From cd1dfa246fa9053db5ade099ecf5062aba492cb0 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 24 Jul 2019 15:13:45 +0800 Subject: [PATCH 1/2] =?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()); From 534c30ae751b59bbd702c3c2dc136124b30a8691 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 24 Jul 2019 15:44:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=BA=97=E9=93=BA][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=8F=82=E8=80=83=E7=A7=9F=E9=87=91=E7=B1=BB=E5=9E=8B]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V201907241543__G_ALTER_SHOP.sql | 1 + .../src/main/java/com/iformall/domain/po/WxShop.java | 11 +---------- .../com/iformall/service/impl/WxShopServiceImpl.java | 5 ----- 3 files changed, 2 insertions(+), 15 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201907241543__G_ALTER_SHOP.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201907241543__G_ALTER_SHOP.sql b/mallinkAdmin/src/main/resources/db/migration/V201907241543__G_ALTER_SHOP.sql new file mode 100644 index 000000000..c24a0102d --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201907241543__G_ALTER_SHOP.sql @@ -0,0 +1 @@ +alter table wx_shop modify `rent` varchar(20) DEFAULT '' COMMENT '参与租金'; \ No newline at end of file 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 fcc439029..af7f1d16a 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java @@ -126,16 +126,7 @@ public class WxShop extends BaseEntity { private Integer freeDay; @io.swagger.annotations.ApiModelProperty(value = "参考租金", name = "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; - + private String rent; @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 41f6a95ab..943d4d1e0 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java @@ -25,7 +25,6 @@ import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.math.BigDecimal; import java.util.*; @Service @@ -72,10 +71,6 @@ 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());