gas_cylinder_allot.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. package dto
  2. import (
  3. "gas-cylinder-api/app/admin/model"
  4. "gas-cylinder-api/common/dto"
  5. common "gas-cylinder-api/common/model"
  6. )
  7. type GasCylinderAllotGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. My string `form:"my" search:"-"` // 我的 allot-我调拨的 accept-我签收的
  10. Status int `form:"status" search:"type:exact;column:status;table:gas_cylinder_allot"` // 1-调拨中 2-已完成 3-已取消 4-超时取消
  11. GasCylinderAllotOrder
  12. }
  13. type GasCylinderAllotOrder struct {
  14. CreatedAtOrder string `search:"type:order;column:created_at;table:gas_cylinder_allot" form:"createdAtOrder" default:"desc"`
  15. }
  16. func (m *GasCylinderAllotGetPageReq) GetNeedSearch() interface{} {
  17. return *m
  18. }
  19. type GasCylinderAllotInsertReq struct {
  20. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  21. OptType string `json:"optType" vd:"len($)>0;msg:'气瓶流转步骤不能为空'"` // 气瓶流转步骤
  22. AllotUserId int `json:"allotUserId" swaggerignore:"true"` // 调拨者用户id
  23. AcceptUserId int `json:"acceptUserId" vd:"$>0;msg:'接收者用户id不能为空'"` // 接收者用户id
  24. AllotCompanyId int `json:"allotCompanyId" swaggerignore:"true"` // 调拨者所属公司id
  25. AcceptCompanyId int `json:"acceptCompanyId" vd:"$>0;msg:'接收者公司id不能为空'"` // 接收者所属公司id
  26. InnerCodeList common.StringList `json:"innerCodeList" vd:"len($)>0;msg:'单位内编码不能为空'"` // 单位内编码列表
  27. GasCylinderStatus string `json:"gasCylinderStatus"` // 气瓶状态
  28. Status int `json:"status" swaggerignore:"true"` // 调拨状态
  29. AllotType int `json:"allotType" ` // 调拨类型 1-扫码调拨 2-一键调拨
  30. common.ControlBy `swaggerignore:"true"`
  31. common.DeptBy `swaggerignore:"true"`
  32. }
  33. func (s *GasCylinderAllotInsertReq) Generate(m *model.GasCylinderAllot) {
  34. if s.Id != 0 {
  35. m.Id = s.Id
  36. }
  37. m.OptType = s.OptType
  38. m.AllotUserId = s.CreateBy
  39. m.AcceptUserId = s.AcceptUserId
  40. m.AllotCompanyId = s.DeptId
  41. m.AcceptCompanyId = s.AcceptCompanyId
  42. m.InnerCodeList = s.InnerCodeList
  43. m.Status = model.GasCylinderAllotStateAllot
  44. m.AllotType = s.AllotType
  45. if s.ControlBy.UpdateBy != 0 {
  46. m.UpdateBy = s.UpdateBy
  47. }
  48. if s.ControlBy.CreateBy != 0 {
  49. m.CreateBy = s.CreateBy
  50. }
  51. if s.DeptBy.DeptId != 0 {
  52. m.DeptId = s.DeptId
  53. }
  54. }
  55. func (s *GasCylinderAllotInsertReq) GetId() interface{} {
  56. return s.Id
  57. }
  58. type GasCylinderAllotUpdateReq struct {
  59. Id int `json:"id" comment:"编码"` // 编码
  60. Status string `json:"status" vd:"len($)>0;msg:'钢瓶位置不能为空'"` // 钢瓶规格名称
  61. Remark string `json:"remark"` // 备注
  62. common.ControlBy `swaggerignore:"true"`
  63. }
  64. func (s *GasCylinderAllotUpdateReq) Generate(model *model.GasCylinderAllot) {
  65. if s.Id != 0 {
  66. model.Id = s.Id
  67. }
  68. //model.Status = s.Status
  69. if s.ControlBy.UpdateBy != 0 {
  70. model.UpdateBy = s.UpdateBy
  71. }
  72. if s.ControlBy.CreateBy != 0 {
  73. model.CreateBy = s.CreateBy
  74. }
  75. }
  76. func (s *GasCylinderAllotUpdateReq) GetId() interface{} {
  77. return s.Id
  78. }
  79. type GasCylinderAllotGetReq struct {
  80. Id int `uri:"id" vd:"$>0;msg:'id不能为空'"`
  81. }
  82. func (s *GasCylinderAllotGetReq) GetId() interface{} {
  83. return s.Id
  84. }
  85. type GasCylinderAllotGetByOptTypeReq struct {
  86. OptType string `uri:"optType" vd:"len($)>0;msg:'气瓶流转步骤不能为空'"` // 气瓶流转步骤
  87. }
  88. type GasCylinderAllotDeleteReq struct {
  89. Id int `json:"id" vd:"$>0;msg:'id不能为空'"`
  90. common.ControlBy `swaggerignore:"true"`
  91. }
  92. func (s *GasCylinderAllotDeleteReq) GetId() interface{} {
  93. return s.Id
  94. }
  95. type GasCylinderAllotCancelReq struct {
  96. Id int `json:"id" comment:"编码"` // 编码
  97. common.ControlBy `swaggerignore:"true"`
  98. }
  99. func (s *GasCylinderAllotCancelReq) GetId() interface{} {
  100. return s.Id
  101. }
  102. type GasCylinderAllotSubmitReq struct {
  103. Id int `json:"id" comment:"编码"` // 编码
  104. OptType string `json:"optType" vd:"len($)>0;msg:'气瓶流转步骤不能为空'"` // 气瓶流转步骤
  105. AllotUserId int `json:"allotUserId" swaggerignore:"true"` // 调拨者用户id
  106. AcceptUserId int `json:"acceptUserId" vd:"$>0;msg:'接收者用户id不能为空'"` // 接收者用户id
  107. AllotCompanyId int `json:"allotCompanyId" swaggerignore:"true"` // 调拨者所属公司id
  108. AcceptCompanyId int `json:"acceptCompanyId" vd:"$>0;msg:'接收者公司id不能为空'"` // 接收者所属公司id
  109. InnerCodeList []string `json:"innerCodeList" vd:"len($)>0;msg:'单位内编码不能为空'"` // 单位内编码列表
  110. common.ControlBy `swaggerignore:"true"`
  111. common.DeptBy `swaggerignore:"true"`
  112. }
  113. func (s *GasCylinderAllotSubmitReq) GetId() interface{} {
  114. return s.Id
  115. }