Commit Graph

186 Commits (d78ec58d961079de897d6509700d136bf03338a6)
 

Author SHA1 Message Date
chenyuan1 d78ec58d96 fix: enforce issuance workflow and validate learner answers 4 weeks ago
chenyuan1 e9c6947b35 fix: correct training workflows and isolate learner data
Separate issuance timestamp retrieval from request creation, validate learner action inputs, and guard request ownership. Preserve exact payment report signing text, hide peer wallet balances, and maintain isolated reversible teaching reserve entries. Include schema upgrades and regression coverage.
4 weeks ago
赵佳正 b68e7201c5 feat:文件上传的功能开发 4 weeks ago
赵佳正 8f948dece3 feat:文件上传的功能开发 4 weeks ago
赵佳正 a6a83e5bd5 feat:文件上传的功能开发 1 month ago
chenyuan ae2e1f5d74 fix(exchange): decouple training coins from issuance inventory 1 month ago
赵佳正 9723e00c3b feat:文件上传的功能开发 1 month ago
chenyuan 79ecc277e2 feat: 实训任务进度支持随时保存答案,并统一覆盖模块一至五
/api/v1/training-tasks 原先只表示"哪些步骤完成了",且模块二、四、五的动作链、
模块三的各接口都不会写入,导致步骤做完了进度不更新。同时新需求要求学员操作过程中
可以随时保存答案。

接口
- PUT    /training-tasks/{moduleCode}/steps/{stepCode}  保存答案(JSON),覆盖上一次
- GET    /training-tasks/{moduleCode}/steps/{stepCode}  读取答案和步骤状态
- DELETE /training-tasks/{moduleCode}                   重新实训,清空模块进度
- 步骤新增状态 SAVED(已保存草稿未完成);模块/步骤新增 savedSteps、hasData、savedAt、locked
- 非法输入(空、非 JSON、非对象/数组、超 10 万字符、未知模块/步骤)一律 400

防止学员改答案
- 步骤完成之前答案可反复覆盖;完成之后只再接受一次保存(页面做完最后一个动作会自动存一次),
  随即锁定。锁定后提交不同内容返回 409(新增 ErrorCode.CONFLICT),原答案保留;
  相同内容(忽略空白和键顺序)视为成功。重新实训清空整个模块,包括锁定状态
- 保存时对该步骤行加锁,避免并发请求绕过锁定检查

进度写入
- 模块一、二、四、五的评分服务在步骤完成时统一同步进度;模块三在拦截器里按
  前端各步完成判据对应到最后一个写接口,并恢复为 5 步可用
- 去掉拦截器里"仅打开页面的读接口也记步骤完成"的三处映射(兑换/支付 context、发行库存),
  否则步骤一进入就被当成已完成,答案会被提前锁定
- 草稿不计入完成数:module-completion 只统计 completed_at 不为空的记录

数据库(必须先于后端部署,按顺序执行,均可重复执行)
1. db/manual/training_task_progress_draft_upgrade.sql  新增 step_data/saved_at/sealed_at,completed_at 改为可空
2. db/manual/training_task_progress_draft_migrate.sql  把旧 user_step_progress_new 的答案迁入
3. db/manual/training_task_progress_backfill.sql       补录历史漏记的完成记录,并封存已完成且有答案的步骤
   第 3 个脚本会锁定存量答案,建议在没有学员正在操作时执行

测试
- 新增服务层 22、接口层 6、拦截器 5、评分服务若干用例;锁定与进度同步的用例已验证
  在去掉实现后会失败
- 完整套件的 29 个失败(institutionidentity 三个类和 WalletRuntimeResetTest)在改动前的
  master 上同样存在,与本次无关
2 months ago
赵佳正 e7c54403d7 feat:文件上传的功能开发 2 months ago
chenyuan a2b539c2c3 chore: 发行模块注释中文化
将 CentralBankIssuanceQueryService、IssuanceAuditActor 中的英文注释改为中文。
仅注释改动,无逻辑变化。
2 months ago
chenyuan 1e3abc9554 feat: 新增 GET /exchange/attempts/latest,区分实验"已完成"与"从未开始"
attempts/current 只查 IN_PROGRESS/SUBMITTED,实验走完后返回 404,
前端无法区分"已完成"和"从未开始",会静默新建一个空实验,导致页面
回显旧进度而后端动作历史为空。

