diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index b00a73034..59a303c6e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/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(); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 40a39c0d6..c0db34182 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/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();