Browse Source

消毒计划

XMLWAN 4 years ago
parent
commit
e4e109a9c9

+ 5 - 5
controllers/base_api_controller.go View File

71
 	if this.GetAdminUserInfo() == nil {
71
 	if this.GetAdminUserInfo() == nil {
72
 		var userAdmin models.AdminUser
72
 		var userAdmin models.AdminUser
73
 		userAdmin.Id = 558
73
 		userAdmin.Id = 558
74
-		userAdmin.Mobile = "13535547901"
74
+		userAdmin.Mobile = "13318464649"
75
 
75
 
76
 		//userAdmin.Id = 597
76
 		//userAdmin.Id = 597
77
 		//userAdmin.Mobile = "19874122664"
77
 		//userAdmin.Mobile = "19874122664"
81
 		userAdmin.ModifyTime = 1530786071
81
 		userAdmin.ModifyTime = 1530786071
82
 		var subscibe models.ServeSubscibe
82
 		var subscibe models.ServeSubscibe
83
 		subscibe.ID = 1
83
 		subscibe.ID = 1
84
-		subscibe.OrgId = 9841
84
+		subscibe.OrgId = 7957
85
 		subscibe.PeriodStart = 1538035409
85
 		subscibe.PeriodStart = 1538035409
86
 		subscibe.PeriodEnd = 1569571409
86
 		subscibe.PeriodEnd = 1569571409
87
 		subscibe.State = 1
87
 		subscibe.State = 1
91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
92
 		subscibes[4] = &subscibe
92
 		subscibes[4] = &subscibe
93
 		var adminUserInfo service.AdminUserInfo
93
 		var adminUserInfo service.AdminUserInfo
94
-		adminUserInfo.CurrentOrgId = 9841
94
+		adminUserInfo.CurrentOrgId = 7957
95
 		adminUserInfo.CurrentAppId = 18
95
 		adminUserInfo.CurrentAppId = 18
96
 		adminUserInfo.AdminUser = &userAdmin
96
 		adminUserInfo.AdminUser = &userAdmin
97
 		adminUserInfo.Subscibes = subscibes
97
 		adminUserInfo.Subscibes = subscibes
326
 		userAdmin.ModifyTime = 1530786071
326
 		userAdmin.ModifyTime = 1530786071
327
 		var subscibe models.ServeSubscibe
327
 		var subscibe models.ServeSubscibe
328
 		subscibe.ID = 1
328
 		subscibe.ID = 1
329
-		subscibe.OrgId = 12
329
+		subscibe.OrgId = 7957
330
 		subscibe.PeriodStart = 1538035409
330
 		subscibe.PeriodStart = 1538035409
331
 		subscibe.PeriodEnd = 1569571409
331
 		subscibe.PeriodEnd = 1569571409
332
 		subscibe.State = 1
332
 		subscibe.State = 1
336
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
336
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
337
 		subscibes[4] = &subscibe
337
 		subscibes[4] = &subscibe
338
 		var adminUserInfo service.AdminUserInfo
338
 		var adminUserInfo service.AdminUserInfo
339
-		adminUserInfo.CurrentOrgId = 9841
339
+		adminUserInfo.CurrentOrgId = 7957
340
 		adminUserInfo.CurrentAppId = 18
340
 		adminUserInfo.CurrentAppId = 18
341
 		adminUserInfo.AdminUser = &userAdmin
341
 		adminUserInfo.AdminUser = &userAdmin
342
 		adminUserInfo.Subscibes = subscibes
342
 		adminUserInfo.Subscibes = subscibes

+ 1 - 3
controllers/mobile_api_controllers/dialysis_api_controller.go View File

85
 
85
 
86
 	// cur_date := time.Now().Format("2006-01-02")
86
 	// cur_date := time.Now().Format("2006-01-02")
87
 	key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
87
 	key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
88
-
89
 	scheduals_json_str, _ := redis.Get(key).Result()
88
 	scheduals_json_str, _ := redis.Get(key).Result()
90
 
89
 
91
 	if len(scheduals_json_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
90
 	if len(scheduals_json_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
109
 		}
108
 		}
110
 
109
 
111
 	} else { //缓存数据了数据,将redis缓存的json字符串转为map
110
 	} else { //缓存数据了数据,将redis缓存的json字符串转为map
112
-
113
 		var dat []map[string]interface{}
111
 		var dat []map[string]interface{}
114
 
112
 
115
 		if err := json.Unmarshal([]byte(scheduals_json_str), &dat); err == nil {
113
 		if err := json.Unmarshal([]byte(scheduals_json_str), &dat); err == nil {
144
 
142
 
145
 	// cur_date := time.Now().Format("2006-01-02")
143
 	// cur_date := time.Now().Format("2006-01-02")
146
 	key := "wait_scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
144
 	key := "wait_scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
145
+
147
 	wait_scheduals, _ := redis.Get(key).Result()
146
 	wait_scheduals, _ := redis.Get(key).Result()
148
 
147
 
149
 	if len(wait_scheduals) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
148
 	if len(wait_scheduals) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
154
 		} else {
153
 		} else {
155
 			returnScheduals := make([]*service.MDialysisScheduleVM, 0, len(scheduals))
154
 			returnScheduals := make([]*service.MDialysisScheduleVM, 0, len(scheduals))
156
 			for _, s := range scheduals {
155
 			for _, s := range scheduals {
157
-
158
 				returnScheduals = append(returnScheduals, s)
156
 				returnScheduals = append(returnScheduals, s)
159
 			}
157
 			}
160
 
158
 

+ 1 - 0
controllers/mobile_api_controllers/dialysis_api_controller_extend.go View File

438
 				UpdatedTime:  time.Now().Unix(),
438
 				UpdatedTime:  time.Now().Unix(),
439
 			}
439
 			}
440
 			createErr := service.CreateSchedule(newSchedule)
440
 			createErr := service.CreateSchedule(newSchedule)
441
+
441
 			if createErr != nil {
442
 			if createErr != nil {
442
 				this.ErrorLog("紧急排班失败:%v", createErr)
443
 				this.ErrorLog("紧急排班失败:%v", createErr)
443
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateScheduleFail)
444
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateScheduleFail)

+ 72 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go View File

2659
 		"electronic_signature": Url,
2659
 		"electronic_signature": Url,
2660
 	})
