diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml index 881a9d798..0a525298a 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml @@ -18,7 +18,7 @@ diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java index 032d17190..6b7453958 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java @@ -19,14 +19,11 @@ import com.logpm.warehouse.dto.ZeroOrderVO; import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity; import com.logpm.warehouse.entity.WarehouseTrayGoodsLogEntity; import com.logpm.warehouse.entity.WarehouseTrayTypeEntity; +import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; import com.logpm.warehouse.mapper.WarehouseTrayTypeMapper; -import com.logpm.warehouse.service.IWarehouseTaryAllocationService; -import com.logpm.warehouse.service.IWarehouseTrayGoodsLogService; -import com.logpm.warehouse.service.IWarehouseTrayGoodsService; -import com.logpm.warehouse.service.IWarehouseTrayTypeService; +import com.logpm.warehouse.service.*; import com.logpm.warehouse.vo.*; import com.logpm.warehouse.wrapper.WarehouseTrayTypeWrapper; -import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.apiwarehouse.PalletProductTypeConstant; @@ -35,6 +32,8 @@ import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.system.cache.DictBizCache; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,24 +44,27 @@ import java.util.Objects; @Log4j2 @Service -@AllArgsConstructor public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl implements IWarehouseTrayTypeService { - private final IWarehouseTrayGoodsService warehouseTrayGoodsService; - - private final IDistributionStockArticleClient distributionStockArticleClient; - - private final IDistributionParcelListClient distributionParcelListClient; - - private final IBasicMaterialClient basicMaterialClient; - - private final IDistributionStockListClient distributionStockListClient; - - private final IBasicdataTrayClient basicdataTrayClient; - - private final IWarehouseTrayGoodsLogService warehouseTrayGoodsLogService; - - private final IWarehouseTaryAllocationService warehouseTaryAllocationService; + @Autowired + private IWarehouseTrayGoodsService warehouseTrayGoodsService; + @Autowired + private IDistributionStockArticleClient distributionStockArticleClient; + @Autowired + private IDistributionParcelListClient distributionParcelListClient; + @Autowired + private IBasicMaterialClient basicMaterialClient; + @Autowired + private IDistributionStockListClient distributionStockListClient; + @Autowired + private IBasicdataTrayClient basicdataTrayClient; + @Autowired + private IWarehouseTrayGoodsLogService warehouseTrayGoodsLogService; + @Autowired + private IWarehouseTaryAllocationService warehouseTaryAllocationService; + @Autowired + @Lazy + private IWarehouseUpdownGoodsService warehouseUpdownGoodsService; @Override public IPage orderPageList(TrayTypeDTO trayTypeDTO) { @@ -107,6 +109,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl queryTrayTypeWrapper = new QueryWrapper<>(); queryTrayTypeWrapper.eq("tray_code",trayCode) @@ -167,6 +176,14 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl updownGoodsEntityQueryWrapper = new QueryWrapper<>(); + updownGoodsEntityQueryWrapper.eq("association_value",orderPackageCode); + WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(updownGoodsEntityQueryWrapper); + if(!Objects.isNull(updownGoodsEntity)){ + log.warn("#########orderScanOrderPackageCode: 包件已上架 orderPackageCode={}",orderPackageCode); + return R.fail(403,"包件已上架"); + } + BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode); if(Objects.isNull(basicdataTrayEntity)){ log.warn("#########orderScanOrderPackageCode: 未找到托盘信息 trayCode={}",trayCode); @@ -482,9 +499,46 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl getZeroOrderByWaybillCode(String waybillCode) { +// List zeroOrderByWaybillCode = baseMapper.getZeroOrderByWaybillCode(waybillCode); +// for (TrayTypeDataListVO trayTypeDataListVO:zeroOrderByWaybillCode){ +// +// String ordeCode = trayTypeDataListVO.getDataCode(); +// Long orderId = trayTypeDataListVO.getDataId(); +// //计算零担订单可用数量 +// countZeroAvailableNum(orderId); +// +// } return baseMapper.getZeroOrderByWaybillCode(waybillCode); } + /** + * 计算零担订单的可用数量 + * @param orderId + * @return + */ + private Integer countZeroAvailableNum(Long orderId) { + //计算已打托数量 + QueryWrapper trayGoodsEntityQueryWrapper = new QueryWrapper<>(); + trayGoodsEntityQueryWrapper.eq("association_id",orderId) + .eq("association_type",1); + List trayGoodsList = warehouseTrayGoodsService.list(trayGoodsEntityQueryWrapper); + QueryWrapper updownGoodsEntityQueryWrapper = new QueryWrapper<>(); + trayGoodsEntityQueryWrapper.eq("association_id",orderId) + .eq("association_type",1); + List updownGoodsList = warehouseUpdownGoodsService.list(updownGoodsEntityQueryWrapper); + for (WarehouseTrayGoodsEntity trayGoodsEntity:trayGoodsList){ + + for (WarehouseUpdownGoodsEntity updownGoodsEntity:updownGoodsList){ + + } + + } + + + + return 0; + } + @Transactional(rollbackFor = Exception.class) @Override public R enterZeroOrderByTrayCode(String trayType,String trayCode, List zeroList) { @@ -1225,12 +1279,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl taryAllocationEntityQueryWrapper = new QueryWrapper<>(); + taryAllocationEntityQueryWrapper.eq("allocation_id",allocationId) + .eq("is_deleted",0); + WarehouseTaryAllocationEntity taryAllocationEntity = warehouseTaryAllocationService.getOne(taryAllocationEntityQueryWrapper); +// BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId); + if(!Objects.isNull(taryAllocationEntity)){ //有托盘,托盘下托 warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,"包件下架:同步下托"); } @@ -810,6 +814,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl taryAllocationEntityQueryWrapper = new QueryWrapper<>(); + taryAllocationEntityQueryWrapper.eq("allocation_id",allocationId) + .eq("is_deleted",0); + WarehouseTaryAllocationEntity taryAllocationEntity = warehouseTaryAllocationService.getOne(taryAllocationEntityQueryWrapper); + if(!Objects.isNull(taryAllocationEntity)){ //绑定了托盘 - warehouseTrayTypeService.downTrayGoodsByTrayId(trayEntity.getId(),"下架:按库位下架"); + warehouseTaryAllocationService.deleteById(taryAllocationEntity); +// warehouseTrayTypeService.downTrayGoodsByTrayId(trayEntity.getId(),"下架:按库位下架"); } return R.success("下架成功"); } @@ -1020,7 +1027,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("tary_id",trayId) + queryWrapper.eq("tray_id",trayId) .eq("is_deleted",0); WarehouseTaryAllocationEntity taryAllocationEntity = warehouseTaryAllocationService.getOne(queryWrapper); if(Objects.isNull(taryAllocationEntity)){ @@ -1029,7 +1036,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl