lyhzzz 1 rok pred
rodič
commit
902c60e51a

+ 9 - 0
src/main/java/com/fdkankan/manage/httpClient/service/LaserService.java

@@ -465,6 +465,15 @@ public class LaserService {
         return this.list(newParam);
     }
 
+    public HashMap<String, JSONObject> list(String sceneName,Integer sceneSource) {
+        LaserSceneParam newParam = new LaserSceneParam();
+        newParam.setPageNum(1);
+        newParam.setPageSize(9999);
+        newParam.setTitle(sceneName);
+        newParam.setSceneSource(sceneSource);
+        return this.list(newParam);
+    }
+
     public HashMap<String, JSONObject> list(LaserSceneParam newParam) {
         HashMap<String, JSONObject> map = new HashMap<>();
         try {

+ 1 - 1
src/main/java/com/fdkankan/manage/mapper/IScenePlusMapper.java

@@ -20,7 +20,7 @@ import java.util.List;
 @Mapper
 public interface IScenePlusMapper extends BaseMapper<ScenePlus> {
 
-    List<GroupByCount> getCountGroupByUserId(@Param("userIdList") List<Long> userIdList, @Param("isObj") Integer isObj);
+    List<GroupByCount> getCountGroupByUserId(@Param("userIdList") List<Long> userIdList);
 
     List<GroupByCount> getCountGroupByCameraId(@Param("cameraIds") List<Long> cameraIds);
 

+ 1 - 1
src/main/java/com/fdkankan/manage/mapper/ISceneProMapper.java

@@ -22,7 +22,7 @@ import java.util.List;
 @Mapper
 public interface ISceneProMapper extends BaseMapper<ScenePro> {
 
-    List<GroupByCount> getCountGroupByUserId(@Param("userIdList") List<Long> userIdList,@Param("isObj") Integer isObj);
+    List<GroupByCount> getCountGroupByUserId(@Param("userIdList") List<Long> userIdLis);
 
     List<GroupByCount> getCountGroupByCameraId(@Param("cameraIds") List<Long> cameraIds);
 

+ 1 - 1
src/main/java/com/fdkankan/manage/service/IScenePlusService.java

@@ -22,7 +22,7 @@ public interface IScenePlusService extends IService<ScenePlus> {
 
     void unbindCamera(Long cameraId);
 
-    HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList,Integer isObj);
+    HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList);
 
     HashMap<Long, Long> getCountGroupByCameraId(ArrayList<Long> longs);
 

+ 1 - 1
src/main/java/com/fdkankan/manage/service/ISceneProService.java

@@ -29,7 +29,7 @@ public interface ISceneProService extends IService<ScenePro> {
 
     List<ScenePro> getListByCameraId(Long cameraId);
 
-    HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList,Integer isObj);
+    HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList);
 
     HashMap<Long, Long>  getCountGroupByCameraId(List<Long> cameraIds);
 

+ 2 - 2
src/main/java/com/fdkankan/manage/service/impl/ScenePlusServiceImpl.java

@@ -55,9 +55,9 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
     }
 
     @Override
-    public HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList,Integer isObj) {
+    public HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList) {
         HashMap<Long,Long> map = new HashMap<>();
-        List<GroupByCount> result = this.getBaseMapper().getCountGroupByUserId(userIdList,isObj);
+        List<GroupByCount> result = this.getBaseMapper().getCountGroupByUserId(userIdList);
         result.forEach(entity ->map.put(entity.getId(),entity.getCount()));
         return map;
     }

+ 27 - 18
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -120,9 +120,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
     }
 
     @Override
-    public HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList,Integer isObj) {
+    public HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList) {
         HashMap<Long,Long> map = new HashMap<>();
-        List<GroupByCount> result = this.getBaseMapper().getCountGroupByUserId(userIdList,isObj);
+        List<GroupByCount> result = this.getBaseMapper().getCountGroupByUserId(userIdList);
         result.forEach(entity ->map.put(entity.getId(),entity.getCount()));
         return map;
     }
@@ -231,7 +231,18 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             }
         }
         if((param.getCameraIds() != null && param.getCameraIds().size()<=0) || (param.getUserIds() != null && param.getUserIds().size()<=0)){
-            param.setNum("empty");
+            return PageInfo.PageInfoEmpty(param.getPageNum(),param.getPageSize());
+        }
+        HashMap<String, JSONObject> laserMap = new HashMap<>();
+        if(param.getType() == 2 && StringUtils.isNotBlank(param.getSceneName())){
+            laserMap = laserService.list(param.getSceneName(), 4);
+        }
+        if(param.getType() == 6 && StringUtils.isNotBlank(param.getSceneName())){
+            laserMap = laserService.list(param.getSceneName(), 5);
+        }
+        if(!laserMap.isEmpty()){
+            Set<String> keySet = laserMap.keySet();
+            param.setNumList(new ArrayList<>(keySet));
         }
 
         Page<SceneVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
