京东商城订单转移修改

This commit is contained in:
苏尹岚
2020-07-09 16:00:02 +08:00
parent ae4deb9a04
commit 889f05214c

View File

@@ -1283,7 +1283,13 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
return "", fmt.Errorf("未查询到该门店对应的平台信息!门店:[%v]", order.StoreID)
}
if len(order.VendorOrderID) > 12 {
suffix := utils.Str2Int(order.VendorOrderID[12:len(order.VendorOrderID)])
var goodsOrders []*model.GoodsOrder
sql := `
SELECT * FROM goods_order WHERE vendor_order_id2 = ? ORDER BY vendor_order_id DESC
`
sqlParams := []interface{}{order.VendorOrderID2}
err = dao.GetRows(db, &goodsOrders, sql, sqlParams)
suffix := utils.Str2Int(goodsOrders[0].VendorOrderID[12:len(goodsOrders[0].VendorOrderID)])
suffix++
order.VendorOrderID = utils.Int64ToStr(utils.Str2Int64(order.VendorOrderID2)*100000) + utils.Int2Str(suffix)
}