| | |
| | | import com.doumee.dao.business.dto.CountCyclePriceDTO; |
| | | import com.doumee.dao.business.dto.InsuranceApplyOptDTO; |
| | | import com.doumee.dao.business.dto.InsuranceApplyQueryDTO; |
| | | import com.doumee.dao.business.dto.SmsCheckDTO; |
| | | import com.doumee.dao.business.join.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CountCyclePriceVO; |
| | |
| | | InsuranceApply update = new InsuranceApply(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(model.getCreator()); |
| | | update.setStatus(Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey()); |
| | | update.setStatus(Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("企业完成签署方案确认书"); |
| | | update.setCheckUserId(model.getCreator()); |
| | |
| | | f.setInfo("企业完成签署方案确认书"); |
| | | f.setName("方案确认书.pdf"); |
| | | multifileMapper.insert(f); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.WTB_FINISH_FAQRS; |
| | | ApplyLog log = new ApplyLog(update,applyLogType.getName(), null |
| | | ,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | applyLogMapper.insert(log); |
| | | return f; |
| | | } |
| | | |
| | | /** |
| | | * 委托保 企业签署投保申请书 |
| | | * @param model |
| | | * @param fileurl |
| | | * @param fullUrl |
| | | * @return |
| | | */ |
| | | public Multifile uploadTBSQSSignedFileDo(InsuranceApply model,String fileurl,String fullUrl) { |
| | | InsuranceApply update = new InsuranceApply(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(model.getCreator()); |
| | | update.setUnionApplyTbdStatus(Constants.TWO); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("委托保企业完成签署投保申请书"); |
| | | update.setCheckUserId(model.getCreator()); |
| | | update.setId(model.getId()); |
| | | insuranceApplyMapper.updateById(update); |
| | | |
| | | Multifile f = new Multifile(); |
| | | f.setIsdeleted(Constants.ZERO); |
| | | f.setCreator(model.getCreator()); |
| | | f.setObjId(update.getId()); |
| | | f.setCreateDate(update.getEditDate()); |
| | | f.setObjType(Constants.MultiFile.COMPANY_TBD_SIGNED_PDF.getKey()); |
| | | f.setType(Constants.TWO); |
| | | f.setFileurl(fileurl); |
| | | f.setFileurlFull(fullUrl); |
| | | f.setInfo("委托保企业完成签署投保申请书"); |
| | | f.setName("投保申请书.pdf"); |
| | | multifileMapper.insert(f); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.SIGNATURE; |
| | | ApplyLog log = new ApplyLog(update,applyLogType.getName(), null |
| | | ,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | applyLogMapper.insert(log); |
| | | return f; |
| | | } |
| | | |
| | |
| | | InsuranceApply update = new InsuranceApply(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(model.getCreator()); |
| | | update.setStatus(Constants.InsuranceApplyStatus.COMPANY_MEMBER_LIST_SIGNATURE.getKey()); |
| | | update.setStatus(Constants.InsuranceApplyStatus.WTB_COMPANY_MEMBER_LIST_SIGNATURE.getKey()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("企业完成签署人员名单"); |
| | | update.setCheckUserId(model.getCreator()); |
| | |
| | | f.setInfo("企业完成签署人员名单"); |
| | | f.setName("人员名单.pdf"); |
| | | multifileMapper.insert(f); |
| | | |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.WTB_FINISH_MEMBER_LIST; |
| | | ApplyLog log = new ApplyLog(update,applyLogType.getName(), null |
| | | ,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | applyLogMapper.insert(log); |
| | | return f; |
| | | } |
| | | |
| | |
| | | f.setInfo("企业申请表签署文件"); |
| | | f.setName("签章申请表.pdf"); |
| | | multifileMapper.insert(f); |
| | | |
| | | Constants.ApplyLogType applyLogType =Constants.equalsInteger(Constants.ZERO,model.getType())? Constants.ApplyLogType.CA_JIAJIAN_APPLY_SIGN: Constants.ApplyLogType.CA_CHANGUNIT_APPLY_SIGN; |
| | | ApplyLog log = new ApplyLog(update,applyLogType.getName(), null,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | applyLogMapper.insert(log); |
| | |
| | | f.setInfo("企业完成签署人员名单"); |
| | | f.setName("签章人员名单.pdf"); |
| | | multifileMapper.insert(f); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_WTB_FINISH_MEMBER_LIST; |
| | | ApplyLog log = new ApplyLog(update,applyLogType.getName(), null,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | applyLogMapper.insert(log); |
| | | |
| | | return f; |
| | | } |
| | |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //如果下载失败,清除合同,下次签章重新生成新合同 |
| | | return; |
| | | continue; |
| | | } |
| | | uploadSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | // return; |
| | | } |
| | | } |
| | | //委托保 企业签署投保确认书 |
| | |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD.getKey()) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey()) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .isNotNull(InsuranceApply::getSignQrsNo)); |
| | | if(applyList !=null && applyList.size()>0 ){ |
| | |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //如果下载失败,清除合同,下次签章重新生成新合同 |
| | | return; |
| | | continue; |
| | | } |
| | | uploadFAQRSSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | // return; |
| | | } |
| | | } |
| | | |
| | |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey()) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey()) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .isNotNull(InsuranceApply::getSignMemberListNo)); |
| | | if(applyList !=null && applyList.size()>0 ){ |
| | |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //如果下载失败,清除合同,下次签章重新生成新合同 |
| | | return; |
| | | continue; |
| | | } |
| | | uploadApplyMemberListSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | // return; |
| | | } |
| | | } |
| | | |
| | | //委托保企业签署投保申请单 |
| | | applyList = insuranceApplyJoinMapper.selectJoinList(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getEmail,InsuranceApply::getSolutionEmail) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getUnionApplyTbdStatus,Constants.ONE) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .isNotNull(InsuranceApply::getApplyTbdNo)); |
| | | |
| | | if(applyList !=null && applyList.size()>0 ){ |
| | | for(InsuranceApply model : applyList){ |
| | | String status = signService.linkFileStatus(model.getApplyTbdNo()); |
| | | if(!StringUtils.equals(status,"3")){ |
| | | continue; |
| | | } |
| | | String link = signService.linkFile(model.getApplyTbdNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //如果下载失败,清除合同,下次签章重新生成新合同 |
| | | continue; |
| | | } |
| | | uploadTBSQSSignedFileDo(model,fileUrl,path+fileUrl); |
| | | // return; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | List<ApplyChange> chagneList = applyChangeMapper.selectJoinList(ApplyChange.class, |
| | | new MPJLambdaWrapper<ApplyChange>() |
| | |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //如果下载失败,清除合同,下次签章重新生成新合同 |
| | | return; |
| | | continue; |
| | | } |
| | | uploadChangeSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | // return; |
| | | } |
| | | } |
| | | |
| | |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //如果下载失败,清除合同,下次签章重新生成新合同 |
| | | return; |
| | | continue; |
| | | } |
| | | uploadChangeMemberListSignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | // return; |
| | | } |
| | | } |
| | | |
| | |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //如果下载失败,清除合同,下次签章重新生成新合同 |
| | | return; |
| | | continue; |
| | | } |
| | | uploadUnionApplySignedFileDo(model,fileUrl,path+fileUrl); |
| | | return; |
| | | // return; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | @Override |
| | |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .eq(InsuranceApply::getSignQrsNo,data.getApplyNo()) |
| | | .last("limit 1" )); |
| | | if(modelTBQRS != null && Constants.equalsInteger(modelTBQRS.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){ |
| | | if(modelTBQRS != null && Constants.equalsInteger(modelTBQRS.getStatus(),Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey())){ |
| | | //完成签署已完成操作 |
| | | String link = signService.linkFile(data.getApplyNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | |
| | | uploadFAQRSSignedFileDo(modelTBQRS,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | //委托保 企业签署人员名单 |
| | | InsuranceApply modelMemberList = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .eq(InsuranceApply::getSignMemberListNo,data.getApplyNo()) |
| | | .last("limit 1" )); |
| | | if(modelMemberList != null && Constants.equalsInteger(modelMemberList.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey())){ |
| | | if(modelMemberList != null && Constants.equalsInteger(modelMemberList.getStatus(),Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey())){ |
| | | //完成签署已完成操作 |
| | | String link = signService.linkFile(data.getApplyNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | |
| | | return; |
| | | } |
| | | uploadApplyMemberListSignedFileDo(modelMemberList,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | |
| | | |
| | | //委托保 投保申请书签署 |
| | | InsuranceApply modelTBQSQ = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class, |
| | | new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getEmail,InsuranceApply::getSolutionEmail) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(Solutions::getType,Constants.ONE) |
| | | .eq(InsuranceApply::getApplyTbdNo,data.getApplyNo()) |
| | | .last("limit 1" )); |
| | | if(modelTBQRS != null && Constants.equalsInteger(modelTBQSQ.getUnionApplyTbdStatus(),Constants.ONE)){ |
| | | //完成签署已完成操作 |
| | | String link = signService.linkFile(data.getApplyNo()); |
| | | String fileUrl = uploadSignFile(link); |
| | | if(StringUtils.isBlank(fileUrl)){ |
| | | //如果下载失败,清除合同,下次签章重新生成新合同 |
| | | return; |
| | | } |
| | | uploadTBSQSSignedFileDo(modelTBQSQ,fileUrl,path+fileUrl); |
| | | return; |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public Integer check(InsuranceApply insuranceApply) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(insuranceApply.getId() == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | |
| | | Solutions solutions = solutionsMapper.selectById(model.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息"); |
| | | } |
| | | if(solutions.getType().equals(Constants.ZERO)){ |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | }else{ |
| | | if(!user.getType().equals(Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非商户端无法进行该操作"); |
| | | } |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_RETURN.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | } |
| | | |
| | | Constants.ApplyLogType applyLogType = null; |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | InsuranceApply update = new InsuranceApply(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(user.getId()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo(insuranceApply.getCheckInfo()); |
| | | update.setCheckUserId(user.getId()); |
| | | update.setId(model.getId()); |
| | | Constants.NoticeType noticeType = Constants.NoticeType.ONE; |
| | | update.setId(model.getId()); |
| | | if(insuranceApply.getDealBackApply() ==1){ |
| | | //如果是不通过 |
| | | applyLogType = Constants.ApplyLogType.PLATFORM_RETURN ; |
| | | update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey()); |
| | | |
| | | noticeType = Constants.NoticeType.FOUR; |
| | | }else{ |
| | | applyLogType = Constants.ApplyLogType.PLATFORM_CHECK_PASS; |
| | | update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()); |
| | |
| | | //删除其他待办 |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()) |
| | | .ne(Notices::getType,Constants.NoticeType.SIX.getStatus()) |
| | | .eq(Notices::getObjId,model.getId())); |
| | | // Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),solutions.getName(),model.getCompanyId(),noticeType); |
| | | // noticesMapper.insert(notices); |
| | | |
| | | .eq(Notices::getObjId,model.getId())); |
| | | String info =applyLogType.getInfo(); |
| | | if(StringUtils.isNotBlank(update.getCheckInfo())){ |
| | | info = info.replace("${param}", update.getCheckInfo()); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"员工信息存在重复信息"); |
| | | } |
| | | Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.UPLOAD; |
| | | if(solutions.getType().equals(Constants.ONE)){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.WTB_UPLOAD; |
| | | } |
| | | insuranceApply.setCreateDate(new Date()); |
| | | insuranceApply.setCreator(loginUserInfo.getId()); |
| | | insuranceApply.setEditor(loginUserInfo.getId()); |
| | |
| | | QueryWrapper<InsuranceApply> wrapper = new QueryWrapper<>(insuranceApply); |
| | | return insuranceApplyMapper.selectList(wrapper); |
| | | } |
| | | |
| | | public List<Integer> getCollectStatus(Integer collectStatus){ |
| | | if(collectStatus ==null){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<Integer> statusList = Constants.InsuranceApplyStatus.getKesByStatus(collectStatus); |
| | | if(collectStatus.equals(Constants.ApplyCollectStatus.DCD)){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDCD.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.DSP)){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDSH.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.BZZ)){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBBZZ.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.YTH)){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBYTH.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.YGB)){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBYGB.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.DQYQZ)){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDQS.getKey())); |
| | | } |
| | | |
| | | return statusList; |
| | | } |
| | | |
| | | @Override |
| | | public PageData<InsuranceApply> findPage(PageWrap<InsuranceApplyQueryDTO> pageWrap) { |
| | | IPage<InsuranceApply> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<InsuranceApply> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | List<Integer> statusList = Constants.InsuranceApplyStatus.getKesByStatus(pageWrap.getModel().getStatusCollect()); |
| | | |
| | | List<Integer> statusList = this.getCollectStatus(pageWrap.getModel().getStatusCollect()); |
| | | |
| | | queryWrapper.selectAll(InsuranceApply.class); |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | |
| | | |
| | | private void initImgData(InsuranceApply model) { |
| | | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,Constants.equalsInteger(model.getSolutionType(),Constants.ZERO)? model.getId():model.getUnionApplyId()) |
| | | .eq(Multifile::getObjId, model.getId()) |
| | | .in(Multifile::getObjType,Arrays.asList(new Integer[]{Constants.MultiFile.BD_APPLY_PDF.getKey() |
| | | ,Constants.MultiFile.BD_SIGNED_PDF.getKey() |
| | | ,Constants.MultiFile.WTB_CONFIRMATION_LATTER.getKey() |
| | | ,Constants.MultiFile.MEMBER_LIST_LATTER.getKey() |
| | | ,Constants.MultiFile.BD_DONE_PDF.getKey()})) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO)); |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .orderByAsc(Multifile::getId)); |
| | | if(multifiles!=null){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode(); |
| | |
| | | }else if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.BD_DONE_PDF.getKey())){ |
| | | //最終保险单 |
| | | model.setBaoxiandanFile(f); |
| | | }else if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.MEMBER_LIST_LATTER.getKey())){ |
| | | //申请单 |
| | | model.setShenqingdanFile(f); |
| | | }else if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.WTB_CONFIRMATION_LATTER.getKey())){ |
| | | //签署后确认书 |
| | | model.setFanganFile(f); |
| | | } |
| | | |
| | | // if(model.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){ |
| | |
| | | |
| | | /** |
| | | * 委托宝 投保确认书 |
| | | * @param id |
| | | * @param smsCheckDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String getSignTBQRSLink(Integer id) { |
| | | if(id == null ){ |
| | | public String getSignTBQRSLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | MPJLambdaWrapper wrapper= new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getSignKeyword,InsuranceApply::getSignKeyword) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(InsuranceApply::getId,id) |
| | | .eq(InsuranceApply::getId,smsCheckDTO.getBusinessId()) |
| | | .last("limit 1"); |
| | | |
| | | InsuranceApply model = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,wrapper); |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息"); |
| | | } |
| | | if(solutions.getType().equals(Constants.ZERO)){ |
| | | if(Constants.equalsInteger(solutions.getType(),(Constants.ZERO))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,非委托保方案保单!"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Constants.ApplyLogType applyLogType = null; |
| | | String info = ""; |
| | | //如果是驳回,只能可驳回已签章状态下的退回申请状态进行操作 |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){ |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | Company company = user.getCompany(); |
| | |
| | | return link; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public InsuranceApply queryApplyDetail(Integer applyId){ |
| | | InsuranceApply model = findDetail(applyId); |
| | |
| | | * 人员名单签章 |
| | | */ |
| | | @Override |
| | | public String getMemberListOnlineSignLink(Integer applyId) { |
| | | InsuranceApply model = this.queryApplyDetail(applyId); |
| | | public String getMemberListOnlineSignLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //验证 验证码 |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | InsuranceApply model = this.queryApplyDetail(smsCheckDTO.getBusinessId()); |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询保单信息"); |
| | | } |
| | | if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getIsdeleted())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(Constants.ZERO,model.getStatus())){ |
| | | if(!Constants.equalsInteger(Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey(),model.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,该申请状态已流转,当前不支持签章操作!"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 委托保 投保申请签署 |
| | | * @param smsCheckDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String getSignWTBTBDLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //验证 验证码 |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | MPJLambdaWrapper wrapper= new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getSignKeyword,InsuranceApply::getSignKeyword) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(InsuranceApply::getId,smsCheckDTO.getBusinessId()) |
| | | .last("limit 1"); |
| | | |
| | | InsuranceApply model = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,wrapper); |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Solutions solutions = solutionsMapper.selectById(model.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息"); |
| | | } |
| | | if(solutions.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,非委托保方案保单!"); |
| | | } |
| | | if(!model.getUnionApplyTbdStatus().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,商户未上传或已签署"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Constants.ApplyLogType applyLogType = null; |
| | | String info = ""; |
| | | //如果是驳回,只能可驳回已签章状态下的退回申请状态进行操作 |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | Company company = user.getCompany(); |
| | | if(debugModel){ |
| | | company = companyMapper.selectById(model.getCompanyId()); |
| | | } |
| | | if(company== null || StringUtils.isBlank( company.getEmail()) || !Constants.equalsInteger(company.getSignStatus(),Constants.THREE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,企业尚未具备在线签章条件,请联系平台管理员确认~"); |
| | | } |
| | | Multifile f = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,model.getId()) |
| | | .eq(Multifile::getObjType,Constants.MultiFile.COMPANY_TBD_SIGNED.getKey()) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO).last("limit 1")); |
| | | if(f == null || StringUtils.isBlank(f.getFileurl())){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,获取确认书文件失败,请联系商户确认投保申请书是否正确!"); |
| | | } |
| | | String url = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode()+f.getFileurl(); |
| | | 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.applySign(company.getName(),url,company.getName(),company.getCode(),company.getEmail(),model.getSignKeyword(),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(),"对不起,获取在线签章地址失败,请稍后重试!"); |
| | | } |
| | | InsuranceApply update= new InsuranceApply(); |
| | | update.setId(model.getId()); |
| | | update.setEditor(user.getId()); |
| | | update.setEditDate(new Date()); |
| | | update.setApplyTbdNo(applyNo); |
| | | insuranceApplyMapper.updateById(update); |
| | | return link; |
| | | } |
| | | |
| | | } |