阿里云查询商品条码
This commit is contained in:
@@ -3,6 +3,8 @@ package cms
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -573,7 +575,8 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku bool, params ma
|
||||
t1.ex_prefix,
|
||||
t1.ex_prefix_begin,
|
||||
t1.ex_prefix_end,
|
||||
t1.yb_name_suffix`
|
||||
t1.yb_name_suffix,
|
||||
t4.mid_unit_price`
|
||||
if isBySku {
|
||||
sql += `,
|
||||
t2.id`
|
||||
@@ -608,6 +611,7 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku bool, params ma
|
||||
t1.ex_prefix_begin,
|
||||
t1.ex_prefix_end,
|
||||
t1.yb_name_suffix,
|
||||
t4.mid_unit_price,
|
||||
CONCAT("[", GROUP_CONCAT(DISTINCT CONCAT('{"id":', t2.id, ',"comment":"', t2.comment, '","status":', t2.status,
|
||||
',"createdAt":"', CONCAT(REPLACE(t2.created_at," ","T"),"+08:00"), '","updatedAt":"', CONCAT(REPLACE(t2.updated_at," ","T"),"+08:00"),
|
||||
'","lastOperator":"', t2.last_operator, '","specQuality":', t2.spec_quality, ',"specUnit":"', t2.spec_unit,
|
||||
@@ -1588,7 +1592,7 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
|
||||
Upc: &v.UpcID,
|
||||
Status: model.SkuStatusNormal,
|
||||
}
|
||||
skuName.CategoryID = 35 //默认给了个分类
|
||||
skuName.CategoryID = model.NoCatCatgoryID //默认给了个分类
|
||||
dao.WrapAddIDCULDEntity(skuName, ctx.GetUserName())
|
||||
err = dao.CreateEntity(db, skuName)
|
||||
if err != nil {
|
||||
@@ -1710,3 +1714,29 @@ func SendNoCatSkusToOperater(ctx *jxcontext.Context) (err error) {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func CreateUpcSkuByExcel(ctx *jxcontext.Context, files []*multipart.FileHeader) (err error) {
|
||||
if len(files) == 0 {
|
||||
return errors.New("没有文件上传!")
|
||||
}
|
||||
fileHeader := files[0]
|
||||
file, err := fileHeader.Open()
|
||||
err = CreateUpcSkuByExcelBin(ctx, file)
|
||||
file.Close()
|
||||
return err
|
||||
}
|
||||
|
||||
func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader) (err error) {
|
||||
taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||
switch step {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
taskSeq := tasksch.NewSeqTask2("根据excel创建标品-序列任务", ctx, true, taskSeqFunc, 3)
|
||||
tasksch.HandleTask(taskSeq, nil, true).Run()
|
||||
_, err = taskSeq.GetResult(0)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -106,6 +106,8 @@ xiaoWMAppKey = "94337"
|
||||
yinbaoAppKey = "682628966212343269"
|
||||
yinbaoAppID = "18C0E0867E467DBC26EFF5E957B02EC4"
|
||||
|
||||
aliUpcAppCode = "52a6ee59970844eab9bc4de2f397f6f8"
|
||||
|
||||
yilianyunClientID = "1039586024"
|
||||
yilianyunClientSecret = "4885d07c2997b661102e4b6099c0bf3b"
|
||||
yilianyunClientID2 = "1098307169"
|
||||
@@ -201,6 +203,8 @@ weixinMiniSecret2 = "2a57228a716ce991a52739f0ff41111d"
|
||||
yinbaoAppKey = "682628966212343269"
|
||||
yinbaoAppID = "18C0E0867E467DBC26EFF5E957B02EC4"
|
||||
|
||||
aliUpcAppCode = "52a6ee59970844eab9bc4de2f397f6f8"
|
||||
|
||||
wxpayNotifyURL = "http://callback.jxc4.com/wxpay/msg/"
|
||||
|
||||
tonglianPayAppID = "00183083"
|
||||
@@ -417,4 +421,6 @@ getWeimobTokenURL = "http://www.jxc4.com/v2/sys/GetWeimobToken"
|
||||
dbConnectStr = "root:WebServer@1@tcp(127.0.0.1:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true"
|
||||
|
||||
yinbaoAppKey = "682628966212343269"
|
||||
yinbaoAppID = "18C0E0867E467DBC26EFF5E957B02EC4"
|
||||
yinbaoAppID = "18C0E0867E467DBC26EFF5E957B02EC4"
|
||||
|
||||
aliUpcAppCode = "52a6ee59970844eab9bc4de2f397f6f8"
|
||||
|
||||
@@ -3,6 +3,8 @@ package api
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/aliupcapi"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
|
||||
|
||||
@@ -72,6 +74,7 @@ var (
|
||||
WeimobAPI *weimobapi.API
|
||||
DingDingAPI *dingdingapi.API
|
||||
DingDingQRCodeAPI *dingdingapi.API
|
||||
AliUpcAPI *aliupcapi.API //阿里商品条码查询api
|
||||
|
||||
FeieAPI *feieapi.API
|
||||
XiaoWMAPI *xiaowmapi.API
|
||||
@@ -210,6 +213,7 @@ func Init() {
|
||||
QiniuAPI = qbox.NewMac(beego.AppConfig.String("qiniuAK"), beego.AppConfig.String("qiniuSK"))
|
||||
ShowAPI = showapi.New(beego.AppConfig.DefaultInt("showAppID", 0), beego.AppConfig.DefaultString("showAppSecret", ""))
|
||||
Cacher = redis.New(beego.AppConfig.DefaultString("redisHost", "localhost"), beego.AppConfig.DefaultInt("redisPort", 0), beego.AppConfig.DefaultString("redisPassword", ""))
|
||||
AliUpcAPI = aliupcapi.New(beego.AppConfig.String("aliUpcAppCode"))
|
||||
|
||||
DingDingAPI = dingdingapi.NewWithAgentID(beego.AppConfig.DefaultInt64("dingdingAgentID", 0), beego.AppConfig.DefaultString("dingdingCorpID", ""), beego.AppConfig.DefaultString("dingdingAppKey", ""), beego.AppConfig.DefaultString("dingdingSecret", ""))
|
||||
DingDingQRCodeAPI = dingdingapi.New(beego.AppConfig.DefaultString("dingdingCorpID", ""), beego.AppConfig.DefaultString("dingdingQRCodeAppKey", ""), beego.AppConfig.DefaultString("dingdingQRCodeSecret", ""))
|
||||
|
||||
Reference in New Issue
Block a user