From b1fb83530b7105e4aa73e4101727dea945eb01c2 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 29 八月 2025 21:48:15 +0800
Subject: [PATCH] bug修改

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
index 8c99b48..4370fa7 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
@@ -12,6 +12,7 @@
 import com.dsh.course.feignClient.account.model.TAppUser;
 import com.dsh.course.feignClient.activity.CouponClient;
 import com.dsh.course.feignClient.activity.model.*;
+import com.dsh.course.feignClient.other.model.Site;
 import com.dsh.guns.config.UserExt;
 import com.dsh.guns.core.base.tips.SuccessTip;
 import com.dsh.guns.core.common.constant.factory.PageFactory;
@@ -65,6 +66,8 @@
     private TOperatorService operatorService;
     @Autowired
     private TOperatorCityService operatorCityService;
+    @Autowired
+    private ITSiteService siteService;
 
     /**
      * 跳转到优惠券管理首页
@@ -186,7 +189,23 @@
     @RequestMapping("/updateType")
     @ResponseBody
     public Object updateType(Long id) {
-        client.updateType(id);
+        if (UserExt.getUser().getObjectType()==1){
+            client.updateType(id);
+        }
+        if (UserExt.getUser().getObjectType()!=1){
+            if (UserExt.getUser().getObjectType()==2){
+                TStore tStore = storeService.getById(UserExt.getUser().getObjectId());
+                client.updateTypeOther(id,tStore.getOperatorId()==null?0:tStore.getOperatorId(),
+                        tStore.getId(),0);
+            }
+            if (UserExt.getUser().getObjectType()==3){
+                TSite site = siteService.getById(UserExt.getUser().getObjectId());
+                TStore tStore = storeService.getById(site.getStoreId());
+                client.updateTypeOther(id,tStore.getOperatorId()==null?0:tStore.getOperatorId(),
+                        tStore.getId(),site.getId());
+            }
+        }
+
         return new SuccessTip<>();
     }
 

--
Gitblit v1.7.1