Sfoglia il codice sorgente

fix bug

release_toaliyun_real
zhengfangyuan 3 anni fa
parent
commit
3aa09c3da4
2 ha cambiato i file con 18 aggiunte e 14 eliminazioni
  1. +15
    -11
      mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java
  2. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 15
- 11
mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java Vedi File

@@ -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();


+ 3
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Vedi File

@@ -1186,7 +1186,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
if(wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode())){
String rentInfo = wxRentContract.getRentInfo();
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();
int size = rentInfoArray.size();
for (int i = 0;i < size;i++) {
@@ -1403,7 +1403,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
wxBillRent.setStarttime(billTimeVo.getStartDate());
wxBillRent.setEndtime(billTimeVo.getEndDate());
wxBillRent.setReceiveDate(billTimeVo.getReceiveDate());
```11111111
wxBillRent.setContractNeedPay(needpay);
wxBillRent.setRentPriceInfo(getRentPriceInfo(wxRentContract,needpay));
wxBillRent.setNeedPay(needpay);
@@ -2659,7 +2659,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
adjustRatioList.add(adjustRatioStr.toString());
}
List<long[]> priceList = WxRentContractHelper.computePrice(rentInfo, wxRentContract);
List<long[]> priceList = WxRentContractHelper.computeRentPriceByShop(wxRentContract);
int size = priceList.size();
priceArrs = new long[size];
for (int i = 0; i < size; i++) {


Caricamento…
Annulla
Salva