1. 更新数据类型重量: int => double
2. 更新数据类型规格: int => String 3. 修复bug: OrderInCheckor打印日志错误的问题
This commit is contained in:
parent
ec6487d87e
commit
e7436bcf46
482
db/wms_ntyc.sql
482
db/wms_ntyc.sql
File diff suppressed because it is too large
Load Diff
|
|
@ -67,5 +67,5 @@ public class GoodsExcelTemplate {
|
|||
* SLED时间(天)
|
||||
*/
|
||||
@Excel(name = "SLED时间(天)")
|
||||
private Integer sledDays;
|
||||
private String sledDays;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,10 @@ public class ErpGoodsDetail {
|
|||
private String goodsName;
|
||||
private String batch;
|
||||
private String goodsType;
|
||||
private Integer specification;
|
||||
private BigDecimal quantity;
|
||||
private String specification;
|
||||
private Double quantity;
|
||||
private String goodsDesc;
|
||||
private String goodsBarcode;
|
||||
private String xsfbillno;
|
||||
private String xsfseq;
|
||||
private String neibubianhao;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class MesDetailTaskInfo {
|
|||
* 线圈数量
|
||||
*/
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity;
|
||||
private Double quantity;
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class GoodsInfoForTask {
|
|||
* 操作数量
|
||||
*/
|
||||
@JsonProperty("opNum")
|
||||
private Integer opNum;
|
||||
private Double opNum;
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ public class OrderInGoodsDetail {
|
|||
private String goodsType;
|
||||
|
||||
@JsonProperty("specification")
|
||||
private Integer specification;
|
||||
private String specification;
|
||||
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity;
|
||||
private Double quantity;
|
||||
|
||||
@JsonProperty("goodsDesc")
|
||||
private String goodsDesc;
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ public class OrderOutRequest {
|
|||
private String batch;
|
||||
|
||||
@JsonProperty("specification")
|
||||
private Integer specification;
|
||||
private String specification;
|
||||
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity;
|
||||
private Double quantity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,13 +21,16 @@ public class OrderInGoodsDetail {
|
|||
private String goodsType;
|
||||
|
||||
@JsonProperty("specification")
|
||||
private Integer specification;
|
||||
private String specification;
|
||||
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity;
|
||||
private Double quantity;
|
||||
|
||||
@JsonProperty("goodsDesc")
|
||||
private String goodsDesc;
|
||||
|
||||
@JsonProperty("goodsBarcode")
|
||||
private String goodsBarcode;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ public class OrderOutReq {
|
|||
private String batch;
|
||||
|
||||
@JsonProperty("specification")
|
||||
private Integer specification;
|
||||
private String specification;
|
||||
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity;
|
||||
private Double quantity;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class StockReq {
|
|||
private String goodsId;
|
||||
|
||||
@JsonProperty("specification")
|
||||
private Integer specification;
|
||||
private String specification;
|
||||
|
||||
|
||||
public boolean empty() {
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ public class StockRespGoodsDetail {
|
|||
private String goodsType;
|
||||
|
||||
@JsonProperty("specification")
|
||||
private Integer specification;
|
||||
private String specification;
|
||||
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity;
|
||||
private Double quantity;
|
||||
|
||||
@JsonProperty("goodsDesc")
|
||||
private String goodsDesc;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class TAppGoods extends BaseImportEntity {
|
|||
* SLED天数
|
||||
*/
|
||||
@TableField(value = "sled_days")
|
||||
private Integer sledDays;
|
||||
private String sledDays;
|
||||
/**
|
||||
* 补料方式
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ public class TAppOrderIn {
|
|||
private String goodsType;
|
||||
|
||||
@TableField(value = "specification")
|
||||
private Integer specification;
|
||||
private String specification;
|
||||
|
||||
@TableField(value = "quantity")
|
||||
private Integer quantity;
|
||||
private Double quantity;
|
||||
|
||||
@TableField(value = "goods_desc")
|
||||
private String goodsDesc;
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ public class TAppOrderOut {
|
|||
private String batch;
|
||||
|
||||
@TableField(value = "specification")
|
||||
private Integer specification;
|
||||
private String specification;
|
||||
|
||||
@TableField(value = "quantity")
|
||||
private Integer quantity;
|
||||
private Double quantity;
|
||||
|
||||
@TableField(value = "order_status")
|
||||
private Integer orderStatus;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class TAppPickPlan {
|
|||
* 计划拣选数量
|
||||
*/
|
||||
@TableField(value = "plan_pick_qty")
|
||||
private Integer planPickQty;
|
||||
private Double planPickQty;
|
||||
/**
|
||||
* 拣选类型
|
||||
* 1. 工作拣选
|
||||
|
|
|
|||
|
|
@ -73,17 +73,17 @@ public class TAppStock {
|
|||
* 入库总量
|
||||
*/
|
||||
@TableField(value = "total_num")
|
||||
private Integer totalNum;
|
||||
private Double totalNum;
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
@TableField(value = "remain_num")
|
||||
private Integer remainNum;
|
||||
private Double remainNum;
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
@TableField(value = "real_num")
|
||||
private Integer realNum;
|
||||
private Double realNum;
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
|
|
@ -98,7 +98,7 @@ public class TAppStock {
|
|||
* sled 天数
|
||||
*/
|
||||
@TableField(value = "sled")
|
||||
private Integer sled;
|
||||
private String sled;
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -41,12 +41,12 @@ public class TAppStockUpdate {
|
|||
* 原数量
|
||||
*/
|
||||
@TableField(value = "before_num")
|
||||
private Integer beforeNum;
|
||||
private Double beforeNum;
|
||||
/**
|
||||
* 新数量
|
||||
*/
|
||||
@TableField(value = "after_num")
|
||||
private Integer afterNum;
|
||||
private Double afterNum;
|
||||
/**
|
||||
* 更新理由
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -77,12 +77,12 @@ public class TAppTask {
|
|||
* 操作数量
|
||||
*/
|
||||
@TableField(value = "op_num")
|
||||
private Integer opNum;
|
||||
private Double opNum;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@TableField(value = "stock_num")
|
||||
private Integer stockNum;
|
||||
private Double stockNum;
|
||||
/**
|
||||
* 操纵用户
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -77,12 +77,12 @@ public class TAppTaskBak {
|
|||
* 操作数量
|
||||
*/
|
||||
@TableField(value = "op_num")
|
||||
private Integer opNum;
|
||||
private Double opNum;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@TableField(value = "stock_num")
|
||||
private Integer stockNum;
|
||||
private Double stockNum;
|
||||
/**
|
||||
* 操纵用户
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -57,17 +57,17 @@ public class StockVo {
|
|||
* 入库总数
|
||||
*/
|
||||
@JsonProperty("totalNum")
|
||||
private Integer totalNum;
|
||||
private Double totalNum;
|
||||
/**
|
||||
* 实际剩余数量
|
||||
*/
|
||||
@JsonProperty("realNum")
|
||||
private Integer realNum;
|
||||
private Double realNum;
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
@JsonProperty("remainNum")
|
||||
private Integer remainNum;
|
||||
private Double remainNum;
|
||||
/**
|
||||
* 有效期
|
||||
*/
|
||||
|
|
@ -79,7 +79,7 @@ public class StockVo {
|
|||
* sled
|
||||
*/
|
||||
@JsonProperty("sled")
|
||||
private Integer sled;
|
||||
private String sled;
|
||||
/**
|
||||
* 初次入库时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.wms_main.model.bo.erp.ErpVehicleNoResp;
|
|||
import com.wms_main.model.bo.ycwms.YCWmsApiResponse;
|
||||
import com.wms_main.model.dto.request.ycwms.OrderInCBReq;
|
||||
import com.wms_main.model.dto.request.ycwms.OrderOutCBReq;
|
||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
||||
|
||||
public interface IExternalApiService {
|
||||
|
|
|
|||
|
|
@ -68,12 +68,13 @@ public class ExternalApiServiceImpl implements IExternalApiService {
|
|||
goodsDetail.setGoodsName((String) detail.get("goodsName"));
|
||||
goodsDetail.setBatch((String) detail.get("batch"));
|
||||
goodsDetail.setGoodsType((String) detail.get("goodsType"));
|
||||
goodsDetail.setSpecification(Integer.parseInt(detail.get("specification").toString()));
|
||||
goodsDetail.setQuantity(new java.math.BigDecimal(detail.get("quantity").toString()));
|
||||
goodsDetail.setSpecification((String) (detail.get("specification")));
|
||||
goodsDetail.setQuantity(Double.parseDouble(detail.get("quantity").toString()));
|
||||
goodsDetail.setGoodsDesc((String) detail.get("goodsDesc"));
|
||||
goodsDetail.setXsfbillno((String) detail.get("xsfbillno"));
|
||||
goodsDetail.setXsfseq((String) detail.get("xsfseq"));
|
||||
goodsDetail.setNeibubianhao((String) detail.get("neibubianhao"));
|
||||
goodsDetail.setGoodsBarcode((String) detail.get("goodsBarcode"));
|
||||
erpsGoodsDetails.add(goodsDetail);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,6 @@ public interface IStockDataService {
|
|||
* @param goodsIds 物料列表
|
||||
* @return 结果map
|
||||
*/
|
||||
Map<String, Map<String, Integer>> getCanPutGoodsMap(List<String> goodsIds);
|
||||
Map<String, Map<String, Double>> getCanPutGoodsMap(List<String> goodsIds);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -541,13 +541,13 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
|||
.filter(stock -> Objects.equals(stock.getGoodsId(), thisVehicleInTask.getGoodsId()))
|
||||
.toList();
|
||||
TAppGoods thisGoods = appCommon.getInstantGoodsByGoodsId(thisVehicleInTask.getGoodsId());
|
||||
Integer sledDays = null;// -1表示非有效期管理
|
||||
String sledDays = null;// -1表示非有效期管理
|
||||
LocalDate expireDate = null;// null表示非有效期管理
|
||||
if (thisGoods != null && Objects.equals(thisGoods.getPutArea(), "ASRS") && thisGoods.getIsSled().contains("Y")) {
|
||||
// 有效期管理的物料
|
||||
if (thisGoods.getSledDays() != null) {
|
||||
sledDays = thisGoods.getSledDays();
|
||||
expireDate = thisVehicleInTask.getCreateTime().plusDays(sledDays).toLocalDate();
|
||||
expireDate = LocalDate.now();
|
||||
}
|
||||
}
|
||||
if (oldStockList.isEmpty()) {
|
||||
|
|
@ -578,11 +578,11 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
|||
// 更新已有库存信息
|
||||
if (oldStockList.size() > 1) {
|
||||
// 需要合并库存信息
|
||||
int originSum = oldStockList.stream()
|
||||
.mapToInt(TAppStock::getRealNum)
|
||||
Double originSum = oldStockList.stream()
|
||||
.mapToDouble(TAppStock::getRealNum)
|
||||
.sum();
|
||||
int originTotal = oldStockList.stream()
|
||||
.mapToInt(TAppStock::getTotalNum)
|
||||
Double originTotal = oldStockList.stream()
|
||||
.mapToDouble(TAppStock::getTotalNum)
|
||||
.sum();
|
||||
// 新库存,增加库存信息
|
||||
newStockList.add(new TAppStock(
|
||||
|
|
@ -729,17 +729,17 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
|
|||
// 获取订单的商品属性
|
||||
String goodsId = order.getGoodsId();
|
||||
String batch = order.getBatch();
|
||||
int specification = order.getSpecification();
|
||||
String specification = order.getSpecification();
|
||||
|
||||
// 筛选匹配的库存并计算总数量
|
||||
int totalQty = appStockService.list(new LambdaQueryWrapper<TAppStock>().eq(TAppStock::getVehicleId, vehicleId)).stream()
|
||||
Double totalQty = appStockService.list(new LambdaQueryWrapper<TAppStock>().eq(TAppStock::getVehicleId, vehicleId)).stream()
|
||||
.filter(stock ->
|
||||
goodsId.equals(stock.getGoodsId()) && batch.equals(stock.getBatch()) && specification == stock.getSled())
|
||||
.mapToInt(TAppStock::getTotalNum)
|
||||
goodsId.equals(stock.getGoodsId()) && batch.equals(stock.getBatch()) && specification.equals(stock.getSled()))
|
||||
.mapToDouble(TAppStock::getTotalNum)
|
||||
.sum();
|
||||
|
||||
if (totalQty > 0) {
|
||||
int newQuantity = order.getQuantity() - totalQty;
|
||||
Double newQuantity = order.getQuantity() - totalQty;
|
||||
// 更新订单数量
|
||||
appOrderOutService.update(
|
||||
new LambdaUpdateWrapper<TAppOrderOut>()
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
|||
// 库存更新记录列表
|
||||
List<TAppStockUpdate> stockUpdateList = new ArrayList<>();
|
||||
// 剩余数量
|
||||
int remainQty = stockConfirm.getPlanRemainQty();
|
||||
Double remainQty = Double.valueOf(stockConfirm.getPlanRemainQty());
|
||||
for (TAppStock stock : stockList) {
|
||||
if (remainQty <= 0) {
|
||||
removeStocks.add(stock);
|
||||
|
|
@ -78,7 +78,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
|||
);
|
||||
stockUpdateList.add(stockUpdate);
|
||||
stock.setRealNum(remainQty);
|
||||
remainQty = 0;
|
||||
remainQty = 0.0;
|
||||
}
|
||||
updateStocks.add(stock);
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
|||
* @return 结果map
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Map<String, Integer>> getCanPutGoodsMap(List<String> goodsIds) {
|
||||
public Map<String, Map<String, Double>> getCanPutGoodsMap(List<String> goodsIds) {
|
||||
// 筛选出料号,查询库存
|
||||
if (goodsIds == null || goodsIds.isEmpty()) {
|
||||
return new HashMap<>();
|
||||
|
|
@ -175,10 +175,10 @@ public class StockDataServiceImpl implements IStockDataService {
|
|||
.in(TAppStock::getGoodsId, distinctGoodsIds)
|
||||
.orderByAsc(TAppStock::getFirstInTime));
|
||||
// 根据载具号合并数量----因为这个项目默认一箱一料
|
||||
Map<String, Map<String, Integer>> goodsQtyMap = new HashMap<>();
|
||||
Map<String, Map<String, Double>> goodsQtyMap = new HashMap<>();
|
||||
for (TAppStock stock : stocksOfThisGoodsIds) {
|
||||
if (goodsQtyMap.containsKey(stock.getGoodsId())) {
|
||||
Map<String, Integer> qtyByVehicleMap = goodsQtyMap.get(stock.getGoodsId());
|
||||
Map<String, Double> qtyByVehicleMap = goodsQtyMap.get(stock.getGoodsId());
|
||||
if (qtyByVehicleMap.containsKey(stock.getVehicleId())) {
|
||||
qtyByVehicleMap.replace(stock.getVehicleId(), qtyByVehicleMap.get(stock.getVehicleId()) + stock.getRemainNum());
|
||||
} else {
|
||||
|
|
@ -186,7 +186,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
|||
}
|
||||
goodsQtyMap.replace(stock.getGoodsId(), qtyByVehicleMap);
|
||||
} else {
|
||||
Map<String, Integer> qtyByVehicleMap = new HashMap<>();
|
||||
Map<String, Double> qtyByVehicleMap = new HashMap<>();
|
||||
qtyByVehicleMap.put(stock.getVehicleId(), stock.getRemainNum());
|
||||
goodsQtyMap.put(stock.getGoodsId(), qtyByVehicleMap);
|
||||
}
|
||||
|
|
@ -200,7 +200,7 @@ public class StockDataServiceImpl implements IStockDataService {
|
|||
continue;
|
||||
}
|
||||
// 根据数量过滤
|
||||
Map<String, Integer> qtyByVehicleMap = goodsQtyMap.get(goodsId);
|
||||
Map<String, Double> qtyByVehicleMap = goodsQtyMap.get(goodsId);
|
||||
List<String> vehicleIdsOfThisGoods = new ArrayList<>(qtyByVehicleMap.keySet());
|
||||
for (String vehicleId : vehicleIdsOfThisGoods) {
|
||||
if (qtyByVehicleMap.get(vehicleId) > (thisGoods.getMaxBoxNum() - 1) * thisGoods.getBoxQty()) {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class MesControllerServiceImpl implements IMesControllerService {
|
|||
null,
|
||||
mesDetailTaskInfo.getGoodsId(),
|
||||
mesDetailTaskInfo.getQuantity(),
|
||||
0,
|
||||
0.0,
|
||||
"mes",
|
||||
"",
|
||||
mesInTaskRequest.getStandId(),
|
||||
|
|
@ -134,7 +134,7 @@ public class MesControllerServiceImpl implements IMesControllerService {
|
|||
null,
|
||||
mesDetailTaskInfo.getGoodsId(),
|
||||
mesDetailTaskInfo.getQuantity(),
|
||||
0,
|
||||
0.0,
|
||||
"mes",
|
||||
"",
|
||||
mesOutTaskRequest.getStandId(),
|
||||
|
|
|
|||
|
|
@ -122,8 +122,8 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
LocalDateTime.now(),
|
||||
null,
|
||||
AppConstant.EMPTY_GOODS_ID,
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0.0,
|
||||
stockInRequest.getUserName(),
|
||||
"",
|
||||
stockInRequest.getStandId(),
|
||||
|
|
@ -178,7 +178,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
null,
|
||||
goodsInfoForTask.getGoodsId(),
|
||||
goodsInfoForTask.getOpNum(),
|
||||
0,
|
||||
0.0,
|
||||
stockInRequest.getUserName(),
|
||||
goodsInfoForTask.getRemark(),
|
||||
stockInRequest.getStandId(),
|
||||
|
|
@ -195,12 +195,12 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
// 判断数量是否超载
|
||||
TAppGoods thisGoods = goodsMap.get(goodsInfoForTask.getGoodsId());
|
||||
int maxQty1Vehicle = thisGoods.getBoxQty() * thisGoods.getMaxBoxNum();
|
||||
int oldStockNum = 0;
|
||||
Double oldStockNum = 0.0;
|
||||
if (thisVehicleStocks != null && !thisVehicleStocks.isEmpty()) {
|
||||
// 计算出该物料的库存数量
|
||||
oldStockNum = thisVehicleStocks.stream()
|
||||
.filter(stock -> stock.getGoodsId().equals(goodsInfoForTask.getGoodsId()))
|
||||
.mapToInt(TAppStock::getRealNum)
|
||||
.mapToDouble(TAppStock::getRealNum)
|
||||
.sum();
|
||||
}
|
||||
if (goodsIdTaskMap.get(goodsInfoForTask.getGoodsId()).getOpNum() + oldStockNum > maxQty1Vehicle) {
|
||||
|
|
@ -282,10 +282,13 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
.eq(TAppStock::getGoodsId, stockOutRequest.getGoodsId())
|
||||
.gt(TAppStock::getRemainNum, 0));
|
||||
// 生成物料数量map
|
||||
Map<String, Integer> stockByGoodsMap = new HashMap<>();
|
||||
Map<String, Double> stockByGoodsMap = new HashMap<>();
|
||||
for (TAppStock stock : stockList) {
|
||||
if (stockByGoodsMap.containsKey(stock.getGoodsId())) {
|
||||
stockByGoodsMap.replace(stock.getGoodsId(), stockByGoodsMap.get(stock.getGoodsId()) + stock.getRemainNum());
|
||||
stockByGoodsMap.replace(
|
||||
stock.getGoodsId(),
|
||||
stockByGoodsMap.get(stock.getGoodsId()) + stock.getRemainNum()
|
||||
);
|
||||
} else {
|
||||
stockByGoodsMap.put(stock.getGoodsId(), stock.getRemainNum());
|
||||
}
|
||||
|
|
@ -293,7 +296,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
if (!stockByGoodsMap.containsKey(stockOutRequest.getGoodsId())) {
|
||||
return BaseWmsApiResponse.error("请求错误:库内无该料库存。");
|
||||
}
|
||||
if (stockByGoodsMap.get(stockOutRequest.getGoodsId()) < stockOutRequest.getNeedNum()) {
|
||||
if (stockOutRequest.getNeedNum() == null || stockOutRequest.getNeedNum().compareTo(0) <= 0) {
|
||||
return BaseWmsApiResponse.error("请求错误:库内该料库存不足,库内数量:" + stockByGoodsMap.get(stockOutRequest.getGoodsId()) + ",需求数量: " + stockOutRequest.getNeedNum() + "。");
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ public class WcsControllerServiceImpl implements IWcsControllerService {
|
|||
orderIn.setGoodsName("空托盘");
|
||||
orderIn.setBatch("0");
|
||||
orderIn.setGoodsType("0");
|
||||
orderIn.setSpecification(0);
|
||||
orderIn.setQuantity(1);
|
||||
orderIn.setSpecification("");
|
||||
orderIn.setQuantity(1.0);
|
||||
orderIn.setGoodsDesc("");
|
||||
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
||||
orderIn.setCreateTime(LocalDateTime.now());
|
||||
|
|
@ -131,8 +131,8 @@ public class WcsControllerServiceImpl implements IWcsControllerService {
|
|||
orderIn.setGoodsName("空托盘");
|
||||
orderIn.setBatch("0");
|
||||
orderIn.setGoodsType("0");
|
||||
orderIn.setSpecification(0);
|
||||
orderIn.setQuantity(1);
|
||||
orderIn.setSpecification("");
|
||||
orderIn.setQuantity(1.0);
|
||||
orderIn.setGoodsDesc("");
|
||||
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
||||
orderIn.setCreateTime(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService {
|
|||
public YcwmsResponse<Object> orderIn(OrderInReq request) {
|
||||
log.info("入库单请求参数{}", JSON.toJSON(request));
|
||||
if(request == null) return YcwmsResponse.error("参数错误", null);
|
||||
if(StringUtils.isEmpty(request.getOrderId()) || StringUtils.isEmpty(request.getClientId())
|
||||
if(StringUtils.isEmpty(request.getOrderId())
|
||||
|| StringUtils.isEmpty(request.getVehicleNo()) || StringUtils.isEmpty(request.getVehicleSize())
|
||||
|| StringUtils.isEmpty(request.getInStand()) || request.getGoodsDetail() == null || request.getGoodsDetail().isEmpty()) {
|
||||
return YcwmsResponse.error("参数错误", null);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.wms_main.model.bo.erp.ErpVehicleNoResp;
|
|||
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
||||
import com.wms_main.model.po.TAppOrderIn;
|
||||
import com.wms_main.model.po.TAppWcsTask;
|
||||
import com.wms_main.repository.utils.StringUtils;
|
||||
import com.wms_main.service.api.IExternalApiService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -58,6 +59,9 @@ public class OrderInCheckor implements Job {
|
|||
log.error("处理载具[{}]数据时发生异常:", vehicleNo, e);
|
||||
}
|
||||
List<TAppOrderIn> inTasks = vehicleIdToTaskMap.get(vehicleNo);
|
||||
if (inTasks.stream().anyMatch(task -> StringUtils.isEmpty(task.getClientId()))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 对比inTasks和goodsDetails
|
||||
Iterator<ErpGoodsDetail> iterator = goodsDetails.iterator();
|
||||
|
|
@ -65,7 +69,7 @@ public class OrderInCheckor implements Job {
|
|||
ErpGoodsDetail goodsDetail = iterator.next();
|
||||
boolean matchFound = inTasks.stream().anyMatch(task ->
|
||||
task.getGoodsId().equals(goodsDetail.getGoodsId()) &&
|
||||
task.getBatch().equals(goodsDetail.getBatch()) &&
|
||||
Objects.equals(task.getQuantity(), goodsDetail.getQuantity()) &&
|
||||
task.getGoodsType().equals(goodsDetail.getGoodsType()) &&
|
||||
Objects.equals(task.getSpecification(), goodsDetail.getSpecification())
|
||||
);
|
||||
|
|
@ -80,7 +84,7 @@ public class OrderInCheckor implements Job {
|
|||
wcsTaskService.remove(new LambdaUpdateWrapper<TAppWcsTask>()
|
||||
.eq(TAppWcsTask::getVehicleId, vehicleNo));
|
||||
} else {
|
||||
log.error("MES校验入库单失败, 载具[{}]", vehicleNo);
|
||||
log.info("MES校验入库单成功, 载具[{}]", vehicleNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class OutsExecutor implements Job {
|
|||
return;
|
||||
}
|
||||
for(TAppOrderOut orderOut : orderOutsList) {
|
||||
Integer needQuantity = orderOut.getQuantity();
|
||||
Double needQuantity = orderOut.getQuantity();
|
||||
if(needQuantity == null || needQuantity < 1 ) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -95,8 +95,8 @@ public class OutsExecutor implements Job {
|
|||
needQuantity -= stockItem.getRemainNum();
|
||||
}
|
||||
stockItem.setStockStatus(WmsStockStatusEnums.OUTING.getCode());
|
||||
stockItem.setRemainNum(0);
|
||||
stockItem.setRealNum(0);
|
||||
stockItem.setRemainNum(0.0);
|
||||
stockItem.setRealNum(0.0);
|
||||
outStockList.add(stockItem);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,8 +174,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
LocalDateTime.now(),
|
||||
null,
|
||||
AppConstant.EMPTY_GOODS_ID,
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0.0,
|
||||
appOuts.getUserName(),
|
||||
"",
|
||||
appOuts.getDestination(),
|
||||
|
|
@ -209,7 +209,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
return;
|
||||
}
|
||||
// 根据箱号+料号 map一下数量
|
||||
Map<String, Integer> goodsNumMap = new HashMap<>();
|
||||
Map<String, Double> goodsNumMap = new HashMap<>();
|
||||
for (TAppStock stock : allStocks) {
|
||||
String key = stock.getVehicleId() + "_" + stock.getGoodsId();
|
||||
if (goodsNumMap.containsKey(key)) {
|
||||
|
|
@ -243,7 +243,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
continue;
|
||||
}
|
||||
String key = stock.getVehicleId() + "_" + stock.getGoodsId();
|
||||
int stockNum = goodsNumMap.getOrDefault(key, appGoods.getBoxQty() * appGoods.getMaxBoxNum());
|
||||
Double stockNum = goodsNumMap.getOrDefault(key, Double.valueOf(appGoods.getBoxQty() * appGoods.getMaxBoxNum()));
|
||||
// 判断是否还能够入库用
|
||||
if (stockNum <= (appGoods.getMaxBoxNum() - 1) * appGoods.getBoxQty()) {
|
||||
// 已有的拣选任务
|
||||
|
|
@ -283,8 +283,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
LocalDateTime.now(),
|
||||
null,
|
||||
AppConstant.EMPTY_GOODS_ID,
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0.0,
|
||||
appOuts.getUserName(),
|
||||
"",
|
||||
appOuts.getDestination(),
|
||||
|
|
@ -346,15 +346,15 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
continue;
|
||||
}
|
||||
// 判断当前的这条库存,当前站台是否需要
|
||||
int originNum = stock.getRemainNum();
|
||||
int remainNum = stock.getRemainNum();
|
||||
Double originNum = stock.getRemainNum();
|
||||
Double remainNum = stock.getRemainNum();
|
||||
int needNum = appOuts.getNeedNum() - appOuts.getDistributeNum();
|
||||
if (needNum < remainNum) {
|
||||
appOuts.setDistributeNum(appOuts.getNeedNum());
|
||||
remainNum = remainNum - needNum;
|
||||
} else {
|
||||
appOuts.setDistributeNum(appOuts.getDistributeNum() + remainNum);
|
||||
remainNum = 0;
|
||||
appOuts.setDistributeNum((int) (appOuts.getDistributeNum() + remainNum));
|
||||
remainNum = 0.0;
|
||||
}
|
||||
if (remainNum == originNum) {
|
||||
// 没用到这条库存
|
||||
|
|
@ -390,8 +390,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
LocalDateTime.now(),
|
||||
null,
|
||||
AppConstant.EMPTY_GOODS_ID,
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0.0,
|
||||
appOuts.getUserName(),
|
||||
"",
|
||||
appOuts.getDestination(),
|
||||
|
|
@ -559,8 +559,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
continue;
|
||||
}
|
||||
// 判断当前的这条库存,当前站台是否需要
|
||||
int originRemainNum = stock.getRemainNum();
|
||||
int remainNum = stock.getRemainNum();
|
||||
Double originRemainNum = stock.getRemainNum();
|
||||
Double remainNum = stock.getRemainNum();
|
||||
for (TAppWork thisWork : works) {
|
||||
if (!Objects.equals(thisWork.getGoodsId(), stock.getGoodsId())) {
|
||||
// 不是这个料
|
||||
|
|
@ -570,20 +570,20 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
break;
|
||||
}
|
||||
// 需求数量
|
||||
int remainNeedNum = thisWork.getNeedNum() - thisWork.getDistributeNum();
|
||||
Double remainNeedNum = (double) (thisWork.getNeedNum() - thisWork.getDistributeNum());
|
||||
if (remainNeedNum <= 0) {
|
||||
// 不需要分配
|
||||
continue;
|
||||
}
|
||||
int thisTimePickNum;
|
||||
Double thisTimePickNum;
|
||||
if (remainNeedNum < remainNum) {
|
||||
thisTimePickNum = remainNeedNum;
|
||||
thisWork.setDistributeNum(thisWork.getNeedNum());
|
||||
remainNum = remainNum - thisTimePickNum;
|
||||
} else {
|
||||
thisTimePickNum = remainNum;
|
||||
thisWork.setDistributeNum(thisWork.getDistributeNum() + thisTimePickNum);
|
||||
remainNum = 0;
|
||||
thisWork.setDistributeNum((int) (thisWork.getDistributeNum() + thisTimePickNum));
|
||||
remainNum = 0.0;
|
||||
}
|
||||
thisWork.setWorkStatus(1);// 正在做
|
||||
// 生成拣选计划
|
||||
|
|
@ -621,8 +621,8 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
LocalDateTime.now(),
|
||||
null,
|
||||
AppConstant.EMPTY_GOODS_ID,
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0.0,
|
||||
"wms_auto",
|
||||
"",
|
||||
stand.getStandId(),
|
||||
|
|
@ -873,7 +873,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
// 筛选出料号
|
||||
List<String> distinctGoodsIdList = inOuts.stream().map(TAppOuts::getGoodsId).distinct().toList();
|
||||
// 获取数据map
|
||||
Map<String, Map<String, Integer>> goodsQtyMap = stockDataService.getCanPutGoodsMap(distinctGoodsIdList);
|
||||
Map<String, Map<String, Double>> goodsQtyMap = stockDataService.getCanPutGoodsMap(distinctGoodsIdList);
|
||||
for (TAppOuts inOut : inOuts) {
|
||||
int needNum = inOut.getNeedNum() - inOut.getDistributeNum();
|
||||
if (needNum <= 0) {
|
||||
|
|
@ -885,7 +885,7 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
continue;
|
||||
}
|
||||
// 判断数量够不够
|
||||
Map<String, Integer> goodsQtyMapByGoodsId = goodsQtyMap.get(inOut.getGoodsId());
|
||||
Map<String, Double> goodsQtyMapByGoodsId = goodsQtyMap.get(inOut.getGoodsId());
|
||||
if (goodsQtyMapByGoodsId.isEmpty()) {
|
||||
goodsQtyMap.remove(inOut.getGoodsId());
|
||||
addRemovingOutsAndRecord(needRemoveOutIds, inOut, needAddOutRecords);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,19 @@
|
|||
import request from "@/http/request";
|
||||
import axios from "axios";
|
||||
|
||||
/**
|
||||
* 提交入库单
|
||||
*/
|
||||
|
||||
const _request = axios.create({
|
||||
// baseURL: 'http://10.18.58.20:12315/wms',
|
||||
baseURL: 'http://10.18.58.20:12315',
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
const submitOrderInForm = (params) => {
|
||||
return request({
|
||||
url: '/order/orderIn',
|
||||
return _request({
|
||||
url: '/ycwms/orderIn',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,11 +1,19 @@
|
|||
import request from "@/http/request";
|
||||
import axios from "axios";
|
||||
|
||||
/**
|
||||
* 提交入库单
|
||||
*/
|
||||
|
||||
const _request = axios.create({
|
||||
// baseURL: 'http://10.18.58.20:12315/wms',
|
||||
baseURL: 'http://10.18.58.20:12315',
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
const submitOrderOutForm = (params) => {
|
||||
return request({
|
||||
url: '/order/orderOut',
|
||||
return _request({
|
||||
url: '/ycwms/orderOut',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
|
|
|
|||
|
|
@ -7,6 +7,12 @@
|
|||
<el-form ref="orderInFormRef" :model="orderInForm" :rules="rules" label-width="100px"
|
||||
:label-position="labelPosition" status-icon>
|
||||
<el-row :gutter="20">
|
||||
<el-col :xs="24" :sm="12" :md="6" :lg="5">
|
||||
<el-form-item label="订单号" prop="orderId">
|
||||
<el-input v-model="orderInForm.orderId" clearable @keyup.enter="handleEnter('vehicleNo')"
|
||||
ref="orderIdRef"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="6" :lg="5">
|
||||
<el-form-item label="料箱号" prop="vehicleNo">
|
||||
<el-input v-model="orderInForm.vehicleNo" clearable @keyup.enter="handleEnter('vehicleSize')"
|
||||
|
|
@ -298,9 +304,11 @@ import {submitOrderInForm, getOrderIns, updateOrderIn} from '@/api/orderIn.js'
|
|||
// 表单数据
|
||||
const orderInFormRef = ref()
|
||||
const orderInForm = reactive({
|
||||
orderId: '',
|
||||
vehicleNo: '',
|
||||
vehicleSize: '',
|
||||
inStand: '',
|
||||
clientId: 'YaChi',
|
||||
goodsDetail: []
|
||||
})
|
||||
|
||||
|
|
@ -325,12 +333,14 @@ const queryForm = reactive({
|
|||
|
||||
// 表单规则
|
||||
const rules = reactive({
|
||||
orderId: [{required: true, message: '请输入订单号', trigger: 'blur'}],
|
||||
vehicleNo: [{required: true, message: '请输入料箱号', trigger: 'blur'}],
|
||||
vehicleSize: [{required: true, message: '请输入料箱尺寸', trigger: 'blur'}],
|
||||
inStand: [{required: true, message: '请输入入库站台', trigger: 'blur'}],
|
||||
})
|
||||
|
||||
// 引用DOM元素
|
||||
const orderIdRef = ref()
|
||||
const vehicleNoRef = ref()
|
||||
const vehicleSizeRef = ref()
|
||||
const inStandRef = ref()
|
||||
|
|
@ -350,7 +360,7 @@ const currentOrderIn = ref(null)
|
|||
// 初始化时聚焦第一个输入框
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
vehicleNoRef.value.focus()
|
||||
orderIdRef.value.focus()
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -6,22 +6,27 @@
|
|||
<legend>出库单信息</legend>
|
||||
<el-form ref="orderOutFormRef" :model="orderOutForm" :rules="rules" label-width="70px" :label-position="labelPosition" status-icon>
|
||||
<el-row :gutter="5" class="form-row">
|
||||
<el-col :xs="24" :sm="5" :md="5" :lg="5">
|
||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||
<el-form-item label="订单号" prop="orderId">
|
||||
<el-input v-model="orderOutForm.orderId" clearable @keyup.enter="handleEnter('goodsId')" ref="orderIdRef" class="custom-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||
<el-form-item label="物料编号" prop="goodsId">
|
||||
<el-input v-model="orderOutForm.goodsId" clearable @keyup.enter="handleEnter('batch')" ref="goodsIdRef" class="custom-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="5" :md="5" :lg="5">
|
||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||
<el-form-item label="批次" prop="batch">
|
||||
<el-input v-model="orderOutForm.batch" clearable @keyup.enter="handleEnter('specification')" ref="batchRef" class="custom-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="5" :md="5" :lg="5">
|
||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||
<el-form-item label="规格" prop="specification">
|
||||
<el-input-number v-model="orderOutForm.specification" :min="1" controls-position="right" clearable @keyup.enter="handleEnter('quantity')" ref="specificationRef" class="custom-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="5" :md="5" :lg="5">
|
||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input-number v-model="orderOutForm.quantity" :min="1" controls-position="right" clearable ref="quantityRef" class="custom-input" />
|
||||
</el-form-item>
|
||||
|
|
@ -59,6 +64,7 @@ import { submitOrderOutForm } from '@/api/orderOut.js'
|
|||
// 表单数据
|
||||
const orderOutFormRef = ref()
|
||||
const orderOutForm = reactive({
|
||||
orderId: '',
|
||||
goodsId: '',
|
||||
batch: '',
|
||||
specification: null,
|
||||
|
|
@ -67,6 +73,7 @@ const orderOutForm = reactive({
|
|||
|
||||
// 表单规则
|
||||
const rules = reactive({
|
||||
orderId: [{ required: true, message: '请输入订单号', trigger: 'blur' }],
|
||||
goodsId: [{ required: true, message: '请输入物料编号', trigger: 'blur' }],
|
||||
batch: [{ required: true, message: '请输入批次', trigger: 'blur' }],
|
||||
specification: [{ required: true, message: '请输入规格', trigger: 'blur' }],
|
||||
|
|
@ -74,6 +81,7 @@ const rules = reactive({
|
|||
})
|
||||
|
||||
// 引用DOM元素
|
||||
const orderIdRef = ref()
|
||||
const goodsIdRef = ref()
|
||||
const batchRef = ref()
|
||||
const specificationRef = ref()
|
||||
|
|
@ -86,7 +94,7 @@ const responseResult = ref({})
|
|||
// 初始化时聚焦第一个输入框
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
goodsIdRef.value.focus()
|
||||
orderIdRef.value.focus()
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
|
|
@ -103,6 +111,7 @@ const resizeHeight = () => {
|
|||
// 处理回车事件
|
||||
const handleEnter = (nextField) => {
|
||||
const refMap = {
|
||||
'goodsId': goodsIdRef,
|
||||
'batch': batchRef,
|
||||
'specification': specificationRef,
|
||||
'quantity': quantityRef
|
||||
|
|
@ -117,7 +126,7 @@ const handleEnter = (nextField) => {
|
|||
const resetForm = () => {
|
||||
orderOutFormRef.value.resetFields()
|
||||
nextTick(() => {
|
||||
goodsIdRef.value.focus()
|
||||
orderIdRef.value.focus()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user