同步错误返回

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