制度手册显示附件
This commit is contained in:
parent
dad440b539
commit
4e0971d550
@ -416,13 +416,46 @@ public class Report1Gener {
|
||||
}
|
||||
if (search != null && search.size() > 0) {
|
||||
//创建附件目录及复制附件
|
||||
// fileName = fileName + "_file";
|
||||
// file = new File(docPath, fileName);
|
||||
// if (!file.exists()) {
|
||||
// log.info("创建附件");
|
||||
// file.mkdir();
|
||||
// }
|
||||
fileName = fileName + "_file";
|
||||
file = new File(docPath, fileName);
|
||||
if (!file.exists()) {
|
||||
log.info("创建附件");
|
||||
file.mkdir();
|
||||
}
|
||||
}
|
||||
|
||||
//文件属性附件
|
||||
int fileIndex = 1;
|
||||
if (search != null && search.size() > 0) {
|
||||
// 复制附件
|
||||
for (UpfileModel upfileModel : search) {
|
||||
if (!"f".equals(upfileModel.getType())) {// 文件
|
||||
continue;
|
||||
}
|
||||
// 复制doccenter下的文件
|
||||
DCContext dcContext = null;
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||
if (dcProfile != null) {
|
||||
dcContext = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, "file", upfileModel.getPl_uuid(), upfileModel.getFileName());
|
||||
}
|
||||
File sourceFile = new UtilFile(dcContext.getFilePath());
|
||||
File targetFile = new UtilFile(file.toString() + File.separator + dcContext.getFileName());
|
||||
try {
|
||||
UtilFile.copyFile(sourceFile, targetFile);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("file_name", fileIndex + "." + upfileModel.getFileName());
|
||||
String link = fileName + File.separator + upfileModel.getFileName();
|
||||
object.put("link", link);
|
||||
fileTable.add(object);
|
||||
fileIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String controlShapeId = "";
|
||||
if (repositoryFileElements != null) {
|
||||
int index = 1;// 流程步骤序号
|
||||
@ -477,11 +510,11 @@ public class Report1Gener {
|
||||
// System.out.println(e);
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("file_name", upfileModel.getFileName());
|
||||
String link = fileName + File.separator + upfileModel.getFileName();
|
||||
object.put("link", link);
|
||||
fileTable.add(object);
|
||||
/*
|
||||
* JSONObject object = new JSONObject(); object.put("file_name",
|
||||
* upfileModel.getFileName()); String link = fileName + File.separator +
|
||||
* upfileModel.getFileName(); object.put("link", link); fileTable.add(object);
|
||||
*/
|
||||
}
|
||||
}
|
||||
if(shapeFileTable.size() == 0) {// 没有附件时给空值,不然使用office打开会解析错误
|
||||
@ -535,32 +568,29 @@ public class Report1Gener {
|
||||
setTableValueOfKPI("kpi", repositoryId, KPITable, relationFileMap);
|
||||
if (search != null && search.size() > 0) {
|
||||
// 复制附件
|
||||
// int index = 1;
|
||||
// for (UpfileModel upfileModel : search) {
|
||||
// if (!"f".equals(upfileModel.getType())) {// 文件
|
||||
// continue;
|
||||
// }
|
||||
// // 复制doccenter下的文件
|
||||
// DCContext dcContext = null;
|
||||
// DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||
// if (dcProfile != null) {
|
||||
// dcContext = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, "file", upfileModel.getPl_uuid(), upfileModel.getFileName());
|
||||
// }
|
||||
// File sourceFile = new UtilFile(dcContext.getFilePath());
|
||||
// File targetFile = new UtilFile(file.toString() + File.separator + dcContext.getFileName());
|
||||
// try {
|
||||
// UtilFile.copyFile(sourceFile, targetFile);
|
||||
// } catch (Exception e) {
|
||||
// System.out.println(e);
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// JSONObject object = new JSONObject();
|
||||
// object.put("file_name", index + "." + upfileModel.getFileName());
|
||||
// String link = fileName + File.separator + upfileModel.getFileName();
|
||||
// object.put("link", link);
|
||||
// fileTable.add(object);
|
||||
// index++;
|
||||
// }
|
||||
int index = 1;
|
||||
for (UpfileModel upfileModel : search) {
|
||||
if (!"f".equals(upfileModel.getType())) {// 文件
|
||||
continue;
|
||||
}
|
||||
// 复制doccenter下的文件
|
||||
/*
|
||||
* DCContext dcContext = null; DCPluginProfile dcProfile =
|
||||
* DCProfileManager.getDCProfile(CoEConstant.APP_ID,
|
||||
* CoeFileConstant.COE_UPFILE); if (dcProfile != null) { dcContext = new
|
||||
* DCContext(userContext, dcProfile, CoEConstant.APP_ID, "file",
|
||||
* upfileModel.getPl_uuid(), upfileModel.getFileName()); } File sourceFile = new
|
||||
* UtilFile(dcContext.getFilePath()); File targetFile = new
|
||||
* UtilFile(file.toString() + File.separator + dcContext.getFileName()); try {
|
||||
* UtilFile.copyFile(sourceFile, targetFile); } catch (Exception e) {
|
||||
* System.out.println(e); e.printStackTrace(); } JSONObject object = new
|
||||
* JSONObject(); object.put("file_name", index + "." +
|
||||
* upfileModel.getFileName()); String link = fileName + File.separator +
|
||||
* upfileModel.getFileName(); object.put("link", link);
|
||||
* System.err.println("==1==>"+object); fileTable.add(object);
|
||||
* System.err.println("==2==>"+fileTable); index++;
|
||||
*/
|
||||
}
|
||||
}
|
||||
JSONArray termTable = new JSONArray(); //术语定义Table
|
||||
// 属性特征 属性代码KEY
|
||||
@ -667,8 +697,8 @@ public class Report1Gener {
|
||||
|
||||
dataMap.put(OutputWordUtil.TABLE_REPOSITORY_SHAPE, repositoryShapeTable);
|
||||
dataMap.put("file_table", fileTable);
|
||||
// dataMap.put("file_table_count", fileTable.size());
|
||||
dataMap.put("file_table_count", 0);// 暂时置空
|
||||
dataMap.put("file_table_count", fileTable.size());
|
||||
//dataMap.put("file_table_count", 0);// 暂时置空
|
||||
dataMap.put(OutputWordUtil.TABLE_DANGER, dangerTable);
|
||||
dataMap.put(OutputWordUtil.TABLE_REGULATE, regulateTable);
|
||||
dataMap.put(OutputWordUtil.TABLE_KPI, KPITable);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user