chengf
2025-08-21 bde271fdbab51e654a293dba02a31eab8ff3ea8b
service-fee/src/main/java/com/java110/fee/smo/impl/FeeDiscountInnerServiceSMOImpl.java
@@ -290,26 +290,30 @@
        List<ApplyRoomDiscountDto> applyRoomDiscountDtos = applyRoomDiscountInnerServiceSMOImpl.queryApplyRoomDiscounts(applyRoomDiscountDto);
        if (!ListUtil.isNull(applyRoomDiscountDtos)) {
            computeApplyRoomDiscount(feeDetailDto, simpleDateFormat, c, computeDiscountDtos,useCycle);
            //取出开关映射的值
            String value = MappingCache.getValue(DOMAIN_COMMON, DISCOUNT_MODE);
            List<ComputeDiscountDto> computeDiscountDtoList = new ArrayList<>();
            for (ComputeDiscountDto computeDiscountDto : computeDiscountDtos) {
                computeDiscountDto.setValue(value);
                String value = MappingCache.getValue(DOMAIN_COMMON, DISCOUNT_MODE);
                List<ComputeDiscountDto> computeDiscountDtoList = new ArrayList<>();
                computeDiscountDto.setDiscountPrice(
                        MoneyUtil.computePriceScale(
                                computeDiscountDto.getDiscountPrice(),
                                feeDtos.get(0).getScale(),
                                Integer.parseInt(feeDtos.get(0).getDecimalPlace())
                        )
                );
                if (!StringUtil.isEmpty(computeDiscountDto.getDiscountType()) && "3003".equals(computeDiscountDto.getDiscountType())) {
                    computeDiscountDto.setArdId(feeDetailDto.getArdId());
                for (ComputeDiscountDto computeDiscountDto : computeDiscountDtos) {
                    computeDiscountDto.setValue(value);
                    computeDiscountDto.setDiscountPrice(
                            MoneyUtil.computePriceScale(
                                    computeDiscountDto.getDiscountPrice(),
                                    feeDtos.get(0).getScale(),
                                    Integer.parseInt(feeDtos.get(0).getDecimalPlace())
                            )
                    );
                    if (!StringUtil.isEmpty(computeDiscountDto.getDiscountType()) && "3003".equals(computeDiscountDto.getDiscountType())) {
                        computeDiscountDto.setArdId(feeDetailDto.getArdId());
                    }
                    computeDiscountDtoList.add(computeDiscountDto);
                }
                computeDiscountDtoList.add(computeDiscountDto);
            }
            return computeDiscountDtos;
                if(computeDiscountDtos.size() > 0){
                    return computeDiscountDtos;
                }
        }
        //根据费用项查询折扣(该费用项下的所有折扣信息)
        List<PayFeeConfigDiscountDto> payFeeConfigDiscountDtos =
@@ -320,6 +324,8 @@
        c.add(Calendar.MONTH, (int) mon);
        //获取缴费结束时间
        Date finishTime = feeDetailDto.getEndTime();
        for (PayFeeConfigDiscountDto tmpPayFeeConfigDiscountDto : payFeeConfigDiscountDtos) {
            //获取缴费最大截止时间
            Date payMaxEndTime = tmpPayFeeConfigDiscountDto.getPayMaxEndTime();
@@ -356,16 +362,25 @@
                cal.add(Calendar.MONTH, Integer.parseInt(specValue));
                finishTime = cal.getTime();
            }
            if (payMaxEndTime == null) {
                doCompute(tmpPayFeeConfigDiscountDto, Double.parseDouble(feeDetailDto.getCycles()), computeDiscountDtos, feeDetailDto.getFeeId());
            } else if (payMaxEndTime.getTime() >= finishTime.getTime()) {
                doCompute(tmpPayFeeConfigDiscountDto, Double.parseDouble(feeDetailDto.getCycles()), computeDiscountDtos, feeDetailDto.getFeeId());
            double cycle = Double.parseDouble(feeDetailDto.getCycles());
            Date startTime = feeDetailDto.getStartTime();
            if(tmpPayFeeConfigDiscountDto.getPayMaxStarTime() == null || startTime.getTime() > tmpPayFeeConfigDiscountDto.getPayMaxStarTime().getTime()){
                tmpPayFeeConfigDiscountDto.setPayMaxStarTime(startTime);
            }
            if (tmpPayFeeConfigDiscountDto.getPayMaxEndTime() == null || finishTime.getTime() < tmpPayFeeConfigDiscountDto.getPayMaxEndTime().getTime()) {
                tmpPayFeeConfigDiscountDto.setPayMaxEndTime(finishTime);
            }
            cycle =DateUtil.dayCompare(
                    tmpPayFeeConfigDiscountDto.getPayMaxStarTime(),
                    tmpPayFeeConfigDiscountDto.getPayMaxEndTime()
            );
            if (cycle > 0) {
                doCompute(tmpPayFeeConfigDiscountDto, cycle, computeDiscountDtos, feeDetailDto.getFeeId());
            } else {
                continue;
            }
            finishTime = c.getTime();
        }
        computeApplyRoomDiscount(feeDetailDto, simpleDateFormat, c, computeDiscountDtos);
        //取出开关映射的值
        String value = MappingCache.getValue(DOMAIN_COMMON, DISCOUNT_MODE);
        List<ComputeDiscountDto> computeDiscountDtoList = new ArrayList<>();
@@ -538,7 +553,7 @@
        IComputeDiscount computeDiscount = (IComputeDiscount) ApplicationContextFactory.getBean(feeDiscountDtos.get(0).getBeanImpl());
        feeDiscountDtos.get(0).setDiscountDesc(useCycle+"");
        ComputeDiscountDto computeDiscountDto = computeDiscount.compute(feeDiscountDtos.get(0));
        if (computeDiscountDto == null) {
        if (computeDiscountDto == null || computeDiscountDto.getDiscountPrice() == 0) {
            return;
        }
        computeDiscountDtos.add(computeDiscountDto);