Forráskód Böngészése

会计,验证章功能 部分开发

徐滕 2 napja
szülő
commit
c60e59e583
36 módosított fájl, 5341 hozzáadás és 3 törlés
  1. 252 0
      docs/architecture/电子签章与流程外置表单集成示例.md
  2. 86 0
      docs/features/finance/会计-报告验证章.bpmn
  3. 8 3
      docs/features/finance/报告执业签章.md
  4. 586 0
      docs/features/finance/报告验证章.md
  5. 791 0
      docs/features/finance/报告验证章_开发文档.md
  6. 158 0
      docs/sql/addsql/20261124__backfill_cw_practice_signature_apply_user_time.sql
  7. 89 0
      docs/sql/addsql/20261124__ddl_cw_report_verification_seal.sql
  8. 87 0
      docs/sql/addsql/20261124__dict_cw_report_verification_seal_status.sql
  9. 97 0
      docs/sql/addsql/20261124__menu_cw_report_verification_seal.sql
  10. 5 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/RoleApiFallbackFactory.java
  11. 8 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/feign/IRoleApi.java
  12. 2 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/SignaturePostUtil.java
  13. 34 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/practiceSignature/service/CwPracticeSignatureService.java
  14. 49 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/controller/CwReportVerificationSealCallBackController.java
  15. 212 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/controller/CwReportVerificationSealController.java
  16. 57 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/domain/CwReportVerificationSeal.java
  17. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/domain/CwReportVerificationSealFile.java
  18. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/mapper/CwReportVerificationSealFileMapper.java
  19. 54 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/mapper/CwReportVerificationSealMapper.java
  20. 229 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/mapper/xml/CwReportVerificationSealMapper.xml
  21. 1578 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/CwReportVerificationSealService.java
  22. 540 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/QiyuesuoVerificationPayloadBuilder.java
  23. 30 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealCarriedFilesDTO.java
  24. 115 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealDTO.java
  25. 43 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealFileDTO.java
  26. 43 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealReportCheckDTO.java
  27. 28 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealReviewerCheckDTO.java
  28. 25 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealSignStatusDTO.java
  29. 20 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/mapstruct/CwReportVerificationSealFileWrapper.java
  30. 20 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/mapstruct/CwReportVerificationSealWrapper.java
  31. 6 0
      jeeplus-modules/jeeplus-finance/src/main/resources/application-finance-development.yml
  32. 6 0
      jeeplus-modules/jeeplus-finance/src/main/resources/application-finance-production.yml
  33. 5 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/RoleApiImpl.java
  34. 8 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/RoleMapper.java
  35. 4 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/RoleMapper.xml
  36. 9 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/RoleService.java

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 252 - 0
docs/architecture/电子签章与流程外置表单集成示例.md


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 86 - 0
docs/features/finance/会计-报告验证章.bpmn


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 8 - 3
docs/features/finance/报告执业签章.md


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 586 - 0
docs/features/finance/报告验证章.md


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 791 - 0
docs/features/finance/报告验证章_开发文档.md


+ 158 - 0
docs/sql/addsql/20261124__backfill_cw_practice_signature_apply_user_time.sql

@@ -0,0 +1,158 @@
+-- ============================================================================
+-- 报告执业签章 · 存量 apply_user_id / apply_user_name / apply_time 回填
+-- 背景:这三个字段是 2026-11-23 16:00(提交 e6e65330)才在
+--       CwPracticeSignatureService.saveDraft() 的送审分支里开始写的(状态置 2 时落
+--       发起人快照与发起时间)。此前送审的单据谁都没写,所以列表【发起时间】一直是
+--       "-",【发起人】靠模板里的 `applyUserName || createByName` 兜底才看着正常。
+-- 口径(2026-11-24 用户定稿):
+--       **只要 apply_time 为空,就用 create_time 填**,发起人一律取创建人。
+--       送审过的单也一视同仁 —— 不再去 JOIN act_hi_procinst 取流程启动时间。
+--       代价:对"先暂存、隔几天才送审"的单,这里填的是建单时间,可能比真正点
+--       【送审】早几天;换来的是脚本只碰一张业务表 + sys_user,没有跨库问题、
+--       也不会因 act_hi_procinst 与业务表 COLLATION 不同报 1267。
+--       精确版(送审过的取流程启动时间、其余用创建时间)见文末附录 A。
+-- 范围:del_flag = 0 且 apply_time IS NULL 的全部行 —— 含状态 1 暂存单。
+--       暂存单本来就没有"发起"这个动作,这里按用户口径用创建时间顶上,
+--       让列表不再出现 "-"。
+-- 前提:sys_user 与业务表同库(本项目 jeeplus-system 与业务表同库;生产若分库,
+--       给 sys_user 加上库名即可)。
+-- 幂等:UPDATE 以 `apply_time IS NULL` 为条件,第二次执行起 0 行受影响;
+--       备份表用 CREATE TABLE IF NOT EXISTS,只建一次。不含 DROP / TRUNCATE。
+-- 执行顺序:第 0 段预览(只读)→ 第 1 段备份 → 第 2 段回填 → 第 3 段校验(只读)。
+-- 局限:本脚本只治**历史行**,跑不跑都不影响显示 —— 列表/详情的"没发起时间就用创建时间"
+--       已于 2026-11-24 直接改在前端(见附录 B),新单与暂存单都不会再出现 "-"。
+--       是否还跑本脚本,取决于你要不要把老单的 apply_user_name / apply_time 真正落库
+--       (按发起人筛选、导出、统计才用得到)。
+-- author: Qoder 2026-11-24
+-- ============================================================================
+
+SET NAMES utf8mb4;
+
+-- ---------------------------------------------------------------------------
+-- 0. 预览(只读):先看条数和明细,确认口径没问题再往下跑
+-- ---------------------------------------------------------------------------
+-- 0.1 按状态分组看总量(1 暂存 / 2 待审核 / 3 撤回 / 4 驳回 / 5 签章完成 / 6 签署中 / 7 签章失败)
+SELECT a.status,
+       COUNT(*)                                             AS rows_to_fix,
+       SUM(CASE WHEN a.proc_ins_id IS NULL OR a.proc_ins_id = '' THEN 1 ELSE 0 END) AS never_submitted
+FROM cw_practice_signature a
+WHERE a.del_flag = 0
+  AND a.apply_time IS NULL
+GROUP BY a.status;
+
+-- 0.2 明细(人工复核用:报告号 + 项目名 + 姓名 + 要填进去的时间,不放 UUID)
+SELECT a.report_no,
+       a.project_name,
+       su.name       AS creator_name,
+       a.status,
+       a.create_time AS apply_time_will_be,
+       a.proc_ins_id
+FROM cw_practice_signature a
+LEFT JOIN sys_user su ON su.id = a.create_by_id
+WHERE a.del_flag = 0
+  AND a.apply_time IS NULL
+ORDER BY a.create_time DESC;
+
+-- 0.3 异常体检:create_time 也是空的行(第 2 段会跳过它们,跑完仍为 NULL)
+SELECT COUNT(*) AS no_create_time_rows
+FROM cw_practice_signature a
+WHERE a.del_flag = 0
+  AND a.apply_time IS NULL
+  AND a.create_time IS NULL;
+
+-- 0.4 反向体检:已有 apply_time 的行(修复后送审的,本次不动)
+SELECT COUNT(*) AS already_filled_rows, MIN(apply_time) AS earliest, MAX(apply_time) AS latest
+FROM cw_practice_signature
+WHERE del_flag = 0 AND apply_time IS NOT NULL;
+
+-- ---------------------------------------------------------------------------
+-- 1. 备份:只备份本次要改的行,出问题可以按 id 逐行还原(还原语句见第 5 段)
+-- ---------------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS cw_practice_signature_bak_20261124_apply AS
+SELECT a.id,
+       a.report_no,
+       a.status,
+       a.proc_ins_id,
+       a.apply_user_id,
+       a.apply_user_name,
+       a.apply_time,
+       NOW() AS bak_time
+FROM cw_practice_signature a
+WHERE a.del_flag = 0
+  AND a.apply_time IS NULL;
+
+-- ---------------------------------------------------------------------------
+-- 2. 回填:发起时间取创建时间,发起人取创建人
+--    su.name 不过滤 del_flag —— 姓名是快照,人后来停用了也得有名字
+-- ---------------------------------------------------------------------------
+UPDATE cw_practice_signature a
+LEFT JOIN sys_user su ON su.id = a.create_by_id
+SET a.apply_time      = a.create_time,
+    a.apply_user_id   = a.create_by_id,
+    a.apply_user_name = su.name
+WHERE a.del_flag = 0
+  AND a.apply_time IS NULL
+  AND a.create_time IS NOT NULL;
+
+-- ---------------------------------------------------------------------------
+-- 3. 校验(只读)
+-- ---------------------------------------------------------------------------
+-- 3.1 期望:null_total = 0.3 的行数(只剩 create_time 也为空的极端行);
+--          time_but_no_name = 0(填了时间但没填上姓名,说明 create_by_id 在 sys_user 找不到)
+SELECT COUNT(*)                                                        AS total_rows,
+       SUM(CASE WHEN apply_time IS NULL THEN 1 ELSE 0 END)             AS null_total,
+       SUM(CASE WHEN apply_user_name IS NULL THEN 1 ELSE 0 END)        AS name_null,
+       SUM(CASE WHEN apply_time IS NOT NULL AND apply_user_name IS NULL
+                THEN 1 ELSE 0 END)                                     AS time_but_no_name,
+       SUM(CASE WHEN apply_user_id IS NOT NULL AND create_by_id IS NOT NULL
+                 AND apply_user_id <> create_by_id THEN 1 ELSE 0 END)  AS applyer_not_creator,
+       MIN(apply_time)                                                 AS earliest,
+       MAX(apply_time)                                                 AS latest
+FROM cw_practice_signature
+WHERE del_flag = 0;
+
+-- 3.2 抽样看列表要显示的内容(报告号 / 发起人 / 发起时间 / 状态)
+SELECT a.report_no, a.project_name, a.apply_user_name, a.apply_time,
+       a.status, a.sign_finish_time
+FROM cw_practice_signature a
+WHERE a.del_flag = 0
+ORDER BY a.apply_time DESC
+LIMIT 20;
+
+-- ---------------------------------------------------------------------------
+-- 4. 回滚(只在需要时用;按备份表逐行还原,不整表覆盖)
+-- ---------------------------------------------------------------------------
+-- UPDATE cw_practice_signature a
+-- JOIN cw_practice_signature_bak_20261124_apply b ON b.id = a.id
+-- SET a.apply_user_id   = b.apply_user_id,
+--     a.apply_user_name = b.apply_user_name,
+--     a.apply_time      = b.apply_time;
+
+-- ---------------------------------------------------------------------------
+-- 附录 A:精确版(**默认不跑**,只有在"送审过的必须显示真实送审时刻"时才用)
+--   先跑 A.1 把送审过的按流程实例启动时间填准,再跑本文第 2 段把剩下的(暂存单、
+--   流程历史已清理的)用创建时间兜住。第 2 段带 apply_time IS NULL 条件,
+--   不会覆盖 A.1 已写好的精确值。
+--   跨库时给 act_hi_procinst 加库名;若与业务表 COLLATION 不同报 1267,
+--   把 JOIN 改成 ON h.PROC_INST_ID_ = a.proc_ins_id COLLATE utf8mb4_general_ci。
+-- ---------------------------------------------------------------------------
+-- UPDATE cw_practice_signature a
+-- JOIN act_hi_procinst h ON h.PROC_INST_ID_ = a.proc_ins_id
+-- LEFT JOIN sys_user su ON su.id = a.create_by_id
+-- SET a.apply_time      = h.START_TIME_,
+--     a.apply_user_id   = a.create_by_id,
+--     a.apply_user_name = su.name
+-- WHERE a.del_flag = 0
+--   AND a.apply_time IS NULL;
+
+-- ---------------------------------------------------------------------------
+-- 附录 B:前端兜底**已于 2026-11-24 落地**(这才是长期解,本脚本因此变成可选)
+--   PracticeSignatureList.vue:87      {{ scope.row.applyTime || scope.row.createTime || '-' }}
+--   PracticeSignatureDetailPopup.vue  :value="inputForm.applyTime || inputForm.createTime || '-'"
+--   PracticeSignatureAuditForm.vue    同上
+--   后端零改动:findList / queryById 都 select 了 a.create_time(Base_Column_List:61),
+--   BaseResultMap:10 已映射到 DTO.createTime,所以列表与详情都拿得到。
+--   ⇒ 暂存单与新单都不会再显示 "-",**历史行不跑本脚本也不影响显示**。
+--   本脚本仍值得跑一次的理由只有一个:把 apply_user_name / apply_time 落进库,
+--   便于以后按发起人筛选、导出、统计(现在这三列在库里对老单仍是空的)。
+-- ---------------------------------------------------------------------------

