1
This commit is contained in:
@@ -1927,9 +1927,10 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
//panic(r)
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
globals.SugarLogger.Debugf("----------------------------1")
|
||||
for _, storeID := range storeIDs {
|
||||
// todo 可以考虑在需要更新价格再获取
|
||||
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDJX, "")
|
||||
@@ -2004,6 +2005,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
FOR UPDATE`
|
||||
sqlParams = append(sqlParams, utils.DefaultTimeValue)
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
globals.SugarLogger.Debugf("----------------------------2")
|
||||
if err = dao.GetRows(db, &allBinds, sql, sqlParams...); err == nil {
|
||||
if len(allBinds) > 0 {
|
||||
inSkuBinsMap := make(map[int]*StoreSkuBindSkuInfo, len(inSkuBinds))
|
||||
@@ -2165,6 +2167,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
}
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("----------------------------3")
|
||||
// 用了SELECT FOR UPDATE后,只更新修改字段是没有必要的,暂时保留
|
||||
updateFieldMap := make(map[string]interface{})
|
||||
if skuBindInfo.IsFocus == 1 { // 关注之后再关注不操作
|
||||
@@ -2179,6 +2182,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
// updateFieldMap["Price"] = 1
|
||||
}
|
||||
if tmpStatus := getSkuSaleStatus(inSkuBind, skuBindInfo); tmpStatus != model.StoreSkuBindStatusNA {
|
||||
globals.SugarLogger.Debugf("----------------------------4")
|
||||
if tmpStatus != skuBind.Status {
|
||||
updateFieldMap[model.FieldStatus] = 1
|
||||
}
|
||||
@@ -2186,6 +2190,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
setStoreSkuBindStatus(skuBind, model.SyncFlagSaleMask)
|
||||
setStoreSkuBindStatus(skuBind, model.SyncFlagStockMask)
|
||||
if tmpStatus == model.StoreSkuBindStatusNormal {
|
||||
globals.SugarLogger.Debugf("----------------------------5")
|
||||
if skuBind.Stock == 0 && beego.BConfig.RunMode != model.ServerTypePet {
|
||||
skuBind.Stock = model.MaxStoreSkuStockQty
|
||||
} else {
|
||||
@@ -2193,6 +2198,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
}
|
||||
//下面这段很难受
|
||||
{
|
||||
globals.SugarLogger.Debugf("----------------------------6")
|
||||
//如果是京东关注,要去建商品
|
||||
list1, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, []int{storeID}, nil, model.StoreStatusAll, 1, "", "", "")
|
||||
//表示这个门店绑定了京东
|
||||
|
||||
Reference in New Issue
Block a user