物料下单测试
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/globals"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/wxpayapi"
|
||||
|
||||
"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) {
|
||||
if order.FromStoreID != 0 {
|
||||
// var (
|
||||
// goodsNos []string
|
||||
// prices []int
|
||||
// quantities []int
|
||||
// db = dao.GetDB()
|
||||
// )
|
||||
var (
|
||||
goodsNos []string
|
||||
prices []int
|
||||
quantities []int
|
||||
db = dao.GetDB()
|
||||
)
|
||||
err = changeOrderStatus(order.VendorOrderID, model.OrderStatusDelivering, "")
|
||||
// goods, err := dao.QueryOrders(db, order.VendorOrderID, -1, []int{model.VendorIDJX}, -1, utils.ZeroTimeValue, utils.ZeroTimeValue)
|
||||
// if err != nil || len(goods) == 0 {
|
||||
// return err
|
||||
// }
|
||||
// for _, v := range goods[0].Skus {
|
||||
// skus, err := dao.GetSkus(db, []int{v.SkuID}, nil, nil, nil)
|
||||
// if err != nil || len(skus) == 0 {
|
||||
// continue
|
||||
// }
|
||||
// goodsNos = append(goodsNos, skus[0].EclpID)
|
||||
// prices = append(prices, 0)
|
||||
// quantities = append(quantities, v.Count)
|
||||
// }
|
||||
// result, err := api.JdEclpAPI.AddOrder(&jdeclpapi.AddOrderParam{
|
||||
// IsvUUID: order.VendorOrderID,
|
||||
// IsvSource: jdeclpapi.IsvSource,
|
||||
// ShopNo: jdeclpapi.ShopNo,
|
||||
// DepartmentNo: jdeclpapi.DepartmentNo,
|
||||
// WarehouseNo: jdeclpapi.WarehouseNo,
|
||||
// SalesPlatformOrderNo: order.VendorOrderID,
|
||||
// SalePlatformSource: "",
|
||||
// ConsigneeName: order.ConsigneeName,
|
||||
// ConsigneeMobile: order.ConsigneeMobile,
|
||||
// ConsigneeAddress: order.ConsigneeAddress,
|
||||
// OrderMark: jdeclpapi.OrderMark,
|
||||
// GoodsNo: goodsNos,
|
||||
// Price: prices,
|
||||
// Quantity: quantities,
|
||||
// })
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// order.EclpOutID = result.EclpSoNo
|
||||
// dao.UpdateEntity(db, order, "EclpOutID")
|
||||
goods, err := dao.QueryOrders(db, order.VendorOrderID, -1, []int{model.VendorIDJX}, -1, utils.ZeroTimeValue, utils.ZeroTimeValue)
|
||||
if err != nil || len(goods) == 0 {
|
||||
return err
|
||||
}
|
||||
for _, v := range goods[0].Skus {
|
||||
skus, err := dao.GetSkus(db, []int{v.SkuID}, nil, nil, nil)
|
||||
if err != nil || len(skus) == 0 {
|
||||
continue
|
||||
}
|
||||
goodsNos = append(goodsNos, skus[0].EclpID)
|
||||
prices = append(prices, 0)
|
||||
quantities = append(quantities, v.Count)
|
||||
}
|
||||
result, err := api.JdEclpAPI.AddOrder(&jdeclpapi.AddOrderParam{
|
||||
IsvUUID: order.VendorOrderID,
|
||||
IsvSource: jdeclpapi.IsvSource,
|
||||
ShopNo: jdeclpapi.ShopNo,
|
||||
DepartmentNo: jdeclpapi.DepartmentNo,
|
||||
WarehouseNo: jdeclpapi.WarehouseNo,
|
||||
SalesPlatformOrderNo: order.VendorOrderID,
|
||||
SalePlatformSource: jdeclpapi.SalePlatformSource,
|
||||
ConsigneeName: order.ConsigneeName,
|
||||
ConsigneeMobile: order.ConsigneeMobile,
|
||||
ConsigneeAddress: order.ConsigneeAddress,
|
||||
OrderMark: jdeclpapi.OrderMark,
|
||||
GoodsNo: goodsNos,
|
||||
Price: prices,
|
||||
Quantity: quantities,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
order.EclpOutID = result
|
||||
dao.UpdateEntity(db, order, "EclpOutID")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -170,10 +170,9 @@ jd2Token = "29e0e567-c475-433a-aff0-37176ee8d8a7"
|
||||
jd2AppKey = "7fb947624ff847ae94ff2f068cc99652"
|
||||
jd2Secret = "1097abd7ef09427099b4922784af123a"
|
||||
|
||||
jdEclpAccessToken = ""
|
||||
jdEclpAccessToken = "7e9c1a5fe4ac4ea48c3c572d488e60b8hnwz"
|
||||
jdEclpAppKey = "0D397F05CF11C51BCDCC81744680EBC3"
|
||||
jdEclpAppSecret = "f16a5e57ff4f4f428b702c40d2d4b933"
|
||||
jdEclpRedirectUri = ""
|
||||
|
||||
elmIsProd = true
|
||||
elmToken = ""
|
||||
|
||||
@@ -108,7 +108,7 @@ func Init() {
|
||||
JdAPI = nil
|
||||
}
|
||||
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 {
|
||||
JdEclpAPI = nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user