P4-2 脚本迁移线:全量改写产出 + facade 动词表运行时实现

任务1 全量改写执行:
- run_rewrite.py 对客户库缓存 1,427 条逐条改写,按 template_id+脚本序号落盘
  output/rewritten/(497 FULL_AUTO + 30 PARTIAL + 85 HARD + 815 NO_S3)
- 人工作业单 115 份(PARTIAL 30 + HARD 85),每份附原文/已改部分/余留模式/建议改法/工时口径
- 自动化率 81.2% 复现 C4 实测,0 误改

任务2 facade 动词表运行时:
- ScriptFacade 把 31 改写目标动词 + bindField 作为 Groovy 闭包注入 Bindings
  (PoC enableButton 模式扩展);服务端语义动词直接求值,UI 语义动词捕获为
  amis 事件动作指令 JSON(actionType/componentId/args)
- 保真层纪律:全在 com.eip4 现代层,com.dsasp 源码零改,ArchUnit 复跑通过
- ScriptExecuteController 提供 /api/script/execute 与 /api/script/execute-template

验证:
- 单测 17 方法逐动词覆盖,均经真实 Groovy 过保真层引擎,BUILD SUCCESS
- 集成 6 条真实 FULL_AUTO 改写脚本经 8086 执行,amis 指令协议合规
- 回归 PoC script-test 通过,ArchUnit 架构纪律通过

报告 tools/s3_rewriter/P4脚本迁移执行报告.md;新坑入 docs/迁移手册.md 5.39/9.3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 16:10:22 +08:00
parent 3a13c50a01
commit aefb0e2eb9
1552 changed files with 41290 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
// === EIP4 P4 脚本迁移产出 ===
// template_id : 209698e6-38fb-4c4e-8106-bf28fc9ca87e
// template_name: 外经证开具申请
// seq : 1
// label : NO_S3
// 处置 : 无 S3 模式,原样进 P4
page.setDataFilter(["ID":PM_EXTERNALAPPLY_ID]);

View File

@@ -0,0 +1,29 @@
// === EIP4 P4 脚本迁移产出 ===
// template_id : 209698e6-38fb-4c4e-8106-bf28fc9ca87e
// template_name: 外经证开具申请
// seq : 2
// label : NO_S3
// 处置 : 无 S3 模式,原样进 P4
def ordersStatus = GetServicesFunction.getEnumerateItemValue("WFSTATUS",item['STATUS']);
if(ordersStatus == 3){
enableButton("核销",true);
enableButton("调整",true);
}else{
enableButton("核销",false);
enableButton("调整",false);
}
if(item['WRITEOFF'] != null){
enableButton("确认核销",true);
}else{
enableButton("确认核销",false);
enableButton("取消核销",false);
}
if(item['WRITEOFFSTATUS'] == "已核销"){
enableButton("取消核销",true);
enableButton("确认核销",false);
}else if(item['WRITEOFFSTATUS'] == "待核销"){
enableButton("取消核销",false);
enableButton("确认核销",true);
}

View File

@@ -0,0 +1,27 @@
// === EIP4 P4 脚本迁移产出 ===
// template_id : 209698e6-38fb-4c4e-8106-bf28fc9ca87e
// template_name: 外经证开具申请
// seq : 3
// label : NO_S3
// 处置 : 无 S3 模式,原样进 P4
def id = getFieldValue("PM_EXTERNALAPPLY_ID");
def sql = "";
sql+=" select c.externalmoney-coalesce(a.externalmoney,0) as lastmoney";
sql+=" from pm_externalapply c ";
sql+=" left join lateral(";
sql+=" select sum(coalesce(a.externalmoney,0)) as externalmoney ";
sql+=" from pm_invoiceapply_external a ";
sql+=" join pm_invoiceapply b on a.invoiceapplyid = b.pm_invoiceapply_id ";
sql+=" left join sys_datastatus s on b.pm_invoiceapply_id = s.businesskey and s.tablename = 'PM_INVOICEAPPLY' ";
sql+=" where coalesce(s.datastatus,1) in (1,2,3,5) and a.externalapplyid = c.pm_externalapply_id";
sql+=" ) a on true ";
sql+=" where c.pm_externalapply_id ='"+id+"'";
def returnmap = GetServicesFunction.executeQueryForMap(sql);
if(returnmap!=null){
bindField("WRITEOFF",returnmap["LASTMONEY"]);
}else{
bindField("WRITEOFF",null);
}