+ 89 - 0
docs/sql/addsql/20261124__ddl_cw_report_verification_seal.sql

@@ -0,0 +1,89 @@
+-- ============================================================================
+-- 报告验证章 · E1 数据库脚本 · 2 张业务表
+-- 用途:新建报告验证章申请主表与文件子表。
+--       cw_report_verification_seal      申请主表(一份申请一行)
+--       cw_report_verification_seal_file 申请文件(执业章带出件与手工上传件共存)
+-- 目标库:会计业务库(cw_project_records、sys_dict、sys_menu 所在库)。
+-- 字符集:utf8mb4 / utf8mb4_unicode_ci,确保中文文件名与 OSS 路径可完整保存。
+-- 主键:varchar(64),由 MyBatis-Plus 生成;审计字段由框架自动填充。
+-- 幂等:只使用 CREATE TABLE IF NOT EXISTS,可重复执行;不修改任何存量表。
+-- 执行顺序:先跑本脚本,再跑状态字典与菜单脚本,最后发布 jeeplus-finance。
+-- 自检:脚本末尾均为只读 SELECT;预期 2 张表、2 行表信息、3 行关键列信息。
+-- author: Qoder 2026-11-24
+-- ============================================================================
+
+SET NAMES utf8mb4;
+
+-- ---------------------------------------------------------------------------
+-- 1. 申请主表
+-- ---------------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS cw_report_verification_seal (
+  id                    varchar(64)  NOT NULL COMMENT '主键',
+  project_name          varchar(255) DEFAULT NULL COMMENT '项目名称快照(来源同执业章报告台账)',
+  report_id             varchar(64)  DEFAULT NULL COMMENT '报告台账id快照(cw_project_report.id;送审必填,草稿可空)',
+  report_no             varchar(64)  DEFAULT NULL COMMENT '报告号快照(来源cw_project_report_new_line.report_no;一单一个报告号,送审必填,草稿可空)',
+  contract_id           varchar(64)  DEFAULT NULL COMMENT '契约锁合同id(当前有效那份;驳回/撤回重发换新值,旧值写remarks)',
+  contract_tenant_name  varchar(255) DEFAULT NULL COMMENT '建单时企业主体名快照',
+  status                char(1)      DEFAULT '0' COMMENT '状态(0:草稿,1:待盖章,2:待复核,3:复核通过,4:已驳回,5:已撤回,6:已终止)',
+  proc_ins_id           varchar(64)  DEFAULT NULL COMMENT '流程实例id',
+  process_definition_id varchar(64)  DEFAULT NULL COMMENT '流程定义id',
+  apply_user_id         varchar(64)  DEFAULT NULL COMMENT '发起人id(节点1办理人=本人)',
+  signed_zip_url        varchar(500) DEFAULT NULL COMMENT '已盖章压缩包OSS路径(复核通过后CONTRACT_COMPLETE回调上传;为空=还没可下载)',
+  remarks               varchar(1000) DEFAULT NULL COMMENT '备注/变更记录(旧contract_id留痕写这里)',
+  create_by_id          varchar(64)  DEFAULT NULL,
+  create_time           datetime     DEFAULT NULL,
+  update_by_id          varchar(64)  DEFAULT NULL,
+  update_time           datetime     DEFAULT NULL,
+  del_flag              char(1)      DEFAULT '0' COMMENT '逻辑删除(0:正常,1:删除)',
+  tenant_id             varchar(64)  DEFAULT NULL COMMENT '租户id(框架自动填,禁止手工set)',
+  PRIMARY KEY (id),
+  KEY idx_rvs_contract (contract_id),
+  KEY idx_rvs_proc_ins (proc_ins_id),
+  KEY idx_rvs_status_del (status, del_flag),
+  KEY idx_rvs_apply (apply_user_id, del_flag),
+  KEY idx_rvs_report (report_id, del_flag)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='报告验证章申请单';
+
+-- ---------------------------------------------------------------------------
+-- 2. 申请文件子表
+-- ---------------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS cw_report_verification_seal_file (
+  id                     varchar(64)  NOT NULL COMMENT '主键',
+  verification_seal_id  varchar(64)  DEFAULT NULL COMMENT '主表id(cw_report_verification_seal.id;非契约锁印章编号)',
+  source                 char(1)      DEFAULT NULL COMMENT '来源(1:带出执业章已盖章件,2:手工上传)',
+  ref_practice_file_id   varchar(64)  DEFAULT NULL COMMENT 'source=1时回指cw_practice_signature_file.id(审计链)',
+  file_name              varchar(500) DEFAULT NULL COMMENT '文件名',
+  attachment_id          varchar(64)  DEFAULT NULL COMMENT '送契约锁原件附件id(work_attachment.id;带出行=执业章signed_attachment_id)',
+  document_id            varchar(64)  DEFAULT NULL COMMENT '契约锁documentId(建单后回填)',
+  sort                   int          DEFAULT NULL COMMENT '排序',
+  remarks                varchar(1000) DEFAULT NULL,
+  create_by_id           varchar(64)  DEFAULT NULL,
+  create_time            datetime     DEFAULT NULL,
+  update_by_id           varchar(64)  DEFAULT NULL,
+  update_time            datetime     DEFAULT NULL,
+  del_flag               char(1)      DEFAULT '0',
+  tenant_id              varchar(64)  DEFAULT NULL COMMENT '租户id(框架自动填)',
+  PRIMARY KEY (id),
+  KEY idx_rvs_file_seal (verification_seal_id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='报告验证章申请文件(混合共存,全部进documents)';
+
+-- ---------------------------------------------------------------------------
+-- 执行后只读自检
+-- ---------------------------------------------------------------------------
+SELECT COUNT(*) AS expected_table_count
+  FROM information_schema.TABLES
+ WHERE TABLE_SCHEMA = DATABASE()
+   AND TABLE_NAME IN ('cw_report_verification_seal', 'cw_report_verification_seal_file');
+
+SELECT TABLE_NAME, TABLE_COLLATION, TABLE_COMMENT
+  FROM information_schema.TABLES
+ WHERE TABLE_SCHEMA = DATABASE()
+   AND TABLE_NAME IN ('cw_report_verification_seal', 'cw_report_verification_seal_file')
+ ORDER BY TABLE_NAME;
+
+SELECT TABLE_NAME, COLUMN_NAME, COLUMN_TYPE, CHARACTER_SET_NAME, COLLATION_NAME
+  FROM information_schema.COLUMNS
+ WHERE TABLE_SCHEMA = DATABASE()
+   AND ((TABLE_NAME = 'cw_report_verification_seal' AND COLUMN_NAME = 'signed_zip_url')
+     OR (TABLE_NAME = 'cw_report_verification_seal_file' AND COLUMN_NAME IN ('file_name', 'attachment_id')))
+ ORDER BY TABLE_NAME, COLUMN_NAME;

+ 87 - 0
docs/sql/addsql/20261124__dict_cw_report_verification_seal_status.sql

@@ -0,0 +1,87 @@
+-- ============================================================================
+-- 报告验证章 · E1 字典脚本 · cw_report_verification_seal_status
+-- 用途:新建报告验证章状态字典,共 1 个类型、7 个值(0~6)。
+-- 目标库:会计业务库(sys_dict_type / sys_dict_value 所在库)。
+-- 幂等:INSERT ... SELECT ... WHERE NOT EXISTS,可重复执行;不修改任何已有字典。
+-- 缓存:执行后刷新字典缓存或重新登录,前端才能读取新字典。
+-- 自检:脚本末尾均为只读 SELECT;预期类型 1 个、启用值 7 个。
+-- author: Qoder 2026-11-24
+-- ============================================================================
+
+SET NAMES utf8mb4;
+
+-- ---------------------------------------------------------------------------
+-- 1. 字典类型
+-- ---------------------------------------------------------------------------
+INSERT INTO sys_dict_type (id, type, remarks, create_by_id, create_time, update_by_id, update_time, del_flag, tenant_id)
+SELECT 'cw_report_verification_seal_status_type', 'cw_report_verification_seal_status', '报告验证章状态', '1', NOW(), '1', NOW(), 0, NULL
+  FROM dual
+ WHERE NOT EXISTS (SELECT 1 FROM sys_dict_type WHERE type = 'cw_report_verification_seal_status');
+
+-- ---------------------------------------------------------------------------
+-- 2. 字典值
+-- ---------------------------------------------------------------------------
+INSERT INTO sys_dict_value (id, dict_type_id, label, value, sort, create_by_id, create_time, update_by_id, update_time, del_flag, remarks, tenant_id)
+SELECT 'cw_report_verification_seal_status_0', t.id, '草稿', '0', '0', '1', NOW(), '1', NOW(), 0, '已保存,尚未送审', NULL
+  FROM sys_dict_type t
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND NOT EXISTS (SELECT 1 FROM sys_dict_value v WHERE v.dict_type_id = t.id AND v.value = '0');
+
+INSERT INTO sys_dict_value (id, dict_type_id, label, value, sort, create_by_id, create_time, update_by_id, update_time, del_flag, remarks, tenant_id)
+SELECT 'cw_report_verification_seal_status_1', t.id, '待盖章', '1', '1', '1', NOW(), '1', NOW(), 0, '合同已创建,等待发起人完成验证章盖章', NULL
+  FROM sys_dict_type t
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND NOT EXISTS (SELECT 1 FROM sys_dict_value v WHERE v.dict_type_id = t.id AND v.value = '1');
+
+INSERT INTO sys_dict_value (id, dict_type_id, label, value, sort, create_by_id, create_time, update_by_id, update_time, del_flag, remarks, tenant_id)
+SELECT 'cw_report_verification_seal_status_2', t.id, '待复核', '2', '2', '1', NOW(), '1', NOW(), 0, '发起人已盖章并同意,等待复核角色处理', NULL
+  FROM sys_dict_type t
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND NOT EXISTS (SELECT 1 FROM sys_dict_value v WHERE v.dict_type_id = t.id AND v.value = '2');
+
+INSERT INTO sys_dict_value (id, dict_type_id, label, value, sort, create_by_id, create_time, update_by_id, update_time, del_flag, remarks, tenant_id)
+SELECT 'cw_report_verification_seal_status_3', t.id, '复核通过', '3', '3', '1', NOW(), '1', NOW(), 0, '复核人已同意并强制完成合同,等待或已接收已盖章压缩包', NULL
+  FROM sys_dict_type t
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND NOT EXISTS (SELECT 1 FROM sys_dict_value v WHERE v.dict_type_id = t.id AND v.value = '3');
+
+INSERT INTO sys_dict_value (id, dict_type_id, label, value, sort, create_by_id, create_time, update_by_id, update_time, del_flag, remarks, tenant_id)
+SELECT 'cw_report_verification_seal_status_4', t.id, '已驳回', '4', '4', '1', NOW(), '1', NOW(), 0, '复核人已驳回并召回合同,回到节点1修改后重新申请', NULL
+  FROM sys_dict_type t
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND NOT EXISTS (SELECT 1 FROM sys_dict_value v WHERE v.dict_type_id = t.id AND v.value = '4');
+
+INSERT INTO sys_dict_value (id, dict_type_id, label, value, sort, create_by_id, create_time, update_by_id, update_time, del_flag, remarks, tenant_id)
+SELECT 'cw_report_verification_seal_status_5', t.id, '已撤回', '5', '5', '1', NOW(), '1', NOW(), 0, '发起人已撤回并召回合同,可重新申请', NULL
+  FROM sys_dict_type t
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND NOT EXISTS (SELECT 1 FROM sys_dict_value v WHERE v.dict_type_id = t.id AND v.value = '5');
+
+INSERT INTO sys_dict_value (id, dict_type_id, label, value, sort, create_by_id, create_time, update_by_id, update_time, del_flag, remarks, tenant_id)
+SELECT 'cw_report_verification_seal_status_6', t.id, '已终止', '6', '6', '1', NOW(), '1', NOW(), 0, '预留状态,本版不提供写入入口', NULL
+  FROM sys_dict_type t
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND NOT EXISTS (SELECT 1 FROM sys_dict_value v WHERE v.dict_type_id = t.id AND v.value = '6');
+
+-- ---------------------------------------------------------------------------
+-- 执行后只读自检
+-- ---------------------------------------------------------------------------
+SELECT COUNT(*) AS expected_type_count
+  FROM sys_dict_type
+ WHERE type = 'cw_report_verification_seal_status'
+   AND del_flag = 0;
+
+SELECT COUNT(*) AS expected_value_count
+  FROM sys_dict_value v
+  JOIN sys_dict_type t ON t.id = v.dict_type_id
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND t.del_flag = 0
+   AND v.del_flag = 0;
+
+SELECT v.value, v.label, v.sort, v.remarks
+  FROM sys_dict_value v
+  JOIN sys_dict_type t ON t.id = v.dict_type_id
+ WHERE t.type = 'cw_report_verification_seal_status'
+   AND t.del_flag = 0
+   AND v.del_flag = 0
+ ORDER BY CAST(v.sort AS UNSIGNED);

+ 97 - 0
docs/sql/addsql/20261124__menu_cw_report_verification_seal.sql

@@ -0,0 +1,97 @@
+-- ============================================================================
+-- 报告验证章 · E1 菜单脚本 · 1 个页面菜单 + 8 个按钮权限
+-- 用途:在「报告管理(会计)」下新增「报告验证章」页面,并配置前端按钮权限。
+-- 目标库:会计业务库(sys_menu 所在库)。
+-- 前置:先跑同目录 ddl_cw_report_verification_seal.sql 与
+--       dict_cw_report_verification_seal_status.sql。
+-- 幂等:INSERT ... SELECT ... WHERE NOT EXISTS,可重复执行;不修改任何存量菜单。
+-- 授权:角色授权走系统管理界面;脚本不写 sys_role_menu,避免绕过菜单缓存清理。
+-- 自检:脚本末尾均为只读 SELECT;预期本功能启用权限点共 9 个。
+-- author: Qoder 2026-11-24
+-- ============================================================================
+
+SET NAMES utf8mb4;
+
+-- ---------------------------------------------------------------------------
+-- 0. 解析父菜单;父菜单不存在时停止插入,避免产生孤儿权限
+-- ---------------------------------------------------------------------------
+SET @parent_name = '报告管理(会计)';
+
+SET @parent_id = (SELECT m.id FROM sys_menu m
+                   WHERE m.del_flag = '0'
+                     AND m.menu_type IN ('0', '1')
+                     AND m.name = @parent_name
+                   ORDER BY m.id LIMIT 1);
+
+SET @parent_ids = (SELECT CONCAT(m.parent_ids, m.id, ',') FROM sys_menu m
+                    WHERE m.id = @parent_id);
+
+SELECT IF(@parent_id IS NULL,
+          CONCAT('[FAIL] 没找到父菜单「', @parent_name, '」,本次不会插入任何菜单。请核对父菜单名称后重跑。'),
+          CONCAT('[OK] 父菜单「', @parent_name, '」 id=', @parent_id, ' parent_ids=', @parent_ids))
+       AS step0_parent_check;
+
+-- ---------------------------------------------------------------------------
+-- 1. 页面菜单
+--    href 为 src/views 下组件绝对路径,必须带前导斜杠
+-- ---------------------------------------------------------------------------
+SET @menu_id = 'cwrv0000000000000000000000000000';
+
+INSERT INTO sys_menu (id, parent_id, parent_ids, name, sort, href, target, icon,
+                      is_show, permission, create_by_id, create_time, update_by_id, update_time,
+                      remarks, del_flag, menu_type, affix, tenant_id, code, hidden_breadcrumb)
+SELECT @menu_id, @parent_id, @parent_ids, '报告验证章', 91,
+       '/cw/reportVerificationSeal/ReportVerificationSealList', '_self', '',
+       '1', 'cw:reportVerificationSeal:list', '1', NOW(), '1', NOW(),
+       '报告验证章申请台账', 0, '1', '0', NULL, '', '0'
+  FROM dual
+ WHERE @parent_id IS NOT NULL
+   AND NOT EXISTS (SELECT 1 FROM sys_menu m WHERE m.id = @menu_id);
+
+SET @menu_exists = (SELECT COUNT(1) FROM sys_menu m WHERE m.id = @menu_id AND m.del_flag = '0');
+
+-- ---------------------------------------------------------------------------
+-- 2. 按钮权限;menu_type='2'、is_show='0'、href=NULL
+-- ---------------------------------------------------------------------------
+INSERT INTO sys_menu (id, parent_id, parent_ids, name, sort, href, target, icon,
+                      is_show, permission, create_by_id, create_time, update_by_id, update_time,
+                      remarks, del_flag, menu_type, affix, tenant_id, code, hidden_breadcrumb)
+SELECT t.id, @menu_id, CONCAT(@parent_ids, @menu_id, ','), t.name, t.sort, NULL, NULL, NULL,
+       '0', t.permission, '1', NOW(), '1', NOW(), t.remarks, 0, '2', '0', NULL, '', '0'
+  FROM (
+                      SELECT 'cwrv0000000000000000000000000001' AS id, '新增'               AS name, 10 AS sort, 'cw:reportVerificationSeal:add'      AS permission, '新建报告验证章申请' AS remarks
+        UNION ALL SELECT 'cwrv0000000000000000000000000002',      '修改',               20, 'cw:reportVerificationSeal:edit',     '修改草稿或撤回后重新申请'
+        UNION ALL SELECT 'cwrv0000000000000000000000000003',      '删除',               30, 'cw:reportVerificationSeal:delete',   '逻辑删除草稿'
+        UNION ALL SELECT 'cwrv0000000000000000000000000004',      '送审',               40, 'cw:reportVerificationSeal:submit',   '校验报告与复核角色后创建合同并送审'
+        UNION ALL SELECT 'cwrv0000000000000000000000000005',      '撤回',               50, 'cw:reportVerificationSeal:withdraw', '发起人撤回并召回合同'
+        UNION ALL SELECT 'cwrv0000000000000000000000000006',      '盖章',               60, 'cw:reportVerificationSeal:seal',     '打开本人验证章拖章页面'
+        UNION ALL SELECT 'cwrv0000000000000000000000000007',      '查看盖章情况',       70, 'cw:reportVerificationSeal:review',   '复核人查看只读盖章页面'
+        UNION ALL SELECT 'cwrv0000000000000000000000000008',      '下载已盖章件',       80, 'cw:reportVerificationSeal:download', '复核通过后下载已盖章压缩包'
+  ) t
+ WHERE @menu_exists = 1
+   AND NOT EXISTS (SELECT 1 FROM sys_menu m WHERE m.id = t.id);
+
+-- ---------------------------------------------------------------------------
+-- 3. 执行后只读自检
+-- ---------------------------------------------------------------------------
+SELECT COUNT(*) AS expected_menu_count
+  FROM sys_menu
+ WHERE del_flag = '0'
+   AND permission LIKE 'cw:reportVerificationSeal:%';
+
+SELECT m.id, m.parent_id, m.name, m.menu_type, m.is_show, m.href, m.permission, m.sort
+  FROM sys_menu m
+ WHERE m.del_flag = '0'
+   AND m.permission IN ('cw:reportVerificationSeal:list',
+                        'cw:reportVerificationSeal:add',
+                        'cw:reportVerificationSeal:edit',
+                        'cw:reportVerificationSeal:delete',
+                        'cw:reportVerificationSeal:submit',
+                        'cw:reportVerificationSeal:withdraw',
+                        'cw:reportVerificationSeal:seal',
+                        'cw:reportVerificationSeal:review',
+                        'cw:reportVerificationSeal:download')
+ ORDER BY m.sort;
+
+-- 非 SQL 动作:在系统管理→角色管理中,把新菜单及所需按钮授权给发起人群和
+-- 「兴光会计报告签章专员」;保存后重新登录,使权限集合与字典缓存生效。

+ 5 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/RoleApiFallbackFactory.java

@@ -41,6 +41,11 @@ public class RoleApiFallbackFactory implements FallbackFactory <IRoleApi> {
             }
 
             @Override
+            public RoleDTO getRoleDTOByNameIgnoreTenant(String name) {
+                return null;
+            }
+
+            @Override
             public RoleDTO getRoleDTOById(String id) {
                 return null;
             }

+ 8 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/feign/IRoleApi.java

@@ -34,6 +34,14 @@ public interface IRoleApi {
      */
     @GetMapping(value = "/sys/role/getRoleDTOByName2")
     RoleDTO getRoleDTOByName2(@RequestParam(value = "name") String name);
+
+    /**
+     * 获取角色(忽略租户过滤,用于系统级角色校验)
+     *
+     * @return
+     */
+    @GetMapping(value = "/feign/sys/role/getRoleDTOByNameIgnoreTenant")
+    RoleDTO getRoleDTOByNameIgnoreTenant(@RequestParam(value = "name") String name);
     /**
      * 获取角色
      *

+ 2 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/SignaturePostUtil.java

@@ -340,6 +340,8 @@ public class SignaturePostUtil {
                     }
                     out.write(sbFormData.toString().getBytes(requestEncoding));
                 }
+                // multipart 必须以 --boundary-- 结束,缺结束行时契约锁解析不到字段,实测返回 code=100 请求失败
+                out.write(("--" + boundary + "--").getBytes(requestEncoding));
             } else {
                 String boundary = "-----------------------------" + String.valueOf(new Date().getTime());
                 connection.setRequestProperty("content-type", "multipart/form-data; boundary=" + boundary);

+ 34 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/practiceSignature/service/CwPracticeSignatureService.java

@@ -1230,6 +1230,10 @@ public class CwPracticeSignatureService extends ServiceImpl<CwPracticeSignatureM
             CwPracticeSignature newest = cwPracticeSignatureMapper.selectById(id);
             throw new Exception("单据状态已被更新为" + StringUtils.defaultIfBlank(newest == null ? "" : newest.getStatus(), "未知") + ",请刷新页面后重试");
         }
+        if (fileReady) {
+            // 回调早已把已盖章件落好,这一笔直接把状态写成 5,留证键当场清掉
+            clearCallBackEvidence(cwPracticeSignature.getContractId());
+        }
         return "操作成功";
     }
 
@@ -1655,6 +1659,10 @@ public class CwPracticeSignatureService extends ServiceImpl<CwPracticeSignatureM
             // 这一批人的 sign_time 取回调时间,不是真实落章时刻,只用于门禁与展示,不当审计依据。
             markAllSignerSigned(signatureId);
             boolean finished = writeFinishedIfSigning(signatureId);
+            if (finished) {
+                // 状态已落到 5,这条链路的回调留证不再需要,当场清掉(回调重投时会重新攒一份)
+                clearCallBackEvidence(contractId);
+            }
             if (fileList.size() != savedCount) {
                 // 份数对不上时状态推不到 5(列表页 signedFileCount 与 fileCount 会直接显示差异),这里只留日志
                 log.warn("报告执业签章完成回调:已盖章件{}份,与原件清单{}行不一致,signatureId={},contractId={},状态结算结果={}",
@@ -2183,6 +2191,32 @@ public class CwPracticeSignatureService extends ServiceImpl<CwPracticeSignatureM
     }
 
     /**
+     * 单据结算为签章完成(5)后清掉这份合同的回调留证键
+     *
+     * 留证只在"链路还没走完"时有取证价值(推了几次、载荷里是谁);状态一旦落到 5,回调、落库、
+     * 状态结算三件事都已闭环,键继续留着只是占空间 —— 量级上来一天几百份,按 7 天滚动会攒出
+     * 几万个键。清理点选在"状态真到 5"而不是"完成回调处理完":完成回调可能比末位注师点【同意】
+     * 先到(设计文档 6.5),那一刻单据还停在 2/6,留证要留着继续查。
+     *
+     * 这里 catch 只用于"清理失败不影响业务":键本身带 7 天 TTL,最坏就是多留几天,
+     * 不涉及任何落库与状态判定,所以不需要让整笔事务回滚(AGENTS 禁的是吞掉业务异常)。
+     *
+     * @param contractId 契约锁合同id
+     */
+    private void clearCallBackEvidence(String contractId) {
+        if (StringUtils.isBlank(contractId)) {
+            return;
+        }
+        try {
+            for (String stage : Arrays.asList("signProcess", "accomplish")) {
+                stringRedisTemplate.delete(CALL_BACK_EVIDENCE_KEY + contractId + ":" + stage);
+            }
+        } catch (Exception e) {
+            log.warn("报告执业签章回调留证清理失败,contractId=" + contractId + ",键会随 " + CALL_BACK_EVIDENCE_DAYS + " 天 TTL 自然过期", e);
+        }
+    }
+
+    /**
      * 下载已盖章文件
      *
      * 1 个文件:直接下载原文件(保留原始扩展名,浏览器可直接预览/打开);

+ 49 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/controller/CwReportVerificationSealCallBackController.java

@@ -0,0 +1,49 @@
+package com.jeeplus.finance.reportVerificationSeal.controller;
+
+import com.jeeplus.finance.projectReport.domain.PresignCallBack;
+import com.jeeplus.finance.reportVerificationSeal.service.CwReportVerificationSealService;
+import io.swagger.annotations.Api;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * 报告验证章-契约锁签署完成回调controller
+ *
+ * 地址给契约锁侧配置,不给前端用:
+ * 1. **不加 @ApiLog**:载荷含 operatorMobile / contact,写进接口日志等于把手机号落库(AGENTS 第十三章);
+ * 2. **不加 @PreAuthorize、不依赖 token**:契约锁回调没有本系统登录态,回调地址直连 finance:9527,不走 8088 网关;
+ * 3. 本类只做接收,落库都在 service 的 receiveAccomplishCallBack 里:只写 signed_zip_url,
+ *    **不写单据状态、不推进 Flowable**(状态 2→3 由复核人点【同意】触发);
+ * 4. 签署过程(signProcess)回调本版不建:厂商文档未写事件粒度,先由节点 1 的 detail 强查兜底。
+ *
+ * @author: 徐滕
+ * @version: 2026-11-24 14:00
+ */
+@RestController
+@Api("报告验证章回调")
+@RequestMapping(value = "/cw/reportVerificationSeal/signatureCallBack")
+public class CwReportVerificationSealCallBackController {
+
+    @Resource
+    private CwReportVerificationSealService cwReportVerificationSealService;
+
+    private static Logger log = LoggerFactory.getLogger(CwReportVerificationSealCallBackController.class);
+
+    /**
+     * 签署完成回调:下载已盖章整包→解压→打 zip 传 OSS→写 signed_zip_url
+     *
+     * @param presignCallBack 契约锁回调参数
+     * @return 给契约锁回调记录页看的可读结论
+     */
+    @RequestMapping(value = "/accomplish", method = RequestMethod.POST)
+    public String accomplish(PresignCallBack presignCallBack) {
+        log.info("报告验证章完成回调已接收,contractId 已收到");
+        return cwReportVerificationSealService.receiveAccomplishCallBack(presignCallBack);
+    }
+
+}

+ 212 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/controller/CwReportVerificationSealController.java

@@ -0,0 +1,212 @@
+package com.jeeplus.finance.reportVerificationSeal.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.reportVerificationSeal.service.CwReportVerificationSealService;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealCarriedFilesDTO;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealDTO;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealReportCheckDTO;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealReviewerCheckDTO;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealSignStatusDTO;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import io.swagger.annotations.Api;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+/**
+ * 报告验证章controller
+ *
+ * E2 提供列表、详情、执业章文件带出、报告检查、复核角色检查、草稿保存与删除;
+ * E3 补上送审建单、流程状态回调、盖章页/查看页、强制结束与已盖章件直链。
+ *
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@RestController
+@Api("报告验证章")
+@RequestMapping(value = "/cw/reportVerificationSeal")
+public class CwReportVerificationSealController {
+
+    @Resource
+    private CwReportVerificationSealService cwReportVerificationSealService;
+
+    private static Logger log = LoggerFactory.getLogger(CwReportVerificationSealController.class);
+
+    /**
+     * 查询报告验证章申请列表
+     * @param cwReportVerificationSealDTO 查询条件
+     * @param page 分页
+     * @return 申请列表
+     */
+    @ApiLog("查询报告验证章申请列表")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:list')")
+    @GetMapping("list")
+    public ResponseEntity<IPage<CwReportVerificationSealDTO>> list(CwReportVerificationSealDTO cwReportVerificationSealDTO,
+                                                                  Page<CwReportVerificationSealDTO> page) throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.findList(page, cwReportVerificationSealDTO));
+    }
+
+    /**
+     * 查询报告验证章申请详情
+     * @param id 申请id
+     * @return 申请详情
+     */
+    @ApiLog("查询报告验证章申请详情")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:list')")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam("id") String id) throws Exception {
+        CwReportVerificationSealDTO result = cwReportVerificationSealService.queryById(id);
+        if (result == null) {
+            return ResponseUtil.newInstance().error("这条申请不存在或已被删除,请刷新列表");
+        }
+        return ResponseEntity.ok(result);
+    }
+
+    /**
+     * 按报告号带出最近一次已完成执业章的已盖章件
+     * @param reportNo 报告号
+     * @return 带出文件及多次盖章标记
+     */
+    @ApiLog("查询执业章已盖章件带出数据")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:list')")
+    @GetMapping("carriedStampedFiles")
+    public ResponseEntity<CwReportVerificationSealCarriedFilesDTO> carriedStampedFiles(@RequestParam("reportNo") String reportNo) throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.carriedStampedFiles(reportNo));
+    }
+
+    /**
+     * 只读检查报告当前是否满足签章前置条件
+     * @param reportId 报告id
+     * @return 检查结果
+     */
+    @ApiLog("复核报告验证章前置条件")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:list')")
+    @GetMapping("reportCheck")
+    public ResponseEntity<CwReportVerificationSealReportCheckDTO> reportCheck(@RequestParam("reportId") String reportId) throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.reportCheck(reportId));
+    }
+
+    /**
+     * 检查复核角色是否存在且成员非空
+     * @return 角色可用性
+     */
+    @ApiLog("检查报告验证章复核角色")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:submit')")
+    @GetMapping("checkReviewer")
+    public ResponseEntity<CwReportVerificationSealReviewerCheckDTO> checkReviewer() throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.checkReviewer());
+    }
+
+    /**
+     * 保存报告验证章申请:status=0 存草稿,status=1 送审并创建契约锁合同
+     * @param cwReportVerificationSealDTO 申请内容
+     * @return 保存结果
+     */
+    @ApiLog(value = "保存报告验证章申请", type = LogTypeEnum.SAVE)
+    // @PreAuthorize("hasAnyAuthority('cw:reportVerificationSeal:add','cw:reportVerificationSeal:edit')")
+    @PostMapping("save")
+    public ResponseEntity save(@Valid @RequestBody CwReportVerificationSealDTO cwReportVerificationSealDTO) throws Exception {
+        String id = cwReportVerificationSealService.save(cwReportVerificationSealDTO);
+        return ResponseUtil.newInstance().add("businessTable", "cw_report_verification_seal").add("businessId", id).ok("操作成功");
+    }
+
+    /**
+     * 流程外置表单回调写状态,只接受白名单迁移
+     * @param cwReportVerificationSealDTO 含 id 与目标 status
+     * @return 写入结果
+     */
+    @ApiLog(value = "更新报告验证章申请状态", type = LogTypeEnum.SAVE)
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:submit')")
+    @PostMapping("updateStatusById")
+    public ResponseEntity<String> updateStatusById(@RequestBody CwReportVerificationSealDTO cwReportVerificationSealDTO) throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.updateStatusById(cwReportVerificationSealDTO));
+    }
+
+    /**
+     * 取契约锁盖章页地址,仅状态1的发起人本人可调
+     * @param id 申请id
+     * @return 盖章页地址
+     */
+    @ApiLog("获取报告验证章盖章页")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:seal')")
+    @GetMapping("signUrl")
+    public ResponseEntity<String> signUrl(@RequestParam("id") String id) throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.getSignUrl(id));
+    }
+
+    /**
+     * 查询报告验证章盖章进度,节点1【同意】前强查
+     * @param id 申请id
+     * @return 进度结论
+     */
+    @ApiLog("查询报告验证章盖章进度")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:seal')")
+    @GetMapping("sealProgress")
+    public ResponseEntity<CwReportVerificationSealSignStatusDTO> sealProgress(@RequestParam("id") String id) throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.sealProgress(id));
+    }
+
+    /**
+     * 取契约锁只读查看页地址,仅状态2的复核角色成员可调
+     * @param id 申请id
+     * @return 查看页地址
+     */
+    @ApiLog("获取报告验证章查看页")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:review')")
+    @GetMapping("reviewViewUrl")
+    public ResponseEntity<String> reviewViewUrl(@RequestParam("id") String id) throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.getViewUrl(id));
+    }
+
+    /**
+     * 强制结束契约锁合同,手动兜底入口
+     * 自 v3.3 起不再是节点2【同意】的前置步骤:138 实测该接口以复核人身份回「没有权限」,
+     * 同意改由「复核人在签章系统签掉门挡⇒合同自然完成」这条路径校验,接口保留待平台开通权限后使用
+     * @param id 申请id
+     * @return 操作结果
+     */
+    @ApiLog(value = "结束报告验证章盖章流程", type = LogTypeEnum.SAVE)
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:review')")
+    @PostMapping("forceFinish")
+    public ResponseEntity<String> forceFinish(@RequestParam("id") String id) throws Exception {
+        return ResponseEntity.ok(cwReportVerificationSealService.forceFinish(id));
+    }
+
+    /**
+     * 取已盖章压缩包直链,终态且回调已落库才返回
+     * @param id 申请id
+     * @return 已盖章件地址
+     */
+    @ApiLog("获取报告验证章已盖章件")
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:list')")
+    @GetMapping("downloadSignedFile")
+    public ResponseEntity downloadSignedFile(@RequestParam("id") String id) throws Exception {
+        return cwReportVerificationSealService.downloadSignedFile(id);
+    }
+
+    /**
+     * 逻辑删除本人草稿,文件同步逻辑删除
+     * @param ids 逗号分隔的申请id
+     * @return 删除结果
+     */
+    @ApiLog(value = "删除报告验证章申请", type = LogTypeEnum.SAVE)
+    // @PreAuthorize("hasAuthority('cw:reportVerificationSeal:delete')")
+    @DeleteMapping("delete")
+    public ResponseEntity delete(String ids) throws Exception {
+        return cwReportVerificationSealService.deleteByIds(ids);
+    }
+
+}

