Commit a360bd18 by jianan

前端对接问题修复29

parent 290c4d3b
......@@ -41,14 +41,14 @@ import java.util.*;
import java.util.stream.Collectors;
/**
* @author Zhang Jianan
* @description 针对表【policy(保单表)】的数据库操作Service实现
* @createDate 2025-09-18 15:07:25
*/
* @author Zhang Jianan
* @description 针对表【policy(保单表)】的数据库操作Service实现
* @createDate 2025-09-18 15:07:25
*/
@Service
@Slf4j
public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
implements PolicyService{
implements PolicyService {
@Resource
private PolicyAdditionalService policyAdditionalService;
......@@ -154,25 +154,27 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
/**
* 查询列表
*
* @param dto
* @return
*/
@Override
public List<Policy> queryList(QueryPolicyDto dto) {
List<Policy> list = baseMapper.selectList(new LambdaQueryWrapper<Policy>()
.in(!CollectionUtils.isEmpty(dto.getPolicyNoList()),Policy::getPolicyNo,dto.getPolicyNoList())
.in(!CollectionUtils.isEmpty(dto.getPolicyNoList()), Policy::getPolicyNo, dto.getPolicyNoList())
);
return list;
}
/**
* 根据保单号查询单个对象
*
* @param policyNo
* @return
*/
@Override
public Policy queryOne(String policyNo) {
return this.getOne(new LambdaQueryWrapper<Policy>().eq(Policy::getPolicyNo,policyNo).last(" limit 1 "));
return this.getOne(new LambdaQueryWrapper<Policy>().eq(Policy::getPolicyNo, policyNo).last(" limit 1 "));
}
@Override
......@@ -195,13 +197,12 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
return CollUtil.newArrayList();
}
try {
log.info(JSONUtil.parseObj(result).toString());
log.info("Feign返回数据: {}", JSONUtil.parseObj(result).toString());
// 直接使用Map来处理数据,避免复杂的类型转换
Object data = result.getData();
List<Map<String, Object>> policyProductInfoList = new ArrayList<>();
// 将数据转换为JSONObject进行解析
JSONObject jsonObject = JSONUtil.parseObj(data);
......@@ -214,6 +215,9 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
Map<String, Object> infoMap = new HashMap<>();
infoMap.put("productLaunchBizId", record.getStr("productLaunchBizId"));
infoMap.put("productName", record.getStr("productName"));
infoMap.put("title", record.getStr("title"));
infoMap.put("shortTitle", record.getStr("shortTitle"));
infoMap.put("status", record.getStr("status"));
// 解析自定义属性
JSONArray attributeSettingArray = record.getJSONArray("apiAttributeSettingDtoList");
......@@ -224,12 +228,13 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
policyProductInfoList.add(infoMap);
}
}
log.info("解析后的保单产品信息: {}", JSONUtil.toJsonStr(policyProductInfoList));
return policyProductInfoList;
} catch (Exception e) {
log.error("解析Feign返回数据失败: {}", e.getMessage(), e);
return CollUtil.newArrayList();
}
return null;
}
/**
......@@ -242,33 +247,32 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
for (int i = 0; i < attributeSettingArray.size(); i++) {
JSONObject attribute = attributeSettingArray.getJSONObject(i);
// 根据实际字段名设置属性
// infoMap.put("insuranceCompanyBizId", attribute.getStr("fieldName"));
// infoMap.put("insuranceCompany", attribute.getStr("fieldName"));
// infoMap.put("reconciliationCompanyBizId", attribute.getStr("fieldName"));
// infoMap.put("reconciliationCompany", attribute.getStr("fieldName"));
String name = attribute.getStr("name");
String value = attribute.getStr("value");
// 根据属性名称设置对应的字段
switch (name) {
case "保险公司":
infoMap.put("insuranceCompany", value);
infoMap.put("insuranceCompanyBizId", attribute.getStr("fieldValueBizId"));
break;
case "对账公司":
infoMap.put("reconciliationCompany", value);
infoMap.put("reconciliationCompanyBizId", attribute.getStr("fieldValueBizId"));
break;
case "产品计划类型":
infoMap.put("productPlanType", value);
break;
case "是否区分吸烟":
infoMap.put("isSmokingDistinguish", value);
break;
default:
// 其他自定义属性
infoMap.put(name, value);
break;
}
}
/**
* 从附加险列表中获取保险公司业务ID
*
* @param apiAttributeSettingDtoList
* @param infoMap
*/
private void getInfo(List<ApiAttributeSettingDto> apiAttributeSettingDtoList, Map<String, Object> infoMap) {
if (CollUtil.isEmpty(apiAttributeSettingDtoList)) {
return;
}
// insuranceCompanyBizId
// insuranceCompany
// reconciliationCompanyBizId
// reconciliationCompany
for (ApiAttributeSettingDto dto : apiAttributeSettingDtoList) {
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment