This commit is contained in:
邹宗楠
2024-08-20 16:27:10 +08:00
parent f7332b5df6
commit 33bacc5cd0
2 changed files with 6 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ package permission
import (
"fmt"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
"git.rosy.net.cn/jx-callback/globals/api2"
"strings"
"time"
@@ -373,6 +374,10 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
}
}
}
roleList, _ := api2.RoleMan.GetUserRoleList(userID)
for _, v := range roleList {
resultMap[v.StoreID] = v.StoreID
}
return resultMap, err
}

View File

@@ -44,14 +44,12 @@ func formalizeTagList(mtwmTagList string) (outTagList string) {
}
func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) {
globals.SugarLogger.Debugf("--------------------------------------------------------------")
startTime := time.Now().Add(-24 * time.Hour)
//endTime := time.Now().Add(-RefreshCommentTime)
endDateStr := startTime.Format("20060102")
startDateStr := time.Now().Add(-RefreshCommentTime).Format("20060102")
storeIDs, _ := dao.GetOrderStoreIDs(dao.GetDB(), fromTime, toTime, model.VendorIDMTWM)
storeIDs = append(storeIDs, 804697)
globals.SugarLogger.Debugf("------storeIDs := %s", utils.Format4Output(storeIDs, false))
task := tasksch.NewParallelTask("mtwm RefreshComment", nil, jxcontext.AdminCtx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeID := batchItemList[0].(int)
@@ -61,11 +59,7 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error)
return nil, nil
}
// 查询门店差评
commentList, err := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied)
globals.SugarLogger.Debugf("commentList lenght --------------- :=%d,%s,%s", storeID, storeDetail.VendorStoreID, utils.Format4Output(len(commentList), false))
if err != nil {
globals.SugarLogger.Debugf("=========err := %v", err)
}
commentList, _ := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied)
var orderCommentList []*model.OrderComment
if len(commentList) == model.NO || commentList == nil {
return nil, nil