wuxw
2023-10-25 c03932c8b4d3558e2c9b11ade3c9155a8dc7f2b5
优化账单费用 加入账单生成期
2个文件已修改
15 ■■■■ 已修改文件
java110-utils/src/main/java/com/java110/utils/util/DateUtil.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/bill/CycleConvertOnceFeeImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/util/DateUtil.java
@@ -412,13 +412,18 @@
    public static Date getNextMonthFirstDate(Date curDate) {
        return getNextMonthFirstDate(curDate,1);
    }
    public static Date getNextMonthFirstDate(Date curDate,int monthCount) {
        Calendar curDateCal = Calendar.getInstance();
        curDateCal.setTime(curDate);
        curDateCal.set(Calendar.DAY_OF_MONTH, 1);
        curDateCal.set(Calendar.HOUR_OF_DAY, 0);
        curDateCal.set(Calendar.MINUTE, 0);
        curDateCal.set(Calendar.SECOND, 0);
        curDateCal.add(Calendar.MONTH, 1);
        curDateCal.add(Calendar.MONTH, monthCount);
        return curDateCal.getTime();
    }
service-fee/src/main/java/com/java110/fee/bill/CycleConvertOnceFeeImpl.java
@@ -1,5 +1,6 @@
package com.java110.fee.bill;
import com.java110.core.factory.CommunitySettingFactory;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.core.log.LoggerFactory;
import com.java110.core.smo.IComputeFeeSMO;
@@ -162,6 +163,11 @@
     * @param tmpPayFeeRulePo
     */
    public int ruleGeneratePayFee(PayFeeRulePo tmpPayFeeRulePo) {
        int ruleCycle = 1;
        String value = CommunitySettingFactory.getValue(tmpPayFeeRulePo.getCommunityId(), "PAY_FEE_MONTH_CYCLE");
        if (StringUtil.isNumber(value)) {
            ruleCycle = Integer.parseInt(value);
        }
        //todo 查询费用项信息
        FeeConfigDto feeConfigDto = new FeeConfigDto();
@@ -195,7 +201,7 @@
        }
        do {
            endTime = DateUtil.getNextMonthFirstDate(startTime);
            endTime = DateUtil.getNextMonthFirstDate(startTime, ruleCycle);
            if (endTime.getTime() >= targetEndTime.getTime()) {
                endTime = targetEndTime;
            }