| | |
| | | private UnionApplyJoinMapper unionApplyJoinMapper; |
| | | @Autowired |
| | | private UnionChangeJoinMapper unionChangeJoinMapper; |
| | | @Autowired |
| | | private CompanySolutionMapper companySolutionMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | |
| | | update.setStatus(Constants.InsuranceApplyStatus.FAIL_RETURN.getKey()); |
| | | }else{ |
| | | if( !(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_COMPANY_MEMBER_LIST_SIGNATURE.getKey()) |
| | | || Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey()))){ |
| | | || Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey()) |
| | | || Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | | update.setStatus(Constants.InsuranceApplyStatus.WTB_RETURN.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.ZERO,model.getId(),model.getSolutionsName(),model.getCompanyId(),Constants.NoticeType.TWO); |
| | | noticesMapper.insert(notices); |
| | | Solutions solutions = solutionsMapper.selectById(model.getSolutionId()); |
| | | if(Objects.nonNull(solutions)&&Objects.nonNull(solutions.getShopId())){ |
| | | Notices shopNotices = new Notices(noticeObjectType,Constants.TWO,model.getId(),model.getSolutionsName(),solutions.getShopId(),Constants.NoticeType.TWO); |
| | | |
| | | CompanySolution companySolution = companySolutionMapper.selectOne(new QueryWrapper<CompanySolution>().lambda() |
| | | .eq(CompanySolution::getIsdeleted,Constants.ZERO) |
| | | .eq(CompanySolution::getSolutionId,model.getSolutionId()) |
| | | .eq(CompanySolution::getCompanyId,model.getCompanyId()) |
| | | .last("limit 1") |
| | | ); |
| | | //商户待办 |
| | | if(Objects.nonNull(companySolution)&&Objects.nonNull(companySolution.getShopId())){ |
| | | Notices shopNotices = new Notices(noticeObjectType,Constants.TWO, |
| | | model.getId(),model.getSolutionsName(),companySolution.getShopId(),Constants.NoticeType.ZERO); |
| | | noticesMapper.insert(shopNotices); |
| | | } |
| | | |
| | | |
| | | |
| | | Multifile f = new Multifile(); |
| | | f.setIsdeleted(Constants.ZERO); |
| | |
| | | f.setType(Constants.TWO); |
| | | f.setFileurl(fileurl); |
| | | f.setFileurlFull(fullUrl); |
| | | f.setInfo("委托加减保/换厂业务 -投保单"); |
| | | f.setName("委托加减保/换厂业务 -投保单.pdf"); |
| | | f.setInfo("投保申请单 -申请单"); |
| | | f.setName("投保申请单.pdf"); |
| | | multifileMapper.insert(f); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_SIGNATURE_TBD; |
| | |
| | | applyLogType = Constants.ApplyLogType.PLATFORM_CHECK_PASS; |
| | | if(Constants.equalsObject(solutions.getType(),Constants.ONE)){ |
| | | update.setStatus(Constants.InsuranceApplyStatus.WTB_BUSINESS_CHECK_PASS.getKey()); |
| | | }else{ |
| | | update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()); |
| | | } |
| | | } |
| | | insuranceApplyMapper.updateById(update); |
| | |
| | | if(!(solutions.getIsdeleted().equals(Constants.ZERO)||solutions.getStatus().equals(Constants.ZERO))){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"方案信息已被禁用"); |
| | | } |
| | | if(solutions.getValidType().equals(Constants.ZERO)){ |
| | | if(DateUtil.getMontageDate( |
| | | DateUtil.addDaysToDate(new Date(),solutions.getValidType()),0).getTime()>insuranceApply.getApplyStartTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"保单生效起期错误"); |
| | | } |
| | | }else{ |
| | | if(DateUtil.getNextMonthFirst(new Date()).getTime()>insuranceApply.getApplyStartTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"保单生效起期错误"); |
| | | } |
| | | } |
| | | |
| | | List<ApplyDetail> applyDetailList = insuranceApply.getApplyDetailList(); |
| | | //判断是否存在重复信息 |
| | | List<String> idCardList = applyDetailList.stream().map(i->i.getIdcardNo()).collect(Collectors.toList()); |
| | |
| | | //存储平台待办 |
| | | Notices notices = new Notices(noticeObjectType,Constants.ZERO,insuranceApply.getId(),solutions.getName(),insuranceApply.getCompanyId(),Constants.NoticeType.ZERO); |
| | | noticesMapper.insert(notices); |
| | | CompanySolution companySolution = companySolutionMapper.selectOne(new QueryWrapper<CompanySolution>().lambda() |
| | | .eq(CompanySolution::getIsdeleted,Constants.ZERO) |
| | | .eq(CompanySolution::getSolutionId,solutions.getId()) |
| | | .eq(CompanySolution::getCompanyId,insuranceApply.getCompanyId()) |
| | | .last("limit 1") |
| | | ); |
| | | //商户待办 |
| | | if(Objects.nonNull(solutions.getShopId())){ |
| | | if(Objects.nonNull(companySolution)&&Objects.nonNull(companySolution.getShopId())){ |
| | | Notices shopNotices = new Notices(noticeObjectType,Constants.TWO, |
| | | insuranceApply.getId(),solutions.getName(),solutions.getShopId(),Constants.NoticeType.ZERO); |
| | | insuranceApply.getId(),solutions.getName(),companySolution.getShopId(),Constants.NoticeType.ZERO); |
| | | noticesMapper.insert(shopNotices); |
| | | } |
| | | } |
| | |
| | | return new ArrayList<>(); |
| | | } |
| | | List<Integer> statusList = Constants.InsuranceApplyStatus.getKesByStatus(collectStatus); |
| | | if(collectStatus.equals(Constants.ApplyCollectStatus.DCD)){ |
| | | if(collectStatus.equals(Constants.ApplyCollectStatus.DCD.getKey())){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDCD.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.DSP)){ |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.DSP.getKey())){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDSH.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.BZZ)){ |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.BZZ.getKey())){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBBZZ.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.YTH)){ |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.YTH.getKey())){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBYTH.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.YGB)){ |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.YGB.getKey())){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBYGB.getKey())); |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.DQYQZ)){ |
| | | }else if(collectStatus.equals(Constants.ApplyCollectStatus.DQYQZ.getKey())){ |
| | | statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDQS.getKey())); |
| | | } |
| | | |
| | |
| | | queryWrapper.eq(pageWrap.getModel().getBaseSolutionId()!=null,Solutions::getBaseId,pageWrap.getModel().getBaseSolutionId()); |
| | | queryWrapper.in(statusList.size()>0,InsuranceApply::getStatus,statusList); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getSolutionName()),Solutions::getName,pageWrap.getModel().getSolutionName()); |
| | | if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.THREE) ){ |
| | | queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()); |
| | | if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.ApplyCollectStatus.YGQ.getKey()) ){ |
| | | //如果是已過期 |
| | | // queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()); |
| | | queryWrapper.lt(InsuranceApply::getEndTime, Utils.Date.getStart(new Date())); |
| | | }else if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.ApplyCollectStatus.BZZ.getKey()) ){ |
| | | //如果是保障中 |
| | | // queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()); |
| | | queryWrapper.gt(InsuranceApply::getEndTime, Utils.Date.getStart(new Date())); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | |
| | | MPJLambdaWrapper wrapper= new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getType,InsuranceApply::getSolutionType) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | |
| | | if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey()))){ |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey())) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey()) |
| | | || insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey()) |
| | | || insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_COMPANY_MEMBER_LIST_SIGNATURE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态非可申请退回!"); |
| | | } |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey())){ |
| | |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_PASS; |
| | | } |
| | | |
| | | else if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey()) |
| | | || insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey()) |
| | | || insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_COMPANY_MEMBER_LIST_SIGNATURE.getKey())){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.WTB_RETURN; |
| | | } |
| | | |
| | | //存储待办信息 |
| | | //删除其他待办 |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()) |
| | | .ne(Notices::getType,Constants.NoticeType.SIX.getStatus()) |
| | | .eq(Notices::getObjId,insuranceApply.getId())); |
| | | Notices notices = new Notices(noticeObjectType,Constants.ZERO,insuranceApply.getId(),solutions.getName(), |
| | | insuranceApply.getCompanyId(), Constants.NoticeType.THREE); |
| | | noticesMapper.insert(notices); |
| | | //商户待办 |
| | | if(Objects.nonNull(solutions.getShopId())){ |
| | | Notices shopNotices = new Notices(noticeObjectType,Constants.TWO, |
| | | insuranceApply.getId(),solutions.getName(),solutions.getShopId(),Constants.NoticeType.THREE); |
| | | noticesMapper.insert(shopNotices); |
| | | if(!loginUserInfo.getCompanyId().equals(insuranceApply.getCompanyId())){ |
| | | Notices notices = new Notices(noticeObjectType,Constants.ZERO,insuranceApply.getId(),solutions.getName(), |
| | | insuranceApply.getCompanyId(), Constants.NoticeType.THREE); |
| | | noticesMapper.insert(notices); |
| | | } |
| | | |
| | | |
| | | // CompanySolution companySolution = companySolutionMapper.selectOne(new QueryWrapper<CompanySolution>().lambda() |
| | | // .eq(CompanySolution::getIsdeleted,Constants.ZERO) |
| | | // .eq(CompanySolution::getSolutionId,solutions.getId()) |
| | | // .eq(CompanySolution::getCompanyId,insuranceApply.getCompanyId()) |
| | | // .last("limit 1") |
| | | // ); |
| | | // //商户待办 |
| | | // if(Objects.nonNull(companySolution)&&Objects.nonNull(companySolution.getShopId())){ |
| | | // Notices shopNotices = new Notices(noticeObjectType,Constants.TWO, |
| | | // insuranceApply.getId(),solutions.getName(),companySolution.getShopId(),Constants.NoticeType.THREE); |
| | | // noticesMapper.insert(shopNotices); |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }else if(insuranceApplyOptDTO.getOptType().equals(Constants.TWO)){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.CLOSE; |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.CLOSE.getKey())){ |
| | |
| | | MPJLambdaWrapper<ApplyDetail> lambdaWrapper = new MPJLambdaWrapper<ApplyDetail>(); |
| | | lambdaWrapper.select(ApplyDetail::getId) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId) |
| | | .and(i->i.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()).or().eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey())) |
| | | .and(i->i.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | .or().eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey())) |
| | | .eq(InsuranceApply::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .apply(" now() between t.START_TIME and t.END_TIME "); |
| | | |