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,9 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// template_name: 建造师注册证
|
||||
// seq : 1
|
||||
// label : FULL_AUTO
|
||||
// 处置 : 全自动改写完成,直接入 P4 转换流水线
|
||||
def searchMap=[:];
|
||||
searchMap["SYS_ENUMERATETYPE_ID"] = 'HR_EMPLOYEE_STATUS';
|
||||
setFieldFilter("JOBSTATUSS", searchMap);
|
||||
@@ -0,0 +1,15 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// template_name: 建造师注册证
|
||||
// seq : 2
|
||||
// label : FULL_AUTO
|
||||
// 处置 : 全自动改写完成,直接入 P4 转换流水线
|
||||
//读取组件
|
||||
|
||||
|
||||
|
||||
|
||||
//为组件赋值
|
||||
setFieldConvertedValue("ISAPPROVAL", 1);
|
||||
setFieldConvertedValue("ISMAINITEMS", 0);
|
||||
setFieldConvertedValue("VALIDDATE", GetDefaultValueFunction.currentDate());
|
||||
@@ -0,0 +1,69 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// template_name: 建造师注册证
|
||||
// seq : 3
|
||||
// label : NO_S3
|
||||
// 处置 : 无 S3 模式,原样进 P4
|
||||
|
||||
if(item["USERMODETEXT"]=="已注销"){//所选记录已经是确认状态!
|
||||
enableButton("增项注册",false);
|
||||
enableButton("延期注册",false);
|
||||
enableButton("修改",false);
|
||||
enableButton("借用登记",false);
|
||||
enableButton("归还登记",false);
|
||||
enableButton("继续教育",false);
|
||||
|
||||
enableButton("添加",true);
|
||||
enableButton("删除",true);
|
||||
enableButton("查看",true);
|
||||
}else if(item["USERMODETEXT"]=="已转出"){
|
||||
enableButton("增项注册",false);
|
||||
enableButton("延期注册",false);
|
||||
enableButton("修改",false);
|
||||
enableButton("借用登记",false);
|
||||
enableButton("归还登记",false);
|
||||
enableButton("继续教育",false);
|
||||
|
||||
enableButton("添加",true);
|
||||
enableButton("删除",true);
|
||||
enableButton("查看",true);
|
||||
}else if(item["USERMODETEXT"]=="使用中"){
|
||||
enableButton("增项注册",true);
|
||||
enableButton("延期注册",true);
|
||||
enableButton("修改",true);
|
||||
enableButton("借用登记",false);
|
||||
enableButton("归还登记",true);
|
||||
enableButton("继续教育",true);
|
||||
|
||||
enableButton("添加",true);
|
||||
enableButton("删除",false);
|
||||
enableButton("查看",true);
|
||||
}else if(item["USERMODETEXT"]=="空闲"){
|
||||
enableButton("增项注册",true);
|
||||
enableButton("延期注册",true);
|
||||
enableButton("修改",true);
|
||||
enableButton("借用登记",true);
|
||||
enableButton("归还登记",false);
|
||||
enableButton("继续教育",true);
|
||||
|
||||
enableButton("添加",true);
|
||||
enableButton("删除",true);
|
||||
enableButton("查看",true);
|
||||
}else{
|
||||
enableButton("增项注册",true);
|
||||
enableButton("延期注册",true);
|
||||
enableButton("修改",true);
|
||||
enableButton("借用登记",false);
|
||||
enableButton("归还登记",false);
|
||||
enableButton("继续教育",false);
|
||||
|
||||
enableButton("添加",true);
|
||||
enableButton("删除",false);
|
||||
enableButton("查看",true);
|
||||
}
|
||||
|
||||
def dow = GetDefaultValueFunction.getConfigValue("com.dsasp.pm.projectbasemanager.ISUSERCARDWINDOW")== null?1:Integer.parseInt(GetDefaultValueFunction.getConfigValue("com.dsasp.pm.projectbasemanager.ISUSERCARDWINDOW"));
|
||||
if(dow==1){//1:启用(通过招投标和总包合同备案控制证书状态)。
|
||||
enableButton("借用登记",false);
|
||||
enableButton("归还登记",false);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// template_name: 建造师注册证
|
||||
// seq : 4
|
||||
// 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.vaadin.data.Property.ValueChangeListener;
|
||||
import com.vaadin.data.Property.ValueChangeEvent;
|
||||
import com.dsasp.client.viewframework.listener.ConfirmDialogListener;
|
||||
|
||||
import com.vaadin.ui.Link;
|
||||
import com.vaadin.server.ExternalResource;
|
||||
import com.vaadin.ui.Label;
|
||||
|
||||
|
||||
final def professionals = group.getField("PROFESSIONALS");
|
||||
final Button but = new Button("注销");
|
||||
|
||||
final Object table = professionals?.table;
|
||||
table?.setImmediate(true);
|
||||
|
||||
|
||||
final group1 = group;
|
||||
but?.addClickListener(new ClickListener() {
|
||||
public void buttonClick(ClickEvent event) {
|
||||
def id = table?.getValue();
|
||||
if (id == null){
|
||||
Notification.show("请选择一条记录!", Type.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
def hr_con_id = id?.getField("HR_CONSTRUCTORREGISTERED_ID")?.getValue();
|
||||
def islogout = id?.getField("ISLOGOUT")?.getValue();
|
||||
if(islogout){
|
||||
Notification.show("已经注销!", Type.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
final pojo = GetServicesFunction.loadPOJO(hr_con_id,"HR_CONSTRUCTORREGISTERED",false);
|
||||
if(pojo!=null){
|
||||
if(pojo.get_Value("ISMAINITEMS")){
|
||||
Notification.show("如要注销主项注册专业,请注销建造师注册证!", Type.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
def updateMap=[:];
|
||||
updateMap["HR_CONSTRUCTORREGISTERED_ID"] = hr_con_id;
|
||||
updateMap["ISLOGOUT"] = 1;
|
||||
GetServicesFunction.excuteFlow(updateMap,"HR_CONSTRUCTORREGISTERED_LOGOUT");
|
||||
|
||||
|
||||
id?.getField("ISLOGOUT")?.setImmediate(true);
|
||||
setFieldReadOnly(id,"ISLOGOUT",false);
|
||||
|
||||
id?.getField("ISLOGOUT")?.setValue(true);
|
||||
|
||||
setFieldReadOnly(id,"ISLOGOUT",true);
|
||||
professionals.setValue(new ArrayList(professionals.getValue()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
professionals?.addButton(but,0);
|
||||
|
||||
professionals?.showAddButton(false);
|
||||
professionals?.showDeleteButton(false);
|
||||
@@ -0,0 +1,32 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// template_name: 建造师注册证
|
||||
// seq : 5
|
||||
// label : NO_S3
|
||||
// 处置 : 无 S3 模式,原样进 P4
|
||||
//证书ID
|
||||
def CARDID=getFieldValue('HR_CONSTRUCTORCARD_ID');
|
||||
//加载人员证书登记
|
||||
//BORROWUSE 借用人
|
||||
//借用日期 BORROWDATE
|
||||
//预计归还日期 PREDICTRETURNDATE
|
||||
//实际归还日期 RETURNDATE
|
||||
//存放地点 DEPOSITPLACE
|
||||
def con=[];
|
||||
con.add("BORROWUSE");
|
||||
con.add("BORROWDATE");
|
||||
con.add("PREDICTRETURNDATE");
|
||||
con.add("RETURNDATE");
|
||||
con.add("DEPOSITPLACE");
|
||||
con.add("BORROWREASON");
|
||||
def Map=[:];
|
||||
def result=[];
|
||||
def sql="select BORROWUSE,BORROWDATE,PREDICTRETURNDATE,RETURNDATE,DEPOSITPLACE,BORROWREASON from HR_CARDBORROWREGISTER ";
|
||||
sql+="where CARDID='"+CARDID+"'";
|
||||
def list=GetServicesFunction.listSelectResultBySql(Map,"HR_CARDBORROWREGISTER",sql,con);
|
||||
if(list!=null&&list.size()>0){
|
||||
for(i in 0..<list.size()){
|
||||
result.add(list[i].toMap());
|
||||
}
|
||||
}
|
||||
bindField("LIUZHUAN",result);
|
||||
@@ -0,0 +1,18 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// template_name: 建造师注册证
|
||||
// seq : 6
|
||||
// label : HARD
|
||||
// 硬 S3 原因 : 动态创建 Vaadin 组件
|
||||
// 处置 : 原文保留,进人工排期(amis dialog/service 重写)
|
||||
import com.vaadin.ui.Link;
|
||||
import com.vaadin.server.ExternalResource;
|
||||
import com.vaadin.ui.Label;
|
||||
|
||||
def url = group.getField("CARDURL");
|
||||
if(url.getValue()!= null){
|
||||
Link link = new Link("信息链接", new ExternalResource(url.getValue()));
|
||||
link.setTargetName("_blank");
|
||||
url.setVisible(false);
|
||||
url.parent?.addComponent(link);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// 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;
|
||||
import com.vaadin.ui.Notification;
|
||||
import com.vaadin.ui.Notification.Type;
|
||||
import com.vaadin.data.Property.ValueChangeListener;
|
||||
import com.vaadin.data.Property.ValueChangeEvent;
|
||||
import com.dsasp.client.viewframework.listener.ConfirmDialogListener;
|
||||
|
||||
import com.vaadin.ui.Link;
|
||||
import com.vaadin.server.ExternalResource;
|
||||
import com.vaadin.ui.Label;
|
||||
|
||||
def url = group.getField("CARDURL");
|
||||
if(url.getValue()!= null){
|
||||
Link link = new Link("信息链接", new ExternalResource(url.getValue()));
|
||||
link.setTargetName("_blank");
|
||||
|
||||
url.setVisible(false);
|
||||
url.parent?.addComponent(link);
|
||||
|
||||
}
|
||||
|
||||
|
||||
final def professionals = group.getField("PROFESSIONALS");
|
||||
final Button but = new Button("注销");
|
||||
|
||||
final Object table = professionals?.table;
|
||||
table?.setImmediate(true);
|
||||
|
||||
|
||||
final group1 = group;
|
||||
but?.addClickListener(new ClickListener() {
|
||||
public void buttonClick(ClickEvent event) {
|
||||
def id = table?.getValue();
|
||||
if (id == null){
|
||||
Notification.show("请选择一条记录!", Type.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
def hr_con_id = id?.getField("HR_CONSTRUCTORREGISTERED_ID")?.getValue();
|
||||
def islogout = id?.getField("ISLOGOUT")?.getValue();
|
||||
if(islogout){
|
||||
Notification.show("已经注销!", Type.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
final pojo = GetServicesFunction.loadPOJO(hr_con_id,"HR_CONSTRUCTORREGISTERED",false);
|
||||
if(pojo!=null){
|
||||
if(pojo.get_Value("ISMAINITEMS")){
|
||||
Notification.show("如要注销主项注册专业,请注销建造师注册证!", Type.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
def updateMap=[:];
|
||||
updateMap["HR_CONSTRUCTORREGISTERED_ID"] = hr_con_id;
|
||||
updateMap["ISLOGOUT"] = 1;
|
||||
GetServicesFunction.excuteFlow(updateMap,"HR_CONSTRUCTORREGISTERED_LOGOUT");
|
||||
|
||||
|
||||
id?.getField("ISLOGOUT")?.setImmediate(true);
|
||||
setFieldReadOnly(id,"ISLOGOUT",false);
|
||||
|
||||
id?.getField("ISLOGOUT")?.setValue(true);
|
||||
|
||||
setFieldReadOnly(id,"ISLOGOUT",true);
|
||||
professionals.setValue(new ArrayList(professionals.getValue()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
professionals?.addButton(but,0);
|
||||
|
||||
professionals?.showAddButton(false);
|
||||
professionals?.showDeleteButton(false);
|
||||
@@ -0,0 +1,7 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// template_name: 建造师注册证
|
||||
// seq : 8
|
||||
// label : NO_S3
|
||||
// 处置 : 无 S3 模式,原样进 P4
|
||||
page.setDataFilter(["HR_CONSTRUCTORCARD_ID":HR_CONSTRUCTORCARD_ID]);
|
||||
@@ -0,0 +1,18 @@
|
||||
// === EIP4 P4 脚本迁移产出 ===
|
||||
// template_id : 2cceb83c-4079-43e4-b7b7-c395fd68cbbc
|
||||
// template_name: 建造师注册证
|
||||
// seq : 9
|
||||
// label : NO_S3
|
||||
// 处置 : 无 S3 模式,原样进 P4
|
||||
def searchMap=[:];
|
||||
def solvelist=[];
|
||||
searchMap["SYS_ENUMERATETYPE_ID"] = 'HR_EMPLOYEE_STATUS';
|
||||
//searchMap["CODEDES"]=["处理中","已派工"];
|
||||
searchMap["CODEVALUE"]=[1,4,5];
|
||||
def list = GetServicesFunction.listSelectResult(searchMap,"SYS_ENUMERATE");
|
||||
if(list!=null && list.size()>0){
|
||||
list.each{
|
||||
solvelist.add(it.get_ID());
|
||||
}
|
||||
}
|
||||
bindField("JOBSTATUSS",solvelist);
|
||||
Reference in New Issue
Block a user