刷新京东商城订单结算价

This commit is contained in:
苏尹岚
2020-05-08 11:00:13 +08:00
parent a247c24a08
commit 29065aa419
6 changed files with 60 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ import (
"strings"
"time"
"git.rosy.net.cn/jx-callback/globals/api"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
"git.rosy.net.cn/baseapi/utils"
@@ -1345,3 +1347,23 @@ func GetMatterStoreOrderCount(ctx *jxcontext.Context, storeID int) (result *Orde
// orderCount.Count = 1000
return orderCount, err
}
func RefreshJdShopOrdersEarningPrice(ctx *jxcontext.Context, orderStartTime, orderEndTime string) (err error) {
var (
db = dao.GetDB()
)
results, err := api.JdAPI.GetJdShopOrders(orderStartTime, orderEndTime, globals.JdOrgCode, globals.JdLoginName)
if err != nil {
return err
}
for _, v := range results.BillList.Result {
if v.DueAmount != 0 {
order := &model.GoodsOrder{}
order.VendorOrderID = utils.Int64ToStr(v.OrderID)
order.EarningPrice = utils.Float64TwoInt64(v.DueAmount * 100)
order.NewEarningPrice = utils.Float64TwoInt64(v.DueAmount * 100)
dao.UpdateEntity(db, order, "EarningPrice", "NewEarningPrice")
}
}
return err
}