增加代码替换,PPT,excel文件的
This commit is contained in:
parent
da34bfdead
commit
03f30b7e8f
@ -91,6 +91,9 @@ public class HSSFUtils {
|
||||
mergeSheetAllRegion(tmpSheet, newExcelSheet);
|
||||
// 设置单元格列宽度
|
||||
// 获取最后一个单元格位置
|
||||
if (tmpSheet!=null) {
|
||||
|
||||
|
||||
if (tmpSheet.getRow(tmpSheet.getFirstRowNum()) == null) {
|
||||
|
||||
} else {
|
||||
@ -109,6 +112,7 @@ public class HSSFUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* #合并单元格
|
||||
|
||||
@ -132,7 +132,9 @@ public class UpFileExcelAndPptController {
|
||||
|
||||
// 查找并替换参数
|
||||
//这个是替换文件编码
|
||||
String file_number = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID = 'file_number'");
|
||||
//
|
||||
//
|
||||
String file_number = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID IN ('file_number','form_number')");
|
||||
if (StringUtils.isEmpty(file_number)){
|
||||
replaceParameter(sheet, "{{file_code}}", "");
|
||||
}else {
|
||||
@ -140,7 +142,7 @@ public class UpFileExcelAndPptController {
|
||||
replaceParameter(sheet, "{{file_code}}", file_number);
|
||||
}
|
||||
//这个是替换生效日期
|
||||
String file_date = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID = 'effective_date'");
|
||||
String file_date = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID IN('effective_date','form_effective_date') ");
|
||||
if (UtilString.isNotEmpty(file_date)){
|
||||
|
||||
replaceParameter(sheet, "{{file_date}}", file_date);
|
||||
@ -148,7 +150,8 @@ public class UpFileExcelAndPptController {
|
||||
replaceParameter(sheet, "{{file_date}}", "");
|
||||
}
|
||||
//这个是替换适用范围
|
||||
String fanwei = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID = 'application'");
|
||||
//
|
||||
String fanwei = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID in( 'application','form_Scope_application')");
|
||||
if (UtilString.isNotEmpty(fanwei)){
|
||||
|
||||
replaceParameter(sheet, "{{fanwei}}", fanwei);
|
||||
@ -172,7 +175,7 @@ public class UpFileExcelAndPptController {
|
||||
|
||||
XSSFSheet sheet_xd = workbook.getSheet("修订记录");
|
||||
|
||||
|
||||
replaceParameter(sheet_xd, "{{process_name}}", process_name);
|
||||
|
||||
// 获取参数所在的行和列
|
||||
int parameterRow = 3; // 假设参数在第二行
|
||||
@ -274,7 +277,7 @@ public class UpFileExcelAndPptController {
|
||||
|
||||
// 查找并替换参数
|
||||
//这个是替换文件编码
|
||||
String file_number = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID = 'file_number'");
|
||||
String file_number = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID IN('form_number','file_number')");
|
||||
if (StringUtils.isEmpty(file_number)){
|
||||
replaceParameter(sheet, "{{file_code}}", "");
|
||||
}else {
|
||||
@ -282,7 +285,7 @@ public class UpFileExcelAndPptController {
|
||||
replaceParameter(sheet, "{{file_code}}", file_number);
|
||||
}
|
||||
//这个是替换生效日期
|
||||
String file_date = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID = 'effective_date'");
|
||||
String file_date = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID IN('effective_date','form_effective_date')");
|
||||
if (UtilString.isNotEmpty(file_date)){
|
||||
|
||||
replaceParameter(sheet, "{{file_date}}", file_date);
|
||||
@ -290,7 +293,7 @@ public class UpFileExcelAndPptController {
|
||||
replaceParameter(sheet, "{{file_date}}", "");
|
||||
}
|
||||
//这个是替换适用范围
|
||||
String fanwei = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID = 'application'");
|
||||
String fanwei = DBSql.getString("select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '" + pl_uuid + "' and PROPERTYID in( 'application','form_Scope_application')");
|
||||
if (UtilString.isNotEmpty(fanwei)){
|
||||
|
||||
replaceParameter(sheet, "{{fanwei}}", fanwei);
|
||||
@ -313,7 +316,7 @@ public class UpFileExcelAndPptController {
|
||||
|
||||
|
||||
HSSFSheet sheet_xd = workbook.getSheet("修订记录");
|
||||
|
||||
replaceParameter(sheet_xd, "{{process_name}}", process_name);
|
||||
|
||||
|
||||
// 获取参数所在的行和列
|
||||
@ -403,7 +406,7 @@ public class UpFileExcelAndPptController {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else {
|
||||
}else if (name.endsWith(".pptx")||name.endsWith(".ppt")){
|
||||
UpfileModel model_old = new UpfileModel();
|
||||
model_old.setUuid(UUIDGener.getUUID());
|
||||
model_old.setPl_uuid("f9df56d7-a6b2-442c-9898-822619057493");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user