Files
drawlogo/works/devdoc/newhouse-design.html
T
sgp 12f8b65e1c feat(works): 新增成品「开发文档中心 · 甄房」
- 回收 ZhenOS-SH/ruoyi-ui public/devdoc 静态站(16 文件 / 3.69 MB)到 works/devdoc
- 目录页 5 分类 21 条文档 + 10 个子页(业务全流程流程图 mermaid / 菜单图标选型 / 头像素材规范等)
- works.js 追加索引(文档类),works.html 版本 bump
2026-11-15 22:48:48 +08:00

920 lines
47 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>新房智联(NewHouse Link)—— 调研与设计方案</title>
<style>
:root {
--ink: #1f2329;
--ink-2: #5c6670;
--line: #e5e8ec;
--bg: #ffffff;
--bg-soft: #f7f8fa;
--brand: #2b6de5;
--brand-soft: #eef3fe;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
font-size: 14px; line-height: 1.78;
-webkit-font-smoothing: antialiased;
}
.layout { display: flex; align-items: flex-start; gap: 32px; padding: 24px 32px 64px; }
.toc {
position: sticky; top: 16px; flex: 0 0 236px; max-height: calc(100vh - 48px);
overflow: auto; padding: 14px 16px; border: 1px solid var(--line);
border-radius: 8px; background: var(--bg-soft); font-size: 13px;
}
.toc > ul { padding-left: 16px; margin: 0; }
.toc ul ul { padding-left: 14px; }
.toc li { margin: 3px 0; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--brand); }
.doc { flex: 1 1 auto; min-width: 0; max-width: 1000px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.4; font-weight: 600; }
h1 { font-size: 26px; margin: 8px 0 20px; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
h2 { font-size: 20px; margin: 34px 0 14px; padding-left: 10px; border-left: 4px solid var(--brand); }
h3 { font-size: 16px; margin: 24px 0 10px; }
h4 { font-size: 14px; margin: 18px 0 8px; color: var(--ink-2); }
p { margin: 10px 0; }
ul, ol { margin: 8px 0; padding-left: 24px; }
li { margin: 4px 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
blockquote {
margin: 12px 0; padding: 10px 16px; color: var(--ink-2);
background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 4px;
}
blockquote p { margin: 4px 0; }
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-size: 12.5px; background: #f2f4f7; border-radius: 3px; padding: 1px 5px;
}
pre {
margin: 12px 0; padding: 14px 16px; overflow: auto; background: #1f2430;
border-radius: 8px; line-height: 1.6;
}
pre code {
background: transparent; color: #e6e9ef; padding: 0; font-size: 12.5px;
white-space: pre;
}
table {
width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px;
display: table; overflow-x: auto;
}
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: #fbfcfd; }
img { max-width: 100%; }
@media (max-width: 900px) {
.layout { display: block; padding: 16px; }
.toc { position: static; max-height: none; margin-bottom: 20px; }
}
@media print {
.toc { display: none; }
.layout { display: block; padding: 0; }
}
</style>
</head>
<body>
<div class="layout">
<aside class="toc"><div class="toc">
<ul>
<li><a href="#_1">一、命名方案</a><ul>
<li><a href="#11-newhouse-link">1.1 名称:新房智联(英文/代码标识:NewHouse Link)</a></li>
<li><a href="#12">1.2 一句话定位</a></li>
</ul>
</li>
<li><a href="#_2">二、需求拆解与产品形态</a></li>
<li><a href="#_3">三、市场最佳实践调研(开发参考)</a><ul>
<li><a href="#31-c-web">3.1 C 端新房展示页(小程序端 / WEB 端)</a></li>
<li><a href="#32-erp">3.2 ERP 后台:新房列表管理 + 渠道管理</a></li>
</ul>
</li>
<li><a href="#_4">四、系统融合方案(与现有模块的完美融合)</a><ul>
<li><a href="#41">4.1 账号模型:组织架构落位 + 双入口(核心决策)</a></li>
<li><a href="#42">4.2 五端职责与复用映射</a></li>
<li><a href="#43">4.3 核心链路设计(融合现有机制)</a></li>
<li><a href="#44">4.4 与「微门店」的边界(防功能打架)</a></li>
<li><a href="#45-c">4.5 注册与入驻设计(双客群同小程序:C 端客户 + 渠道人员)</a></li>
</ul>
</li>
<li><a href="#databasemigration">五、数据模型(DatabaseMigration 新增)</a><ul>
<li><a href="#51-b-zhenos_sh">5.1 表清单(B 端库 zhenos_sh)</a></li>
<li><a href="#52">5.2 新盘状态机</a></li>
<li><a href="#53-estate_customer_lead">5.3 与 estate_customer_lead 的关联</a></li>
</ul>
</li>
<li><a href="#erp">六、ERP 端联通与权限设计</a><ul>
<li><a href="#61-sys_menu8400">6.1 菜单规划(sys_menu,8400 段——当前空闲)</a></li>
<li><a href="#62-sys_role_permission_scope">6.2 角色与数据域(sys_role_permission_scope 原生生效)</a></li>
<li><a href="#63-erp">6.3 审核建号流程(ERP 侧)</a></li>
<li><a href="#64">6.4 防污染与安全约束(组织架构方案的配套代价)</a></li>
<li><a href="#65">6.5 后端联通</a></li>
</ul>
</li>
<li><a href="#ux">七、分端页面设计(UX 规格)</a><ul>
<li><a href="#71-c-h5-pagessubnewhouse">7.1 小程序(c-h5 pagesSub/newhouse/)</a></li>
<li><a href="#72-webc-web">7.2 WEB(c-web)</a></li>
<li><a href="#73-erpruoyi-ui-viewsestatenewhouse">7.3 ERP(ruoyi-ui views/estate/newhouse/)</a></li>
</ul>
</li>
<li><a href="#_5">八、实施顺序建议(供后续开发排期参考)</a></li>
<li><a href="#_6">九、已知缺口与风险清单</a></li>
<li><a href="#_7">十、变更后必办事项(进入编码阶段时)</a></li>
</ul>
</div></aside>
<main class="doc">
<h1 id="newhouse-link">新房智联(NewHouse Link)—— 新房渠道模块 调研与设计方案</h1>
<blockquote>
<p>日期:2026-10-10 | 阶段:调研 + 方案设计(未进入编码)
需求来源:H5 新房功能模块,覆盖「渠道销售注册录入新盘 → 小程序录入 → 转发获客 → 微信直连渠道专员 → WEB 展示 → ERP 渠道用户/新房管理」全链路。
<strong>账号模型(2026-10-11 定稿):平台招募 + 专用租户 8 + 业务租户只读</strong>
渠道只由平台统一招募:渠道账号与新房数据统一归专用租户 <strong>8「新房智联」</strong>(新增 <code>capi.newhouse-tenant-id=8</code>,与 <code>capi.tenant-id</code> 解耦);平台租户 0 负责审核与线索跟进;业务租户(3/7)仅通过「新房广场」只读共享已上架新盘;C 端 H5/WEB 固定读租户 8。</p>
</blockquote>
<hr />
<h2 id="_1">一、命名方案</h2>
<h3 id="11-newhouse-link">1.1 名称:新房智联(英文/代码标识:NewHouse Link)</h3>
<table>
<thead>
<tr>
<th>层面</th>
<th>命名</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>产品名</td>
<td><strong>新房智联</strong></td>
<td>「新房」明确业务域,「智联」= 智慧直连(渠道专员 ↔ 客户 ↔ 案场),呼应"通过微信直接联系该渠道专员"的核心体验</td>
</tr>
<tr>
<td>菜单目录</td>
<td>新房智联</td>
<td>ERP 一级目录显示名</td>
</tr>
<tr>
<td>权限标识</td>
<td><code>estate:newhouse:*</code></td>
<td>遵循 <code>estate:模块[:业务]:操作</code> 规范</td>
</tr>
<tr>
<td>数据库表</td>
<td><code>estate_newhouse_*</code></td>
<td>遵循 <code>estate_</code> 前缀规范</td>
</tr>
<tr>
<td>小程序页面</td>
<td><code>pagesSub/newhouse/**</code></td>
<td>与 <code>pagesSub/mstore/</code>(微门店)并列</td>
</tr>
<tr>
<td>capi 路由</td>
<td><code>/house/c/newhouse/**</code></td>
<td>遵循 <code>/house/c/**</code> 契约</td>
</tr>
<tr>
<td>ERP 管理路由</td>
<td><code>/estate/newhouse/**</code></td>
<td>遵循 <code>/estate/**</code> 契约</td>
</tr>
</tbody>
</table>
<p>候选曾评估:盘客通(B端味过重)、新盘官(传播好但偏 C 端称号)、云案场(与明源概念撞车)、盘友圈(偏社交)。<strong>最终采用「新房智联」</strong>,兼顾两端语感与"直连"卖点。</p>
<h3 id="12">1.2 一句话定位</h3>
<blockquote>
<p>面向新房渠道销售的"注册即入驻"平台:渠道销售在小程序申请注册,后台审核通过后进入 ERP 组织架构,可在<strong>小程序或后台双入口</strong>录入新盘、转发自己的新盘橱窗;经纪人公司或 C 端客户扫码/点击即可通过微信直连该渠道专员;所有渠道的新盘与人员在 WEB 聚合展示、在 ERP 统一管理。</p>
</blockquote>
<hr />
<h2 id="_2">二、需求拆解与产品形态</h2>
<table>
<thead>
<tr>
<th>#</th>
<th>用户需求</th>
<th>产品形态</th>
<th>落地端</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>新房渠道销售注册后可录入新盘</td>
<td>小程序申请注册 → 后台审核通过 → <strong>建号入组织架构</strong>(「外部渠道体系」部门 + 渠道角色)→ 录入新盘</td>
<td>小程序(c-h5)+ ERP</td>
</tr>
<tr>
<td>2</td>
<td>渠道从小程序录入</td>
<td><code>pagesSub/newhouse/publish</code> 新盘录入页(发布即提审,复用 sharem 模式);<strong>后台同步提供录入页</strong>(双入口同表单)</td>
<td>小程序 + ruoyi-ui</td>
</tr>
<tr>
<td>3</td>
<td>录入后可转发自己的新房(类似微门店)</td>
<td>个人新盘橱窗页 + 分享海报/小程序卡片/链接(带归因)</td>
<td>小程序 + B端H5</td>
</tr>
<tr>
<td>4</td>
<td>经纪人公司/C 端客户可微信联系渠道专员</td>
<td>详情页/橱窗页「加微信」按钮 → 企微联系我二维码(state 归因)→ 回调建档</td>
<td>capi + 企业微信</td>
</tr>
<tr>
<td>5</td>
<td>WEB 端所有渠道发的新房展示页</td>
<td>c-web 新盘频道(列表 + 详情 + 按专员聚合的橱窗页)</td>
<td>c-web(Nuxt3 SSR)</td>
</tr>
<tr>
<td>6</td>
<td>ERP 端渠道注册用户列表</td>
<td>「新房智联 → 渠道用户」管理页(审核建号/停用/启用/导出)</td>
<td>ruoyi-ui</td>
</tr>
<tr>
<td>7</td>
<td>ERP 端渠道发的新房列表</td>
<td>「新房智联 → 渠道新盘」管理页(审核/上下架/推荐/导出)</td>
<td>ruoyi-ui</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="_3">三、市场最佳实践调研(开发参考)</h2>
<h3 id="31-c-web">3.1 C 端新房展示页(小程序端 / WEB 端)</h3>
<p>调研对象:贝壳找房、安居客、幸福里等头部新房频道,及行业改版案例。</p>
<p><strong>详情页信息架构(行业共识):</strong></p>
<ol>
<li><strong>头图区</strong>:楼盘大图轮播/航拍/宣传视频,第一屏即"均价 + 价格区间 + 在售状态 + 核心卖点标签"</li>
<li><strong>价格透明</strong>:均价、总价区间、单价基准;进阶做法附"一房一价"公示表/备案价查询入口(安居客模式),显著增强信任</li>
<li><strong>户型模块合一</strong>:户型图 + 户型分析 + 样板间图集中在一个模块内浏览,避免用户在头图与户型区来回跳转(行业改版核心结论)</li>
<li><strong>配套独立成块</strong>:交通(地铁/驾车)、教育、商业、医疗分列展示,含距离/步行时间</li>
<li><strong>资质与信任</strong>:开发商、预售许可证、物业公司、产权年限、交房时间</li>
<li><strong>地图找房</strong>:楼盘位置 POI + 周边配套可视化(安居客/百度地图合作模式)</li>
<li><strong>动态资讯</strong>:楼盘动态、取证/开盘信息</li>
<li><strong>底部行动栏(Action Bar)</strong>:在线咨询 / 电话 / 预约看房 / 分享,常驻吸底</li>
</ol>
<p><strong>对本模块的启示:</strong>
- 渠道录入表单按上述信息架构切分为「基础信息 → 价格 → 户型 → 配套 → 资质 → 图片」分步录入,<strong>只录必填,选填可后补</strong>(降低外部渠道录入门槛)
- 详情页优先展示<strong>价格 + 户型 + 联系专员</strong>三要素(转化路径最短)
- 信任要素(预售证/备案价)是 C 端新房转化差异点,表单中做结构化字段而非纯文本</p>
<h3 id="32-erp">3.2 ERP 后台:新房列表管理 + 渠道管理</h3>
<p>调研对象:明源云「分销通」「渠道管家」、华拓云渠道管家、鼎尖新房分销报备等。</p>
<table>
<thead>
<tr>
<th>能力</th>
<th>行业做法</th>
<th>本模块取舍</th>
</tr>
</thead>
<tbody>
<tr>
<td>一键报备</td>
<td>微信/APP 报备直通案场</td>
<td><strong>一期不做报备/判客</strong>(本模块定位是"渠道发盘+获客",不做案场判客)</td>
</tr>
<tr>
<td>实时判客 / 客户归属唯一</td>
<td>API 判客、防撞客纠纷</td>
<td>线索归属沿用现有 <code>estate_customer_lead</code> 归属机制(houseId→agentId→deptId),<strong>归属唯一由线索表天然保证</strong></td>
</tr>
<tr>
<td>全流程管理</td>
<td>报备→判客→带看→分配→纠纷 全线上</td>
<td>一期:注册审核→录入→审核→上架→转发→线索→微信直连;带看/判客列为二期</td>
</tr>
<tr>
<td>佣金结算引擎</td>
<td>成交同步、规则核算、一键结算</td>
<td><strong>二期</strong>,一期只在新盘上挂"佣金说明"文本字段</td>
</tr>
<tr>
<td>渠道洞察</td>
<td>渠道业绩/费效看板</td>
<td>一期做基础统计(渠道数/新盘数/线索数),深度看板二期</td>
</tr>
</tbody>
</table>
<p><strong>对本模块的启示:</strong>
- ERP 新房列表必备列:楼盘名、区域、均价/总价区间、状态(待审核/已上架/已下架/已驳回)、渠道专员、公司、发布时间、线索数
- 渠道管理必备能力:注册审核、启用/停用、所属公司、手机号(脱敏显示)、新盘数、线索数、最后活跃
- 「客户归属唯一」「全程留痕」是行业刚性诉求 → 必须有分享归因 + 线索落库(复用现有机制)</p>
<hr />
<h2 id="_4">四、系统融合方案(与现有模块的完美融合)</h2>
<h3 id="41">4.1 账号模型:组织架构落位 + 双入口(核心决策)</h3>
<p><strong>决策:渠道账号 = sys_user,审核通过后入驻独立部门树「外部渠道体系」;小程序登录与后台登录是同一身份的两个入口。</strong></p>
<pre><code>小程序申请(capi /register, register_channel=NEWHOUSE_CHANNEL)→ c_user + 申请单(estate_newhouse_user, auth_status=PENDING)
│
├─ 审核通过 → 自动建号:sys_user(status='0',入驻「外部渠道体系/xx渠道公司」)
│ + 分配角色「新房渠道专员」(仅 estate:newhouse:*,data_scope=5 仅本人)
│ + estate_user_notice 站内通知
│
├─ 小程序入口:capi 短信登录(c_user 登录态)→ 身份解析 findByPhone → sys_user(微门店同款机制)
│
└─ 后台入口:sys_login(zf.zhuig.com / zfapp.zhuig.com)→ 仅见「新房智联」菜单,双入口录入同一套 estate_newhouse_* 表
拒绝/停用 = auth_status=REJECTED/DISABLED + sys_user.status='1'(禁登录即时生效)
</code></pre>
<p><strong>为什么比双轨方案(c_user + 影像表,不进 sys_user)更好(评估结论):</strong></p>
<table>
<thead>
<tr>
<th>维度</th>
<th>双轨方案</th>
<th>组织架构方案(采用)</th>
</tr>
</thead>
<tbody>
<tr>
<td>权限控制</td>
<td>自建身份判定,ERP 权限另写一套</td>
<td>原生 <code>@PreAuthorize</code> + 角色 + 菜单,零新建机制</td>
</tr>
<tr>
<td>数据域</td>
<td>影像表无部门,主管/专员数据域做不了</td>
<td><code>sys_role_permission_scope</code> data_scope 1-5 直接生效</td>
</tr>
<tr>
<td>组织层级</td>
<td>company_name 仅文本</td>
<td>部门树天然表达「渠道公司→团队→专员」,主管看本部门及以下免费得</td>
</tr>
<tr>
<td>归属链路</td>
<td>线索/分享/企微/提醒全靠 phone→userId 映射(换手机即断)</td>
<td>agentId=userId 直连,微门店整套机制原样复用</td>
</tr>
<tr>
<td>审核/停用</td>
<td>自建 auth_status + 双处同步</td>
<td>申请单状态 + <code>sys_user.status</code> 一处控制</td>
</tr>
<tr>
<td>租户隔离</td>
<td>capi 固定租户,口径要对齐</td>
<td>tenant_id + TenantInterceptor/injectTenantId 双防线自动覆盖</td>
</tr>
<tr>
<td>后台录入</td>
<td>无登录态,做不了</td>
<td>天然支持(需求"渠道进后台录入"的唯一可行解)</td>
</tr>
</tbody>
</table>
<p><strong>代价(必须配套处理,详见 §6.4):</strong> 外部账号进入组织架构会污染用户下拉与人效统计,且外部账号可登录后台扩大敏感面——用「独立部门 + 下拉过滤 + 最小权限角色」三件事对冲。</p>
<h3 id="42">4.2 五端职责与复用映射</h3>
<table>
<thead>
<tr>
<th>端</th>
<th>职责</th>
<th>复用(关键)</th>
<th>新增</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>c-h5(小程序)</strong></td>
<td>渠道申请注册/录入新盘/我的新盘/橱窗转发/联系</td>
<td>注册登录(<code>api/auth.ts</code>)、UGC 录入+我的管理(<code>pagesSub/sharem/</code> 模式)、海报生成(<code>utils/poster.ts</code> PosterData)、橱窗页(<code>pagesSub/mstore/index.vue</code> 结构)</td>
<td><code>pagesSub/newhouse/{index,publish,detail,my}.vue</code></td>
</tr>
<tr>
<td><strong>c-web(官网)</strong></td>
<td>全渠道新盘展示页(列表/详情/专员橱窗)</td>
<td><code>agent/[id]</code> 橱窗模板、HouseCard 组件、SEO/SSR 路由</td>
<td><code>newhouse/</code> 频道(列表 + 详情 + [agentId] 橱窗)</td>
</tr>
<tr>
<td><strong>capi(C 端服务 8635)</strong></td>
<td>渠道申请注册、新盘 CRUD、分享归因、线索、企微联系</td>
<td><code>AuthController</code> 注册登录、<code>AgentMapper.findByPhone</code>(身份解析)、<code>InteractService.writeLead</code>、<code>WecomContactController.contactWay</code></td>
<td><code>/house/c/newhouse/**</code> 一组接口 + <code>NewHouseController</code></td>
</tr>
<tr>
<td><strong>ruoyi-estate(B 端)</strong></td>
<td>ERP 管理:申请审核建号、新盘审核/上下架、统计;后台录入接口</td>
<td><code>EstateStoreController</code>(管理页+接口模板)、<code>SysUser</code> 建号/角色分配(system 服务)、DatabaseMigration 幂等建表</td>
<td><code>EstateNewHouseController</code> + Service/Mapper + <strong>审核建号流程</strong></td>
</tr>
<tr>
<td><strong>ruoyi-ui(ERP 前端)</strong></td>
<td>渠道用户(申请审核建号)、新盘管理、后台录入页</td>
<td><code>views/estate/sharem/post/</code>、<code>views/estate/store/</code> 页面模板、<code>api/estate/</code> 模式、列偏好(right-toolbar)</td>
<td><code>views/estate/newhouse/{user,project,publish}/</code> + <code>api/estate/newhouse.js</code></td>
</tr>
</tbody>
</table>
<h3 id="43">4.3 核心链路设计(融合现有机制)</h3>
<pre><code>渠道销售 客户/经纪人公司 ERP
│ │ │
├─ 小程序申请注册 → c_user + 申请单 ────────────────────────────────→│ 审核
│ │ ├─ 通过 → 建 sys_user 入「外部渠道体系」部门
│ │ │ + 角色「新房渠道专员」+ 站内通知
│ │ │
├─ 录入新盘(小程序 或 后台双入口) │ │
│ → estate_newhouse_project ──────────────→│ │
│ (幂等写 B 端表,含 tenant_id) │ │
│ │ │
├─ 转发橱窗/新盘(海报/小程序卡片/链接) │ │
│ 分享归因 state=`channel_{userId}_{shareType}_{shareId}` │
│ → estate_newhouse_share_log ─────────→│ │
│ │ │
│ 客户浏览详情(c-web / c-h5) │
│ ├─ 「加微信」→ 企微联系我二维码
│ │ state 归因 → estate_customer_wecom 回调建档
│ 咨询/留电 → InteractService.writeLead │
│ │ → estate_customer_lead(MK+yyyyMM+4位)
│ │ → estate_user_notice 站内提醒 ──→│
│ │ ├─ 渠道用户管理(审核建号/停用)
└────────────────────────────────────────────┴────────────────────────┤ 新盘管理(审核/上下架/推荐)
└─ 线索查看(归属专员/部门)
</code></pre>
<p><strong>关键融合点(12 条复用能力):</strong></p>
<ol>
<li><strong>身份模型</strong>:渠道用户即 sys_user(外部渠道部门),归属/分享/企微/站内提醒全部 <strong>userId 直连</strong>;小程序登录态仍走 capi(c_user),身份解析沿用 <code>AgentMapper.findByPhone</code>(<code>c_user.phone</code> ↔ <code>sys_user.phonenumber</code>,微门店同款),<strong>双登录面同一身份</strong></li>
<li><strong>注册登录</strong>:复用 <code>AuthController</code>(/register /loginBySms /loginByWechat),<code>register_channel</code> 增加 <code>NEWHOUSE_CHANNEL</code>;审核通过后由 B 端服务自动建 sys_user + 分配角色(复用 system 的用户/角色服务)</li>
<li><strong>UGC 录入形态</strong>:照搬 sharem「发布即提审」交互,<strong>内容默认审核制</strong>(外部渠道内容需审核,见 §5.2)</li>
<li><strong>橱窗/货架</strong>:照搬 <code>estate_store_listing_pin</code> 增量货架模式 → <code>estate_newhouse_shelf</code>(专员的转发橱窗可置顶/隐藏新盘)</li>
<li><strong>分享归因</strong>:沿用 <code>estate_store_share_log</code> 双轨归因(B端 <code>shareAgentId</code> 参数 / capi <code>state</code> 归因串),新盘分享 shareId 同规则(UUID 前 16 位)</li>
<li><strong>海报/二维码</strong>:PosterData 扩 <code>kind: 'NEWHOUSE'</code>,qrContent = 带归因的新盘分享链接(c-h5/zhenfang-uni/ruoyi-ui 三处海报工具同步)</li>
<li><strong>线索闭环</strong>:咨询/留电走 <code>InteractService.submit</code>(source 扩为 <code>CHANNEL_NEWHOUSE</code>),自动写 <code>estate_customer_lead</code> + <code>estate_user_notice</code> → B 端营销客转正(convert_status 机制不变);<strong>归属 agentId 直接取渠道专员的 sys_user id,无需映射</strong></li>
<li><strong>企微直连</strong>:<code>WecomContactController.contactWay</code> state 前缀扩 <code>channel_</code>(现 <code>mstore_</code>),回调经 <code>estate_customer_wecom</code> 建档;会话存档沿用 <code>estate_store_chat_record</code> 定时拉取</li>
<li><strong>多租户</strong>:渠道专员按真实租户入驻(如 tenant 3 上海房聚缘),<code>injectTenantId</code> 双防线自动覆盖新盘/线索数据;capi 写 B 端表的租户取渠道专员所属租户(不再是固定 capi.tenant-id)</li>
<li><strong>ERP 菜单权限</strong>:复制 8300 微门店菜单模式(M 目录 → C 菜单 → F 按钮)→ 8400 段</li>
<li><strong>数据域精细化</strong>:<code>sys_role_permission_scope</code> 原生生效——渠道主管 data_scope=4(本部门及以下)、渠道专员 data_scope=5(仅本人)、运营 data_scope=1(数据域口径:1全部/2自定义部门/3本部门/4本部门及以下/5仅本人)</li>
<li><strong>上架判定</strong>:WEB/H5 展示沿用 <code>publish_platform LIKE '%SELF%' AND listing_status IN (...)</code> 风格的状态过滤(新盘用自身状态机:DRAFT/PENDING/AUDITED/REJECTED/OFF_SHELF)</li>
</ol>
<h3 id="44">4.4 与「微门店」的边界(防功能打架)</h3>
<table>
<thead>
<tr>
<th></th>
<th>微门店(mstore)</th>
<th>新房智联</th>
</tr>
</thead>
<tbody>
<tr>
<td>用户</td>
<td>内部经纪人(sys_user,内部部门)</td>
<td>外部渠道销售(sys_user,<strong>外部渠道体系部门</strong>,最小权限角色)</td>
</tr>
<tr>
<td>货</td>
<td>二手房/租房(estate_listing)</td>
<td>新盘(estate_newhouse_project,独立表)</td>
</tr>
<tr>
<td>入口</td>
<td>B端 H5 微门店页</td>
<td>小程序 newhouse 页 + 后台录入页</td>
</tr>
<tr>
<td>共享</td>
<td>归因/海报/企微/线索基础设施</td>
<td>同左(同构复用,不共享货架表)</td>
</tr>
</tbody>
</table>
<p><strong>决策:新盘不复用 <code>estate_listing</code></strong>。原因:estate_listing 57 字段 + 11 子表 + 四级级联(项目→栋座→单元→房号)不适配外部渠道轻量录入;字典值 <code>NEW</code> 已于 2026-08-10 下线(<code>V20260810__remove_new_property.sql</code>)。新盘是"楼盘级"信息(一个盘可由多名渠道销售各发一条),与二手房"房源级"模型本质不同。</p>
<h3 id="45-c">4.5 注册与入驻设计(双客群同小程序:C 端客户 + 渠道人员)</h3>
<p><strong>核心决策:注册不分叉,渠道入驻是登录后的"叠加能力"。</strong> 不在注册环节问"你是谁"——所有人注册统一走现有 C 端流程(零改动、零摩擦),渠道入驻是登录后的一个「申请认证」动作,与已定账号模型(申请单 → 审核 → 建 sys_user)无缝衔接。</p>
<table>
<thead>
<tr>
<th>方案</th>
<th>结论</th>
</tr>
</thead>
<tbody>
<tr>
<td>A. 注册时选身份(找房客户/渠道销售)</td>
<td>❌ 注册是 C 端转化最高危环节,多一步即流失;身份判断前置,但一个渠道销售自己也可能找房,两种身份本可共存</td>
</tr>
<tr>
<td>B. 统一注册 + 登录后申请入驻(<strong>采用</strong>)</td>
<td>✅ C 端注册完全不动;渠道申请带实名+审核天然防刷;账号叠加不互斥</td>
</tr>
<tr>
<td>C. 拆双小程序(找房端/渠道工作台)</td>
<td>❌ 行业惯例(贝壳找房 vs 贝壳经纪人)但成本翻倍且<strong>分享链路断裂</strong>——渠道转发的橱窗必须落在客户所在的小程序里</td>
</tr>
<tr>
<td>D. 邀请码注册</td>
<td>非独立方案,作为 B 的增强(绑定归属公司/团队、白名单快速过审)</td>
</tr>
</tbody>
</table>
<p><strong>注册/入驻完整流程:</strong></p>
<pre><code>① 注册(现状不动):/register 或 /loginBySms 首登自动注册 → c_user(短信验证即手机实名一级)
② 渠道入驻申请(新增):填表 → estate_newhouse_user 申请单(auth_status=PENDING)
表单最小集:姓名 + 登录手机号(默认当前手机)+ 渠道公司 + 门店/团队 + 常驻城市
选填:职位 / 名片工牌照片(提通过率)/ 邀请码(有则自动绑定部门归属)
③ ERP「渠道用户」审核通过 → 自动建 sys_user 入「外部渠道体系/xx公司」+ 渠道角色 → 站内通知
④ 身份解锁:小程序「我的」出现渠道专区,新盘录入入口开放
</code></pre>
<p><strong>入驻申请的 4 个入口:</strong></p>
<ol>
<li>「我的」页 →「渠道入驻」banner/列表项(对未入驻用户显示)</li>
<li>新盘录入页 <code>publish</code> 门控:无渠道身份 → 跳申请页(mstore「无权限提示」同款先例)</li>
<li><strong>分享/邀请直达</strong>:已入驻渠道转发橱窗带 <code>invite={userId}</code>、运营邀请海报带邀请码 → 落地申请页并预填归属公司(渠道拉新主路径)</li>
<li>首页金刚区可选入口(运营配置开关)</li>
</ol>
<p><strong>「我的」页身份态门控(运行时按 auth_status 渲染,<code>GET /house/c/newhouse/my/status</code> 统一查询):</strong></p>
<table>
<thead>
<tr>
<th>状态</th>
<th>UI</th>
</tr>
</thead>
<tbody>
<tr>
<td>普通 C 端用户</td>
<td>找房足迹/收藏/委托 + 「渠道入驻」入口</td>
</tr>
<tr>
<td>申请中</td>
<td>入口变为状态卡「入驻审核中」</td>
</tr>
<tr>
<td>已入驻</td>
<td>渠道专区:我的新盘 / 我的橱窗 / 线索数 / 录入入口解锁</td>
</tr>
<tr>
<td>已驳回</td>
<td>状态卡 + 驳回原因 + 重新申请</td>
</tr>
<tr>
<td>已停用</td>
<td>提示联系运营</td>
</tr>
</tbody>
</table>
<p><strong>3 个集成细节(易漏):</strong></p>
<ol>
<li><strong><code>registerCustomerIntoB</code> 处置</strong>(<code>AuthController</code> 注册/首登自动注册后幂等写 <code>estate_customer</code> 营销客):渠道来源注册也会建 C 端客户——<strong>保留</strong>(无害且渠道销售也可能找房),但 <code>register_channel=NEWHOUSE_CHANNEL</code> 落标记,客源统计可筛选排除</li>
<li><strong>重复身份防重</strong>:申请时 findByPhone 命中内部 sys_user 经纪人 → 提示「您已是平台经纪人,无需入驻」;同手机号仅允许一个有效申请(唯一约束);一个 c_user 可叠加渠道身份,与 C 端客户身份不互斥</li>
<li><strong>微信类目审核</strong>:房产类目需资质(C 端找房已涉及);渠道工作台属工具功能混排一般可行,渠道入口保留运营开关以备审核调整</li>
</ol>
<hr />
<h2 id="databasemigration">五、数据模型(DatabaseMigration 新增)</h2>
<blockquote>
<p>版本串:<code>2026.10.11.v33-newhouse-wecom-bind</code>(全局唯一,带业务后缀;上一版为 <code>2026.10.10.v32-newhouse-link</code> 建表,v33 追加菜单 8413 企微绑定权限)
建表走 <code>DatabaseMigration.migrateNewHouseModule()</code>,<code>CREATE TABLE IF NOT EXISTS</code> 幂等。</p>
</blockquote>
<h3 id="51-b-zhenos_sh">5.1 表清单(B 端库 zhenos_sh)</h3>
<table>
<thead>
<tr>
<th>表</th>
<th>作用</th>
<th>关键字段</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>estate_newhouse_user</code></td>
<td>渠道<strong>申请单 + 业务扩展</strong>(账号主体是 sys_user,本表存审核状态与渠道业务信息)</td>
<td>apply_id(PK)、sys_user_id(审核建号后回填)、c_user_id、phone、name、company_name、id_card(加密/可选)、auth_status(PENDING/APPROVED/REJECTED/DISABLED)、reject_reason、wecom_state、tenant_id、del_flag</td>
</tr>
<tr>
<td><code>estate_newhouse_project</code></td>
<td>渠道新盘(一盘一条录入记录)</td>
<td>project_id(PK)、user_id(录入专员=sys_user_id)、project_name、city_id、district_id、address、avg_price/total_price_min/max、sale_status、developer、presale_permit_no、open_time、handover_time、property_right_years、feature_tags、cover_image、images(JSON)、house_types(JSON)、supporting(JSON 交通/教育/商业/医疗)、commission_note、status(DRAFT/PENDING/AUDITED/REJECTED/OFF_SHELF)、reject_reason、publish_platform、tenant_id、del_flag</td>
</tr>
<tr>
<td><code>estate_newhouse_shelf</code></td>
<td>专员转发橱窗货架(复用 pin 模式)</td>
<td>shelf_id、user_id、project_id、pin_type(NORMAL/TOP/HIDE)、sort</td>
</tr>
<tr>
<td><code>estate_newhouse_share_log</code></td>
<td>分享归因</td>
<td>share_id(UUID前16)、user_id、project_id、share_type(HOUSE/STORE)、state、channel(MINI/H5/WEB/POSTER)、view_count、lead_count</td>
</tr>
<tr>
<td><code>estate_newhouse_lead_ext</code></td>
<td>线索扩展(主线索仍落 estate_customer_lead)</td>
<td>lead_id、project_id、share_id、channel_user_id(追溯"谁的分享带来的线索")</td>
</tr>
</tbody>
</table>
<p><strong>账号侧(复用现有表,不新建):</strong>
- <code>sys_user</code> / <code>sys_user_role</code> / <code>sys_dept</code>:审核通过后自动建号入「外部渠道体系/xx渠道公司」部门 + 分配「新房渠道专员」角色
- <code>c_user</code>(zhenos_c):小程序登录态照旧,<code>register_channel</code> 增加 <code>NEWHOUSE_CHANNEL</code> 值;身份解析 findByPhone → sys_user
- 渠道身份判定 = <code>estate_newhouse_user.auth_status=APPROVED</code> 且 sys_user.status='0'</p>
<h3 id="52">5.2 新盘状态机</h3>
<pre><code>草稿(DRAFT) → 待审核(PENDING) → 已上架(AUDITED) ──┬─→ 已下架(OFF_SHELF) → 重新提审(PENDING)
└→ 已驳回(REJECTED) → 可编辑后重新提审
</code></pre>
<ul>
<li>录入发布即进 PENDING(外部渠道内容默认审核制,配置开关 <code>newhouse.autoAudit</code> 可关)</li>
<li>WEB/小程序仅展示 AUDITED;ERP 可见全部</li>
<li>审核通过后同步写 <code>estate_user_notice</code> 通知专员</li>
</ul>
<h3 id="53-estate_customer_lead">5.3 与 estate_customer_lead 的关联</h3>
<p>沿用 <code>InteractService.writeLead</code>,不改主表结构:
- <code>source_channel</code> 增加 <code>CHANNEL_NEWHOUSE</code>(渠道新盘)
- <code>house_id</code> 字段复用为 project_id 语义不可行 → <strong>扩展表 <code>estate_newhouse_lead_ext</code></strong> 按 lead_id 关联(避免污染现有字段语义)
- 归属计算:channel_user_id 即 sys_user id → agentId/deptId 直接落库(无映射环节);异常兜底 DEFAULT_OWNER</p>
<hr />
<h2 id="erp">六、ERP 端联通与权限设计</h2>
<h3 id="61-sys_menu8400">6.1 菜单规划(sys_menu,8400 段——当前空闲)</h3>
<table>
<thead>
<tr>
<th>menu_id</th>
<th>类型</th>
<th>名称</th>
<th>perms</th>
</tr>
</thead>
<tbody>
<tr>
<td>8400</td>
<td>M</td>
<td>新房智联</td>
<td>—</td>
</tr>
<tr>
<td>8401</td>
<td>C</td>
<td>渠道用户</td>
<td><code>estate:newhouse:user:list</code></td>
</tr>
<tr>
<td>8402</td>
<td>C</td>
<td>渠道新盘</td>
<td><code>estate:newhouse:project:list</code></td>
</tr>
<tr>
<td>8403</td>
<td>C</td>
<td>线索看板</td>
<td><code>estate:newhouse:lead:list</code></td>
</tr>
<tr>
<td>8404</td>
<td>C</td>
<td>新盘录入(后台录入入口)</td>
<td><code>estate:newhouse:project:add</code></td>
</tr>
<tr>
<td>8405</td>
<td>C</td>
<td>新房广场(业务租户只读)</td>
<td><code>estate:newhouse:public:list</code></td>
</tr>
<tr>
<td>8411~8417</td>
<td>F(渠道用户按钮)</td>
<td>查询/新增/修改/删除/导出/审核建号/停用</td>
<td><code>estate:newhouse:user:{query|add|edit|remove|export|audit|disable}</code></td>
</tr>
<tr>
<td>8421~8428</td>
<td>F(渠道新盘按钮)</td>
<td>查询/修改/删除/导出/审核/上架/下架/推荐</td>
<td><code>estate:newhouse:project:{query|edit|remove|export|audit|publish|unpublish|recommend}</code></td>
</tr>
<tr>
<td>8431~8433</td>
<td>F(线索按钮)</td>
<td>查询/导出/转客</td>
<td><code>estate:newhouse:lead:{query|export|convert}</code></td>
</tr>
</tbody>
</table>
<p>权限标识严格遵循 <code>estate:模块:业务:操作</code>(操作后缀:list/query/add/edit/remove/export/import + 业务动词 audit/publish/…)。</p>
<h3 id="62-sys_role_permission_scope">6.2 角色与数据域(sys_role_permission_scope 原生生效)</h3>
<table>
<thead>
<tr>
<th>角色</th>
<th>菜单权限</th>
<th>data_scope</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>平台运营/超管(租户 0)</td>
<td>8400~8404 全部 + system:user 管理</td>
<td>1(全部数据)</td>
<td>审核渠道/新盘、跟进线索、绑定企微</td>
</tr>
<tr>
<td><strong>新房渠道专员</strong>(租户 8 专属角色)</td>
<td>8400/8402/8403/8404 + 本人新盘/线索</td>
<td>5(仅本人)</td>
<td>小程序为主,可登录 ERP 但只见到新房菜单</td>
</tr>
<tr>
<td>业务租户(3/7)</td>
<td>仅 8405「新房广场」</td>
<td>—</td>
<td>只读已上架新盘,无审核/渠道/线索权限</td>
</tr>
</tbody>
</table>
<blockquote>
<p>🚨 前置核对:<code>SecurityConfig</code> 的 <code>@EnableMethodSecurity(prePostEnabled)</code> 必须为 <code>true</code>,否则 <code>@PreAuthorize</code> 全部失效(安全规则红线)。</p>
</blockquote>
<h3 id="63-erp">6.3 审核建号流程(ERP 侧)</h3>
<ol>
<li>「渠道用户」页出现 PENDING 申请(姓名/手机号/公司/渠道来源)</li>
<li>点「审核通过」→ 后端同一事务:建 sys_user(userName=手机号、昵称=姓名、password 随机初始化)、入「外部渠道体系/xx渠道公司」部门(公司不存在则建部门)、绑定「新房渠道专员」角色、回填 <code>estate_newhouse_user.sys_user_id</code>、<code>auth_status=APPROVED</code>、写 <code>estate_user_notice</code> 通知</li>
<li>「驳回」→ 填原因,小程序端可见;「停用」→ sys_user.status='1' + auth_status=DISABLED(登录即时失效)</li>
<li>首次登录:小程序短信登录直接可用(登录态走 capi);后台入口需密码重置/短信找回(复用 RuoYi 找回密码或后台重置)</li>
</ol>
<h3 id="64">6.4 防污染与安全约束(组织架构方案的配套代价)</h3>
<ol>
<li><strong>用户下拉过滤</strong>(已核实问题):ERP 多处业务页用 <code>listUser({pageSize: 999~9999})</code> 全量拉用户做下拉(<code>estate/transaction/task</code>、<code>estate/transaction/report</code>、<code>estate/statistics/transaction</code>、<code>system/dept</code> 等)→ 渠道账号会混入经办人/负责人下拉。处置:
- 部门隔离:独立顶级部门「<strong>外部渠道体系</strong>」,与内部部门平行
- <code>selectUserList</code> 及下拉接口按 <code>dept_id NOT IN (外部渠道体系)</code> 过滤(或 DatabaseMigration 给 sys_user 加 <code>account_kind</code> 扩展列,按列过滤更稳)</li>
<li><strong>敏感面管控</strong>:渠道角色只挂 <code>estate:newhouse:*</code>,薪酬/客源/房源/交易/系统管理菜单绝不进渠道角色;渠道角色配置变更需运营复核(权限审计留痕 <code>@Log</code>)</li>
<li><strong>统计口径</strong>:业务日报/人效统计/登录日志按部门排除外部渠道体系,避免污染内部 KPI</li>
<li><strong>双登录面一致性</strong>:小程序身份解析 findByPhone → sys_user 后,与后台登录同一 userId,分享归因/线索归属/站内提醒两端一致;换绑手机号需走申请单更新(同步 sys_user.phonenumber 与 c_user.phone)</li>
<li><strong>账号安全</strong>:后台登录走 sys_login(验证码),渠道账号纳入登录日志监控;导出操作走 <code>export</code> 权限留痕</li>
</ol>
<h3 id="65">6.5 后端联通</h3>
<ul>
<li>ERP 管理接口:<code>/estate/newhouse/**</code>(<code>EstateNewHouseController extends BaseController</code>,<code>@PreAuthorize("@ss.hasPermi('estate:newhouse:...')")</code>,增删改加 <code>@Log</code>);审核建号调用 system 用户服务(不直改框架核心,经 <code>ISysUserService</code>)</li>
<li>capi 接口:<code>/house/c/newhouse/**</code>(JWT header <code>token</code>,走 C 端鉴权,渠道身份校验 = findByPhone → sys_user + <code>estate_newhouse_user.auth_status</code> 双查)</li>
<li>跨端契约:capi 写 B 端表与 ruoyi-estate 读同一套 <code>estate_newhouse_*</code> 表(同库 zhenos_sh,与 sharem/customer_lead 同模式),<strong>无需同步服务</strong></li>
<li>双前端检查清单(跨端守则):本模块改动均为新增接口/新增页面,不触碰共享接口;共享变更点是 <code>InteractService</code> 的 source 枚举、<code>WecomContactController</code> state 前缀、<code>selectUserList</code> 下拉过滤——第三项属共享查询接口,改动前 grep WEB(<code>api/estate/</code>) 与 H5(<code>zhenfang-uni/src/services/</code>) 确认两端下拉不受影响</li>
</ul>
<hr />
<h2 id="ux">七、分端页面设计(UX 规格)</h2>
<h3 id="71-c-h5-pagessubnewhouse">7.1 小程序(c-h5 <code>pagesSub/newhouse/</code>)</h3>
<table>
<thead>
<tr>
<th>页面</th>
<th>内容</th>
<th>复用参考</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>index</code></td>
<td>新盘广场:城市/价格/状态筛选 + 新盘卡片(图/名/均价/标签/专员)</td>
<td>sharem/index</td>
</tr>
<tr>
<td><code>detail</code></td>
<td>新盘详情:头图→均价区间→卖点→户型合一→配套→资质(预售证)→动态→地图→吸底行动栏(咨询/加微信/电话/分享)</td>
<td>行业详情页架构 §3.1</td>
</tr>
<tr>
<td><code>publish</code></td>
<td>分步录入:基础→价格→户型→配套→资质→图片(必填最少化)</td>
<td>sharem/publish</td>
</tr>
<tr>
<td><code>my</code></td>
<td>我的新盘:状态标签(待审/已上架/已驳回)、编辑/下架/转发</td>
<td>sharem/my</td>
</tr>
<tr>
<td><code>shop/[userId]</code></td>
<td>我的橱窗(转发落地页):专员名片 + 转发货架新盘 + 四按钮(分享/电话/加企微/咨询)</td>
<td>mstore/index 整页结构</td>
</tr>
<tr>
<td><code>apply</code></td>
<td>渠道申请注册页(未审核/被驳回状态入口)</td>
<td>auth 注册页扩展</td>
</tr>
</tbody>
</table>
<p>转发能力:<code>onShareAppMessage/onShareTimeline</code> 带 <code>channel={userId}_{shareId}</code>;海报 PosterData <code>kind:'NEWHOUSE'</code>;H5 链接 <code>?shareAgentId=</code> 双轨归因。</p>
<h3 id="72-webc-web">7.2 WEB(c-web)</h3>
<ul>
<li><code>/newhouse</code> 列表(SSR,SEO):城市切换 + 筛选 + 卡片流(HouseCard 复用,扩新房字段)</li>
<li><code>/newhouse/[id]</code> 详情:同小程序详情架构(大屏两栏:左媒体右信息 + 底部联系卡)</li>
<li><code>/newhouse/agent/[userId]</code> 专员橱窗页:对应 mstore 的 WEB 版(c-web 已有 <code>agent/[id]</code> 模板可复用)</li>
<li>「加微信」= 企微联系我二维码弹层(<code>/house/c/wecom/contactWay</code> state=channel_ 归因)</li>
</ul>
<h3 id="73-erpruoyi-ui-viewsestatenewhouse">7.3 ERP(ruoyi-ui <code>views/estate/newhouse/</code>)</h3>
<ul>
<li><code>user/index.vue</code>:渠道用户列表(<strong>申请审核建号</strong>/停用/启用/详情抽屉含其新盘+线索)</li>
<li><code>project/index.vue</code>:渠道新盘列表(筛选:状态/城市/专员;操作:审核弹窗/上下架/推荐/驳回填原因)</li>
<li><code>publish/index.vue</code>:后台新盘录入页(与小程序同表单结构,渠道专员/运营双角色可用)</li>
<li><code>lead/index.vue</code>:线索看板(来源=渠道新盘,含分享归因链路:share_id → project → user)</li>
</ul>
<hr />
<h2 id="_5">八、实施顺序建议(供后续开发排期参考)</h2>
<ol>
<li><strong>M1 数据层 + 账号链路</strong>:DatabaseMigration v32/v33 建表与菜单、capi 申请注册接口、ERP 审核建号流程(sys_user 自动建号+角色+部门)</li>
<li><strong>M2 小程序</strong>:newhouse 六个页面 + 海报/转发归因 + 线索落库</li>
<li><strong>M3 后台录入 + 防污染</strong>:ruoyi-ui 新盘录入页、<code>selectUserList</code> 下拉过滤/<code>account_kind</code> 扩展、统计口径排除</li>
<li><strong>M4 企微直连</strong>:contactWay state 扩 <code>channel_</code> + 回调建档 + 详情页/橱窗页「加微信」</li>
<li><strong>M5 ERP 管理</strong>:菜单 8400 段 SQL + <code>/estate/newhouse/**</code> + ruoyi-ui 管理页 + 角色/数据域配置</li>
<li><strong>M6 WEB 展示</strong>:c-web newhouse 频道(列表/详情/专员橱窗)</li>
<li><strong>M7 验证</strong>:E2E(申请→审核建号→双入口录入→审核→转发→线索→企微直连→停用失效)+ 跨端检查清单 + <code>npm run kg:sync</code>/<code>kg:health</code></li>
</ol>
<p>二期(本方案不含):报备/判客/带看、佣金结算引擎、渠道业绩看板、一房一价结构化、微信登录真打通后的免密注册。</p>
<hr />
<h2 id="_6">九、已知缺口与风险清单</h2>
<table>
<thead>
<tr>
<th>#</th>
<th>风险/缺口</th>
<th>影响</th>
<th>处置建议</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>微信登录 <code>loginByWechat</code> openid 为 mock,未真打通</td>
<td>小程序微信一键注册不可用</td>
<td>一期以短信注册为主,微信登录打通列为前置依赖</td>
</tr>
<tr>
<td>2</td>
<td><code>estate_agent_wecom</code> 只读无写接口(企微绑定手工)</td>
<td>渠道专员企微联系我二维码需人工绑定</td>
<td>增加绑定接口或后台录入页(M4 一并处理)</td>
</tr>
<tr>
<td>3</td>
<td>企微客服(kf)一期空实现</td>
<td>「在线咨询」仅能走线索留言</td>
<td>沿用线索模式,kf 留二期</td>
</tr>
<tr>
<td>4</td>
<td>sharem 的 B 端管理 Controller 缺失(<code>views/estate/sharem/post</code> 孤儿前端)</td>
<td>先例警示:前端页面+API+后端+菜单 SQL 四处必须齐全</td>
<td>本模块按 §8 顺序逐一交付,禁止只落前端</td>
</tr>
<tr>
<td>5</td>
<td><strong>外部账号污染用户下拉/统计</strong>(<code>listUser</code> 全量拉取,多处业务页)</td>
<td>经办人/负责人下拉混入渠道账号;人效统计失真</td>
<td>§6.4 防污染三件套:独立部门 + 下拉过滤(account_kind)+ 统计口径排除</td>
</tr>
<tr>
<td>6</td>
<td><strong>外部账号扩大敏感面</strong>(可登录 ERP/B端H5)</td>
<td>角色配置失误即泄露内部业务数据</td>
<td>渠道角色仅 <code>estate:newhouse:*</code>;核对 <code>@EnableMethodSecurity(prePostEnabled)=true</code>;权限变更审计</td>
</tr>
<tr>
<td>7</td>
<td>本项目 SysUser 无 <code>user_type</code> 字段</td>
<td>外部账号无原生标识列</td>
<td>靠部门隔离为主;建议 DatabaseMigration 加 <code>account_kind</code> 扩展列</td>
</tr>
<tr>
<td>8</td>
<td>手机号明文存储/展示合规风险</td>
<td>渠道用户手机号在 ERP/WEB 展示</td>
<td>ERP 列表脱敏显示(<code>138****5678</code>),导出需 <code>export</code> 权限留痕</td>
</tr>
<tr>
<td>9</td>
<td>外部 UGC 内容合规(虚假楼盘/价格)</td>
<td>展示页内容风险</td>
<td>审核制默认开启 + 驳回原因 + 状态留痕</td>
</tr>
<tr>
<td>10</td>
<td>新盘表字段与录入表单一致性(resultMap/SELECT/INSERT/UPDATE 四处)</td>
<td>字段漏映射值恒 null</td>
<td>按 backend_rules §五检查清单执行</td>
</tr>
</tbody>
</table>
<blockquote>
<p>原风险「capi 固定租户 capi.tenant-id=2」在组织架构方案下已消除主因:渠道专员按真实租户入驻,新盘/线索租户取自专员所属租户;仅游客浏览/留电仍走 capi 固定租户,上线前统一口径即可。</p>
</blockquote>
<hr />
<h2 id="_7">十、变更后必办事项(进入编码阶段时)</h2>
<ol>
<li><code>npx @colbymchenry/codegraph sync</code></li>
<li>三轨捕获:<code>.githooks/post-commit</code> 自动跑 <code>tools/kg/capture.mjs</code></li>
<li>结构变更:生成 <code>.trae/kg-sync/{时间}_newhouse_module.sql</code>(<code>INSERT ... ON DUPLICATE KEY UPDATE</code>,历史 CONCAT 追加),<code>npm run kg:sync -- &lt;单文件&gt;</code>,完成后 <code>npm run kg:health</code>(孤立 0/悬空 0/旧前缀 0/同名重复 0)</li>
<li>实体命名:<code>ZhenosSH:EstateNewHouseUser</code> 等带前缀,新增后补关系(belongs_to / maps_to_table / renders_in)</li>
</ol>
</main>
</div>
</body>
</html>