|
@@ -629,23 +629,32 @@ public class InsurancePolicyController {
|
|
|
@RequestMapping(value = "rollbackOrder",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name="applicationId",value = "投保单ID",required = true,paramType = "query"),
|
|
|
- @ApiImplicitParam(name="policyId",value = "每月投保单ID",required = true,paramType = "query")
|
|
|
+ @ApiImplicitParam(name="policyId",value = "每月投保单ID",paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="status",value = "转单步骤",required = true,paramType = "query")
|
|
|
})
|
|
|
- public MessageResult<Integer> rollbackOrder(String applicationId,String policyId, @RequestAttribute String subject){
|
|
|
+ public MessageResult<Integer> rollbackOrder(String applicationId,String policyId,String status, @RequestAttribute String subject){
|
|
|
//当前用户ID
|
|
|
System.out.println(subject);
|
|
|
|
|
|
MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
+ InsurancePolicy insurancePolicy;
|
|
|
|
|
|
- InsurancePolicy insurancePolicy = insurancePolicyService.get(policyId);
|
|
|
+ if(StringUtils.isNotEmpty(policyId)){
|
|
|
+ insurancePolicy = insurancePolicyService.get(policyId);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ List<ApplicationPolicy> applicationPolicyList = applicationPolicyService.findByApplicationId(applicationId);
|
|
|
+ ApplicationPolicy applicationPolicy = applicationPolicyList.get(0);
|
|
|
+ insurancePolicy = applicationPolicy.getPolicy();
|
|
|
+ }
|
|
|
|
|
|
PolicyStatus srcPolicyStatus = PolicyStatus.valueOf(Integer.valueOf(insurancePolicy.getStatus()));
|
|
|
|
|
|
- PolicyStatus destPolicyStatus = PolicyStatus.PendingTrial;
|
|
|
+ PolicyStatus destPolicyStatus = PolicyStatus.valueOf(Integer.valueOf(status));
|
|
|
|
|
|
- int affectCount = approval(applicationId, policyId, "回退", "", destPolicyStatus.getValue() + "", subject);
|
|
|
+ int affectCount = approval(applicationId, policyId, "回退", "", destPolicyStatus.getValue()+ "", subject);
|
|
|
|
|
|
//发送微信通知
|
|
|
templateMessageService.sendTemplateMessage(policyId, srcPolicyStatus, destPolicyStatus);
|
|
@@ -662,14 +671,21 @@ public class InsurancePolicyController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
private Integer approval(String applicationId,String policyId,String processStatus,String opinion,String status,String subject){
|
|
|
int affectCount = 0;
|
|
|
|
|
|
InsuranceApplication insuranceApplication = insuranceApplicationService.get(applicationId);
|
|
|
- InsurancePolicy insurancePolicy = insurancePolicyService.get(policyId);
|
|
|
+
|
|
|
+ InsurancePolicy insurancePolicy;
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(policyId)){
|
|
|
+ insurancePolicy = insurancePolicyService.get(policyId);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ List<ApplicationPolicy> applicationPolicyList = applicationPolicyService.findByApplicationId(applicationId);
|
|
|
+ ApplicationPolicy applicationPolicy = applicationPolicyList.get(0);
|
|
|
+ insurancePolicy = applicationPolicy.getPolicy();
|
|
|
+ }
|
|
|
|
|
|
String curStatus = insurancePolicy.getStatus();
|
|
|
|