From 48d2d762e71e910c5f2b269ffe089a7c4cb06f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 20 Jan 2020 14:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=88=86=E5=93=81=E9=A2=84=E8=AD=A6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 0fbadda48..852a628c2 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -3348,7 +3348,7 @@ func getCellForSpecTag(rowNum int, row []string, storeSkuMap map[int][]*partner. 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 // 2. 爆品价格低于1元商品小于5个,报警 type2 var ( @@ -3421,12 +3421,7 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i type2 = storeSecKill.SecKillCount2 } if type1 < type1Count || type2 < type2Count { - var storeSecKill2 = &tStoreSkusSecKill{} - storeSecKill2.StoreID = store.ID - storeSecKill2.VendorID = vendorID - storeSecKill2.SecKillCount = type1 - storeSecKill2.SecKillCount2 = type2 - retVal = []*tStoreSkusSecKill{storeSecKill2} + fmt.Println(type1, type2, store.ID, vendorID) err = sendDDMsgBySpecSkusCount(db, type1, type2, storeDetial, vendorID) } } @@ -3434,8 +3429,7 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i }, storeList) tasksch.HandleTask(task, nil, true).Run() if !isAsync { - result, err := task.GetResult(0) - return result, err + _, err = task.GetResult(0) } else { 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) 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, user2.UserID, "警告!门店爆品数量异常!", noticeMsg) return err }