Merge branch 'master' of https://e.coding.net/yilidev/yilipalkaifa/apps
This commit is contained in:
commit
c92421bf9e
Binary file not shown.
@ -1,12 +1,17 @@
|
||||
package com.actionsoft.apps.coe.pal.cooperation;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.components.web.PALRepositoryTreeWeb;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.web.CooperationWeb;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.org.dao.User;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Created by sunlh
|
||||
* @Date 2020-12-01
|
||||
@ -202,6 +207,19 @@ public class CooperationController {
|
||||
return web.queryRoleUpdateData(teamId, roleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏角色配置信息
|
||||
* @param uc
|
||||
* @param teamId
|
||||
* @param userid
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.cooperation_hide_role_update_data_query")
|
||||
public String queryHideRoleUpdateData(UserContext uc, String teamId, String userid) {
|
||||
CooperationWeb web = new CooperationWeb(uc);
|
||||
return web.queryHideRoleUpdateData(teamId, userid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设置的小组权限范围内的流程树结构
|
||||
* @param uc
|
||||
@ -308,4 +326,6 @@ public class CooperationController {
|
||||
return web.removeCooperationMember(teamId, userIds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -694,9 +694,8 @@ public class CooperationWeb extends ActionWeb {
|
||||
if (team == null) {
|
||||
return ResponseObject.newErrResponse("保存失败,小组不存在").toString();
|
||||
}
|
||||
Timestamp now = new Timestamp(System.currentTimeMillis());
|
||||
List<CoeCooperationMemberModel> memberList = new ArrayList<>();
|
||||
boolean isOlderVersion = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal", "IsOlderVersion", true);
|
||||
|
||||
if (isOlderVersion){
|
||||
// 查询当前设置的角色
|
||||
String roleId = dataObj.getString("roleId");
|
||||
@ -718,12 +717,7 @@ public class CooperationWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < userIds.size(); i++) {
|
||||
//删除原有角色
|
||||
api.removeCooperationMemeber(teamId,userIds.getString(i));
|
||||
CoeCooperationMemberModel memberModel = new CoeCooperationMemberModel(UUIDGener.getUUID(),teamId,userIds.getString(i),roleId,_uc.getUID(),now,_uc.getUID(),now);
|
||||
memberList.add(memberModel);
|
||||
//重新添加多角色
|
||||
api.createCooperationMemebers(memberList);
|
||||
api.updateCooperationUserRole(teamId, userIds.getString(i), roleId, _uc.getUID());
|
||||
}
|
||||
}else {
|
||||
//设置多角色的校验
|
||||
@ -751,6 +745,8 @@ public class CooperationWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
//设置多角色
|
||||
Timestamp now = new Timestamp(System.currentTimeMillis());
|
||||
List<CoeCooperationMemberModel> memberList = new ArrayList<>();
|
||||
for (int i = 0; i < userIds.size(); i++) {
|
||||
//删除原有角色
|
||||
api.removeCooperationMemeber(teamId,userIds.getString(i));
|
||||
@ -759,9 +755,9 @@ public class CooperationWeb extends ActionWeb {
|
||||
CoeCooperationMemberModel memberModel = new CoeCooperationMemberModel(UUIDGener.getUUID(),teamId,userIds.getString(i),roleId,_uc.getUID(),now,_uc.getUID(),now);
|
||||
memberList.add(memberModel);
|
||||
}
|
||||
//重新添加多角色
|
||||
api.createCooperationMemebers(memberList);
|
||||
}
|
||||
//重新添加多角色
|
||||
api.createCooperationMemebers(memberList);
|
||||
}
|
||||
//更新用户权限缓存
|
||||
CooperationCache.updateTeamInfo(teamId);
|
||||
@ -824,7 +820,7 @@ public class CooperationWeb extends ActionWeb {
|
||||
actionPermOpts.add(actionObj3);
|
||||
}else {
|
||||
JSONObject actionObj1 = new JSONObject();
|
||||
actionObj1.put("value", "新增、修改");
|
||||
actionObj1.put("value", "新建流程");
|
||||
actionObj1.put("label", CoeCooperationConst.ACTION_CREATE_PROCESS);
|
||||
JSONObject actionObj2 = new JSONObject();
|
||||
actionObj2.put("value", "批量创建/替换");
|
||||
@ -834,14 +830,14 @@ public class CooperationWeb extends ActionWeb {
|
||||
|
||||
|
||||
JSONObject actionObj3 = new JSONObject();
|
||||
actionObj1.put("value", "编辑");
|
||||
actionObj1.put("label", CoeCooperationConst.ACTION_WRITE);
|
||||
actionObj3.put("value", "编辑");
|
||||
actionObj3.put("label", CoeCooperationConst.ACTION_WRITE);
|
||||
JSONObject actionObj4 = new JSONObject();
|
||||
actionObj2.put("value", "删除");
|
||||
actionObj2.put("label", CoeCooperationConst.ACTION_DELETE);
|
||||
actionObj4.put("value", "删除");
|
||||
actionObj4.put("label", CoeCooperationConst.ACTION_DELETE);
|
||||
JSONObject actionObj5 = new JSONObject();
|
||||
actionObj3.put("value", "版本管理");
|
||||
actionObj3.put("label", CoeCooperationConst.ACTION_VERSION);
|
||||
actionObj5.put("value", "版本管理");
|
||||
actionObj5.put("label", CoeCooperationConst.ACTION_VERSION);
|
||||
dataActionPermOpts.add(actionObj3);
|
||||
dataActionPermOpts.add(actionObj4);
|
||||
dataActionPermOpts.add(actionObj5);
|
||||
@ -920,6 +916,135 @@ public class CooperationWeb extends ActionWeb {
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户权限信息
|
||||
* @param teamId
|
||||
* @param userid
|
||||
* @return
|
||||
*/
|
||||
public String queryHideRoleUpdateData(String teamId,String userid){
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
CoeCooperationAPIManager api = CoeCooperationAPIManager.getInstance();
|
||||
CoeCooperationTeamModel team = api.queryCooperationTeamById(teamId);
|
||||
if (team == null) {
|
||||
return ResponseObject.newErrResponse("查询失败,小组不存在").toString();
|
||||
}
|
||||
// 1.数据定义
|
||||
String wsId = team.getWsId();// 资产库Id
|
||||
String roleDesc = "";// 角色描述
|
||||
int roleType = CoeCooperationConst.ROLE_TYPE_CUSTOM;
|
||||
List<JSONObject> appPermOpts = new ArrayList<>();// 应用权限选项
|
||||
JSONArray actionPermOpts = new JSONArray();// 操作权限选项
|
||||
boolean isAllDataPerm = false;// 是否有全部数据权限
|
||||
List<String> dataPerm = new ArrayList<>();// 数据权限
|
||||
Map<String,List<String>> dataActionPerm = new HashMap<>(); //数据操作权限
|
||||
JSONArray dataActionPermOpts = new JSONArray();// 操作权限选项
|
||||
List<String> dataPermTextList = new ArrayList<>();// 数据权限文字,用于界面显示
|
||||
boolean isAllAppPerm = false;// 是否有全部应用权限
|
||||
List<String> appPerm = new ArrayList<>();// 应用权限
|
||||
List<String> actionPerm = new ArrayList<>();// 操作权限
|
||||
// 获取应用权限选项范围
|
||||
List<CooperationAppProfile> appList = CooperationAppManager.getList();
|
||||
for (CooperationAppProfile profile : appList) {
|
||||
JSONObject appObj = new JSONObject();
|
||||
appObj.put("value", profile.getTitle());
|
||||
appObj.put("label", profile.getId());
|
||||
appPermOpts.add(appObj);
|
||||
}
|
||||
//权限操作权限options
|
||||
JSONObject actionObj1 = new JSONObject();
|
||||
actionObj1.put("value", "新建流程");
|
||||
actionObj1.put("label", CoeCooperationConst.ACTION_CREATE_PROCESS);
|
||||
JSONObject actionObj2 = new JSONObject();
|
||||
actionObj2.put("value", "批量创建/替换");
|
||||
actionObj2.put("label", CoeCooperationConst.ACTION_BATCH);
|
||||
actionPermOpts.add(actionObj1);
|
||||
actionPermOpts.add(actionObj2);
|
||||
|
||||
//文件数据操作权限option
|
||||
JSONObject actionObj3 = new JSONObject();
|
||||
actionObj3.put("value", "编辑");
|
||||
actionObj3.put("label", CoeCooperationConst.ACTION_WRITE);
|
||||
JSONObject actionObj4 = new JSONObject();
|
||||
actionObj4.put("value", "删除");
|
||||
actionObj4.put("label", CoeCooperationConst.ACTION_DELETE);
|
||||
JSONObject actionObj5 = new JSONObject();
|
||||
actionObj5.put("value", "版本管理");
|
||||
actionObj5.put("label", CoeCooperationConst.ACTION_VERSION);
|
||||
dataActionPermOpts.add(actionObj3);
|
||||
dataActionPermOpts.add(actionObj4);
|
||||
dataActionPermOpts.add(actionObj5);
|
||||
|
||||
//查询隐藏角色
|
||||
CoeCooperationRoleDao roleDao = new CoeCooperationRoleDao();
|
||||
CoeCooperationRoleModel role = roleDao.getCooperationHideRoleByRoleName(teamId,userid);
|
||||
if (role == null) {
|
||||
return ResponseObject.newErrResponse("用户权限不存在").toString();
|
||||
}
|
||||
|
||||
roleDesc = role.getRoleDesc();
|
||||
roleType = role.getRoleType();
|
||||
// 获取模型全部数据权限
|
||||
isAllDataPerm = CoeCooperationConst.PERM_ALL.equalsIgnoreCase(role.getDataPerm());
|
||||
if (!isAllDataPerm) {
|
||||
// 获取小组的数据权限
|
||||
Set<String> teamPermVerIds = CooperationUtil.getPermRepositoryVersionIds(wsId, teamId, null, null);
|
||||
dataPerm = api.queryCooperationRoleDataPerms(teamId, role.getId());
|
||||
for (String palVersionId : dataPerm) {
|
||||
if (teamPermVerIds.contains(palVersionId)) {
|
||||
List<PALRepositoryModel> palRepositoryModels = PALRepositoryCache.getByVersionId(palVersionId);
|
||||
if (palRepositoryModels != null) {
|
||||
for (PALRepositoryModel palModel : palRepositoryModels) {
|
||||
if (palModel.isUse()) {
|
||||
dataPermTextList.add(palModel.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//具体文件的操作权限
|
||||
List<CoeCooperationRolePermModel> rolePermModels = api.queryCooperationRoleDataPermList(teamId, role.getId());
|
||||
for (CoeCooperationRolePermModel rolePermModel : rolePermModels) {
|
||||
dataActionPerm.put(rolePermModel.getPalVersionId(), Arrays.asList(rolePermModel.getActionPerm().split(",").clone()));
|
||||
}
|
||||
}
|
||||
|
||||
// 获取应用权限数据
|
||||
isAllAppPerm = CoeCooperationConst.PERM_ALL.equalsIgnoreCase(role.getAppPerm());
|
||||
if (!isAllAppPerm) {
|
||||
String appPermsStr = role.getAppPerm();
|
||||
if (UtilString.isNotEmpty(appPermsStr)) {
|
||||
appPerm = Arrays.asList(appPermsStr.split(","));
|
||||
}
|
||||
}
|
||||
// 获取操作权限数据
|
||||
String actionPermsStr = role.getActionPerm();
|
||||
if (UtilString.isNotEmpty(actionPermsStr)) {
|
||||
actionPerm = Arrays.asList(actionPermsStr.split(","));
|
||||
}
|
||||
|
||||
ro.put("wsId", wsId);
|
||||
ro.put("roleId", role.getId());
|
||||
ro.put("userid", userid);
|
||||
ro.put("isUser", role.getIsUser());
|
||||
ro.put("roleName", UserCache.getModel(userid).getUserName());
|
||||
ro.put("roleDesc", roleDesc);
|
||||
ro.put("roleType", roleType);
|
||||
ro.put("appPermOpts", appPermOpts);
|
||||
ro.put("actionPermOpts", actionPermOpts);
|
||||
ro.put("isAllDataPerm", isAllDataPerm);
|
||||
ro.put("isAllAppPerm", isAllAppPerm);
|
||||
ro.put("dataPerm", dataPerm);
|
||||
ro.put("dataActionPerm", dataActionPerm);
|
||||
ro.put("dataActionPermOpts", dataActionPermOpts);
|
||||
ro.put("appPerm", appPerm);
|
||||
ro.put("actionPerm", actionPerm);
|
||||
ro.put("dataPermText", StringUtils.join(dataPermTextList, ","));
|
||||
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设置的小组权限范围内的流程树结构
|
||||
* @param wsId
|
||||
|
||||
Binary file not shown.
@ -609,13 +609,7 @@ public class ArisXmlImportRun {
|
||||
for (Object attribute : dataAttributes) {
|
||||
JSONObject obj = (JSONObject) attribute;
|
||||
if (obj.containsKey("attributesJsonArray")) {
|
||||
List<PALMethodAttributeModel> usedAttributeModels = CoeDesignerShapeAPIManager.getInstance().getValidAndUseAttributeModels(wsId, objDefMappingModel.getShapeMethod(), shapeName, objDefMappingModel.getShapeMethod());
|
||||
usedAttributeModels.forEach(item -> {
|
||||
attrDescObj.put("id", item.getKey());
|
||||
attrDescObj.put("value","");
|
||||
});
|
||||
obj.getJSONArray("attributesJsonArray").add(attrDescObj);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ public class ArisXmlImportWeb extends ActionWeb {
|
||||
// 校验xml文档是否能够正常解析
|
||||
Document doc = analysisXMLFile(file.getPath(), true);
|
||||
// String toFilePath = "/Users/sunlh/Documents/ideaData/actionsoft/aws6.4.1.1008.yili2/apps/com.actionsoft.apps.coe.pal.datamigration/testFile/targetFile/";
|
||||
// XMLUtil.writeXml(d, toFilePath + fileName);
|
||||
// XMLUtil.writeXml(doc, toFilePath + fileName);
|
||||
// 解析xml文件
|
||||
if (doc == null) {
|
||||
msg = Constant.LOG_ERROR + "解析XML文件结构," + Constant.IMPORT_STOP_MSG;
|
||||
|
||||
@ -56,6 +56,9 @@ public class Constant {
|
||||
// public static final String METHOD_ARIS_URL = "ARISURL";
|
||||
public static final String METHOD_ARIS_URL = "ARIS";
|
||||
|
||||
// 建模属性代码--IT系统别名
|
||||
public static final String METHOD_OTHER_NAME = "otherName";
|
||||
|
||||
// 存放与流程同名的角色模型的文件夹名称
|
||||
public static final String DEFAULT_FOLDER_NAME = "角色模型";
|
||||
|
||||
|
||||
@ -510,6 +510,15 @@ public class CoeCooperationAPIManager {
|
||||
return new CoeCooperationRoleDao().getCooperationRoleByUser(teamId, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定id的角色
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
public CoeCooperationRoleModel queryCooperationRole(String roleId) {
|
||||
return new CoeCooperationRoleDao().getInstance(roleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小组下的所有角色
|
||||
* 按照管理员/设计人员/浏览人员+剩余角色创建时间倒序排序
|
||||
|
||||
@ -25,6 +25,7 @@ import java.util.*;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationTeamModel;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
|
||||
@ -1181,7 +1182,7 @@ public class NavigationWeb extends ActionWeb {
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
for (int i = 0; i < teamOptions.size(); i++) {
|
||||
String tempTeamId = teamOptions.getJSONObject(i).getString("teamId");
|
||||
Set<String> appPerm = CoeCooperationAPIManager.getInstance().queryAppPerm(tempTeamId, _uc.getUID());
|
||||
Set<String> appPerm = CooperationCache.getUserAPPPermission(tempTeamId, _uc.getUID());
|
||||
JSONArray tempList = new JSONArray();
|
||||
for (int j = 0; j < appList.size(); j++) {
|
||||
JSONObject app = appList.getJSONObject(j);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user