aa
This commit is contained in:
@@ -435,10 +435,12 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
|
||||
}
|
||||
}
|
||||
fmt.Println("storeIDs111111111111111111111111111", storeIDs)
|
||||
for _, v := range storeIDs {
|
||||
task := tasksch.NewParallelTask("GetStoreManageState", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
v := batchItemList[0].(int)
|
||||
storeDetail, _ := dao.GetStoreDetail(db, v, vendorID, "")
|
||||
if storeDetail == nil || storeDetail.VendorStoreID == "" || storeDetail.VendorOrgCode == "" {
|
||||
continue
|
||||
return retVal, err
|
||||
}
|
||||
result := &GetStoreManageStateResult{
|
||||
StoreID: v,
|
||||
@@ -501,11 +503,20 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
|
||||
}
|
||||
result.NullOrderCount, result.RefuseOrderCount = nullOrderCount, refuseOrderCount
|
||||
//评分(美团)
|
||||
if vendorID == model.VendorIDMTWM {
|
||||
mtapi := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, storeDetail.VendorOrgCode).(*mtwmapi.API)
|
||||
if scoreResult, err := mtapi.CommentScore(storeDetail.VendorStoreID); err == nil {
|
||||
result.StoreScore = scoreResult.AvgPoiScore
|
||||
}
|
||||
getStoreManageStateResult = append(getStoreManageStateResult, result)
|
||||
}
|
||||
retVal = []*GetStoreManageStateResult{result}
|
||||
// getStoreManageStateResult = append(getStoreManageStateResult, result)
|
||||
return retVal, err
|
||||
}, storeIDs)
|
||||
tasksch.HandleTask(task, nil, true).Run()
|
||||
result, err := task.GetResult(0)
|
||||
for _, v := range result {
|
||||
getStoreManageStateResult = append(getStoreManageStateResult, v.(*GetStoreManageStateResult))
|
||||
}
|
||||
return getStoreManageStateResult, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user