|
@@ -876,7 +876,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AjaxResult releaseLocation(String locationFrom, Long warehouseId, String updateBy) {
|
|
|
+ public AjaxResult releaseLocation(String locationFrom,Long locationTo,Long warehouseId, String updateBy) {
|
|
|
|
|
|
BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationFrom, Constant.WAREHOUSE_ID);
|
|
|
if (null == baseLocationInfo) return AjaxResult.error("查无库位信息");
|
|
@@ -886,7 +886,8 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
|
|
|
if (BaseLocationZone.ZONE_OUTBOUND == baseLocationInfo.getZoneId().intValue()) {
|
|
|
for (InvLotLocId invLotLocId : invLotLocIdList) {
|
|
|
- invLotLocIdMapper.updateLocation(Long.parseLong(invLotLocId.getLocationId()), Constant.LOC_SORTATION_CACHE);
|
|
|
+ invLotLocIdMapper.updateLocation(Long.parseLong(invLotLocId.getLocationId())
|
|
|
+ , locationTo);
|
|
|
}
|
|
|
} else {
|
|
|
return AjaxResult.error("出库缓存区的库位才可释放!");
|
|
@@ -894,11 +895,11 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
// 起始库位无货
|
|
|
baseLocationInfoService.unOccupyLocation(baseLocationInfo.getId(), warehouseId, updateBy);
|
|
|
// 目标库位有货
|
|
|
- baseLocationInfoService.occupyLocation(Constant.LOC_SORTATION_CACHE, warehouseId, updateBy);
|
|
|
+ baseLocationInfoService.occupyLocation(locationTo, warehouseId, updateBy);
|
|
|
//修改托盘库位绑定关系
|
|
|
WmsBoxInfo wmsBoxInfo = iWmsBoxInfoService.selectByLocationId(String.valueOf(baseLocationInfo.getId()));
|
|
|
if (wmsBoxInfo != null) {
|
|
|
- iWmsBoxInfoService.updateLocationBind(baseLocationInfo.getId(), Constant.LOC_SORTATION_CACHE
|
|
|
+ iWmsBoxInfoService.updateLocationBind(baseLocationInfo.getId(), locationTo
|
|
|
, wmsBoxInfo.getIsFull() == null ? "" : wmsBoxInfo.getIsFull());
|
|
|
}
|
|
|
//释放库位状态
|
|
@@ -918,36 +919,38 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
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())
|
|
|
- && !wmsDocOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS99.getValue())) {
|
|
|
-
|
|
|
- return AjaxResult.error("备货单还未备货完成,不可直接出库!" + invLotLocIdLotattVO.getLotatt14());
|
|
|
+ // 判断是否是备货库存托盘出库
|
|
|
+ boolean con = false;
|
|
|
+ InvLotLocIdLotattVO vo = null;
|
|
|
+ for (InvLotLocIdLotattVO lotLocIdLotattVO : invLotLocIdLotattVOS) {
|
|
|
+ // 如果lotatt15为空,并且出库的库存lotatt14不为空,说明是备货完成的托盘
|
|
|
+ if (StringUtils.isEmpty(lotLocIdLotattVO.getLotatt15())
|
|
|
+ && StringUtils.isNotEmpty(lotLocIdLotattVO.getLotatt14())) {
|
|
|
+ vo = lotLocIdLotattVO;
|
|
|
+ con = true;
|
|
|
}
|
|
|
- return AjaxResult.error("备货库存库位释放请用【PDA备货库位释放】功能");
|
|
|
-// // 修改备货单出库状态
|
|
|
-// wmsDocOrderHeaderService.modifyAssignmentStockTaskStatusComplete(invLotLocIdLotattVO.getLotatt14()
|
|
|
-// , baseLocationInfo.getId(), invLotLocIdLotattVO.getLotatt07(), true);
|
|
|
-// // 清除库存
|
|
|
-// return invLotLocIdService.clear(baseLocationInfo.getId().toString(), Constant.WAREHOUSE_ID, "PDA");
|
|
|
-
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(invLotLocIdLotattVO.getLotatt15())) {
|
|
|
+ if (con) {
|
|
|
+// WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(vo.getLotatt14());
|
|
|
+// if (!wmsDocOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS23.getValue())
|
|
|
+// && !wmsDocOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS98.getValue())
|
|
|
+// && !wmsDocOrderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS99.getValue())) {
|
|
|
+//
|
|
|
+// return AjaxResult.error("备货单还未备货完成,不可直接出库!" + vo.getLotatt14());
|
|
|
+// }
|
|
|
+// return AjaxResult.error("备货库存库位释放请用【PDA备货库位释放】功能");
|
|
|
+ // 转移库存到线边区
|
|
|
+ return invLotLocIdService.releaseLocation(basLocationForm.getLocationNo(), Constant.LOC_SORTATION02_CACHE
|
|
|
+ ,Constant.WAREHOUSE_ID, "PDA");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(invLotLocIdLotattVOS.get(0).getLotatt15())) {
|
|
|
// 说明是移库,直接删除库存
|
|
|
return AjaxResult.error("移库暂时不支持释放!");
|
|
|
// 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");
|
|
|
+ return invLotLocIdService.releaseLocation(basLocationForm.getLocationNo(), Constant.LOC_SORTATION_CACHE
|
|
|
+ ,Constant.WAREHOUSE_ID, "PDA");
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@@ -969,9 +972,8 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
|
|
|
if (locIdLotattVO.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())) {
|
|
|
return AjaxResult.error("托盘在货架上,不可出库!");
|
|
|
}
|
|
|
- if (!locIdLotattVO.getZoneId().equals(Constant.ZONE_TYPE.ZONE_OUT.getValue())
|
|
|
- && !locIdLotattVO.getLocationId().equals(Constant.LOC_SORTATION02_CACHE)) {
|
|
|
- return AjaxResult.error("托盘不在指定的出库位,不可出库!");
|
|
|
+ if (!locIdLotattVO.getLocationId().equals(Constant.LOC_SORTATION02_CACHE)) {
|
|
|
+ return AjaxResult.error("托盘不在线边位,不可出库!");
|
|
|
}
|
|
|
orderNo = locIdLotattVO.getLotatt14();
|
|
|
locationId = locIdLotattVO.getLocationId();
|