- 添加空JD回调消息
This commit is contained in:
@@ -216,6 +216,13 @@ const (
|
|||||||
OrderStatusEndBegin = 100 // 以下的状态就是结束状态
|
OrderStatusEndBegin = 100 // 以下的状态就是结束状态
|
||||||
OrderStatusFinished = 110 // 订单已完成
|
OrderStatusFinished = 110 // 订单已完成
|
||||||
OrderStatusCanceled = 115 // 订单已取消
|
OrderStatusCanceled = 115 // 订单已取消
|
||||||
|
|
||||||
|
AfsOrderStatusWait4Approve = 150 // 待审核售后单
|
||||||
|
AfsOrderStatusNew = 155 // 已审核售后单,或不需要审核的新售后单
|
||||||
|
AfsOrderStatusWait4ReceiveGoods = 160 // 退款退货的,需要商家确认收到货
|
||||||
|
AfsOrderStatusReceivedGoods = 162 // 已确认收到货
|
||||||
|
AfsOrderStatusFinished = 180 // 售后单成功完成
|
||||||
|
AfsOrderStatusFailed = 190 // 售后单失败
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -290,6 +297,26 @@ const (
|
|||||||
OrderFlagMaskCallPMCourier = 64 // 取货失败后召唤平台配送
|
OrderFlagMaskCallPMCourier = 64 // 取货失败后召唤平台配送
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
AfsAppealTypeRefund = 1 // 仅退款
|
||||||
|
AfsAppealTypeReturnAndRefund = 2 // 退货退款
|
||||||
|
AfsAppealTypeNewGoods = 3 // 重发新商品(即京东到家的直赔)
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
AfsReasonTypeGoodsQuality = 1 // 商品质量
|
||||||
|
AfsReasonTypeWrongGoods = 2 // 错误的商品
|
||||||
|
AfsReasonTypeMissingGoods = 3 // 缺少部分商品
|
||||||
|
AfsReasonTypeNoGoods = 4 // 全部商品未收到
|
||||||
|
AfsReasonTypeDamagedGoods = 5 // 商品有损伤
|
||||||
|
AfsReasonTypeGoodsQuantity = 6 // 缺斤少两
|
||||||
|
AfsReasonTypeAgreedByMerchant = 7 // 与商家协商一致
|
||||||
|
AfsReasonTypeGoodsNoSame = 8 // 商品与描述不符
|
||||||
|
AfsReasonWrongPurchase = 9 // 误购
|
||||||
|
AfsReasonNotReceivedIntime = 10 // 未在时效内送达
|
||||||
|
AfsReasonNotOthers = 20 // 其它
|
||||||
|
)
|
||||||
|
|
||||||
func IsPurchaseVendorExist(vendorID int) bool {
|
func IsPurchaseVendorExist(vendorID int) bool {
|
||||||
_, ok := VendorNames[vendorID]
|
_, ok := VendorNames[vendorID]
|
||||||
return ok && vendorID >= VendorIDPurchaseBegin && vendorID <= VendorIDPurchaseEnd
|
return ok && vendorID >= VendorIDPurchaseBegin && vendorID <= VendorIDPurchaseEnd
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ type GoodsOrder struct {
|
|||||||
SkuCount int `json:"skuCount"` // 商品类别数量,即有多少种商品(注意在某些情况下,相同SKU的商品由于售价不同,也会当成不同商品在这个值里)
|
SkuCount int `json:"skuCount"` // 商品类别数量,即有多少种商品(注意在某些情况下,相同SKU的商品由于售价不同,也会当成不同商品在这个值里)
|
||||||
GoodsCount int `json:"goodsCount"` // 商品个数
|
GoodsCount int `json:"goodsCount"` // 商品个数
|
||||||
Status int `json:"status"` // 参见OrderStatus*相关的常量定义
|
Status int `json:"status"` // 参见OrderStatus*相关的常量定义
|
||||||
VendorStatus string `orm:"size(255)" json:"-"`
|
VendorStatus string `orm:"size(255)" json:"vendorStatus"`
|
||||||
LockStatus int `json:"lockStatus"`
|
LockStatus int `json:"lockStatus"`
|
||||||
LockStatusTime time.Time `orm:"type(datetime);null" json:"lockStatusTime"` // last lock status time
|
LockStatusTime time.Time `orm:"type(datetime);null" json:"lockStatusTime"` // last lock status time
|
||||||
OrderSeq int `json:"orderSeq"` // 门店订单序号
|
OrderSeq int `json:"orderSeq"` // 门店订单序号
|
||||||
|
|||||||
@@ -78,6 +78,17 @@ type AfsOrder struct {
|
|||||||
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"` // 外部系统里记录的storeid
|
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"` // 外部系统里记录的storeid
|
||||||
StoreID int `orm:"column(store_id)" json:"storeID"` // 接口返回的京西门店ID
|
StoreID int `orm:"column(store_id)" json:"storeID"` // 接口返回的京西门店ID
|
||||||
JxStoreID int `orm:"column(jx_store_id)" json:"jxStoreID"` // 根据VendorStoreID在本地系统里查询出来的 jxstoreid
|
JxStoreID int `orm:"column(jx_store_id)" json:"jxStoreID"` // 根据VendorStoreID在本地系统里查询出来的 jxstoreid
|
||||||
|
|
||||||
|
// Status int `json:"status"`
|
||||||
|
// VendorStatus string `orm:"size(255)" json:"vendorStatus"`
|
||||||
|
// ReasonType int8 `json:"reasonType"` // 售后原因
|
||||||
|
// VendorReasonType string `orm:"size(255)" json:"vendorReasonType"`
|
||||||
|
// ReasonDesc string `orm:"size(1024)" json:"reasonDesc"` // 售后原因描述
|
||||||
|
// ReasonImgList string `orm:"size(1024)" json:"reasonImgList"` // 售后描述图片
|
||||||
|
// AppealType int8 `json:"appealType"` // 售后方式
|
||||||
|
// VendorAppealType string `orm:"size(255)" json:"vendorAppealType"`
|
||||||
|
// Flag int `json:"flag"`
|
||||||
|
|
||||||
SkuUserMoney int64 `json:"skuUserMoney"` // 用户支付菜品金额
|
SkuUserMoney int64 `json:"skuUserMoney"` // 用户支付菜品金额
|
||||||
FreightUserMoney int64 `json:"freightUserMoney"` // 用户支付运费金额
|
FreightUserMoney int64 `json:"freightUserMoney"` // 用户支付运费金额
|
||||||
AfsFreightMoney int64 `json:"afsFreightMoney"` // 退货取件费
|
AfsFreightMoney int64 `json:"afsFreightMoney"` // 退货取件费
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func OnStoreMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
|||||||
return retVal
|
return retVal
|
||||||
}
|
}
|
||||||
|
|
||||||
func OnAfterSaleMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
func OnFinancialMsg2(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||||
if curPurchaseHandler != nil {
|
if curPurchaseHandler != nil {
|
||||||
utils.CallFuncAsync(func() {
|
utils.CallFuncAsync(func() {
|
||||||
OnFinancialMsg(msg)
|
OnFinancialMsg(msg)
|
||||||
|
|||||||
@@ -158,30 +158,52 @@ func (c *DjswController) transferResponse(inCallbackResponse *jdapi.CallbackResp
|
|||||||
return inCallbackResponse
|
return inCallbackResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) afterSaleBillStatus() {
|
func (c *DjswController) EndOrderFinance() {
|
||||||
|
c.nullOperation()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) FinanceAdjustment() {
|
||||||
|
c.nullOperation()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) DeliveryCarrierModify() {
|
||||||
|
c.nullOperation()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) NewApplyAfterSaleBill() {
|
||||||
|
c.nullOperation()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) UpdateApplyAfterSaleBill() {
|
||||||
|
c.nullOperation()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) NewAfterSaleBill() {
|
||||||
|
c.nullOperation()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) AfterSaleBillStatus() {
|
||||||
|
// c.orderStatus(false)
|
||||||
|
c.OrderAccounting()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) OrderAccounting() {
|
||||||
var obj *jdapi.CallbackOrderMsg
|
var obj *jdapi.CallbackOrderMsg
|
||||||
var callbackResponse *jdapi.CallbackResponse
|
var callbackResponse *jdapi.CallbackResponse
|
||||||
obj, callbackResponse = api.JdAPI.GetOrderCallbackMsg(getUsefulRequest(c.Ctx))
|
obj, callbackResponse = api.JdAPI.GetOrderCallbackMsg(getUsefulRequest(c.Ctx))
|
||||||
if callbackResponse == nil {
|
if callbackResponse == nil {
|
||||||
callbackResponse = jd.OnAfterSaleMsg(obj)
|
callbackResponse = jd.OnFinancialMsg2(obj)
|
||||||
}
|
}
|
||||||
c.Data["json"] = c.transferResponse(callbackResponse)
|
c.Data["json"] = c.transferResponse(callbackResponse)
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
// func (c *DjswController) NewAfterSaleBill() {
|
|
||||||
// c.afterSaleBillStatus()
|
|
||||||
// }
|
|
||||||
|
|
||||||
func (c *DjswController) AfterSaleBillStatus() {
|
|
||||||
c.afterSaleBillStatus()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *DjswController) OrderAccounting() {
|
|
||||||
c.afterSaleBillStatus()
|
|
||||||
}
|
|
||||||
|
|
||||||
func getUsefulRequest(ctx *context.Context) *http.Request {
|
func getUsefulRequest(ctx *context.Context) *http.Request {
|
||||||
ctx.Request.Body = ioutil.NopCloser(bytes.NewReader(ctx.Input.RequestBody))
|
ctx.Request.Body = ioutil.NopCloser(bytes.NewReader(ctx.Input.RequestBody))
|
||||||
return ctx.Request
|
return ctx.Request
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) nullOperation() {
|
||||||
|
c.Data["json"] = c.transferResponse(nil)
|
||||||
|
c.ServeJSON()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user