This commit is contained in:
邹宗楠
2023-07-03 15:54:59 +08:00
parent d19af94f44
commit 10a24a9cd9
3 changed files with 42 additions and 40 deletions

View File

@@ -192,26 +192,27 @@ func (o *GoodsOrderOriginal) TableUnique() [][]string {
} }
type OrderSku struct { type OrderSku struct {
ID int64 `orm:"column(id)" json:"id"` ID int64 `orm:"column(id)" json:"id"`
VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"` VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
VendorID int `orm:"column(vendor_id)" json:"vendorID"` VendorSubOrderID string `orm:"column(vendor_sub_order_id);size(48)" json:"vendorSubOrderID"` // 子订单id
StoreSubID int `orm:"column(store_sub_id)" json:"storeSubID"` // EarningActID当前这个字段被当成结算活动ID用 VendorID int `orm:"column(vendor_id)" json:"vendorID"`
StoreSubName string `orm:"size(64)" json:"storeSubName"` // 当前这个字段被用作vendorActType StoreSubID int `orm:"column(store_sub_id)" json:"storeSubID"` // EarningActID当前这个字段被当成结算活动ID用
Count int `json:"count"` StoreSubName string `orm:"size(64)" json:"storeSubName"` // 当前这个字段被用作vendorActType
VendorSkuID string `orm:"column(vendor_sku_id);size(48)" json:"vendorSkuID"` Count int `json:"count"`
SkuID int `orm:"column(sku_id)" json:"skuID"` // 外部系统里记录的 jxskuid VendorSkuID string `orm:"column(vendor_sku_id);size(48)" json:"vendorSkuID"`
JxSkuID int `orm:"column(jx_sku_id)" json:"jxSkuID"` // 根据VendorSkuID在本地系统里查询出来的 jxskuid SkuID int `orm:"column(sku_id)" json:"skuID"` // 外部系统里记录的 jxskuid
SkuName string `orm:"size(255)" json:"skuName"` JxSkuID int `orm:"column(jx_sku_id)" json:"jxSkuID"` // 根据VendorSkuID在本地系统里查询出来的 jxskuid
ShopPrice int64 `json:"shopPrice"` // 京西价 SkuName string `orm:"size(255)" json:"skuName"`
VendorPrice int64 `json:"vendorPrice"` // 平台 ShopPrice int64 `json:"shopPrice"` // 京西
SalePrice int64 `json:"salePrice"` // 售卖 VendorPrice int64 `json:"vendorPrice"` // 平台
EarningPrice int64 `json:"earningPrice"` // 活动商品设置结算给门店老板的钱如果结算活动ID为0是按结算比例算的否则就是结算表中的值 SalePrice int64 `json:"salePrice"` // 售卖价
Weight int `json:"weight"` // 单位为克 EarningPrice int64 `json:"earningPrice"` // 活动商品设置结算给门店老板的钱如果结算活动ID为0是按结算比例算的否则就是结算表中的值
SkuType int `json:"skuType"` // 当前如果为gift就为1否则缺省为0 Weight int `json:"weight"` // 单位为克
PromotionType int `json:"promotionType"` // todo 当前是用于记录京东的PromotionType(生成jxorder用),没有做转换 SkuType int `json:"skuType"` // 当前如果为gift就为1否则缺省为0
OrderCreatedAt time.Time `orm:"type(datetime);index" json:"-"` // 分区考虑 PromotionType int `json:"promotionType"` // todo 当前是用于记录京东的PromotionType(生成jxorder用),没有做转换
IsVendorAct int `json:"isVendorAct"` OrderCreatedAt time.Time `orm:"type(datetime);index" json:"-"` // 分区考虑
Upc string `json:"upc"` //upc码 IsVendorAct int `json:"isVendorAct"`
Upc string `json:"upc"` //upc码
} }
// 同样商品在一个订单中可能重复出现(比如搞活动时,相同商品价格不一样,第一个有优惠) // 同样商品在一个订单中可能重复出现(比如搞活动时,相同商品价格不一样,第一个有优惠)

View File

@@ -103,25 +103,26 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
if len(*orderDetail.SubOrderResponseList) > 0 { if len(*orderDetail.SubOrderResponseList) > 0 {
for _, extra := range *orderDetail.SubOrderResponseList { for _, extra := range *orderDetail.SubOrderResponseList {
sku := &model.OrderSku{ sku := &model.OrderSku{
VendorOrderID: order.VendorOrderID, VendorOrderID: order.VendorOrderID,
VendorID: model.VendorIDTaoVegetable, VendorID: model.VendorIDTaoVegetable,
StoreSubID: 0, StoreSubID: 0,
StoreSubName: "", StoreSubName: "",
Count: utils.Float64TwoInt(*extra.BuySaleQuantity), Count: utils.Float64TwoInt(*extra.BuySaleQuantity),
VendorSkuID: *extra.SkuCode, VendorSkuID: *extra.SkuCode,
SkuID: utils.Str2Int(*extra.SkuCode), SkuID: utils.Str2Int(*extra.SkuCode),
JxSkuID: utils.Str2Int(*extra.SkuCode), JxSkuID: utils.Str2Int(*extra.SkuCode),
SkuName: *extra.SkuName, SkuName: *extra.SkuName,
ShopPrice: *extra.Price, ShopPrice: *extra.Price,
VendorPrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity), VendorPrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity),
SalePrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity), SalePrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity),
EarningPrice: 0, EarningPrice: 0,
Weight: int(*extra.Weight / utils.Float64TwoInt64(*extra.BuySaleQuantity)), Weight: int(*extra.Weight / utils.Float64TwoInt64(*extra.BuySaleQuantity)),
SkuType: 0, SkuType: 0,
PromotionType: 0, PromotionType: 0,
OrderCreatedAt: order.OrderCreatedAt, OrderCreatedAt: order.OrderCreatedAt,
IsVendorAct: 0, IsVendorAct: 0,
Upc: *extra.Barcode, Upc: *extra.Barcode,
VendorSubOrderID: utils.Int64ToStr(*extra.BizSubOrderId),
} }
activityId := make([]int64, 0) activityId := make([]int64, 0)

View File

@@ -33,7 +33,7 @@ func orderStatusChangeNotice(order *model.GoodsOrder, orderStatus string) (*requ
} }
for _, v := range skuList { for _, v := range skuList {
workCallbackSubOrderInfo := domain591.AlibabaAelophyOrderWorkCallbackWorkCallbackSubOrderInfo{ workCallbackSubOrderInfo := domain591.AlibabaAelophyOrderWorkCallbackWorkCallbackSubOrderInfo{
BizSubOrderId: nil, BizSubOrderId: utils.Int64ToPointer(utils.Str2Int64(v.VendorSubOrderID)),
SkuCode: utils.String2Pointer(v.VendorSkuID), SkuCode: utils.String2Pointer(v.VendorSkuID),
PickSaleQuantity: utils.String2Pointer(utils.Int2Str(v.Count)), PickSaleQuantity: utils.String2Pointer(utils.Int2Str(v.Count)),
PickStockQuantity: utils.String2Pointer(utils.Int2Str(v.Count)), PickStockQuantity: utils.String2Pointer(utils.Int2Str(v.Count)),