瀏覽代碼

Merge remote-tracking branch 'origin/master'

tomatozq 5 年之前
父節點
當前提交
caa60f8a3e

+ 18 - 0
picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/dto/PromoterAndAgentDto.java

@@ -0,0 +1,18 @@
+package com.jpsoft.picc.modules.base.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+@Data
+@ApiModel(value = "推广者和保险代理人信息")
+public class PromoterAndAgentDto {
+
+    @ApiModelProperty(value = "推广者帐号")
+    private String promoter;
+
+    @ApiModelProperty(value = "保险代理人")
+    private String agentName;
+
+}

+ 61 - 7
picc-admin-server/src/main/java/com/jpsoft/picc/modules/business/controller/InsuranceApplicationController.java

@@ -1,13 +1,9 @@
 package com.jpsoft.picc.modules.business.controller;
 
 import com.github.pagehelper.Page;
-import com.jpsoft.picc.modules.base.entity.InsuranceDefinition;
-import com.jpsoft.picc.modules.base.entity.InsuranceDefinitionLimit;
-import com.jpsoft.picc.modules.base.entity.InsuranceJobs;
-import com.jpsoft.picc.modules.base.service.InsuranceDefinitionLimitService;
-import com.jpsoft.picc.modules.base.service.InsuranceDefinitionService;
-import com.jpsoft.picc.modules.base.service.InsuranceJobsService;
-import com.jpsoft.picc.modules.base.service.JobsService;
+import com.jpsoft.picc.modules.base.dto.PromoterAndAgentDto;
+import com.jpsoft.picc.modules.base.entity.*;
+import com.jpsoft.picc.modules.base.service.*;
 import com.jpsoft.picc.modules.business.entity.InsurancePolicy;
 import com.jpsoft.picc.modules.business.service.ApplicationPolicyService;
 import com.jpsoft.picc.modules.business.service.InsurancePolicyMemberService;
@@ -63,6 +59,9 @@ public class InsuranceApplicationController {
     @Autowired
     private InsurancePolicyMemberService insurancePolicyMemberService;
 
+    @Autowired
+    private CompanyService companyService;
+
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<InsuranceApplication> create(){
@@ -411,4 +410,59 @@ public class InsuranceApplicationController {
         return msgResult;
 
     }
+
+
+    @ApiOperation(value="获取推广员和保险代理人")
+    @RequestMapping(value = "getPromoterAndAgent",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="applicationId",value = "投保单ID",required = true,paramType = "query"),
+            @ApiImplicitParam(name="policyId",value = "每月投保单ID",required = true,paramType = "query")
+    })
+    public MessageResult<PromoterAndAgentDto> getPromoterAndAgent(String applicationId,String policyId){
+
+        MessageResult<PromoterAndAgentDto> msgResult = new MessageResult<>();
+
+        PromoterAndAgentDto promoterAndAgentDto = new PromoterAndAgentDto();
+
+        try {
+
+            InsuranceApplication insuranceApplication = insuranceApplicationService.get(applicationId);
+
+            Company company = companyService.get(insuranceApplication.getCompanyId());
+
+            String promoter = "";
+
+            if (StringUtils.isNotEmpty(company.getPromoter())) {
+                promoter = company.getPromoter();
+            }
+
+            InsurancePolicy insurancePolicy = insurancePolicyService.get(policyId);
+
+            InsuranceAgent insuranceAgent = insurancePolicy.getAgent();
+
+            promoterAndAgentDto.setPromoter(promoter);
+
+            String agentName = "";
+
+            if (insuranceAgent != null && StringUtils.isNotEmpty(insuranceAgent.getName())) {
+                agentName = insuranceAgent.getName();
+            }
+
+            promoterAndAgentDto.setAgentName(agentName);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+
+        msgResult.setResult(true);
+        msgResult.setData(promoterAndAgentDto);
+
+        return msgResult;
+    }
+
+
 }

+ 1 - 1
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/CompanyMemberController.java

@@ -170,7 +170,7 @@ public class CompanyMemberController {
             Page<CompanyMember> page = companyMemberService.pageSearch(searchParams,1,100,sortList);
             if(page.size() > 0){
                 msgResult.setResult(false);
-                msgResult.setMessage("该条数据已存在");
+                msgResult.setMessage("该身份证已经注册");
             }else {
                 companyMember.setId(UUID.randomUUID().toString());
                 if (StringUtils.isNotEmpty(company.getId())) companyMember.setCompanyId(company.getId());