Browse Source

feat(all): 价格整车车型问题

1 修改车型显示异常问题
fix-sign
zhaoqiaobo 4 months ago
parent
commit
a0e89a6216
  1. 5
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicCarModelClient.java
  2. 12
      blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicCarModelClient.java
  3. 16
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

5
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicCarModelClient.java

@ -6,6 +6,8 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_BASIC_NAME
)
@ -17,4 +19,7 @@ public interface IBasicCarModelClient {
@GetMapping(API_PREFIX+"/getCarModelByCarNumber")
BasicCarModelEntity getCarModelByCarNumber(@RequestParam("carModelName") String carNumber);
@GetMapping(API_PREFIX+"/getCarModelList")
List<BasicCarModelEntity> getCarModelList();
}

12
blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicCarModelClient.java

@ -6,19 +6,27 @@ import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class BasicCarModelClient implements IBasicCarModelClient{
public class BasicCarModelClient implements IBasicCarModelClient {
private final IBasicCarModelService basicCarModelService;
@Override
public BasicCarModelEntity getCarModelByCarNumber(String carNumber) {
BasicCarModelEntity carModelByCarNumber = basicCarModelService.getCarModelByCarNumber(carNumber);
if(carModelByCarNumber!=null){
if (carModelByCarNumber != null) {
return carModelByCarNumber;
}
return null;
}
@Override
public List<BasicCarModelEntity> getCarModelList() {
return basicCarModelService.list();
}
}

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

@ -28,6 +28,8 @@ import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.entity.BasicCarModelEntity;
import com.logpm.basic.feign.IBasicCarModelClient;
import com.logpm.basicdata.constant.BasicdataConstants;
import com.logpm.basicdata.entity.BasicdataBrandEntity;
import com.logpm.basicdata.entity.BasicdataCategoryEntity;
@ -144,6 +146,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
private final ISysClient sysClient;
private final IDictBizClient dictBizClient;
private final IBasicCarModelClient carModelClient;
@Override
public IPage<BasicdataPricePageVO> selectBasicdataPricePage(IPage<BasicdataPricePageVO> page, BasicdataPricePageVO basicdataPrice) {
@ -631,7 +634,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
checkGeneralExcels(generalExcels, clientEntityMap, priceEntityMap, provinceMap, provinceCityMap, provinceCityAearMap, message, sheet5);
// 封装整车车型 车型名称为key
Map<String, String> vehicleTypeMap = new HashMap<>();
initVehicleTypeMap(vehicleTypeMap);
initVehicleTypeMapV2(vehicleTypeMap);
// 整车
checkFullExcel(fullVehicleExcels, clientEntityMap, priceEntityMap, provinceMap, provinceCityMap, provinceCityAearMap, vehicleTypeMap, message, sheet6);
if (StrUtil.isNotEmpty(message.toString())) {
@ -711,7 +714,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
provinceCityAearMap, message, sheet3, clientBrandMap, templateMap);
// 封装整车车型 车型名称为key
Map<String, String> vehicleTypeMap = new HashMap<>();
initVehicleTypeMap(vehicleTypeMap);
initVehicleTypeMapV2(vehicleTypeMap);
// 整车
checkFullExcelV2(fullVehicleExcels, clientEntityMap, priceEntityMap, provinceMap, provinceCityMap,
provinceCityAearMap, vehicleTypeMap, message, sheet2, clientBrandMap, templateMap);
@ -2426,6 +2429,15 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
}
private void initVehicleTypeMapV2(Map<String, String> vehicleTypeMap) {
List<BasicCarModelEntity> carModelList = carModelClient.getCarModelList();
if (CollUtil.isNotEmpty(carModelList)) {
for (BasicCarModelEntity basicCarModelEntity : carModelList) {
vehicleTypeMap.put(basicCarModelEntity.getVehicleModel(),Convert.toStr(basicCarModelEntity.getId()));
}
}
}
private void checkFullExcel(List<BasicdataPriceFullVehicleExcel> fullVehicleExcels, Map<String,
BasicdataClientEntity> clientEntityMap, Map<String, BasicdataPriceEntity> priceEntityMap,
Map<String, String> provinceMap, Map<String, String> provinceCityMap,

Loading…
Cancel
Save