This commit is contained in:
苏尹岚
2020-12-22 09:13:30 +08:00
parent 540d18acbc
commit 289134241b
2 changed files with 16 additions and 25 deletions

View File

@@ -8,6 +8,8 @@ import (
"strings" "strings"
"time" "time"
"git.rosy.net.cn/baseapi/platformapi/fnpsapi"
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
"git.rosy.net.cn/jx-callback/business/partner/delivery" "git.rosy.net.cn/jx-callback/business/partner/delivery"
"github.com/360EntSecGroup-Skylar/excelize" "github.com/360EntSecGroup-Skylar/excelize"
@@ -1827,31 +1829,20 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
// }) // })
// } // }
var ( var (
db = dao.GetDB() db = dao.GetDB()
storeIDs []int
) )
stores, _ := dao.GetStoreList(db, nil, nil, nil, nil, "")
for _, v := range stores {
if v.StoreLevel == "A" || v.StoreLevel == "B" || v.StoreLevel == "C" || v.StoreLevel == "D" {
if v.Status == model.StoreStatusOpened || v.Status == model.StoreStatusHaveRest {
list, err := dao.GetStoresMapList(db, []int{model.VendorIDEBAI, model.VendorIDMTWM, model.VendorIDJD, model.VendorIDJDShop}, []int{v.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
if err == nil && len(list) > 0 {
_, err = cms.UpdateOrCreateCourierStores(ctx, v.ID, false, false, false)
if err != nil {
storeIDs = append(storeIDs, v.ID)
} else {
csList, _ := dao.GetStoreCourierList(db, []int{v.ID}, []int{model.VendorIDFengNiao}, model.StoreStatusAll, model.StoreAuditStatusAll)
if len(csList) > 0 {
csList[0].Status = 0
dao.UpdateEntity(db, csList[0], "Status")
}
}
}
}
}
csList, _ := dao.GetStoreCourierList(db, nil, []int{model.VendorIDFengNiao}, model.StoreStatusAll, model.StoreAuditStatusAll)
for _, v := range csList {
stores, _ := dao.GetStoreList(db, []int{v.StoreID}, nil, nil, nil, "")
store := stores[0]
if !strings.Contains(store.Name, "京西菜市-") {
api.FnAPI.UpdateStore(&fnpsapi.CreateStoreParam{
ChainStoreCode: utils.Int2Str(v.StoreID),
ChainStoreName: "京西菜市-" + store.Name,
})
}
} }
fmt.Println("errrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr", storeIDs)
return err return err
} }

View File

@@ -14,7 +14,7 @@ import (
func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (vendorStoreID string, status int, err error) { func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (vendorStoreID string, status int, err error) {
err = api.FnAPI.CreateStore(&fnpsapi.CreateStoreParam{ err = api.FnAPI.CreateStore(&fnpsapi.CreateStoreParam{
ChainStoreCode: utils.Int2Str(storeDetail.ID), ChainStoreCode: utils.Int2Str(storeDetail.ID),
ChainStoreName: storeDetail.Name, ChainStoreName: globals.StoreName + "-" + storeDetail.Name,
ContactPhone: storeDetail.Tel1, ContactPhone: storeDetail.Tel1,
Address: storeDetail.Address, Address: storeDetail.Address,
PositionSource: 3, PositionSource: 3,
@@ -40,7 +40,7 @@ func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorSt
if err == nil { if err == nil {
storeDetail = &dao.StoreDetail2{ storeDetail = &dao.StoreDetail2{
Store: model.Store{ Store: model.Store{
Name: globals.StoreName + "-" + shopInfo.ChainStoreName, Name: shopInfo.ChainStoreName,
Tel1: shopInfo.ContactPhone, Tel1: shopInfo.ContactPhone,
Address: shopInfo.Address, Address: shopInfo.Address,
Lng: jxutils.StandardCoordinate2Int(utils.Str2Float64(shopInfo.Longitude)), Lng: jxutils.StandardCoordinate2Int(utils.Str2Float64(shopInfo.Longitude)),
@@ -65,7 +65,7 @@ func (c *DeliveryHandler) IsErrStoreNotExist(err error) bool {
func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (err error) { func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (err error) {
err = api.FnAPI.UpdateStore(&fnpsapi.CreateStoreParam{ err = api.FnAPI.UpdateStore(&fnpsapi.CreateStoreParam{
ChainStoreCode: utils.Int2Str(storeDetail.ID), ChainStoreCode: utils.Int2Str(storeDetail.ID),
ChainStoreName: storeDetail.Name, ChainStoreName: globals.StoreName + "-" + storeDetail.Name,
ContactPhone: storeDetail.Tel1, ContactPhone: storeDetail.Tel1,
Address: storeDetail.Address, Address: storeDetail.Address,
PositionSource: 3, PositionSource: 3,