feat(dept): 科室管理——flw_dept/flw_dept_member 组+成员模型取代单用户映射行(议题3,拍板D1选B)
build / build-push (push) Successful in 54s

- deptKey=本地自增 id;source_group_id 幂等(一键拉取=初始化/刷新语义,不重复建组);不做存量迁移
- 四处读源全部切新表:AssigneeResolver(宽容口径:deptKey 不存在/停用返回空,图示/轨迹不炸)、
  enabledDeptKeys 发布校验白名单、DeptLabelSupport 唯一出口(图示科室视图+轨迹富化)、编辑器 deptList 聚合
- /admin/dept/* 全套端点(CRUD/成员/拉取预览导入);旧 /map/* 映射 CRUD 端点删除
  (保留 /map/lookupUser 选人检索与 /user/teacherTree);flw_assignee_map 实体/表保留不删
- IT 种子切源(FlowTestSupport tag→deptKey 注册表,用例主体零改动);全量 191 绿;E2E 22/22
  (local-debug/four-topics-e-e2e.py,含切源后果验证与生产盘点 SQL)
This commit is contained in:
chenxing
2026-10-10 19:47:58 +08:00
parent 4293c9628a
commit a06b610d9d
18 changed files with 865 additions and 159 deletions
@@ -1,13 +1,9 @@
package com.yunhai.flowcenter.service;
import com.yunhai.flowcenter.entity.FlwAssigneeMap;
import java.util.List;
/**
* 科室口径文案的唯一出口(2026-09-18):DEPT_KEY 节点的"科室名"取值只在 {@link #mappedDeptName}
* 里实现一次——流程图(FlowDiagramService 的科室视图)与流程轨迹(FlowQueryService 的科室口径)
* 共用,避免两边对同一份映射表给出不同名字。
* 科室口径文案的唯一出口(2026-09-18 建,2026-10-10 切源 flw_dept):DEPT_KEY 节点的"科室名"
* 取值只在这里实现一次——流程图(FlowDiagramService 的科室视图)与流程轨迹(FlowQueryService
* 的科室口径)共用,避免两边对同一份科室表给出不同名字。
*/
final class DeptLabelSupport {
@@ -15,18 +11,14 @@ final class DeptLabelSupport {
}
/**
* 映射行里的科室名:取第一个非空 deptName(一个 deptKey 的表现通常一致;科室名可空,
* 空则返回 null 由调用方决定回落链)。
* 科室名(flw_dept.dept_name):科室不存在/已删返回 null,由调用方决定回落链
* (科室不存在≠科室停用——停用科室仍有名字,轨迹/图示照常显示)。
*/
static String mappedDeptName(List<FlwAssigneeMap> maps) {
if (maps == null) {
static String deptName(FlowDeptAdminService deptAdminService, Long schId, String deptKey) {
try {
return deptAdminService.deptName(schId, deptKey);
} catch (Exception e) {
return null;
}
for (FlwAssigneeMap m : maps) {
if (m.getDeptName() != null && !m.getDeptName().trim().isEmpty()) {
return m.getDeptName();
}
}
return null;
}
}