- fix bug in TransferLegacyJdOrder and TransferLegacyElmOrder
This commit is contained in:
@@ -3,7 +3,6 @@ package tempop
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -276,7 +275,7 @@ func TransferLegacyJdOrder(ctx *jxcontext.Context, isAsync, isContinueWhenError
|
|||||||
SELECT t1.*
|
SELECT t1.*
|
||||||
FROM jdorder t1
|
FROM jdorder t1
|
||||||
LEFT JOIN goods_order_original t2 ON t2.vendor_order_id = t1.vendor_order_id
|
LEFT JOIN goods_order_original t2 ON t2.vendor_order_id = t1.vendor_order_id
|
||||||
WHERE t2.id IS NULL
|
WHERE t2.id IS NULL AND LENGTH(t1.data) > 10 AND t1.cityname = 'all'
|
||||||
ORDER BY t1.orderstatustime
|
ORDER BY t1.orderstatustime
|
||||||
LIMIT ?
|
LIMIT ?
|
||||||
`
|
`
|
||||||
@@ -290,7 +289,6 @@ func TransferLegacyJdOrder(ctx *jxcontext.Context, isAsync, isContinueWhenError
|
|||||||
var orderDetailList []*model.GoodsOrderOriginal
|
var orderDetailList []*model.GoodsOrderOriginal
|
||||||
for _, v := range batchItemList {
|
for _, v := range batchItemList {
|
||||||
jdOrder := v.(*legacymodel2.Jdorder)
|
jdOrder := v.(*legacymodel2.Jdorder)
|
||||||
if len(jdOrder.Data) > 10 {
|
|
||||||
var detail map[string]interface{}
|
var detail map[string]interface{}
|
||||||
if err = utils.UnmarshalUseNumber([]byte(strings.Replace(strings.Replace(jdOrder.Data, "\n", "", -1), "\r", "", -1)), &detail); err != nil {
|
if err = utils.UnmarshalUseNumber([]byte(strings.Replace(strings.Replace(jdOrder.Data, "\n", "", -1), "\r", "", -1)), &detail); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -311,7 +309,6 @@ func TransferLegacyJdOrder(ctx *jxcontext.Context, isAsync, isContinueWhenError
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if len(orderDetailList) > 0 {
|
if len(orderDetailList) > 0 {
|
||||||
err = dao.CreateMultiEntities(db, orderDetailList)
|
err = dao.CreateMultiEntities(db, orderDetailList)
|
||||||
}
|
}
|
||||||
@@ -320,7 +317,6 @@ func TransferLegacyJdOrder(ctx *jxcontext.Context, isAsync, isContinueWhenError
|
|||||||
// rootTask.AddChild(task).Run()
|
// rootTask.AddChild(task).Run()
|
||||||
task.Run()
|
task.Run()
|
||||||
_, err = task.GetResult(0)
|
_, err = task.GetResult(0)
|
||||||
runtime.GC()
|
|
||||||
} else {
|
} else {
|
||||||
rootTask.Cancel()
|
rootTask.Cancel()
|
||||||
}
|
}
|
||||||
@@ -342,7 +338,7 @@ func TransferLegacyElmOrder(ctx *jxcontext.Context, isAsync, isContinueWhenError
|
|||||||
SELECT t1.*
|
SELECT t1.*
|
||||||
FROM elemeorder t1
|
FROM elemeorder t1
|
||||||
LEFT JOIN goods_order_original t2 ON t2.vendor_order_id = t1.orderid
|
LEFT JOIN goods_order_original t2 ON t2.vendor_order_id = t1.orderid
|
||||||
WHERE t2.id IS NULL
|
WHERE t2.id IS NULL AND LENGTH(t1.data) > 10
|
||||||
ORDER BY t1.order_created_at
|
ORDER BY t1.order_created_at
|
||||||
LIMIT ?
|
LIMIT ?
|
||||||
`
|
`
|
||||||
@@ -379,7 +375,6 @@ func TransferLegacyElmOrder(ctx *jxcontext.Context, isAsync, isContinueWhenError
|
|||||||
// rootTask.AddChild(task).Run()
|
// rootTask.AddChild(task).Run()
|
||||||
task.Run()
|
task.Run()
|
||||||
_, err = task.GetResult(0)
|
_, err = task.GetResult(0)
|
||||||
runtime.GC()
|
|
||||||
} else {
|
} else {
|
||||||
rootTask.Cancel()
|
rootTask.Cancel()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user