流程手册/制度手册调整相关支持文件获取方式
This commit is contained in:
parent
daf762aeeb
commit
110bcc04df
@ -1,8 +1,16 @@
|
|||||||
package com.actionsoft.apps.coe.pal.output.pr.report1;
|
package com.actionsoft.apps.coe.pal.output.pr.report1;
|
||||||
|
|
||||||
|
import static com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil.specialCharTransfer;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||||
import com.actionsoft.apps.coe.pal.output.pr.util.PrReportComment;
|
import com.actionsoft.apps.coe.pal.output.pr.util.PrReportComment;
|
||||||
@ -16,7 +24,6 @@ import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
|||||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
|
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.realtime.model.ListenEvent;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
|
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.DesignerShapeRelationDao;
|
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.DesignerShapeRelationDao;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel;
|
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel;
|
||||||
@ -34,6 +41,7 @@ import com.actionsoft.bpms.server.DispatcherRequest;
|
|||||||
import com.actionsoft.bpms.server.UserContext;
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
import com.actionsoft.bpms.server.fs.DCContext;
|
import com.actionsoft.bpms.server.fs.DCContext;
|
||||||
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
||||||
|
import com.actionsoft.bpms.util.DBSql;
|
||||||
import com.actionsoft.bpms.util.UtilDate;
|
import com.actionsoft.bpms.util.UtilDate;
|
||||||
import com.actionsoft.bpms.util.UtilFile;
|
import com.actionsoft.bpms.util.UtilFile;
|
||||||
import com.actionsoft.bpms.util.UtilString;
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
@ -43,11 +51,6 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
|
||||||
import static com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil.specialCharTransfer;
|
|
||||||
import static com.actionsoft.apps.coe.pal.pal.repository.constant.CoeProcessLevelConstant.LINK_PREFIX;
|
|
||||||
import static com.alibaba.druid.util.FnvHash.Constants.NVARCHAR2;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成流程手册-步骤横表横表的入口
|
* 生成流程手册-步骤横表横表的入口
|
||||||
*
|
*
|
||||||
@ -490,52 +493,87 @@ public class Report1Gener {
|
|||||||
|
|
||||||
|
|
||||||
//支持文件
|
//支持文件
|
||||||
JSONArray supportfiles = new JSONArray(); //组织职责Table
|
JSONArray supportfiles = new JSONArray();
|
||||||
List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "support_files");
|
try {
|
||||||
|
int count = 0;
|
||||||
|
String sql = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '"+repositoryModel.getId()+"' and PROPERTYID = 'support_files'";
|
||||||
relationList.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText));
|
String relatFileJson = DBSql.getString(sql);
|
||||||
|
if(UtilString.isNotEmpty(relatFileJson)) {
|
||||||
int index = 0;
|
JSONObject parseObject = JSONObject.parseObject(relatFileJson);
|
||||||
for (DesignerShapeRelationModel relation : relationList) {
|
String fileNames = parseObject.getString("relationShapeText");
|
||||||
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
if(UtilString.isNotEmpty(fileNames)) {
|
||||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
String[] names = fileNames.split(",");
|
||||||
if (model != null) {
|
for (String name : names) {
|
||||||
index++;
|
count++;
|
||||||
String name = model.getName();
|
JSONObject tmp = new JSONObject();
|
||||||
JSONObject tmp = new JSONObject();
|
tmp.put("name", name);
|
||||||
tmp.put("name", name);
|
tmp.put("desc", count);
|
||||||
tmp.put("desc", index);
|
supportfiles.add(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
supportfiles.add(tmp);
|
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* List<DesignerShapeRelationModel> relationList =
|
||||||
|
* DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "",
|
||||||
|
* "support_files");
|
||||||
|
* relationList.sort(Comparator.comparing(DesignerShapeRelationModel::
|
||||||
|
* getShapeText)); int index = 0; for (DesignerShapeRelationModel relation :
|
||||||
|
* relationList) { String relationFileId = relation.getRelationFileId();//
|
||||||
|
* 支持或相关文件的ID PALRepositoryModel model =
|
||||||
|
* PALRepositoryCache.getCache().get(relationFileId); if (model != null) {
|
||||||
|
* index++; String name = model.getName(); JSONObject tmp = new JSONObject();
|
||||||
|
* tmp.put("name", name); tmp.put("desc", index);
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* supportfiles.add(tmp); } }
|
||||||
|
*/
|
||||||
|
|
||||||
//相关文件 R_relevant_flies
|
//相关文件 R_relevant_flies
|
||||||
JSONArray relevant_flies = new JSONArray(); //组织职责Table
|
JSONArray relevant_flies = new JSONArray();
|
||||||
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "R_relevant_flies");
|
try {
|
||||||
|
int count = 0;
|
||||||
relationList2.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText));
|
String sql = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '"+repositoryModel.getId()+"' and PROPERTYID = 'R_relevant_flies'";
|
||||||
|
String relatFileJson = DBSql.getString(sql);
|
||||||
int count = 0;
|
if(UtilString.isNotEmpty(relatFileJson)) {
|
||||||
for (DesignerShapeRelationModel relation : relationList2) {
|
JSONObject parseObject = JSONObject.parseObject(relatFileJson);
|
||||||
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
String fileNames = parseObject.getString("relationShapeText");
|
||||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
if(UtilString.isNotEmpty(fileNames)) {
|
||||||
if (model != null) {
|
String[] names = fileNames.split(",");
|
||||||
count++;
|
for (String name : names) {
|
||||||
String name = model.getName();
|
count++;
|
||||||
JSONObject tmp = new JSONObject();
|
JSONObject tmp = new JSONObject();
|
||||||
tmp.put("name", name);
|
tmp.put("name", name);
|
||||||
tmp.put("desc", count);
|
tmp.put("desc", count);
|
||||||
|
relevant_flies.add(tmp);
|
||||||
relevant_flies.add(tmp);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* List<DesignerShapeRelationModel> relationList2 =
|
||||||
|
* DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "",
|
||||||
|
* "R_relevant_flies");
|
||||||
|
* relationList2.sort(Comparator.comparing(DesignerShapeRelationModel::
|
||||||
|
* getShapeText)); int count = 0; for (DesignerShapeRelationModel relation :
|
||||||
|
* relationList2) { String relationFileId = relation.getRelationFileId();//
|
||||||
|
* 支持或相关文件的ID PALRepositoryModel model =
|
||||||
|
* PALRepositoryCache.getCache().get(relationFileId); if (model != null) {
|
||||||
|
* count++; String name = model.getName(); JSONObject tmp = new JSONObject();
|
||||||
|
* tmp.put("name", name); tmp.put("desc", count); //relevant_flies.add(tmp); } }
|
||||||
|
*/
|
||||||
|
|
||||||
// 修订记录
|
// 修订记录
|
||||||
dataMap.put("version_history_table", getVersionHistoryTable(repositoryModel));
|
dataMap.put("version_history_table", getVersionHistoryTable(repositoryModel));
|
||||||
|
|
||||||
// 附则处理
|
// 附则处理
|
||||||
List<String> T_supplementary_articles_table = new ArrayList<>();
|
List<String> T_supplementary_articles_table = new ArrayList<>();
|
||||||
String [] tmp = dataMap.getString("pl_T_supplementary_articles").split("\n");
|
String [] tmp = dataMap.getString("pl_T_supplementary_articles").split("\n");
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import com.actionsoft.bpms.server.DispatcherRequest;
|
|||||||
import com.actionsoft.bpms.server.UserContext;
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
import com.actionsoft.bpms.server.fs.DCContext;
|
import com.actionsoft.bpms.server.fs.DCContext;
|
||||||
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
||||||
|
import com.actionsoft.bpms.util.DBSql;
|
||||||
import com.actionsoft.bpms.util.UtilDate;
|
import com.actionsoft.bpms.util.UtilDate;
|
||||||
import com.actionsoft.bpms.util.UtilFile;
|
import com.actionsoft.bpms.util.UtilFile;
|
||||||
import com.actionsoft.bpms.util.UtilString;
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
@ -244,12 +245,12 @@ public class Report1Gener {
|
|||||||
String path = dcContextpdf.getPath();
|
String path = dcContextpdf.getPath();
|
||||||
String fileName = dcContextpdf.getFileName();
|
String fileName = dcContextpdf.getFileName();
|
||||||
//创建实例,加载doc测试文档
|
//创建实例,加载doc测试文档
|
||||||
|
String s = path+fileName;
|
||||||
com.spire.doc.Document docs = new com.spire.doc.Document();
|
com.spire.doc.Document docs = new com.spire.doc.Document();
|
||||||
docs.loadFromFile("/"+path+fileName);
|
docs.loadFromFile(path+fileName);
|
||||||
//保存为xml格式
|
//保存为xml格式
|
||||||
//nas/awsinst/doccenter/com.actionsoft.apps.coe.pal/COE_Upfile/03e55104-3ac6-4298-8a9f-6d1c03cad06b/obj_2ebe57d0f9b84bdeb7cf697945d3c5ab/液态奶事业部食品安全委员会运行管理规定.doc
|
|
||||||
String substring = fileName.substring(0, fileName.lastIndexOf(".doc"));
|
String substring = fileName.substring(0, fileName.lastIndexOf(".doc"));
|
||||||
docs.saveToFile("/"+path+substring+".xml",FileFormat.Word_ML);
|
docs.saveToFile(path+substring+".xml",FileFormat.Word_ML);
|
||||||
dcContextpdf = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), substring+".xml");
|
dcContextpdf = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), substring+".xml");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -689,46 +690,87 @@ public class Report1Gener {
|
|||||||
|
|
||||||
|
|
||||||
//支持文件
|
//支持文件
|
||||||
JSONArray support_files = new JSONArray(); //组织职责Table
|
JSONArray support_files = new JSONArray();
|
||||||
List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "support_files");
|
try {
|
||||||
|
int count = 0;
|
||||||
relationList.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText));
|
String sql = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '"+repositoryModel.getId()+"' and PROPERTYID = 'support_files'";
|
||||||
|
String relatFileJson = DBSql.getString(sql);
|
||||||
int index = 0;
|
if(UtilString.isNotEmpty(relatFileJson)) {
|
||||||
for (DesignerShapeRelationModel relation : relationList) {
|
JSONObject parseObject = JSONObject.parseObject(relatFileJson);
|
||||||
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
String fileNames = parseObject.getString("relationShapeText");
|
||||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
if(UtilString.isNotEmpty(fileNames)) {
|
||||||
if (model != null) {
|
String[] names = fileNames.split(",");
|
||||||
index++;
|
for (String name : names) {
|
||||||
String name = model.getName();
|
count++;
|
||||||
JSONObject tmp = new JSONObject();
|
JSONObject tmp = new JSONObject();
|
||||||
tmp.put("name", name);
|
tmp.put("name", name);
|
||||||
tmp.put("desc", index);
|
tmp.put("desc", count);
|
||||||
support_files.add(tmp);
|
support_files.add(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* JSONArray support_files = new JSONArray(); //组织职责Table
|
||||||
|
* List<DesignerShapeRelationModel> relationList =
|
||||||
|
* DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "",
|
||||||
|
* "support_files");
|
||||||
|
*
|
||||||
|
* relationList.sort(Comparator.comparing(DesignerShapeRelationModel::
|
||||||
|
* getShapeText));
|
||||||
|
*
|
||||||
|
* int index = 0; for (DesignerShapeRelationModel relation : relationList) {
|
||||||
|
* String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
||||||
|
* PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
||||||
|
* if (model != null) { index++; String name = model.getName(); JSONObject tmp =
|
||||||
|
* new JSONObject(); tmp.put("name", name); tmp.put("desc", index);
|
||||||
|
* support_files.add(tmp); } }
|
||||||
|
*/
|
||||||
|
|
||||||
//相关文件 related_files
|
//相关文件 related_files
|
||||||
JSONArray related_files = new JSONArray(); //组织职责Table
|
JSONArray related_files = new JSONArray();
|
||||||
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "related_files");
|
try {
|
||||||
|
int count = 0;
|
||||||
|
String sql = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '"+repositoryModel.getId()+"' and PROPERTYID = 'relevant_flies'";
|
||||||
relationList2.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText));
|
String relatFileJson = DBSql.getString(sql);
|
||||||
|
if(UtilString.isNotEmpty(relatFileJson)) {
|
||||||
int count = 0;
|
JSONObject parseObject = JSONObject.parseObject(relatFileJson);
|
||||||
for (DesignerShapeRelationModel relation : relationList2) {
|
String fileNames = parseObject.getString("relationShapeText");
|
||||||
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
if(UtilString.isNotEmpty(fileNames)) {
|
||||||
//System.err.println("生成手册时相关文件id=======>"+relationFileId);
|
String[] names = fileNames.split(",");
|
||||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
for (String name : names) {
|
||||||
if (model != null) {
|
count++;
|
||||||
count++;
|
JSONObject tmp = new JSONObject();
|
||||||
String name = model.getName();
|
tmp.put("name", name);
|
||||||
JSONObject tmp = new JSONObject();
|
tmp.put("desc", count);
|
||||||
tmp.put("name", name);
|
related_files.add(tmp);
|
||||||
tmp.put("desc", count);
|
}
|
||||||
related_files.add(tmp);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* JSONArray related_files = new JSONArray(); //组织职责Table
|
||||||
|
* List<DesignerShapeRelationModel> relationList2 =
|
||||||
|
* DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "",
|
||||||
|
* "related_files");
|
||||||
|
* relationList2.sort(Comparator.comparing(DesignerShapeRelationModel::
|
||||||
|
* getShapeText)); int count = 0; for (DesignerShapeRelationModel relation :
|
||||||
|
* relationList2) { String relationFileId = relation.getRelationFileId();//
|
||||||
|
* 支持或相关文件的ID //System.err.println("生成手册时相关文件id=======>"+relationFileId);
|
||||||
|
* PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
||||||
|
* if (model != null) { count++; String name = model.getName(); JSONObject tmp =
|
||||||
|
* new JSONObject(); tmp.put("name", name); tmp.put("desc", count);
|
||||||
|
* related_files.add(tmp); } }
|
||||||
|
*/
|
||||||
|
|
||||||
//术语
|
//术语
|
||||||
dataMap.put("term_table", termTable);//table4
|
dataMap.put("term_table", termTable);//table4
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user