fuyu 4 jaren geleden
bovenliggende
commit
9853804ebc
2 gewijzigde bestanden met toevoegingen van 12 en 5 verwijderingen
  1. 3 4
      src/service/check.js
  2. 9 1
      src/service/move.js

+ 3 - 4
src/service/check.js

@@ -2,11 +2,11 @@
  * @Author: fuyu
  * @Date: 2021-03-28 19:21:26
  * @LastEditors: fuyu
- * @LastEditTime: 2021-03-28 19:25:58
+ * @LastEditTime: 2021-03-28 22:20:36
  * @FilePath: /sql_merge/src/service/check.js
  */
 let flag = false
-import {moveReport, movePacs} from './move'
+import {moveAll} from './move'
 
 export function getFlag() {
   return flag
@@ -17,7 +17,6 @@ export async function _check() {
     return
   }
   flag = true
-  await moveReport()
-  await movePacs()
+  await moveAll()
   flag = false
 }

+ 9 - 1
src/service/move.js

@@ -2,7 +2,7 @@
  * @Author: fuyu
  * @Date: 2021-03-23 12:00:09
  * @LastEditors: fuyu
- * @LastEditTime: 2021-03-28 19:58:59
+ * @LastEditTime: 2021-03-28 22:20:26
  * @FilePath: /sql_merge/src/service/move.js
  */
 
@@ -17,6 +17,14 @@ import {RemoteApplication as OldRemoteApplication, ApplicationProgressLog as Old
 import {Institution,  RemoteApplication as NewRemoteApplication, ApplicationProgressLog as NewApplicationProgressLog, Bbs as NewBbs, RemoteOrder as NewRemoteOrder, RemoteWater as NewRemoteWater, Register as NewRegister, Exams as NewExams, PatientInfos as NewPatientInfos, Studies as NewStudies, Series as NewSeries, Images as NewImages, Report as NewReport, ReportRecord as NewReportRecord, QualityControl as NewQualityControl, QualityCause as NewQualityCause} from '../dao_new'
 import {getInt} from './common'
 
+export async function moveAll() {
+  const res = await Institution.findAll({attributes: ['id']})
+  const ids = res.map(item => item['id'])
+  await moveSingle(ids)
+  await moveSinglePacs(ids, 0)
+}
+
+
 export async function moveReport(institution_id) {
   if(institution_id) {
     await moveSingle(institution_id)