反算京西价bug,银豹平台,没玩刷新物料订单
This commit is contained in:
@@ -3649,10 +3649,12 @@ func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus,
|
|||||||
} else {
|
} else {
|
||||||
vendorPrice = v.Price
|
vendorPrice = v.Price
|
||||||
}
|
}
|
||||||
|
fmt.Println("RefreshJxPriceByVendor1", vendorPrice)
|
||||||
jxPrice := jxutils.CaculateJxPriceByPricePack(pricePercentagePack, 0, vendorPrice)
|
jxPrice := jxutils.CaculateJxPriceByPricePack(pricePercentagePack, 0, vendorPrice)
|
||||||
if skus[0].Unit == model.SpecialUnit {
|
if skus[0].Unit == model.SpecialUnit {
|
||||||
jxPrice = jxPrice * int(utils.Float64TwoInt64(utils.Int2Float64(model.SpecialSpecQuality)/specQuality))
|
jxPrice = jxPrice * int(utils.Float64TwoInt64(utils.Int2Float64(model.SpecialSpecQuality)/specQuality))
|
||||||
}
|
}
|
||||||
|
fmt.Println("RefreshJxPriceByVendor2", jxPrice)
|
||||||
jdMap[store.ID] = append(jdMap[store.ID], &JdStoreSkus{
|
jdMap[store.ID] = append(jdMap[store.ID], &JdStoreSkus{
|
||||||
JdSkuID: skus[0].NameID,
|
JdSkuID: skus[0].NameID,
|
||||||
Price: jxPrice,
|
Price: jxPrice,
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const (
|
|||||||
VendorIDMTWM = 1
|
VendorIDMTWM = 1
|
||||||
VendorIDELM = 2
|
VendorIDELM = 2
|
||||||
VendorIDEBAI = 3
|
VendorIDEBAI = 3
|
||||||
|
VendorIDYB = 4 //银豹
|
||||||
VendorIDWSC = 11 // 微盟微商城
|
VendorIDWSC = 11 // 微盟微商城
|
||||||
VendorIDPurchaseEnd = 11
|
VendorIDPurchaseEnd = 11
|
||||||
VendorIDJX = 9 // 这是一个假的京西VendorID
|
VendorIDJX = 9 // 这是一个假的京西VendorID
|
||||||
@@ -67,6 +68,7 @@ var (
|
|||||||
VendorIDELM: "Elm",
|
VendorIDELM: "Elm",
|
||||||
VendorIDEBAI: "Ebai",
|
VendorIDEBAI: "Ebai",
|
||||||
VendorIDWSC: "Wsc",
|
VendorIDWSC: "Wsc",
|
||||||
|
VendorIDYB: "YinBao",
|
||||||
VendorIDJX: "Jx",
|
VendorIDJX: "Jx",
|
||||||
|
|
||||||
VendorIDDada: "Dada",
|
VendorIDDada: "Dada",
|
||||||
@@ -92,6 +94,7 @@ var (
|
|||||||
VendorIDMTWM: "美团外卖",
|
VendorIDMTWM: "美团外卖",
|
||||||
VendorIDELM: "饿了么",
|
VendorIDELM: "饿了么",
|
||||||
VendorIDEBAI: "饿百新零售",
|
VendorIDEBAI: "饿百新零售",
|
||||||
|
VendorIDYB: "银豹",
|
||||||
VendorIDWSC: "微盟微商城",
|
VendorIDWSC: "微盟微商城",
|
||||||
VendorIDJX: "京西商城",
|
VendorIDJX: "京西商城",
|
||||||
|
|
||||||
|
|||||||
@@ -1226,6 +1226,64 @@ func GetHalfHoursList() (strs []string) {
|
|||||||
return strs
|
return strs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RefreshAllMatterOrderStatus() (err error) {
|
||||||
|
var (
|
||||||
|
db = dao.GetDB()
|
||||||
|
goodsList []*model.GoodsOrder
|
||||||
|
realTime time.Time
|
||||||
|
)
|
||||||
|
realTime = time.Now().AddDate(0, 0, -3)
|
||||||
|
sql := `
|
||||||
|
SELECT * FROM goods_order WHERE store_id = 666666 AND order_created_at >= ? AND status <> ? AND vendor_id = ? AND eclp_out_id = '' AND LENGTH(vendor_order_id) = 14
|
||||||
|
`
|
||||||
|
sqlParams := []interface{}{realTime, model.OrderStatusFinished, model.VendorIDJX}
|
||||||
|
err = dao.GetRows(db, &goodsList, sql, sqlParams)
|
||||||
|
for _, v := range goodsList {
|
||||||
|
var (
|
||||||
|
goodsList2 []*model.GoodsOrder
|
||||||
|
finishedCount int
|
||||||
|
)
|
||||||
|
sql2 := "SELECT * FROM goods_order WHERE vendor_order_id LIKE ? OR vendor_order_id LIKE ? AND vendor_id = ? AND eclp_out_id <> '' AND LENGTH(vendor_order_id) = 16"
|
||||||
|
sqlParams2 := []interface{}{v.VendorOrderID + "0%", v.VendorOrderID + "1%", model.VendorIDJX}
|
||||||
|
err = dao.GetRows(db, &goodsList2, sql2, sqlParams2)
|
||||||
|
for _, vv := range goodsList2 {
|
||||||
|
if vv.Status != model.OrderStatusFinished {
|
||||||
|
queryOrderStatus, _ := api.JdEclpAPI.QueryOrderStatus(vv.EclpOutID)
|
||||||
|
if len(queryOrderStatus.OrderStatusList) > 0 {
|
||||||
|
if queryOrderStatus.OrderStatusList[len(queryOrderStatus.OrderStatusList)-1].SoStatusCode == jdeclpapi.SoStatusCode10034 {
|
||||||
|
dao.Begin(db)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
dao.Rollback(db)
|
||||||
|
panic(r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
vv.Status = model.OrderStatusFinished
|
||||||
|
dao.UpdateEntity(db, vv, "Status")
|
||||||
|
finishedCount++
|
||||||
|
dao.Commit(db)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
finishedCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if finishedCount == len(goodsList2) {
|
||||||
|
dao.Begin(db)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
dao.Rollback(db)
|
||||||
|
panic(r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
v.Status = model.OrderStatusFinished
|
||||||
|
dao.UpdateEntity(db, v, "Status")
|
||||||
|
dao.Commit(db)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func GetMatterOrderStatus(ctx *jxcontext.Context, vendorOrderID string) (result []*MatterOrderStatus, err error) {
|
func GetMatterOrderStatus(ctx *jxcontext.Context, vendorOrderID string) (result []*MatterOrderStatus, err error) {
|
||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
|
|||||||
@@ -218,6 +218,9 @@ dingdingSecret = "LWrZAFeqUfuVv7n_tc8vPpCAx6PT4CwManx2XCVhJOqGsx2L5XCDuX1sAN_Jtv
|
|||||||
|
|
||||||
dingdingCallbackURL = "http://callback.jxc4.com/dingding/msg"
|
dingdingCallbackURL = "http://callback.jxc4.com/dingding/msg"
|
||||||
|
|
||||||
|
yinbaoAppID = "18C0E0867E467DBC26EFF5E957B02EC4"
|
||||||
|
yinbaoAppKey = "682628966212343269"
|
||||||
|
|
||||||
[jxgy]
|
[jxgy]
|
||||||
httpport = 8088
|
httpport = 8088
|
||||||
EnableDocs = false
|
EnableDocs = false
|
||||||
@@ -287,6 +290,9 @@ jdEclpAccessToken = "7e9c1a5fe4ac4ea48c3c572d488e60b8hnwz"
|
|||||||
jdEclpAppKey = "0D397F05CF11C51BCDCC81744680EBC3"
|
jdEclpAppKey = "0D397F05CF11C51BCDCC81744680EBC3"
|
||||||
jdEclpAppSecret = "f16a5e57ff4f4f428b702c40d2d4b933"
|
jdEclpAppSecret = "f16a5e57ff4f4f428b702c40d2d4b933"
|
||||||
|
|
||||||
|
yinbaoAppID = "18C0E0867E467DBC26EFF5E957B02EC4"
|
||||||
|
yinbaoAppKey = "682628966212343269"
|
||||||
|
|
||||||
storeName = "京西果园"
|
storeName = "京西果园"
|
||||||
|
|
||||||
[test]
|
[test]
|
||||||
@@ -404,3 +410,6 @@ getWeixin2TokenURL = "http://www.jxc4.com/v2/sys/GetWX2Token"
|
|||||||
getWeimobTokenURL = "http://www.jxc4.com/v2/sys/GetWeimobToken"
|
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"
|
dbConnectStr = "root:WebServer@1@tcp(127.0.0.1:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true"
|
||||||
|
|
||||||
|
yinbaoAppID = "18C0E0867E467DBC26EFF5E957B02EC4"
|
||||||
|
yinbaoAppKey = "682628966212343269"
|
||||||
@@ -3,6 +3,8 @@ package api
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/tonglianpayapi"
|
"git.rosy.net.cn/baseapi/platformapi/tonglianpayapi"
|
||||||
@@ -58,6 +60,8 @@ var (
|
|||||||
WxpayAPI *wxpayapi.API // 微信支付API
|
WxpayAPI *wxpayapi.API // 微信支付API
|
||||||
TLpayAPI *tonglianpayapi.API //通联收银宝api
|
TLpayAPI *tonglianpayapi.API //通联收银宝api
|
||||||
|
|
||||||
|
YinBaoAPI *yinbaoapi.API //银豹平台api
|
||||||
|
|
||||||
WeixinPageAPI *weixinapi.API // 用户微信扫码登录
|
WeixinPageAPI *weixinapi.API // 用户微信扫码登录
|
||||||
|
|
||||||
AliPayAPI *alipayapi.API
|
AliPayAPI *alipayapi.API
|
||||||
@@ -156,6 +160,12 @@ func Init() {
|
|||||||
Ebai2API = nil
|
Ebai2API = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !beego.AppConfig.DefaultBool("disableYb", false) {
|
||||||
|
YinBaoAPI = yinbaoapi.New(beego.AppConfig.String("yinbaoAppKey"), beego.AppConfig.String("yinbaoAppID"))
|
||||||
|
} else {
|
||||||
|
YinBaoAPI = nil
|
||||||
|
}
|
||||||
|
|
||||||
if !beego.AppConfig.DefaultBool("disableMtps", false) {
|
if !beego.AppConfig.DefaultBool("disableMtps", false) {
|
||||||
MtpsAPI = mtpsapi.New(beego.AppConfig.String("mtpsAppKey"), beego.AppConfig.String("mtpsSecret"))
|
MtpsAPI = mtpsapi.New(beego.AppConfig.String("mtpsAppKey"), beego.AppConfig.String("mtpsSecret"))
|
||||||
// if mtpsStoreToken := beego.AppConfig.DefaultString("mtpsStoreToken", ""); mtpsStoreToken != "" {
|
// if mtpsStoreToken := beego.AppConfig.DefaultString("mtpsStoreToken", ""); mtpsStoreToken != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user