新增 latest 接口返回最近一次未取消的实验(含 COMPLETED),已取消的不返回。
current 的行为不变。
2 months ago
赵佳正 2af28bbd51 Merge remote-tracking branch 'origin/master' 2 months ago
赵佳正 348edf8516 feat:文件上传的功能开发 2 months ago
chenyuan d4f8443deb fix: validate module four and five training inputs 2 months ago
chenyuan 2f0ae18116 fix: verify exchange coin control signatures 2 months ago
chenyuan b7000539ec fix: synchronize training module state 2 months ago
chenyuan c106ee56f0 fix: correct payment coin reset query 2 months ago
chenyuan c40b1d2878 fix: use built-in payer for payment training 2 months ago
chenyuan 9931e835d0 fix: adapt module four wallet prerequisite to module three send 2 months ago
赵佳正 655d96ff26 Merge remote-tracking branch 'origin/master' 2 months ago
赵佳正 a5a0b882f7 feat:文件上传的功能开发 2 months ago
陈沅 cd41f337da Merge remote-tracking branch 'origin/master' 2 months ago
陈沅 0fd1bbafa2 feat: score input errors in modules 2 4 5 2 months ago
陈沅 7a3c52a07d docs: plan module input error scoring 2 months ago
陈沅 38a5242af0 docs: define input error scoring for modules 2 4 5 2 months ago
赵佳正 21d9a63b83 Merge branch 'master' of http://118.31.7.2:3000/chenyuan1/digital-rmb-backend 2 months ago
赵佳正 ef419e363b feat:文件上传的功能开发 2 months ago
赵佳正 04cda82cf0 feat:文件上传的功能开发 2 months ago
chenyuan ab9be4afc2 fix: allow users to reset wallet runtime 2 months ago
chenyuan 72b771b409 fix(issuance): 校验申请金额不超过建议补充额 2 months ago
赵佳正 32c5cae953 Merge remote-tracking branch 'origin/master' 2 months ago
赵佳正 1cf2bac39a feat:文件上传的功能开发 2 months ago
chenyuan 3dd516d0ff feat(wallet): add teacher-only runtime reset for exchange and payment
Completed exchanges keep the shared wallet projection pinned to the old
module 3 result and the cancel guard refuses to roll the coins back, so a
retrained card could never reach modules 4 and 5. The new endpoint wipes
that user's exchange and payment history, returns the coins to the
commercial bank vault, and re-projects from the latest module 3 result in
the same transaction so the read-only context endpoints stay usable.
2 months ago
赵佳正 9a55f2747f Merge branch 'master' of http://118.31.7.2:3000/chenyuan1/digital-rmb-backend 2 months ago
赵佳正 dfe131edf1 feat:文件上传的功能开发 2 months ago
chenyuan 7a7aed1652 fix(wallet): let unused shared account follow retrained module 3 card 2 months ago
赵佳正 345ca66c63 feat:文件上传的功能开发 2 months ago
chenyuan 8af6f539bf fix(wallet): widen bank_card_number columns and cap input length
Module 3 step 1 (output application) had no length limit on the bank
card number fields in either the frontend input or the backend DTO.
A long test value overflowed VARCHAR(30) and the MySQL update failed
with 'Data truncation: Data too long for column bank_card_number',
returning a 500 and blocking the whole module 3 flow (and therefore
module 4/5 downstream).

- widen wallet_application.bank_card_number/input_bank_card_number,
  bank_received_wallet_application.bank_card_number,
  wallet_registration_request.bank_card_number, and
  central_wallet_registration.bank_card_number from VARCHAR(30) to
  VARCHAR(64) in schema.sql (already applied directly to the running
  dev database via ALTER TABLE)
- add @Size(max = 64) to WalletApplicationRequest's card number fields
- add maxlength=64 to the bank card input on the wallet open step
2 months ago
chenyuan 93bed6a2a4 fix(wallet): retire unused stale wallet after module 3 retraining
Module 3 retraining projects a new wallet_id/signature via
loadCompletedSource(), but ensureWallet() only ever validated the
existing digital_wallet row against it and threw a conflict when the
stale row (from before retraining) didn't match. If that stale wallet
was never actually used downstream (zero balance/frozen amount, no
exchange/payment/ledger history), retire it and its dependent
certificate/contract/binding rows so the fresh module 3 result can be
projected instead of surfacing '共享钱包与模块三最终结果不一致'.

Wallets that were actually used still correctly conflict.
2 months ago
chenyuan 87f93ae614 Merge module 6 charity workflow 2 months ago
chenyuan 847a761cbb feat(module6): implement charity donation workflow 2 months ago
chenyuan 2dd9c817be feat(module6): add innovation training reset 2 months ago
chenyuan 5af0e857b8 Merge salary signing fix 2 months ago
chenyuan c243884e88 fix(salary): isolate batches and sign digest value 2 months ago
chenyuan 1dfeab33f3 Merge branch 'agent/payment-training-progress' into master
# Conflicts:
#	src/main/java/com/yau/digitalrmb/payment/infrastructure/persistence/JdbcPaymentResourceRepository.java
#	src/test/java/com/yau/digitalrmb/payment/interfaces/rest/PaymentControllerTest.java
2 months ago
chenyuan 5e66219d26 fix(payment): project wallet prerequisites on refresh 2 months ago
whb 792888ab04 日志调整 3 months ago
陈沅 4b315995f3 fix: align payment teaching payee with prototype 3 months ago
陈沅 aea498726c fix: add teaching payment payee fallback 3 months ago
赵佳正 718755f8a0 Merge branch 'master' of http://118.31.7.2:3000/chenyuan1/digital-rmb-backend 3 months ago