实验StoreSkuAct
This commit is contained in:
@@ -33,6 +33,8 @@ func (p *PurchaseHandler) GetStoreSkusBatchSize(funcID int) (batchSize int) {
|
||||
batchSize = 1
|
||||
case partner.FuncGetStoreSkusFullInfo:
|
||||
batchSize = 1
|
||||
case partner.FuncCreateActs, partner.FuncCancelActs:
|
||||
batchSize = 1
|
||||
}
|
||||
return batchSize
|
||||
}
|
||||
@@ -460,3 +462,33 @@ func SelectStoreSkuListByOpResult(storeSkuList []*partner.StoreSkuInfo, opResult
|
||||
}
|
||||
return selectedStoreSkuList
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) CreateStoreSkusAct(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
for _, v := range storeSkuList {
|
||||
if vendorActID, err2 := createOneShopAct(putils.GetFixDirectDownAct(storeID, v.SkuID), utils.Int2Str(storeID), putils.StoreSku2ActStoreSku([]*partner.StoreSkuInfo{v})); err2 != nil {
|
||||
failedList = append(failedList, &partner.StoreSkuInfoWithErr{
|
||||
StoreSkuInfo: v,
|
||||
VendoreID: model.VendorIDJD,
|
||||
StoreID: storeID,
|
||||
ErrMsg: err.Error(),
|
||||
})
|
||||
} else {
|
||||
v.VendorActID = vendorActID
|
||||
}
|
||||
}
|
||||
return failedList, err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) CancelActs(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
for _, v := range storeSkuList {
|
||||
if err2 := ActivityDisable(utils.Str2Int64(v.VendorActID), utils.Int2Str(storeID), 0, 0); err2 != nil {
|
||||
failedList = append(failedList, &partner.StoreSkuInfoWithErr{
|
||||
StoreSkuInfo: v,
|
||||
VendoreID: model.VendorIDJD,
|
||||
StoreID: storeID,
|
||||
ErrMsg: err.Error(),
|
||||
})
|
||||
}
|
||||
}
|
||||
return failedList, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user