waybill.go 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. package dto
  2. import (
  3. "cold-logistics/app/admin/model"
  4. "cold-logistics/common/dto"
  5. common "cold-logistics/common/model"
  6. model2 "cold-logistics/common/model"
  7. "time"
  8. )
  9. // 运单
  10. type WaybillGetPageReq struct {
  11. dto.Pagination `search:"-"`
  12. WaybillNo string `form:"waybillNo" search:"type:contains;column:waybill_no;table:waybill"` // 运单编号
  13. Status int `form:"status" search:"type:exact;column:status;table:waybill"` // 状态
  14. OrderStartTime string `form:"orderStartTime" search:"type:gte;column:order_time;table:waybill"` // 下单开始时间
  15. OrderEndTime string `form:"orderEndTime" search:"type:lte;column:order_time;table:waybill"` // 下单结束时间
  16. WaybillOrder
  17. }
  18. type WaybillOrder struct {
  19. CreatedAtOrder string `search:"type:order;column:created_at;table:waybill" form:"createdAtOrder" default:"desc"`
  20. }
  21. func (m *WaybillGetPageReq) GetNeedSearch() interface{} {
  22. return *m
  23. }
  24. type WaybillGetCustomerPageReq struct {
  25. dto.Pagination `search:"-"`
  26. WaybillNo string `form:"waybillNo" search:"type:contains;column:waybill_no;table:waybill"` // 运单编号
  27. Status int `form:"status" search:"-"` // 状态
  28. OrderStartTime string `form:"orderStartTime" search:"type:gte;column:order_time;table:waybill"` // 下单开始时间
  29. OrderEndTime string `form:"orderEndTime" search:"type:lte;column:order_time;table:waybill"` // 下单结束时间
  30. CustomerId int `form:"customerId" search:"type:exact;column:customer_id;table:waybill" swaggerignore:"true"` // 客户id
  31. WaybillOrder
  32. }
  33. func (m *WaybillGetCustomerPageReq) GetNeedSearch() interface{} {
  34. return *m
  35. }
  36. type WaybillInsertReq struct {
  37. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  38. No string `json:"no" swaggerignore:"true"` //单号
  39. Status int `json:"status" swaggerignore:"true"` //订单状态:1-待处理;102-待装车 103-运输中 104-已签收
  40. SenderAddressDetails string `json:"senderAddressDetails"` //发货地址详情
  41. SenderAddressName string `json:"senderAddressName"` //发货地址名称
  42. SenderAddressPhone string `json:"senderAddressPhone"` //发货地址电话
  43. ConsigneeAddressDetails string `json:"consigneeAddressDetails"` //收发货地址详情
  44. ConsigneeAddressName string `json:"consigneeAddressName"` //收发货地址名称
  45. ConsigneeAddressPhone string `json:"consigneeAddressPhone"` //收发货地址电话
  46. CargoType string `json:"cargoType"` //货物类型
  47. TemperatureInterval string `json:"temperatureInterval"` //温度要求
  48. DeliveryCondition string `json:"deliveryCondition"` //配送要求
  49. Quantity int `json:"quantity"` //药品数量
  50. Remark string `json:"remark"` //运输备注
  51. CustomerId int `json:"customerId"` //下单客户id
  52. CustomerName string `json:"customerName"` //下单客户名称
  53. model2.ControlBy `swaggerignore:"true"`
  54. model2.DeptBy
  55. }
  56. func (s *WaybillInsertReq) Generate(m *model.Waybill) {
  57. if s.Id != 0 {
  58. m.Id = s.Id
  59. }
  60. m.Status = 1
  61. m.SenderAddressDetails = s.SenderAddressDetails
  62. m.SenderAddressName = s.SenderAddressName
  63. m.SenderAddressPhone = s.SenderAddressPhone
  64. m.ConsigneeAddressDetails = s.ConsigneeAddressDetails
  65. m.ConsigneeAddressName = s.ConsigneeAddressName
  66. m.ConsigneeAddressPhone = s.ConsigneeAddressPhone
  67. m.CargoType = s.CargoType
  68. m.TemperatureInterval = s.TemperatureInterval
  69. m.DeliveryCondition = s.DeliveryCondition
  70. m.Quantity = s.Quantity
  71. m.Remark = s.Remark
  72. m.CustomerId = s.CustomerId
  73. m.CustomerName = s.CustomerName
  74. m.OrderTime = model2.Time(time.Now())
  75. if s.ControlBy.UpdateBy != 0 {
  76. m.UpdateBy = s.UpdateBy
  77. }
  78. if s.ControlBy.CreateBy != 0 {
  79. m.CreateBy = s.CreateBy
  80. }
  81. if s.DeptBy.DeptId != 0 {
  82. m.DeptId = s.DeptId
  83. }
  84. }
  85. func (s *WaybillInsertReq) GetId() interface{} {
  86. return s.Id
  87. }
  88. type WaybillUpdateReq struct {
  89. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  90. SenderAddressDetails string `json:"senderAddressDetails"` //发货地址详情
  91. SenderAddressName string `json:"senderAddressName"` //发货地址名称
  92. SenderAddressPhone string `json:"senderAddressPhone"` //发货地址电话
  93. ConsigneeAddressDetails string `json:"consigneeAddressDetails"` //收发货地址详情
  94. ConsigneeAddressName string `json:"consigneeAddressName"` //收发货地址名称
  95. ConsigneeAddressPhone string `json:"consigneeAddressPhone"` //收发货地址电话
  96. CargoType string `json:"cargoType"` //货物类型
  97. TemperatureInterval string `json:"temperatureInterval"` //温度要求
  98. DeliveryCondition string `json:"deliveryCondition"` //配送要求
  99. Quantity int `json:"quantity"` //药品数量
  100. Remark string `json:"remark"` //运输备注
  101. CustomerName string `json:"customerName"` //下单客户名称
  102. model2.ControlBy `swaggerignore:"true"`
  103. model2.DeptBy `swaggerignore:"true"`
  104. }
  105. func (s *WaybillUpdateReq) Generate(m *model.Waybill) {
  106. if s.Id != 0 {
  107. m.Id = s.Id
  108. }
  109. m.SenderAddressDetails = s.SenderAddressDetails
  110. m.SenderAddressName = s.SenderAddressName
  111. m.SenderAddressPhone = s.SenderAddressPhone
  112. m.ConsigneeAddressDetails = s.ConsigneeAddressDetails
  113. m.ConsigneeAddressName = s.ConsigneeAddressName
  114. m.ConsigneeAddressPhone = s.ConsigneeAddressPhone
  115. m.CargoType = s.CargoType
  116. m.TemperatureInterval = s.TemperatureInterval
  117. m.DeliveryCondition = s.DeliveryCondition
  118. m.Quantity = s.Quantity
  119. m.Remark = s.Remark
  120. m.CustomerName = s.CustomerName
  121. if s.ControlBy.UpdateBy != 0 {
  122. m.UpdateBy = s.UpdateBy
  123. }
  124. if s.ControlBy.CreateBy != 0 {
  125. m.CreateBy = s.CreateBy
  126. }
  127. }
  128. func (s *WaybillUpdateReq) GetId() interface{} {
  129. return s.Id
  130. }
  131. type WaybillDeliveryReq struct {
  132. WaybillIds []int `json:"waybillIds"` // 运单id
  133. Type int `json:"type"` // 派单类型 3司机 2仓管
  134. PrintUserId int `json:"printUserId"` // 制单人
  135. model2.ControlBy `swaggerignore:"true"`
  136. model2.DeptBy `swaggerignore:"true"`
  137. }
  138. func (s *WaybillDeliveryReq) GetId() interface{} {
  139. return s.WaybillIds
  140. }
  141. type WaybillGetReq struct {
  142. Id int `uri:"id"`
  143. }
  144. func (s *WaybillGetReq) GetId() interface{} {
  145. return s.Id
  146. }
  147. type WaybillDeleteReq struct {
  148. Id int `json:"id"`
  149. common.ControlBy `swaggerignore:"true"`
  150. }
  151. func (s *WaybillDeleteReq) GetId() interface{} {
  152. return s.Id
  153. }
  154. // 运单出入库/上下车
  155. type WaybillInOutReq struct {
  156. StartTime model2.Time `json:"startTime"`
  157. WaybillNoList []string `json:"waybillNoList" gorm:"size:128"` // 订单编号
  158. }
  159. // 运单签收
  160. type WaybillReceiptReq struct {
  161. StartTime model2.Time `json:"startTime"`
  162. WaybillNo string `json:"waybillNo" gorm:"size:128"` // 订单编号
  163. ReceiptImg string `json:"receiptImg" gorm:"size:128"` // 签收图片
  164. }
  165. type WaybillGetAppletPageReq struct {
  166. dto.Pagination `search:"-"`
  167. WaybillNo string `form:"waybillNo" search:"type:contains;column:waybill_no;table:waybill_logistics"` // 运单编号
  168. Status int `form:"status" search:"type:exact;column:status;table:waybill_logistics"` // 状态
  169. WaybillOrder
  170. }
  171. type WaybillGetAppletPageOrder struct {
  172. CreatedAtOrder string `search:"type:order;column:created_at;table:waybill_logistics" form:"createdAtOrder" default:"desc"`
  173. }
  174. func (m *WaybillGetAppletPageReq) GetNeedSearch() interface{} {
  175. return *m
  176. }
  177. type WaybillImportReq struct {
  178. CustomerName string `form:"customerName"` //下单客户名称
  179. }
  180. type WaybillStatsReq struct {
  181. Date string `form:"date"` // 日期
  182. Type string `form:"type"` // 类型 month-月 year-年
  183. }
  184. type WaybillStatsRes struct {
  185. TodayNum int64 `json:"todayNum"` // 今日总运单数
  186. WaitDeliveryNum int64 `json:"waitDeliveryNum"` // 待派单
  187. WaitTruckNum int64 `json:"waitTruckNum"` // 未装车
  188. WaitStorageNum int64 `json:"waitStorageNum"` // 未入库
  189. InDeliveryNum int64 `json:"inDeliveryNum"` // 运送中
  190. ThisMonthNum int64 `json:"thisMonthNum"` // 本月运单数
  191. LastMonthNum int64 `json:"lastMonthNum"` // 上月运单数
  192. ThisYearNum int64 `json:"thisYearNum"` // 本年运单数
  193. LastYearNum int64 `json:"lastYearNum"` // 上年运单数
  194. Stats []struct {
  195. Date string `json:"date"` // 日期 2024-01-01
  196. Num int64 `json:"num"` // 数量
  197. } `json:"stats"`
  198. }
  199. type WaybillGetByWaybillNoReq struct {
  200. WaybillNo string `form:"waybillNo" vd:"len($)>0;msg:'订单编号不能为空'"` // 运单编号-必填
  201. }
  202. type WaybillGetByWaybillPdfReq struct {
  203. WaybillNo string `form:"waybillNo" vd:"len($)>0;msg:'订单编号不能为空'"` // 运单编号-必填
  204. HumidityShow bool `form:"humidityShow" vd:""` // 湿度显示
  205. //TemplateShow bool `form:"templateShow" vd:""` // 湿度显示
  206. }