Browse Source

feat(service): 优化价格体系

dist.1.3.0
zhaoqiaobo 9 months ago
parent
commit
5be3192c5a
  1. 464
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

464
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

@ -21,6 +21,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@ -1541,12 +1542,14 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
// 按类型分组放到fullMap中
list.forEach(item -> {
Integer type = item.getType();
List<BasicdataPriceFullVehicleEntity> collect = fullMap.get(type);
if (ObjectUtil.isEmpty(collect)) {
collect = new ArrayList<>();
if (ObjectUtil.isNotNull(fullMap)) {
List<BasicdataPriceFullVehicleEntity> collect = fullMap.get(type);
if (ObjectUtil.isEmpty(collect)) {
collect = new ArrayList<>();
}
collect.add(item);
fullMap.put(type, collect);
}
collect.add(item);
fullMap.put(type, collect);
});
}
// 获取品类数据
@ -1630,97 +1633,99 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
categoryBasicMap.put(type, collect);
});
}
//整车
if (dispatchPricingType.contains(DispatchPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
List<BasicdataPriceFullVehicleVO> basicVOList = new ArrayList<>();
fullVehicleEntities.forEach(item -> {
BasicdataPriceFullVehicleVO basicVO = new BasicdataPriceFullVehicleVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
priceDispatchVO.setFullVehicle(basicVOList);
}
}
// 按件
if (dispatchPricingType.contains(DispatchPricingTypeEnums.PIECE.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.PIECE.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setPieceCategory(basicVOList);
}
// 按重量
if (dispatchPricingType.contains(DispatchPricingTypeEnums.WEIGHT.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.WEIGHT.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setWeightCategory(basicVOList);
}
// 按方
if (dispatchPricingType.contains(DispatchPricingTypeEnums.CUBE.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.CUBE.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setCubeCategory(basicVOList);
}
// 按公里
if (dispatchPricingType.contains(DispatchPricingTypeEnums.KILOMETER.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.KILOMETER.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setKilometerCost(basicVOList);
}
// 按吨
if (dispatchPricingType.contains(DispatchPricingTypeEnums.TON.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.TON.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setTonCost(basicVOList);
}
//按吨公里
if (dispatchPricingType.contains(DispatchPricingTypeEnums.TON_PER_KILOMETER.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.TON_PER_KILOMETER.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
if (ObjectUtil.isNotEmpty(dispatchPricingType)) {
//整车
if (ObjectUtil.contains(dispatchPricingType, DispatchPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
List<BasicdataPriceFullVehicleVO> basicVOList = new ArrayList<>();
fullVehicleEntities.forEach(item -> {
BasicdataPriceFullVehicleVO basicVO = new BasicdataPriceFullVehicleVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
priceDispatchVO.setFullVehicle(basicVOList);
}
}
// 按件
if (ObjectUtil.contains(dispatchPricingType, DispatchPricingTypeEnums.PIECE.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.PIECE.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setPieceCategory(basicVOList);
}
// 按重量
if (ObjectUtil.contains(dispatchPricingType, DispatchPricingTypeEnums.WEIGHT.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.WEIGHT.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setWeightCategory(basicVOList);
}
// 按方
if (ObjectUtil.contains(dispatchPricingType, DispatchPricingTypeEnums.CUBE.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.CUBE.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setCubeCategory(basicVOList);
}
// 按公里
if (ObjectUtil.contains(dispatchPricingType, DispatchPricingTypeEnums.KILOMETER.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.KILOMETER.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setKilometerCost(basicVOList);
}
// 按吨
if (ObjectUtil.contains(dispatchPricingType, DispatchPricingTypeEnums.TON.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.TON.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setTonCost(basicVOList);
}
//按吨公里
if (ObjectUtil.contains(dispatchPricingType, DispatchPricingTypeEnums.TON_PER_KILOMETER.getCode().toString())) {
List<PriceDispatchBasicVO> basicVOList = new ArrayList<>();
List<BasicdataPriceCategoryDispatchEntity> basicEntities = categoryBasicMap.get(DispatchPricingTypeEnums.TON_PER_KILOMETER.getCode());
if (CollUtil.isNotEmpty(basicEntities)) {
basicEntities.forEach(item -> {
PriceDispatchBasicVO basicVO = new PriceDispatchBasicVO();
BeanUtil.copyProperties(item, basicVO);
basicVOList.add(basicVO);
});
}
priceDispatchVO.setTonKilometerCost(basicVOList);
}
priceDispatchVO.setTonKilometerCost(basicVOList);
}
//附加费
List<BasicdataPriceCategoryDispatchEntity> dispatchEntities1 = dispatchMap.get(CostTypeEnums.ADD.getCode());
if (CollUtil.isNotEmpty(dispatchEntities1)) {
@ -1748,9 +1753,11 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
}
// 设置基础费用
priceDispatchVO.setDispatchUpwardJudgment(priceEntity.getDispatchUpwardJudgment());
priceDispatchVO.setDispatchUpwardJudgmentCost(priceEntity.getDispatchUpwardJudgmentCost());
priceDispatchVO.setDispatchStairsCarryingCharge(priceEntity.getDispatchStairsCarryingCharge());
if (ObjectUtil.isNotEmpty(priceEntity)) {
priceDispatchVO.setDispatchUpwardJudgment(priceEntity.getDispatchUpwardJudgment());
priceDispatchVO.setDispatchUpwardJudgmentCost(priceEntity.getDispatchUpwardJudgmentCost());
priceDispatchVO.setDispatchStairsCarryingCharge(priceEntity.getDispatchStairsCarryingCharge());
}
return priceDispatchVO;
}
@ -1770,48 +1777,51 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
categoryBasicMap.put(type, collect);
});
}
// 按件
if (warehousePricingType.equals(WarehousePricingTypeEnums.PIECE.getCode())) {
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities1 = categoryBasicMap.get(WarehousePricingTypeEnums.PIECE.getCode());
if (CollUtil.isNotEmpty(warehouseEntities1)) {
List<PriceWarehouseBasicVO> basicVOS = warehouseEntities1.stream().map(item -> {
PriceWarehouseBasicVO basicVO = new PriceWarehouseBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
priceWarehouseVO.setCatergory(basicVOS);
}
} else if (warehousePricingType.equals(WarehousePricingTypeEnums.CUBE.getCode())) {
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities2 = categoryBasicMap.get(WarehousePricingTypeEnums.CUBE.getCode());
if (CollUtil.isNotEmpty(warehouseEntities2)) {
List<PriceWarehouseBasicVO> basicVOS = warehouseEntities2.stream().map(item -> {
PriceWarehouseBasicVO basicVO = new PriceWarehouseBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
priceWarehouseVO.setCatergory(basicVOS);
}
} else if (warehousePricingType.equals(WarehousePricingTypeEnums.WEIGHT.getCode())) {
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities3 = categoryBasicMap.get(WarehousePricingTypeEnums.WEIGHT.getCode());
if (CollUtil.isNotEmpty(warehouseEntities3)) {
List<PriceWarehouseBasicVO> basicVOS = warehouseEntities3.stream().map(item -> {
PriceWarehouseBasicVO basicVO = new PriceWarehouseBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
priceWarehouseVO.setCatergory(basicVOS);
}
} else if (warehousePricingType.equals(WarehousePricingTypeEnums.TONNE.getCode())) {
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities4 = categoryBasicMap.get(WarehousePricingTypeEnums.TONNE.getCode());
if (CollUtil.isNotEmpty(warehouseEntities4)) {
List<PriceWarehouseBasicVO> basicVOS = warehouseEntities4.stream().map(item -> {
PriceWarehouseBasicVO basicVO = new PriceWarehouseBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
priceWarehouseVO.setCatergory(basicVOS);
if (ObjectUtil.isNotEmpty(warehousePricingType)) {
// 按件
if (ObjectUtil.equal(warehousePricingType, WarehousePricingTypeEnums.PIECE.getCode())) {
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities1 = categoryBasicMap.get(WarehousePricingTypeEnums.PIECE.getCode());
if (CollUtil.isNotEmpty(warehouseEntities1)) {
List<PriceWarehouseBasicVO> basicVOS = warehouseEntities1.stream().map(item -> {
PriceWarehouseBasicVO basicVO = new PriceWarehouseBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
priceWarehouseVO.setCatergory(basicVOS);
}
} else if (ObjectUtil.equal(warehousePricingType, WarehousePricingTypeEnums.CUBE.getCode())) {
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities2 = categoryBasicMap.get(WarehousePricingTypeEnums.CUBE.getCode());
if (CollUtil.isNotEmpty(warehouseEntities2)) {
List<PriceWarehouseBasicVO> basicVOS = warehouseEntities2.stream().map(item -> {
PriceWarehouseBasicVO basicVO = new PriceWarehouseBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
priceWarehouseVO.setCatergory(basicVOS);
}
} else if (ObjectUtil.equal(warehousePricingType, WarehousePricingTypeEnums.WEIGHT.getCode())) {
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities3 = categoryBasicMap.get(WarehousePricingTypeEnums.WEIGHT.getCode());
if (CollUtil.isNotEmpty(warehouseEntities3)) {
List<PriceWarehouseBasicVO> basicVOS = warehouseEntities3.stream().map(item -> {
PriceWarehouseBasicVO basicVO = new PriceWarehouseBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
priceWarehouseVO.setCatergory(basicVOS);
}
} else if (ObjectUtil.equal(warehousePricingType, WarehousePricingTypeEnums.TONNE.getCode())) {
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities4 = categoryBasicMap.get(WarehousePricingTypeEnums.TONNE.getCode());
if (CollUtil.isNotEmpty(warehouseEntities4)) {
List<PriceWarehouseBasicVO> basicVOS = warehouseEntities4.stream().map(item -> {
PriceWarehouseBasicVO basicVO = new PriceWarehouseBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
priceWarehouseVO.setCatergory(basicVOS);
}
}
}
// 附加费
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities1 = warehouseMap.get(CostTypeEnums.ADD.getCode());
if (CollUtil.isNotEmpty(warehouseEntities1)) {
@ -1832,50 +1842,52 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
initCategoryBasicMap(categoryBasicEntities, categoryBasicMap);
// 设置整车
String trunklinePricingType = templateEntity.getTrunklinePricingType();
if (trunklinePricingType.contains(TrunkLinePricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
List<BasicdataPriceFullVehicleVO> fullVehicleVOS = fullVehicleEntities.stream().map(item -> {
BasicdataPriceFullVehicleVO basicdataPriceFullVehicleVO = new BasicdataPriceFullVehicleVO();
BeanUtil.copyProperties(item, basicdataPriceFullVehicleVO);
return basicdataPriceFullVehicleVO;
}).collect(Collectors.toList());
priceTrunkLineVO.setFullVehicle(fullVehicleVOS);
}
}
// 设置按件
if (trunklinePricingType.contains(TrunkLinePricingTypeEnums.PIECE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(TrunkLinePricingTypeEnums.PIECE.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> pieceCategoryVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO priceBasicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, priceBasicVO);
return priceBasicVO;
}).collect(Collectors.toList());
priceTrunkLineVO.setPieceCategory(pieceCategoryVOS);
}
}
// 设置按方
if (trunklinePricingType.contains(TrunkLinePricingTypeEnums.CUBE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(TrunkLinePricingTypeEnums.CUBE.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> cubeCategoryVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO priceBasicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, priceBasicVO);
return priceBasicVO;
}).collect(Collectors.toList());
priceTrunkLineVO.setCubeCategory(cubeCategoryVOS);
}
}
// 设置重量
if (trunklinePricingType.contains(TrunkLinePricingTypeEnums.WEIGHT.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(TrunkLinePricingTypeEnums.WEIGHT.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> weightCategoryVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO priceBasicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, priceBasicVO);
return priceBasicVO;
}).collect(Collectors.toList());
priceTrunkLineVO.setWeightCategory(weightCategoryVOS);
if (StrUtil.isNotEmpty(trunklinePricingType)) {
if (trunklinePricingType.contains(TrunkLinePricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
List<BasicdataPriceFullVehicleVO> fullVehicleVOS = fullVehicleEntities.stream().map(item -> {
BasicdataPriceFullVehicleVO basicdataPriceFullVehicleVO = new BasicdataPriceFullVehicleVO();
BeanUtil.copyProperties(item, basicdataPriceFullVehicleVO);
return basicdataPriceFullVehicleVO;
}).collect(Collectors.toList());
priceTrunkLineVO.setFullVehicle(fullVehicleVOS);
}
}
// 设置按件
if (trunklinePricingType.contains(TrunkLinePricingTypeEnums.PIECE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(TrunkLinePricingTypeEnums.PIECE.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> pieceCategoryVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO priceBasicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, priceBasicVO);
return priceBasicVO;
}).collect(Collectors.toList());
priceTrunkLineVO.setPieceCategory(pieceCategoryVOS);
}
}
// 设置按方
if (trunklinePricingType.contains(TrunkLinePricingTypeEnums.CUBE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(TrunkLinePricingTypeEnums.CUBE.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> cubeCategoryVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO priceBasicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, priceBasicVO);
return priceBasicVO;
}).collect(Collectors.toList());
priceTrunkLineVO.setCubeCategory(cubeCategoryVOS);
}
}
// 设置重量
if (trunklinePricingType.contains(TrunkLinePricingTypeEnums.WEIGHT.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(TrunkLinePricingTypeEnums.WEIGHT.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> weightCategoryVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO priceBasicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, priceBasicVO);
return priceBasicVO;
}).collect(Collectors.toList());
priceTrunkLineVO.setWeightCategory(weightCategoryVOS);
}
}
}
Integer pickupIsMinCost = templateEntity.getPickupIsMinCost();
@ -1900,50 +1912,52 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
// 设置整车
// fullVehicleEntities转为BasicdataPriceFullVehicleVO
String pickupPricingType = templateEntity.getPickupPricingType();
if (pickupPricingType.contains(PickupPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
List<BasicdataPriceFullVehicleVO> fullVehicleVOS = fullVehicleEntities.stream().map(item -> {
BasicdataPriceFullVehicleVO basicdataPriceFullVehicleVO = new BasicdataPriceFullVehicleVO();
BeanUtil.copyProperties(item, basicdataPriceFullVehicleVO);
return basicdataPriceFullVehicleVO;
}).collect(Collectors.toList());
pricePickupVO.setFullVehicle(fullVehicleVOS);
}
}
// 按件
if (pickupPricingType.contains(PickupPricingTypeEnums.PIECE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(PickupPricingTypeEnums.PIECE.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> basicVOS = categoryBasicEntities.stream().map(item -> {
PriceBasicVO basicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
pricePickupVO.setPieceCategory(basicVOS);
}
}
// 按方
if (pickupPricingType.contains(PickupPricingTypeEnums.CUBE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(PickupPricingTypeEnums.CUBE.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> basicVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO basicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
pricePickupVO.setCubeCategory(basicVOS);
}
}
// 按重量
if (pickupPricingType.contains(PickupPricingTypeEnums.WEIGHT.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(PickupPricingTypeEnums.WEIGHT.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> basicVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO basicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
pricePickupVO.setWeightCategory(basicVOS);
if (StrUtil.isNotEmpty(pickupPricingType)) {
if (pickupPricingType.contains(PickupPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
List<BasicdataPriceFullVehicleVO> fullVehicleVOS = fullVehicleEntities.stream().map(item -> {
BasicdataPriceFullVehicleVO basicdataPriceFullVehicleVO = new BasicdataPriceFullVehicleVO();
BeanUtil.copyProperties(item, basicdataPriceFullVehicleVO);
return basicdataPriceFullVehicleVO;
}).collect(Collectors.toList());
pricePickupVO.setFullVehicle(fullVehicleVOS);
}
}
// 按件
if (pickupPricingType.contains(PickupPricingTypeEnums.PIECE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(PickupPricingTypeEnums.PIECE.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> basicVOS = categoryBasicEntities.stream().map(item -> {
PriceBasicVO basicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
pricePickupVO.setPieceCategory(basicVOS);
}
}
// 按方
if (pickupPricingType.contains(PickupPricingTypeEnums.CUBE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(PickupPricingTypeEnums.CUBE.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> basicVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO basicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
pricePickupVO.setCubeCategory(basicVOS);
}
}
// 按重量
if (pickupPricingType.contains(PickupPricingTypeEnums.WEIGHT.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(PickupPricingTypeEnums.WEIGHT.getCode());
if (CollUtil.isNotEmpty(categoryBasicEntityList)) {
List<PriceBasicVO> basicVOS = categoryBasicEntityList.stream().map(item -> {
PriceBasicVO basicVO = new PriceBasicVO();
BeanUtil.copyProperties(item, basicVO);
return basicVO;
}).collect(Collectors.toList());
pricePickupVO.setWeightCategory(basicVOS);
}
}
}
Integer pickupIsMinCost = templateEntity.getPickupIsMinCost();

Loading…
Cancel
Save