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 }