爆品预警测试
This commit is contained in:
@@ -3348,7 +3348,7 @@ func getCellForSpecTag(rowNum int, row []string, storeSkuMap map[int][]*partner.
|
|||||||
storeSkuMap[storeID] = append(storeSkuMap[storeID], skuMap)
|
storeSkuMap[storeID] = append(storeSkuMap[storeID], skuMap)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, isContinueWhenError bool) (hint interface{}, err error) {
|
func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
// 1. 如果爆品低于8个,报警 type1
|
// 1. 如果爆品低于8个,报警 type1
|
||||||
// 2. 爆品价格低于1元商品小于5个,报警 type2
|
// 2. 爆品价格低于1元商品小于5个,报警 type2
|
||||||
var (
|
var (
|
||||||
@@ -3421,12 +3421,7 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i
|
|||||||
type2 = storeSecKill.SecKillCount2
|
type2 = storeSecKill.SecKillCount2
|
||||||
}
|
}
|
||||||
if type1 < type1Count || type2 < type2Count {
|
if type1 < type1Count || type2 < type2Count {
|
||||||
var storeSecKill2 = &tStoreSkusSecKill{}
|
fmt.Println(type1, type2, store.ID, vendorID)
|
||||||
storeSecKill2.StoreID = store.ID
|
|
||||||
storeSecKill2.VendorID = vendorID
|
|
||||||
storeSecKill2.SecKillCount = type1
|
|
||||||
storeSecKill2.SecKillCount2 = type2
|
|
||||||
retVal = []*tStoreSkusSecKill{storeSecKill2}
|
|
||||||
err = sendDDMsgBySpecSkusCount(db, type1, type2, storeDetial, vendorID)
|
err = sendDDMsgBySpecSkusCount(db, type1, type2, storeDetial, vendorID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3434,8 +3429,7 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i
|
|||||||
}, storeList)
|
}, storeList)
|
||||||
tasksch.HandleTask(task, nil, true).Run()
|
tasksch.HandleTask(task, nil, true).Run()
|
||||||
if !isAsync {
|
if !isAsync {
|
||||||
result, err := task.GetResult(0)
|
_, err = task.GetResult(0)
|
||||||
return result, err
|
|
||||||
} else {
|
} else {
|
||||||
hint = task.GetID()
|
hint = task.GetID()
|
||||||
}
|
}
|
||||||
@@ -3465,8 +3459,12 @@ func sendDDMsgBySpecSkusCount(db *dao.DaoDB, type1Count, type2Count int, store *
|
|||||||
}
|
}
|
||||||
noticeMsg := fmt.Sprintf("运营负责人:[%v],门店ID:[%v],平台门店ID[%v],门店名:[%v],平台:[%v],警告类型:[%v]", operatorName, store.ID, store.VendorStoreID, store.Name, model.VendorChineseNames[vendorID], typeResult)
|
noticeMsg := fmt.Sprintf("运营负责人:[%v],门店ID:[%v],平台门店ID[%v],门店名:[%v],平台:[%v],警告类型:[%v]", operatorName, store.ID, store.VendorStoreID, store.Name, model.VendorChineseNames[vendorID], typeResult)
|
||||||
user, err := dao.GetUserByID(db, "mobile", operatorPhone)
|
user, err := dao.GetUserByID(db, "mobile", operatorPhone)
|
||||||
user2, err := dao.GetUserByID(db, "mobile", store.MarketManPhone)
|
if store.MarketManPhone != "" {
|
||||||
|
user2, err := dao.GetUserByID(db, "mobile", store.MarketManPhone)
|
||||||
|
if err != nil {
|
||||||
|
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user2.UserID, "警告!门店爆品数量异常!", noticeMsg)
|
||||||
|
}
|
||||||
|
}
|
||||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "警告!门店爆品数量异常!", noticeMsg)
|
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "警告!门店爆品数量异常!", noticeMsg)
|
||||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user2.UserID, "警告!门店爆品数量异常!", noticeMsg)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user