From cd1dfa246fa9053db5ade099ecf5062aba492cb0 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 24 Jul 2019 15:13:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BA=97=E9=93=BA][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=8F=82=E8=80=83=E7=A7=9F=E9=87=91]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/iformall/domain/po/WxShop.java | 11 ++++++++++- .../com/iformall/service/impl/WxShopServiceImpl.java | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java index 721e41061..fcc439029 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java @@ -126,7 +126,16 @@ public class WxShop extends BaseEntity { private Integer freeDay; @io.swagger.annotations.ApiModelProperty(value = "参考租金", name = "rent") - private Integer rent; + private Long rent; + + public String getRentStr() { + return rent != null ? new BigDecimal(rent).divide(new BigDecimal(100)).setScale(2).toPlainString() : "0"; + } + + @Transient + @io.swagger.annotations.ApiModelProperty(value = "参考租金", name = "rentStr") + private String rentStr; + @io.swagger.annotations.ApiModelProperty(value = "预置业态", name = "businessId") private Long businessId; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java index 943d4d1e0..41f6a95ab 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java @@ -25,6 +25,7 @@ import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; import java.util.*; @Service @@ -71,6 +72,10 @@ public class WxShopServiceImpl implements WxShopService { @Override public ResultData saveOrUpdate(WxShop record) { + if (StringUtils.isNotEmpty(record.getRentStr())) { + long rent = new BigDecimal(record.getRentStr()).multiply(new BigDecimal(100)).longValue(); + record.setRent(rent); + } if (record.getId() == null) { final IdWorker idWorker = IdWorker.get(); record.setId(idWorker.nextId());