智慧食堂
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

182 linhas
6.8 KiB

  1. package md
  2. import (
  3. "applet/app/db/model"
  4. "applet/app/enum"
  5. )
  6. type EnterpriseAddReq struct {
  7. Name string `json:"name" binding:"required" label:"名称"`
  8. Pvd int32 `json:"pvd" label:"消费场景"`
  9. Mode int32 `json:"mode" label:"模式(1:学校 2:工厂 3:养老院)"`
  10. Kind int32 `json:"kind" binding:"required" label:"种类(1:央厨-学校 2:央厨-工厂 3:自营-学校 4:自营-工厂 5:养老院)"`
  11. CompanyId int `json:"company_id" binding:"required" label:"所属公司id"`
  12. Memo string `json:"memo" label:"备注"`
  13. }
  14. type CentralKitchenForSchoolUpdateReq struct {
  15. Id int `json:"id" binding:"required" label:"企业id"`
  16. Name string `json:"name" binding:"required" label:"名称"`
  17. CompanyId int `json:"company_id" binding:"required" label:"所属公司id"`
  18. Memo string `json:"memo" label:"备注"`
  19. State int32 `json:"state" label:"状态"`
  20. PeriodList []struct {
  21. Id int `json:"id" label:"学段id"`
  22. Name string `json:"name" label:"名称"`
  23. GradeList []struct {
  24. Id int `json:"id" label:"年级id"`
  25. Name string `json:"name" label:"名称"`
  26. ClassList []struct {
  27. Id int `json:"id" label:"班级id"`
  28. Name string `json:"name" label:"名称"`
  29. } `json:"class_list" label:"班级"`
  30. } `json:"grade_list" label:"年级"`
  31. } `json:"period_list" label:"学段"`
  32. }
  33. type EnterpriseDeleteReq struct {
  34. EnterpriseIds []int `json:"enterprise_ids"`
  35. }
  36. type EnterpriseUpdateStateReq struct {
  37. Id int `json:"id" binding:"required" label:"企业id"`
  38. State int32 `json:"state" label:"状态"`
  39. }
  40. type EnterpriseListReq struct {
  41. Limit int `json:"limit"`
  42. Page int `json:"page" `
  43. Name string `json:"name" label:"名称"`
  44. Kind int `json:"kind" label:"种类"`
  45. Pvd int `json:"pvd" label:"场景"`
  46. Mode int `json:"mode" label:"模式"`
  47. }
  48. type EnterpriseDetailResp struct {
  49. Enterprise model.Enterprise `json:"enterprise"`
  50. PeriodList []PeriodListStruct `json:"period_list"`
  51. }
  52. type PeriodListStruct struct {
  53. Period model.Period `json:"period"`
  54. GradeList []GradeListStruct `json:"grade_list"`
  55. }
  56. type GradeListStruct struct {
  57. Grade model.Grade `json:"grade"`
  58. ClassList []model.Class `json:"class_list"`
  59. }
  60. type SetCentralKitchenForSchoolWithSpecForSystemReq struct {
  61. BreakfastUnitPrice string `json:"breakfast_unit_price" binding:"required" label:"早餐-单价"`
  62. BreakfastUnitPriceForTeacher string `json:"breakfast_unit_price_for_teacher" binding:"required" label:"教师-早餐-单价"`
  63. LunchUnitPrice string `json:"lunch_unit_price" binding:"required" label:"午餐-单价"`
  64. LunchUnitPriceForTeacher string `json:"lunch_unit_price_for_teacher" binding:"required" label:"教师-午餐-单价"`
  65. DinnerUnitPrice string `json:"dinner_unit_price" binding:"required" label:"晚餐-单价"`
  66. DinnerUnitPriceForTeacher string `json:"dinner_unit_price_for_teacher" binding:"required" label:"教师-晚餐-单价"`
  67. }
  68. type ListCentralKitchenForSchoolPackageForSystemReq struct {
  69. Page int `json:"page" label:"页码"`
  70. Limit int `json:"limit" label:"每页数量"`
  71. Year string `json:"year" label:"年份"`
  72. Month string `json:"month" label:"月份"`
  73. }
  74. type SaveCentralKitchenForSchoolPackageForSystemReq struct {
  75. Id int `json:"id" label:"套餐ID"`
  76. Year string `json:"year" binding:"required" label:"年份"`
  77. Month string `json:"month" binding:"required" label:"月份"`
  78. StartDate string `json:"start_date" binding:"required" label:"开始时间"`
  79. EndDate string `json:"end_date" binding:"required" label:"截止时间"`
  80. State int `json:"state" label:"状态(1:可用 2:不可用)"`
  81. DateList []struct {
  82. Date string `json:"date"`
  83. IsOpenBreakfast int `json:"is_open_breakfast"`
  84. IsOpenLunch int `json:"is_open_lunch"`
  85. IsOpenDinner int `json:"is_open_dinner"`
  86. IsOpenReplenish int `json:"is_open_replenish"`
  87. } `json:"date_list" binding:"required" label:"日期"`
  88. }
  89. type SyncCentralKitchenForSchoolPackageForSystemReq struct {
  90. Ids []int `json:"ids" label:"套餐ids"`
  91. EnterpriseIds []int `json:"enterprise_ids" label:"校企ids"`
  92. IsCarryPackagePrice bool `json:"is_carry_package_price" label:"是否跟随套餐价格"`
  93. }
  94. type CentralKitchenForSchoolPackageForSystemWithDay struct {
  95. Date string `json:"date"`
  96. IsOpenBreakfast int `json:"is_open_breakfast"`
  97. IsOpenLunch int `json:"is_open_lunch"`
  98. IsOpenDinner int `json:"is_open_dinner"`
  99. IsOpenReplenish int `json:"is_open_replenish"`
  100. }
  101. type CentralKitchenForSchoolStudentAdmissionBySchool struct {
  102. EnterpriseIds []int `json:"enterprise_ids" binding:"required" label:"企业id"`
  103. }
  104. type CentralKitchenForSchoolStudentAdmissionByGrade struct {
  105. EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"`
  106. GradeIds []int `json:"grade_ids" binding:"required" label:"年级id"`
  107. }
  108. type CentralKitchenForSchoolStudentAdmissionByClass struct {
  109. EnterpriseId int `json:"enterprise_id" binding:"required" label:"企业id"`
  110. GradeId int `json:"grade_id" binding:"required" label:"年级id"`
  111. ClassIds []int `json:"class_ids" label:"班级id"`
  112. }
  113. var EnterpriseKindByMode = []map[string]interface{}{
  114. {
  115. "name": enum.EnterpriseMode(enum.EnterpriseModeForSchool).String(),
  116. "value": enum.EnterpriseModeForSchool,
  117. "kind_list": []map[string]interface{}{
  118. {
  119. "name": enum.EnterpriseKind(enum.EnterpriseKindByCentralKitchenForSchool).String(),
  120. "value": enum.EnterpriseKindByCentralKitchenForSchool,
  121. },
  122. {
  123. "name": enum.EnterpriseKind(enum.EnterpriseKindBySelfSupportForSchool).String(),
  124. "value": enum.EnterpriseKindBySelfSupportForSchool,
  125. },
  126. },
  127. },
  128. {
  129. "name": enum.EnterpriseMode(enum.EnterpriseModeForFactory).String(),
  130. "value": enum.EnterpriseModeForFactory,
  131. "kind_list": []map[string]interface{}{
  132. {
  133. "name": enum.EnterpriseKind(enum.EnterpriseKindByCentralKitchenForFactory).String(),
  134. "value": enum.EnterpriseKindByCentralKitchenForFactory,
  135. },
  136. {
  137. "name": enum.EnterpriseKind(enum.EnterpriseKindBySelfSupportForFactory).String(),
  138. "value": enum.EnterpriseKindBySelfSupportForFactory,
  139. },
  140. },
  141. },
  142. //{
  143. // "name": enum.EnterpriseMode(enum.EnterpriseModeForNursingHome).String(),
  144. // "value": enum.EnterpriseModeForNursingHome,
  145. // "kind_list": []map[string]interface{}{
  146. // {
  147. // "name": enum.EnterpriseKind(enum.EnterpriseKindByNursingHome).String(),
  148. // "value": enum.EnterpriseKindByNursingHome,
  149. // },
  150. // },
  151. //},
  152. }
  153. var EnterpriseKindForSchool = []map[string]interface{}{
  154. {
  155. "name": enum.EnterpriseKind.String(enum.EnterpriseKindByCentralKitchenForSchool),
  156. "value": enum.EnterpriseKindByCentralKitchenForSchool,
  157. },
  158. {
  159. "name": enum.EnterpriseKind.String(enum.EnterpriseKindBySelfSupportForSchool),
  160. "value": enum.EnterpriseKindBySelfSupportForSchool,
  161. },
  162. }