京东
This commit is contained in:
@@ -1876,6 +1876,16 @@ func UpdateOrderInfo(ctx *jxcontext.Context, vendorOrderID string, vendorID int,
|
|||||||
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, vendorID)
|
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, vendorID)
|
||||||
valid := dao.StrictMakeMapByStructObject(payload, order, ctx.GetUserName())
|
valid := dao.StrictMakeMapByStructObject(payload, order, ctx.GetUserName())
|
||||||
if len(valid) > 0 {
|
if len(valid) > 0 {
|
||||||
|
if payload["consigneeLng"] != nil || payload["consigneeLat"] != nil {
|
||||||
|
intLng := jxutils.StandardCoordinate2Int(utils.Interface2Float64WithDefault(payload["consigneeLng"], 0.0))
|
||||||
|
intLat := jxutils.StandardCoordinate2Int(utils.Interface2Float64WithDefault(payload["consigneeLat"], 0.0))
|
||||||
|
if intLng != 0 && intLng != order.ConsigneeLng {
|
||||||
|
valid["consigneeLng"] = intLng
|
||||||
|
}
|
||||||
|
if intLat != 0 && intLat != order.ConsigneeLat {
|
||||||
|
valid["consigneeLat"] = intLat
|
||||||
|
}
|
||||||
|
}
|
||||||
dao.Begin(db)
|
dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
|
|||||||
@@ -1585,7 +1585,35 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
// fmt.Println("deleteList2", deleteList)
|
// fmt.Println("deleteList2", deleteList)
|
||||||
// cms.DeletedDuplicateWaitAuditData(ctx, dao.GetDB())
|
// cms.DeletedDuplicateWaitAuditData(ctx, dao.GetDB())
|
||||||
// orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, time.Now().AddDate(0, 0, -2).Format("20060102"), time.Now().Format("20060102"))
|
// orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, time.Now().AddDate(0, 0, -2).Format("20060102"), time.Now().Format("20060102"))
|
||||||
|
var (
|
||||||
|
db = dao.GetDB()
|
||||||
|
goods []*model.GoodsOrder
|
||||||
|
)
|
||||||
|
sql := `SELECT * from goods_order where vendor_id = 0 and buyer_comment = '【JD】' and total_shop_money = 0 and status = 110
|
||||||
|
AND order_created_at > '2020-09-01'`
|
||||||
|
dao.GetRows(db, &goods, sql, nil)
|
||||||
|
for _, order2 := range goods {
|
||||||
|
results, err := api.JdAPI.GetJdShopOrders(order2.OrderCreatedAt.AddDate(0, 0, -1).Format("20060102"), order2.OrderCreatedAt.Format("20060102"), globals.JdOrgCode, globals.JdLoginName)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, v := range results.BillList.Result {
|
||||||
|
if v.DueAmount != 0 {
|
||||||
|
order, _ := partner.CurOrderManager.LoadOrder(utils.Int64ToStr(v.OrderID), model.VendorIDJD)
|
||||||
|
stores, _ := dao.GetStoreList(db, []int{jxutils.GetSaleStoreIDFromOrder(order)}, nil, nil, nil, "")
|
||||||
|
if len(stores) > 0 {
|
||||||
|
store := stores[0]
|
||||||
|
if order.NewEarningPrice == 0 {
|
||||||
|
jxutils.RefreshOrderEarningPrice2(order, store.PayPercentage)
|
||||||
|
}
|
||||||
|
if order.TotalShopMoney == 0 {
|
||||||
|
order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100)
|
||||||
|
}
|
||||||
|
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user