| | |
| | | PLATFORM_UN_AGREE_BACK(9, "驳回退回申请","提交意见:${param}"), |
| | | COMPANY_EDIT(10, "保单修改","提交意见:${param1}\n${param2}"), |
| | | PLATFORM_CHECK_PASS(11, "投保审核通过",""), |
| | | CA_PLATFORM_CHECK_PASS_NO(12, "退回投保","提交意见:${param}"), |
| | | CA_PLATFORM_AGREE_BACK_APPLY(13, "同意退回申请","提交意见:${param}"), |
| | | CA_PLATFORM_CHECK_APPROVE(14, "批单完成",""), |
| | | CA_PLATFORM_CHECK_SIGNATURE(15, "企业签章",""), |
| | | CA_COMPANY_EDIT(16, "批单修改","提交意见:${param1}\n${param2}"), |
| | | CA_COMPANY_COMMIT(17, "提交投保","提交意见:${param}"), |
| | | CA_COMPANY_BACK_APPLY(18, "申请退回","提交意见:${param}"), |
| | | CA_COMPANY_CLOSE(19, "关闭订单",""), |
| | | CA_PALTFORM_REFUSE_APPLY(20, "驳回退回申请",""), |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | |
| | | SIGNATURE(3, "已签章待上传保险单",""), |
| | | FAIL_RETURN(4, "保单出具失败退回",""), |
| | | UPLOAD_INSURANCE(5, "保单完成","保险生效起期:${param}变更为${param1}"), |
| | | COMPANY_APPLY_RETURN(6, "企业申请退回(不可驳回)","提交意见:${param}"), |
| | | COMPANY_APPLY_RETURN_SELECT(7, "企业申请退回(可驳回)","提交意见:${param}"), |
| | | CLOSE(8, "订单关闭",""), |
| | | PLATFORM_CHECK_PASS(9,"平台投保审核通过",""), |
| | | COMPANY_BACK_APPLY_UPLOAD(6, "企业申请退回(提交投保)","提交意见:${param}"), |
| | | COMPANY_BACK_APPLY_WAIT_SIGNATURE(7, "企业申请退回(待签章)","提交意见:${param}"), |
| | | COMPANY_BACK_APPLY_SIGNATURE(8, "企业申请退回(已签章)","提交意见:${param}"), |
| | | CLOSE(9, "订单关闭",""), |
| | | PLATFORM_CHECK_PASS(10,"平台投保审核通过",""), |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | |
| | | UPLOAD(0, "提交加减保/换厂申请"), |
| | | SIGNATURE(1, "已签章"), |
| | | APPROVE(2, "已上传审批"), |
| | | RETURN_APPLY(3, "发起退回申请"), |
| | | PLATFORM_AGREE(4, "平台同意(已退回)"), |
| | | CLOSE(5, "已关闭"), |
| | | PALTFORM_CHECK_PASS(6, "审核不通过"), |
| | | PALTFORM_CHECK_PASS_NO(7, "审核通过"), |
| | | RETURN_APPLY_UPLOAD(3, "发起退回申请(待审核)"), |
| | | RETURN_APPLY_SIGNATURE(4, "发起退回申请(已签章)"), |
| | | PLATFORM_AGREE(5, "平台同意(已退回)"), |
| | | CLOSE(6, "已关闭"), |
| | | PALTFORM_CHECK_PASS(7, "审核通过"), |
| | | PALTFORM_CHECK_PASS_NO(8, "审核不通过"), |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | |
| | | */ |
| | | Integer create(ApplyChange applyChange); |
| | | Integer back(ApplyChange param); |
| | | Integer dealBackApply(ApplyChange param); |
| | | /** |
| | | * 主键删除 |
| | | * |
| | |
| | | private SolutionsMapper solutionsMapper; |
| | | |
| | | /** |
| | | * 平台退回申请 |
| | | * @param insuranceApply |
| | | * 平台退回投保 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())){ |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.APPROVE.getKey())){ |
| | | //已提交和已完成状态不支持审核不通过 |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | update.setId(model.getId()); |
| | | applyChangeMapper.updateById(update); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.PLATFORM_RETURN; |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_CHECK_PASS_NO; |
| | | String info =applyLogType.getInfo(); |
| | | info = info.replace("${param}", update.getCheckInfo()); |
| | | ApplyLog log = new ApplyLog(update,applyLogType.getName(),info,update.getId(),applyLogType.getKey(), JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | applyLogMapper.insert(log); |
| | | return 1; |
| | | |
| | | } |
| | | /** |
| | | * 平台退回投保 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public Integer dealBackApply(ApplyChange param) { |
| | | if(param.getId() == null ||StringUtils.isBlank(param.getCheckInfo())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | ApplyChange model = applyChangeMapper.selectById(param.getId()); |
| | | |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.APPROVE.getKey())){ |
| | | //已提交和已完成状态不支持审核不通过 |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | ApplyChange update = new ApplyChange(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(user.getId()); |
| | | update.setStatus(Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS_NO.getKey()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo(param.getCheckInfo()); |
| | | update.setCheckUserId(user.getId()); |
| | | update.setId(model.getId()); |
| | | applyChangeMapper.updateById(update); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_CHECK_PASS_NO; |
| | | String info =applyLogType.getInfo(); |
| | | info = info.replace("${param}", update.getCheckInfo()); |
| | | ApplyLog log = new ApplyLog(update,applyLogType.getName(),info,update.getId(),applyLogType.getKey(), JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"数据已删除,无法进行该操作"); |
| | | } |
| | | Constants.ApplyChangeLogStatus applyChangeLogStatus = Constants.ApplyChangeLogStatus.RETURN_APPLY; |
| | | |
| | | if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY.getKey())){ |
| | | if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()) |
| | | ||applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())){ |
| | | //发起退回申请 |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作"); |
| | |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非平台端用户无法进行该操作"); |
| | | } |
| | | if(!applyChange.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY.getKey())){ |
| | | if(!(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()) |
| | | ||applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.UPLOAD.getKey())){ |
| | |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非平台端用户无法进行该操作"); |
| | | } |
| | | if(!applyChange.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY.getKey())){ |
| | | if(!(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()) |
| | | ||applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.CLOSE.getKey())){ |
| | |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Constants.ApplyLogType applyLogType = null; |
| | | String info = ""; |
| | | InsuranceApply update = new InsuranceApply(); |
| | | if(insuranceApply.getDealBackApply() ==1){ |
| | | //如果是驳回,只能可驳回申请状态进行操作 |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN_SELECT.getKey())){ |
| | | //如果是驳回,只能可驳回已签章状态下的退回申请状态进行操作 |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | applyLogType = Constants.ApplyLogType.PLATFORM_UN_AGREE_BACK; |
| | | info = applyLogType.getInfo(); |
| | | info = info.replace("${param}", insuranceApply.getCheckInfo()); |
| | | update.setStatus(Constants.InsuranceApplyStatus.SIGNATURE.getKey()); |
| | | }else{ |
| | | //如果是同意,两种申请退回状态都可操作 |
| | | if(!(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN_SELECT.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN.getKey()))){ |
| | | if(!(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | applyLogType = Constants.ApplyLogType.PLATFORM_AGREE_BACK; |
| | | if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE.getKey())){ |
| | | update.setStatus(Constants.InsuranceApplyStatus.SIGNATURE.getKey()); |
| | | }else if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE.getKey())){ |
| | | update.setStatus(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()); |
| | | }else if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey())){ |
| | | update.setStatus(Constants.InsuranceApplyStatus.UPLOAD.getKey()); |
| | | } |
| | | } |
| | | InsuranceApply update = new InsuranceApply(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(user.getId()); |
| | | //同意退回,直接回到最初状态,如果驳回退回申请,则保单状态回到待上传保险单 |
| | |
| | | if(insuranceApply.getIsdeleted().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"数据已删除,无法进行该操作"); |
| | | } |
| | | Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN; |
| | | //-----TODU-------RJ-------完善退回状态分开标记------------------ |
| | | Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE; |
| | | if(insuranceApplyOptDTO.getOptType().equals(Constants.ONE)){ |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"退回申请中,请勿重复操作"); |
| | | } |
| | | if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态非可申请退回!"); |
| | | } |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey())){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD; |
| | | }else if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey())){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE; |
| | | }else if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey())){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE; |
| | | } |
| | | }else if(insuranceApplyOptDTO.getOptType().equals(Constants.TWO)){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.CLOSE; |
| | |
| | | insuranceApply.setCheckUserId(loginUserInfo.getId()); |
| | | insuranceApplyMapper.updateById(insuranceApply); |
| | | //存储日志数据 |
| | | this.saveApplyLog(insuranceApply,insuranceApplyStatus,null); |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.COMPANY_APPLY_RETURN; |
| | | String info =applyLogType.getInfo(); |
| | | info = info.replace("${param}", insuranceApplyOptDTO.getOptIllustration()); |
| | | ApplyLog log = new ApplyLog(insuranceApply,applyLogType.getName(),info,insuranceApply.getId(),applyLogType.getKey(),JSONObject.toJSONString(insuranceApply), JSONObject.toJSONString(insuranceApply)); |
| | | applyLogMapper.insert(log); |
| | | // this.saveApplyLog(insuranceApply,insuranceApplyStatus,null); |
| | | } |
| | | |
| | | |