删除日志
This commit is contained in:
@@ -118,7 +118,6 @@ func GetWeixinOpenIDsFromStoreID(storeID int) (retVal []string) {
|
||||
retVal = jxutils.StringMap2List(openIDMap)
|
||||
if !globals.ReallyCallPlatformAPI {
|
||||
// todo,调试,只发给我
|
||||
globals.SugarLogger.Debugf("GetWeixinOpenIDsFromStoreID store:%d, openids:%v", storeID, retVal)
|
||||
if storeID == 100146 {
|
||||
retVal = []string{"oYN_ust9hXKEvEv0X6Mq6nlAWs_E"}
|
||||
} else {
|
||||
@@ -129,7 +128,6 @@ func GetWeixinOpenIDsFromStoreID(storeID int) (retVal []string) {
|
||||
}
|
||||
|
||||
func SendMsgToStore(storeID int, templateID, downloadURL, miniPageURL string, data interface{}) (err error) {
|
||||
globals.SugarLogger.Debugf("SendMsgToStore storeID:%d, templateID:%s, downloadURL:%s, miniPageURL:%s", storeID, templateID, downloadURL, miniPageURL)
|
||||
if storeID == 0 { // 测试,只发给我
|
||||
// SmartMessageTemplateSend("oYN_ust9hXKEvEv0X6Mq6nlAWs_E", templateID, downloadURL, miniPageURL, data)
|
||||
} else {
|
||||
@@ -137,10 +135,6 @@ func SendMsgToStore(storeID int, templateID, downloadURL, miniPageURL string, da
|
||||
successCount := 0
|
||||
for _, openID := range openIDs {
|
||||
realMiniPageURL := miniPageURL
|
||||
// if testMiniProgramStoreMap[storeID] == 0 && debugOpenIDMap[openID] == 0 {
|
||||
// realMiniPageURL = ""
|
||||
// }
|
||||
globals.SugarLogger.Debugf("SendMsgToStore storeID:%d, openID:%s, templateID:%s, downloadURL:%s, realMiniPageURL:%s", storeID, openID, templateID, downloadURL, realMiniPageURL)
|
||||
if err2 := SmartMessageTemplateSend(openID, templateID, downloadURL, realMiniPageURL, data); err2 == nil {
|
||||
successCount++
|
||||
} else {
|
||||
@@ -165,7 +159,6 @@ func SmartMessageTemplateSend(userOpenID, templateID, downloadURL, miniPageURL s
|
||||
"pagepath": miniPageURL,
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("SmartMessageTemplateSend openID:%s, templateID:%s, downloadURL:%s, miniProgram:%s", userOpenID, templateID, downloadURL, utils.Format4Output(miniProgram, true))
|
||||
if globals.ReallySendWeixinMsg || debugOpenIDMap[userOpenID] == 1 {
|
||||
if err = api.WeixinAPI.CBMessageTemplateSend(userOpenID, templateID, downloadURL, miniProgram, data); err != nil {
|
||||
globals.SugarLogger.Debugf("SmartMessageTemplateSend openID:%s, templateID:%s, downloadURL:%s, miniProgram:%s, failed with error:%v", userOpenID, templateID, downloadURL, utils.Format4Output(miniProgram, true), err)
|
||||
@@ -205,7 +198,6 @@ func getOrderDetailBrief(order *model.GoodsOrder) (brief string) {
|
||||
}
|
||||
|
||||
func NotifyNewOrder(order *model.GoodsOrder) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyNewOrder orderID:%s", order.VendorOrderID)
|
||||
if order.VendorID == model.VendorIDELM {
|
||||
return nil
|
||||
}
|
||||
@@ -262,7 +254,6 @@ func NotifyNewOrder(order *model.GoodsOrder) (err error) {
|
||||
}
|
||||
|
||||
func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder, isBillAlreadyCandidate bool) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyWaybillStatus orderID:%s bill:%v", order.VendorOrderID, bill)
|
||||
if order.VendorID == model.VendorIDELM {
|
||||
return nil
|
||||
}
|
||||
@@ -337,7 +328,6 @@ func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder, isBillAlr
|
||||
}
|
||||
|
||||
func NotifyUserApplyCancel(order *model.GoodsOrder, cancelReason string) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyUserApplyCancel orderID:%s", order.VendorOrderID)
|
||||
if order.VendorID == model.VendorIDELM {
|
||||
return nil
|
||||
}
|
||||
@@ -384,7 +374,6 @@ func NotifyUserApplyCancel(order *model.GoodsOrder, cancelReason string) (err er
|
||||
}
|
||||
|
||||
func NotifyOrderChanged(order *model.GoodsOrder) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyOrderChanged orderID:%s", order.VendorOrderID)
|
||||
if order.VendorID == model.VendorIDELM {
|
||||
return nil
|
||||
}
|
||||
@@ -430,7 +419,6 @@ func NotifyOrderChanged(order *model.GoodsOrder) (err error) {
|
||||
}
|
||||
|
||||
func NotifyOrderCanceled(order *model.GoodsOrder) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyOrderCanceled orderID:%s", order.VendorOrderID)
|
||||
if order.VendorID == model.VendorIDELM {
|
||||
return nil
|
||||
}
|
||||
@@ -491,7 +479,6 @@ func NotifyOrderCanceled(order *model.GoodsOrder) (err error) {
|
||||
}
|
||||
|
||||
func PushJDBadCommentToWeiXin(comment *legacymodel.JxBadComments, isBadComment bool, order *model.GoodsOrder) (err error) {
|
||||
globals.SugarLogger.Debugf("PushJDBadCommentToWeiXin orderID:%s", comment.OrderId)
|
||||
suffix := ""
|
||||
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), jxutils.GetSaleStoreIDFromOrder(order), order.VendorID, "")
|
||||
if err == nil && storeDetail != nil {
|
||||
@@ -549,7 +536,6 @@ func PushJDBadCommentToWeiXin(comment *legacymodel.JxBadComments, isBadComment b
|
||||
}
|
||||
|
||||
func NotifySaleBill(storeID int, title, shopName, fileURL string) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifySaleBill storeID:%d, fileURL:%s", storeID, fileURL)
|
||||
if title == "" {
|
||||
title = "当期账单"
|
||||
}
|
||||
@@ -582,7 +568,6 @@ func NotifySaleBill(storeID int, title, shopName, fileURL string) (err error) {
|
||||
}
|
||||
|
||||
func NotifyStoreOpRequestStatus(isAccepted bool, storeID, nameID int, spuName string, originalUnitPrice, unitPrice int, rejectReason string) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyStoreOpRequestStatus isAccepted:%t, storeID:%d, nameID:%d, spuName:%s, originalUnitPrice:%d, unitPrice:%d, rejectReason:%s", isAccepted, storeID, nameID, spuName, originalUnitPrice, unitPrice, rejectReason)
|
||||
templateID := ""
|
||||
fileURL := globals.WxBackstageHost + fmt.Sprintf("%s%d", WX_TO_STORE_SKU_PAGE_URL, storeID)
|
||||
data := make(map[string]interface{})
|
||||
@@ -638,7 +623,6 @@ func NotifyStoreOpRequestStatus(isAccepted bool, storeID, nameID int, spuName st
|
||||
}
|
||||
|
||||
func NotifyStoreMessage(storeID, msgID, msgStatusID int, msg *model.Message) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyStoreMessage storeID:%d, msgID:%d, title:%s, content:%s", storeID, msgID, msg.Title, msg.Content)
|
||||
templateID := ""
|
||||
fileURL := globals.WxBackstageHost + fmt.Sprintf(WX_TO_SHOW_MSG, msgID, msgStatusID)
|
||||
data := make(map[string]interface{})
|
||||
@@ -692,7 +676,6 @@ func NotifyStoreMessage(storeID, msgID, msgStatusID int, msg *model.Message) (er
|
||||
}
|
||||
|
||||
func NotifyAfsOrderStatus(afsOrder *model.AfsOrder) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyAfsOrderStatus orderID:%s", afsOrder.VendorOrderID)
|
||||
if afsOrder.VendorID == model.VendorIDELM {
|
||||
return nil
|
||||
}
|
||||
@@ -799,7 +782,6 @@ func NotifyStoreStatusChanged(openUserID, title, content string) (err error) {
|
||||
}
|
||||
|
||||
func NotifyStoreAlertMessage(storeID int, storeName, title, content string) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyStoreAlertMessage storeID:%d, storeName:%d, title:%s, content:%s", storeID, storeName, title, content)
|
||||
templateID := WX_STORE_ALERT_TEMPLATE_ID
|
||||
data := map[string]interface{}{
|
||||
"first": map[string]interface{}{
|
||||
@@ -896,7 +878,6 @@ func SendStoreMessage(ctx *jxcontext.Context, title, content string, storeIDs []
|
||||
msgStatus.Status = model.MessageStatusSendAllFailed
|
||||
}
|
||||
dao.WrapUpdateULEntity(msgStatus, ctx.GetUserName())
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(msgStatus, false))
|
||||
_, err = dao.UpdateEntity(db, msgStatus)
|
||||
return nil, err
|
||||
}, msgStatusList)
|
||||
@@ -911,7 +892,6 @@ func SendStoreMessage(ctx *jxcontext.Context, title, content string, storeIDs []
|
||||
}
|
||||
|
||||
func NotifyAdjustOrder(order *model.GoodsOrder) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyAdjustOrder orderID:%s", order.VendorOrderID)
|
||||
if order.VendorID == model.VendorIDELM {
|
||||
return nil
|
||||
}
|
||||
@@ -1010,7 +990,6 @@ func SendStoreMessageKnowledge(ctx *jxcontext.Context, title string, knowIDs, st
|
||||
msgStatus.Status = model.MessageStatusSendAllFailed
|
||||
}
|
||||
dao.WrapUpdateULEntity(msgStatus, ctx.GetUserName())
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(msgStatus, false))
|
||||
_, err = dao.UpdateEntity(db, msgStatus)
|
||||
return nil, err
|
||||
}, msgStatusList)
|
||||
@@ -1024,7 +1003,6 @@ func SendStoreMessageKnowledge(ctx *jxcontext.Context, title string, knowIDs, st
|
||||
}
|
||||
|
||||
func NotifyKnowledge(storeID int, title string) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyKnowledge storeID:%d, title:%s", storeID, title)
|
||||
templateID := WX_KNOWLEDGE_BASE_TEMPLATE_ID
|
||||
data := map[string]interface{}{
|
||||
"first": map[string]interface{}{
|
||||
@@ -1103,7 +1081,6 @@ func SendUserMessage(ctx *jxcontext.Context, title, content string, userIDs []st
|
||||
}
|
||||
|
||||
func NotifyUserMessage(userID string, title, content string) (err error) {
|
||||
globals.SugarLogger.Debugf("NotifyUserMessage userID:%d, title:%s, content:%s", userID, title, content)
|
||||
templateID := WX_NORMAL_STORE_MSG_TEMPLATE_ID
|
||||
data := map[string]interface{}{
|
||||
"first": map[string]interface{}{
|
||||
@@ -1126,7 +1103,6 @@ func NotifyUserMessage(userID string, title, content string) (err error) {
|
||||
}
|
||||
|
||||
func SendMsgToUser(userID string, templateID string, data interface{}) (err error) {
|
||||
globals.SugarLogger.Debugf("SendMsgToUser userID:%d, templateID:%s", userID, templateID)
|
||||
authBinds, err := dao.GetUserBindAuthInfo(dao.GetDB(), userID, model.AuthBindTypeAuth, []string{"weixinsns"}, "", "", []string{"wx2bb99eb5d2c9b82c"})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -1135,7 +1111,6 @@ func SendMsgToUser(userID string, templateID string, data interface{}) (err erro
|
||||
if len(authBinds) == 0 {
|
||||
return fmt.Errorf("此用户未找到微信认证方式!userID: %v", userID)
|
||||
}
|
||||
globals.SugarLogger.Debugf("SendMsgToUser userID:%d, openID:%s, templateID:%s", userID, authBinds[0].AuthID, templateID)
|
||||
if err2 := SmartMessageTemplateSend(authBinds[0].AuthID, templateID, "", "", data); err2 == nil {
|
||||
successCount++
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user