浏览代码

运营绩效 去除維度限制

zxa 2 年之前
父节点
当前提交
c73bfdfeab

+ 3 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysUserMapper.java

@@ -191,10 +191,10 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
     JSONObject getDepart(@Param("companyId") String companyId);
 
 
-    List<JSONObject> getQuarterlyChangeRoleOperators(@Param("roleCode") List<String> roleCode, @Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("mediaId") String mediaId);
+    List<JSONObject> getQuarterlyChangeRoleOperators(@Param("roleCode") List<String> roleCode, @Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
-    List<JSONObject> getQuarterlyOnJobOperators(@Param("roleCode") List<String> roleCode, @Param("userId") String userId, @Param("status") int status, @Param("changeRoleUserIds") List<JSONObject> changeRoleUserIds, @Param("mediaId") String mediaId);
+    List<JSONObject> getQuarterlyOnJobOperators(@Param("roleCode") List<String> roleCode, @Param("userId") String userId, @Param("status") int status, @Param("changeRoleUserIds") List<JSONObject> changeRoleUserIds);
 
-    List<JSONObject> getQuarterlyOffJobOperators(@Param("roleCode") List<String> roleCode, @Param("userId") String userId, @Param("status") int status, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("mediaId") String mediaId);
+    List<JSONObject> getQuarterlyOffJobOperators(@Param("roleCode") List<String> roleCode, @Param("userId") String userId, @Param("status") int status, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
 }

+ 0 - 9
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserMapper.xml

@@ -379,7 +379,6 @@
         LEFT JOIN sys_user_role t1 ON t.id = t1.role_id
         LEFT JOIN sys_user t2 ON t1.user_id = t2.id
         LEFT JOIN sys_role_change_record t3 ON t1.user_id = t3.user_id
-        LEFT JOIN ctop_user_allocation t4 ON t1.user_id = t4.user_id
         WHERE t.role_code in
         <foreach collection="roleCode" item="roleCode" separator="," open="(" close=")">
             #{roleCode}
@@ -390,7 +389,6 @@
         AND t1.user_id is not null
         AND t3.create_time >=#{startDate}
         AND t3.create_time &lt;=#{endDate}
-        AND t4.media_id = #{mediaId}
         GROUP BY t1.user_id
     </select>
 
@@ -403,7 +401,6 @@
         FROM `sys_role` t
         LEFT JOIN sys_user_role t1 ON t.id = t1.role_id
         LEFT JOIN sys_user t2 ON t1.user_id = t2.id
-        LEFT JOIN ctop_user_allocation t3 ON t1.user_id = t3.user_id
         WHERE t.role_code in
         <foreach collection="roleCode" item="roleCode" separator="," open="(" close=")">
             #{roleCode}
@@ -419,7 +416,6 @@
                 #{user.userId}
             </foreach>
         </if>
-        AND t3.media_id = #{mediaId}
         GROUP BY t1.user_id
     </select>
 
@@ -433,7 +429,6 @@
         FROM `sys_role` t
         LEFT JOIN sys_user_role t1 ON t.id = t1.role_id
         LEFT JOIN sys_user t2 ON t1.user_id = t2.id
-        LEFT JOIN ctop_user_allocation t3 ON t1.user_id = t3.user_id
         WHERE t.role_code in
         <foreach collection="roleCode" item="roleCode" separator="," open="(" close=")">
             #{roleCode}
@@ -444,7 +439,6 @@
         AND t2.status= 2
         AND frozen_time >=#{startDate}
         AND frozen_time &lt;=#{endDate}
-        AND t3.media_id = #{mediaId}
         GROUP BY t1.user_id
         UNION
         SELECT
@@ -457,7 +451,6 @@
         LEFT JOIN sys_user_role t1 ON t.id = t1.role_id
         LEFT JOIN sys_user t2 ON t1.user_id = t2.id
         LEFT JOIN ctop_transfer_account t4 ON t1.user_id = t4.transferor
-        LEFT JOIN ctop_user_allocation t3 ON t4.account_id = t3.account_id
         WHERE t.role_code in
         <foreach collection="roleCode" item="roleCode" separator="," open="(" close=")">
             #{roleCode}
@@ -468,8 +461,6 @@
         AND t2.status= 2
         AND frozen_time >=#{startDate}
         AND frozen_time &lt;=#{endDate}
-        AND t3.media_id = #{mediaId}
         GROUP BY t1.user_id
-
     </select>
 </mapper>

+ 3 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/ISysUserService.java

@@ -303,9 +303,9 @@ public interface ISysUserService extends IService<SysUser> {
 
     void getItsPersonnelIds(List<String> rids, String userId);
 
-    List<JSONObject> getQuarterlyChangeRoleOperators(List<String> roleCode, String userId, String startDate, String endDate,String mediaId);
+    List<JSONObject> getQuarterlyChangeRoleOperators(List<String> roleCode, String userId, String startDate, String endDate);
 
-    List<JSONObject> getQuarterlyOnJobOperators(List<String> roleCode, String userId, int status, List<JSONObject> changeRoleUserIds,String mediaId);
+    List<JSONObject> getQuarterlyOnJobOperators(List<String> roleCode, String userId, int status, List<JSONObject> changeRoleUserIds);
 
-    List<JSONObject> getQuarterlyOffJobOperators(List<String> roleCode, String userId, int status, String startDate, String endDate,String mediaId);
+    List<JSONObject> getQuarterlyOffJobOperators(List<String> roleCode, String userId, int status, String startDate, String endDate);
 }

+ 6 - 6
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/SysUserServiceImpl.java

@@ -715,18 +715,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     }
 
     @Override
