diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 51145df99..7bc15774c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -979,6 +979,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); if (rent.getOwe() <= pay) { rent.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = rent.getPayDate(); + Date receiveDate = rent.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + rent.setExpiredDay((long) expiredDay); + } } rent.setPay(rent.getPay() + pay); rent.setOwe(rent.getOwe() - pay); @@ -1004,6 +1010,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); if (property.getOwe() <= pay) { property.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = property.getPayDate(); + Date receiveDate = property.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + property.setExpiredDay((long) expiredDay); + } } property.setPay(property.getPay() + pay); property.setOwe(property.getOwe() - pay); @@ -1034,6 +1046,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { if (!daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { if (daily.getOwe() <= pay) { daily.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = daily.getPayDate(); + Date receiveDate = daily.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + daily.setExpiredDay((long) expiredDay); + } } daily.setPay(daily.getPay() + pay); daily.setOwe(daily.getOwe() - pay); @@ -1070,6 +1088,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { daily.setIsDel(EnumDelStatus.NOT_DEL.getCode()); daily.setStarttime(bill.getStarttime()); daily.setEndtime(bill.getEndtime()); + Date payDate = daily.getPayDate(); + Date receiveDate = daily.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + daily.setExpiredDay((long) expiredDay); + } wxBillDailyMapper.insertSelective(daily); addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); } @@ -1087,6 +1111,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { if (!other.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { if (other.getOwe() <= pay) { other.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = other.getPayDate(); + Date receiveDate = other.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + other.setExpiredDay((long) expiredDay); + } } other.setName(bill.getBillAttr()); other.setComments(bill.getBillAttr()); @@ -1126,6 +1156,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { other.setIsDel(EnumDelStatus.NOT_DEL.getCode()); other.setStarttime(bill.getStarttime()); other.setEndtime(bill.getEndtime()); + Date payDate = other.getPayDate(); + Date receiveDate = other.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + other.setExpiredDay((long) expiredDay); + } wxBillOtherMapper.insertSelective(other); addActionImport(other.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); } @@ -1143,6 +1179,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { if (!otherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { if (otherDeposit.getOwe() <= pay) { otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = otherDeposit.getPayDate(); + Date receiveDate = otherDeposit.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + otherDeposit.setExpiredDay((long) expiredDay); + } } otherDeposit.setPay(otherDeposit.getPay() + pay); otherDeposit.setOwe(otherDeposit.getOwe() - pay); @@ -1181,6 +1223,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { otherDeposit.setIsDel(EnumDelStatus.NOT_DEL.getCode()); otherDeposit.setStarttime(bill.getStarttime()); otherDeposit.setEndtime(bill.getEndtime()); + Date payDate = otherDeposit.getPayDate(); + Date receiveDate = otherDeposit.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + otherDeposit.setExpiredDay((long) expiredDay); + } wxBillOtherDepositMapper.insertSelective(otherDeposit); addActionImport(otherDeposit.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java index 45cfbd4e0..1adb8cbcc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java @@ -167,6 +167,12 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { wxBillDaily.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = wxBillDaily.getPayDate(); + Date receiveDate = wxBillDaily.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + wxBillDaily.setExpiredDay((long) expiredDay); + } } wxBillDaily.setPayDate(record.getPayDate()); wxBillDaily.setUpdatetime(date); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java index 5ea8e9028..6f9733341 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java @@ -17,6 +17,7 @@ import com.iformall.exception.MallinkException; import com.iformall.mapper.WxBillDepositMapper; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillDepositService; +import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -133,6 +134,12 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { wxBillDeposit.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = wxBillDeposit.getPayDate(); + Date receiveDate = wxBillDeposit.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + wxBillDeposit.setExpiredDay((long) expiredDay); + } } wxBillDeposit.setPayDate(record.getPayDate()); wxBillDeposit.setUpdatetime(date); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java index 04f946d02..ff1a7b1a5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java @@ -14,6 +14,7 @@ import com.iformall.mapper.WxShopMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillOtherDepositService; +import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -161,6 +162,12 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService wxBillOtherDeposit.setOwe(record.getReceivePay() - record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = wxBillOtherDeposit.getPayDate(); + Date receiveDate = wxBillOtherDeposit.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + wxBillOtherDeposit.setExpiredDay((long) expiredDay); + } } wxBillOtherDeposit.setPayDate(record.getPayDate()); wxBillOtherDeposit.setUpdatetime(date); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java index bab94adab..fa42e7629 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java @@ -14,6 +14,7 @@ import com.iformall.mapper.WxShopMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillOtherService; +import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -161,6 +162,12 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { wxBillOther.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = wxBillOther.getPayDate(); + Date receiveDate = wxBillOther.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + wxBillOther.setExpiredDay((long) expiredDay); + } } wxBillOther.setPayDate(record.getPayDate()); wxBillOther.setUpdatetime(date); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java index b83c03e89..f07b9c342 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java @@ -17,6 +17,7 @@ import com.iformall.exception.MallinkException; import com.iformall.mapper.WxBillPropertyDepositMapper; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillPropertyDepositService; +import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -133,6 +134,12 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe wxBillDeposit.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = wxBillDeposit.getPayDate(); + Date receiveDate = wxBillDeposit.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + wxBillDeposit.setExpiredDay((long) expiredDay); + } } wxBillDeposit.setPayDate(record.getPayDate()); wxBillDeposit.setUpdatetime(date); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java index 0604d3ad0..d63c570ee 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java @@ -15,6 +15,7 @@ import com.iformall.mapper.WxBillPropertyMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillPropertyService; +import com.iformall.utils.DateUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -142,6 +143,12 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { property.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { property.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = property.getPayDate(); + Date receiveDate = property.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + property.setExpiredDay((long) expiredDay); + } } property.setPayDate(record.getPayDate()); property.setUpdatetime(date); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java index a668b13f6..4ffaa2de7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -18,6 +18,7 @@ import com.iformall.mapper.WxBillRentMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillRentService; +import com.iformall.utils.DateUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -144,6 +145,12 @@ public class WxBillRentServiceImpl implements WxBillRentService { wxBillRent.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); + Date payDate = wxBillRent.getPayDate(); + Date receiveDate = wxBillRent.getReceiveDate(); + if (payDate.after(receiveDate)) { + int expiredDay = DateUtils.daysBetween(receiveDate, payDate); + wxBillRent.setExpiredDay((long) expiredDay); + } } wxBillRent.setPayDate(record.getPayDate()); wxBillRent.setUpdatetime(date);