diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar index 6236c599..adcfb585 100644 Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/PublisherController.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/PublisherController.java index ea8ac0ed..bc9ae765 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/PublisherController.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/PublisherController.java @@ -419,6 +419,19 @@ public class PublisherController { return web.getPublisherData(processInstId, wsId); } + + /** + * 获取字表数据 + * @param me + * @param processInstId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal.publisher_data_query_getFile") + public String getPublisherDataGetFile(UserContext me, String processInstId, String wsId) { + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.getPublisherDataGetFile(processInstId, wsId); + } + /** * 是否开启三员管理 * @return diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java index 06d8715b..06df19a9 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java @@ -1073,8 +1073,6 @@ public class ProcessPublishWeb extends ActionWeb { - - /** * 获取有权限的流程树(多个资产库) * @@ -1893,6 +1891,169 @@ public class ProcessPublishWeb extends ActionWeb { return ro.toString(); } + + public String getPublisherDataGetFile(String processInstId, String wsId){ + ResponseObject ro = ResponseObject.newOkResponse(); + boolean closeFormPage = SDK.getAppAPI().getPropertyBooleanValue(PublisherConf.APPID, "closeFormPage", false); + ro.put("closeFormPage", closeFormPage); + JSONObject newObj = new JSONObject(); + JSONObject changeObj = new JSONObject(); + JSONObject stopObj = new JSONObject(); + boolean proNumber = false; + List list = SDK.getTaskQueryAPI().processInstId(processInstId).list(); + + if (!list.isEmpty()) + for (TaskInstance taskIn : list) + if ("obj_87371cad5d54457e8c325c805028a56f".equals(taskIn.getActivityDefId())) + proNumber = true; + ro.put("proNumber", proNumber); + BO publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH").detailByBindId(processInstId); + if (publish != null) { + boolean isEnd = publish.isEnd(); + ro.put("isEnd", isEnd); + String bindId = publish.getBindId(); + BO newBo = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N").detailByBindId(bindId); + if (newBo != null) { + String publishId = newBo.getString("PUBLISHFILEID"); + newObj.put("publishDesc", newBo.getString("PUBLISHDESC")); + newObj.put("publishFileName", newBo.getString("PUBLISHFILENAME")); + newObj.put("publishFileId", newBo.getString("PUBLISHFILEID")); + PALRepositoryModel model = PALRepositoryCache.getCache().get(publishId); + if (model != null) { + String id = model.getId(); + newObj.put("fileVersion", VersionUtil.getVersionStr(model.getVersion())); + newObj.put("methodId", model.getMethodId()); + newObj.put("category", model.getMethodCategory()); + + // List> shapeMessageJson4 = + // getShapeMessageJson4(publishId); + // 当前流程所有节点 + + List shapeIds = new ArrayList<>(); + List> shapeList = CoeDesignerUtil.getShapeMessageJson2(publishId);// 获取所有节点 + if (shapeList != null && shapeList.size() > 0) + for (Map map : shapeList) + shapeIds.add((String) map.get("id")); + + /******************** 附件 ************************/ + // 文件或节点自身附件 + JSONArray js = new JSONArray(); + UpFileDao upFileDao = new UpFileDao(); + StringBuilder sqlWhere = new StringBuilder(); + sqlWhere.append(" and PALREPOSITORYID ='").append(publishId).append("'"); + List fileList = upFileDao.search(sqlWhere.toString()); + if (fileList != null && fileList.size() > 0) + for (UpfileModel upfileModel : fileList) + if ("f".equals(upfileModel.getType())) { + JSONObject jb = new JSONObject(); + String upfileId = upfileModel.getUuid(); + String upFileName = upfileModel.getFileName(); + jb.put("upfileId", upfileId); + jb.put("upFileName", upFileName); + String openUrl = ""; + ResponseObject ros = getUrl("f",jb,upfileModel); + JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); + String url = parseObject.get("url").toString(); + if(url.contains(".xls")) + openUrl= url; + else + openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + url.replace("./", ""); + jb.put("openUrl",openUrl); + js.add(jb.toJSONString()); + } + newObj.put("upfileId", js); + + } else { + newObj.put("fileVersion", "1.0"); + newObj.put("methodId", "1"); + newObj.put("category", "1"); + } + newObj.put("taskId", newBo.getString("TASKID")); + } + BO changeBo = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C").detailByBindId(bindId); + if (changeBo != null) { + String changeId = changeBo.getString("CHANGEFILEID"); + changeObj.put("changeFileName", changeBo.getString("CHANGEFILENAME")); + changeObj.put("changedFileNameNew", changeBo.getString("CHANGEDFILENAMENEW")); + changeObj.put("changeFileId", changeBo.getString("CHANGEFILEID")); + changeObj.put("changedDesc", changeBo.getString("CHANGEDDESC")); + changeObj.put("changedFileIdNew", changeBo.getString("CHANGEDFILEIDNEW")); + changeObj.put("taskId", changeBo.getString("TASKID")); + JSONArray array = new JSONArray(); + PALRepositoryModel model = PALRepositoryCache.getCache().get(changeBo.getString("CHANGEFILEID")); + if (model != null) { + changeObj.put("fileVersion", VersionUtil.getVersionStr(model.getVersion())); + changeObj.put("methodId", model.getMethodId()); + changeObj.put("category", model.getMethodCategory()); + List list2 = PALRepositoryCache.getByVersionId(wsId, model.getVersionId()); + if (list2 != null && list2.size() > 0) + Collections.sort(list2, new Comparator() { + @Override + public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { + return VersionUtil.compareVersionNo(o1.getVersion(), o2.getVersion(), true); //升序 + } + }); + for (PALRepositoryModel model2 : list2) + if (!model2.getId().equals(changeObj.getString("changeFileId")) && !model2.isPublish()) { + JSONObject object = new JSONObject(); + object.put("text", model2.getName()); + object.put("id", model2.getId()); + object.put("version", VersionUtil.getVersionStr(model2.getVersion())); + array.add(object); + } + + + // List> shapeMessageJson4 = + // getShapeMessageJson4(publishId); + // 当前流程所有节点 + + List shapeIds = new ArrayList<>(); + List> shapeList = CoeDesignerUtil.getShapeMessageJson2(changeId);// 获取所有节点 + if (shapeList != null && shapeList.size() > 0) + for (Map map : shapeList) + shapeIds.add((String) map.get("id")); + /******************** 附件 ************************/ + // 文件或节点自身附件 + JSONArray js = new JSONArray(); + UpFileDao upFileDao = new UpFileDao(); + StringBuilder sqlWhere = new StringBuilder(); + sqlWhere.append(" and PALREPOSITORYID ='").append(changeId).append("'"); + List fileList = upFileDao.search(sqlWhere.toString()); + if (fileList != null && fileList.size() > 0) + for (UpfileModel upfileModel : fileList) + if ("f".equals(upfileModel.getType())) { + JSONObject jb = new JSONObject(); + String upfileId = upfileModel.getUuid(); + String upFileName = upfileModel.getFileName(); + jb.put("upfileId", upfileId); + jb.put("upFileName", upFileName); + String openUrl = ""; + ResponseObject ros = getUrl("f",jb,upfileModel); + JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); + String url = parseObject.get("url").toString(); + if(url.contains(".xls")) + openUrl= url; + else + openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + url.replace("./", ""); + jb.put("openUrl",openUrl); + js.add(jb.toJSONString()); + } + changeObj.put("upfileId", js); + } else { + changeObj.put("fileVersion", "1.0"); + changeObj.put("methodId", "1"); + changeObj.put("category", "1"); + } + + } + + } + ro.put("newData", newObj); + ro.put("changeData", changeObj); + ro.put("stopData", stopObj); + return ro.toString(); + } + /** * 查询树结构 * @@ -1926,7 +2087,7 @@ public class ProcessPublishWeb extends ActionWeb { else if ("change".equals(type)) array = getPublishedRepositoryTreeData2(wsId, teamId); else - array = getPublishedRepositoryTreeData(wsId, teamId); + array = getPublishedRepositoryTreeData(wsId, teamId,flag,pid); if (array == null || array.isEmpty()) array = new JSONArray(); ro.put("data", array); @@ -2176,7 +2337,7 @@ public class ProcessPublishWeb extends ActionWeb { * @param teamId * @return */ - private JSONArray getPublishedRepositoryTreeData(String wsId, String teamId) { + private JSONArray getPublishedRepositoryTreeData(String wsId, String teamId,boolean flag,String pid) { PALRepository dao = new PALRepository(); if (UtilString.isNotEmpty(teamId)) { // 小组Id不为空,则需要查询小组授权后的流程库 @@ -2184,7 +2345,7 @@ public class ProcessPublishWeb extends ActionWeb { if (team != null) wsId = team.getWsId(); } - List list = dao.getPublishedRepositoryList(wsId); + List list = dao.getPublishedRepositoryListByStop(wsId); // List versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID()); Set versionIds = CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false); if (UtilString.isNotEmpty(teamId)) @@ -2197,6 +2358,8 @@ public class ProcessPublishWeb extends ActionWeb { } JSONArray treeData = getRepositoryTree(list, wsId, false, true, "-", false); return treeData; + + } @@ -3418,7 +3581,6 @@ public class ProcessPublishWeb extends ActionWeb { if (list != null && list.size() > 0) for (BO bo : list) { ProcessInstance instanceById = SDK.getProcessAPI().getInstanceById(bo.getBindId()); - System.err.println("--------instanceById-------"+instanceById); if (instanceById != null) { if ("terminate".equals(instanceById.getControlState())) { continue;