张保健 2 years ago
parent
commit
bcbd8169f1
3 changed files with 9 additions and 8 deletions
  1. 1 1
      main.go
  2. 5 4
      service/cron.go
  3. 3 3
      service/ystx_service.go

+ 1 - 1
main.go View File

@@ -19,7 +19,7 @@ func main() {
19 19
 	//service.GetDataInsertDB(10138)
20 20
 	//service.GetResultDataInsertDB(10138)
21 21
 	//service.GetSHResultDataInsertDB(10215)
22
-	service.Synctfyz()
22
+	// service.Synctfyz()
23 23
 	// service.GetSHResultDataInsertDB(10215)
24 24
 	beego.Run()
25 25
 }

+ 5 - 4
service/cron.go View File

@@ -66,10 +66,11 @@ func BeginAutoSyncLis() {
66 66
 	utils.InfoLog("开启自动检验检查同步定时任务")
67 67
 	createLisSyncCronJob := newWithSeconds()
68 68
 
69
-	// specgzjh := "0 */1 * * * ?" // 每1分钟同步 广州暨华HIS医嘱
70
-	// createLisSyncCronJob.AddFunc(specgzjh, func() {
71
-	// 	SyncGzjhyz()
72
-	// })
69
+	specgzjh := "0 */1 * * * ?" // 每1分钟同步 广州暨华HIS医嘱
70
+	createLisSyncCronJob.AddFunc(specgzjh, func() {
71
+		// SyncGzjhyz()
72
+		Synctfyz()
73
+	})
73 74
 
74 75
 	specys := "0 0 3 * * ?" // 每天凌晨3点同步 湖北监利
75 76
 	createLisSyncCronJob.AddFunc(specys, func() {

+ 3 - 3
service/ystx_service.go View File

@@ -594,7 +594,7 @@ func GetAdviceBySyncAdviceId(orgId int64, sync_advice_id int64) (advice models.X
594 594
 	return
595 595
 }
596 596
 
597
-func GetAdviceBySyncAdviceIdTwo(orgId int64, sync_advice_id int64) (advice models.XtDoctorAdvice, err error) {
597
+func GetAdviceBySyncAdviceIdTwo(orgId int64, sync_advice_id string) (advice models.XtDoctorAdvice, err error) {
598 598
 	err = readDb.Model(&models.XtDoctorAdvice{}).Where("status = 1 AND user_org_id = ? AND sync_id = ?", orgId, sync_advice_id).First(&advice).Error
599 599
 	return
600 600
 }
@@ -605,7 +605,7 @@ func HttpGetTfData(id_card_no string, advice_time string) (string, string) {
605 605
 
606 606
 	inputData["病人来源"] = "1"
607 607
 	inputData["身份证号"] = id_card_no
608
-	inputData["开嘱时间"] = "2022-07-26 17:41:22"
608
+	inputData["开嘱时间"] = advice_time
609 609
 
610 610
 	var inputLog string
611 611
 	bytesData, err := json.Marshal(inputData)
@@ -1719,7 +1719,7 @@ func Synctfyz() (err error) {
1719 1719
 				}
1720 1720
 				utils.InfoLog("advice:%v", advice)
1721 1721
 				// 根据同步来的 advice_id 来查询库里是否已经存在
1722
-				advice_info, _ := GetAdviceBySyncAdviceIdTwo(org_id, yz.AdviceId)
1722
+				advice_info, _ := GetAdviceBySyncAdviceIdTwo(org_id, strconv.FormatInt(yz.AdviceId,10))
1723 1723
 				utils.InfoLog("advice_info:%v", advice_info)
1724 1724
 				if advice_info.ID > 0 {
1725 1725
 					key := strconv.FormatInt(org_id, 10) + ":" + strconv.FormatInt(temp_patient_id, 10) + ":" + strconv.FormatInt(schedulesTime, 10) + ":doctor_advices"