Browse Source

fix

release_toaliyun_real
winter 1 year ago
parent
commit
ff6ce5ac61
2 changed files with 20 additions and 10 deletions
  1. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  2. +19
    -9
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -691,7 +691,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService


List<BillTimeVo> billTimeVoList = new ArrayList<>(); List<BillTimeVo> billTimeVoList = new ArrayList<>();
if(saveDb){ if(saveDb){
billTimeVoList = WxRentContractServiceImpl.initBillTimeList(wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate(),wxPropertyContract.getAdjustPeriod(),dayType,receivePeriod);
billTimeVoList = WxRentContractServiceImpl.initBillTimeList(yearList,wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate(),wxPropertyContract.getAdjustPeriod(),dayType,receivePeriod);
}else{ }else{
//预账单编辑账期,生成金额 //预账单编辑账期,生成金额
for (WxAllBill rent:wxPropertyContract.getPreviewBillRentList()) { for (WxAllBill rent:wxPropertyContract.getPreviewBillRentList()) {


+ 19
- 9
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java View File

@@ -1241,7 +1241,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
List<BillTimeVo> billTimeVoList = new ArrayList<>(); List<BillTimeVo> billTimeVoList = new ArrayList<>();
if(saveDb){ if(saveDb){
billTimeVoList = initBillTimeList(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate(),wxRentContract.getAdjustPeriod(),dayType,receivePeriod);
billTimeVoList = initBillTimeList(yearList,wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate(),wxRentContract.getAdjustPeriod(),dayType,receivePeriod);
}else{ }else{
//预账单编辑账期,生成金额 //预账单编辑账期,生成金额
for (WxAllBill rent:wxRentContract.getPreviewBillRentList()) { for (WxAllBill rent:wxRentContract.getPreviewBillRentList()) {
@@ -1259,9 +1259,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
int index = 0; int index = 0;
for (int i = 0; i < billTimeVoList.size(); i++) { for (int i = 0; i < billTimeVoList.size(); i++) {
BillTimeVo billTimeVo = billTimeVoList.get(i); BillTimeVo billTimeVo = billTimeVoList.get(i);
if (i == 4) {
String aa = "000";
}
//计算金额 //计算金额
String needpay = "0"; String needpay = "0";
//商业管理费 //商业管理费
@@ -1876,11 +1873,16 @@ public class WxRentContractServiceImpl implements WxRentContractService {
// return wxRentContractMapper.getShopType(wxRentContract); // 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<>(); List<BillTimeVo> list = new ArrayList<>();
int count = 0; 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(); 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)){ if(timeVo.getEndDate().after(end)){
timeVo.setEndDate(end); timeVo.setEndDate(end);
} }
@@ -1916,7 +1927,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
list.add(timeVo); list.add(timeVo);
//next //next
//start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.DATE,1);
start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.SECOND,1); start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.SECOND,1);
if(start.after(end)) { if(start.after(end)) {
@@ -1930,7 +1940,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
logger.error("initBillTimeList() warnCount max error !!!"); logger.error("initBillTimeList() warnCount max error !!!");
break; break;
} }
}
}
return list; return list;
} }


Loading…
Cancel
Save