|
|
|
@@ -761,7 +761,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
|
|
|
|
//计算租金,每年-每个店铺租金 |
|
|
|
public List<long[]> computePrice(String rentInfo,Integer priceUnit) { |
|
|
|
public List<long[]> computePrice(String rentInfo, WxRentContract wxRentContract) { |
|
|
|
|
|
|
|
JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); |
|
|
|
int arraySize = rentInfoArray.size(); |
|
|
|
@@ -777,18 +777,32 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
JSONObject rentInfoObject = rentInfoArray.getJSONObject(0); |
|
|
|
JSONArray adjustRatio = rentInfoObject.getJSONArray("adjustRatio"); |
|
|
|
int adjustRatioSize = adjustRatio.size(); |
|
|
|
|
|
|
|
for (int i = 0; i < adjustRatioSize; i++) { |
|
|
|
long[] priceArrs = new long[arraySize]; |
|
|
|
for (int j = 0; j < arraySize; j++) { |
|
|
|
rentInfoObject = rentInfoArray.getJSONObject(j); |
|
|
|
adjustRatio = rentInfoObject.getJSONArray("adjustRatio"); |
|
|
|
BigDecimal multiply = new BigDecimal(priceList.get(i)[j]).multiply(new BigDecimal(adjustRatio.getString(i)).divide(new BigDecimal(100))); |
|
|
|
BigDecimal price = new BigDecimal(priceList.get(i)[j]).add(multiply); |
|
|
|
priceArrs[j] = price.setScale(0, RoundingMode.HALF_EVEN).longValue(); |
|
|
|
//判断年租金调整方式 |
|
|
|
if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { |
|
|
|
for (int i = 0; i < adjustRatioSize; i++) { |
|
|
|
long[] priceArrs = new long[arraySize]; |
|
|
|
for (int j = 0; j < arraySize; j++) { |
|
|
|
rentInfoObject = rentInfoArray.getJSONObject(j); |
|
|
|
adjustRatio = rentInfoObject.getJSONArray("adjustRatio"); |
|
|
|
BigDecimal multiply = new BigDecimal(priceList.get(i)[j]).multiply(new BigDecimal(adjustRatio.getString(i)).divide(new BigDecimal(100))); |
|
|
|
BigDecimal price = new BigDecimal(priceList.get(i)[j]).add(multiply); |
|
|
|
priceArrs[j] = price.setScale(0, RoundingMode.HALF_EVEN).longValue(); |
|
|
|
} |
|
|
|
priceList.add(priceArrs); |
|
|
|
} |
|
|
|
} else { |
|
|
|
for (int i = 0; i < adjustRatioSize; i++) { |
|
|
|
long[] priceArrs = new long[arraySize]; |
|
|
|
for (int j = 0; j < arraySize; j++) { |
|
|
|
rentInfoObject = rentInfoArray.getJSONObject(j); |
|
|
|
adjustRatio = rentInfoObject.getJSONArray("adjustRatio"); |
|
|
|
BigDecimal price = new BigDecimal(priceList.get(i)[j]).add(new BigDecimal(adjustRatio.getString(i))); |
|
|
|
priceArrs[j] = price.setScale(0, RoundingMode.HALF_EVEN).longValue(); |
|
|
|
} |
|
|
|
priceList.add(priceArrs); |
|
|
|
} |
|
|
|
priceList.add(priceArrs); |
|
|
|
} |
|
|
|
|
|
|
|
return priceList; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -797,10 +811,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
long[] priceArrs = null; |
|
|
|
List<Map<String, Object>> shopInfos = new ArrayList<>(); |
|
|
|
if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) && |
|
|
|
wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode()) && |
|
|
|
!wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { |
|
|
|
String rentInfo = wxRentContract.getRentInfo(); |
|
|
|
JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); |
|
|
|
List<long[]> priceList = computePrice(rentInfo,wxRentContract.getPriceUnit()); |
|
|
|
List<long[]> priceList = computePrice(rentInfo, wxRentContract); |
|
|
|
size = priceList.size(); |
|
|
|
priceArrs = new long[size]; |
|
|
|
for (int i = 0; i < size; i++) { |
|
|
|
@@ -1693,7 +1708,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
adjustRatioList.add(adjustRatioStr.toString()); |
|
|
|
} |
|
|
|
List<long[]> priceList = computePrice(rentInfo,wxRentContract.getPriceUnit()); |
|
|
|
List<long[]> priceList = computePrice(rentInfo, wxRentContract); |
|
|
|
int size = priceList.size(); |
|
|
|
priceArrs = new long[size]; |
|
|
|
for (int i = 0; i < size; i++) { |
|
|
|
|