| | |
| | | } |
| | | |
| | | this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null); |
| | | |
| | | |
| | | return applyChange.getId(); |
| | | } |
| | | |
| | |
| | | applyLog.setIsdeleted(Constants.ZERO); |
| | | applyLog.setApplyId(applyChange.getApplyId()); |
| | | applyLog.setTitle(applyChangeLogStatus.getName()); |
| | | applyLog.setContent(content); |
| | | applyLog.setContent(applyChangeLogStatus.getInfo().replace("${param}",content)); |
| | | applyLog.setObjType(applyChangeLogStatus.getKey()); |
| | | applyLog.setObjId( applyChange.getId()); |
| | | applyLog.setStatus(applyChange.getStatus()); |
| | |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(!Objects.isNull(model.getType()),ApplyChange::getType,model.getType()) |
| | | .eq(!Objects.isNull(model.getStatus()),ApplyChange::getStatus,model.getStatus()) |
| | | .eq(!Objects.isNull(model.getStatus())&&!model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus,model.getStatus()) |
| | | .in(!Objects.isNull(model.getStatus())&&model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus, |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey(), |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) |
| | | .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId()) |
| | | .eq(!Objects.isNull(model.getSolutionsId()),ApplyChange::getSolutionsId,model.getSolutionsId()) |
| | | .ge(StringUtils.isNotBlank(model.getCreateDateS()),ApplyChange::getCreateDate, model.getCreateDateS()+" 00:00:00" ) |
| | |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(!Objects.isNull(model.getType()),ApplyChange::getType,model.getType()) |
| | | .eq(!Objects.isNull(model.getStatus()),ApplyChange::getStatus,model.getStatus()) |
| | | .eq(!Objects.isNull(model.getStatus())&&!model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus,model.getStatus()) |
| | | .in(!Objects.isNull(model.getStatus())&&model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus, |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey(), |
| | | Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) |
| | | .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId()) |
| | | .eq(!Objects.isNull(model.getSolutionsId()),ApplyChange::getSolutionsId,model.getSolutionsId()) |
| | | .ge(StringUtils.isNotBlank(model.getCreateDateS()),ApplyChange::getCreateDate, model.getCreateDateS()+" 00:00:00" ) |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"数据已删除,无法进行该操作"); |
| | | } |
| | | Constants.ApplyChangeLogStatus applyChangeLogStatus = Constants.ApplyChangeLogStatus.RETURN_APPLY; |
| | | if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()) |
| | | ||applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())){ |
| | | |
| | | if(applyChangeOptDTO.getOptType().equals(3)){ |
| | | //发起退回申请 |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作"); |
| | | } |
| | | if(!applyChange.getStatus().equals(Constants.ApplyChangeStatus.UPLOAD.getKey()) ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | if(!(applyChange.getStatus().equals(Constants.ApplyChangeStatus.UPLOAD.getKey()) |
| | | || applyChange.getStatus().equals(Constants.ApplyChangeStatus.SIGNATURE.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进退回申请!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.PLATFORM_AGREE.getKey())){ |
| | | |
| | | if(applyChange.getStatus().equals(Constants.ApplyChangeStatus.UPLOAD.getKey())){ |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()); |
| | | }else{ |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()); |
| | | } |
| | | |
| | | }else if(applyChangeOptDTO.getOptType().equals(4)){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_AGREE; |
| | | //平台同意退回 |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.UPLOAD.getKey())){ |
| | | }else if(applyChangeOptDTO.getOptType().equals(5)){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_UN_AGREE; |
| | | //平台驳回退回 |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(Constants.ApplyChangeStatus.CLOSE.getKey())){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.CLOSE; |
| | | if(applyChange.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey())){ |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.UPLOAD.getKey()); |
| | | }else{ |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.SIGNATURE.getKey()); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(6)){ |
| | | //企业关闭 |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.CLOSE; |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作"); |
| | | } |
| | | if(!applyChange.getStatus().equals(Constants.ApplyChangeStatus.PLATFORM_AGREE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.CLOSE.getKey()); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST ); |
| | | } |
| | | applyChange.setStatus(applyChangeOptDTO.getOptType()); |
| | | applyChange.setEditor(loginUserInfo.getId()); |
| | | applyChange.setEditDate(new Date()); |
| | | applyChangeMapper.updateById(applyChange); |
| | | // //存储日志数据 |
| | | |
| | | //存储日志数据 |
| | | this.saveApplyLog(applyChange,applyChangeLogStatus,applyChangeOptDTO.getOptIllustration()); |
| | | } |
| | | |
| | |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | | String link = signService.signLink(applyNo,company.getEmail(),company.getCode()); |
| | | String link = signService.signLink(applyNo,company.getName(),company.getCode()); |
| | | if(StringUtils.isBlank(link) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |