Bladeren bron

打印單

test_user 2 jaren geleden
bovenliggende
commit
81b4b9eaae

+ 38 - 0
controllers/gobal_config_api_controller.go Bestand weergeven

@@ -121,10 +121,48 @@ func GobalConfigRegistRouters() {
121 121
 	beego.Router("/api/changesettleopenconfig", &GobalConfigApiController{}, "Get:ChangeSettleOpenConfig")
122 122
 
123 123
 	beego.Router("/api/changegoodoutopen", &GobalConfigApiController{}, "Get:ChangeGoodOutOpen")
124
+
125
+	beego.Router("/api/schedule/config/commit", &GobalConfigApiController{}, "post:PostScheduleConfig")
126
+	beego.Router("/api/schedule/config/get", &GobalConfigApiController{}, "get:GetScheduleConfig")
124 127
 }
125 128
 
126 129
 //provinces, _ := service.GetDistrictsByUpid(0)21
127 130
 
131
+func (c *GobalConfigApiController) PostScheduleConfig() {
132
+	is_show_mode, _ := c.GetInt64("is_show_mode", 0)
133
+	is_show_machine, _ := c.GetInt64("is_show_machine", 0)
134
+	id, _ := c.GetInt64("id", 0)
135
+
136
+	config, _ := service.GetScheduleConfigById(id)
137
+	var err error
138
+	if config.ID == 0 {
139
+		config.IsShowMode = is_show_mode
140
+		config.IsShowMachine = is_show_machine
141
+		config.UserOrgId = c.GetAdminUserInfo().CurrentOrgId
142
+		config.Ctime = time.Now().Unix()
143
+		config.Mtime = time.Now().Unix()
144
+		config.Status = 1
145
+		err = service.CreateScheduleConfig(config)
146
+	} else {
147
+		config.IsShowMachine = is_show_machine
148
+		config.IsShowMode = is_show_mode
149
+		config.Mtime = time.Now().Unix()
150
+		err = service.SaveScheduleConfig(config)
151
+	}
152
+	if err == nil {
153
+		c.ServeSuccessJSON(map[string]interface{}{
154
+			"config": config,
155
+		})
156
+	}
157
+}
158
+
159
+func (c *GobalConfigApiController) GetScheduleConfig() {
160
+	config, _ := service.GetScheduleConfigByOrgId(c.GetAdminUserInfo().CurrentOrgId)
161
+	c.ServeSuccessJSON(map[string]interface{}{
162
+		"config": config,
163
+	})
164
+}
165
+
128 166
 func (c *GobalConfigApiController) PostStockConfig() {
129 167
 	is_open, _ := c.GetInt64("is_open", 0)
130 168
 	adminUserInfo := c.GetAdminUserInfo()

+ 0 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go Bestand weergeven

@@ -2443,7 +2443,6 @@ func (c *DialysisAPIController) GetSchedualPatientsList() {
2443 2443
 // @param nurse:int 上机护士
2444 2444
 // @param bed:int 床位号
2445 2445
 func (this *DialysisAPIController) StartDialysis() {
2446
-
2447 2446
 	patientID, _ := this.GetInt64("patient_id")
2448 2447
 	recordDateStr := this.GetString("record_date")
2449 2448
 	nurseID, _ := this.GetInt64("nurse")