任务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>
90 lines
2.5 KiB
Groovy
90 lines
2.5 KiB
Groovy
// === EIP4 P4 脚本迁移产出 ===
|
||
// template_id : 9b0ea26a-26a3-4dd2-be5e-2b18e7837005
|
||
// template_name: 项目付款申请
|
||
// seq : 2
|
||
// label : HARD
|
||
// 硬 S3 原因 : 动态创建 Vaadin 组件
|
||
// 处置 : 原文保留,进人工排期(amis dialog/service 重写)
|
||
import com.vaadin.ui.Label;
|
||
def label4 = new Label("<font style=\"float:right\">入库金额(元)</font>");
|
||
def label5 = new Label("<font style=\"float:left\">超出控制金额后,本次申请付款金额以红色字体显示</font>");
|
||
|
||
|
||
label4.setContentMode(Label.CONTENT_XHTML);
|
||
label5.setContentMode(Label.CONTENT_XHTML);
|
||
|
||
def formLayout4 =group.getField("LBLIMPORTMONEY").parent;
|
||
def formLayout5 =group.getField("LBLDESCRIBE").parent;
|
||
|
||
|
||
if(formLayout4.getComponentCount()>1){
|
||
formLayout4.removeComponent(formLayout4.getComponent(1));
|
||
}
|
||
formLayout4.addComponent(label4);
|
||
|
||
if(formLayout5.getComponentCount()>1){
|
||
formLayout5.removeComponent(formLayout5.getComponent(1));
|
||
}
|
||
formLayout5.addComponent(label5);
|
||
|
||
def txt4 = group.getField("IMPORTMONEY");
|
||
|
||
def controlmode = GetDefaultValueFunction.getConfigValue("com.dsasp.pm.projectsubpayment.CONTROLMODE");
|
||
|
||
|
||
switch(controlmode){
|
||
case "1"://土建通用模式
|
||
label4?.setVisible(false);
|
||
txt4?.setVisible(false);
|
||
break;
|
||
case "2"://华丽美登模式
|
||
label4?.setVisible(true);
|
||
txt4?.setVisible(true);
|
||
break;
|
||
case "3"://华新模式
|
||
label4?.setVisible(true);
|
||
txt4?.setVisible(true);
|
||
break;
|
||
case "4"://万象控制模式
|
||
label4?.setVisible(false);
|
||
txt4?.setVisible(false);
|
||
break;
|
||
case "5"://五建控制模式
|
||
label4?.setVisible(false);
|
||
txt4?.setVisible(false);
|
||
break;
|
||
case "6"://建设集团-天城控制模式
|
||
label4?.setVisible(true);
|
||
txt4?.setVisible(true);
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
|
||
|
||
|
||
|
||
def type = getFieldValue("APPROVALTYPE");
|
||
if(type==null){
|
||
type = 1;
|
||
}
|
||
|
||
def icType = group.getField("APPROVALTYPE")?.getContainerDataSource();
|
||
|
||
//排除“项目付款的审批类型”
|
||
def smap=[:];
|
||
smap["EXTENDATTRIBUTEONE"] = 1;
|
||
smap["SYS_ENUMERATETYPE_ID"] = "APPROVAL_TYPE";
|
||
def typelist = GetServicesFunction.listSelectResult(smap,"SYS_ENUMERATE");
|
||
if(typelist!=null && typelist.size()>0){
|
||
for(i in 0..<typelist.size()){
|
||
def po = typelist[i]
|
||
icType?.removeItem(po.get_Value("CODEVALUE"));
|
||
}
|
||
}
|
||
|
||
//绑定默认
|
||
bindField("APPROVALTYPE",type);
|
||
|
||
|