Browse Source

上传文件路径

master
zhouyl 1 year ago
parent
commit
7d6b3140f8
  1. 2
      tp-admin/src/main/java/com/inscloudtech/web/controller/system/TestReportController.java
  2. 11
      tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java
  3. 2
      tp-common/src/main/java/com/inscloudtech/common/utils/file/FileUploadUtils.java
  4. 6
      tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java

2
tp-admin/src/main/java/com/inscloudtech/web/controller/system/TestReportController.java

@ -110,7 +110,7 @@ public class TestReportController {
@SneakyThrows @SneakyThrows
@Log(title = "测试数据管理", businessType = BusinessType.INSERT) @Log(title = "测试数据管理", businessType = BusinessType.INSERT)
@PostMapping(value = "/uploadTestData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/uploadTestData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R uploadToolAndTips( @RequestPart("file") MultipartFile file,
public R uploadTestData( @RequestPart("file") MultipartFile file,
@RequestPart("reportName") String reportName) { @RequestPart("reportName") String reportName) {
if (StrUtil.isEmpty(reportName)) { if (StrUtil.isEmpty(reportName)) {

11
tp-admin/src/main/java/com/inscloudtech/web/controller/system/ToolManageController.java

@ -122,17 +122,6 @@ public class ToolManageController extends BaseController {
iToolManageService.downloadByToolName(downloadToolRequest,response); iToolManageService.downloadByToolName(downloadToolRequest,response);
} }
// /**
// * 修改测试包管理
// */
// @Log(title = "测试包管理", businessType = BusinessType.UPDATE)
// @RepeatSubmit()
// @PutMapping()
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody ToolManage bo) {
// return toAjax(iToolManageService.updateByBo(bo));
// }
/** /**
* 删除测试包管理 * 删除测试包管理
* *

2
tp-common/src/main/java/com/inscloudtech/common/utils/file/FileUploadUtils.java

@ -204,7 +204,7 @@ public class FileUploadUtils {
public static String getPathFileName(String uploadDir, String fileName) throws IOException { public static String getPathFileName(String uploadDir, String fileName) throws IOException {
int dirLastIndex = ProjectConfig.getProfile().length() + 1; int dirLastIndex = ProjectConfig.getProfile().length() + 1;
String currentDir = StringUtils.substring(uploadDir, dirLastIndex); String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
return Constants.RESOURCE_PREFIX + "/" + currentDir + fileName;
} }
/** /**

6
tp-system/src/main/java/com/inscloudtech/system/service/impl/ToolManageServiceImpl.java

@ -188,11 +188,7 @@ public class ToolManageServiceImpl implements IToolManageService {
ToolManage dbObj = baseMapper.selectOne(new LambdaQueryWrapper<ToolManage>().eq(ToolManage::getToolName, request.getToolName()) ToolManage dbObj = baseMapper.selectOne(new LambdaQueryWrapper<ToolManage>().eq(ToolManage::getToolName, request.getToolName())
.eq(ToolManage::getModuleName, request.getModuleName())); .eq(ToolManage::getModuleName, request.getModuleName()));
if (ObjectUtil.isNull(dbObj)) { if (ObjectUtil.isNull(dbObj)) {
throw new ServiceException("测试包信息不存在!");
}
if(dbObj.getToolOssId() == null || dbObj.getToolOssId() == 0L){
throw new ServiceException("文件数据不存在!");
throw new ServiceException("测试工具信息不存在!");
} }
if(request.getType() == 0){ if(request.getType() == 0){

Loading…
Cancel
Save