| | |
| | | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | queryWrapper.leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId); |
| | | queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId); |
| | | queryWrapper.leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId); |
| | | queryWrapper.eq(ApplyDetail::getIsdeleted,Constants.ZERO); |
| | | |
| | | ApplyDetailPageDTO applyDetailPageDTO = pageWrap.getModel(); |
| | | |
| | |
| | | //在保 |
| | | if(!Objects.isNull(applyDetailPageDTO.getApplyStatus()) |
| | | &&applyDetailPageDTO.getApplyStatus().equals(Constants.ONE)){ |
| | | queryWrapper.apply(" now() <= t.END_TIME "); |
| | | queryWrapper.apply(" now() <= t.END_TIME and now() >= t.START_TIME "); |
| | | queryWrapper.in(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_DONE.getKey()); |
| | | } |
| | | //不在保 |
| | | if(!Objects.isNull(applyDetailPageDTO.getApplyStatus()) |
| | | &&applyDetailPageDTO.getApplyStatus().equals(Constants.TWO)){ |
| | | queryWrapper.apply("now() > t.END_TIME "); |
| | | queryWrapper.in(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_DONE.getKey()); |
| | | } |
| | | //待生效 |
| | | if(!Objects.isNull(applyDetailPageDTO.getApplyStatus()) |
| | | &&applyDetailPageDTO.getApplyStatus().equals(Constants.THREE)){ |
| | | queryWrapper.apply("now() < t.START_TIME "); |
| | | queryWrapper.in(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_DONE.getKey()); |
| | | } |
| | | |
| | | queryWrapper.eq(!Objects.isNull(applyDetailPageDTO.getDuId()),ApplyDetail::getDuId,applyDetailPageDTO.getDuId()); |
| | |
| | | int num = 1; |
| | | for (ApplyDetail d : pageData.getRecords()){ |
| | | d.setSortnum(num++); |
| | | if(d.getEndTime().compareTo(new Date())<0){ |
| | | d.setApplyStatus(Constants.ONE); |
| | | if(Constants.equalsInteger(d.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | || Constants.equalsInteger(d.getStatus(),Constants.InsuranceApplyStatus.WTB_DONE.getKey())){ |
| | | if(d.getEndTime().getTime()< System.currentTimeMillis()){ |
| | | d.setApplyStatus(Constants.ONE); |
| | | }else if(d.getStartTime().getTime()> System.currentTimeMillis()){ |
| | | d.setApplyStatus(Constants.TWO); |
| | | }else{ |
| | | d.setApplyStatus(Constants.ZERO); |
| | | } |
| | | }else{ |
| | | d.setApplyStatus(Constants.ZERO); |
| | | d.setApplyStatus(-Constants.ONE); |
| | | } |
| | | if(Objects.nonNull(d.getReduceMoney())){ |
| | | d.setFee(d.getFee().add(d.getReduceMoney())); |
| | | } |
| | | |
| | | // d.setPrice(Constants.getTwoPoint(d.getPrice())); |
| | | // d.setFee(Constants.getTwoPoint(d.getFee())); |
| | | |
| | | |
| | | } |
| | | } |
| | | return pageData; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询人员可报案数据 |
| | | * @param memberId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ApplyDetail> getMemberSettleClaimsList(Integer memberId){ |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectJoinList(ApplyDetail.class, |
| | | new MPJLambdaWrapper<ApplyDetail>() |
| | | .selectAll(ApplyDetail.class) |
| | | .selectAs(InsuranceApply::getCode,ApplyDetail::getApplyCode) |
| | | .selectAs(InsuranceApply::getStartTime,ApplyDetail::getParentStartTime) |
| | | .selectAs(InsuranceApply::getEndTime,ApplyDetail::getParentEndTime) |
| | | .selectAs(Company::getName,ApplyDetail::getCompanyName) |
| | | .selectAs(Solutions::getName,ApplyDetail::getSolutionName) |
| | | .selectAs(Worktype::getName,ApplyDetail::getWorkTypeName) |
| | | .selectAs(DispatchUnit::getName,ApplyDetail::getDuName) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId) |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyDetail::getDuId) |
| | | .in(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(), |
| | | Constants.InsuranceApplyStatus.WTB_DONE.getKey()) |
| | | .eq(ApplyDetail::getIsdeleted,Constants.ZERO) |
| | | .eq(InsuranceApply::getCompanyId,user.getCompanyId()) |
| | | .eq(ApplyDetail::getMemberId,memberId) |
| | | ); |
| | | return applyDetailList; |
| | | } |
| | | |
| | | |
| | | } |