This commit is contained in:
邹宗楠
2023-09-21 14:30:05 +08:00
parent aaaf465fd6
commit 2c2dc5402b
7 changed files with 17 additions and 23 deletions

View File

@@ -1369,7 +1369,7 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
Status: model.StoreStatusOpened,
PricePercentagePack: "无",
VendorID: model.VendorIDJX,
})
}, false)
//尝试把平台负责人加到他自己的权限里
if store.MarketManPhone != "" {
user, _ := dao.GetUserByID(db, "mobile", store.MarketManPhone)
@@ -1489,7 +1489,7 @@ func CreateStore2JX(ctx *jxcontext.Context, storeExt *StoreExt, userName string)
PricePercentagePack: "无",
CreateDeliveryType: model.YES, // 菜市门店默认门店发单
VendorID: model.VendorIDJX,
})
}, false)
//尝试把平台负责人加到他自己的权限里
if store.MarketManPhone != "" {
user, _ := dao.GetUserByID(db, "mobile", store.MarketManPhone)
@@ -1570,7 +1570,7 @@ func GetStoreVendorMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, vend
}
// todo 需要对字段做有效性检查
func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vendorOrgCode string, storeID int, storeMap *model.StoreMap) (outStoreMap *model.StoreMap, err error) {
func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vendorOrgCode string, storeID int, storeMap *model.StoreMap, isAdd bool) (outStoreMap *model.StoreMap, err error) {
errList := errlist.ErrList{}
if storeID == 0 {
return nil, fmt.Errorf("storeID不能为0")
@@ -1687,7 +1687,7 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
err = AddEventDetail(db, ctx, model.OperateAdd, vendorID, model.ThingTypeStore, storeID, "", `{"VendorID":`+utils.Int2Str(vendorID)+`}`)
}
_, err = CurVendorSync.SyncStore(ctx, db, storeMap.VendorID, storeID, false, userName)
_, err = CurVendorSync.FullSyncStoresSkus(ctx, db, []int{vendorID}, []int{storeID}, true, nil, true, true)
_, err = CurVendorSync.FullSyncStoresSkus(ctx, db, []int{vendorID}, []int{storeID}, true, nil, true, true, isAdd)
if utils.IsNil(errList) && err == nil {
return outStoreMap, nil
} else {
@@ -1924,7 +1924,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
case 1:
if singleStoreHandler != nil {
// 直接同步商品
err = syncStoreSkuNew(ctx, task, 0, false, vendorID, storeID, "", nil, nil, nil, false, true)
err = syncStoreSkuNew(ctx, task, 0, true, vendorID, storeID, "", nil, nil, nil, false, true)
}
}
return retVal, err
@@ -5541,7 +5541,7 @@ func AuditStoreMap(ctx *jxcontext.Context, ID int, vendorOrgCode, vendorStoreID
DeliveryCompetition: 1,
PricePercentage: 100,
}
_, err = AddStoreVendorMap(ctx, db, storeMapAudit.VendorID, vendorOrgCode, storeMapAudit.StoreID, storeMap)
_, err = AddStoreVendorMap(ctx, db, storeMapAudit.VendorID, vendorOrgCode, storeMapAudit.StoreID, storeMap, false)
} else {
if comment == "" {
fmt.Errorf("审核不通过请输入原因!")