vo.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. package warehousesrv
  2. import (
  3. "Cold_Logistic/internal/pkg/common/constant"
  4. "Cold_Logistic/internal/pkg/common/global"
  5. "Cold_Logistic/internal/server/infra/models"
  6. validation "github.com/go-ozzo/ozzo-validation/v4"
  7. "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/core"
  8. )
  9. type WarehouseInfoRespVO struct {
  10. Name string `json:"name"`
  11. SnCode string `json:"snCode"`
  12. SnIds []global.SnIdVO `json:"snIds"`
  13. }
  14. type WarehouseOrderReqVO struct {
  15. Page core.Page `json:"page"`
  16. Search struct {
  17. OrderNo string `json:"orderNo"`
  18. TimeStart models.MyTime `json:"timeStart"`
  19. TimeEnd models.MyTime `json:"timeEnd"`
  20. }
  21. }
  22. type OrderIntoHouseReqVO struct {
  23. OrderId int `json:"orderId"`
  24. }
  25. func (r *OrderIntoHouseReqVO) Validate() error {
  26. return validation.ValidateStruct(r, validation.Field(&r.OrderId, validation.Required))
  27. }
  28. type OrderIntoHouseRespVO struct {
  29. OrderId int `json:"orderId"`
  30. OrderNo string `json:"orderNo"`
  31. IntoTime models.MyTime `json:"intoTime"`
  32. }
  33. type OrderOutHouseReqVO struct {
  34. OrderId int `json:"orderId"`
  35. }
  36. func (r *OrderOutHouseReqVO) Validate() error {
  37. return validation.ValidateStruct(r, validation.Field(&r.OrderId, validation.Required))
  38. }
  39. type OrderOutHouseRespVO struct {
  40. OrderId int `json:"orderId"`
  41. OrderNo string `json:"orderNo"`
  42. OutTime models.MyTime `json:"outTime"`
  43. }
  44. type WarehousePageReqVO struct {
  45. Page core.Page `json:"page"`
  46. Search struct {
  47. Name string `json:"name"`
  48. SnCode string `json:"snCode"`
  49. }
  50. }
  51. type WarehousePageVO struct {
  52. WarehouseId int `json:"warehouseId"` //
  53. Name string `json:"name"` //仓库名称
  54. SnCode string `json:"snCode"` //sn编码
  55. Address string `json:"address"` //地址
  56. OrderCount int64 `json:"orderCount"` //订单数量
  57. AccountList []WarehouseManageVO `json:"accountList"` // 仓管
  58. }
  59. type WarehouseManageVO struct {
  60. AccountId int `json:"accountId"`
  61. AccountUuid string `json:"accountUuid"`
  62. AccountName string `json:"accountName"`
  63. }
  64. type AddWarehouseReqVO struct {
  65. Name string `json:"name"` //仓库名称
  66. SnCode string `json:"snCode"` //sn编码
  67. Address string `json:"address"` //地址
  68. Manage []global.ClodAccount `json:"manage"`
  69. Enable int `json:"enable"`
  70. }
  71. func (r *AddWarehouseReqVO) Validate() error {
  72. return validation.ValidateStruct(r,
  73. validation.Field(&r.Name, validation.Required, validation.RuneLength(1, 50)),
  74. validation.Field(&r.SnCode, validation.Required, validation.RuneLength(1, 100)),
  75. validation.Field(&r.Address, validation.Required, validation.RuneLength(1, 200)),
  76. validation.Field(&r.Enable, validation.In(constant.YES, constant.NO)),
  77. )
  78. }
  79. type WarehouseIdRespVO struct {
  80. WarehouseId int `json:"warehouseId"`
  81. }
  82. type UpdateWarehouseReqVO struct {
  83. WarehouseId int `json:"warehouseId"`
  84. AddWarehouseReqVO
  85. }
  86. func (r *UpdateWarehouseReqVO) Validate() error {
  87. return validation.ValidateStruct(r,
  88. validation.Field(&r.WarehouseId, validation.Required),
  89. validation.Field(&r.AddWarehouseReqVO),
  90. )
  91. }