- up
This commit is contained in:
@@ -1159,6 +1159,7 @@ func UpdateOrCreateCourierStores(ctx *jxcontext.Context, storeID int, isForceUpd
|
|||||||
if isNeedAdd {
|
if isNeedAdd {
|
||||||
storeDetail.VendorID = vendorID
|
storeDetail.VendorID = vendorID
|
||||||
storeDetail.VendorStoreID = utils.Int2Str(storeDetail.ID)
|
storeDetail.VendorStoreID = utils.Int2Str(storeDetail.ID)
|
||||||
|
storeDetail.AuditStatus = model.StoreAuditStatusCreated
|
||||||
}
|
}
|
||||||
if _, err = updateOrCreateCourierStore(ctx, storeDetail); err == nil && isNeedAdd {
|
if _, err = updateOrCreateCourierStore(ctx, storeDetail); err == nil && isNeedAdd {
|
||||||
storeCourier := &model.StoreCourierMap{
|
storeCourier := &model.StoreCourierMap{
|
||||||
|
|||||||
@@ -20,14 +20,20 @@ var (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func getAuditStatus(vendorAuditStatus int) int {
|
||||||
|
if auditStatus, ok := auditStatusMap[vendorAuditStatus]; ok {
|
||||||
|
return auditStatus
|
||||||
|
}
|
||||||
|
return model.StoreAuditStatusCreated
|
||||||
|
}
|
||||||
|
|
||||||
func OnStoreStatus(msg *mtpsapi.CallbackShopStatusMsg) (retVal *mtpsapi.CallbackResponse) {
|
func OnStoreStatus(msg *mtpsapi.CallbackShopStatusMsg) (retVal *mtpsapi.CallbackResponse) {
|
||||||
return curDeliveryHandler.OnStoreStatus(msg)
|
return curDeliveryHandler.OnStoreStatus(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DeliveryHandler) OnStoreStatus(msg *mtpsapi.CallbackShopStatusMsg) (retVal *mtpsapi.CallbackResponse) {
|
func (c *DeliveryHandler) OnStoreStatus(msg *mtpsapi.CallbackShopStatusMsg) (retVal *mtpsapi.CallbackResponse) {
|
||||||
globals.SugarLogger.Debugf("mtps OnStoreStatus, msg:%s", utils.Format4Output(msg, true))
|
globals.SugarLogger.Debugf("mtps OnStoreStatus, msg:%s", utils.Format4Output(msg, true))
|
||||||
auditStatus := auditStatusMap[msg.Status]
|
err := partner.CurStoreManager.OnCourierStoreStatusChanged(jxcontext.AdminCtx, msg.ShopID, model.VendorIDMTPS, getAuditStatus(msg.Status))
|
||||||
err := partner.CurStoreManager.OnCourierStoreStatusChanged(jxcontext.AdminCtx, msg.ShopID, model.VendorIDMTPS, auditStatus)
|
|
||||||
retVal = mtpsapi.Err2CallbackResponse(err, "mtps OnStoreStatus")
|
retVal = mtpsapi.Err2CallbackResponse(err, "mtps OnStoreStatus")
|
||||||
return retVal
|
return retVal
|
||||||
}
|
}
|
||||||
@@ -57,7 +63,7 @@ func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.S
|
|||||||
shopStatus, err = api.MtpsAPI.ShopCreate(shopInfo)
|
shopStatus, err = api.MtpsAPI.ShopCreate(shopInfo)
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
status = auditStatusMap[shopStatus]
|
status = getAuditStatus(shopStatus)
|
||||||
}
|
}
|
||||||
return "", status, err
|
return "", status, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user