Browse Source

feat(all): 增加价格体系更严格的控制

dist.1.3.0
zhaoqiaobo 8 months ago
parent
commit
daf3b4d886
  1. 468
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

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

@ -1346,121 +1346,134 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
String trunkLinePrice = excel.getTrunkLinePrice();
String dispatchPrice = excel.getDispatchPrice();
if (StrUtil.isNotEmpty(pickupPrice) && Convert.toDouble(pickupPrice) > 0) {
boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode());
BasicdataPriceFullVehicleEntity entity = null;
if (b) {
entity = new BasicdataPriceFullVehicleEntity();
} else {
if (pickupEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) {
entity = pickupEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType());
} else {
String pickupPricingType = templateEntity.getPickupPricingType();
// 提货费的计价方式是否包含整车
if (StrUtil.isNotEmpty(pickupPricingType) && StrUtil.contains(pickupPricingType, PickupPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode());
BasicdataPriceFullVehicleEntity entity = null;
if (b) {
entity = new BasicdataPriceFullVehicleEntity();
pickupEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity);
} else {
if (pickupEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) {
entity = pickupEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType());
} else {
entity = new BasicdataPriceFullVehicleEntity();
pickupEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity);
}
}
}
if (b) {
if (!ObjectUtil.isAllEmpty(excel.getClient(), excel.getBrand(), excel.getSendOrg())) {
String key = buildRoutKeyV2(excel.getClient(), excel.getBrand(), excel.getStartProvince(), excel.getStartCity(),
excel.getStartArea(), excel.getEndProvince(), excel.getEndCity(), excel.getEndArea(), excel.getSendOrg(), "1");
BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key);
if (ObjectUtil.isNotEmpty(routeEntity)) {
entity.setBoId(routeEntity.getId());
if (b) {
if (!ObjectUtil.isAllEmpty(excel.getClient(), excel.getBrand(), excel.getSendOrg())) {
String key = buildRoutKeyV2(excel.getClient(), excel.getBrand(), excel.getStartProvince(), excel.getStartCity(),
excel.getStartArea(), excel.getEndProvince(), excel.getEndCity(), excel.getEndArea(), excel.getSendOrg(), "1");
BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key);
if (ObjectUtil.isNotEmpty(routeEntity)) {
entity.setBoId(routeEntity.getId());
}
} else {
entity.setBoId(priceEntity.getId());
log.error("价格体系导入FullVehicle数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(excel));
continue;
}
} else {
// 统一计费
entity.setBoId(priceEntity.getId());
log.error("价格体系导入FullVehicle数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(excel));
continue;
}
} else {
// 统一计费
entity.setBoId(priceEntity.getId());
}
entity.setPriceId(priceEntity.getId());
// 类型
entity.setType(FullVehicleTypeEnums.PICK_UP.getCode());
// 车型
if (ObjectUtil.isNotEmpty(excel.getVehicleType())) {
String vehicleType = vehicleTypeMap.get(excel.getVehicleType());
if (StrUtil.isNotEmpty(vehicleType)) {
entity.setVehicleType(Convert.toInt(vehicleType));
entity.setPriceId(priceEntity.getId());
// 类型
entity.setType(FullVehicleTypeEnums.PICK_UP.getCode());
// 车型
if (ObjectUtil.isNotEmpty(excel.getVehicleType())) {
String vehicleType = vehicleTypeMap.get(excel.getVehicleType());
if (StrUtil.isNotEmpty(vehicleType)) {
entity.setVehicleType(Convert.toInt(vehicleType));
}
}
// 价格
entity.setPrice(Convert.toDouble(pickupPrice));
if (b) {
entities.add(entity);
}
}
// 价格
entity.setPrice(Convert.toDouble(pickupPrice));
if (b) {
entities.add(entity);
}
}
if (StrUtil.isNotEmpty(trunkLinePrice) && Convert.toDouble(trunkLinePrice) > 0) {
boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode());
BasicdataPriceFullVehicleEntity entity = null;
if (b) {
entity = new BasicdataPriceFullVehicleEntity();
} else {
if (trunkLineEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) {
entity = trunkLineEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType());
} else {
String pricingType = templateEntity.getTrunklinePricingType();
// 提货费的计价方式是否包含整车
if (StrUtil.isNotEmpty(pricingType) && StrUtil.contains(pricingType, TrunkLinePricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode());
BasicdataPriceFullVehicleEntity entity = null;
if (b) {
entity = new BasicdataPriceFullVehicleEntity();
trunkLineEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity);
} else {
if (trunkLineEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) {
entity = trunkLineEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType());
} else {
entity = new BasicdataPriceFullVehicleEntity();
trunkLineEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity);
}
}
}
if (ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode())) {
if (!ObjectUtil.isAllEmpty(excel.getClient(), excel.getBrand(), excel.getSendOrg())) {
String key = buildRoutKeyV2(excel.getClient(), excel.getBrand(), excel.getStartProvince(), excel.getStartCity(),
excel.getStartArea(), excel.getEndProvince(), excel.getEndCity(), excel.getEndArea(), excel.getSendOrg(), "2");
BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key);
if (ObjectUtil.isNotEmpty(routeEntity)) {
entity.setBoId(routeEntity.getId());
if (ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode())) {
if (!ObjectUtil.isAllEmpty(excel.getClient(), excel.getBrand(), excel.getSendOrg())) {
String key = buildRoutKeyV2(excel.getClient(), excel.getBrand(), excel.getStartProvince(), excel.getStartCity(),
excel.getStartArea(), excel.getEndProvince(), excel.getEndCity(), excel.getEndArea(), excel.getSendOrg(), "2");
BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key);
if (ObjectUtil.isNotEmpty(routeEntity)) {
entity.setBoId(routeEntity.getId());
}
} else {
entity.setBoId(priceEntity.getId());
log.error("价格体系导入FullVehicle数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(excel));
continue;
}
} else {
// 统一计费
entity.setBoId(priceEntity.getId());
log.error("价格体系导入FullVehicle数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(excel));
continue;
}
} else {
// 统一计费
entity.setBoId(priceEntity.getId());
}
entity.setPriceId(priceEntity.getId());
// 类型
entity.setType(FullVehicleTypeEnums.TRUNK_LINE.getCode());
// 车型
if (ObjectUtil.isNotEmpty(excel.getVehicleType())) {
String vehicleType = vehicleTypeMap.get(excel.getVehicleType());
if (StrUtil.isNotEmpty(vehicleType)) {
entity.setVehicleType(Convert.toInt(vehicleType));
entity.setPriceId(priceEntity.getId());
// 类型
entity.setType(FullVehicleTypeEnums.TRUNK_LINE.getCode());
// 车型
if (ObjectUtil.isNotEmpty(excel.getVehicleType())) {
String vehicleType = vehicleTypeMap.get(excel.getVehicleType());
if (StrUtil.isNotEmpty(vehicleType)) {
entity.setVehicleType(Convert.toInt(vehicleType));
}
}
// 价格
entity.setPrice(Convert.toDouble(trunkLinePrice));
if (b) {
entities.add(entity);
}
}
// 价格
entity.setPrice(Convert.toDouble(trunkLinePrice));
if (b) {
entities.add(entity);
}
}
if (StrUtil.isNotEmpty(dispatchPrice) && Convert.toDouble(dispatchPrice) > 0) {
BasicdataPriceFullVehicleEntity entity = null;
if (dispatchEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) {
entity = dispatchEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType());
} else {
entity = new BasicdataPriceFullVehicleEntity();
dispatchEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity);
}
// 统一计费
entity.setBoId(priceEntity.getId());
entity.setPriceId(priceEntity.getId());
// 类型
entity.setType(FullVehicleTypeEnums.DISPATCH.getCode());
// 车型
if (ObjectUtil.isNotEmpty(excel.getVehicleType())) {
String vehicleType = vehicleTypeMap.get(excel.getVehicleType());
if (StrUtil.isNotEmpty(vehicleType)) {
entity.setVehicleType(Convert.toInt(vehicleType));
String pricingType = templateEntity.getDispatchPricingType();
// 提货费的计价方式是否包含整车
if (StrUtil.isNotEmpty(pricingType) && StrUtil.contains(pricingType, DispatchPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
BasicdataPriceFullVehicleEntity entity = null;
if (dispatchEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) {
entity = dispatchEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType());
} else {
entity = new BasicdataPriceFullVehicleEntity();
dispatchEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity);
}
// 统一计费
entity.setBoId(priceEntity.getId());
entity.setPriceId(priceEntity.getId());
// 类型
entity.setType(FullVehicleTypeEnums.DISPATCH.getCode());
// 车型
if (ObjectUtil.isNotEmpty(excel.getVehicleType())) {
String vehicleType = vehicleTypeMap.get(excel.getVehicleType());
if (StrUtil.isNotEmpty(vehicleType)) {
entity.setVehicleType(Convert.toInt(vehicleType));
}
}
// 价格
entity.setPrice(Convert.toDouble(dispatchPrice));
}
// 价格
entity.setPrice(Convert.toDouble(dispatchPrice));
}
}
@ -1556,135 +1569,148 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
String dispatchMinCost = basicExcel.getDispatchMinCost();
String dispatchLeaveBehindMinCost = basicExcel.getDispatchLeaveBehindMinCost();
if (StrUtil.isNotEmpty(pickupMinCost) && Convert.toDouble(pickupMinCost) > 0) {
boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode());
// 服务类型
BasicdataPriceGeneralEntity basicEntity = null;
if (b) {
basicEntity = new BasicdataPriceGeneralEntity();
} else {
if (pickupEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
basicEntity = pickupEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
Integer isMinCost = templateEntity.getPickupIsMinCost();
if (ObjectUtil.isNotEmpty(isMinCost) && ObjectUtil.equal(isMinCost, BooleanZeroOneEnums.YES.getCode())) {
boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode());
// 服务类型
BasicdataPriceGeneralEntity basicEntity = null;
if (b) {
basicEntity = new BasicdataPriceGeneralEntity();
pickupEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity);
} else {
if (pickupEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
basicEntity = pickupEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
basicEntity = new BasicdataPriceGeneralEntity();
pickupEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity);
}
}
}
basicEntity.setServiceType(GeneralServiceTypeEnums.PICK_UP.getCode());
// 按区域计费
if (b) {
if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) {
String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), basicExcel.getStartCity(),
basicExcel.getStartArea(), basicExcel.getEndProvince(), basicExcel.getEndCity(), basicExcel.getEndArea(), basicExcel.getSendOrg(), "1");
BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key);
if (ObjectUtil.isNotEmpty(routeEntity)) {
basicEntity.setBoId(routeEntity.getId());
basicEntity.setServiceType(GeneralServiceTypeEnums.PICK_UP.getCode());
// 按区域计费
if (b) {
if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) {
String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), basicExcel.getStartCity(),
basicExcel.getStartArea(), basicExcel.getEndProvince(), basicExcel.getEndCity(), basicExcel.getEndArea(), basicExcel.getSendOrg(), "1");
BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key);
if (ObjectUtil.isNotEmpty(routeEntity)) {
basicEntity.setBoId(routeEntity.getId());
}
} else {
basicEntity.setBoId(priceEntity.getId());
log.error("价格体系导入General数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel));
continue;
}
} else {
// 统一计费
basicEntity.setBoId(priceEntity.getId());
log.error("价格体系导入General数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel));
continue;
}
} else {
// 统一计费
basicEntity.setBoId(priceEntity.getId());
}
basicEntity.setPriceId(priceEntity.getId());
// 最低计费
basicEntity.setMinCost(Convert.toDouble(pickupMinCost));
// 加算价格
if (StrUtil.isNotEmpty(basicExcel.getPickupAddCost())) {
basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getPickupAddCost()));
}
// 按区域计费直接加入保存队列
if (b) {
entities.add(basicEntity);
basicEntity.setPriceId(priceEntity.getId());
// 最低计费
basicEntity.setMinCost(Convert.toDouble(pickupMinCost));
// 加算价格
if (StrUtil.isNotEmpty(basicExcel.getPickupAddCost())) {
basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getPickupAddCost()));
}
// 按区域计费直接加入保存队列
if (b) {
entities.add(basicEntity);
}
}
}
if (StrUtil.isNotEmpty(trunkLineMinCost) && Convert.toDouble(trunkLineMinCost) > 0) {
boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode());
// 服务类型
BasicdataPriceGeneralEntity basicEntity = null;
if (b) {
basicEntity = new BasicdataPriceGeneralEntity();
} else {
if (trunkLineEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
basicEntity = trunkLineEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
Integer isMinCost = templateEntity.getTrunklineIsMinCost();
if (ObjectUtil.isNotEmpty(isMinCost) && ObjectUtil.equal(isMinCost, BooleanZeroOneEnums.YES.getCode())) {
boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode());
// 服务类型
BasicdataPriceGeneralEntity basicEntity = null;
if (b) {
basicEntity = new BasicdataPriceGeneralEntity();
trunkLineEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity);
} else {
if (trunkLineEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
basicEntity = trunkLineEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
basicEntity = new BasicdataPriceGeneralEntity();
trunkLineEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity);
}
}
}
basicEntity.setServiceType(GeneralServiceTypeEnums.TRUNK_LINE.getCode());
// 按区域计费
if (b) {
if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) {
String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), basicExcel.getStartCity(),
basicExcel.getStartArea(), basicExcel.getEndProvince(), basicExcel.getEndCity(), basicExcel.getEndArea(), basicExcel.getSendOrg(), "2");
BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key);
if (ObjectUtil.isNotEmpty(routeEntity)) {
basicEntity.setBoId(routeEntity.getId());
basicEntity.setServiceType(GeneralServiceTypeEnums.TRUNK_LINE.getCode());
// 按区域计费
if (b) {
if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) {
String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), basicExcel.getStartCity(),
basicExcel.getStartArea(), basicExcel.getEndProvince(), basicExcel.getEndCity(), basicExcel.getEndArea(), basicExcel.getSendOrg(), "2");
BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key);
if (ObjectUtil.isNotEmpty(routeEntity)) {
basicEntity.setBoId(routeEntity.getId());
}
} else {
basicEntity.setBoId(priceEntity.getId());
log.error("价格体系导入General数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel));
continue;
}
} else {
// 统一计费
basicEntity.setBoId(priceEntity.getId());
log.error("价格体系导入General数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel));
continue;
}
} else {
// 统一计费
basicEntity.setBoId(priceEntity.getId());
}
basicEntity.setPriceId(priceEntity.getId());
// 最低计费
basicEntity.setMinCost(Convert.toDouble(trunkLineMinCost));
// 加算价格
if (StrUtil.isNotEmpty(basicExcel.getTrunkLineAddCost())) {
basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getTrunkLineAddCost()));
}
if (b) {
entities.add(basicEntity);
basicEntity.setPriceId(priceEntity.getId());
// 最低计费
basicEntity.setMinCost(Convert.toDouble(trunkLineMinCost));
// 加算价格
if (StrUtil.isNotEmpty(basicExcel.getTrunkLineAddCost())) {
basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getTrunkLineAddCost()));
}
if (b) {
entities.add(basicEntity);
}
}
}
if (StrUtil.isNotEmpty(dispatchMinCost) && Convert.toDouble(dispatchMinCost) > 0) {
// 服务类型
BasicdataPriceGeneralEntity basicEntity = null;
if (dispatchEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
basicEntity = dispatchEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
basicEntity = new BasicdataPriceGeneralEntity();
dispatchEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity);
}
basicEntity.setServiceType(GeneralServiceTypeEnums.DISPATCH.getCode());
// 统一计费
basicEntity.setBoId(priceEntity.getId());
basicEntity.setPriceId(priceEntity.getId());
// 最低计费
basicEntity.setMinCost(Convert.toDouble(dispatchMinCost));
// 加算价格
if (StrUtil.isNotEmpty(basicExcel.getDispatchAddCost())) {
basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getDispatchAddCost()));
Integer isMinCost = templateEntity.getDispatchIsMinCost();
if (ObjectUtil.isNotEmpty(isMinCost) && ObjectUtil.equal(isMinCost, BooleanZeroOneEnums.YES.getCode())) {
BasicdataPriceGeneralEntity basicEntity = null;
if (dispatchEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
basicEntity = dispatchEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
basicEntity = new BasicdataPriceGeneralEntity();
dispatchEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity);
}
basicEntity.setServiceType(GeneralServiceTypeEnums.DISPATCH.getCode());
// 统一计费
basicEntity.setBoId(priceEntity.getId());
basicEntity.setPriceId(priceEntity.getId());
// 最低计费
basicEntity.setMinCost(Convert.toDouble(dispatchMinCost));
// 加算价格
if (StrUtil.isNotEmpty(basicExcel.getDispatchAddCost())) {
basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getDispatchAddCost()));
}
}
}
if (StrUtil.isNotEmpty(dispatchLeaveBehindMinCost) && Convert.toDouble(dispatchLeaveBehindMinCost) > 0) {
// 服务类型
BasicdataPriceGeneralEntity basicEntity = null;
if (dispatchLeaveBehindEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
basicEntity = dispatchLeaveBehindEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
basicEntity = new BasicdataPriceGeneralEntity();
dispatchLeaveBehindEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity);
}
basicEntity.setServiceType(GeneralServiceTypeEnums.DISPATCH_LEAVE_BEHIND.getCode());
// 统一计费
basicEntity.setBoId(priceEntity.getId());
basicEntity.setPriceId(priceEntity.getId());
// 最低计费
basicEntity.setMinCost(Convert.toDouble(dispatchLeaveBehindMinCost));
// 加算价格
if (StrUtil.isNotEmpty(basicExcel.getDispatchLeaveBehindAddCost())) {
basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getDispatchLeaveBehindAddCost()));
Integer isMinCost = templateEntity.getDispatchIsMinCost();
if (ObjectUtil.isNotEmpty(isMinCost) && ObjectUtil.equal(isMinCost, BooleanZeroOneEnums.YES.getCode())) {
BasicdataPriceGeneralEntity basicEntity = null;
if (dispatchLeaveBehindEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
basicEntity = dispatchLeaveBehindEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
basicEntity = new BasicdataPriceGeneralEntity();
dispatchLeaveBehindEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity);
}
basicEntity.setServiceType(GeneralServiceTypeEnums.DISPATCH_LEAVE_BEHIND.getCode());
// 统一计费
basicEntity.setBoId(priceEntity.getId());
basicEntity.setPriceId(priceEntity.getId());
// 最低计费
basicEntity.setMinCost(Convert.toDouble(dispatchLeaveBehindMinCost));
// 加算价格
if (StrUtil.isNotEmpty(basicExcel.getDispatchLeaveBehindAddCost())) {
basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getDispatchLeaveBehindAddCost()));
}
}
}
@ -1865,13 +1891,18 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
private void buildSaveDispatchAddExcel(Map<String, BasicdataCategoryEntity> categoryEntityMap, Map<String, BasicdataPriceCategoryDispatchEntity> dispatchAddEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity) {
// 配送是否附加费
Integer dispatchIsAddFee = templateEntity.getDispatchIsAddFee();
if(ObjectUtil.isEmpty(dispatchIsAddFee) || ObjectUtil.equal(dispatchIsAddFee, BooleanZeroOneEnums.NO.getCode())){
return;
}
Integer pickupIsByCategory = templateEntity.getDispatchIsByCategory();
// 按品类计费
boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode());
BasicdataPriceCategoryDispatchEntity entity = null;
if(categoryFlag){
if (categoryFlag) {
String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory();
if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){
if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) {
key = key + basicExcel.getDispatchUnit();
}
if (dispatchAddEntityMap.containsKey(key)) {
@ -1880,9 +1911,9 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
entity = new BasicdataPriceCategoryDispatchEntity();
dispatchAddEntityMap.put(key, entity);
}
}else{
} else {
String key = basicExcel.getClient() + basicExcel.getBrand();
if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){
if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) {
key = key + basicExcel.getDispatchUnit();
}
if (dispatchAddEntityMap.containsKey(key)) {
@ -1928,9 +1959,9 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
// 按品类计费
boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode());
BasicdataPriceCategoryDispatchEntity entity = null;
if(categoryFlag){
if (categoryFlag) {
String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory();
if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){
if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) {
key = key + basicExcel.getDispatchUnit();
}
if (dispatchEntityMap.containsKey(key)) {
@ -1939,9 +1970,9 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
entity = new BasicdataPriceCategoryDispatchEntity();
dispatchEntityMap.put(key, entity);
}
}else{
} else {
String key = basicExcel.getClient() + basicExcel.getBrand();
if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){
if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) {
key = key + basicExcel.getDispatchUnit();
}
if (dispatchEntityMap.containsKey(key)) {
@ -1977,13 +2008,18 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
private void buildSaveWarehouseAddExcel(Map<String, BasicdataCategoryEntity> categoryEntityMap, Map<String, BasicdataPriceCategoryWarehouseEntity> warehouseAddEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity) {
// 仓储是否附加费
Integer warehouseIsAddFee = templateEntity.getWarehouseIsAddFee();
if(ObjectUtil.isEmpty(warehouseIsAddFee) || ObjectUtil.equal(warehouseIsAddFee, BooleanZeroOneEnums.NO.getCode())){
return;
}
Integer pickupIsByCategory = templateEntity.getWarehouseIsCategorySubjoin();
// 按品类计费
boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode());
BasicdataPriceCategoryWarehouseEntity warehouseEntity = null;
if(categoryFlag){
if (categoryFlag) {
String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory();
if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){
if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) {
key = key + basicExcel.getDispatchUnit();
}
if (warehouseAddEntityMap.containsKey(key)) {
@ -1992,9 +2028,9 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
warehouseEntity = new BasicdataPriceCategoryWarehouseEntity();
warehouseAddEntityMap.put(key, warehouseEntity);
}
}else{
} else {
String key = basicExcel.getClient() + basicExcel.getBrand();
if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){
if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) {
key = key + basicExcel.getDispatchUnit();
}
if (warehouseAddEntityMap.containsKey(key)) {
@ -2035,14 +2071,14 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
// 按品类计费
boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode());
BasicdataPriceCategoryWarehouseEntity warehouseEntity = null;
if(categoryFlag){
if (categoryFlag) {
if (warehouseEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) {
warehouseEntity = warehouseEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory());
} else {
warehouseEntity = new BasicdataPriceCategoryWarehouseEntity();
warehouseEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), warehouseEntity);
}
}else{
} else {
if (warehouseEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) {
warehouseEntity = warehouseEntityMap.get(basicExcel.getClient() + basicExcel.getBrand());
} else {
@ -2102,7 +2138,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
if (b && categoryFlag) {
// 有路径按品类计费
String key = basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory();
if(StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())){
if (StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())) {
key = key + basicExcel.getTrunkLineUnit();
}
if (trunkLineEntityMap.containsKey(key)) {
@ -2114,7 +2150,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
} else if (b && !categoryFlag) {
// 有路径不按品类计费,一个客户一条路径一个价格
String key = basicExcel.getClient() + basicExcel.getBrand() + routeId;
if(StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())){
if (StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())) {
key = key + basicExcel.getTrunkLineUnit();
}
if (trunkLineEntityMap.containsKey(key)) {
@ -2126,7 +2162,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
} else if (!b && categoryFlag) {
// 没路径 按品类计费 一个客户一个品类一个价格
String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory();
if(StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())){
if (StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())) {
key = key + basicExcel.getTrunkLineUnit();
}
if (trunkLineEntityMap.containsKey(key)) {
@ -2138,7 +2174,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
} else {
// 没路径 不按品类计费 一个客户一个价格
String key = basicExcel.getClient() + basicExcel.getBrand();
if(StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())){
if (StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())) {
key = key + basicExcel.getTrunkLineUnit();
}
if (trunkLineEntityMap.containsKey(key)) {
@ -2194,7 +2230,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
if (b && categoryFlag) {
// 有路径按品类计费 一个客户一条路径一个品类一种计价方式一个价格
String key = basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory();
if(StrUtil.isNotEmpty(basicExcel.getPickupUnit())){
if (StrUtil.isNotEmpty(basicExcel.getPickupUnit())) {
key = key + basicExcel.getPickupUnit();
}
if (pickupEntityMap.containsKey(key)) {
@ -2206,7 +2242,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
} else if (b && !categoryFlag) {
// 有路径不按品类计费,一个客户一条路径一种计价方式一个价格
String key = basicExcel.getClient() + basicExcel.getBrand() + routeId;
if(StrUtil.isNotEmpty(basicExcel.getPickupUnit())){
if (StrUtil.isNotEmpty(basicExcel.getPickupUnit())) {
key = key + basicExcel.getPickupUnit();
}
if (pickupEntityMap.containsKey(key)) {
@ -2218,7 +2254,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
} else if (!b && categoryFlag) {
// 没路径 按品类计费 一个客户一个品类一种计价方式一个价格
String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory();
if(StrUtil.isNotEmpty(basicExcel.getPickupUnit())){
if (StrUtil.isNotEmpty(basicExcel.getPickupUnit())) {
key = key + basicExcel.getPickupUnit();
}
if (pickupEntityMap.containsKey(key)) {
@ -2230,7 +2266,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
} else {
// 没路径 不按品类计费 一个客户一个计价方式一个价格
String key = basicExcel.getClient() + basicExcel.getBrand();
if(StrUtil.isNotEmpty(basicExcel.getPickupUnit())){
if (StrUtil.isNotEmpty(basicExcel.getPickupUnit())) {
key = key + basicExcel.getPickupUnit();
}
if (pickupEntityMap.containsKey(key)) {

Loading…
Cancel
Save