From 2ba17f768be8d4f2214c1595d7195919eced9e07 Mon Sep 17 00:00:00 2001 From: zhal <15900249928@163.com> Date: Tue, 5 Jul 2022 13:56:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=94=99=E8=AF=AF=E6=95=B0=E6=8D=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/coe/pal/CoEPALController.java | 5 + .../pal/repository/job/SynchronousOrgJob.java | 6 +- .../repository/web/CoeProcessLevelWeb.java | 146 +++++++++++++++--- 3 files changed, 130 insertions(+), 27 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java index 02c22dc0..be5d00c4 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java @@ -2900,6 +2900,11 @@ public class CoEPALController { } + @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_create_save_Designer") + public String saveCreatePalProcessLevelRepositoryDesigner(UserContext me, String wsId, String teamId, String category, String method, String parentId, String container,Integer securityLevel,String name) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.saveCreatePalProcessLevelRepositoryDesigner(wsId, teamId, category, method, parentId, container,securityLevel,name); + } /** * 校验重名功能 diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java index b28d11b7..d0f235fa 100644 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java @@ -47,7 +47,7 @@ public class SynchronousOrgJob implements IJob { String plRid1 = UUIDGener.getUUID(); String id1 = UUIDGener.getUUID(); - orgdepartmentList = DBSql.getMaps("select DEPARTMENTNAME,ID,LAYER,PARENTDEPARTMENTID,ORDERINDEX from ORGDEPARTMENT limit 20"); + orgdepartmentList = DBSql.getMaps("select DEPARTMENTNAME,ID,LAYER,PARENTDEPARTMENTID,ORDERINDEX from ORGDEPARTMENT "); Timestamp nowTime = new Timestamp(System.currentTimeMillis()); @@ -190,7 +190,7 @@ public class SynchronousOrgJob implements IJob { if(orgdepartmentList.size()>0){ - for(int i=0;i (sortAttrMap.containsKey(p1.getPropertyId()) ? sortAttrMap.get(p1.getPropertyId()) : 0) - (sortAttrMap.containsKey(p2.getPropertyId()) ? sortAttrMap.get(p2.getPropertyId()) : 0)); - JSONArray repositoryPathData = CoeProcessLevelUtil.getRepositoryPath(m.getId()); - StringBuilder content = new StringBuilder(); StringBuilder sb = new StringBuilder(); JSONObject refs = new JSONObject(); @@ -2614,16 +2612,7 @@ public class CoeProcessLevelWeb extends ActionWeb { boolean isRequired = attributeModel.getIsRequired(); - /****************************************判断如果添加组织架构则修改显示值 by zhaolei*******************************************************************/ - String input = null; - if(attributeModel.getKey().contains("Process_Architecture") && (repositoryPathData.size()!=index)) { - String name = ((JSONObject) repositoryPathData.get(index)).getString("name"); - input=""; - index++; - }else{ - input=""; - } - //String input = ""; + String input = ""; String type = attributeModel.getType(); @@ -8004,6 +7993,120 @@ public class CoeProcessLevelWeb extends ActionWeb { } // 保存文件属性 PALRepositoryAPIManager.getInstance().updateRepositoryProperty(model.getId()); + + + // 小组权限设置 + if (!UtilString.isEmpty(teamId)) { + CoeCooperationAPIManager.getInstance().addRepositoryToTeamAndRolePerm(_uc, teamId, model.getVersionId(), true, true); + } + ro.put("id", id); + // 操作行为日志记录 + if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { + CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_CREATE, CoEOpLogConst.INFO_REPOSITORY_CREATE); + } + + + + + return ro.toString(); + } + + + + public String saveCreatePalProcessLevelRepositoryDesigner(String wsId, String teamId, String category, String method, String parentId, String container,Integer securityLevel,String name){ + ResponseObject ro = ResponseObject.newOkResponse(); + PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel(); + String parentVersionId = ""; + int level = 1; + if (parentId.length() < 36) {// 父节点是大类 + parentVersionId = parentId; + } else { + PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(parentId); + parentVersionId = parentModel.getVersionId(); + level = parentModel.getLevel() + 1; + } + int orderIndex = coeProcessLevel.getChildrenMaxOrderIndexByPidAndWsId(parentId, wsId) + 1; + String uid = _uc.getUID(); + Timestamp nowTime = new Timestamp(System.currentTimeMillis()); + String plRid = UUIDGener.getUUID(); + String id = UUIDGener.getUUID(); + PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, wsId, name, "", orderIndex, parentVersionId, category, true, 1, + id, false, method, "0", level, null, null, uid, uid, nowTime, null, null, null, null, null, null, null, null, null,securityLevel); + // 创建 + try { + coeProcessLevel.insert(model); + // 流程发布用户组权限和父级同步 + PALRepositoryModel parentModel = (PALRepositoryModel) coeProcessLevel.getInstance(parentId); + if (parentModel != null) { + PublishUserGroupPerm dao = new PublishUserGroupPerm(); + List list = dao.getAllPermsByResourceId(parentModel.getVersionId()); + for (PublishUserGroupPermModel parentPModel : list) { + PublishUserGroupPermModel newPModel = new PublishUserGroupPermModel(); + newPModel.setId(UUIDGener.getUUID()); + newPModel.setGroupId(parentPModel.getGroupId()); + newPModel.setPermType(parentPModel.getPermType()); + newPModel.setResourceId(model.getId()); + dao.insert(newPModel); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + // 如果有模板,复制模板中的内容 + if (container != null && !"".equals(container) && !"_blank".equals(container)) { + PALMethodTemplateModel templateModel = PALMethodTemplateCache.getCache().get(container); + BaseModel defineModel; + if (category.contains("bpmn2")) { + defineModel = CoeDesignerUtil.createBPMNModel(model.getId(), 0); + } else { + defineModel = CoeDesignerUtil.createModel(model.getId(), 0); + } + defineModel.setDefinition(copyDefine(model.getId(), templateModel.getDefine().toString())); + if (category.contains("bpmn2")) { + CoeDesignerAPIManager.getInstance().storeDefinitionOfBpmn((BPMNModel) defineModel); + } else { + CoeDesignerAPIManager.getInstance().storeDefinition(defineModel); + } + // 保存模型属性(依照最新的属性进行保存,不再取模板属性) +// String tempId = templateModel.getDefine().getString("uuid"); +// String json = CoePropertyUtil.getPropertyValue(tempId + "_attr"); +// if (!UtilString.isEmpty(json)) { +// JSONArray jsonArr = JSONArray.parseArray(json); +// for (int i = 0; i < jsonArr.size(); i++) { +// JSONObject attribute = jsonArr.getJSONObject(i); +// attribute.put("value", ""); +// } +// try { +// PALRepositoryAPIManager.getInstance().updatePropertysByPLId(model.getId(), jsonArr); +// } catch (SQLException e) { +// e.printStackTrace(); +// } +// } + } + // 保存文件属性 + PALRepositoryAPIManager.getInstance().updateRepositoryProperty(model.getId()); + + JSONArray repositoryPathData = CoeProcessLevelUtil.getRepositoryPath(parentId); + + PALRepositoryPropertyDao propertyDao = new PALRepositoryPropertyDao(); + + + // 一级架构默认值处理 + int index=1; + if(repositoryPathData.size()>0){ + for(int i=0;i0){ - for(int i=0;i groups = methodModel.getGroup(); PALRepositoryPropertyDao dao = new PALRepositoryPropertyDao(); List propertys = dao.getPropertysByPlid(uuid, null); - // 排序 - propertys.sort((p1, p2) -> (sortAttrMap.containsKey(p1.getPropertyId()) ? sortAttrMap.get(p1.getPropertyId()) : 0) - (sortAttrMap.containsKey(p2.getPropertyId()) ? sortAttrMap.get(p2.getPropertyId()) : 0)); Boolean flag1=false; From d7c9511bce536dd7b2ef4b5ed9a341a4b9b7980a Mon Sep 17 00:00:00 2001 From: "mrs_12345@163.com" Date: Tue, 5 Jul 2022 14:09:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?PAL=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=B1=BB=E5=9E=8B=E8=BE=93=E5=85=A5=E6=A1=86id?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index 61130c9e..25bf6629 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -2642,7 +2642,7 @@ public class CoeProcessLevelWeb extends ActionWeb { event = "readonly='readonly' data-value="+ dataArr +" groupPath=\"" + attributeModel.getGroupPath() + "\" ref="+ refObj +" onclick=\"openRelationAwsorgDialog($(this))\""; input = ""; } else if("DateTimePicker".equals(type)) { - input = "" + ""; + input = "" + ""; }else if ("table".equals(type)){ JSONObject table = JSON.parseObject(jsonValue);