|
|
|
@ -10,12 +10,10 @@ import com.logpm.distribution.feign.IDistributionStockArticleClient;
|
|
|
|
|
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseUpdownTypeEntity; |
|
|
|
|
import com.logpm.warehouse.mapper.WarehouseUpdownTypeMapper; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseTaryAllocationService; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseTrayGoodsService; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseTrayTypeService; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseUpdownTypeService; |
|
|
|
|
import com.logpm.warehouse.service.*; |
|
|
|
|
import com.logpm.warehouse.vo.GoodsVO; |
|
|
|
|
import com.logpm.warehouse.vo.TragetAllocationVO; |
|
|
|
|
import com.logpm.warehouse.vo.UpShelfAllocationVO; |
|
|
|
|
import com.logpm.warehouse.vo.UpShelfDataVO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
@ -44,6 +42,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
private final IBasicdataTrayClient basicdataTrayClient; |
|
|
|
|
private final IWarehouseTrayTypeService warehouseTrayTypeService; |
|
|
|
|
private final IWarehouseTrayGoodsService warehouseTrayGoodsService; |
|
|
|
|
private final IWarehouseUpdownTypeService warehouseUpdownTypeService; |
|
|
|
|
private final IWarehouseUpdownGoodsService warehouseUpdownGoodsService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public TragetAllocationVO findGoodsByAllocation(String allocationCode, Integer moveType) { |
|
|
|
@ -133,20 +133,14 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
log.warn("#################findUpShelfScanGoods: 包件信息不存在 code={}",code); |
|
|
|
|
throw new CustomerException(403,"包件信息不存在"); |
|
|
|
|
} |
|
|
|
|
Long stockArticleId = parcelListEntity.getStockArticleId();//订单号id
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findEntityByStockArticleId(stockArticleId); |
|
|
|
|
if(Objects.isNull(stockArticleEntity)){ |
|
|
|
|
log.warn("#################findUpShelfScanGoods: 订单信息不存在 stockArticleId={}",stockArticleId); |
|
|
|
|
throw new CustomerException(403,"订单信息不存在"); |
|
|
|
|
} |
|
|
|
|
String serviceNumber = stockArticleEntity.getServiceNumber();//服务号
|
|
|
|
|
String serviceNumber = parcelListEntity.getServiceNumber(); |
|
|
|
|
List<Map> ls = distributionStockArticleClient.fingListByServiceNumber(serviceNumber); |
|
|
|
|
List<UpShelfDataVO> list = new ArrayList<>(); |
|
|
|
|
for (Map map:ls){ |
|
|
|
|
UpShelfDataVO upShelfDataVO = new UpShelfDataVO(); |
|
|
|
|
upShelfDataVO.setServiceNum((String) map.get("serviceNum")); |
|
|
|
|
upShelfDataVO.setOrderCode((String) map.get("orderCode")); |
|
|
|
|
upShelfDataVO.setNum((Integer) map.get("num")); |
|
|
|
|
upShelfDataVO.setTotalNum((Integer) map.get("num")); |
|
|
|
|
upShelfDataVO.setCompleteSet((Integer) map.get("completeSet")); |
|
|
|
|
list.add(upShelfDataVO); |
|
|
|
|
} |
|
|
|
@ -162,7 +156,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
UpShelfDataVO dataVO = new UpShelfDataVO(); |
|
|
|
|
dataVO.setServiceNum(stockArticleEntity.getServiceNumber()); |
|
|
|
|
dataVO.setOrderCode(stockArticleEntity.getOrderCode()); |
|
|
|
|
dataVO.setNum(stockArticleEntity.getTotalNumber()); |
|
|
|
|
dataVO.setTotalNum(stockArticleEntity.getTotalNumber()); |
|
|
|
|
dataVO.setCompleteSet(stockArticleEntity.getCompleteSet()); |
|
|
|
|
ls.add(dataVO); |
|
|
|
|
return ls; |
|
|
|
@ -203,12 +197,110 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
}else if(PalletProductTypeConstant.ARTIFICIAL.equals(type)){ |
|
|
|
|
listByTrayTypeId = warehouseTrayGoodsService.getZeroUpListByTrayTypeId(trayTypeId); |
|
|
|
|
}else if(PalletProductTypeConstant.STOCKDATA.equals(type)){ |
|
|
|
|
// listByTrayTypeId = warehouseTrayGoodsService.getStockListByTrayTypeId(trayTypeId)
|
|
|
|
|
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId); |
|
|
|
|
}else if(PalletProductTypeConstant.STOCKNODATA.equals(type)){ |
|
|
|
|
|
|
|
|
|
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId); |
|
|
|
|
} |
|
|
|
|
return listByTrayTypeId; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public UpShelfAllocationVO upShelfScanAllocation(String code) { |
|
|
|
|
String allocationCode = code;//库位码
|
|
|
|
|
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationCode(allocationCode); |
|
|
|
|
if(Objects.isNull(goodsAllocationEntity)){ |
|
|
|
|
log.warn("#############upShelfScanAllocation: 库位信息不存在 allocationCode={}",allocationCode); |
|
|
|
|
throw new CustomerException(403,"库位信息不存在"); |
|
|
|
|
} |
|
|
|
|
Long allocationId = goodsAllocationEntity.getId(); |
|
|
|
|
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,"货区信息不存在"); |
|
|
|
|
} |
|
|
|
|
Long warehouseId = basicdataGoodsAreaEntity.getWarehouseId(); |
|
|
|
|
String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称
|
|
|
|
|
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); |
|
|
|
|
if(Objects.isNull(basicdataWarehouseEntity)){ |
|
|
|
|
log.warn("#################upShelfScanAllocation: 仓库信息不存在 warehouseId={}",warehouseId); |
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
//查询货位上是否有托盘
|
|
|
|
|
BasicdataTrayEntity basicdataTrayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId); |
|
|
|
|
if(Objects.isNull(basicdataTrayEntity)){ |
|
|
|
|
//如果没有托盘,就去查对应的库位绑定数据
|
|
|
|
|
QueryWrapper<WarehouseUpdownTypeEntity> updownTypeEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
updownTypeEntityQueryWrapper.eq("area_id",goodsAreaId) |
|
|
|
|
.eq("shelf_id",goodsShelfId) |
|
|
|
|
.eq("allocation_id",allocationId) |
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
WarehouseUpdownTypeEntity updownTypeEntity = warehouseUpdownTypeService.getOne(updownTypeEntityQueryWrapper); |
|
|
|
|
if(Objects.isNull(updownTypeEntity)){ |
|
|
|
|
log.warn("#############upShelfScanAllocation: 库位暂无数据 allocationId={}",allocationId); |
|
|
|
|
return upShelfAllocationVO; |
|
|
|
|
}else{ |
|
|
|
|
Long updownTypeId = updownTypeEntity.getId();//库位打包货物方式id
|
|
|
|
|
//同一个货位上能存所有类型的货物,所以要分三类来查 association_type 1订单号(零担) 3包件码(订单号) 4库存品
|
|
|
|
|
List<UpShelfDataVO> packageList = warehouseUpdownGoodsService.findPackageByUpdownTypeId(updownTypeId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
//有托盘就查询托盘上的数据
|
|
|
|
|
Long trayId = basicdataTrayEntity.getId(); |
|
|
|
|
|
|
|
|
|
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,"托盘未找到打托数据"); |
|
|
|
|
} |
|
|
|
|
Long trayTypeId = trayTypeEntity.getId();//打托方式id
|
|
|
|
|
String type = trayTypeEntity.getType();//打托分类
|
|
|
|
|
List<UpShelfDataVO> listByTrayTypeId = null; |
|
|
|
|
if(PalletProductTypeConstant.CUSTOMIZED.equals(type)){ |
|
|
|
|
upShelfAllocationVO.setTotalNum(trayTypeEntity.getTotalNum()); |
|
|
|
|
listByTrayTypeId = warehouseTrayGoodsService.getUpListByTrayTypeId(trayTypeId); |
|
|
|
|
}else if(PalletProductTypeConstant.ARTIFICIAL.equals(type)){ |
|
|
|
|
upShelfAllocationVO.setTotalNum(trayTypeEntity.getTotalNum()); |
|
|
|
|
listByTrayTypeId = warehouseTrayGoodsService.getZeroUpListByTrayTypeId(trayTypeId); |
|
|
|
|
}else if(PalletProductTypeConstant.STOCKDATA.equals(type)){ |
|
|
|
|
upShelfAllocationVO.setStockTotalNum(trayTypeEntity.getTotalNum()); |
|
|
|
|
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId); |
|
|
|
|
}else if(PalletProductTypeConstant.STOCKNODATA.equals(type)){ |
|
|
|
|
upShelfAllocationVO.setStockTotalNum(trayTypeEntity.getTotalNum()); |
|
|
|
|
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId); |
|
|
|
|
} |
|
|
|
|
upShelfAllocationVO.setList(listByTrayTypeId); |
|
|
|
|
return upShelfAllocationVO; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|