@@ -264,21 +275,19 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             }
         }
         for (SceneVo record : page.getRecords()) {
-            if(record.getStatus() != 0){
-                if(param.getType() == 2 || param.getType() == 6){
-                    JSONObject ssObj = ssSceneMap.get(record.getNum());
-                    if(ssObj!=null){
-                        record.setSceneName(ssObj.getString("title"));
-                        record.setThumb(ssObj.getString("thumb"));
-                        record.setWebSite(ssObj.getString("webSite"));
-                        record.setIsObj(ssObj.getInteger("buildObjStatus"));
-                        record.setViewCount(ssObj.getInteger("viewCount"));
-                        record.setStatus(toFdStatus(ssObj.getInteger("status")));
-                        record.setAlgorithmTime(ssObj.getString("algorithmTime"));
-                    }else{
-                        record.setStatus(-1);
-                        record.setWebSite(null);
-                    }
+            if(param.getType() == 2 || param.getType() == 6){
+                JSONObject ssObj = ssSceneMap.get(record.getNum());
+                if(ssObj!=null){
+                    record.setSceneName(ssObj.getString("title"));
+                    record.setThumb(ssObj.getString("thumb"));
+                    record.setWebSite(ssObj.getString("webSite"));
+                    record.setIsObj(ssObj.getInteger("buildObjStatus"));
+                    record.setViewCount(ssObj.getInteger("viewCount"));
+                    record.setStatus(toFdStatus(ssObj.getInteger("status")));
+                    record.setAlgorithmTime(ssObj.getString("algorithmTime"));
+                }else if(record.getStatus() != 0){
+                    record.setStatus(-1);
+                    record.setWebSite(null);
                 }
             }
 

+ 2 - 2
src/main/java/com/fdkankan/manage/service/impl/UserServiceImpl.java

@@ -122,8 +122,8 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
             HashMap<Long,Long> incrementCountMap = userIncrementService.getValidCountGroupByUserId(userIdList);
             HashMap<Long,Long> cameraCountMap = cameraDetailService.getCountGroupByUserId(userIdList);
             HashMap<Long,Long> sceneCountMap = sceneService.getCountGroupByUserId(userIdList);
-            HashMap<Long,Long> sceneProCountMap = sceneProService.getCountGroupByUserId(userIdList,0);
-            HashMap<Long,Long> scenePlusCountMap = scenePlusService.getCountGroupByUserId(userIdList,0);
+            HashMap<Long,Long> sceneProCountMap = sceneProService.getCountGroupByUserId(userIdList);
+            HashMap<Long,Long> scenePlusCountMap = scenePlusService.getCountGroupByUserId(userIdList);
            // HashMap<Long,Long> sceneProCountObjMap = sceneProService.getCountGroupByUserId(userIdList,1);
           //  HashMap<Long,Long> scenePlusCountObjMap = scenePlusService.getCountGroupByUserId(userIdList,1);
 

+ 0 - 10
src/main/resources/mapper/manage/ScenePlusMapper.xml

@@ -4,21 +4,11 @@
 
     <select id="getCountGroupByUserId" resultType="com.fdkankan.manage.vo.response.GroupByCount" >
         SELECT user_id as id, count(p.id) as count FROM t_scene_plus p
-        <if test="isObj != null and isObj == 1">
-            left join t_scene_plus_ext e on p.id = e.plus_id
-        </if>
         WHERE  p.rec_status = 'A'
         and  p.user_id in
         <foreach item="userId" collection="userIdList" open="(" separator="," close=")">
             #{userId}
         </foreach>
-        <if test="isObj != null and isObj == 0">
-            and p.scene_source in (1,2,3,12,13,14)
-        </if>
-        <if test="isObj != null and isObj == 1">
-            and e.is_obj = 1
-            and p.scene_source = 4
-        </if>
         GROUP BY p.user_id
     </select>
 

+ 7 - 7
src/main/resources/mapper/manage/SceneProMapper.xml

@@ -8,13 +8,6 @@
          <foreach item="userId" collection="userIdList" open="(" separator="," close=")">
             #{userId}
         </foreach>
-        <if test="isObj !=null and isObj == 0">
-            and scene_source in (1,2,3,12,13,14)
-        </if>
-        <if test="isObj !=null and isObj == 1">
-           and  is_obj = 1
-            and scene_source  = 4
-        </if>
         GROUP BY user_id
     </select>
     <select id="getCountGroupByCameraId" resultType="com.fdkankan.manage.vo.response.GroupByCount">
@@ -68,6 +61,13 @@
             </foreach>
         </if>
 
+        <if test="param.numList !=null and param.numList.size >0">
+            and s.num in
+            <foreach item="num" collection="param.numList" open="(" separator="," close=")">
+                #{num}
+            </foreach>
+        </if>
+
         <if test="param.type !=null and param.type == 0">
             and s.scene_source in (1,2,12,13,14)
         </if>