lyhzzz 7 달 전
부모
커밋
6c5e739486

+ 5 - 0
README.md

@@ -1,5 +1,10 @@
 #**管理后台**
 
+
+docker exec -it 4dkankan-modeling-scene /bin/bash
+kill -9 
+docker exec -itd 4dkankan-modeling-scene /bin/bash -c "/opt/manage.sh"
+
 ###**v1.0.0** 
 ~~~~
 1.更新nacos网关路由

+ 16 - 0
doc/update-1.6.0.sql

@@ -41,3 +41,19 @@ ALTER TABLE `4dkankan_v4`.`jy_scene_user_auth`
 
 
 UPDATE t_scene_plus_ext set thumb = '/oss/loading/thumb.jpg' WHERE thumb LIKE '%https://4dkk.4dage.com/loading/thumb.jpg%'
+
+
+
+USE fdkk_laser;
+
+SET GLOBAL character_set_server = 'utf8mb4';
+SET GLOBAL character_set_database = 'utf8mb4';
+SET GLOBAL collation_server = 'utf8mb4_0900_ai_ci';
+
+SELECT
+    CONCAT('ALTER TABLE `', table_name, '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;') AS alter_sql
+FROM
+    information_schema.TABLES
+WHERE
+        table_schema = 'fdkk_laser';
+

+ 1 - 0
src/main/java/com/fdkankan/manage/common/ResultCode.java

