This commit is contained in:
suyl
2021-06-07 11:33:26 +08:00
parent bd72b79987
commit 9f37c3de71

View File

@@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"context" "context"
"fmt" "fmt"
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman" "git.rosy.net.cn/baseapi/platformapi/mtpsapi"
"regexp" "regexp"
"strings" "strings"
"time" "time"
@@ -1926,56 +1926,34 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
//} //}
var ( var (
db = dao.GetDB() db = dao.GetDB()
goods []*model.GoodsOrder
) )
sql := ` courierStoreList, _ := dao.GetStoreCourierList(db, []int{800106}, []int{model.VendorIDMTPS}, model.StoreStatusAll, model.StoreAuditStatusAll)
SELECT * FROM goods_order WHERE IF(jx_store_id = 0, store_id, jx_store_id) IN ( task := tasksch.NewParallelTask("uuuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
100115, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
100123, courierStore := batchItemList[0].(*model.StoreCourierMap)
100135, storeDetail, _ := dao.GetStoreDetail(db, courierStore.StoreID, model.VendorIDJX, "")
100140, result, _ := api.MtpsAPI.GetStoreInfoByID(utils.Str2Int(courierStore.VendorStoreID))
100471, name := fmt.Sprintf("%s-%s-%s", globals.StoreName, storeDetail.CityName, storeDetail.Name)
101036, if result != nil {
101039, if result.PoiName != name {
101942, shopInfo := &mtpsapi.ShopInfo{
102383, ShopID: utils.Int2Str(storeDetail.ID),
102630, ShopName: name,
102671,
102736,
102740,
102996,
103205,
103408,
666677,
667234,
667272,
667278,
667281,
667284,
667292,
667297,
667304,
667308,
667312,
667332,
667540,
668125,
668131,
668144,
668150,
668152,
668159,
668183,
668185
) AND order_created_at > '2021-05-29 17:00:00' AND order_created_at < '2021-05-31 14:20:00' AND status = 110
`
dao.GetRows(db, &goods, sql, nil)
for _, v := range goods {
skus, _ := dao.GetSimpleOrderSkus(db, v.VendorOrderID, nil)
for _, vv := range skus {
orderman.RefreshOrderSkuInfo(jxcontext.AdminCtx, v.VendorOrderID, v.VendorID, vv.SkuID)
} }
api.MtpsAPI.ShopUpdate(shopInfo)
} }
if result.OpenType != courierStore.VendorStatus {
courierStore.VendorStatus = result.OpenType
dao.UpdateEntity(db, courierStore, "VendorStatus")
}
} else {
courierStore.VendorStatus = 0
dao.UpdateEntity(db, courierStore, "VendorStatus")
}
return retVal, err
}, courierStoreList)
tasksch.HandleTask(task, nil, true).Run()
task.GetID()
return err return err
} }