Просмотр исходного кода

协议调度支持配置保司账号

lipf 4 месяцев назад
Родитель
Сommit
d118a20877

+ 4 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/po/PtlAgreementAttribution.java

@@ -14,6 +14,8 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 
+import java.io.Serial;
+
 /**
  * @author quchen
  * @date 2025/2/18 11:09
@@ -25,6 +27,8 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @TableName(value = "ptl_agreement_attribution", autoResultMap = true)
 public class PtlAgreementAttribution extends BaseModel {
+    @Serial
+    private static final long serialVersionUID = 772426849982494479L;
     @Schema(description = "id")
     @TableId(value = "id")
     private String id;

+ 8 - 1
platform/src/main/java/com/jzg/controller/AgreementAttributionController.java

@@ -5,6 +5,7 @@ import com.jzg.commons.aop.OperatorTrajectory;
 import com.jzg.commons.constants.OperationTypeEnum;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.po.PtlAgreementAttribution;
 import com.jzg.commons.entity.agreement.vo.PtlAgreementAttributionDeptVo;
 import com.jzg.commons.entity.agreement.vo.PtlAgreementAttributionQueryVo;
 import com.jzg.commons.entity.agreement.vo.PtlAgreementAttributionSaveVo;
@@ -45,7 +46,13 @@ public class AgreementAttributionController extends BaseController {
 
     @Operation(summary = "保险公司账号详情接口", description = "保险公司账号接口")
     @PostMapping(value = "/getAgreementAttribution")
-    public HttpResult<Object> getAgreementAttribution(@RequestSingleParam(value = "id") String id) {
+    public HttpResult<PtlAgreementAttribution> getAgreementAttribution(@RequestSingleParam(value = "id") String id) {
+        return agreementAttributionService.getAgreementAttribution(id);
+    }
+
+    @Operation(summary = "保险公司账号详情接口", description = "保险公司账号接口")
+    @PostMapping(value = "/getAgreementAttribution2")
+    public HttpResult<PtlAgreementAttribution> getAgreementAttribution2(@RequestParam(value = "id") String id) {
         return agreementAttributionService.getAgreementAttribution(id);
     }
 

+ 8 - 2
platform/src/main/java/com/jzg/service/PtlAgreementAttributionService.java

@@ -14,8 +14,14 @@ public interface PtlAgreementAttributionService extends IService<PtlAgreementAtt
 
     boolean addAgreementAttribution(PtlAgreementAttributionSaveVo ptlAgreementAttributionSaveVo);
 
-    HttpResult<Object> getAgreementAttribution(String id);
-
+    HttpResult<PtlAgreementAttribution> getAgreementAttribution(String id);
+
+    /**
+     * 查询保险公司账号列表接口
+     *
+     * @author lipf
+     * @date 2026/5/22 14:17
+     */
     Page<PtlAgreementAttribution> getAgreementAttributionList(Page page, PtlAgreementAttributionQueryVo ptlAgreementAttributionQueryVo);
 
     boolean updateAgreementAttribution(PtlAgreementAttributionSaveVo ptlAgreementAttributionSaveVo);

+ 1 - 1
platform/src/main/java/com/jzg/service/impl/PtlAgreementAttributionImpl.java

@@ -65,7 +65,7 @@ public class PtlAgreementAttributionImpl extends ServiceImpl<PtlAgreementAttribu
     }
 
     @Override
-    public HttpResult<Object> getAgreementAttribution(String id) {
+    public HttpResult<PtlAgreementAttribution> getAgreementAttribution(String id) {
         PtlAgreementAttribution ptlAgreementAttribution = baseMapper.getAgreementAttribution(id);
         if (Objects.isNull(ptlAgreementAttribution)) {
             throw new RuntimeException("该保险公司账号不存在");

+ 1 - 0
platform/src/main/java/com/jzg/service/impl/PtlInsAttributionTemplateServiceImpl.java

@@ -143,6 +143,7 @@ public class PtlInsAttributionTemplateServiceImpl extends ServiceImpl<PtlInsAttr
 
     @Override
     public HttpResult<PtlAgreementAttribution> getAgreementAttribution(String agreementId) {
+        log.info("获取协议属性信息:agreementId=[{}]",agreementId);
         PtlAgreement ptlAgreement = ptlAgreementService.getById(agreementId);
         AssertionUtils.isEmpty(ptlAgreement, "协议不存在");
 

+ 25 - 0
tenant/organization/src/main/java/com/jzg/organization/client/PlatformClient.java

@@ -0,0 +1,25 @@
+package com.jzg.organization.client;
+
+
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.po.PtlAgreementAttribution;
+import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+
+@FeignClient(name = "jzg-platform")
+public interface PlatformClient {
+
+    /**
+     * 根据协议属性id查询协议属性信息
+     *
+     * @author lipf
+     * @date 2026/5/22 15:00
+     */
+    @Operation(summary = "保险公司账号详情接口", description = "保险公司账号接口")
+    @PostMapping(value = "/manager/attribution/getAgreementAttribution2")
+    public HttpResult<PtlAgreementAttribution> getAgreementAttribution2(@RequestParam(value = "id") String id);
+
+}

+ 7 - 3
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementDispatchServiceImpl.java

@@ -16,6 +16,7 @@ import com.jzg.commons.entity.po.*;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.organization.client.EsmInsCompanyClient;
+import com.jzg.organization.client.PlatformClient;
 import com.jzg.organization.mapper.PtlAgreementDispatchActionMapper;
 import com.jzg.organization.mapper.PtlAgreementDispatchAfterActionMapper;
 import com.jzg.organization.mapper.PtlAgreementDispatchMapper;
@@ -52,6 +53,8 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
     @Autowired
     SysDictService sysDictService;
     @Autowired
+    PlatformClient platformClient;
+    @Autowired
     PtlAgreementService ptlAgreementService;
     @Autowired
     EsmInsCompanyClient esmInsCompanyClient;
@@ -199,8 +202,10 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
                                 }
                             }
                         }else if("change_bs_account".equals(action.getActionCode())){
-                            if(Objects.nonNull(action.getActionJson().get("accountId"))) {
-                                HttpResult<PtlAgreementAttribution> agreementAttribution = esmInsCompanyClient.getAgreementAttribution(action.getActionJson().get("accountId").toString());
+                            String accountId = action.getActionJson().get("accountId").toString();
+                            if(Objects.nonNull(accountId)){
+                                HttpResult<PtlAgreementAttribution> agreementAttribution = platformClient.getAgreementAttribution2(accountId);
+                                //HttpResult<PtlAgreementAttribution> agreementAttribution = esmInsCompanyClient.getAgreementAttribution(accountId);
                                 if (agreementAttribution.getCode() == 200) {
                                     PtlAgreementAttribution data = agreementAttribution.getData();
                                     action.getActionJson().put("userName", data.getUsername());
@@ -282,7 +287,6 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
         return false;
     }
 
-
 }