流程手册 制度 表格开发完成。

This commit is contained in:
翟林帆 2022-07-05 23:54:12 +08:00
parent d101790c41
commit c3d516f7ae
10 changed files with 240 additions and 23583 deletions

View File

@ -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.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.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;
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil; 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.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 * @author zhangming
*/ */
public class Report1Gener { public class Report1Gener {
@ -58,12 +61,12 @@ public class Report1Gener {
/** /**
* 生成文件 * 生成文件
* *
* @param model OutputTaskModel对象 * @param model OutputTaskModel对象
* @param wizardJsonData 向导收集的Json参数targetFilesrelationFilesoptions... * @param wizardJsonData 向导收集的Json参数targetFilesrelationFilesoptions...
* @param dcContext 要生成报告的DC目录对象已准备好 * @param dcContext 要生成报告的DC目录对象已准备好
* @return 将文件生成到output目录下返回状态 * @return 将文件生成到output目录下返回状态
* *
* @see PlatformAPIImpl#getDefaultLanguage() * @see PlatformAPIImpl#getDefaultLanguage()
* @see PlatformAPIImpl#getlanguages() * @see PlatformAPIImpl#getlanguages()
*/ */
@ -106,7 +109,7 @@ public class Report1Gener {
*/ */
private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData) { private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData) {
String[] repositoryIds = wizardJsonData.getString("targetFileId").split(","); String[] repositoryIds = wizardJsonData.getString("targetFileId").split(",");
String reportName = wizardJsonData.getString("reportNameIsItName"); //页面上设计的文件命名规则 String reportName = wizardJsonData.getString("reportNameIsItName"); //页面上设计的文件命名规则
Map<String, Integer> indexMap = new HashMap<String, Integer>(); Map<String, Integer> indexMap = new HashMap<String, Integer>();
for (String repositoryId : repositoryIds) { for (String repositoryId : repositoryIds) {
@ -140,7 +143,7 @@ public class Report1Gener {
String reportNameValue = reportName; String reportNameValue = reportName;
if (reportNameLabels.size() > 0) { if (reportNameLabels.size() > 0) {
reportNameValue = OutputExcelUtil.label2value(model, extendAttr, null, reportName); reportNameValue = OutputExcelUtil.label2value(model, extendAttr, null, reportName);
} }
reportNameValue = reportNameValue.replaceAll(OutputExcelUtil.FILENAMEREGX, ""); reportNameValue = reportNameValue.replaceAll(OutputExcelUtil.FILENAMEREGX, "");
if (reportNameValue.length() > 255) { if (reportNameValue.length() > 255) {
@ -163,13 +166,12 @@ public class Report1Gener {
} }
JSONObject dataMap = getData(repositoryId, wizardJsonData, docPath, fileName); JSONObject dataMap = getData(repositoryId, wizardJsonData, docPath, fileName);
if (dataMap != null) { if (dataMap != null) {
System.out.println("dataMap字段数为======"+dataMap.size());
OutputWordUtil.createDoc2(dataMap, tempPath, tempName, docName); OutputWordUtil.createDoc2(dataMap, tempPath, tempName, docName);
} }
} }
} }
} }
/** /**
* 获取文档数据 * 获取文档数据
* @param repositoryId * @param repositoryId
@ -191,23 +193,23 @@ public class Report1Gener {
return null; return null;
} }
prReportComment.getCommentContent(dataMap, repositoryModel);//获取一些公共的数据(手册首页的手册岗位名称部门时间等) prReportComment.getCommentContent(dataMap, repositoryModel);//获取一些公共的数据(手册首页的手册岗位名称部门时间等)
JSONArray repositoryShapeTable = new JSONArray();//流程步骤Table JSONArray repositoryShapeTable = new JSONArray();//流程步骤Table
JSONArray fileTable = new JSONArray(); //流程附件Table JSONArray fileTable = new JSONArray(); //流程附件Table
JSONArray dangerTable = new JSONArray(); //风险Table JSONArray dangerTable = new JSONArray(); //风险Table
JSONArray regulateTable = new JSONArray(); //控制Table JSONArray regulateTable = new JSONArray(); //控制Table
JSONArray KPITable = new JSONArray(); //相关绩效考核Table JSONArray KPITable = new JSONArray(); //相关绩效考核Table
Set<String> dangerSet = new HashSet<String>();// 风险 Set<String> dangerSet = new HashSet<String>();// 风险
Set<String> regulateSet = new HashSet<String>();// 控制 Set<String> regulateSet = new HashSet<String>();// 控制
Set<String> KPISet = new HashSet<String>();// kpi Set<String> KPISet = new HashSet<String>();// kpi
//System.out.println("id======================="+repositoryId); //System.out.println("id======================="+repositoryId);
List<Map<String, Object>> repositoryFileElements = CoeDesignerUtil.getShapeMessageJson4(repositoryId); //流程文件内容 List<Map<String, Object>> repositoryFileElements = CoeDesignerUtil.getShapeMessageJson4(repositoryId); //流程文件内容
if (wizardJsonData.getBoolean("orderNuberFirst")) { // 根据页面选择进行排序 if (wizardJsonData.getBoolean("orderNuberFirst")) { // 根据页面选择进行排序
OutputWordUtil.orderByNumber(repositoryFileElements); OutputWordUtil.orderByNumber(repositoryFileElements);
} }
// 流程附件列表 // 流程附件列表
UpFileDao upFileDao = new UpFileDao(); UpFileDao upFileDao = new UpFileDao();
StringBuffer sqlWhere = new StringBuffer(); StringBuffer sqlWhere = new StringBuffer();
@ -248,7 +250,7 @@ public class Report1Gener {
_tr.put(OutputWordUtil.SERIAL_NUMBER, shape.get("number")); _tr.put(OutputWordUtil.SERIAL_NUMBER, shape.get("number"));
}*/ }*/
/**序号改为流程编号**/ /**序号改为流程编号**/
// 节点的附件处理 // 节点的附件处理
JSONArray shapeFileTable = new JSONArray(); //流程节点附件Table JSONArray shapeFileTable = new JSONArray(); //流程节点附件Table
if (search != null && search.size() > 0) { if (search != null && search.size() > 0) {
@ -356,7 +358,113 @@ public class Report1Gener {
index++; 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(OutputWordUtil.TABLE_REPOSITORY_SHAPE, repositoryShapeTable);
dataMap.put("file_table", fileTable); dataMap.put("file_table", fileTable);
dataMap.put(OutputWordUtil.TABLE_DANGER, dangerTable); dataMap.put(OutputWordUtil.TABLE_DANGER, dangerTable);

View File

@ -76,7 +76,7 @@ public class PrReportComment {
dataMap.put(OutputWordUtil.PL_VERSION, "V" + repositoryModel.getVersion()+ ".0 " + date); // 版本 dataMap.put(OutputWordUtil.PL_VERSION, "V" + repositoryModel.getVersion()+ ".0 " + date); // 版本
OutputWordUtil.setRepositoryDefaultValue2(TARGET_METHOD_SCOPE, dataMap);// 设置属性默认值空字符串 OutputWordUtil.setRepositoryDefaultValue2(TARGET_METHOD_SCOPE, dataMap);// 设置属性默认值空字符串
//System.out.println("表单数据内容获取==================");
JSONArray propertyArr = CoeProcessLevelUtil.getProcessLevelPropertyArr(repositoryModel.getId()); JSONArray propertyArr = CoeProcessLevelUtil.getProcessLevelPropertyArr(repositoryModel.getId());
for (int i = 0; i < propertyArr.size(); i++) { for (int i = 0; i < propertyArr.size(); i++) {
JSONObject propertyObj = propertyArr.getJSONObject(i); JSONObject propertyObj = propertyArr.getJSONObject(i);

File diff suppressed because it is too large Load Diff

View File

@ -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.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.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;
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil; import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
@ -350,6 +351,116 @@ public class Report1Gener {
index++; 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(OutputWordUtil.TABLE_REPOSITORY_SHAPE, repositoryShapeTable);
dataMap.put("file_table", fileTable); dataMap.put("file_table", fileTable);
@ -362,6 +473,13 @@ public class Report1Gener {
return dataMap; return dataMap;
} }
/** /**
* 设置风险控制表格 * 设置风险控制表格
* @param attrId * @param attrId