|
@@ -7,10 +7,12 @@ 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.business.entity.InsuranceApplication;
|
|
|
-import com.jpsoft.picc.modules.business.entity.InsurancePolicy;
|
|
|
-import com.jpsoft.picc.modules.business.entity.StudentApplication;
|
|
|
+import com.jpsoft.picc.modules.base.service.TemplateMessageService;
|
|
|
+import com.jpsoft.picc.modules.business.entity.*;
|
|
|
+import com.jpsoft.picc.modules.business.service.StudentApplicationRecordService;
|
|
|
import com.jpsoft.picc.modules.business.service.StudentApplicationService;
|
|
|
+import com.jpsoft.picc.modules.common.constant.PolicyStatus;
|
|
|
+import com.jpsoft.picc.modules.common.constant.StudentPolicyStatus;
|
|
|
import com.jpsoft.picc.modules.common.dto.Sort;
|
|
|
import com.jpsoft.picc.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.picc.modules.common.utils.NumberToCN;
|
|
@@ -51,6 +53,12 @@ public class StudentApplicationController {
|
|
|
@Autowired
|
|
|
private InsuranceJobsService insuranceJobsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TemplateMessageService templateMessageService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StudentApplicationRecordService studentApplicationRecordService;
|
|
|
+
|
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
|
public MessageResult<StudentApplication> create(){
|
|
@@ -221,6 +229,10 @@ public class StudentApplicationController {
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
|
String id,
|
|
|
+ String tabStatus,
|
|
|
+ String userType,
|
|
|
+ String policyNo,
|
|
|
+ String status,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
@@ -235,8 +247,22 @@ public class StudentApplicationController {
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
- searchParams.put("id","%" + id + "%");
|
|
|
+ if (StringUtils.isNotEmpty(tabStatus)) {
|
|
|
+ searchParams.put("tabStatus",tabStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(policyNo)) {
|
|
|
+ searchParams.put("policyNo","%" + policyNo + "%");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(userType)) {
|
|
|
+ if(userType.equals("1")){
|
|
|
+ searchParams.put("userType",userType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(status)) {
|
|
|
+ searchParams.put("status",status);
|
|
|
}
|
|
|
|
|
|
searchParams.put("delFlag",false);
|
|
@@ -248,6 +274,63 @@ public class StudentApplicationController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value="标签页数量提示")
|
|
|
+ @RequestMapping(value = "tabCount",method = RequestMethod.POST)
|
|
|
+ public MessageResult<Map> tabCount(
|
|
|
+ String tabStatus,
|
|
|
+ String userType,
|
|
|
+ String policyNo,
|
|
|
+ String status,
|
|
|
+ @RequestAttribute String subject){
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(tabStatus)) {
|
|
|
+ searchParams.put("tabStatus",tabStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(policyNo)) {
|
|
|
+ searchParams.put("policyNo","%" + policyNo + "%");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(userType)) {
|
|
|
+ if(userType.equals("1")){
|
|
|
+ searchParams.put("userType",userType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(status)) {
|
|
|
+ searchParams.put("status",status);
|
|
|
+ }
|
|
|
+
|
|
|
+ searchParams.put("delFlag",false);
|
|
|
+
|
|
|
+ Map<String,Object> countMap = new HashMap<>();
|
|
|
+
|
|
|
+ Page<StudentApplication> allPage = studentApplicationService.pageSearch(searchParams,1,100000,true,sortList);
|
|
|
+
|
|
|
+ countMap.put("all",allPage.getTotal());
|
|
|
+
|
|
|
+ for (StudentPolicyStatus sPolicyStatus : StudentPolicyStatus.values()) {
|
|
|
+ searchParams.put("status",sPolicyStatus.getValue());
|
|
|
+ Page<StudentApplication> page = studentApplicationService.pageSearch(searchParams,1,100000,true,sortList);
|
|
|
+ System.out.println(sPolicyStatus.getText() + "=============" + page.getTotal());
|
|
|
+ countMap.put(sPolicyStatus.getValue() + "" , page.getTotal());
|
|
|
+ }
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(countMap);
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@ApiOperation(value="添加测试信息")
|
|
|
@PostMapping("addTestApplication")
|
|
@@ -453,8 +536,7 @@ public class StudentApplicationController {
|
|
|
map1.put("id",jobId);
|
|
|
map1.put("name",insuranceJobs.getJobs().getName());
|
|
|
map1.put("content",insuranceJobs.getJobs().getContent());
|
|
|
- map1.put("charges",insuranceJobs.getCharges());
|
|
|
- map1.put("chargesY",insuranceJobs.getCharges().multiply(new BigDecimal(12)));
|
|
|
+ map1.put("chargesY",insuranceJobs.getCharges());
|
|
|
long memberCount = 1;
|
|
|
long number = Long.valueOf(memberCount).intValue();
|
|
|
map1.put("number",number);
|
|
@@ -477,4 +559,134 @@ public class StudentApplicationController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="人才超市与PICC转账")
|
|
|
+ @RequestMapping(value = "makePolicy",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="applicationId",value = "投保单ID",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="accountBank",value = "入账银行",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="issuingBank",value = "出账银行",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="singlNumber",value = "单号",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="processStatus",value = "流程审核状态(正常/回退)",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="opinion",value = "意见",required = true,paramType = "query")
|
|
|
+ })
|
|
|
+ public MessageResult<Integer> makePolicy(String applicationId,
|
|
|
+ String accountBank,String issuingBank,String singlNumber,
|
|
|
+ String processStatus,String opinion, @RequestAttribute String subject){
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ StudentApplication studentApplication = studentApplicationService.get(applicationId);
|
|
|
+ StudentPolicyStatus srcStudentPolicyStatus = StudentPolicyStatus.valueOf(Integer.valueOf(studentApplication.getStatus()));
|
|
|
+
|
|
|
+ StudentPolicyStatus destStudentPolicyStatus;
|
|
|
+
|
|
|
+ if (processStatus.equals("正常")) {
|
|
|
+ //40
|
|
|
+ destStudentPolicyStatus = StudentPolicyStatus.PendingOutPolicy;
|
|
|
+ } else {
|
|
|
+ //30
|
|
|
+ destStudentPolicyStatus = StudentPolicyStatus.PendingPay;
|
|
|
+ }
|
|
|
+
|
|
|
+ studentApplication.setAccountBank(accountBank);
|
|
|
+ studentApplication.setIssuingBank(issuingBank);
|
|
|
+ studentApplication.setSinglNumber(singlNumber);
|
|
|
+ studentApplication.setTransferTime(new Date());
|
|
|
+
|
|
|
+ int affectCount = studentApplicationService.update(studentApplication);
|
|
|
+
|
|
|
+ int affectCount1 = 0;
|
|
|
+
|
|
|
+ if (affectCount > 0) {
|
|
|
+ affectCount1 = approval(applicationId, processStatus, opinion, destStudentPolicyStatus.getValue() + "", subject);
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送微信通知
|
|
|
+ //templateMessageService.sendTemplateMessage(applicationId, srcStudentPolicyStatus, destStudentPolicyStatus);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(affectCount1);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value="回退转单通用")
|
|
|
+ @RequestMapping(value = "transferOrder",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="applicationId",value = "投保单ID",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="processStatus",value = "转单步骤",required = true,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="status",value = "转单步骤",required = true,paramType = "query")
|
|
|
+ })
|
|
|
+ public MessageResult<Integer> transferOrder(String applicationId,
|
|
|
+ String status,
|
|
|
+ String processStatus,
|
|
|
+ @RequestAttribute String subject){
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ StudentApplication studentApplication = studentApplicationService.get(applicationId);
|
|
|
+ StudentPolicyStatus srcStatus = StudentPolicyStatus.valueOf(Integer.valueOf(studentApplication.getStatus()));
|
|
|
+
|
|
|
+ StudentPolicyStatus destStatus = StudentPolicyStatus.valueOf(Integer.valueOf(status));
|
|
|
+
|
|
|
+ int affectCount = approval(applicationId, processStatus, "", destStatus.getValue()+ "", subject);
|
|
|
+
|
|
|
+ //发送微信通知
|
|
|
+ //templateMessageService.sendTemplateMessage(applicationId, srcStatus, destStatus);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(affectCount);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Integer approval(String applicationId,String processStatus,String opinion,String status,String subject){
|
|
|
+ int affectCount = 0;
|
|
|
+
|
|
|
+ StudentApplication studentApplication = studentApplicationService.get(applicationId);
|
|
|
+
|
|
|
+ String curStatus = studentApplication.getStatus();
|
|
|
+
|
|
|
+ studentApplication.setProcessStatus(processStatus);
|
|
|
+ studentApplication.setStatus(status);
|
|
|
+ studentApplication.setUpdateBy(subject);
|
|
|
+ studentApplication.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ int affectCount1 = studentApplicationService.update(studentApplication);
|
|
|
+
|
|
|
+ if(affectCount1 > 0){
|
|
|
+ StudentApplicationRecord record = new StudentApplicationRecord();
|
|
|
+ record.setApplicationId(studentApplication.getId());
|
|
|
+ record.setStatus(curStatus);
|
|
|
+ record.setOpinion(opinion);
|
|
|
+ record.setProcessStatus(processStatus);
|
|
|
+ record.setId(UUID.randomUUID().toString());
|
|
|
+ record.setDelFlag(false);
|
|
|
+ record.setCreateBy(subject);
|
|
|
+ record.setCreateTime(new Date());
|
|
|
+
|
|
|
+ affectCount = studentApplicationRecordService.insert(record);
|
|
|
+ }
|
|
|
+
|
|
|
+ return affectCount;
|
|
|
+ }
|
|
|
+
|
|
|
}
|