| | |
| | | |
| | | @ApiOperation("发起签署") |
| | | @GetMapping("/getSignLink") |
| | | @RequiresPermissions("business:contract:query") |
| | | @RequiresPermissions("business:companysolution:query") |
| | | public ApiResponse<String> getSignLink (@RequestParam Integer id) { |
| | | return ApiResponse.success(companySolutionService.getCompanySolutionSignLink(id)); |
| | | } |
| | |
| | | return ApiResponse.success(insuranceApplyService.getApplyPower(applyPowerDTO)); |
| | | } |
| | | |
| | | @ApiOperation("测试发送邮件") |
| | | @PostMapping("/testSendEmail") |
| | | public ApiResponse testSendEmail() { |
| | | insuranceApplyService.testSendEmail(); |
| | | return ApiResponse.success(null); |
| | | } |
| | | } |
| | |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(solutionsBaseService.findById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("测试生成主方案") |
| | | @GetMapping("/createSolutionBase") |
| | | public ApiResponse createSolutionBase(Integer solutionId) { |
| | | solutionsBaseService.createSolutionBase(solutionId); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | } |
| | |
| | | <artifactId>alibaba-dingtalk-service-sdk</artifactId> |
| | | <version>2.0.0</version> |
| | | </dependency> |
| | | <!-- 在pom.xml中添加依赖 --> |
| | | <dependency> |
| | | <groupId>javax.mail</groupId> |
| | | <artifactId>javax.mail-api</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | |
| | | @TableField(exist = false) |
| | | private Integer signType; |
| | | |
| | | @ApiModelProperty(value = "批改提醒时间 HH:mm") |
| | | @TableField(exist = false) |
| | | private String correctWarnTime; |
| | | |
| | | @ApiModelProperty(value = "方案类型 0直保 1委托投保") |
| | | @TableField(exist = false) |
| | | private Integer solutionType; |
| | |
| | | return taxesInvoicingVO; |
| | | } |
| | | |
| | | @ApiModelProperty(value = "在线签章地址") |
| | | @TableField(exist = false) |
| | | private String signLink; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | ApplyPowerVO getApplyPower(ApplyPowerDTO applyPowerDTO); |
| | | |
| | | void testSendEmail(); |
| | | } |
| | | |
| | |
| | | * @return long |
| | | */ |
| | | long count(SolutionsBase solutionsBase); |
| | | |
| | | |
| | | void createSolutionBase(Integer solutionId); |
| | | } |
| | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | import com.baomidou.mybatisplus.extension.api.R; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_COMPANY_COMMIT; |
| | | ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),"",applyChange.getId(),applyLogType.getKey(), null, null); |
| | | applyLogMapper.insert(log); |
| | | // if(1==1){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY ); |
| | | // } |
| | | return applyChange.getId(); |
| | | } |
| | | |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "减保人员【" + applyChagneDetail.getMemberName() + "】已出险无法进行减保"); |
| | | }; |
| | | //2024-10-29 15:17:54 查询人员是否已减保 已减保后无法再次减保 |
| | | if(applyChangeDetailJoinMapper.selectJoinCount(new MPJLambdaWrapper<ApplyChagneDetail>() |
| | | // if(applyChangeDetailJoinMapper.selectJoinCount(new MPJLambdaWrapper<ApplyChagneDetail>() |
| | | // .leftJoin(ApplyChange.class,ApplyChange::getId,ApplyChagneDetail::getApplyChangeId) |
| | | // .eq(ApplyChagneDetail::getType,Constants.ONE) |
| | | // .eq(ApplyChange::getApplyId,applyChange.getApplyId()) |
| | | // .eq(ApplyChagneDetail::getMemberId,applyChagneDetail.getMemberId()) |
| | | // .notIn(ApplyChange::getStatus,Constants.ApplyChangeStatus.CLOSE.getKey() |
| | | // ,Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS_NO.getKey() |
| | | // ) |
| | | // )>Constants.ZERO){ |
| | | // throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "减保人员【" + applyChagneDetail.getMemberName() + "】已减保无法再次进行减保"); |
| | | // }; |
| | | //2025-1-16 09:11:14 根据查询当前人员最后一次的加减保记录 如果最后一条记录是加保进入 则可以减保 如果最后一条记录是减保记录 则不可以减保 如果为空 这可以进行操作 |
| | | ApplyChagneDetail lastApplyChagneDetail = applyChangeDetailJoinMapper.selectJoinOne(ApplyChagneDetail.class, |
| | | new MPJLambdaWrapper<ApplyChagneDetail>() |
| | | .leftJoin(ApplyChange.class,ApplyChange::getId,ApplyChagneDetail::getApplyChangeId) |
| | | .eq(ApplyChagneDetail::getType,Constants.ONE) |
| | | .ne(ApplyChagneDetail::getType,Constants.TWO) |
| | | .eq(ApplyChange::getApplyId,applyChange.getApplyId()) |
| | | .eq(ApplyChagneDetail::getMemberId,applyChagneDetail.getMemberId()) |
| | | .eq(ApplyChagneDetail::getMemberId,applyChagneDetail.getMemberId()) |
| | | .notIn(ApplyChange::getStatus,Constants.ApplyChangeStatus.CLOSE.getKey() |
| | | ,Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS_NO.getKey() |
| | | ,Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS_NO.getKey() |
| | | ) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "减保人员【" + applyChagneDetail.getMemberName() + "】已减保无法再次进行减保"); |
| | | }; |
| | | |
| | | .orderByDesc(ApplyChagneDetail::getId) |
| | | .last(" limit 1 ") |
| | | ); |
| | | if(Objects.nonNull(lastApplyChagneDetail)){ |
| | | if(Constants.equalsInteger(lastApplyChagneDetail.getType(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "减保人员【" + applyChagneDetail.getMemberName() + "】已减保无法再次进行减保"); |
| | | } |
| | | } |
| | | //查询减保人员是否存在 冲突的 保单明细数据 |
| | | if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>() |
| | | .lambda() |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息"); |
| | | } |
| | | String fileUrl = null; |
| | | // if(Constants.equalsObject(model.getType(), Constants.ONE)){ |
| | | // fileUrl = ExcelExporter.build(ApplyChange.class).exportChangeUnitExcelToPdf(model,"换厂申请表","投保企业"); |
| | | // }else{ |
| | | // fileUrl = ExcelExporter.build(ApplyChange.class).exportJiajianBaoExcelToPdf(model,"加减保申请表","投保企业"); |
| | | // } |
| | | 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); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",model.getId().toString()); |
| | | String applyNo = signService.applySignLocalFileByParam(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"投保企业签章",company.getSignId(),notifyUrl,new Float(0.7)); |
| | | //临时使用 |
| | | fileUrl = |
| | | "https://yybred.oss-cn-hangzhou.aliyuncs.com/apply/20241120/1c80f0d7-ab35-4355-b9fe-944464643115.pdf"; |
| | | String applyNo = signService.applySign(companyName,fileUrl,companyName,creditCode,email,"人员名单签章",null,notifyUrl); |
| | | // fileUrl = |
| | | // "https://yybred.oss-cn-hangzhou.aliyuncs.com/apply/20241120/1c80f0d7-ab35-4355-b9fe-944464643115.pdf"; |
| | | // String applyNo = signService.applySign(companyName,fileUrl,companyName,creditCode,email,"人员名单签章",null,notifyUrl); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | |
| | | 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,"加减保申请表","被保险人"); |
| | | // } |
| | | 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()); |
| | | |
| | | //临时使用 |
| | | fileUrl = "https://yybred.oss-cn-hangzhou.aliyuncs.com/apply/20241230/a0d128f2-ba6c-4ad4-b86b-b2610a513d41.pdf"; |
| | | String applyNo = signService.applySignDoByParam(company.getName(),fileUrl,company.getName(),company.getCode(),company.getEmail(),"人员名单签章",company.getSignId(),notifyUrl,new Float(0.7)); |
| | | // fileUrl = "https://yybred.oss-cn-hangzhou.aliyuncs.com/apply/20241230/a0d128f2-ba6c-4ad4-b86b-b2610a513d41.pdf"; |
| | | // String applyNo = signService.applySignDoByParam(company.getName(),fileUrl,company.getName(),company.getCode(),company.getEmail(),"人员名单签章",company.getSignId(),notifyUrl,new Float(0.7)); |
| | | |
| | | // String applyNo = signService.applySignLocalFile(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"人员名单签章",company.getSignId(),notifyUrl); |
| | | String applyNo = signService.applySignLocalFileByParam(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"人员名单签章",company.getSignId(),notifyUrl,new Float(0.7)); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到保单数据"); |
| | | } |
| | | SaveUnionChangeDTO saveUnionChangeDTO = new SaveUnionChangeDTO(); |
| | | saveUnionChangeDTO.setApplyDate(update.getApplyStartTime()); |
| | | // saveUnionChangeDTO.setApplyDate(update.getApplyStartTime()); |
| | | saveUnionChangeDTO.setApplyDate(model.getValidTime()); |
| | | List<Integer> applyIds = new ArrayList<>(); |
| | | applyIds.add(model.getId()); |
| | | saveUnionChangeDTO.setApplyIds(applyIds); |
| | | saveUnionChangeDTO.setApplyChange(model); |
| | | saveUnionChangeDTO.setUnionApplyId(insuranceApply.getUnionApplyId()); |
| | | saveUnionChangeDTO.setBusinessType(model.getType()); |
| | | if(Constants.equalsInteger(model.getType(),Constants.ONE)){ |
| | | saveUnionChangeDTO.setApplyDate(model.getApplyStartTime()); |
| | | } |
| | | // if(Constants.equalsInteger(model.getType(),Constants.ONE)){ |
| | | // } |
| | | if(Constants.equalsInteger(user.getType(),Constants.TWO)){ |
| | | saveUnionChangeDTO.setShopId(user.getCompanyId()); |
| | | }else{ |
| | |
| | | saveUnionChangeDTO.setShopId(companySolution.getShopId()); |
| | | |
| | | } |
| | | // if(1==1){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | // } |
| | | |
| | | unionChangeService.merge(saveUnionChangeDTO); |
| | | } |
| | | // if(1==1){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | // } |
| | | return 1; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | |
| | | private void startSendEmail(Multifile f, String companyName, String solutionsName, String solutionEmail) { |
| | | if(StringUtils.isBlank(solutionEmail) || f==null|| StringUtils.isBlank(f.getFileurl())){ |
| | | return; |
| | |
| | | if(file!=null && file.isFile()){ |
| | | Map<String,Object> files = new HashMap<>(); |
| | | files.put("name",f.getName()); |
| | | files.put("file",file); |
| | | email.setFileList(new ArrayList<>()); |
| | | email.getFileList().add(files); |
| | | smsEmailService.sendEmail(email); |
| | | file.delete();//发送后删除临时文件 |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void testSendEmail(){ |
| | | SmsEmail email = new SmsEmail(); |
| | | email.setTitle("测试邮件"); |
| | | email.setEmail("94314517@qq.com"); |
| | | email.setContent("来自企业【测试企业】关于保险方案【测试方案】的测试邮件"); |
| | | File file = Constants.getFileByNetFile("https://yybred.oss-cn-hangzhou.aliyuncs.com/apply/20250116/600faf2f-5ba2-44e2-9a96-c99052dc013d.pdf","1111.pdf"); |
| | | if(file!=null && file.isFile()){ |
| | | Map<String,Object> files = new HashMap<>(); |
| | | files.put("name","测试文件"); |
| | | files.put("file",file); |
| | | email.setFileList(new ArrayList<>()); |
| | | email.getFileList().add(files); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public Integer updateData(InsuranceApply insuranceApply) { |
| | |
| | | .selectAs(Solutions::getType,InsuranceApply::getSolutionType) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getHasDispatchUnit,InsuranceApply::getHasDispatchUnit) |
| | | .selectAs(Solutions::getSignType,InsuranceApply::getSignType) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .selectAs(Solutions::getCorrectWarnTime,InsuranceApply::getCorrectWarnTime) |
| | | .select("( select ifnull(sum(ad.FEE),0) from apply_chagne_detail ad left join apply_change a on a.id = ad.APPLY_CHANGE_ID where t.id = a.APPLY_ID and a.status = 2 )",InsuranceApply::getChangeMoney) |
| | | .select(" ( select max(ac.APPLY_START_TIME) from apply_change ac where ac.apply_id = t.id and ac.status = 2 ) as lastChangeDate") |
| | | .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id ) as insureNum") |
| | |
| | | .leftJoin(Company.class,Company::getId,Solutions::getShopId) |
| | | .eq(InsuranceApply::getId,id) |
| | | .last("limit 1"); |
| | | |
| | | InsuranceApply insuranceApply = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,wrapper); |
| | | if(Objects.isNull(insuranceApply)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | this.dealDataDetail(insuranceApply); |
| | | return insuranceApply; |
| | | } |
| | | |
| | | public void dealDataDetail(InsuranceApply insuranceApply){ |
| | | Solutions solutions = solutionsMapper.selectById(insuranceApply.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到方案信息"); |
| | | } |
| | | insuranceApply.setCorrectWarnTime(solutions.getCorrectWarnTime()); |
| | | if(solutions.getDataType().equals(Constants.ONE)){ |
| | | Solutions newVersionSolution = solutionsMapper.selectOne(new QueryWrapper<Solutions>().lambda().eq(Solutions::getBaseId,solutions.getBaseId()).eq(Solutions::getDataType,Constants.TWO).last("limit 1")); |
| | | if(Objects.isNull(newVersionSolution)){ |
| | |
| | | initApplyStatus(insuranceApply); |
| | | //查询附件数据 |
| | | initImgData(insuranceApply); |
| | | |
| | | insuranceApply.setChangeMoney(Constants.getTwoPoint(insuranceApply.getChangeMoney())); |
| | | insuranceApply.setFee(Constants.getTwoPoint(insuranceApply.getFee())); |
| | | |
| | | //查询操作记录 |
| | | List<ApplyLog> applyLogList = applyLogJoinMapper.selectJoinList(ApplyLog.class, |
| | | new MPJLambdaWrapper<ApplyLog>() |
| | |
| | | .orderByAsc(ApplyLog::getCreateDate) |
| | | ); |
| | | insuranceApply.setApplyLogList(applyLogList); |
| | | return insuranceApply; |
| | | } |
| | | |
| | | private void setServiceDays(InsuranceApply insuranceApply) { |
| | |
| | | if(solutions.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,非委托保方案保单,无法进行该操作!"); |
| | | } |
| | | String fileUrl = "https://yybred.oss-cn-hangzhou.aliyuncs.com/apply/20241230/a0d128f2-ba6c-4ad4-b86b-b2610a513d41.pdf";//ExcelExporter.build(InsuranceApply.class).exportApplyExcelToPdf(model,"人员名单"); |
| | | String fileUrl = ExcelExporter.build(InsuranceApply.class).exportApplyExcelToPdf(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); |
| | | String applyNo = signService.applySign(company.getName(),fileUrl,company.getName(),company.getCode(),company.getEmail(),model.getSignKeyword(),company.getSignId(),notifyUrl); |
| | | String applyNo = signService.applySignLocalFileByParam(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"投保名单签章",company.getSignId(),notifyUrl,new Float(0.7)); |
| | | // String applyNo = signService.applySign(company.getName(),fileUrl,company.getName(),company.getCode(),company.getEmail(),model.getSignKeyword(),company.getSignId(),notifyUrl); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | QueryWrapper<SolutionsBase> wrapper = new QueryWrapper<>(solutionsBase); |
| | | return solutionsBaseMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void createSolutionBase(Integer solutionId){ |
| | | List<Solutions> solutionsList = solutionsMapper.selectList(new QueryWrapper<Solutions>().lambda() |
| | | .eq(Objects.nonNull(solutionId),Solutions::getId,solutionId) |
| | | .isNull(Solutions::getParentId).eq(Solutions::getDataType,Constants.ZERO).eq(Solutions::getIsdeleted,Constants.ZERO)); |
| | | for (Solutions solutions: solutionsList) { |
| | | SolutionsBase solutionsBase = new SolutionsBase(); |
| | | solutionsBase.setCreator(solutions.getCreator()); |
| | | solutionsBase.setCreateDate(new Date()); |
| | | solutionsBase.setIsdeleted(Constants.ZERO); |
| | | solutionsBase.setName(solutions.getName()); |
| | | solutionsBase.setStatus(solutions.getStatus()); |
| | | solutionsBase.setSortnum(Constants.ZERO); |
| | | solutionsBase.setInsuranceId(solutions.getInsuranceId()); |
| | | solutionsBase.setValidType(solutions.getValidType()); |
| | | solutionsBase.setMinAge(solutions.getMinAge()); |
| | | solutionsBase.setMaxAge(solutions.getMaxAge()); |
| | | solutionsBase.setSingleWorktype(solutions.getSingleWorktype()); |
| | | solutionsBase.setSpecialInfo(solutions.getSpecialInfo()); |
| | | solutionsBase.setSpecialAgreement(solutions.getSpecialAgreement()); |
| | | solutionsBase.setOrtherInfo(solutions.getOrtherInfo()); |
| | | solutionsBase.setDataType(Constants.ZERO); |
| | | solutionsBase.setValidTypeNum(solutions.getValidTypeNum()); |
| | | solutionsBase.setShopId(solutions.getShopId()); |
| | | solutionsBase.setAddValidDays(solutions.getAddValidDays()); |
| | | solutionsBase.setDelValidDays(solutions.getDelValidDays()); |
| | | solutionsBase.setCanAdd(solutions.getCanAdd()); |
| | | solutionsBase.setCanReduce(solutions.getCanReduce()); |
| | | solutionsBase.setCanChangeUnit(solutions.getCanChangeUnit()); |
| | | solutionsBase.setDelOnlyReplace(solutions.getDelOnlyReplace()); |
| | | solutionsBase.setCompanyName(solutions.getCompanyName()); |
| | | solutionsBase.setCompanyName(solutions.getCompanyName()); |
| | | solutionsBase.setCorrectWarnTime("18:30"); |
| | | solutionsBaseMapper.insert(solutionsBase); |
| | | |
| | | |
| | | //如果有工种,则产生一个新的有效历史版本 ~ |
| | | SolutionsBase newModel = new SolutionsBase(); |
| | | BeanUtils.copyProperties(solutionsBase,newModel); |
| | | newModel.setId(null); |
| | | newModel.setBaseId(solutionsBase.getId()); |
| | | newModel.setDataType(Constants.TWO); |
| | | solutionsBaseMapper.insert(newModel); |
| | | |
| | | List<SolutionWorktype> solutionWorktypeList = solutionWorktypeJoinMapper.selectList(new QueryWrapper<SolutionWorktype>().lambda().eq(SolutionWorktype::getType,Constants.ZERO).eq(SolutionWorktype::getSolutionId,solutions.getId())); |
| | | |
| | | Integer num = 1; |
| | | for(SolutionWorktype solutionWorktype : solutionWorktypeList) { |
| | | //基础版本 |
| | | SolutionWorktype w = new SolutionWorktype(); |
| | | w.setSolutionId(solutionsBase.getId()); |
| | | w.setIsdeleted(Constants.ZERO); |
| | | w.setCreator(newModel.getCreator()); |
| | | w.setCreateDate(solutionsBase.getCreateDate()); |
| | | w.setStatus(Constants.ZERO); |
| | | w.setSortnum(num++); |
| | | w.setWorktypeId(solutionWorktype.getWorktypeId()); |
| | | w.setType(Constants.ONE); |
| | | solutionWorktypeJoinMapper.insert(w); |
| | | |
| | | //历史版本的工种信息 |
| | | SolutionWorktype newType = new SolutionWorktype(); |
| | | BeanUtils.copyProperties(w, newType); |
| | | newType.setSolutionId(newModel.getId()); |
| | | solutionWorktypeJoinMapper.insert(newType); |
| | | } |
| | | |
| | | solutionsMapper.update(null,new UpdateWrapper<Solutions>().lambda().set(Solutions::getParentId,solutionsBase.getId()) |
| | | .and(i->i.eq(Solutions::getId,solutions.getId()).or().eq(Solutions::getBaseId,solutions.getId())) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | solutionsMapper.deleteById(id); |
| | | //查询是否已存在使用中的保单 |
| | | if(insuranceApplyMapper.selectCount(new QueryWrapper<InsuranceApply>().lambda() |
| | | .apply(" solution_id in ( select id from solutions where BASE_ID = "+id+" or id = "+id+" )" ) |
| | | .notIn(InsuranceApply::getStatus |
| | | ,Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.CLOSE.getKey() |
| | | ,Constants.InsuranceApplyStatus.WTB_CLOSED.getKey() |
| | | ) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在已投保的保单数据,无法进行删除"); |
| | | }; |
| | | solutionsMapper.update(null,new UpdateWrapper<Solutions>() |
| | | .lambda() |
| | | .set(Solutions::getIsdeleted,Constants.ONE) |
| | | .and(i->i.eq(Solutions::getId,id).or().eq(Solutions::getBaseId,id)) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | |
| | | applyDetail.setEndTime(unionApplyBXDDTO.getEndTime()); |
| | | |
| | | |
| | | |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(applyDetail,user.getId()); |
| | | memberInsurance.setBdCode(unionApplyBXDDTO.getCode()); |
| | | memberInsurance.setRelationType(Constants.ZERO); |
| | |
| | | ,unionApply.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(unionApply)); |
| | | applyLogMapper.insert(log); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.eq(UnionChange::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getSolutionsName() != null) { |
| | | queryWrapper.eq(Solutions::getName, pageWrap.getModel().getSolutionsName()); |
| | | } |
| | | |
| | | if (pageWrap.getModel().getQueryStartTime() != null) { |
| | | queryWrapper.ge(UnionChange::getCreateDate, pageWrap.getModel().getQueryStartTime() +" 00:00:00" ); |
| | |
| | | if(!(Constants.equalsInteger(user.getType(),Constants.ZERO) || Constants.equalsInteger(user.getType(),Constants.TWO))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非商户平台用户,无法进行该操作"); |
| | | } |
| | | if(saveUnionChangeDTO.getBusinessType().equals(Constants.ZERO)||Objects.isNull(saveUnionChangeDTO.getApplyDate())){ |
| | | //2024年5月9日14:59:24 修改 默认入当前天 |
| | | saveUnionChangeDTO.setApplyDate(DateUtil.getMontageDate(new Date(),1)); |
| | | } |
| | | // if(saveUnionChangeDTO.getBusinessType().equals(Constants.ZERO)||Objects.isNull(saveUnionChangeDTO.getApplyDate())){ |
| | | // //2024年5月9日14:59:24 修改 默认入当前天 |
| | | // saveUnionChangeDTO.setApplyDate(DateUtil.getMontageDate(new Date(),1)); |
| | | // } |
| | | if(Objects.isNull(saveUnionChangeDTO) |
| | | || Objects.isNull(saveUnionChangeDTO.getApplyIds()) |
| | | || Objects.isNull(saveUnionChangeDTO.getApplyDate()) |
| | |
| | | String companyName = ""; |
| | | String creditCode = ""; |
| | | String email = ""; |
| | | String signId = ""; |
| | | if(Constants.equalsInteger(user.getType(),Constants.TWO)){ |
| | | if(!unionChange.getShopId().equals(user.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起非您的合并单,您无法进行操作!"); |
| | |
| | | companyName = company.getName(); |
| | | creditCode = company.getCode(); |
| | | email = company.getEmail(); |
| | | signId = company.getSignId(); |
| | | }else{ |
| | | companyName = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PLAT_COMPANY_NAME).getCode(); |
| | | creditCode = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PLAT_CREDIT_CODE).getCode(); |
| | |
| | | |
| | | |
| | | String fileUrl = null; |
| | | // if(Constants.equalsObject(unionChange.getType(), Constants.ONE)){ |
| | | // fileUrl = ExcelExporter.build(UnionChange.class).exportUnionChangeOtherUnitExcelToPdf(unionChange,"换厂申请表"); |
| | | // }else{ |
| | | // fileUrl = ExcelExporter.build(UnionChange.class).exportUnionChangeExcelToPdf(unionChange,"加减保申请表"); |
| | | // } |
| | | if(Constants.equalsObject(unionChange.getType(), Constants.ONE)){ |
| | | fileUrl = ExcelExporter.build(UnionChange.class).exportUnionChangeOtherUnitExcelToPdf(unionChange,"换厂申请表"); |
| | | }else{ |
| | | fileUrl = ExcelExporter.build(UnionChange.class).exportUnionChangeExcelToPdf(unionChange,"加减保申请表"); |
| | | } |
| | | String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode(); |
| | | notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",unionChange.getId().toString()); |
| | | // String applyNo = signService.applySignLocalFile(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"合并单(加减保/换厂)申请签署",company.getSignId(),notifyUrl); |
| | | String applyNo = signService.applySignLocalFileByParam(companyName,companyName,fileUrl,creditCode,email,"合并单(加减保/换厂)申请签署",null,notifyUrl,new Float(0.7)); |
| | | //临时使用 |
| | | fileUrl = "https://yybred.oss-cn-hangzhou.aliyuncs.com/apply/20241230/a0d128f2-ba6c-4ad4-b86b-b2610a513d41.pdf"; |
| | | String applyNo = signService.applySignWidthQifengSet(companyName,fileUrl,companyName,creditCode,email,"人员名单签章",null,notifyUrl,new Float(0.7)); |
| | | // fileUrl = "https://yybred.oss-cn-hangzhou.aliyuncs.com/apply/20241230/a0d128f2-ba6c-4ad4-b86b-b2610a513d41.pdf"; |
| | | // String applyNo = signService.applySignWidthQifengSet(companyName,fileUrl,companyName,creditCode,email,"人员名单签章",null,notifyUrl,new Float(0.7)); |
| | | if(StringUtils.isBlank(applyNo) ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | |
| | | BigDecimal reduceFee = BigDecimal.ZERO; |
| | | |
| | | //如果批单日期 大于 员工保单的开始日期 |
| | | if(applyChange.getDelValidTime().getTime() > oldModel.getStartTime().getTime()){ |
| | | if(reduceDate.getTime()>oldModel.getStartTime().getTime()){ |
| | | reduceDate = DateUtil.getMontageDate(oldModel.getStartTime(), 3); |
| | | }else{ |
| | | reduceDate = DateUtil.getMontageDate(applyChange.getDelValidTime(), 3); |
| | | } |
| | | //减保记录操作后的总费用 |
| | | reduceFee = Constants.reduceFee( |
| | | solutions,fee,insuranceApply.getStartTime(),insuranceApply.getFinalEndTime(),oldModel.getStartTime(),reduceDate) ; |
| | | if(reduceDate.getTime() > oldModel.getStartTime().getTime()){ |
| | | reduceDate = DateUtil.getMontageDate(applyChange.getDelValidTime(), 3); |
| | | // if(reduceDate.getTime()<oldModel.getStartTime().getTime()){ |
| | | // reduceDate = DateUtil.getMontageDate(oldModel.getStartTime(), 3); |
| | | // }else{ |
| | | // reduceDate = DateUtil.getMontageDate(applyChange.getDelValidTime(), 3); |
| | | // } |
| | | }else{ |
| | | reduceDate = DateUtil.getMontageDate(oldModel.getStartTime(), 3); |
| | | } |
| | | |
| | | //减保记录操作后的总费用 |
| | | reduceFee = Constants.reduceFee( |
| | | solutions,fee,insuranceApply.getStartTime(),insuranceApply.getFinalEndTime(),oldModel.getStartTime(),reduceDate) ; |
| | | |
| | | BigDecimal pullFee = BigDecimal.ZERO; |
| | | if (oldModel.getStartTime().getTime() < System.currentTimeMillis()) { |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 发起签约 |
| | | * @param name |
| | | * @param file |
| | | * @param creditCoe |
| | | * @param email |
| | | * @param postionJson |
| | | */ |
| | | public String applySignLocalFileByParam(String name,String fullname,String file,String creditCoe,String email,String postionJson,String singId,String notifyUrl,Float qifengSet){ |
| | | try { initParams(); |
| | | String url=SERVICE_URL+"/v2/sign/applySign"; |
| | | Map<String, Object> params=bodyParams; |
| | | params.put("contractName",name); //合同名称 |
| | | params.put("serverCa",1); //使用云证书 |
| | | params.put("file",new File(file)); |
| | | params.put("dealType",5); //指定合同文件签署方式 5 为部分自动签 |
| | | params.put("positionType",0); //指定通过表单域方式设置签字位置 |
| | | params.put("fileType",0); |
| | | params.put("needQifengSign",1); |
| | | params.put("notifyUrl",notifyUrl); |
| | | JSONArray signatories=new JSONArray(); |
| | | SignatoryReq sReq=new SignatoryReq(); |
| | | sReq.setFullName(fullname); //企业姓名 |
| | | sReq.setIdentityType(11); //证件类型 |
| | | sReq.setIdentityCard(creditCoe);//营业执照号 |
| | | sReq.setEmail(email); //在君子签注册认证的邮箱 |
| | | // sReq.setChapteJson("[{\"page\":0,\"chaptes\":[{\"offsetX\":0.12,\"offsetY\":0.23}]},{\"page\":1,\"chaptes\":[{\"offsetX\":0.45,\"offsetY\":0.67}]}]"); |
| | | // sReq.setChapteJson(postionJson); |
| | | // sReq.setSearchKey(postionJson); |
| | | sReq.setSignId(singId); |
| | | sReq.setQiFengOffset(qifengSet); |
| | | sReq.setSearchConvertExtend("{\"fixX\":-80,\"fixY\":-80}"); |
| | | sReq.setNoNeedVerify(1); |
| | | signatories.add(sReq); |
| | | params.put("signatories",signatories.toJSONString()); |
| | | System.out.println(signatories.toJSONString()); |
| | | String str= HttpClientUtils.init().getPost(url,null,params,true); |
| | | System.out.println(str); |
| | | saveInterfaceLog(url,"【电子签】发起签约",JSONObject.toJSONString(params),str); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | if(json!=null && json.getBoolean("success")){ |
| | | return json.getString("data"); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取签署链接地址(签署页面地址) |