log delete
This commit is contained in:
@@ -608,7 +608,6 @@ func (v *VendorSync) DeleteRemoteStoreSkus(ctx *jxcontext.Context, db *dao.DaoDB
|
||||
// 将平台有,但本地没有的门店商品清除
|
||||
// todo,京东到家也应该支持
|
||||
func (v *VendorSync) PruneMissingStoreSkus(ctx *jxcontext.Context, vendorIDs []int, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debug("PruneMissingStoreSkus")
|
||||
hint, err = v.LoopStoresMap(ctx, dao.GetDB(), fmt.Sprintf("删除远程无关联的门店商品信息:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
|
||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||
@@ -633,7 +632,6 @@ func (v *VendorSync) PruneMissingStoreSkus(ctx *jxcontext.Context, vendorIDs []i
|
||||
// 把京西有,平台无且没有待创建标记的商品加上待创建标记
|
||||
// todo,京东到家也应该支持
|
||||
func (v *VendorSync) AddCreateFlagForJxStoreSku(ctx *jxcontext.Context, vendorIDs []int, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debug("AddCreateFlagForJxStoreSku")
|
||||
hint, err = v.LoopStoresMap(ctx, dao.GetDB(), fmt.Sprintf("处理京西有,平台无且没有待创建标记的商品加上待创建标记:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
|
||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||
@@ -656,7 +654,6 @@ func (v *VendorSync) AddCreateFlagForJxStoreSku(ctx *jxcontext.Context, vendorID
|
||||
}
|
||||
|
||||
func (v *VendorSync) AmendAndPruneStoreStuff(ctx *jxcontext.Context, vendorIDs []int, storeIDs []int, isAsync, isContinueWhenError bool, optType int, isForceUpdate bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debug("AmendAndPruneStoreStuff")
|
||||
hint, err = v.LoopStoresMap(ctx, dao.GetDB(), fmt.Sprintf("处理京西平台商家分类与商品差异:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
|
||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||
@@ -1219,7 +1216,6 @@ func SyncJdsStoreStock(ctx *jxcontext.Context, isAsync, isContinueWhenError bool
|
||||
}
|
||||
|
||||
func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, storeMap *model.StoreMap, isAsync, isContinueWhenError bool) (err error) {
|
||||
globals.SugarLogger.Debugf("syncJdsStoresSkus")
|
||||
var (
|
||||
mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||
skusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||
@@ -1347,8 +1343,6 @@ func SyncSkuExperfixAndWatermark(ctx *jxcontext.Context) (err error) {
|
||||
}
|
||||
|
||||
func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
globals.SugarLogger.Debug("SetMTPSStatus is start ")
|
||||
globals.SugarLogger.Debug("StoreId", "CourierStatus", storeId, courierStatus)
|
||||
/*获取美团门店信息*/
|
||||
//&& CourierStatus != 0
|
||||
if storeId != 0 {
|
||||
@@ -1432,7 +1426,6 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
{
|
||||
sl := make(map[string]interface{})
|
||||
sl["vendorStatus"] = 0
|
||||
globals.SugarLogger.Debug("因为没找到被修改配送状态的VendorStoreID是", ShopName, storeId)
|
||||
UpdateStoreCourierMap(ctx, nil, storeId, model.VendorIDMTPS, sl, ctx.GetUserName())
|
||||
return
|
||||
}
|
||||
@@ -1496,7 +1489,6 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
diff := false
|
||||
StoreLists, _ := dao.GetStoreList(db, []int{StoreCourierList1.StoreID}, nil, nil, nil, nil, "")
|
||||
if StoreLists == nil {
|
||||
globals.SugarLogger.Debugf("StoreID为:%s,在store表未找到", StoreCourierList1.StoreID)
|
||||
continue
|
||||
}
|
||||
if StoreCourierList1.VendorID != model.VendorIDMTPS || StoreCourierList1.VendorStoreID == "" {
|
||||
@@ -1511,7 +1503,6 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
MTPSInfo := new(mtpsapi.ShopInfo)
|
||||
MTPSInfo, _ = api.MtpsAPI.ShopQuery(StoreCourierList1.VendorStoreID)
|
||||
if MTPSInfo == nil {
|
||||
globals.SugarLogger.Debug("美团未找到该门店," + StoreLists[0].Name + strconv.Itoa(StoreCourierList1.StoreID) + " 被解绑,关联的ID为:" + StoreCourierList1.VendorStoreID)
|
||||
diff = true
|
||||
}
|
||||
if MTPSInfo != nil && MTPSInfo.ShopName == "" {
|
||||
@@ -1519,23 +1510,19 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
}
|
||||
if MTPSInfo != nil && MTPSInfo.ShopLng != StoreCourierList1.Lng && MTPSInfo.ShopLat == StoreCourierList1.Lat {
|
||||
/*平台上但是坐标不同,解绑*/
|
||||
globals.SugarLogger.Debug("商店与美团配送上的坐标不同," + StoreLists[0].Name + strconv.Itoa(StoreCourierList1.StoreID) + " 被解绑,关联的ID为:" + StoreCourierList1.VendorStoreID)
|
||||
if _, err := DeleteStoreCourierMap(ctx, db, StoreCourierList1.StoreID, StoreCourierList1.VendorID, ctx.GetUserName()); err != nil {
|
||||
globals.SugarLogger.Debug(err.Error())
|
||||
return
|
||||
}
|
||||
diff = true
|
||||
}
|
||||
if diff {
|
||||
if _, err := DeleteStoreCourierMap(ctx, db, StoreCourierList1.StoreID, StoreCourierList1.VendorID, ctx.GetUserName()); err != nil {
|
||||
globals.SugarLogger.Debug(err.Error())
|
||||
return
|
||||
}
|
||||
//break test
|
||||
}
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debug("SetMTPSStatus is Complete")
|
||||
}
|
||||
|
||||
func SetMTPSStatus2(storeID int) {
|
||||
|
||||
Reference in New Issue
Block a user