Commit 6624e22f by zhouhaibao

fix(smartcarlife): 理想品牌门店查询逻辑不再依赖 paramStr 条件

- 将理想品牌门店查询逻辑从 paramStr 非空判断中移出
- 品牌配置读取、RPC调用及商户号提取改为无条件执行
- paramStr 非空判断仅保留 endDate 解析逻辑
1 parent 4796cf1b
......@@ -2272,44 +2272,43 @@ public class SendWorkWechatMessageService {
try {
String endDate = DateUtils.getDayStartDate(1, false);
List<Integer> merchantIdListParam = new ArrayList<>();
String lixiangBrandIds = env.getProperty("lixiang.brand.ids", org.apache.commons.lang3.StringUtils.EMPTY);
if (org.apache.commons.lang3.StringUtils.isBlank(lixiangBrandIds)) {
log.error("理想品牌门店查询失败:配置项 lixiang.brand.ids 为空");
}
List<Integer> brandIdList = new ArrayList<>();
for (String idStr : lixiangBrandIds.split(",")) {
String trimmed = idStr.trim();
if (org.apache.commons.lang3.StringUtils.isNumeric(trimmed)) {
brandIdList.add(Integer.parseInt(trimmed));
}
}
if (CollectionUtils.isEmpty(brandIdList)) {
log.error("理想品牌门店查询失败:配置项 lixiang.brand.ids 解析后为空, 原始值={}", lixiangBrandIds);
}
log.info("理想品牌门店查询开始,brandIds={}", brandIdList);
CarBrandRequestDTO carBrandRequestDTO = new CarBrandRequestDTO();
carBrandRequestDTO.setFirstBrandIdList(brandIdList);
RpcResponse<List<MerchantSimpleResponse>> merchantRpcResponse = merchantRemote2.findMerchantListByBrandIds2(carBrandRequestDTO);
if (!merchantRpcResponse.hasResult()) {
log.error("理想品牌门店查询异常:{}", merchantRpcResponse.getMessage());
}
List<MerchantSimpleResponse> merchantList = merchantRpcResponse.getResult();
if (CollectionUtils.isEmpty(merchantList)) {
log.error("理想品牌门店查询结果为空,brandIds={}", brandIdList);
}
for (MerchantSimpleResponse merchant : merchantList) {
if (merchant != null && merchant.getMerchantNo() != null) {
merchantIdListParam.add(merchant.getMerchantNo());
}
}
if (CollectionUtils.isEmpty(merchantIdListParam)) {
log.error("理想品牌门店商户号提取后为空,brandIds={}", brandIdList);
return;
}
if (StringUtils.isNotBlank(paramStr)) {
JSONObject jsonObject = JSONObject.parseObject(paramStr);
endDate = jsonObject.getString("endDate");
String lixiangBrandIds = env.getProperty("lixiang.brand.ids", org.apache.commons.lang3.StringUtils.EMPTY);
if (org.apache.commons.lang3.StringUtils.isBlank(lixiangBrandIds)) {
log.error("理想品牌门店查询失败:配置项 lixiang.brand.ids 为空");
}
List<Integer> brandIdList = new ArrayList<>();
for (String idStr : lixiangBrandIds.split(",")) {
String trimmed = idStr.trim();
if (org.apache.commons.lang3.StringUtils.isNumeric(trimmed)) {
brandIdList.add(Integer.parseInt(trimmed));
}
}
if (CollectionUtils.isEmpty(brandIdList)) {
log.error("理想品牌门店查询失败:配置项 lixiang.brand.ids 解析后为空, 原始值={}", lixiangBrandIds);
}
log.info("理想品牌门店查询开始,brandIds={}", brandIdList);
CarBrandRequestDTO carBrandRequestDTO = new CarBrandRequestDTO();
carBrandRequestDTO.setFirstBrandIdList(brandIdList);
RpcResponse<List<MerchantSimpleResponse>> merchantRpcResponse = merchantRemote2.findMerchantListByBrandIds2(carBrandRequestDTO);
if (!merchantRpcResponse.hasResult()) {
log.error("理想品牌门店查询异常:{}", merchantRpcResponse.getMessage());
}
List<MerchantSimpleResponse> merchantList = merchantRpcResponse.getResult();
if (CollectionUtils.isEmpty(merchantList)) {
log.error("理想品牌门店查询结果为空,brandIds={}", brandIdList);
}
for (MerchantSimpleResponse merchant : merchantList) {
if (merchant != null && merchant.getMerchantNo() != null) {
merchantIdListParam.add(merchant.getMerchantNo());
}
}
if (CollectionUtils.isEmpty(merchantIdListParam)) {
log.error("理想品牌门店商户号提取后为空,brandIds={}", brandIdList);
return;
}
}
String startDate = DateUtils.getMonthFirstDayStr(endDate);
if (StringUtils.isBlank(startDate) || StringUtils.isBlank(endDate)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!