123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- package dto
- import (
- "cold-delivery/app/admin/model"
- "cold-delivery/common/dto"
- common "cold-delivery/common/model"
- model2 "cold-delivery/common/model"
- "time"
- )
- // 运单
- type WaybillGetPageReq struct {
- dto.Pagination `search:"-"`
- WaybillNo string `form:"waybillNo" search:"type:contains;column:waybill_no;table:waybill"` // 运单编号
- OrderNo string `form:"orderNo" search:"type:contains;column:order_no;table:waybill"` // 运单编号
- Status int `form:"status" search:"type:exact;column:status;table:waybill"` // 状态
- OrderStartTime string `form:"orderStartTime" search:"type:gte;column:order_time;table:waybill"` // 下单开始时间
- OrderEndTime string `form:"orderEndTime" search:"type:lte;column:order_time;table:waybill"` // 下单结束时间
- WaybillOrder
- }
- type WaybillOrder struct {
- CreatedAtOrder string `search:"type:order;column:created_at;table:waybill" form:"createdAtOrder" default:"desc"`
- }
- func (m *WaybillGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type WaybillGetCustomerPageReq struct {
- dto.Pagination `search:"-"`
- WaybillNo string `form:"waybillNo" search:"type:contains;column:waybill_no;table:waybill"` // 运单编号
- OrderNo string `form:"orderNo" search:"type:contains;column:order_no;table:waybill"` // 运单编号
- Status int `form:"status" search:"-"` // 状态
- OrderStartTime string `form:"orderStartTime" search:"type:gte;column:order_time;table:waybill"` // 下单开始时间
- OrderEndTime string `form:"orderEndTime" search:"type:lte;column:order_time;table:waybill"` // 下单结束时间
- CustomerId int `form:"customerId" search:"type:exact;column:customer_id;table:waybill" swaggerignore:"true"` // 客户id
- WaybillOrder
- }
- func (m *WaybillGetCustomerPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type WaybillInsertReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- No string `json:"no" swaggerignore:"true"` //单号
- OrderNo string `json:"orderNo"` // 订单号
- Status int `json:"status" swaggerignore:"true"` //订单状态:1-待处理;102-待装车 103-运输中 104-已签收
- SaveConsigneeAddress bool `json:"SaveConsigneeAddress"` //保存收货地址
- ConsigneeAddressDetails string `json:"consigneeAddressDetails"` //收发货地址详情
- ConsigneeAddressName string `json:"consigneeAddressName"` //收发货地址名称
- ConsigneeAddressPhone string `json:"consigneeAddressPhone" vd:"regexp('^1[3-9]\\d{9}$');msg:'收件人电话格式不正确'"` //收发货地址电话
- DeliveryName string `json:"deliveryName"` // 配送姓名
- DeliveryPhone string `json:"deliveryPhone"` // 配送电话
- DeliveryId int `json:"deliveryId"` // 配送人id
- ReCheckId int `json:"reCheckId"` // 复核人id
- Quantity int `json:"quantity"` // 药品数量
- Remark string `json:"remark"` // 运输备注
- TamperProofLabel string `json:"tamperProofLabel"` // 防拆码标签
- TamperProofLabelImg string `json:"tamperProofLabelImg"` // 防拆码标签图片
- CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
- model2.ControlBy `swaggerignore:"true"`
- model2.DeptBy
- }
- func (s *WaybillInsertReq) Generate(m *model.Waybill) {
- if s.Id != 0 {
- m.Id = s.Id
- }
- m.Status = 1
- m.OrderNo = s.OrderNo
- m.ConsigneeAddressDetails = s.ConsigneeAddressDetails
- m.ConsigneeAddressName = s.ConsigneeAddressName
- m.ConsigneeAddressPhone = s.ConsigneeAddressPhone
- m.DeliveryName = s.DeliveryName
- m.DeliveryPhone = s.DeliveryPhone
- m.DeliveryId = s.DeliveryId
- m.ReCheckId = s.ReCheckId
- m.Quantity = s.Quantity
- m.Remark = s.Remark
- m.TamperProofLabel = s.TamperProofLabel
- m.TamperProofLabelImg = s.TamperProofLabelImg
- m.CoolerBoxId = s.CoolerBoxId
- m.OrderTime = model2.Time(time.Now())
- if s.ControlBy.UpdateBy != 0 {
- m.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- m.CreateBy = s.CreateBy
- }
- if s.DeptBy.DeptId != 0 {
- m.DeptId = s.DeptId
- }
- }
- func (s *WaybillInsertReq) GetId() interface{} {
- return s.Id
- }
- type WaybillUpdateReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- OrderNo string `json:"orderNo"`
- ConsigneeAddressDetails string `json:"consigneeAddressDetails"` //收发货地址详情
- ConsigneeAddressName string `json:"consigneeAddressName"` //收发货地址名称
- ConsigneeAddressPhone string `json:"consigneeAddressPhone"` //收发货地址电话
- DeliveryName string `json:"deliveryName"` // 配送姓名
- DeliveryPhone string `json:"deliveryPhone"` // 配送电话
- DeliveryId int `json:"deliveryId"` // 配送id
- ReCheckId int `json:"reCheckId"` // 复核人id
- TamperProofLabel string `json:"tamperProofLabel"` //防拆标签
- TamperProofLabelImg string `json:"tamperProofLabelImg"` //防拆码标签图片
- DeliveryCondition string `json:"deliveryCondition"` //配送要求
- Quantity int `json:"quantity"` //药品数量
- Remark string `json:"remark"` //运输备注
- CoolerBoxId int `json:"coolerBoxId"` //保温箱id
- model2.ControlBy `swaggerignore:"true"`
- model2.DeptBy `swaggerignore:"true"`
- }
- func (s *WaybillUpdateReq) Generate(m *model.Waybill) {
- if s.Id != 0 {
- m.Id = s.Id
- }
- m.OrderNo = s.OrderNo
- m.ConsigneeAddressDetails = s.ConsigneeAddressDetails
- m.ConsigneeAddressName = s.ConsigneeAddressName
- m.ConsigneeAddressPhone = s.ConsigneeAddressPhone
- m.DeliveryName = s.DeliveryName
- m.DeliveryPhone = s.DeliveryPhone
- m.DeliveryId = s.DeliveryId
- m.ReCheckId = s.ReCheckId
- m.Quantity = s.Quantity
- m.Remark = s.Remark
- m.TamperProofLabel = s.TamperProofLabel
- m.TamperProofLabelImg = s.TamperProofLabelImg
- if s.CoolerBoxId > 0 {
- m.CoolerBoxId = s.CoolerBoxId
- }
- if s.ControlBy.UpdateBy != 0 {
- m.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- m.CreateBy = s.CreateBy
- }
- }
- func (s *WaybillUpdateReq) GetId() interface{} {
- return s.Id
- }
- type WaybillUpdateStatusReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- Status int `json:"status"` //药品数量
- model2.ControlBy `swaggerignore:"true"`
- model2.DeptBy `swaggerignore:"true"`
- }
- func (s *WaybillUpdateStatusReq) Generate(m *model.Waybill) {
- if s.Id != 0 {
- m.Id = s.Id
- }
- m.Status = s.Status
- if s.ControlBy.UpdateBy != 0 {
- m.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- m.CreateBy = s.CreateBy
- }
- }
- func (s *WaybillUpdateStatusReq) GetId() interface{} {
- return s.Id
- }
- type WaybillDeliveryReq struct {
- WaybillIds []int `json:"waybillIds"` // 运单id
- CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
- IceRaftCode []string `json:"iceRaftCode"` // 冰排code
- OldIceRaftCode []string `json:"oldIceRaftCode" swaggerignore:"true"` // 旧的冰排code
- model2.ControlBy `swaggerignore:"true"`
- model2.DeptBy `swaggerignore:"true"`
- }
- func (s *WaybillDeliveryReq) GetId() interface{} {
- return s.WaybillIds
- }
- type WaybillGetReq struct {
- Id int `uri:"id"`
- }
- func (s *WaybillGetReq) GetId() interface{} {
- return s.Id
- }
- type WaybillDeleteReq struct {
- Id int `json:"id"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *WaybillDeleteReq) GetId() interface{} {
- return s.Id
- }
- // 运单出入库/上下车
- type WaybillInOutReq struct {
- StartTime model2.Time `json:"startTime"`
- WaybillNoList []string `json:"waybillNoList"` // 订单编号
- }
- // 运单签收
- type WaybillReceiptReq struct {
- Status int `json:"status"` // 3 已签收 5 已拒收
- RejectionReason string `json:"rejectionReason"` // 拒收原因
- WaybillNo string `json:"waybillNo"` // 订单编号
- ReceiptImg string `json:"receiptImg"` // 签收图片
- AssessStar int `json:"assessStar"` // 评价星星
- AssessContent string `json:"assessContent"` // 评价内容
- }
- type WaybillGetAppletPageReq struct {
- dto.Pagination `search:"-"`
- WaybillNo string `form:"waybillNo" search:"type:contains;column:waybill_no;table:waybill_logistics"` // 运单编号
- Status int `form:"status" search:"type:exact;column:status;table:waybill_logistics"` // 状态
- WaybillOrder
- }
- type WaybillGetAppletPageOrder struct {
- CreatedAtOrder string `search:"type:order;column:created_at;table:waybill_logistics" form:"createdAtOrder" default:"desc"`
- }
- func (m *WaybillGetAppletPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type WaybillImportReq struct {
- CustomerName string `form:"customerName"` //下单客户名称
- }
- type WaybillStatsReq struct {
- Date string `form:"date"` // 日期
- Type string `form:"type"` // 类型 month-月 year-年
- }
- type WaybillUserStatsReq struct {
- Date string `form:"date"` // 日期
- Type string `form:"type"` // 类型 month-月 year-年
- UserType string `form:"userType"` // 配送员 delivery-配送员 reCheck-复核员
- UserIds []int `form:"userId"` // 用户id
- }
- type WaybillStats struct {
- Date string `json:"date"` // 日期 2024-01-01
- Num int64 `json:"num"` // 数量
- }
- type WaybillUserStats struct {
- Name string
- Stats []WaybillStats `json:"stats"`
- }
- type WaybillStatsRes struct {
- TodayNum int64 `json:"todayNum"` // 今日总运单数
- WaitDeliveryNum int64 `json:"waitDeliveryNum"` // 已下单
- ReceiptNum int64 `json:"receiptNum"` // 已签收
- RejectionNum int64 `json:"rejectionNum"` // 已拒收
- InDeliveryNum int64 `json:"inDeliveryNum"` // 运送中
- ThisMonthNum int64 `json:"thisMonthNum"` // 本月运单数
- LastMonthNum int64 `json:"lastMonthNum"` // 上月运单数
- ThisYearNum int64 `json:"thisYearNum"` // 本年运单数
- LastYearNum int64 `json:"lastYearNum"` // 上年运单数
- Stats []WaybillStats `json:"stats"`
- }
- type WaybillGetByWaybillNoReq struct {
- WaybillNo string `form:"waybillNo" vd:"len($)>0;msg:'订单编号不能为空'"` // 运单编号-必填
- }
- type WaybillGetByWaybillPdfReq struct {
- WaybillNo string `form:"waybillNo" vd:"len($)>0;msg:'订单编号不能为空'"` // 运单编号-必填
- HumidityShow bool `form:"humidityShow" vd:""` // 湿度显示
- //TemplateShow bool `form:"templateShow" vd:""` // 湿度显示
- }
|