|
@@ -16,10 +16,13 @@ import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
|
|
|
import com.ruoyi.ams.inv.mapper.InvLotAttMapper;
|
|
|
import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
|
|
|
import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
|
+import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
|
|
|
+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.BaseLocationZone;
|
|
|
+import com.ruoyi.base.domain.form.BasLocationForm;
|
|
|
import com.ruoyi.base.service.IBaseLocationInfoService;
|
|
|
import com.ruoyi.base.utils.IdSequenceUtils;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -64,6 +67,8 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
private IBusinessService iBusinessService;
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
+ @Autowired
|
|
|
+ private IWmsDocOrderHeaderService wmsDocOrderHeaderService;
|
|
|
|
|
|
/**
|
|
|
* 查询库位库存信息
|
|
@@ -812,7 +817,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
invLotLocIdMapper.updateLocation(Long.parseLong(invLotLocId.getLocationId()), Constant.LOC_SORTATION_CACHE);
|
|
|
}
|
|
|
} else {
|
|
|
- deleteInvLotLocIdById(baseLocationInfo.getId());
|
|
|
+ return AjaxResult.error("出库缓存区的库位才可释放!");
|
|
|
}
|
|
|
adjLocationIsEmpty(locationFrom, Constant.WAREHOUSE_ID, updateBy);
|
|
|
//修改托盘库位绑定关系
|
|
@@ -825,6 +830,44 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
return AjaxResult.success("操作成功");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult locationRelease(BasLocationForm basLocationForm) {
|
|
|
+ BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(basLocationForm.getLocationNo(), Constant.WAREHOUSE_ID);
|
|
|
+ if (baseLocationInfo == null) {
|
|
|
+ return AjaxResult.error("不存在此库位!");
|
|
|
+ }
|
|
|
+ List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattByLocationId(baseLocationInfo.getId());
|
|
|
+ if (invLotLocIdLotattVOS.size() == 0) {
|
|
|
+ return AjaxResult.error("不存在对应释放库存!");
|
|
|
+ }
|
|
|
+ // 查出对应出库单
|
|
|
+ InvLotLocIdLotattVO invLotLocIdLotattVO = invLotLocIdLotattVOS.get(0);
|
|
|
+ // 如果lotatt15为空,并且出库的库存lotatt14不为空,说明是备货完成的托盘
|
|
|
+ // 就需要删除库存
|
|
|
+ if (StringUtils.isEmpty(invLotLocIdLotattVO.getLotatt15())
|
|
|
+ && StringUtils.isNotEmpty(invLotLocIdLotattVO.getLotatt14())) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(invLotLocIdLotattVO.getLotatt14());
|
|
|
+ if (!wmsDocOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS23.getValue())
|
|
|
+ && !wmsDocOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS98.getValue())) {
|
|
|
+ return AjaxResult.error("备货单还未备货完成,不可直接出库!" + invLotLocIdLotattVO.getLotatt14());
|
|
|
+ }
|
|
|
+ // 修改备货单出库状态
|
|
|
+ wmsDocOrderHeaderService.modifyAssignmentStockTaskStatusComplete(invLotLocIdLotattVO.getLotatt14()
|
|
|
+ , baseLocationInfo.getId(), invLotLocIdLotattVO.getLotatt07(), true);
|
|
|
+ // 清除库存
|
|
|
+ return invLotLocIdService.clear(baseLocationInfo.getId().toString(), Constant.WAREHOUSE_ID, "PDA");
|
|
|
+
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(invLotLocIdLotattVO.getLotatt15())) {
|
|
|
+ // 说明是移库,直接删除库存
|
|
|
+ return invLotLocIdService.clear(baseLocationInfo.getId().toString(), Constant.WAREHOUSE_ID, "PDA");
|
|
|
+ }
|
|
|
+ String lotatt15 = invLotLocIdLotattVO.getLotatt15();
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(lotatt15);
|
|
|
+ // 转移库存到出库虚拟区
|
|
|
+ return invLotLocIdService.releaseLocation(basLocationForm.getLocationNo(), Constant.WAREHOUSE_ID, "PDA");
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public AjaxResult checkPalletIsOnlyOrderNo(String palletNoTo, String orderNo) {
|
|
|
InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|