This commit is contained in:
邹宗楠
2023-08-29 18:27:40 +08:00
parent 6e9372ef3b
commit 8800bbb762

View File

@@ -1838,6 +1838,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
// 增加门店地址修改同步
storeDetail, err := dao.GetStoreBaseByVendorStoreID(storeMap.VendorStoreID, storeMap.VendorID)
address := ""
if err != nil || storeDetail == nil {
return 0, fmt.Errorf("基础门店信息异常,请联系管理员")
}
@@ -1848,6 +1849,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
// 添加同步
valid["address"] = payload["address"].(string)
syncStatus |= model.SyncFlagStoreName
address = payload["address"].(string)
}
if err == nil {
@@ -1860,6 +1862,9 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
}
}()
if address != "" {
delete(valid, "address")
}
// storeMap 不包含address参数
if isStoreMapNeedSync(vendorID, valid) { // 对于store vendor map只有Status改变才需要同步到厂商
num, err = dao.UpdateEntityLogicallyAndUpdateSyncStatus(db, storeMap, valid, userName, map[string]interface{}{
@@ -1904,7 +1909,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
}
dao.Commit(db, txDB)
if isStoreMapNeedSync(vendorID, valid) || valid["address"] != nil {
if isStoreMapNeedSync(vendorID, valid) || address != "" {
_, err = CurVendorSync.SyncStore(ctx, db, vendorID, storeID, false, userName)
}