lyhzzz 8 months ago
parent
commit
66624beb35

+ 1 - 1
src/main/java/com/fdkankan/fusion/common/FilePath.java

@@ -19,5 +19,5 @@ public class FilePath {
     public final static String OFFLINE_RESOURCE_PACKAGE_PATH = OFFLINE_PACKAGE_PATH + "%s/www/package/resource/";
     public final static String OFFLINE_OSS_PATH = OFFLINE_PACKAGE_PATH + "%s/www";
     public final static String OFFLINE_LASER_OSS_PATH =  "/swss/%s/www/%s/";
-    public final static String LASER_OSS_PATH = "laser-prod/%s/data/%s/webcloud";
+    public final static String LASER_OSS_PATH = "laser-prod/%s/data/%s_ply.zip";
 }

+ 10 - 1
src/main/java/com/fdkankan/fusion/common/util/MinIoUploadService.java

@@ -227,7 +227,7 @@ public class MinIoUploadService {
     }
 
 
-    public Long getSize(String filePath){
+    public Long getSizePath(String filePath){
         Long total = 0L;
         try {
             Iterable<Result<Item>> results = listObjects(bucketName, filePath, true);
@@ -246,5 +246,14 @@ public class MinIoUploadService {
         return total;
     }
 
+    public Long getSize(String filePath){
+        Long total = 0L;
+        try {
+        }catch (Exception e){
+            log.info("oss-getFileInfo-error:{}",e);
+        }
+        return total;
+    }
+
 
 }

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/CaseFilesController.java

@@ -111,7 +111,7 @@ public class CaseFilesController extends BaseController{
         caseFilesService.removeById(caseFiles.getFilesId());
 
         //删除认定书,案件修改为未认定
-        if(caseFiles1 != null && caseFiles1.getFilesTypeId() == 4){
+        if(caseFiles1 != null && caseFiles1.getFilesTypeId() == 5){
             List<CaseFiles> caseFilesList = caseFilesService.allList(caseFiles1.getCaseId(),caseFiles1.getFilesTypeId());
             if(caseFilesList == null || caseFilesList.size() <=0){
                 caseService.updateIdenTityStatus(caseFiles1.getCaseId(),0);

+ 2 - 2
src/main/java/com/fdkankan/fusion/controller/LoginController.java

@@ -50,8 +50,8 @@ public class LoginController extends BaseController{
                 || StringUtils.isBlank(param.getCode()) || StringUtils.isBlank(param.getDeptId())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        String id = request.getSession().getId();
-        //String id = param.getCode();
+        //String id = request.getSession().getId();
+        String id = param.getCode();
         if(!redisUtil.hasKey(String.format(RedisKeyUtil.loginAuthCode,id))){
             throw new BusinessException(ResultCode.LOGIN_AUTH_NOT_EXIST);
         }

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/NoLoginController.java

@@ -53,7 +53,7 @@ public class NoLoginController {
             LineCaptcha lineCaptcha = new LineCaptcha(200, 100);
             RandomGenerator mathGenerator = new RandomGenerator("1234567890",4);
             lineCaptcha.setGenerator(mathGenerator);
-            redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,id),lineCaptcha.getCode(),60*5);
+            redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,lineCaptcha.getCode()),lineCaptcha.getCode(),60*5);
             lineCaptcha.write(response.getOutputStream());
             response.getOutputStream().close();
         } catch (Exception e){

+ 2 - 4
src/main/java/com/fdkankan/fusion/controller/SceneController.java

@@ -94,10 +94,8 @@ public class SceneController extends BaseController{
             String sceneObjPath =null;
 
             if(type == 2 || type == 5){  //点云
-                sceneObjPath = String.format(FilePath.LASER_OSS_PATH, num,num)+"/cloud.js" ;
+                sceneObjPath = String.format(FilePath.LASER_OSS_PATH, num,num) ;
                 fileInfo = minIoUploadService.getFileStatusInfo(sceneObjPath);
-                String scenePath = String.format(FilePath.LASER_OSS_PATH, num,num);
-                size = minIoUploadService.getSize(scenePath);
             }else {
                 sceneObjPath = String.format(FilePath.OBJ_OSS_PATH,num) + "/images/3dtiles/tileset.json";
                 if(!uploadToOssUtil.existKey(sceneObjPath)){
@@ -113,7 +111,7 @@ public class SceneController extends BaseController{
             if(fileInfo == null){
                 throw new BusinessException(ResultCode.FILE_NOT_EXIST);
             }
-            fileInfo.setSize(size);
+            fileInfo.setSize(size == null? fileInfo.getSize() : size);
             String objPath = String.format(FilePath.OBJ_LOCAL_PATH,environment , num) ;
             File file = new File(objPath +"/"+num + "_hash.txt");
             res.setContentType("application/octet-stream");

+ 5 - 4
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -113,11 +113,12 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
                     }else {
                         model.setCreateStatus(2);
                         threadService.objToB3dm(num,param.getType());
+//                        model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
+//                        model.setModelGlbUrl(getGlbUrl(param.getType(),num,model));
+//                        model.setModelType("b3dm");
+//                        model.setModelDateType("b3dm");
                     }
-//                    model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
-//                    model.setModelGlbUrl(getGlbUrl(param.getType(),num,model));
-//                    model.setModelType("b3dm");
-//                    model.setModelDateType("b3dm");
+
                 }
                 model.setNum(num);
                 modelList.add(model);

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

@@ -172,7 +172,7 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
         HashMap<String, TmDepartment> mapBySnCodes = tmCameraService.getMapBySnCodes(snList);
         for (SceneVo sceneVo : listAll) {
             if(StringUtils.isNotBlank(sceneVo.getSnCode())){
-                TmDepartment tmDepartment = mapBySnCodes.get(sceneVo.getSnCode());
+                TmDepartment tmDepartment = mapBySnCodes.get(sceneVo.getSnCode().toUpperCase());
                 if(tmDepartment != null){
                     sceneVo.setDeptId(tmDepartment.getId());
                     sceneVo.setDeptName(tmDepartment.getName());

+ 5 - 1
src/main/java/com/fdkankan/fusion/service/impl/TmDepartmentServiceImpl.java

@@ -81,9 +81,13 @@ public class TmDepartmentServiceImpl extends ServiceImpl<ITmDepartmentMapper, Tm
         if(dept.getId().equals(dept.getParentId())){
             throw new BusinessException(ResultCode.DEPT_EDIT_ERROR);
         }
-        if(dept.getLevel() != null && dept.getLevel() >4){
+        List<TmDepartment> tmDepartments = new ArrayList<>();
+        this.getParentList(dept.getParentId(),tmDepartments);
+        List<TmDepartment> collect1 = tmDepartments.stream().filter(entity -> !entity.getId().equals("0")).collect(Collectors.toList());
+        if(collect1.size() >=4){
             throw new BusinessException(ResultCode.DEPT_ADD_ERROR);
         }
+
         List<TmDepartment> sonByDeptId = this.getSonByDeptId(dept.getId());
         if(sonByDeptId.size() >0){
             List<String> collect = sonByDeptId.stream().map(TmDepartment::getId).collect(Collectors.toList());

+ 2 - 1
src/main/java/com/fdkankan/fusion/service/impl/UploadService.java

@@ -16,6 +16,7 @@ import sun.rmi.runtime.Log;
 import javax.annotation.Resource;
 import java.io.File;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.util.LinkedHashSet;
 import java.util.UUID;
@@ -100,7 +101,7 @@ public class UploadService {
             if(!uploadToOssUtil.existKey(filePathAdd + fileName + suffixName)){
                 throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);
             }
-            return queryPath +filePathAdd+ URLEncoder.encode(fileName,"utf-8") + suffixName;
+            return queryPath +filePathAdd+ URLEncoder.encode(fileName,"utf-8").replace("+", "%20") + suffixName;
         }catch (Exception e){
             log.info("upload-error:{}",e);
             throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);