-
Notifications
You must be signed in to change notification settings - Fork 12
/
BatchStockPublishDto.go
58 lines (53 loc) · 2.18 KB
/
BatchStockPublishDto.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package wdk
import (
"sync"
)
// BatchStockPublishDto 结构体
type BatchStockPublishDto struct {
// 子参数列表
StockPublishDtos []StockPublishDto `json:"stock_publish_dtos,omitempty" xml:"stock_publish_dtos>stock_publish_dto,omitempty"`
// 外部单据号(幂等),理解为一次请求提交
BillNo string `json:"bill_no,omitempty" xml:"bill_no,omitempty"`
// 发布来源,取商家编码
PublishSource string `json:"publish_source,omitempty" xml:"publish_source,omitempty"`
// 仓编码(废弃)
WarehouseCode string `json:"warehouse_code,omitempty" xml:"warehouse_code,omitempty"`
// 经营店编码(必须)
ShopCode string `json:"shop_code,omitempty" xml:"shop_code,omitempty"`
// 渠道店编号(废弃)
ChannelSourceId string `json:"channel_source_id,omitempty" xml:"channel_source_id,omitempty"`
// 操作者
Operator string `json:"operator,omitempty" xml:"operator,omitempty"`
// 更新类型,全量1,增量2
UpdateType int64 `json:"update_type,omitempty" xml:"update_type,omitempty"`
// 外部单据类型,9001大润发 9002欧尚 9003三江 9005 文峰 9007美特好
BillType int64 `json:"bill_type,omitempty" xml:"bill_type,omitempty"`
// 渠道店类型(废弃)
ChannelSourceType int64 `json:"channel_source_type,omitempty" xml:"channel_source_type,omitempty"`
// 是否已扣除未批次数,用于全量发布
UnBatchedOrderStockSubtracted bool `json:"un_batched_order_stock_subtracted,omitempty" xml:"un_batched_order_stock_subtracted,omitempty"`
}
var poolBatchStockPublishDto = sync.Pool{
New: func() any {
return new(BatchStockPublishDto)
},
}
// GetBatchStockPublishDto() 从对象池中获取BatchStockPublishDto
func GetBatchStockPublishDto() *BatchStockPublishDto {
return poolBatchStockPublishDto.Get().(*BatchStockPublishDto)
}
// ReleaseBatchStockPublishDto 释放BatchStockPublishDto
func ReleaseBatchStockPublishDto(v *BatchStockPublishDto) {
v.StockPublishDtos = v.StockPublishDtos[:0]
v.BillNo = ""
v.PublishSource = ""
v.WarehouseCode = ""
v.ShopCode = ""
v.ChannelSourceId = ""
v.Operator = ""
v.UpdateType = 0
v.BillType = 0
v.ChannelSourceType = 0
v.UnBatchedOrderStockSubtracted = false
poolBatchStockPublishDto.Put(v)
}