dada门店名

This commit is contained in:
苏尹岚
2020-08-12 12:02:54 +08:00
parent b6a1746d6a
commit 5a65f04e15
8 changed files with 24 additions and 78 deletions

View File

@@ -8,13 +8,12 @@ import (
"strings"
"time"
"git.rosy.net.cn/jx-callback/business/jxstore/act"
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
"git.rosy.net.cn/jx-callback/business/partner/delivery"
"github.com/360EntSecGroup-Skylar/excelize"
"github.com/qiniu/api.v7/storage"
"git.rosy.net.cn/baseapi/platformapi/dadaapi"
"git.rosy.net.cn/baseapi/platformapi/jdapi"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
@@ -1585,76 +1584,19 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
// fmt.Println("addList2", addList)
// fmt.Println("updateList2", utils.Format4Output(updateList, false))
// fmt.Println("deleteList2", deleteList)
db := dao.GetDB()
storeIDs := []int{
667335,
667321,
667319,
667260,
667227,
667167,
667109,
667094,
667050,
666898,
666852,
666815,
666763,
666761,
666760,
666759,
666714,
666708,
666705,
666669,
103437,
103425,
103349,
103123,
103116,
103107,
103069,
103019,
102940,
102890,
102831,
102772,
102751,
101870,
101755,
101176,
100767,
100754,
100726,
100699,
100476,
100369,
100366,
100361,
100351,
100350,
}
for _, storeID := range storeIDs {
acts, _ := dao.QueryActs(db, 0, 0, 50, 0, "", -1, []int{1}, []int{0, 3, 4}, nil, storeID, nil, 0, utils.ZeroTimeValue, utils.ZeroTimeValue, utils.Str2Time("2020-05-30 00:00:00"), utils.Str2Time("2020-07-30 00:00:00"))
for _, v := range acts.Data {
var actStoreSkuParam []*act.ActStoreSkuParam
_, actStoreSkus, _ := dao.GetActStoreSkuVendorList(db, v.ID, []int{0}, nil, nil, "", 0, 99999)
for _, actStoreSku := range actStoreSkus {
if actStoreSku.StoreID == storeID {
aa := &act.ActStoreSkuParam{
ActStoreSku: model.ActStoreSku{
StoreID: storeID,
SkuID: actStoreSku.SkuID,
ActID: v.ID,
},
}
actStoreSkuParam = append(actStoreSkuParam, aa)
}
}
_, err = act.DeleteActStoreSkuBind(ctx, db, v.ID, actStoreSkuParam)
if err == nil {
_, err = act.SyncAct(ctx, nil, v.ID, nil, true)
var (
db = dao.GetDB()
)
list, err := dao.GetStoreCourierList(db, nil, []int{model.VendorIDDada}, model.StoreStatusAll, model.StoreAuditStatusAll)
for _, v := range list {
stores, _ := dao.GetStoreList(db, []int{v.StoreID}, nil, nil, nil, "")
sd, _ := api.DadaAPI.ShopDetail(v.VendorStoreID)
if !strings.Contains(sd.StationName, globals.StoreName) {
shopInfo := &dadaapi.ShopInfo{
OriginShopID: v.VendorStoreID,
StationName: globals.StoreName + "-" + stores[0].Name,
}
api.DadaAPI.ShopUpdate(shopInfo)
}
}
return err