|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|