+ 57 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/domain/CwReportVerificationSeal.java

@@ -0,0 +1,57 @@
+package com.jeeplus.finance.reportVerificationSeal.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.core.query.QueryType;
+import lombok.Data;
+
+/**
+ * 报告验证章申请单
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Data
+@TableName("cw_report_verification_seal")
+public class CwReportVerificationSeal extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 项目名称快照 */
+    @Query(tableColumn = "a.project_name", type = QueryType.LIKE)
+    private String projectName;
+
+    /** 报告台账id快照,送审必填,草稿可空 */
+    private String reportId;
+
+    /** 报告号快照,权威来源为 cw_project_report_new_line.report_no */
+    @Query(tableColumn = "a.report_no", type = QueryType.LIKE)
+    private String reportNo;
+
+    /** 当前有效契约锁合同id */
+    private String contractId;
+
+    /** 建单时企业主体名快照 */
+    private String contractTenantName;
+
+    /** 状态(0:草稿,1:待盖章,2:待复核,3:复核通过,4:已驳回,5:已撤回,6:已终止) */
+    @Query(tableColumn = "a.status", type = QueryType.EQ)
+    private String status;
+
+    /** 流程实例id */
+    private String procInsId;
+
+    /** 流程定义id */
+    private String processDefinitionId;
+
+    /** 发起人id,节点1办理人为本人 */
+    @Query(tableColumn = "a.apply_user_id", type = QueryType.EQ)
+    private String applyUserId;
+
+    /** 已盖章压缩包OSS路径,回调写入 */
+    private String signedZipUrl;
+
+    /** 备注及合同变更记录 */
+    private String remarks;
+
+}

