流程手册 制度 表格开发完成。
This commit is contained in:
parent
d101790c41
commit
c3d516f7ae
@ -15,6 +15,7 @@ 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.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
|
||||
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.model.DesignerShapeRelationModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
||||
@ -40,11 +41,13 @@ 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;
|
||||
|
||||
|
||||
/**
|
||||
* 生成流程手册-步骤横表横表的入口
|
||||
*
|
||||
*
|
||||
* @author zhangming
|
||||
*/
|
||||
public class Report1Gener {
|
||||
@ -58,12 +61,12 @@ public class Report1Gener {
|
||||
|
||||
/**
|
||||
* 生成文件
|
||||
*
|
||||
*
|
||||
* @param model OutputTaskModel对象
|
||||
* @param wizardJsonData 向导收集的Json参数(targetFiles、relationFiles、options...)
|
||||
* @param dcContext 要生成报告的DC目录对象,已准备好
|
||||
* @return 将文件生成到output目录下,返回状态
|
||||
*
|
||||
*
|
||||
* @see PlatformAPIImpl#getDefaultLanguage()
|
||||
* @see PlatformAPIImpl#getlanguages()
|
||||
*/
|
||||
@ -106,7 +109,7 @@ public class Report1Gener {
|
||||
*/
|
||||
private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData) {
|
||||
String[] repositoryIds = wizardJsonData.getString("targetFileId").split(",");
|
||||
|
||||
|
||||
String reportName = wizardJsonData.getString("reportNameIsItName"); //页面上设计的文件命名规则
|
||||
Map<String, Integer> indexMap = new HashMap<String, Integer>();
|
||||
for (String repositoryId : repositoryIds) {
|
||||
@ -140,7 +143,7 @@ public class Report1Gener {
|
||||
String reportNameValue = reportName;
|
||||
if (reportNameLabels.size() > 0) {
|
||||
reportNameValue = OutputExcelUtil.label2value(model, extendAttr, null, reportName);
|
||||
|
||||
|
||||
}
|
||||
reportNameValue = reportNameValue.replaceAll(OutputExcelUtil.FILENAMEREGX, "");
|
||||
if (reportNameValue.length() > 255) {
|
||||
@ -163,13 +166,12 @@ public class Report1Gener {
|
||||
}
|
||||
JSONObject dataMap = getData(repositoryId, wizardJsonData, docPath, fileName);
|
||||
if (dataMap != null) {
|
||||
System.out.println("dataMap字段数为======"+dataMap.size());
|
||||
OutputWordUtil.createDoc2(dataMap, tempPath, tempName, docName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取文档数据
|
||||
* @param repositoryId
|
||||
@ -191,23 +193,23 @@ public class Report1Gener {
|
||||
return null;
|
||||
}
|
||||
prReportComment.getCommentContent(dataMap, repositoryModel);//获取一些公共的数据(手册首页的手册岗位名称、部门、时间等)
|
||||
|
||||
|
||||
JSONArray repositoryShapeTable = new JSONArray();//流程步骤Table
|
||||
JSONArray fileTable = new JSONArray(); //流程附件Table
|
||||
JSONArray dangerTable = new JSONArray(); //风险Table
|
||||
JSONArray regulateTable = new JSONArray(); //控制Table
|
||||
JSONArray KPITable = new JSONArray(); //相关绩效考核Table
|
||||
|
||||
|
||||
Set<String> dangerSet = new HashSet<String>();// 风险
|
||||
Set<String> regulateSet = new HashSet<String>();// 控制
|
||||
Set<String> KPISet = new HashSet<String>();// kpi
|
||||
//System.out.println("id======================="+repositoryId);
|
||||
|
||||
|
||||
List<Map<String, Object>> repositoryFileElements = CoeDesignerUtil.getShapeMessageJson4(repositoryId); //流程文件内容
|
||||
if (wizardJsonData.getBoolean("orderNuberFirst")) { // 根据页面选择进行排序
|
||||
OutputWordUtil.orderByNumber(repositoryFileElements);
|
||||
}
|
||||
|
||||
|
||||
// 流程附件列表
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
StringBuffer sqlWhere = new StringBuffer();
|
||||
@ -248,7 +250,7 @@ public class Report1Gener {
|
||||
_tr.put(OutputWordUtil.SERIAL_NUMBER, shape.get("number"));
|
||||
}*/
|
||||
/**序号改为流程编号**/
|
||||
|
||||
|
||||
// 节点的附件处理
|
||||
JSONArray shapeFileTable = new JSONArray(); //流程节点附件Table
|
||||
if (search != null && search.size() > 0) {
|
||||
@ -356,7 +358,113 @@ public class Report1Gener {
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
JSONArray termTable = new JSONArray(); //术语定义Table
|
||||
// 属性特征 属性代码KEY
|
||||
PALRepositoryPropertyModel term = PALRepositoryPropertyCache.getPropertyByPropertyId(repositoryModel.getId(),"term");
|
||||
String termVal = term.getPropertyValue();
|
||||
JSONObject termObj = JSONObject.parseObject(termVal);
|
||||
if (termObj != null && !termObj.isEmpty()) {
|
||||
JSONArray tableArr = termObj.getJSONArray("table");
|
||||
if (tableArr != null && !tableArr.isEmpty()) {
|
||||
for (Object obj : tableArr) {
|
||||
JSONObject obj2 = (JSONObject) obj;
|
||||
if (!"table_head".equals(obj2.getString("id"))) {
|
||||
String name = obj2.getString("name");
|
||||
String desc = obj2.getString("desc");
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("name", name);
|
||||
tmp.put("desc", desc);
|
||||
termTable.add(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray organizationTable = new JSONArray(); //组织职责Table
|
||||
// 属性特征 属性代码KEY
|
||||
PALRepositoryPropertyModel Organizational = PALRepositoryPropertyCache.getPropertyByPropertyId(repositoryModel.getId(),"Organizational_role");
|
||||
String OrganizationalVal = Organizational.getPropertyValue();
|
||||
JSONObject OrganizationalObj = JSONObject.parseObject(OrganizationalVal);
|
||||
if (OrganizationalObj != null && !OrganizationalObj.isEmpty()) {
|
||||
JSONArray tableArr = OrganizationalObj.getJSONArray("table");
|
||||
if (tableArr != null && !tableArr.isEmpty()) {
|
||||
for (Object obj : tableArr) {
|
||||
JSONObject obj2 = (JSONObject) obj;
|
||||
if (!"table_head".equals(obj2.getString("id"))) {
|
||||
String name = obj2.getString("name");
|
||||
String desc = obj2.getString("desc");
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("name", name);
|
||||
tmp.put("desc", desc);
|
||||
organizationTable.add(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//支持文件
|
||||
JSONArray supportfiles = new JSONArray(); //组织职责Table
|
||||
List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "support_files");
|
||||
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
|
||||
JSONArray relevant_flies = new JSONArray(); //组织职责Table
|
||||
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "R_relevant_flies");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 2张表
|
||||
// 文件属性内容(文本内容)表
|
||||
// 文件属性内容关联表
|
||||
|
||||
// 根据绩效所属模型查询绩效形状的详细信息
|
||||
|
||||
|
||||
|
||||
// 流程文件属性术语与定义(表格类型)
|
||||
|
||||
|
||||
|
||||
// 流程文件属性绩效形状的信息
|
||||
|
||||
// 流程文件属性相关文件和支持文件
|
||||
|
||||
//术语
|
||||
dataMap.put("term_table", termTable);//table4
|
||||
//组织和职责
|
||||
dataMap.put("organization_table", organizationTable);//table5
|
||||
//支持文件
|
||||
dataMap.put("supports_table", supportfiles);//table6
|
||||
//相关文件
|
||||
dataMap.put("relevant_table", relevant_flies);//table7
|
||||
dataMap.put(OutputWordUtil.TABLE_REPOSITORY_SHAPE, repositoryShapeTable);
|
||||
dataMap.put("file_table", fileTable);
|
||||
dataMap.put(OutputWordUtil.TABLE_DANGER, dangerTable);
|
||||
|
||||
@ -76,7 +76,7 @@ public class PrReportComment {
|
||||
dataMap.put(OutputWordUtil.PL_VERSION, "V" + repositoryModel.getVersion()+ ".0 " + date); // 版本
|
||||
|
||||
OutputWordUtil.setRepositoryDefaultValue2(TARGET_METHOD_SCOPE, dataMap);// 设置属性默认值(空字符串)
|
||||
|
||||
//System.out.println("表单数据内容获取==================");
|
||||
JSONArray propertyArr = CoeProcessLevelUtil.getProcessLevelPropertyArr(repositoryModel.getId());
|
||||
for (int i = 0; i < propertyArr.size(); i++) {
|
||||
JSONObject propertyObj = propertyArr.getJSONObject(i);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@ 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.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
|
||||
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.model.DesignerShapeRelationModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
||||
@ -350,6 +351,116 @@ public class Report1Gener {
|
||||
index++;
|
||||
}
|
||||
}
|
||||
JSONArray termTable = new JSONArray(); //术语定义Table
|
||||
// 属性特征 属性代码KEY
|
||||
PALRepositoryPropertyModel term = PALRepositoryPropertyCache.getPropertyByPropertyId(repositoryModel.getId(),"term");
|
||||
String termVal = term.getPropertyValue();
|
||||
JSONObject termObj = JSONObject.parseObject(termVal);
|
||||
if (termObj != null && !termObj.isEmpty()) {
|
||||
JSONArray tableArr = termObj.getJSONArray("table");
|
||||
if (tableArr != null && !tableArr.isEmpty()) {
|
||||
for (Object obj : tableArr) {
|
||||
JSONObject obj2 = (JSONObject) obj;
|
||||
if (!"table_head".equals(obj2.getString("id"))) {
|
||||
String name = obj2.getString("name");
|
||||
String desc = obj2.getString("desc");
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("name", name);
|
||||
tmp.put("desc", desc);
|
||||
termTable.add(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray organizationTable = new JSONArray(); //组织职责Table
|
||||
// 属性特征 属性代码KEY
|
||||
PALRepositoryPropertyModel Organizational = PALRepositoryPropertyCache.getPropertyByPropertyId(repositoryModel.getId(),"Organizational_role");
|
||||
String OrganizationalVal = Organizational.getPropertyValue();
|
||||
JSONObject OrganizationalObj = JSONObject.parseObject(OrganizationalVal);
|
||||
if (OrganizationalObj != null && !OrganizationalObj.isEmpty()) {
|
||||
JSONArray tableArr = OrganizationalObj.getJSONArray("table");
|
||||
if (tableArr != null && !tableArr.isEmpty()) {
|
||||
for (Object obj : tableArr) {
|
||||
JSONObject obj2 = (JSONObject) obj;
|
||||
if (!"table_head".equals(obj2.getString("id"))) {
|
||||
String name = obj2.getString("name");
|
||||
String desc = obj2.getString("desc");
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("name", name);
|
||||
tmp.put("desc", desc);
|
||||
organizationTable.add(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//支持文件
|
||||
JSONArray support_files = new JSONArray(); //组织职责Table
|
||||
List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "support_files");
|
||||
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
|
||||
JSONArray related_files = new JSONArray(); //组织职责Table
|
||||
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "related_files");
|
||||
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);
|
||||
related_files.add(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 2张表
|
||||
// 文件属性内容(文本内容)表
|
||||
// 文件属性内容关联表
|
||||
|
||||
// 根据绩效所属模型查询绩效形状的详细信息
|
||||
|
||||
|
||||
|
||||
// 流程文件属性术语与定义(表格类型)
|
||||
|
||||
|
||||
|
||||
// 流程文件属性绩效形状的信息
|
||||
|
||||
// 流程文件属性相关文件和支持文件
|
||||
|
||||
//术语
|
||||
dataMap.put("term_table", termTable);//table4
|
||||
//组织和职责
|
||||
dataMap.put("organization_table", organizationTable);//table5
|
||||
//支持文件
|
||||
dataMap.put("supports_table", support_files);//table6
|
||||
//相关文件
|
||||
dataMap.put("relevant_table", related_files);//table7
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dataMap.put(OutputWordUtil.TABLE_REPOSITORY_SHAPE, repositoryShapeTable);
|
||||
dataMap.put("file_table", fileTable);
|
||||
@ -362,6 +473,13 @@ public class Report1Gener {
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置风险控制表格
|
||||
* @param attrId
|
||||
|
||||
Loading…
Reference in New Issue
Block a user