This commit is contained in:
邹宗楠
2024-08-20 18:21:33 +08:00
parent b85dc4d5c2
commit 37a9e6662b
2 changed files with 4 additions and 35 deletions

View File

@@ -778,36 +778,11 @@ func (c *PurchaseHandler) ListOrders(ctx *jxcontext.Context, vendorOrgCode strin
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
vendorStoreID := batchItemList[0].(string)
var orderIDs []string
//seqStart := 1
//i := 0
for {
//batchSize := int(math.Min(math.Pow(2, float64(i*3)), float64(mtwmapi.MaxGap4GetOrderIdByDaySeq)))
//seqEnd := seqStart + batchSize - 1
//var tmpOrderIDs []int64
//if seqStart == seqEnd {
// if vendorOderID, err2 := getAPI(vendorOrgCode, 0, vendorStoreID).GetOrderIdByDaySeqSingle(vendorStoreID, queryDate, seqStart); err2 == nil {
// tmpOrderIDs = []int64{vendorOderID}
// }
//} else {
// tmpOrderIDs, err = getAPI(vendorOrgCode, 0, vendorStoreID).GetOrderIdByDaySeq(vendorStoreID, queryDate, seqStart, seqEnd)
//}
tmpOrderIDs, _ := getAPI(vendorOrgCode, 0, vendorStoreID).EcommerceGetOrderIdByPage(vendorStoreID, queryDate, endData)
globals.SugarLogger.Debugf("-------------------tmpOrderIDs := %s", utils.Format4Output(tmpOrderIDs, false))
globals.SugarLogger.Debugf("-------------------queryDate := %s", utils.Format4Output(queryDate, false))
globals.SugarLogger.Debugf("-------------------endData := %s", utils.Format4Output(endData, false))
globals.SugarLogger.Debugf("-------------------vendorStoreID := %s", utils.Format4Output(vendorStoreID, false))
if len(tmpOrderIDs) > 0 {
for _, v := range tmpOrderIDs {
orderIDs = append(orderIDs, utils.Int64ToStr(v))
}
tmpOrderIDs, _ := getAPI(vendorOrgCode, 0, vendorStoreID).EcommerceGetOrderIdByPage(vendorStoreID, queryDate, endData)
if len(tmpOrderIDs) > 0 {
for _, v := range tmpOrderIDs {
orderIDs = append(orderIDs, utils.Int64ToStr(v))
}
if err != nil /*|| len(tmpOrderIDs) < batchSize */ {
err = nil
break
}
//seqStart = seqEnd + 1
//i++
}
retVal = orderIDs
return retVal, nil