|
@@ -1,25 +1,17 @@
|
|
package com.ruoyi.web.controller.system;
|
|
package com.ruoyi.web.controller.system;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
import com.ruoyi.common.annotation.Log;
|
|
import com.ruoyi.common.annotation.Log;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
import com.ruoyi.system.domain.SysRepo;
|
|
import com.ruoyi.system.domain.SysRepo;
|
|
import com.ruoyi.system.service.ISysRepoService;
|
|
import com.ruoyi.system.service.ISysRepoService;
|
|
-import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 仓库管理Controller
|
|
* 仓库管理Controller
|
|
@@ -39,11 +31,10 @@ public class SysRepoController extends BaseController
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:repo:list')")
|
|
@PreAuthorize("@ss.hasPermi('system:repo:list')")
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
- public TableDataInfo list(SysRepo sysRepo)
|
|
|
|
|
|
+ public AjaxResult list(SysRepo sysRepo)
|
|
{
|
|
{
|
|
- startPage();
|
|
|
|
List<SysRepo> list = sysRepoService.selectSysRepoList(sysRepo);
|
|
List<SysRepo> list = sysRepoService.selectSysRepoList(sysRepo);
|
|
- return getDataTable(list);
|
|
|
|
|
|
+ return success(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -68,6 +59,25 @@ public class SysRepoController extends BaseController
|
|
return toAjax(sysRepoService.insertSysRepo(sysRepo));
|
|
return toAjax(sysRepoService.insertSysRepo(sysRepo));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:repo:addByfile')")
|
|
|
|
+ @Log(title = "新增仓库文件", businessType = BusinessType.INSERT)
|
|
|
|
+ public AjaxResult addByfile(@RequestParam("parent_id") Long parent_id,@RequestParam("file") MultipartFile file)
|
|
|
|
+ {
|
|
|
|
+ if(!file.isEmpty()){
|
|
|
|
+ SysRepo sysRepo = new SysRepo();
|
|
|
|
+ sysRepo.setRepoName(file.getOriginalFilename());
|
|
|
|
+ sysRepo.setParentId(parent_id);
|
|
|
|
+ sysRepo.setRepoType("file");
|
|
|
|
+ sysRepo.setRepoLevel(sysRepoService.selectSysRepoByRepoId(parent_id).getRepoLevel() + 1);
|
|
|
|
+ sysRepo.setRepoStatus("public");
|
|
|
|
+ sysRepo.setCreateBy(getLoginUser().getUserId());
|
|
|
|
+ return toAjax(sysRepoService.insertSysRepo(sysRepo));
|
|
|
|
+ }else{
|
|
|
|
+ return error("上传文件异常,请联系管理员");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 修改仓库
|
|
* 修改仓库
|
|
*/
|
|
*/
|