Browse Source

消毒计划

XMLWAN 4 years ago
parent
commit
e4e109a9c9

+ 5 - 5
controllers/base_api_controller.go View File

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

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

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

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

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

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

@@ -2659,3 +2659,75 @@ func (this *NewDialysisApiController) UpdateImage() {
2659 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,4 +157,6 @@ func NewMobileAPIControllersRegisterRouters() {
157 157
 	beego.Router("/m/api/patient/getnewpatientid", &NewDialysisApiController{}, "Get:GetNewPatientId")
158 158
 	beego.Router("/m/api/patient/updateimage", &NewDialysisApiController{}, "Get:UpdateImage")
159 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
 }