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"
@@ -1925,57 +1925,35 @@ 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, api.MtpsAPI.ShopUpdate(shopInfo)
102740, }
102996, if result.OpenType != courierStore.VendorStatus {
103205, courierStore.VendorStatus = result.OpenType
103408, dao.UpdateEntity(db, courierStore, "VendorStatus")
666677, }
667234, } else {
667272, courierStore.VendorStatus = 0
667278, dao.UpdateEntity(db, courierStore, "VendorStatus")
667281, }
667284, return retVal, err
667292, }, courierStoreList)
667297, tasksch.HandleTask(task, nil, true).Run()
667304, task.GetID()
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)
}
}
return err return err
} }