加日志头

This commit is contained in:
Rosy-zhudan
2019-07-31 11:42:49 +08:00
parent 8739d84e66
commit cd8670da4e

View File

@@ -79,7 +79,7 @@ func StartOrEndOpStore(isStart bool, startTime, endTime int16) {
storeInfo, err := cms.GetStores(ctx, "", map[string]interface{}{}, 0, -1, utils.DefaultTimeValue, utils.DefaultTimeValue, 0, 0) storeInfo, err := cms.GetStores(ctx, "", map[string]interface{}{}, 0, -1, utils.DefaultTimeValue, utils.DefaultTimeValue, 0, 0)
if err != nil { if err != nil {
baseapi.SugarLogger.Errorf("storeInfo error:%v", err) baseapi.SugarLogger.Errorf("StartOrEndOpStore cms.GetStores error:%v", err)
} else { } else {
taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeListValue := batchItemList[0].(*cms.StoreExt) storeListValue := batchItemList[0].(*cms.StoreExt)
@@ -92,14 +92,14 @@ func StartOrEndOpStore(isStart bool, startTime, endTime int16) {
if startTime != 0 && endTime != 0 { if startTime != 0 && endTime != 0 {
startOpStoreTime = startTime startOpStoreTime = startTime
endOpStoreTime = endTime endOpStoreTime = endTime
baseapi.SugarLogger.Debugf("SetStoreOptime:%d do:%d", startTime, endTime) baseapi.SugarLogger.Debugf("StartOrEndOpStore SetStoreOptime:%d do:%d", startTime, endTime)
} }
vendorStoreID := utils.Interface2String(vendorListValue["vendorStoreID"]) vendorStoreID := utils.Interface2String(vendorListValue["vendorStoreID"])
baseapi.SugarLogger.Debugf("storeID:%d vendorID:%d vendorStoreID:%s", storeID, vendorID, vendorStoreID) baseapi.SugarLogger.Debugf("StartOrEndOpStore storeID:%d vendorID:%d vendorStoreID:%s", storeID, vendorID, vendorStoreID)
singleStoreHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler) singleStoreHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
storeSkuNameList, err := singleStoreHandler.GetStoreSkusFullInfo(ctx, nil, storeID, vendorStoreID, nil) storeSkuNameList, err := singleStoreHandler.GetStoreSkusFullInfo(ctx, nil, storeID, vendorStoreID, nil)
if err != nil { if err != nil {
baseapi.SugarLogger.Errorf("storeSkuNameList error:%v storeID:%d vendorID:%d vendorStoreID:%s", err, storeID, vendorID, vendorStoreID) baseapi.SugarLogger.Errorf("StartOrEndOpStore GetStoreSkusFullInfo error:%v storeID:%d vendorID:%d vendorStoreID:%s", err, storeID, vendorID, vendorStoreID)
} else { } else {
filterStoreSkuNameList := FilterSkuNameList(storeSkuNameList) filterStoreSkuNameList := FilterSkuNameList(storeSkuNameList)
storeSkuList := putils.StoreSkuFullList2Bare(filterStoreSkuNameList) storeSkuList := putils.StoreSkuFullList2Bare(filterStoreSkuNameList)
@@ -115,7 +115,7 @@ func StartOrEndOpStore(isStart bool, startTime, endTime int16) {
//var successList []*partner.StoreSkuInfo //var successList []*partner.StoreSkuInfo
if _, err = singleStoreHandler.UpdateStoreSkusStock(ctx, storeID, vendorStoreID, batchedStoreSkuList); err == nil { if _, err = singleStoreHandler.UpdateStoreSkusStock(ctx, storeID, vendorStoreID, batchedStoreSkuList); err == nil {
//successList = batchedStoreSkuList //successList = batchedStoreSkuList
//baseapi.SugarLogger.Debugf("successList:%v error:%v", successList, err) //baseapi.SugarLogger.Debugf("StartOrEndOpStore successList:%v error:%v", successList, err)
} }
return nil, err return nil, err
}, ctx, task, storeSkuList, singleStoreHandler.GetStoreSkusBatchSize(partner.FuncUpdateStoreSkusStock), true) }, ctx, task, storeSkuList, singleStoreHandler.GetStoreSkusBatchSize(partner.FuncUpdateStoreSkusStock), true)
@@ -134,7 +134,7 @@ func StartOrEndOpStore(isStart bool, startTime, endTime int16) {
tasksch.HandleTask(task, nil, true).Run() tasksch.HandleTask(task, nil, true).Run()
_, err = task.GetResult(0) _, err = task.GetResult(0)
if err != nil { if err != nil {
baseapi.SugarLogger.Errorf("tasksch error:%v", err) baseapi.SugarLogger.Debugf("StartOrEndOpStore tasksch error:%v", err)
} }
} }
endProcessTime := time.Now().Unix() endProcessTime := time.Now().Unix()