| | |
| | | if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getIsdeleted())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(Constants.ZERO,model.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,该申请状态已流转,当前不支持签章操作!"); |
| | | } |
| | | |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Company company = user.getCompany(); |
| | | if(debugModel){ |
| | |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息"); |
| | | } |
| | | if(solutions.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,非委托保方案保单,无法进行该操作!"); |
| | | } |
| | | String fileUrl = null; |
| | | if(Constants.equalsObject(model.getType(), Constants.ONE)){ |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportChangeUnitExcelToPdf(model,"换厂申请表","被保险人"); |
| | | if(solutions.getType().equals(Constants.ONE)){ |
| | | if(!Constants.equalsInteger(Constants.ZERO,model.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,该申请状态已流转,当前不支持签章操作!"); |
| | | } |
| | | if(Constants.equalsObject(model.getType(), Constants.ONE)){ |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportChangeUnitExcelToPdf(model,"换厂申请表","被保险人"); |
| | | }else{ |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportJiajianBaoExcelToPdf(model,"加减保申请表","被保险人"); |
| | | } |
| | | String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode(); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",model.getId().toString()); |
| | | String applyNo = signService.applySignLocalFile(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"人员名单签章",company.getSignId(),notifyUrl); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | | String link = signService.signLink(applyNo,company.getName(),company.getCode()); |
| | | if(StringUtils.isBlank(link) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | | ApplyChange update= new ApplyChange(); |
| | | update.setId(model.getId()); |
| | | update.setEditor(user.getId()); |
| | | update.setEditDate(new Date()); |
| | | update.setSignMemberListNo(applyNo); |
| | | applyChangeMapper.updateById(update); |
| | | return link; |
| | | }else{ |
| | | fileUrl = ExcelExporter.build(ApplyChange.class).exportJiajianBaoExcelToPdf(model,"加减保申请表","被保险人"); |
| | | return this.getSignLinkJiajiabao(model); |
| | | } |
| | | String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode(); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",model.getId().toString()); |
| | | String applyNo = signService.applySignLocalFile(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"人员名单签章",company.getSignId(),notifyUrl); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | | String link = signService.signLink(applyNo,company.getName(),company.getCode()); |
| | | if(StringUtils.isBlank(link) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | | ApplyChange update= new ApplyChange(); |
| | | update.setId(model.getId()); |
| | | update.setEditor(user.getId()); |
| | | update.setEditDate(new Date()); |
| | | update.setSignMemberListNo(applyNo); |
| | | applyChangeMapper.updateById(update); |
| | | return link; |
| | | } |
| | | |
| | | |