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

[合同][修改][计租面积为0报错]

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

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

@@ -111,7 +111,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
Double rentPrice = rentInfoObject.getDouble("rentPrice");
Long price = wxPropertyContract.getPrice()/100;
if(rentPrice == null){
if(StringUtils.isNotBlank(wxPropertyContract.getRentArea())) {
if(StringUtils.isNotBlank(wxPropertyContract.getRentArea()) && !"0".equals(wxPropertyContract.getRentArea()) && !"0.00".equals(wxPropertyContract.getRentArea())&& !"0.0".equals(wxPropertyContract.getRentArea()) ) {
Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea());
rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
rentInfoObject.put("rentPrice", rentPrice);
@@ -120,8 +120,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}
wxPropertyContract.setRentInfo(rentInfoArray.toJSONString());
}else{
if(wxPropertyContract.getRentPrice() == null || "0".equals(wxPropertyContract.getRentPrice())){
if(StringUtils.isNotBlank(wxPropertyContract.getRentArea())) {
if(StringUtils.isNotBlank(wxPropertyContract.getRentArea()) && !"0".equals(wxPropertyContract.getRentArea()) && !"0.00".equals(wxPropertyContract.getRentArea())&& !"0.0".equals(wxPropertyContract.getRentArea()) ) {
if(StringUtils.isNotBlank(wxPropertyContract.getRentArea()) && !"0".equals(wxPropertyContract.getRentArea()) && !"0.00".equals(wxPropertyContract.getRentArea())) {
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();


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

@@ -149,7 +149,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
Double rentPrice = rentInfoObject.getDouble("rentPrice");
Long price = wxRentContract.getPrice()/100;
if(rentPrice == null){
if(StringUtils.isNotBlank(wxRentContract.getRentArea())) {
if(StringUtils.isNotBlank(wxRentContract.getRentArea()) && !"0".equals(wxRentContract.getRentArea()) && !"0.00".equals(wxRentContract.getRentArea()) && !"0.0".equals(wxRentContract.getRentArea()) ) {
Double rentArea = Double.parseDouble(wxRentContract.getRentArea());
rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
rentInfoObject.put("rentPrice", rentPrice);
@@ -159,7 +159,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
wxRentContract.setRentInfo(rentInfoArray.toJSONString());
}else{
if(wxRentContract.getRentPrice() == null || "0".equals(wxRentContract.getRentPrice())){
if(StringUtils.isNotBlank(wxRentContract.getRentArea())) {
if(StringUtils.isNotBlank(wxRentContract.getRentArea()) && !"0".equals(wxRentContract.getRentArea()) && !"0.00".equals(wxRentContract.getRentArea()) && !"0.0".equals(wxRentContract.getRentArea()) ) {
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();


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