- jdSyncStatus in Convert2JDSPU
This commit is contained in:
@@ -167,8 +167,8 @@ func GetStoreMessageStatuses(ctx *jxcontext.Context, msgIDs, storeIDs []int, fro
|
||||
dao.Begin(db)
|
||||
defer dao.Commit(db)
|
||||
var msgStatusList []*model.MessageStatus
|
||||
globals.SugarLogger.Debug(sql)
|
||||
globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
||||
if err = dao.GetRows(db, &msgStatusList, sql, sqlParams...); err == nil {
|
||||
pagedInfo = &model.PagedInfo{
|
||||
TotalCount: dao.GetLastTotalRowCount(db),
|
||||
|
||||
@@ -203,7 +203,7 @@ func Convert2JDSPU(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (h
|
||||
LEFT JOIN sku_name t2 ON t1.link_id = t2.id
|
||||
WHERE t1.deleted_at = ? AND t1.status <> ? AND t1.is_spu = 0 AND t1.unit = '份'
|
||||
AND t2.id IS NULL
|
||||
;
|
||||
LIMIT 1;
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
@@ -252,6 +252,8 @@ func Convert2JDSPU(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (h
|
||||
skuNameNew.JdID = 0
|
||||
skuNameNew.LinkID = skuName.ID
|
||||
skuNameNew.IsSpu = 1
|
||||
skuNameNew.JdSyncStatus = model.SyncFlagNewMask
|
||||
skuNameNew.Status = model.SkuStatusDontSale
|
||||
if err = dao.CreateEntity(db, skuNameNew); err != nil {
|
||||
dao.Rollback(db)
|
||||
return "", err
|
||||
@@ -263,6 +265,7 @@ func Convert2JDSPU(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (h
|
||||
skuNew.JdID = jxutils.GenFakeID()
|
||||
skuNew.LinkID = sku.ID
|
||||
skuNew.NameID = skuNameNew.ID
|
||||
skuNew.JdSyncStatus = model.SyncFlagNewMask
|
||||
if err = dao.CreateEntity(db, skuNew); err != nil {
|
||||
dao.Rollback(db)
|
||||
return "", err
|
||||
@@ -287,7 +290,6 @@ func Convert2JDSPU(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (h
|
||||
if err = dao.GetRows(db, &skuNameList, sql); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
rootTask := tasksch.NewParallelTask("Convert2JDSPU", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx.GetUserName(), func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
skuName := batchItemList[0].(*model.SkuName)
|
||||
_, err = cms.CurVendorSync.SyncSku(ctx, db, skuName.ID, -1, false, ctx.GetUserName())
|
||||
|
||||
Reference in New Issue
Block a user