Files
eip4-platform/tools/s3_rewriter/output/rewritten/745c9534-c755-4ef5-bc26-8b78a802ec4a/1.PARTIAL.groovy
zhengwr a711ecd8f0 F2-4(一): 修 XML 实体污染并重批重入库,固化标准入库器
- run_eval: PG xpath(...)::text 保留实体转义(< → &lt;),抽取后补 XML 预定义实体反转义
  (等价手册 §5.3 dom4j getText() 语义);293 个污染产物清零,Groovy 编译失败根因消除
- 缓存重建(源=eip4dev,1428 条:1 模板改名+1 新增脚本属数据演进);全量重跑
  497/30/86/815,自动化率 81.1% 守住 ≥80%
- 重大发现:同模板内脚本顺序在两次抽取间会交换((templateId,seq) 非稳定键,
  welfare 模板 seq1↔seq2 实锤)——重批后 onEvent seq 已与磁盘对齐,长期需内容哈希键(登记 F2-4)
- tools/page-schema-loader/load_page_schema.py:幂等标准入库器(etag=sha256,version 递增,
  仅允许 localhost 双库);本次双库各更新 756/幂等跳过 733,e2e 28/28 保持全绿
- 坑:mvn exec:java 的 -Dexec.args 引号空参会被吞导致参数错位(密码用占位符代替空串)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:27:38 +08:00

95 lines
3.2 KiB
Groovy

// === EIP4 P4 脚本迁移产出 ===
// template_id : 745c9534-c755-4ef5-bc26-8b78a802ec4a
// template_name: 验工月报区间
// seq : 1
// label : PARTIAL
// 余留模式 : 残留字段句柄链(未覆盖动词)
// 处置 : 大部分已自动改写,余留行人工补全(见作业单)
import com.dsasp.server.common.dataDic.service.POJOCRUDService;
//--设置年份下拉框默认值--
//获取组件(年份)
clearFieldData("YEAR");
def currentYear = GetDefaultValueFunction.currentYear();
//设置开始年份和结束年份
def startYear = currentYear - 4;
def endYear = currentYear + 11;
for(i in startYear..<endYear){
addFieldOption("YEAR", i, i.toString());
}
//--设置月份下拉框默认值--
clearFieldData("MONTH");
def currentMonth = GetDefaultValueFunction.currentMonth();
for(j in 1..12){
addFieldOption("MONTH", j, j.toString());
}
//--设置默认显示的年份、月份、开始日期、结束日期--
def startDate = group.getField("STARTDATE");
def endDate = group.getField("ENDDATE");
def monthReportMap = [:];
monthReportMap["PROJECTID"] = getFieldValue("PROJECTID");
monthReportMap[POJOCRUDService.ORDER] = " order by endDate DESC limit 1";
def monthReportList = GetServicesFunction.listSelectResult(monthReportMap,"PM_MREPORTINTERVAL");
if(monthReportList != null){
//设置年份、月份
def data = monthReportList.get(0).toMap();
def lastYear = data.get("YEAR");
def lastMonth = data.get("MONTH");
if(lastMonth == 12){
setFieldConvertedValue("YEAR", lastYear + 1);
setFieldConvertedValue("MONTH", 1);
}else{
setFieldConvertedValue("YEAR", lastYear);
setFieldConvertedValue("MONTH", lastMonth + 1);
}
//设置开始日期、结束日期
startDate = GetValueFunction.addDays(data.get("ENDDATE"),1);
endDate = GetValueFunction.addMonths(data.get("ENDDATE"),1);
if(GetValueFunction.monthOF(endDate) == 12){
endDate = GetValueFunction.lastDateOfMonth(endDate);
}
bindField("STARTDATE", startDate);
bindField("ENDDATE", endDate);
setFieldReadOnly("STARTDATE",true);
}else{
def projectList = GetServicesFunction.listSelectResult(["PM_PROJECT_ID":getFieldValue("PROJECTID")],"PM_PROJECT");
if(projectList != null){
def projectMap = projectList.get(0).toMap();
if(projectMap.get("ACTUALSTARTDATE") != null){
setFieldConvertedValue("YEAR", GetValueFunction.yearOf(projectMap.get("ACTUALSTARTDATE")));
setFieldConvertedValue("MONTH", GetValueFunction.monthOF(projectMap.get("ACTUALSTARTDATE")));
startDate = projectMap.get("ACTUALSTARTDATE");
endDate = GetValueFunction.addMonths(projectMap.get("ACTUALSTARTDATE"),1);
endDate = GetValueFunction.addDays(endDate,-1);
bindField("STARTDATE", startDate);
bindField("ENDDATE", endDate);
}
else{
setFieldConvertedValue("YEAR", currentYear);
setFieldConvertedValue("MONTH", currentMonth);
}
}else{
setFieldConvertedValue("YEAR", currentYear);
setFieldConvertedValue("MONTH", currentMonth);
}
setFieldReadOnly("STARTDATE",false);
}