csx 3 years ago
parent
commit
b19428b642
1 changed files with 17 additions and 0 deletions
  1. 17 0
      service/bl_service.go

+ 17 - 0
service/bl_service.go View File

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
 	return
807
 	return
791
 
808
 
792
 }
809
 }