| | |
| | | Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.UPLOAD; |
| | | insuranceApply.setCreateDate(new Date()); |
| | | insuranceApply.setCreator(loginUserInfo.getId()); |
| | | insuranceApply.setEditor(loginUserInfo.getId()); |
| | | insuranceApply.setEditDate(new Date()); |
| | | insuranceApply.setIsdeleted(Constants.ZERO); |
| | | insuranceApply.setCompanyId(loginUserInfo.getCompanyId()); |
| | | insuranceApply.setCheckInfo(insuranceApplyStatus.getName()); |
| | |
| | | applyDetail.setIdcardNo(member.getIdcardNo()); |
| | | applyDetail.setSex(member.getSex()); |
| | | applyDetail.setFee(countCyclePriceVO.getCyclePrice()); |
| | | applyDetail.setCurrentFee(BigDecimal.ZERO); |
| | | //验证派遣单位信息是否存在 |
| | | if(duSolutionList.stream().filter(d->d.getDispatchUnitId().equals(applyDetail.getDuId())).collect(Collectors.toList()).size()<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"【"+applyDetail.getMemberName()+"】员工派遣单位未查询到!"); |
| | |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | | queryWrapper.select(" DATEDIFF( t.END_TIME ,now() ) AS loseEfficacyDays "); |
| | | queryWrapper.select(" ( select count(1) from apply_detail ad where ad.apply_id = t.id ) as insureNum"); |
| | | queryWrapper.select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id ) as insureNum"); |
| | | if(!Objects.isNull(pageWrap.getModel())&&!Objects.isNull(pageWrap.getModel().getType())){ |
| | | queryWrapper.select(" ifnull(( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ),0) as taxesMoney"); |
| | | queryWrapper.select(" ( select td.CREATE_DATE from taxes ts inner join tax_detial td on td.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.ge(InsuranceApply::getEndTime, Utils.Date.getStart(pageWrap.getModel().getEndTimeS())); |
| | | } |
| | | if (pageWrap.getModel().getEndTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getEndTime, Utils.Date.getEnd(pageWrap.getModel().getEndTimeE())); |
| | | queryWrapper.lt(InsuranceApply::getEndTime, Utils.Date.getEnd(pageWrap.getModel().getEndTimeE())); |
| | | } |
| | | if (pageWrap.getModel().getStartTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getStartTime, Utils.Date.getStart(pageWrap.getModel().getStartTimeS())); |
| | | } |
| | | if (pageWrap.getModel().getStartTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getStartTime, Utils.Date.getEnd(pageWrap.getModel().getStartTimeE())); |
| | | queryWrapper.lt(InsuranceApply::getStartTime, Utils.Date.getEnd(pageWrap.getModel().getStartTimeE())); |
| | | } |
| | | if (pageWrap.getModel().getCreateTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateTimeS())); |
| | | } |
| | | if (pageWrap.getModel().getCreateTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateTimeE())); |
| | | queryWrapper.lt(InsuranceApply::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateTimeE())); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.eq(Solutions::getType, pageWrap.getModel().getType()); |
| | |
| | | queryWrapper.eq(InsuranceApply::getCode, pageWrap.getModel().getCode()); |
| | | } |
| | | if (pageWrap.getModel().getStatus() != null) { |
| | | queryWrapper.eq(InsuranceApply::getStatus, pageWrap.getModel().getStatus()); |
| | | queryWrapper.in(InsuranceApply::getStatus, pageWrap.getModel().getStatus().split(",")); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(pageWrap.getSorts())){ |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | |
| | | |
| | | public void initApplyStatus(InsuranceApply apply){ |
| | | apply.setStatusCollect(Constants.InsuranceApplyStatus.getCollectStatus(apply.getStatus())); |
| | | if(Constants.equalsInteger(apply.getStatusCollect(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){ |
| | | if(Constants.equalsInteger(apply.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){ |
| | | //如果已完成 |
| | | if(apply.getEndTime()==null || System.currentTimeMillis()>apply.getEndTime().getTime()){ |
| | | apply.setStatusCollect(Constants.THREE);//已过期 |
| | |
| | | queryWrapper.eq(InsuranceApply::getCode, model.getCode()); |
| | | } |
| | | if (model.getStatus() != null) { |
| | | queryWrapper.eq(InsuranceApply::getStatus, model.getStatus()); |
| | | queryWrapper.in(InsuranceApply::getStatus, model.getStatus().split(",")); |
| | | } |
| | | if (CollectionUtils.isNotEmpty(model.getIds())) { |
| | | queryWrapper.in(InsuranceApply::getId, model.getIds()); |
| | |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .select(" ( select count(1) from apply_detail ad where ad.apply_id = t.id ) as insureNum") |
| | | .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(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getId,id) |
| | |
| | | .selectAll(ApplyLog.class) |
| | | .selectAs(SystemUser::getRealname,ApplyLog::getCreatorName) |
| | | .selectAs(Company::getName,ApplyLog::getCompanyName) |
| | | .selectAs(SystemUser::getType,ApplyLog::getCreatorType) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.ZERO)) |
| | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void applyOpt(InsuranceApplyOptDTO insuranceApplyOptDTO){ |
| | | if(Objects.isNull(insuranceApplyOptDTO) |
| | | ||Objects.isNull(insuranceApplyOptDTO.getApplyId()) |
| | | ||StringUtils.isBlank(insuranceApplyOptDTO.getOptIllustration())){ |
| | | ||Objects.isNull(insuranceApplyOptDTO.getApplyId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |