|
@@ -98,14 +98,19 @@ public class WmsDocOrderSubService {
|
|
|
|
|
|
|
|
|
boolean con = true;
|
|
|
+ //机械手应拆袋数
|
|
|
+ int allocateQuantities = 0;
|
|
|
+ //出库单对应袋数
|
|
|
+ int orderNum = list.get(0).getQtyOrderedEach().intValue();
|
|
|
for (BaseLocationLotattVO baseLocationLotattVO1 : baseLocationLotattVOS1) {
|
|
|
|
|
|
+
|
|
|
BaseSku baseSku = iBaseSkuService.selectBaseSkuByCustomerId(Constant.CUSTOMER_ID, list.get(0).getSku());
|
|
|
|
|
|
String pallentNo = baseLocationLotattVO1.getLotattVO().getLotatt07();
|
|
|
String locationFrom = baseLocationLotattVO1.getLocationNo();
|
|
|
String wcsNo = "wcs" + wcsTaskSubService.generateTaskNo();//生成唯一标识wcsno
|
|
|
-
|
|
|
+ Float qty = baseLocationLotattVO1.getQty();
|
|
|
//Wcs x y z
|
|
|
String Y = baseLocationLotattVO1.getRowNo();
|
|
|
String Z = baseLocationLotattVO1.getShiftNo();
|
|
@@ -123,12 +128,19 @@ public class WmsDocOrderSubService {
|
|
|
outTaskForm.setFloor(Integer.parseInt(Z));
|
|
|
outTaskForm.setPackageType(Integer.valueOf(baseSku.getSkuType()));
|
|
|
outTaskForm.setMaterial(Integer.valueOf(baseSku.getDesc2()));
|
|
|
- outTaskForm.setTotal(list.get(0).getQtyOrderedEach().intValue());
|
|
|
+ outTaskForm.setTotal(qty.intValue());
|
|
|
outTaskForm.setDocNo(orderNo);
|
|
|
List<OutTaskForm.Dest> dests = new ArrayList<>();
|
|
|
OutTaskForm.Dest dest = new OutTaskForm.Dest();
|
|
|
dest.setDest(Integer.parseInt(wmsDocOrderHeader.getSoReference3()));
|
|
|
- dest.setNum(list.get(0).getQtyOrdered().intValue());
|
|
|
+ if (orderNum <= qty.intValue()) {
|
|
|
+ allocateQuantities = list.get(0).getQtyOrdered().intValue();
|
|
|
+ dest.setNum(allocateQuantities);
|
|
|
+ } else if (orderNum > qty.intValue()) {
|
|
|
+ allocateQuantities = qty.intValue();
|
|
|
+ orderNum = list.get(0).getQtyOrdered().intValue()-qty.intValue();
|
|
|
+ dest.setNum(allocateQuantities);
|
|
|
+ }
|
|
|
dests.add(dest);
|
|
|
outTaskForm.setDests(dests);
|
|
|
WcsResponseVo wcsResponseVo = wmsToWcsApiService.wmsOutTask(outTaskForm);
|
|
@@ -138,6 +150,7 @@ public class WmsDocOrderSubService {
|
|
|
iWmsDocOrderHeaderService.updateWmsDocOrderHeader(wmsDocOrderHeader);
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
if (con == true) {
|
|
|
// 修改 明细行状态为10
|
|
@@ -222,7 +235,7 @@ public class WmsDocOrderSubService {
|
|
|
}
|
|
|
//库存数量
|
|
|
String sku = baseLocationLotattVO1.getSku();
|
|
|
- BigDecimal qty =new BigDecimal(baseLocationLotattVO1.getQty());
|
|
|
+ BigDecimal qty = new BigDecimal(baseLocationLotattVO1.getQty());
|
|
|
|
|
|
if (!sku.equals(sku1)) {
|
|
|
continue;
|
|
@@ -235,7 +248,7 @@ public class WmsDocOrderSubService {
|
|
|
baseLocationLotattVOS1.add(baseLocationLotattVO1);
|
|
|
return baseLocationLotattVOS1;
|
|
|
} else if (i < 0) {
|
|
|
- qtyAllocatedEach= qtyAllocatedEach.subtract(qty);
|
|
|
+ qtyAllocatedEach = qtyAllocatedEach.subtract(qty);
|
|
|
baseLocationLotattVOS1.add(baseLocationLotattVO1);
|
|
|
}
|
|
|
}
|
|
@@ -289,8 +302,18 @@ public class WmsDocOrderSubService {
|
|
|
wmsDocOrderHeader.setOrderStatus(Constant.ORDER_STS.STS00.getValue());
|
|
|
wmsDocOrderHeader.setCreateTime(new Date());
|
|
|
wmsDocOrderHeader.setOrderType(Constant.ORDER_TYP.DZ.getValue());
|
|
|
+ if (sku.equals("Na2CO3")) {
|
|
|
+ wmsDocOrderHeader.setSoReference3("1");
|
|
|
+ } else if (sku.equals("C5H10OS2")) {
|
|
|
+ wmsDocOrderHeader.setSoReference3("2");
|
|
|
+ } else if (sku.equals("(NaPO3)6")) {
|
|
|
+ wmsDocOrderHeader.setSoReference3("3");
|
|
|
+ } else if (sku.equals("(NH4)2SO4")) {
|
|
|
+ wmsDocOrderHeader.setSoReference3("4");
|
|
|
+ } else if (sku.equals("CH3CH2OCS2Na")) {
|
|
|
+ wmsDocOrderHeader.setSoReference3("5");
|
|
|
+ }
|
|
|
wmsDocOrderHeaderMapper.insertWmsDocOrderHeader(wmsDocOrderHeader);
|
|
|
-
|
|
|
//生成明细
|
|
|
WmsDocOrderDetails wmsDocOrderDetails = new WmsDocOrderDetails();
|
|
|
wmsDocOrderDetails.setOrderNo(orderNo);
|