- change bill ext to .lsx
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"mime/multipart"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -60,7 +59,7 @@ func SendFilesToStores(ctx *jxcontext.Context, files []*multipart.FileHeader, is
|
||||
globals.SugarLogger.Debugf("SendFilesToStores upload file:%s", fileHeader.Filename)
|
||||
if err == nil {
|
||||
ret := storage.PutRet{}
|
||||
key := "storeBill_" + utils.Int2Str(storeID) + "_" + strings.ToLower(utils.GetUUID()) + path.Ext(fileHeader.Filename)
|
||||
key := "storeBill_" + utils.Int2Str(storeID) + "_" + strings.ToLower(utils.GetUUID()) + ".lsx" //path.Ext(fileHeader.Filename)
|
||||
formUploader := storage.NewFormUploader(cfg)
|
||||
err = formUploader.Put(context.Background(), &ret, upToken, key, file, fileHeader.Size, nil)
|
||||
file.Close()
|
||||
|
||||
@@ -85,6 +85,7 @@ func GetWeixinOpenIDsFromStoreID(storeID int) (retVal []string) {
|
||||
}
|
||||
|
||||
func SendMsgToStore(storeID int, templateID, downloadURL string, data interface{}) (err error) {
|
||||
globals.SugarLogger.Debugf("SendMsgToStore storeID:%d, templateID:%s, downloadURL:%s", storeID, templateID, downloadURL)
|
||||
if globals.ReallySendWeixinMsg {
|
||||
if storeID == 0 { // 测试,只发给我
|
||||
api.WeixinAPI.MessageTemplateSend("oYN_ust9hXKEvEv0X6Mq6nlAWs_E", templateID, downloadURL, nil, data)
|
||||
@@ -92,6 +93,7 @@ func SendMsgToStore(storeID int, templateID, downloadURL string, data interface{
|
||||
openIDs := GetWeixinOpenIDsFromStoreID(storeID)
|
||||
successCount := 0
|
||||
for _, openID := range openIDs {
|
||||
globals.SugarLogger.Debugf("SendMsgToStore storeID:%d, openID:%s, templateID:%s, downloadURL:%s", storeID, openID, templateID, downloadURL)
|
||||
if err2 := api.WeixinAPI.MessageTemplateSend(openID, templateID, downloadURL, nil, data); err2 == nil {
|
||||
successCount++
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user