|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
package com.foreverwin.mesnac.anomaly.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.extra.ftp.Ftp;
|
|
|
|
|
import com.foreverwin.mesnac.anomaly.service.FileUploadedService;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BusinessException;
|
|
|
|
|
import com.foreverwin.modular.core.util.CommonMethods;
|
|
|
|
|
import org.apache.commons.fileupload.FileItem;
|
|
|
|
|
import org.apache.commons.net.ftp.FTP;
|
|
|
|
|
import org.apache.commons.net.ftp.FTPClient;
|
|
|
|
|
import org.apache.commons.net.ftp.FTPReply;
|
|
|
|
@ -164,7 +164,7 @@ public class FileUploadedServiceImpl implements FileUploadedService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void uploadImage(MultipartFile fileItem, HttpServletRequest request){
|
|
|
|
|
public void uploadImage(FileItem fileItem, HttpServletRequest request){
|
|
|
|
|
String site = request.getParameter("site");
|
|
|
|
|
String taskNo = request.getParameter("taskNo");
|
|
|
|
|
String fileType = request.getParameter("fileType");
|
|
|
|
@ -175,7 +175,7 @@ public class FileUploadedServiceImpl implements FileUploadedService {
|
|
|
|
|
//上传附件目录:年/月/日
|
|
|
|
|
String path = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd"))+"/"+taskNo;
|
|
|
|
|
//上传附件名称
|
|
|
|
|
String fileName = fileItem.getOriginalFilename();
|
|
|
|
|
String fileName = fileItem.getName();
|
|
|
|
|
try {
|
|
|
|
|
Ftp ftp = new Ftp(host, port,username,password);
|
|
|
|
|
|
|
|
|
|