lyhzzz 8 months ago
parent
commit
8d2a33c657

+ 3 - 2
src/main/java/com/fdkankan/manage/controller/CommonController.java

@@ -41,7 +41,8 @@ public class CommonController {
      */
     @RequestMapping(value = "/upload/fileNew", method = RequestMethod.POST)
     public ResultData uploadNew(
-            @RequestParam(value = "file") MultipartFile file) throws Exception {
-        return commonService.uploadFileNew(file);
+            @RequestParam(value = "file") MultipartFile file,@RequestParam(value = "dictId") Integer dictId) {
+
+        return commonService.uploadFileNew(file,dictId);
     }
 }

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

@@ -17,5 +17,5 @@ public interface ICommonService {
     ResultData uploadFile(MultipartFile file) throws IOException;
 
 
-    ResultData uploadFileNew(MultipartFile file);
+    ResultData uploadFileNew(MultipartFile file,Integer dictId);
 }

+ 16 - 1
src/main/java/com/fdkankan/manage/service/impl/CommonServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fdkankan.manage.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.fdkankan.manage.common.OssPath;
@@ -9,6 +10,7 @@ import com.fdkankan.common.util.DateExtUtil;
 import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.manage.constant.FileTypeEnum;
 import com.fdkankan.manage.entity.CommonUpload;
+import com.fdkankan.manage.entity.DictFile;
 import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.service.ICommonService;
 import java.io.File;
@@ -16,9 +18,11 @@ import java.io.IOException;
 import java.util.*;
 
 import com.fdkankan.manage.service.ICommonUploadService;
+import com.fdkankan.manage.service.IDictFileService;
 import com.fdkankan.manage.util.FileWriterUtil;
 import com.fdkankan.manage.util.OBJToGLBUtil;
 import com.fdkankan.manage.util.ShellUtil;
+import com.fdkankan.manage.vo.response.DictFileVo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -72,9 +76,11 @@ public class CommonServiceImpl implements ICommonService {
 
     @Autowired
     ICommonUploadService commonUploadService;
+    @Autowired
+    IDictFileService dictFileService;
 
     @Override
-    public ResultData uploadFileNew(MultipartFile file) {
+    public ResultData uploadFileNew(MultipartFile file,Integer dictId) {
         if(file.isEmpty() ){
             throw new BusinessException(ResultCode.UPLOAD_ERROR);
         }
@@ -103,6 +109,15 @@ public class CommonServiceImpl implements ICommonService {
                 throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
             }
             CommonUpload commonUpload = commonUploadService.add(originalFilename.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum.getMsg(), extName.replace(".", ""),1,null);
+
+            DictFile dictFile = new DictFile();
+            dictFile.setName(commonUpload.getFileName());
+            dictFile.setTypeKey("media-library");
+            dictFile.setUploadId(commonUpload.getId());
+            dictFile.setDictId(dictId);
+            dictFile.setSysUserId(Long.valueOf(StpUtil.getLoginId().toString()));
+            dictFileService.addOrUpdate(dictFile);
+
             return ResultData.ok(commonUpload);
         }catch (Exception e){
             log.info("upload-file-error:{}",e);

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

@@ -81,7 +81,7 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
     @Override
     public void addOrUpdate(DictFile dictFile) {
         if(StringUtils.isBlank(dictFile.getName()) || StringUtils.isBlank(dictFile.getTypeKey())
-                || dictFile.getDictId() == null || dictFile.getUploadId() == null){
+                || dictFile.getDictId() == null ){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         this.saveOrUpdate(dictFile);

+ 0 - 6
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -303,12 +303,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
     @Override
     public PageInfo pageList(SceneParam param) {
-//        if(param.getType() == 2 || param.getType() == 6){  //深时
-//            return laserService.pageList(param);
-//        }
-        if(param.getType() == 3){ //双目lite
-           return sceneService.pageList(param);
-        }
         SysUser byId = sysUserService.getById(Long.valueOf(StpUtil.getLoginId().toString()));
         JyUser jyUser = jyUserService.getBySysId(byId.getId());
         if(jyUser == null){

+ 1 - 0
src/main/java/com/fdkankan/manage/vo/request/SceneParam.java

@@ -15,6 +15,7 @@ public class SceneParam extends RequestBase {
     private Integer type = 0;   //0 看看,1看见,2深时
     private Integer companyId;
     private Long userId;
+    private Integer isObj;
 
     private List<String> snCodes;
     private List<String> authNumList = new ArrayList<>();