fuyu 4 년 전
부모
커밋
9853804ebc
2개의 변경된 파일12개의 추가작업 그리고 5개의 파일을 삭제
  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)