diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index e186c384..858c2790 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/manage/method/PalManageWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/manage/method/PalManageWeb.java index 6bf8a720..16fd33c4 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/manage/method/PalManageWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/manage/method/PalManageWeb.java @@ -14,8 +14,14 @@ import com.actionsoft.apps.coe.pal.pal.method.PALMethodManager; import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryAttributeCache; +import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryShapeAttributeCache; import com.actionsoft.apps.coe.pal.pal.repository.dao.*; +import com.actionsoft.apps.coe.pal.pal.repository.designer.dao.CoeDesignerDefaultDao; +import com.actionsoft.apps.coe.pal.pal.repository.designer.io.file.CoeDesignerFile; +import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager; +import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel; +import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil; import com.actionsoft.apps.coe.pal.pal.repository.model.*; import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil; import com.actionsoft.apps.coe.pal.util.HighSecurityUtil; @@ -73,7 +79,7 @@ public class PalManageWeb extends ActionWeb { super(_uc); this._uc = _uc; } - + protected CoeDesignerFile storer;// 存储操作器 /** * 获取schema中的json * @@ -706,9 +712,16 @@ public class PalManageWeb extends ActionWeb { attributeXmlMap.put(attributeModel.getKey(), map1); } } + + + for (PALRepositoryModel plModel : palList) { + + + CoeDesignerShapeAPIManager.getInstance().updateShapeAttribute(_uc, plModel.getId(), methodId, shapeName, shapeAttrConfigs, attributeXmlMap); } + } // 操作行为日志记录 if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java index 1fdeafc4..9c00b53b 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java @@ -920,6 +920,37 @@ public class PALRepositoryQueryAPIManager { return list; } + public List getPalRepositoryModelsByPidRole(String wsId, String pid,String ruuid) { + List list = new ArrayList(); + + List repositoryModelList = PALRepositoryCache.getAllSubModelsByPid(wsId, pid); + if (repositoryModelList != null) { + for (PALRepositoryModel model : repositoryModelList) { + try { + PALRepositoryModelImpl newModel = ((PALRepositoryModelImpl) model).clone(); + newModel.setNewParentId(pid); + list.add(newModel); + + + + } catch (CloneNotSupportedException e) { + e.printStackTrace(); + } + } + } + + List data = new ArrayList(); + data.add(0, "org.role"); + data.add(1, ruuid); + RowMap rowMap = DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?", data.toString()); + if (rowMap != null) { + PALRepositoryModel roleModel = PALRepositoryCache.getCache().get(rowMap.getString("ID")); + list.add(roleModel); + } + return list; + } + + public void getAllPalRepositoryModelsByPid(String wsId, String pid, List list) { List children = getPalRepositoryModelsByPid(wsId, pid); if (children != null && children.size() > 0) { @@ -1027,6 +1058,63 @@ public class PALRepositoryQueryAPIManager { return list; } + + + public List getUsedPalRepositoryModelsByPidRole(String wsId, String pid,String ruuid) { + List list = getPalRepositoryModelsByPidRole(wsId, pid,ruuid); + List removeList = new ArrayList(); + if (list != null) { + for (PALRepositoryModel model : list) { + if (!model.isUse()) { + removeList.add(model); + } + if(model.getName().equals("岗位模型")){ + removeList.add(model); + } + + } + } + list.removeAll(removeList); + //Collections.sort(list, new Comparator1()); + + /*List data = new ArrayList(); + data.add(0, "org.role"); + data.add(1, ruuid); + RowMap rowMap = DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?", data.toString()); + if (rowMap != null) { + PALRepositoryModel roleModel = PALRepositoryCache.getCache().get(rowMap.getString("ID")); + list.add(roleModel); + }*/ + + return list; + } + + public List getUsedPalRepositoryModelsByPidRoleCorrelation(String wsId, String pid,String ruuid) { + List list = getPalRepositoryModelsByPid(wsId, pid); + List removeList = new ArrayList(); + if (list != null) { + for (PALRepositoryModel model : list) { + if (!model.isUse()) { + removeList.add(model); + } + List data = new ArrayList(); + data.add(0, "org.role"); + data.add(1, ruuid); + RowMap rowMap = DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=? AND ID=?", data.toString(),model.getId()); + if (rowMap == null) { + removeList.add(model); + } + + + } + } + list.removeAll(removeList); + Collections.sort(list, new Comparator1()); + return list; + } + + + /**************************************************** 获取使用中的流程 *****************************************************/ /** @@ -1346,7 +1434,19 @@ public class PALRepositoryQueryAPIManager { return result; } - + /** + * 根据pid获取使用中的流程树(角色模型) + * + * @param wsId 流程库Id + * @param pid 父节点Id + * @return + */ + public JSONArray getUsedPalRepositoryTreeDataByPidRole(UserContext context, String wsId, String pid,String ruuid) { + List list = getUsedPalRepositoryModelsByPidRole(wsId, pid,ruuid); // 根据父节点Id获取使用中的子节点 + //Collections.sort(list, new Comparator1()); // 按级别排序 + JSONArray result = list2JsonRole(context, list, true, false,ruuid); + return result; + } /** * * @param context @@ -1791,7 +1891,121 @@ public class PALRepositoryQueryAPIManager { return jsonArray; } + /**********************************************************筛选角色模型***************************************************/ + /** + * 通过流程model列表,获取流程树的json数组 + * + * @param context + * @param list + * @return + */ + public JSONArray list2JsonRole(UserContext context, List list, boolean isUsed, boolean isPublished,String ruuid) { + return list2JsonRole(context, list, isUsed, isPublished, null, null,ruuid); + } + + private JSONArray list2JsonRole(UserContext context, List list, boolean isUsed, boolean isPublished, String removeIds, String param,String ruuid) { + JSONArray jsonArray = new JSONArray(); + for (PALRepositoryModel model : list) { + + JSONObject object = new JSONObject(); + object.put("id", model.getId().trim()); + object.put("pid", model.getNewParentId().trim()); + if (removeIds != null && removeIds.contains(model.getId().trim())) { + object.put("nocheck", true); + } else { + object.put("nocheck", false); + } + object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim()); + object.put("name", I18nRes.findValue(CoEConstant.APP_ID, context.getLanguage(), model.getName()).trim()); + object.put("wsId", model.getWsId()); + PALMethodModel methodModel = PALMethodCache.getPALMethodModelById(model.getMethodId()); + if (methodModel == null || methodModel.isFolder()) {// 没有该建模方法或者是文件夹类 + object.put("title", object.get("name")); + } else { + object.put("title", object.get("name") + " " + VersionUtil.getVersionStrV(model.getVersion()).trim()); + } + //三员管理文件密级校验 + if (HighSecurityUtil.isON() && HighSecurityUtil.fileSecuritySwitch()){ + ResponseObject responseObject = new CoeProcessLevelWeb(DispatcherRequest.getUserContext()).checkFilePemission(model.getId()); + if (responseObject.isErr() && (methodModel != null && !methodModel.isFolder())){ + object.put("nocheck", true); + } + } + object.put("drop", false); + object.put("isSystemFile", model.isSystemFile()); + object.put("plMethodId", model.getMethodId().trim()); + if (methodModel == null || methodModel.isFolder()) {// 没有该建模方法或者是文件夹类 + object.put("iconFont", ""); + } else { + object.put("iconFont", ""); + } + + if(model.getName().equals("角色模型")){ + object.put("isParent", true); + object.put("open", true); + }else{ + object.put("isParent", false); + object.remove("open"); + } + /*List children = null; + if (isUsed) { + children = getUsedPalRepositoryModelsByPidRoleCorrelation(model.getWsId(), model.getId(),ruuid); + if (param != null && "designer".equals(param) && children != null && children.size() > 0) {// 过滤掉发布版本 + List tempChildren = new ArrayList<>(); + for (PALRepositoryModel model2 : children) { + if (!model2.isPublish()) { + tempChildren.add(model2); + } + } + children = tempChildren; + } + } else if (isPublished) { + children = getPublishedPalRepositoryModelsByPid(model.getWsId(), model.getId()); + } + if (children == null || children.size() == 0) { + object.put("isParent", false); + //String icon = object.getString("icon"); + object.put("leaf", true);// 叶子节点 + // object.put("icon", icon.replace("16.png", "16.leaf.png")); + } else { + object.put("isParent", true); + object.put("open", false); + }*/ + + object.put("plLevel", model.getLevel()); + object.put("plOrdexIndex", model.getOrderIndex()); + object.put("plDiagramUrl", model.getDiagramUrl()); + object.put("isDrops", model.isSystemFile()); + object.put("isPublish", model.isPublish()); + object.put("isStop", model.isStop()); + object.put("isApproval", model.isApproval()); + object.put("ext1", model.getExt1()); + object.put("ext2", model.getExt2()); + object.put("ext3", model.getExt3()); + object.put("ext4", model.getExt4()); + object.put("isUse", model.isUse()); + object.put("url", "./w?sid=" + context.getSessionId() + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_portal_page&ruuid=" + model.getId() + "&type=1&wsid=" + model.getWsId()); + object.put("plCategory", model.getMethodCategory()); + object.put("versionId", model.getVersionId()); + object.put("orderIndex", model.getOrderIndex()); + object.put("isBottomLevel", model.isBottomLevel()); + String dutyDeptId = model.getDutyDept(); + object.put("dutyDeptId", dutyDeptId == null ? "" : dutyDeptId); + String plDutyDeptName = dutyDeptId; + if (!UtilString.isEmpty(dutyDeptId)) { + if (SDK.getORGAPI().getDepartmentById(dutyDeptId) != null) { + plDutyDeptName = SDK.getORGAPI().getDepartmentById(dutyDeptId).getName(); + } + } + object.put("dutyDeptName", UtilString.isEmpty(dutyDeptId) ? "" : plDutyDeptName); + String plDutyPerson = model.getDutyUser(); + object.put("dutyPersonId", model.getDutyUser() == null ? "" : model.getDutyUser()); + object.put("dutyPersionName", UtilString.isEmpty(plDutyPerson) ? "" : SDK.getORGAPI().getUserAliasNames(plDutyPerson)); + jsonArray.add(object); + } + return jsonArray; + } /*********************************************************************重写通过流程model列表,获取流程树的json数组***by zhaolei*****************************************************/ @@ -1874,6 +2088,7 @@ public class PALRepositoryQueryAPIManager { object.put("open", false); } + object.put("open",true); object.put("plLevel", model.getLevel()); object.put("plOrdexIndex", model.getOrderIndex()); object.put("plDiagramUrl", model.getDiagramUrl()); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/dao/PALRepositoryRemoveInfo.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/dao/PALRepositoryRemoveInfo.java index ee9184b6..6eb159e3 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/dao/PALRepositoryRemoveInfo.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/dao/PALRepositoryRemoveInfo.java @@ -271,8 +271,13 @@ public class PALRepositoryRemoveInfo extends DaoObject list = Arrays.asList(versionIdsSql.split(StringPool.COMMA)); + sql.append(" and " + getAppendOrAndInString(list)); + + //sql.append(" and r.PLVERSIONID in (" + versionIdsSql + ")"); } + + if (UtilString.isNotEmpty(searchInput)) { String namelike = ""; if (StringUtil.containSpecialChar(searchInput)) { diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java index ad972851..0d12c2b1 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java @@ -831,54 +831,6 @@ public class DesignerRelationShapeWeb extends ActionWeb { } } macroLibraries.put("treeData", jsonArr_new.toString()); - } else if (attrId.equals("role")) { - if (objects != null) { - for (int i = 0; i < objects.size(); i++) { - JSONObject jsonObject = objects.getJSONObject(i); - String id = jsonObject.getString("id"); - String isParent = jsonObject.getString("isParent"); - - if (isParent != null) { - if (isParent.equals("true")) { - String title=jsonObject.getString("title"); - if(title.equals("角色模型")){ - jsonArr_new.add(objects.getJSONObject(i)); - }else{ - List coeProcessLevelModels = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getCoeProcessLevelByPid(id, wsId); - if (coeProcessLevelModels.size() > 0) { - for (int k = 0; k < coeProcessLevelModels.size(); k++) { - PALRepositoryModel coeProcessLevelModel = coeProcessLevelModels.get(k); - if (coeProcessLevelModel != null) { - List data = new ArrayList(); - data.add(0, "org.role"); - data.add(1, ruuid); - RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", coeProcessLevelModel.getId(), data.toString()); - if (rowMap != null) { - JSONObject json = getJSon(coeProcessLevelModel); - jsonArr_new.add(json); - } - } - } - } - } - - } else { - List data = new ArrayList(); - data.add(0, jsonObject.getString("plMethodId")); - data.add(1, ruuid); - RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", id, data.toString()); - if (rowMap != null) { - jsonArr_new.add(objects.getJSONObject(i)); - } - } - } else { - jsonArr_new.add(objects.getJSONObject(i)); - } - - } - } - macroLibraries.put("treeData", jsonArr_new.toString()); - } else if (attrId.equals("post")) { if (objects != null) { for (int i = 0; i < objects.size(); i++) { @@ -1174,9 +1126,13 @@ public class DesignerRelationShapeWeb extends ActionWeb { controlpmjm2.setOpen(true); jsonArray.add(controlpmjm2); }*/ + JSONArray nodes = null; + if(attrId.equals("role")){ + nodes=PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPidRole(_uc, wsuuid, controlpmjm.getId(),ruuid); + }else{ + nodes = PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPid(_uc, wsuuid, controlpmjm.getId()); + } - - JSONArray nodes = PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPid(_uc, wsuuid, controlpmjm.getId()); for (int i = 0; i < nodes.size(); i++) { JSONObject node = nodes.getJSONObject(i); node.put("url", "./jd?sid=" + _uc.getSessionId() + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_info&ruuid=" + node.getString("id") + "&uuid=" + node.getString("id")); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SystemExceptionFileJob.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SystemExceptionFileJob.java new file mode 100644 index 00000000..6a1e768d --- /dev/null +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SystemExceptionFileJob.java @@ -0,0 +1,45 @@ +package com.actionsoft.apps.coe.pal.pal.repository.job; + +import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; +import com.actionsoft.apps.coe.pal.pal.repository.designer.io.file.CoeDesignerFile; +import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager; +import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel; +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.schedule.IJob; +import com.actionsoft.bpms.util.DBSql; +import com.actionsoft.sdk.local.SDK; +import com.alibaba.fastjson.JSONObject; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import java.util.List; + +public class SystemExceptionFileJob implements IJob { + @Override + public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { + + + List rowMaps=DBSql.getMaps("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLMETHODID='control.policy' "); + + for(int i=0;i