Browse Source

体积小

XMLWAN 3 years ago
parent
commit
233942826d

+ 31 - 18
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

@@ -46,6 +46,10 @@ func XcxApiControllersRegisterRouters() {
46 46
 
47 47
 	//获取医嘱信息
48 48
 	beego.Router("/xcx/api/mobile/getdoctoradvice", &XcxApiController{}, "Get:GetDoctorAdvice")
49
+
50
+	//获取机构医生护士的姓名
51
+	beego.Router("/xcx/api/mobile/getdoctorname", &XcxApiController{}, "Get:GetDoctorName")
52
+
49 53
 }
50 54
 
51 55
 type XcxApiController struct {
@@ -134,25 +138,24 @@ func (this *XcxApiController) GetUserRegister() {
134 138
 
135 139
 func (this *XcxApiController) GetCodeInfo() {
136 140
 
137
-	//mobile := this.GetString("phone")
138
-	//aespass := this.GetString("aespass")
139
-	//utils.TraceLog("mobile:%v aespass:%v", mobile, aespass)
140
-	//if utils.CellPhoneRegexp().MatchString(mobile) == false {
141
-	//	this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeMobileFormat)
142
-	//	this.ServeJSON()
143
-	//	return
144
-	//}
141
+	mobile := this.GetString("phone")
142
+	aespass := this.GetString("aespass")
143
+	utils.TraceLog("mobile:%v aespass:%v", mobile, aespass)
144
+	if utils.CellPhoneRegexp().MatchString(mobile) == false {
145
+		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeMobileFormat)
146
+		this.ServeJSON()
147
+		return
148
+	}
145 149
 
146
-	//if err := service.SendVerificationCodeSMS(mobile, aespass); err != nil {
147
-	//	this.Data["json"] = enums.MakeFailResponseJSON(err.Error(), 600)
148
-	//	this.ServeJSON()
149
-	//} else {
150
-	//	this.Data["json"] = enums.MakeSuccessResponseJSON(map[string]interface{}{
151
-	//		"msg": "短信发送成功,有效期为10分钟",
152
-	//
153
-	//	})
154
-	//	this.ServeJSON()
155
-	//}
150
+	if err := service.SendVerificationCodeSMS(mobile, aespass); err != nil {
151
+		this.Data["json"] = enums.MakeFailResponseJSON(err.Error(), 600)
152
+		this.ServeJSON()
153
+	} else {
154
+		this.Data["json"] = enums.MakeSuccessResponseJSON(map[string]interface{}{
155
+			"msg": "短信发送成功,有效期为10分钟",
156
+		})
157
+		this.ServeJSON()
158
+	}
156 159
 	this.ServeSuccessJSON(map[string]interface{}{
157 160
 		"code": "100100",
158 161
 	})
@@ -631,3 +634,13 @@ func (this *XcxApiController) GetDoctorAdvice() {
631 634
 	}
632 635
 
633 636
 }
637
+
638
+func (this *XcxApiController) GetDoctorName() {
639
+	patient_id, _ := this.GetInt64("patient_id")
640
+	fmt.Println("patient_id", patient_id)
641
+	info, _ := service.GetXcxPatientInfo(patient_id)
642
+	user_name, _ := service.GetDoctorName(info.UserOrgId)
643
+	this.ServeSuccessJSON(map[string]interface{}{
644
+		"user_name": user_name,
645
+	})
646
+}

+ 56 - 0
models/his_models.go View File

@@ -1416,3 +1416,59 @@ type HisPrescriptionInfoTemplate struct {
1416 1416
 func (HisPrescriptionInfoTemplate) TableName() string {
1417 1417
 	return "his_prescription_info_template"
1418 1418
 }
1419
+
1420
+type XcxSgjUserAdminRole struct {
1421
+	ID                                      int64  `gorm:"column:id" json:"id" form:"id"`
1422
+	AdminUserId                             int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
1423
+	OrgId                                   int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
1424
+	AppId                                   int64  `gorm:"column:app_id" json:"app_id" form:"app_id"`
1425
+	RoleId                                  int64  `gorm:"column:role_id" json:"role_id" form:"role_id"`
1426
+	UserName                                string `gorm:"column:user_name" json:"user_name" form:"user_name"`
1427
+	Avatar                                  string `gorm:"column:avatar" json:"avatar" form:"avatar"`
1428
+	UserType                                int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
1429
+	UserTitle                               int64  `gorm:"column:user_title" json:"user_title" form:"user_title"`
1430
+	Intro                                   string `gorm:"column:intro" json:"intro" form:"intro"`
1431
+	Status                                  int64  `gorm:"column:status" json:"status" form:"status"`
1432
+	Ctime                                   int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1433
+	Mtime                                   int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1434
+	RoleIds                                 string `gorm:"column:role_ids" json:"role_ids" form:"role_ids"`
1435
+	Message                                 string `gorm:"column:message" json:"message" form:"message"`
1436
+	Sex                                     int64  `gorm:"column:sex" json:"sex" form:"sex"`
1437
+	Birthday                                int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
1438
+	UserTitleName                           string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
1439
+	Sort                                    int64  `gorm:"column:sort" json:"sort" form:"sort"`
1440
+	IsSort                                  int64  `gorm:"column:is_sort" json:"is_sort" form:"is_sort"`
1441
+	Department                              string `gorm:"column:department" json:"department" form:"department"`
1442
+	DepartmentId                            int64  `gorm:"column:department_id" json:"department_id" form:"department_id"`
1443
+	Age                                     int64  `gorm:"column:age" json:"age" form:"age"`
1444
+	Nation                                  string `gorm:"column:nation" json:"nation" form:"nation"`
1445
+	CardType                                int64  `gorm:"column:card_type" json:"card_type" form:"card_type"`
1446
+	IdCard                                  string `gorm:"column:id_card" json:"id_card" form:"id_card"`
1447
+	Education                               int64  `gorm:"column:education" json:"education" form:"education"`
1448
+	StudyMajorName                          string `gorm:"column:study_major_name" json:"study_major_name" form:"study_major_name"`
1449
+	WorkMajorName                           string `gorm:"column:work_major_name" json:"work_major_name" form:"work_major_name"`
1450
+	RoleType                                int64  `gorm:"column:role_type" json:"role_type" form:"role_type"`
1451
+	MedicalCode                             string `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
1452
+	DoctorCode                              string `gorm:"column:doctor_code" json:"doctor_code" form:"doctor_code"`
1453
+	Licensing                               int64  `gorm:"column:licensing" json:"licensing" form:"licensing"`
1454
+	JobNumber                               string `gorm:"column:job_number" json:"job_number" form:"job_number"`
1455
+	PrescriptionQualificationIdentification int64  `gorm:"column:prescription_qualification_identification" json:"prescription_qualification_identification" form:"prescription_qualification_identification"`
1456
+	IdentificationOutpatients               int64  `gorm:"column:identification_outpatients" json:"identification_outpatients" form:"identification_outpatients"`
1457
+	StartTime                               int64  `gorm:"column:start_time" json:"start_time" form:"start_time"`
1458
+	MedicalRangeCode                        int64  `gorm:"column:medical_range_code" json:"medical_range_code" form:"medical_range_code"`
1459
+	MedicalLevel                            int64  `gorm:"column:medical_level" json:"medical_level" form:"medical_level"`
1460
+	MedicalTypeJob                          int64  `gorm:"column:medical_type_job" json:"medical_type_job" form:"medical_type_job"`
1461
+	PharmacistRegistrationNumber            string `gorm:"column:pharmacist_registration_number" json:"pharmacist_registration_number" form:"pharmacist_registration_number"`
1462
+	DoctorTypeJob                           int64  `gorm:"column:doctor_type_job" json:"doctor_type_job" form:"doctor_type_job"`
1463
+	DoctorNumber                            string `gorm:"column:doctor_number" json:"doctor_number" form:"doctor_number"`
1464
+	DoctorRangeCode                         int64  `gorm:"column:doctor_range_code" json:"doctor_range_code" form:"doctor_range_code"`
1465
+	DoctorLevel                             int64  `gorm:"column:doctor_level" json:"doctor_level" form:"doctor_level"`
1466
+	OutpatientIllnessCategory               string `gorm:"column:outpatient_illness_category" json:"outpatient_illness_category" form:"outpatient_illness_category"`
1467
+	IsActive                                int64  `gorm:"column:is_active" json:"is_active" form:"is_active"`
1468
+	ActiveStatus                            int64  `gorm:"column:active_status" json:"active_status" form:"active_status"`
1469
+	IsMark                                  int64  `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
1470
+}
1471
+
1472
+func (XcxSgjUserAdminRole) TableName() string {
1473
+	return "sgj_user_admin_role"
1474
+}

+ 1 - 1
routers/router.go View File

@@ -13,7 +13,7 @@ import (
13 13
 func init() {
14 14
 	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
15 15
 		// AllowAllOrigins:  true,
16
-		AllowOrigins: []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://localhost:9529", "http://localhost:9531", "http://xt.test.shengws.com", "http://new_mobile.test.sgjyun.com", "https://xt.test.shengws.com", "http://xt.test.sgjyun.com", "https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com", "https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com", "http://mobile.sgjyun.com", "http://mobile.kuyicloud.com"},
16
+		AllowOrigins: []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://localhost:9529", "http://localhost:9531", "http://xt.test.shengws.com", "http://new_mobile.test.sgjyun.com", "https://xt.test.shengws.com", "http://xt.test.sgjyun.com", "https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com", "https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com", "http://mobile.sgjyun.com", "http://mobile.kuyicloud.com", "http://xcx.sgjyun.com"},
17 17
 		//AllowOrigins:     []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://xt.test.shengws.com","https://xt.test.shengws.com", "http://xt.test.sgjyun.com","https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com","https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com","http://mobile.sgjyun.com","http://mobile.kuyicloud.com"},
18 18
 		AllowMethods:     []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
19 19
 		AllowHeaders:     []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type", "X-XSRF-TOKEN", "Permission"},

+ 6 - 0
service/xcx_mobile_api_service.go View File

@@ -492,3 +492,9 @@ func GetAllHisDoctorAdviceOne(orgid int64, patientid int64) (his []*models.HisDo
492 492
 	return
493 493
 
494 494
 }
495
+
496
+func GetDoctorName(orgid int64) (role []*models.XcxSgjUserAdminRole, err error) {
497
+
498
+	err = UserReadDB().Where("org_id = ? and status = 1", orgid).Find(&role).Error
499
+	return role, err
500
+}