物料下单测试
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/jxstore/event"
|
"git.rosy.net.cn/jx-callback/business/jxstore/event"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/wxpayapi"
|
"git.rosy.net.cn/baseapi/platformapi/wxpayapi"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
@@ -594,47 +595,47 @@ func PickupGoods(order *model.GoodsOrder, isSelfDelivery bool, userName string)
|
|||||||
|
|
||||||
func orderSolutionForWuLiao(order *model.GoodsOrder) (err error) {
|
func orderSolutionForWuLiao(order *model.GoodsOrder) (err error) {
|
||||||
if order.FromStoreID != 0 {
|
if order.FromStoreID != 0 {
|
||||||
// var (
|
var (
|
||||||
// goodsNos []string
|
goodsNos []string
|
||||||
// prices []int
|
prices []int
|
||||||
// quantities []int
|
quantities []int
|
||||||
// db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
// )
|
)
|
||||||
err = changeOrderStatus(order.VendorOrderID, model.OrderStatusDelivering, "")
|
err = changeOrderStatus(order.VendorOrderID, model.OrderStatusDelivering, "")
|
||||||
// goods, err := dao.QueryOrders(db, order.VendorOrderID, -1, []int{model.VendorIDJX}, -1, utils.ZeroTimeValue, utils.ZeroTimeValue)
|
goods, err := dao.QueryOrders(db, order.VendorOrderID, -1, []int{model.VendorIDJX}, -1, utils.ZeroTimeValue, utils.ZeroTimeValue)
|
||||||
// if err != nil || len(goods) == 0 {
|
if err != nil || len(goods) == 0 {
|
||||||
// return err
|
return err
|
||||||
// }
|
}
|
||||||
// for _, v := range goods[0].Skus {
|
for _, v := range goods[0].Skus {
|
||||||
// skus, err := dao.GetSkus(db, []int{v.SkuID}, nil, nil, nil)
|
skus, err := dao.GetSkus(db, []int{v.SkuID}, nil, nil, nil)
|
||||||
// if err != nil || len(skus) == 0 {
|
if err != nil || len(skus) == 0 {
|
||||||
// continue
|
continue
|
||||||
// }
|
}
|
||||||
// goodsNos = append(goodsNos, skus[0].EclpID)
|
goodsNos = append(goodsNos, skus[0].EclpID)
|
||||||
// prices = append(prices, 0)
|
prices = append(prices, 0)
|
||||||
// quantities = append(quantities, v.Count)
|
quantities = append(quantities, v.Count)
|
||||||
// }
|
}
|
||||||
// result, err := api.JdEclpAPI.AddOrder(&jdeclpapi.AddOrderParam{
|
result, err := api.JdEclpAPI.AddOrder(&jdeclpapi.AddOrderParam{
|
||||||
// IsvUUID: order.VendorOrderID,
|
IsvUUID: order.VendorOrderID,
|
||||||
// IsvSource: jdeclpapi.IsvSource,
|
IsvSource: jdeclpapi.IsvSource,
|
||||||
// ShopNo: jdeclpapi.ShopNo,
|
ShopNo: jdeclpapi.ShopNo,
|
||||||
// DepartmentNo: jdeclpapi.DepartmentNo,
|
DepartmentNo: jdeclpapi.DepartmentNo,
|
||||||
// WarehouseNo: jdeclpapi.WarehouseNo,
|
WarehouseNo: jdeclpapi.WarehouseNo,
|
||||||
// SalesPlatformOrderNo: order.VendorOrderID,
|
SalesPlatformOrderNo: order.VendorOrderID,
|
||||||
// SalePlatformSource: "",
|
SalePlatformSource: jdeclpapi.SalePlatformSource,
|
||||||
// ConsigneeName: order.ConsigneeName,
|
ConsigneeName: order.ConsigneeName,
|
||||||
// ConsigneeMobile: order.ConsigneeMobile,
|
ConsigneeMobile: order.ConsigneeMobile,
|
||||||
// ConsigneeAddress: order.ConsigneeAddress,
|
ConsigneeAddress: order.ConsigneeAddress,
|
||||||
// OrderMark: jdeclpapi.OrderMark,
|
OrderMark: jdeclpapi.OrderMark,
|
||||||
// GoodsNo: goodsNos,
|
GoodsNo: goodsNos,
|
||||||
// Price: prices,
|
Price: prices,
|
||||||
// Quantity: quantities,
|
Quantity: quantities,
|
||||||
// })
|
})
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// return err
|
return err
|
||||||
// }
|
}
|
||||||
// order.EclpOutID = result.EclpSoNo
|
order.EclpOutID = result
|
||||||
// dao.UpdateEntity(db, order, "EclpOutID")
|
dao.UpdateEntity(db, order, "EclpOutID")
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,10 +170,9 @@ jd2Token = "29e0e567-c475-433a-aff0-37176ee8d8a7"
|
|||||||
jd2AppKey = "7fb947624ff847ae94ff2f068cc99652"
|
jd2AppKey = "7fb947624ff847ae94ff2f068cc99652"
|
||||||
jd2Secret = "1097abd7ef09427099b4922784af123a"
|
jd2Secret = "1097abd7ef09427099b4922784af123a"
|
||||||
|
|
||||||
jdEclpAccessToken = ""
|
jdEclpAccessToken = "7e9c1a5fe4ac4ea48c3c572d488e60b8hnwz"
|
||||||
jdEclpAppKey = "0D397F05CF11C51BCDCC81744680EBC3"
|
jdEclpAppKey = "0D397F05CF11C51BCDCC81744680EBC3"
|
||||||
jdEclpAppSecret = "f16a5e57ff4f4f428b702c40d2d4b933"
|
jdEclpAppSecret = "f16a5e57ff4f4f428b702c40d2d4b933"
|
||||||
jdEclpRedirectUri = ""
|
|
||||||
|
|
||||||
elmIsProd = true
|
elmIsProd = true
|
||||||
elmToken = ""
|
elmToken = ""
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ func Init() {
|
|||||||
JdAPI = nil
|
JdAPI = nil
|
||||||
}
|
}
|
||||||
if !beego.AppConfig.DefaultBool("disableJdEclp", false) {
|
if !beego.AppConfig.DefaultBool("disableJdEclp", false) {
|
||||||
JdEclpAPI = jdeclpapi.New(beego.AppConfig.String("jdEclpAccessToken"), beego.AppConfig.String("jdEclpAppKey"), beego.AppConfig.String("jdEclpAppSecret"), beego.AppConfig.String("jdEclpRedirectUri"))
|
JdEclpAPI = jdeclpapi.New(beego.AppConfig.String("jdEclpAccessToken"), beego.AppConfig.String("jdEclpAppKey"), beego.AppConfig.String("jdEclpAppSecret"))
|
||||||
} else {
|
} else {
|
||||||
JdEclpAPI = nil
|
JdEclpAPI = nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user