| @@ -979,6 +979,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); | long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); | ||||
| if (rent.getOwe() <= pay) { | if (rent.getOwe() <= pay) { | ||||
| rent.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPay(rent.getPay() + pay); | ||||
| rent.setOwe(rent.getOwe() - 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(); | long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); | ||||
| if (property.getOwe() <= pay) { | if (property.getOwe() <= pay) { | ||||
| property.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPay(property.getPay() + pay); | ||||
| property.setOwe(property.getOwe() - pay); | property.setOwe(property.getOwe() - pay); | ||||
| @@ -1034,6 +1046,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| if (!daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | if (!daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | ||||
| if (daily.getOwe() <= pay) { | if (daily.getOwe() <= pay) { | ||||
| daily.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPay(daily.getPay() + pay); | ||||
| daily.setOwe(daily.getOwe() - pay); | daily.setOwe(daily.getOwe() - pay); | ||||
| @@ -1070,6 +1088,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| daily.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | daily.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| daily.setStarttime(bill.getStarttime()); | daily.setStarttime(bill.getStarttime()); | ||||
| daily.setEndtime(bill.getEndtime()); | 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); | wxBillDailyMapper.insertSelective(daily); | ||||
| addActionImport(daily.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); | 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.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | ||||
| if (other.getOwe() <= pay) { | if (other.getOwe() <= pay) { | ||||
| other.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setName(bill.getBillAttr()); | ||||
| other.setComments(bill.getBillAttr()); | other.setComments(bill.getBillAttr()); | ||||
| @@ -1126,6 +1156,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| other.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | other.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| other.setStarttime(bill.getStarttime()); | other.setStarttime(bill.getStarttime()); | ||||
| other.setEndtime(bill.getEndtime()); | 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); | wxBillOtherMapper.insertSelective(other); | ||||
| addActionImport(other.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); | 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.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | ||||
| if (otherDeposit.getOwe() <= pay) { | if (otherDeposit.getOwe() <= pay) { | ||||
| otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPay(otherDeposit.getPay() + pay); | ||||
| otherDeposit.setOwe(otherDeposit.getOwe() - pay); | otherDeposit.setOwe(otherDeposit.getOwe() - pay); | ||||
| @@ -1181,6 +1223,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| otherDeposit.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | otherDeposit.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| otherDeposit.setStarttime(bill.getStarttime()); | otherDeposit.setStarttime(bill.getStarttime()); | ||||
| otherDeposit.setEndtime(bill.getEndtime()); | 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); | wxBillOtherDepositMapper.insertSelective(otherDeposit); | ||||
| addActionImport(otherDeposit.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); | addActionImport(otherDeposit.getId(), bill.getPayWay(), bill.getPayDate(), user, bill.getPayStr()); | ||||
| } | } | ||||
| @@ -167,6 +167,12 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| wxBillDaily.setOwe(record.getReceivePay()-record.getPay()); | wxBillDaily.setOwe(record.getReceivePay()-record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPayDate(record.getPayDate()); | ||||
| wxBillDaily.setUpdatetime(date); | wxBillDaily.setUpdatetime(date); | ||||
| @@ -17,6 +17,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxBillDepositMapper; | import com.iformall.mapper.WxBillDepositMapper; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillDepositService; | import com.iformall.service.WxBillDepositService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -133,6 +134,12 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| wxBillDeposit.setOwe(record.getReceivePay()-record.getPay()); | wxBillDeposit.setOwe(record.getReceivePay()-record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPayDate(record.getPayDate()); | ||||
| wxBillDeposit.setUpdatetime(date); | wxBillDeposit.setUpdatetime(date); | ||||
| @@ -14,6 +14,7 @@ import com.iformall.mapper.WxShopMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillOtherDepositService; | import com.iformall.service.WxBillOtherDepositService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -161,6 +162,12 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| wxBillOtherDeposit.setOwe(record.getReceivePay() - record.getPay()); | wxBillOtherDeposit.setOwe(record.getReceivePay() - record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPayDate(record.getPayDate()); | ||||
| wxBillOtherDeposit.setUpdatetime(date); | wxBillOtherDeposit.setUpdatetime(date); | ||||
| @@ -14,6 +14,7 @@ import com.iformall.mapper.WxShopMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillOtherService; | import com.iformall.service.WxBillOtherService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -161,6 +162,12 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| wxBillOther.setOwe(record.getReceivePay()-record.getPay()); | wxBillOther.setOwe(record.getReceivePay()-record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPayDate(record.getPayDate()); | ||||
| wxBillOther.setUpdatetime(date); | wxBillOther.setUpdatetime(date); | ||||
| @@ -17,6 +17,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxBillPropertyDepositMapper; | import com.iformall.mapper.WxBillPropertyDepositMapper; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillPropertyDepositService; | import com.iformall.service.WxBillPropertyDepositService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -133,6 +134,12 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| wxBillDeposit.setOwe(record.getReceivePay()-record.getPay()); | wxBillDeposit.setOwe(record.getReceivePay()-record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPayDate(record.getPayDate()); | ||||
| wxBillDeposit.setUpdatetime(date); | wxBillDeposit.setUpdatetime(date); | ||||
| @@ -15,6 +15,7 @@ import com.iformall.mapper.WxBillPropertyMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillPropertyService; | import com.iformall.service.WxBillPropertyService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -142,6 +143,12 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| property.setOwe(record.getReceivePay()-record.getPay()); | property.setOwe(record.getReceivePay()-record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| property.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPayDate(record.getPayDate()); | ||||
| property.setUpdatetime(date); | property.setUpdatetime(date); | ||||
| @@ -18,6 +18,7 @@ import com.iformall.mapper.WxBillRentMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillRentService; | import com.iformall.service.WxBillRentService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -144,6 +145,12 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| wxBillRent.setOwe(record.getReceivePay()-record.getPay()); | wxBillRent.setOwe(record.getReceivePay()-record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | 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.setPayDate(record.getPayDate()); | ||||
| wxBillRent.setUpdatetime(date); | wxBillRent.setUpdatetime(date); | ||||