From 8018cc77095f60929c7dc7f5e079e0a86d4ede1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 6 Nov 2019 16:52:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/jx_order.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/jx_order.go b/controllers/jx_order.go index 6150990ef..b8ce53b7a 100644 --- a/controllers/jx_order.go +++ b/controllers/jx_order.go @@ -747,7 +747,7 @@ func (c *OrderController) AmendMissingOrders() { // @Param fromDate formData string true "订单起始日期" // @Param toDate formData string true "订单结束日期" // @Param vendorOrderID formData string false "订单号" -// @Param vendorIDs formData int false "平台ID列表[0,1,3]" +// @Param vendorIDs formData string false "平台ID列表[0,1,3]" // @Param storeID formData int false "门店ID" // @Param isAsync formData bool true "是否异步操作" // @Param isContinueWhenError formData bool false "单个失败是否继续,缺省true" From 87a86972423c84525d58af951dc19f9ec84e27d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 6 Nov 2019 17:11:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/jx_order.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/jx_order.go b/controllers/jx_order.go index b8ce53b7a..d867a2574 100644 --- a/controllers/jx_order.go +++ b/controllers/jx_order.go @@ -744,8 +744,8 @@ func (c *OrderController) AmendMissingOrders() { // @Title 同步刷新历史订单的结算价按订单 // @Description 同步刷新历史订单的结算价按订单 // @Param token header string true "认证token" -// @Param fromDate formData string true "订单起始日期" -// @Param toDate formData string true "订单结束日期" +// @Param fromTime formData string true "订单起始时间 (yyyy-mm-dd hh:ms:ss)" +// @Param toTime formData string true "订单结束时间 (yyyy-mm-dd hh:ms:ss)" // @Param vendorOrderID formData string false "订单号" // @Param vendorIDs formData string false "平台ID列表[0,1,3]" // @Param storeID formData int false "门店ID" @@ -758,7 +758,7 @@ func (c *OrderController) RefreshHistoryOrdersEarningPrice() { c.callRefreshHistoryOrdersEarningPrice(func(params *tOrderRefreshHistoryOrdersEarningPriceParams) (retVal interface{}, errCode string, err error) { var vendorIDList []int if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDList); err == nil { - err = orderman.FixedOrderManager.RefreshHistoryOrdersEarningPrice(params.Ctx, params.VendorOrderID, vendorIDList, params.StoreID, params.FromDate, params.ToDate, params.IsAsync, params.IsContinueWhenError) + err = orderman.FixedOrderManager.RefreshHistoryOrdersEarningPrice(params.Ctx, params.VendorOrderID, vendorIDList, params.StoreID, params.FromTime, params.ToTime, params.IsAsync, params.IsContinueWhenError) } return retVal, "", err }) From 29b3dc637ed1d4c58fd73ca669193e6cd35479ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 6 Nov 2019 17:19:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 11 +++++++---- controllers/jx_order.go | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index bf5b74acf..36d4abbde 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -613,17 +613,17 @@ func (c *OrderManager) UpdateOrderFields(order *model.GoodsOrder, fieldList []st return err } -func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, vendorOrderID string, vendorIDs []int, storeID int, fromDate string, toDate string, isAsync, isContinueWhenError bool) (err error) { +func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, vendorOrderID string, vendorIDs []int, storeID int, fromDate string, toDate string, isAsync, isContinueWhenError bool) (hint string, err error) { db := dao.GetDB() fromDateParam := utils.Str2Time(fromDate) toDateParam := utils.Str2Time(toDate) //若时间间隔大于10天则不允许查询 if math.Ceil(toDateParam.Sub(fromDateParam).Hours()/24) > 10 { - return errors.New(fmt.Sprintf("查询间隔时间不允许大于10天!时间范围:[%v] 至 [%v]", fromDate, toDate)) + return "", errors.New(fmt.Sprintf("查询间隔时间不允许大于10天!时间范围:[%v] 至 [%v]", fromDate, toDate)) } orderList, _ := dao.QueryOrders(db, vendorOrderID, vendorIDs, storeID, fromDateParam, toDateParam) if len(orderList) <= 0 { - return errors.New(fmt.Sprintf("未查询到订单!,vendorOrderID : %s, 时间范围:[%v] 至 [%v]", vendorOrderID, fromDate, toDate)) + return "", errors.New(fmt.Sprintf("未查询到订单!,vendorOrderID : %s, 时间范围:[%v] 至 [%v]", vendorOrderID, fromDate, toDate)) } task := tasksch.NewParallelTask("刷新历史订单结算价", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { @@ -655,6 +655,9 @@ func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, tasksch.HandleTask(task, nil, true).Run() if !isAsync { _, err = task.GetResult(0) + hint = "1" + } else { + hint = task.GetID() } - return err + return hint, err } diff --git a/controllers/jx_order.go b/controllers/jx_order.go index d867a2574..cc0be95db 100644 --- a/controllers/jx_order.go +++ b/controllers/jx_order.go @@ -758,7 +758,7 @@ func (c *OrderController) RefreshHistoryOrdersEarningPrice() { c.callRefreshHistoryOrdersEarningPrice(func(params *tOrderRefreshHistoryOrdersEarningPriceParams) (retVal interface{}, errCode string, err error) { var vendorIDList []int if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDList); err == nil { - err = orderman.FixedOrderManager.RefreshHistoryOrdersEarningPrice(params.Ctx, params.VendorOrderID, vendorIDList, params.StoreID, params.FromTime, params.ToTime, params.IsAsync, params.IsContinueWhenError) + retVal, err = orderman.FixedOrderManager.RefreshHistoryOrdersEarningPrice(params.Ctx, params.VendorOrderID, vendorIDList, params.StoreID, params.FromTime, params.ToTime, params.IsAsync, params.IsContinueWhenError) } return retVal, "", err })