|
|
|
@@ -73,17 +73,7 @@ public class WxRentContractHelper { |
|
|
|
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"); |
|
|
|
}else { |
|
|
|
return calcuteRentPriceByJoin(wxRentContract); |
|
|
|
@@ -92,6 +82,20 @@ public class WxRentContractHelper { |
|
|
|
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) { |
|
|
|
String adjustRatio = wxRentContract.getAdjustRatio(); |
|
|
|
|