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,12 +2,8 @@
// template_id : e7670207-9cf7-4db9-a452-884b58408b96
// template_name: 付款确认(五建定制)
// seq : 7
// label : HARD
// 硬 S3 原因 : 动态创建 Vaadin 组件
// 处置 : 原文保留,进人工排期(amis dialog/service 重写)
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
// label : FULL_AUTO
// 处置 : 全自动改写完成,直接入 P4 转换流水线
import com.vaadin.ui.Notification;
import com.vaadin.ui.Notification.Type;
import com.dsasp.server.common.exception.ValidationException;
@@ -15,7 +11,7 @@ import com.dsasp.server.common.util.HTTPClientUtils;
//选择付款申请按钮
group.getField("DRAFTLIST")?.addButton(group.getField("SELECT"),0);
addSubTableButton("DRAFTLIST", "SELECT", 0);
/** 页面必填项:客户号(默认)、单位编码(默认)、账号集合、交易类型(默认背书转让)、发查标识(宁波银行账号送 1:查询;非宁波银行账号送0:发查时向开户行同步票据信息)、
@@ -29,10 +25,9 @@ def custId = GetDefaultValueFunction.getConfigValue("com.dsasp.pm.bankWJ.custId"
def url = GetDefaultValueFunction.getConfigValue("com.dsasp.pm.bankWJ.IPpath");//客户ip接口访问地址
def transType = "4";//交易类型-背书转让
final Button search = new Button("查询");
search?.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
// 付款确认-批量转账付款
//将自定义的按钮添加至
addFieldButton("DETAILS", "查询", {
// 付款确认-批量转账付款
// 验证提醒
def content = "";
def corpCode = getFieldValue("CORPCODE");//客户在财资设置的四位单位编码
@@ -53,7 +48,7 @@ search?.addClickListener(new ClickListener() {
}
if(content !=null && content !=""){
//throw new ValidationException(content);
Notification.show(content,Type.ERROR_MESSAGE);
showToast(content,Type.ERROR_MESSAGE);
return;
}
@@ -83,18 +78,18 @@ search?.addClickListener(new ClickListener() {
def tempdataJson = HTTPClientUtils.jsonToString(tempparams);
def tempresponseBody = HTTPClientUtils.sendPostRequest(url,tempdataJson,null,null,null);
if(!tempresponseBody.contains("retCode")){
Notification.show("发查接口请求超时,请联系管理员",Type.ERROR_MESSAGE);
showToast("发查接口请求超时,请联系管理员",Type.ERROR_MESSAGE);
}
def tempreturnlist = HTTPClientUtils.jsonStringtoMap(tempresponseBody)?.get("data");
Console.debug("发查"+tempreturnlist);
if(!tempreturnlist || !tempreturnlist.get("retCode")){
Notification.show("发查接口请求异常,请联系管理员!",Type.ERROR_MESSAGE);
showToast("发查接口请求异常,请联系管理员!",Type.ERROR_MESSAGE);
return;
}
//得到付款结果
def tempretCode = tempreturnlist.get("retCode");
if(tempretCode && tempretCode != "0000" && tempreturnlist.get("retMsg")){
Notification.show(tempreturnlist.get("retMsg"),Type.ERROR_MESSAGE);
showToast(tempreturnlist.get("retMsg"),Type.ERROR_MESSAGE);
return;
}
}
@@ -109,20 +104,20 @@ search?.addClickListener(new ClickListener() {
def signdetails = [];
def responseBody = HTTPClientUtils.sendPostRequest(url,dataJson,null,null,null);
if(!responseBody.contains("retCode")){
Notification.show("查询接口请求超时,请联系管理员",Type.ERROR_MESSAGE);
showToast("查询接口请求超时,请联系管理员",Type.ERROR_MESSAGE);
}
def returnlist = HTTPClientUtils.jsonStringtoMap(responseBody)?.get("data");
Console.debug("查询"+returnlist);
if(!returnlist || !returnlist.get("retCode")){
//throw new ValidationException("接口请求异常,请联系管理员!");
Notification.show("接口请求异常,请联系管理员!",Type.ERROR_MESSAGE);
showToast("接口请求异常,请联系管理员!",Type.ERROR_MESSAGE);
return;
}
//得到付款结果
def retCode = returnlist.get("retCode");
if(retCode && retCode != "0000" && returnlist.get("retMsg")){
//throw new ValidationException(returnlist.get("retMsg"));
Notification.show(returnlist.get("retMsg"),Type.ERROR_MESSAGE);
showToast(returnlist.get("retMsg"),Type.ERROR_MESSAGE);
return;
}else if(retCode && retCode == "0000"){
//查询票据查询明细表中是否存在该信息,存在则删除后再新增,不存在则新增
@@ -158,8 +153,4 @@ search?.addClickListener(new ClickListener() {
}
};
bindField("DETAILS",signdetails);
}
});
//将自定义的按钮添加至
def details = group.getField("DETAILS");
details?.addButton(search, 0);
}, 0)