同步错误返回

This commit is contained in:
苏尹岚
2020-01-07 18:02:14 +08:00
parent 86e783a4d0
commit e53df61baa

View File

@@ -21,14 +21,15 @@ import (
)
type SyncErrResult struct {
SkuID int `json:"商品ID"`
StoreID int `json:"门店ID"`
VendorID int `json:"平台ID"`
VendorSkuID string `json:"平台商品ID"`
NameID int `json:"商品nameID"`
VendorPrice int64 `json:"平台价"`
SyncType string `json:"同步类型"`
ErrMsg string `json:"错误信息"`
SkuID int `json:"商品ID"`
CategoryName string `json:"分类名"`
StoreID int `json:"门店ID"`
VendorID int `json:"平台ID"`
VendorSkuID string `json:"平台商品ID"`
NameID int `json:"商品nameID"`
VendorPrice int64 `json:"平台价"`
SyncType string `json:"同步类型"`
ErrMsg string `json:"错误信息"`
}
type SyncErrResultLock struct {
@@ -68,6 +69,7 @@ var (
ErrEntityNotExist = errors.New("找不到相应实体")
SyncErrResultTitle = []string{
"商品ID",
"分类名",
"门店ID",
"平台ID",
"平台商品ID",
@@ -820,14 +822,15 @@ func WirteToExcelBySyncFailed(task tasksch.ITask, ctx *jxcontext.Context) (err e
for _, v := range failedList {
for _, vv := range v.([]*partner.StoreSkuInfoWithErr) {
result := SyncErrResult{
SkuID: vv.StoreSkuInfo.SkuID,
StoreID: vv.StoreID,
VendorID: vv.VendoreID,
VendorSkuID: vv.StoreSkuInfo.VendorSkuID,
NameID: vv.StoreSkuInfo.NameID,
VendorPrice: vv.StoreSkuInfo.VendorPrice,
SyncType: vv.SyncType,
ErrMsg: vv.ErrMsg,
SkuID: vv.StoreSkuInfo.SkuID,
CategoryName: vv.CategoryName,
StoreID: vv.StoreID,
VendorID: vv.VendoreID,
VendorSkuID: vv.StoreSkuInfo.VendorSkuID,
NameID: vv.StoreSkuInfo.NameID,
VendorPrice: vv.StoreSkuInfo.VendorPrice,
SyncType: vv.SyncType,
ErrMsg: vv.ErrMsg,
}
syncErrResultLock.AppendData(result)
}