+jd.VenderAuditApplyCancelOrder
This commit is contained in:
@@ -93,9 +93,6 @@ func (c *PurchaseHandler) onOrderMsg(vendorOrgCode string, msg *jdapi.CallbackOr
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
err := partner.CurOrderManager.OnOrderStatusChanged(vendorOrgCode, status)
|
err := partner.CurOrderManager.OnOrderStatusChanged(vendorOrgCode, status)
|
||||||
// if globals.HandleLegacyJxOrder && err == nil {
|
|
||||||
// c.legacyJdOrderStatusChanged(status)
|
|
||||||
// }
|
|
||||||
retVal = jdapi.Err2CallbackResponse(err, status.VendorStatus)
|
retVal = jdapi.Err2CallbackResponse(err, status.VendorStatus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ type DjswController struct {
|
|||||||
beego.Controller
|
beego.Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) handleMsg(isNeedDecode bool, handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) {
|
func (c *DjswController) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) {
|
||||||
callbackMsg, mapData, callbackResponse := jdapi.GetCallbackMsg2(getUsefulRequest(c.Ctx))
|
callbackMsg, mapData, callbackResponse := jdapi.GetCallbackMsg(getUsefulRequest(c.Ctx))
|
||||||
globals.SugarLogger.Debug(utils.Format4Output(callbackMsg, true))
|
globals.SugarLogger.Debug(utils.Format4Output(callbackMsg, true))
|
||||||
if callbackResponse == nil {
|
if callbackResponse == nil {
|
||||||
if jdAPI := jd.GetAPI(jd.AppKey2OrgCode(callbackMsg.AppKey)); jdAPI != 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)
|
callbackResponse = handler(jdAPI, callbackMsg.Param)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -34,9 +34,9 @@ func (c *DjswController) handleMsg(isNeedDecode bool, handler func(*jdapi.API, i
|
|||||||
return callbackResponse
|
return callbackResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) orderStatus(isCancelOrder bool) {
|
func (c *DjswController) orderStatus() {
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
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))
|
callbackResponse = jd.OnOrderMsg(obj.(*jdapi.CallbackOrderMsg))
|
||||||
return callbackResponse
|
return callbackResponse
|
||||||
})
|
})
|
||||||
@@ -48,48 +48,52 @@ func (c *DjswController) orderStatus(isCancelOrder bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) NewOrder() {
|
func (c *DjswController) NewOrder() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) OrderAdjust() {
|
func (c *DjswController) OrderAdjust() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) OrderWaitOutStore() {
|
func (c *DjswController) OrderWaitOutStore() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) PickFinishOrder() {
|
func (c *DjswController) PickFinishOrder() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) DeliveryOrder() {
|
func (c *DjswController) DeliveryOrder() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) FinishOrder() {
|
func (c *DjswController) FinishOrder() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) LockOrder() {
|
func (c *DjswController) LockOrder() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) UnlockOrder() {
|
func (c *DjswController) UnlockOrder() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) UserCancelOrder() {
|
func (c *DjswController) UserCancelOrder() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) ApplyCancelOrder() {
|
func (c *DjswController) ApplyCancelOrder() {
|
||||||
c.orderStatus(true)
|
c.orderStatus()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *DjswController) VenderAuditApplyCancelOrder() {
|
||||||
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) PushDeliveryStatus() {
|
func (c *DjswController) PushDeliveryStatus() {
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
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))
|
callbackResponse = jd.OnWaybillMsg(obj.(*jdapi.CallbackDeliveryStatusMsg))
|
||||||
return callbackResponse
|
return callbackResponse
|
||||||
})
|
})
|
||||||
@@ -101,7 +105,7 @@ func (c *DjswController) PushDeliveryStatus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) OrderCommentPush() {
|
func (c *DjswController) OrderCommentPush() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) Token() {
|
func (c *DjswController) Token() {
|
||||||
@@ -116,7 +120,7 @@ func (c *DjswController) Token() {
|
|||||||
func (c *DjswController) StockIsHave() {
|
func (c *DjswController) StockIsHave() {
|
||||||
// globals.SugarLogger.Info(string(c.Ctx.Input.RequestBody))
|
// globals.SugarLogger.Info(string(c.Ctx.Input.RequestBody))
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
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
|
return callbackResponse
|
||||||
})
|
})
|
||||||
c.Data["json"] = c.transferResponse("StockIsHave", callbackResponse)
|
c.Data["json"] = c.transferResponse("StockIsHave", callbackResponse)
|
||||||
@@ -128,7 +132,7 @@ func (c *DjswController) StockIsHave() {
|
|||||||
|
|
||||||
func (c *DjswController) SinglePromoteCreate() {
|
func (c *DjswController) SinglePromoteCreate() {
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
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))
|
callbackResponse = jd.OnActMsg(obj.(*jdapi.CallbackOrderMsg))
|
||||||
return callbackResponse
|
return callbackResponse
|
||||||
})
|
})
|
||||||
@@ -141,7 +145,7 @@ func (c *DjswController) SinglePromoteCreate() {
|
|||||||
|
|
||||||
func (c *DjswController) StoreCrud() {
|
func (c *DjswController) StoreCrud() {
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
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))
|
callbackResponse = jd.OnStoreMsg(obj.(*jdapi.CallbackOrderMsg))
|
||||||
return callbackResponse
|
return callbackResponse
|
||||||
})
|
})
|
||||||
@@ -188,11 +192,11 @@ func (c *DjswController) NewAfterSaleBill() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) AfterSaleBillStatus() {
|
func (c *DjswController) AfterSaleBillStatus() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) OrderAccounting() {
|
func (c *DjswController) OrderAccounting() {
|
||||||
c.orderStatus(false)
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func getUsefulRequest(ctx *context.Context) *http.Request {
|
func getUsefulRequest(ctx *context.Context) *http.Request {
|
||||||
|
|||||||
Reference in New Issue
Block a user