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:
@@ -0,0 +1,64 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : ee9e2a39-45e2-434a-b691-a02a2041b7e6
|
||||
// template_name: 物资采购申请(土建-公司)
|
||||
// seq : 1
|
||||
// label : HARD
|
||||
// 硬 S3 原因 : 动态创建 Vaadin 组件
|
||||
// 处置 : 原文保留,进人工排期(amis dialog/service 重写)
|
||||
import com.vaadin.ui.Button;
|
||||
import com.vaadin.ui.Button.ClickEvent;
|
||||
import com.vaadin.ui.Button.ClickListener;
|
||||
import com.vaadin.ui.Notification;
|
||||
import com.vaadin.ui.Notification.Type;
|
||||
|
||||
def materialList = group.getField("MATERIALDETAILS");
|
||||
final Button cb = new Button("复制");
|
||||
final Object table = materialList?.table;
|
||||
table?.setImmediate(true);//设置验证
|
||||
final group1 = group;
|
||||
cb?.addClickListener(new ClickListener() {
|
||||
public void buttonClick(ClickEvent event) {
|
||||
Object o = table?.getValue();
|
||||
if (o == null){
|
||||
Notification.show("请选择一条记录!", Type.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
def itemMap = [:];
|
||||
itemMap["MATERIALID"] = getFieldValue(o, "MATERIALID");//材料ID
|
||||
itemMap["MATERIALCODE"] = getFieldValue(o, "MATERIALCODE");//材料编码
|
||||
//itemMap["MATERIALALIASID"] = getFieldValue(o, "MATERIALALIASID");//材料别名ID
|
||||
itemMap["MATERIALNAME"] = getFieldValue(o, "MATERIALNAME");//材料名称
|
||||
itemMap["SPECIFICATIONS"] = getFieldValue(o, "SPECIFICATIONS");//规格
|
||||
//itemMap["FIGURENO"] = getFieldValue(o, "FIGURENO");//图号编号
|
||||
//itemMap["SURFACETREATMENT"] = getFieldValue(o, "SURFACETREATMENT");//表面处理
|
||||
//itemMap["COLORNUMBER"] = getFieldValue(o, "COLORNUMBER");//色泽色号
|
||||
//itemMap["LENGTH"] = getFieldValue(o, "LENGTH");//长度
|
||||
itemMap["NUMBER"] = getFieldValue(o, "NUMBER");//件数
|
||||
//itemMap["CHILDUNIT"] = getFieldValue(o, "CHILDUNIT");//子单位
|
||||
//itemMap["LENGTHSUM"] = getFieldValue(o, "LENGTHSUM");//总长
|
||||
//itemMap["METERWEIGHT"] = getFieldValue(o, "METERWEIGHT");//米重
|
||||
itemMap["PURCHASENUM"] = getFieldValue(o, "PURCHASENUM");//数量
|
||||
itemMap["UNIT"] = getFieldValue(o, "UNIT");//主单位
|
||||
itemMap["REMARK"] = getFieldValue(o, "REMARK");//备注
|
||||
|
||||
//调用addItem()方法可直接在
|
||||
materialList.addItem(itemMap);
|
||||
table.select(o);
|
||||
}
|
||||
});
|
||||
|
||||
//将自定义的按钮添加至
|
||||
materialList?.addButton(group.getField("SELECT"),0);
|
||||
materialList?.addButton(cb, 1);
|
||||
|
||||
import com.dsasp.client.viewframework.util.TableImportExport;
|
||||
def tie = new TableImportExport(materialList,"com.dsasp.pm.materialmanagertj.client.MaterialApplyDetailImportOfTJ");
|
||||
tie.addImportButton(4);
|
||||
tie.addExportButton(5);
|
||||
|
||||
|
||||
|
||||
group.getField("MATERIALDETAILS")?.addButton(group.getField("SELECT"),0);
|
||||
group.getField("ISPREPARATION")?.setVisible(false);
|
||||
//group.getField("ISPREPARATION").setCaption("公司备料");
|
||||
@@ -0,0 +1,22 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : ee9e2a39-45e2-434a-b691-a02a2041b7e6
|
||||
// template_name: 物资采购申请(土建-公司)
|
||||
// seq : 2
|
||||
// label : NO_S3
|
||||
// 处置 : 无 S3 模式,原样进 P4
|
||||
def applyStatus = GetServicesFunction.getEnumerateItemValue("WFSTATUS",item['STATUS']);
|
||||
|
||||
switch(applyStatus){
|
||||
case 3:
|
||||
enableButton("作废",true);
|
||||
break;
|
||||
case 6:
|
||||
enableButton("作废",false);
|
||||
enableButton("修改",false);
|
||||
enableButton("删除",false);
|
||||
enableButton("提交审批",false);
|
||||
break;
|
||||
default:
|
||||
enableButton("作废",false);
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : ee9e2a39-45e2-434a-b691-a02a2041b7e6
|
||||
// template_name: 物资采购申请(土建-公司)
|
||||
// seq : 3
|
||||
// label : FULL_AUTO
|
||||
// 处置 : 全自动改写完成,直接入 P4 转换流水线
|
||||
setFieldVisible("ISPREPARATION", false);
|
||||
@@ -0,0 +1,7 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : ee9e2a39-45e2-434a-b691-a02a2041b7e6
|
||||
// template_name: 物资采购申请(土建-公司)
|
||||
// seq : 4
|
||||
// label : NO_S3
|
||||
// 处置 : 无 S3 模式,原样进 P4
|
||||
page.setDataFilter(["PM_MATERIALPURCHASEAPPLY_TJ_ID":PM_MATERIALPURCHASEAPPLY_TJ_ID,"COMPANY":GetDefaultValueFunction.getConfigValue("com.dsasp.server.organize.COMPANY")]);
|
||||
Reference in New Issue
Block a user