aa
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"strings"
|
||||
"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/partner/delivery"
|
||||
"github.com/360EntSecGroup-Skylar/excelize"
|
||||
@@ -1827,31 +1829,20 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
||||
// })
|
||||
// }
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
storeIDs []int
|
||||
db = dao.GetDB()
|
||||
)
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (vendorStoreID string, status int, err error) {
|
||||
err = api.FnAPI.CreateStore(&fnpsapi.CreateStoreParam{
|
||||
ChainStoreCode: utils.Int2Str(storeDetail.ID),
|
||||
ChainStoreName: storeDetail.Name,
|
||||
ChainStoreName: globals.StoreName + "-" + storeDetail.Name,
|
||||
ContactPhone: storeDetail.Tel1,
|
||||
Address: storeDetail.Address,
|
||||
PositionSource: 3,
|
||||
@@ -40,7 +40,7 @@ func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorSt
|
||||
if err == nil {
|
||||
storeDetail = &dao.StoreDetail2{
|
||||
Store: model.Store{
|
||||
Name: globals.StoreName + "-" + shopInfo.ChainStoreName,
|
||||
Name: shopInfo.ChainStoreName,
|
||||
Tel1: shopInfo.ContactPhone,
|
||||
Address: shopInfo.Address,
|
||||
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) {
|
||||
err = api.FnAPI.UpdateStore(&fnpsapi.CreateStoreParam{
|
||||
ChainStoreCode: utils.Int2Str(storeDetail.ID),
|
||||
ChainStoreName: storeDetail.Name,
|
||||
ChainStoreName: globals.StoreName + "-" + storeDetail.Name,
|
||||
ContactPhone: storeDetail.Tel1,
|
||||
Address: storeDetail.Address,
|
||||
PositionSource: 3,
|
||||
|
||||
Reference in New Issue
Block a user