Commit 103178ec authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent bf62d00e
...@@ -39,6 +39,7 @@ import lombok.RequiredArgsConstructor; ...@@ -39,6 +39,7 @@ import lombok.RequiredArgsConstructor;
import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils; import org.springframework.util.ResourceUtils;
...@@ -73,6 +74,9 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -73,6 +74,9 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
private final TAttaInfoMapper attaInfoMapper; private final TAttaInfoMapper attaInfoMapper;
@Value("${filePath.path}")
private String filePath;
@Override @Override
public boolean save(TElecEmployeeInfo entity) { public boolean save(TElecEmployeeInfo entity) {
return super.save(entity); return super.save(entity);
...@@ -93,8 +97,10 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -93,8 +97,10 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
@Override @Override
public R importZip(MultipartFile zipFile){ public R importZip(MultipartFile zipFile){
try { try {
String pathName = ResourceUtils.getURL("classpath:").getPath() + "unloap/"; // String pathName = ResourceUtils.getURL("classpath:").getPath() + "unloap/";
String dec = ResourceUtils.getURL("classpath:").getPath() + "unloap/"; // String dec = ResourceUtils.getURL("classpath:").getPath() + "unloap/";
String pathName = filePath;
String dec = filePath;
File file1 = new File(pathName); File file1 = new File(pathName);
//如果文件夹不存在 创建文件夹 //如果文件夹不存在 创建文件夹
if (!file1.exists()) { if (!file1.exists()) {
......
...@@ -16,9 +16,11 @@ spring: ...@@ -16,9 +16,11 @@ spring:
password: yf_zsk password: yf_zsk
#url: jdbc:mysql://127.0.0.1:3306/yifu_upms?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true #url: jdbc:mysql://127.0.0.1:3306/yifu_upms?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.1.65:22306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true url: jdbc:mysql://192.168.1.65:22306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
servlet: # servlet:
multipart: # multipart:
location: /data/tmp # location: /data/tmp/
filePath:
path: /data/tmp/
#法大大生产环境 #法大大生产环境
#fdd: #fdd:
......
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