+ 42 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/domain/CwReportVerificationSealFile.java

@@ -0,0 +1,42 @@
+package com.jeeplus.finance.reportVerificationSeal.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 报告验证章申请文件,执业章带出件与手工上传件混合共存
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Data
+@TableName("cw_report_verification_seal_file")
+public class CwReportVerificationSealFile extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 申请单id,cw_report_verification_seal.id */
+    private String verificationSealId;
+
+    /** 来源(1:执业章已盖章件,2:手工上传) */
+    private String source;
+
+    /** source=1 时回指 cw_practice_signature_file.id */
+    private String refPracticeFileId;
+
+    /** 文件名 */
+    private String fileName;
+
+    /** 待盖章原件附件id,work_attachment.id */
+    private String attachmentId;
+
+    /** 契约锁documentId,建单后回填 */
+    private String documentId;
+
+    /** 文件排序 */
+    private Integer sort;
+
+    /** 备注 */
+    private String remarks;
+
+}

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/mapper/CwReportVerificationSealFileMapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.finance.reportVerificationSeal.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.reportVerificationSeal.domain.CwReportVerificationSealFile;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 报告验证章文件mapper
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Mapper
+public interface CwReportVerificationSealFileMapper extends BaseMapper<CwReportVerificationSealFile> {
+
+}

