39 lines
991 B
Go
39 lines
991 B
Go
package jd
|
|
|
|
import (
|
|
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
|
|
"git.rosy.net.cn/jx-callback/business/model"
|
|
)
|
|
|
|
var (
|
|
curPurchaseHandler *PurchaseHandler
|
|
)
|
|
|
|
type PurchaseHandler struct {
|
|
scheduler.BasePurchasePlatform
|
|
}
|
|
|
|
func init() {
|
|
curPurchaseHandler = new(PurchaseHandler)
|
|
scheduler.CurrentScheduler.RegisterPurchasePlatform(model.VendorIDJD, curPurchaseHandler)
|
|
}
|
|
|
|
func OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
|
return curPurchaseHandler.OnOrderMsg(msg)
|
|
}
|
|
|
|
func OnWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *jdapi.CallbackResponse) {
|
|
return curPurchaseHandler.OnWaybillMsg(msg)
|
|
}
|
|
|
|
func JdOperationTime2JxOperationTime(value1 interface{}) int {
|
|
value := int(utils.Interface2Int64WithDefault(value1, 0))
|
|
return (value/2)*100 + (value%2)*30
|
|
}
|
|
|
|
func JxOperationTime2JdOperationTime(value int) int {
|
|
return (value/100)*2 + (value % 30)
|
|
}
|