岗位手册-横表相关代码修改

This commit is contained in:
Mr-wang 2023-07-07 11:34:15 +08:00
parent 46e54a8bec
commit c52f433153
6 changed files with 3976 additions and 3122 deletions

View File

@ -1,9 +1,18 @@
package com.actionsoft.apps.coe.pal.output.or;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
import com.actionsoft.apps.coe.pal.pal.output.OutPutReportWeb;
import com.actionsoft.apps.coe.pal.pal.output.OutputAPIManager;
import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
import com.actionsoft.bpms.server.fs.DCContext;
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
import com.actionsoft.bpms.server.fs.dc.DCUtil;
import com.actionsoft.bpms.util.UtilFile;
import com.actionsoft.sdk.local.SDK;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.actionsoft.apps.coe.pal.output.or.dc.OutputDCFileProcessor;
@ -12,6 +21,8 @@ import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.bind.annotation.Controller;
import com.actionsoft.bpms.server.bind.annotation.Mapping;
import java.io.File;
/**
* @Description 岗位手册Controller类
@ -46,6 +57,61 @@ public class ReportORController {
return ro.toString();
}
@Mapping("com.actionsoft.apps.coe.pal.output.downLoad_or_Name")
public ResponseObject downLoad_or_Name(String sid,String taskName) throws Exception {
ResponseObject ro = ResponseObject.newOkResponse();
UserContext userContext = UserContext.fromSessionId(sid);
OutPutReportWeb outPutReport = new OutPutReportWeb(userContext);
String lang = "cn";
String userId = userContext.getUID();
String wsId = "7d3ca852-a0bd-42e6-80b1-3dcea6f55083";
String teamId ="";
String profileId ="_fe696a872a52a5f9860bb65a2f9c3354";
String isExecute = "N";
String config = "{'isItReport':true,'orderNuberFirst':true,'orderNametwo':false,'reportNameIsItName':'%shapeName%'}";
String targetFileId = ",5b372c57-cda8-41c1-a1f0-07d94af6fb3f";
String targetShape = "obj_c9eac6bfaaf000018e3014a212701106,";
String relationFileId =",e15d106a-74b8-47e5-8513-2bb13d054e50";
String isModify = "false";
String taskId = "";
String s = outPutReport.reportSave(lang, taskName, userId, teamId, profileId, wsId, isExecute, config, targetFileId, targetShape, relationFileId, isModify, taskId);
JSONObject jsonObject = JSON.parseObject(s);
JSONObject data = jsonObject.getJSONObject("data");
String id = data.getString("taskId");
String s1 = outPutReport.reportExecute(id, wsId, profileId);
OutputTaskModel model = new OutputTask().getTaskReportById(id);
DCContext dcContext = new DCContext(userContext,
DCProfileManager.getDCProfile("com.actionsoft.apps.coe.pal.output.or", "output"), "com.actionsoft.apps.coe.pal.output.or",
"7d3ca852-a0bd-42e6-80b1-3dcea6f55083", id, userContext.getUserModel().getPositionName()+".doc");
//String reportDownloadURL = getReportDownloadURL(model.getWsId(), id, model.getProfileId(), userContext, model.getTaskName());
ro.put("url",dcContext.getDownloadURL());
return ro;
}
public static String getReportDownloadURL(String wsId, String id, String profileId, UserContext _uc, String taskName) throws Exception {
UtilFile file = OutputAPIManager.getInstance().getFilePath(wsId, id, profileId);
if (file.exists()) {
//String josnStr = OutputAPIManager.getInstance().getWizardJsonData(wsId, id, profileId);
// JSONObject jsonObj = JSONObject.fromObject(josnStr);
DCContext dcContext = null;
DCUtil.getInstance();
dcContext = DCUtil.createTempFileContext("com.actionsoft.apps.coe.pal.output.or", "output", id, "zip");
dcContext.setFileName(taskName+ ".zip");
File ff = new File(dcContext.getFilePath());
UtilFile.zipCompress(file.getPath(), ff, "doc");
dcContext.setSession(_uc);
// 操作行为日志记录
/*if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_DOWNLOAD, CoEOpLogConst.INFO_OUTPUT_DOWNLOAD);
}*/
return dcContext.getDownloadURL();
}
return "";
}
@Mapping("com.actionsoft.apps.coe.pal.output.or_downloadlog")
/**日志下载
*

View File

@ -11,11 +11,15 @@ 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.util.OutputExcelUtil;
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.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;
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.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -26,10 +30,15 @@ import com.actionsoft.bpms.server.fs.DCContext;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.internal.PlatformAPIImpl;
import com.awspaas.user.apps.yili.reportform.util.RepositoryAttribute;
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;
/**
* 生成岗位手册-横表的入口
*
*
* @author zhangming
*/
public class Report1Gener {
@ -42,21 +51,26 @@ public class Report1Gener {
/**
* 生成文件
*
*
* @param model OutputTaskModel对象
* @param wizardJsonData 向导收集的Json参数targetFilesrelationFilesoptions...
* @param dcContext 要生成报告的DC目录对象已准备好
* @return 将文件生成到output目录下返回状态
*
*
* @see PlatformAPIImpl#getDefaultLanguage()
* @see PlatformAPIImpl#getlanguages()
*/
public ResponseObject execute(OutputTaskModel model, String wizardJsonData, DCContext dcContext) {
try {
synchronized (_lock) {
System.out.println("outPuttaskModel>>>>>>>>"+model);
System.out.println("wizardJsonData>>>>>>>>"+wizardJsonData);
System.out.println("dcContext>>>>>>>>"+dcContext);
isRunning = true;
String teamId = model.getTeamId();
String wsId = model.getWsId();
String userId = model.getUserId();
System.out.println("这个的id是什么>>>>>>>>>"+userId);
log.info("execute ready...");
log.info("-------------------");
log.info("TeamId=" + teamId);
@ -74,10 +88,10 @@ public class Report1Gener {
if (!UtilString.isEmpty(targetFileIds)) {
if (isJsonArray(targetFileIds)) {
JSONArray array = JSONArray.parseArray(targetFileIds);
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj, array);
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj, array,userId);
} else {
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj);
}
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj,userId);
}
}
log.info("end");
}
@ -95,16 +109,16 @@ public class Report1Gener {
return false;
}
}
/**
* 循环生成多份报告
*
*
* @param tempPath
* @param tempName
* @param docPath
* @param wizardJsonData
*/
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[] repositoryIds = wizardJsonData.getString("targetFileId").split(",");
String repositoryId = null;
@ -153,30 +167,32 @@ public class Report1Gener {
indexMap.put(shapeName, index);
} else {
log.info("得到word名称为:" + shapeName);
docName = docPath + shapeName + ".doc";
UserContext userContext = UserContext.fromUID(userId);
String positionName = userContext.getUserModel().getPositionName();
docName = docPath + positionName + ".doc";
indexMap.put(shapeName, 1);
}
JSONObject dataMap = getData(targetShapeId, shapesMap, linkerList, wizardJsonData);
JSONObject dataMap = getData(targetShapeId, shapesMap, linkerList, wizardJsonData,userId);
OutputWordUtil.createDoc(dataMap, tempPath, tempName, docName);
}
}
/**
* 获取报告中所需数据
*
*
* @param shapeId
* @param shapesMap
* @param linkerList
* @param wizardJsonData
* @return
*/
private JSONObject getData(String shapeId, Map<String, Map<String, Object>> shapesMap, List<Map<String, Object>> linkerList, JSONObject wizardJsonData) {
private JSONObject getData(String shapeId, Map<String, Map<String, Object>> shapesMap, List<Map<String, Object>> linkerList, JSONObject wizardJsonData,String userId) {
JSONObject dataMap = new JSONObject();
OrReportComment orReportComment = new OrReportComment();
orReportComment.getCommentContent(dataMap, shapesMap, shapeId); // 获取一些公共的数据(手册首页的手册岗位名称部门时间等)
orReportComment.getCommentContent(dataMap, shapesMap, shapeId,userId); // 获取一些公共的数据(手册首页的手册岗位名称部门时间等)
// 流程表格
JSONArray _table = new JSONArray();
@ -184,6 +200,7 @@ public class Report1Gener {
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
// 循环关联文件
int index = 1;
/*int index = 1;
for (String relationFileId : relationFileIds) {
if (relationFileId.equals("")) {
continue;
@ -213,6 +230,8 @@ public class Report1Gener {
_tr.put(OutputWordUtil.SERIAL_NUMBER, index); // 序号
_tr.put(OutputWordUtil.REPOSITORY_NAME, relationModel.getName().toString().replace("\n", "")); // 流程名称
_tr.put(OutputWordUtil.SHAPE_NAME, shapeMap.get("text").toString().replace("\n", OutputWordUtil.WRAPSTRING)); // 步骤名称
//JSONObject jsonObject = personalView_right(UserContext.fromUID(userId));
JSONArray dataAttributes = (JSONArray) shapeMap.get("attributes");
if (!dataAttributes.isEmpty()) {
@ -221,14 +240,71 @@ public class Report1Gener {
String attrId = obj.getString("key");
String attrValue = obj.getString("value");
_tr.put("shape_" + attrId, attrValue.replace("\n", OutputWordUtil.WRAPSTRING));
_tr.put("shape_role", "123456"); // 步骤名称
}
}
_table.add(_tr);
index++;
}
}
}*/
JSONObject jsonObject = personalView_right(UserContext.fromUID(userId));
JSONArray typeB = jsonObject.getJSONArray("typeB");
if (typeB.size()>0){
for (int i=0;i<typeB.size();i++){
JSONObject jsonObject1 = typeB.getJSONObject(i);
JSONObject _tr = new JSONObject();
_tr.put(OutputWordUtil.SERIAL_NUMBER, index); // 序号
_tr.put(OutputWordUtil.REPOSITORY_NAME,jsonObject1.getString("PLNAME")); // 流程名称
_tr.put(OutputWordUtil.SHAPE_NAME, jsonObject1.getString("NODENAME")); // 活动名称
_tr.put(OutputWordUtil.SHAPE_DESC, jsonObject1.getString("ACTIVITYDESC")); // 活动描述
_tr.put(OutputWordUtil.SHAPE_ITSYSTEM, jsonObject1.getString("ITSYSVAL")); // 系统名称
System.out.println("角色名称>>>>>>>>>>"+jsonObject1.getString("ROLENAME"));
_tr.put("shape_role", jsonObject1.getString("ROLENAME")); // 角色名称
Map<String, JSONObject> queryRepositoryAttributeById = new RepositoryAttribute().queryRepositoryAttributeById(jsonObject1.getString("PLID"));
String kpi = "";
String institution = "";
if (null != queryRepositoryAttributeById && !queryRepositoryAttributeById.isEmpty()) {
// 获取流程绩效
JSONObject Issuing_department = queryRepositoryAttributeById.get("Process_performance_metrics");
if (null != Issuing_department && !Issuing_department.equals("")) {
JSONArray PUBDEPTJA = Issuing_department.getJSONArray("value");
if (null != PUBDEPTJA && !PUBDEPTJA.isEmpty()) {
for (Object PUBDEPTO : PUBDEPTJA) {
JSONObject PUBDEPTJO = JSONObject.parseObject(String.valueOf(PUBDEPTO));
String dempId = PUBDEPTJO.getString("id");
System.out.println("第一这个是什么呢>>>>>"+dempId);
kpi+=dempId+",";
}
}
}
// 获取相关文件
JSONObject relevant_flies = queryRepositoryAttributeById.get("R_relevant_flies");
if (null != relevant_flies && !relevant_flies.equals("")) {
JSONArray PUBDEPTJA = relevant_flies.getJSONArray("value");
if (null != PUBDEPTJA && !PUBDEPTJA.isEmpty()) {
for (Object PUBDEPTO : PUBDEPTJA) {
JSONObject PUBDEPTJO = JSONObject.parseObject(String.valueOf(PUBDEPTO));
String dempId = PUBDEPTJO.getString("id");
System.out.println("第二这个是什么呢>>>>>"+dempId);
institution+=dempId+",";
}
}
}
}
_tr.put(OutputWordUtil.SHAPE_KPI,kpi);
_tr.put(OutputWordUtil.SHAPE_INSTITUTION,institution);
//获取相关知识
_table.add(_tr);
index++;
}
}
if (_table.size() == 0) {
_table = getEmptyTable("process.bpmn2");
}
@ -246,6 +322,7 @@ public class Report1Gener {
_tr.put(OutputWordUtil.REPOSITORY_NAME, ""); // 流程名称
_tr.put(OutputWordUtil.SERIAL_NUMBER, "");
_tr.put(OutputWordUtil.SHAPE_DESC, ""); // 工作详细描述
_tr.put("shape_role", ""); // 工作详细描述
List<PALMethodAttributeModel> attributes = palMethodModel.getAttributes();
if (attributes != null) {
for (PALMethodAttributeModel attribute : attributes) {
@ -259,16 +336,490 @@ public class Report1Gener {
return table;
}
public JSONObject personalView_right(UserContext uc) {
System.out.println("uc>>>>>>>>"+uc.getUID());
JSONObject ro = new JSONObject(new LinkedHashMap<>());
String positionKeys = null;
String positionVals = null;
Integer i = -1;
String uid = uc.getUID();
String sid = uc.getSessionId();
// 定义用户/岗位流程list用户/岗位流程map
ArrayList<Map> UoPProcessMaps = new ArrayList<>();
HashMap<String, Object> UoPProcessMap = new HashMap<>();
ArrayList<Map> nodeMaps = new ArrayList<>();
ArrayList<Map> nodeAMaps = new ArrayList<>();
ArrayList<Map> nodeBMaps = new ArrayList<>();
HashMap<String, Object> nodeMap = new HashMap<>();
Map nodeTempMap = new HashMap<>();
ArrayList<Map> reRegulationMaps = new ArrayList<>();
ArrayList<Map> reFormMaps = new ArrayList<>();
ArrayList<Map> reIO_L4Maps = new ArrayList<>();
ArrayList<Map> reYSMaps = new ArrayList<>();
ArrayList<Map> tempMaps = new ArrayList<>();
LinkedList<Map> linksMaps = new LinkedList<>();
HashMap<String, Object> linksMap = new HashMap<>();
String path = "";
PALRepositoryModel model = null;
String taskId = "";
String fileType = "";
Integer totalNum = 0;
Integer aNum = 0;
Integer bNum = 0;
Object[] sqlParams = new Object[] {};
// List<RowMap> fileRowMaps = DBSql.getMaps("SELECT
// FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI
// FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' AND FILESTATE='1' ORDER
// BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC");
// List<RowMap> fileRowMaps1 = DBSql.getMaps("SELECT
// FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI
// FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' AND FILESTATE='1' ORDER
// BY PLLEVEL ASC, PLORDERINDEX ASC");
// AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX)
// ASC
UoPProcessMaps = new ArrayList<Map>();
nodeMaps = new ArrayList<Map>();
linksMaps = new LinkedList<Map>();
UoPProcessMap = new HashMap<String, Object>();
String rootuuId = SDK.getRuleAPI().executeAtScript("@uuid()");
UoPProcessMap.put("id", rootuuId);
UoPProcessMap.put("text", "岗位流程");
UoPProcessMap.put("fileType", "UoPProcess");
UoPProcessMaps.add(UoPProcessMap);
long start = System.currentTimeMillis();
ArrayList<String> positionNameList = new ArrayList<>();
// if (nodeRowMap.getString("ROLE").equals(positionID) ||
// nodeRowMap.getString("POST").equals(positionID)) {
String positionName = UserContext.fromUID(uid).getUserModel().getPositionName();
String departName = UserContext.fromUID(uid).getDepartmentModel().getName();
List<RowMap> nodeRowMaps = DBSql.getMaps(
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME,ITSYSVAL FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
+ positionName + "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%' ");
List<RowMap> DepartnodeRowMaps = DBSql.getMaps(
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME,ITSYSVAL FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
+ departName + "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%' ");
System.out.println("=========nodeRowMaps========>"+nodeRowMaps);
System.out.println("=========DepartnodeRowMaps========>"+DepartnodeRowMaps);
for (RowMap nodeRowMap : nodeRowMaps) {
String plId = nodeRowMap.getString("PLID");
RowMap fileRowMap = DBSql.getMap(
"SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '"
+ plId + "'");
if (fileRowMap != null) {
if ("0".equals(fileRowMap.getString("FILESTATE"))) {
continue;
}
nodeMap = new HashMap<String, Object>();
taskId = getLastPublishTaskIdByModelId(plId);
/*
* model = PALRepositoryCache.getCache().get(plId); if (null != model) { if
* (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 } }
*/
path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + plId + "&" + "sid=" + sid + "&" + "taskId="
+ taskId;
nodeMap.put("NODENAME", nodeRowMap.getString("NODENAME"));
nodeMap.put("PLID", plId);
nodeMap.put("PLNAME", nodeRowMap.getString("PLNAME"));
nodeMap.put("NODETYPE", nodeRowMap.getString("NODETYPE"));
nodeMap.put("path", path);
nodeMap.put("ACTIVITYNUMBER", nodeRowMap.getString("ACTIVITYNUMBER"));
nodeMap.put("ACTIVITYDESC", nodeRowMap.getString("ACTIVITYDESC"));
nodeMap.put("ROLENAME", nodeRowMap.getString("ROLE"));
nodeMap.put("POSTNAME", nodeRowMap.getString("POST"));
nodeMap.put("ITSYSVAL", nodeRowMap.getString("ITSYSVAL"));
nodeMaps.add(nodeMap);
UoPProcessMap = new HashMap<String, Object>();
fileType = "process";
/*
* model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID")); if
* (null != model) { if (model.isPublish() || model.isStop()) {//
* 停用或已发布状态查询最新流程手册 taskId = getLastPublishTaskIdByModelId(model.getId()); } }
*/
path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + fileRowMap.getString("FILEID") + "&" + "sid=" + sid + "&" + "taskId="
+ taskId;
UoPProcessMap.put("id", fileRowMap.getString("FILEID"));
UoPProcessMap.put("text", fileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("RELEVANTFILE", fileRowMap.getString("RELEVANTFILE"));
UoPProcessMap.put("SUPPORTFILE", fileRowMap.getString("SUPPORTFILE"));
UoPProcessMap.put("PROCESSKPI", fileRowMap.getString("PROCESSKPI"));
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", rootuuId);
UoPProcessMaps.add(UoPProcessMap);
}
}
for (RowMap nodeRowMap : DepartnodeRowMaps) {
String plId = nodeRowMap.getString("PLID");
RowMap fileRowMap = DBSql.getMap(
"SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '"
+ plId + "'");
if (fileRowMap != null) {
if ("0".equals(fileRowMap.getString("FILESTATE"))) {
continue;
}
nodeMap = new HashMap<String, Object>();
taskId = getLastPublishTaskIdByModelId(plId);
/*
* model = PALRepositoryCache.getCache().get(plId); if (null != model) { if
* (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 } }
*/
path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + plId + "&" + "sid=" + sid + "&" + "taskId="
+ taskId;
nodeMap.put("PLID", plId);
nodeMap.put("NODENAME", nodeRowMap.getString("NODENAME"));
nodeMap.put("PLNAME", nodeRowMap.getString("PLNAME"));
nodeMap.put("NODETYPE", nodeRowMap.getString("NODETYPE"));
nodeMap.put("path", path);
nodeMap.put("ACTIVITYNUMBER", nodeRowMap.getString("ACTIVITYNUMBER"));
nodeMap.put("ACTIVITYDESC", nodeRowMap.getString("ACTIVITYDESC"));
nodeMap.put("ROLENAME", nodeRowMap.getString("ROLE"));
nodeMap.put("POSTNAME", nodeRowMap.getString("POST"));
nodeMap.put("ITSYSVAL", nodeRowMap.getString("ITSYSVAL"));
nodeMaps.add(nodeMap);
UoPProcessMap = new HashMap<String, Object>();
fileType = "process";
/*
* model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID")); if
* (null != model) { if (model.isPublish() || model.isStop()) {//
* 停用或已发布状态查询最新流程手册 taskId = getLastPublishTaskIdByModelId(model.getId()); } }
*/
path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + fileRowMap.getString("FILEID") + "&" + "sid=" + sid + "&" + "taskId="
+ taskId;
UoPProcessMap.put("id", fileRowMap.getString("FILEID"));
UoPProcessMap.put("text", fileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("RELEVANTFILE", fileRowMap.getString("RELEVANTFILE"));
UoPProcessMap.put("SUPPORTFILE", fileRowMap.getString("SUPPORTFILE"));
UoPProcessMap.put("PROCESSKPI", fileRowMap.getString("PROCESSKPI"));
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", rootuuId);
UoPProcessMaps.add(UoPProcessMap);
}
}
long end = System.currentTimeMillis();
System.err.println("个人视图(有权限的流程)查询用时=========>" + (end - start) / 1000 + "");
UoPProcessMaps = UoPProcessMaps.stream()
.collect(collectingAndThen(
toCollection(() -> new TreeSet<>(Comparator.comparing(o -> String.valueOf(o.get("id"))))),
ArrayList::new));
tempMaps = new ArrayList<Map>();
if (nodeMaps.size() == 0) {
ro.put("rootId", "");
UoPProcessMaps = new ArrayList<Map>();
ro.put("nodes", UoPProcessMaps);
linksMaps = new LinkedList<Map>();
ro.put("links", linksMaps);
} else {
for (Map uoPProcessMap : UoPProcessMaps) {
reRegulationMaps = new ArrayList<>();
reFormMaps = new ArrayList<>();
reIO_L4Maps = new ArrayList<>();
reYSMaps = new ArrayList<>();
String FILEID = String.valueOf(uoPProcessMap.get("id"));
fileType = String.valueOf(uoPProcessMap.get("fileType"));
if (fileType.equals("process")) {
String RELEVANTFILE = String.valueOf(uoPProcessMap.get("RELEVANTFILE"));
String SUPPORTFILE = String.valueOf(uoPProcessMap.get("SUPPORTFILE"));
String PROCESSKPI = String.valueOf(uoPProcessMap.get("PROCESSKPI"));
if (null != RELEVANTFILE && !RELEVANTFILE.equals("")) {
String[] reFileIDs = RELEVANTFILE.split(" ");
for (String reFileID : reFileIDs) {
sqlParams = new Object[] { reFileID };
RowMap refileRowMap = DBSql.getMap(
"SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILEID=?",
sqlParams);
if (null != refileRowMap && !refileRowMap.isEmpty()) {
if (refileRowMap.getString("PLMETHODID").equals("control.policy")
&& (refileRowMap.getString("POLICYTYPE").equals("regulation")
|| null == refileRowMap.getString("POLICYTYPE")
|| refileRowMap.getString("POLICYTYPE").equals(""))) {
// && refileRowMap.getString("POLICYTYPE").equals("regulation")
UoPProcessMap = new HashMap<String, Object>();
fileType = "reRegulationFile";
model = PALRepositoryCache.getCache().get(reFileID);
if (null != model) {
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
taskId = getLastPublishTaskIdByModelId(model.getId());
}
}
path = "./w" + "?"
+ "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId;
UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID"));
UoPProcessMap.put("text", refileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", FILEID + "reRegulation");
reRegulationMaps.add(UoPProcessMap);
} else if (refileRowMap.getString("PLMETHODID").equals("data.form")) {
UoPProcessMap = new HashMap<String, Object>();
fileType = "reFormFile";
model = PALRepositoryCache.getCache().get(reFileID);
if (model != null) {
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
taskId = getLastPublishTaskIdByModelId(model.getId());
}
}
path = "./w" + "?"
+ "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId;
UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID"));
UoPProcessMap.put("text", refileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", FILEID + "reForm");
reFormMaps.add(UoPProcessMap);
} else if (refileRowMap.getString("PLMETHODID").equals("control.policy")
&& refileRowMap.getString("POLICYTYPE").equals("I/O_L4")) {
UoPProcessMap = new HashMap<String, Object>();
fileType = "reI/O_L4File";
model = PALRepositoryCache.getCache().get(reFileID);
if (null != model) {
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
taskId = getLastPublishTaskIdByModelId(model.getId());
}
}
path = "./w" + "?"
+ "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId;
UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID"));
UoPProcessMap.put("text", refileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", FILEID + "reI/O_L4");
reIO_L4Maps.add(UoPProcessMap);
}
}
}
}
if (null != SUPPORTFILE && !SUPPORTFILE.equals("")) {
String[] reFileIDs = SUPPORTFILE.split(" ");
for (String reFileID : reFileIDs) {
sqlParams = new Object[] { reFileID };
RowMap refileRowMap = DBSql.getMap(
"SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILEID=?",
sqlParams);
if (null != refileRowMap && !refileRowMap.isEmpty()) {
if (refileRowMap.getString("PLMETHODID").equals("control.policy")
&& (refileRowMap.getString("POLICYTYPE").equals("regulation")
|| null == refileRowMap.getString("POLICYTYPE")
|| refileRowMap.getString("POLICYTYPE").equals(""))) {
// && refileRowMap.getString("POLICYTYPE").equals("regulation")
UoPProcessMap = new HashMap<String, Object>();
fileType = "reRegulationFile";
model = PALRepositoryCache.getCache().get(reFileID);
if (null != model) {
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
taskId = getLastPublishTaskIdByModelId(model.getId());
}
}
path = "./w" + "?"
+ "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId;
UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID"));
UoPProcessMap.put("text", refileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", FILEID + "reRegulation");
reRegulationMaps.add(UoPProcessMap);
} else if (refileRowMap.getString("PLMETHODID").equals("data.form")) {
UoPProcessMap = new HashMap<String, Object>();
fileType = "reFormFile";
model = PALRepositoryCache.getCache().get(reFileID);
if (null != model) {
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
taskId = getLastPublishTaskIdByModelId(model.getId());
}
}
path = "./w" + "?"
+ "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId;
UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID"));
UoPProcessMap.put("text", refileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", FILEID + "reForm");
reFormMaps.add(UoPProcessMap);
} else if (refileRowMap.getString("PLMETHODID").equals("control.policy")
&& refileRowMap.getString("POLICYTYPE").equals("I/O_L4")) {
UoPProcessMap = new HashMap<String, Object>();
fileType = "reI/O_L4File";
model = PALRepositoryCache.getCache().get(reFileID);
if (null != model) {
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
taskId = getLastPublishTaskIdByModelId(model.getId());
}
}
path = "./w" + "?"
+ "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&"
+ "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId;
UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID"));
UoPProcessMap.put("text", refileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", FILEID + "reI/O_L4");
reIO_L4Maps.add(UoPProcessMap);
}
}
}
}
if (null != PROCESSKPI && !PROCESSKPI.equals("")) {
String[] PROCESSKPIIDS = PROCESSKPI.split(" ");
for (String PROCESSKPIID : PROCESSKPIIDS) {
sqlParams = new Object[] { PROCESSKPIID };
RowMap refileRowMap = DBSql.getMap(
"SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILEID=?",
sqlParams);
if (null != refileRowMap && !refileRowMap.isEmpty()) {
UoPProcessMap = new HashMap<String, Object>();
fileType = "processKPIFile";
model = PALRepositoryCache.getCache().get(PROCESSKPIID);
if (null != model) {
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
taskId = getLastPublishTaskIdByModelId(model.getId());
}
}
path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open"
+ "&" + "uuid=" + PROCESSKPIID + "&" + "sid=" + sid + "&" + "taskId="
+ taskId;
UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID"));
UoPProcessMap.put("text", refileRowMap.getString("PLNAME"));
UoPProcessMap.put("path", path);
UoPProcessMap.put("fileType", fileType);
UoPProcessMap.put("PARENTID", FILEID + "reProcessKPI");
reYSMaps.add(UoPProcessMap);
}
}
}
if (null != reRegulationMaps && !reRegulationMaps.isEmpty()) {
UoPProcessMap = new HashMap<String, Object>();
UoPProcessMap.put("id", FILEID + "reRegulation");
UoPProcessMap.put("text", "相关制度");
UoPProcessMap.put("fileType", "reRegulation");
UoPProcessMap.put("PARENTID", FILEID);
reRegulationMaps.add(UoPProcessMap);
}
if (null != reFormMaps && !reFormMaps.isEmpty()) {
UoPProcessMap = new HashMap<String, Object>();
UoPProcessMap.put("id", FILEID + "reForm");
UoPProcessMap.put("text", "相关表单");
UoPProcessMap.put("fileType", "reForm");
UoPProcessMap.put("PARENTID", FILEID);
reFormMaps.add(UoPProcessMap);
}
if (null != reIO_L4Maps && !reIO_L4Maps.isEmpty()) {
UoPProcessMap = new HashMap<String, Object>();
UoPProcessMap.put("id", FILEID + "reI/O_L4");
UoPProcessMap.put("text", "相关操作指导");
UoPProcessMap.put("fileType", "reI/O_L4");
UoPProcessMap.put("PARENTID", FILEID);
reIO_L4Maps.add(UoPProcessMap);
}
if (null != reYSMaps && !reYSMaps.isEmpty()) {
UoPProcessMap = new HashMap<String, Object>();
UoPProcessMap.put("id", FILEID + "reYS");
UoPProcessMap.put("text", "相关要素");
UoPProcessMap.put("fileType", "reYS");
UoPProcessMap.put("PARENTID", FILEID);
reYSMaps.add(UoPProcessMap);
UoPProcessMap = new HashMap<String, Object>();
UoPProcessMap.put("id", FILEID + "reProcessKPI");
UoPProcessMap.put("text", "绩效");
UoPProcessMap.put("fileType", "reProcessKPI");
UoPProcessMap.put("PARENTID", FILEID + "reYS");
reYSMaps.add(UoPProcessMap);
}
tempMaps.addAll(reRegulationMaps);
tempMaps.addAll(reFormMaps);
tempMaps.addAll(reIO_L4Maps);
tempMaps.addAll(reYSMaps);
}
}
UoPProcessMaps.addAll(tempMaps);
if (UoPProcessMaps.size() > 1) {
for (Map uoPProcessMap : UoPProcessMaps) {
if (String.valueOf(uoPProcessMap.get("fileType")).equals("UoPProcess")) {
ro.put("rootId", String.valueOf(uoPProcessMap.get("id")));
}
}
ro.put("nodes", UoPProcessMaps);
for (Map uoPProcessMap : UoPProcessMaps) {
String id = String.valueOf(uoPProcessMap.get("id"));
for (Map pProcessMap : UoPProcessMaps) {
String PARENTID = String.valueOf(pProcessMap.get("PARENTID"));
if (id.equals(PARENTID)) {
String childID = String.valueOf(pProcessMap.get("id"));
linksMap = new LinkedHashMap<String, Object>();
linksMap.put("from", id);
linksMap.put("to", childID);
linksMaps.add(linksMap);
}
}
}
ro.put("links", linksMaps);
} else {
ro.put("rootId", "");
UoPProcessMaps = new ArrayList<Map>();
ro.put("nodes", UoPProcessMaps);
linksMaps = new LinkedList<Map>();
ro.put("links", linksMaps);
}
}
nodeAMaps = new ArrayList<>();
nodeBMaps = new ArrayList<>();
if (null != nodeMaps && !nodeMaps.isEmpty()) {
for (Map nodeReturnMap : nodeMaps) {
nodeTempMap = new HashMap<String, Object>();
String NODETYPE = String.valueOf(nodeReturnMap.get("NODETYPE"));
if (NODETYPE.equals("method_approval_node") || NODETYPE.equals("method_service_node")) {
nodeTempMap = nodeReturnMap;
nodeAMaps.add(nodeTempMap);
} else if (NODETYPE.equals("method_approval_node3") || NODETYPE.equals("method_service_node4")) {
nodeTempMap = nodeReturnMap;
nodeBMaps.add(nodeTempMap);
}
}
}
totalNum = nodeMaps.size();
aNum = nodeAMaps.size();
bNum = nodeBMaps.size();
ro.put("totalNodeNum", totalNum);
ro.put("totalNode", nodeMaps);
ro.put("typeANum", aNum);
ro.put("typeA", nodeAMaps);
ro.put("typeBNum", bNum);
ro.put("typeB", nodeBMaps);
// 岗位流程/我的流程
return ro;
}
/**********************关联AWS组织的excel处理***************************/
/**
* 循环生成多份报告
*
*
* @param tempPath
* @param tempName
* @param docPath
* @param wizardJsonData
*/
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<>();
for (int i = 0; i < targetFileIds.size(); i++) {
@ -285,7 +836,7 @@ public class Report1Gener {
}
});
}
Map<String, Integer> indexMap = new HashMap<String, Integer>();
String reportName = wizardJsonData.getString("reportNameIsItName");
for (RoleModel role : roleList) {
@ -308,8 +859,8 @@ public class Report1Gener {
docName = docPath + shapeName + ".doc";
indexMap.put(shapeName, 1);
}
JSONObject dataMap = getData(role, wizardJsonData);
JSONObject dataMap = getData(role, wizardJsonData,userId);
OutputWordUtil.createDoc2(dataMap, tempPath, tempName, docName);
}
}
@ -320,12 +871,12 @@ public class Report1Gener {
* @param wizardJsonData
* @return
*/
private JSONObject getData(RoleModel role, JSONObject wizardJsonData) {
private JSONObject getData(RoleModel role, JSONObject wizardJsonData,String userId) {
JSONObject dataMap = new JSONObject();
OrReportComment orReportComment = new OrReportComment();
orReportComment.getAwsOrgCommentContent(dataMap, role); // 获取一些公共的数据(手册首页的手册岗位名称部门时间等)
orReportComment.getAwsOrgCommentContent(dataMap, role,userId); // 获取一些公共的数据 (手册首页的手册岗位名称部门时间等)
// 流程表格
JSONArray _table = new JSONArray();
@ -333,6 +884,10 @@ public class Report1Gener {
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
// 循环关联文件
int index = 1;
for (String relationFileId : relationFileIds) {
if (relationFileId.equals("")) {
continue;
@ -367,6 +922,7 @@ public class Report1Gener {
_tr.put(OutputWordUtil.REPOSITORY_NAME, relationModel.getName().toString().replace("\n", "")); // 流程名称
_tr.put(OutputWordUtil.SHAPE_NAME, shapeMap.get("text").toString().replace("\n", OutputWordUtil.WRAPSTRING)); // 步骤名称
JSONArray dataAttributes = (JSONArray) shapeMap.get("attributes");
if (!dataAttributes.isEmpty()) {
for (int i = 0; i < dataAttributes.size(); i++) {
@ -374,6 +930,7 @@ public class Report1Gener {
String attrId = obj.getString("key");
String attrValue = obj.getString("value");
_tr.put("shape_" + attrId, attrValue.replace("\n", OutputWordUtil.WRAPSTRING));
_tr.put("shape_role", "1231231231243"); // 步骤名称
}
}
_table.add(_tr);
@ -390,5 +947,5 @@ public class Report1Gener {
return dataMap;
}
/**********************关联AWS组织的excel处理***************************/
}

View File

@ -12,6 +12,9 @@ import java.util.Set;
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.designer.util.ShapeUtil;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.util.DBSql;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.actionsoft.bpms.org.cache.UserCache;
@ -27,9 +30,9 @@ import org.apache.commons.lang.StringUtils;
public class OrReportComment {
public void getCommentContent(JSONObject dataMap, Map<String, Map<String, Object>> shapesMap, String shapeId) {
public void getCommentContent(JSONObject dataMap, Map<String, Map<String, Object>> shapesMap, String shapeId,String userId) {
Map<String, Object> shapeMap = shapesMap.get(shapeId);
dataMap.put(OutputWordUtil.POSITION, shapeMap.get("name").toString().replace("\n", "")); //岗位名称
dataMap.put(OutputWordUtil.POSITION, UserContext.fromUID(userId).getUserModel().getPositionName()); //岗位名称
//TODO 所属部门/公司
String messageJson = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(null, shapeMap.get("pid").toString());
JSONObject definition = JSONObject.parseObject(messageJson);
@ -49,8 +52,29 @@ public class OrReportComment {
if (deptNames.size() > 0) {
deptName = Joiner.on(",").join(deptNames);
}
dataMap.put(OutputWordUtil.DEPARTMENT, deptName); //所属部门
dataMap.put("role_department", deptName);// 所属部门
dataMap.put(OutputWordUtil.DEPARTMENT, deptName);
//所属部门
UserContext userContext =UserContext.fromUID(userId);
String pathNameOfCache = userContext.getDepartmentModel().getPathNameOfCache();
dataMap.put("role_department", pathNameOfCache);// 所属部门
//这个是获取岗位流程数
String positionName = userContext.getUserModel().getPositionName();
List<RowMap> nodeRowMaps = DBSql.getMaps(
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
+ positionName+ "%'");
List<RowMap> nodeRowMap_process = DBSql.getMaps(
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
+ positionName+ "%'");
List<String> list = new ArrayList<>();
for (RowMap rowMap:
nodeRowMap_process) {
String plid = rowMap.getString("PLID");
if (!list.contains(plid)){
list.add(plid);
}
}
dataMap.put("activity_nums", nodeRowMaps.size());// 参数的活动数
dataMap.put("process_nums", list.size());// 参与的流程数
dataMap.put(OutputWordUtil.COMPANY, "公司"); //所属公司
//创建日期
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
@ -87,8 +111,8 @@ public class OrReportComment {
}
}
public void getAwsOrgCommentContent(JSONObject dataMap, RoleModel role) {
dataMap.put(OutputWordUtil.POSITION, role.getName().replace("\n", "")); //岗位名称// 岗位名称
public void getAwsOrgCommentContent(JSONObject dataMap, RoleModel role,String userId) {
dataMap.put(OutputWordUtil.POSITION, UserContext.fromUID(userId).getUserModel().getPositionName()); //岗位名称// 岗位名称
//TODO 所属部门/公司
dataMap.put(OutputWordUtil.COMPANY, "公司"); // 所属公司
dataMap.put(OutputWordUtil.DEPARTMENT, "部门"); //所属部门
@ -121,8 +145,28 @@ public class OrReportComment {
if (sb.length() > 0) {
departments = sb.substring(0, sb.length() - 1);
}
dataMap.put("role_department", departments);// 所属部门
UserContext userContext = UserContext.fromUID(userId);
DepartmentModel departmentById = SDK.getORGAPI().getDepartmentById(userContext.getDepartmentModel().getId());
String pathNameOfCache = departmentById.getPathNameOfCache();
dataMap.put("role_department", pathNameOfCache);// 所属部门
//这个是获取岗位流程数
String positionName = userContext.getUserModel().getPositionName();
List<RowMap> nodeRowMaps = DBSql.getMaps(
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
+ positionName+ "%'");
List<RowMap> nodeRowMap_process = DBSql.getMaps(
"SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%"
+ positionName+ "%'");
List<String> list_new = new ArrayList<>();
for (RowMap rowMap:
nodeRowMap_process) {
String plid = rowMap.getString("PLID");
if (!list_new.contains(plid)){
list_new.add(plid);
}
}
dataMap.put("activity_nums", nodeRowMaps.size());// 参数的活动数
dataMap.put("process_nums", list.size());// 参与的流程数
//创建日期
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

File diff suppressed because it is too large Load Diff

View File

@ -66,9 +66,11 @@ public class OutputAPIManager {
throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
// --------dc context-----------
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
System.out.println("这是一个什么东西>>>>>>"+dcProfile);
if (dcProfile == null)
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
System.out.println("dc里边的是什么东西>>>>>>>>>>>>"+dcContext);
InputStream in = null;
try {
in = new ByteArrayInputStream(jsonData.getBytes("UTF-8"));
@ -155,7 +157,7 @@ public class OutputAPIManager {
* @param id 任务Id
* @param profileId 报告生成器扩展App的配置Id
*/
public String getWizardJsonData(String wsId, String id, String profileId) throws AWSException {
public String getWizardJsonData(String wsId, String id, String profileId) throws AWSException {
// --------app appProfile----------
OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
if (appProfile == null)