2660
 	})
2661
 }
2661
 }
2662
+
2663
+func (this *NewDialysisApiController) SaveCourseManageMent() {
2664
+	adminUser := this.GetMobileAdminUserInfo()
2665
+	orgid := adminUser.Org.Id
2666
+	content := this.GetString("content")
2667
+	fmt.Println("content", content)
2668
+	patientid, _ := this.GetInt64("patientid")
2669
+	patient, _ := service.GetPatientDetailTwo(patientid)
2670
+	fmt.Println("patientid", patientid)
2671
+	course_content := this.GetString("course_content")
2672
+	fmt.Println("courese_content", course_content)
2673
+	startTime := this.GetString("start_time")
2674
+	checkDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", startTime)
2675
+	title := this.GetString("title")
2676
+	fmt.Println("title", title)
2677
+	record := models.PatientDiseaseCourse{
2678
+		OrgID:      orgid,
2679
+		PatientID:  patient.BloodId,
2680
+		Recorder:   adminUser.AdminUser.Id,
2681
+		RecordTime: checkDate.Unix(),
2682
+		Content:    content,
2683
+		Status:     1,
2684
+		CreateTime: time.Now().Unix(),
2685
+		Title:      title,
2686
+	}
2687
+	err := service.CreatePatientCourseOfDisease(&record)
2688
+	if err != nil {
2689
+		this.ErrorLog("创建患者病程记录失败:%v", err)
2690
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2691
+		return
2692
+	}
2693
+
2694
+	this.ServeSuccessJSON(map[string]interface{}{
2695
+		"record": record,
2696
+	})
2697
+}
2698
+
2699
+func (this *NewDialysisApiController) SaveCourseManageMentTwo() {
2700
+
2701
+	adminUser := this.GetMobileAdminUserInfo()
2702
+	orgid := adminUser.Org.Id
2703
+	content := this.GetString("content")
2704
+	fmt.Println("content", content)
2705
+	patientid, _ := this.GetInt64("patientid")
2706
+	fmt.Println("patientid", patientid)
2707
+	course_content := this.GetString("course_content")
2708
+	fmt.Println("courese_content", course_content)
2709
+	startTime := this.GetString("start_time")
2710
+	checkDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", startTime)
2711
+	title := this.GetString("title")
2712
+	fmt.Println("title", title)
2713
+	record := models.PatientDiseaseCourse{
2714
+		OrgID:      orgid,
2715
+		PatientID:  patientid,
2716
+		Recorder:   adminUser.AdminUser.Id,
2717
+		RecordTime: checkDate.Unix(),
2718
+		Content:    content,
2719
+		Status:     1,
2720
+		CreateTime: time.Now().Unix(),
2721
+		Title:      title,
2722
+	}
2723
+	err := service.CreatePatientCourseOfDisease(&record)
2724
+	if err != nil {
2725
+		this.ErrorLog("创建患者病程记录失败:%v", err)
2726
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2727
+		return
2728
+	}
2729
+
2730
+	this.ServeSuccessJSON(map[string]interface{}{
2731
+		"record": record,
2732
+	})
2733
+}

+ 2 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go View File

157
 	beego.Router("/m/api/patient/getnewpatientid", &NewDialysisApiController{}, "Get:GetNewPatientId")
157
 	beego.Router("/m/api/patient/getnewpatientid", &NewDialysisApiController{}, "Get:GetNewPatientId")
158
 	beego.Router("/m/api/patient/updateimage", &NewDialysisApiController{}, "Get:UpdateImage")
158
 	beego.Router("/m/api/patient/updateimage", &NewDialysisApiController{}, "Get:UpdateImage")
159
 	beego.Router("/m/api/patient/deletemanagementtwo", &NewDialysisApiController{}, "Delete:DeleteManageMentTwo")
159
 	beego.Router("/m/api/patient/deletemanagementtwo", &NewDialysisApiController{}, "Delete:DeleteManageMentTwo")
160
+	beego.Router("/m/api/patient/savecouresemanagement", &NewDialysisApiController{}, "Get:SaveCourseManageMent")
161
+	beego.Router("/m/api/patient/savecoursemanagementtwo", &NewDialysisApiController{}, "Get:SaveCourseManageMentTwo")
160
 }
162
 }