| @@ -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"); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -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){ | ||||