supply_order_api_contorller.go 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package controllers
  2. import (
  3. "XT_New/service"
  4. "github.com/astaxie/beego"
  5. )
  6. type SupplyOrderApiController struct {
  7. BaseAuthAPIController
  8. }
  9. func SupplyOrderApiRegistRouters() {
  10. beego.Router("/api/supply/getinitorder", &SupplyOrderApiController{}, "get:GetInitOrder")
  11. }
  12. func (this *SupplyOrderApiController) GetInitOrder() {
  13. orgId := this.GetAdminUserInfo().CurrentOrgId
  14. //获取药品库数据
  15. baseList, _ := service.GetSupplyDrugList(orgId)
  16. goodList, _ := service.GetSupplyGoodList(orgId)
  17. manufactuerList, _ := service.GetAllManufacturerList(orgId)
  18. goodTypeList, _ := service.GetAllGoodType(orgId)
  19. supplyList, _ := service.GetSupplierList(orgId)
  20. var drugType = "药品类型"
  21. drugTypeParent, _ := service.GetDrugDataConfig(0, drugType)
  22. drugTypeList, _ := service.GetParentDataConfig(drugTypeParent.ID, orgId)
  23. this.ServeSuccessJSON(map[string]interface{}{
  24. "drugList": baseList,
  25. "goodList": goodList,
  26. "manufactuerList": manufactuerList,
  27. "goodTypeList": goodTypeList,
  28. "drugTypeList": drugTypeList,
  29. "supplyList": supplyList,
  30. })
  31. return
  32. }