Просмотр исходного кода

[合同][修改][优化合同需求]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
49f4b0774f
2 измененных файлов: 29 добавлений и 20 удалений
  1. +14
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  2. +15
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 14
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java Просмотреть файл

@@ -113,21 +113,25 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
Double rentPrice = rentInfoObject.getDouble("rentPrice"); Double rentPrice = rentInfoObject.getDouble("rentPrice");
Long price = wxPropertyContract.getPrice()/100; Long price = wxPropertyContract.getPrice()/100;
if(rentPrice == null){ if(rentPrice == null){
Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea());
rentPrice = new BigDecimal((float)price/rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
rentInfoObject.put("rentPrice",rentPrice);
if(wxPropertyContract.getRentArea() != null) {
Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea());
rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
rentInfoObject.put("rentPrice", rentPrice);
}
} }
} }
wxPropertyContract.setRentInfo(rentInfoArray.toJSONString()); wxPropertyContract.setRentInfo(rentInfoArray.toJSONString());
}else{ }else{
if(wxPropertyContract.getRentPrice() == null || "0".equals(wxPropertyContract.getRentPrice())){ if(wxPropertyContract.getRentPrice() == null || "0".equals(wxPropertyContract.getRentPrice())){
Long price = wxPropertyContract.getPrice()/100;
Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea());
Double rentPrice = new BigDecimal((float)price/rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
if(rentPrice > 0){
wxPropertyContract.setRentPrice(rentPrice.toString());
}else{
wxPropertyContract.setRentPrice("0");
if(wxPropertyContract.getRentArea()!=null) {
Long price = wxPropertyContract.getPrice() / 100;
Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea());
Double rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
if (rentPrice > 0) {
wxPropertyContract.setRentPrice(rentPrice.toString());
} else {
wxPropertyContract.setRentPrice("0");
}
} }
} }
} }


+ 15
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -136,22 +136,27 @@ public class WxRentContractServiceImpl implements WxRentContractService {
Double rentPrice = rentInfoObject.getDouble("rentPrice"); Double rentPrice = rentInfoObject.getDouble("rentPrice");
Long price = wxRentContract.getPrice()/100; Long price = wxRentContract.getPrice()/100;
if(rentPrice == null){ if(rentPrice == null){
Double rentArea = Double.parseDouble(wxRentContract.getRentArea());
rentPrice = new BigDecimal((float)price/rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
rentInfoObject.put("rentPrice",rentPrice);
if(wxRentContract.getRentArea() != null) {
Double rentArea = Double.parseDouble(wxRentContract.getRentArea());
rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
rentInfoObject.put("rentPrice", rentPrice);
}
} }
} }
wxRentContract.setRentInfo(rentInfoArray.toJSONString()); wxRentContract.setRentInfo(rentInfoArray.toJSONString());
}else{ }else{
if(wxRentContract.getRentPrice() == null || "0".equals(wxRentContract.getRentPrice())){ if(wxRentContract.getRentPrice() == null || "0".equals(wxRentContract.getRentPrice())){
Long price = wxRentContract.getPrice()/100;
Double rentArea = Double.parseDouble(wxRentContract.getRentArea());
Double rentPrice = new BigDecimal((float)price/rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
if(rentPrice > 0){
wxRentContract.setRentPrice(rentPrice.toString());
}else{
wxRentContract.setRentPrice("0");
if(wxRentContract.getRentArea() != null){
Long price = wxRentContract.getPrice()/100;
Double rentArea = Double.parseDouble(wxRentContract.getRentArea());
Double rentPrice = new BigDecimal((float)price/rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
if(rentPrice > 0){
wxRentContract.setRentPrice(rentPrice.toString());
}else{
wxRentContract.setRentPrice("0");
}
} }

} }
} }
if(wxRentContract.getPriceUnit() == null){ if(wxRentContract.getPriceUnit() == null){


Загрузка…
Отмена
Сохранить