张保健 il y a 4 ans
Parent
révision
855f6c8df7

+ 24 - 1
controllers/dialysis_record_api_controller.go Voir le fichier

@@ -11,7 +11,8 @@ import (
11 11
 	"XT_New/enums"
12 12
 	"XT_New/service"
13 13
 	"XT_New/utils"
14
-
14
+	"net/http"
15
+	"net/url"
15 16
 	"fmt"
16 17
 	"github.com/astaxie/beego"
17 18
 )
@@ -770,6 +771,18 @@ func (this *DialysisRecordAPIController) StartDialysis() {
770 771
 				return
771 772
 			}
772 773
 		}
774
+
775
+		go func (){
776
+			ssoDomain := beego.AppConfig.String("call_domain")
777
+			api := ssoDomain + "/index/uppatient"
778
+			values := make(url.Values)
779
+			values.Set("org_id",  strconv.FormatInt(adminUserInfo.CurrentOrgId,10))
780
+			values.Set("admin_user_id", strconv.FormatInt(nurseID,10))
781
+			values.Set("patient_id",  strconv.FormatInt(patientID,10))
782
+			values.Set("up_time",  strconv.FormatInt(startDate.Unix(),10))
783
+			http.PostForm(api, values)
784
+		} ()
785
+
773 786
 		this.ServeSuccessJSON(map[string]interface{}{
774 787
 			"dialysis_order": dialysisRecord,
775 788
 			"monitor":        record,
@@ -990,6 +1003,16 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
990 1003
 		return
991 1004
 	}
992 1005
 
1006
+	go func (){
1007
+		ssoDomain := beego.AppConfig.String("call_domain")
1008
+		api := ssoDomain + "/index/downpatient"
1009
+		values := make(url.Values)
1010
+		values.Set("org_id",  strconv.FormatInt(adminUserInfo.CurrentOrgId,10))
1011
+		values.Set("admin_user_id", strconv.FormatInt(nurseID,10))
1012
+		values.Set("patient_id",  strconv.FormatInt(patientID,10))
1013
+		http.PostForm(api, values)
1014
+	} ()
1015
+
993 1016
 	updateErr := service.ModifyDialysisRecord(dialysisRecord.ID, nurseID, endDate.Unix(), adminUserInfo.AdminUser.Id)
994 1017
 	if updateErr != nil {
995 1018
 		this.ErrorLog("下机失败:%v", updateErr)

+ 3 - 2
controllers/mobile_api_controllers/check_weight_api_controller.go Voir le fichier

@@ -728,9 +728,10 @@ func (c *CheckWeightApiController) GetPatientList() {
728 728
 	}
729 729
 
730 730
 	adminUserInfo := c.GetMobileAdminUserInfo()
731
-	need_update := 0
731
+
732 732
 	patientList, total, error := service.GetPatientListByUpdateTime(adminUserInfo.Org.Id, int64(syncTime))
733
-	if len(patientList)  > 0 {
733
+	need_update := 0
734
+	if syncTime ==  0 {
734 735
 		need_update = 1
735 736
 	}
736 737
 	if error != nil {