| @@ -494,7 +494,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| //计算租金 | //计算租金 | ||||
| public int[] computePrice(String rentInfo) { | |||||
| public List<int[]> computePrice(String rentInfo) { | |||||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | ||||
| int arraySize = rentInfoArray.size(); | int arraySize = rentInfoArray.size(); | ||||
| @@ -521,22 +521,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| priceList.add(priceArrs); | priceList.add(priceArrs); | ||||
| } | } | ||||
| return priceList; | |||||
| } | |||||
| public List<WxBillRent> buildRentMonth(WxMerchant wxMerchant, Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Integer price,Integer isPreview) { | |||||
| List<int[]> priceList = computePrice(wxRentContract.getRentInfo()); | |||||
| int size = priceList.size(); | int size = priceList.size(); | ||||
| int[] priceArrs = new int[size]; | int[] priceArrs = new int[size]; | ||||
| for (int i = 0; i < size; i++) { | for (int i = 0; i < size; i++) { | ||||
| int[] price = priceList.get(i); | |||||
| int[] priceInt = priceList.get(i); | |||||
| int sum = 0; | int sum = 0; | ||||
| for (int p : price) { | |||||
| for (int p : priceInt) { | |||||
| sum += p; | sum += p; | ||||
| } | } | ||||
| priceArrs[i] = sum; | priceArrs[i] = sum; | ||||
| } | } | ||||
| return priceArrs; | |||||
| } | |||||
| public List<WxBillRent> buildRentMonth(WxMerchant wxMerchant, Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Integer price,Integer isPreview) { | |||||
| int[] priceArr = computePrice(wxRentContract.getRentInfo()); | |||||
| int size = priceArr.length; | |||||
| int month = 12; | int month = 12; | ||||
| int divide = lease / month; | int divide = lease / month; | ||||
| int mod = lease % month; | int mod = lease % month; | ||||
| @@ -555,7 +555,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| instance.setTime(rentalStartDate); | instance.setTime(rentalStartDate); | ||||
| //开始时间 | //开始时间 | ||||
| instance.add(Calendar.MONTH, month * i); | instance.add(Calendar.MONTH, month * i); | ||||
| Map<String,Object> resultMap = buildRent(leaseArr[i], receivePeriod, priceArr[i], instance.getTime(), Calendar.MONTH, wxRentContract, userId, wxMerchant, billcount,isPreview); | |||||
| Map<String, Object> resultMap = buildRent(leaseArr[i], receivePeriod, priceArrs[i], instance.getTime(), Calendar.MONTH, wxRentContract, userId, wxMerchant, billcount, isPreview); | |||||
| List<WxBillRent> billRentList = (List<WxBillRent>)resultMap.get("billList"); | List<WxBillRent> billRentList = (List<WxBillRent>)resultMap.get("billList"); | ||||
| billcount = (Integer)resultMap.get("billcount"); | billcount = (Integer)resultMap.get("billcount"); | ||||
| resultList.addAll(billRentList); | resultList.addAll(billRentList); | ||||