任务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>
75 lines
3.1 KiB
Groovy
75 lines
3.1 KiB
Groovy
// === EIP4 P4 脚本迁移产出 ===
|
||
// template_id : 1a7f5b05-adee-4a67-a311-ac9f76af2c15
|
||
// template_name: 物资合同评审(五建定制)
|
||
// seq : 5
|
||
// 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;
|
||
import com.dsasp.client.viewframework.util.TableImportExport;
|
||
|
||
bindField("FIRSTPARTY",GetDefaultValueFunction.getConfigValue("com.dsasp.server.organize.COMPANY"));
|
||
//绑定费率项
|
||
def ratelist = [];
|
||
def returnCol = [];
|
||
def PM_MATERIALCONTRACTVIEWCONFIG_ID = null;
|
||
def PM_MATERIALCONTRACTREVIEW_ID = null;
|
||
returnCol.add("PM_MATERIALCONTRACTVIEWCONFIG_ID");
|
||
returnCol.add("MATERIALCONTRACTVIEWID");
|
||
returnCol.add("RATEITEM");
|
||
returnCol.add("RATEVALUE");
|
||
|
||
def sql = "select PM_MATERIALCONTRACTVIEWCONFIG_ID,'"+PM_MATERIALCONTRACTREVIEW_ID+"' as MATERIALCONTRACTVIEWID,'' as MATERIALCONTRACTVIEWID_DISPLAY__,codevalue as rateitem,";
|
||
sql += " case when rowcount > 0 then b.ratevalue else c.ratevalue end as ratevalue from sys_enumerate a ";
|
||
sql += " left outer join PM_MATERIALCONTRACTVIEWCONFIG b on a.codevalue = b.rateitem and MATERIALCONTRACTVIEWID = '"+PM_MATERIALCONTRACTREVIEW_ID+"'";
|
||
sql += " left outer join (";
|
||
sql += " select count(rateitem) AS rowcount,MATERIALCONTRACTVIEWID from PM_MATERIALCONTRACTVIEWCONFIG where MATERIALCONTRACTVIEWID = '"+PM_MATERIALCONTRACTREVIEW_ID+"'";
|
||
sql += " Group by MATERIALCONTRACTVIEWID) as temp1 on b.MATERIALCONTRACTVIEWID = temp1.MATERIALCONTRACTVIEWID";
|
||
sql += " left OUTER JOIN PM_SUBCONTRACTBASICSCONFIG c on a.codevalue = c.rateitem"
|
||
sql += " where sys_enumeratetype_id = 'SUBCONTRACT_BASICSCONFIG'";
|
||
|
||
|
||
def list = GetServicesFunction.listSelectResultBySql(map,"PM_MATERIALCONTRACTVIEWCONFIG",sql,returnCol);
|
||
|
||
if(list!=null && list.size()>0){
|
||
for(i in 0..<list.size()){
|
||
ratelist.add(list[i].toMap());
|
||
}
|
||
}
|
||
|
||
bindField("MATERIALCONTRACTVIEWID",ratelist);
|
||
|
||
//将自定义的按钮添加至
|
||
def materialList = group.getField("MATERIALDETAILS");
|
||
|
||
materialList?.addButton(group.getField("SELECT"),0);
|
||
//导入按钮
|
||
def tie = new TableImportExport(materialList,"com.dsasp.pm.materialcontract.client.MaterialContractDetailImport");
|
||
tie.addImportButton(3);
|
||
tie.addExportButton(4);
|
||
|
||
//绑定合计按钮
|
||
def opertor = group.getField("BUTTON");
|
||
def vl = opertor?.parent;
|
||
Button button = new Button("计算合同价款");
|
||
vl.addComponent(button,0);
|
||
|
||
button.addClickListener(new Button.ClickListener() {
|
||
@Override
|
||
public void buttonClick(Button.ClickEvent event) {
|
||
def meterialDetails = getFieldValue("MATERIALDETAILS");
|
||
def summoney = new BigDecimal("0");;
|
||
if(meterialDetails != null && meterialDetails.size()>0){
|
||
meterialDetails?.each{
|
||
if(it.get('TOTAL') !=null && it.get('TOTAL') !=""){
|
||
summoney = summoney.add(new BigDecimal(it.get('TOTAL')))
|
||
}
|
||
}
|
||
}
|
||
bindField("CONTRACTMONEY",summoney);
|
||
}
|
||
}) |