Browse Source

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

陈少旭 1 week ago
parent
commit
10c2d9d3fb

+ 4 - 4
controllers/base_api_controller.go View File

83
 		userAdmin.ModifyTime = 1530786071
83
 		userAdmin.ModifyTime = 1530786071
84
 		var subscibe models.ServeSubscibe
84
 		var subscibe models.ServeSubscibe
85
 		subscibe.ID = 11
85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10702 //机构id
86
+		subscibe.OrgId = 10164 //机构id
87
 		subscibe.PeriodStart = 1547447814
87
 		subscibe.PeriodStart = 1547447814
88
 		subscibe.PeriodEnd = 1550039814
88
 		subscibe.PeriodEnd = 1550039814
89
 		subscibe.State = 1
89
 		subscibe.State = 1
93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94
 		subscibes[4] = &subscibe
94
 		subscibes[4] = &subscibe
95
 		var adminUserInfo service.AdminUserInfo
95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10702 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97
 		adminUserInfo.CurrentAppId = 12123 //4
97
 		adminUserInfo.CurrentAppId = 12123 //4
98
 		adminUserInfo.AdminUser = &userAdmin
98
 		adminUserInfo.AdminUser = &userAdmin
99
 		adminUserInfo.Subscibes = subscibes
99
 		adminUserInfo.Subscibes = subscibes
329
 		userAdmin.ModifyTime = 1530786071
329
 		userAdmin.ModifyTime = 1530786071
330
 		var subscibe models.ServeSubscibe
330
 		var subscibe models.ServeSubscibe
331
 		subscibe.ID = 11
331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10702 //机构id小英9675或4
332
+		subscibe.OrgId = 10164 //机构id小英9675或4
333
 		subscibe.PeriodStart = 1538035409
333
 		subscibe.PeriodStart = 1538035409
334
 		subscibe.PeriodEnd = 1569571409
334
 		subscibe.PeriodEnd = 1569571409
335
 		subscibe.State = 1
335
 		subscibe.State = 1
339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340
 		subscibes[4] = &subscibe
340
 		subscibes[4] = &subscibe
341
 		var adminUserInfo service.AdminUserInfo
341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10702 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343
 		adminUserInfo.CurrentAppId = 12123 //4
343
 		adminUserInfo.CurrentAppId = 12123 //4
344
 		adminUserInfo.AdminUser = &userAdmin
344
 		adminUserInfo.AdminUser = &userAdmin
345
 		adminUserInfo.Subscibes = subscibes
345
 		adminUserInfo.Subscibes = subscibes

+ 14 - 0
controllers/doctors_api_controller.go View File

75
 	beego.Router("/api/schedule/getdoctoradvicemonthlist", &DoctorsApiController{}, "Get:GetDoctorAdivceMonthList")
75
 	beego.Router("/api/schedule/getdoctoradvicemonthlist", &DoctorsApiController{}, "Get:GetDoctorAdivceMonthList")
76
 
76
 
77
 	beego.Router("/api/schedule/gethisprescriptionprojectmonthlist", &DoctorsApiController{}, "Get:GetHisPrescriptionProjectMonthList")
77
 	beego.Router("/api/schedule/gethisprescriptionprojectmonthlist", &DoctorsApiController{}, "Get:GetHisPrescriptionProjectMonthList")
78
+
79
+	beego.Router("/api/mobilealldoctors", &DoctorsApiController{}, "Get:GetMobileAllDoctorList")
80
+
78
 }
81
 }
79
 
82
 
80
 func (c *DoctorsApiController) ScheduleAdvices() {
83
 func (c *DoctorsApiController) ScheduleAdvices() {
1861
 		"projectMonthList": projectMonthList,
1864
 		"projectMonthList": projectMonthList,
1862
 	})
1865
 	})
1863
 }
1866
 }
1867
+
1868
+func (c *DoctorsApiController) GetMobileAllDoctorList() {
1869
+
1870
+	orgId := c.GetAdminUserInfo().CurrentOrgId
1871
+
1872
+	adminRoles, _ := service.GetMobileAllDoctorList(orgId)
1873
+
1874
+	c.ServeSuccessJSON(map[string]interface{}{
1875
+		"doctors": adminRoles,
1876
+	})
1877
+}

+ 26 - 0
controllers/mobile_api_controllers/patient_api_controller.go View File

4313
 	}
4313
 	}
4314
 
4314
 
4315
 	if adminUserInfo.Org.Id == 10597 {
4315
 	if adminUserInfo.Org.Id == 10597 {
4316
+
4316
 		if evaluation.ID > 0 {
4317
 		if evaluation.ID > 0 {
4318
+
4317
 			dialysisPrescribeOne, _ := service.MobileGetDialysisPrescribeOne(adminUserInfo.Org.Id, id, theAssessmentDateTime)
4319
 			dialysisPrescribeOne, _ := service.MobileGetDialysisPrescribeOne(adminUserInfo.Org.Id, id, theAssessmentDateTime)
4318
 			if dialysisPrescribeOne.ID > 0 && evaluation.ID > 0 {
4320
 			if dialysisPrescribeOne.ID > 0 && evaluation.ID > 0 {
4319
 				dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
4321
 				dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
4320
 				service.UpdateMobileGetDialysisPrescribeOne(dialysisPrescribeOne.ID, dewater_amount)
4322
 				service.UpdateMobileGetDialysisPrescribeOne(dialysisPrescribeOne.ID, dewater_amount)
4321
 			}
4323
 			}
4324
+			keyThree := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe_by_mode"
4325
+			redis := service.RedisClient()
4326
+			//清空key 值
4327
+			redis.Set(keyThree, "", time.Second)
4328
+
4329
+			keyFour := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":system_dialysis_prescribe"
4330
+			//清空key 值
4331
+			redis.Set(keyFour, "", time.Second)
4332
+			keyFive := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":schedual_detail"
4333
+			redis.Set(keyFive, "", time.Second)
4334
+
4335
+			keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
4336
+			redis.Set(keySix, "", time.Second)
4337
+
4338
+			keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
4339
+			redis.Set(keySeven, "", time.Second)
4340
+
4341
+			keyNight := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
4342
+			redis.Set(keyNight, "", time.Second)
4343
+			var recordDateStr = time.Now().Format("2006-01-02")
4344
+			keyOne := "scheduals_" + recordDateStr + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
4345
+			//清空key 值
4346
+			redis.Set(keyOne, "", time.Second)
4347
+
4322
 		}
4348
 		}
4323
 	}
4349
 	}
4324
 
4350
 

+ 7 - 0
service/doctor_advice_service.go View File

591
 
591
 
592
 	return project, err
592
 	return project, err
593
 }
593
 }
594
+
595
+func GetMobileAllDoctorList(orgid int64) (list []*models.SgjUserAdminRole, err error) {
596
+
597
+	err = UserReadDB().Where("org_id = ? and status=1", orgid).Find(&list).Error
598
+
599
+	return list, err
600
+}