浏览代码

搜索接口更新

XMLWAN 4 年前
父节点
当前提交
b8bfad12e0

+ 34 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

@@ -1503,3 +1503,37 @@ func (this *NewDialysisApiController) GetInspectionDetail() {
1503 1503
 		"InspectionDetail": InspectionDetail,
1504 1504
 	})
1505 1505
 }
1506
+
1507
+func (this *NewDialysisApiController) SaveFeed() {
1508
+
1509
+	question, _ := this.GetInt64("question")
1510
+	fmt.Print("question", question)
1511
+	title := this.GetString("title")
1512
+	fmt.Print("title", title)
1513
+	content := this.GetString("content")
1514
+	fmt.Print("content", content)
1515
+	phone := this.GetString("phone")
1516
+	fmt.Print("phone", phone)
1517
+	times, _ := this.GetInt64("time")
1518
+	fmt.Print("time", times)
1519
+	adminUser := this.GetMobileAdminUserInfo()
1520
+	orgid := adminUser.Org.Id
1521
+	feedback := models.XtPatientFeedback{
1522
+		ProblemType: question,
1523
+		Title:       title,
1524
+		Content:     content,
1525
+		Phone:       phone,
1526
+		TimeQuantum: times,
1527
+		UserOrgId:   orgid,
1528
+		Ctime:       time.Now().Unix(),
1529
+		Status:      1,
1530
+	}
1531
+	err := service.CreateFeedBack(&feedback)
1532
+	if err != nil {
1533
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1534
+		return
1535
+	}
1536
+	this.ServeSuccessJSON(map[string]interface{}{
1537
+		"feedback": feedback,
1538
+	})
1539
+}

+ 1 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go 查看文件

@@ -93,4 +93,5 @@ func NewMobileAPIControllersRegisterRouters() {
93 93
 	beego.Router("/m/api/patient/getmyinformation", &NewDialysisApiController{}, "Get:GetMyInformation")
94 94
 	beego.Router("/m/api/patient/getpatientname", &NewDialysisApiController{}, "Get:GetPatientName")
95 95
 	beego.Router("/m/api/patient/getinspectiondetail", &NewDialysisApiController{}, "Get:GetInspectionDetail")
96
+	beego.Router("/m/api/patient/savefeed", &NewDialysisApiController{}, "Get:SaveFeed")
96 97
 }

+ 20 - 0
models/inspection_models.go 查看文件

@@ -77,3 +77,23 @@ type InepectionForm struct {
77 77
 type InspectionDate struct {
78 78
 	InspectDate int64
79 79
 }
80
+
81
+type XtPatientFeedback struct {
82
+	ID          int64  `gorm:"column:id" json:"id" form:"id"`
83
+	ProblemType int64  `gorm:"column:problem_type" json:"problem_type" form:"problem_type"`
84
+	Title       string `gorm:"column:title" json:"title" form:"title"`
85
+	Content     string `gorm:"column:content" json:"content" form:"content"`
86
+	Image       string `gorm:"column:image" json:"image" form:"image"`
87
+	Phone       string `gorm:"column:phone" json:"phone" form:"phone"`
88
+	TimeQuantum int64  `gorm:"column:time_quantum" json:"time_quantum" form:"time_quantum"`
89
+	Ctime       int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
90
+	Mtime       int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
91
+	Status      int64  `gorm:"column:status" json:"status" form:"status"`
92
+	UserOrgId   int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
93
+	AdminUserId int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
94
+	AppId       int64  `gorm:"column:app_id" json:"app_id" form:"app_id"`
95
+}
96
+
97
+func (XtPatientFeedback) TableName() string {
98
+	return "xt_patient_feedback"
99
+}

+ 6 - 0
service/patientmanage_service.go 查看文件

@@ -923,3 +923,9 @@ func GetInspectionDetail(patientid int64, date int64, orgid int64, projectid int
923 923
 	err = db.Select("x.id,x.patient_id,x.org_id,x.project_id,x.item_id,x.item_name,x.project_name,x.inspect_type,x.inspect_value,x.inspect_date,x.status,x.created_time,x.updated_time").Scan(&inspection).Error
924 924
 	return inspection, err
925 925
 }
926
+
927
+func CreateFeedBack(feedback *models.XtPatientFeedback) error {
928
+
929
+	err := XTWriteDB().Model(&feedback).Create(&feedback).Error
930
+	return err
931
+}