k94314517
2025-05-14 4ddff036191a2ec6ee6f85a337c97d6f7d9471d6
server/service/src/main/java/com/doumee/service/business/impl/ApplyDetailServiceImpl.java
@@ -223,12 +223,20 @@
        //在保
        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());
@@ -259,11 +267,25 @@
            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()));
            }
        }