aa
This commit is contained in:
@@ -3889,13 +3889,25 @@ func UpdateBrand(ctx *jxcontext.Context, payload map[string]interface{}, isDel b
|
||||
}
|
||||
|
||||
func CreateVendorStore(ctx *jxcontext.Context, storeID, vendorID int, payload map[string]interface{}) (err error) {
|
||||
// var (
|
||||
// db = dao.GetDB()
|
||||
// )
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
storeDetail *dao.StoreDetail
|
||||
)
|
||||
if storeDetail, err = dao.GetStoreDetail(db, storeID, vendorID, ""); err != nil {
|
||||
return fmt.Errorf("获取门店信息失败,请联系技术部!")
|
||||
}
|
||||
if payload["vendorOrgCode"] == nil {
|
||||
return fmt.Errorf("请选择平台账号!")
|
||||
}
|
||||
// storeDetail, _ := dao.GetStoreDetail(db, storeID, vendorID, payload["vendorOrgCode"].(string))
|
||||
if vendorID == model.VendorIDMTWM {
|
||||
if brands, err := dao.GetBrands(db, "", storeDetail.BrandID); err == nil {
|
||||
if len(brands) > 0 {
|
||||
if strings.Contains(brands[0].Name, "无品牌") {
|
||||
return fmt.Errorf("无品牌店铺不允许创建美团门店!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// handler := partner.GetPurchasePlatformFromVendorID(vendorID)
|
||||
// vendorStoreID, err := handler.CreateStore2(db, storeID, ctx.GetUserName(), payload)
|
||||
// if err != nil {
|
||||
|
||||
@@ -245,7 +245,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
db2 = dao.GetDB()
|
||||
}
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil); err == nil {
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, nil); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
} else {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, model.VendorChineseNames[storeMap.VendorID], "创建门店")
|
||||
@@ -283,7 +283,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
var vendorStoreID string
|
||||
storeMap := loopMapInfo.StoreMapList[0]
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil); err == nil {
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, nil); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
} else {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, model.VendorChineseNames[storeMap.VendorID], "创建门店")
|
||||
|
||||
@@ -469,6 +469,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
now := jxutils.OperationTime2HourMinuteFormat(time.Now())
|
||||
var failedList []*partner.StoreSkuInfoWithErr
|
||||
for _, sku := range skus {
|
||||
globals.SugarLogger.Debugf("syncStoreSkuNew sku sync:%v", sku.SkuSyncStatus)
|
||||
if !useVendorPriceDirectly &&
|
||||
!isSkuLockTimeValid(sku) {
|
||||
sku.VendorPrice = 0
|
||||
|
||||
Reference in New Issue
Block a user