| @@ -73,17 +73,7 @@ public class WxRentContractHelper { | |||||
| if (wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode())) { | if (wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode())) { | ||||
| //计算每年租金基数(按面积,分铺录入) | //计算每年租金基数(按面积,分铺录入) | ||||
| //第一年 | //第一年 | ||||
| JSONArray rentInfoArray = JSONArray.parseArray(wxRentContract.getRentInfo()); | |||||
| long[] priceArr = new long[rentInfoArray.size()]; | |||||
| for (int i = 0; i < rentInfoArray.size(); i++) { | |||||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||||
| String priceStr = rentInfoObject.getString("price"); | |||||
| if (priceStr == null || priceStr.equalsIgnoreCase("NaN")) { | |||||
| priceStr = "0"; | |||||
| } | |||||
| priceArr[i] = new BigDecimal(priceStr).multiply(new BigDecimal(100)).longValue(); | |||||
| } | |||||
| List<long[]> priceList = computeRatioByShop(rentInfoArray,wxRentContract.getAdjustRatioWay(),priceArr,"adjustRatio"); | |||||
| List<long[]> priceList = computeRentPriceByShop(wxRentContract); | |||||
| return calcuteRatioByPart(priceList, "adjustRatio"); | return calcuteRatioByPart(priceList, "adjustRatio"); | ||||
| }else { | }else { | ||||
| return calcuteRentPriceByJoin(wxRentContract); | return calcuteRentPriceByJoin(wxRentContract); | ||||
| @@ -92,6 +82,20 @@ public class WxRentContractHelper { | |||||
| return calcuteRentPriceByJoin(wxRentContract); | return calcuteRentPriceByJoin(wxRentContract); | ||||
| } | } | ||||
| public static List<long[]> computeRentPriceByShop(WxRentContract wxRentContract) { | |||||
| JSONArray rentInfoArray = JSONArray.parseArray(wxRentContract.getRentInfo()); | |||||
| long[] priceArr = new long[rentInfoArray.size()]; | |||||
| for (int i = 0; i < rentInfoArray.size(); i++) { | |||||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||||
| String priceStr = rentInfoObject.getString("price"); | |||||
| if (priceStr == null || priceStr.equalsIgnoreCase("NaN")) { | |||||
| priceStr = "0"; | |||||
| } | |||||
| priceArr[i] = new BigDecimal(priceStr).multiply(new BigDecimal(100)).longValue(); | |||||
| } | |||||
| return computeRatioByShop(rentInfoArray,wxRentContract.getAdjustRatioWay(),priceArr,"adjustRatio"); | |||||
| } | |||||
| //计算每年租金基数(合铺录入) | //计算每年租金基数(合铺录入) | ||||
| private static long[] calcuteRentPriceByJoin(WxRentContract wxRentContract) { | private static long[] calcuteRentPriceByJoin(WxRentContract wxRentContract) { | ||||
| String adjustRatio = wxRentContract.getAdjustRatio(); | String adjustRatio = wxRentContract.getAdjustRatio(); | ||||
| @@ -1186,7 +1186,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if(wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode())){ | if(wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode())){ | ||||
| String rentInfo = wxRentContract.getRentInfo(); | String rentInfo = wxRentContract.getRentInfo(); | ||||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | ||||
| long[] priceList = WxRentContractHelper.computePrice(rentInfo, wxRentContract).get(0); | |||||
| long[] priceList = WxRentContractHelper.computeRentPriceByShop(wxRentContract).get(0); | |||||
| long sum = Arrays.stream(priceList).sum(); | long sum = Arrays.stream(priceList).sum(); | ||||
| int size = rentInfoArray.size(); | int size = rentInfoArray.size(); | ||||
| for (int i = 0;i < size;i++) { | for (int i = 0;i < size;i++) { | ||||
| @@ -1403,7 +1403,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| wxBillRent.setStarttime(billTimeVo.getStartDate()); | wxBillRent.setStarttime(billTimeVo.getStartDate()); | ||||
| wxBillRent.setEndtime(billTimeVo.getEndDate()); | wxBillRent.setEndtime(billTimeVo.getEndDate()); | ||||
| wxBillRent.setReceiveDate(billTimeVo.getReceiveDate()); | wxBillRent.setReceiveDate(billTimeVo.getReceiveDate()); | ||||
| ```11111111 | |||||
| wxBillRent.setContractNeedPay(needpay); | wxBillRent.setContractNeedPay(needpay); | ||||
| wxBillRent.setRentPriceInfo(getRentPriceInfo(wxRentContract,needpay)); | wxBillRent.setRentPriceInfo(getRentPriceInfo(wxRentContract,needpay)); | ||||
| wxBillRent.setNeedPay(needpay); | wxBillRent.setNeedPay(needpay); | ||||
| @@ -2659,7 +2659,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| adjustRatioList.add(adjustRatioStr.toString()); | adjustRatioList.add(adjustRatioStr.toString()); | ||||
| } | } | ||||
| List<long[]> priceList = WxRentContractHelper.computePrice(rentInfo, wxRentContract); | |||||
| List<long[]> priceList = WxRentContractHelper.computeRentPriceByShop(wxRentContract); | |||||
| int size = priceList.size(); | int size = priceList.size(); | ||||
| priceArrs = new long[size]; | priceArrs = new long[size]; | ||||
| for (int i = 0; i < size; i++) { | for (int i = 0; i < size; i++) { | ||||