京东商城订单,商品审核暂停一下
This commit is contained in:
@@ -1043,12 +1043,19 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o
|
||||
StoreName: jdsOrder.StoreName,
|
||||
OrderCreatedAt: utils.Str2Time(jdsOrder.OrderCreateTime + ":00"),
|
||||
ConsigneeAddress: orderDetail.ConsigneeAddress,
|
||||
ConsigneeMobile: orderDetail.ConsigneeMobile,
|
||||
ConsigneeName: orderDetail.ConsigneeName,
|
||||
ActualPayPrice: orderDetail.ActualPayPrice,
|
||||
Status: model.OrderStatusNew,
|
||||
TotalShopMoney: utils.Float64TwoInt64(math.Round(utils.Int64ToFloat64(orderDetail.ActualPayPrice) * jdshopapi.JdsPayPercentage)),
|
||||
}
|
||||
//获取真实手机号
|
||||
fakeMobile, err := api.JdShopAPI.PhoneSensltiveInfo(order.VendorOrderID2, orderDetail.MobileKey)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("jds PhoneSensltiveInfo error: %v", err.Error())
|
||||
continue
|
||||
} else {
|
||||
order.ConsigneeMobile = jxutils.DecryptDESECB([]byte(fakeMobile), []byte(jdshopapi.JdsMobileKey))
|
||||
}
|
||||
if order.TotalShopMoney < 100 {
|
||||
order.TotalShopMoney = 100
|
||||
}
|
||||
|
||||
@@ -4479,6 +4479,7 @@ func GetStoreSkuAudit(ctx *jxcontext.Context, storeIDs, nameIDs, skuIDs, statuss
|
||||
|
||||
func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*StoreSkuBindInfo) (isAudit bool, err error) {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit storeIDs: %v", storeIDs)
|
||||
time.Sleep(time.Second / 5)
|
||||
db := dao.GetDB()
|
||||
for _, storeID := range storeIDs {
|
||||
for _, skuBindInfo := range skuBindInfos {
|
||||
|
||||
@@ -3,6 +3,8 @@ package jxutils
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/aes"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
@@ -882,3 +884,35 @@ func TranslateSoundSize(vendorID, soundPercentage int) (soundSize string) {
|
||||
}
|
||||
return soundSize
|
||||
}
|
||||
|
||||
//ECB,AES模式解密
|
||||
//目前就京东商城订单手机号解密用
|
||||
func DecryptDESECB(d, key []byte) string {
|
||||
data, err := base64.StdEncoding.DecodeString(string(d))
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
bs := block.BlockSize()
|
||||
if len(data)%bs != 0 {
|
||||
return ""
|
||||
}
|
||||
out := make([]byte, len(data))
|
||||
dst := out
|
||||
for len(data) > 0 {
|
||||
block.Decrypt(dst, data[:bs])
|
||||
data = data[bs:]
|
||||
dst = dst[bs:]
|
||||
}
|
||||
out = PKCS5UnPadding(out)
|
||||
return string(out)
|
||||
}
|
||||
|
||||
func PKCS5UnPadding(origData []byte) []byte {
|
||||
length := len(origData)
|
||||
unpadding := int(origData[length-1])
|
||||
return origData[:(length - unpadding)]
|
||||
}
|
||||
|
||||
82
business/partner/delivery/jdeclp/waybill.go
Normal file
82
business/partner/delivery/jdeclp/waybill.go
Normal file
@@ -0,0 +1,82 @@
|
||||
package jdeclp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
var (
|
||||
CurDeliveryHandler *DeliveryHandler
|
||||
)
|
||||
|
||||
type DeliveryHandler struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
CurDeliveryHandler = new(DeliveryHandler)
|
||||
partner.RegisterDeliveryPlatform(CurDeliveryHandler, true)
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetVendorID() int {
|
||||
return model.VendorIDJDWL
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (vendorStoreID string, status int, err error) {
|
||||
return vendorStoreID, status, err
|
||||
}
|
||||
func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorStoreID string) (storeDetail *dao.StoreDetail2, err error) {
|
||||
return storeDetail, err
|
||||
}
|
||||
func (c *DeliveryHandler) IsErrStoreNotExist(err error) bool {
|
||||
return false
|
||||
}
|
||||
func (c *DeliveryHandler) IsErrStoreExist(err error) bool {
|
||||
return false
|
||||
}
|
||||
func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, maxDeliveryFee int64) (bill *model.Waybill, err error) {
|
||||
storeID := jxutils.GetShowStoreIDFromOrder(order)
|
||||
stores, err := dao.GetStoreList(dao.GetDB(), []int{storeID}, nil, nil, nil, "")
|
||||
if len(stores) == 0 || err != nil {
|
||||
return bill, fmt.Errorf("未查询到该门店! 门店id :[%v]", storeID)
|
||||
}
|
||||
_, err = api.JdEclpAPI.WaybillReceive(&jdeclpapi.WaybillReceiveParam{
|
||||
SalePlat: jdeclpapi.SalePlatSourceDelivery,
|
||||
CustomerCode: jdeclpapi.CustomerCode,
|
||||
OrderID: order.VendorOrderID,
|
||||
SenderName: order.StoreName,
|
||||
SenderAddress: stores[0].Address,
|
||||
SenderTel: stores[0].Tel1,
|
||||
ReceiveName: order.ConsigneeName,
|
||||
ReceiveAddress: order.ConsigneeAddress,
|
||||
ReceiveTel: order.ConsigneeMobile,
|
||||
Weight: order.Weight,
|
||||
Vloumn: order.Weight,
|
||||
PackageCount: 1,
|
||||
Description: "生鲜",
|
||||
})
|
||||
// partner.CurOrderManager.OnWaybillStatusChanged(order)
|
||||
return bill, err
|
||||
}
|
||||
func (c *DeliveryHandler) CancelWaybill(bill *model.Waybill, cancelReasonID int, cancelReason string) (err error) {
|
||||
err = api.JdEclpAPI.CancelWayBill(&jdeclpapi.CancelWayBillParam{
|
||||
WaybillCode: bill.VendorWaybillID,
|
||||
CustomerCode: jdeclpapi.CustomerCode,
|
||||
Source: "JOS",
|
||||
CancelReason: cancelReason,
|
||||
OperatorName: "jxadmin",
|
||||
})
|
||||
return err
|
||||
}
|
||||
func (c *DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInfo *partner.WaybillFeeInfo, err error) {
|
||||
return deliveryFeeInfo, err
|
||||
}
|
||||
func (c *DeliveryHandler) ComplaintRider(bill *model.Waybill, resonID int, resonContent string) (err error) {
|
||||
return err
|
||||
}
|
||||
1
business/partner/delivery/jdeclp/waybill_test.go
Normal file
1
business/partner/delivery/jdeclp/waybill_test.go
Normal file
@@ -0,0 +1 @@
|
||||
package jdeclp
|
||||
Reference in New Issue
Block a user