feat: 会议提交剩余时间+解冻 + 会务/劳务材料批量下载 + 多角色人员/账号模块完善

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
郭庆泰
2026-08-25 06:53:18 +08:00
co-authored by Claude
parent 0c882ae846
commit 591a43fe61
126 changed files with 3789 additions and 1334 deletions
@@ -103,20 +103,20 @@
<!--
支持方下拉选项: JOIN sys_user 取主账号 user_name (供分配弹窗缓存 biz_project.sponsor_admin_user_name 用)
返回 Map: userId / orgName / userName
返回 Map: orgId / orgName / userName
EXPLAIN 实际命中: idx_org_type_status (org_type,status) (优化器在数据量小时倾向小索引),
org_name LIKE 走 Using where 二次过滤, ORDER BY org_id DESC 走 filesort
过滤条件: orgName 模糊匹配 (主用) / userId 精确匹配 (拉回已选项)
过滤条件: orgName 模糊匹配 (主用) / orgId 精确匹配 (拉回已选项)
-->
<select id="selectSponsorOrgOptions" parameterType="BizOrg" resultType="java.util.LinkedHashMap">
select o.user_id as userId,
select o.org_id as orgId,
o.org_name as orgName,
u.user_name as userName
from biz_org o
join sys_user u on u.user_id = o.user_id
where o.org_type = 'sponsor'
and u.del_flag = '0'
<if test="userId != null">and o.user_id = #{userId}</if>
<if test="orgId != null">and o.org_id = #{orgId}</if>
<if test="orgName != null and orgName != ''">and o.org_name like concat('%', #{orgName}, '%')</if>
order by o.org_id desc
LIMIT 5
@@ -124,16 +124,16 @@
<!--
执行方下拉选项: JOIN sys_user 取 MAIN 账号 user_name (parent_user_id IS NULL 限定主账号)
返回 Map: userId / orgName / userName
返回 Map: orgId / orgName / userName
EXPLAIN 实际命中: idx_org_type_status (org_type,status) (优化器在数据量小时倾向小索引),
sys_user 走 PRIMARY eq_ref, parent_user_id IS NULL 走 Using where
关键: 只查 MAIN 账号 (parent_user_id IS NULL), 过滤掉同一公司下的普通员工子账号
value=userId (MAIN 账号 sys_user.user_id, 直接写 biz_project_assign.exec_user_id)
value=orgId (biz_org.org_id, 直接写 biz_project_assign.execution_unit_id)
label=orgName (执行单位名称, 不带 user_name 避免人名/昵称混淆)
过滤条件: orgName 模糊匹配 (主用) / userId 精确匹配 (拉回已选项)
过滤条件: orgName 模糊匹配 (主用) / orgId 精确匹配 (拉回已选项)
-->
<select id="selectExecutorOrgOptions" parameterType="BizOrg" resultType="java.util.LinkedHashMap">
select o.user_id as userId,
select o.org_id as orgId,
o.org_name as orgName,
u.user_name as userName
from biz_org o
@@ -141,12 +141,30 @@
where o.org_type = 'executor'
and u.del_flag = '0'
and u.parent_user_id is null
<if test="userId != null">and o.user_id = #{userId}</if>
<if test="orgId != null">and o.org_id = #{orgId}</if>
<if test="orgName != null and orgName != ''">and o.org_name like concat('%', #{orgName}, '%')</if>
order by o.org_id desc
LIMIT 5
</select>
<!--
支持方注册下拉选项 (匿名公开, register-sponsor 选企业注册 SUB 子账号)
与 selectSponsorOrgOptions 的区别: 不 JOIN sys_user → 无主账号 (user_id IS NULL) 的 org 也能被选到
返回 Map: orgId / orgName / mainUserId (= biz_org.user_id, 可为 null)
mainUserId 用于 registerSponsor 判断: 有主账号 → SUB 绑 parent_user_id; 无主账号 → parent_user_id 留空待 admin/manager 分配
-->
<select id="selectSponsorRegisterOptions" parameterType="BizOrg" resultType="java.util.LinkedHashMap">
select o.org_id as orgId,
o.org_name as orgName,
o.user_id as mainUserId
from biz_org o
where o.org_type = 'sponsor'
and o.status = '0'
<if test="orgName != null and orgName != ''">and o.org_name like concat('%', #{orgName}, '%')</if>
order by o.org_id desc
limit 20
</select>
<!--
当前登录 sponsor 的所属公司 (供 /sponsor/account 页面回显 + 主账号改名)
主账号 (sys_user.parent_user_id IS NULL): 用 own (biz_org.user_id = #{userId})
@@ -165,4 +183,17 @@
where u.user_id = #{userId}
limit 1
</select>
<!--
user_id → org_id 单一可信源反查:
MAIN 主账号: biz_org.user_id = #{userId} (企业表直接关联主账号)
SUB 子账号: biz_person.org_id (person 表 user_id = #{userId} 反查企业)
COALESCE 二选一, 都没有返回 NULL
-->
<select id="selectOrgIdByUserId" parameterType="Long" resultType="Long">
select coalesce(
(select org_id from biz_org where user_id = #{userId} limit 1),
(select org_id from biz_person where user_id = #{userId} limit 1)
)
</select>
</mapper>