|
@@ -33,6 +33,7 @@ import com.ruoyi.ams.order.mapper.WmsDocOrderDetailsMapper;
|
|
|
import com.ruoyi.ams.order.mapper.WmsDocOrderHeaderMapper;
|
|
|
import com.ruoyi.ams.order.service.IActAllocationDetailsService;
|
|
|
import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
|
|
|
+import com.ruoyi.ams.task.domain.WcsTask;
|
|
|
import com.ruoyi.base.constant.Constant;
|
|
|
import com.ruoyi.base.domain.BaseLocationInfo;
|
|
|
import com.ruoyi.base.domain.BaseSku;
|
|
@@ -538,20 +539,32 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
throw new ServiceException("托盘不存在");
|
|
|
}
|
|
|
BaseLocationInfo locationTo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(paForm.getLocationTo(), Constant.WAREHOUSE_ID);
|
|
|
+ // 校验上架库位必须为入库缓存位或者线边库位
|
|
|
+ if (!locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_IN.getValue())
|
|
|
+ && !locationTo.getId().equals(Constant.LOC_SORTATION02_CACHE)) {
|
|
|
+ return AjaxResult.error("上架点必须为入库缓存位或者线边库位!");
|
|
|
+ }
|
|
|
|
|
|
//获取库存当前的托盘位置
|
|
|
InvLotAtt lotAtt = new InvLotAtt();
|
|
|
lotAtt.setLotatt07(paForm.getPalletNo());
|
|
|
List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvByInvLotatt(lotAtt);
|
|
|
- for (InvLotLocId inv : invLotLocIdList) {
|
|
|
- // 判断上架的库存是否已经上架
|
|
|
- BaseLocationInfo baseLocInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(inv.getLocationId(), Constant.WAREHOUSE_ID);
|
|
|
- if (baseLocInfo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())) {
|
|
|
- return AjaxResult.error("托盘已经在货架上:" + baseLocInfo.getLocationNo());
|
|
|
+ for (InvLotLocId invLotLocId : invLotLocIdList) {
|
|
|
+ InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(invLotLocId.getLotnum());
|
|
|
+ // 判断库存是否已经上架
|
|
|
+ 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)) {
|
|
|
+ return AjaxResult.error("托盘已经上架:" + baseLocInfo.getLocationNo());
|
|
|
}
|
|
|
-
|
|
|
+ // 判断如果上架到线边库位上只有备货库存才可以继续
|
|
|
+ if (locationTo.getId().equals(Constant.LOC_SORTATION02_CACHE)
|
|
|
+ && StringUtils.isEmpty(invLotAtt.getLotatt14())) {
|
|
|
+ return AjaxResult.error("只有备货的托盘才可以上架到线边库位!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (InvLotLocId inv : invLotLocIdList) {
|
|
|
InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(inv.getLotnum());
|
|
|
- invLotAtt.setLotatt12("Y");
|
|
|
invLotAttService.updateInvLotAtt(invLotAtt);
|
|
|
|
|
|
//更新托盘库存到起始库位
|
|
@@ -574,7 +587,16 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
if (result <= 0) {
|
|
|
throw new ServiceException("托盘绑定更新失败");
|
|
|
}
|
|
|
- return AjaxResult.success("操作成功",asnNo);
|
|
|
+ // 如果是上架到线边仓库(1)入库:修改入库单完成状态(2)回库:修改库存lotatt15为空
|
|
|
+ if (locationTo.getId().equals(Constant.LOC_SORTATION02_CACHE)) {
|
|
|
+ if (flowId == Constant.FLOW_ID_ASN) {
|
|
|
+ this.modifyReceiptDocCompletionStatus(palletNo);
|
|
|
+ } else {
|
|
|
+ invLotLocIdService.clearInvActOrderNoByPalletNo(palletNo);
|
|
|
+ }
|
|
|
+ return AjaxResult.error("上架完成!AGV不参与搬运!");
|
|
|
+ }
|
|
|
+ return AjaxResult.success("操作成功", asnNo);
|
|
|
}
|
|
|
|
|
|
/**
|