|
|
@ -1663,7 +1663,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd |
|
|
|
return upShelfAllocationVO; |
|
|
|
return upShelfAllocationVO; |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
log.warn("#############moveAllocationScanAllocation: 库位已有绑定货物 allocationId={}",allocationId); |
|
|
|
log.warn("#############moveAllocationScanAllocation: 库位已有绑定货物 allocationId={}",allocationId); |
|
|
|
throw new CustomerException(403,"库位已有绑定货物"); |
|
|
|
throw new CustomerException(403,"库位已绑定货物"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1675,7 +1675,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd |
|
|
|
return Resp.scanFail(403,"库位信息不存在","库位信息不存在"); |
|
|
|
return Resp.scanFail(403,"库位信息不存在","库位信息不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
Long wid = goodsAllocationEntity.getWarehouseId(); |
|
|
|
Long wid = goodsAllocationEntity.getWarehouseId(); |
|
|
|
if(wid.equals(warehouseId)){ |
|
|
|
if(!wid.equals(warehouseId)){ |
|
|
|
log.warn("#############moveAllocationByAllocation: 库位不在当前仓 allocationId={}",allocationId); |
|
|
|
log.warn("#############moveAllocationByAllocation: 库位不在当前仓 allocationId={}",allocationId); |
|
|
|
return Resp.scanFail(403,"库位不在当前仓","库位不在当前仓"); |
|
|
|
return Resp.scanFail(403,"库位不在当前仓","库位不在当前仓"); |
|
|
|
} |
|
|
|
} |
|
|
@ -1686,7 +1686,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd |
|
|
|
return Resp.scanFail(403,"目标库位信息不存在","目标库位信息不存在"); |
|
|
|
return Resp.scanFail(403,"目标库位信息不存在","目标库位信息不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
Long targetWid = targetGoodsAllocationEntity.getWarehouseId(); |
|
|
|
Long targetWid = targetGoodsAllocationEntity.getWarehouseId(); |
|
|
|
if(targetWid.equals(warehouseId)){ |
|
|
|
if(!targetWid.equals(warehouseId)){ |
|
|
|
log.warn("#############moveAllocationByAllocation: 目标库位不在当前仓 targetAllocationId={}",targetAllocationId); |
|
|
|
log.warn("#############moveAllocationByAllocation: 目标库位不在当前仓 targetAllocationId={}",targetAllocationId); |
|
|
|
return Resp.scanFail(403,"目标库位不在当前仓","目标库位不在当前仓"); |
|
|
|
return Resp.scanFail(403,"目标库位不在当前仓","目标库位不在当前仓"); |
|
|
|
} |
|
|
|
} |
|
|
@ -1726,6 +1726,122 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd |
|
|
|
return Resp.scanSuccess("整库移库成功","整库移库成功"); |
|
|
|
return Resp.scanSuccess("整库移库成功","整库移库成功"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public UpShelfAllocationVO moveAllocationScanSourceAllocation(Long allocationId, Long warehouseId) { |
|
|
|
|
|
|
|
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId); |
|
|
|
|
|
|
|
if(Objects.isNull(goodsAllocationEntity)){ |
|
|
|
|
|
|
|
log.warn("#############upShelfScanAllocation: 库位信息不存在 allocationId={}",allocationId); |
|
|
|
|
|
|
|
throw new CustomerException(403,"库位信息不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String goodsAllocationName = goodsAllocationEntity.getGoodsAllocationName(); |
|
|
|
|
|
|
|
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId(); |
|
|
|
|
|
|
|
BasicdataGoodsShelfEntity basicdataGoodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId); |
|
|
|
|
|
|
|
if(Objects.isNull(basicdataGoodsShelfEntity)){ |
|
|
|
|
|
|
|
log.warn("#################upShelfScanAllocation: 货架信息不存在 goodsShelfId={}",goodsShelfId); |
|
|
|
|
|
|
|
throw new CustomerException(403,"货架信息不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String goodsShelfName = basicdataGoodsShelfEntity.getGoodsShelfName(); |
|
|
|
|
|
|
|
Long goodsAreaId = basicdataGoodsShelfEntity.getGoodsAreaId();//货区id
|
|
|
|
|
|
|
|
BasicdataGoodsAreaEntity basicdataGoodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId); |
|
|
|
|
|
|
|
if(Objects.isNull(basicdataGoodsAreaEntity)){ |
|
|
|
|
|
|
|
log.warn("#################upShelfScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId); |
|
|
|
|
|
|
|
throw new CustomerException(403,"货区信息不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String areaType = basicdataGoodsAreaEntity.getAreaType(); |
|
|
|
|
|
|
|
if("1".equals(areaType)){ |
|
|
|
|
|
|
|
log.warn("#################upShelfScanAllocation: 备货区不能上下架 goodsAreaId={}",goodsAreaId); |
|
|
|
|
|
|
|
throw new CustomerException(403,"备货区不能上下架"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Long wid = basicdataGoodsAreaEntity.getWarehouseId(); |
|
|
|
|
|
|
|
String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid); |
|
|
|
|
|
|
|
if(Objects.isNull(basicdataWarehouseEntity)){ |
|
|
|
|
|
|
|
log.warn("#################upShelfScanAllocation: 仓库信息不存在 wid={}",wid); |
|
|
|
|
|
|
|
throw new CustomerException(403,"仓库信息不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!wid.equals(warehouseId)){ |
|
|
|
|
|
|
|
log.warn("#################upShelfScanAllocation: 库位不在当前仓"); |
|
|
|
|
|
|
|
throw new CustomerException(403,"库位不在当前仓"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq("allocation_id",allocationId); |
|
|
|
|
|
|
|
List<WarehouseUpdownGoodsEntity> list = warehouseUpdownGoodsService.list(queryWrapper); |
|
|
|
|
|
|
|
if(list.isEmpty()){ |
|
|
|
|
|
|
|
log.warn("#################upShelfScanAllocation: 库位暂无货物绑定 allocationId={}",allocationId); |
|
|
|
|
|
|
|
throw new CustomerException(403,"库位暂无货物绑定"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String warehouseName = basicdataWarehouseEntity.getName();//仓库名称
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UpShelfAllocationVO upShelfAllocationVO = new UpShelfAllocationVO(); |
|
|
|
|
|
|
|
upShelfAllocationVO.setWarehouseId(warehouseId); |
|
|
|
|
|
|
|
upShelfAllocationVO.setWarehouseName(warehouseName); |
|
|
|
|
|
|
|
upShelfAllocationVO.setAreaId(goodsAreaId); |
|
|
|
|
|
|
|
upShelfAllocationVO.setAreaTitle(goodsAreaName); |
|
|
|
|
|
|
|
upShelfAllocationVO.setShelfId(goodsShelfId); |
|
|
|
|
|
|
|
upShelfAllocationVO.setShelfTitle(goodsShelfName); |
|
|
|
|
|
|
|
upShelfAllocationVO.setAllocationId(allocationId); |
|
|
|
|
|
|
|
upShelfAllocationVO.setAllocationTitle(goodsAllocationName); |
|
|
|
|
|
|
|
//就去查对应的库位绑定数据
|
|
|
|
|
|
|
|
QueryWrapper<WarehouseUpdownTypeEntity> updownTypeEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
updownTypeEntityQueryWrapper.eq("area_id",goodsAreaId) |
|
|
|
|
|
|
|
.eq("shelf_id",goodsShelfId) |
|
|
|
|
|
|
|
.eq("allocation_id",allocationId) |
|
|
|
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
|
|
|
WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectOne(updownTypeEntityQueryWrapper); |
|
|
|
|
|
|
|
if(Objects.isNull(updownTypeEntity)){ |
|
|
|
|
|
|
|
log.warn("#############upShelfScanAllocation: 库位暂无数据 allocationId={}",allocationId); |
|
|
|
|
|
|
|
return upShelfAllocationVO; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
upShelfAllocationVO.setTotalNum(updownTypeEntity.getTotalNum()); |
|
|
|
|
|
|
|
upShelfAllocationVO.setOrderTotalnum(updownTypeEntity.getOrderTotalNum()); |
|
|
|
|
|
|
|
upShelfAllocationVO.setStockNum(updownTypeEntity.getStockNum()); |
|
|
|
|
|
|
|
upShelfAllocationVO.setStockTotalNum(updownTypeEntity.getStockTotalNum()); |
|
|
|
|
|
|
|
Long updownTypeId = updownTypeEntity.getId();//库位打包货物方式id
|
|
|
|
|
|
|
|
//同一个货位上能存所有类型的货物,所以要分三类来查 association_type 1订单号(零担) 3包件码(订单号) 4库存品
|
|
|
|
|
|
|
|
List<UpShelfDataVO> packageList = warehouseUpdownGoodsService.findPackageByUpdownTypeId(updownTypeId); |
|
|
|
|
|
|
|
List<UpShelfDataVO> zeroList = warehouseUpdownGoodsService.findZeroByUpdownTypeId(updownTypeId); |
|
|
|
|
|
|
|
Integer orderNum = packageList.size() + zeroList.size(); |
|
|
|
|
|
|
|
upShelfAllocationVO.setOrderNum(orderNum); |
|
|
|
|
|
|
|
List<UpShelfDataVO> stockList = warehouseUpdownGoodsService.findStockByUpdownTypeId(updownTypeId); |
|
|
|
|
|
|
|
upShelfAllocationVO.getList().addAll(packageList); |
|
|
|
|
|
|
|
upShelfAllocationVO.getList().addAll(zeroList); |
|
|
|
|
|
|
|
upShelfAllocationVO.getList().addAll(stockList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询货位上是否有托盘
|
|
|
|
|
|
|
|
BasicdataTrayEntity basicdataTrayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId); |
|
|
|
|
|
|
|
if(!Objects.isNull(basicdataTrayEntity)){ |
|
|
|
|
|
|
|
//有托盘就查询托盘上的数据
|
|
|
|
|
|
|
|
Long trayId = basicdataTrayEntity.getId(); |
|
|
|
|
|
|
|
String trayCode = basicdataTrayEntity.getPalletCode(); |
|
|
|
|
|
|
|
upShelfAllocationVO.setTrayId(trayId); |
|
|
|
|
|
|
|
upShelfAllocationVO.setTrayCode(trayCode); |
|
|
|
|
|
|
|
QueryWrapper<WarehouseTrayTypeEntity> trayTypeEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
trayTypeEntityQueryWrapper.eq("tray_id",trayId) |
|
|
|
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
|
|
|
WarehouseTrayTypeEntity trayTypeEntity = warehouseTrayTypeService.getOne(trayTypeEntityQueryWrapper); |
|
|
|
|
|
|
|
if(Objects.isNull(trayTypeEntity)){ |
|
|
|
|
|
|
|
log.warn("#############upShelfScanAllocation: 托盘未找到打托数据 trayId={}",trayId); |
|
|
|
|
|
|
|
throw new CustomerException(403,"托盘未找到打托数据"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String type = trayTypeEntity.getType();//打托分类
|
|
|
|
|
|
|
|
upShelfAllocationVO.setTotalNum(trayTypeEntity.getTotalNum()); |
|
|
|
|
|
|
|
upShelfAllocationVO.setOrderTotalnum(trayTypeEntity.getOrderTotalNum()); |
|
|
|
|
|
|
|
upShelfAllocationVO.setStockNum(trayTypeEntity.getStockNum()); |
|
|
|
|
|
|
|
upShelfAllocationVO.setStockTotalNum(trayTypeEntity.getStockTotalNum()); |
|
|
|
|
|
|
|
if("1".equals(type) || "2".equals(type)){ |
|
|
|
|
|
|
|
upShelfAllocationVO.setTrayNum(trayTypeEntity.getTotalNum()); |
|
|
|
|
|
|
|
}else if("3".equals(type) || "4".equals(type)){ |
|
|
|
|
|
|
|
upShelfAllocationVO.setTrayNum(trayTypeEntity.getStockNum()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return upShelfAllocationVO; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void changeUpdownGoodsToNewAllocation(List<WarehouseUpdownGoodsEntity> list, Long allocationId,WarehouseUpdownTypeEntity updownTypeEntity) { |
|
|
|
private void changeUpdownGoodsToNewAllocation(List<WarehouseUpdownGoodsEntity> list, Long allocationId,WarehouseUpdownTypeEntity updownTypeEntity) { |
|
|
|
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId); |
|
|
|
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId); |
|
|
|
if(Objects.isNull(goodsAllocationEntity)){ |
|
|
|
if(Objects.isNull(goodsAllocationEntity)){ |
|
|
|