- 去掉dao对于jxutils的依赖
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"git.rosy.net.cn/jx-callback/globals/refutil"
|
||||
)
|
||||
|
||||
type LoopStoreMapInfo struct {
|
||||
@@ -134,7 +135,7 @@ func (v *VendorSync) syncCategories(ctx *jxcontext.Context, parentTask tasksch.I
|
||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
cat := batchItemList[0].(*model.SkuCategory)
|
||||
updateFields := []string{syncStatusFieldName}
|
||||
syncStatus := jxutils.GetObjFieldByName(cat, syncStatusFieldName).(int8)
|
||||
syncStatus := refutil.GetObjFieldByName(cat, syncStatusFieldName).(int8)
|
||||
if (syncStatus & model.SyncFlagDeletedMask) != 0 { //删除
|
||||
err = multiStoresHandler.DeleteCategory(db, cat, userName)
|
||||
} else if (syncStatus & model.SyncFlagNewMask) != 0 { // 新增
|
||||
@@ -147,7 +148,7 @@ func (v *VendorSync) syncCategories(ctx *jxcontext.Context, parentTask tasksch.I
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
jxutils.SetObjFieldByName(cat, syncStatusFieldName, int8(0))
|
||||
refutil.SetObjFieldByName(cat, syncStatusFieldName, int8(0))
|
||||
_, err = dao.UpdateEntity(db, cat, updateFields...)
|
||||
}
|
||||
return nil, err
|
||||
@@ -274,7 +275,7 @@ func (v *VendorSync) SyncSku(ctx *jxcontext.Context, db *dao.DaoDB, nameID, skuI
|
||||
ORDER BY IF(spec_unit IN('kg', 'L'), 1000, 1) * spec_quality
|
||||
`, dbField), skuName.ID); err == nil && len(skuList) > 0 {
|
||||
for _, sku := range skuList {
|
||||
syncStatus := jxutils.GetObjFieldByName(sku, syncStatusFieldName).(int8)
|
||||
syncStatus := refutil.GetObjFieldByName(sku, syncStatusFieldName).(int8)
|
||||
globals.SugarLogger.Debugf("SyncSku trackInfo:%s, skuID:%d, syncStatus:%d", ctx.GetTrackInfo(), sku.ID, syncStatus)
|
||||
if (skuID == -1 || skuID == sku.ID) && (syncStatus != 0) {
|
||||
updateFields := []string{syncStatusFieldName}
|
||||
@@ -296,7 +297,7 @@ func (v *VendorSync) SyncSku(ctx *jxcontext.Context, db *dao.DaoDB, nameID, skuI
|
||||
err = multiStoresHandler.UpdateSku(db, sku, userName)
|
||||
}
|
||||
if err == nil {
|
||||
jxutils.SetObjFieldByName(sku, syncStatusFieldName, int8(0))
|
||||
refutil.SetObjFieldByName(sku, syncStatusFieldName, int8(0))
|
||||
if _, err = dao.UpdateEntity(db, sku, updateFields...); err != nil {
|
||||
break
|
||||
}
|
||||
@@ -305,7 +306,7 @@ func (v *VendorSync) SyncSku(ctx *jxcontext.Context, db *dao.DaoDB, nameID, skuI
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
jxutils.SetObjFieldByName(skuName, syncStatusFieldName, int8(0))
|
||||
refutil.SetObjFieldByName(skuName, syncStatusFieldName, int8(0))
|
||||
_, err = dao.UpdateEntity(db, skuName, syncStatusFieldName)
|
||||
}
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user