|
|
|
@@ -1241,7 +1241,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
List<BillTimeVo> billTimeVoList = new ArrayList<>();
|
|
|
|
if(saveDb){
|
|
|
|
billTimeVoList = initBillTimeList(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate(),wxRentContract.getAdjustPeriod(),dayType,receivePeriod);
|
|
|
|
billTimeVoList = initBillTimeList(yearList,wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate(),wxRentContract.getAdjustPeriod(),dayType,receivePeriod);
|
|
|
|
}else{
|
|
|
|
//预账单编辑账期,生成金额
|
|
|
|
for (WxAllBill rent:wxRentContract.getPreviewBillRentList()) {
|
|
|
|
@@ -1259,9 +1259,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
int index = 0;
|
|
|
|
for (int i = 0; i < billTimeVoList.size(); i++) {
|
|
|
|
BillTimeVo billTimeVo = billTimeVoList.get(i);
|
|
|
|
if (i == 4) {
|
|
|
|
String aa = "000";
|
|
|
|
}
|
|
|
|
//计算金额
|
|
|
|
String needpay = "0";
|
|
|
|
//商业管理费
|
|
|
|
@@ -1876,11 +1873,16 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
// return wxRentContractMapper.getShopType(wxRentContract);
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
public static List<BillTimeVo> initBillTimeList(Date start,Date end,Integer adjustPeriod,Integer dayType,int receivePeriod){
|
|
|
|
//yearList,每年的合同截止日期,到这个截止日之前之后,需要拆开时间
|
|
|
|
public static List<BillTimeVo> initBillTimeList(List<Date> yearList,Date start,Date end,Integer adjustPeriod,Integer dayType,int receivePeriod){
|
|
|
|
List<BillTimeVo> list = new ArrayList<>();
|
|
|
|
int count = 0;
|
|
|
|
while (true){
|
|
|
|
List<Date> yearsEndList = new ArrayList<Date>();
|
|
|
|
yearsEndList.addAll(yearList);
|
|
|
|
if (yearsEndList.size() > 0) {
|
|
|
|
yearsEndList.remove(0);
|
|
|
|
}
|
|
|
|
while (true) {
|
|
|
|
BillTimeVo timeVo = new BillTimeVo();
|
|
|
|
|
|
|
|
//开始时间
|
|
|
|
@@ -1909,6 +1911,15 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//如果是到了每年的截止时间,第一年忽略(是开始时间)
|
|
|
|
if (null != yearsEndList && yearsEndList.size() > 0 ) {
|
|
|
|
Date yearEndDate = yearsEndList.get(0);
|
|
|
|
if (timeVo.getEndDate().after(yearEndDate)) {
|
|
|
|
timeVo.setEndDate(yearEndDate);
|
|
|
|
yearsEndList.remove(yearEndDate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(timeVo.getEndDate().after(end)){
|
|
|
|
timeVo.setEndDate(end);
|
|
|
|
}
|
|
|
|
@@ -1916,7 +1927,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
list.add(timeVo);
|
|
|
|
|
|
|
|
//next
|
|
|
|
//start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.DATE,1);
|
|
|
|
start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.SECOND,1);
|
|
|
|
|
|
|
|
if(start.after(end)) {
|
|
|
|
@@ -1930,7 +1940,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
logger.error("initBillTimeList() warnCount max error !!!");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|