diff --git a/mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java
index 5a4e39676..2386d7ea4 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java
@@ -98,12 +98,12 @@ public class WxBillBaseEntity extends TenantEntity {
// @TableField(exist = false)
// protected Integer onlyOwe;
- //账单逾期计算提前天数
+ //账单逾期计算截止时间
@TableField(exist = false)
- private Integer oweBillBeforeDays;
+ private Date oweBillLastTime;
- //临期计算提前天数
+ //临期计算截止时间
@TableField(exist = false)
- private Integer nearBillBeforeDays;
+ private Date nearBillLastTime;
}
diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java
index d08bdc8b0..849f49dc0 100644
--- a/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java
+++ b/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java
@@ -104,8 +104,13 @@ public class WxBillAllHelper {
bill.setStarttime(starttime);
bill.setEndtime(enttime);
bill.setRentShopType(wxMerchant.getType());
- bill.setOweBillBeforeDays(wxMerchant.getOweBillBeforeDays());
- bill.setNearBillBeforeDays(wxMerchant.getNearBillBeforeDays());
+ Date nowBegin = DateUtils.getDayBegin(new Date());
+ if (null != wxMerchant.getOweBillBeforeDays()) {
+ bill.setOweBillLastTime(DateUtils.getSecondsTimeAfter(wxMerchant.getOweBillBeforeDays()*3600, nowBegin));
+ }
+ if (null != wxMerchant.getNearBillBeforeDays()) {
+ bill.setNearBillLastTime(DateUtils.getSecondsTimeAfter(wxMerchant.getNearBillBeforeDays()*3600, nowBegin));
+ }
}
public WxBillSum getBillRentSum(WxMerchant wxMerchant,Date starttime, Date enttime) {
diff --git a/mallinkService/src/main/java/com/iformall/utils/DateUtils.java b/mallinkService/src/main/java/com/iformall/utils/DateUtils.java
index 3d0e8e02e..5cb7172ac 100755
--- a/mallinkService/src/main/java/com/iformall/utils/DateUtils.java
+++ b/mallinkService/src/main/java/com/iformall/utils/DateUtils.java
@@ -380,7 +380,7 @@ public class DateUtils {
Date date = new Date(myTime * 1000);
return formatter.format(date);
}
-
+
/**
* 获得当前时间前几小时的时间
*
@@ -403,10 +403,14 @@ public class DateUtils {
* @return
*/
public static String getSecondsTimeBefore(int seconds, Date myDate) {
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ return formatter.format(getDateTimeBefore(seconds, myDate));
+ }
+
+ public static Date getDateTimeBefore(int seconds, Date myDate) {
long myTime = (myDate.getTime() / 1000) - seconds;
Date date = new Date(myTime * 1000);
- return formatter.format(date);
+ return date;
}
/**
diff --git a/mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml b/mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml
index b209b7888..7178cd178 100644
--- a/mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml
@@ -102,16 +102,11 @@
and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month}
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6)
- )
+
+ and (br.`starttime` <= #{oweBillLastTime} and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6))
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
- and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.status not in (3,6)
- )
+
+ and (br.`starttime` > #{oweBillLastTime} and br.`starttime` <= #{nearBillLastTime} and br.status not in (3,6))
and br.`build_way` = #{buildWay}
diff --git a/mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml b/mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml
index 74c56f319..f5914b72b 100644
--- a/mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml
@@ -123,16 +123,11 @@
and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month}
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6)
- )
+
+ and (br.`starttime` <= #{oweBillLastTime} and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6))
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
- and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.status not in (3,6)
- )
+
+ and (br.`starttime` > #{oweBillLastTime} and br.`starttime` <= #{nearBillLastTime} and br.status not in (3,6))
and br.`merchant_id` in
diff --git a/mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml b/mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml
index 9f3cbd50b..ad2b43a3d 100644
--- a/mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml
@@ -107,16 +107,11 @@
and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month}
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6)
- )
+
+ and (br.`starttime` <= #{oweBillLastTime} and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6))
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
- and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.status not in (3,6)
- )
+
+ and (br.`starttime` > #{oweBillLastTime} and br.`starttime` <= #{nearBillLastTime} and br.status not in (3,6))
and br.`merchant_id` in
diff --git a/mallinkService/src/main/resources/mapper/WxBillOtherMapper.xml b/mallinkService/src/main/resources/mapper/WxBillOtherMapper.xml
index 737e1c8da..7ce3baf66 100644
--- a/mallinkService/src/main/resources/mapper/WxBillOtherMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillOtherMapper.xml
@@ -103,16 +103,11 @@
and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month}
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6)
- )
+
+ and (br.`starttime` <= #{oweBillLastTime} and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6))
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
- and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.status not in (3,6)
- )
+
+ and (br.`starttime` > #{oweBillLastTime} and br.`starttime` <= #{nearBillLastTime} and br.status not in (3,6))
and br.`merchant_id` in
diff --git a/mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml b/mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml
index dbcec5a25..8676148f0 100644
--- a/mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml
@@ -114,16 +114,11 @@
and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month}
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6)
- )
+
+ and (br.`starttime` <= #{oweBillLastTime} and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6))
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
- and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.status not in (3,6)
- )
+
+ and (br.`starttime` > #{oweBillLastTime} and br.`starttime` <= #{nearBillLastTime} and br.status not in (3,6))
and br.`merchant_id` in
diff --git a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
index 3fb828f40..141ef5cb1 100644
--- a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
@@ -134,16 +134,11 @@
and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month}
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6)
- )
+
+ and (br.`starttime` <= #{oweBillLastTime} and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6))
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
- and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.status not in (3,6)
- )
+
+ and (br.`starttime` > #{oweBillLastTime} and br.`starttime` <= #{nearBillLastTime} and br.status not in (3,6))
and br.`rent_shop_type` = #{rentShopType}
and br.`property_contract_id` = #{propertyContractId}
diff --git a/mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml
index 5a20a43d0..a8524353c 100644
--- a/mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml
@@ -122,16 +122,11 @@
and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month}
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6)
- )
+
+ and (br.`starttime` <= #{oweBillLastTime} and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6))
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
- and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.status not in (3,6)
- )
+
+ and (br.`starttime` > #{oweBillLastTime} and br.`starttime` <= #{nearBillLastTime} and br.status not in (3,6))
and br.`manage_fee_type` = #{manageFeeType}
and br.`merchant_id` is not null
diff --git a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml
index e6eb6022f..9d7da8bfb 100644
--- a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml
@@ -139,16 +139,11 @@
and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month}
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6)
- )
+
+ and (br.`starttime` <= #{oweBillLastTime} and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6))
-
- and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
- and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
- and br.status not in (3,6)
- )
+
+ and (br.`starttime` > #{oweBillLastTime} and br.`starttime` <= #{nearBillLastTime} and br.status not in (3,6))
and br.`rent_contract_id` in