岗位手册
This commit is contained in:
parent
0769e75e8a
commit
1743a0d58e
@ -1,13 +1,7 @@
|
|||||||
package com.actionsoft.apps.coe.pal.output.or.report2;
|
package com.actionsoft.apps.coe.pal.output.or.report2;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.io.*;
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
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.pal.method.cache.PALMethodCache;
|
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||||
@ -18,11 +12,17 @@ import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile;
|
|||||||
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.util.OutputExcelUtil;
|
import com.actionsoft.apps.coe.pal.pal.output.util.OutputExcelUtil;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
||||||
|
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;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||||
|
import com.actionsoft.bpms.commons.database.RowMap;
|
||||||
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
|
import com.actionsoft.bpms.util.DBSql;
|
||||||
|
import com.actionsoft.bpms.util.UtilFile;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
@ -33,6 +33,15 @@ import com.actionsoft.bpms.server.fs.DCContext;
|
|||||||
import com.actionsoft.bpms.util.UtilString;
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
import com.actionsoft.sdk.local.SDK;
|
import com.actionsoft.sdk.local.SDK;
|
||||||
import com.actionsoft.sdk.local.api.internal.PlatformAPIImpl;
|
import com.actionsoft.sdk.local.api.internal.PlatformAPIImpl;
|
||||||
|
import com.awspaas.user.apps.yili.reportform.util.RepositoryAttribute;
|
||||||
|
import freemarker.template.Configuration;
|
||||||
|
import freemarker.template.Template;
|
||||||
|
import freemarker.template.TemplateException;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import static com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil.getLastPublishTaskIdByModelId;
|
||||||
|
import static java.util.stream.Collectors.collectingAndThen;
|
||||||
|
import static java.util.stream.Collectors.toCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成岗位手册-横表的入口
|
* 生成岗位手册-横表的入口
|
||||||
@ -65,6 +74,7 @@ public class Report2Gener {
|
|||||||
isRunning = true;
|
isRunning = true;
|
||||||
String teamId = model.getTeamId();
|
String teamId = model.getTeamId();
|
||||||
String wsId = model.getWsId();
|
String wsId = model.getWsId();
|
||||||
|
String userId = model.getUserId();
|
||||||
log.info("execute ready...");
|
log.info("execute ready...");
|
||||||
log.info("-------------------");
|
log.info("-------------------");
|
||||||
log.info("TeamId=" + teamId);
|
log.info("TeamId=" + teamId);
|
||||||
@ -82,9 +92,9 @@ public class Report2Gener {
|
|||||||
if (!UtilString.isEmpty(targetFileIds)) {
|
if (!UtilString.isEmpty(targetFileIds)) {
|
||||||
if (isJsonArray(targetFileIds)) {
|
if (isJsonArray(targetFileIds)) {
|
||||||
JSONArray array = JSONArray.parseArray(targetFileIds);
|
JSONArray array = JSONArray.parseArray(targetFileIds);
|
||||||
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj, array);
|
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj, array,userId);
|
||||||
} else {
|
} else {
|
||||||
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj);
|
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj,userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info("end");
|
log.info("end");
|
||||||
@ -104,7 +114,7 @@ public class Report2Gener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData) {
|
private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData,String userId) {
|
||||||
String[] targetShapes = wizardJsonData.getString("targetShape").split(",");
|
String[] targetShapes = wizardJsonData.getString("targetShape").split(",");
|
||||||
String[] repositoryIds = wizardJsonData.getString("targetFileId").split(",");
|
String[] repositoryIds = wizardJsonData.getString("targetFileId").split(",");
|
||||||
String repositoryId = null;
|
String repositoryId = null;
|
||||||
@ -154,24 +164,41 @@ public class Report2Gener {
|
|||||||
indexMap.put(shapeName, index);
|
indexMap.put(shapeName, index);
|
||||||
} else {
|
} else {
|
||||||
log.info("得到word名称为:" + shapeName);
|
log.info("得到word名称为:" + shapeName);
|
||||||
docName = docPath + shapeName + ".doc";
|
docName = docPath + UserContext.fromUID(userId).getUserModel().getPositionName() + ".doc";
|
||||||
indexMap.put(shapeName, 1);
|
indexMap.put(shapeName, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject dataMap = getData(targetShapeId, shapesMap, linkerList, wizardJsonData);
|
|
||||||
OutputWordUtil.createDoc(dataMap, tempPath, tempName, docName);
|
/*List<String> lists = new LinkedList<>();
|
||||||
|
List<RowMap> nodeRowMaps = DBSql.getMaps(
|
||||||
|
"SELECT NODEID,NODENAME,ITSYSVAL,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
|
||||||
|
+ UserContext.fromUID(userId).getUserModel().getPositionName()+ "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%'");
|
||||||
|
for (RowMap rowMap:
|
||||||
|
nodeRowMaps) {
|
||||||
|
String plid = rowMap.getString("PLID");
|
||||||
|
if (!lists.contains(plid)){
|
||||||
|
lists.add(plid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("size>>>>>>>>"+lists.size());*/
|
||||||
|
|
||||||
|
JSONArray jsonArray = getData(targetShapeId, shapesMap, linkerList, wizardJsonData,userId);
|
||||||
|
for (int i=0;i<jsonArray.size();i++) {
|
||||||
|
JSONObject dataMap = jsonArray.getJSONObject(i);
|
||||||
|
OutputWordUtil.createDoc2(dataMap, tempPath, tempName, docName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private JSONObject getData(String shapeId, Map<String, Map<String, Object>> shapesMap,
|
|
||||||
List<Map<String, Object>> linkerList, JSONObject wizardJsonData) {
|
|
||||||
|
private JSONArray getData(String shapeId, Map<String, Map<String, Object>> shapesMap,
|
||||||
JSONObject dataMap = new JSONObject();
|
List<Map<String, Object>> linkerList, JSONObject wizardJsonData,String userId) {
|
||||||
|
JSONArray jsonArray = new JSONArray(new LinkedList<>());
|
||||||
OrReportComment orReportComment = new OrReportComment();
|
|
||||||
orReportComment.getCommentContent(dataMap, shapesMap, shapeId); //获取一些公共的数据(手册首页的手册岗位名称、部门、公司、时间、岗位职责等)
|
|
||||||
|
|
||||||
//流程表格
|
//流程表格
|
||||||
|
JSONArray positionTable = new JSONArray(); //相关流程
|
||||||
JSONArray repositoryTable = new JSONArray(); //相关流程
|
JSONArray repositoryTable = new JSONArray(); //相关流程
|
||||||
JSONArray repositoryShapeTable = new JSONArray(); //流程步骤
|
JSONArray repositoryShapeTable = new JSONArray(); //流程步骤
|
||||||
JSONArray institutionTable = new JSONArray(); //相关制度
|
JSONArray institutionTable = new JSONArray(); //相关制度
|
||||||
@ -185,101 +212,169 @@ public class Report2Gener {
|
|||||||
Set<String> formSet = new HashSet<String>();
|
Set<String> formSet = new HashSet<String>();
|
||||||
Set<String> itsystemSet = new HashSet<String>();
|
Set<String> itsystemSet = new HashSet<String>();
|
||||||
Set<String> KPISet = new HashSet<String>();
|
Set<String> KPISet = new HashSet<String>();
|
||||||
|
//updateOtherTableInfo(dataMap,repositoryShapeTable, institutionTable, formTable, itsystemTable, KPITable);
|
||||||
String[] relationFileIds = wizardJsonData.getString("relationFileId").split(","); //页面选择的关联文件Id数组
|
List<String> lists = new LinkedList<>();
|
||||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
List<RowMap> nodeRowMaps = DBSql.getMaps(
|
||||||
|
"SELECT NODEID,NODENAME,ITSYSVAL,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
|
||||||
// 记录查询过的文件,避免重复查询
|
+ UserContext.fromUID(userId).getUserModel().getPositionName()+ "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%'");
|
||||||
Map<String, List<String>> map = new HashMap<>();// key: fileId value: shapes
|
for (RowMap rowMap:
|
||||||
|
nodeRowMaps) {
|
||||||
int index = 1;
|
String plid = rowMap.getString("PLID");
|
||||||
for (String relationFileId : relationFileIds) {
|
if (!lists.contains(plid)){
|
||||||
if (relationFileId.equals("")) {
|
lists.add(plid);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
List<DesignerShapeRelationModel> relationModelList = dao.getModelListByRelationShapeId(relationFileId, shapeId); // 关联信息
|
System.out.println("size>>>>>>>>"+lists.size());
|
||||||
if (relationModelList != null && relationModelList.size() > 0) {
|
|
||||||
PALRepositoryModel relationModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(relationFileId);
|
for (int q =0;q< lists.size();q++){
|
||||||
List<Map<String, Object>> relationFileElements = CoeDesignerUtil.getShapeMessageJson4(relationFileId); // 关联流程文件内容
|
JSONObject dataMap = new JSONObject();
|
||||||
if (wizardJsonData.getBoolean("orderNuberFirst")) {
|
OrReportComment orReportComment = new OrReportComment();
|
||||||
OutputWordUtil.orderByNumber(relationFileElements);
|
orReportComment.getCommentContent(dataMap, shapesMap, shapeId,userId); //获取一些公共的数据(手册首页的手册岗位名称、部门、公司、时间、岗位职责等)
|
||||||
}
|
|
||||||
Set<String> shapeIds = new HashSet<>();
|
System.out.println("循环了几次>>>>>>>" + q);
|
||||||
for (DesignerShapeRelationModel srModel : relationModelList) {
|
//这个代码是为了解决 岗位参与执行的流程存储
|
||||||
if (UtilString.isEmpty(srModel.getShapeId())) {
|
JSONObject _tr = new JSONObject(new LinkedHashMap<>());
|
||||||
continue;
|
_tr.put("nums", q + 1);
|
||||||
}
|
positionTable.add(_tr);
|
||||||
shapeIds.add(srModel.getShapeId());
|
//dataMap.put("position_table", positionTable);
|
||||||
|
|
||||||
|
//这块代码主要是为了存储流程名称
|
||||||
|
PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(lists.get(q));
|
||||||
|
String name = palRepositoryModel.getName();
|
||||||
|
JSONObject _tr_prcoess = new JSONObject(new LinkedHashMap<>());
|
||||||
|
_tr.put("numbers", 1);
|
||||||
|
_tr.put("shape_name", name);
|
||||||
|
dataMap.put("position_table", positionTable);
|
||||||
|
|
||||||
|
List<RowMap> nodeRowMaps_shape = DBSql.getMaps(
|
||||||
|
"SELECT * FROM (SELECT NODEID,NODENAME,ITSYSVAL,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
|
||||||
|
+ UserContext.fromUID(userId).getUserModel().getPositionName() + "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%') WHERE PLID = '" + lists.get(q) + "'");
|
||||||
|
int m = 1;
|
||||||
|
System.out.println("nodeRowMaps_shape>>>>>>>>>" + nodeRowMaps_shape.size());
|
||||||
|
for (RowMap rowMap :
|
||||||
|
nodeRowMaps_shape) {
|
||||||
|
JSONObject _tr_shape = new JSONObject(new LinkedHashMap<>());
|
||||||
|
String activitydesc = rowMap.getString("ACTIVITYDESC");
|
||||||
|
String nodename = rowMap.getString("NODENAME");
|
||||||
|
_tr_shape.put("numbers", m);
|
||||||
|
_tr_shape.put("shape_name", nodename);
|
||||||
|
_tr_shape.put("shape_desc", activitydesc);
|
||||||
|
String nodetype = rowMap.getString("NODETYPE");
|
||||||
|
if (nodetype.equals("method_approval_node")) {
|
||||||
|
_tr_shape.put("shape_type", "审批类(线上审批)");
|
||||||
|
} else if (nodetype.equals("method_service_node")) {
|
||||||
|
_tr_shape.put("shape_type", "审批类(线下审批)");
|
||||||
|
} else if (nodetype.equals("method_approval_node3")) {
|
||||||
|
_tr_shape.put("shape_type", "操作类(系统活动)");
|
||||||
|
} else if (nodetype.equals("method_service_node4")) {
|
||||||
|
_tr_shape.put("shape_type", "操作类(人工活动)");
|
||||||
}
|
}
|
||||||
|
String rolename = rowMap.getString("ROLENAME");
|
||||||
|
_tr_shape.put("shape_role", rolename);
|
||||||
|
m++;
|
||||||
|
repositoryShapeTable.add(_tr_shape);
|
||||||
|
}
|
||||||
|
dataMap.put("repository_table", repositoryShapeTable);
|
||||||
|
|
||||||
for (Map<String, Object> shapeMap : relationFileElements) {
|
|
||||||
String id = shapeMap.get("id").toString();
|
|
||||||
if (!shapeIds.contains(id)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
JSONObject _tr = new JSONObject();
|
|
||||||
OutputWordUtil.setShapeDefaultValue2(relationFileId, _tr);
|
|
||||||
|
|
||||||
_tr.put(OutputWordUtil.SERIAL_NUMBER, index); //序号
|
//这里是对流程制度/表单/模版进行存储数据
|
||||||
_tr.put(OutputWordUtil.REPOSITORY_NAME, relationModel.getName().toString().replace("\n", "")); //流程名称
|
Map<String, JSONObject> queryRepositoryAttributeById = new RepositoryAttribute().queryRepositoryAttributeById(lists.get(q));
|
||||||
_tr.put(OutputWordUtil.SHAPE_ID, shapeMap.get("id")); //步骤元素id
|
if (null != queryRepositoryAttributeById && !queryRepositoryAttributeById.isEmpty()) {
|
||||||
_tr.put(OutputWordUtil.SHAPE_NAME, shapeMap.get("text").toString().replace("\n", OutputWordUtil.WRAPSTRING)); //步骤名称
|
|
||||||
|
|
||||||
JSONArray dataAttributes = (JSONArray) shapeMap.get("attributes");
|
//这块是取适用范围的字段数据
|
||||||
if (!dataAttributes.isEmpty()) {
|
String applicant = "";
|
||||||
for (int i = 0; i < dataAttributes.size(); i++) {
|
JSONObject application = queryRepositoryAttributeById.get("application");
|
||||||
JSONObject obj = dataAttributes.getJSONObject(i);
|
if (null != application && !application.equals("")) {
|
||||||
String attrId = obj.getString("key");
|
JSONArray PUBDEPTJA = application.getJSONArray("value");
|
||||||
String attrValue = obj.getString("value");
|
if (null != PUBDEPTJA && !PUBDEPTJA.isEmpty()) {
|
||||||
_tr.put("shape_" + attrId, attrValue.replace("\n", OutputWordUtil.WRAPSTRING));
|
for (Object PUBDEPTO : PUBDEPTJA) {
|
||||||
|
JSONObject _tr_institutionTable = new JSONObject(new LinkedHashMap<>());
|
||||||
|
JSONObject PUBDEPTJO = JSONObject.parseObject(String.valueOf(PUBDEPTO));
|
||||||
|
String dempId = PUBDEPTJO.getString("id");
|
||||||
|
applicant += dempId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositoryShapeTable.add(_tr);
|
}
|
||||||
if (!repositoryNameList.contains(relationModel.getName())) {
|
// 获取相关文件
|
||||||
repositoryNameList.add(relationModel.getName());
|
|
||||||
|
|
||||||
|
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(lists.get(q), "", "R_relevant_flies");
|
||||||
|
int o = 1;
|
||||||
|
System.out.println("shuj>>>>>>>>" + relationList2.size());
|
||||||
|
if (relationList2.size() > 0) {
|
||||||
|
for (DesignerShapeRelationModel relation : relationList2) {
|
||||||
|
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
||||||
|
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
||||||
|
if (model != null) {
|
||||||
|
JSONObject _tr_institutionTable = new JSONObject(new LinkedHashMap<>());
|
||||||
|
String names = model.getName();
|
||||||
|
if (!names.isEmpty()) {
|
||||||
|
_tr_institutionTable.put("numbers", o);
|
||||||
|
_tr_institutionTable.put("institution_name", names);
|
||||||
|
PALRepositoryModel dempId_pal_model = PALRepositoryCache.getCache().get(model.getId());
|
||||||
|
_tr_institutionTable.put("version", dempId_pal_model.getVersion());
|
||||||
|
_tr_institutionTable.put("application", applicant);
|
||||||
|
institutionTable.add(_tr_institutionTable);
|
||||||
|
o++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!map.containsKey(relationModel.getId())) {
|
}
|
||||||
map.put(relationModel.getId(), new ArrayList<String>());
|
dataMap.put("institution_tables", institutionTable);
|
||||||
}
|
}
|
||||||
map.get(relationModel.getId()).add(id);
|
|
||||||
index++;
|
|
||||||
|
//这个是存储相关IT系统数据
|
||||||
|
List<String> list_it_system = new LinkedList<>();
|
||||||
|
for (RowMap rowMap :
|
||||||
|
nodeRowMaps_shape) {
|
||||||
|
String itsysval = rowMap.getString("ITSYSVAL");
|
||||||
|
if (!list_it_system.contains(itsysval)) {
|
||||||
|
list_it_system.add(itsysval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
int t = 1;
|
||||||
|
for (int r = 0; r < list_it_system.size(); r++) {
|
||||||
//相关流程Table
|
if (StringUtils.isEmpty(list_it_system.get(r))) {
|
||||||
int i = 1;
|
JSONObject _tr_it_system = new JSONObject(new LinkedHashMap<>());
|
||||||
for (String it : repositoryNameList) {
|
_tr_it_system.put("numbers", t);
|
||||||
JSONObject _tr = new JSONObject();
|
_tr_it_system.put("it_name", list_it_system.get(r));
|
||||||
_tr.put(OutputWordUtil.SERIAL_NUMBER, i);
|
itsystemTable.add(_tr_it_system);
|
||||||
_tr.put(OutputWordUtil.REPOSITORY_NAME, it.replace("\n", ""));
|
t++;
|
||||||
repositoryTable.add(_tr);
|
}
|
||||||
i++;
|
|
||||||
}
|
|
||||||
Map<String, List<Map<String, Object>>> recordsMap = new HashMap<>();
|
|
||||||
// 制度、表单、IT系统、绩效考核数据
|
|
||||||
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
|
|
||||||
String fileId = entry.getKey();
|
|
||||||
for (String id : entry.getValue()) {
|
|
||||||
// 制度
|
|
||||||
getRelationData(institutionTable, "institution", fileId, id, institutionSet, dao, recordsMap);
|
|
||||||
// 表单
|
|
||||||
getRelationData(formTable, "form", fileId, id, formSet, dao, recordsMap);
|
|
||||||
// it系统
|
|
||||||
getRelationData(itsystemTable, "itsystem", fileId, id, itsystemSet, dao, recordsMap);
|
|
||||||
// kpi绩效
|
|
||||||
getRelationData(KPITable, "kpi", fileId, id, KPISet, dao, recordsMap);
|
|
||||||
}
|
}
|
||||||
|
dataMap.put("it_system_table", itsystemTable);
|
||||||
|
//这个是存储kpi数据
|
||||||
|
|
||||||
|
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(lists.get(q), "", "Process_performance_metrics");
|
||||||
|
|
||||||
|
int u = 1;
|
||||||
|
if (relationList2.size() > 0) {
|
||||||
|
for (DesignerShapeRelationModel relation : relationList2) {
|
||||||
|
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
|
||||||
|
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
|
||||||
|
if (model != null) {
|
||||||
|
JSONObject _tr_kpi = new JSONObject(new LinkedHashMap<>());
|
||||||
|
_tr_kpi.put("numbers", u);
|
||||||
|
String names = model.getName();
|
||||||
|
_tr_kpi.put("kpi_name", names);
|
||||||
|
_tr_kpi.put("kpi_number", "");
|
||||||
|
KPITable.add(_tr_kpi);
|
||||||
|
u++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
dataMap.put("kpi_table", KPITable);
|
||||||
|
//这里是存储数据表格
|
||||||
|
//for (int i=0;i<2;i++){
|
||||||
|
System.out.println("dataMap>>>>>>>>>>>>>>>"+dataMap.toString());
|
||||||
|
updateOtherTableInfo(dataMap, repositoryShapeTable, institutionTable, formTable, itsystemTable, KPITable);
|
||||||
|
//}
|
||||||
|
jsonArray.add(dataMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
dataMap.put(OutputWordUtil.TABLE_REPOSITORY, repositoryTable);
|
|
||||||
dataMap.put(OutputWordUtil.TABLE_REPOSITORY_SHAPE, repositoryShapeTable);
|
|
||||||
|
|
||||||
// 完善部分表格信息
|
return jsonArray;
|
||||||
updateOtherTableInfo(dataMap, institutionTable, formTable, itsystemTable, KPITable);
|
|
||||||
|
|
||||||
return dataMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -290,12 +385,14 @@ public class Report2Gener {
|
|||||||
* @param itsystemTable
|
* @param itsystemTable
|
||||||
* @param KPITable
|
* @param KPITable
|
||||||
*/
|
*/
|
||||||
private void updateOtherTableInfo(JSONObject dataMap, JSONArray institutionTable, JSONArray formTable, JSONArray itsystemTable, JSONArray KPITable) {
|
private void updateOtherTableInfo(JSONObject dataMap,JSONArray repositoryShapeTable, JSONArray institutionTable, JSONArray formTable, JSONArray itsystemTable, JSONArray KPITable) {
|
||||||
//制度
|
//制度
|
||||||
if (institutionTable.size() == 0) {
|
if (institutionTable.size() == 0) {
|
||||||
institutionTable = getEmptyTable("control.policy");
|
institutionTable = getEmptyTable("control.policy");
|
||||||
}
|
}
|
||||||
dataMap.put(OutputWordUtil.TABLE_INSTITUTION, institutionTable);
|
dataMap.put(OutputWordUtil.TABLE_INSTITUTION, institutionTable);
|
||||||
|
//相关职责
|
||||||
|
dataMap.put(OutputWordUtil.TABLE_REPOSITORY, repositoryShapeTable);
|
||||||
//表单
|
//表单
|
||||||
if (formTable.size() == 0) {
|
if (formTable.size() == 0) {
|
||||||
formTable = getEmptyTable("data.form");
|
formTable = getEmptyTable("data.form");
|
||||||
@ -317,6 +414,10 @@ public class Report2Gener {
|
|||||||
institutionTable.getJSONObject(j).put(OutputWordUtil.SERIAL_NUMBER, j + 1);
|
institutionTable.getJSONObject(j).put(OutputWordUtil.SERIAL_NUMBER, j + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int j = 0; j < repositoryShapeTable.size(); j++) {
|
||||||
|
repositoryShapeTable.getJSONObject(j).put(OutputWordUtil.SERIAL_NUMBER, j + 1);
|
||||||
|
}
|
||||||
|
|
||||||
for (int j = 0; j < formTable.size(); j++) {
|
for (int j = 0; j < formTable.size(); j++) {
|
||||||
formTable.getJSONObject(j).put(OutputWordUtil.SERIAL_NUMBER, j + 1);
|
formTable.getJSONObject(j).put(OutputWordUtil.SERIAL_NUMBER, j + 1);
|
||||||
}
|
}
|
||||||
@ -395,7 +496,7 @@ public class Report2Gener {
|
|||||||
|
|
||||||
/**********************关联AWS组织的excel处理***************************/
|
/**********************关联AWS组织的excel处理***************************/
|
||||||
|
|
||||||
private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData, JSONArray targetFileIds) {
|
private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData, JSONArray targetFileIds,String userId) {
|
||||||
// 按照名称排序
|
// 按照名称排序
|
||||||
List<RoleModel> roleList = new ArrayList<>();
|
List<RoleModel> roleList = new ArrayList<>();
|
||||||
for (int i = 0; i < targetFileIds.size(); i++) {
|
for (int i = 0; i < targetFileIds.size(); i++) {
|
||||||
@ -437,17 +538,17 @@ public class Report2Gener {
|
|||||||
indexMap.put(shapeName, 1);
|
indexMap.put(shapeName, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject dataMap = getData(role, wizardJsonData);
|
JSONObject dataMap = getData(role, wizardJsonData,userId);
|
||||||
OutputWordUtil.createDoc(dataMap, tempPath, tempName, docName);
|
OutputWordUtil.createDoc(dataMap, tempPath, tempName, docName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private JSONObject getData(RoleModel role, JSONObject wizardJsonData) {
|
private JSONObject getData(RoleModel role, JSONObject wizardJsonData,String userId) {
|
||||||
|
|
||||||
JSONObject dataMap = new JSONObject();
|
JSONObject dataMap = new JSONObject();
|
||||||
|
|
||||||
OrReportComment orReportComment = new OrReportComment();
|
OrReportComment orReportComment = new OrReportComment();
|
||||||
orReportComment.getAwsOrgCommentContent(dataMap, role); //获取一些公共的数据(手册首页的手册岗位名称、部门、公司、时间、岗位职责等)
|
orReportComment.getAwsOrgCommentContent(dataMap, role,userId); //获取一些公共的数据(手册首页的手册岗位名称、部门、公司、时间、岗位职责等)
|
||||||
|
|
||||||
//流程表格
|
//流程表格
|
||||||
JSONArray repositoryTable = new JSONArray(); //相关流程
|
JSONArray repositoryTable = new JSONArray(); //相关流程
|
||||||
@ -525,7 +626,14 @@ public class Report2Gener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//相关流程Table
|
//相关流程Table
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (String it : repositoryNameList) {
|
for (String it : repositoryNameList) {
|
||||||
@ -556,11 +664,16 @@ public class Report2Gener {
|
|||||||
dataMap.put(OutputWordUtil.TABLE_REPOSITORY_SHAPE, repositoryShapeTable);
|
dataMap.put(OutputWordUtil.TABLE_REPOSITORY_SHAPE, repositoryShapeTable);
|
||||||
|
|
||||||
// 完善部分表格信息
|
// 完善部分表格信息
|
||||||
updateOtherTableInfo(dataMap, institutionTable, formTable, itsystemTable, KPITable);
|
|
||||||
|
//for (int s=0;s<=2;s++){
|
||||||
|
|
||||||
|
updateOtherTableInfo(dataMap,new JSONArray(), institutionTable, formTable, itsystemTable, KPITable);
|
||||||
|
// }
|
||||||
|
|
||||||
return dataMap;
|
return dataMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************关联AWS组织的excel处理***************************/
|
/**********************关联AWS组织的excel处理***************************/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user