From 43edb57c071053e8a182acf569cffaf9ed4b8aff Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Tue, 11 Jun 2024 16:50:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/user/expand/IUserExpandDao.java | 3 + .../pojo/pos/user/expand/UserExpandPO.java | 66 +++++++++++++++++++ .../handler/LoginHandlerServiceImpl.java | 25 +++++++ .../user/expand/UserExpandServiceImpl.java | 7 ++ .../mapper/user/expand/user-expand.xml | 25 +++++++ .../templates/user/expand/save-or-update.html | 23 +++---- 6 files changed, 138 insertions(+), 11 deletions(-) create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/pos/user/expand/UserExpandPO.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/login/handler/LoginHandlerServiceImpl.java diff --git a/src/main/java/cn/com/tenlion/operator/dao/user/expand/IUserExpandDao.java b/src/main/java/cn/com/tenlion/operator/dao/user/expand/IUserExpandDao.java index 3790345..9970369 100644 --- a/src/main/java/cn/com/tenlion/operator/dao/user/expand/IUserExpandDao.java +++ b/src/main/java/cn/com/tenlion/operator/dao/user/expand/IUserExpandDao.java @@ -1,6 +1,7 @@ package cn.com.tenlion.operator.dao.user.expand; import cn.com.tenlion.operator.pojo.dtos.user.expand.UserExpandDTO; +import cn.com.tenlion.operator.pojo.pos.user.expand.UserExpandPO; import org.springframework.stereotype.Repository; import java.util.Map; @@ -21,4 +22,6 @@ public interface IUserExpandDao { UserExpandDTO get(Map params); + UserExpandPO getPO(Map params); + } diff --git a/src/main/java/cn/com/tenlion/operator/pojo/pos/user/expand/UserExpandPO.java b/src/main/java/cn/com/tenlion/operator/pojo/pos/user/expand/UserExpandPO.java new file mode 100644 index 0000000..e1abc2a --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/pos/user/expand/UserExpandPO.java @@ -0,0 +1,66 @@ +package cn.com.tenlion.operator.pojo.pos.user.expand; + +/** + * @ClassName: UserExpandDTO + * @Description: + * @Author: wanggeng + * @Date: 2024/6/11 上午10:39 + * @Version: 1.0 + */ +public class UserExpandPO { + + private Long priceAdditionalPkg; + private Long priceAdditionalVideoDemo; + private Long priceAll; + private Long priceMaterial; + private Long priceMaterialAgent; + private Long priceMaterialAgentUrgent; + + public Long getPriceAdditionalPkg() { + return priceAdditionalPkg == null ? 0 : priceAdditionalPkg; + } + + public void setPriceAdditionalPkg(Long priceAdditionalPkg) { + this.priceAdditionalPkg = priceAdditionalPkg; + } + + public Long getPriceAdditionalVideoDemo() { + return priceAdditionalVideoDemo == null ? 0 : priceAdditionalVideoDemo; + } + + public void setPriceAdditionalVideoDemo(Long priceAdditionalVideoDemo) { + this.priceAdditionalVideoDemo = priceAdditionalVideoDemo; + } + + public Long getPriceAll() { + return priceAll == null ? 0 : priceAll; + } + + public void setPriceAll(Long priceAll) { + this.priceAll = priceAll; + } + + public Long getPriceMaterial() { + return priceMaterial == null ? 0 : priceMaterial; + } + + public void setPriceMaterial(Long priceMaterial) { + this.priceMaterial = priceMaterial; + } + + public Long getPriceMaterialAgent() { + return priceMaterialAgent == null ? 0 : priceMaterialAgent; + } + + public void setPriceMaterialAgent(Long priceMaterialAgent) { + this.priceMaterialAgent = priceMaterialAgent; + } + + public Long getPriceMaterialAgentUrgent() { + return priceMaterialAgentUrgent == null ? 0 : priceMaterialAgentUrgent; + } + + public void setPriceMaterialAgentUrgent(Long priceMaterialAgentUrgent) { + this.priceMaterialAgentUrgent = priceMaterialAgentUrgent; + } +} diff --git a/src/main/java/cn/com/tenlion/operator/service/login/handler/LoginHandlerServiceImpl.java b/src/main/java/cn/com/tenlion/operator/service/login/handler/LoginHandlerServiceImpl.java new file mode 100644 index 0000000..eb9c474 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/login/handler/LoginHandlerServiceImpl.java @@ -0,0 +1,25 @@ +package cn.com.tenlion.operator.service.login.handler; + +import cn.com.tenlion.operator.pojo.pos.user.expand.UserExpandPO; +import cn.com.tenlion.operator.service.user.expand.UserExpandServiceImpl; +import ink.wgink.interfaces.expand.login.ILoginHandlerService; +import ink.wgink.interfaces.user.IUserExpandBaseService; +import ink.wgink.pojo.bos.LoginUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class LoginHandlerServiceImpl implements ILoginHandlerService { + + @Autowired + private UserExpandServiceImpl userExpandService; + + @Override + public void handle(LoginUser loginUser) throws Exception { + UserExpandPO po = userExpandService.getPO(loginUser.getUserId()); + if (po == null) { + po = new UserExpandPO(); + } + loginUser.setExpandData(po); + } +} diff --git a/src/main/java/cn/com/tenlion/operator/service/user/expand/UserExpandServiceImpl.java b/src/main/java/cn/com/tenlion/operator/service/user/expand/UserExpandServiceImpl.java index aa820f3..524356b 100644 --- a/src/main/java/cn/com/tenlion/operator/service/user/expand/UserExpandServiceImpl.java +++ b/src/main/java/cn/com/tenlion/operator/service/user/expand/UserExpandServiceImpl.java @@ -2,6 +2,7 @@ package cn.com.tenlion.operator.service.user.expand; import cn.com.tenlion.operator.dao.user.expand.IUserExpandDao; import cn.com.tenlion.operator.pojo.dtos.user.expand.UserExpandDTO; +import cn.com.tenlion.operator.pojo.pos.user.expand.UserExpandPO; import cn.com.tenlion.operator.pojo.vos.user.expand.UserExpandVO; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.exceptions.SearchException; @@ -51,6 +52,12 @@ public class UserExpandServiceImpl extends DefaultBaseService implements IUserEx return get(userDTO); } + public UserExpandPO getPO(String userId) { + Map params = getHashMap(2); + params.put("userId", userId); + return userExpandDao.getPO(params); + } + private UserExpandDTO get(UserDTO userDTO) { if (userDTO == null) { throw new SearchException("用户不存在"); diff --git a/src/main/resources/mybatis/mapper/user/expand/user-expand.xml b/src/main/resources/mybatis/mapper/user/expand/user-expand.xml index 3a935d7..4daafa9 100644 --- a/src/main/resources/mybatis/mapper/user/expand/user-expand.xml +++ b/src/main/resources/mybatis/mapper/user/expand/user-expand.xml @@ -11,6 +11,15 @@ + + + + + + + + + INSERT INTO sys_user_expand ( user_id, @@ -61,4 +70,20 @@ + + \ No newline at end of file diff --git a/src/main/resources/templates/user/expand/save-or-update.html b/src/main/resources/templates/user/expand/save-or-update.html index 7ee0e3a..1863e5b 100644 --- a/src/main/resources/templates/user/expand/save-or-update.html +++ b/src/main/resources/templates/user/expand/save-or-update.html @@ -20,9 +20,9 @@
-
价格设置¥,保留两位小数,使用系统默认金额,设置为0即可
+
【项目价格设置】单位为元(¥),可保留两位小数,如要使用系统默认金额,设置为0即可
-
+
@@ -30,7 +30,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
@@ -46,9 +46,7 @@
-
-
-
+
@@ -56,15 +54,18 @@
-
+
+
【项目附加费用】单位为元(¥),可保留两位小数,如要使用系统默认金额,设置为0即可
+
+
- +
- +
-
+