From 9486766c806fe1d9e082b2fd02ea1cc558f1b443 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 08 五月 2025 09:21:57 +0800
Subject: [PATCH] bug修改

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopEvaluationController.java |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopEvaluationController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopEvaluationController.java
index 2f68429..4eaa02a 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopEvaluationController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopEvaluationController.java
@@ -2,6 +2,7 @@
 
 import cn.hutool.crypto.SecureUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dsh.course.feignClient.account.CityClient;
 import com.dsh.course.feignClient.account.model.CityListQuery;
@@ -14,10 +15,7 @@
 import com.dsh.guns.core.common.constant.factory.PageFactory;
 import com.dsh.guns.core.util.ToolUtil;
 import com.dsh.guns.modular.system.model.*;
-import com.dsh.guns.modular.system.service.ICityService;
-import com.dsh.guns.modular.system.service.IEvaluationService;
-import com.dsh.guns.modular.system.service.IStoreService;
-import com.dsh.guns.modular.system.service.StoreConfigService;
+import com.dsh.guns.modular.system.service.*;
 import org.apache.ibatis.ognl.Evaluation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -29,6 +27,7 @@
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 车辆管理控制器
@@ -56,6 +55,8 @@
     @Resource
     private UserMapper userMapper;
 
+    @Autowired
+    private ITSiteService siteService;
     @Resource
     private StoreConfigService storeConfigService;
     @Autowired
@@ -81,7 +82,7 @@
         model.addAttribute("list",list);
         String roleid = UserExt.getUser().getRoleid();
         model.addAttribute("role",roleid);
-        return PREFIX + "tShop_add.html";
+        return PREFIX + "TShop_add.html";
     }
 
 
@@ -109,28 +110,30 @@
         User byId1 = userMapper.selectById(byId.getStoreStaffId());
         model.addAttribute("city",byId1);
         model.addAttribute("type",1);
-        return PREFIX + "tShop_edit.html";
+        return PREFIX + "TShop_edit.html";
     }
     @RequestMapping("/tShop_info/{id}")
-    public String tCityInfo(@PathVariable Integer id, Model model) {
+    public String tCityInfo(@PathVariable("id") Integer id, Model model) {
         TEvaluationListVo vo = evaluationService.info(id);
         model.addAttribute("item",vo);
         ArrayList<String> strings = new ArrayList<>();
         String imgs = vo.getImgs();
-        for (String s : imgs.split(",")) {
-            strings.add(s);
+        if (!ToolUtil.isEmpty(imgs)){
+            for (String s : imgs.split(",")) {
+                strings.add(s);
+            }
         }
         model.addAttribute("imgs",strings);
         model.addAttribute("name1",vo.getPName());
         model.addAttribute("name2",vo.getCName());
-        return PREFIX + "tShop_edit.html";
+        return PREFIX + "TShop_edit.html";
     }
     @RequestMapping("/tShop_gift/{id}")
     public String tCityGift(@PathVariable Integer id, Model model) {
         TStore byId = storeService.getById(id);
         model.addAttribute("welfarePicture",byId.getWelfarePicture());
         model.addAttribute("id",id);
-        return PREFIX + "tShop_img.html";
+        return PREFIX + "TShop_img.html";
     }
     @RequestMapping("/tShop_indexSet/{id}")
     public String tCityIndexSet(@PathVariable Integer id, Model model) {
@@ -151,15 +154,24 @@
         StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8));
         model.addAttribute("c8",c8);
         model.addAttribute("id",id);
-        return PREFIX + "tShop_imgAll.html";
+        return PREFIX + "TShop_imgAll.html";
     }
 
 
     @RequestMapping(value = "/list")
     @ResponseBody
     public Object list(String provinceCode, String cityCode ,String shopName, String name, String phone) {
+        List<Integer> operatorId = new ArrayList<>();
+        if (UserExt.getUser().getObjectType()==2){
+            operatorId = storeService.list(new QueryWrapper<TStore>()
+                    .eq("operatorId", UserExt.getUser().getObjectId()))
+                    .stream().map(TStore::getId).collect(Collectors.toList());
+        }
+        if (UserExt.getUser().getObjectType()==3){
+            operatorId.add(UserExt.getUser().getObjectId());
+        }
         Page<TEvaluationListVo> page = new PageFactory<TEvaluationListVo>().defaultPage();
-        List<TEvaluationListVo> list =  evaluationService.listAll(page,provinceCode,cityCode,name,phone,shopName);
+        List<TEvaluationListVo> list =  evaluationService.listAll(page,provinceCode,cityCode,name,phone,shopName,operatorId);
         page.setRecords(list);
         return  super.packForBT(page);
     }

--
Gitblit v1.7.1