Accept Merge Request #4: (don -> mark)

Merge Request: 门店评分-修改BUG
Created By: @zhudan
Accepted By: @zhudan
URL: https://rosydev.coding.net/p/jx-callback/d/jx-callback/git/merge/4
This commit is contained in:
zhudan
2019-09-17 17:03:10 +08:00
parent 7b0d1d396f
commit 61c52330fd
2 changed files with 32 additions and 14 deletions

View File

@@ -591,17 +591,35 @@ func ScoreStore(ctx *jxcontext.Context, storeIDList []int) (retVal interface{},
GetAllStoreSkus(ctx, task, storeList)
baseapi.SugarLogger.Debugf("ScoreStore step1 end")
case 2:
db := dao.GetDB()
storeCountList, _ := dao.GetDailyBadCommentOrderCount(db, scoreDate)
storeScoreDataWrapper.SetDailyBadCommentOrderCount(storeCountList)
storeCountList, _ = dao.GetDailyUnFinishOrderCount(db, scoreDate)
storeScoreDataWrapper.SetDailyUnFinishOrderCount(storeCountList)
storeCountList, _ = dao.GetDailyFinishOrderCount(db, scoreDate)
storeScoreDataWrapper.SetDailyFinishOrderCount(storeCountList)
storeCountList, _ = dao.GetDailyAbsentGoodsOrderCount(db, scoreDate)
storeScoreDataWrapper.SetDailyAbsentGoodsOrderCount(storeCountList)
case 3:
baseapi.SugarLogger.Debugf("ScoreStore step2 begin")
db := dao.GetDB()
storeCountList, err := dao.GetDailyBadCommentOrderCount(db, scoreDate)
if err == nil {
storeScoreDataWrapper.SetDailyBadCommentOrderCount(storeCountList)
} else {
baseapi.SugarLogger.Debugf("ScoreStore GetDailyBadCommentOrderCount %v", err)
}
storeCountList, err = dao.GetDailyUnFinishOrderCount(db, scoreDate)
if err == nil {
storeScoreDataWrapper.SetDailyUnFinishOrderCount(storeCountList)
} else {
baseapi.SugarLogger.Debugf("ScoreStore GetDailyUnFinishOrderCount %v", err)
}
storeCountList, err = dao.GetDailyFinishOrderCount(db, scoreDate)
if err == nil {
storeScoreDataWrapper.SetDailyFinishOrderCount(storeCountList)
} else {
baseapi.SugarLogger.Debugf("ScoreStore GetDailyFinishOrderCount %v", err)
}
storeCountList, err = dao.GetDailyAbsentGoodsOrderCount(db, scoreDate)
if err == nil {
storeScoreDataWrapper.SetDailyAbsentGoodsOrderCount(storeCountList)
} else {
baseapi.SugarLogger.Debugf("ScoreStore GetDailyAbsentGoodsOrderCount %v", err)
}
baseapi.SugarLogger.Debugf("ScoreStore step2 end")
case 3:
baseapi.SugarLogger.Debugf("ScoreStore step3 begin")
taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeInfo := batchItemList[0].(*cms.StoreExt)
storeID := storeInfo.ID
@@ -626,13 +644,13 @@ func ScoreStore(ctx *jxcontext.Context, storeIDList []int) (retVal interface{},
if err != nil {
baseapi.SugarLogger.Debugf("ScoreStore taskParallel error:%v", err)
}
baseapi.SugarLogger.Debugf("ScoreStore step2 end")
baseapi.SugarLogger.Debugf("ScoreStore step3 end")
case 4:
baseapi.SugarLogger.Debugf("ScoreStore step3 begin")
baseapi.SugarLogger.Debugf("ScoreStore step4 begin")
storeScoreDataWrapper.InsertStoreScore()
storeScoreDataWrapper.ClearData()
allStoreSkusWrapper.ClearData()
baseapi.SugarLogger.Debugf("ScoreStore step3 end")
baseapi.SugarLogger.Debugf("ScoreStore step4 end")
isScoring = false
}
return result, err

View File

@@ -354,7 +354,7 @@ func GetDailyEndOrderCount(db *DaoDB, statusList []int, isAbsentOrder bool, date
}
sql += `
GROUP BY jx_store_id`
err = GetRow(db, &storeCountList, sql, sqlParams)
err = GetRows(db, &storeCountList, sql, sqlParams)
return storeCountList, err
}