|
|
@@ -4,7 +4,6 @@ import com.uas.eis.core.config.SpObserver;
|
|
|
import com.uas.eis.dao.BaseDao;
|
|
|
import com.uas.eis.dao.SqlRowList;
|
|
|
import com.uas.eis.entity.ErrorMessage;
|
|
|
-import com.uas.eis.entity.FTPConfig;
|
|
|
import com.uas.eis.exception.ApiSystemException;
|
|
|
import com.uas.eis.sdk.entity.ApiResult;
|
|
|
import com.uas.eis.sdk.resp.ApiResponse;
|
|
|
@@ -35,9 +34,6 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
@Value("${spring.datasource.username}")
|
|
|
private String username;
|
|
|
|
|
|
- @Autowired
|
|
|
- private FTPConfig ftpConfig;
|
|
|
-
|
|
|
@Override
|
|
|
public List<Map<Object,Object>> snStepPass(String accessKey, String requestId, String data) {
|
|
|
String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
@@ -540,16 +536,18 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
|
|
|
private void uploadFTP(File file){
|
|
|
Map<String,Object> map=new HashMap<String,Object>();
|
|
|
- String folder = ftpConfig.getFolder();
|
|
|
- map.put("ip", ftpConfig.getHost());
|
|
|
- map.put("port", ftpConfig.getPort());
|
|
|
- map.put("user", ftpConfig.getUsername());
|
|
|
- map.put("password", ftpConfig.getPassword());
|
|
|
- FTPClient connect = FtpUtil.connect(map, folder);
|
|
|
- if (connect != null){
|
|
|
- FtpUtil.uploadFile(connect, folder,file);
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select * from Enterprise");
|
|
|
+ if (rs.next()){
|
|
|
+ String folder = rs.getGeneralString("en_folder");
|
|
|
+ map.put("ip", rs.getGeneralString("en_ip"));
|
|
|
+ map.put("port", rs.getGeneralInt("en_port"));
|
|
|
+ map.put("user", rs.getGeneralString("en_username"));
|
|
|
+ map.put("password", rs.getGeneralString("en_userpass"));
|
|
|
+ FTPClient connect = FtpUtil.connect(map, folder);
|
|
|
+ if (connect != null){
|
|
|
+ FtpUtil.uploadFile(connect, folder,file);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private File convertMultiPartFileToFile(MultipartFile multipartFile) throws IOException {
|