-    public List<JSONObject> getQuarterlyChangeRoleOperators(List<String> roleCode, String userId, String startDate, String endDate,String mediaId) {
-        return userMapper.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate, mediaId);
+    public List<JSONObject> getQuarterlyChangeRoleOperators(List<String> roleCode, String userId, String startDate, String endDate) {
+        return userMapper.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate);
     }
 
     @Override
-    public List<JSONObject> getQuarterlyOnJobOperators(List<String> roleCode, String userId, int status, List<JSONObject> changeRoleUserIds,String mediaId) {
-        return userMapper.getQuarterlyOnJobOperators(roleCode, userId, status, changeRoleUserIds, mediaId);
+    public List<JSONObject> getQuarterlyOnJobOperators(List<String> roleCode, String userId, int status, List<JSONObject> changeRoleUserIds) {
+        return userMapper.getQuarterlyOnJobOperators(roleCode, userId, status, changeRoleUserIds);
     }
 
     @Override
-    public List<JSONObject> getQuarterlyOffJobOperators(List<String> roleCode, String userId, int status, String startDate, String endDate,String mediaId) {
-        return userMapper.getQuarterlyOffJobOperators(roleCode, userId, status, startDate, endDate, mediaId);
+    public List<JSONObject> getQuarterlyOffJobOperators(List<String> roleCode, String userId, int status, String startDate, String endDate) {
+        return userMapper.getQuarterlyOffJobOperators(roleCode, userId, status, startDate, endDate);
     }
 
 }

+ 20 - 12
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouOperationReportServiceImpl.java

@@ -65,22 +65,24 @@ public class KuaishouOperationReportServiceImpl extends ServiceImpl<KuaishouOper
             //运营助理
             roleCode.add("operationAssistant");
             //头条运营经理
+            roleCode.add("kuaishouOperationManager");
             roleCode.add("touTiaoOperationManager");
             //运营专员
             roleCode.add("operator");
         } else {
             if ("manager".equals(role)) {
+                roleCode.add("kuaishouOperationManager");
                 roleCode.add("touTiaoOperationManager");
             } else {
                 roleCode.add(role);
             }
         }
         //查询岗位变动人员
-        List<JSONObject> changeRoleUserIds = sysUserService.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate, "1");
+        List<JSONObject> changeRoleUserIds = sysUserService.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate);
         //查询在职人员 1-在职
-        List<JSONObject> onJobUserIds = sysUserService.getQuarterlyOnJobOperators(roleCode, userId, 1, changeRoleUserIds, "1");
+        List<JSONObject> onJobUserIds = sysUserService.getQuarterlyOnJobOperators(roleCode, userId, 1, changeRoleUserIds);
         //查询离职人员 2-离职
-        List<JSONObject> offJobUserIds = sysUserService.getQuarterlyOffJobOperators(roleCode, userId, 2, startDate, nextMonthEndDate, "1");
+        List<JSONObject> offJobUserIds = sysUserService.getQuarterlyOffJobOperators(roleCode, userId, 2, startDate, nextMonthEndDate);
         JSONObject dates = new JSONObject();
         int count = 1;
         for (Integer month : monthInt) {
@@ -117,11 +119,13 @@ public class KuaishouOperationReportServiceImpl extends ServiceImpl<KuaishouOper
             //运营助理
             roleCode.add("operationAssistant");
             //头条运营经理
+            roleCode.add("kuaishouOperationManager");
             roleCode.add("touTiaoOperationManager");
             //运营专员
             roleCode.add("operator");
         } else {
             if ("manager".equals(role)) {
+                roleCode.add("kuaishouOperationManager");
                 roleCode.add("touTiaoOperationManager");
             } else {
                 roleCode.add(role);
@@ -129,11 +133,11 @@ public class KuaishouOperationReportServiceImpl extends ServiceImpl<KuaishouOper
         }
 
         //查询岗位变动人员
-        List<JSONObject> changeRoleUserIds = sysUserService.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate, "1");
+        List<JSONObject> changeRoleUserIds = sysUserService.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate);
         //查询在职人员 1-在职
