|
|
@ -79,6 +79,16 @@ public class MntnUploadServiceImpl implements MntnUploadService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void uploadLog(Integer termId, MultipartFile file) throws Exception {
|
|
|
|
public void uploadLog(Integer termId, MultipartFile file) throws Exception {
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
|
|
|
|
|
if (termId == 0) {
|
|
|
|
|
|
|
|
String[] strs = fileName.split(".");
|
|
|
|
|
|
|
|
if (strs.length >= 3) {
|
|
|
|
|
|
|
|
String cmdid = strs[strs.length - 3];
|
|
|
|
|
|
|
|
Terminals term = terminalExtService.getByCmdid(cmdid);
|
|
|
|
|
|
|
|
if (term != null) {
|
|
|
|
|
|
|
|
termId = term.getId();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
String ext = StringUtils.getFilenameExtension(fileName);
|
|
|
|
String ext = StringUtils.getFilenameExtension(fileName);
|
|
|
|
String path = DateUtil.format(new Date(), "yyyyMMdd") + "_log_"
|
|
|
|
String path = DateUtil.format(new Date(), "yyyyMMdd") + "_log_"
|
|
|
|
+ UUID.randomUUID().toString().replace("-", "").substring(0, 13);
|
|
|
|
+ UUID.randomUUID().toString().replace("-", "").substring(0, 13);
|
|
|
@ -101,6 +111,16 @@ public class MntnUploadServiceImpl implements MntnUploadService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void uploadFile(Integer termId, MultipartFile file) throws Exception {
|
|
|
|
public void uploadFile(Integer termId, MultipartFile file) throws Exception {
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
|
|
|
|
|
if (termId == 0) {
|
|
|
|
|
|
|
|
String[] strs = fileName.split(".");
|
|
|
|
|
|
|
|
if (strs.length >= 3) {
|
|
|
|
|
|
|
|
String cmdid = strs[strs.length - 3];
|
|
|
|
|
|
|
|
Terminals term = terminalExtService.getByCmdid(cmdid);
|
|
|
|
|
|
|
|
if (term != null) {
|
|
|
|
|
|
|
|
termId = term.getId();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
String ext = StringUtils.getFilenameExtension(fileName);
|
|
|
|
String ext = StringUtils.getFilenameExtension(fileName);
|
|
|
|
String path = DateUtil.format(new Date(), "yyyyMMdd") + "_file_"
|
|
|
|
String path = DateUtil.format(new Date(), "yyyyMMdd") + "_file_"
|
|
|
|
+ UUID.randomUUID().toString().replace("-", "").substring(0, 10);
|
|
|
|
+ UUID.randomUUID().toString().replace("-", "").substring(0, 10);
|
|
|
|