|
|
@@ -2,6 +2,7 @@ package com.ydtech.modules.protocol.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -19,10 +20,7 @@ import com.ydtech.modules.order.service.InsCrawlerOrderService;
|
|
|
import com.ydtech.modules.protocol.constants.HistoryStatusConstants;
|
|
|
import com.ydtech.modules.protocol.dao.PtlAgreementMapper;
|
|
|
import com.ydtech.modules.protocol.entity.constants.PtlApiType;
|
|
|
-import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
|
|
|
-import com.ydtech.modules.protocol.entity.dto.PtlAgreementDto;
|
|
|
-import com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto;
|
|
|
-import com.ydtech.modules.protocol.entity.dto.PtlAgreementSaveDto;
|
|
|
+import com.ydtech.modules.protocol.entity.dto.*;
|
|
|
import com.ydtech.modules.protocol.entity.dto.history.PtlAgreementUndwrtRulesHistory;
|
|
|
import com.ydtech.modules.protocol.entity.po.*;
|
|
|
import com.ydtech.modules.protocol.entity.vo.*;
|
|
|
@@ -82,6 +80,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
|
|
|
private final PtlAgreementTrajectoryService ptlAgreementTrajectoryService;
|
|
|
|
|
|
+ private final PtlInsAttributionTemplateService ptlInsAttributionTemplateService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private PtlAgreementDeptHistoryService ptlAgreementDeptHistoryService;
|
|
|
|
|
|
@@ -106,7 +106,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
PtlAgreementProductCostsHistoryService ptlAgreementProductCostsHistoryService,
|
|
|
PtlAgreementUndwrtRulesHistoryService ptlAgreementUndwrtRulesHistoryService,
|
|
|
PtlAgreementAttributionHistoryService ptlAgreementAttributionHistoryService,
|
|
|
- PtlAgreementTrajectoryService ptlAgreementTrajectoryService) {
|
|
|
+ PtlAgreementTrajectoryService ptlAgreementTrajectoryService, PtlInsAttributionTemplateService ptlInsAttributionTemplateService) {
|
|
|
this.ptlAgreementProductCostsService = ptlAgreementProductCostsService;
|
|
|
this.ptlAgreementAttributionService = ptlAgreementAttributionService;
|
|
|
this.ptlAgreementDeptService = ptlAgreementDeptService;
|
|
|
@@ -121,6 +121,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
this.ptlAgreementUndwrtRulesHistoryService = ptlAgreementUndwrtRulesHistoryService;
|
|
|
this.ptlAgreementAttributionHistoryService = ptlAgreementAttributionHistoryService;
|
|
|
this.ptlAgreementTrajectoryService = ptlAgreementTrajectoryService;
|
|
|
+ this.ptlInsAttributionTemplateService = ptlInsAttributionTemplateService;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -640,7 +641,25 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
ptlAgreementAttribution.setUsername("");
|
|
|
ptlAgreementAttribution.setPassword("");
|
|
|
|
|
|
+ }else {
|
|
|
+ PtlInsAttributionTemplate ptlInsAttributionTemplate = ptlInsAttributionTemplateService.lambdaQuery()
|
|
|
+ .eq(PtlInsAttributionTemplate::getInsCompanyId, ptlAgreementAttribution.getInsCompanyId())
|
|
|
+ .eq(PtlInsAttributionTemplate::getApiType, ptlAgreementAttribution.getApiType())
|
|
|
+ .one();
|
|
|
+ // 信息
|
|
|
+ List<PtlAttributionTemplateDto> ptlAttributionTemplateDtoList = ptlAgreementAttribution.getFields().toJavaList(PtlAttributionTemplateDto.class);
|
|
|
+ // 信息
|
|
|
+ Map<String, String> map = ptlAttributionTemplateDtoList.stream().collect(Collectors.toMap(PtlAttributionTemplateDto::getField, PtlAttributionTemplateDto::getValue));
|
|
|
+ // 模版中的数据
|
|
|
+ List<PtlAttributionTemplateDto> ptlAttributionTemplate = ptlInsAttributionTemplate.getFields().toJavaList(PtlAttributionTemplateDto.class);
|
|
|
+ ptlAttributionTemplate.forEach(x->{
|
|
|
+ String s = map.get(x.getField());
|
|
|
+ x.setValue(s);
|
|
|
+ });
|
|
|
+ ptlAgreementAttribution.setFields(JSON.parseArray(JSON.toJSONString(ptlAttributionTemplate)));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
// 授权查询
|
|
|
List<PtlAgreementDept> deptList = ptlAgreementDeptService.getByAgreementId(agreementId);
|
|
|
PtlAgreementQueryVo ptlAgreementQueryVo = new PtlAgreementQueryVo(ptlAgreement, ptlAgreementAttribution, deptList);
|