-        List<JSONObject> onJobUserIds = sysUserService.getQuarterlyOnJobOperators(roleCode, userId, 1, changeRoleUserIds, "1");
+        List<JSONObject> onJobUserIds = sysUserService.getQuarterlyOnJobOperators(roleCode, userId, 1, changeRoleUserIds);
         //查询离职人员 2-离职
-        List<JSONObject> offJobUserIds = sysUserService.getQuarterlyOffJobOperators(roleCode, userId, 2, startDate, nextMonthEndDate, "1");
+        List<JSONObject> offJobUserIds = sysUserService.getQuarterlyOffJobOperators(roleCode, userId, 2, startDate, nextMonthEndDate);
         JSONObject dates = new JSONObject();
 
         List<JSONObject> dataList = new ArrayList<>();
@@ -666,22 +670,24 @@ public class KuaishouOperationReportServiceImpl extends ServiceImpl<KuaishouOper
             roleCode.add("operationAssistant");
             //快手运营经理
             roleCode.add("kuaishouOperationManager");
+            roleCode.add("touTiaoOperationManager");
             //运营专员
             roleCode.add("operator");
         } else {
             if ("manager".equals(role)) {
                 roleCode.add("kuaishouOperationManager");
+                roleCode.add("touTiaoOperationManager");
             } else {
                 roleCode.add(role);
             }
         }
 
         //查询岗位变动人员
-        List<JSONObject> changeRoleUserIds = sysUserService.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate, "2");
+        List<JSONObject> changeRoleUserIds = sysUserService.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate);
         //查询在职人员 1-在职
-        List<JSONObject> onJobUserIds = sysUserService.getQuarterlyOnJobOperators(roleCode, userId, 1, changeRoleUserIds, "2");
+        List<JSONObject> onJobUserIds = sysUserService.getQuarterlyOnJobOperators(roleCode, userId, 1, changeRoleUserIds);
         //查询离职人员 2-离职
-        List<JSONObject> offJobUserIds = sysUserService.getQuarterlyOffJobOperators(roleCode, userId, 2, startDate, nextMonthEndDate, "2");
+        List<JSONObject> offJobUserIds = sysUserService.getQuarterlyOffJobOperators(roleCode, userId, 2, startDate, nextMonthEndDate);
         JSONObject dates = new JSONObject();
         int count = 1;
         for (Integer month : monthInt) {
@@ -723,22 +729,24 @@ public class KuaishouOperationReportServiceImpl extends ServiceImpl<KuaishouOper
             roleCode.add("operationAssistant");
             //快手运营经理
             roleCode.add("kuaishouOperationManager");
+            roleCode.add("touTiaoOperationManager");
             //运营专员
             roleCode.add("operator");
         } else {
             if ("manager".equals(role)) {
                 roleCode.add("kuaishouOperationManager");
+                roleCode.add("touTiaoOperationManager");
             } else {
                 roleCode.add(role);
             }
         }
 
         //查询岗位变动人员
-        List<JSONObject> changeRoleUserIds = sysUserService.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate, "2");
+        List<JSONObject> changeRoleUserIds = sysUserService.getQuarterlyChangeRoleOperators(roleCode, userId, startDate, endDate);
         //查询在职人员 1-在职
-        List<JSONObject> onJobUserIds = sysUserService.getQuarterlyOnJobOperators(roleCode, userId, 1, changeRoleUserIds, "2");
+        List<JSONObject> onJobUserIds = sysUserService.getQuarterlyOnJobOperators(roleCode, userId, 1, changeRoleUserIds);
         //查询离职人员 2-离职
-        List<JSONObject> offJobUserIds = sysUserService.getQuarterlyOffJobOperators(roleCode, userId, 2, startDate, nextMonthEndDate, "2");
+        List<JSONObject> offJobUserIds = sysUserService.getQuarterlyOffJobOperators(roleCode, userId, 2, startDate, nextMonthEndDate);
         JSONObject dates = new JSONObject();
 
         List<JSONObject> dataList = new ArrayList<>();