fix: 외사대상목표,외사장비 파일경로설정 및 적용

TaehunPark 2022-11-10 09:45:46 +09:00
parent 5aa9fd0d9a
commit ceba63b88f
4 changed files with 22 additions and 11 deletions

View File

@ -36,8 +36,10 @@ import java.util.*;
@Service
@RequiredArgsConstructor
public class EquipService {
@Value("${spring.servlet.multipart.location}")
protected String locationPath;
@Value("${file.dir}")
protected String fileDir;
@Value("${file.dir.equip}")
protected String equ;
private final EquipRepository equipRepository;
private final EquipFileRepository equipFileRepository;
@ -81,7 +83,7 @@ public class EquipService {
public void saveFile(Equip equip, MultipartHttpServletRequest mRequest) throws Exception {
try {
String path = locationPath;
String path = fileDir+equ;
String FileSize;
File dir = new File(path);
if(!dir.exists()) dir.mkdir();
@ -190,7 +192,7 @@ public class EquipService {
public void updateFile(Equip equip,Equip equipTmp, MultipartHttpServletRequest mRequest) throws Exception {
try {
String path = locationPath;
String path = fileDir+equ;
String FileSize;
File dir = new File(path);
if(!dir.exists()) dir.mkdir();

View File

@ -13,7 +13,6 @@ import com.dbnt.faisp.main.fipTarget.service.FipTargetService;
import com.dbnt.faisp.main.organMgt.service.OrganConfigService;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
import com.dbnt.faisp.main.userInfo.service.UserInfoService;
import com.dbnt.faisp.util.Excel;
import com.dbnt.faisp.util.ParamMap;
import com.dbnt.faisp.util.Utils;

View File

@ -35,14 +35,17 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.*;
@Service
@RequiredArgsConstructor
public class FipTargetService extends BaseService {
@Value("${spring.servlet.multipart.location}")
protected String locationPath;
@Value("${file.dir}")
protected String fileDir;
@Value("${file.dir.vulnerable}")
protected String vulnerable;
@Value("${file.dir.part}")
protected String part;
private final PartInfoRepository partInfoRepository;
private final PartInfoFileRepository partInfoFileRepository;
@ -83,7 +86,7 @@ public class FipTargetService extends BaseService {
} else {
for(MultipartFile file : multipartFileList){
String saveName = UUID.randomUUID().toString();
String path = locationPath+File.separator+"publicFile"+File.separator;
String path = fileDir+part;
saveFile(file, new File(path+File.separator+saveName));
String originalFilename = file.getOriginalFilename();
@ -251,7 +254,7 @@ public class FipTargetService extends BaseService {
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
for(MultipartFile file : multipartFileList){
String saveName = UUID.randomUUID().toString();
String path = locationPath+File.separator+"publicFile"+File.separator;
String path = fileDir+part;
saveFile(file, new File(path+File.separator+saveName));
String originalFilename = file.getOriginalFilename();
@ -351,7 +354,7 @@ public class FipTargetService extends BaseService {
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
for(MultipartFile file : multipartFileList){
String saveName = UUID.randomUUID().toString();
String path = locationPath+File.separator+"publicFile"+File.separator;
String path = fileDir+vulnerable;
saveFile(file, new File(path+File.separator+saveName));
String originalFilename = file.getOriginalFilename();

View File

@ -6,6 +6,13 @@ spring.servlet.multipart.location=C:\\faispUploadFiles
spring.servlet.multipart.max-file-size=200MB
spring.servlet.multipart.max-request-size=500MB
#file
file.dir=C:\\faispUploadFiles
file.dir.vulnerable=/vulnerable
file.dir.part=/part
file.dir.equip=/equip
#thymeleaf
spring.thymeleaf.prefix=classpath:templates/
spring.thymeleaf.check-template-location=true