|
@@ -24,6 +24,7 @@ import com.ruoyi.ams.inv.dto.InvLotLocIdDTO;
|
|
import com.ruoyi.ams.inv.dto.InvLotLocIdSurplusQtyDTO;
|
|
import com.ruoyi.ams.inv.dto.InvLotLocIdSurplusQtyDTO;
|
|
import com.ruoyi.ams.inv.mapper.InvLotAttMapper;
|
|
import com.ruoyi.ams.inv.mapper.InvLotAttMapper;
|
|
import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
|
|
import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
|
|
|
|
+import com.ruoyi.ams.inv.service.IInvLotAttService;
|
|
import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
import com.ruoyi.ams.order.domain.ActAllocationDTO;
|
|
import com.ruoyi.ams.order.domain.ActAllocationDTO;
|
|
import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
|
|
import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
|
|
@@ -81,6 +82,8 @@ public class InvLotLocIdServiceImpl extends CrudServiceImpl<InvLotLocIdMapper, I
|
|
@Autowired
|
|
@Autowired
|
|
private InvLotAttMapper invLotAttMapper;
|
|
private InvLotAttMapper invLotAttMapper;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private IInvLotAttService invLotAttService;
|
|
|
|
+ @Autowired
|
|
private IBaseLocationInfoService baseLocationInfoService;
|
|
private IBaseLocationInfoService baseLocationInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private IWmsBoxInfoService iWmsBoxInfoService;
|
|
private IWmsBoxInfoService iWmsBoxInfoService;
|
|
@@ -980,7 +983,7 @@ public class InvLotLocIdServiceImpl extends CrudServiceImpl<InvLotLocIdMapper, I
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public AjaxResult releaseLocation(String locationFrom, Long locationTo, Long warehouseId, String updateBy) {
|
|
|
|
|
|
+ public AjaxResult releaseLocation(String locationFrom, Long locationTo, Long warehouseId, String updateBy, boolean flag) {
|
|
|
|
|
|
BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationFrom, Constant.WAREHOUSE_ID);
|
|
BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationFrom, Constant.WAREHOUSE_ID);
|
|
if (null == baseLocationInfo) return AjaxResult.error("查无库位信息");
|
|
if (null == baseLocationInfo) return AjaxResult.error("查无库位信息");
|
|
@@ -988,14 +991,25 @@ public class InvLotLocIdServiceImpl extends CrudServiceImpl<InvLotLocIdMapper, I
|
|
invLotLocIdQuery.setLocationId(String.valueOf(baseLocationInfo.getId()));
|
|
invLotLocIdQuery.setLocationId(String.valueOf(baseLocationInfo.getId()));
|
|
List<InvLotLocId> invLotLocIdList = selectInvLotLocIdList(invLotLocIdQuery);
|
|
List<InvLotLocId> invLotLocIdList = selectInvLotLocIdList(invLotLocIdQuery);
|
|
|
|
|
|
- if (BaseLocationZone.ZONE_OUTBOUND == baseLocationInfo.getZoneId().intValue()) {
|
|
|
|
- for (InvLotLocId invLotLocId : invLotLocIdList) {
|
|
|
|
- invLotLocIdMapper.updateLocation(Long.parseLong(invLotLocId.getLocationId())
|
|
|
|
- , locationTo);
|
|
|
|
|
|
+ if (BaseLocationZone.ZONE_OUTBOUND != baseLocationInfo.getZoneId().intValue()) return AjaxResult.error("出库缓存区的库位才可释放!");
|
|
|
|
+ for (InvLotLocId invLotLocId : invLotLocIdList) {
|
|
|
|
+ if (ObjectUtil.equals(Constant.LOC_SORTATION_CACHE, locationTo) && flag){
|
|
|
|
+ //创建新批次
|
|
|
|
+ String newLotNum = IdWorker.getIdStr();
|
|
|
|
+ InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(invLotLocId.getLotnum());
|
|
|
|
+ invLotAtt.setLotnum(newLotNum);
|
|
|
|
+ invLotAtt.setLotatt07(Constant.VIRTUAL_PALLET);
|
|
|
|
+ invLotAtt.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ invLotAtt.setRemark("invLotAtt insert cause by pda release Location");
|
|
|
|
+ invLotAttService.insertInvLotAtt(invLotAtt);
|
|
|
|
+ //修改库存
|
|
|
|
+ invLotLocIdService.updateInvLotLocIdLotNum(invLotLocId.getLotnum(), newLotNum, String.valueOf(locationTo));
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- return AjaxResult.error("出库缓存区的库位才可释放!");
|
|
|
|
|
|
+ invLotLocIdMapper.updateLocation(Long.parseLong(invLotLocId.getLocationId())
|
|
|
|
+ , locationTo);
|
|
}
|
|
}
|
|
|
|
+
|
|
// 起始库位无货
|
|
// 起始库位无货
|
|
baseLocationInfoService.unOccupyLocation(baseLocationInfo.getId(), warehouseId, updateBy);
|
|
baseLocationInfoService.unOccupyLocation(baseLocationInfo.getId(), warehouseId, updateBy);
|
|
// 目标库位有货
|
|
// 目标库位有货
|
|
@@ -1026,44 +1040,25 @@ public class InvLotLocIdServiceImpl extends CrudServiceImpl<InvLotLocIdMapper, I
|
|
}
|
|
}
|
|
// 判断是否是备货库存托盘出库
|
|
// 判断是否是备货库存托盘出库
|
|
boolean con = false;
|
|
boolean con = false;
|
|
- InvLotLocIdLotattVO vo = null;
|
|
|
|
|
|
+ // 判断是否释放到虚拟大栈板
|
|
|
|
+ boolean flag = true;
|
|
for (InvLotLocIdLotattVO lotLocIdLotattVO : invLotLocIdLotattVOS) {
|
|
for (InvLotLocIdLotattVO lotLocIdLotattVO : invLotLocIdLotattVOS) {
|
|
// 如果lotatt15为空,并且出库的库存lotatt14不为空,说明是备货完成的托盘
|
|
// 如果lotatt15为空,并且出库的库存lotatt14不为空,说明是备货完成的托盘
|
|
- if (StringUtils.isEmpty(lotLocIdLotattVO.getLotatt15())
|
|
|
|
- && StringUtils.isNotEmpty(lotLocIdLotattVO.getLotatt14())) {
|
|
|
|
- vo = lotLocIdLotattVO;
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(lotLocIdLotattVO.getLotatt14())) {
|
|
con = true;
|
|
con = true;
|
|
}
|
|
}
|
|
|
|
+ if (StringUtils.isNotBlank(lotLocIdLotattVO.getLotatt16()) || StringUtils.isNotBlank(lotLocIdLotattVO.getLotatt17())){
|
|
|
|
+ flag = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (con) {
|
|
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
|
|
return invLotLocIdService.releaseLocation(basLocationForm.getLocationNo(), Constant.LOC_SORTATION02_CACHE
|
|
- , Constant.WAREHOUSE_ID, "PDA");
|
|
|
|
|
|
+ , Constant.WAREHOUSE_ID, "PDA", flag);
|
|
}
|
|
}
|
|
- //todo
|
|
|
|
- // 如果库存中所有lotatt15都为空 说明是移库
|
|
|
|
- boolean lotatt15Null = true;
|
|
|
|
- for (InvLotLocIdLotattVO lotLocIdLotattVO : invLotLocIdLotattVOS) {
|
|
|
|
- if (StringUtils.isNotEmpty(lotLocIdLotattVO.getLotatt15())) {
|
|
|
|
- lotatt15Null = false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-// if (lotatt15Null) {
|
|
|
|
-// // 说明是移库,直接删除库存
|
|
|
|
-// return AjaxResult.error("移库暂时不支持释放!");
|
|
|
|
-//// return invLotLocIdService.clear(baseLocationInfo.getId().toString(), Constant.WAREHOUSE_ID, "PDA");
|
|
|
|
-// }
|
|
|
|
// 转移库存到出库虚拟区
|
|
// 转移库存到出库虚拟区
|
|
return invLotLocIdService.releaseLocation(basLocationForm.getLocationNo(), Constant.LOC_SORTATION_CACHE
|
|
return invLotLocIdService.releaseLocation(basLocationForm.getLocationNo(), Constant.LOC_SORTATION_CACHE
|
|
- , Constant.WAREHOUSE_ID, "PDA");
|
|
|
|
|
|
+ , Constant.WAREHOUSE_ID, "PDA", flag);
|
|
}
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@@ -1231,7 +1226,8 @@ public class InvLotLocIdServiceImpl extends CrudServiceImpl<InvLotLocIdMapper, I
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<InvLotLocId> queryInvLotLocIdByLotnum(List<String> lotnumList){
|
|
public List<InvLotLocId> queryInvLotLocIdByLotnum(List<String> lotnumList){
|
|
- return queryInvLotLocIdByLotnum(lotnumList, null);
|
|
|
|
|
|
+ return queryInvLotLocIdByLotnum(lotnumList, null).stream().filter(item ->
|
|
|
|
+ !ObjectUtil.equals(item.getLocationId(), Constant.LOC_SORTATION_CACHE.toString())).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1257,6 +1253,17 @@ public class InvLotLocIdServiceImpl extends CrudServiceImpl<InvLotLocIdMapper, I
|
|
return updateInvLotLocId(lotNum, null, null, qtyAllocated, sku, null);
|
|
return updateInvLotLocId(lotNum, null, null, qtyAllocated, sku, null);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 修改库位库存主键
|
|
|
|
+ * @param lotNum
|
|
|
|
+ * @param lotNumTo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean updateInvLotLocIdLotNum(String lotNum, String lotNumTo) {
|
|
|
|
+ return updateInvLotLocIdLotNum(lotNum, lotNumTo, null, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 修改库位库存主键以及库位id
|
|
* 修改库位库存主键以及库位id
|
|
* @param lotNum
|
|
* @param lotNum
|