|
@@ -787,6 +787,23 @@ func GetResultDataInsertDB(org_id int64) (result []*CmResult) {
|
787
|
787
|
}
|
788
|
788
|
|
789
|
789
|
}
|
|
790
|
+
|
|
791
|
+ // 第一步:跟进org_id 去中间库查出需要同步的数据
|
|
792
|
+ inspection_references, _ := GetSyncInspectionReferenceByOrgId(org_id)
|
|
793
|
+ inspections, _ := GetSyncInspectionByOrgId(org_id)
|
|
794
|
+
|
|
795
|
+ // 第二步:将数据同步到业务库
|
|
796
|
+ if len(inspection_references) > 0 {
|
|
797
|
+ for _, inspection_reference := range inspection_references {
|
|
798
|
+ SyncInspectionReference(&inspection_reference)
|
|
799
|
+ }
|
|
800
|
+ }
|
|
801
|
+
|
|
802
|
+ if len(inspections) > 0 {
|
|
803
|
+ for _, inspection := range inspections {
|
|
804
|
+ SyncInspection(&inspection)
|
|
805
|
+ }
|
|
806
|
+ }
|
790
|
807
|
return
|
791
|
808
|
|
792
|
809
|
}
|