Commit 21bf2946 authored by liuChang's avatar liuChang

Merge branch 'master' of 192.168.60.201:root/dsk-operate-sys

parents 3c730780 bcf1477a
package com.dsk.web.controller.business; package com.dsk.web.controller.business;
import java.util.List; import com.dsk.common.core.controller.BaseController;
import javax.annotation.PostConstruct; import com.dsk.common.core.domain.AjaxResult;
import javax.servlet.http.HttpServletResponse;
import com.dsk.common.core.domain.entity.BusinessBacklog; import com.dsk.common.core.domain.entity.BusinessBacklog;
import com.dsk.common.utils.poi.ExcelUtil; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.service.IBusinessBacklogService; import com.dsk.system.service.IBusinessBacklogService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import java.util.List;
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 com.dsk.common.annotation.Log;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.enums.BusinessType;
import com.dsk.common.core.page.TableDataInfo;
/** /**
* 项目工作待办Controller * 项目工作待办Controller
......
package com.dsk.web.controller.business; package com.dsk.web.controller.business;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.dsk.common.core.domain.entity.BusinessContacts;
import com.dsk.common.utils.poi.ExcelUtil;
import com.dsk.system.service.IBusinessContactsService;
import org.springframework.security.access.prepost.PreAuthorize;
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 com.dsk.common.annotation.Log;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult; import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.enums.BusinessType; import com.dsk.common.core.domain.entity.BusinessContacts;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.service.IBusinessContactsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* 项目联系人Controller * 项目联系人Controller
......
...@@ -3,13 +3,17 @@ package com.dsk.web.controller.business; ...@@ -3,13 +3,17 @@ package com.dsk.web.controller.business;
import com.dsk.common.config.RuoYiConfig; import com.dsk.common.config.RuoYiConfig;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult; import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.file.FileUploadUtils;
import com.dsk.common.utils.file.FileUtils; import com.dsk.common.utils.file.FileUtils;
import com.dsk.framework.config.ServerConfig;
import com.dsk.system.domain.BusinessIdDto;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
...@@ -23,8 +27,8 @@ import java.util.List; ...@@ -23,8 +27,8 @@ import java.util.List;
@RequestMapping("/business/file") @RequestMapping("/business/file")
public class BusinessFileController extends BaseController { public class BusinessFileController extends BaseController {
// 本地资源路径 @Autowired
public static final String LOCALPATH = RuoYiConfig.getProfile(); private ServerConfig serverConfig;
/** /**
* 新建文件夹 * 新建文件夹
...@@ -33,36 +37,63 @@ public class BusinessFileController extends BaseController { ...@@ -33,36 +37,63 @@ public class BusinessFileController extends BaseController {
// @Log(title = "项目资料文档", businessType = BusinessType.INSERT) // @Log(title = "项目资料文档", businessType = BusinessType.INSERT)
@GetMapping("/new/{filePath}") @GetMapping("/new/{filePath}")
public AjaxResult newFolder(@PathVariable String filePath) { public AjaxResult newFolder(@PathVariable String filePath) {
return FileUtils.newFolder(LOCALPATH + filePath) ? AjaxResult.success() : AjaxResult.error(); return FileUtils.newFolder(RuoYiConfig.getProfile() + filePath) ? AjaxResult.success() : AjaxResult.error();
} }
/** /**
* 删除某个文件或整个文件夹 * 删除某个文件或整个文件夹
*/ */
@GetMapping("/remove/{filePath}") @PostMapping("/remove")
public AjaxResult removeFile(@PathVariable String filePath) { public AjaxResult removeFile(@RequestBody(required=false) BusinessIdDto folderPath) {
boolean deleteFile = FileUtils.deleteFile(LOCALPATH + filePath); return FileUtils.delFolder(RuoYiConfig.getProfile() + folderPath.getFolderPath()) ? AjaxResult.success() : AjaxResult.error();
return deleteFile ? AjaxResult.success() : AjaxResult.error();
} }
/** /**
* 分页查询项目的所有文件
* 获取文件夹中所有文件 * 获取文件夹中所有文件
*/ */
@GetMapping("/all/{folderPath}") @GetMapping(value = "/list")
public AjaxResult getAllFiles(@PathVariable String folderPath) { public TableDataInfo getAllFiles(@RequestBody(required=false) BusinessIdDto folderPath) {
List<String> allFiles = FileUtils.getAllFiles(LOCALPATH + folderPath); startPage();
return AjaxResult.success(allFiles); List<String> allFiles = FileUtils.getAllFiles(RuoYiConfig.getProfile() + folderPath.getFolderPath());
return getDataTable(allFiles);
} }
/** /* *//**
* 上传文件及文件夹 * 上传文件及文件夹
* @param url * @param url
* @param folderPath * @param folderPath
* @return * @return
*/ *//*
@GetMapping("/upload/{url}/{folderPath}") @GetMapping("/upload/{url}/{folderPath}")
public AjaxResult uploadFolder(@PathVariable("url") String url,@PathVariable("folderPath") String folderPath) throws IOException { public AjaxResult uploadFolder(@PathVariable("url") String url,@PathVariable("folderPath") String folderPath) throws IOException {
return toAjax(FileUtils.uploadFolder(url, LOCALPATH + folderPath)); return toAjax(FileUtils.uploadFolder(url, LOCALPATH + folderPath));
}*/
/**
* 上传文件及文件夹
* @param file 文件流
* @param request 请求头参数
* @return
*/
@PostMapping("/upload/")
public AjaxResult uploadFolder(@RequestPart("file") MultipartFile file, HttpServletRequest request){
try {
String businessFileName = request.getParameter("filePath");
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath()+businessFileName;
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
} catch (IOException e) {
return AjaxResult.error(e.getMessage());
}
} }
/** /**
......
package com.dsk.web.controller.business; package com.dsk.web.controller.business;
import java.util.List; import com.dsk.common.core.controller.BaseController;
import javax.servlet.http.HttpServletResponse; import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessFollowRecord; import com.dsk.common.core.domain.entity.BusinessFollowRecord;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.domain.BusinessIdDto; import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.service.IBusinessFollowRecordService; import com.dsk.system.service.IBusinessFollowRecordService;
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.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import java.util.List;
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 com.dsk.common.annotation.Log;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.enums.BusinessType;
import com.dsk.common.utils.poi.ExcelUtil;
import com.dsk.common.core.page.TableDataInfo;
/** /**
* 项目跟进记录Controller * 项目跟进记录Controller
......
package com.dsk.web.controller.business; package com.dsk.web.controller.business;
import java.util.List; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessInfo; import com.dsk.common.core.domain.entity.BusinessInfo;
import com.dsk.common.dtos.BusinessInfoDto; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.CheckUtils;
import com.dsk.system.domain.BusinessAddDto; import com.dsk.system.domain.BusinessAddDto;
import com.dsk.system.domain.BusinessListDto; import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.domain.vo.BusinessBrowseVo;
import com.dsk.system.domain.vo.BusinessListVo; import com.dsk.system.domain.vo.BusinessListVo;
import com.dsk.system.service.IBusinessInfoService; import com.dsk.system.service.IBusinessInfoService;
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.*; import org.springframework.web.bind.annotation.*;
import com.dsk.common.annotation.Log;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.enums.BusinessType;
import com.dsk.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import java.util.List;
import javax.servlet.http.HttpServletResponse;
/** /**
* 项目详情Controller * 项目详情Controller
......
package com.dsk.web.controller.business; package com.dsk.web.controller.business;
import java.util.List; import com.dsk.common.core.controller.BaseController;
import javax.servlet.http.HttpServletResponse; import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessLabel; import com.dsk.common.core.domain.entity.BusinessLabel;
import com.dsk.common.utils.poi.ExcelUtil;
import com.dsk.system.domain.BusinessIdDto; import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.service.IBusinessLabelService; import com.dsk.system.service.IBusinessLabelService;
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.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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.dsk.common.annotation.Log;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.enums.BusinessType;
import com.dsk.common.core.page.TableDataInfo;
/** /**
* 项目标签Controller * 项目标签Controller
......
package com.dsk.web.controller.business; package com.dsk.web.controller.business;
import java.util.List; import com.dsk.common.core.controller.BaseController;
import javax.servlet.http.HttpServletResponse; import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessRelateCompany; import com.dsk.common.core.domain.entity.BusinessRelateCompany;
import com.dsk.common.utils.poi.ExcelUtil; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.domain.BusinessIdDto; import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.service.IBusinessRelateCompanyService; import com.dsk.system.service.IBusinessRelateCompanyService;
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.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import java.util.List;
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 com.dsk.common.annotation.Log;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.enums.BusinessType;
import com.dsk.common.core.page.TableDataInfo;
/** /**
* 项目关联单位Controller * 项目相关企业Controller
* *
* @author lxl * @author lxl
* @date 2023-05-17 * @date 2023-05-17
...@@ -37,7 +25,7 @@ public class BusinessRelateCompanyController extends BaseController ...@@ -37,7 +25,7 @@ public class BusinessRelateCompanyController extends BaseController
private IBusinessRelateCompanyService businessRelateCompanyService; private IBusinessRelateCompanyService businessRelateCompanyService;
/** /**
* 查询关联单位角色 * 查询相关企业角色
*/ */
@PostMapping("/role/list") @PostMapping("/role/list")
public AjaxResult companyRoleList(@RequestBody BusinessIdDto dto){ public AjaxResult companyRoleList(@RequestBody BusinessIdDto dto){
...@@ -45,7 +33,7 @@ public class BusinessRelateCompanyController extends BaseController ...@@ -45,7 +33,7 @@ public class BusinessRelateCompanyController extends BaseController
} }
/** /**
* 查询项目关联单位列表 * 查询项目相关企业列表
*/ */
// @PreAuthorize("@ss.hasPermi('system:company:list')") // @PreAuthorize("@ss.hasPermi('system:company:list')")
@GetMapping("/list") @GetMapping("/list")
...@@ -78,6 +66,17 @@ public class BusinessRelateCompanyController extends BaseController ...@@ -78,6 +66,17 @@ public class BusinessRelateCompanyController extends BaseController
return toAjax(businessRelateCompanyService.updateBusinessRelateCompany(businessRelateCompany)); return toAjax(businessRelateCompanyService.updateBusinessRelateCompany(businessRelateCompany));
} }
/**
* 删除项目关联单位
*/
// @PreAuthorize("@ss.hasPermi('system:company:remove')")
// @Log(title = "项目关联单位", businessType = BusinessType.DELETE)
@DeleteMapping("/remove/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(businessRelateCompanyService.deleteBusinessRelateCompanyByIds(ids));
}
// /** // /**
// * 导出项目关联单位列表 // * 导出项目关联单位列表
// */ // */
...@@ -101,15 +100,4 @@ public class BusinessRelateCompanyController extends BaseController ...@@ -101,15 +100,4 @@ public class BusinessRelateCompanyController extends BaseController
// return success(businessRelateCompanyService.selectBusinessRelateCompanyById(id)); // return success(businessRelateCompanyService.selectBusinessRelateCompanyById(id));
// } // }
//
// /**
// * 删除项目关联单位
// */
// @PreAuthorize("@ss.hasPermi('system:company:remove')")
// @Log(title = "项目关联单位", businessType = BusinessType.DELETE)
// @DeleteMapping("/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// {
// return toAjax(businessRelateCompanyService.deleteBusinessRelateCompanyByIds(ids));
// }
} }
...@@ -51,9 +51,8 @@ public class MarketAnalysisController extends BaseController { ...@@ -51,9 +51,8 @@ public class MarketAnalysisController extends BaseController {
/* /*
* 资质等级按照大类、省份、等级类型分组 * 资质等级按照大类、省份、等级类型分组
*/ */
@RequestMapping("/certGroupByCategoryProvinceLevel") @RequestMapping("/certGroupByMajorProvinceLevel")
public AjaxResult certGroupByCategoryProvinceLevel() { public AjaxResult certGroupByMajorProvinceLevel() {
return marketAnalysisService.certGroupByMajorProvinceLevel(); return marketAnalysisService.certGroupByMajorProvinceLevel();
} }
......
...@@ -8,8 +8,9 @@ ruoyi: ...@@ -8,8 +8,9 @@ ruoyi:
copyrightYear: 2023 copyrightYear: 2023
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/server/dsk-operate-sys/uploadPath)
profile: D:/dsk-operate-sys/uploadPath/ # profile: D:/dsk-operate-sys/uploadPath/
profile: /home/server/dsk-operate-sys/uploadPath/
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
......
package com.dsk.common.utils.file; package com.dsk.common.utils.file;
import java.io.File; import com.dsk.common.config.RuoYiConfig;
import java.io.FileInputStream; import com.dsk.common.exception.base.BaseException;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.dsk.common.utils.DateUtils; import com.dsk.common.utils.DateUtils;
import com.dsk.common.utils.StringUtils; import com.dsk.common.utils.StringUtils;
import com.dsk.common.utils.uuid.IdUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.dsk.common.config.RuoYiConfig;
import com.dsk.common.utils.uuid.IdUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
...@@ -35,6 +18,18 @@ import org.apache.http.entity.mime.content.FileBody; ...@@ -35,6 +18,18 @@ import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/** /**
* 文件处理工具类 * 文件处理工具类
* *
...@@ -46,6 +41,10 @@ public class FileUtils ...@@ -46,6 +41,10 @@ public class FileUtils
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
public static void main(String[] args) {
System.out.println(RuoYiConfig.getProfile());
}
/** /**
* 检查目录是否存在,如果不存在,则创建目录,如果创建失败则返回false * 检查目录是否存在,如果不存在,则创建目录,如果创建失败则返回false
* *
...@@ -57,8 +56,10 @@ public class FileUtils ...@@ -57,8 +56,10 @@ public class FileUtils
if (!file.exists()) { if (!file.exists()) {
boolean isSuccess = file.mkdir(); boolean isSuccess = file.mkdir();
if (!isSuccess) if (!isSuccess)
file.mkdirs(); if (!file.exists()) {
return !isSuccess; file.mkdirs();
}
return isSuccess;
} else { } else {
return true; return true;
} }
...@@ -160,12 +161,12 @@ public class FileUtils ...@@ -160,12 +161,12 @@ public class FileUtils
return FileUploadUtils.getPathFileName(uploadDir, pathName); return FileUploadUtils.getPathFileName(uploadDir, pathName);
} }
/* *//** /**
* 删除文件 * 删除文件
* *
* @param filePath 文件 * @param filePath 文件
* @return * @return
*//* */
public static boolean deleteFile(String filePath) public static boolean deleteFile(String filePath)
{ {
boolean flag = false; boolean flag = false;
...@@ -176,22 +177,20 @@ public class FileUtils ...@@ -176,22 +177,20 @@ public class FileUtils
flag = file.delete(); flag = file.delete();
} }
return flag; return flag;
}*/ }
/** /**
* 删除整个文件夹或者文某个文件 * 删除整个文件夹或者文某个文件
* *
* @param filePath 文件 * @param filePath 文件
* @return * @return
*/ */
public static boolean deleteFile(String filePath) { public static boolean delFolder(String filePath) {
try { try {
if(StringUtils.isNotEmpty(delAllFile(filePath))) return false; delAllFile(filePath); // 删除里面的所有文件
File file = new File(filePath); File file = new File(filePath);
return file.delete(); return file.delete(); // 删除空文件夹
} catch (Exception e) { } catch (Exception e) {
log.info("删除文件失败"); throw new BaseException("删除文件夹失败",e.getMessage());
e.printStackTrace();
return false;
} }
} }
...@@ -200,32 +199,50 @@ public class FileUtils ...@@ -200,32 +199,50 @@ public class FileUtils
* *
* @param path 文件夹路径 * @param path 文件夹路径
*/ */
public static String delAllFile(String path) { public static void delAllFile(String path) {
String hint = "这是一个根目录,请更换目录!"; String hint = "这是一个根目录,请更换目录!";
File file = new File(path); File file = new File(path);
if (!file.exists()) { if (!file.exists()) {
return hint; throw new BaseException("文件不存在");
} }
// if (!file.isDirectory()) { // if (!file.isDirectory()) {
// return false; // return false;
// } // }
if (file.getAbsolutePath().equalsIgnoreCase("/")) { if (file.getAbsolutePath().equalsIgnoreCase("/")) {
return hint; throw new BaseException(hint);
} }
if (file.getAbsolutePath().equalsIgnoreCase("/root")) { if (file.getAbsolutePath().equalsIgnoreCase("/root")) {
return hint; throw new BaseException(hint);
} }
if (file.getAbsolutePath().equalsIgnoreCase("/usr") || file.getAbsolutePath().equalsIgnoreCase("/opt") if (file.getAbsolutePath().equalsIgnoreCase("/usr") || file.getAbsolutePath().equalsIgnoreCase("/opt")
|| file.getAbsolutePath().equalsIgnoreCase("/bin") || file.getAbsolutePath().equalsIgnoreCase("/sbin") || file.getAbsolutePath().equalsIgnoreCase("/bin") || file.getAbsolutePath().equalsIgnoreCase("/sbin")
|| file.getAbsolutePath().equalsIgnoreCase("/etc") || file.getAbsolutePath().equalsIgnoreCase("/selinux") || file.getAbsolutePath().equalsIgnoreCase("/etc") || file.getAbsolutePath().equalsIgnoreCase("/selinux")
|| file.getAbsolutePath().equalsIgnoreCase("/sys") || file.getAbsolutePath().equalsIgnoreCase("/var") || file.getAbsolutePath().equalsIgnoreCase("/sys") || file.getAbsolutePath().equalsIgnoreCase("/var")
|| file.getAbsolutePath().equalsIgnoreCase("/home") || file.getAbsolutePath().equalsIgnoreCase("/net")) { || file.getAbsolutePath().equalsIgnoreCase("/home") || file.getAbsolutePath().equalsIgnoreCase("/net")) {
return hint; throw new BaseException(hint);
} }
if (file.getAbsolutePath().equalsIgnoreCase("C://") || file.getAbsolutePath().equalsIgnoreCase("C:\\\\")) { if (file.getAbsolutePath().equalsIgnoreCase("C://") || file.getAbsolutePath().equalsIgnoreCase("C:\\\\")) {
return hint; throw new BaseException(hint);
}
String[] tempList = file.list();
File temp;
if (tempList == null) {
return;
}
for (String aTempList : tempList) {
if (path.endsWith(File.separator)) {
temp = new File(path + aTempList);
} else {
temp = new File(path + File.separator + aTempList);
}
if (temp.isFile()) {
temp.delete();
}
if (temp.isDirectory()) {
delAllFile(path + "/" + aTempList);// 删除里面的所有文件
delFolder(path + "/" + aTempList);// 删除空文件夹
}
} }
return "";
} }
......
...@@ -114,4 +114,7 @@ export default { ...@@ -114,4 +114,7 @@ export default {
::v-deep .el-table__body tr.current-row > td.el-table__cell{ ::v-deep .el-table__body tr.current-row > td.el-table__cell{
background-color: #ffffff; background-color: #ffffff;
} }
::v-deep .el-table__fixed{
height: calc(100% - 16px) !important;
}
</style> </style>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<tables <tables
:indexFixed="true" :indexFixed="true"
:defaultSort="defaultSort"
:tableLoading="tableLoading" :tableLoading="tableLoading"
:tableData="tableData" :tableData="tableData"
:forData="forData" :forData="forData"
...@@ -56,10 +57,11 @@ export default { ...@@ -56,10 +57,11 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
defaultSort: {prop: 'issueTime', order: 'descending'},
forData: [ forData: [
{label: '招标代理单位名称', prop: 'agency', minWidth: '350', slot: true}, {label: '招标代理单位名称', prop: 'agency', minWidth: '350', slot: true},
{label: '合作项目/工程名称', prop: 'projectInfo', minWidth: '400', sortable: 'custom', slot: true}, {label: '合作项目/工程名称', prop: 'projectInfo', minWidth: '400', slot: true, sortable: 'custom', descending: '5', ascending: '6'},
{label: '最近一次合作时间', prop: 'issueTime', minWidth: '140', sortable: 'custom'} {label: '最近一次合作时间', prop: 'issueTime', minWidth: '140', sortable: 'custom', descending: '3', ascending: '4'}
], ],
formData: [ formData: [
{ type: 3, fieldName: 'keys', value: '', placeholder: '输入企业名称查询', options: []}, { type: 3, fieldName: 'keys', value: '', placeholder: '输入企业名称查询', options: []},
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
pageSize: 10 pageSize: 10
}, },
formData: [ formData: [
{ type: 3, fieldName: 'keys', value: '', placeholder: '输入企业名称查询', options: []}, { type: 3, fieldName: 'keys', value: '', placeholder: '输入合作项目/工程名称查询', options: []},
], ],
forData: [ forData: [
{label: '合作项目/工程名称', prop: 'dealTitle', width: '720', slot: true}, {label: '合作项目/工程名称', prop: 'dealTitle', width: '720', slot: true},
......
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
{ type: 3, fieldName: 'keys', value: '', placeholder: '输入项目/工程名称查询', options: []}, { type: 3, fieldName: 'keys', value: '', placeholder: '输入项目/工程名称查询', options: []},
], ],
forData: [ forData: [
{label: '合作项目/工程名称', prop: 'projectAllName', width: '720', slot: true}, {label: '合作项目/工程名称', prop: 'projectAllName', width: '720', fixed: true, slot: true},
{label: '项目/工程金额(万元)', prop: 'winBidAmount', width: '160'}, {label: '项目/工程金额(万元)', prop: 'winBidAmount', width: '160'},
{label: '合作时间', prop: 'winBidTime', width: '100'}, {label: '合作时间', prop: 'winBidTime', width: '100'},
{label: '项目地区', prop: 'province', width: '160', slot: true}, {label: '项目地区', prop: 'province', width: '160', slot: true},
......
...@@ -79,10 +79,10 @@ export default { ...@@ -79,10 +79,10 @@ export default {
pageSize: 10 pageSize: 10
}, },
formData: [ formData: [
{ type: 3, fieldName: 'keys', value: '', placeholder: '输入企业名称查询', options: []}, { type: 3, fieldName: 'keys', value: '', placeholder: '输入合作项目/工程名称查询', options: []},
], ],
forData: [ forData: [
{label: '合作项目/工程名称', prop: 'projectAllName', width: '720', slot: true}, {label: '合作项目/工程名称', prop: 'projectAllName', width: '720', fixed: true, slot: true},
{label: '项目/工程金额(万元)', prop: 'winBidAmount', width: '160'}, {label: '项目/工程金额(万元)', prop: 'winBidAmount', width: '160'},
{label: '合作时间', prop: 'winBidTime', width: '100'}, {label: '合作时间', prop: 'winBidTime', width: '100'},
{label: '项目地区', prop: 'province', width: '160', slot: true}, {label: '项目地区', prop: 'province', width: '160', slot: true},
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<tables <tables
:indexFixed="true" :indexFixed="true"
:defaultSort="defaultSort"
:tableLoading="tableLoading" :tableLoading="tableLoading"
:tableData="tableData" :tableData="tableData"
:forData="forData" :forData="forData"
...@@ -20,8 +21,8 @@ ...@@ -20,8 +21,8 @@
@sort-change="sortChange" @sort-change="sortChange"
> >
<template slot="projectAllName" slot-scope="scope"> <template slot="projectAllName" slot-scope="scope">
<router-link to="" tag="a" class="a-link" v-if="scope.row.id&&scope.row.projectAllName ">{{ scope.row.projectAllName }}</router-link> <router-link to="" tag="a" class="a-link" v-if="scope.row.id&&scope.row.projectAllName " v-html="scope.row.projectAllName"></router-link>
<div v-else>{{ scope.row.projectAllName || '--' }}</div> <div v-else v-html="scope.row.projectAllName || '--'"></div>
</template> </template>
<template slot="companyName" slot-scope="scope"> <template slot="companyName" slot-scope="scope">
<router-link to="" tag="a" class="a-link" v-if="scope.row.companyId&&scope.row.companyName">{{ scope.row.companyName }}</router-link> <router-link to="" tag="a" class="a-link" v-if="scope.row.companyId&&scope.row.companyName">{{ scope.row.companyName }}</router-link>
...@@ -49,22 +50,23 @@ export default { ...@@ -49,22 +50,23 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
defaultSort: {prop: 'winBidTime', order: 'descending'},
forData: [ forData: [
{label: '项目名称', prop: 'projectAllName', minWidth: '560', slot: true}, {label: '项目名称', prop: 'projectAllName', minWidth: '560', slot: true},
{label: '中标时间', prop: 'winBidTime', minWidth: '100', sortable: 'custom'}, {label: '中标时间', prop: 'winBidTime', minWidth: '100', sortable: 'custom', descending: '3', ascending: '4'},
{label: '中标企业', prop: 'companyName', minWidth: '320', slot: true}, {label: '中标企业', prop: 'companyName', minWidth: '320', slot: true},
{label: '中标金额(万元)', prop: 'winBidAmount', minWidth: '140', sortable: 'custom'}, {label: '中标金额(万元)', prop: 'winBidAmount', minWidth: '140', sortable: 'custom', descending: '1', ascending: '2'},
{label: '下浮率(%)', prop: 'lowerRate', minWidth: '120', sortable: 'custom'}, {label: '下浮率(%)', prop: 'lowerRate', minWidth: '120', sortable: 'custom', descending: '7', ascending: '8'},
{label: '项目经理 / 负责人', prop: 'staffName', minWidth: '130'}, {label: '项目经理 / 负责人', prop: 'staffName', minWidth: '130'},
{label: '中标地区', prop: 'region', minWidth: '160'}, {label: '中标地区', prop: 'region', minWidth: '160'},
{label: '工期(天)', prop: 'period', minWidth: '110', sortable: 'custom'}, {label: '工期(天)', prop: 'period', minWidth: '110', sortable: 'custom', descending: '9', ascending: '10'},
{label: '业绩类别', prop: 'boundType', minWidth: '110'} {label: '业绩类别', prop: 'boundType', minWidth: '110'}
], ],
formData: [ formData: [
{ type: 1, fieldName: 'provinceId', value: '', placeholder: '项目地区', options: [] }, { type: 1, fieldName: 'provinceId', value: '', placeholder: '项目地区', options: [] },
{ type: 5, fieldName: 'time', value: '', placeholder: '中标时间', startTime: 'dateFrom', endTime: 'dateTo' }, { type: 5, fieldName: 'time', value: '', placeholder: '中标时间', startTime: 'dateFrom', endTime: 'dateTo' },
{ type: 6, fieldName: 'money', value: '', placeholder: '中标金额', startMoney: 'amountMin', endMoney: 'amountMax' }, { type: 6, fieldName: 'money', value: '', placeholder: '中标金额', startMoney: 'amountMin', endMoney: 'amountMax' },
{ type: 3, fieldName: 'keys', value: '', placeholder: '输入关键词查询', options: [] } { type: 3, fieldName: 'keys', value: '', placeholder: '输入项目名称查询', options: [] }
], ],
//列表 //列表
tableLoading:false, tableLoading:false,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<tables <tables
:indexFixed="true" :indexFixed="true"
:defaultSort="defaultSort"
:tableLoading="tableLoading" :tableLoading="tableLoading"
:tableData="tableData" :tableData="tableData"
:forData="forData" :forData="forData"
...@@ -57,11 +58,12 @@ export default { ...@@ -57,11 +58,12 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
defaultSort: {prop: 'time', order: 'descending'},
forData: [ forData: [
{label: '供应商', prop: 'companyName', minWidth: '350', slot: true}, {label: '供应商', prop: 'companyName', minWidth: '350', slot: true},
{label: '合作项目/工程名称', prop: 'projectAllName', minWidth: '400', sortable: 'custom', slot: true}, {label: '合作项目/工程名称', prop: 'projectAllName', minWidth: '400', slot: true, sortable: 'custom', descending: '5', ascending: '6'},
{label: '合作总金额(万元)', prop: 'amount', minWidth: '150', sortable: 'custom'}, {label: '合作总金额(万元)', prop: 'amount', minWidth: '150', sortable: 'custom', descending: '1', ascending: '2'},
{label: '最近一次合作时间', prop: 'time', minWidth: '140', sortable: 'custom'} {label: '最近一次合作时间', prop: 'time', minWidth: '140', sortable: 'custom', descending: '3', ascending: '4'}
], ],
formData: [ formData: [
{ type: 3, fieldName: 'keys', value: '', placeholder: '输入企业名称查询', options: []}, { type: 3, fieldName: 'keys', value: '', placeholder: '输入企业名称查询', options: []},
......
...@@ -19,4 +19,9 @@ public class BusinessIdDto { ...@@ -19,4 +19,9 @@ public class BusinessIdDto {
* 项目标签名称 * 项目标签名称
*/ */
private String label; private String label;
/**
* 文件路径
*/
private String folderPath;
} }
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