浏览代码

协议修改

wks 1 年之前
父节点
当前提交
44901efa2c

+ 8 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementAttribution.java

@@ -87,5 +87,13 @@ public class PtlAgreementAttribution implements Serializable {
         this.password = ptlAgreementAttributionDto.getPassword();
     }
 
+    public PtlAgreementAttribution(String agreementId, PtlInsAttributionTemplate ptlInsAttributionTemplate) {
+        this.id = agreementId;
+        this.insCompanyId = ptlInsAttributionTemplate.getInsCompanyId();
+        this.insCompanyName = ptlInsAttributionTemplate.getInsCompanyName();
+        this.templateId = ptlInsAttributionTemplate.getId();
+        this.apiType = ptlInsAttributionTemplate.getApiType();
+        this.fields = ptlInsAttributionTemplate.getFields();
+    }
 
 }

+ 8 - 1
src/main/java/com/ydtech/modules/protocol/service/impl/PtlInsAttributionTemplateServiceImpl.java

@@ -163,7 +163,14 @@ public class PtlInsAttributionTemplateServiceImpl extends ServiceImpl<PtlInsAttr
         String companyId = substring + code;
         LambdaQueryWrapper<PtlAgreementAttribution> wrapper = byInsCompanyIdAndApiTypeAndAgreementId(ptlInsAttributionTemplateVo.getAgreementId(),companyId, ptlInsAttributionTemplateVo.getApiType());
         PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getOne(wrapper);
-        AssertionUtils.isEmpty(ptlAgreementAttribution, "保险公司归属信息模板查询失败");
+        if(ObjectUtils.isEmpty(ptlAgreementAttribution)) {
+
+            PtlInsAttributionTemplate ptlInsAttributionTemplate = lambdaQuery().eq(PtlInsAttributionTemplate::getInsCompanyId, companyId)
+                    .eq(PtlInsAttributionTemplate::getApiType, ptlInsAttributionTemplateVo.getApiType())
+                    .one();
+            AssertionUtils.isEmpty(ptlInsAttributionTemplate, "保险公司归属信息模板查询失败");
+            ptlAgreementAttribution = new PtlAgreementAttribution(ptlInsAttributionTemplateVo.getAgreementId(), ptlInsAttributionTemplate);
+        }
         return HttpResult.ok(ptlAgreementAttribution);
     }
 

+ 1 - 1
src/main/resources/application.yml

@@ -3,7 +3,7 @@ server:
     encoding:
       charset: UTF-8
       force: true
-  port: 8081
+  port: 8080
 
 spring:
   profiles: