|
@@ -590,6 +590,19 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
|
|
|
CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.snCheck(sn);
|
|
|
WmsDocOrderHeader docOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
|
+ if (docOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS40.getValue())) {
|
|
|
+ return AjaxResult.error("已经全部分拣完成!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (docOrderHeader.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())
|
|
|
+ && !docOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS23.getValue())
|
|
|
+ && !docOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS30.getValue())) {
|
|
|
+ return AjaxResult.error("没有备货完成不能分拣出库!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (docOrderHeader.getOrderType().equals(Constant.ORDER_TYP.LH.getValue())) {
|
|
|
+ return AjaxResult.error("库内理货单不能分拣出库!");
|
|
|
+ }
|
|
|
|
|
|
List<ActAllocationDetailsFrom> actAllocationDetailsFromList = new ArrayList<>();
|
|
|
ActAllocationDetailsFrom actAllocationQuery = new ActAllocationDetailsFrom();
|
|
@@ -632,21 +645,15 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
if (endActAllocation == null) {
|
|
|
return AjaxResult.error("没有可以拣货的分配明细!");
|
|
|
}
|
|
|
-
|
|
|
- ActAllocationDetails allocationUpdate = new ActAllocationDetails();
|
|
|
- allocationUpdate.setAllocationId(endActAllocation.getAllocationId());
|
|
|
- allocationUpdate.setPickQty(endActAllocation.getPickQty().add(qty));
|
|
|
- allocationUpdate.setStatus(Constant.ORDER_STS.STS30.getValue());
|
|
|
- if (endActAllocation.getQty().compareTo(allocationUpdate.getPickQty()) == 0) {
|
|
|
- allocationUpdate.setStatus(Constant.ORDER_STS.STS40.getValue());
|
|
|
- }
|
|
|
- actAllocationDetailsService.updateActAllocationDetails(allocationUpdate);
|
|
|
|
|
|
String lotnum = endActAllocation.getLotnum();
|
|
|
Long locationId = Constant.LOC_SORTATION_CACHE;
|
|
|
String sku = endActAllocation.getMaterial();
|
|
|
String customerId = Constant.CUSTOMER_ID;
|
|
|
InvLotLocId invLotLocId = invLotLocIdService.selectInvLotLocIdById(locationId.toString(), customerId, sku, lotnum);
|
|
|
+ if (invLotLocId == null) {
|
|
|
+ return AjaxResult.error("没有可以分拣的库存!");
|
|
|
+ }
|
|
|
invLotLocId.setQty(invLotLocId.getQty().subtract(qty));
|
|
|
invLotLocId.setQtyEach(invLotLocId.getQty());
|
|
|
invLotLocId.setQtyallocated(invLotLocId.getQtyallocated().subtract(qty));
|
|
@@ -654,6 +661,15 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
invLotLocIdService.updateInvLotLocId(invLotLocId);
|
|
|
|
|
|
invLotLocIdService.clearZeroInventory(locationId.toString(), customerId, sku, lotnum);
|
|
|
+
|
|
|
+ ActAllocationDetails allocationUpdate = new ActAllocationDetails();
|
|
|
+ allocationUpdate.setAllocationId(endActAllocation.getAllocationId());
|
|
|
+ allocationUpdate.setPickQty(endActAllocation.getPickQty().add(qty));
|
|
|
+ allocationUpdate.setStatus(Constant.ORDER_STS.STS30.getValue());
|
|
|
+ if (endActAllocation.getQty().compareTo(allocationUpdate.getPickQty()) == 0) {
|
|
|
+ allocationUpdate.setStatus(Constant.ORDER_STS.STS40.getValue());
|
|
|
+ }
|
|
|
+ actAllocationDetailsService.updateActAllocationDetails(allocationUpdate);
|
|
|
|
|
|
WmsDocOrderDetails wmsDocOrderDetails = wmsDocOrderDetailsMapper.selectWmsDocOrderDetailsByNoLineNo(endActAllocation.getOrderNo(), endActAllocation.getLineNo());
|
|
|
wmsDocOrderDetails.setQtyPicked(wmsDocOrderDetails.getQtyPicked().add(qty));
|
|
@@ -784,6 +800,16 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
if (StringUtils.isNotEmpty(groupDiskFrom.getOrderNo())) {
|
|
|
orderNo = groupDiskFrom.getOrderNo();
|
|
|
}
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(orderNo)) {
|
|
|
+ WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
|
+ if (header != null
|
|
|
+ && !header.getOrderStatus().equals(Constant.ORDER_STS.STS10.getValue())
|
|
|
+ && !header.getOrderStatus().equals(Constant.ORDER_STS.STS20.getValue())
|
|
|
+ && !header.getOrderStatus().equals(Constant.ORDER_STS.STS21.getValue())) {
|
|
|
+ return AjaxResult.error("出库单状态不可组盘!");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(sn);
|
|
|
sku = codeSkuRelationshipVO.getSku();
|
|
@@ -805,7 +831,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
}
|
|
|
|
|
|
List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = new ArrayList<>();
|
|
|
- InvLotLocIdLotattVO endLotattVO = new InvLotLocIdLotattVO();
|
|
|
+ InvLotLocIdLotattVO endLotattVO = null;
|
|
|
List<InvLotLocIdLotattVO> equalInv = invLotLocIdLotattList.stream().filter(v -> v.getQty().compareTo(toQty) == 0).collect(Collectors.toList());
|
|
|
if (equalInv.size() > 0) {
|
|
|
endLotattVO = equalInv.get(0);
|
|
@@ -1184,7 +1210,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
codeSkuRelationshipSoVO.setSkuName(actAllocationDetailsFrom.getSkuName());
|
|
|
codeSkuRelationshipSoVO.setSkuType(codeSkuRelationshipVO.getSkuType());
|
|
|
codeSkuRelationshipSoVO.setSn(actAllocationDetailsFrom.getLotatt02());
|
|
|
- codeSkuRelationshipSoVO.setProduct(codeSkuRelationshipSoVO.isProduct());
|
|
|
+ codeSkuRelationshipSoVO.setProduct(codeSkuRelationshipVO.isProduct());
|
|
|
BigDecimal qty = actAllocationDetailsFrom.getQty().subtract(actAllocationDetailsFrom.getPickQty());
|
|
|
codeSkuRelationshipSoVO.setQty(qty.doubleValue());
|
|
|
}
|
|
@@ -1297,7 +1323,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
for (ActAllocationDetailsFrom allocationDetails : actAllocationDetailsFromList) {
|
|
|
ActAllocationDetails allocationDetailsUpdate = new ActAllocationDetails();
|
|
|
allocationDetailsUpdate.setAllocationId(allocationDetails.getAllocationId());
|
|
|
- allocationDetailsUpdate.setStatus(Constant.ORDER_STS.STS30.getValue());
|
|
|
+ allocationDetailsUpdate.setStatus(Constant.ORDER_STS.STS40.getValue());
|
|
|
actAllocationDetailsService.updateActAllocationDetails(allocationDetailsUpdate);
|
|
|
|
|
|
WmsDocOrderDetails wmsDocOrderDetails = wmsDocOrderDetailsMapper.selectWmsDocOrderDetailsByNoLineNo(allocationDetails.getOrderNo(), allocationDetails.getLineNo());
|