|
|
@@ -11,12 +11,14 @@ import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
import com.ydtech.modules.protocol.dao.PtlInsAttributionTemplateMapper;
|
|
|
import com.ydtech.modules.protocol.entity.constants.PtlApiType;
|
|
|
import com.ydtech.modules.protocol.entity.dto.PtlInsAttributionTemplateQueryDto;
|
|
|
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlCrawlerApi;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlInsAttributionTemplate;
|
|
|
import com.ydtech.modules.protocol.entity.vo.PtlCrawlerApiSaveVo;
|
|
|
import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateQueryVo;
|
|
|
import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateSaveVo;
|
|
|
import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateVo;
|
|
|
+import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
|
|
|
import com.ydtech.modules.protocol.service.PtlCrawlerApiService;
|
|
|
import com.ydtech.modules.protocol.service.PtlInsAttributionTemplateService;
|
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
@@ -46,11 +48,14 @@ public class PtlInsAttributionTemplateServiceImpl extends ServiceImpl<PtlInsAttr
|
|
|
|
|
|
private final PtlInsAttributionTemplateService proxyService;
|
|
|
|
|
|
+ private final PtlAgreementAttributionService ptlAgreementAttributionService;
|
|
|
+
|
|
|
public PtlInsAttributionTemplateServiceImpl(EsmInsCompanyService esmInsCompanyService, PtlCrawlerApiService ptlCrawlerApiService,
|
|
|
- @Lazy PtlInsAttributionTemplateService proxyService) {
|
|
|
+ @Lazy PtlInsAttributionTemplateService proxyService,PtlAgreementAttributionService ptlAgreementAttributionService) {
|
|
|
this.esmInsCompanyService = esmInsCompanyService;
|
|
|
this.ptlCrawlerApiService = ptlCrawlerApiService;
|
|
|
this.proxyService = proxyService;
|
|
|
+ this.ptlAgreementAttributionService = ptlAgreementAttributionService;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -152,15 +157,14 @@ public class PtlInsAttributionTemplateServiceImpl extends ServiceImpl<PtlInsAttr
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpResult<PtlInsAttributionTemplate> getPtlInsAttributionTemplate(PtlInsAttributionTemplateVo ptlInsAttributionTemplateVo) {
|
|
|
+ public HttpResult<PtlAgreementAttribution> getPtlInsAttributionTemplate(PtlInsAttributionTemplateVo ptlInsAttributionTemplateVo) {
|
|
|
String code = "000000";
|
|
|
String substring = ptlInsAttributionTemplateVo.getInsCompanyId().substring(0, 5);
|
|
|
String companyId = substring + code;
|
|
|
-
|
|
|
- LambdaQueryWrapper<PtlInsAttributionTemplate> wrapper = byInsCompanyIdAndApiType(companyId, ptlInsAttributionTemplateVo.getApiType());
|
|
|
- PtlInsAttributionTemplate ptlInsAttributionTemplate = getOne(wrapper);
|
|
|
- AssertionUtils.isEmpty(ptlInsAttributionTemplate, "保险公司归属信息模板查询失败");
|
|
|
- return HttpResult.ok(ptlInsAttributionTemplate);
|
|
|
+ LambdaQueryWrapper<PtlAgreementAttribution> wrapper = byInsCompanyIdAndApiTypeAndAgreementId(ptlInsAttributionTemplateVo.getAgreementId(),companyId, ptlInsAttributionTemplateVo.getApiType());
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getOne(wrapper);
|
|
|
+ AssertionUtils.isEmpty(ptlAgreementAttribution, "保险公司归属信息模板查询失败");
|
|
|
+ return HttpResult.ok(ptlAgreementAttribution);
|
|
|
}
|
|
|
|
|
|
private LambdaQueryWrapper<PtlInsAttributionTemplate> byInsCompanyIdAndApiType(String insCompanyId, Integer apiType) {
|
|
|
@@ -170,6 +174,14 @@ public class PtlInsAttributionTemplateServiceImpl extends ServiceImpl<PtlInsAttr
|
|
|
return wrapper;
|
|
|
}
|
|
|
|
|
|
+ private LambdaQueryWrapper<PtlAgreementAttribution> byInsCompanyIdAndApiTypeAndAgreementId(String agreementId, String insCompanyId, Integer apiType) {
|
|
|
+ LambdaQueryWrapper<PtlAgreementAttribution> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(PtlAgreementAttribution::getId, agreementId)
|
|
|
+ .eq(PtlAgreementAttribution::getInsCompanyId, insCompanyId)
|
|
|
+ .eq(PtlAgreementAttribution::getApiType, apiType);
|
|
|
+ return wrapper;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|