From d299420aba3a19363755cee0c2b2d8ae93fea928 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期一, 01 九月 2025 15:44:30 +0800
Subject: [PATCH] bug修改

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentListVO.java            |    3 +++
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipDetailController.java |   14 +++++++++++---
 cloud-server-management/src/main/webapp/static/modular/system/vipPayment/vipPayment.js                      |   12 +++++++++++-
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipDetailController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipDetailController.java
index b93091d..7a88661 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipDetailController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TVipDetailController.java
@@ -1,12 +1,14 @@
 package com.dsh.guns.modular.system.controller.code;
 
 import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.dsh.course.feignClient.account.AppUserClient;
 import com.dsh.course.feignClient.account.VipPaymentClient;
 import com.dsh.course.feignClient.account.model.QueryByNamePhone;
 import com.dsh.course.feignClient.account.model.TAppUser;
 import com.dsh.course.feignClient.activity.CouponClient;
 import com.dsh.course.feignClient.activity.model.HuiminPayQuery;
+import com.dsh.guns.config.UserExt;
 import com.dsh.guns.core.base.controller.BaseController;
 import com.dsh.guns.core.base.tips.SuccessTip;
 import com.dsh.guns.modular.system.model.*;
@@ -43,13 +45,11 @@
     @Autowired
     private CouponClient couponClient;
     @Autowired
-    private IStoreService storeService;
+    private IRelationService relationService;
     @Autowired
     private AppUserClient appUserClient;
     @Autowired
     private VipPaymentClient vipPaymentClient;
-    @Autowired
-    private ITSiteService siteService;
     @Autowired
     private TOperatorService operatorService;
     private String PREFIX = "/system/vipPayment/";
@@ -73,6 +73,9 @@
             , Integer isRefund
             , String time
             ) {
+        // 判断当前是否有权限
+        String roleid = UserExt.getUser().getRoleid();
+        int count = relationService.count(new LambdaQueryWrapper<Relation>().eq(Relation::getRoleid, roleid).eq(Relation::getMenuid, 646));
         VipPaymentDto vipPaymentDto = new VipPaymentDto();
         if (StringUtils.hasLength(vipName)){
             List<Integer> vipIds = vipService.lambdaQuery().like(Vip::getVipName, vipName)
@@ -146,7 +149,12 @@
                 re.setAppUserName(appUser.getName());
                 re.setAppUserPhone(appUser.getPhone());
             }
+            if (count>0){
+                re.setMenuShow(1);
+            }
+
         }
+
         return res;
     }
     /**
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentListVO.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentListVO.java
index b089a96..9c7e193 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentListVO.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentListVO.java
@@ -67,5 +67,8 @@
     @TableField("state")
     private Integer state;
 
+    @ApiModelProperty(value = "菜单显示 1显示 2不显示")
+    private Integer menuShow=2;
+
 
 }
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/vipPayment/vipPayment.js b/cloud-server-management/src/main/webapp/static/modular/system/vipPayment/vipPayment.js
index d8cd0ee..5642d72 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/vipPayment/vipPayment.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/vipPayment/vipPayment.js
@@ -28,17 +28,27 @@
                 return {0:"否",1:"是"}[data]
             }
         },
+        {title: '权限展示', field: 'menuShow', visible: false, align: 'center', valign: 'middle',
+            formatter:function (data) {
+                return {2:"否",1:"是"}[data]
+            }
+        },
         {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle'},
         { title: '操作', field: 'remark', visible: true, align: 'center', valign: 'middle',
             formatter: function (data,row) {
                 // row.redCode存储的设备二维码连接
                 var temp = row.isRefund;
+                var menuShow = row.menuShow;
                 var id = row.id;
                 // 已退费不展示按钮
-                if (temp==0){
+                if (temp==0 && menuShow==1){
                     var str = '<button class="btn btn-outline btn-primary" onclick="TCompetition.refund(\'' + id + '\')" >'+'会员退费'+'</button>'
                     btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>']
                     return btn;
+                }else if (temp==0 && menuShow==2){
+                    var str = '<button class="btn btn-outline btn-primary" onclick="TCompetition.refund(\'' + id + '\')" disabled>'+'会员退费'+'</button>'
+                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>']
+                    return btn;
                 }else{
                     return '已退费';
                 }

--
Gitblit v1.7.1