瀏覽代碼

数据修改

yumeng 2 年之前
父節點
當前提交
376959d6c2

+ 26 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemCollectSamplesController.java

@@ -649,6 +649,31 @@ public class KuaishouItemCollectSamplesController extends BaseController {
     }
 
 
+    @GetMapping("/getMediaId")
+    @ApiOperation(value = "工作台——个人信息")
+    public JSONObject getMediaId(Long userId) {
+        JSONObject returnJson = new JSONObject();
+        try {
+
+            String mediaId = null;
+            String depName = sysUserService.getDepName(userId);
+            if (depName.contains("抖音")) {
+                mediaId = "1";
+            } else {
+                mediaId = "2";
+            }
+            returnJson.put("code", 0);
+            returnJson.put("message", "success");
+            returnJson.put("data", mediaId);
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", -500);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
     @GetMapping("/getPersonalInfo")
     @ApiOperation(value = "工作台——个人信息")
     public JSONObject getPersonalInfo(@ApiParam("创建人ID") @RequestParam(value = "userId", required = true) Long userId,
@@ -703,7 +728,7 @@ public class KuaishouItemCollectSamplesController extends BaseController {
             if (Check.isNull(userId)) {
                 throw new Exception("请传入人员ID");
             }
-            return kuaishouItemCollectSamplesService.getDataAnalysis(userId,     startDate, endDate, type, mediaId);
+            return kuaishouItemCollectSamplesService.getDataAnalysis(userId, startDate, endDate, type, mediaId);
         } catch (Exception e) {
             e.printStackTrace();
             returnJson.put("code", 500);

+ 2 - 0
ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysUserMapper.java

@@ -164,4 +164,6 @@ public interface SysUserMapper {
     String getRoleKeyByUserId(@Param("userId") Long userId);
 
     List<Long> getUserIdByRoleKey(@Param("roleKey") String roleKey);
+
+    String getDepName(@Param("userId") Long userId);
 }

+ 3 - 0
ruixuan-system/src/main/java/com/ruixuan/system/service/ISysUserService.java

@@ -2,6 +2,7 @@ package com.ruixuan.system.service;
 
 import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.core.domain.entity.SysUser;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -230,4 +231,6 @@ public interface ISysUserService {
     String getRoleKeyByUserId(Long userId);
 
     List<Long> getUserIdByRoleKey(String roleKey);
+
+    String getDepName( Long userId);
 }

+ 5 - 0
ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysUserServiceImpl.java

@@ -550,4 +550,9 @@ public class SysUserServiceImpl implements ISysUserService {
         return userMapper.getUserIdByRoleKey(roleKey);
     }
 
+    @Override
+    public String getDepName(Long userId) {
+        return userMapper.getDepName(userId);
+    }
+
 }

+ 5 - 0
ruixuan-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -381,5 +381,10 @@
           AND u.STATUS = 0
           and r.role_key like concat('%', #{roleKey}, '%')
     </select>
+    <select id="getDepName" resultType="java.lang.String" parameterType="java.lang.Long">
+        select  t2.dept_name  as 'name'  from sys_user t1 left join  sys_dept t2
+on t1.dept_id = t2.dept_id
+where t1.user_id = #{userId}
+    </select>
 
 </mapper>