+ 54 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/mapper/CwReportVerificationSealMapper.java

@@ -0,0 +1,54 @@
+package com.jeeplus.finance.reportVerificationSeal.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.finance.reportVerificationSeal.domain.CwReportVerificationSeal;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealDTO;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealFileDTO;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealReportCheckDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 报告验证章mapper
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Mapper
+public interface CwReportVerificationSealMapper extends BaseMapper<CwReportVerificationSeal> {
+
+    /** 查询申请列表 */
+    IPage<CwReportVerificationSealDTO> findList(Page<CwReportVerificationSealDTO> page,
+                                                @Param(Constants.WRAPPER) QueryWrapper<CwReportVerificationSeal> queryWrapper);
+
+    /** 查询申请详情及报告展示字段 */
+    CwReportVerificationSealDTO queryById(@Param("id") String id);
+
+    /** 查询申请的有效文件 */
+    List<CwReportVerificationSealFileDTO> selectFiles(@Param("verificationSealId") String verificationSealId);
+
+    /** 只读检查报告签章前置条件 */
+    CwReportVerificationSealReportCheckDTO checkReportByReportId(@Param("reportId") String reportId);
+
+    /** 查询申请的有效文件(含原件附件路径,仅供建单取文件使用) */
+    List<CwReportVerificationSealFileDTO> selectFilesWithAttachment(@Param("verificationSealId") String verificationSealId);
+
+    /** 查询本单据已落附件表的手工上传原件(保存文件行时用附件表为准,杜绝静默丢文件) */
+    List<CwReportVerificationSealFileDTO> selectUploadedAttachments(@Param("verificationSealId") String verificationSealId,
+                                                                  @Param("attachmentFlag") String attachmentFlag);
+
+    /** 定位最近一次已完成的执业章申请 */
+    String findLatestCompletedSignature(@Param("reportNo") String reportNo);
+
+    /** 统计同一报告号已完成的执业章申请数 */
+    Integer countCompletedSignatures(@Param("reportNo") String reportNo);
+
+    /** 查询最近一次完成单的全部已盖章件 */
+    List<CwReportVerificationSealFileDTO> findCarriedStampedFiles(@Param("latestSignatureId") String latestSignatureId);
+
+}

+ 229 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/mapper/xml/CwReportVerificationSealMapper.xml

@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.reportVerificationSeal.mapper.CwReportVerificationSealMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealDTO">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+        <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+        <result property="projectName" column="project_name" jdbcType="VARCHAR"/>
+        <result property="reportId" column="report_id" jdbcType="VARCHAR"/>
+        <result property="reportNo" column="report_no" jdbcType="VARCHAR"/>
+        <result property="contractId" column="contract_id" jdbcType="VARCHAR"/>
+        <result property="contractTenantName" column="contract_tenant_name" jdbcType="VARCHAR"/>
+        <result property="status" column="status" jdbcType="VARCHAR"/>
+        <result property="procInsId" column="proc_ins_id" jdbcType="VARCHAR"/>
+        <result property="processDefinitionId" column="process_definition_id" jdbcType="VARCHAR"/>
+        <result property="applyUserId" column="apply_user_id" jdbcType="VARCHAR"/>
+        <result property="signedZipUrl" column="signed_zip_url" jdbcType="VARCHAR"/>
+        <result property="createByName" column="createByName" jdbcType="VARCHAR"/>
+        <result property="fileCount" column="fileCount" jdbcType="VARCHAR"/>
+        <result property="reportStatus" column="reportStatus" jdbcType="VARCHAR"/>
+        <result property="projectNumber" column="project_number" jdbcType="VARCHAR"/>
+        <result property="reportName" column="report_name" jdbcType="VARCHAR"/>
+        <result property="servedUnitName" column="served_unit_name" jdbcType="VARCHAR"/>
+        <result property="reportType" column="report_type" jdbcType="VARCHAR"/>
+        <result property="bankLettersCount" column="bank_letters_count" jdbcType="VARCHAR"/>
+        <result property="digitalLetterCount" column="digital_letter_count" jdbcType="VARCHAR"/>
+        <result property="approvedNoIncludingTax" column="approved_no_including_tax" jdbcType="VARCHAR"/>
+        <result property="approvedIncludingTax" column="approved_including_tax" jdbcType="VARCHAR"/>
+        <result property="industry" column="industry" jdbcType="VARCHAR"/>
+        <result property="businessObjects" column="business_objects" jdbcType="VARCHAR"/>
+        <result property="businessType" column="business_type" jdbcType="VARCHAR"/>
+        <result property="auditBusinessType" column="audit_business_type" jdbcType="VARCHAR"/>
+        <result property="reportNumber" column="report_number" jdbcType="VARCHAR"/>
+        <result property="reportDate" column="report_date" jdbcType="TIMESTAMP"/>
+        <result property="projectMasterName" column="project_master_name" jdbcType="VARCHAR"/>
+        <result property="realHeaderName" column="real_header_name" jdbcType="VARCHAR"/>
+        <result property="reviewStatus" column="review_status" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <resultMap id="FileResultMap" type="com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealFileDTO">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+        <result property="verificationSealId" column="verification_seal_id" jdbcType="VARCHAR"/>
+        <result property="source" column="source" jdbcType="VARCHAR"/>
+        <result property="refPracticeFileId" column="ref_practice_file_id" jdbcType="VARCHAR"/>
+        <result property="fileName" column="file_name" jdbcType="VARCHAR"/>
+        <result property="attachmentId" column="attachment_id" jdbcType="VARCHAR"/>
+        <result property="documentId" column="document_id" jdbcType="VARCHAR"/>
+        <result property="attachmentUrl" column="attachment_url" jdbcType="VARCHAR"/>
+        <result property="sort" column="sort" jdbcType="INTEGER"/>
+        <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        a.id, a.create_by_id, a.create_time, a.update_by_id, a.update_time, a.del_flag,
+        a.remarks, a.project_name, a.report_id, a.report_no, a.contract_id, a.contract_tenant_name,
+        a.status, a.proc_ins_id, a.process_definition_id, a.apply_user_id, a.signed_zip_url
+    </sql>
+
+    <sql id="Detail_Column_List">
+        a.id, a.create_by_id, a.create_time, a.update_by_id, a.update_time, a.del_flag,
+        a.remarks, a.report_id, a.contract_id, a.contract_tenant_name,
+        a.status, a.proc_ins_id, a.process_definition_id, a.apply_user_id, a.signed_zip_url
+    </sql>
+
+    <!-- 列表:报告状态实时反查,文件数只统计当前租户的有效文件 -->
+    <select id="findList" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>,
+        su.name AS createByName,
+        (SELECT COUNT(1) FROM cw_report_verification_seal_file cw_f
+          WHERE cw_f.verification_seal_id = a.id AND cw_f.del_flag = '0') AS fileCount,
+        (SELECT cw_r.status FROM cw_project_report cw_r
+          WHERE cw_r.id = a.report_id AND cw_r.del_flag = '0') AS reportStatus
+        FROM cw_report_verification_seal a
+        LEFT JOIN sys_user su ON su.id = a.create_by_id AND su.del_flag = '0'
+        ${ew.customSqlSegment}
+        ORDER BY a.create_time DESC
+    </select>
+
+    <!-- 详情:报告号只取 new_line,关联不到时回落主表快照 -->
+    <select id="queryById" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Detail_Column_List"/>,
+        su.name AS createByName,
+        COALESCE(cw_pbt.project_name, a.project_name) AS project_name,
+        COALESCE(new_line.report_no, a.report_no) AS report_no,
+        cw_pbt.project_number AS project_number,
+        cw_r.report_name AS report_name,
+        cwcb.name AS served_unit_name,
+        new_line.report_type AS report_type,
+        new_line.bank_letters_count AS bank_letters_count,
+        new_line.digital_letter_count AS digital_letter_count,
+        new_line.approved_no_including_tax AS approved_no_including_tax,
+        new_line.approved_including_tax AS approved_including_tax,
+        cw_r.industry AS industry,
+        cw_r.business_objects AS business_objects,
+        cw_r.business_type AS business_type,
+        cw_r.audit_business_type AS audit_business_type,
+        new_line.report_number AS report_number,
+        new_line.report_date AS report_date,
+        su_pm.name AS project_master_name,
+        su_rh.name AS real_header_name,
+        COALESCE(cw_rev.review_status, '0') AS review_status,
+        cw_r.status AS report_status
+        FROM cw_report_verification_seal a
+        LEFT JOIN sys_user su ON su.id = a.create_by_id AND su.del_flag = '0'
+        LEFT JOIN cw_project_report cw_r ON cw_r.id = a.report_id AND cw_r.del_flag = '0'
+        LEFT JOIN cw_project_report_new_line new_line ON new_line.id = (
+            SELECT nl.id FROM cw_project_report_new_line nl
+             WHERE nl.report_id = cw_r.id AND nl.del_flag = '0'
+             ORDER BY nl.update_time DESC, nl.id DESC LIMIT 1)
+        LEFT JOIN (SELECT cw_rev_inner.report_id, MAX(cw_rev_inner.review_status) AS review_status
+                     FROM cw_project_report_review cw_rev_inner
+                    WHERE cw_rev_inner.del_flag = '0'
+                    GROUP BY cw_rev_inner.report_id) cw_rev ON cw_rev.report_id = cw_r.id
+        LEFT JOIN cw_project_records cw_pbt ON cw_pbt.id = cw_r.project_id AND cw_pbt.del_flag = '0'
+        LEFT JOIN cw_work_client_base cwcb ON cwcb.id = new_line.served_unit_id AND cwcb.del_flag = '0'
+        LEFT JOIN sys_user su_pm ON su_pm.id = cw_pbt.project_master_id AND su_pm.del_flag = '0'
+        LEFT JOIN sys_user su_rh ON su_rh.id = cw_pbt.real_header AND su_rh.del_flag = '0'
+        WHERE a.id = #{id} AND a.del_flag = '0'
+    </select>
+
+    <select id="selectFiles" resultMap="FileResultMap">
+        SELECT id, create_by_id, create_time, update_by_id, update_time, del_flag,
+               verification_seal_id, source, ref_practice_file_id, file_name,
+               attachment_id, document_id, sort, remarks
+        FROM cw_report_verification_seal_file
+        WHERE verification_seal_id = #{verificationSealId} AND del_flag = '0'
+        ORDER BY sort ASC, id ASC
+    </select>
+
+    <!-- 手工上传原件以附件表为准:work_attachment.attachment_id 存的是本单据id -->
+    <select id="selectUploadedAttachments" resultMap="FileResultMap">
+        SELECT wa.id AS id, wa.create_by_id, wa.create_time, wa.update_by_id, wa.update_time, wa.del_flag,
+               #{verificationSealId} AS verification_seal_id,
+               '2' AS source,
+               NULL AS ref_practice_file_id,
+               COALESCE(NULLIF(wa.attachment_name, ''), CONCAT('attachment_', wa.id)) AS file_name,
+               wa.id AS attachment_id,
+               wa.url AS attachment_url,
+               NULL AS document_id, NULL AS sort, NULL AS remarks
+        FROM work_attachment wa
+        WHERE wa.del_flag = '0'
+          AND wa.attachment_id = #{verificationSealId} AND wa.attachment_flag = #{attachmentFlag}
+        ORDER BY wa.create_time ASC, wa.id ASC
+    </select>
+
+    <!-- 建单取原件:文件名与附件路径按当前文件行取,附件表已删除或路径为空时由 service 报错,不静默跳过 -->
+    <select id="selectFilesWithAttachment" resultMap="FileResultMap">
+        SELECT f.id, f.create_by_id, f.create_time, f.update_by_id, f.update_time, f.del_flag,
+               f.verification_seal_id, f.source, f.ref_practice_file_id, f.file_name,
+               f.attachment_id, f.document_id, f.sort, f.remarks,
+               wa.url AS attachment_url
+        FROM cw_report_verification_seal_file f
+        LEFT JOIN work_attachment wa ON wa.id = f.attachment_id AND wa.del_flag = '0'
+        WHERE f.verification_seal_id = #{verificationSealId} AND f.del_flag = '0'
+        ORDER BY f.sort ASC, f.id ASC
+    </select>
+
+    <!-- 前置条件:报告、项目、复核状态、报告号逐项只读检查 -->
+    <select id="checkReportByReportId" resultType="com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealReportCheckDTO">
+        SELECT
+            cw_r.id AS reportId,
+            new_line.report_no AS reportNo,
+            cw_pbt.project_number AS projectNumber,
+            cw_pbt.project_name AS projectName,
+            CASE WHEN cw_pbt.id IS NULL THEN 0 ELSE 1 END AS projectValid,
+            cw_r.status AS reportStatus,
+            COALESCE(cw_rev.review_status, '0') AS reviewStatus
+        FROM cw_project_report cw_r
+        LEFT JOIN cw_project_records cw_pbt ON cw_r.project_id = cw_pbt.id AND cw_pbt.del_flag = '0'
+        LEFT JOIN (SELECT cw_rev_inner.report_id, MAX(cw_rev_inner.review_status) AS review_status
+                     FROM cw_project_report_review cw_rev_inner
+                    WHERE cw_rev_inner.del_flag = '0'
+                    GROUP BY cw_rev_inner.report_id) cw_rev ON cw_rev.report_id = cw_r.id
+        LEFT JOIN (SELECT nl.report_id, MAX(nl.report_no) AS report_no
+                     FROM cw_project_report_new_line nl
+                    WHERE nl.del_flag = '0'
+                    GROUP BY nl.report_id) new_line ON new_line.report_id = cw_r.id
+        WHERE cw_r.id = #{reportId} AND cw_r.del_flag = '0'
+    </select>
+
+    <!-- 先定位最近一次完成单,禁止按文件行 LIMIT -->
+    <select id="findLatestCompletedSignature" resultType="java.lang.String">
+        SELECT s.id
+        FROM cw_practice_signature s
+        WHERE s.del_flag = '0' AND s.status = '5' AND s.report_no = #{reportNo}
+        ORDER BY s.update_time DESC, s.id DESC
+        LIMIT 1
+    </select>
+
+    <select id="countCompletedSignatures" resultType="java.lang.Integer">
+        SELECT COUNT(*) FROM cw_practice_signature s
+        WHERE s.del_flag = '0' AND s.status = '5' AND s.report_no = #{reportNo}
+    </select>
+
+    <!-- 真实执业章文件表使用 serial_no 排序,不存在 sort 列 -->
+    <select id="findCarriedStampedFiles" resultMap="FileResultMap">
+        SELECT
+            f.id,
+            f.create_by_id, f.create_time, f.update_by_id, f.update_time, f.del_flag,
+            '1' AS source,
+            f.id AS ref_practice_file_id,
+            COALESCE(NULLIF(f.signed_file_name, ''), wa.attachment_name, f.file_name) AS file_name,
+            f.signed_attachment_id AS attachment_id,
+            wa.url AS attachment_url,
+            NULL AS document_id,
+            NULL AS sort,
+            NULL AS remarks
+        FROM cw_practice_signature_file f
+        LEFT JOIN work_attachment wa ON wa.id = f.signed_attachment_id AND wa.del_flag = '0'
+        WHERE f.del_flag = '0' AND f.signature_id = #{latestSignatureId}
+          AND f.signed_attachment_id IS NOT NULL AND f.signed_attachment_id != ''
+        ORDER BY CAST(f.serial_no AS UNSIGNED) ASC, f.id ASC
+    </select>
+
+</mapper>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1578 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/CwReportVerificationSealService.java


