整理京西自有PHP商城相关的代码
This commit is contained in:
45
business/partner/purchase/jx/phpjx/jxapi_order.go
Normal file
45
business/partner/purchase/jx/phpjx/jxapi_order.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package phpjx
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
var (
|
||||
orderStatusMap = map[int]int{
|
||||
model.OrderStatusFinishedPickup: 7,
|
||||
model.OrderStatusDelivering: 8,
|
||||
// 4,
|
||||
model.OrderStatusFinished: 3,
|
||||
model.OrderStatusCanceled: 3,
|
||||
}
|
||||
)
|
||||
|
||||
func translateOrderStatus(status int) (outStatus int) {
|
||||
return status //orderStatusMap[status]
|
||||
}
|
||||
|
||||
func (a *API) NotifyOrderStatusChanged(order *model.GoodsOrder) (err error) {
|
||||
status := translateOrderStatus(order.Status)
|
||||
if status > 0 {
|
||||
_, err = a.AccessAPI("orderChangeStatus", map[string]interface{}{
|
||||
"orderid": order.VendorOrderID,
|
||||
"status": status,
|
||||
"data": "", //string(utils.MustMarshal(order)),
|
||||
}, "")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (a *API) NotifyAfsOrderStatusChanged(afsOrder *model.AfsOrder) (err error) {
|
||||
status := translateOrderStatus(afsOrder.Status)
|
||||
if status > 0 {
|
||||
_, err = a.AccessAPI("afsOrderChangeStatus", map[string]interface{}{
|
||||
"orderid": afsOrder.VendorOrderID,
|
||||
"afsOrderID": afsOrder.AfsOrderID,
|
||||
"status": status,
|
||||
"data": "", //string(utils.MustMarshal(order)),
|
||||
}, "")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user