From 4e3aa057b6a7bceb777ea4a768d52e9705245847 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期二, 14 一月 2025 14:42:52 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java            |    3 ++-
 ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml                           |    2 ++
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java |   15 ++++++++++-----
 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml                  |    3 +++
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
index 9f57d1e..d1cd882 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
@@ -207,6 +207,7 @@
  			<if test="roleType != null and roleType != ''">role_type,</if>
  			<if test="remark != null and remark != ''">remark,</if>
  			<if test="objectId != null and objectId != ''">objectId,</if>
+	    	<if test="appUserId != null and appUserId != ''">app_user_id,</if>
  			create_time
  		)values(
  			<if test="userId != null and userId != ''">#{userId},</if>
@@ -223,6 +224,7 @@
  			<if test="roleType != null and roleType != ''">#{roleType},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="objectId != null and objectId != ''">#{objectId},</if>
+	    	<if test="appUserId != null and appUserId != ''">#{appUserId},</if>
  			sysdate()
  		)
 	</insert>
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java
index df9ff8c..03e72ce 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianSubscribeMapper.java
@@ -27,7 +27,8 @@
      */
     List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(PageInfo<TechnicianSubscribeVO> pageInfo,
                                                                     @Param("shopId") Long shopId,
-                                                                    @Param("status") Integer status);
+                                                                    @Param("status") Integer status,
+                                                                    @Param("technicianId") Integer technicianId);
     List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop1(PageInfo<TechnicianSubscribeVO> pageInfo,
                                                                     @Param("shopId") Long shopId,
                                                                      @Param("status") Integer status, @Param("phone")String phone,
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
index c82ba18..0f8de83 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -13,9 +13,11 @@
 import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.order.feignClient.RemoteOrderGoodsClient;
+import com.ruoyi.other.api.domain.Technician;
 import com.ruoyi.other.api.domain.TechnicianSubscribe;
 import com.ruoyi.other.enums.TechnicianStatus;
 import com.ruoyi.other.mapper.TechnicianSubscribeMapper;
+import com.ruoyi.other.service.TechnicianService;
 import com.ruoyi.other.service.TechnicianSubscribeService;
 import com.ruoyi.other.vo.TechnicianSubscribeVO;
 import org.springframework.data.redis.connection.RedisZSetCommands;
@@ -53,6 +55,8 @@
     private TokenService tokenService;
     @Resource
     private AppUserShopClient appUserShopClient;
+    @Resource
+    private TechnicianService technicianService;
     
     
     
@@ -64,13 +68,14 @@
         Long userid = tokenService.getLoginUserApplet().getUserid();
         List<AppUserShop> data = appUserShopClient.getAppUserShop(userid).getData();
         Optional<AppUserShop> first = data.stream().filter(s -> s.getShopId() == shopId.intValue() && s.getRoleType() == 3).findFirst();
-        
+        Integer technicianId = null;
         if(first.isPresent()){
-        
+            AppUserShop appUserShop = first.get();
+            Technician technician = technicianService.getOne(new LambdaQueryWrapper<Technician>().eq(Technician::getAppUserId, appUserShop.getAppUserId())
+                    .eq(Technician::getShopId, appUserShop.getShopId()).eq(Technician::getDelFlag, 0).eq(Technician::getStatus, 1));
+            technicianId = technician.getId();
         }
-    
-    
-        List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status);
+        List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status, technicianId);
         for (TechnicianSubscribeVO technicianSubscribeVO : list) {
             String id = technicianSubscribeVO.getId();
             TechnicianSubscribe technicianSubscribe = this.getById(id);
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
index 32f51d2..d8da8e6 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
@@ -24,6 +24,9 @@
         <if test="status != null">
             AND tts.status = #{status}
         </if>
+        <if test="technicianId != null">
+            AND tts.technician_id = #{technicianId}
+        </if>
         ORDER BY tts.create_time DESC
     </select>
     <select id="getTechnicianSubscribeByUserAndShop1" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO">

--
Gitblit v1.7.1