|
@@ -2,8 +2,8 @@
|
|
|
* @Author: fuyu
|
|
|
* @Date: 2021-03-26 16:38:25
|
|
|
* @LastEditors: fuyu
|
|
|
- * @LastEditTime: 2021-03-26 18:31:29
|
|
|
- * @FilePath: /202103/code/sql_merge/src/service/html.js
|
|
|
+ * @LastEditTime: 2021-03-28 19:34:26
|
|
|
+ * @FilePath: /sql_merge/src/service/html.js
|
|
|
*/
|
|
|
|
|
|
const FLAG_DELAULT = 0
|
|
@@ -11,6 +11,7 @@ const FLAG_REPORT = 1
|
|
|
const FLAG_PACS = 2
|
|
|
import {Exams as OldExams} from '../dao_old'
|
|
|
import {Exams as NewExams, Institution} from '../dao_new'
|
|
|
+import {getFlag} from './check'
|
|
|
export async function getHtml() {
|
|
|
const institution = await Institution.findAll({order: ['id', 'name']})
|
|
|
const map = {}, ids = []
|
|
@@ -22,7 +23,6 @@ export async function getHtml() {
|
|
|
})
|
|
|
const oldExams = await OldExams.count({attributes: ['institution_id', 'flag'], where: {institution_id: ids}, group: ['institution_id', 'flag']})
|
|
|
const newExams = await NewExams.count({attributes: ['institution_id', 'flag'], where: {institution_id: ids}, group: ['institution_id', 'flag']})
|
|
|
-
|
|
|
oldExams.forEach(item => {
|
|
|
const id = item['institution_id']
|
|
|
const flag = item['flag']
|
|
@@ -97,8 +97,12 @@ export async function getHtml() {
|
|
|
</tr>`)
|
|
|
// return data
|
|
|
const tbody = trs.join('')
|
|
|
+ const flag = getFlag()
|
|
|
return `<html>
|
|
|
<title>白银市数据同步报告</title>
|
|
|
+ <body>
|
|
|
+ <div>${flag ? '同步中...': '同步完成'}</div>
|
|
|
+ <a href="./api/check">同步报告</a>
|
|
|
<style>
|
|
|
.report {
|
|
|
color:#FF8C00
|
|
@@ -150,5 +154,6 @@ export async function getHtml() {
|
|
|
<tbody>${tbody}</tbody>
|
|
|
</table>
|
|
|
<script>setTimeout(_ => window.location.reload(), 60000)</script>
|
|
|
+ </body>
|
|
|
</html>`
|
|
|
}
|