Merge remote-tracking branch 'origin/mdc' into mdc
This commit is contained in:
commit
b6b72b9ad2
|
@ -102,38 +102,6 @@ public class FTPUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
long l = System.currentTimeMillis();
|
||||
String path = "/rn/datatest/savefile/";
|
||||
String fromPath = "Spectrum/Particulates/Samplephd/2015/11/AUP09_004-20151119_0421_S_PREL_42710.PHD";
|
||||
String fromPath2 = "Spectrum/Particulates/Samplephd/2015/11/NZP46_002-20151119_0021_S_PREL_57588.PHD";
|
||||
FTPClient ftpClient = new FTPClient();
|
||||
//连接
|
||||
ftpClient.connect("172.21.70.87", 21);
|
||||
//登录
|
||||
ftpClient.login("rmsops", "cnndc66367220");
|
||||
System.out.println("login>>>"+(System.currentTimeMillis()-l));
|
||||
// 切换为本地被动模式,可以解决FTP上传后文件为空的问题,但需要服务器将FTP服务添加至防火墙白名单
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
//判断是否连接成功
|
||||
int reply = ftpClient.getReplyCode();
|
||||
ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
|
||||
// 设置编码,当文件中存在中文且上传后文件乱码时可使用此配置项
|
||||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
InputStream inputStream = ftpClient.retrieveFileStream(path+fromPath);
|
||||
File file = new File("D:\\test1.txt");
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
System.out.println(null == inputStream);
|
||||
System.out.println(ftpClient.printWorkingDirectory());
|
||||
ftpClient.completePendingCommand();
|
||||
InputStream inputStream2 = ftpClient.retrieveFileStream(path+fromPath2);
|
||||
File file2 = new File("D:\\test2.txt");
|
||||
FileUtils.copyInputStreamToFile(inputStream2, file2);
|
||||
System.out.println(null == inputStream2);
|
||||
System.out.println(System.currentTimeMillis() - l);
|
||||
}
|
||||
|
||||
public void downloadFTPFile(String localPath, String fileName, HttpServletResponse response) {
|
||||
InputStream in = null;
|
||||
ServletOutputStream out = null;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -143,10 +142,6 @@ public class MyLogFormatUtil {
|
|||
attributeItemVo.setContext(errors);
|
||||
energys.add(attributeItemVo);
|
||||
MyLogFormatUtil.getBlock(MyLogFormatUtil.SetSampleGEnergyChannel, "sampleId", energys);
|
||||
|
||||
|
||||
Console.log(getTitleFormat("Read calibration finished","."));
|
||||
Console.log(getHeaderFormat("header","."));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -220,7 +215,6 @@ public class MyLogFormatUtil {
|
|||
Object value = entry.getValue();
|
||||
String formattedKey = String.format("%-"+ (keyWidth + 4) + "s", key);
|
||||
String formattedValue = String.format("%-"+ (valueWidth + 4) + "s", value);
|
||||
System.out.println(formattedKey + " : " + formattedValue);
|
||||
result.add(formattedKey + formattedValue + "\n");
|
||||
}
|
||||
return result;
|
||||
|
@ -306,7 +300,6 @@ public class MyLogFormatUtil {
|
|||
// 构造格式化字符串
|
||||
result.add(String.format(sb.toString(), row.toArray()));
|
||||
result.add(STRING_END);
|
||||
Console.log(String.format(sb.toString(), row.toArray()));
|
||||
sb = new StringBuilder();
|
||||
}
|
||||
return result;
|
||||
|
@ -347,7 +340,7 @@ public class MyLogFormatUtil {
|
|||
public static List<String> getPass(List<String> source) {
|
||||
List<String> result = Lists.newLinkedList();
|
||||
for (String str : source) {
|
||||
result.add(str.contains("0") ? "Fail" : "Pass");
|
||||
result.add(Double.valueOf(str)< 1? "Fail" : "Pass");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -224,7 +224,6 @@ public class Sample_B_Analysis implements BlockConstant {
|
|||
*/
|
||||
private void autoAnalyse() throws BAnalyseException, FileNotExistException {
|
||||
BgAnalyseResult analyseResult = EnergySpectrumHandler.bgAnalyse(this.sampleFileFinalPath,this.gasFileFinalPath,this.detFileFinalPath);
|
||||
System.out.println(analyseResult);
|
||||
this.analyseResult = analyseResult;
|
||||
if(Objects.isNull(analyseResult) || !analyseResult.analyse_flag){
|
||||
ErrorLogManager.getInstance().write(new SpectrumErrorEvent(new Date(), analyseResult.error_log, this.phdFileName));
|
||||
|
|
Loading…
Reference in New Issue
Block a user