- 重构RefreshOrderRealMobile

This commit is contained in:
gazebo
2019-03-28 15:09:23 +08:00
parent cd99fc3e14
commit 24af4bc330
8 changed files with 78 additions and 63 deletions

View File

@@ -8,10 +8,10 @@ import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler/defsch"
"git.rosy.net.cn/jx-callback/business/jxstore/misc"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/partner"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego"
)
@@ -290,13 +290,9 @@ func (c *OrderController) GetOrderStatusList() {
// @router /RefreshOrderRealMobile [put]
func (c *OrderController) RefreshOrderRealMobile() {
c.callRefreshOrderRealMobile(func(params *tOrderRefreshOrderRealMobileParams) (retVal interface{}, errCode string, err error) {
if handler := partner.GetPurchasePlatformFromVendorID(params.VendorID); handler != nil {
timeList, err2 := jxutils.BatchStr2Time(params.FromTime, params.ToTime)
if err = err2; err == nil {
retVal, err = handler.RefreshRealMobile(params.Ctx, timeList[0], timeList[1], params.IsAsync, params.IsContinueWhenError)
}
} else {
err = fmt.Errorf("vendorID:%d非法", params.VendorID)
timeList, err2 := jxutils.BatchStr2Time(params.FromTime, params.ToTime)
if err = err2; err == nil {
retVal, err = misc.RefreshRealMobile(params.Ctx, params.VendorID, timeList[0], timeList[1], params.IsAsync, params.IsContinueWhenError)
}
return retVal, "", err
})