This commit is contained in:
邹宗楠
2023-04-03 15:07:19 +08:00
parent 30ed11db6c
commit 015d14ee0c
3 changed files with 19 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ func (c *BaseScheduler) SelfDeliveredAndUpdateStatus(ctx *jxcontext.Context, ven
}
if err == nil {
order.Status = model.OrderStatusFinished // todo 是否需要强制设置完成状态?
if err = dao.SetOrderFlag(dao.GetDB(), ctx.GetUserName(), order.VendorOrderID, order.VendorID, model.OrderFlagMaskSetDelivered); err == nil {
if err = dao.SetOrderFlag(dao.GetDB(), ctx.GetUserName(), order.VendorOrderID, order.VendorID, model.OrderFlagMaskSetDelivered); err != nil {
return err
}
order.OrderFinishedAt = time.Now()

View File

@@ -562,9 +562,16 @@ func setStoreMapInfo(ctx *jxcontext.Context, db *dao.DaoDB, storesInfo *StoresIn
// todo 门店绑定信息可以考虑以数组形式返回,而不是现在这样
func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interface{}, offset, pageSize int, orderTimeFrom, orderTimeTo time.Time, orderCountFrom, orderCountTo int) (retVal *StoresInfo, err error) {
briefLevel := int(utils.ForceInterface2Int64(params["briefLevel"]))
if ctx.GetUserID() == "6D914A8BB71611EDB37F525400E86DC0" {
globals.SugarLogger.Debugf("======params:%s", utils.Format4Output(params, false))
}
//权限
if permission.IsRoled(ctx) {
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
if ctx.GetUserID() == "6D914A8BB71611EDB37F525400E86DC0" {
globals.SugarLogger.Debugf("======storeIDsMap:%s", utils.Format4Output(storeIDsMap, false))
}
var storeIDs2 []int
if params["storeIDs"] != nil {
var storeIDs []int
@@ -636,8 +643,16 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
pageSize = jxutils.FormalizePageSize(pageSize)
sqlParams = append(sqlParams, pageSize, offset)
//mapLimit := false
if ctx.GetUserID() == "6D914A8BB71611EDB37F525400E86DC0" {
globals.SugarLogger.Debugf("======sql:%s", sql)
globals.SugarLogger.Debugf("======sql:%s", sqlParams)
}
txDB, _ := dao.Begin(db)
if err = dao.GetRowsTx(txDB, &storeList, sql, sqlParams...); err == nil {
if ctx.GetUserID() == "6D914A8BB71611EDB37F525400E86DC0" {
globals.SugarLogger.Debugf("======storeList:%s", utils.Format4Output(storeList, false))
}
retVal.Stores = storeList
retVal.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
// 地图区域限制过滤

View File

@@ -353,7 +353,9 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
}
}
userRoles, err2 := dao.GetUserRole2(db, []string{userID}, nil)
globals.SugarLogger.Debugf("======userRoles:%s", utils.Format4Output(userRoles, false))
if userID == "6D914A8BB71611EDB37F525400E86DC0" {
globals.SugarLogger.Debugf("======userRoles:%s", utils.Format4Output(userRoles, false))
}
err = err2
for _, v := range userRoles {
var (