Browse Source

仓库管理

mainqaq 2 years ago
parent
commit
7bb46bd97d
1 changed files with 18 additions and 2 deletions
  1. 18 2
      controllers/secondary_order_api_contorller.go

+ 18 - 2
controllers/secondary_order_api_contorller.go View File

@@ -32,6 +32,7 @@ func SecondaryOrderApiRegistRouters() {
32 32
 	beego.Router("/api/secondary/updateoutinfo", &SecondaryOrderApiController{}, "get:UpdateOutInfo")               //更改耗材自动出库仓库
33 33
 	beego.Router("/api/secondary/updatedruginfo", &SecondaryOrderApiController{}, "get:UpdateDrugInfo")             //更改药品自动入库仓库
34 34
 	beego.Router("/api/secondary/updatedrugout", &SecondaryOrderApiController{}, "get:UpdateDrugOut")               //更改药品自动出库仓库
35
+	beego.Router("/api/secondary/getusername", &SecondaryOrderApiController{}, "get:GetuserName")                   //获取仓库管理员信息
35 36
 	beego.Router("/api/secondary/byliinit", &SecondaryOrderApiController{}, "get:Byliinit")                         //初始化旧数据
36 37
 
37 38
 }
@@ -57,6 +58,7 @@ func (this *SecondaryOrderApiController) GetStoreCode() {
57 58
 //修改仓库状态
58 59
 func (this *SecondaryOrderApiController) UpdateStatus() {
59 60
 	orgId := this.GetAdminUserInfo().CurrentOrgId
61
+	orgId = 9675
60 62
 	check := map[string][]string{
61 63
 		"id": {"must", "int", "id"},
62 64
 	}
@@ -220,12 +222,12 @@ func (this *SecondaryOrderApiController) AddStorehouse() {
220 222
 	if tmpid == nil {
221 223
 		admin_id = 0
222 224
 	} else {
223
-		admin_id = int64(dataBody["storehouse_status"].(float64)) //管理员id
225
+		admin_id = int64(dataBody["storehouse_admin_id"].(float64)) //管理员id
224 226
 	}
225 227
 	if tmpname == nil {
226 228
 		admin_name = "admin"
227 229
 	} else {
228
-		admin_name = dataBody["storehouse_status"].(string) //管理员名称
230
+		admin_name = dataBody["storehouse_admin_name"].(string) //管理员名称
229 231
 	}
230 232
 
231 233
 	switch {
@@ -550,3 +552,17 @@ func (this *SecondaryOrderApiController) Byliinit() {
550 552
 	})
551 553
 	return
552 554
 }
555
+
556
+//查询机构所属管理员
557
+func (this *SecondaryOrderApiController) GetuserName() {
558
+	orgId := this.GetAdminUserInfo().CurrentOrgId
559
+	username, err := service.GetuserName(orgId)
560
+	if err != nil {
561
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
562
+		return
563
+	}
564
+	this.ServeSuccessJSON(map[string]interface{}{
565
+		"list": username,
566
+	})
567
+
568
+}