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,8 @@
// === EIP4 P4 脚本迁移产出 ===
// template_id : 93a3c6d5-bdda-4fbc-b1f3-a496aea19575
// template_name: 物资采购订单(土建)
// seq : 1
// label : NO_S3
// 处置 : 无 S3 模式,原样进 P4
page.setDataFilter(["PM_MATERIALPURCHASEORDERS_TJ_ID":PM_MATERIALPURCHASEORDERS_TJ_ID,"COMPANY":GetDefaultValueFunction.getConfigValue("com.dsasp.server.organize.COMPANY")]);
page.noSearch(false);

View File

@@ -0,0 +1,9 @@
// === EIP4 P4 脚本迁移产出 ===
// template_id : 93a3c6d5-bdda-4fbc-b1f3-a496aea19575
// template_name: 物资采购订单(土建)
// seq : 2
// label : FULL_AUTO
// 处置 : 全自动改写完成,直接入 P4 转换流水线
addSubTableButton("ORDERSDETAILS", "SELECT", 0);
//setFieldCaption("ISPREPARATION", "公司备料");
setFieldVisible("ISPREPARATION", false);

View File

@@ -0,0 +1,16 @@
// === EIP4 P4 脚本迁移产出 ===
// template_id : 93a3c6d5-bdda-4fbc-b1f3-a496aea19575
// template_name: 物资采购订单(土建)
// seq : 3
// label : FULL_AUTO
// 处置 : 全自动改写完成,直接入 P4 转换流水线
//setFieldCaption("ISPREPARATION", "公司备料");
//def projectid = getFieldValue("PROJECTID");
//
//if(projectid != null){
// bindField("ISPREPARATION",false);
//}else{
// bindField("ISPREPARATION",true);
// setFieldReadOnly("PROJECTID",true);
//}
setFieldVisible("ISPREPARATION", false);

View File

@@ -0,0 +1,70 @@
// === EIP4 P4 脚本迁移产出 ===
// template_id : 93a3c6d5-bdda-4fbc-b1f3-a496aea19575
// template_name: 物资采购订单(土建)
// seq : 4
// label : NO_S3
// 处置 : 无 S3 模式,原样进 P4
def ordersStatus = GetServicesFunction.getEnumerateItemValue("ordersStatus",item['ORDERSSTATUS']);
//true:可用;false:不可用
switch(ordersStatus){
case 1://未核对
def strSql = "select Count(*) from pm_materialpurchaseorders_tj a";
strSql += " inner join pm_materialpurchaseapply_tj b on a.purchaseapplyid = b.pm_materialpurchaseapply_tj_id";
strSql += " inner join sys_datastatus c on b.pm_materialpurchaseapply_tj_id = c.businesskey";
strSql += " AND c.tablename = 'PM_MATERIALPURCHASEAPPLY_TJ'";
strSql += " where datastatus = 3 and a.pm_materialpurchaseorders_tj_id = '" + item['PM_MATERIALPURCHASEORDERS_TJ_ID'] + "'";
def applycount = GetServicesFunction.findCount(strSql);
if(applycount &gt; 0){
enableButton("确认下单",true);
}else{
enableButton("确认下单",false);
}
enableButton("取消下单",false);
enableButton("确认到货",false);
enableButton("修改",true);
enableButton("删除",true);
enableButton("单价复核",false);
enableButton("作废",true);
break;
case 3://已下单
enableButton("确认下单",false);
def sqlStr = "select count(*) from pm_materialpurchaseorders_tj a";
sqlStr += " inner join pm_materialpurchaseordersdetails_tj b on a.pm_materialpurchaseorders_tj_id = b.purchaseordersid";
sqlStr += " where pm_materialpurchaseorders_tj_id = '" + item['PM_MATERIALPURCHASEORDERS_TJ_ID'] + "'";
sqlStr += " and pm_materialpurchaseordersdetails_tj_id in (SELECT ordersdetails_tj_id from PM_PROJECTIMPORT_TJ)";
def count = GetServicesFunction.findCount(sqlStr);
if(count &gt; 0){
enableButton("取消下单",false);
enableButton("作废",false);
}else{
enableButton("取消下单",true);
enableButton("作废",true);
}
enableButton("确认到货",true);
enableButton("修改",false);
enableButton("删除",false);
enableButton("单价复核",true);
break;
case 4://已完成
enableButton("确认下单",false);
enableButton("取消下单",false);
enableButton("确认到货",false);
enableButton("修改",false);
enableButton("删除",false);
enableButton("单价复核",true);
enableButton("作废",false);
break;
case 5://作废
enableButton("确认下单",false);
enableButton("取消下单",false);
enableButton("确认到货",false);
enableButton("修改",false);
enableButton("删除",false);
enableButton("单价复核",false);
enableButton("作废",false);
default:
break;
}