+jd.VenderAuditApplyCancelOrder

This commit is contained in:
gazebo
2019-12-17 15:55:46 +08:00
parent 6e3ee7c9c1
commit 64c7aec3c3
2 changed files with 26 additions and 25 deletions

View File

@@ -93,9 +93,6 @@ func (c *PurchaseHandler) onOrderMsg(vendorOrgCode string, msg *jdapi.CallbackOr
})
}
err := partner.CurOrderManager.OnOrderStatusChanged(vendorOrgCode, status)
// if globals.HandleLegacyJxOrder && err == nil {
// c.legacyJdOrderStatusChanged(status)
// }
retVal = jdapi.Err2CallbackResponse(err, status.VendorStatus)
}
}

View File

@@ -19,12 +19,12 @@ type DjswController struct {
beego.Controller
}
func (c *DjswController) handleMsg(isNeedDecode bool, handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) {
callbackMsg, mapData, callbackResponse := jdapi.GetCallbackMsg2(getUsefulRequest(c.Ctx))
func (c *DjswController) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) {
callbackMsg, mapData, callbackResponse := jdapi.GetCallbackMsg(getUsefulRequest(c.Ctx))
globals.SugarLogger.Debug(utils.Format4Output(callbackMsg, true))
if callbackResponse == nil {
if jdAPI := jd.GetAPI(jd.AppKey2OrgCode(callbackMsg.AppKey)); jdAPI != nil {
if callbackResponse = jdAPI.CheckCallbackValidation2(mapData, callbackMsg.Sign); callbackResponse == nil {
if callbackResponse = jdAPI.CheckCallbackValidation(mapData, callbackMsg.Sign); callbackResponse == nil {
callbackResponse = handler(jdAPI, callbackMsg.Param)
}
} else {
@@ -34,9 +34,9 @@ func (c *DjswController) handleMsg(isNeedDecode bool, handler func(*jdapi.API, i
return callbackResponse
}
func (c *DjswController) orderStatus(isCancelOrder bool) {
func (c *DjswController) orderStatus() {
if c.Ctx.Input.Method() == http.MethodPost {
callbackResponse := c.handleMsg(isCancelOrder, func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse = jd.OnOrderMsg(obj.(*jdapi.CallbackOrderMsg))
return callbackResponse
})
@@ -48,48 +48,52 @@ func (c *DjswController) orderStatus(isCancelOrder bool) {
}
func (c *DjswController) NewOrder() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) OrderAdjust() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) OrderWaitOutStore() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) PickFinishOrder() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) DeliveryOrder() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) FinishOrder() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) LockOrder() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) UnlockOrder() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) UserCancelOrder() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) ApplyCancelOrder() {
c.orderStatus(true)
c.orderStatus()
}
func (c *DjswController) VenderAuditApplyCancelOrder() {
c.orderStatus()
}
func (c *DjswController) PushDeliveryStatus() {
if c.Ctx.Input.Method() == http.MethodPost {
callbackResponse := c.handleMsg(true, func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse = jd.OnWaybillMsg(obj.(*jdapi.CallbackDeliveryStatusMsg))
return callbackResponse
})
@@ -101,7 +105,7 @@ func (c *DjswController) PushDeliveryStatus() {
}
func (c *DjswController) OrderCommentPush() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) Token() {
@@ -116,7 +120,7 @@ func (c *DjswController) Token() {
func (c *DjswController) StockIsHave() {
// globals.SugarLogger.Info(string(c.Ctx.Input.RequestBody))
if c.Ctx.Input.Method() == http.MethodPost {
callbackResponse := c.handleMsg(true, func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
return callbackResponse
})
c.Data["json"] = c.transferResponse("StockIsHave", callbackResponse)
@@ -128,7 +132,7 @@ func (c *DjswController) StockIsHave() {
func (c *DjswController) SinglePromoteCreate() {
if c.Ctx.Input.Method() == http.MethodPost {
callbackResponse := c.handleMsg(false, func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse = jd.OnActMsg(obj.(*jdapi.CallbackOrderMsg))
return callbackResponse
})
@@ -141,7 +145,7 @@ func (c *DjswController) SinglePromoteCreate() {
func (c *DjswController) StoreCrud() {
if c.Ctx.Input.Method() == http.MethodPost {
callbackResponse := c.handleMsg(false, func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse = jd.OnStoreMsg(obj.(*jdapi.CallbackOrderMsg))
return callbackResponse
})
@@ -188,11 +192,11 @@ func (c *DjswController) NewAfterSaleBill() {
}
func (c *DjswController) AfterSaleBillStatus() {
c.orderStatus(false)
c.orderStatus()
}
func (c *DjswController) OrderAccounting() {
c.orderStatus(false)
c.orderStatus()
}
func getUsefulRequest(ctx *context.Context) *http.Request {