ERP.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package controllers
  2. import (
  3. "ColdVerify_server/lib"
  4. "ColdVerify_server/models/Account"
  5. "ColdVerify_server/models/Distributor"
  6. "ColdVerify_server/models/Task"
  7. )
  8. // 获取管理员 关联ERP
  9. func (c *AccountController) Account_List_All_For_ERP() {
  10. PowerList := Account.Read_Power_List_ALL_1()
  11. PowerMap := Account.UserPowerListToPowerMap(PowerList)
  12. T_name := c.GetString("T_name")
  13. var r_jsons lib.R_JSONS
  14. r_jsons.List = Account.Read_Admin_List_ALL_Power("", T_name, PowerMap)
  15. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: r_jsons}
  16. c.ServeJSON()
  17. return
  18. }
  19. // 获取公司列表
  20. func (c *UserController) User_List_All_For_ERP() {
  21. T_name := c.GetString("T_name")
  22. CreateDate := c.GetString("CreateDate")
  23. if len(CreateDate) > 0 && !lib.IsDateStr(CreateDate) {
  24. c.Data["json"] = lib.JSONS{Code: 202, Msg: "日期格式错误!"}
  25. c.ServeJSON()
  26. return
  27. }
  28. distributorList := Distributor.Read_Distributor_List_ALL("")
  29. distributorMap := Distributor.DistributorListToMap(distributorList)
  30. List, _ := Account.List_All_For_ERP(T_name, CreateDate, distributorMap)
  31. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: List}
  32. c.ServeJSON()
  33. return
  34. }
  35. func (c *TaskController) Task_List_All_For_ERP() {
  36. T_reporting_pass_time := c.GetString("T_reporting_pass_time")
  37. if len(T_reporting_pass_time) > 0 && !lib.IsDateStr(T_reporting_pass_time) {
  38. c.Data["json"] = lib.JSONS{Code: 202, Msg: "日期格式错误!"}
  39. c.ServeJSON()
  40. return
  41. }
  42. List, _ := Task.Read_Task_List_For_ERP(T_reporting_pass_time)
  43. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: List}
  44. c.ServeJSON()
  45. return
  46. }