+ 540 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/QiyuesuoVerificationPayloadBuilder.java

@@ -0,0 +1,540 @@
+package com.jeeplus.finance.reportVerificationSeal.service;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jeeplus.finance.invoice.util.SignaturePostUtil;
+import com.jeeplus.finance.projectReport.domain.Action;
+import com.jeeplus.finance.projectReport.domain.ActionOperatorInfo;
+import com.jeeplus.finance.projectReport.domain.SignatorieInfo;
+import com.jeeplus.finance.projectReport.domain.SignatureContract;
+import com.jeeplus.finance.utils.Global;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 报告验证章契约锁请求封装(所有固定路径与请求形状都收敛在本类)
+ *
+ * 业务 Service 只调本类的方法,不出现散落的 `/contract/...` 字符串;
+ * E4 在 138 实测出来的参数校正(T7a/T7b/T7b2/T7c/T8)**只改本类对应常量或分支**,不改 Service 业务流程。
+ *
+ * 主体名与应用凭据复用个人执业章的三个配置键(用户已确认同一签章系统、同一主体),
+ * 本功能只新增 `verification_signature_category_id` 与回调地址两键。
+ *
+ * @author: 徐滕
+ * @version: 2026-11-24 14:00
+ */
+public class QiyuesuoVerificationPayloadBuilder {
+
+    /** 契约锁服务地址(与个人执业章同一实例) */
+    private static final String SIGN_HTTP_TOP = GlobalConfigHolder.get("signature_http_top");
+
+    /** 报告验证章业务分类id(落章位置在控制台该分类上配置,代码不传 sealIds/locations) */
+    private static final String VERIFICATION_CATEGORY_ID = GlobalConfigHolder.get("verification_signature_category_id");
+
+    /** 建单主体名,须与契约锁实例登记名逐字一致 */
+    private static final String TENANT_NAME = GlobalConfigHolder.get("practice_signature_tenant_name");
+
+    /** 事务所应用凭据 apptoken */
+    private static final String APPTOKEN = GlobalConfigHolder.get("practice_signature_apptoken");
+
+    /** 事务所应用 signature,口径 md5(apptoken + appsecret + timestamp),timestamp 头固定 "0" */
+    private static final String SIGNATURE = GlobalConfigHolder.get("practice_signature_signature");
+
+    /** 签署动作类型:企业章(验证章是事务所企业章,不是个人执业章) */
+    public static final String ACTION_TYPE_CORPORATE = "CORPORATE";
+
+    /** action1 顺序号:验证章拖章动作,门禁只认这条 */
+    public static final String ACTION1_SERIAL_NO = "1";
+
+    /** action2 顺序号:门挡占位,保证 action1 签完后合同仍停在"签署中",由 force 推进终态 */
+    public static final String ACTION2_SERIAL_NO = "2";
+
+    /**
+     * 隔离点 #1(T7a/T8)实测结论(2026-11-24 两条新单对照):
+     * action2 不挂操作人 ≠ 没人能签,契约锁会回落成"该主体全员可签",发起人自己就能把门挡签掉、
+     * 合同提前完成并在签章系统里下载完成件;传了操作人就只限这些人可签(动作1 只列发起人即证据)。
+     * 所以门挡操作人改由 Service 建单时取复核角色成员手机号传入,本类不再保留 empty/initiator 开关。
+     */
+
+    /** 已认定"合同已终结"的合同状态,认不出的一律按未签处理 */
+    private static final List<String> SIGNED_CONTRACT_STATUS =
+            Arrays.asList("SIGN_COMPLETE", "FINISHED", "COMPLETE", "SUCCESS");
+
+    /** 已认定"单个动作已落章"的动作状态 */
+    private static final List<String> SIGNED_ACTION_STATUS =
+            Arrays.asList("SIGNED", "SIGN_COMPLETE", "COMPLETE", "SUCCESS");
+
+    private QiyuesuoVerificationPayloadBuilder() {
+    }
+
+    /**
+     * 配置是否齐备;缺失时返回可直接定位配置项的提示(不携带密钥内容)
+     *
+     * @return 空串表示可用
+     */
+    public static String configMissingMessage() {
+        if (StringUtils.isBlank(VERIFICATION_CATEGORY_ID)) {
+            return "未配置报告验证章业务分类(verification_signature_category_id),无法发起签章";
+        }
+        if (StringUtils.isBlank(APPTOKEN) || StringUtils.isBlank(SIGNATURE)) {
+            return "未配置契约锁应用凭据(practice_signature_apptoken / practice_signature_signature),无法发起签章";
+        }
+        return "";
+    }
+
+    /**
+     * 建单主体名,供主表 `contract_tenant_name` 快照
+     *
+     * @return 主体名
+     */
+    public static String tenantName() {
+        return TENANT_NAME;
+    }
+
+    /**
+     * 隔离点 #4:动作是否已落章;状态值认不出一律按未签
+     *
+     * @param actionStatus 契约锁详情里的动作状态
+     * @return 是否已落章
+     */
+    public static boolean isActionCompleted(String actionStatus) {
+        return SIGNED_ACTION_STATUS.contains(StringUtils.upperCase(StringUtils.defaultString(actionStatus)));
+    }
+
+    /**
+     * 隔离点 #4:合同是否整体已完成
+     *
+     * @param contractStatus 契约锁详情里的合同状态
+     * @return 是否已完成
+     */
+    public static boolean isContractCompleted(String contractStatus) {
+        return SIGNED_CONTRACT_STATUS.contains(StringUtils.upperCase(StringUtils.defaultString(contractStatus)));
+    }
+
+    /**
+     * 待盖章原件上传契约锁换 documentId
+     *
+     * @param srcFile 本地文件
+     * @return 契约锁原始响应
+     */
+    public static HashMap createDocument(File srcFile) {
+        return SignaturePostUtil.getDocument(srcFile, APPTOKEN, SIGNATURE);
+    }
+
+    /**
+     * 建合同载荷并发起:一个 COMPANY 签署方挂 action1(验证章拖章)+ action2(门挡)
+     *
+     * @param documentIds 已建好的契约锁文档id
+     * @param subject 合同标题
+     * @param initiatorMobile action1 操作人手机号(发起人本人)
+     * @param gateMobiles action2 门挡操作人手机号(复核角色成员,任意一人签署即完成合同)
+     * @return 契约锁原始响应
+     */
+    public static JSONObject createContract(List<String> documentIds, String subject, String initiatorMobile,
+                                            List<String> gateMobiles) {
+        Action action1 = new Action();
+        action1.setType(ACTION_TYPE_CORPORATE);
+        action1.setName("报告验证章");
+        action1.setSerialNo(ACTION1_SERIAL_NO);
+        action1.setSealIds("[]");
+        action1.setLocations(Collections.emptyList());
+        action1.setActionOperators(operatorList(initiatorMobile));
+
+        Action action2 = new Action();
+        action2.setType(ACTION_TYPE_CORPORATE);
+        action2.setName("报告验证章复核门挡");
+        action2.setSerialNo(ACTION2_SERIAL_NO);
+        action2.setSealIds("[]");
+        action2.setLocations(Collections.emptyList());
+        // 门挡只允许复核角色成员签,发起人不在名单里 ⇒ 发起人签不动它,合同只能停在"签署中"等复核
+        action2.setActionOperators(operatorList(gateMobiles));
+
+        List<Action> actions = new ArrayList<>();
+        actions.add(action1);
+        actions.add(action2);
+
+        SignatorieInfo signatorie = new SignatorieInfo();
+        signatorie.setSerialNo("1");
+        signatorie.setTenantType("COMPANY");
+        signatorie.setTenantName(TENANT_NAME);
+        signatorie.setActions(actions);
+
+        List<SignatorieInfo> signatories = new ArrayList<>();
+        signatories.add(signatorie);
+
+        SignatureContract contract = new SignatureContract();
+        contract.setDocuments(documentIds);
+        contract.setCategoryId(VERIFICATION_CATEGORY_ID);
+        contract.setSend(true);
+        contract.setSignatories(signatories);
+        contract.setSn("");
+        contract.setSubject(subject);
+
+        String response = SignaturePostUtil.sendPostApplicationJson(SIGN_HTTP_TOP + "/contract/createbycategory",
+                net.sf.json.JSONObject.fromObject(contract).toString(), APPTOKEN, SIGNATURE);
+        return parse(response);
+    }
+
+    /**
+     * 取签署页地址(拖章页)
+     *
+     * @param contractId 合同id
+     * @param contact 操作人手机号
+     * @return 契约锁原始响应
+     */
+    public static JSONObject getSignUrl(String contractId, String contact) {
+        Map<String, String> body = new HashMap<>();
+        body.put("contractId", contractId);
+        body.put("tenantType", "COMPANY");
+        body.put("tenantName", TENANT_NAME);
+        body.put("contact", contact);
+        return parse(SignaturePostUtil.sendPostApplicationJson(SIGN_HTTP_TOP + "/contract/signurl",
+                JSON.toJSONString(body), APPTOKEN, SIGNATURE));
+    }
+
+    /**
+     * 隔离点 #3:取只读查看页地址,未完成合同也要能看见 action1 已盖的章面
+     *
+     * @param contractId 合同id
+     * @return 契约锁原始响应
+     */
+    public static JSONObject getViewUrl(String contractId) {
+        Map<String, String> params = new HashMap<>();
+        params.put("contractId", encode(contractId));
+        params.put("allowDownload", "false");
+        params.put("pageType", "CONTENT");
+        return parse(SignaturePostUtil.sendGet(SIGN_HTTP_TOP + "/contract/viewurl?" + queryString(params),
+                authHeader(), "UTF-8"));
+    }
+
+    /**
+     * 合同详情,用于判断 action1 是否已落章
+     *
+     * @param contractId 合同id
+     * @return 契约锁原始响应
+     */
+    public static JSONObject getContractDetail(String contractId) {
+        return parse(SignaturePostUtil.sendGet(SIGN_HTTP_TOP + "/contract/detail?contractId=" + encode(contractId),
+                authHeader(), "UTF-8"));
+    }
+
+    /**
+     * 隔离点 #2:强制结束合同,让合同进终态触发 CONTRACT_COMPLETE 回调
+     *
+     * companyId/registerNo 是否必填由 T7b2 实测决定,未确认前不新增配置键、不猜值。
+     *
+     * @param contractId 合同id
+     * @param mobile 点同意的复核人手机号
+     * @return 契约锁原始响应
+     */
+    public static JSONObject forceFinish(String contractId, String mobile) {
+        Map<String, String> body = new HashMap<>();
+        body.put("contractId", contractId);
+        body.put("companyName", TENANT_NAME);
+        body.put("mobile", mobile);
+        return parse(SignaturePostUtil.sendPostApplicationJson(SIGN_HTTP_TOP + "/contract/finish/force",
+                JSON.toJSONString(body), APPTOKEN, SIGNATURE));
+    }
+
+    /**
+     * 隔离点 #6:服务端静默签(把门挡动作签掉,不打开签署页、不发短信),目标是**落无外观章面(透明)**
+     *
+     * 2026-11-24 真单实测两轮才把形状逼出来,两条都不是文档写全的:
+     * ① `stampers` 在参数表标"否",但真合同上回「没有设置参数:stampers」——不传这个键不行;
+     * ② 传**空数组也不行**,回同一句话(当时 finance 进程 17:46:40 起、class 17:46:39 编译,确认跑的是新代码)
+     * ⇒ 这台实例要的是**非空 stampers**。而"只传 contractId 就走到合同层"那次是假 id 探的,
+     * 参数校验排在合同查询之后,探不到必填项,那句推论已作废。
+     *
+     * **为什么给了位置也不会多一枚看得见的章**:Stamper 里刻意不填 sealId/sealName/sealCategoryName
+     * (=查找不到具体印章),配合 `signWithoutAppearance=true`(文档原话:没有查找到具体印章时
+     * true=加盖无外观章面即透明图片,false/不传=报错),以及 `useDefaultSeal=false`
+     * (文档默认 true,"仅在已设置签署位置未设置印章的情况下生效"——保持默认就会拿事务所**默认公章**盖出来,
+     * 那是绝对不能接受的结果)。三个条件凑齐=动作完成、报告上只有透明章面。
+     *
+     * 位置取 page=-1(最后一页)+ 居中比例:章面透明,落在哪都不影响阅读,但坐标定位要求
+     * page/x/y 齐且合法(平台有"签署位置错误,X,Y坐标大于1或者页码小于1"这类错误码),所以给一组必然合法的值。
+     * documentId 由调用方从 `/contract/detail` 的 documents 里取,本类不猜。
+     *
+     * 本接口没有操作人字段(带 contact/mobile 那族的是 1.2.1.5 signbypractice 执业章)
+     * ⇒ 契约锁侧签署主体是**事务所**、不是点同意的复核人;"谁复核的"由业务表 update_by 与调用日志留痕。
+     *
+     * @param contractId 合同id
+     * @param documentIds 合同文档id列表(每个文档一条 Stamper,少一个就会"某份文件没签")
+     * @return 契约锁原始响应
+     */
+    public static JSONObject signByCompany(String contractId, List<String> documentIds) {
+        JSONArray stampers = new JSONArray();
+        for (String documentId : documentIds) {
+            if (StringUtils.isBlank(documentId)) {
+                continue;
+            }
+            JSONObject stamper = new JSONObject();
+            stamper.put("documentId", documentId);
+            stamper.put("type", "SEAL_CORPORATE");
+            // 不填 sealId/sealName/sealCategoryName:查不到章 + signWithoutAppearance=true ⇒ 透明章面
+            stamper.put("page", -1);
+            stamper.put("x", 0.5D);
+            stamper.put("y", 0.5D);
+            stampers.add(stamper);
+        }
+        JSONObject body = new JSONObject();
+        body.put("contractId", contractId);
+        body.put("tenantName", TENANT_NAME);
+        body.put("stampers", stampers);
+        body.put("useDefaultSeal", false);
+        body.put("signWithoutAppearance", true);
+        return parse(SignaturePostUtil.sendPostApplicationJson(SIGN_HTTP_TOP + "/contract/signbycompany",
+                body.toJSONString(), APPTOKEN, SIGNATURE));
+    }
+
+    /**
+     * 隔离点 #5:撤回合同(multipart),驳回与发起人撤回都走这里
+     *
+     * @param contractId 合同id
+     * @return 契约锁原始响应
+     */
+    public static JSONObject recall(String contractId) {
+        Map<String, String> formTexts = new HashMap<>();
+        formTexts.put("contractId", contractId);
+        return parse(SignaturePostUtil.sendPost(SIGN_HTTP_TOP + "/contract/recall", authHeader(), formTexts,
+                null, "UTF-8", "UTF-8"));
+    }
+
+    /**
+     * 隔离点:已盖章整包下载(回调 storagePath 为空时兜底)
+     *
+     * @param contractId 合同id
+     * @param targetDir 本地临时目录(带结尾斜杠)
+     * @return 本地文件名
+     * @throws Exception 下载异常
+     */
+    public static String downloadSignedZip(String contractId, String targetDir) throws Exception {
+        String apiUrl = SIGN_HTTP_TOP + "/contract/download?contractId=" + encode(contractId) + "&downloadItems=NORMAL";
+        HttpURLConnection conn = null;
+        InputStream inputStream = null;
+        FileOutputStream fos = null;
+        try {
+            conn = (HttpURLConnection) new URL(apiUrl).openConnection();
+            conn.setRequestMethod("GET");
+            for (Map.Entry<String, String> entry : authHeader().entrySet()) {
+                conn.setRequestProperty(entry.getKey(), entry.getValue());
+            }
+            conn.setConnectTimeout(35000);
+            conn.setReadTimeout(120000);
+            if (HttpURLConnection.HTTP_OK != conn.getResponseCode()) {
+                throw new Exception("契约锁下载接口返回非200,responseCode=" + conn.getResponseCode());
+            }
+            String fileName = contractId + ".zip";
+            inputStream = conn.getInputStream();
+            fos = new FileOutputStream(new File(targetDir + fileName));
+            byte[] buffer = new byte[4096];
+            int len;
+            while ((len = inputStream.read(buffer)) != -1) {
+                fos.write(buffer, 0, len);
+            }
+            return fileName;
+        } finally {
+            if (fos != null) {
+                fos.close();
+            }
+            if (inputStream != null) {
+                inputStream.close();
+            }
+            if (conn != null) {
+                conn.disconnect();
+            }
+        }
+    }
+
+    /**
+     * 解压契约锁下来的整包
+     *
+     * @param zipFile 本地 zip
+     * @param unzipDir 解压目录
+     */
+    public static void unzip(File zipFile, String unzipDir) {
+        SignaturePostUtil.unZipFile(zipFile, unzipDir);
+    }
+
+    /**
+     * 把契约锁响应解析成 JSON 对象;空响应或非 JSON 都返回 null,调用方按"查询异常"处理
+     *
+     * @param response 原始响应
+     * @return JSON 对象
+     */
+    public static JSONObject parse(String response) {
+        if (StringUtils.isBlank(response)) {
+            return null;
+        }
+        try {
+            return JSON.parseObject(response);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    /**
+     * 响应里的业务码是否成功(厂商口径 code=0)
+     *
+     * @param response 契约锁响应
+     * @return 是否成功
+     */
+    public static boolean isSuccess(JSONObject response) {
+        return response != null && "0".equals(StringUtils.defaultString(response.getString("code")));
+    }
+
+    /**
+     * 取可读失败原因;契约锁没给 message 时用固定兜底文案,不回显响应体
+     *
+     * @param response 契约锁响应
+     * @param fallback 兜底文案
+     * @return 提示文案
+     */
+    public static String message(JSONObject response, String fallback) {
+        if (response == null) {
+            return fallback;
+        }
+        return StringUtils.defaultIfBlank(response.getString("message"), fallback);
+    }
+
+    /**
+     * 按手机号构造动作操作人,手机号为空返回空列表
+     *
+     * @param mobile 手机号
+     * @return 操作人列表
+     */
+    private static List<ActionOperatorInfo> operatorList(String mobile) {
+        List<ActionOperatorInfo> operators = new ArrayList<>();
+        if (StringUtils.isBlank(mobile)) {
+            return operators;
+        }
+        ActionOperatorInfo operator = new ActionOperatorInfo();
+        operator.setOperatorContact(mobile);
+        operators.add(operator);
+        return operators;
+    }
+
+    /**
+     * 按手机号列表构造动作操作人,空号跳过
+     *
+     * 多个操作人在契约锁侧是"或签"还是"会签"没有文档依据,由 E4 实测判定:
+     * 若一名复核人签完动作2 就变已完成 ⇒ 或签,符合业务口径;若要求全员签完 ⇒ 会签,
+     * 需改成只传 1 人(此时"谁来复核"由建单快照决定,换人须撤回重发)。
+     *
+     * @param mobiles 手机号列表
+     * @return 操作人列表
+     */
+    private static List<ActionOperatorInfo> operatorList(List<String> mobiles) {
+        List<ActionOperatorInfo> operators = new ArrayList<>();
+        if (mobiles == null) {
+            return operators;
+        }
+        for (String mobile : mobiles) {
+            operators.addAll(operatorList(mobile));
+        }
+        return operators;
+    }
+
+    /**
+     * 契约锁鉴权请求头,timestamp 固定 "0" 与存量口径一致
+     *
+     * @return 请求头
+     */
+    private static Map<String, String> authHeader() {
+        Map<String, String> header = new HashMap<>();
+        header.put("x-qys-accesstoken", APPTOKEN);
+        header.put("x-qys-signature", SIGNATURE);
+        header.put("x-qys-timestamp", "0");
+        return header;
+    }
+
+    /**
+     * 拼 GET 查询串
+     *
+     * @param params 参数(值已编码)
+     * @return 查询串
+     */
+    private static String queryString(Map<String, String> params) {
+        StringBuilder sb = new StringBuilder();
+        for (Map.Entry<String, String> entry : params.entrySet()) {
+            if (sb.length() > 0) {
+                sb.append("&");
+            }
+            sb.append(entry.getKey()).append("=").append(StringUtils.defaultString(entry.getValue()));
+        }
+        return sb.toString();
+    }
+
+    /**
+     * URL 编码
+     *
+     * @param value 原值
+     * @return 编码后的值
+     */
+    private static String encode(String value) {
+        try {
+            return URLEncoder.encode(StringUtils.defaultString(value), "UTF-8");
+        } catch (Exception e) {
+            throw new IllegalStateException("UTF-8 编码不可用", e);
+        }
+    }
+
+    /**
+     * 配置读取的小封装:本类在静态初始化阶段取值,PropertiesLoader 按 ISO-8859-1 解码,中文值需还原
+     */
+    private static class GlobalConfigHolder {
+
+        /**
+         * 读取模块 profile 配置并修复中文乱码
+         *
+         * @param key 配置键
+         * @return 配置值
+         */
+        private static String get(String key) {
+            return fixLatin1Mojibake(Global.getConfig(key));
+        }
+
+        /**
+         * ISO-8859-1 乱码还原(与个人执业章同型实现,不跨包改执业章访问性)
+         *
+         * @param value 原值
+         * @return 还原后的值
+         */
+        private static String fixLatin1Mojibake(String value) {
+            if (StringUtils.isBlank(value)) {
+                return value;
+            }
+            boolean latin1Range = false;
+            for (int i = 0; i < value.length(); i++) {
+                char c = value.charAt(i);
+                if (c >= 0x80 && c <= 0xFF) {
+                    latin1Range = true;
+                } else if (c > 0xFF) {
+                    return value;
+                }
+            }
+            if (!latin1Range) {
+                return value;
+            }
+            try {
+                return new String(value.getBytes("ISO-8859-1"), "UTF-8");
+            } catch (Exception e) {
+                return value;
+            }
+        }
+    }
+
+}

+ 30 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealCarriedFilesDTO.java

@@ -0,0 +1,30 @@
+package com.jeeplus.finance.reportVerificationSeal.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 执业章已盖章件带出结果
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Data
+public class CwReportVerificationSealCarriedFilesDTO extends BaseDTO {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 最近一次已完成的执业章申请id,无数据时为空 */
+    private String latestSignatureId;
+
+    /** 该报告号已完成执业章申请数 */
+    private Integer completedCount;
+
+    /** 是否多次完成,前端据此显示标注文案 */
+    private Boolean multipleCompleted;
+
+    /** 最近一次完成的全部已盖章文件 */
+    private List<CwReportVerificationSealFileDTO> files;
+
+}

+ 115 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealDTO.java

@@ -0,0 +1,115 @@
+package com.jeeplus.finance.reportVerificationSeal.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 报告验证章申请单DTO,详情同时返回文件与报告展示字段
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Data
+public class CwReportVerificationSealDTO extends BaseDTO {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 项目名称快照 */
+    private String projectName;
+
+    /** 报告台账id */
+    private String reportId;
+
+    /** 报告号,关联不到时回落主表快照 */
+    private String reportNo;
+
+    /** 当前有效契约锁合同id */
+    private String contractId;
+
+    /** 建单主体名快照 */
+    private String contractTenantName;
+
+    /** 状态(0:草稿,1:待盖章,2:待复核,3:复核通过,4:已驳回,5:已撤回,6:已终止) */
+    private String status;
+
+    /** 发起人id */
+    private String applyUserId;
+
+    /** 已盖章压缩包OSS路径 */
+    private String signedZipUrl;
+
+    /** 备注及变更记录 */
+    private String remarks;
+
+    /** 本次提交的带出文件(source=1),保存时与手工上传一起全量替换 */
+    private List<CwReportVerificationSealFileDTO> files;
+
+    /** 本次手工上传的原件(source=2),走通用附件组件,保存时先落 work_attachment */
+    private List<com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO> workAttachmentDtoList;
+
+    /** 有效文件数,列表展示 */
+    private String fileCount;
+
+    /** 创建人姓名,草稿列表发起人列使用 */
+    private String createByName;
+
+    /** 项目编号,报告台账实时带出 */
+    private String projectNumber;
+
+    /** 报告名称,报告台账实时带出 */
+    private String reportName;
+
+    /** 被服务单位名称 */
+    private String servedUnitName;
+
+    /** 报告类型 */
+    private String reportType;
+
+    /** 银行函证发出数量 */
+    private String bankLettersCount;
+
+    /** 数字函证发出数量 */
+    private String digitalLetterCount;
+
+    /** 审定金额(不含税/元) */
+    private String approvedNoIncludingTax;
+
+    /** 审定金额(含税/元) */
+    private String approvedIncludingTax;
+
+    /** 所属行业 */
+    private String industry;
+
+    /** 业务对象 */
+    private String businessObjects;
+
+    /** 业务类型 */
+    private String businessType;
+
+    /** 审计业务类型 */
+    private String auditBusinessType;
+
+    /** 报告流水号 */
+    private String reportNumber;
+
+    /** 报告日期 */
+    @com.fasterxml.jackson.annotation.JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private java.util.Date reportDate;
+
+    /** 项目经理1姓名 */
+    private String projectMasterName;
+
+    /** 项目经理2姓名 */
+    private String realHeaderName;
+
+    /** 报告复核签章状态,5=已完成 */
+    private String reviewStatus;
+
+    /** 报告实时状态,7=已作废 */
+    private String reportStatus;
+
+    /** 创建时间查询区间,createDates[0] / createDates[1] */
+    private String[] createDates;
+
+}

+ 43 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealFileDTO.java

@@ -0,0 +1,43 @@
+package com.jeeplus.finance.reportVerificationSeal.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 报告验证章申请文件DTO
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Data
+public class CwReportVerificationSealFileDTO extends BaseDTO {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 申请单id,尚未保存的执业章带出行可为空 */
+    private String verificationSealId;
+
+    /** 来源(1:执业章已盖章件,2:手工上传) */
+    private String source;
+
+    /** source=1 时回指执业章文件id */
+    private String refPracticeFileId;
+
+    /** 文件名 */
+    private String fileName;
+
+    /** 原件附件id */
+    private String attachmentId;
+
+    /** 契约锁documentId,建单后回填 */
+    private String documentId;
+
+    /** 原件附件相对路径,建单时用于从OSS取文件,仅服务内部使用 */
+    private String attachmentUrl;
+
+    /** 文件排序 */
+    private Integer sort;
+
+    /** 备注 */
+    private String remarks;
+
+}

+ 43 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealReportCheckDTO.java

@@ -0,0 +1,43 @@
+package com.jeeplus.finance.reportVerificationSeal.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 报告签章前置条件检查结果
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Data
+public class CwReportVerificationSealReportCheckDTO extends BaseDTO {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 是否可继续签章,1=可以,0=不可以 */
+    private String valid;
+
+    /** 检查结果说明 */
+    private String message;
+
+    /** 报告id */
+    private String reportId;
+
+    /** 报告号,权威来源 cw_project_report_new_line.report_no */
+    private String reportNo;
+
+    /** 项目名称 */
+    private String projectName;
+
+    /** 项目编号 */
+    private String projectNumber;
+
+    /** 关联项目是否仍存在,false=项目不存在或已逻辑删除 */
+    private Boolean projectValid;
+
+    /** 报告状态,7=已作废 */
+    private String reportStatus;
+
+    /** 复核签章状态,5=已完成 */
+    private String reviewStatus;
+
+}

+ 28 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealReviewerCheckDTO.java

@@ -0,0 +1,28 @@
+package com.jeeplus.finance.reportVerificationSeal.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 复核角色可用性检查结果,不返回成员个人信息
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Data
+public class CwReportVerificationSealReviewerCheckDTO extends BaseDTO {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 复核角色是否有成员 */
+    private Boolean available;
+
+    /** 检查结果说明 */
+    private String message;
+
+    /** 复核角色id */
+    private String roleId;
+
+    /** 复核角色成员数 */
+    private Integer memberCount;
+
+}

+ 25 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/dto/CwReportVerificationSealSignStatusDTO.java

@@ -0,0 +1,25 @@
+package com.jeeplus.finance.reportVerificationSeal.service.dto;
+
+import lombok.Data;
+
+/**
+ * 报告验证章盖章进度DTO(节点1【同意】门禁判据)
+ *
+ * 只返回结论与提示,不返回手机号、签署页地址、契约锁原始响应。
+ *
+ * @author: 徐滕
+ * @version: 2026-11-24 14:00
+ */
+@Data
+public class CwReportVerificationSealSignStatusDTO {
+
+    /** action1 是否已落章(1:已盖章,0:未盖章或状态未知) */
+    private String sealed;
+
+    /** 前端是否按门禁拦截(1:拦截,0:查询异常/状态未知,只提示不拦) */
+    private String gateEnabled;
+
+    /** 可读提示,不含手机号与签署地址 */
+    private String tip;
+
+}

+ 20 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/mapstruct/CwReportVerificationSealFileWrapper.java

@@ -0,0 +1,20 @@
+package com.jeeplus.finance.reportVerificationSeal.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.finance.reportVerificationSeal.domain.CwReportVerificationSealFile;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealFileDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * 报告验证章文件转换器
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwReportVerificationSealFileWrapper extends EntityWrapper<CwReportVerificationSealFileDTO, CwReportVerificationSealFile> {
+
+    CwReportVerificationSealFileWrapper INSTANCE = Mappers.getMapper(CwReportVerificationSealFileWrapper.class);
+
+}

+ 20 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reportVerificationSeal/service/mapstruct/CwReportVerificationSealWrapper.java

@@ -0,0 +1,20 @@
+package com.jeeplus.finance.reportVerificationSeal.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.finance.reportVerificationSeal.domain.CwReportVerificationSeal;
+import com.jeeplus.finance.reportVerificationSeal.service.dto.CwReportVerificationSealDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * 报告验证章单据转换器
+ * @author: 徐滕
+ * @version: 2026-11-24 10:00
+ */
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwReportVerificationSealWrapper extends EntityWrapper<CwReportVerificationSealDTO, CwReportVerificationSeal> {
+
+    CwReportVerificationSealWrapper INSTANCE = Mappers.getMapper(CwReportVerificationSealWrapper.class);
+
+}

+ 6 - 0
jeeplus-modules/jeeplus-finance/src/main/resources/application-finance-development.yml

@@ -67,6 +67,12 @@ practice_signature_apptoken: nttiOI4oOb
 practice_signature_appsecret: K0TSdhhYGT1SEhDsL1fKdJvuMCo44K
 practice_signature_signature: f134d94b83b083c366cab5a108aad5a1
 
+#报告验证章-业务分类id(不同于个人执业章分类)
+verification_signature_category_id: 3562408303883997936
+#主体名与应用凭据直接复用 practice_signature_*;API 地址复用 signature_http_top
+#报告验证章-回调地址(直连 finance:9527,待用户回填)
+verification_signature_qiyuesuo_callback_url:
+
 #验证码发送相关参数
 rong_userid: 8a216da86715511501673e331c24171e
 rong_token: 3d7dc58c6a334ad6887317efbf847e41

+ 6 - 0
jeeplus-modules/jeeplus-finance/src/main/resources/application-finance-production.yml

@@ -71,3 +71,9 @@ practice_signature_apptoken: KtjC5uKnuC
 practice_signature_appsecret: C3S18vtTAiWHSuEbKHBvubbQIAOqGO
 practice_signature_signature: 1fcb11e02adb61bb615cc0eb0de1af25
 
+#报告验证章-业务分类id(不同于个人执业章分类)
+verification_signature_category_id:
+#主体名与应用凭据直接复用 practice_signature_*;API 地址复用 signature_http_top
+#报告验证章-回调地址(直连 finance:9527,待用户回填)
+verification_signature_qiyuesuo_callback_url:
+

+ 5 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/RoleApiImpl.java

@@ -36,6 +36,11 @@ public class RoleApiImpl implements IRoleApi {
     }
 
     @Override
+    public RoleDTO getRoleDTOByNameIgnoreTenant(String name) {
+        return RoleWrapper.INSTANCE.toDTO(roleService.getRoleByNameIgnoreTenant(name));
+    }
+
+    @Override
     public RoleDTO getRoleDTOById(String id) {
         return RoleWrapper.INSTANCE.toDTO ( roleService.lambdaQuery ( ).eq ( Role::getTenantId, TenantUtils.getTenantId ( ) ).eq ( Role::getId, id ).one ( ) );
     }

+ 8 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/RoleMapper.java

@@ -66,6 +66,14 @@ public interface RoleMapper extends BaseMapper <Role> {
     @InterceptorIgnore(tenantLine = "true")
     RoleDTO getRoleByName2(@Param("name") String name);
 
+    /**
+     * 按角色名查询(忽略租户过滤,用于系统级角色校验)
+     * @param name 角色名
+     * @return 角色实体
+     */
+    @InterceptorIgnore(tenantLine = "true")
+    Role getRoleByNameIgnoreTenant(@Param("name") String name);
+
     @InterceptorIgnore(tenantLine = "true")
     Role getRoleDTOByNameAndTenantId(@Param("name")String name,@Param("tenantId")String tenantId);
 

+ 4 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/RoleMapper.xml

@@ -29,6 +29,10 @@
     <select id="getRoleByName2" resultType="com.jeeplus.sys.service.dto.RoleDTO">
         select id from sys_role where name = #{name}
     </select>
+    <select id="getRoleByNameIgnoreTenant" resultType="com.jeeplus.sys.domain.Role">
+        SELECT id, name, en_name, is_sys AS sysData, useable, remarks, create_time, create_by_id, update_time,
+        update_by_id, del_flag, tenant_id FROM sys_role WHERE del_flag = 0 AND name = #{name} LIMIT 1
+    </select>
     <select id="getRoleDTOByNameAndTenantId" resultType="com.jeeplus.sys.domain.Role">
         SELECT id, name, en_name, is_sys AS sysData, useable, remarks, create_time, create_by_id, update_time,
         update_by_id, del_flag, tenant_id FROM sys_role WHERE del_flag = 0 AND name = #{name} and tenant_id = #{tenantId}

+ 9 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/RoleService.java

@@ -181,6 +181,15 @@ public class RoleService extends ServiceImpl <RoleMapper, Role> {
     }
 
     /**
+     * 按角色名查询(忽略租户过滤,用于系统级角色校验)
+     * @param name 角色名
+     * @return 角色实体
+     */
+    public Role getRoleByNameIgnoreTenant(String name) {
+        return baseMapper.getRoleByNameIgnoreTenant(name);
+    }
+
+    /**
      * 根据数据权限id查询用户是否存在当前权限
      * @param userDTO
      * @param dataRuleId