|
@@ -3,11 +3,13 @@ package com.jpsoft.picc.modules.business.controller;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.picc.modules.base.entity.InsuranceAgent;
|
|
|
import com.jpsoft.picc.modules.base.service.InsuranceAgentService;
|
|
|
+import com.jpsoft.picc.modules.business.service.InsurancePolicyRecordService;
|
|
|
import com.jpsoft.picc.modules.common.utils.PojoUtils;
|
|
|
import com.jpsoft.picc.modules.common.dto.Sort;
|
|
|
import com.jpsoft.picc.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.picc.modules.business.entity.InsurancePolicy;
|
|
|
import com.jpsoft.picc.modules.business.service.InsurancePolicyService;
|
|
|
+import com.jpsoft.picc.modules.business.entity.InsurancePolicyRecord;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -34,6 +36,9 @@ public class InsurancePolicyController {
|
|
|
@Autowired
|
|
|
private InsuranceAgentService insuranceAgentService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private InsurancePolicyRecordService insurancePolicyRecordService;
|
|
|
+
|
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
|
public MessageResult<InsurancePolicy> create(){
|
|
@@ -216,7 +221,7 @@ public class InsurancePolicyController {
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
|
searchParams.put("id","%" + id + "%");
|
|
@@ -265,11 +270,11 @@ public class InsurancePolicyController {
|
|
|
|
|
|
|
|
|
@ApiOperation(value="读取推广信息")
|
|
|
- @RequestMapping(value = "LoadInsuranceAgent",method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "loadInsuranceAgent",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name="id",value = "每月投保单ID",required = true,paramType = "query")
|
|
|
})
|
|
|
- public MessageResult<InsuranceAgent> LoadInsuranceAgent(String id, @RequestAttribute String subject){
|
|
|
+ public MessageResult<InsuranceAgent> loadInsuranceAgent(String id, @RequestAttribute String subject){
|
|
|
|
|
|
//当前用户ID
|
|
|
System.out.println(subject);
|
|
@@ -287,4 +292,103 @@ public class InsurancePolicyController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value="人才超市初审")
|
|
|
+ @RequestMapping(value = "firstApproval",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="id",value = "每月投保单ID",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="processStatus",value = "流程审核状态(正常/回退)",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="opinion",value = "意见",required = true,paramType = "query")
|
|
|
+ })
|
|
|
+ public MessageResult<Integer> firstApproval(String id,String processStatus,String opinion, @RequestAttribute String subject){
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ int affectCount1 = approval(id,processStatus,opinion,"50",subject);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(affectCount1);
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value="PICC复审")
|
|
|
+ @RequestMapping(value = "secondApproval",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="id",value = "每月投保单ID",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="processStatus",value = "流程审核状态(正常/回退)",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="opinion",value = "意见",required = true,paramType = "query")
|
|
|
+ })
|
|
|
+ public MessageResult<Integer> secondApproval(String id,String processStatus,String opinion, @RequestAttribute String subject){
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ int affectCount1 = approval(id,processStatus,opinion,"60",subject);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(affectCount1);
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value="PICC出单")
|
|
|
+ @RequestMapping(value = "issued",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="id",value = "每月投保单ID",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="processStatus",value = "流程审核状态(正常/回退)",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="opinion",value = "意见",required = true,paramType = "query")
|
|
|
+ })
|
|
|
+ public MessageResult<Integer> issued(String id,String processStatus,String opinion, @RequestAttribute String subject){
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ int affectCount1 = approval(id,processStatus,opinion,"70",subject);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(affectCount1);
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private Integer approval(String id,String processStatus,String opinion,String status,String subject){
|
|
|
+
|
|
|
+ InsurancePolicy insurancePolicy = insurancePolicyService.get(id);
|
|
|
+
|
|
|
+ insurancePolicy.setProcessStatus(processStatus);
|
|
|
+ insurancePolicy.setStatus(status);
|
|
|
+
|
|
|
+ int affectCount = insurancePolicyService.update(insurancePolicy);
|
|
|
+
|
|
|
+ int affectCount1 = 0;
|
|
|
+
|
|
|
+ if(affectCount > 0){
|
|
|
+ InsurancePolicyRecord insurancePolicyRecord = new InsurancePolicyRecord();
|
|
|
+ insurancePolicyRecord.setPolicyId(insurancePolicy.getId());
|
|
|
+ insurancePolicyRecord.setOpinion(opinion);
|
|
|
+ insurancePolicyRecord.setProcessStatus(processStatus);
|
|
|
+ insurancePolicyRecord.setId(UUID.randomUUID().toString());
|
|
|
+ insurancePolicyRecord.setDelFlag(false);
|
|
|
+ insurancePolicyRecord.setCreateBy(subject);
|
|
|
+ insurancePolicyRecord.setCreateTime(new Date());
|
|
|
+
|
|
|
+ affectCount1 = insurancePolicyRecordService.insert(insurancePolicyRecord);
|
|
|
+ }
|
|
|
+ return affectCount1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|