Commit ac54a36e by 杨卫

feat:效果分析自测

1 parent 4b2a3d19
package cn.com.glsx.dj.riskmanage.dto;
import cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO;
import cn.com.glsx.dj.smartcarlife.response.CarBrandResponse;
import com.google.common.collect.Lists;
import lombok.Data;
......@@ -28,7 +29,7 @@ public class MerchantServiceAndBrandDTO implements Serializable {
/**
* 品牌名称
*/
private List<CarBrandResponse> brands = Lists.newArrayList();
private List<CarBrandDTO> brands = Lists.newArrayList();
/**
* 主服务名称
......
......@@ -4,7 +4,7 @@ import cn.com.glsx.dj.riskmanage.consts.ConfigCenterConstants;
import cn.com.glsx.dj.riskmanage.dto.MerchantServiceAndBrandDTO;
import cn.com.glsx.dj.riskmanage.dto.YqMerchantConfigDTO;
import cn.com.glsx.dj.riskmanage.mapper.ActivityMapper;
import cn.com.glsx.dj.smartcarlife.response.CarBrandResponse;
import cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.merchants.model.response.MerchantBrandDTO;
import cn.com.glsx.merchants.remote.MerchantRemote;
......@@ -87,16 +87,16 @@ public class CommonService {
}, taskExecutor);
// 查询车品牌树
CompletableFuture<Map<Integer, CarBrandResponse>> carBrandFuture =
CompletableFuture<Map<Integer, CarBrandDTO>> carBrandFuture =
CompletableFuture.supplyAsync(() -> {
try {
return Optional.ofNullable(getCarBrandTree())
.orElseGet(Lists::newArrayList)
.stream()
.collect(Collectors.toMap(CarBrandResponse::getId, Function.identity()));
.collect(Collectors.toMap(CarBrandDTO::getId, Function.identity()));
} catch (Exception e) {
log.error("查询车品牌树异常", e);
return MapUtil.<Integer, CarBrandResponse>builder().build();
return MapUtil.<Integer, CarBrandDTO>builder().build();
}
}, taskExecutor);
CompletableFuture<Void> allFutures = CompletableFuture.allOf(
......@@ -108,7 +108,7 @@ public class CommonService {
return allFutures.thenApply(v -> {
Map<Integer, List<YqMerchantConfigDTO>> merchantIdGroup = merchantConfigFuture.join();
Map<Integer, List<MerchantBrandDTO>> merchantIdGroupBrand = merchantBrandFuture.join();
Map<Integer, CarBrandResponse> firstBrandMap = carBrandFuture.join();
Map<Integer, CarBrandDTO> firstBrandMap = carBrandFuture.join();
return merchantNos.stream().map(merchantNo -> {
MerchantServiceAndBrandDTO merchantServiceAndBrandDTO = new MerchantServiceAndBrandDTO().setMerchantNo(merchantNo);
......@@ -126,7 +126,7 @@ public class CommonService {
Optional.ofNullable(merchantIdGroupBrand.get(merchantNo))
.orElseGet(ArrayList::new)
.forEach(merchantBrandDTO -> {
CarBrandResponse carBrandResponse = firstBrandMap.get(merchantBrandDTO.getFirstBrandId());
CarBrandDTO carBrandResponse = firstBrandMap.get(merchantBrandDTO.getFirstBrandId());
merchantServiceAndBrandDTO.getBrands().add(carBrandResponse);
});
return merchantServiceAndBrandDTO;
......@@ -140,9 +140,9 @@ public class CommonService {
* 查询车品牌树
* @author yangwei
* @since 2026/1/19 18:25
* @return java.util.List<cn.com.glsx.scrm.proxy.model.CarBrandResponse>
* @return java.util.List<cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO>
*/
public List<CarBrandResponse> getCarBrandTree() {
public List<CarBrandDTO> getCarBrandTree() {
final String requestMethod = "merchants.api.merchantCommon.getCarbrandTree";
CommonProxyRequest proxyRequest = new CommonProxyRequest();
LinkedMultiValueMap<String, String> params = new LinkedMultiValueMap<>();
......@@ -157,6 +157,6 @@ public class CommonService {
log.error("查询车品牌失败, message:{}", response.getMessage());
return Lists.newArrayList();
}
return response.getResult().getList(CarBrandResponse.class);
return response.getResult().getList(CarBrandDTO.class);
}
}
......@@ -101,6 +101,7 @@
<select id="getServiceByMerchantId" resultType="cn.com.glsx.dj.riskmanage.dto.YqMerchantConfigDTO">
select
t2.main_merchant_id as merchantId,
t1.partner_merchant_id as partnerMerchantId,
t1.partner_merchant_name as partnerMerchantName
from dj_car_life_yqmerchant_config t1
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!