|
@@ -543,7 +543,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
if (!locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_IN.getValue())
|
|
if (!locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_IN.getValue())
|
|
&& !locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_RE.getValue())
|
|
&& !locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_RE.getValue())
|
|
&& !locationTo.getId().equals(Constant.LOC_SORTATION02_CACHE)) {
|
|
&& !locationTo.getId().equals(Constant.LOC_SORTATION02_CACHE)) {
|
|
- return AjaxResult.error("上架点必须为入库缓存位,出库缓存位或者线边库位!");
|
|
|
|
|
|
+ return AjaxResult.error("上架点必须为入库缓存位,回库位或者线边库位!");
|
|
}
|
|
}
|
|
|
|
|
|
//获取库存当前的托盘位置
|
|
//获取库存当前的托盘位置
|
|
@@ -554,15 +554,50 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(invLotLocId.getLotnum());
|
|
InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(invLotLocId.getLotnum());
|
|
// 判断库存是否已经上架
|
|
// 判断库存是否已经上架
|
|
BaseLocationInfo baseLocInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(invLotLocId.getLocationId(), Constant.WAREHOUSE_ID);
|
|
BaseLocationInfo baseLocInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(invLotLocId.getLocationId(), Constant.WAREHOUSE_ID);
|
|
- if (baseLocInfo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())
|
|
|
|
- || baseLocInfo.getId().equals(Constant.LOC_SORTATION02_CACHE)) {
|
|
|
|
|
|
+ if (baseLocInfo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())) {
|
|
return AjaxResult.error("托盘已经上架:" + baseLocInfo.getLocationNo());
|
|
return AjaxResult.error("托盘已经上架:" + baseLocInfo.getLocationNo());
|
|
}
|
|
}
|
|
|
|
+ if (!baseLocInfo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_VIRTUAL.getValue())) {
|
|
|
|
+ return AjaxResult.error("只有虚拟区或者线边区的托盘才可以回库!");
|
|
|
|
+ }
|
|
// 判断如果上架到线边库位上只有备货库存才可以继续
|
|
// 判断如果上架到线边库位上只有备货库存才可以继续
|
|
if (locationTo.getId().equals(Constant.LOC_SORTATION02_CACHE)
|
|
if (locationTo.getId().equals(Constant.LOC_SORTATION02_CACHE)
|
|
&& StringUtils.isEmpty(invLotAtt.getLotatt14())) {
|
|
&& StringUtils.isEmpty(invLotAtt.getLotatt14())) {
|
|
return AjaxResult.error("只有备货的托盘才可以上架到线边库位!");
|
|
return AjaxResult.error("只有备货的托盘才可以上架到线边库位!");
|
|
}
|
|
}
|
|
|
|
+ // 入库-未完全收货不可上架
|
|
|
|
+ if (flowId == Constant.FLOW_ID_ASN) {
|
|
|
|
+ String asnno = invLotAtt.getLotatt08();
|
|
|
|
+ WmsDocAsnHeader wmsDocAsnHeader = iWmsDocAsnHeaderService.selectWmsDocAsnHeaderByAsnNo(asnno);
|
|
|
|
+ if (wmsDocAsnHeader != null
|
|
|
|
+ && !wmsDocAsnHeader.getAsnStatus().equals(Constant.ASN_STS.STS40.getValue())) {
|
|
|
|
+ return AjaxResult.error("入库单未完全收货不可上架!" + asnno);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 回库-(1)未备货的库存不可回库(2)未拣货的库存不可回库
|
|
|
|
+ if (StringUtils.isNotEmpty(invLotAtt.getLotatt15())) {
|
|
|
|
+ String orderno = invLotAtt.getLotatt15();
|
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectDocOrderHeaderByOrderNo(orderno);
|
|
|
|
+ if (wmsDocOrderHeader != null) {
|
|
|
|
+ if (wmsDocOrderHeader.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {
|
|
|
|
+ // 未备货库存
|
|
|
|
+ if (invLotLocId.getQtyallocated().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
+ if (StringUtils.isEmpty(invLotAtt.getLotatt14())) {
|
|
|
|
+ return AjaxResult.error("托盘上有未备货的库存不可回库!条码号:" + invLotAtt.getLotatt02());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else if (wmsDocOrderHeader.getOrderType().equals(Constant.ORDER_TYP.ZC.getValue())) {
|
|
|
|
+ // 未拣货库存
|
|
|
|
+ if (invLotLocId.getQtyallocated().compareTo(BigDecimal.ZERO) != 0) {
|
|
|
|
+ return AjaxResult.error("托盘上有未拣货的库存不可回库!条码号:" + invLotAtt.getLotatt02());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
for (InvLotLocId inv : invLotLocIdList) {
|
|
for (InvLotLocId inv : invLotLocIdList) {
|
|
InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(inv.getLotnum());
|
|
InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(inv.getLotnum());
|