Procházet zdrojové kódy

Merge branch 'task-lyh-sg' into test

lyhzzz před 2 roky
rodič
revize
a8bf6e37eb

+ 1 - 1
src/main/java/com/fdkankan/ucenter/controller/CameraController.java

@@ -150,7 +150,7 @@ public class CameraController extends BaseController {
         User user = userService.getByToken(getToken());
         LambdaQueryWrapper<CameraDetail> condition = new LambdaQueryWrapper<>();
         condition.eq(CameraDetail::getCooperationUser,user.getId());
-        condition.eq(CameraDetail::getGoodsId,10);
+        condition.eq(CameraDetail::getType,10);
         List<CameraDetail> list = cameraDetailService.list(condition);
         if(CollectionUtils.isEmpty(list)){
             return Result.success();

+ 8 - 1
src/main/java/com/fdkankan/ucenter/controller/app/AppCameraController.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.ucenter.common.Result;
 import com.fdkankan.ucenter.constant.LoginConstant;
 import com.fdkankan.ucenter.service.impl.AppCameraService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
@@ -13,6 +14,7 @@ import java.util.concurrent.CompletableFuture;
 
 @RestController
 @RequestMapping("/ucenter/app/camera")
+@Slf4j
 public class AppCameraController {
 
     @Autowired
@@ -65,7 +67,12 @@ public class AppCameraController {
                 || !param.containsKey("appVersion")) {
             return Result.failure(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
         }
-        appCameraService.uploadUserCameraInfo(param.get("snCode"),param.get("cameraVersion"),param.get("appVersion"));
+        try {
+            appCameraService.uploadUserCameraInfo(param.get("snCode"),param.get("cameraVersion"),param.get("appVersion"));
+        }catch ( Exception e){
+            log.error("uploadUserCameraInfo--snCode:{},cameraVersion:{},appVersion:{},error:{}",
+                    param.get("snCode"),param.get("cameraVersion"),param.get("appVersion"),e);
+        }
 
         return Result.success();
     }

+ 1 - 1
src/main/java/com/fdkankan/ucenter/service/impl/CameraDetailServiceImpl.java

@@ -74,7 +74,7 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
         LambdaQueryWrapper<CameraDetail> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(CameraDetail::getUserId,userId);
         if(type != null){
-            wrapper.eq(CameraDetail::getGoodsId,type);
+            wrapper.eq(CameraDetail::getType,type);
         }
         return this.count(wrapper);
     }

+ 2 - 4
src/main/resources/mapper/ucenter/CameraDetailMapper.xml

@@ -5,22 +5,20 @@
     <select id="getListByUserAndType" resultType="com.fdkankan.ucenter.vo.response.CameraAppVo">
      SELECT * FROM t_camera_detail d
         LEFT JOIN t_camera c on d.camera_id = c.id
-        LEFT JOIN t_goods g on d.goods_id = g.id
         WHERE d.rec_status = 'A'
         and d.user_id = #{userId}
-        and d.goods_id = #{cameraType}
+        and d.type = #{cameraType}
     </select>
 
     <select id="getListByUserIdsAndType" resultType="com.fdkankan.ucenter.vo.response.CameraAppVo">
         SELECT * FROM t_camera_detail d
             LEFT JOIN t_camera c on d.camera_id = c.id
-              LEFT JOIN t_goods g on d.goods_id = g.id
         WHERE d.rec_status = 'A'
           and d.user_id in
         <foreach item="userId" collection="userIds" open="(" separator="," close=")">
             #{userId}
         </foreach>
-          and d.goods_id = #{cameraType}
+          and d.type = #{cameraType}
     </select>
 
     <select id="getListByUserAndTypeEx" resultType="com.fdkankan.ucenter.vo.response.CameraExcelVo">

+ 1 - 3
src/main/resources/mapper/ucenter/CameraMapper.xml

@@ -4,11 +4,10 @@
 
     <select id="pageList" resultType="com.fdkankan.ucenter.vo.response.CameraVo">
         select c.id,c.sn_code,c.child_name ,d.balance,d.type , d.total_space,d.used_space,
-        u.id as cooperationUser,u.user_name as cooperationUserName,g.pic,d.goods_id
+        u.id as cooperationUser,u.user_name as cooperationUserName
         from t_camera c
         left join t_camera_detail d on c.id = d.camera_id
         left join t_user u on d.cooperation_user = u.id
-        left join t_goods g on d.goods_id = g.id
         WHERE c.rec_status = 'A'
         <if test="param.selecttype !=null and param.selecttype == 2 and param.childName !=null and param.childName!='' ">
             and c.child_name like CONCAT('%',#{param.childName},'%')
@@ -30,7 +29,6 @@
     <select id="getCameraInfo" resultType="com.fdkankan.ucenter.vo.response.CameraAppVo">
          select * from  t_camera c
         left join t_camera_detail d on c.id = d.camera_id
-        left join t_goods g on d.goods_id = g.id
         left join t_user u on d.user_id = u.id
         where c.rec_status = 'A'
         and c.child_name = #{childName}

+ 2 - 2
src/main/resources/mapper/ucenter/ScenePlusMapper.xml

@@ -58,7 +58,7 @@
             and  p.scene_type  = #{param.sceneType}
         </if>
         <if test= 'param.cameraType != null' >
-            and tcd.goods_id = #{param.cameraType}
+            and tcd.type = #{param.cameraType}
         </if>
     </sql>
 
@@ -66,7 +66,7 @@
     <select id="getCountByUserId" resultType="java.lang.Long">
         select count(*) from t_scene_plus s left join t_camera_detail d on s.camera_id = d.camera_id
         where s.rec_status = 'A'
-          and s.user_id = #{userId} and d.goods_id = #{cameraType}
+          and s.user_id = #{userId} and d.type = #{cameraType}
     </select>
 
 </mapper>

+ 1 - 1
src/main/resources/mapper/ucenter/SceneProMapper.xml

@@ -60,7 +60,7 @@
     <select id="getCountByUserId" resultType="java.lang.Long">
            select count(*) from t_scene_pro s left join t_camera_detail d on s.camera_id = d.camera_id
         where s.rec_status = 'A' and s.is_upgrade = 0
-        and s.user_id = #{userId} and d.goods_id = #{cameraType}
+        and s.user_id = #{userId} and d.type = #{cameraType}
     </select>
 
     <sql id="HasFolder">