Commit 34b5a9f5 authored by 郝彦辉's avatar 郝彦辉

完善日志输出,及文件目录//处理

parent 40e2aeca
......@@ -143,6 +143,12 @@ public class IReportServiceImpl implements ReportService {
String str = formatData(dataList, reportConfig.isDesensitization());
String savepath = reportConfig.getFilePathPre() + File.separator + DateUtil.getCurrentServerDate(DateUtil.YYYYMMDD) + File.separator + PathType.REPORT.getPath();
//modify 2020.05.29
if(savepath!=null && savepath.indexOf("//")!=-1){
String tmp_savepath = savepath;
savepath = savepath.replaceAll("//", "/");
log.info("发现文件路径中有//替换, 原: {} , 新: {} ", tmp_savepath, savepath);
}
File file = new File(savepath);
if (!file.exists()) {
......@@ -364,9 +370,9 @@ public class IReportServiceImpl implements ReportService {
log.info("[header]: \n" + utils.map2Json(headerMap));
try {
resp = reportJerseyClient.post(headerMap, bodyMap, reportConfig.getDataUri());
log.info("上报返回结果resp: {} ", resp);
log.info("上报返回结果, fileName: {} , resp: {} ", fileEntry.getFileName(), resp);
String entitystr = resp.getEntity(String.class);
log.info("上报返回结果entitystr: {} ", entitystr);
log.info("上报返回结果, fileName: {} , entitystr: {} ", fileEntry.getFileName(), entitystr);
ReportRecord record = new ReportRecord();
record.setFilename(fileEntry.getFileName());
record.setFilepath(fileEntry.getFilePath());
......@@ -396,9 +402,10 @@ public class IReportServiceImpl implements ReportService {
throw new QgException("上报接口返回失败", entitystr);
}
} catch (QgException e) {
log.error("上报接口请求异常QgException, fileName: {} ", fileEntry.getFileName(), e);
throw e;
} catch (Exception e) {
log.error("上报接口请求异常", e);
log.error("上报接口请求异常Exception, fileName: {} ", fileEntry.getFileName(), e);
ReportRecord record = new ReportRecord();
record.setFilename(fileEntry.getFileName());
record.setFilepath(fileEntry.getFilePath());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment