123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- package dto
- import (
- "cold-logistics/app/admin/model"
- "cold-logistics/common/dto"
- common "cold-logistics/common/model"
- model2 "cold-logistics/common/model"
- "time"
- )
- // 运单
- type WaybillGetPageReq struct {
- dto.Pagination `search:"-"`
- WaybillNo string `form:"waybillNo" search:"type:contains;column:waybill_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"` // 运单编号
- 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"` //单号
- Status int `json:"status" swaggerignore:"true"` //运单状态:1-待处理;102-待装车 103-运输中 104-已签收
- SenderAddressDetails string `json:"senderAddressDetails"` //发货地址详情
- SenderAddressName string `json:"senderAddressName"` //发货地址名称
- SenderAddressPhone string `json:"senderAddressPhone" vd:"regexp('^1[3-9]\\d{9}$');msg:'寄件人电话格式不正确'"` //发货地址电话
- ConsigneeAddressDetails string `json:"consigneeAddressDetails"` //收发货地址详情
- ConsigneeAddressName string `json:"consigneeAddressName"` //收发货地址名称
- ConsigneeAddressPhone string `json:"consigneeAddressPhone" vd:"regexp('^1[3-9]\\d{9}$');msg:'收件人电话格式不正确'"` //收发货地址电话
- CargoType string `json:"cargoType"` //货物类型
- TemperatureInterval string `json:"temperatureInterval"` //温度要求
- DeliveryCondition string `json:"deliveryCondition"` //配送要求
- Quantity int `json:"quantity"` //药品数量
- Remark string `json:"remark"` //运输备注
- CustomerId int `json:"customerId"` //下单客户id
- CustomerName string `json:"customerName"` //下单客户名称
- 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.SenderAddressDetails = s.SenderAddressDetails
- m.SenderAddressName = s.SenderAddressName
- m.SenderAddressPhone = s.SenderAddressPhone
- m.ConsigneeAddressDetails = s.ConsigneeAddressDetails
- m.ConsigneeAddressName = s.ConsigneeAddressName
- m.ConsigneeAddressPhone = s.ConsigneeAddressPhone
- m.CargoType = s.CargoType
- m.TemperatureInterval = s.TemperatureInterval
- m.DeliveryCondition = s.DeliveryCondition
- m.Quantity = s.Quantity
- m.Remark = s.Remark
- m.CustomerId = s.CustomerId
- m.CustomerName = s.CustomerName
- 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"` // 编码
- SenderAddressDetails string `json:"senderAddressDetails"` //发货地址详情
- SenderAddressName string `json:"senderAddressName"` //发货地址名称
- SenderAddressPhone string `json:"senderAddressPhone"` //发货地址电话
- ConsigneeAddressDetails string `json:"consigneeAddressDetails"` //收发货地址详情
- ConsigneeAddressName string `json:"consigneeAddressName"` //收发货地址名称
- ConsigneeAddressPhone string `json:"consigneeAddressPhone"` //收发货地址电话
- CargoType string `json:"cargoType"` //货物类型
- TemperatureInterval string `json:"temperatureInterval"` //温度要求
- DeliveryCondition string `json:"deliveryCondition"` //配送要求
- Quantity int `json:"quantity"` //药品数量
- Remark string `json:"remark"` //运输备注
- CustomerName string `json:"customerName"` //下单客户名称
- model2.ControlBy `swaggerignore:"true"`
- model2.DeptBy `swaggerignore:"true"`
- }
- func (s *WaybillUpdateReq) Generate(m *model.Waybill) {
- if s.Id != 0 {
- m.Id = s.Id
- }
- m.SenderAddressDetails = s.SenderAddressDetails
- m.SenderAddressName = s.SenderAddressName
- m.SenderAddressPhone = s.SenderAddressPhone
- m.ConsigneeAddressDetails = s.ConsigneeAddressDetails
- m.ConsigneeAddressName = s.ConsigneeAddressName
- m.ConsigneeAddressPhone = s.ConsigneeAddressPhone
- m.CargoType = s.CargoType
- m.TemperatureInterval = s.TemperatureInterval
- m.DeliveryCondition = s.DeliveryCondition
- m.Quantity = s.Quantity
- m.Remark = s.Remark
- m.CustomerName = s.CustomerName
- 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 WaybillDeliveryReq struct {
- WaybillIds []int `json:"waybillIds"` // 运单id
- Type int `json:"type"` // 派单类型 3司机 2仓管 4保温箱
- PrintUserId int `json:"printUserId"` // 制单人
- CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
- model2.ControlBy `swaggerignore:"true"`
- model2.DeptBy `swaggerignore:"true"`
- }
- func (s *WaybillDeliveryReq) GetId() interface{} {
- return s.WaybillIds
- }
- type WaybillGetReq struct {
- WaybillNo string `uri:"waybillNo"`
- }
- 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 WaybillCoolerBoxInReq struct {
- StartTime model2.Time `json:"startTime"`
- WaybillNoList []string `json:"waybillNoList" ` // 运单编号
- CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
- }
- // 运单签收
- type WaybillReceiptReq struct {
- StartTime model2.Time `json:"startTime"`
- WaybillNo string `json:"waybillNo" gorm:"size:128"` // 运单编号
- ReceiptImg string `json:"receiptImg" gorm:"size:128"` // 签收图片
- }
- type WaybillStopRecordReq struct {
- StartTime model2.Time `json:"startTime"`
- WaybillNo string `json:"waybillNo" gorm:"size:128"` // 运单编号
- }
- 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 WaybillStatsRes struct {
- TodayNum int64 `json:"todayNum"` // 今日总运单数
- WaitDeliveryNum int64 `json:"waitDeliveryNum"` // 待派单
- WaitTruckNum int64 `json:"waitTruckNum"` // 未装车
- WaitStorageNum int64 `json:"waitStorageNum"` // 未入库
- WaitVanningNum int64 `json:"waitVanningNum"` // 未装箱
- InDeliveryNum int64 `json:"inDeliveryNum"` // 运送中
- ThisMonthNum int64 `json:"thisMonthNum"` // 本月运单数
- LastMonthNum int64 `json:"lastMonthNum"` // 上月运单数
- ThisYearNum int64 `json:"thisYearNum"` // 本年运单数
- LastYearNum int64 `json:"lastYearNum"` // 上年运单数
- Stats []struct {
- Date string `json:"date"` // 日期 2024-01-01
- Num int64 `json:"num"` // 数量
- } `json:"stats"`
- }
- type WaybillGetByWaybillNoReq struct {
- WaybillNo string `form:"waybillNo" vd:"len($)>0;msg:'运单编号不能为空'"` // 运单编号-必填
- }
- type WaybillPdfReq struct {
- WaybillNo string `form:"waybillNo" vd:"len($)>0;msg:'运单编号不能为空'"` // 运单编号-必填
- WaybillTaskIds []int `form:"waybillTaskIds" vd:""` // 运单任务id
- }
- type WaybillGetByWaybillPdfReq struct {
- WaybillNo string `form:"waybillNo" vd:"len($)>0;msg:'运单编号不能为空'"` // 运单编号-必填
- HumidityShow bool `form:"humidityShow" vd:""` // 湿度显示
- WaybillTaskIds []int `form:"waybillTaskIds" vd:""` // 运单任务id
- //TemplateShow bool `form:"templateShow" vd:""` // 湿度显示
- }
- type WaybillSendMailPdfReq struct {
- WaybillNo string `form:"waybillNo" vd:"len($)>0;msg:'运单编号不能为空'"` // 运单编号-必填
- HumidityShow bool `form:"humidityShow" vd:""` // 湿度显示
- WaybillTaskIds []int `form:"waybillTaskIds" vd:""` // 运单任务id
- To []string `form:"to" vd:""` // 收件人
- }
- type WaybillLogisticsUpdateReq struct {
- WaybillLogisticsList []struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- Time model2.Time `json:"time" gorm:"size:128"` // 开始时间
- } `json:"waybillLogistics"`
- model2.ControlBy `swaggerignore:"true"`
- model2.DeptBy `swaggerignore:"true"`
- }
|