diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml index b902457c4..7b1595641 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml @@ -240,10 +240,14 @@ - and t.id in + and t.client_id in (select client_id from logpm_basicdata_price where id in #{item} - + ) + and t.brand_id in (select brand_id from logpm_basicdata_price where id in + + #{item} + ) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java index 7e2009499..afbb06221 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java @@ -127,7 +127,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -539,48 +538,65 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl fullVehicleEntities = fullVehicleService.list(Wrappers.lambdaQuery().in(BasicdataPriceFullVehicleEntity::getPriceId, priceIdSet)); if (CollUtil.isNotEmpty(fullVehicleEntities)) { List fullVehicleV2Excels = new ArrayList<>(); - // 业务id + 类型 + 车型 = 一条数据 - Map> fullVehicleMap = fullVehicleEntities.stream().collect(Collectors.groupingBy(BasicdataPriceFullVehicleEntity::getBoId)); - for (Map.Entry> fullVehicleMapEntry : fullVehicleMap.entrySet()) { - Long fullVehicleBoId = fullVehicleMapEntry.getKey(); - List value = fullVehicleMapEntry.getValue(); - Map> fullVehicleTypeMap = value.stream().collect(Collectors.groupingBy(BasicdataPriceFullVehicleEntity::getVehicleType)); - for (Map.Entry> fullVehicleTypeMapEntry : fullVehicleTypeMap.entrySet()) { - Long fullVehicleType = fullVehicleTypeMapEntry.getKey(); - List fullVehicleTypeValue = fullVehicleTypeMapEntry.getValue(); - // 一条数据 - BasicdataPriceFullVehicleV2Excel fullVehicleV2Excel = new BasicdataPriceFullVehicleV2Excel(); - BasicdataPricePageV2VO pricePageV2VO = null; - if (basicdataPricePageV2VOMap.containsKey(fullVehicleBoId)) { - // 不是路径 - pricePageV2VO = basicdataPricePageV2VOMap.get(fullVehicleBoId); - } else { - // 路径 + // 一套价格体系内 + Map> priceFullMap = fullVehicleEntities.stream().collect(Collectors.groupingBy(BasicdataPriceFullVehicleEntity::getPriceId)); + for (Map.Entry> priceFullMapEntry : priceFullMap.entrySet()) { + Long key = priceFullMapEntry.getKey(); + List value = priceFullMapEntry.getValue(); + // 带路径的 + List collect = value.stream().filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + Map fullVehicleV2ExcelMap = new HashMap<>(); + Set fullVehicleV2ExcelSet = new HashSet<>(); + if (CollUtil.isNotEmpty(collect)) { + for (BasicdataPriceFullVehicleEntity fullVehicleEntity : collect) { + Long fullVehicleBoId = fullVehicleEntity.getBoId(); + BasicdataPricePageV2VO pricePageV2VO = null; BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); Long priceId = priceRouteEntity.getPriceId(); pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); - fullVehicleV2Excel.setStartProvince(regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId()))); - fullVehicleV2Excel.setStartCity(regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId()))); - fullVehicleV2Excel.setStartArea(regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId()))); - fullVehicleV2Excel.setEndProvince(regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId()))); - fullVehicleV2Excel.setEndCity(regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId()))); - fullVehicleV2Excel.setEndArea(regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId()))); - fullVehicleV2Excel.setSendOrg(clientMap.get(priceRouteEntity.getSendOrgId())); - } - fullVehicleV2Excel.setVehicleType(vehicleTypeMap.get(fullVehicleType)); - if (ObjectUtil.isNotEmpty(pricePageV2VO)) { - fullVehicleV2Excel.setClient(pricePageV2VO.getClientName()); - fullVehicleV2Excel.setBrand(pricePageV2VO.getBrandName()); - fullVehicleV2Excel.setEffectiveTime(DateUtil.formatDate(pricePageV2VO.getEffectiveTime())); - fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); - } - for (BasicdataPriceFullVehicleEntity basicdataPriceFullVehicleEntity : fullVehicleTypeValue) { - Integer type = basicdataPriceFullVehicleEntity.getType(); - Double price = basicdataPriceFullVehicleEntity.getPrice(); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + Long vehicleType = fullVehicleEntity.getVehicleType(); + String vehicleTypeStr = Convert.toStr(ObjectUtil.isNotEmpty(vehicleType) ? vehicleType : ""); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + vehicleTypeStr + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + BasicdataPriceFullVehicleV2Excel fullVehicleV2Excel = null; + if (fullVehicleV2ExcelMap.containsKey(onlyKey)) { + fullVehicleV2Excel = fullVehicleV2ExcelMap.get(onlyKey); + } else { + fullVehicleV2Excel = new BasicdataPriceFullVehicleV2Excel(); + fullVehicleV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + fullVehicleV2ExcelSet.add(clientName + brandName + vehicleTypeStr); + } + // 路径 + fullVehicleV2Excel.setStartProvince(startProvince); + fullVehicleV2Excel.setStartCity(startCity); + fullVehicleV2Excel.setStartArea(startCounty); + fullVehicleV2Excel.setEndProvince(endProvince); + fullVehicleV2Excel.setEndCity(endCity); + fullVehicleV2Excel.setEndArea(endCounty); + fullVehicleV2Excel.setSendOrg(sendOrg); + fullVehicleV2Excel.setVehicleType(vehicleTypeMap.get(vehicleType)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(DateUtil.formatDate(pricePageV2VO.getEffectiveTime())); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + Integer type = fullVehicleEntity.getType(); + Double price = fullVehicleEntity.getPrice(); String priceStr = Convert.toStr(price); if (ObjectUtil.isNotEmpty(type)) { if (type == 1) { @@ -592,77 +608,297 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl collect1 = value.stream().filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(collect1)) { + for (BasicdataPriceFullVehicleEntity basicdataPriceFullVehicleEntity : collect1) { + Long priceId = basicdataPriceFullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long vehicleType = basicdataPriceFullVehicleEntity.getVehicleType(); + String vehicleTypeStr = Convert.toStr(ObjectUtil.isNotEmpty(vehicleType) ? vehicleType : ""); + if (fullVehicleV2ExcelSet.contains(clientName + brandName + vehicleTypeStr)) { + if (CollUtil.isNotEmpty(fullVehicleV2ExcelMap)) { + for (Map.Entry priceFullVehicleEntity : fullVehicleV2ExcelMap.entrySet()) { + String key1 = priceFullVehicleEntity.getKey(); + BasicdataPriceFullVehicleV2Excel value1 = priceFullVehicleEntity.getValue(); + if (key1.contains(clientName + brandName + vehicleTypeStr)) { + // 存在 + Integer type = basicdataPriceFullVehicleEntity.getType(); + Double price = basicdataPriceFullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + value1.setPickupPrice(priceStr); + } else if (type == 2) { + value1.setTrunkLinePrice(priceStr); + } else if (type == 4) { + value1.setDispatchPrice(priceStr); + } + } + } + } + } + } else { + // 不存在 + BasicdataPriceFullVehicleV2Excel fullVehicleV2Excel = null; + if (fullVehicleV2ExcelMap.containsKey(clientName + brandName + vehicleTypeStr)) { + fullVehicleV2Excel = fullVehicleV2ExcelMap.get(clientName + brandName + vehicleTypeStr); + } else { + fullVehicleV2Excel = new BasicdataPriceFullVehicleV2Excel(); + fullVehicleV2Excel.setVehicleType(vehicleTypeMap.get(vehicleType)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(pricePageV2VO.getClientName()); + fullVehicleV2Excel.setBrand(pricePageV2VO.getBrandName()); + fullVehicleV2Excel.setEffectiveTime(DateUtil.formatDate(pricePageV2VO.getEffectiveTime())); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + fullVehicleV2ExcelMap.put(clientName + brandName + vehicleTypeStr, fullVehicleV2Excel); + } + Integer type = basicdataPriceFullVehicleEntity.getType(); + Double price = basicdataPriceFullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + fullVehicleV2Excel.setPickupPrice(priceStr); + } else if (type == 2) { + fullVehicleV2Excel.setTrunkLinePrice(priceStr); + } else if (type == 4) { + fullVehicleV2Excel.setDispatchPrice(priceStr); + } + } + } + } + } + if (CollUtil.isNotEmpty(fullVehicleV2ExcelMap)) { + fullVehicleV2Excels.addAll(fullVehicleV2ExcelMap.values()); } } + + if (CollUtil.isNotEmpty(fullVehicleV2Excels)) { excelWriter.write(fullVehicleV2Excels, writeSheet2, table2); - }else{ + } else { excelWriter.write(new ArrayList(), writeSheet2, table2); } - }else{ + } else { excelWriter.write(new ArrayList(), writeSheet2, table2); } + // 查询出一般计费数据 List generalEntities = generalService.list(Wrappers.lambdaQuery().in(BasicdataPriceGeneralEntity::getPriceId, priceIdSet)); if (CollUtil.isNotEmpty(generalEntities)) { List generalV2Excels = new ArrayList<>(); // 业务id + 类型 + 车型 = 一条数据 - Map> generalMap = generalEntities.stream().collect(Collectors.groupingBy(BasicdataPriceGeneralEntity::getBoId)); - for (Map.Entry> generalMapEntry : generalMap.entrySet()) { - Long generalBoId = generalMapEntry.getKey(); - List value = generalMapEntry.getValue(); - // 一条数据 - BasicdataPriceGeneralV2Excel generalV2Excel = new BasicdataPriceGeneralV2Excel(); - BasicdataPricePageV2VO pricePageV2VO = null; - if (basicdataPricePageV2VOMap.containsKey(generalBoId)) { - // 不是路径 - pricePageV2VO = basicdataPricePageV2VOMap.get(generalBoId); - } else { - // 路径 - BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(generalBoId); - Long priceId = priceRouteEntity.getPriceId(); - pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); - generalV2Excel.setStartProvince(regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId()))); - generalV2Excel.setStartCity(regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId()))); - generalV2Excel.setStartArea(regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId()))); - generalV2Excel.setEndProvince(regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId()))); - generalV2Excel.setEndCity(regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId()))); - generalV2Excel.setEndArea(regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId()))); - generalV2Excel.setSendOrg(clientMap.get(priceRouteEntity.getSendOrgId())); - } - if (ObjectUtil.isNotEmpty(pricePageV2VO)) { - generalV2Excel.setClient(pricePageV2VO.getClientName()); - generalV2Excel.setBrand(pricePageV2VO.getBrandName()); - generalV2Excel.setEffectiveTime(DateUtil.formatDate(pricePageV2VO.getEffectiveTime())); - generalV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); - generalV2Excel.setDispatchUpwardJudgment(pricePageV2VO.getDispatchUpwardJudgment()); - generalV2Excel.setDispatchUpwardJudgmentCost(pricePageV2VO.getDispatchUpwardJudgmentCost()); + Map> priceFullMap = generalEntities.stream().collect(Collectors.groupingBy(BasicdataPriceGeneralEntity::getPriceId)); + for (Map.Entry> priceFullMapEntry : priceFullMap.entrySet()) { + Long key = priceFullMapEntry.getKey(); + List value = priceFullMapEntry.getValue(); + // 带路径的 + List collect = value.stream().filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + Map fullVehicleV2ExcelMap = new HashMap<>(); + Set fullVehicleV2ExcelSet = new HashSet<>(); + if (CollUtil.isNotEmpty(collect)) { + for (BasicdataPriceGeneralEntity fullVehicleEntity : collect) { + Long fullVehicleBoId = fullVehicleEntity.getBoId(); + BasicdataPricePageV2VO pricePageV2VO = null; + BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + Long priceId = priceRouteEntity.getPriceId(); + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + BasicdataPriceGeneralV2Excel fullVehicleV2Excel = null; + if (fullVehicleV2ExcelMap.containsKey(onlyKey)) { + fullVehicleV2Excel = fullVehicleV2ExcelMap.get(onlyKey); + } else { + fullVehicleV2Excel = new BasicdataPriceGeneralV2Excel(); + fullVehicleV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + fullVehicleV2ExcelSet.add(clientName + brandName); + } + // 路径 + fullVehicleV2Excel.setStartProvince(startProvince); + fullVehicleV2Excel.setStartCity(startCity); + fullVehicleV2Excel.setStartArea(startCounty); + fullVehicleV2Excel.setEndProvince(endProvince); + fullVehicleV2Excel.setEndCity(endCity); + fullVehicleV2Excel.setEndArea(endCounty); + fullVehicleV2Excel.setSendOrg(sendOrg); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(DateUtil.formatDate(pricePageV2VO.getEffectiveTime())); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + Integer type = fullVehicleEntity.getServiceType(); + Double price = fullVehicleEntity.getMinCost(); + Double additionalCost = fullVehicleEntity.getAdditionalCost(); + String priceStr = Convert.toStr(price); + String additionalCostStr = Convert.toStr(additionalCost); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + fullVehicleV2Excel.setPickupMinCost(priceStr); + fullVehicleV2Excel.setPickupAddCost(additionalCostStr); + } else if (type == 2) { + fullVehicleV2Excel.setTrunkLineMinCost(priceStr); + fullVehicleV2Excel.setTrunkLineAddCost(additionalCostStr); + } else if (type == 4) { + fullVehicleV2Excel.setDispatchMinCost(priceStr); + fullVehicleV2Excel.setDispatchAddCost(additionalCostStr); + } else if (type == 5) { + fullVehicleV2Excel.setDispatchLeaveBehindMinCost(priceStr); + fullVehicleV2Excel.setDispatchLeaveBehindAddCost(additionalCostStr); + } + } + } } - for (BasicdataPriceGeneralEntity basicdataPriceFullVehicleEntity : value) { - Integer type = basicdataPriceFullVehicleEntity.getServiceType(); - Double price = basicdataPriceFullVehicleEntity.getMinCost(); - Double additionalCost = basicdataPriceFullVehicleEntity.getAdditionalCost(); - String priceStr = Convert.toStr(price); - String additionalCostStr = Convert.toStr(additionalCost); - if (ObjectUtil.isNotEmpty(type)) { - if (type == 1) { - generalV2Excel.setPickupMinCost(priceStr); - generalV2Excel.setPickupAddCost(additionalCostStr); - } else if (type == 2) { - generalV2Excel.setTrunkLineMinCost(priceStr); - generalV2Excel.setTrunkLineAddCost(additionalCostStr); - } else if (type == 4) { - generalV2Excel.setDispatchMinCost(priceStr); - generalV2Excel.setDispatchAddCost(additionalCostStr); - } else if (type == 5) { - generalV2Excel.setDispatchLeaveBehindMinCost(priceStr); - generalV2Excel.setDispatchLeaveBehindAddCost(additionalCostStr); + // 不带路径的情况下 将数据分摊到每条数据中,不包含的情况下 则单独一行数据处理 + List collect1 = value.stream().filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(collect1)) { + for (BasicdataPriceGeneralEntity basicdataPriceFullVehicleEntity : collect1) { + Long priceId = basicdataPriceFullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + if (fullVehicleV2ExcelSet.contains(clientName + brandName)) { + if (CollUtil.isNotEmpty(fullVehicleV2ExcelMap)) { + for (Map.Entry priceFullVehicleEntity : fullVehicleV2ExcelMap.entrySet()) { + String key1 = priceFullVehicleEntity.getKey(); + BasicdataPriceGeneralV2Excel value1 = priceFullVehicleEntity.getValue(); + if (key1.contains(clientName + brandName)) { + // 存在 + Integer type = basicdataPriceFullVehicleEntity.getServiceType(); + Double price = basicdataPriceFullVehicleEntity.getMinCost(); + Double additionalCost = basicdataPriceFullVehicleEntity.getAdditionalCost(); + String priceStr = Convert.toStr(price); + String additionalCostStr = Convert.toStr(additionalCost); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + value1.setPickupMinCost(priceStr); + value1.setPickupAddCost(additionalCostStr); + } else if (type == 2) { + value1.setTrunkLineMinCost(priceStr); + value1.setTrunkLineAddCost(additionalCostStr); + } else if (type == 4) { + value1.setDispatchMinCost(priceStr); + value1.setDispatchAddCost(additionalCostStr); + } else if (type == 5) { + value1.setDispatchLeaveBehindMinCost(priceStr); + value1.setDispatchLeaveBehindAddCost(additionalCostStr); + } + } + } + } + } + } else { + // 不存在 + BasicdataPriceGeneralV2Excel fullVehicleV2Excel = null; + if (fullVehicleV2ExcelMap.containsKey(clientName + brandName)) { + fullVehicleV2Excel = fullVehicleV2ExcelMap.get(clientName + brandName); + } else { + fullVehicleV2Excel = new BasicdataPriceGeneralV2Excel(); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(pricePageV2VO.getClientName()); + fullVehicleV2Excel.setBrand(pricePageV2VO.getBrandName()); + fullVehicleV2Excel.setEffectiveTime(DateUtil.formatDate(pricePageV2VO.getEffectiveTime())); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + fullVehicleV2ExcelMap.put(clientName + brandName, fullVehicleV2Excel); + } + Integer type = basicdataPriceFullVehicleEntity.getServiceType(); + Double price = basicdataPriceFullVehicleEntity.getMinCost(); + Double additionalCost = basicdataPriceFullVehicleEntity.getAdditionalCost(); + String priceStr = Convert.toStr(price); + String additionalCostStr = Convert.toStr(additionalCost); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + fullVehicleV2Excel.setPickupMinCost(priceStr); + fullVehicleV2Excel.setPickupAddCost(additionalCostStr); + } else if (type == 2) { + fullVehicleV2Excel.setTrunkLineMinCost(priceStr); + fullVehicleV2Excel.setTrunkLineAddCost(additionalCostStr); + } else if (type == 4) { + fullVehicleV2Excel.setDispatchMinCost(priceStr); + fullVehicleV2Excel.setDispatchAddCost(additionalCostStr); + } else if (type == 5) { + fullVehicleV2Excel.setDispatchLeaveBehindMinCost(priceStr); + fullVehicleV2Excel.setDispatchLeaveBehindAddCost(additionalCostStr); + } + } } } } - generalV2Excels.add(generalV2Excel); + if (CollUtil.isNotEmpty(fullVehicleV2ExcelMap)) { + generalV2Excels.addAll(fullVehicleV2ExcelMap.values()); + } } + + // Map> generalMap = generalEntities.stream().collect(Collectors.groupingBy(BasicdataPriceGeneralEntity::getBoId)); + // Map generalV2ExcelMap = new HashMap<>(); + // for (Map.Entry> generalMapEntry : generalMap.entrySet()) { + // Long generalBoId = generalMapEntry.getKey(); + // List value = generalMapEntry.getValue(); + // // 一条数据 = + // BasicdataPriceGeneralV2Excel generalV2Excel = new BasicdataPriceGeneralV2Excel(); + // BasicdataPricePageV2VO pricePageV2VO = null; + // if (basicdataPricePageV2VOMap.containsKey(generalBoId)) { + // // 不是路径 + // pricePageV2VO = basicdataPricePageV2VOMap.get(generalBoId); + // } else { + // // 路径 + // BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(generalBoId); + // Long priceId = priceRouteEntity.getPriceId(); + // pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + // generalV2Excel.setStartProvince(regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId()))); + // generalV2Excel.setStartCity(regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId()))); + // generalV2Excel.setStartArea(regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId()))); + // generalV2Excel.setEndProvince(regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId()))); + // generalV2Excel.setEndCity(regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId()))); + // generalV2Excel.setEndArea(regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId()))); + // generalV2Excel.setSendOrg(clientMap.get(priceRouteEntity.getSendOrgId())); + // } + // if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + // generalV2Excel.setClient(pricePageV2VO.getClientName()); + // generalV2Excel.setBrand(pricePageV2VO.getBrandName()); + // generalV2Excel.setEffectiveTime(DateUtil.formatDate(pricePageV2VO.getEffectiveTime())); + // generalV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + // generalV2Excel.setDispatchUpwardJudgment(pricePageV2VO.getDispatchUpwardJudgment()); + // generalV2Excel.setDispatchUpwardJudgmentCost(pricePageV2VO.getDispatchUpwardJudgmentCost()); + // } + // for (BasicdataPriceGeneralEntity basicdataPriceFullVehicleEntity : value) { + // Integer type = basicdataPriceFullVehicleEntity.getServiceType(); + // Double price = basicdataPriceFullVehicleEntity.getMinCost(); + // Double additionalCost = basicdataPriceFullVehicleEntity.getAdditionalCost(); + // String priceStr = Convert.toStr(price); + // String additionalCostStr = Convert.toStr(additionalCost); + // if (ObjectUtil.isNotEmpty(type)) { + // if (type == 1) { + // generalV2Excel.setPickupMinCost(priceStr); + // generalV2Excel.setPickupAddCost(additionalCostStr); + // } else if (type == 2) { + // generalV2Excel.setTrunkLineMinCost(priceStr); + // generalV2Excel.setTrunkLineAddCost(additionalCostStr); + // } else if (type == 4) { + // generalV2Excel.setDispatchMinCost(priceStr); + // generalV2Excel.setDispatchAddCost(additionalCostStr); + // } else if (type == 5) { + // generalV2Excel.setDispatchLeaveBehindMinCost(priceStr); + // generalV2Excel.setDispatchLeaveBehindAddCost(additionalCostStr); + // } + // } + // } + // generalV2Excels.add(generalV2Excel); + // } if (CollUtil.isNotEmpty(generalV2Excels)) { excelWriter.write(generalV2Excels, writeSheet3, table3); } else { @@ -671,61 +907,359 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl categoryMap = new HashMap<>(); + Map categoryV2ExcelMap = new HashMap<>(); + // 价格 + 品类 + 路径 + Set fullVehicleV2ExcelSet = new HashSet<>(); + // 价格 + 路径 + Set basicRouteSet = new HashSet<>(); + // 价格 + 品类 + Set basicCategorySet = new HashSet<>(); + // 价格 + Set basicSet = new HashSet<>(); List basicEntities = categoryBasicService.list(Wrappers.lambdaQuery().in(BasicdataPriceCategoryBasicEntity::getPriceId, priceIdSet)); + List warehouseEntities = categoryWarehouseService.list(Wrappers.lambdaQuery().in(BasicdataPriceCategoryWarehouseEntity::getPriceId, priceIdSet)); + List dispatchEntities = categoryDispatchService.list(Wrappers.lambdaQuery().in(BasicdataPriceCategoryDispatchEntity::getPriceId, priceIdSet)); + //价格 + 品类 + 路径 if (CollUtil.isNotEmpty(basicEntities)) { - // 业务id + 类型 + 车型 = 一条数据 - Map> basicMap = basicEntities.stream().collect(Collectors.groupingBy(BasicdataPriceCategoryBasicEntity::getBoId)); - for (Map.Entry> basicMapEntry : basicMap.entrySet()) { - Long fullVehicleBoId = basicMapEntry.getKey(); - List value = basicMapEntry.getValue(); - Map> basicCategoryMap = value.stream().collect(Collectors.groupingBy(entity -> Optional.ofNullable(entity.getCategoryId()) - .map(String::valueOf) - .orElse(""))); - for (Map.Entry> basicCategoryMapEntry : basicCategoryMap.entrySet()) { - String categoryId = basicCategoryMapEntry.getKey(); - List categoryBasicEntities = basicCategoryMapEntry.getValue(); - // 一条数据 - BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // 提货干线 有路径 + 有品类 + List routeCategoryBaseList = basicEntities.stream() + .filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isNotEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryBasicEntity fullVehicleEntity : routeCategoryBaseList) { + Long fullVehicleBoId = fullVehicleEntity.getBoId(); BasicdataPricePageV2VO pricePageV2VO = null; - if (basicdataPricePageV2VOMap.containsKey(fullVehicleBoId)) { - // 不是路径 - pricePageV2VO = basicdataPricePageV2VOMap.get(fullVehicleBoId); + BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + Long priceId = priceRouteEntity.getPriceId(); + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyRouteKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyCategoryKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr; + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + if (categoryV2ExcelMap.containsKey(onlyKey)) { + fullVehicleV2Excel = categoryV2ExcelMap.get(onlyKey); } else { + fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); // 路径 - BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); - Long priceId = priceRouteEntity.getPriceId(); - pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); - fullVehicleV2Excel.setStartProvince(regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId()))); - fullVehicleV2Excel.setStartCity(regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId()))); - fullVehicleV2Excel.setStartArea(regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId()))); - fullVehicleV2Excel.setEndProvince(regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId()))); - fullVehicleV2Excel.setEndCity(regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId()))); - fullVehicleV2Excel.setEndArea(regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId()))); - fullVehicleV2Excel.setSendOrg(clientMap.get(priceRouteEntity.getSendOrgId())); + fullVehicleV2Excel.setStartProvince(startProvince); + fullVehicleV2Excel.setStartCity(startCity); + fullVehicleV2Excel.setStartArea(startCounty); + fullVehicleV2Excel.setEndProvince(endProvince); + fullVehicleV2Excel.setEndCity(endCity); + fullVehicleV2Excel.setEndArea(endCounty); + fullVehicleV2Excel.setSendOrg(sendOrg); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + fullVehicleV2ExcelSet.add(onlyKey); + basicRouteSet.add(onlyRouteKey); + basicCategorySet.add(onlyCategoryKey); + basicSet.add(onlyBasicKey); } - fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryId)); - if (ObjectUtil.isNotEmpty(pricePageV2VO)) { - fullVehicleV2Excel.setClient(pricePageV2VO.getClientName()); - fullVehicleV2Excel.setBrand(pricePageV2VO.getBrandName()); - fullVehicleV2Excel.setEffectiveTime(DateUtil.formatDate(pricePageV2VO.getEffectiveTime())); - fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + Integer type = fullVehicleEntity.getType(); + String typeStr = ""; + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + typeStr = "按件"; + } else if (type == 3) { + typeStr = "按方"; + } else if (type == 4) { + typeStr = "按重量"; + } } - for (BasicdataPriceCategoryBasicEntity basicdataPriceFullVehicleEntity : categoryBasicEntities) { - Integer type = basicdataPriceFullVehicleEntity.getType(); - String typeStr = ""; - if (ObjectUtil.isNotEmpty(type)) { - if (type == 1) { - typeStr = "按件"; - } else if (type == 3) { - typeStr = "按方"; - } else if (type == 4) { - typeStr = "按重量"; + Integer serviceType = fullVehicleEntity.getServiceType(); + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + if (ObjectUtil.isNotEmpty(serviceType)) { + if (serviceType == 1) { + fullVehicleV2Excel.setPickupUnit(typeStr); + fullVehicleV2Excel.setPickupPrice(priceStr); + } else if (serviceType == 2) { + fullVehicleV2Excel.setTrunkLineUnit(typeStr); + fullVehicleV2Excel.setTrunkLinePrice(priceStr); + } + } + } + } + } + if (CollUtil.isNotEmpty(warehouseEntities)) { + // 仓储 有路径 + 有品类 + List routeCategoryWarehouseList = warehouseEntities.stream() + .filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isNotEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryWarehouseList)) { + for (BasicdataPriceCategoryWarehouseEntity fullVehicleEntity : routeCategoryWarehouseList) { + Long fullVehicleBoId = fullVehicleEntity.getBoId(); + BasicdataPricePageV2VO pricePageV2VO = null; + BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + Long priceId = priceRouteEntity.getPriceId(); + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyRouteKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyCategoryKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr; + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + if (categoryV2ExcelMap.containsKey(onlyKey)) { + fullVehicleV2Excel = categoryV2ExcelMap.get(onlyKey); + } else { + fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // 路径 + fullVehicleV2Excel.setStartProvince(startProvince); + fullVehicleV2Excel.setStartCity(startCity); + fullVehicleV2Excel.setStartArea(startCounty); + fullVehicleV2Excel.setEndProvince(endProvince); + fullVehicleV2Excel.setEndCity(endCity); + fullVehicleV2Excel.setEndArea(endCounty); + fullVehicleV2Excel.setSendOrg(sendOrg); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + fullVehicleV2ExcelSet.add(onlyKey); + basicRouteSet.add(onlyRouteKey); + basicCategorySet.add(onlyCategoryKey); + basicSet.add(onlyBasicKey); + } + Integer costType = fullVehicleEntity.getCostType(); + Double withinThirtyPrice = fullVehicleEntity.getWithinThirtyPrice(); + String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + Double betweenThirtySixtyPrice = fullVehicleEntity.getBetweenThirtySixtyPrice(); + String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + Double beyondSixtyPrice = fullVehicleEntity.getBeyondSixtyPrice(); + String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + Double beyondNinetyPrice = fullVehicleEntity.getBeyondNinetyPrice(); + String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + Double operatePrice = fullVehicleEntity.getOperatePrice(); + String operatePriceStr = Convert.toStr(operatePrice); + Double warehouseManagementPrice = fullVehicleEntity.getWarehouseManagementPrice(); + String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + Double warehouseSortPrice = fullVehicleEntity.getWarehouseSortPrice(); + String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + fullVehicleV2Excel.setWithinThirtyPrice(withinThirtyPriceStr); + fullVehicleV2Excel.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + fullVehicleV2Excel.setBeyondSixtyPrice(beyondSixtyPriceStr); + fullVehicleV2Excel.setBeyondNinetyPrice(beyondNinetyPriceStr); + } else if (costType == 2) { + fullVehicleV2Excel.setWarehouseOperatePrice(operatePriceStr); + fullVehicleV2Excel.setWarehouseManagementPrice(warehouseManagementPriceStr); + fullVehicleV2Excel.setWarehouseSortPrice(warehouseSortPriceStr); + } + } + } + } + } + if (CollUtil.isNotEmpty(dispatchEntities)) { + // 配送 有路径 + 有品类 + List routeCategoryDispatchList = dispatchEntities.stream() + .filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isNotEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryDispatchList)) { + for (BasicdataPriceCategoryDispatchEntity fullVehicleEntity : routeCategoryDispatchList) { + Long fullVehicleBoId = fullVehicleEntity.getBoId(); + BasicdataPricePageV2VO pricePageV2VO = null; + BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + Long priceId = priceRouteEntity.getPriceId(); + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyRouteKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyCategoryKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr; + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + if (categoryV2ExcelMap.containsKey(onlyKey)) { + fullVehicleV2Excel = categoryV2ExcelMap.get(onlyKey); + } else { + fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // 路径 + fullVehicleV2Excel.setStartProvince(startProvince); + fullVehicleV2Excel.setStartCity(startCity); + fullVehicleV2Excel.setStartArea(startCounty); + fullVehicleV2Excel.setEndProvince(endProvince); + fullVehicleV2Excel.setEndCity(endCity); + fullVehicleV2Excel.setEndArea(endCounty); + fullVehicleV2Excel.setSendOrg(sendOrg); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + fullVehicleV2ExcelSet.add(onlyKey); + basicRouteSet.add(onlyRouteKey); + basicCategorySet.add(onlyCategoryKey); + basicSet.add(onlyBasicKey); + } + Integer costType = fullVehicleEntity.getCostType(); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + Double leaveBehindPrice = fullVehicleEntity.getLeaveBehindPrice(); + String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + Integer type = fullVehicleEntity.getType(); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + fullVehicleV2Excel.setDispatchUnit("按件"); + } else if (type == 2) { + fullVehicleV2Excel.setDispatchUnit("按方"); + } else if (type == 3) { + fullVehicleV2Excel.setDispatchUnit("按重量"); + } else if (type == 4) { + fullVehicleV2Excel.setDispatchUnit("按公里"); + } else if (type == 5) { + fullVehicleV2Excel.setDispatchUnit("按吨公里"); + } else if (type == 6) { + fullVehicleV2Excel.setDispatchUnit("按吨"); + } + } + fullVehicleV2Excel.setDispatchPrice(priceStr); + fullVehicleV2Excel.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + } else if (costType == 2) { + Double sortPrice = fullVehicleEntity.getSortPrice(); + String sortPriceStr = Convert.toStr(sortPrice); + Double handlingPrice = fullVehicleEntity.getHandlingPrice(); + String handlingPriceStr = Convert.toStr(handlingPrice); + Double relocationPrice = fullVehicleEntity.getRelocationPrice(); + String relocationPriceStr = Convert.toStr(relocationPrice); + Double upstairsDeliveryPrice = fullVehicleEntity.getUpstairsDeliveryPrice(); + String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + fullVehicleV2Excel.setDispatchSortPrice(sortPriceStr); + fullVehicleV2Excel.setDispatchHandlingPrice(handlingPriceStr); + fullVehicleV2Excel.setDispatchRelocationPrice(relocationPriceStr); + fullVehicleV2Excel.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + fullVehicleV2Excel.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + } + } + } + } + } + + // 价格+品类 + if (CollUtil.isNotEmpty(basicEntities)) { + // 提货干线 无路径 + 有品类 + List routeCategoryBaseList = basicEntities.stream() + .filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isNotEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryBasicEntity fullVehicleEntity : routeCategoryBaseList) { + Integer type = fullVehicleEntity.getType(); + String typeStr = ""; + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + typeStr = "按件"; + } else if (type == 3) { + typeStr = "按方"; + } else if (type == 4) { + typeStr = "按重量"; + } + } + Long priceId = fullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = null; + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr; + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicCategorySet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer serviceType = fullVehicleEntity.getServiceType(); + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + if (ObjectUtil.isNotEmpty(serviceType)) { + if (serviceType == 1) { + value.setPickupUnit(typeStr); + value.setPickupPrice(priceStr); + } else if (serviceType == 2) { + value.setTrunkLineUnit(typeStr); + value.setTrunkLinePrice(priceStr); + } + } } } - Integer serviceType = basicdataPriceFullVehicleEntity.getServiceType(); - Double price = basicdataPriceFullVehicleEntity.getPrice(); + } else { + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicCategorySet.add(onlyKey); + basicSet.add(onlyBasicKey); + Integer serviceType = fullVehicleEntity.getServiceType(); + Double price = fullVehicleEntity.getPrice(); String priceStr = Convert.toStr(price); if (ObjectUtil.isNotEmpty(serviceType)) { if (serviceType == 1) { @@ -737,45 +1271,411 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl warehouseEntities = categoryWarehouseService.list(Wrappers.lambdaQuery().in(BasicdataPriceCategoryWarehouseEntity::getPriceId, priceIdSet)); if (CollUtil.isNotEmpty(warehouseEntities)) { - // 业务id + 类型 + 车型 = 一条数据 - Map> basicMap = warehouseEntities.stream().collect(Collectors.groupingBy(BasicdataPriceCategoryWarehouseEntity::getBoId)); - for (Map.Entry> basicMapEntry : basicMap.entrySet()) { - Long fullVehicleBoId = basicMapEntry.getKey(); - List value = basicMapEntry.getValue(); - Map> basicCategoryMap = value.stream().collect(Collectors.groupingBy(entity -> Optional.ofNullable(entity.getCategoryId()) - .map(String::valueOf) - .orElse(""))); - for (Map.Entry> basicCategoryMapEntry : basicCategoryMap.entrySet()) { - String categoryId = basicCategoryMapEntry.getKey(); - List categoryBasicEntities = basicCategoryMapEntry.getValue(); - // 一条数据 - BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; - if (categoryMap.containsKey(Convert.toStr(fullVehicleBoId) + Convert.toStr(categoryId))) { - fullVehicleV2Excel = categoryMap.get(Convert.toStr(fullVehicleBoId) + Convert.toStr(categoryId)); + // 提货干线 无路径 + 有品类 + List routeCategoryBaseList = warehouseEntities.stream() + .filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isNotEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryWarehouseEntity fullVehicleEntity : routeCategoryBaseList) { + Long priceId = fullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = null; + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr; + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicCategorySet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer costType = fullVehicleEntity.getCostType(); + Double withinThirtyPrice = fullVehicleEntity.getWithinThirtyPrice(); + String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + Double betweenThirtySixtyPrice = fullVehicleEntity.getBetweenThirtySixtyPrice(); + String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + Double beyondSixtyPrice = fullVehicleEntity.getBeyondSixtyPrice(); + String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + Double beyondNinetyPrice = fullVehicleEntity.getBeyondNinetyPrice(); + String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + Double operatePrice = fullVehicleEntity.getOperatePrice(); + String operatePriceStr = Convert.toStr(operatePrice); + Double warehouseManagementPrice = fullVehicleEntity.getWarehouseManagementPrice(); + String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + Double warehouseSortPrice = fullVehicleEntity.getWarehouseSortPrice(); + String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + value.setWithinThirtyPrice(withinThirtyPriceStr); + value.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + value.setBeyondSixtyPrice(beyondSixtyPriceStr); + value.setBeyondNinetyPrice(beyondNinetyPriceStr); + } else if (costType == 2) { + value.setWarehouseOperatePrice(operatePriceStr); + value.setWarehouseManagementPrice(warehouseManagementPriceStr); + value.setWarehouseSortPrice(warehouseSortPriceStr); + } + } + } + } } else { - fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicCategorySet.add(onlyKey); + basicSet.add(onlyBasicKey); + Integer costType = fullVehicleEntity.getCostType(); + Double withinThirtyPrice = fullVehicleEntity.getWithinThirtyPrice(); + String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + Double betweenThirtySixtyPrice = fullVehicleEntity.getBetweenThirtySixtyPrice(); + String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + Double beyondSixtyPrice = fullVehicleEntity.getBeyondSixtyPrice(); + String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + Double beyondNinetyPrice = fullVehicleEntity.getBeyondNinetyPrice(); + String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + Double operatePrice = fullVehicleEntity.getOperatePrice(); + String operatePriceStr = Convert.toStr(operatePrice); + Double warehouseManagementPrice = fullVehicleEntity.getWarehouseManagementPrice(); + String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + Double warehouseSortPrice = fullVehicleEntity.getWarehouseSortPrice(); + String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + fullVehicleV2Excel.setWithinThirtyPrice(withinThirtyPriceStr); + fullVehicleV2Excel.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + fullVehicleV2Excel.setBeyondSixtyPrice(beyondSixtyPriceStr); + fullVehicleV2Excel.setBeyondNinetyPrice(beyondNinetyPriceStr); + } else if (costType == 2) { + fullVehicleV2Excel.setWarehouseOperatePrice(operatePriceStr); + fullVehicleV2Excel.setWarehouseManagementPrice(warehouseManagementPriceStr); + fullVehicleV2Excel.setWarehouseSortPrice(warehouseSortPriceStr); + } + } } - for (BasicdataPriceCategoryWarehouseEntity basicdataPriceFullVehicleEntity : categoryBasicEntities) { - Integer costType = basicdataPriceFullVehicleEntity.getCostType(); - Double withinThirtyPrice = basicdataPriceFullVehicleEntity.getWithinThirtyPrice(); + } + } + } + if (CollUtil.isNotEmpty(dispatchEntities)) { + // 提货干线 无路径 + 有品类 + List routeCategoryBaseList = dispatchEntities.stream() + .filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isNotEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryDispatchEntity fullVehicleEntity : routeCategoryBaseList) { + Long priceId = fullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = null; + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr; + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicCategorySet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer costType = fullVehicleEntity.getCostType(); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + Double leaveBehindPrice = fullVehicleEntity.getLeaveBehindPrice(); + String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + Integer type = fullVehicleEntity.getType(); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + value.setDispatchUnit("按件"); + } else if (type == 2) { + value.setDispatchUnit("按方"); + } else if (type == 3) { + value.setDispatchUnit("按重量"); + } else if (type == 4) { + value.setDispatchUnit("按公里"); + } else if (type == 5) { + value.setDispatchUnit("按吨公里"); + } else if (type == 6) { + value.setDispatchUnit("按吨"); + } + } + value.setDispatchPrice(priceStr); + value.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + } else if (costType == 2) { + Double sortPrice = fullVehicleEntity.getSortPrice(); + String sortPriceStr = Convert.toStr(sortPrice); + Double handlingPrice = fullVehicleEntity.getHandlingPrice(); + String handlingPriceStr = Convert.toStr(handlingPrice); + Double relocationPrice = fullVehicleEntity.getRelocationPrice(); + String relocationPriceStr = Convert.toStr(relocationPrice); + Double upstairsDeliveryPrice = fullVehicleEntity.getUpstairsDeliveryPrice(); + String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + value.setDispatchSortPrice(sortPriceStr); + value.setDispatchHandlingPrice(handlingPriceStr); + value.setDispatchRelocationPrice(relocationPriceStr); + value.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + value.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + } + } + } + } + } else { + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicCategorySet.add(onlyKey); + basicSet.add(onlyBasicKey); + Integer costType = fullVehicleEntity.getCostType(); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + Double leaveBehindPrice = fullVehicleEntity.getLeaveBehindPrice(); + String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + Integer type = fullVehicleEntity.getType(); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + fullVehicleV2Excel.setDispatchUnit("按件"); + } else if (type == 2) { + fullVehicleV2Excel.setDispatchUnit("按方"); + } else if (type == 3) { + fullVehicleV2Excel.setDispatchUnit("按重量"); + } else if (type == 4) { + fullVehicleV2Excel.setDispatchUnit("按公里"); + } else if (type == 5) { + fullVehicleV2Excel.setDispatchUnit("按吨公里"); + } else if (type == 6) { + fullVehicleV2Excel.setDispatchUnit("按吨"); + } + } + fullVehicleV2Excel.setDispatchPrice(priceStr); + fullVehicleV2Excel.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + } else if (costType == 2) { + Double sortPrice = fullVehicleEntity.getSortPrice(); + String sortPriceStr = Convert.toStr(sortPrice); + Double handlingPrice = fullVehicleEntity.getHandlingPrice(); + String handlingPriceStr = Convert.toStr(handlingPrice); + Double relocationPrice = fullVehicleEntity.getRelocationPrice(); + String relocationPriceStr = Convert.toStr(relocationPrice); + Double upstairsDeliveryPrice = fullVehicleEntity.getUpstairsDeliveryPrice(); + String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + fullVehicleV2Excel.setDispatchSortPrice(sortPriceStr); + fullVehicleV2Excel.setDispatchHandlingPrice(handlingPriceStr); + fullVehicleV2Excel.setDispatchRelocationPrice(relocationPriceStr); + fullVehicleV2Excel.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + fullVehicleV2Excel.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + } + } + } + } + } + } + + // 价格+路径 + if (CollUtil.isNotEmpty(basicEntities)) { + // 提货干线 有路径 + 无品类 + List routeCategoryBaseList = basicEntities.stream() + .filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryBasicEntity fullVehicleEntity : routeCategoryBaseList) { + Integer type = fullVehicleEntity.getType(); + String typeStr = ""; + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + typeStr = "按件"; + } else if (type == 3) { + typeStr = "按方"; + } else if (type == 4) { + typeStr = "按重量"; + } + } + Long priceId = fullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = null; + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long fullVehicleBoId = fullVehicleEntity.getBoId(); + BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicRouteSet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer serviceType = fullVehicleEntity.getServiceType(); + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + if (ObjectUtil.isNotEmpty(serviceType)) { + if (serviceType == 1) { + value.setPickupUnit(typeStr); + value.setPickupPrice(priceStr); + } else if (serviceType == 2) { + value.setTrunkLineUnit(typeStr); + value.setTrunkLinePrice(priceStr); + } + } + } + } + } else { + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicRouteSet.add(onlyKey); + basicSet.add(onlyBasicKey); + Integer serviceType = fullVehicleEntity.getServiceType(); + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + if (ObjectUtil.isNotEmpty(serviceType)) { + if (serviceType == 1) { + fullVehicleV2Excel.setPickupUnit(typeStr); + fullVehicleV2Excel.setPickupPrice(priceStr); + } else if (serviceType == 2) { + fullVehicleV2Excel.setTrunkLineUnit(typeStr); + fullVehicleV2Excel.setTrunkLinePrice(priceStr); + } + } + } + } + } + } + if (CollUtil.isNotEmpty(warehouseEntities)) { + // 提货干线 有路径 + 无品类 + List routeCategoryBaseList = warehouseEntities.stream() + .filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryWarehouseEntity fullVehicleEntity : routeCategoryBaseList) { + Long priceId = fullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = null; + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long fullVehicleBoId = fullVehicleEntity.getBoId(); + BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicRouteSet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer costType = fullVehicleEntity.getCostType(); + Double withinThirtyPrice = fullVehicleEntity.getWithinThirtyPrice(); + String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + Double betweenThirtySixtyPrice = fullVehicleEntity.getBetweenThirtySixtyPrice(); + String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + Double beyondSixtyPrice = fullVehicleEntity.getBeyondSixtyPrice(); + String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + Double beyondNinetyPrice = fullVehicleEntity.getBeyondNinetyPrice(); + String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + Double operatePrice = fullVehicleEntity.getOperatePrice(); + String operatePriceStr = Convert.toStr(operatePrice); + Double warehouseManagementPrice = fullVehicleEntity.getWarehouseManagementPrice(); + String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + Double warehouseSortPrice = fullVehicleEntity.getWarehouseSortPrice(); + String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + value.setWithinThirtyPrice(withinThirtyPriceStr); + value.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + value.setBeyondSixtyPrice(beyondSixtyPriceStr); + value.setBeyondNinetyPrice(beyondNinetyPriceStr); + } else if (costType == 2) { + value.setWarehouseOperatePrice(operatePriceStr); + value.setWarehouseManagementPrice(warehouseManagementPriceStr); + value.setWarehouseSortPrice(warehouseSortPriceStr); + } + } + } + } + } else { + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicRouteSet.add(onlyKey); + basicSet.add(onlyBasicKey); + Integer costType = fullVehicleEntity.getCostType(); + Double withinThirtyPrice = fullVehicleEntity.getWithinThirtyPrice(); String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); - Double betweenThirtySixtyPrice = basicdataPriceFullVehicleEntity.getBetweenThirtySixtyPrice(); + Double betweenThirtySixtyPrice = fullVehicleEntity.getBetweenThirtySixtyPrice(); String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); - Double beyondSixtyPrice = basicdataPriceFullVehicleEntity.getBeyondSixtyPrice(); + Double beyondSixtyPrice = fullVehicleEntity.getBeyondSixtyPrice(); String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); - Double beyondNinetyPrice = basicdataPriceFullVehicleEntity.getBeyondNinetyPrice(); + Double beyondNinetyPrice = fullVehicleEntity.getBeyondNinetyPrice(); String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); - Double operatePrice = basicdataPriceFullVehicleEntity.getOperatePrice(); + Double operatePrice = fullVehicleEntity.getOperatePrice(); String operatePriceStr = Convert.toStr(operatePrice); - Double warehouseManagementPrice = basicdataPriceFullVehicleEntity.getWarehouseManagementPrice(); + Double warehouseManagementPrice = fullVehicleEntity.getWarehouseManagementPrice(); String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); - Double warehouseSortPrice = basicdataPriceFullVehicleEntity.getWarehouseSortPrice(); + Double warehouseSortPrice = fullVehicleEntity.getWarehouseSortPrice(); String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); if (ObjectUtil.isNotEmpty(costType)) { if (costType == 1) { @@ -793,45 +1693,403 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl dispatchEntities = categoryDispatchService.list(Wrappers.lambdaQuery().in(BasicdataPriceCategoryDispatchEntity::getPriceId, priceIdSet)); if (CollUtil.isNotEmpty(dispatchEntities)) { - Map> basicMap = dispatchEntities.stream().collect(Collectors.groupingBy(BasicdataPriceCategoryDispatchEntity::getBoId)); - for (Map.Entry> basicMapEntry : basicMap.entrySet()) { - Long fullVehicleBoId = basicMapEntry.getKey(); - List value = basicMapEntry.getValue(); - Map> basicCategoryMap = value.stream().collect(Collectors.groupingBy(entity -> Optional.ofNullable(entity.getCategoryId()) - .map(String::valueOf) - .orElse(""))); - for (Map.Entry> basicCategoryMapEntry : basicCategoryMap.entrySet()) { - String categoryId = basicCategoryMapEntry.getKey(); - List categoryBasicEntities = basicCategoryMapEntry.getValue(); - // 一条数据 - BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; - if (categoryMap.containsKey(Convert.toStr(fullVehicleBoId) + Convert.toStr(categoryId))) { - fullVehicleV2Excel = categoryMap.get(Convert.toStr(fullVehicleBoId) + Convert.toStr(categoryId)); + // 提货干线 无路径 + 有品类 + List routeCategoryBaseList = dispatchEntities.stream() + .filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryDispatchEntity fullVehicleEntity : routeCategoryBaseList) { + Long priceId = fullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = null; + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long fullVehicleBoId = fullVehicleEntity.getBoId(); + BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + String onlyBasicKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicRouteSet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer costType = fullVehicleEntity.getCostType(); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + Double leaveBehindPrice = fullVehicleEntity.getLeaveBehindPrice(); + String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + Integer type = fullVehicleEntity.getType(); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + value.setDispatchUnit("按件"); + } else if (type == 2) { + value.setDispatchUnit("按方"); + } else if (type == 3) { + value.setDispatchUnit("按重量"); + } else if (type == 4) { + value.setDispatchUnit("按公里"); + } else if (type == 5) { + value.setDispatchUnit("按吨公里"); + } else if (type == 6) { + value.setDispatchUnit("按吨"); + } + } + value.setDispatchPrice(priceStr); + value.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + } else if (costType == 2) { + Double sortPrice = fullVehicleEntity.getSortPrice(); + String sortPriceStr = Convert.toStr(sortPrice); + Double handlingPrice = fullVehicleEntity.getHandlingPrice(); + String handlingPriceStr = Convert.toStr(handlingPrice); + Double relocationPrice = fullVehicleEntity.getRelocationPrice(); + String relocationPriceStr = Convert.toStr(relocationPrice); + Double upstairsDeliveryPrice = fullVehicleEntity.getUpstairsDeliveryPrice(); + String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + value.setDispatchSortPrice(sortPriceStr); + value.setDispatchHandlingPrice(handlingPriceStr); + value.setDispatchRelocationPrice(relocationPriceStr); + value.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + value.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + } + } + } + } } else { - fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicRouteSet.add(onlyKey); + basicSet.add(onlyBasicKey); + Integer costType = fullVehicleEntity.getCostType(); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + Double leaveBehindPrice = fullVehicleEntity.getLeaveBehindPrice(); + String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + Integer type = fullVehicleEntity.getType(); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + fullVehicleV2Excel.setDispatchUnit("按件"); + } else if (type == 2) { + fullVehicleV2Excel.setDispatchUnit("按方"); + } else if (type == 3) { + fullVehicleV2Excel.setDispatchUnit("按重量"); + } else if (type == 4) { + fullVehicleV2Excel.setDispatchUnit("按公里"); + } else if (type == 5) { + fullVehicleV2Excel.setDispatchUnit("按吨公里"); + } else if (type == 6) { + fullVehicleV2Excel.setDispatchUnit("按吨"); + } + } + fullVehicleV2Excel.setDispatchPrice(priceStr); + fullVehicleV2Excel.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + } else if (costType == 2) { + Double sortPrice = fullVehicleEntity.getSortPrice(); + String sortPriceStr = Convert.toStr(sortPrice); + Double handlingPrice = fullVehicleEntity.getHandlingPrice(); + String handlingPriceStr = Convert.toStr(handlingPrice); + Double relocationPrice = fullVehicleEntity.getRelocationPrice(); + String relocationPriceStr = Convert.toStr(relocationPrice); + Double upstairsDeliveryPrice = fullVehicleEntity.getUpstairsDeliveryPrice(); + String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + fullVehicleV2Excel.setDispatchSortPrice(sortPriceStr); + fullVehicleV2Excel.setDispatchHandlingPrice(handlingPriceStr); + fullVehicleV2Excel.setDispatchRelocationPrice(relocationPriceStr); + fullVehicleV2Excel.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + fullVehicleV2Excel.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + } + } } + } + } + } + + // 价格 + if (CollUtil.isNotEmpty(basicEntities)) { + // 提货干线 无路径 + 无品类 + List routeCategoryBaseList = basicEntities.stream() + .filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryBasicEntity fullVehicleEntity : routeCategoryBaseList) { + Integer type = fullVehicleEntity.getType(); + String typeStr = ""; + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + typeStr = "按件"; + } else if (type == 3) { + typeStr = "按方"; + } else if (type == 4) { + typeStr = "按重量"; + } + } + Long priceId = fullVehicleEntity.getPriceId(); BasicdataPricePageV2VO pricePageV2VO = null; - if (basicdataPricePageV2VOMap.containsKey(fullVehicleBoId)) { - // 不是路径 - pricePageV2VO = basicdataPricePageV2VOMap.get(fullVehicleBoId); + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicSet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer serviceType = fullVehicleEntity.getServiceType(); + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + if (ObjectUtil.isNotEmpty(serviceType)) { + if (serviceType == 1) { + value.setPickupUnit(typeStr); + value.setPickupPrice(priceStr); + } else if (serviceType == 2) { + value.setTrunkLineUnit(typeStr); + value.setTrunkLinePrice(priceStr); + } + } + } + } } else { - // 路径 - BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); - Long priceId = priceRouteEntity.getPriceId(); - pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicSet.add(onlyKey); + Integer serviceType = fullVehicleEntity.getServiceType(); + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + if (ObjectUtil.isNotEmpty(serviceType)) { + if (serviceType == 1) { + fullVehicleV2Excel.setPickupUnit(typeStr); + fullVehicleV2Excel.setPickupPrice(priceStr); + } else if (serviceType == 2) { + fullVehicleV2Excel.setTrunkLineUnit(typeStr); + fullVehicleV2Excel.setTrunkLinePrice(priceStr); + } + } + } + } + } + } + if (CollUtil.isNotEmpty(warehouseEntities)) { + // 仓储 无路径 + 无品类 + List routeCategoryBaseList = warehouseEntities.stream() + .filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryWarehouseEntity fullVehicleEntity : routeCategoryBaseList) { + Long priceId = fullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = null; + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicSet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer costType = fullVehicleEntity.getCostType(); + Double withinThirtyPrice = fullVehicleEntity.getWithinThirtyPrice(); + String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + Double betweenThirtySixtyPrice = fullVehicleEntity.getBetweenThirtySixtyPrice(); + String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + Double beyondSixtyPrice = fullVehicleEntity.getBeyondSixtyPrice(); + String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + Double beyondNinetyPrice = fullVehicleEntity.getBeyondNinetyPrice(); + String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + Double operatePrice = fullVehicleEntity.getOperatePrice(); + String operatePriceStr = Convert.toStr(operatePrice); + Double warehouseManagementPrice = fullVehicleEntity.getWarehouseManagementPrice(); + String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + Double warehouseSortPrice = fullVehicleEntity.getWarehouseSortPrice(); + String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + value.setWithinThirtyPrice(withinThirtyPriceStr); + value.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + value.setBeyondSixtyPrice(beyondSixtyPriceStr); + value.setBeyondNinetyPrice(beyondNinetyPriceStr); + } else if (costType == 2) { + value.setWarehouseOperatePrice(operatePriceStr); + value.setWarehouseManagementPrice(warehouseManagementPriceStr); + value.setWarehouseSortPrice(warehouseSortPriceStr); + } + } + } + } + } else { + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicSet.add(onlyKey); + Integer costType = fullVehicleEntity.getCostType(); + Double withinThirtyPrice = fullVehicleEntity.getWithinThirtyPrice(); + String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + Double betweenThirtySixtyPrice = fullVehicleEntity.getBetweenThirtySixtyPrice(); + String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + Double beyondSixtyPrice = fullVehicleEntity.getBeyondSixtyPrice(); + String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + Double beyondNinetyPrice = fullVehicleEntity.getBeyondNinetyPrice(); + String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + Double operatePrice = fullVehicleEntity.getOperatePrice(); + String operatePriceStr = Convert.toStr(operatePrice); + Double warehouseManagementPrice = fullVehicleEntity.getWarehouseManagementPrice(); + String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + Double warehouseSortPrice = fullVehicleEntity.getWarehouseSortPrice(); + String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + fullVehicleV2Excel.setWithinThirtyPrice(withinThirtyPriceStr); + fullVehicleV2Excel.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + fullVehicleV2Excel.setBeyondSixtyPrice(beyondSixtyPriceStr); + fullVehicleV2Excel.setBeyondNinetyPrice(beyondNinetyPriceStr); + } else if (costType == 2) { + fullVehicleV2Excel.setWarehouseOperatePrice(operatePriceStr); + fullVehicleV2Excel.setWarehouseManagementPrice(warehouseManagementPriceStr); + fullVehicleV2Excel.setWarehouseSortPrice(warehouseSortPriceStr); + } + } } - for (BasicdataPriceCategoryDispatchEntity basicdataPriceFullVehicleEntity : categoryBasicEntities) { - Integer costType = basicdataPriceFullVehicleEntity.getCostType(); + } + } + } + if (CollUtil.isNotEmpty(dispatchEntities)) { + // 配送 无路径 + 无品类 + List routeCategoryBaseList = dispatchEntities.stream() + .filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + .filter(item -> ObjectUtil.isEmpty(item.getCategoryId())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(routeCategoryBaseList)) { + for (BasicdataPriceCategoryDispatchEntity fullVehicleEntity : routeCategoryBaseList) { + Long priceId = fullVehicleEntity.getPriceId(); + BasicdataPricePageV2VO pricePageV2VO = null; + pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + String clientName = pricePageV2VO.getClientName(); + String brandName = pricePageV2VO.getBrandName(); + Long categoryId = fullVehicleEntity.getCategoryId(); + String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime); + // 价格 + 品类 + if (basicSet.contains(onlyKey)) { + for (Map.Entry entry : categoryV2ExcelMap.entrySet()) { + String key = entry.getKey(); + BasicdataPriceCategoryV2Excel value = entry.getValue(); + if (key.contains(onlyKey)) { + Integer costType = fullVehicleEntity.getCostType(); + if (ObjectUtil.isNotEmpty(costType)) { + if (costType == 1) { + Double price = fullVehicleEntity.getPrice(); + String priceStr = Convert.toStr(price); + Double leaveBehindPrice = fullVehicleEntity.getLeaveBehindPrice(); + String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + Integer type = fullVehicleEntity.getType(); + if (ObjectUtil.isNotEmpty(type)) { + if (type == 1) { + value.setDispatchUnit("按件"); + } else if (type == 2) { + value.setDispatchUnit("按方"); + } else if (type == 3) { + value.setDispatchUnit("按重量"); + } else if (type == 4) { + value.setDispatchUnit("按公里"); + } else if (type == 5) { + value.setDispatchUnit("按吨公里"); + } else if (type == 6) { + value.setDispatchUnit("按吨"); + } + } + value.setDispatchPrice(priceStr); + value.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + } else if (costType == 2) { + Double sortPrice = fullVehicleEntity.getSortPrice(); + String sortPriceStr = Convert.toStr(sortPrice); + Double handlingPrice = fullVehicleEntity.getHandlingPrice(); + String handlingPriceStr = Convert.toStr(handlingPrice); + Double relocationPrice = fullVehicleEntity.getRelocationPrice(); + String relocationPriceStr = Convert.toStr(relocationPrice); + Double upstairsDeliveryPrice = fullVehicleEntity.getUpstairsDeliveryPrice(); + String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + value.setDispatchSortPrice(sortPriceStr); + value.setDispatchHandlingPrice(handlingPriceStr); + value.setDispatchRelocationPrice(relocationPriceStr); + value.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + value.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + } + } + } + } + } else { + BasicdataPriceCategoryV2Excel fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + fullVehicleV2Excel.setClient(clientName); + fullVehicleV2Excel.setBrand(brandName); + fullVehicleV2Excel.setEffectiveTime(effectiveTime); + fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + } + categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + basicSet.add(onlyKey); + Integer costType = fullVehicleEntity.getCostType(); if (ObjectUtil.isNotEmpty(costType)) { if (costType == 1) { - Double price = basicdataPriceFullVehicleEntity.getPrice(); + Double price = fullVehicleEntity.getPrice(); String priceStr = Convert.toStr(price); - Double leaveBehindPrice = basicdataPriceFullVehicleEntity.getLeaveBehindPrice(); + Double leaveBehindPrice = fullVehicleEntity.getLeaveBehindPrice(); String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 - Integer type = basicdataPriceFullVehicleEntity.getType(); + Integer type = fullVehicleEntity.getType(); if (ObjectUtil.isNotEmpty(type)) { if (type == 1) { fullVehicleV2Excel.setDispatchUnit("按件"); @@ -850,13 +2108,13 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl values = categoryMap.values(); + + + + + + + + + // if (CollUtil.isNotEmpty(basicEntities)) { + // // 提货干线 有路径 + 有品类 + // List routeCategoryBaseList = basicEntities.stream() + // .filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + // .filter(item -> ObjectUtil.isNotEmpty(item.getCategoryId())) + // .collect(Collectors.toList()); + // // 提货干线 有路径 + 有品类 + // List categoryBaseList = basicEntities.stream() + // .filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))) + // .filter(item -> ObjectUtil.isNotEmpty(item.getCategoryId())) + // .collect(Collectors.toList()); + // + // + // Map> priceFullMap = basicEntities.stream().collect(Collectors.groupingBy(BasicdataPriceCategoryBasicEntity::getPriceId)); + // for (Map.Entry> priceFullMapEntry : priceFullMap.entrySet()) { + // Long key = priceFullMapEntry.getKey(); + // List value = priceFullMapEntry.getValue(); + // // 带路径的 + // List collect = value.stream().filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + // if (CollUtil.isNotEmpty(collect)) { + // for (BasicdataPriceCategoryBasicEntity fullVehicleEntity : collect) { + // Long fullVehicleBoId = fullVehicleEntity.getBoId(); + // BasicdataPricePageV2VO pricePageV2VO = null; + // BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + // Long priceId = priceRouteEntity.getPriceId(); + // pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + // String clientName = pricePageV2VO.getClientName(); + // String brandName = pricePageV2VO.getBrandName(); + // String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + // String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + // String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + // String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + // String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + // String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + // String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + // Long categoryId = fullVehicleEntity.getCategoryId(); + // String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + // String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + // String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + // + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + // BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + // if (categoryV2ExcelMap.containsKey(onlyKey)) { + // fullVehicleV2Excel = categoryV2ExcelMap.get(onlyKey); + // } else { + // fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // // 路径 + // fullVehicleV2Excel.setStartProvince(startProvince); + // fullVehicleV2Excel.setStartCity(startCity); + // fullVehicleV2Excel.setStartArea(startCounty); + // fullVehicleV2Excel.setEndProvince(endProvince); + // fullVehicleV2Excel.setEndCity(endCity); + // fullVehicleV2Excel.setEndArea(endCounty); + // fullVehicleV2Excel.setSendOrg(sendOrg); + // fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + // if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + // fullVehicleV2Excel.setClient(clientName); + // fullVehicleV2Excel.setBrand(brandName); + // fullVehicleV2Excel.setEffectiveTime(effectiveTime); + // fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + // } + // categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + // fullVehicleV2ExcelSet.add(clientName + brandName + Convert.toStr(effectiveTime)); + // } + // Integer type = fullVehicleEntity.getType(); + // String typeStr = ""; + // if (ObjectUtil.isNotEmpty(type)) { + // if (type == 1) { + // typeStr = "按件"; + // } else if (type == 3) { + // typeStr = "按方"; + // } else if (type == 4) { + // typeStr = "按重量"; + // } + // } + // Integer serviceType = fullVehicleEntity.getServiceType(); + // Double price = fullVehicleEntity.getPrice(); + // String priceStr = Convert.toStr(price); + // if (ObjectUtil.isNotEmpty(serviceType)) { + // if (serviceType == 1) { + // fullVehicleV2Excel.setPickupUnit(typeStr); + // fullVehicleV2Excel.setPickupPrice(priceStr); + // } else if (serviceType == 2) { + // fullVehicleV2Excel.setTrunkLineUnit(typeStr); + // fullVehicleV2Excel.setTrunkLinePrice(priceStr); + // } + // } + // } + // } + // // 不带路径的情况下 将数据分摊到每条数据中,不包含的情况下 则单独一行数据处理 + // List collect1 = value.stream().filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + // if (CollUtil.isNotEmpty(collect1)) { + // for (BasicdataPriceCategoryBasicEntity basicdataPriceFullVehicleEntity : collect1) { + // Long priceId = basicdataPriceFullVehicleEntity.getPriceId(); + // BasicdataPricePageV2VO pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + // String clientName = pricePageV2VO.getClientName(); + // String brandName = pricePageV2VO.getBrandName(); + // Long categoryId = basicdataPriceFullVehicleEntity.getCategoryId(); + // String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + // String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + // String checkKey = clientName + brandName + Convert.toStr(effectiveTime); + // String checkKey1 = clientName + brandName + Convert.toStr(effectiveTime) + categoryIdStr; + // if (fullVehicleV2ExcelSet.contains(checkKey)) { + // if (CollUtil.isNotEmpty(categoryV2ExcelMap)) { + // for (Map.Entry priceFullVehicleEntity : categoryV2ExcelMap.entrySet()) { + // String key1 = priceFullVehicleEntity.getKey(); + // BasicdataPriceCategoryV2Excel value1 = priceFullVehicleEntity.getValue(); + // if (key1.contains(checkKey1)) { + // // 存在 + // Integer type = basicdataPriceFullVehicleEntity.getType(); + // String typeStr = ""; + // if (ObjectUtil.isNotEmpty(type)) { + // if (type == 1) { + // typeStr = "按件"; + // } else if (type == 3) { + // typeStr = "按方"; + // } else if (type == 4) { + // typeStr = "按重量"; + // } + // } + // Integer serviceType = basicdataPriceFullVehicleEntity.getServiceType(); + // Double price = basicdataPriceFullVehicleEntity.getPrice(); + // String priceStr = Convert.toStr(price); + // if (ObjectUtil.isNotEmpty(serviceType)) { + // if (serviceType == 1) { + // value1.setPickupUnit(typeStr); + // value1.setPickupPrice(priceStr); + // } else if (serviceType == 2) { + // value1.setTrunkLineUnit(typeStr); + // value1.setTrunkLinePrice(priceStr); + // } + // } + // } + // } + // } + // } else { + // // 不存在 + // BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + // if (categoryV2ExcelMap.containsKey(checkKey1)) { + // fullVehicleV2Excel = categoryV2ExcelMap.get(checkKey1); + // } else { + // fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + // if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + // fullVehicleV2Excel.setClient(pricePageV2VO.getClientName()); + // fullVehicleV2Excel.setBrand(pricePageV2VO.getBrandName()); + // fullVehicleV2Excel.setEffectiveTime(effectiveTime); + // fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + // } + // categoryV2ExcelMap.put(checkKey1, fullVehicleV2Excel); + // } + // Integer type = basicdataPriceFullVehicleEntity.getType(); + // String typeStr = ""; + // if (ObjectUtil.isNotEmpty(type)) { + // if (type == 1) { + // typeStr = "按件"; + // } else if (type == 3) { + // typeStr = "按方"; + // } else if (type == 4) { + // typeStr = "按重量"; + // } + // } + // Integer serviceType = basicdataPriceFullVehicleEntity.getServiceType(); + // Double price = basicdataPriceFullVehicleEntity.getPrice(); + // String priceStr = Convert.toStr(price); + // if (ObjectUtil.isNotEmpty(serviceType)) { + // if (serviceType == 1) { + // fullVehicleV2Excel.setPickupUnit(typeStr); + // fullVehicleV2Excel.setPickupPrice(priceStr); + // } else if (serviceType == 2) { + // fullVehicleV2Excel.setTrunkLineUnit(typeStr); + // fullVehicleV2Excel.setTrunkLinePrice(priceStr); + // } + // } + // } + // } + // } + // } + // } + // + // if (CollUtil.isNotEmpty(warehouseEntities)) { + // // 业务id + 类型 + 车型 = 一条数据 + // Map> priceFullMap = warehouseEntities.stream().collect(Collectors.groupingBy(BasicdataPriceCategoryWarehouseEntity::getPriceId)); + // for (Map.Entry> priceFullMapEntry : priceFullMap.entrySet()) { + // Long key = priceFullMapEntry.getKey(); + // List value = priceFullMapEntry.getValue(); + // // 带路径的 + // List collect = value.stream().filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + // if (CollUtil.isNotEmpty(collect)) { + // for (BasicdataPriceCategoryWarehouseEntity fullVehicleEntity : collect) { + // Long fullVehicleBoId = fullVehicleEntity.getBoId(); + // BasicdataPricePageV2VO pricePageV2VO = null; + // BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + // Long priceId = priceRouteEntity.getPriceId(); + // pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + // String clientName = pricePageV2VO.getClientName(); + // String brandName = pricePageV2VO.getBrandName(); + // String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + // String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + // String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + // String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + // String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + // String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + // String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + // Long categoryId = fullVehicleEntity.getCategoryId(); + // String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + // String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + // String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + // + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + // BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + // if (categoryV2ExcelMap.containsKey(onlyKey)) { + // fullVehicleV2Excel = categoryV2ExcelMap.get(onlyKey); + // } else { + // fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // // 路径 + // fullVehicleV2Excel.setStartProvince(startProvince); + // fullVehicleV2Excel.setStartCity(startCity); + // fullVehicleV2Excel.setStartArea(startCounty); + // fullVehicleV2Excel.setEndProvince(endProvince); + // fullVehicleV2Excel.setEndCity(endCity); + // fullVehicleV2Excel.setEndArea(endCounty); + // fullVehicleV2Excel.setSendOrg(sendOrg); + // fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + // if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + // fullVehicleV2Excel.setClient(clientName); + // fullVehicleV2Excel.setBrand(brandName); + // fullVehicleV2Excel.setEffectiveTime(effectiveTime); + // fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + // } + // categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + // fullVehicleV2ExcelSet.add(clientName + brandName + Convert.toStr(effectiveTime)); + // } + // Integer costType = fullVehicleEntity.getCostType(); + // Double withinThirtyPrice = fullVehicleEntity.getWithinThirtyPrice(); + // String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + // Double betweenThirtySixtyPrice = fullVehicleEntity.getBetweenThirtySixtyPrice(); + // String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + // Double beyondSixtyPrice = fullVehicleEntity.getBeyondSixtyPrice(); + // String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + // Double beyondNinetyPrice = fullVehicleEntity.getBeyondNinetyPrice(); + // String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + // Double operatePrice = fullVehicleEntity.getOperatePrice(); + // String operatePriceStr = Convert.toStr(operatePrice); + // Double warehouseManagementPrice = fullVehicleEntity.getWarehouseManagementPrice(); + // String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + // Double warehouseSortPrice = fullVehicleEntity.getWarehouseSortPrice(); + // String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + // if (ObjectUtil.isNotEmpty(costType)) { + // if (costType == 1) { + // fullVehicleV2Excel.setWithinThirtyPrice(withinThirtyPriceStr); + // fullVehicleV2Excel.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + // fullVehicleV2Excel.setBeyondSixtyPrice(beyondSixtyPriceStr); + // fullVehicleV2Excel.setBeyondNinetyPrice(beyondNinetyPriceStr); + // } else if (costType == 2) { + // fullVehicleV2Excel.setWarehouseOperatePrice(operatePriceStr); + // fullVehicleV2Excel.setWarehouseManagementPrice(warehouseManagementPriceStr); + // fullVehicleV2Excel.setWarehouseSortPrice(warehouseSortPriceStr); + // } + // } + // } + // } + // // 不带路径的情况下 将数据分摊到每条数据中,不包含的情况下 则单独一行数据处理 + // List collect1 = value.stream().filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + // if (CollUtil.isNotEmpty(collect1)) { + // for (BasicdataPriceCategoryWarehouseEntity basicdataPriceFullVehicleEntity : collect1) { + // Long priceId = basicdataPriceFullVehicleEntity.getPriceId(); + // BasicdataPricePageV2VO pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + // String clientName = pricePageV2VO.getClientName(); + // String brandName = pricePageV2VO.getBrandName(); + // Long categoryId = basicdataPriceFullVehicleEntity.getCategoryId(); + // String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + // String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + // String checkKey = clientName + brandName + Convert.toStr(effectiveTime); + // String checkKey1 = clientName + brandName + Convert.toStr(effectiveTime) + categoryIdStr; + // if (fullVehicleV2ExcelSet.contains(checkKey)) { + // if (CollUtil.isNotEmpty(categoryV2ExcelMap)) { + // for (Map.Entry priceFullVehicleEntity : categoryV2ExcelMap.entrySet()) { + // String key1 = priceFullVehicleEntity.getKey(); + // BasicdataPriceCategoryV2Excel value1 = priceFullVehicleEntity.getValue(); + // if (key1.contains(checkKey1)) { + // // 存在 + // Integer type = basicdataPriceFullVehicleEntity.getType(); + // String typeStr = ""; + // if (ObjectUtil.isNotEmpty(type)) { + // if (type == 1) { + // typeStr = "按件"; + // } else if (type == 3) { + // typeStr = "按方"; + // } else if (type == 4) { + // typeStr = "按重量"; + // } + // } + // Integer costType = basicdataPriceFullVehicleEntity.getCostType(); + // Double withinThirtyPrice = basicdataPriceFullVehicleEntity.getWithinThirtyPrice(); + // String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + // Double betweenThirtySixtyPrice = basicdataPriceFullVehicleEntity.getBetweenThirtySixtyPrice(); + // String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + // Double beyondSixtyPrice = basicdataPriceFullVehicleEntity.getBeyondSixtyPrice(); + // String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + // Double beyondNinetyPrice = basicdataPriceFullVehicleEntity.getBeyondNinetyPrice(); + // String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + // Double operatePrice = basicdataPriceFullVehicleEntity.getOperatePrice(); + // String operatePriceStr = Convert.toStr(operatePrice); + // Double warehouseManagementPrice = basicdataPriceFullVehicleEntity.getWarehouseManagementPrice(); + // String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + // Double warehouseSortPrice = basicdataPriceFullVehicleEntity.getWarehouseSortPrice(); + // String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + // if (ObjectUtil.isNotEmpty(costType)) { + // if (costType == 1) { + // value1.setWithinThirtyPrice(withinThirtyPriceStr); + // value1.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + // value1.setBeyondSixtyPrice(beyondSixtyPriceStr); + // value1.setBeyondNinetyPrice(beyondNinetyPriceStr); + // } else if (costType == 2) { + // value1.setWarehouseOperatePrice(operatePriceStr); + // value1.setWarehouseManagementPrice(warehouseManagementPriceStr); + // value1.setWarehouseSortPrice(warehouseSortPriceStr); + // } + // } + // } + // } + // } + // } else { + // // 不存在 + // BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + // if (categoryV2ExcelMap.containsKey(checkKey1)) { + // fullVehicleV2Excel = categoryV2ExcelMap.get(checkKey1); + // } else { + // fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + // if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + // fullVehicleV2Excel.setClient(pricePageV2VO.getClientName()); + // fullVehicleV2Excel.setBrand(pricePageV2VO.getBrandName()); + // fullVehicleV2Excel.setEffectiveTime(effectiveTime); + // fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + // } + // categoryV2ExcelMap.put(checkKey1, fullVehicleV2Excel); + // } + // Integer costType = basicdataPriceFullVehicleEntity.getCostType(); + // Double withinThirtyPrice = basicdataPriceFullVehicleEntity.getWithinThirtyPrice(); + // String withinThirtyPriceStr = Convert.toStr(withinThirtyPrice); + // Double betweenThirtySixtyPrice = basicdataPriceFullVehicleEntity.getBetweenThirtySixtyPrice(); + // String betweenThirtySixtyPriceStr = Convert.toStr(betweenThirtySixtyPrice); + // Double beyondSixtyPrice = basicdataPriceFullVehicleEntity.getBeyondSixtyPrice(); + // String beyondSixtyPriceStr = Convert.toStr(beyondSixtyPrice); + // Double beyondNinetyPrice = basicdataPriceFullVehicleEntity.getBeyondNinetyPrice(); + // String beyondNinetyPriceStr = Convert.toStr(beyondNinetyPrice); + // Double operatePrice = basicdataPriceFullVehicleEntity.getOperatePrice(); + // String operatePriceStr = Convert.toStr(operatePrice); + // Double warehouseManagementPrice = basicdataPriceFullVehicleEntity.getWarehouseManagementPrice(); + // String warehouseManagementPriceStr = Convert.toStr(warehouseManagementPrice); + // Double warehouseSortPrice = basicdataPriceFullVehicleEntity.getWarehouseSortPrice(); + // String warehouseSortPriceStr = Convert.toStr(warehouseSortPrice); + // if (ObjectUtil.isNotEmpty(costType)) { + // if (costType == 1) { + // fullVehicleV2Excel.setWithinThirtyPrice(withinThirtyPriceStr); + // fullVehicleV2Excel.setBetweenThirtySixtyPrice(betweenThirtySixtyPriceStr); + // fullVehicleV2Excel.setBeyondSixtyPrice(beyondSixtyPriceStr); + // fullVehicleV2Excel.setBeyondNinetyPrice(beyondNinetyPriceStr); + // } else if (costType == 2) { + // fullVehicleV2Excel.setWarehouseOperatePrice(operatePriceStr); + // fullVehicleV2Excel.setWarehouseManagementPrice(warehouseManagementPriceStr); + // fullVehicleV2Excel.setWarehouseSortPrice(warehouseSortPriceStr); + // } + // } + // } + // } + // } + // } + // } + // + // + // if (CollUtil.isNotEmpty(dispatchEntities)) { + // Map> priceFullMap = dispatchEntities.stream().collect(Collectors.groupingBy(BasicdataPriceCategoryDispatchEntity::getPriceId)); + // for (Map.Entry> priceFullMapEntry : priceFullMap.entrySet()) { + // Long key = priceFullMapEntry.getKey(); + // List value = priceFullMapEntry.getValue(); + // // 带路径的 + // List collect = value.stream().filter(item -> !StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + // if (CollUtil.isNotEmpty(collect)) { + // for (BasicdataPriceCategoryDispatchEntity fullVehicleEntity : collect) { + // Long fullVehicleBoId = fullVehicleEntity.getBoId(); + // BasicdataPricePageV2VO pricePageV2VO = null; + // BasicdataPriceRouteEntity priceRouteEntity = priceRouteEntityMap.get(fullVehicleBoId); + // Long priceId = priceRouteEntity.getPriceId(); + // pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + // String clientName = pricePageV2VO.getClientName(); + // String brandName = pricePageV2VO.getBrandName(); + // String startProvince = regionMap.get(Convert.toStr(priceRouteEntity.getStartProvinceId())); + // String startCity = regionMap.get(Convert.toStr(priceRouteEntity.getStartCityId())); + // String startCounty = regionMap.get(Convert.toStr(priceRouteEntity.getStartCountyId())); + // String endProvince = regionMap.get(Convert.toStr(priceRouteEntity.getEndProvinceId())); + // String endCity = regionMap.get(Convert.toStr(priceRouteEntity.getEndCityId())); + // String endCounty = regionMap.get(Convert.toStr(priceRouteEntity.getEndCountyId())); + // String sendOrg = clientMap.get(priceRouteEntity.getSendOrgId()); + // Long categoryId = fullVehicleEntity.getCategoryId(); + // String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + // String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + // String onlyKey = Convert.toStr(clientName) + Convert.toStr(brandName) + Convert.toStr(effectiveTime) + categoryIdStr + Convert.toStr(startProvince) + Convert.toStr(startCity) + Convert.toStr(startCounty) + // + Convert.toStr(endProvince) + Convert.toStr(endCity) + Convert.toStr(endCounty) + Convert.toStr(sendOrg); + // BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + // if (categoryV2ExcelMap.containsKey(onlyKey)) { + // fullVehicleV2Excel = categoryV2ExcelMap.get(onlyKey); + // } else { + // fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // // 路径 + // fullVehicleV2Excel.setStartProvince(startProvince); + // fullVehicleV2Excel.setStartCity(startCity); + // fullVehicleV2Excel.setStartArea(startCounty); + // fullVehicleV2Excel.setEndProvince(endProvince); + // fullVehicleV2Excel.setEndCity(endCity); + // fullVehicleV2Excel.setEndArea(endCounty); + // fullVehicleV2Excel.setSendOrg(sendOrg); + // fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + // if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + // fullVehicleV2Excel.setClient(clientName); + // fullVehicleV2Excel.setBrand(brandName); + // fullVehicleV2Excel.setEffectiveTime(effectiveTime); + // fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + // } + // categoryV2ExcelMap.put(onlyKey, fullVehicleV2Excel); + // fullVehicleV2ExcelSet.add(clientName + brandName + Convert.toStr(effectiveTime)); + // } + // Integer costType = fullVehicleEntity.getCostType(); + // if (ObjectUtil.isNotEmpty(costType)) { + // if (costType == 1) { + // Double price = fullVehicleEntity.getPrice(); + // String priceStr = Convert.toStr(price); + // Double leaveBehindPrice = fullVehicleEntity.getLeaveBehindPrice(); + // String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + // Integer type = fullVehicleEntity.getType(); + // if (ObjectUtil.isNotEmpty(type)) { + // if (type == 1) { + // fullVehicleV2Excel.setDispatchUnit("按件"); + // } else if (type == 2) { + // fullVehicleV2Excel.setDispatchUnit("按方"); + // } else if (type == 3) { + // fullVehicleV2Excel.setDispatchUnit("按重量"); + // } else if (type == 4) { + // fullVehicleV2Excel.setDispatchUnit("按公里"); + // } else if (type == 5) { + // fullVehicleV2Excel.setDispatchUnit("按吨公里"); + // } else if (type == 6) { + // fullVehicleV2Excel.setDispatchUnit("按吨"); + // } + // } + // fullVehicleV2Excel.setDispatchPrice(priceStr); + // fullVehicleV2Excel.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + // } else if (costType == 2) { + // Double sortPrice = fullVehicleEntity.getSortPrice(); + // String sortPriceStr = Convert.toStr(sortPrice); + // Double handlingPrice = fullVehicleEntity.getHandlingPrice(); + // String handlingPriceStr = Convert.toStr(handlingPrice); + // Double relocationPrice = fullVehicleEntity.getRelocationPrice(); + // String relocationPriceStr = Convert.toStr(relocationPrice); + // Double upstairsDeliveryPrice = fullVehicleEntity.getUpstairsDeliveryPrice(); + // String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + // String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + // fullVehicleV2Excel.setDispatchSortPrice(sortPriceStr); + // fullVehicleV2Excel.setDispatchHandlingPrice(handlingPriceStr); + // fullVehicleV2Excel.setDispatchRelocationPrice(relocationPriceStr); + // fullVehicleV2Excel.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + // fullVehicleV2Excel.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + // } + // } + // } + // } + // // 不带路径的情况下 将数据分摊到每条数据中,不包含的情况下 则单独一行数据处理 + // List collect1 = value.stream().filter(item -> StrUtil.equals(Convert.toStr(item.getBoId()), Convert.toStr(item.getPriceId()))).collect(Collectors.toList()); + // if (CollUtil.isNotEmpty(collect1)) { + // for (BasicdataPriceCategoryDispatchEntity basicdataPriceFullVehicleEntity : collect1) { + // Long priceId = basicdataPriceFullVehicleEntity.getPriceId(); + // BasicdataPricePageV2VO pricePageV2VO = basicdataPricePageV2VOMap.get(priceId); + // String clientName = pricePageV2VO.getClientName(); + // String brandName = pricePageV2VO.getBrandName(); + // String effectiveTime = DateUtil.formatDate(pricePageV2VO.getEffectiveTime()); + // Long categoryId = basicdataPriceFullVehicleEntity.getCategoryId(); + // String categoryIdStr = Convert.toStr(ObjectUtil.isNotEmpty(categoryId) ? categoryId : ""); + // String checkKey = clientName + brandName + Convert.toStr(effectiveTime); + // String checkKey1 = clientName + brandName + Convert.toStr(effectiveTime) + categoryIdStr; + // if (fullVehicleV2ExcelSet.contains(checkKey)) { + // if (CollUtil.isNotEmpty(categoryV2ExcelMap)) { + // for (Map.Entry priceFullVehicleEntity : categoryV2ExcelMap.entrySet()) { + // String key1 = priceFullVehicleEntity.getKey(); + // BasicdataPriceCategoryV2Excel value1 = priceFullVehicleEntity.getValue(); + // if (key1.contains(checkKey1)) { + // // 存在 + // Integer costType = basicdataPriceFullVehicleEntity.getCostType(); + // if (ObjectUtil.isNotEmpty(costType)) { + // if (costType == 1) { + // Double price = basicdataPriceFullVehicleEntity.getPrice(); + // String priceStr = Convert.toStr(price); + // Double leaveBehindPrice = basicdataPriceFullVehicleEntity.getLeaveBehindPrice(); + // String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + // Integer type = basicdataPriceFullVehicleEntity.getType(); + // if (ObjectUtil.isNotEmpty(type)) { + // if (type == 1) { + // value1.setDispatchUnit("按件"); + // } else if (type == 2) { + // value1.setDispatchUnit("按方"); + // } else if (type == 3) { + // value1.setDispatchUnit("按重量"); + // } else if (type == 4) { + // value1.setDispatchUnit("按公里"); + // } else if (type == 5) { + // value1.setDispatchUnit("按吨公里"); + // } else if (type == 6) { + // value1.setDispatchUnit("按吨"); + // } + // } + // value1.setDispatchPrice(priceStr); + // value1.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + // } else if (costType == 2) { + // Double sortPrice = basicdataPriceFullVehicleEntity.getSortPrice(); + // String sortPriceStr = Convert.toStr(sortPrice); + // Double handlingPrice = basicdataPriceFullVehicleEntity.getHandlingPrice(); + // String handlingPriceStr = Convert.toStr(handlingPrice); + // Double relocationPrice = basicdataPriceFullVehicleEntity.getRelocationPrice(); + // String relocationPriceStr = Convert.toStr(relocationPrice); + // Double upstairsDeliveryPrice = basicdataPriceFullVehicleEntity.getUpstairsDeliveryPrice(); + // String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + // String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + // value1.setDispatchSortPrice(sortPriceStr); + // value1.setDispatchHandlingPrice(handlingPriceStr); + // value1.setDispatchRelocationPrice(relocationPriceStr); + // value1.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + // value1.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + // } + // } + // } + // } + // } + // } else { + // // 不存在 + // BasicdataPriceCategoryV2Excel fullVehicleV2Excel = null; + // if (categoryV2ExcelMap.containsKey(checkKey1)) { + // fullVehicleV2Excel = categoryV2ExcelMap.get(checkKey1); + // } else { + // fullVehicleV2Excel = new BasicdataPriceCategoryV2Excel(); + // fullVehicleV2Excel.setCategory(categoryEntityMap.get(categoryIdStr)); + // if (ObjectUtil.isNotEmpty(pricePageV2VO)) { + // fullVehicleV2Excel.setClient(pricePageV2VO.getClientName()); + // fullVehicleV2Excel.setBrand(pricePageV2VO.getBrandName()); + // fullVehicleV2Excel.setEffectiveTime(effectiveTime); + // fullVehicleV2Excel.setEffectiveStatus(pricePageV2VO.getEffectiveStatus()); + // } + // categoryV2ExcelMap.put(checkKey1, fullVehicleV2Excel); + // } + // Integer costType = basicdataPriceFullVehicleEntity.getCostType(); + // if (ObjectUtil.isNotEmpty(costType)) { + // if (costType == 1) { + // Double price = basicdataPriceFullVehicleEntity.getPrice(); + // String priceStr = Convert.toStr(price); + // Double leaveBehindPrice = basicdataPriceFullVehicleEntity.getLeaveBehindPrice(); + // String leaveBehindPriceStr = Convert.toStr(leaveBehindPrice); + // // 1:按件,2:按方,3:按重量,4:按公里,5:按吨公里,6:按吨 + // Integer type = basicdataPriceFullVehicleEntity.getType(); + // if (ObjectUtil.isNotEmpty(type)) { + // if (type == 1) { + // fullVehicleV2Excel.setDispatchUnit("按件"); + // } else if (type == 2) { + // fullVehicleV2Excel.setDispatchUnit("按方"); + // } else if (type == 3) { + // fullVehicleV2Excel.setDispatchUnit("按重量"); + // } else if (type == 4) { + // fullVehicleV2Excel.setDispatchUnit("按公里"); + // } else if (type == 5) { + // fullVehicleV2Excel.setDispatchUnit("按吨公里"); + // } else if (type == 6) { + // fullVehicleV2Excel.setDispatchUnit("按吨"); + // } + // } + // fullVehicleV2Excel.setDispatchPrice(priceStr); + // fullVehicleV2Excel.setDispatchLeaveBehindPrice(leaveBehindPriceStr); + // } else if (costType == 2) { + // Double sortPrice = basicdataPriceFullVehicleEntity.getSortPrice(); + // String sortPriceStr = Convert.toStr(sortPrice); + // Double handlingPrice = basicdataPriceFullVehicleEntity.getHandlingPrice(); + // String handlingPriceStr = Convert.toStr(handlingPrice); + // Double relocationPrice = basicdataPriceFullVehicleEntity.getRelocationPrice(); + // String relocationPriceStr = Convert.toStr(relocationPrice); + // Double upstairsDeliveryPrice = basicdataPriceFullVehicleEntity.getUpstairsDeliveryPrice(); + // String upstairsDeliveryPriceStr = Convert.toStr(upstairsDeliveryPrice); + // String dispatchStairsCarryingCharge = pricePageV2VO.getDispatchStairsCarryingCharge(); + // fullVehicleV2Excel.setDispatchSortPrice(sortPriceStr); + // fullVehicleV2Excel.setDispatchHandlingPrice(handlingPriceStr); + // fullVehicleV2Excel.setDispatchRelocationPrice(relocationPriceStr); + // fullVehicleV2Excel.setDispatchDeliveryPrice(upstairsDeliveryPriceStr); + // fullVehicleV2Excel.setDispatchStairsCarryingCharge(dispatchStairsCarryingCharge); + // } + // } + // } + // } + // } + // } + // } + + if (CollUtil.isNotEmpty(categoryV2ExcelMap)) { + Collection values = categoryV2ExcelMap.values(); if (CollUtil.isNotEmpty(values)) { List objects = new ArrayList<>(); objects.addAll(values); excelWriter.write(objects, writeSheet4, table4); - }else{ + } else { excelWriter.write(new ArrayList(), writeSheet4, table4); } } @@ -3816,10 +5680,18 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl priceEntities = this.list(Wrappers.lambdaQuery() .in(BasicdataPriceEntity::getClientId, clientEntityMap.values().stream().map(BasicdataClientEntity::getId).collect(Collectors.toList())) .in(BasicdataPriceEntity::getBrandId, brandEntityMap.values().stream().map(BasicdataBrandEntity::getId).collect(Collectors.toList())) - .lt(BasicdataPriceEntity::getEffectiveStatus, 1) ); if (CollUtil.isNotEmpty(priceEntities)) { // 分组存入map中 priceEntities.forEach(priceEntity -> { - checkPriceMap.computeIfAbsent(clientMap.get(priceEntity.getClientId().toString()) + brandMap.get(priceEntity.getBrandId().toString()), k -> new ArrayList<>()); - checkPriceMap.get(clientMap.get(priceEntity.getClientId().toString()) + brandMap.get(priceEntity.getBrandId().toString())).add(priceEntity); + checkPriceMap.computeIfAbsent(clientMap.get(priceEntity.getClientId().toString()) + brandMap.get(priceEntity.getBrandId().toString()) + DateUtil.formatDate(priceEntity.getEffectiveTime()), k -> new ArrayList<>()); + checkPriceMap.get(clientMap.get(priceEntity.getClientId().toString()) + brandMap.get(priceEntity.getBrandId().toString()) + DateUtil.formatDate(priceEntity.getEffectiveTime())).add(priceEntity); }); } } @@ -5087,7 +6960,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl priceEntities = checkPriceEntityMap.get(priceExcel.getClient() + priceExcel.getBrand()); + List priceEntities = checkPriceEntityMap.get(priceExcel.getClient() + priceExcel.getBrand() + DateUtil.formatDate(startTime)); if (CollUtil.isNotEmpty(priceEntities)) { for (BasicdataPriceEntity priceEntity : priceEntities) { LocalDateTime now = DateUtil.date().toLocalDateTime();