Aris流程数据迁移日志记录处理

This commit is contained in:
446052889@qq.com 2022-07-04 12:44:59 +08:00
parent bdddcbeef2
commit 668d6104ce
8 changed files with 23 additions and 36 deletions

View File

@ -249,7 +249,7 @@ public class ArisXmlImportWeb extends ActionWeb {
new Thread(()->{new ArisXmlImportRun(_uc, wsId, logId, logPath, simpleLogFile, fullLogFile, warnLogFile, this.filePath, this.fileName, startTime).execute(handleWeb);}) .start(); new Thread(()->{new ArisXmlImportRun(_uc, wsId, logId, logPath, simpleLogFile, fullLogFile, warnLogFile, this.filePath, this.fileName, startTime).execute(handleWeb);}) .start();
ro.put("totalCount", totalCount); ro.put("totalCount", totalCount);
ro.put("importCount", LogRealTimeCountCache.getCache().get(logId).getImportingCount()); ro.put("importingCount", LogRealTimeCountCache.getCache().get(logId).getImportingCount());
return ro.toString(); return ro.toString();
} }
@ -419,7 +419,17 @@ public class ArisXmlImportWeb extends ActionWeb {
ResponseObject ro = ResponseObject.newOkResponse(); ResponseObject ro = ResponseObject.newOkResponse();
ro.put("content", content); ro.put("content", content);
ro.put("timer", timer); ro.put("timer", timer);
ro.put("resultStatus", LogUtil.queryLog(logId).getResultStatus());
LogRealTimeCountModel countCache = LogRealTimeCountCache.getCache().get(logId);
int importingCount = 0;
int resultStatus = Constant.LOG_RESULT_StATUS_RUN;
if (countCache != null) {
importingCount = countCache.getImportingCount();
} else {
resultStatus = LogUtil.queryLog(logId).getResultStatus();
}
ro.put("resultStatus", resultStatus);
ro.put("importingCount", importingCount);
return ro.toString(); return ro.toString();
} }

View File

@ -53,16 +53,19 @@ public class LogUtil {
public static String getLogContent(File file) { public static String getLogContent(File file) {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
InputStreamReader reader = null; InputStreamReader reader = null;
BufferedReader br = null; BufferedReader br = null;
try { try {
builder.append("<p>");
reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8); reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
br = new BufferedReader(reader); br = new BufferedReader(reader);
String s; String s;
while ((s = br.readLine()) != null) { while ((s = br.readLine()) != null) {
builder.append(s).append("\n"); // builder.append(s).append("\n");
builder.append(s).append("</p><p>");
} }
builder.append("</p>");
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {

View File

@ -22,8 +22,8 @@
const production = true; const production = true;
const devUserInfo = {}; const devUserInfo = {};
</script> </script>
<script type="module" crossorigin src="../apps/com.actionsoft.apps.coe.pal.datamigration/main/js/entry-index-9631faac.js"></script> <script type="module" crossorigin src="../apps/com.actionsoft.apps.coe.pal.datamigration/main/js/entry-index-336aeba6.js"></script>
<link rel="stylesheet" href="../apps/com.actionsoft.apps.coe.pal.datamigration/main/assets/asset-style-931be2b3.css"> <link rel="stylesheet" href="../apps/com.actionsoft.apps.coe.pal.datamigration/main/assets/asset-style-06d30a92.css">
</head> </head>
<body style="margin:0;"> <body style="margin:0;">
<div id="app"></div> <div id="app"></div>