F2-3:运行时动词闭包子指令机制 + staging 晋级(FULL_AUTO 507/HARD 74)

ScriptFacade:addFieldButton 扩第3参闭包(onClick 子指令数组)+ showConfirm
新动词,服务端急切求值闭包,子指令收进子缓冲,输出嵌套指令 JSON。
前端 scriptCommands.ts/registerReplayAction.ts:处理 addButton onClick/
confirmDialog onOk 嵌套重放,onClickActions/onOkActions 透传给 amis。
ScriptFacadeTest 补 7 个正反例(24/24 全绿)。
staging 晋级:FULL_AUTO 507(+10)/HARD 74(-12)/自动化率 82.7%,
双库各更新 801 条,e2e 30/30 全绿。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 22:24:08 +08:00
parent bc23909feb
commit 43fdfd1830
190 changed files with 2625 additions and 2454 deletions

View File

@@ -2,14 +2,11 @@
// template_id : 86c05eb5-753d-46e5-b958-cdbcefe7eabc
// template_name: 销项税发票
// seq : 6
// label : HARD
// 硬 S3 原因 : 动态创建 Vaadin 组件
// 处置 : 原文保留,进人工排期(amis dialog/service 重写)
// label : PARTIAL
// 余留模式 : 数据源 addItem(非标准选项 idiom); 残留字段句柄链(未覆盖动词)
// 处置 : 大部分已自动改写,余留行人工补全(见作业单)
import com.dsasp.server.common.exception.ValidationException;
import com.dsasp.server.common.util.HTTPClientUtils;
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;
@@ -20,13 +17,12 @@ def transformnum (moneyStr) {
}
def invoicelist = group.getField("INVOICELIST");
def document = group.getField("SELECT");
final Button cb = new Button("识别");
cb?.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
Object fplists = document?.getValue();
//将自定义的按钮添加至
addFieldButton("INVOICELIST", "识别", {
Object fplists = getFieldValue("SELECT");
def documentfp = [];
for (int i = 0; i < fplists.size(); i++) {
def item = fplists.get(i);
@@ -36,7 +32,7 @@ cb?.addClickListener(new ClickListener() {
};
// Console.debug(documentfp);
if (documentfp == null || documentfp.size()==0){
Notification.show("请先上传发票信息!", Type.ERROR_MESSAGE);
showToast("请先上传发票信息!", Type.ERROR_MESSAGE);
return;
};
if(documentfp && documentfp.size()>0){
@@ -136,16 +132,16 @@ cb?.addClickListener(new ClickListener() {
};
if(fplist!=null){
def flag = true;
if(invoicelist.getValue() && invoicelist.getValue().size()>0){
for (int j = 0; j < invoicelist.getValue().size(); j++) {
def tempitem = invoicelist.getValue().get(j);
if(getFieldValue("INVOICELIST") && getFieldValue("INVOICELIST").size()>0){
for (int j = 0; j < getFieldValue("INVOICELIST").size(); j++) {
def tempitem = getFieldValue("INVOICELIST").get(j);
if((fplist.get("INVOICENO")==null || (fplist.get("INVOICENO")!=null && tempitem.get("INVOICENO") == fplist.get("INVOICENO"))) && (fplist.get("INVOICECODE")==null || (fplist.get("INVOICECODE")!=null && tempitem.get("INVOICECODE") == fplist.get("INVOICECODE")))){
flag = false;;
}
};
};
if(flag){
invoicelist.addItem(fplist);
group.getField("INVOICELIST").addItem(fplist);
};
}
}
@@ -160,12 +156,8 @@ cb?.addClickListener(new ClickListener() {
}
}
if(message.trim()!=""){
Notification.show(message, Type.ERROR_MESSAGE);
showToast(message, Type.ERROR_MESSAGE);
}
}
};
});
//将自定义的按钮添加至
invoicelist?.addButton(cb, 0);
}, 0)