|
@@ -381,6 +381,8 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
} else if (header.getOrderType().equals(Constant.ORDER_TYP.LH.getValue())) {
|
|
|
// 库内理货不需要分配
|
|
|
ajaxResult = AjaxResult.success();
|
|
|
+ } else {
|
|
|
+ ajaxResult = AjaxResult.error("出库单类型不存在!");
|
|
|
}
|
|
|
if (!ajaxResult.isSuccess()) {
|
|
|
builder.append(s).append(":").append(ajaxResult.getMsg()).append(";");
|
|
@@ -561,7 +563,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
return false;
|
|
|
}
|
|
|
// 库存是否已经分配或者备货
|
|
|
- if (StringUtils.isEmpty(v.getLotatt15()) || orderNo.equals(v.getLotatt15())) {
|
|
|
+ if (StringUtils.isEmpty(v.getLotatt15())) {
|
|
|
if (StringUtils.isEmpty(v.getLotatt14())) {
|
|
|
return true;
|
|
|
}
|
|
@@ -605,8 +607,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
//生成分配明细
|
|
|
actAllocationDetailsService.addActAllocationDetails(inv.getLotnum(), inv.getLocationId(), allocatedQty, details
|
|
|
, Constant.ORDER_STS.STS20.getValue());
|
|
|
+ //修改分配的库存批次lotatt15记录分配出库单号
|
|
|
+ invLotLocIdService.updateLotatt15ByLotnum(inv.getLotnum(), orderNo);
|
|
|
//库位对应所有库存lotatt15记录分配出库单号
|
|
|
- invLotLocIdService.updateLotatt15ByLocationId(inv.getLocationId(), orderNo);
|
|
|
+// invLotLocIdService.updateLotatt15ByLocationId(inv.getLocationId(), orderNo);
|
|
|
} else {
|
|
|
throw new ServiceException("占用库存分配数失败");
|
|
|
}
|
|
@@ -626,8 +630,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
//生成分配明细
|
|
|
actAllocationDetailsService.addActAllocationDetails(inv.getLotnum(), inv.getLocationId(), allocatedQty, details
|
|
|
, Constant.ORDER_STS.STS20.getValue());
|
|
|
+ //修改分配的库存批次lotatt15记录分配出库单号
|
|
|
+ invLotLocIdService.updateLotatt15ByLotnum(inv.getLotnum(), orderNo);
|
|
|
//库位对应所有库存lotatt15记录分配出库单号
|
|
|
- invLotLocIdService.updateLotatt15ByLocationId(inv.getLocationId(), orderNo);
|
|
|
+// invLotLocIdService.updateLotatt15ByLocationId(inv.getLocationId(), orderNo);
|
|
|
return AjaxResult.success("分配完成", originalOrderQty);
|
|
|
} else {
|
|
|
throw new ServiceException("占用库存分配数失败");
|
|
@@ -646,8 +652,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
//生成分配明细
|
|
|
actAllocationDetailsService.addActAllocationDetails(inv.getLotnum(), inv.getLocationId(), currentQty, details
|
|
|
, Constant.ORDER_STS.STS20.getValue());
|
|
|
+ //修改分配的库存批次lotatt15记录分配出库单号
|
|
|
+ invLotLocIdService.updateLotatt15ByLotnum(inv.getLotnum(), orderNo);
|
|
|
//库位对应所有库存lotatt15记录分配出库单号
|
|
|
- invLotLocIdService.updateLotatt15ByLocationId(inv.getLocationId(), orderNo);
|
|
|
+// invLotLocIdService.updateLotatt15ByLocationId(inv.getLocationId(), orderNo);
|
|
|
return AjaxResult.success("分配完成", originalOrderQty);
|
|
|
|
|
|
} else {
|
|
@@ -683,7 +691,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
String lotatt15 = locIdLotattVO.getLotatt15();
|
|
|
WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(lotatt15);
|
|
|
PickingListVO pickingListVO = new PickingListVO();
|
|
|
- pickingListVO.setOrderNo(wmsDocOrderHeader.getSoReference1()); // ERP单号
|
|
|
+ if (wmsDocOrderHeader != null) {
|
|
|
+ pickingListVO.setOrderNo(wmsDocOrderHeader.getSoReference1() == null ? ""
|
|
|
+ : wmsDocOrderHeader.getSoReference1()); // ERP单号
|
|
|
+ }
|
|
|
pickingListVO.setSku(locIdLotattVO.getSku());
|
|
|
pickingListVO.setPickQty(locIdLotattVO.getQtyallocated());
|
|
|
pickingListVO.setToBePickQty(locIdLotattVO.getQty());
|
|
@@ -1217,7 +1228,6 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
* @return
|
|
|
*/
|
|
|
private int judgmentOfGroupPlateType(InvLotLocIdLotattVO locIdLotattVO) {
|
|
|
- // 为空说明是备货出库,但是被更新备货流程改变了分配数
|
|
|
if (StringUtils.isEmpty(locIdLotattVO.getLotatt15())
|
|
|
&& StringUtils.isNotEmpty(locIdLotattVO.getLotatt14())) {
|
|
|
return 3;
|
|
@@ -1734,7 +1744,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
for (InvLotLocIdLotattVO locIdLotattVO : invLotLocIdLotattVOList) {
|
|
|
String lotatt15 = locIdLotattVO.getLotatt15();
|
|
|
WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(lotatt15);
|
|
|
- codeSkuRelationshipSoVO.setOrderNo(wmsDocOrderHeader.getSoReference1());
|
|
|
+ if (wmsDocOrderHeader != null) {
|
|
|
+ codeSkuRelationshipSoVO.setOrderNo(wmsDocOrderHeader.getSoReference1() == null ? ""
|
|
|
+ : wmsDocOrderHeader.getSoReference1()); // ERP单号
|
|
|
+ }
|
|
|
codeSkuRelationshipSoVO.setSku(locIdLotattVO.getSku());
|
|
|
codeSkuRelationshipSoVO.setSkuName(locIdLotattVO.getSkuName());
|
|
|
codeSkuRelationshipSoVO.setSkuType(locIdLotattVO.getSkuTypeName());
|