From c25b9e363fe3ec35069f73309d66f3b71cffb49d Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 11 Dec 2024 18:20:51 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E9=99=90=E5=88=B6=202.=E5=8A=A8=E6=80=81=E6=89=98?= =?UTF-8?q?=E7=9B=98=E7=A0=81=E6=89=93=E6=89=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/vo/TrunklineCarsLoadVO.java | 7 +- .../entity/WarehouseConfigEntity.java | 18 +- .../ITrunklineCarsLoadLinePhotoService.java | 3 + ...ineCarsLoadLinePhotoEntityServiceImpl.java | 10 + .../impl/TrunklineCarsLoadServiceImpl.java | 313 ++++++++---------- .../api/WarehouseTrayTypeApiController.java | 31 ++ .../service/IWarehouseTrayTypeService.java | 3 + .../impl/WarehouseTrayTypeServiceImpl.java | 26 +- 8 files changed, 235 insertions(+), 176 deletions(-) diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java index 2249c2757..a09a2541f 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java @@ -1,9 +1,6 @@ package com.logpm.trunkline.vo; -import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; -import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity; -import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; -import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity; +import com.logpm.trunkline.entity.*; import lombok.Data; import java.math.BigDecimal; @@ -58,4 +55,6 @@ public class TrunklineCarsLoadVO extends TrunklineCarsLoadEntity { private Integer isStartPhoto; private Integer isUnloadPhoto; + private List carsLoadLinePhotoEntities = new ArrayList<>(); + } diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java index 869af202d..a33e47485 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.tenant.mp.TenantEntity; @Data @@ -71,6 +70,23 @@ public class WarehouseConfigEntity extends TenantEntity { @ApiModelProperty(value = "预留5") private String reserve5; + /** + * 是否干线上传装车图片 + */ + @ApiModelProperty(value = "是否干线上传装车图片") + private Integer isTrunklineLoadingPhoto; + + /** + * 是否干线上传发车图片 + */ + @ApiModelProperty(value = "是否干线上传发车图片") + private Integer isTrunklineStartPhoto; + + /** + * 是否干线上传卸车图片 + */ + @ApiModelProperty(value = "是否干线上传卸车图片") + private Integer isTrunklineUnloadPhoto; } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLinePhotoService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLinePhotoService.java index ab3b69028..7445c299b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLinePhotoService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLinePhotoService.java @@ -9,4 +9,7 @@ public interface ITrunklineCarsLoadLinePhotoService extends BaseService findListByLoadIdAndWarehouseId(Long loadId, Long warehouseId, Integer type, Integer position); + + List findListByLoadIdListAndWarehouseId(List idList, Long warehouseId); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLinePhotoEntityServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLinePhotoEntityServiceImpl.java index 3d4e7c64d..07fe76776 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLinePhotoEntityServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLinePhotoEntityServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.trunkline.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.trunkline.entity.TrunklineCarsLoadLinePhotoEntity; import com.logpm.trunkline.mapper.TrunklineCarsLoadLinePhotoMapper; import com.logpm.trunkline.service.ITrunklineCarsLoadLinePhotoService; @@ -25,4 +26,13 @@ public class TrunklineCarsLoadLinePhotoEntityServiceImpl extends BaseServiceImpl public List findListByLoadIdAndWarehouseId(Long loadId, Long warehouseId, Integer type, Integer position) { return baseMapper.findListByLoadIdAndWarehouseId(loadId,warehouseId, type, position); } + + @Override + public List findListByLoadIdListAndWarehouseId(List idList, Long warehouseId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("load_id",idList) + .eq("warehouse_id",warehouseId); + List trunklineCarsLoadLinePhotoEntities = baseMapper.selectList(queryWrapper); + return trunklineCarsLoadLinePhotoEntities; + } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index aae2a5f28..6cf5164d3 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -45,14 +45,8 @@ import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient; import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper; import com.logpm.trunkline.service.*; import com.logpm.trunkline.vo.*; -import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity; -import com.logpm.warehouse.entity.WarehouseTrayTypeEntity; -import com.logpm.warehouse.entity.WarehouseWayBillDetail; -import com.logpm.warehouse.entity.WarehouseWaybillEntity; -import com.logpm.warehouse.feign.IWarehouseTrayTypeClient; -import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; -import com.logpm.warehouse.feign.IWarehouseWaybillClient; -import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient; +import com.logpm.warehouse.entity.*; +import com.logpm.warehouse.feign.*; import com.logpm.warehouse.vo.WarehouseWaybillVO; import com.logpm.warehouse.vo.WaybillOrderTotalWeightAndVolumeVO; import lombok.AllArgsConstructor; @@ -139,6 +133,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl> resultList = new ArrayList<>(); - List linePhotoEntityList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, null, null, null); - //把linePhotoEntityList中所有元素的loadLineId放入一个Set集合 - Set loadLineIdSet = linePhotoEntityList.stream().map(TrunklineCarsLoadLinePhotoEntity::getLoadLineId).collect(Collectors.toSet()); - if(CollUtil.isNotEmpty(loadLineIdSet)){ - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("id",loadLineIdSet); - List carsLoadLineList = trunklineCarsLoadLineService.list(queryWrapper); - //把carsLoadLineList转化为以id为key的map - Map carsLoadLineMap = carsLoadLineList.stream().collect(Collectors.toMap(TrunklineCarsLoadLineEntity::getId, Function.identity())); - //把linePhotoEntityList中所有元素以loadLineId进行分组 - Map> linePhotoMap = linePhotoEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadLineId)); + Map> linePhotoMap = linePhotoEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadLineId)); + List loadLineEntityList = trunklineCarsLoadLineService.findListByLoadId(loadId); + List> resultList = new ArrayList<>(); - linePhotoMap.keySet().forEach(loadLineId -> { - Map map = new HashMap<>(); - List trunklineCarsLoadLinePhotoEntities = linePhotoMap.get(loadLineId); - TrunklineCarsLoadLineEntity trunklineCarsLoadLineEntity = carsLoadLineMap.get(loadLineId); - map.put("carsLoadLineEntity",trunklineCarsLoadLineEntity); - - - Map loadingMap = new HashMap<>(); - - //把trunklineCarsLoadLinePhotoEntities通过type=10进行过滤 - List ls = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(10)).collect(Collectors.toList()); - - //把qualityList通过position进行分组 -// List listQian = new ArrayList<>(); -// List listHou = new ArrayList<>(); -// List listZuo = new ArrayList<>(); -// List listYou = new ArrayList<>(); -// Map> listMap = ls.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition)); -// listMap.keySet().forEach(key -> { -// List list = listMap.get(key); -// if(NumberUtil.equals(1,key)){//后 -// listQian.addAll(list); -// }else if(NumberUtil.equals(2,key)){//后 -// listHou.addAll(list); -// }else if(NumberUtil.equals(3,key)){ -// listZuo.addAll(list); -// }else if(NumberUtil.equals(4,key)){ -// listYou.addAll(list); -// } -// }); -// -// loadingMap.put("listQian",listQian); -// loadingMap.put("listHou",listHou); -// loadingMap.put("listZuo",listZuo); -// loadingMap.put("listYou",listYou); - -// Map loadingObject = new HashMap<>(); -// loadingObject.put("loadingList",ls); - - map.put("loadingObject",ls); - - //发车 -// Map qualityMap = new HashMap<>(); - - List qualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(20)).collect(Collectors.toList()); - //把qualityList通过position进行分组 -// List qualityListQian = new ArrayList<>(); -// List qualityListHou = new ArrayList<>(); -// List qualityListZuo = new ArrayList<>(); -// List qualityListYou = new ArrayList<>(); -// Map> qualityListMap = qualityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition)); -// qualityListMap.keySet().forEach(key -> { -// List list = qualityListMap.get(key); -// if(NumberUtil.equals(1,key)){//后 -// qualityListQian.addAll(list); -// }else if(NumberUtil.equals(2,key)){//后 -// qualityListHou.addAll(list); -// }else if(NumberUtil.equals(3,key)){ -// qualityListZuo.addAll(list); -// }else if(NumberUtil.equals(4,key)){ -// qualityListYou.addAll(list); -// } -// }); -// -// qualityMap.put("qualityListQian",qualityListQian); -// qualityMap.put("qualityListHou",qualityListHou); -// qualityMap.put("qualityListZuo",qualityListZuo); -// qualityMap.put("qualityListYou",qualityListYou); - - -// Map yubuMap = new HashMap<>(); -// List yubuListQian = new ArrayList<>(); -// List yubuListHou = new ArrayList<>(); -// List yubuListZuo = new ArrayList<>(); -// List yubuListYou = new ArrayList<>(); - List yubuList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(21)).collect(Collectors.toList()); - //把qualityList通过position进行分组 -// Map> yubuListMap = yubuList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition)); -// yubuListMap.keySet().forEach(key -> { -// List list = yubuListMap.get(key); -// if(NumberUtil.equals(1,key)){//后 -// yubuListQian.addAll(list); -// }else if(NumberUtil.equals(2,key)){//后 -// yubuListHou.addAll(list); -// }else if(NumberUtil.equals(3,key)){ -// yubuListZuo.addAll(list); -// }else if(NumberUtil.equals(4,key)){ -// yubuListYou.addAll(list); -// } -// }); -// -// yubuMap.put("yubuListQian",yubuListQian); -// yubuMap.put("yubuListHou",yubuListHou); -// yubuMap.put("yubuListZuo",yubuListZuo); -// yubuMap.put("yubuListYou",yubuListYou); - - -// Map startObject = new HashMap<>(); -// startObject.put("qualityList",qualityList); -// startObject.put("yubuList",yubuList); - - map.put("startObject",qualityList.addAll(yubuList)); - - //卸车 - Map unloadQualityMap = new HashMap<>(); - - List unloadQualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(30)).collect(Collectors.toList()); - //把qualityList通过position进行分组 -// List unloadQualityListQian = new ArrayList<>(); -// List unloadQualityListHou = new ArrayList<>(); -// List unloadQualityListZuo = new ArrayList<>(); -// List unloadQualityListYou = new ArrayList<>(); -// Map> unloadQualityListMap = unloadQualityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition)); -// qualityListMap.keySet().forEach(key -> { -// List list = unloadQualityListMap.get(key); -// if(NumberUtil.equals(1,key)){//后 -// unloadQualityListQian.addAll(list); -// }else if(NumberUtil.equals(2,key)){//后 -// unloadQualityListHou.addAll(list); -// }else if(NumberUtil.equals(3,key)){ -// unloadQualityListZuo.addAll(list); -// }else if(NumberUtil.equals(4,key)){ -// unloadQualityListYou.addAll(list); -// } -// }); -// -// unloadQualityMap.put("unloadQualityListQian",unloadQualityListQian); -// unloadQualityMap.put("unloadQualityListHou",unloadQualityListHou); -// unloadQualityMap.put("unloadQualityListZuo",unloadQualityListZuo); -// unloadQualityMap.put("unloadQualityListYou",unloadQualityListYou); - - -// Map protectionMap = new HashMap<>(); - - List protectionList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(31)).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(loadLineEntityList)){ -// protectionMap.put("protectionList",protectionList); + loadLineEntityList.forEach(loadLineEntity -> { + Long loadLineId = loadLineEntity.getId(); -// Map unloadObject = new HashMap<>(); -// unloadObject.put("unloadQualityList",unloadQualityList); -// unloadObject.put("protectionList",protectionList); + Map map = new HashMap<>(); + map.put("carsLoadLineEntity",loadLineEntity); - map.put("unloadObject",unloadQualityList.addAll(protectionList)); + List trunklineCarsLoadLinePhotoEntities = linePhotoMap.get(loadLineId); + if(CollUtil.isNotEmpty(trunklineCarsLoadLinePhotoEntities)){ + List ls = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(10)).collect(Collectors.toList()); + map.put("loadingObject",ls); + List qualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(20)).collect(Collectors.toList()); + List yubuList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(21)).collect(Collectors.toList()); + qualityList.addAll(yubuList); + map.put("startObject",qualityList); + List unloadQualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(30)).collect(Collectors.toList()); + List protectionList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(31)).collect(Collectors.toList()); + unloadQualityList.addAll(protectionList); + map.put("unloadObject",unloadQualityList); + } resultList.add(map); + }); - } + } return R.data(resultList); } @@ -3560,6 +3439,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl pageList = baseMapper.carsLoadPageList(page, loadCarsDTO); List records = pageList.getRecords(); + //把records中所有元素的id放入一个List + List idList = records.stream().map(TrunklineCarsLoadVO::getId).collect(Collectors.toList()); + List carsLoadLinePhotoEntities = carsLoadLinePhotoService.findListByLoadIdListAndWarehouseId(idList,warehouseId); + Map> map = new HashMap<>(); + if(CollUtil.isNotEmpty(carsLoadLinePhotoEntities)){ + //把carsLoadLinePhotoEntities中所有元素通过loadId进行分组 + map = carsLoadLinePhotoEntities.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadId)); + } + //循环records,获取字典值 for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) { String loadStatus = trunklineCarsLoadVO.getLoadStatus(); @@ -4321,6 +4236,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl trunklineCarsLoadLinePhotoEntities = map.get(trunklineCarsLoadVO.getId()); + trunklineCarsLoadVO.setCarsLoadLinePhotoEntities(trunklineCarsLoadLinePhotoEntities); } pageList.setRecords(records); return R.data(pageList); @@ -7405,6 +7323,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl pageList = baseMapper.arriveUnloadPageList(page, loadCarsDTO); List records = pageList.getRecords(); + //把records中所有元素的id放入一个List + List idList = records.stream().map(TrunklineCarsLoadVO::getId).collect(Collectors.toList()); + List carsLoadLinePhotoEntities = carsLoadLinePhotoService.findListByLoadIdListAndWarehouseId(idList,warehouseId); + Map> map = new HashMap<>(); + if(CollUtil.isNotEmpty(carsLoadLinePhotoEntities)){ + //把carsLoadLinePhotoEntities中所有元素通过loadId进行分组 + map = carsLoadLinePhotoEntities.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadId)); + } + for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) { Long loadId = trunklineCarsLoadVO.getId(); TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); @@ -11338,6 +11299,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl trunklineCarsLoadLinePhotoEntities = map.get(loadId); + trunklineCarsLoadVO.setCarsLoadLinePhotoEntities(trunklineCarsLoadLinePhotoEntities); } pageList.setRecords(records); return R.data(pageList); @@ -11510,6 +11474,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl downPackageCodeDTOS, Long warehouseId); + + BasicdataTrayEntity createTray(Long warehouseId, String warehouseCode); } 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 3bdc52dd4..ccbd04f1a 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 @@ -39,10 +39,7 @@ import com.logpm.warehouse.service.*; import com.logpm.warehouse.vo.*; import com.logpm.warehouse.wrapper.WarehouseTrayTypeWrapper; import lombok.extern.log4j.Log4j2; -import org.springblade.common.constant.DictBizConstant; -import org.springblade.common.constant.RedisKeyConstant; -import org.springblade.common.constant.TenantNum; -import org.springblade.common.constant.WorkNodeEnums; +import org.springblade.common.constant.*; import org.springblade.common.constant.apiwarehouse.PalletProductTypeConstant; import org.springblade.common.constant.broadcast.FanoutConstants; import org.springblade.common.constant.order.OrderFreezeStatusConstant; @@ -141,6 +138,8 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl