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