shan
This commit is contained in:
@@ -4,10 +4,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
)
|
||||
|
||||
type SyncErrResult struct {
|
||||
@@ -44,16 +40,6 @@ type SpecSyncError struct {
|
||||
SpecErr error `json:"specErr"`
|
||||
}
|
||||
|
||||
// 对于多门店平台接口的通用处理
|
||||
type MultiStoreHandlerWrapper struct {
|
||||
partner.IMultipleStoresHandler
|
||||
}
|
||||
|
||||
// 对于单门店平台接口的通用处理
|
||||
type SingleStoreHandlerWrapper struct {
|
||||
partner.ISingleStoreHandler
|
||||
}
|
||||
|
||||
var (
|
||||
CurVendorSync VendorSync
|
||||
)
|
||||
@@ -75,38 +61,6 @@ var (
|
||||
syncErrResultLock SyncErrResultLock
|
||||
)
|
||||
|
||||
func buildErrMsg(task tasksch.ITask) (err error) {
|
||||
err = fmt.Errorf(utils.Format4Output(buildErrMsgJson(task), true))
|
||||
return makeSpecSyncError(err)
|
||||
}
|
||||
|
||||
func buildErrMsgJson(task tasksch.ITask) (resultL []*SyncErrResult) {
|
||||
failedList := task.GetFailedList()
|
||||
for _, v := range failedList {
|
||||
for _, vv := range v.([]*partner.StoreSkuInfoWithErr) {
|
||||
result := &SyncErrResult{
|
||||
SkuID: 0,
|
||||
StoreID: vv.StoreID,
|
||||
CategoryName: vv.CategoryName,
|
||||
VendorName: vv.VendoreName,
|
||||
VendorSkuID: "",
|
||||
NameID: 0,
|
||||
VendorPrice: 0,
|
||||
SyncType: vv.SyncType,
|
||||
ErrMsg: vv.ErrMsg,
|
||||
}
|
||||
if vv.StoreSkuInfo != nil {
|
||||
result.SkuID = vv.StoreSkuInfo.SkuID
|
||||
result.VendorSkuID = vv.StoreSkuInfo.VendorSkuID
|
||||
result.NameID = vv.StoreSkuInfo.NameID
|
||||
result.VendorPrice = vv.StoreSkuInfo.VendorPrice
|
||||
}
|
||||
resultL = append(resultL, result)
|
||||
}
|
||||
}
|
||||
return resultL
|
||||
}
|
||||
|
||||
func makeSyncError(err error) (newErr error) {
|
||||
if err != nil {
|
||||
if _, ok := err.(*SyncError); !ok {
|
||||
|
||||
Reference in New Issue
Block a user