ice_raft.go 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. package dto
  2. import (
  3. "cold-delivery/app/admin/model"
  4. "cold-delivery/common/dto"
  5. common "cold-delivery/common/model"
  6. )
  7. type IceRaftGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. Code string `form:"code" search:"type:contains;column:code;table:ice_raft"` // 冰排名称
  10. Status string `form:"status" search:"type:exact;column:status;table:ice_raft"` // 状态
  11. IceRaftOrder
  12. }
  13. type IceRaftRecordRecording struct {
  14. dto.Pagination `search:"-"`
  15. StartTime string `form:"startTime" search:"-"` // 开始时间
  16. EndTime string `form:"endTime" search:"-"` // 结束时间
  17. CoolerBoxId int `form:"coolerBoxId" search:"type:contains;column:cooler_box_id;table:ice_raft_record"` // 保温箱id
  18. IceLockerId int `form:"iceLockerId" search:"type:contains;column:ice_locker_id;table:ice_raft_record"` // 冷冻柜id
  19. Code string `form:"code" search:"type:contains;column:code;table:ice_raft_record"` // 冰排名称
  20. }
  21. type IceRaftGetNewestRecordPageReq struct {
  22. dto.Pagination `search:"-"`
  23. Code string `form:"code" search:"type:contains;column:code;table:ice_raft"` // 冰排名称
  24. Status string `form:"status" search:"-"` // 状态
  25. IceLockerId int `form:"iceLockerId" search:"-"` // 冷冻柜id
  26. CoolerBoxId int `form:"coolerBoxId" search:"-"` // 保温箱id
  27. IceRaftOrder
  28. }
  29. type GetPageByCoolerBoxIdReq struct {
  30. CoolerBoxId int `form:"coolerBoxId" search:"-"` // 保温箱id
  31. IceRaftOrder
  32. }
  33. type IceRaftOrder struct {
  34. CreatedAtOrder string `search:"type:order;column:created_at;table:ice_raft" form:"createdAtOrder" default:"desc"`
  35. IdOrder string `search:"type:order;column:id;table:ice_raft" form:"idOrder" default:"desc"`
  36. }
  37. func (m *IceRaftRecordRecording) GetNeedSearch() interface{} {
  38. return *m
  39. }
  40. func (m *IceRaftGetPageReq) GetNeedSearch() interface{} {
  41. return *m
  42. }
  43. func (m *IceRaftGetNewestRecordPageReq) GetNeedSearch() interface{} {
  44. return *m
  45. }
  46. type IceRaftInsertReq struct {
  47. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  48. CodeList []string `json:"codeList" vd:"len($)>0;msg:'冰排编号不能为空'"` // 冰排名称
  49. Status string `json:"status"` // 1-停用 2-正常
  50. FreezeClaim common.FloatList `json:"freezeClaim"` // 冷冻要求 单位小时
  51. Label string `json:"label"` // 标签
  52. IceColdAddress string `json:"iceColdAddress" gorm:"size:128;comment:冰排预冷地点"` //冰排预冷地点
  53. SuitableForCold float32 `json:"suitableForCold" gorm:"type:decimal(10,2);comment:冰排适冷温度"` // 冰排遇冷温度
  54. common.ControlBy `swaggerignore:"true"`
  55. common.DeptBy `swaggerignore:"true"`
  56. }
  57. func (s *IceRaftInsertReq) Generate(model *model.IceRaft, code string) {
  58. if s.Id != 0 {
  59. model.Id = s.Id
  60. }
  61. model.Code = code
  62. model.Status = s.Status
  63. model.FreezeClaim = s.FreezeClaim
  64. model.Label = s.Label
  65. model.IceColdAddress = s.IceColdAddress
  66. model.SuitableForCold = s.SuitableForCold
  67. if s.ControlBy.UpdateBy != 0 {
  68. model.UpdateBy = s.UpdateBy
  69. }
  70. if s.ControlBy.CreateBy != 0 {
  71. model.CreateBy = s.CreateBy
  72. }
  73. if s.DeptBy.DeptId != 0 {
  74. model.DeptId = s.DeptId
  75. }
  76. }
  77. func (s *IceRaftInsertReq) GetId() interface{} {
  78. return s.Id
  79. }
  80. type IceRaftUpdateReq struct {
  81. Id int `json:"id" comment:"编码"` // 编码
  82. Label string `json:"label" gorm:"size:128;comment:标签"` // 标签
  83. Code string `json:"code" vd:"len($)>0;msg:'冰排编号不能为空'"` // 冰排名称
  84. Status string `json:"status"` // 1-停用 2-正常
  85. FreezeClaim common.FloatList `json:"freezeClaim"` // 冷冻要求 单位小时
  86. IceColdAddress string `json:"iceColdAddress" gorm:"size:128;comment:冰排预冷地点"` //冰排预冷地点
  87. SuitableForCold float32 `json:"suitableForCold" gorm:"type:decimal(10,2);comment:冰排适冷温度"` // 冰排遇冷温度
  88. common.ControlBy `swaggerignore:"true"`
  89. }
  90. func (s *IceRaftUpdateReq) Generate(model *model.IceRaft) {
  91. if s.Id != 0 {
  92. model.Id = s.Id
  93. }
  94. model.Code = s.Code
  95. model.Status = s.Status
  96. model.FreezeClaim = s.FreezeClaim
  97. model.Label = s.Label
  98. model.IceColdAddress = s.IceColdAddress
  99. model.SuitableForCold = s.SuitableForCold
  100. if s.ControlBy.UpdateBy != 0 {
  101. model.UpdateBy = s.UpdateBy
  102. }
  103. if s.ControlBy.CreateBy != 0 {
  104. model.CreateBy = s.CreateBy
  105. }
  106. }
  107. func (s *IceRaftUpdateReq) GetId() interface{} {
  108. return s.Id
  109. }
  110. type IceRaftGetReq struct {
  111. Id int `uri:"id"`
  112. }
  113. func (s *IceRaftGetReq) GetId() interface{} {
  114. return s.Id
  115. }
  116. type IceRaftGetByCodeReq struct {
  117. Code string `uri:"code"`
  118. }
  119. type IceRaftDeleteReq struct {
  120. Id int `json:"id"`
  121. common.ControlBy `swaggerignore:"true"`
  122. }
  123. func (s *IceRaftDeleteReq) GetId() interface{} {
  124. return s.Id
  125. }
  126. type IceRaftInStorageReq struct {
  127. Code []string `json:"code"`
  128. IceLockerId int `json:"iceLockerId"` // 冷冻柜id
  129. FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求
  130. common.ControlBy `swaggerignore:"true"`
  131. }
  132. type IceRaftOutStorageReq struct {
  133. Code []string `json:"code"`
  134. CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
  135. SuitableForCold float32 `json:"suitableForCold"` // 冰排适冷温度
  136. common.ControlBy `swaggerignore:"true"`
  137. }
  138. type IceStartbleForColfTimReq struct {
  139. Id []string `json:"id"`
  140. }
  141. type IceOutStorageReq struct {
  142. Code []string `json:"code"`
  143. common.ControlBy `swaggerignore:"true"`
  144. }
  145. type IceRaftRecordGetPageReq struct {
  146. dto.Pagination `search:"-"`
  147. IceRaftId int `form:"iceRaftId" search:"type:exact;column:ice_raft_id;table:ice_raft_record" vd:"$>0;msg:'冰排id不能为空'"` // 冰排id
  148. Status string `form:"status" search:"type:exact;column:status;table:ice_raft_record"` // 状态
  149. IceRaftRecordOrder
  150. }
  151. type IceRaftRecordOrder struct {
  152. CreatedAtOrder string `search:"type:order;column:created_at;table:ice_raft_record" form:"createdAtOrder" default:"desc"`
  153. }
  154. func (m *IceRaftRecordGetPageReq) GetNeedSearch() interface{} {
  155. return *m
  156. }
  157. type IceRaftRecordUpdateReq struct {
  158. Id int `json:"id" comment:"编码"` // 编码
  159. IceLockerId int `json:"iceLockerId"` // 冷冻柜id
  160. CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
  161. FreezeClaim common.FloatList `json:"freezeClaim"` // 冷冻要求 单位小时
  162. common.ControlBy `swaggerignore:"true"`
  163. }
  164. func (s *IceRaftRecordUpdateReq) GetId() interface{} {
  165. return s.Id
  166. }
  167. func (s *IceRaftRecordUpdateReq) Generate(model *model.IceRaftRecord) {
  168. if s.Id != 0 {
  169. model.Id = s.Id
  170. }
  171. model.IceLockerId = s.IceLockerId
  172. model.CoolerBoxId = s.CoolerBoxId
  173. model.FreezeClaim = s.FreezeClaim
  174. if s.ControlBy.UpdateBy != 0 {
  175. model.UpdateBy = s.UpdateBy
  176. }
  177. if s.ControlBy.CreateBy != 0 {
  178. model.CreateBy = s.CreateBy
  179. }
  180. }
  181. type IceRaftRecordDeleteReq struct {
  182. Id int `json:"id"`
  183. common.ControlBy `swaggerignore:"true"`
  184. }
  185. type IceRaftRecordEedReq struct {
  186. Id []int `json:"iceRaftRecordId"`
  187. common.ControlBy `swaggerignore:"true"`
  188. }
  189. func (s *IceRaftRecordDeleteReq) GetId() interface{} {
  190. return s.Id
  191. }