From b96e4239d3ae6cd8b6244ed13b5c3fbaa673fedb Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期一, 18 八月 2025 00:23:38 +0800
Subject: [PATCH] 会员协议

---
 cloud-server-account/src/main/java/com/dsh/account/vo/VipPaymentVO.java                                 |    2 ++
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipController.java   |   19 +++++++++++++++++++
 cloud-server-account/src/main/java/com/dsh/account/service/impl/VipPaymentServiceImpl.java              |    4 ++--
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAgreeController.java |   13 +++++++++++++
 cloud-server-account/src/main/java/com/dsh/account/feignclient/other/VipClient.java                     |    2 ++
 cloud-server-management/src/main/webapp/WEB-INF/view/system/tAgreement/tAgreementDriver.html            |   18 ++++++++++++++++++
 6 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/cloud-server-account/src/main/java/com/dsh/account/feignclient/other/VipClient.java b/cloud-server-account/src/main/java/com/dsh/account/feignclient/other/VipClient.java
index c85a845..fdc44f7 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/feignclient/other/VipClient.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/feignclient/other/VipClient.java
@@ -24,5 +24,7 @@
     List<Vip> listAll();
     @PostMapping("/vip/getVipByIds")
     List<Vip> getVipByIds(@RequestBody String ids);
+    @PostMapping("/vip/getAgreement")
+    String getAgreement();
 
 }
diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/VipPaymentServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/VipPaymentServiceImpl.java
index 55b5a3d..fab2ff4 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/VipPaymentServiceImpl.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/VipPaymentServiceImpl.java
@@ -129,7 +129,7 @@
         String code = vipPayment.getCode();
         String amount = vipPayment.getAmount().toString();
         ResultUtil alipay = payMoneyUtil.alipay
-                (smid, "购买年度会员", "购买年度会员",
+                (smid, "购买会员", "购买会员",
                         vipPayment.getAppUserId() + "",
                         code, vipPayment.getAmount().toString(),
                         "/base/appUser/addVipPaymentAliCallback");
@@ -280,7 +280,7 @@
             grantCoupon.setTicketJson(ticketJson);
         }
         // 远程调用 给用户送优惠券和门票
-        userConponClient.granCoupon(grantCoupon);
+        userConponClient.grantCoupon(grantCoupon);
 
         // 注册会员送券 先判断是否有注册送券类型的优惠券 判断优惠券状态 审核是否通过 是否删除 是否在有效期内 是否领取数量达上限
         List<Long> longs = userConponClient.queryCouponByUser(appUser.getId());
diff --git a/cloud-server-account/src/main/java/com/dsh/account/vo/VipPaymentVO.java b/cloud-server-account/src/main/java/com/dsh/account/vo/VipPaymentVO.java
index f1b9917..fa8e6cc 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/vo/VipPaymentVO.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/vo/VipPaymentVO.java
@@ -21,5 +21,7 @@
     private Integer isVip;
     @ApiModelProperty(value = "所有上架的会员卡")
     private List<Vip> vipList;
+    @ApiModelProperty(value = "会员协议")
+    private String agreement;
 
 }
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAgreeController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAgreeController.java
index 01029be..6ac41f4 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAgreeController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAgreeController.java
@@ -53,11 +53,24 @@
         Protocol three = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 3));
         Protocol four = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 4));
         Protocol five = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 5));
+        Protocol six = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 6));
         model.addAttribute("one",one);
         model.addAttribute("two",two);
         model.addAttribute("three",three);
         model.addAttribute("four",four);
         model.addAttribute("five",five);
+        if (six == null){
+            Protocol protocol = new Protocol();
+            protocol.setType(6);
+            protocol.setContent("");
+            protocol.setInsertTime(new Date());
+            protocolService.save( protocol);
+
+            model.addAttribute("six",protocol);
+        }else{
+            model.addAttribute("six",six);
+        }
+
         return PREFIX + "tAgreementDriver.html";
     }
 
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipController.java
index 08f1f7d..58c4f4e 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipController.java
@@ -11,6 +11,7 @@
 import com.dsh.guns.core.base.controller.BaseController;
 import com.dsh.guns.core.common.constant.factory.PageFactory;
 import com.dsh.guns.modular.system.model.*;
+import com.dsh.guns.modular.system.service.IProtocolService;
 import com.dsh.guns.modular.system.service.IStoreService;
 import com.dsh.guns.modular.system.service.IVipService;
 import com.dsh.guns.modular.system.util.ResultUtil;
@@ -440,6 +441,24 @@
         }
         return list;
     }
+    @Autowired
+    private IProtocolService protocolService;
+    @ResponseBody
+    @PostMapping("/getAgreement")
+    public String getAgreement() {
+        Protocol one = protocolService.lambdaQuery().eq(Protocol::getType, 6).one();
+        if (one==null){
+            Protocol protocol = new Protocol();
+            protocol.setType(6);
+            protocol.setContent("");
+            protocol.setInsertTime(new Date());
+            protocolService.save( protocol);
+            return  "";
+        }else{
+            return one.getContent();
+
+        }
+    }
 
     @ResponseBody
     @PostMapping("/getVipByIds")
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tAgreement/tAgreementDriver.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tAgreement/tAgreementDriver.html
index 20e7867..23c6ff9 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tAgreement/tAgreementDriver.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tAgreement/tAgreementDriver.html
@@ -17,6 +17,7 @@
                                 <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">运动安全告知书</a></li>
                                 <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">注销账号说明</a></li>
                                 <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">社区世界杯报名协议</a></li>
+                                <li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false">会员协议</a></li>
                             </ul>
                             <div class="tab-content">
                                 <div id="tab-1" class="tab-pane active">
@@ -67,6 +68,16 @@
                                         <div class="row btn-group-m-t">
                                             <div class="col-sm-10 col-sm-offset-5">
                                                 <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="update_5(${five.id});"/>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div id="tab-6" class="tab-pane">
+                                    <div class="panel-body">
+                                        <textarea type="text/plain" id="editor_6" style="width:1200px;height:400px;">${six.content}</textarea>
+                                        <div class="row btn-group-m-t">
+                                            <div class="col-sm-10 col-sm-offset-5">
+                                                <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="update_6(${six.id});"/>
                                             </div>
                                         </div>
                                     </div>
@@ -130,6 +141,13 @@
         }
         submitData(editor_5.getContent(),id);
     }
+    function update_6(id){
+        if (editor_6.getContentTxt() == ""){
+            Feng.error("内容不能为空!");
+            return;
+        }
+        submitData(editor_6.getContent(),id);
+    }
 
     function submitData(content,id) {
         //提交信息

--
Gitblit v1.7.1