فهرست منبع

1.控制台bug

wuhp 1 سال پیش
والد
کامیت
9b4aeafc99

+ 15 - 0
src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java

@@ -371,6 +371,7 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
             }else if ("1".equals(taskStatisticsVo.getTreeType())){
                 taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
                 taskStatisticsVo.setTreeUserId(null);
+                taskStatisticsVo.setUserIds(null);
             }
         }
         PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
@@ -529,6 +530,20 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
                 taskStatisticsVo.setUserIds(userIds);
             }
         }
+
+        if(StringUtils.isNotEmpty(taskStatisticsVo.getTreeType())){
+            if(StringUtils.isNotEmpty(taskStatisticsVo.getTreeUserId()) && "2".equals(taskStatisticsVo.getTreeType())){
+                List<String> userIds=this.getNextLevel(taskStatisticsVo.getTreeUserId());
+                if(!userIds.isEmpty()){
+                    taskStatisticsVo.setUserIds(userIds);
+                }
+            }else if ("1".equals(taskStatisticsVo.getTreeType())){
+                taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
+                taskStatisticsVo.setTreeUserId(null);
+                taskStatisticsVo.setUserIds(null);
+            }
+        }
+
         BusinessAgentData result = this.taskStatisticsMapper.getBusinessAgentDataTotalAdd(taskStatisticsVo);
         BusinessAgentData allsumPremium = this.taskStatisticsMapper.getAllsumPremium(taskStatisticsVo);
         if (ObjectUtils.isNotEmpty(allsumPremium) && ObjectUtils.isNotEmpty(result)) {

+ 6 - 16
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -24,14 +24,9 @@
                 DATE_FORMAT( #{vo.createtimeEnd}, '%Y-%m-%d')
             </if>
 
-            <choose>
-                <when test="vo.userId !=null  and vo.userId!='' and vo.managementSource  ='1' ">
-                    and su.id=#{vo.userId}
-                </when>
-                <when test="vo.userId !=null  and vo.userId!='' and vo.managementSource  ='2' ">
-                    and su.leader_id=#{vo.userId}
-                </when>
-            </choose>
+            <if test="vo.userId !=null  and vo.userId!=''">
+                and su.id=#{vo.userId}
+            </if>
 
             <if test="vo.managementSource !=null  and vo.managementSource!=''">
                 and sd.management_source=#{vo.managementSource}
@@ -87,14 +82,9 @@
                 and su.name=#{vo.userName}
             </if>
 
-            <choose>
-                <when test="vo.userId !=null  and vo.userId!='' and vo.managementSource  ='1' ">
-                    and su.id=#{vo.userId}
-                </when>
-                <when test="vo.userId !=null  and vo.userId!='' and vo.managementSource  ='2' ">
-                    and su.leader_id=#{vo.userId}
-                </when>
-            </choose>
+            <if test="vo.userId !=null  and vo.userId!=''">
+                and su.id=#{vo.userId}
+            </if>
 
             <if test="vo.userIds  !=null  and vo.userIds!=''  and vo.userIds.size()>0">
                 and su.id in