| | |
| | | //如果是驳回,只能可驳回已签章状态下的退回申请状态进行操作 |
| | | if(!(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE.getKey())|| |
| | | Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE.getKey())|| |
| | | Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey())) |
| | | Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey())|| |
| | | Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_PASS.getKey())) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | |
| | | update.setStatus(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()); |
| | | }else if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey())){ |
| | | update.setStatus(Constants.InsuranceApplyStatus.UPLOAD.getKey()); |
| | | }else if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_PASS.getKey())){ |
| | | update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()); |
| | | } |
| | | }else{ |
| | | //如果是同意,两种申请退回状态都可操作 |
| | |
| | | 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); |
| | | // Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),solutions.getName(),model.getCompanyId(),noticeType); |
| | | // noticesMapper.insert(notices); |
| | | |
| | | String info =applyLogType.getInfo(); |
| | | if(StringUtils.isNotBlank(update.getCheckInfo())){ |
| | |
| | | queryWrapper.selectAll(InsuranceApply.class); |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | | queryWrapper.selectAs(Solutions::getType,InsuranceApply::getSolutionType); |
| | | queryWrapper.selectAs(Solutions::getMaxAge,InsuranceApply::getMaxAge); |
| | | queryWrapper.selectAs(Solutions::getMinAge,InsuranceApply::getMinAge); |
| | | queryWrapper.selectAs(Solutions::getPrice,InsuranceApply::getPrice); |
| | |
| | | //企业人员查看本企业数据 |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | | queryWrapper.eq(InsuranceApply::getCompanyId, loginUserInfo.getCompanyId()); |
| | | }else if(loginUserInfo.getType().equals(Constants.TWO)){ |
| | | //如果是商户查看 |
| | | if(pageWrap.getModel().getSolutionType()!=null && pageWrap.getModel().getSolutionType() ==0){ |
| | | queryWrapper.exists("select cs.id from company_solution cs where cs.isdeleted=0 and cs.company_id=t.company_id and cs.shop_id="+loginUserInfo.getCompanyId()); |
| | | }else if(pageWrap.getModel().getSolutionType()!=null && pageWrap.getModel().getSolutionType() ==1){ |
| | | queryWrapper.eq(Solutions::getShopId,loginUserInfo.getCompanyId()); |
| | | }else{ |
| | | queryWrapper.apply("((t1.type=0 and exists(select cs.id from company_solution cs where cs.isdeleted=0 and cs.company_id=t.company_id and cs.shop_id="+loginUserInfo.getCompanyId()+")) or (" + |
| | | "t1.type=1 and t1.shop_id="+loginUserInfo.getCompanyId()+"))") ; |
| | | } |
| | | }else{ |
| | | if(loginUserInfo.getCompanyIdList()!=null && loginUserInfo.getCompanyIdList().size()>0){ |
| | | queryWrapper.in(InsuranceApply::getCompanyId, loginUserInfo.getCompanyIdList()); |
| | |
| | | } |
| | | if (pageWrap.getModel().getSolutionId() != null) { |
| | | queryWrapper.eq(InsuranceApply::getSolutionId, pageWrap.getModel().getSolutionId()); |
| | | } |
| | | if (pageWrap.getModel().getSolutionType() != null) { |
| | | queryWrapper.eq(Solutions::getType, pageWrap.getModel().getSolutionType()); |
| | | } |
| | | if (pageWrap.getModel().getEndTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getEndTime, Utils.Date.getStart(pageWrap.getModel().getEndTimeS())); |
| | |
| | | queryWrapper.in(InsuranceApply::getStatus, pageWrap.getModel().getStatus().split(",")); |
| | | } |
| | | if (pageWrap.getModel().getLoseEfficacy() != null && pageWrap.getModel().getLoseEfficacy() ==1) { |
| | | queryWrapper.apply(" DATEDIFF(t.END_TIME,CURRENT_DATE() ) <= 5 "); |
| | | queryWrapper.apply(" DATEDIFF(t.END_TIME,CURRENT_DATE() ) <= 5 and t.END_TIME >= now() "); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(pageWrap.getSorts())){ |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | |
| | | queryWrapper.selectAll(InsuranceApply.class); |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | | queryWrapper.selectAs(Solutions::getType,InsuranceApply::getSolutionType); |
| | | queryWrapper.select(" ( select sum(td.fee) from taxes ts inner join tax_detial td on ts.TAX_ID = ts.id where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ) as taxesMoney "); |
| | | queryWrapper.select(" ( select td.CREATE_DATE from taxes ts inner join tax_detial td on ts.TAX_ID = ts.id where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id order by td.CREATE_DATE desc limit 1 ) as taxesLast "); |
| | | queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId); |
| | |
| | | } |
| | | if (model.getSolutionId() != null) { |
| | | queryWrapper.eq(InsuranceApply::getSolutionId, model.getSolutionId()); |
| | | } |
| | | if (model.getSolutionType() != null) { |
| | | queryWrapper.eq(Solutions::getType,model.getSolutionType() ); |
| | | } |
| | | if (model.getEndTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getEndTime, Utils.Date.getStart(model.getEndTimeS())); |
| | |
| | | .selectAs(Solutions::getMinAge,InsuranceApply::getMinAge) |
| | | .selectAs(Solutions::getPrice,InsuranceApply::getPrice) |
| | | .selectAs(Solutions::getTimeUnit,InsuranceApply::getTimeUnit) |
| | | .selectAs(Solutions::getType,InsuranceApply::getSolutionType) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .select(" ( select max(ac.APPLY_START_TIME) from apply_change ac where ac.apply_id = t.id and ac.status = 2 ) as lastChangeDate") |
| | |
| | | |
| | | private void initImgData(InsuranceApply model) { |
| | | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,model.getId()) |
| | | .eq(Multifile::getObjId,Constants.equalsInteger(model.getSolutionType(),Constants.ZERO)? model.getId():model.getUnionApplyId()) |
| | | .in(Multifile::getObjType,Arrays.asList(new Integer[]{Constants.MultiFile.BD_APPLY_PDF.getKey() |
| | | ,Constants.MultiFile.BD_SIGNED_PDF.getKey() |
| | | ,Constants.MultiFile.BD_DONE_PDF.getKey()})) |
| | |
| | | if(insuranceApplyOptDTO.getOptType().equals(Constants.ONE)){ |
| | | 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()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态非可申请退回!"); |
| | | } |
| | |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE; |
| | | }else if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey())){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE; |
| | | }else if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey())){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_PASS; |
| | | } |
| | | |
| | | //存储待办信息 |
| | |
| | | } |
| | | if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.FAIL_RETURN.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态非可申请退回!"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态无法进行关闭!"); |
| | | } |
| | | //删除其他待办 |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,insuranceApply.getId())); |