Pārlūkot izejas kodu

我的项目 修改

zhaoxian 2 gadi atpakaļ
vecāks
revīzija
7dda470df2

+ 10 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouProjectServiceImpl.java

@@ -162,6 +162,16 @@ public class KuaishouProjectServiceImpl implements IKuaishouProjectService {
 
     @Override
     public List<KuaishouProject> getMyProjects(KuaishouProject kuaishouProject) {
+        String roleKey = sysUserService.getRoleKeyByUserId(kuaishouProject.getUserId());
+        if ("admin".equals(roleKey) || "directorOperations".equals(roleKey)) {
+
+        } else if ("operationsManager".equals(roleKey)) {
+            //运营经理 可以看自己部门所有人的(自己和下属的)
+            Long deptId = deptService.getDeptIdByUserId(kuaishouProject.getUserId());
+            kuaishouProject.setOperatorIdList(deptService.getDeptUserListByDeptId(deptId));
+        } else {
+            kuaishouProject.setOperatorIdList(Arrays.asList(kuaishouProject.getUserId()));
+        }
         return projectMapper.getMyProjects(kuaishouProject);
     }
 

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/report/controller/KuaishouLiveAccountReportController.java

@@ -30,12 +30,12 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * 【请填写功能名称】Controller
+ * 账户报表Controller
  *
  * @author ruoyi
  * @date 2023-03-22
  */
-@Api(tags = "------账户报表")
+@Api(tags = "账户报表")
 @Slf4j
 @RestController
 @RequestMapping("/report/account")

+ 12 - 4
ruixuan-live/src/main/resources/mapper/jinniu/KuaishouProjectMapper.xml

@@ -113,10 +113,18 @@
         t1.update_time
         from kuaishou_project t1
         LEFT JOIN kuaishou_project_member t2 ON t1.id = t2.project_id
-        WHERE t2.user_id =#{userId}
-        <if test="projectName != null  and projectName != ''">
-            and t1.project_name like concat('%', #{projectName}, '%')
-        </if>
+        <where>
+            <if test="operatorIdList != null and operatorIdList.size() > 0 ">
+                AND t2.user_id IN
+                <foreach collection="operatorIdList" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
+            <if test="projectName != null  and projectName != ''">
+                and t1.project_name like concat('%', #{projectName}, '%')
+            </if>
+        </where>
+        GROUP BY t1.id
     </select>
 
     <select id="getMyProjectIdsByUserIds" resultType="Long">