|
|
|
@@ -7,10 +7,7 @@ import com.iformall.common.IdWorker; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumBillRentStatus; |
|
|
|
import com.iformall.enums.EnumDelStatus; |
|
|
|
import com.iformall.enums.EnumRentContractStatus; |
|
|
|
import com.iformall.enums.EnumShopStatus; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxPropertyContractService; |
|
|
|
@@ -251,6 +248,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
List<WxPropertyContract> list = wxPropertyContractMapper.findList(wxPropertyContract); |
|
|
|
if (list.size() > 0) { |
|
|
|
wxPropertyContract = list.get(0); |
|
|
|
//找到计租方式 |
|
|
|
int dayType = wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
WxBillPropertyDeposit wxBillDeposit = new WxBillPropertyDeposit(); |
|
|
|
wxBillDeposit.setId(idWorker.nextId()); |
|
|
|
@@ -274,7 +273,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
//账单结束时间 |
|
|
|
instance.clear(); |
|
|
|
instance.setTime(wxBillDeposit.getReceiveDate()); |
|
|
|
instance.add(Calendar.MONTH, wxPropertyContract.getLease()); |
|
|
|
instance.add(dayType, wxPropertyContract.getLease()); |
|
|
|
wxBillDeposit.setEndtime(instance.getTime()); |
|
|
|
//截止收租日在当前时间之前 |
|
|
|
if (wxBillDeposit.getReceiveDate().before(date)) { |
|
|
|
@@ -310,6 +309,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
List<WxPropertyContract> list = wxPropertyContractMapper.findList(wxPropertyContract); |
|
|
|
if (list.size() > 0) { |
|
|
|
wxPropertyContract = list.get(0); |
|
|
|
int dayType = wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) ? Calendar.MONTH : Calendar.DAY_OF_MONTH; |
|
|
|
int receivePeriod = wxPropertyContract.getReceivePeriod().intValue(); |
|
|
|
Integer lease = wxPropertyContract.getLease(); |
|
|
|
int extralease = lease % receivePeriod; |
|
|
|
@@ -327,7 +327,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
Date date = new Date(); |
|
|
|
Calendar instance = Calendar.getInstance(); |
|
|
|
instance.setTime(wxPropertyContract.getRentalStartDate()); |
|
|
|
instance.add(Calendar.MONTH, receivePeriod * i); |
|
|
|
instance.add(dayType, receivePeriod * i); |
|
|
|
instance.add(Calendar.DAY_OF_MONTH, -1); |
|
|
|
Date time = instance.getTime(); |
|
|
|
wxBillProperty.setReceiveDate(time); |
|
|
|
@@ -340,7 +340,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
//账单结束时间 |
|
|
|
instance.clear(); |
|
|
|
instance.setTime(wxBillProperty.getStarttime()); |
|
|
|
instance.add(Calendar.MONTH, receivePeriod); |
|
|
|
instance.add(dayType, receivePeriod); |
|
|
|
instance.add(Calendar.DAY_OF_MONTH, -1); |
|
|
|
wxBillProperty.setEndtime(instance.getTime()); |
|
|
|
int needpay = wxPropertyContract.getPrice() * receivePeriod; |
|
|
|
@@ -353,7 +353,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
//账单结束时间 |
|
|
|
instance.clear(); |
|
|
|
instance.setTime(wxBillProperty.getStarttime()); |
|
|
|
instance.add(Calendar.MONTH, extralease); |
|
|
|
instance.add(dayType, extralease); |
|
|
|
instance.add(Calendar.DAY_OF_MONTH, -1); |
|
|
|
wxBillProperty.setEndtime(instance.getTime()); |
|
|
|
needpay = wxPropertyContract.getPrice() * extralease; |
|
|
|
@@ -367,7 +367,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
wxBillProperty.setExpiredDay(day); |
|
|
|
} else {//截止收租日在当前时间之后 |
|
|
|
Calendar now = Calendar.getInstance(); |
|
|
|
now.add(Calendar.MONTH, receivePeriod); |
|
|
|
now.add(dayType, receivePeriod); |
|
|
|
Date currenttime = now.getTime(); |
|
|
|
//当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 |
|
|
|
if (currenttime.before(wxBillProperty.getReceiveDate())) { |
|
|
|
|