@@ -995,7 +995,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
for (int i = 0; i < arraySize; i++) {
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i);
String priceStr = rentInfoObject.getString("price");
if(priceStr.equalsIgnoreCase("NaN")) {
if (priceStr.equalsIgnoreCase("NaN")) {
priceStr = "0";
}
priceArr[i] = new BigDecimal(priceStr).multiply(new BigDecimal(100)).longValue();
@@ -1018,7 +1018,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
priceList.add(priceArrs);
}
} else {
return priceList;
}
if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.MONEY.getCode())) {
for (int i = 0; i < adjustRatioSize; i++) {
long[] priceArrs = new long[arraySize];
for (int j = 0; j < arraySize; j++) {
@@ -1029,12 +1031,24 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
priceList.add(priceArrs);
}
return priceList;
}
if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.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 price = new BigDecimal(adjustRatio.getString(i)).multiply(new BigDecimal(100));
priceArrs[j] = price.setScale(0, RoundingMode.HALF_EVEN).longValue();
}
priceList.add(priceArrs);
}
}
return priceList;
}
public List<WxBillRent> buildRentMonth(Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview,boolean saveDb) {
public List<WxBillRent> buildRentMonth(Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview, boolean saveDb) {
int size = 0;
long[] priceArrs = null;
List<Map<String, Object>> shopInfos = new ArrayList<>();
@@ -1079,11 +1093,15 @@ public class WxRentContractServiceImpl implements WxRentContractService {
priceD = priceD.add(divide);
priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue();
}
} else {
} else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.MONEY.getCode())) {
for (int i = 1; i < size; i++) {
priceD = priceD.add(new BigDecimal(integers.get(i)));
priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue();
}
} else {
for (int i = 1; i < size; i++) {
priceArrs[i] = new BigDecimal(integers.get(i)).setScale(0, RoundingMode.HALF_EVEN).longValue();
}
}
}