@@ -96,6 +96,7 @@ public enum ResultCode  {
     LASER_VIEW_ERROR(60024, "激光系统访问失败"),
 
     FILE_TYPE_ERROR2(60025, "文件类型不符合规则"),
+    FILE_TYPE_ERROR23(60031, "文件名不得含有中文"),
     UNZIP_ERROR(60026, "解压失败"),
 
     UPLOAD_FILE_OBJ_ERROR(60027,"文件内容错误,缺少文件"),

+ 3 - 0
src/main/java/com/fdkankan/manage/entity/ScenePlus.java

@@ -112,4 +112,7 @@ public class ScenePlus implements Serializable {
 
     @TableField("has_ai")
     private Integer hasAi;
+
+    @TableField("three_cam_type")
+    private String threeCamType;
 }

+ 2 - 2
src/main/java/com/fdkankan/manage/mapper/IDataMapper.java

@@ -42,10 +42,10 @@ public interface IDataMapper {
     List<DataGroupByCount> sceneObjGroupBy(@Param("tb") String tb, @Param("dateFormat")String dateFormat,
                                            @Param("startTime")String startTime,@Param("endTime")String endTime);
     List<DataGroupByCount> sceneObjGroupBy(@Param("tb") String tb, @Param("dateFormat")String dateFormat,
-                                           @Param("startTime")String startTime,@Param("endTime")String endTime,@Param("userIds") List<Long> userIds);
+                                           @Param("startTime")String startTime,@Param("endTime")String endTime,@Param("userIds") List<Long> userIds,@Param("threeCamType")String threeCamType);
 
     List<DataGroupByCount> sceneObjGroupByWeek(@Param("tb") String tb,@Param("startTime")String startTime,@Param("endTime")String endTime);
-    List<DataGroupByCount> sceneObjGroupByWeek(@Param("tb") String tb,@Param("startTime")String startTime,@Param("endTime")String endTime,@Param("userIds") List<Long> userIds);
+    List<DataGroupByCount> sceneObjGroupByWeek(@Param("tb") String tb,@Param("startTime")String startTime,@Param("endTime")String endTime,@Param("userIds") List<Long> userIds,@Param("threeCamType")String threeCamType);
 
     List<DataGroupByCount> sceneOutTimeGroupBy(@Param("tb") String tb, @Param("dateFormat")String dateFormat,
                                         @Param("startTime")String startTime,@Param("endTime")String endTime);

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

@@ -40,7 +40,7 @@ public interface ISceneProService extends IService<ScenePro> {
 
     ScenePro getByNum(String sceneNum);
 
-    Long getKkCount(List<String> asList, String startTime,List<Long> userIds);
+    Long getKkCount(List<String> asList, String startTime,List<Long> userIds,String treeCamType);
     Long getSsCount(List<String> asList, String startTime,List<Long> userIds);
     Long getSsObjCount(List<String> asList, String startTime,List<Long> userIds);
 

+ 1 - 0
src/main/java/com/fdkankan/manage/service/impl/CaseServiceImpl.java

@@ -91,6 +91,7 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, Case> implements I
         if(param.getCaseId() == null){
             caseEntity = new Case();
             caseEntity.setSysUserId(Long.valueOf(StpUtil.getLoginId().toString()));
+            caseEntity.setUserName((String)StpUtil.getExtra("userName"));
         }else {
             caseEntity = this.getById(param.getCaseId());
         }

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

@@ -118,6 +118,9 @@ public class CommonServiceImpl implements ICommonService {
             CommonUpload commonUpload = commonUploadService.add(originalFilename.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum, format,format,1,null,dictId);
             tempFile.delete();
             return ResultData.ok(commonUpload);
+        }catch ( BusinessException e){
+            log.info("upload-file-error:{}",e);
+            throw e;
         }catch (Exception e){
             log.info("upload-file-error:{}",e);
             throw new BusinessException(ResultCode.UPLOAD_ERROR);
@@ -140,10 +143,10 @@ public class CommonServiceImpl implements ICommonService {
         File modelFile = fileList.get(0);
 
         if(FileWriterUtil.isChinese(modelFile.getName())){
-            throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
+            throw new BusinessException(ResultCode.FILE_TYPE_ERROR23);
         }
         if(FileWriterUtil.isChinese(modelFile.getPath())){
-            throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
+            throw new BusinessException(ResultCode.FILE_TYPE_ERROR23);
         }
         String modelFileFormat = modelFile.getName().split("\\.")[1].toLowerCase();
         String url = null;
@@ -194,6 +197,7 @@ public class CommonServiceImpl implements ICommonService {
         if(!fYunFileServiceInterface.fileExist(ossPath)){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
+        FileUtil.del(unzipPath);
         return ossUrlPrefix +  ossPath;
     }
 

+ 19 - 8
src/main/java/com/fdkankan/manage/service/impl/DataService.java

@@ -280,27 +280,30 @@ public class DataService implements IDataService {
         List<DataGroupByCount> plusList = new ArrayList<>();
         List<DataGroupByCount> proObjList = new ArrayList<>();
         List<DataGroupByCount> plusObjList = new ArrayList<>();
+        List<DataGroupByCount> yzlList = new ArrayList<>();
         int rule = Dateutils.DAY;
         switch (type){
             case 0 :
                 proList = dataMapper.sceneGroupBy("t_scene_pro",dayFormat,startTime,endTime,userIds);
                 plusList = dataMapper.sceneGroupBy("t_scene_plus",dayFormat,startTime,endTime,userIds);
-                proObjList = dataMapper.sceneObjGroupBy("t_scene_pro",dayFormat,startTime,endTime,userIds);
-                plusObjList = dataMapper.sceneObjGroupBy("t_scene_plus",dayFormat,startTime,endTime,userIds);
+                proObjList = dataMapper.sceneObjGroupBy("t_scene_pro",dayFormat,startTime,endTime,userIds,null);
+                plusObjList = dataMapper.sceneObjGroupBy("t_scene_plus",dayFormat,startTime,endTime,userIds,null);
+                yzlList = dataMapper.sceneObjGroupBy("t_scene_plus",dayFormat,startTime,endTime,userIds,"yzl");
                 break;
             case 1 :
                 rule = Dateutils.WEEK;
                 proList = dataMapper.sceneGroupByWeek("t_scene_pro",startTime,endTime,userIds);
                 plusList = dataMapper.sceneGroupByWeek("t_scene_plus",startTime,endTime,userIds);
-                proObjList = dataMapper.sceneObjGroupByWeek("t_scene_pro",startTime,endTime,userIds);
-                plusObjList = dataMapper.sceneObjGroupByWeek("t_scene_plus",startTime,endTime,userIds);
+                proObjList = dataMapper.sceneObjGroupByWeek("t_scene_pro",startTime,endTime,userIds,null);
+                plusObjList = dataMapper.sceneObjGroupByWeek("t_scene_plus",startTime,endTime,userIds,null);
+                yzlList = dataMapper.sceneObjGroupByWeek("t_scene_plus",startTime,endTime,userIds,"yzl");
                 break;
             case 2 :
                 rule = Dateutils.MONTH;
                 proList = dataMapper.sceneGroupBy("t_scene_pro",mouthFormat,startTime,endTime,userIds);
                 plusList = dataMapper.sceneGroupBy("t_scene_plus",mouthFormat,startTime,endTime,userIds);
-                proObjList = dataMapper.sceneObjGroupBy("t_scene_pro",mouthFormat,startTime,endTime,userIds);
-                plusObjList = dataMapper.sceneObjGroupBy("t_scene_plus",mouthFormat,startTime,endTime,userIds);
+                proObjList = dataMapper.sceneObjGroupBy("t_scene_pro",mouthFormat,startTime,endTime,userIds,null);
+                yzlList = dataMapper.sceneObjGroupBy("t_scene_plus",mouthFormat,startTime,endTime,userIds,"yzl");
                 break;
         }
         HashMap<String, Long> kkMap = new HashMap<>();
@@ -309,6 +312,7 @@ public class DataService implements IDataService {
         HashMap<String, Long> ssObjMap = new HashMap<>();
         HashMap<String, Long> sgMap = new HashMap<>();
         HashMap<String, Long> sgObjMap = new HashMap<>();
+        HashMap<String, Long> yzlMap = new HashMap<>();
         for (DataGroupByCount dataGroupByCount : proList) {
             if(dataGroupByCount.getGroupKey2().equals("3")){    //看见
                 kjMap.merge(dataGroupByCount.getGroupKey(),dataGroupByCount.getCount(), Long:: sum);
@@ -353,19 +357,24 @@ public class DataService implements IDataService {
                 sgObjMap.merge(dataGroupByCount.getGroupKey(),dataGroupByCount.getCount(), Long:: sum);
             }
         }
+        for (DataGroupByCount dataGroupByCount : yzlList) {
+            yzlMap.merge(dataGroupByCount.getGroupKey(),dataGroupByCount.getCount(), Long:: sum);
+        }
         Long kkCount = 0L;
         Long KjCount = 0L;
         Long ssCount = 0L;
         Long ssObjCount = 0L;
         Long sgCount = 0L;
         Long sgObjCount = 0L;
+        Long yzlCount = 0L;
         if(dataType == 1){
-            kkCount = sceneProService.getKkCount(Arrays.asList("1","2","12","13","14"),startTime,userIds);
-            KjCount = sceneProService.getKkCount(Arrays.asList("3"),startTime,userIds);
+            kkCount = sceneProService.getKkCount(Arrays.asList("1","2","12","13","14"),startTime,userIds,null);
+            KjCount = sceneProService.getKkCount(Arrays.asList("3"),startTime,userIds,null);
             ssCount = sceneProService.getSsCount(Arrays.asList("4"),startTime,userIds);
             ssObjCount = sceneProService.getSsObjCount(Arrays.asList("4"),startTime,userIds);
             sgCount = sceneProService.getSsCount(Arrays.asList("5"),startTime,userIds);
             sgObjCount = sceneProService.getSsObjCount(Arrays.asList("5"),startTime,userIds);
+            yzlCount = sceneProService.getKkCount(Arrays.asList("1"),startTime,userIds,"yzl");
         }
         List<String> dates = Dateutils.findDatesStr(Dateutils.getDate(startTime), Dateutils.getDate(endTime),rule );
         setListData(kkList,kkMap,dates,dataType,kkCount);
@@ -375,6 +384,7 @@ public class DataService implements IDataService {
 
         setListData(sgList,sgMap,dates,dataType,sgCount);
         setListData(sgObjList,sgObjMap,dates,dataType,sgObjCount);
+        setListData(yzlList,yzlMap,dates,dataType,yzlCount);
 
         map.put("kkList",kkList);
         map.put("kjList",kjList);
@@ -382,6 +392,7 @@ public class DataService implements IDataService {
         map.put("ssobjList",ssObjList);
         map.put("sgList",sgList);
         map.put("sgobjList",sgObjList);
+        map.put("yzlList",yzlList);
         return map;
     }
 

+ 8 - 3
src/main/java/com/fdkankan/manage/service/impl/JySceneUserAuthServiceImpl.java

@@ -558,9 +558,14 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
                 jySceneUserAuth = jySceneUserAuthService.getByCaseIdAndJyUserId(jyUser.getId(), caseId,jySceneAuth.getAuthType());
             }
             setFlag(jySceneUserAuth,sceneAuthVo);
-            if(caseList != null && !caseList.isEmpty()){
-                for (Case aCase : caseList) {
-                    jySceneUserAuth = jySceneUserAuthService.getByCaseIdAndJyUserId(jyUser.getId(), aCase.getCaseId(),jySceneAuth.getAuthType());
+
+        }
+        if(caseList != null && !caseList.isEmpty()){
+            JySceneUserAuth jySceneUserAuth = null;
+            for (Case aCase : caseList) {
+                JySceneAuth jySceneAuth1 = jySceneAuthService.getByCaseId(aCase.getCaseId());
+                if(jySceneAuth1 != null){
+                    jySceneUserAuth = jySceneUserAuthService.getByCaseIdAndJyUserId(jyUser.getId(), aCase.getCaseId(),jySceneAuth1.getAuthType());
                     setFlag(jySceneUserAuth,sceneAuthVo);
                 }
             }

+ 4 - 16
src/main/java/com/fdkankan/manage/service/impl/JyUserServiceImpl.java

@@ -208,9 +208,8 @@ public class JyUserServiceImpl extends ServiceImpl<IJyUserMapper, JyUser> implem
         }
         List<UserAuthSceneVo> voList = new ArrayList<>();
 
-
-        List<JySceneUserAuth> jySceneUserAuths = jySceneUserAuthService.getByJyUserId(jyUser.getId());
-        if(jySceneUserAuths.isEmpty()){
+        JySceneUserAuth jySceneUserAuths = jySceneUserAuthService.getByCaseIdAndJyUserId(jyUser.getId(),param.getCaseId(),0);
+        if(jySceneUserAuths == null){
             return voList;
         }
 
@@ -220,12 +219,7 @@ public class JyUserServiceImpl extends ServiceImpl<IJyUserMapper, JyUser> implem
         }
         List<String> numList = caseNums.stream().map(CaseNum::getNum).collect(Collectors.toList());
 
-        List<String> authNumList = jySceneUserAuths.stream().map(JySceneUserAuth::getNum).collect(Collectors.toList());
-        List<String> containList = authNumList.stream().filter(numList::contains).collect(Collectors.toList());
-        if(containList.isEmpty()){
-            return voList;
-        }
-        List<ScenePlus> scenePluses = scenePlusService.getByNumList(containList);
+        List<ScenePlus> scenePluses = scenePlusService.getByNumList(numList);
 
         if(scenePluses.isEmpty()){
             return voList;
@@ -233,9 +227,6 @@ public class JyUserServiceImpl extends ServiceImpl<IJyUserMapper, JyUser> implem
         List<Long> plusIds = scenePluses.stream().map(ScenePlus::getId).collect(Collectors.toList());
         HashMap<Long, ScenePlusExt> byPlusIds = scenePlusExtService.getByPlusIds(plusIds);
 
-        HashMap<String,JySceneUserAuth> map = new HashMap<>();
-        jySceneUserAuths.forEach( e ->map.put(e.getNum(),e));
-
         for (ScenePlus scenePlus : scenePluses) {
             UserAuthSceneVo vo = new UserAuthSceneVo();
             BeanUtils.copyProperties(scenePlus,vo);
@@ -243,10 +234,7 @@ public class JyUserServiceImpl extends ServiceImpl<IJyUserMapper, JyUser> implem
             if(ext != null){
                 BeanUtils.copyProperties(ext,vo);
             }
-            JySceneUserAuth jySceneUserAuth = map.get(scenePlus.getNum());
-            if(jySceneUserAuth != null){
-                BeanUtils.copyProperties(jySceneUserAuth,vo);
-            }
+            BeanUtils.copyProperties(jySceneUserAuths, vo);
             voList.add(vo);
         }
 

+ 10 - 4
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -313,15 +313,16 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             throw new BusinessException(ResultCode.JY_ID_NO_EXIST);
         }
 
-        if(byId.getRoleId() == 47L ){
-            param.setUserId(jyUser.getUserId());
-        }
         if(byId.getRoleId() !=1 ){
             Integer loginPlatformId = jyUserPlatformService.getLoginPlatformId();
             if(loginPlatformId == null) {
                return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
             }
             param.setPlatformId(loginPlatformId);
+
+            if(byId.getRoleId() == 47L || param.getIsObj() != null){
+                param.setUserId(jyUser.getUserId());
+            }
         }
 
         if(param.getSceneType() == 1){
@@ -587,7 +588,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
 
     @Override
-    public Long getKkCount(List<String> asList, String startTime,List<Long> userIds) {
+    public Long getKkCount(List<String> asList, String startTime,List<Long> userIds,String treeCamType) {
         LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(ScenePro::getSceneSource,asList);
         if(!userIds.isEmpty()){
@@ -602,6 +603,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         if(!userIds.isEmpty()){
             wrapper2.in(ScenePlus::getUserId,userIds);
         }
+        if(StringUtils.isNotBlank(treeCamType)){
+            wrapper2.isNotNull(ScenePlus::getThreeCamType);
+        }else {
+            wrapper2.isNull(ScenePlus::getThreeCamType);
+        }
         wrapper2.lt(ScenePlus::getCreateTime,startTime);
         long count1 = scenePlusService.count(wrapper2);
         return count + count1;

+ 12 - 0
src/main/resources/mapper/manage/DataMapper.xml

@@ -177,6 +177,12 @@
         <if test="tb == 't_scene_pro'">
             AND is_upgrade = 0
         </if>
+        <if test="threeCamType !=null and threeCamType != ''">
+            AND p.three_cam_type is not null
+        </if>
+        <if test="threeCamType == null">
+            AND p.three_cam_type is  null
+        </if>
         <if test="userIds != null and userIds.size >0">
             and user_id in
             <foreach item="userId" collection="userIds" open="(" separator="," close=")">
@@ -199,6 +205,12 @@
         <if test="tb == 't_scene_pro'">
             AND is_upgrade = 0
         </if>
+        <if test="threeCamType !=null and threeCamType != ''">
+            AND p.three_cam_type is not null
+        </if>
+        <if test="threeCamType == null">
+            AND p.three_cam_type is  null
+        </if>
         <if test="userIds != null and userIds.size >0">
             and user_id in
             <foreach item="userId" collection="userIds" open="(" separator="," close=")">

+ 5 - 2
src/main/resources/mapper/manage/SceneProMapper.xml

@@ -30,12 +30,13 @@
     <select id="pageList" resultType="com.fdkankan.manage.vo.response.SceneVo">
         select s.title as sceneName ,s.num,s.create_time,c.sn_code,e.space as sceneSize
         ,u.user_name,e.view_count,s.scene_status as status,s.pay_status,'v4' as scene_version,e.web_site , e.thumb
-        ,algorithm_time,s.user_id,jy.platform_id,s.scene_source,s.three_cam_type
+        ,e.algorithm_time,s.user_id,jy.platform_id,s.scene_source,s.three_cam_type
         from t_scene_plus s
         left join t_scene_plus_ext e on s.id = e.plus_id
         left join t_user u on s.user_id = u.id
         left join t_camera c on s.camera_id = c.id
         left join jy_user jy on u.id = jy.user_id
+        LEFT JOIN fdkk_laser.t_scene ls on s.num = ls.scene_code
         where
         <include refid="commonWhere"></include>
         <if test="param.sceneType == 0">
@@ -78,7 +79,9 @@
     <sql id="commonWhere">
         s.rec_status = 'A'
         <if test="param.sceneName != null and param.sceneName!='' ">
-            and s.title like concat ('%',#{param.sceneName},'%')
+            and ( s.title like concat ('%',#{param.sceneName},'%')
+                or ls.title like concat ('%',#{param.sceneName},'%')
+            )
         </if>
         <if test="param.type != null and (param.type == 5 or param.type ==7)">
             and e.is_obj = 1