Commit f26ec872 by 284718418@qq.com

修改BUG 云盘上传

parent abf77cb2
...@@ -4,6 +4,7 @@ import cn.timer.api.bean.disk.DiskCatalogue; ...@@ -4,6 +4,7 @@ import cn.timer.api.bean.disk.DiskCatalogue;
import cn.timer.api.bean.disk.DiskCatalogueFiles; import cn.timer.api.bean.disk.DiskCatalogueFiles;
import cn.timer.api.bean.disk.DiskFiles; import cn.timer.api.bean.disk.DiskFiles;
import cn.timer.api.bean.disk.DiskFilesLog; import cn.timer.api.bean.disk.DiskFilesLog;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.JxglEnumInterface; import cn.timer.api.config.enuminterface.JxglEnumInterface;
...@@ -75,9 +76,26 @@ public class DiskFilesController { ...@@ -75,9 +76,26 @@ public class DiskFilesController {
@PostMapping("/upload") @PostMapping("/upload")
@ApiOperation(value = "上传普通文件", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "上传普通文件", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> upload(@CurrentUser UserBean userBean, @RequestParam(required = true) MultipartFile[] file, public Result<Object> upload(@CurrentUser UserBean userBean, @RequestParam(required = true) MultipartFile[] file,
@ApiParam("文件文件夹或共享空间ID") @RequestParam(required = true) Integer catalogueId,HttpServletRequest request) { @ApiParam("文件文件夹或共享空间ID") @RequestParam(required = false) Integer catalogueId,HttpServletRequest request) {
if(catalogueId<=0){ if(catalogueId<=0){
return ResultUtil.error("上传失败,请选择文件夹"); DiskCatalogue diskCatalogue = DiskCatalogue.builder().build().selectOne(new QueryWrapper<DiskCatalogue>().select("id")
.eq("org_id", userBean.getOrgCode())
.eq("delete_flag",0)
.eq("create_user_id",userBean.getEmpNum()).orderByAsc("create_time")
);
if(StringUtils.isEmpty(diskCatalogue)){
diskCatalogue = new DiskCatalogue();
diskCatalogue.setCreateUserId(userBean.getEmpNum());
diskCatalogue.setOrgId(userBean.getOrgCode());
diskCatalogue.setParentIds("");
diskCatalogue.setName("我的文件夹");
diskCatalogue.setUserName(userBean.getUserInfo().getName());
diskCatalogue.setType(JxglEnumInterface.DiskCatalogueType.DISK_FILE.getType());
diskCatalogue.insert();
}
catalogueId = diskCatalogue.getId();
//return ResultUtil.error("上传失败,请选择文件夹");
} }
if (file == null || file.length == 0) { if (file == null || file.length == 0) {
return ResultUtil.error("上传失败,请选择上传文件"); return ResultUtil.error("上传失败,请选择上传文件");
......
...@@ -215,7 +215,7 @@ zip: ...@@ -215,7 +215,7 @@ zip:
sftp: sftp:
client: client:
protocol: 'sftp' protocol: 'sftp'
host: '39.108.180.180' host: '112.74.91.126'
port: '22' port: '22'
username: 'root' username: 'root'
password: 'fksdlfjs(*&&%HGgjfkdjsfhksh9781283KFHFFGHghhndbv##2@' password: 'fksdlfjs(*&&%HGgjfkdjsfhksh9781283KFHFFGHghhndbv##2@'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment