فهرست منبع

获取用户场景记录 修改xml

lyhzzz 3 سال پیش
والد
کامیت
702443fcff

+ 4 - 4
4dkankan-center-platform/src/main/java/com/fdkankan/platform/feign/UserFeign.java

@@ -63,11 +63,11 @@ public class UserFeign {
     }
 
     @PostMapping("/getUserByUserId")
-    public String getNickNameByUserId(@RequestParam(value = "userId")  Long userId) {
+    public User getUserByUserId(@RequestParam(value = "userId")  Long userId) {
         log.info("feign调用: getUserByUserId,参数:userId:{},",userId);
-        String nickName = userService.getUserByUserId(userId);
-        log.info("feign调用: getUserByUserId,返回:{},",nickName);
-        return nickName;
+        User user = userService.getUserByUserId(userId);
+        log.info("feign调用: getUserByUserId,返回:{},",user);
+        return user;
     }
     @PostMapping("/getUserLikeUserName")
     List<User> getUserLikeUserName(@RequestParam(value = "searchKey") String searchKey){

+ 1 - 1
4dkankan-center-platform/src/main/java/com/fdkankan/platform/order/service/impl/SpaceSdkServiceImpl.java

@@ -45,7 +45,7 @@ public class SpaceSdkServiceImpl extends ServiceImpl<ISpaceSdkMapper, SpaceSdk>
     @Value("${oss.type}")
     private String ossType;
 
-    @Value("${prefix.ali.sdk}")
+    @Value("${oss.prefix.sdk}")
     private String prefixAli;
 
     @Override

+ 2 - 3
4dkankan-center-scene/src/main/java/com/fdkankan/scene/mapper/ISceneMapper.java

@@ -1,8 +1,8 @@
 package com.fdkankan.scene.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.scene.entity.Scene;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fdkankan.scene.entity.ScenePO;
 import com.fdkankan.scene.entity.SceneProPO;
 import com.fdkankan.scene.vo.SceneParamVO;
@@ -11,7 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * <p>
@@ -34,7 +33,7 @@ public interface ISceneMapper extends BaseMapper<Scene> {
 
     List<ScenePO> findAllByYesterday();
 
-    Page<SceneProPO> findAllScene(Page page, SceneParamVO param);
+    Page<SceneProPO> findAllScene(Page page, @Param("param")SceneParamVO param);
 
     Page<ScenePO> unionSearchBySceneName(Page<ScenePO> page, @Param("searchKey") String searchKey);
 

+ 7 - 1
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/UserSceneService.java

@@ -1,6 +1,8 @@
 package com.fdkankan.scene.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.user.SSOLoginHelper;
 import com.fdkankan.common.user.SSOUser;
 import com.fdkankan.platform.api.feign.PlatformGoodsClient;
@@ -37,7 +39,11 @@ public class UserSceneService {
 
     public Page<SceneVO> getScenes(String token, SceneParamVO param) {
         SSOUser ssoUser = ssoLoginHelper.loginCheck(token);
+        if(ssoUser == null){
+            throw new BusinessException(ErrorCode.USER_NOT_LOGIN);
+        }
         Long userId = ssoUser.getId();
+        param.setUserId(userId);
         String cameraId = null;
         String nums = null;
         log.info("搜索条件是:"+ param.getSearchKey());
@@ -55,7 +61,7 @@ public class UserSceneService {
                 param.setNums(nums);
             }
         }
-
+        param.setCameraIds(cameraId);
         Page<SceneProPO> proPOPage = sceneService.findAllScene( param);
 
         Page<SceneVO> pageInfo = new Page<>(proPOPage.getCurrent(),proPOPage.getSize());

+ 50 - 56
4dkankan-center-scene/src/main/resources/mapper/scene/SceneMapper.xml

@@ -96,107 +96,101 @@
     <select id="findAllScene" parameterType="com.fdkankan.scene.vo.SceneParamVO"
             resultType="com.fdkankan.scene.entity.SceneProPO">
         select a.* from (
-            SELECT t.id,scene_name, scene_dec, web_site, thumb, scene_type,
-            t.create_time, scene_status, user_id, pay_status, camera_id, scene_code, scene_scheme, shoot_count,
-            rec_status, SPACE, recommend, view_count, 'V1' AS build_type
-            FROM `t_scene` t
-            LEFT JOIN  t_scene_ext ext ON t.id = ext.scene_id
-            UNION
-            SELECT t.id,t.scene_name, t.scene_dec, t.web_site, t.thumb, t.scene_type,
-            t.create_time, ext.scene_status, t.user_id, ext.pay_status, t.camera_id, t.scene_code, t.scene_scheme, t.shoot_count,
-            t.rec_status, ext.space, ext.recommend, t.view_count, t.build_type
-            FROM `t_scene_pro` t
-            LEFT JOIN t_scene_pro_ext ext ON t.id = ext.scene_pro_id
+        SELECT t.id,scene_name, scene_dec, web_site, thumb, scene_type,
+        t.create_time, scene_status, user_id, pay_status, camera_id, scene_code, scene_scheme, shoot_count,
+        rec_status, SPACE, recommend, view_count, 'V1' AS build_type
+        FROM `t_scene` t
+        LEFT JOIN  t_scene_ext ext ON t.id = ext.scene_id
+        UNION
+        SELECT t.id,t.scene_name, t.scene_dec, t.web_site, t.thumb, t.scene_type,
+        t.create_time, t.scene_status, t.user_id, t.pay_status, t.camera_id, t.scene_code, t.scene_scheme, ext.shoot_count,
+        t.rec_status, ext.space, ext.recommend, ext.view_count, t.build_type
+        FROM `t_scene_pro` t
+        LEFT JOIN t_scene_pro_ext ext ON t.id = ext.scene_pro_id
         ) a
         where 1 = 1 and rec_status = 'A' and a.scene_type != 99
-        <if test="sceneType != null and sceneType!= ''">
-            and a.scene_type = #{sceneType}
+        <if test="param.sceneType != null and param.sceneType!= ''">
+            and a.scene_type = #{param.sceneType}
         </if>
-        <if test="sceneScheme != null">
+        <if test="param.sceneScheme != null">
             <choose>
-                <when test="sceneScheme >= 4">
-                    and a.scene_scheme >= #{sceneScheme}
+                <when test="param.sceneScheme >= 4">
+                    and a.scene_scheme >= #{param.sceneScheme}
                 </when>
                 <otherwise>
-                    and a.scene_scheme <![CDATA[ < ]]> #{sceneScheme}
+                    and a.scene_scheme <![CDATA[ < ]]> #{param.sceneScheme}
                 </otherwise>
             </choose>
         </if>
-        <if test="type != null and type == '11'">
+        <if test="param.type != null and param.type == '11'">
             and a.scene_status in (1, -2)
             and a.pay_status = 1
             and a.build_type = 'V3'
         </if>
-        <if test="userId != null">
-            and a.user_id = #{userId}
+        <if test="param.userId != null">
+            and a.user_id = #{param.userId}
         </if>
-        <if test="userId == null">
+        <if test="param.userId == null">
             and a.scene_status = 1
             and a.pay_status = 1
         </if>
         <choose>
-            <when test="nums != null and nums.size() > 0">
+            <when test="param.nums != null and param.nums.length > 0">
                 <choose>
-                    <when test="sceneName != null and sceneName != '' and cameraId != null">
-                        and (a.scene_name like CONCAT('%',#{sceneName},'%')
-                            or a.scene_code like #{likeNum}
-                            or a.camera_id = #{cameraId}
+                    <when test="param.sceneName != null and param.sceneName != '' and param.cameraIds != null">
+                        and (a.scene_name like CONCAT('%',#{param.sceneName},'%')
+                            or a.scene_code like #{param.likeNum}
+                            or a.camera_id in (#{param.cameraId})
                             or a.scene_code in
-                            <foreach collection="numList" item="item" open="(" close=")" separator=",">
+                            <foreach collection="param.nums" item="item" open="(" close=")" separator=",">
                                 #{item}
                             </foreach>
                         )
                     </when>
-                    <when test="sceneName != null and sceneName !=''">
-                        and (a.scene_name like CONCAT('%',#{sceneName},'%')
-                            or a.scene_code like #{likeNum}
-                            or a.scene_code in
-                            <foreach collection="numList" item="item" open="(" close=")" separator=",">
-                                #{item}
-                            </foreach>
+                    <when test="param.sceneName != null and param.sceneName !=''">
+                        and (a.scene_name like CONCAT('%',#{param.sceneName},'%')
+                            or a.scene_code like #{param.likeNum}
+                            or a.scene_code in (#{param.nums})
                         )
                     </when>
                     <otherwise>
-                        and (a.camera_id = #{cameraId}
-                            or a.scene_code in
-                            <foreach collection="numList" item="item" open="(" close=")" separator=",">
-                                #{item}
-                            </foreach>
+                        and (a.camera_id = #{param.cameraId}
+                            or a.scene_code in (#{param.nums})
                         )
                     </otherwise>
                 </choose>
             </when>
             <otherwise>
                 <choose>
-                    <when test="sceneName != null and sceneName != '' and cameraId != null">
-                        and (a.scene_name like CONCAT('%',#{sceneName},'%')
-                            or a.scene_code like #{likeNum}
-                            or a.camera_id = #{cameraId}
-                            or a.scene_code in
+                    <when test="param.sceneName != null and param.sceneName != '' and param.cameraId != null">
+                        and (a.scene_name like CONCAT('%',#{param.sceneName},'%')
+                            or a.scene_code like #{param.likeNum}
+                            or a.camera_id in #{param.cameraId}
+                            or a.scene_code in  (#{param.nums})
                         )
                     </when>
-                    <when test="sceneName != null and sceneName !=''">
-                        and (a.scene_name like CONCAT('%',#{sceneName},'%')
-                            or a.scene_code like #{likeNum}
+                    <when test="param.sceneName != null and param.sceneName !=''">
+                        and (a.scene_name like CONCAT('%',#{param.sceneName},'%')
+                            or a.scene_code like #{param.likeNum}
                         )
                     </when>
                     <otherwise>
-                        and a.camera_id = #{cameraId}
+                        and a.camera_id in ( #{param.cameraId} )
                     </otherwise>
                 </choose>
             </otherwise>
         </choose>
-        <if test="startTime != null">
-            and a.create_time >= #{startTime}
+        <if test="param.startTime != null">
+            and a.create_time >= #{param.startTime}
         </if>
-        <if test="endTime != null">
-            and a.create_time <![CDATA[ <= ]]> #{endDate}
+        <if test="param.endTime != null">
+            and a.create_time <![CDATA[ <= ]]> #{param.endDate}
         </if>
-        <if test="num != null and num != ''">
-            and a.scene_code = #{num}
+        <if test="param.num != null and param.num != ''">
+            and a.scene_code = #{param.num}
         </if>
-        <if test="order != null and order != ''">
-            order by ${order}
+        <if test="param.order != null and param.order != ''">
+            order by ${param.order}
         </if>
     </select>