pal小组缓存重构

This commit is contained in:
446052889@qq.com 2023-10-26 11:18:43 +08:00
parent a8bf6a2b45
commit 3a67cfc45b
119 changed files with 31944 additions and 32244 deletions

View File

@ -1,17 +1,10 @@
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
@ -20,345 +13,360 @@ import java.util.List;
@Controller
public class CooperationController {
/**
* 主页
* @param uc
* @param mainPage
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_main")
public String mainPage(UserContext uc, String mainPage) {
CooperationWeb web = new CooperationWeb(uc);
return web.mainPage(mainPage);
}
/**
* 主页
*
* @param uc
* @param mainPage
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_main")
public String mainPage(UserContext uc, String mainPage) {
CooperationWeb web = new CooperationWeb(uc);
return web.mainPage(mainPage);
}
/**
* 新建修改小组时查询必要数据
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_query")
public String queryTeamCreateOrUpdateData(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryTeamCreateOrUpdateData(teamId);
}
/**
* 新建修改小组时查询必要数据
*
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_query")
public String queryTeamCreateOrUpdateData(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryTeamCreateOrUpdateData(teamId);
}
/**
* 查询PAL用户树
* @param uc
* @param pid
* @param parentType
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_pal_user_tree_subjson")
public String queryPalUserTree(UserContext uc, String pid, String parentType) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryPalUserTree(pid, parentType);
}
/**
* 查询PAL用户树
*
* @param uc
* @param pid
* @param parentType
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_pal_user_tree_subjson")
public String queryPalUserTree(UserContext uc, String pid, String parentType) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryPalUserTree(pid, parentType);
}
/**
* 保存新建修改的小组信息
* @param uc
* @param data
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_save")
public String saveTeamCreateOrUpdateData(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.saveTeamCreateOrUpdateData(data);
}
/**
* 保存新建修改的小组信息
*
* @param uc
* @param data
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_save")
public String saveTeamCreateOrUpdateData(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.saveTeamCreateOrUpdateData(data);
}
/**
* 查询当前用户拥有管理权限的小组
* @param uc
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_info_list")
public String queryManageTeamInfoList(UserContext uc) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryManageTeamInfoList();
}
/**
* 查询当前用户拥有管理权限的小组
*
* @param uc
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_info_list")
public String queryManageTeamInfoList(UserContext uc) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryManageTeamInfoList();
}
/**
* 批量查询小组的授权文件数量
* @param uc
* @param teamIdArr
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_info_perm")
public String queryManageTeamInfoPerm(UserContext uc, String teamIdArr) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryManageTeamInfoPerm(teamIdArr);
}
/**
* 批量查询小组的授权文件数量
*
* @param uc
* @param teamIdArr
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_info_perm")
public String queryManageTeamInfoPerm(UserContext uc, String teamIdArr) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryManageTeamInfoPerm(teamIdArr);
}
/**
* 查询当前用户所在的所有小组
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_joined_team_list_query")
public String queryJoinedTeamList(UserContext uc) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryJoinedTeamList();
}
/**
* 查询当前用户所在的所有小组
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_joined_team_list_query")
public String queryJoinedTeamList(UserContext uc) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryJoinedTeamList();
}
/**
* 对小组进行排序
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_user_team_sort")
public String sortTeam(UserContext uc, String teamIds) {
CooperationWeb web = new CooperationWeb(uc);
return web.sortTeam(teamIds);
}
/**
* 对小组进行排序
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_user_team_sort")
public String sortTeam(UserContext uc, String teamIds) {
CooperationWeb web = new CooperationWeb(uc);
return web.sortTeam(teamIds);
}
/**
* 修改小组的基本信息
* @param uc
* @param data
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_baseinfo_update_save")
public String updateTeamInfo(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.updateTeamInfo(data);
}
/**
* 修改小组的基本信息
*
* @param uc
* @param data
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_baseinfo_update_save")
public String updateTeamInfo(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.updateTeamInfo(data);
}
/**
* 修改小组状态停用/启用
* @param uc
* @param teamId
* @param status 0启用/1停用
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_update_status")
public String updateTeamStatus(UserContext uc, String teamId, int status) {
CooperationWeb web = new CooperationWeb(uc);
return web.updateTeamStatus(teamId, status);
}
/**
* 修改小组状态停用/启用
*
* @param uc
* @param teamId
* @param status 0启用/1停用
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_update_status")
public String updateTeamStatus(UserContext uc, String teamId, int status) {
CooperationWeb web = new CooperationWeb(uc);
return web.updateTeamStatus(teamId, status);
}
/**
* 解散小组
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_remove")
public String removeTeam(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.removeTeam(teamId);
}
/**
* 解散小组
*
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_remove")
public String removeTeam(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.removeTeam(teamId);
}
/**
* 退出小组
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_exit")
public String exitTeam(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.exitTeam(teamId);
}
/**
* 退出小组
*
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_exit")
public String exitTeam(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.exitTeam(teamId);
}
/**
* 查询小组的详细信息成员信息
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_detail_query")
public String queryTeamDetail(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryTeamDetail(teamId);
}
/**
* 查询小组的详细信息成员信息
*
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_detail_query")
public String queryTeamDetail(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryTeamDetail(teamId);
}
/**
* 查询小组角色列表
* @param uc
* @param teamId
* @param userIds
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_data_query")
public String queryRoleData(UserContext uc, String teamId, String userIds) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryRoleData(teamId, userIds);
}
/**
* 查询小组角色列表
*
* @param uc
* @param teamId
* @param userIds
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_data_query")
public String queryRoleData(UserContext uc, String teamId, String userIds) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryRoleData(teamId, userIds);
}
/**
* 修改用户的角色保存
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_user_update_save")
public String saveUserUpdateRole(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.saveUserUpdateRole(data);
}
/**
* 修改用户的角色保存
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_user_update_save")
public String saveUserUpdateRole(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.saveUserUpdateRole(data);
}
/**
* 删除小组角色
* @param uc
* @param teamId
* @param roleId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_remove")
public String removeCooperationRole(UserContext uc, String teamId, String roleId) {
CooperationWeb web = new CooperationWeb(uc);
return web.removeCooperationRole(teamId, roleId);
}
/**
* 删除小组角色
*
* @param uc
* @param teamId
* @param roleId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_remove")
public String removeCooperationRole(UserContext uc, String teamId, String roleId) {
CooperationWeb web = new CooperationWeb(uc);
return web.removeCooperationRole(teamId, roleId);
}
/**
* 新增修改角色信息时查询相关角色信息
* @param uc
* @param teamId
* @param roleId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_create_or_update_data_query")
public String queryRoleUpdateData(UserContext uc, String teamId, String roleId) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryRoleUpdateData(teamId, roleId);
}
/**
* 新增修改角色信息时查询相关角色信息
*
* @param uc
* @param teamId
* @param roleId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_create_or_update_data_query")
public String queryRoleUpdateData(UserContext uc, String teamId, String roleId) {
CooperationWeb web = new CooperationWeb(uc);
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
* @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
* @param wsId
* @param teamId
* @param pid
* @param categorys
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_repository_tree_component_subjson")
public String queryCooperationTeamRepositoryTree(UserContext uc, String wsId, String teamId, String pid, String categorys) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryCooperationTeamRepositoryTree(wsId, teamId, pid, categorys);
}
/**
* 获取设置的小组权限范围内的流程树结构
*
* @param uc
* @param wsId
* @param teamId
* @param pid
* @param categorys
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_repository_tree_component_subjson")
public String queryCooperationTeamRepositoryTree(UserContext uc, String wsId, String teamId, String pid, String categorys) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryCooperationTeamRepositoryTree(wsId, teamId, pid, categorys);
}
/**
* 查询小组权限范围内流程树
* @param uc
* @param wsId
* @param teamId
* @param rootId
* @param categorys
* @param name
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_repository_tree_component_search")
public String searchCooperationTeamRepositoryTreeData(UserContext uc, String wsId, String teamId, String rootId, String categorys, String name) {
CooperationWeb web = new CooperationWeb(uc);
return web.searchCooperationTeamRepositoryTreeData(wsId, teamId, rootId, categorys, name);
}
/**
* 查询小组权限范围内流程树
*
* @param uc
* @param wsId
* @param teamId
* @param rootId
* @param categorys
* @param name
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_repository_tree_component_search")
public String searchCooperationTeamRepositoryTreeData(UserContext uc, String wsId, String teamId, String rootId, String categorys, String name) {
CooperationWeb web = new CooperationWeb(uc);
return web.searchCooperationTeamRepositoryTreeData(wsId, teamId, rootId, categorys, name);
}
/**
* 查询小组权限范围内所有的子节点
* @param uc
* @param wsId
* @param teamId
* @param pid
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_repository_all_childern_data_query")
public String searchCooperationTeamRepositoryAllChildrenData(UserContext uc, String wsId, String teamId, String pid) {
CooperationWeb web = new CooperationWeb(uc);
return web.searchCooperationTeamRepositoryAllChildrenData(wsId, teamId, pid);
}
/**
* 查询小组权限范围内所有的子节点
*
* @param uc
* @param wsId
* @param teamId
* @param pid
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_repository_all_childern_data_query")
public String searchCooperationTeamRepositoryAllChildrenData(UserContext uc, String wsId, String teamId, String pid) {
CooperationWeb web = new CooperationWeb(uc);
return web.searchCooperationTeamRepositoryAllChildrenData(wsId, teamId, pid);
}
/**
* 根据版本号查询当前正在使用中的流程名称
* @param uc
* @param versionIds
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_repository_names_query")
public String queryRepositoryNamesByVersionIds(UserContext uc, String versionIds) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryRepositoryNamesByVersionIds(versionIds);
}
/**
* 根据版本号查询当前正在使用中的流程名称
*
* @param uc
* @param versionIds
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_repository_names_query")
public String queryRepositoryNamesByVersionIds(UserContext uc, String versionIds) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryRepositoryNamesByVersionIds(versionIds);
}
/**
* 新增/修改角色保存
* @param uc
* @param data
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_create_or_update_data_save")
public String saveRoleUpdateData(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.saveRoleUpdateData(data);
}
/**
* 新增/修改角色保存
*
* @param uc
* @param data
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_role_create_or_update_data_save")
public String saveRoleUpdateData(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.saveRoleUpdateData(data);
}
/**
* 添加成员查询未加入小组的PAL用户以及现有的角色列表
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_member_add_data_query")
public String queryCooperationAddMemberData(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryCooperationAddMemberData(teamId);
}
/**
* 添加成员查询未加入小组的PAL用户以及现有的角色列表
*
* @param uc
* @param teamId
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_member_add_data_query")
public String queryCooperationAddMemberData(UserContext uc, String teamId) {
CooperationWeb web = new CooperationWeb(uc);
return web.queryCooperationAddMemberData(teamId);
}
/**
* 添加成员保存
* @param uc
* @param data
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_member_add_data_save")
public String saveCooperationAddMemberData(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.saveCooperationAddMemberData(data);
}
/**
* 添加成员保存
*
* @param uc
* @param data
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_member_add_data_save")
public String saveCooperationAddMemberData(UserContext uc, String data) {
CooperationWeb web = new CooperationWeb(uc);
return web.saveCooperationAddMemberData(data);
}
/**
* 删除小组成员
* @param uc
* @param teamId
* @param userIds
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_member_remove")
public String removeCooperationMember(UserContext uc, String teamId, String userIds) {
CooperationWeb web = new CooperationWeb(uc);
return web.removeCooperationMember(teamId, userIds);
}
/**
* 删除小组成员
*
* @param uc
* @param teamId
* @param userIds
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_member_remove")
public String removeCooperationMember(UserContext uc, String teamId, String userIds) {
CooperationWeb web = new CooperationWeb(uc);
return web.removeCooperationMember(teamId, userIds);
}
/**
* 权限复制
* @param uc
* @param teamId
* @param userid
* @param targetUserid
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_member_perm_copy")
public String copyCooperationMemberPerm(UserContext uc,String teamId,String userid,String targetUserid){
CooperationWeb web = new CooperationWeb(uc);
return web.copyCooperationMemberPerm(teamId,userid,targetUserid);
}
@Mapping("com.actionsoft.apps.coe.pal.cooperation_test")
public String test(UserContext uc) {
ResponseObject ro = ResponseObject.newOkResponse();
List<TeamInfo> allTeamInfo = CooperationCache.getAllTeamInfo();
ro.put("perms",allTeamInfo);
return ro.toString();
}
/**
* 权限复制
*
* @param uc
* @param teamId
* @param userid
* @param targetUserid
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal.cooperation_manage_team_member_perm_copy")
public String copyCooperationMemberPerm(UserContext uc, String teamId, String userid, String targetUserid) {
CooperationWeb web = new CooperationWeb(uc);
return web.copyCooperationMemberPerm(teamId, userid, targetUserid);
}
}

View File

@ -1,245 +1,234 @@
package com.actionsoft.apps.coe.pal.cooperation;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.aslp.ListApps;
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo;
import com.actionsoft.apps.coe.pal.cooperation.dao.*;
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppManager;
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppProfile;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationMemberModel;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRolePermModel;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationTeamModel;
import com.actionsoft.apps.coe.pal.cooperation.util.CooperationUtil;
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.i18n.I18nRes;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.AppAPI;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class CooperationQueryAPIManager {
private CooperationQueryAPIManager(){
private CooperationQueryAPIManager() {
}
}
public static CooperationQueryAPIManager getInstance() {
return CooperationQueryAPIManager.Inner.instance;
}
public static CooperationQueryAPIManager getInstance() {
return Inner.instance;
}
private static class Inner {
private final static CooperationQueryAPIManager instance = new CooperationQueryAPIManager();
}
/**
* 获取小组权限范围内的使用中的流程树根节点
*
* @param wsId
* @param categorys
* @param teamId 小组Id
* @return
*/
public JSONArray getPalRepositoryTreeRoot(String wsId, String categorys, String teamId) {
JSONArray result = new JSONArray();
List<String> palMethodList;
String[] categoryArray;
if (UtilString.isEmpty(categorys)) {// 不指定分类
palMethodList = PALMethodCache.getPALMethodList(true);
if (!UtilString.isEmpty(teamId)) {
palMethodList = PALMethodCache.getPALMethodList(true);
List<String> list = new ArrayList<>();
List<PALRepositoryModel> list1 = CooperationUtil.getPermRepositoryList(wsId, teamId, null, null, true, false);
for (String str : palMethodList) {
for (PALRepositoryModel model : list1) {
if (model.getMethodCategory().equals(str)) {
list.add(str);
break;
}
}
}
palMethodList = list;
}
categoryArray = new String[palMethodList.size()];
palMethodList.toArray(categoryArray);
} else {// 指定分类
categoryArray = categorys.split(",");
}
for (String category : categoryArray) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", category);
jsonObject.put("versionId", category);
String name = I18nRes.findValue(CoEConstant.APP_ID, category);
jsonObject.put("name", name);
JSONObject icon = new JSONObject();
icon.put("icon", "");
icon.put("color", "red");
jsonObject.put("icon", icon);
jsonObject.put("plCategory", category);
List<PALRepositoryModel> list = CooperationUtil.getPermRepositoryList(wsId, teamId, category, null, true, false);
if (list != null && list.size() > 0) {
jsonObject.put("leaf", false);
} else {
jsonObject.put("leaf", true);
}
result.add(jsonObject);
}
return result;
}
/**
* 获取小组权限范围内的使用中的流程树根节点
*
* @param wsId
* @param categorys
* @param teamId 小组Id
* @return
*/
public JSONArray getPalRepositoryTreeRoot(String wsId, String categorys, String teamId) {
JSONArray result = new JSONArray();
List<String> palMethodList;
String[] categoryArray;
if (UtilString.isEmpty(categorys)) {// 不指定分类
palMethodList = PALMethodCache.getPALMethodList(true);
if (!UtilString.isEmpty(teamId)) {
palMethodList = PALMethodCache.getPALMethodList(true);
List<String> list = new ArrayList<>();
List<PALRepositoryModel> list1 = CooperationUtil.getPermRepositoryList(wsId, teamId, null, null, true, false);
for (String str: palMethodList) {
for (PALRepositoryModel model : list1) {
if (model.getMethodCategory().equals(str)) {
list.add(new String(str));
break;
}
}
}
palMethodList = list;
}
categoryArray = new String[palMethodList.size()];
palMethodList.toArray(categoryArray);
} else {// 指定分类
categoryArray = categorys.split(",");
}
for (String category : categoryArray) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", category);
jsonObject.put("versionId", category);
String name = I18nRes.findValue(CoEConstant.APP_ID, category);
jsonObject.put("name", name);
JSONObject icon = new JSONObject();
icon.put("icon", "");
icon.put("color", "red");
jsonObject.put("icon", icon);
jsonObject.put("plCategory", category);
List<PALRepositoryModel> list = CooperationUtil.getPermRepositoryList(wsId, teamId, category, null, true, false);
if (list != null && list.size() > 0) {
jsonObject.put("leaf", false);
} else {
jsonObject.put("leaf", true);
}
result.add(jsonObject);
}
return result;
}
/**
* 根据pid获取符合条件的子流程数据小组权限范围内
*
* @param wsId
* @param teamId
* @param pid
* @return
*/
public JSONArray getUsedPalRepositoryTreeDataByPidNew(String wsId, String teamId, String pid) {
// 获取符合权限的子流程
List<PALRepositoryModel> childrenList = getUsedPalRepositoryModelsByPidNew(wsId, teamId, pid);
CooperationUtil.sortByLevelAndOrderIndex(childrenList);
/**
* 根据pid获取符合条件的子流程数据小组权限范围内
* @param wsId
* @param teamId
* @param pid
* @return
*/
public JSONArray getUsedPalRepositoryTreeDataByPidNew(String wsId, String teamId, String pid) {
// 获取符合权限的子流程
List<PALRepositoryModel> childrenList = getUsedPalRepositoryModelsByPidNew(wsId, teamId, pid);
CooperationUtil.sortByLevelAndOrderIndex(childrenList);
// Map<String, Integer> grandChildrenCountMap = new HashMap<>();
// for (PALRepositoryModel chlidModel : childrenList) {
// List<PALRepositoryModel> grandChildrenList = getUsedPalRepositoryModelsByPidNew(wsId, teamId, chlidModel.getId());
// grandChildrenCountMap.put(chlidModel.getId(), grandChildrenList.size());
// }
JSONArray result = list2JsonNew(childrenList);
return result;
}
// Map<String, Integer> grandChildrenCountMap = new HashMap<>();
// for (PALRepositoryModel chlidModel : childrenList) {
// List<PALRepositoryModel> grandChildrenList = getUsedPalRepositoryModelsByPidNew(wsId, teamId, chlidModel.getId());
// grandChildrenCountMap.put(chlidModel.getId(), grandChildrenList.size());
// }
JSONArray result = list2JsonNew(childrenList);
return result;
}
/**
* 获取某个流程的使用中的子流程小组权限范围内
*
* @param wsId
* @param pid
* @return
*/
public List<PALRepositoryModel> getUsedPalRepositoryModelsByPidNew(String wsId, String teamId, String pid) {
if (UtilString.isEmpty(teamId)) {
return PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryModelsByPid(wsId, pid);
} else {
List<PALRepositoryModel> result = new ArrayList<>();
// 获取权限versionIds
// Set<String> permVerIds = CooperationUtil.getPermRepositoryVersionIds(wsId, teamId, null, null);
// 获取已设置的权限versionId
Set<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationTeamPermVerIds(teamId);
if (versionIds.size() > 0) {
getPermRepositoryByPid(wsId, pid, versionIds, true, false, new HashSet<>(), result);
}
return result;
}
}
/**
* 获取某个流程的使用中的子流程小组权限范围内
*
* @param wsId
* @param pid
* @return
*/
public List<PALRepositoryModel> getUsedPalRepositoryModelsByPidNew(String wsId, String teamId, String pid) {
if (UtilString.isEmpty(teamId)) {
return PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryModelsByPid(wsId, pid);
} else {
List<PALRepositoryModel> result = new ArrayList<>();
// 获取权限versionIds
// Set<String> permVerIds = CooperationUtil.getPermRepositoryVersionIds(wsId, teamId, null, null);
// 获取已设置的权限versionId
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationTeamPermVerIds(teamId);
if (versionIds.size() > 0) {
getPermRepositoryByPid(wsId, pid, versionIds, true, false, new HashSet<>(), result);
}
return result;
}
}
/**
* 根据父节点获取权限范围内的子流程小组权限范围内
*
* @param wsId
* @param pid
* @param permVersionIds 权限versionIds
* @param isUse
* @param isPublish
* @param verIds 给一个空的Set,防止数据造成的死循环
* @param result 结果集
*/
private void getPermRepositoryByPid(String wsId, String pid, Set<String> permVersionIds, boolean isUse, boolean isPublish, Set<String> verIds, List<PALRepositoryModel> result) {
List<PALRepositoryModel> childList = PALRepositoryCache.getAllSubModelsByPid(wsId, pid);
if (childList != null && childList.size() > 0) {
for (PALRepositoryModel model : childList) {
if (verIds.contains(model.getVersionId())) {
//防止无限循环
continue;
}
if (isUse) {
if (model.isUse()) {// 设计中的流程是连贯的与发布不同
verIds.add(model.getVersionId());
if (permVersionIds.contains(model.getVersionId())) {
result.add(model);
} else {
getPermRepositoryByPid(wsId, model.getId(), permVersionIds, isUse, isPublish, verIds, result);
}
}
} else if (isPublish) {
if (model.isPublish() && permVersionIds.contains(model.getVersionId())) {
verIds.add(model.getVersionId());
result.add(model);
} else {
getPermRepositoryByPid(wsId, model.getId(), permVersionIds, isUse, isPublish, verIds, result);
}
}
}
}
}
/**
* 根据父节点获取权限范围内的子流程小组权限范围内
* @param wsId
* @param pid
* @param permVersionIds 权限versionIds
* @param isUse
* @param isPublish
* @param verIds 给一个空的Set,防止数据造成的死循环
* @param result 结果集
*/
private void getPermRepositoryByPid(String wsId, String pid, List<String> permVersionIds, boolean isUse, boolean isPublish, Set<String> verIds, List<PALRepositoryModel> result) {
List<PALRepositoryModel> childList = PALRepositoryCache.getAllSubModelsByPid(wsId, pid);
if (childList != null && childList.size() > 0) {
for (PALRepositoryModel model : childList) {
if (verIds.contains(model.getVersionId())) {
//防止无限循环
continue;
}
if (isUse) {
if (model.isUse()) {// 设计中的流程是连贯的与发布不同
verIds.add(model.getVersionId());
if (permVersionIds.contains(model.getVersionId())) {
result.add(model);
} else {
getPermRepositoryByPid(wsId, model.getId(), permVersionIds, isUse, isPublish, verIds, result);
}
}
} else if (isPublish) {
if (model.isPublish() && permVersionIds.contains(model.getVersionId())) {
verIds.add(model.getVersionId());
result.add(model);
} else {
getPermRepositoryByPid(wsId, model.getId(), permVersionIds, isUse, isPublish, verIds, result);
}
}
}
}
}
/**
* 新的流程树list转换json方法
*
* @param list
* @param childrenCountMap list中的model是否具有子节点map记录
* @return
*/
private JSONArray list2JsonNew(List<PALRepositoryModel> list) {
JSONArray jsonArray = new JSONArray();
for (PALRepositoryModel model : list) {
JSONObject object = new JSONObject();
object.put("id", model.getVersionId().trim());
object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim());
object.put("name", I18nRes.findValue(CoEConstant.APP_ID, model.getName()).trim());
object.put("wsId", model.getWsId());
object.put("isSystemFile", model.isSystemFile());
object.put("plMethodId", model.getMethodId().trim());
JSONObject icon = new JSONObject();// vue
if (!"default".equals(model.getMethodId())) {
if (PALMethodCache.getPALMethodModelById(model.getMethodId()) == null) {
object.put("iconFont", "&#58930;");
icon.put("icon", "&#58930;");
icon.put("color", "#ff9421");
} else {
object.put("iconFont", "&#59101;");
icon.put("icon", "&#xe705;");
icon.put("color", "#909399");
}
} else {
object.put("iconFont", "&#58930;");
icon.put("icon", "&#58930;");
icon.put("color", "#ff9421");
}
object.put("icon", icon);
List<PALRepositoryModel> children = null;
if (PALRepositoryCache.getByPid(model.getWsId(), model.getId()).hasNext()) {
object.put("leaf", false);// 非叶子节点
} else {
object.put("leaf", true);// 叶子节点
}
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("plCategory", model.getMethodCategory());
object.put("versionId", model.getVersionId());
object.put("orderIndex", model.getOrderIndex());
object.put("isBottomLevel", model.isBottomLevel());
jsonArray.add(object);
}
return jsonArray;
}
/**
* 新的流程树list转换json方法
* @param list
* @param childrenCountMap list中的model是否具有子节点map记录
* @return
*/
private JSONArray list2JsonNew(List<PALRepositoryModel> list) {
JSONArray jsonArray = new JSONArray();
for (PALRepositoryModel model : list) {
JSONObject object = new JSONObject();
object.put("id", model.getVersionId().trim());
object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim());
object.put("name", I18nRes.findValue(CoEConstant.APP_ID, model.getName()).trim());
object.put("wsId", model.getWsId());
object.put("isSystemFile", model.isSystemFile());
object.put("plMethodId", model.getMethodId().trim());
JSONObject icon = new JSONObject();// vue
if (!"default".equals(model.getMethodId())) {
if (PALMethodCache.getPALMethodModelById(model.getMethodId()) == null) {
object.put("iconFont", "&#58930;");
icon.put("icon", "&#58930;");
icon.put("color", "#ff9421");
} else {
object.put("iconFont", "&#59101;");
icon.put("icon", "&#xe705;");
icon.put("color", "#909399");
}
} else {
object.put("iconFont", "&#58930;");
icon.put("icon", "&#58930;");
icon.put("color", "#ff9421");
}
object.put("icon", icon);
List<PALRepositoryModel> children = null;
if (PALRepositoryCache.getByPid(model.getWsId(), model.getId()).hasNext()) {
object.put("leaf", false);// 非叶子节点
} else {
object.put("leaf", true);// 叶子节点
}
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("plCategory", model.getMethodCategory());
object.put("versionId", model.getVersionId());
object.put("orderIndex", model.getOrderIndex());
object.put("isBottomLevel", model.isBottomLevel());
jsonArray.add(object);
}
return jsonArray;
}
private static class Inner {
private final static CooperationQueryAPIManager instance = new CooperationQueryAPIManager();
}
}

View File

@ -1,7 +1,5 @@
package com.actionsoft.apps.coe.pal.cooperation.dto;
import org.apache.xpath.operations.Bool;
import java.util.ArrayList;
import java.util.List;
@ -12,153 +10,149 @@ import java.util.List;
*/
public class CooperationManageListTeamMemberDto {
private String userId;
private String userName;
private String deptId;
private String deptName;
private String email;
private Boolean close;
private String userId;
private String userName;
private String deptId;
private String deptName;
private String email;
private Boolean close;
private String teamId;
private String teamName;
private String roleId;
private String roleName;
private int roleType;
private List<Integer> roleTypes = new ArrayList<>();
private List<String> roleIds = new ArrayList<>();
private boolean isOlderVersion;
private boolean hasUserPerm;
private String teamId;
private String teamName;
private String roleId;
private String roleName;
private int roleType;
private List<Integer> roleTypes = new ArrayList<>();
private List<String> roleIds = new ArrayList<>();
private List<String> roleNames = new ArrayList<>();
private boolean hasUserPerm;
public CooperationManageListTeamMemberDto() {
}
public CooperationManageListTeamMemberDto() {
}
public String getUserId() {
return userId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDeptId() {
return deptId;
}
public String getDeptId() {
return deptId;
}
public void setDeptId(String deptId) {
this.deptId = deptId;
}
public void setDeptId(String deptId) {
this.deptId = deptId;
}
public String getDeptName() {
return deptName;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getEmail() {
return email;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTeamId() {
return teamId;
}
public String getTeamId() {
return teamId;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public String getTeamName() {
return teamName;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getRoleId() {
return roleId;
}
public String getRoleId() {
return roleId;
}
public void setRoleId(String roleId) {
this.roleId = roleId;
}
public void setRoleId(String roleId) {
this.roleId = roleId;
}
public String getRoleName() {
return roleName;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public void addRoleName(String roleName) {
this.roleName = this.roleName == null ? roleName : this.roleName + ","+ roleName;
}
public List<Integer> getRoleTypes() {
return roleTypes;
}
public List<Integer> getRoleTypes() {
return roleTypes;
}
public void setRoleTypes(List<Integer> roleTypes) {
this.roleTypes = roleTypes;
}
public void setRoleTypes(List<Integer> roleTypes) {
this.roleTypes = roleTypes;
}
public int getRoleType() {
int num = 3;
for (Integer roleType : this.roleTypes) {
if (num > roleType) {
num = roleType;
}
}
return num;
}
public int getRoleType() {
int num = 3;
for (Integer roleType : this.roleTypes) {
if (num > roleType){
num = roleType;
}
}
return num;
}
public void setRoleType(int roleType) {
this.roleType = roleType;
}
public void setRoleType(int roleType) {
this.roleType = roleType;
}
public Boolean getClose() {
return close;
}
public Boolean getClose() {
return close;
}
public void setClose(Boolean close) {
this.close = close;
}
public void setClose(Boolean close) {
this.close = close;
}
public List<String> getRoleIds() {
return roleIds;
}
public List<String> getRoleIds() {
return roleIds;
}
public void setRoleIds(List<String> roleIds) {
this.roleIds = roleIds;
}
public void setRoleIds(List<String> roleIds) {
this.roleIds = roleIds;
}
public boolean getHasUserPerm() {
return hasUserPerm;
}
public boolean getIsOlderVersion() {
return isOlderVersion;
}
public void setHasUserPerm(boolean hasUserPerm) {
this.hasUserPerm = hasUserPerm;
}
public void setIsOlderVersion(boolean olderVersion) {
isOlderVersion = olderVersion;
}
public List<String> getRoleNames() {
return roleNames;
}
public boolean getHasUserPerm() {
return hasUserPerm;
}
public void setHasUserPerm(boolean hasUserPerm) {
this.hasUserPerm = hasUserPerm;
}
public void setRoleNames(List<String> roleNames) {
this.roleNames = roleNames;
}
}

View File

@ -1,37 +1,39 @@
package com.actionsoft.apps.coe.pal.cooperation.plugins;
import com.actionsoft.apps.coe.pal.cooperation.aslp.ListApps;
import com.actionsoft.apps.coe.pal.cooperation.aslp.RegisterApp;
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
import com.actionsoft.apps.coe.pal.cooperation.dc.FileProcessor;
import com.actionsoft.apps.listener.PluginListener;
import com.actionsoft.apps.resource.AppContext;
import com.actionsoft.apps.resource.plugin.profile.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.actionsoft.apps.coe.pal.cooperation.aslp.ListApps;
import com.actionsoft.apps.coe.pal.cooperation.aslp.RegisterApp;
import com.actionsoft.apps.coe.pal.cooperation.dc.FileProcessor;
import com.actionsoft.apps.listener.PluginListener;
import com.actionsoft.apps.resource.AppContext;
import com.actionsoft.apps.resource.plugin.profile.ASLPPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.AWSPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.AppExtensionProfile;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
/**
* @Created by sunlh
* @Date 2020-12-01
*/
public class Plugins implements PluginListener {
@Override
public List<AWSPluginProfile> register(AppContext app) {
List<AWSPluginProfile> list = new ArrayList<>();
list.add(new ASLPPluginProfile("registerApp", RegisterApp.class.getName(), "开发者注册流程团队扩展App", null));
list.add(new ASLPPluginProfile("listApps", ListApps.class.getName(), "列出已注册的流程团队扩展App", null));
list.add(new DCPluginProfile("teamworkUpgradeLog", FileProcessor.class.getName(), "[流程团队][小组/权限数据]自动更新到[PAL小组]", false, false));
@Override
public List<AWSPluginProfile> register(AppContext app) {
List<AWSPluginProfile> list = new ArrayList<>();
list.add(new ASLPPluginProfile("registerApp", RegisterApp.class.getName(), "开发者注册流程团队扩展App", null));
list.add(new ASLPPluginProfile("listApps", ListApps.class.getName(), "列出已注册的流程团队扩展App", null));
list.add(new DCPluginProfile("teamworkUpgradeLog", FileProcessor.class.getName(), "[流程团队][小组/权限数据]自动更新到[PAL小组]", false, false));
Map<String, Object> params2 = new HashMap<String, Object>();
params2.put("title", "回收站");
params2.put("id", "recycle");// 回收站标识
params2.put("desc", "浏览和编辑流程回收站内容");
params2.put("deletedClass", "");
list.add(new AppExtensionProfile("PAL小组->回收站", "aslp://com.actionsoft.apps.coe.pal.cooperation/registerApp", params2));
Map<String, Object> params2 = new HashMap<String, Object>();
params2.put("title", "回收站");
params2.put("id", "recycle");// 回收站标识
params2.put("desc", "浏览和编辑流程回收站内容");
params2.put("deletedClass", "");
list.add(new AppExtensionProfile("PAL小组->回收站", "aslp://com.actionsoft.apps.coe.pal.cooperation/registerApp", params2));
return list;
}
return list;
}
}

View File

@ -1,5 +1,13 @@
package com.actionsoft.apps.coe.pal.cooperation.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
import com.actionsoft.apps.coe.pal.pal.method.PALMethodManager;
@ -12,166 +20,168 @@ import com.actionsoft.i18n.I18nRes;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
public class CooperationUtil {
/**
* 统计个人权限下的模型文件的建模大类和建模方法分类
* 不作为个人是否有某建模方法判断依据仅根据已有数据进行统计
* @param wsId
* @param teamId
*/
public static List<JSONObject> getRepositoryCategoryAndMethods(String wsId, String teamId) {
List<JSONObject> result = new ArrayList<>();
List<String> palMethodCategoryList = PALMethodCache.getPALMethodList(true);// 获取建模标准大类
Set<String> categorys = new HashSet<>();
Set<String> methods = new HashSet<>();
if (UtilString.isNotEmpty(teamId)) {
Set<String> versionIds = getPermRepositoryVersionIds(wsId, teamId, null, null);
for (String versionId : versionIds) {
List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(versionId);
if (list != null && list.size() > 0) {
PALRepositoryModel model = list.get(0);
categorys.add(model.getMethodCategory());
methods.add(model.getMethodId());
}
}
} else {
methods.add("default");// 文件夹分类
}
for (String category : palMethodCategoryList) {
if (UtilString.isNotEmpty(teamId) && !categorys.contains(category)) {
continue;
}
JSONObject categoryObj = new JSONObject();
String name = I18nRes.findValue(CoEConstant.APP_ID, category);
categoryObj.put("category", category);
categoryObj.put("id", category);
categoryObj.put("name", name);
categoryObj.put("method", new JSONArray());
if ("process".equals(category) && methods.contains("default")) {// 文件夹特殊分类特殊处理
JSONObject methodObj = new JSONObject();
methodObj.put("app", CoEConstant.APP_ID);
methodObj.put("category", category);
methodObj.put("categoryName", I18nRes.findValue(CoEConstant.APP_ID, category));
methodObj.put("method", "default");
methodObj.put("id", "default");
methodObj.put("name", "文件夹");
JSONObject icon = PALMethodManager.getInstance().getPALMethodIconById("default");
methodObj.put("icon", icon);
categoryObj.getJSONArray("method").add(methodObj);
}
List<PALMethodModel> list = PALMethodCache.getPALMethodModelListByMethod(category);// 建模分类
for (PALMethodModel model : list) {
if (UtilString.isNotEmpty(teamId) && !methods.contains(model.getId())) {
continue;
}
JSONObject methodObj = new JSONObject();
methodObj.put("app", model.getApp().getId());
methodObj.put("category", category);
methodObj.put("categoryName", I18nRes.findValue(CoEConstant.APP_ID, category));
methodObj.put("method", model.getId());
methodObj.put("id", model.getId());
methodObj.put("name", I18nRes.findValue(CoEConstant.APP_ID, model.getId()));
JSONObject icon = PALMethodManager.getInstance().getPALMethodIconById(model.getId());
methodObj.put("icon", icon);
categoryObj.getJSONArray("method").add(methodObj);
}
result.add(categoryObj);
}
return result;
}
/**
* 统计个人权限下的模型文件的建模大类和建模方法分类
* 不作为个人是否有某建模方法判断依据仅根据已有数据进行统计
*
* @param wsId
* @param teamId
*/
public static List<JSONObject> getRepositoryCategoryAndMethods(String wsId, String teamId) {
List<JSONObject> result = new ArrayList<>();
List<String> palMethodCategoryList = PALMethodCache.getPALMethodList(true);// 获取建模标准大类
Set<String> categorys = new HashSet<>();
Set<String> methods = new HashSet<>();
if (UtilString.isNotEmpty(teamId)) {
Set<String> versionIds = getPermRepositoryVersionIds(wsId, teamId, null, null);
for (String versionId : versionIds) {
List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(versionId);
if (list != null && list.size() > 0) {
PALRepositoryModel model = list.get(0);
categorys.add(model.getMethodCategory());
methods.add(model.getMethodId());
}
}
} else {
methods.add("default");// 文件夹分类
}
for (String category : palMethodCategoryList) {
if (UtilString.isNotEmpty(teamId) && !categorys.contains(category)) {
continue;
}
JSONObject categoryObj = new JSONObject();
String name = I18nRes.findValue(CoEConstant.APP_ID, category);
categoryObj.put("category", category);
categoryObj.put("id", category);
categoryObj.put("name", name);
categoryObj.put("method", new JSONArray());
if ("process".equals(category) && methods.contains("default")) {// 文件夹特殊分类特殊处理
JSONObject methodObj = new JSONObject();
methodObj.put("app", CoEConstant.APP_ID);
methodObj.put("category", category);
methodObj.put("categoryName", I18nRes.findValue(CoEConstant.APP_ID, category));
methodObj.put("method", "default");
methodObj.put("id", "default");
methodObj.put("name", "文件夹");
JSONObject icon = PALMethodManager.getInstance().getPALMethodIconById("default");
methodObj.put("icon", icon);
categoryObj.getJSONArray("method").add(methodObj);
}
List<PALMethodModel> list = PALMethodCache.getPALMethodModelListByMethod(category);// 建模分类
for (PALMethodModel model : list) {
if (UtilString.isNotEmpty(teamId) && !methods.contains(model.getId())) {
continue;
}
JSONObject methodObj = new JSONObject();
methodObj.put("app", model.getApp().getId());
methodObj.put("category", category);
methodObj.put("categoryName", I18nRes.findValue(CoEConstant.APP_ID, category));
methodObj.put("method", model.getId());
methodObj.put("id", model.getId());
methodObj.put("name", I18nRes.findValue(CoEConstant.APP_ID, model.getId()));
JSONObject icon = PALMethodManager.getInstance().getPALMethodIconById(model.getId());
methodObj.put("icon", icon);
categoryObj.getJSONArray("method").add(methodObj);
}
result.add(categoryObj);
}
return result;
}
/**
* 获取所有有权限的模型文件的versionId
* @param wsId 资产库Id
* @param teamId 小组Id
* @param category 建模方法大类可为null
* @param method 模型分类可为null
* @return
*/
public static Set<String> getPermRepositoryVersionIds(String wsId, String teamId, String category, String method) {
Set<String> result = new HashSet<>();
Iterator<PALRepositoryModel> iterator = PALRepositoryCache.getByWsId(wsId);
while (iterator.hasNext()) {
PALRepositoryModel model = iterator.next();
if (!result.contains(model.getVersionId())) {
if (UtilString.isNotEmpty(method)) {// 先判断建模分类是否符合
if (model.getMethodId().equals(method)) {
result.add(model.getVersionId());
}
} else if (UtilString.isNotEmpty(category)){// 再判断建模分类是否符合
if (model.getMethodCategory().equals(category)) {
result.add(model.getVersionId());
}
} else {
result.add(model.getVersionId());
}
}
}
// 小组数据权限范围+该角色当前用户所属角色下的数据权限交集
if (!UtilString.isEmpty(teamId)) {
List<String> permVerList = CoeCooperationAPIManager.getInstance().queryCooperationTeamPermVerIds(teamId);
Set<String> versionIds = new HashSet<>();
if (result.size() > 0) {
for (String verId : result) {
if (permVerList.contains(verId)) {
versionIds.add(verId);
}
}
}
result = versionIds;
}
return result;
}
/**
* 获取所有有权限的模型文件的versionId
*
* @param wsId 资产库Id
* @param teamId 小组Id
* @param category 建模方法大类可为null
* @param method 模型分类可为null
* @return
*/
public static Set<String> getPermRepositoryVersionIds(String wsId, String teamId, String category, String method) {
Set<String> result = new HashSet<>();
Iterator<PALRepositoryModel> iterator = PALRepositoryCache.getByWsId(wsId);
while (iterator.hasNext()) {
PALRepositoryModel model = iterator.next();
if (!result.contains(model.getVersionId())) {
if (UtilString.isNotEmpty(method)) {// 先判断建模分类是否符合
if (model.getMethodId().equals(method)) {
result.add(model.getVersionId());
}
} else if (UtilString.isNotEmpty(category)) {// 再判断建模分类是否符合
if (model.getMethodCategory().equals(category)) {
result.add(model.getVersionId());
}
} else {
result.add(model.getVersionId());
}
}
}
// 小组数据权限范围+该角色当前用户所属角色下的数据权限交集
if (!UtilString.isEmpty(teamId)) {
Set<String> permVerList = CoeCooperationAPIManager.getInstance().queryCooperationTeamPermVerIds(teamId);
Set<String> versionIds = new HashSet<>();
if (result.size() > 0) {
for (String verId : result) {
if (permVerList.contains(verId)) {
versionIds.add(verId);
}
}
}
result = versionIds;
}
return result;
}
/**
* 获取所有有权限的使用中的模型文件
* @param wsId 资产库Id
* @param teamId 小组Id
* @param category 建模方法大类可为null
* @param method 模型分类可为null
* @return
*/
public static List<PALRepositoryModel> getPermRepositoryList(String wsId, String teamId, String category, String method, boolean isUse, boolean isPublish) {
List<PALRepositoryModel> result = new ArrayList<>();
Set<String> versionIds = getPermRepositoryVersionIds(wsId, teamId, category, method);
for (String versionId : versionIds) {
List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(versionId);
if (list != null) {
for (PALRepositoryModel model : list) {
if ((isUse && model.isUse()) || (isPublish && model.isPublish())) {
result.add(model);
}
}
}
}
return result;
}
/**
* 获取所有有权限的使用中的模型文件
*
* @param wsId 资产库Id
* @param teamId 小组Id
* @param category 建模方法大类可为null
* @param method 模型分类可为null
* @return
*/
public static List<PALRepositoryModel> getPermRepositoryList(String wsId, String teamId, String category, String method, boolean isUse, boolean isPublish) {
List<PALRepositoryModel> result = new ArrayList<>();
Set<String> versionIds = getPermRepositoryVersionIds(wsId, teamId, category, method);
for (String versionId : versionIds) {
List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(versionId);
if (list != null) {
for (PALRepositoryModel model : list) {
if ((isUse && model.isUse()) || (isPublish && model.isPublish())) {
result.add(model);
}
}
}
}
return result;
}
/**
* 排序
* @param list
*/
public static void sortByLevelAndOrderIndex(List<PALRepositoryModel> list) {
Collections.sort(list, new Comparator1());
}
/**
* 排序
*
* @param list
*/
public static void sortByLevelAndOrderIndex(List<PALRepositoryModel> list) {
Collections.sort(list, new Comparator1());
}
/**
* 根据级别排序
*/
private static class Comparator1 implements Comparator<PALRepositoryModel> {
@Override
public int compare(PALRepositoryModel model1, PALRepositoryModel model2) {
Integer level1 = model1.getLevel();
Integer level2 = model2.getLevel();
int result = level1.compareTo(level2);
if (result == 0) {
Integer index1 = model1.getOrderIndex();
Integer index2 = model2.getOrderIndex();
result = index1.compareTo(index2);
}
return result;
}
}
/**
* 根据级别排序
*/
private static class Comparator1 implements Comparator<PALRepositoryModel> {
@Override
public int compare(PALRepositoryModel model1, PALRepositoryModel model2) {
Integer level1 = model1.getLevel();
Integer level2 = model2.getLevel();
int result = level1.compareTo(level2);
if (result == 0) {
Integer index1 = model1.getOrderIndex();
Integer index2 = model2.getOrderIndex();
result = index1.compareTo(index2);
}
return result;
}
}
}

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/favicon.ico><title>com.actionsoft.apps.coe.pal.cooperation</title><script src=../commons/awsui/js/icon.array.js></script><script>const settingParam = <#settingParam>;
const axiosBaseUrl = "./";
const production = true;</script><script>var mainPage = "<#mainPage>";
var isManage = <#isManage>;</script><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/chunk-152a7426.b4e75db9.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/chunk-40a157f3.8540025f.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/chunk-d8eb2bb4.4fbfecd2.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-152a7426.c4583821.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-2d0c1436.5fd531a5.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-2d224ef1.b7c7be6e.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-3a9b7577.1c8372d8.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-40a157f3.910556dd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-d8eb2bb4.ef33e493.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/app.57e8682f.css rel=preload as=style><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/app.6546ee23.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-vendors.870f1ca9.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/app.57e8682f.css rel=stylesheet></head><body style=margin:0;><div id=app></div><script src=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-vendors.870f1ca9.js></script><script src=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/app.6546ee23.js></script></body></html>
var isManage = <#isManage>;</script><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/chunk-300ed378.8540025f.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/chunk-7fbbdec0.b4e75db9.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/chunk-8b0ba2ba.06a87d91.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-2d0c1436.13b19de7.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-2d224ef1.b2d73e77.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-300ed378.0767827f.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-7fbbdec0.a3e2e1c3.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-8b0ba2ba.5f8ecf17.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-bf7921b8.44b0a0f5.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/app.ad6bd664.css rel=preload as=style><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/app.a757d3d2.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-vendors.568b7fcc.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal.cooperation/main/css/app.ad6bd664.css rel=stylesheet></head><body style=margin:0;><div id=app></div><script src=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/chunk-vendors.568b7fcc.js></script><script src=../apps/com.actionsoft.apps.coe.pal.cooperation/main/js/app.a757d3d2.js></script></body></html>

View File

@ -1 +1 @@
#manageMain[data-v-ac2e0a1e] .awsui-dialog__body{padding-top:5px}#manageMain[data-v-ac2e0a1e] .awsui-icon-picker-box1{border-radius:15%}.team-item-div[data-v-ac2e0a1e]{height:46px;padding:6px 0 4px 0}.team-item-icon-div[data-v-ac2e0a1e]{position:relative;top:5px;width:32px;height:32px;line-height:32px;vertical-align:middle;text-align:center;border-radius:15%}.team-item-text-div[data-v-ac2e0a1e]{margin-left:7px;position:relative;top:12px}.team-item-text-div div[data-v-ac2e0a1e]{width:170px}.team-item-text-div div p[data-v-ac2e0a1e]{width:160px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.inline-block[data-v-ac2e0a1e]{display:inline-block}.cursor-pointer[data-v-ac2e0a1e]{cursor:pointer}.general-bgcolor-hover:hover .icon-drag[data-v-ac2e0a1e]{display:inline}.general-bgcolor-hover .icon-drag[data-v-ac2e0a1e]{display:none}.general-bgcolor-hover:hover .operate-icon-display[data-v-ac2e0a1e]{display:inline}.general-bgcolor-hover .operate-icon-display[data-v-ac2e0a1e]{display:none}.general-bgcolor-hover:hover .team-item-text-div p[data-v-ac2e0a1e]{color:#4e7ff9!important}.team-item-div-checked[data-v-ac2e0a1e]{color:#4e7ff9}.icon-team-div[data-v-ac2e0a1e]{position:absolute;right:40px;top:45px;z-index:2;height:70px;width:70px;line-height:70px;display:inline-block}.icon-team[data-v-ac2e0a1e]{color:#fff;font-size:52px}.required-logo[data-v-ac2e0a1e] label{margin-left:10px}#palRepositoryTree[data-v-dbb2ca8e] .el-dialog__body{padding:10px 20px;color:#606266;font-size:14px;word-break:break-all}#palRepositoryTree[data-v-dbb2ca8e] .el-input__inner{border-radius:0}#palRepositoryTree[data-v-dbb2ca8e] .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#f5f7fa;color:#4e7ff9}#palRepositoryTree[data-v-dbb2ca8e] .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content .awsui-iconfont{color:#4e7ff9!important}.tree[data-v-dbb2ca8e]{overflow:auto;width:432px;height:300px}#palRepositoryTree[data-v-dbb2ca8e] .el-tree{min-width:100%;display:inline-block!important}.allGroup[data-v-5398adc3]{display:flex}.allGroup .processAll[data-v-5398adc3]{margin-left:5px}.allGroup .actionGroup[data-v-5398adc3]{flex:1;text-align:right;padding-right:1px}#roleManage[data-v-5b5b40a9] .awsui-dialog__body{margin:0 16px}#roleManage[data-v-5b5b40a9] .role_data_perm_textarea textarea{cursor:pointer}.text-overflow-hidden[data-v-5b5b40a9]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.general-bgcolor-hover:hover .operate-icon-display[data-v-5b5b40a9]{display:inline}.general-bgcolor-hover .operate-icon-display[data-v-5b5b40a9]{display:none}#manageList[data-v-1de625d3] .awsui-main{padding:0 20px!important}#tableMain[data-v-1de625d3] .hideCheckBoxCell .el-checkbox__input{visibility:hidden}#tableMain[data-v-1de625d3] .el-table__header-wrapper .el-checkbox,#tableMain[data-v-1de625d3] .el-table__row .operate-icon-display{display:none}#tableMain[data-v-1de625d3] .el-table__row:hover .operate-icon-display,.inline-block[data-v-1de625d3]{display:inline-block}.team-icon-div[data-v-1de625d3]{text-align:center;border-radius:15%}.text-overflow-hidden[data-v-1de625d3]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#manage[data-v-eb099fd6] .awsui-aside,#manage[data-v-eb099fd6] .awsui-main{padding:0}
#manageMain[data-v-ac2e0a1e] .awsui-dialog__body{padding-top:5px}#manageMain[data-v-ac2e0a1e] .awsui-icon-picker-box1{border-radius:15%}.team-item-div[data-v-ac2e0a1e]{height:46px;padding:6px 0 4px 0}.team-item-icon-div[data-v-ac2e0a1e]{position:relative;top:5px;width:32px;height:32px;line-height:32px;vertical-align:middle;text-align:center;border-radius:15%}.team-item-text-div[data-v-ac2e0a1e]{margin-left:7px;position:relative;top:12px}.team-item-text-div div[data-v-ac2e0a1e]{width:170px}.team-item-text-div div p[data-v-ac2e0a1e]{width:160px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.inline-block[data-v-ac2e0a1e]{display:inline-block}.cursor-pointer[data-v-ac2e0a1e]{cursor:pointer}.general-bgcolor-hover:hover .icon-drag[data-v-ac2e0a1e]{display:inline}.general-bgcolor-hover .icon-drag[data-v-ac2e0a1e]{display:none}.general-bgcolor-hover:hover .operate-icon-display[data-v-ac2e0a1e]{display:inline}.general-bgcolor-hover .operate-icon-display[data-v-ac2e0a1e]{display:none}.general-bgcolor-hover:hover .team-item-text-div p[data-v-ac2e0a1e]{color:#4e7ff9!important}.team-item-div-checked[data-v-ac2e0a1e]{color:#4e7ff9}.icon-team-div[data-v-ac2e0a1e]{position:absolute;right:40px;top:45px;z-index:2;height:70px;width:70px;line-height:70px;display:inline-block}.icon-team[data-v-ac2e0a1e]{color:#fff;font-size:52px}.required-logo[data-v-ac2e0a1e] label{margin-left:10px}#palRepositoryTree[data-v-dbb2ca8e] .el-dialog__body{padding:10px 20px;color:#606266;font-size:14px;word-break:break-all}#palRepositoryTree[data-v-dbb2ca8e] .el-input__inner{border-radius:0}#palRepositoryTree[data-v-dbb2ca8e] .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#f5f7fa;color:#4e7ff9}#palRepositoryTree[data-v-dbb2ca8e] .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content .awsui-iconfont{color:#4e7ff9!important}.tree[data-v-dbb2ca8e]{overflow:auto;width:432px;height:300px}#palRepositoryTree[data-v-dbb2ca8e] .el-tree{min-width:100%;display:inline-block!important}.allGroup[data-v-5e2fabd3]{display:flex}.allGroup .processAll[data-v-5e2fabd3]{margin-left:5px}.allGroup .actionGroup[data-v-5e2fabd3]{flex:1;text-align:right;padding-right:1px}#roleManage[data-v-5b5b40a9] .awsui-dialog__body{margin:0 16px}#roleManage[data-v-5b5b40a9] .role_data_perm_textarea textarea{cursor:pointer}.text-overflow-hidden[data-v-5b5b40a9]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.general-bgcolor-hover:hover .operate-icon-display[data-v-5b5b40a9]{display:inline}.general-bgcolor-hover .operate-icon-display[data-v-5b5b40a9]{display:none}#manageList[data-v-1de625d3] .awsui-main{padding:0 20px!important}#tableMain[data-v-1de625d3] .hideCheckBoxCell .el-checkbox__input{visibility:hidden}#tableMain[data-v-1de625d3] .el-table__header-wrapper .el-checkbox,#tableMain[data-v-1de625d3] .el-table__row .operate-icon-display{display:none}#tableMain[data-v-1de625d3] .el-table__row:hover .operate-icon-display,.inline-block[data-v-1de625d3]{display:inline-block}.team-icon-div[data-v-1de625d3]{text-align:center;border-radius:15%}.text-overflow-hidden[data-v-1de625d3]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#manage[data-v-eb099fd6] .awsui-aside,#manage[data-v-eb099fd6] .awsui-main{padding:0}

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c1436"],{"44ff":function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t._self._c;return e("awsui-layout",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{id:"create","element-loading-text":t.loadingText}},[e("awsui-main",{style:{width:"100%",padding:0,height:t.bodyHeight},attrs:{id:"createMain"}},[e("div",{staticStyle:{width:"100%",height:"100%"}},[e("div",{staticStyle:{width:"100%",height:"300px",margin:"auto",position:"relative",top:"35%"}},[e("div",{staticStyle:{"text-align":"center"}},[e("span",[e("i",{staticClass:"iconfont",staticStyle:{color:"#C2C2C2","font-size":"60px"}},[t._v("")])]),e("p",{staticClass:"text-general-color",staticStyle:{margin:"15px 0"}},[t._v("您还没加入任何小组!")])]),t.isManage?e("div",{staticStyle:{"text-align":"center"}},[e("awsui-button",{staticClass:"button-general-color text-general-color",attrs:{type:"primary"},on:{click:t.createTeam}},[t._v("创建小组")])],1):t._e()])])]),e("cooperation-update",{ref:"cooperationUpdate",attrs:{visible:t.update.visible,teamId:t.update.teamId,title:t.update.title},on:{"update:visible":function(e){return t.$set(t.update,"visible",e)},cancel:function(e){t.update.visible=!1},getResult:t.updateDone}})],1)},n=[],o=i("de40"),s=(i("0f08"),{name:"Create",components:{CooperationUpdate:o["a"]},data(){return{bodyHeight:document.documentElement.clientHeight+"px",isManage:isManage,update:{visible:!1,teamId:"",title:"创建小组"},loading:!1,loadingText:"正在保存"}},mounted(){const t=this;t.resize()},methods:{createTeam(){this.update.teamId="",this.update.visible=!0},updateDone(t){"ok"==t&&(this.update.visible=!1,parent.location.reload())},resize(){const t=this;let e=null;window.onresize=()=>(()=>{e&&clearTimeout(e),e=setTimeout((function(){t.bodyHeight=document.documentElement.clientHeight+"px"}),400)})()}}}),l=s,d=i("2877"),c=Object(d["a"])(l,a,n,!1,null,"35cadde6",null);e["default"]=c.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c1436"],{"44ff":function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t._self._c;return e("awsui-layout",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{id:"create","element-loading-text":t.loadingText}},[e("awsui-main",{style:{width:"100%",padding:0,height:t.bodyHeight},attrs:{id:"createMain"}},[e("div",{staticStyle:{width:"100%",height:"100%"}},[e("div",{staticStyle:{width:"100%",height:"300px",margin:"auto",position:"relative",top:"35%"}},[e("div",{staticStyle:{"text-align":"center"}},[e("span",[e("i",{staticClass:"iconfont",staticStyle:{color:"#C2C2C2","font-size":"60px"}},[t._v("")])]),e("p",{staticClass:"text-general-color",staticStyle:{margin:"15px 0"}},[t._v("您还没加入任何小组!")])]),t.isManage?e("div",{staticStyle:{"text-align":"center"}},[e("awsui-button",{staticClass:"button-general-color text-general-color",attrs:{type:"primary"},on:{click:t.createTeam}},[t._v("创建小组")])],1):t._e()])])]),e("cooperation-update",{ref:"cooperationUpdate",attrs:{visible:t.update.visible,teamId:t.update.teamId,title:t.update.title},on:{"update:visible":function(e){return t.$set(t.update,"visible",e)},cancel:function(e){t.update.visible=!1},getResult:t.updateDone}})],1)},n=[],o=i("de40"),s=(i("0f08"),{name:"Create",components:{CooperationUpdate:o["a"]},data(){return{bodyHeight:document.documentElement.clientHeight+"px",isManage:isManage,update:{visible:!1,teamId:"",title:"创建小组"},loading:!1,loadingText:"正在保存"}},mounted(){const t=this;t.resize()},methods:{createTeam(){this.update.teamId="",this.update.visible=!0},updateDone(t){"ok"==t&&(this.update.visible=!1,parent.location.reload())},resize(){const t=this;let e=null;window.onresize=()=>(()=>{e&&clearTimeout(e),e=setTimeout((function(){t.bodyHeight=document.documentElement.clientHeight+"px"}),400)})()}}}),l=s,d=i("e607"),c=Object(d["a"])(l,a,n,!1,null,"35cadde6",null);e["default"]=c.exports}}]);

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224ef1"],{e1f5:function(e,s,t){"use strict";t.r(s);var n=function(){var e=this,s=e._self._c;return s("div",{staticClass:"devGetSession"},[e._v(" 正在获取session ")])},a=[],d=t("a18c"),i=t("0f08"),o=t("4360");i["a"].post({url:"jd",data:{userid:devUserInfo.userid,pwd:devUserInfo.pwd,lang:"cn",cmd:"com.actionsoft.apps.getsession.get",deviceType:"pc"}}).then((function(e){"error"==e.result?alert("获取session错误"+e.msg):(o["a"].commit("edit",{sessionId:e.data.sid}),d["a"].replace("/"+mainPage))}));var r={data(){return{dwList:[]}},methods:{},mounted(){}},c=r,u=t("2877"),l=Object(u["a"])(c,n,a,!1,null,null,null);s["default"]=l.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224ef1"],{e1f5:function(e,s,t){"use strict";t.r(s);var n=function(){var e=this,s=e._self._c;return s("div",{staticClass:"devGetSession"},[e._v(" 正在获取session ")])},a=[],d=t("a18c"),i=t("0f08"),o=t("4360");i["a"].post({url:"jd",data:{userid:devUserInfo.userid,pwd:devUserInfo.pwd,lang:"cn",cmd:"com.actionsoft.apps.getsession.get",deviceType:"pc"}}).then((function(e){"error"==e.result?alert("获取session错误"+e.msg):(o["a"].commit("edit",{sessionId:e.data.sid}),d["a"].replace("/"+mainPage))}));var r={data(){return{dwList:[]}},methods:{},mounted(){}},c=r,u=t("e607"),l=Object(u["a"])(c,n,a,!1,null,null,null);s["default"]=l.exports}}]);

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-40a157f3"],{"618f":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t._self._c;return e("el-container",{attrs:{id:"update"}},[e("el-main",{style:{padding:0,height:t.bodyHeight},attrs:{id:"updateMain"}},[e("el-table",{ref:"updateTable",attrs:{id:"updateTable",data:t.tableData,"row-style":{height:"50px"},"cell-style":{padding:"0px"},height:t.bodyHeight}},[e("el-table-column",{attrs:{prop:"icon",label:"小组",align:"right","class-name":"table-row-icon-cloumn","min-width":"45"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",[e("div",{staticClass:"icon-div-repository",style:{"background-color":a.row.teamLogo.color}},[e("i",{staticClass:"awsui-iconfont icon-dynamic-repository",domProps:{innerHTML:t._s(a.row.teamLogo.code)}})])])]}}])}),e("el-table-column",{attrs:{prop:"name",label:"","min-width":"250"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",[e("div",{staticStyle:{"line-height":"20px"}},[e("p",{staticClass:"text-general-color",staticStyle:{"font-size":"14px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},[t._v(" "+t._s(a.row.teamName)+" ")])]),e("div",{staticStyle:{"line-height":"15px"}},[e("p",{staticClass:"text-second-color",staticStyle:{"font-size":"12px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},[t._v(" "+t._s(a.row.teamDesc)+" ")])])])]}}])}),e("el-table-column",{attrs:{prop:"wsName",label:"关联资产库","min-width":"150"}}),e("el-table-column",{attrs:{prop:"admin",label:"管理员","min-width":"180"}}),e("el-table-column",{attrs:{prop:"createTime",label:"创建时间",width:"150",align:"center"}}),e("el-table-column",{attrs:{prop:"createTime",label:"状态",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){return[a.row.isRun?e("span",[t._v("启用中")]):e("span",{staticClass:"text-important-color"},[t._v("已停用")])]}}])}),e("el-table-column",{attrs:{prop:"permStatus",label:"授权状态",width:"150"},scopedSlots:t._u([{key:"default",fn:function(a){return[-1==a.row.permStatus?e("span",[t._v("正在加载...")]):e("span",{domProps:{innerHTML:t._s(0==a.row.permStatus?"未设置权限":"已包含"+a.row.permStatus+"个文件")}})]}}])}),e("el-table-column",{attrs:{prop:"operation",label:"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){return[a.row.isRun?e("div",{staticClass:"operate-icon-display"},[e("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"设置",placement:"bottom"}},[e("i",{staticClass:"awsui-iconfont",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.updateTeam(a.row.teamId)}}},[t._v("")])])],1):t._e()]}}])})],1)],1),e("cooperation-update",{ref:"cooperationUpdate",attrs:{visible:t.update.visible,teamId:t.update.teamId,title:t.update.title},on:{"update:visible":function(e){return t.$set(t.update,"visible",e)},cancel:function(e){t.update.visible=!1},getResult:t.updateDone}})],1)},i=[],n=a("0f08"),l=a("de40"),s={name:"Update",components:{CooperationUpdate:l["a"]},data(){return{bodyHeight:document.documentElement.clientHeight+"px",tableData:[],update:{visible:!1,teamId:"",title:"修改小组"}}},mounted(){const t=this;t.resize(),t.initData()},methods:{initData(){const t=this,e={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal.cooperation_manage_team_info_list"}};n["a"].post(e).then((function(e){"ok"==e.result&&(t.tableData=e.data,t.loadTeamPerm())})).catch(t=>{console.log(t)})},loadTeamPerm(){const t=this,e=[];for(let a=0;a<t.tableData.length;a++)if(-1==t.tableData[a].permStatus&&(e.push(t.tableData[a].teamId),e.length>=5))break;if(e.length>0){const a={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal.cooperation_manage_team_info_perm",teamIdArr:JSON.stringify(e)}};n["a"].post(a).then((function(e){if("ok"==e.result){const a=e.data;for(let e=0;e<t.tableData.length;e++)void 0!=a[t.tableData[e].teamId]&&(t.tableData[e].permStatus=a[t.tableData[e].teamId]);t.loadTeamPerm()}})).catch(t=>{console.log(t)})}},updateTeam(t){this.update.teamId=t,this.update.visible=!0},updateDone(t){const e=this;"ok"==t&&(this.update.visible=!1,e.initData())},resize(){const t=this;let e=null;window.onresize=()=>(()=>{e&&clearTimeout(e),e=setTimeout((function(){t.bodyHeight=document.documentElement.clientHeight+"px"}),400)})()}}},r=s,c=(a("cba2"),a("2877")),d=Object(c["a"])(r,o,i,!1,null,"0d5b21cf",null);e["default"]=d.exports},cba2:function(t,e,a){"use strict";a("f4c8")},f4c8:function(t,e,a){}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-300ed378"],{"618f":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t._self._c;return e("el-container",{attrs:{id:"update"}},[e("el-main",{style:{padding:0,height:t.bodyHeight},attrs:{id:"updateMain"}},[e("el-table",{ref:"updateTable",attrs:{id:"updateTable",data:t.tableData,"row-style":{height:"50px"},"cell-style":{padding:"0px"},height:t.bodyHeight}},[e("el-table-column",{attrs:{prop:"icon",label:"小组",align:"right","class-name":"table-row-icon-cloumn","min-width":"45"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",[e("div",{staticClass:"icon-div-repository",style:{"background-color":a.row.teamLogo.color}},[e("i",{staticClass:"awsui-iconfont icon-dynamic-repository",domProps:{innerHTML:t._s(a.row.teamLogo.code)}})])])]}}])}),e("el-table-column",{attrs:{prop:"name",label:"","min-width":"250"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",[e("div",{staticStyle:{"line-height":"20px"}},[e("p",{staticClass:"text-general-color",staticStyle:{"font-size":"14px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},[t._v(" "+t._s(a.row.teamName)+" ")])]),e("div",{staticStyle:{"line-height":"15px"}},[e("p",{staticClass:"text-second-color",staticStyle:{"font-size":"12px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},[t._v(" "+t._s(a.row.teamDesc)+" ")])])])]}}])}),e("el-table-column",{attrs:{prop:"wsName",label:"关联资产库","min-width":"150"}}),e("el-table-column",{attrs:{prop:"admin",label:"管理员","min-width":"180"}}),e("el-table-column",{attrs:{prop:"createTime",label:"创建时间",width:"150",align:"center"}}),e("el-table-column",{attrs:{prop:"createTime",label:"状态",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){return[a.row.isRun?e("span",[t._v("启用中")]):e("span",{staticClass:"text-important-color"},[t._v("已停用")])]}}])}),e("el-table-column",{attrs:{prop:"permStatus",label:"授权状态",width:"150"},scopedSlots:t._u([{key:"default",fn:function(a){return[-1==a.row.permStatus?e("span",[t._v("正在加载...")]):e("span",{domProps:{innerHTML:t._s(0==a.row.permStatus?"未设置权限":"已包含"+a.row.permStatus+"个文件")}})]}}])}),e("el-table-column",{attrs:{prop:"operation",label:"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){return[a.row.isRun?e("div",{staticClass:"operate-icon-display"},[e("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"设置",placement:"bottom"}},[e("i",{staticClass:"awsui-iconfont",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.updateTeam(a.row.teamId)}}},[t._v("")])])],1):t._e()]}}])})],1)],1),e("cooperation-update",{ref:"cooperationUpdate",attrs:{visible:t.update.visible,teamId:t.update.teamId,title:t.update.title},on:{"update:visible":function(e){return t.$set(t.update,"visible",e)},cancel:function(e){t.update.visible=!1},getResult:t.updateDone}})],1)},i=[],n=a("0f08"),l=a("de40"),s={name:"Update",components:{CooperationUpdate:l["a"]},data(){return{bodyHeight:document.documentElement.clientHeight+"px",tableData:[],update:{visible:!1,teamId:"",title:"修改小组"}}},mounted(){const t=this;t.resize(),t.initData()},methods:{initData(){const t=this,e={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal.cooperation_manage_team_info_list"}};n["a"].post(e).then((function(e){"ok"==e.result&&(t.tableData=e.data,t.loadTeamPerm())})).catch(t=>{console.log(t)})},loadTeamPerm(){const t=this,e=[];for(let a=0;a<t.tableData.length;a++)if(-1==t.tableData[a].permStatus&&(e.push(t.tableData[a].teamId),e.length>=5))break;if(e.length>0){const a={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal.cooperation_manage_team_info_perm",teamIdArr:JSON.stringify(e)}};n["a"].post(a).then((function(e){if("ok"==e.result){const a=e.data;for(let e=0;e<t.tableData.length;e++)void 0!=a[t.tableData[e].teamId]&&(t.tableData[e].permStatus=a[t.tableData[e].teamId]);t.loadTeamPerm()}})).catch(t=>{console.log(t)})}},updateTeam(t){this.update.teamId=t,this.update.visible=!0},updateDone(t){const e=this;"ok"==t&&(this.update.visible=!1,e.initData())},resize(){const t=this;let e=null;window.onresize=()=>(()=>{e&&clearTimeout(e),e=setTimeout((function(){t.bodyHeight=document.documentElement.clientHeight+"px"}),400)})()}}},r=s,c=(a("cba2"),a("e607")),d=Object(c["a"])(r,o,i,!1,null,"0d5b21cf",null);e["default"]=d.exports},a81b:function(t,e,a){},cba2:function(t,e,a){"use strict";a("a81b")}}]);

View File

@ -0,0 +1,56 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import java.util.List;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationRoleDao;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
import com.actionsoft.bpms.commons.cache.Cache;
import com.actionsoft.bpms.commons.cache.CacheManager;
import com.actionsoft.bpms.util.ConsolePrinter;
import com.actionsoft.sdk.local.SDK;
/**
* 小组角色缓存
*/
public class CoeCooperationRoleCache extends Cache<String, CoeCooperationRoleModel> {
public CoeCooperationRoleCache(CachePluginProfile profile) {
super(profile);
registeIndex(CoeCooperationRoleCacheIndex1.class, new CoeCooperationRoleCacheIndex1()); // key: teamId_roleType
registeIndex(CoeCooperationRoleCacheIndex2.class, new CoeCooperationRoleCacheIndex2()); // key: teamId_roleName
registeIndex(CoeCooperationRoleCacheIndex3.class, new CoeCooperationRoleCacheIndex3()); // key: teamId
}
public static CoeCooperationRoleCache getCache() {
return CacheManager.getCache(CoeCooperationRoleCache.class);
}
public static List<CoeCooperationRoleModel> getByTeamIdAndRoleName(String teamId, String roleName) {
return iteratorToList(getCache().getByIndex(CoeCooperationRoleCacheIndex2.class, teamId + "_" + roleName));
}
public static List<CoeCooperationRoleModel> getByTeamIdAndRoleType(String teamId, int roleType) {
return iteratorToList(getCache().getByIndex(CoeCooperationRoleCacheIndex1.class, teamId + "_" + roleType));
}
public static List<CoeCooperationRoleModel> getCooperationAllRoleByTeam(String teamId) {
return iteratorToList(getCache().getByIndex(CoeCooperationRoleCacheIndex3.class, teamId));
}
@Override
protected void load() {
this.load(this);
}
protected void load(Cache<String, CoeCooperationRoleModel> t) {
List<CoeCooperationRoleModel> _list = new CoeCooperationRoleDao().getAllInstance();
if (_list != null) {
for (CoeCooperationRoleModel model : _list) {
t.put(model.getId(), model, false);
}
}
ConsolePrinter.info("[" + SDK.getAppAPI().getAppContext(CoEConstant.APP_ID).getNameI18N() + "]Cache加载PAL小组角色对象 [" + ((_list == null) ? 0 : _list.size()) + "个]");
}
}

View File

@ -0,0 +1,15 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
import com.actionsoft.bpms.commons.cache.ListValueIndex;
/**
* 小组角色缓存
*/
public class CoeCooperationRoleCacheIndex1 extends ListValueIndex<String, CoeCooperationRoleModel> {
@Override
public String key(CoeCooperationRoleModel model) {
return model.getTeamId() + "_" + model.getRoleType();
}
}

View File

@ -0,0 +1,12 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
import com.actionsoft.bpms.commons.cache.ListValueIndex;
public class CoeCooperationRoleCacheIndex2 extends ListValueIndex<String, CoeCooperationRoleModel> {
@Override
public String key(CoeCooperationRoleModel model) {
return model.getTeamId() + "_" + model.getRoleName();
}
}

View File

@ -0,0 +1,15 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
import com.actionsoft.bpms.commons.cache.ListValueIndex;
/**
* 小组角色缓存
*/
public class CoeCooperationRoleCacheIndex3 extends ListValueIndex<String, CoeCooperationRoleModel> {
@Override
public String key(CoeCooperationRoleModel model) {
return model.getTeamId();
}
}

View File

@ -0,0 +1,57 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import java.util.List;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationRolePermDao;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRolePermModel;
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
import com.actionsoft.bpms.commons.cache.Cache;
import com.actionsoft.bpms.commons.cache.CacheManager;
import com.actionsoft.bpms.util.ConsolePrinter;
import com.actionsoft.sdk.local.SDK;
/**
* 小组角色权限缓存
*/
public class CoeCooperationRolePermCache extends Cache<String, CoeCooperationRolePermModel> {
public CoeCooperationRolePermCache(CachePluginProfile profile) {
super(profile);
registeIndex(CoeCooperationRolePermCacheIndex1.class, new CoeCooperationRolePermCacheIndex1()); // key: teamId_roleId
registeIndex(CoeCooperationRolePermCacheIndex2.class, new CoeCooperationRolePermCacheIndex2()); // key: teamId
registeIndex(CoeCooperationRolePermCacheIndex3.class, new CoeCooperationRolePermCacheIndex3()); // key: palVersionId
}
public static CoeCooperationRolePermCache getCache() {
return CacheManager.getCache(CoeCooperationRolePermCache.class);
}
public static List<CoeCooperationRolePermModel> getByTeamIdAndRoleId(String teamId, String roleId) {
return iteratorToList(getCache().getByIndex(CoeCooperationRolePermCacheIndex1.class, teamId + "_" + roleId));
}
public static List<CoeCooperationRolePermModel> getByTeamId(String teamId) {
return iteratorToList(getCache().getByIndex(CoeCooperationRolePermCacheIndex2.class, teamId));
}
public static List<CoeCooperationRolePermModel> getByPalVersionId(String palVersionId) {
return iteratorToList(getCache().getByIndex(CoeCooperationRolePermCacheIndex3.class, palVersionId));
}
@Override
protected void load() {
this.load(this);
}
protected void load(Cache<String, CoeCooperationRolePermModel> t) {
List<CoeCooperationRolePermModel> _list = new CoeCooperationRolePermDao().getAllInstance();
if (_list != null) {
for (CoeCooperationRolePermModel model : _list) {
t.put(model.getId(), model, false);
}
}
ConsolePrinter.info("[" + SDK.getAppAPI().getAppContext(CoEConstant.APP_ID).getNameI18N() + "]Cache加载PAL小组角色权限对象 [" + ((_list == null) ? 0 : _list.size()) + "个]");
}
}

View File

@ -0,0 +1,12 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRolePermModel;
import com.actionsoft.bpms.commons.cache.ListValueIndex;
public class CoeCooperationRolePermCacheIndex1 extends ListValueIndex<String, CoeCooperationRolePermModel> {
@Override
public String key(CoeCooperationRolePermModel model) {
return model.getTeamId() + "_" + model.getRoleId();
}
}

View File

@ -0,0 +1,51 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import java.util.List;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationTeamPermDao;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationTeamPermModel;
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
import com.actionsoft.bpms.commons.cache.Cache;
import com.actionsoft.bpms.commons.cache.CacheManager;
import com.actionsoft.bpms.util.ConsolePrinter;
import com.actionsoft.sdk.local.SDK;
/**
* 小组权限缓存
*/
public class CoeCooperationTeamPermCache extends Cache<String, CoeCooperationTeamPermModel> {
public CoeCooperationTeamPermCache(CachePluginProfile profile) {
super(profile);
registeIndex(CoeCooperationTeamPermCacheIndex1.class, new CoeCooperationTeamPermCacheIndex1()); // key: teamId
registeIndex(CoeCooperationTeamPermCacheIndex2.class, new CoeCooperationTeamPermCacheIndex2()); // key: palVersionId
}
public static CoeCooperationTeamPermCache getCache() {
return CacheManager.getCache(CoeCooperationTeamPermCache.class);
}
public static List<CoeCooperationTeamPermModel> getByTeamId(String teamId) {
return iteratorToList(getCache().getByIndex(CoeCooperationTeamPermCacheIndex1.class, teamId));
}
public static List<CoeCooperationTeamPermModel> getByPalVersionId(String palVersionId) {
return iteratorToList(getCache().getByIndex(CoeCooperationTeamPermCacheIndex2.class, palVersionId));
}
@Override
protected void load() {
this.load(this);
}
protected void load(Cache<String, CoeCooperationTeamPermModel> t) {
List<CoeCooperationTeamPermModel> _list = new CoeCooperationTeamPermDao().getAllInstance();
if (_list != null) {
for (CoeCooperationTeamPermModel model : _list) {
t.put(model.getId(), model, false);
}
}
ConsolePrinter.info("[" + SDK.getAppAPI().getAppContext(CoEConstant.APP_ID).getNameI18N() + "]Cache加载PAL小组权限对象 [" + ((_list == null) ? 0 : _list.size()) + "个]");
}
}

View File

@ -0,0 +1,12 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationTeamPermModel;
import com.actionsoft.bpms.commons.cache.ListValueIndex;
public class CoeCooperationTeamPermCacheIndex1 extends ListValueIndex<String, CoeCooperationTeamPermModel> {
@Override
public String key(CoeCooperationTeamPermModel model) {
return model.getTeamId();
}
}

View File

@ -1,223 +0,0 @@
package com.actionsoft.apps.coe.pal.cooperation.cache;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo;
import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst;
import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationMemberDao;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationMemberModel;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
import com.actionsoft.bpms.commons.cache.Cache;
import com.actionsoft.bpms.commons.cache.CacheManager;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.util.ConsolePrinter;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.AppAPI;
import com.alibaba.fastjson.JSONArray;
import java.util.*;
import java.util.stream.Collectors;
public class CooperationCache extends Cache<String, TeamInfo> {
public CooperationCache(CachePluginProfile profile){
super(profile);
}
@Override
protected void load() {
List<TeamInfo> allTeamInfo = CoeCooperationAPIManager.getInstance().getAllTeamInfo();
for (TeamInfo teamInfo : allTeamInfo) {
put(teamInfo.getTeamId(),teamInfo);
}
//平台console打印
ConsolePrinter.info("[" + SDK.getAppAPI().getAppContext(CoEConstant.APP_ID).getNameI18N() + "]Cache加载pal 小组用户角色权限信息 [" + (( allTeamInfo == null) ? 0 : allTeamInfo.size()) + "个]");
}
public static CooperationCache getCache(){
return CacheManager.getCache(CooperationCache.class);
}
/**
* 获取全部小组权限info
* @return
*/
public static List<TeamInfo> getAllTeamInfo(){
List<TeamInfo> collect = getCache().stream().collect(Collectors.toList());
if (collect.isEmpty()){
getCache().load();
}
return collect;
}
/**
* 获取指定小组的权限info
* @param teamId
* @return
*/
public static TeamInfo getTeamInfo(String teamId){
return getCache().get(teamId);
}
/**
* 获取小组下的全权限文件
* @param teamId
* @return
*/
public static Set<String> getUserInfoVersionIds(String teamId){
TeamInfo teamInfo = CooperationCache.getTeamInfo(teamId);
if (null == teamInfo){
return new HashSet<>();
}
return teamInfo.getVersionIds();
}
/**
* 获取小组下用户权限列表数据
* @param teamId
* @return
*/
public static List<UserInfo> getUserInfo(String teamId){
TeamInfo teamInfo = getCache().get(teamId);
return teamInfo.getUsers();
}
/**
* 获取小组下用户权限列表数据
* @param teamId
* @return
*/
public static UserInfo getUserInfo(String teamId,String userid){
TeamInfo teamInfo = getCache().get(teamId);
if (null == teamInfo){
return null;
}
for (UserInfo user : teamInfo.getUsers()) {
if (user.getUserid().equals(userid)){
return user;
}
}
return null;
}
/**
* 根据小组id与用户id获取用户的角色ids
* @param teamId
* @param userid
* @return
*/
public static List<String> getUserRoles(String teamId,String userid){
UserInfo userInfo = CooperationCache.getUserInfo(teamId, userid);
if (null == userInfo){
return new ArrayList<>();
}
return userInfo.getRoleIds();
}
/**
* 根据小组id与用户id获取用户的操作权限
* @param teamId
* @param userid
* @return
*/
public static Set<String> getUserOperatePermission(String teamId,String userid){
UserInfo userInfo = CooperationCache.getUserInfo(teamId, userid);
if (null == userInfo){
return new HashSet<>();
}
return userInfo.getOperatePermission();
}
/**
* 根据小组id与用户id获取用户的应用权限
* @param teamId
* @param userid
* @return
*/
public static Set<String> getUserAPPPermission(String teamId,String userid){
UserInfo userInfo = CooperationCache.getUserInfo(teamId, userid);
if (null == userInfo){
return new HashSet<>();
}
Set<String> appPermission = userInfo.getAppPermission();
if (appPermission.contains("all")){
Set<String> set = new HashSet<>();
// aslp服务地址
String aslp = "aslp://com.actionsoft.apps.coe.pal.cooperation/listApps";
//列出已注册的流程团队扩展App
ResponseObject ro = SDK.getAppAPI().callASLP(SDK.getAppAPI().getAppContext(CoEConstant.APP_ID), aslp, new HashMap<String, Object>());
if (ro.isOk()) {
JSONArray appArr = (JSONArray)((Map)ro.getData()).get("apps");
for (int i = 0; i < appArr.size(); i++) {
set.add(appArr.getJSONObject(i).getString("id"));
}
}
return set;
}
return appPermission;
}
/**
* 根据小组与用户id获取用户数据访问权限
* @param teamId
* @param userid
* @param isValidPermData 查询使用中的文件标志true过滤掉进入回收站的数据false查询全部权限数据
* @return
*/
public static Set<String> getUserDataVisitablePermission(String teamId,String userid,boolean isValidPermData){
UserInfo userInfo = CooperationCache.getUserInfo(teamId, userid);
if (null == userInfo){
return new HashSet<>();
}
if (userInfo.getIsAllDataPermission()){
TeamInfo teamInfo = CooperationCache.getTeamInfo(teamId);
return teamInfo.getVersionIds();
}
Set<String> set = new HashSet<>();
Set<String> keySet = userInfo.getDataPermission().keySet();
for (String next : keySet) {
if (isValidPermData) {
// 在流程表的校验,抛弃回收站中删除文件
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(next);
if (verModels != null && verModels.size() > 0) {
set.add(next);
}
}else {
set.add(next);
}
}
return set;
}
/**
* 根据小组与用户id获取用户数据控制权限
* @param teamId
* @param userid
* @param versionId
* @return
*/
public static Set<String> getUserDataOperatePermission(String teamId,String userid,String versionId){
UserInfo userInfo = CooperationCache.getUserInfo(teamId, userid);
if (null == userInfo){
return new HashSet<>();
}
if (userInfo.getIsAllDataPermission()){
return Arrays.stream(new String [] {CoeCooperationConst.ACTION_WRITE,CoeCooperationConst.ACTION_DELETE,CoeCooperationConst.ACTION_VERSION}).collect(Collectors.toSet());
}
return userInfo.getDataPermission().get(versionId);
}
public static void updateTeamInfo(String teamId){
TeamInfo teamInfo = CoeCooperationAPIManager.getInstance().getTeamInfo(teamId);
getCache().put(teamId,teamInfo);
}
}

View File

@ -1,42 +0,0 @@
package com.actionsoft.apps.coe.pal.cooperation.cache.model;
import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class TeamInfo implements Serializable {
private static final long serialVersionUID = 1L;
private String teamId;
private List<UserInfo> users;
private Set<String> versionIds = new HashSet<>();
public TeamInfo() {}
public String getTeamId() {
return teamId;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public List<UserInfo> getUsers() {
return users;
}
public void setUsers(List<UserInfo> users) {
this.users = users;
}
public Set<String> getVersionIds() {
return versionIds;
}
public void setVersionIds(Set<String> versionIds) {
this.versionIds = versionIds;
}
}

View File

@ -1,67 +0,0 @@
package com.actionsoft.apps.coe.pal.cooperation.cache.model;
import java.io.Serializable;
import java.util.*;
public class UserInfo implements Serializable {
private static final long serialVersionUID = 1L;
private String userid;
private List<String> roleIds = new ArrayList<>();
private Set<String> operatePermission = new HashSet<>();
private Set<String> appPermission = new HashSet<>();
private Map<String,Set<String>> dataPermission = new HashMap<>();
private boolean isAllDataPermission;
public UserInfo() { }
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public List<String> getRoleIds() {
return roleIds;
}
public void setRoleIds(List<String> roleIds) {
this.roleIds = roleIds;
}
public Set<String> getOperatePermission() {
return operatePermission;
}
public void setOperatePermission(Set<String> operatePermission) {
this.operatePermission = operatePermission;
}
public Set<String> getAppPermission() {
return appPermission;
}
public void setAppPermission(Set<String> appPermission) {
this.appPermission = appPermission;
}
public Map<String, Set<String>> getDataPermission() {
return dataPermission;
}
public void setDataPermission(Map<String, Set<String>> dataPermission) {
this.dataPermission = dataPermission;
}
public boolean getIsAllDataPermission() {
return isAllDataPermission;
}
public void setIsAllDataPermission(boolean allDataPermission) {
isAllDataPermission = allDataPermission;
}
}

View File

@ -1,6 +1,15 @@
package com.actionsoft.apps.coe.pal.cooperation.dao;
import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.actionsoft.apps.coe.pal.cooperation.cache.CoeCooperationRoleCache;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationMemberModel;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
import com.actionsoft.bpms.commons.database.RowMapper;
@ -10,11 +19,6 @@ import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.exception.AWSDataAccessException;
import java.sql.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description TODO
* @Created by sunlh
@ -22,253 +26,200 @@ import java.util.Map;
*/
public class CoeCooperationRoleDao extends DaoObject<CoeCooperationRoleModel> {
public CoeCooperationRoleDao() {
public CoeCooperationRoleDao() {
}
}
@Override
public int insert(CoeCooperationRoleModel model) throws AWSDataAccessException {
if (model == null) {
return 0;
}
Connection conn = DBSql.open();
int r = 0;
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put(CoeCooperationRoleModel.ID, model.getId());
paraMap.put(CoeCooperationRoleModel.TEAMID, model.getTeamId());
paraMap.put(CoeCooperationRoleModel.ROLENAME, model.getRoleName());
paraMap.put(CoeCooperationRoleModel.ROLEDESC, model.getRoleDesc());
paraMap.put(CoeCooperationRoleModel.ROLETYPE, model.getRoleType());
paraMap.put(CoeCooperationRoleModel.APPPERM, model.getAppPerm());
paraMap.put(CoeCooperationRoleModel.ACTIONPERM, model.getActionPerm());
paraMap.put(CoeCooperationRoleModel.DATAPERM, model.getDataPerm());
paraMap.put(CoeCooperationRoleModel.CREATEUSER, model.getCreateUser());
paraMap.put(CoeCooperationRoleModel.CREATETIME, model.getCreateTime());
paraMap.put(CoeCooperationRoleModel.UPDATEUSER, model.getUpdateUser());
paraMap.put(CoeCooperationRoleModel.UPDATETIME, model.getUpdateTime());
paraMap.put(CoeCooperationRoleModel.ISUSER, model.getIsUser());
String sql = DBSql.getInsertStatement(entityName(), paraMap);
r = DBSql.update(conn, sql, paraMap);
DBSql.close(conn);
return r;
}
public List<CoeCooperationRoleModel> getAllInstance() {
return query().list();
}
@Override
public int update(CoeCooperationRoleModel model) throws AWSDataAccessException {
String updateSql = "UPDATE "+ entityName()
+ " SET "+ CoeCooperationRoleModel.ROLENAME +"=?, "
+ CoeCooperationRoleModel.ROLEDESC +"=?, "
+ CoeCooperationRoleModel.ROLETYPE +"=?, "
+ CoeCooperationRoleModel.APPPERM +"=?, "
+ CoeCooperationRoleModel.ACTIONPERM +"=?, "
+ CoeCooperationRoleModel.DATAPERM +"=?, "
+ CoeCooperationRoleModel.UPDATETIME +"=?, "
+ CoeCooperationRoleModel.UPDATEUSER +"=? "
+ "WHERE "+ CoeCooperationRoleModel.ID +"=? ";
return DBSql.update(updateSql, new Object[] { model.getRoleName(), model.getRoleDesc(), model.getRoleType(), model.getAppPerm(), model.getActionPerm(), model.getDataPerm(), model.getUpdateTime(), model.getUpdateUser(), model.getId()});
}
@Override
public int insert(CoeCooperationRoleModel model) throws AWSDataAccessException {
if (model == null) {
return 0;
}
int r = 0;
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put(CoeCooperationRoleModel.ID, model.getId());
paraMap.put(CoeCooperationRoleModel.TEAMID, model.getTeamId());
paraMap.put(CoeCooperationRoleModel.ROLENAME, model.getRoleName());
paraMap.put(CoeCooperationRoleModel.ROLEDESC, model.getRoleDesc());
paraMap.put(CoeCooperationRoleModel.ROLETYPE, model.getRoleType());
paraMap.put(CoeCooperationRoleModel.APPPERM, model.getAppPerm());
paraMap.put(CoeCooperationRoleModel.ACTIONPERM, model.getActionPerm());
paraMap.put(CoeCooperationRoleModel.DATAPERM, model.getDataPerm());
paraMap.put(CoeCooperationRoleModel.CREATEUSER, model.getCreateUser());
paraMap.put(CoeCooperationRoleModel.CREATETIME, model.getCreateTime());
paraMap.put(CoeCooperationRoleModel.UPDATEUSER, model.getUpdateUser());
paraMap.put(CoeCooperationRoleModel.UPDATETIME, model.getUpdateTime());
paraMap.put(CoeCooperationRoleModel.ISUSER, model.getIsUser());
String sql = DBSql.getInsertStatement(entityName(), paraMap);
r = DBSql.update(sql, paraMap);
if (r > 0) {
// 处理缓存
CoeCooperationRoleCache.getCache().put(model.getId(), model);
}
return r;
}
@Override
public String entityName() {
return CoeCooperationRoleModel.DATABASE_ENTITY;
}
@Override
public int update(CoeCooperationRoleModel model) throws AWSDataAccessException {
String updateSql = "UPDATE " + entityName() + " SET " + CoeCooperationRoleModel.ROLENAME + "=?, " + CoeCooperationRoleModel.ROLEDESC + "=?, " + CoeCooperationRoleModel.ROLETYPE + "=?, " + CoeCooperationRoleModel.APPPERM + "=?, " + CoeCooperationRoleModel.ACTIONPERM + "=?, " + CoeCooperationRoleModel.DATAPERM + "=?, " + CoeCooperationRoleModel.UPDATETIME + "=?, " + CoeCooperationRoleModel.UPDATEUSER + "=? " + "WHERE " + CoeCooperationRoleModel.ID + "=? ";
int r = DBSql.update(updateSql, new Object[] { model.getRoleName(), model.getRoleDesc(), model.getRoleType(), model.getAppPerm(), model.getActionPerm(), model.getDataPerm(), model.getUpdateTime(), model.getUpdateUser(), model.getId() });
if (r > 0) {
// 处理缓存
CoeCooperationRoleCache.getCache().put(model.getId(), model);
}
return r;
}
@Override
public RowMapper<CoeCooperationRoleModel> rowMapper() {
return new Mapper();
}
@Override
public String entityName() {
return CoeCooperationRoleModel.DATABASE_ENTITY;
}
/**
* 获取小组信息
* @params teamId
* @return
*/
public CoeCooperationRoleModel getInstance(String roleId) {
String sql = "SELECT * FROM " + entityName() + " WHERE ID = ?";
return DBSql.getObject(sql, rowMapper(), new Object[]{roleId});
}
@Override
public RowMapper<CoeCooperationRoleModel> rowMapper() {
return new Mapper();
}
/**
* 批量插入
* @param list
* @return
*/
public boolean batchInsert(List<CoeCooperationRoleModel> list) throws AWSDataAccessException {
if (list == null || list.size() == 0) {
return false;
}
Connection conn = DBSql.open();
PreparedStatement prest = null;
try {
conn.setAutoCommit(false);
StringBuilder sql = new StringBuilder("INSERT INTO ").append(CoeCooperationRoleModel.DATABASE_ENTITY)
.append("(")
.append(CoeCooperationRoleModel.ID).append(",")
.append(CoeCooperationRoleModel.TEAMID).append(",")
.append(CoeCooperationRoleModel.ROLENAME).append(",")
.append(CoeCooperationRoleModel.ROLEDESC).append(",")
.append(CoeCooperationRoleModel.ROLETYPE).append(",")
.append(CoeCooperationRoleModel.APPPERM).append(",")
.append(CoeCooperationRoleModel.ACTIONPERM).append(",")
.append(CoeCooperationRoleModel.DATAPERM).append(",")
.append(CoeCooperationRoleModel.CREATEUSER).append(",")
.append(CoeCooperationRoleModel.CREATETIME).append(",")
.append(CoeCooperationRoleModel.UPDATEUSER).append(",")
.append(CoeCooperationRoleModel.UPDATETIME).append(",")
.append(CoeCooperationRoleModel.ISUSER).append(")")
.append(" VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)");
prest = conn.prepareStatement(sql.toString(), ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
for (CoeCooperationRoleModel model : list) {
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
if (model.getCreateTime() == null) {
model.setCreateTime(nowTime);
}
if (model.getUpdateTime() == null) {
model.setUpdateTime(nowTime);
}
prest.setString(1, model.getId());
prest.setString(2, model.getTeamId());
prest.setString(3, model.getRoleName());
prest.setString(4, model.getRoleDesc());
prest.setInt(5, model.getRoleType());
prest.setString(6, model.getAppPerm());
prest.setString(7, model.getActionPerm());
prest.setString(8, model.getDataPerm());
prest.setString(9, model.getCreateUser());
prest.setTimestamp(10, model.getCreateTime());
prest.setString(11, model.getUpdateUser());
prest.setTimestamp(12, model.getUpdateTime());
prest.setInt(13, model.getIsUser());
prest.addBatch();
}
prest.executeBatch();
conn.commit();
return true;
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
} finally {
DBSql.close(conn, prest, null);
}
return false;
}
/**
* 批量插入
*
* @param list
* @return
*/
public boolean batchInsert(List<CoeCooperationRoleModel> list) throws AWSDataAccessException {
if (list == null || list.size() == 0) {
return false;
}
Connection conn = DBSql.open();
PreparedStatement prest = null;
try {
conn.setAutoCommit(false);
String sql = "INSERT INTO " + CoeCooperationRoleModel.DATABASE_ENTITY + "(" + CoeCooperationRoleModel.ID + "," + CoeCooperationRoleModel.TEAMID + "," + CoeCooperationRoleModel.ROLENAME + "," + CoeCooperationRoleModel.ROLEDESC + "," + CoeCooperationRoleModel.ROLETYPE + "," + CoeCooperationRoleModel.APPPERM + "," + CoeCooperationRoleModel.ACTIONPERM + "," + CoeCooperationRoleModel.DATAPERM + "," + CoeCooperationRoleModel.CREATEUSER + "," + CoeCooperationRoleModel.CREATETIME + "," + CoeCooperationRoleModel.UPDATEUSER + "," + CoeCooperationRoleModel.UPDATETIME + ","
+ CoeCooperationRoleModel.ISUSER + ")" + " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)";
prest = conn.prepareStatement(sql, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
for (CoeCooperationRoleModel model : list) {
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
if (model.getCreateTime() == null) {
model.setCreateTime(nowTime);
}
if (model.getUpdateTime() == null) {
model.setUpdateTime(nowTime);
}
prest.setString(1, model.getId());
prest.setString(2, model.getTeamId());
prest.setString(3, model.getRoleName());
prest.setString(4, model.getRoleDesc());
prest.setInt(5, model.getRoleType());
prest.setString(6, model.getAppPerm());
prest.setString(7, model.getActionPerm());
prest.setString(8, model.getDataPerm());
prest.setString(9, model.getCreateUser());
prest.setTimestamp(10, model.getCreateTime());
prest.setString(11, model.getUpdateUser());
prest.setTimestamp(12, model.getUpdateTime());
prest.setInt(13, model.getIsUser());
prest.addBatch();
}
prest.executeBatch();
conn.commit();
// 处理缓存
for (CoeCooperationRoleModel model : list) {
CoeCooperationRoleCache.getCache().put(model.getId(), model);
}
return true;
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
} finally {
DBSql.close(conn, prest, null);
}
return false;
}
/**
* 根据小组和角色类型查询角色
* @param teamId
* @param roleType
* @see CoeCooperationConst#ROLE_TYPE_MANAGER
* @see CoeCooperationConst#ROLE_TYPE_DESIGNER
* @see CoeCooperationConst#ROLE_TYPE_VISITOR
* @see CoeCooperationConst#ROLE_TYPE_CUSTOM
* @return
*/
public List<CoeCooperationRoleModel> getCooperationRoleByType(String teamId, int roleType) {
String sql = "SELECT * FROM " + entityName() + " WHERE " + CoeCooperationRoleModel.TEAMID + " =? AND "+ CoeCooperationRoleModel.ROLETYPE +" =?";
return DBSql.query(sql, rowMapper(), new Object[]{teamId, roleType});
}
/**
* 查询用户在某小组的角色
*
* @param teamId
* @param userId
* @return
*/
public CoeCooperationRoleModel getCooperationRoleByUser(String teamId, String userId) {
String sql = "SELECT r.* FROM " + entityName() + " r, " + CoeCooperationMemberModel.DATABASE_ENTITY + " m WHERE r." + CoeCooperationRoleModel.TEAMID + " =? AND r." + CoeCooperationRoleModel.TEAMID + " = m." + CoeCooperationMemberModel.TEAMID + " AND r." + CoeCooperationRoleModel.ID + "= m." + CoeCooperationMemberModel.ROLEID + " AND m." + CoeCooperationMemberModel.USERID + "=?";
return DBSql.getObject(sql, rowMapper(), teamId, userId);
}
/**
* 根据小组查询角色
* @param teamId
* @return
*/
public List<CoeCooperationRoleModel> getCooperationRoleByTeam(String teamId) {
String sql = "SELECT * FROM " + entityName() + " WHERE " + CoeCooperationRoleModel.TEAMID + " =? and "+CoeCooperationRoleModel.ISUSER +"=0";
return DBSql.query(sql, rowMapper(), new Object[]{teamId});
}
/**
* 根据小组删除相关数据
*
* @param teamId
*/
public void removeByTeam(String teamId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationRoleModel.TEAMID + "=?";
DBSql.update(sql, new Object[] { teamId });
// 处理缓存
List<CoeCooperationRoleModel> list = CoeCooperationRoleCache.getCooperationAllRoleByTeam(teamId);
for (CoeCooperationRoleModel model : list) {
CoeCooperationRoleCache.getCache().remove(model.getId());
}
}
/**
* 根据小组查询所有角色
* @param teamId
* @return
*/
public List<CoeCooperationRoleModel> getCooperationAllRoleByTeam(String teamId) {
String sql = "SELECT * FROM " + entityName() + " WHERE " + CoeCooperationRoleModel.TEAMID + " =? ";
return DBSql.query(sql, rowMapper(), new Object[]{teamId});
}
/**
* 删除小组下的角色
*
* @param teamId
*/
public void remove(String teamId, String roleId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationRoleModel.TEAMID + "=? AND " + CoeCooperationRoleModel.ID + "=?";
DBSql.update(sql, new Object[] { teamId, roleId });
// 处理缓存
CoeCooperationRoleCache.getCache().remove(roleId);
}
/**
* 查询用户在某小组的角色
* @param teamId
* @param userId
* @return
*/
public CoeCooperationRoleModel getCooperationRoleByUser(String teamId, String userId) {
String sql = "SELECT r.* FROM " + entityName() + " r, " + CoeCooperationMemberModel.DATABASE_ENTITY + " m WHERE r." + CoeCooperationRoleModel.TEAMID + " =? AND r."+ CoeCooperationRoleModel.TEAMID +" = m." + CoeCooperationMemberModel.TEAMID + " AND r." + CoeCooperationRoleModel.ID + "= m." + CoeCooperationMemberModel.ROLEID + " AND m." + CoeCooperationMemberModel.USERID + "=?";
return DBSql.getObject(sql, rowMapper(), new Object[]{teamId, userId});
}
/**
* 删除所有
*/
public void removeAll() throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName();
DBSql.update(sql);
// 处理缓存
CoeCooperationRoleCache.getCache().reload();
}
/**
* 根据角色名称与小组id查询隐藏角色
* @param teamId
* @param roleName
* @return
*/
public CoeCooperationRoleModel getCooperationHideRoleByRoleName(String teamId, String roleName) {
String where = CoeCooperationRoleModel.TEAMID + "=? and " + CoeCooperationRoleModel.ROLENAME +"=? and "+CoeCooperationRoleModel.ISUSER +"= 1";
return queryBy(where,teamId,roleName);
}
/**
* 根据小组删除相关数据
* @param teamId
*/
public void removeByTeam(String teamId) throws AWSDataAccessException{
String sql = "DELETE FROM " + entityName()
+ " WHERE " + CoeCooperationRoleModel.TEAMID + "=?";
DBSql.update(sql, new Object[]{teamId});
}
/**
* 删除小组下的角色
* @param teamId
*/
public void remove(String teamId, String roleId) throws AWSDataAccessException{
String sql = "DELETE FROM " + entityName()
+ " WHERE " + CoeCooperationRoleModel.TEAMID + "=? AND " + CoeCooperationRoleModel.ID + "=?";
DBSql.update(sql, new Object[]{teamId, roleId});
}
/**
* 删除所有
*/
public void removeAll() throws AWSDataAccessException{
String sql = "DELETE FROM " + entityName();
DBSql.update(sql);
}
private class Mapper implements RowMapper<CoeCooperationRoleModel> {
public CoeCooperationRoleModel mapRow(ResultSet rset, int rowNum) throws SQLException {
CoeCooperationRoleModel model = new CoeCooperationRoleModel();
try {
model.setId(rset.getString(CoeCooperationRoleModel.ID));
model.setTeamId(rset.getString(CoeCooperationRoleModel.TEAMID));
model.setRoleName(rset.getString(CoeCooperationRoleModel.ROLENAME));
model.setRoleDesc(rset.getString(CoeCooperationRoleModel.ROLEDESC));
model.setRoleType(rset.getInt(CoeCooperationRoleModel.ROLETYPE));
model.setAppPerm(rset.getString(CoeCooperationRoleModel.APPPERM));
model.setActionPerm(rset.getString(CoeCooperationRoleModel.ACTIONPERM));
model.setDataPerm(rset.getString(CoeCooperationRoleModel.DATAPERM));
model.setCreateUser(rset.getString(CoeCooperationRoleModel.CREATEUSER));
model.setCreateTime(rset.getTimestamp(CoeCooperationRoleModel.CREATETIME));
model.setUpdateUser(rset.getString(CoeCooperationRoleModel.UPDATEUSER));
model.setUpdateTime(rset.getTimestamp(CoeCooperationRoleModel.UPDATETIME));
model.setIsUser(rset.getInt(CoeCooperationRoleModel.ISUSER));
} catch (Exception e) {
e.printStackTrace();
}
return model;
}
}
private class Mapper implements RowMapper<CoeCooperationRoleModel> {
public CoeCooperationRoleModel mapRow(ResultSet rset, int rowNum) throws SQLException {
CoeCooperationRoleModel model = new CoeCooperationRoleModel();
try {
model.setId(rset.getString(CoeCooperationRoleModel.ID));
model.setTeamId(rset.getString(CoeCooperationRoleModel.TEAMID));
model.setRoleName(rset.getString(CoeCooperationRoleModel.ROLENAME));
model.setRoleDesc(rset.getString(CoeCooperationRoleModel.ROLEDESC));
model.setRoleType(rset.getInt(CoeCooperationRoleModel.ROLETYPE));
model.setAppPerm(rset.getString(CoeCooperationRoleModel.APPPERM));
model.setActionPerm(rset.getString(CoeCooperationRoleModel.ACTIONPERM));
model.setDataPerm(rset.getString(CoeCooperationRoleModel.DATAPERM));
model.setCreateUser(rset.getString(CoeCooperationRoleModel.CREATEUSER));
model.setCreateTime(rset.getTimestamp(CoeCooperationRoleModel.CREATETIME));
model.setUpdateUser(rset.getString(CoeCooperationRoleModel.UPDATEUSER));
model.setUpdateTime(rset.getTimestamp(CoeCooperationRoleModel.UPDATETIME));
model.setIsUser(rset.getInt(CoeCooperationRoleModel.ISUSER));
} catch (Exception e) {
e.printStackTrace();
}
return model;
}
}
}

View File

@ -1,6 +1,15 @@
package com.actionsoft.apps.coe.pal.cooperation.dao;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.actionsoft.apps.coe.pal.cooperation.cache.CoeCooperationRolePermCache;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRolePermModel;
import com.actionsoft.bpms.commons.database.RowMapper;
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
@ -9,9 +18,6 @@ import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.exception.AWSDataAccessException;
import java.sql.*;
import java.util.*;
/**
* @Description TODO
* @Created by sunlh
@ -19,197 +25,192 @@ import java.util.*;
*/
public class CoeCooperationRolePermDao extends DaoObject<CoeCooperationRolePermModel> {
public CoeCooperationRolePermDao() {
public CoeCooperationRolePermDao() {
}
}
@Override
public int insert(CoeCooperationRolePermModel model) throws AWSDataAccessException {
if (model == null) {
return 0;
}
Connection conn = DBSql.open();
int r = 0;
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put(CoeCooperationRolePermModel.ID, model.getId());
paraMap.put(CoeCooperationRolePermModel.TEAMID, model.getTeamId());
paraMap.put(CoeCooperationRolePermModel.ROLEID, model.getRoleId());
paraMap.put(CoeCooperationRolePermModel.PALVERSIONID, model.getPalVersionId());
paraMap.put(CoeCooperationRolePermModel.ACTIONPERM, model.getActionPerm());
String sql = DBSql.getInsertStatement(entityName(), paraMap);
r = DBSql.update(conn, sql, paraMap);
DBSql.close(conn);
return r;
}
public List<CoeCooperationRolePermModel> getAllInstance() {
return query().list();
}
@Override
public int update(CoeCooperationRolePermModel coeCooperationRolePermModel) throws AWSDataAccessException {
return 0;
}
@Override
public int insert(CoeCooperationRolePermModel model) throws AWSDataAccessException {
if (model == null) {
return 0;
}
int r = 0;
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put(CoeCooperationRolePermModel.ID, model.getId());
paraMap.put(CoeCooperationRolePermModel.TEAMID, model.getTeamId());
paraMap.put(CoeCooperationRolePermModel.ROLEID, model.getRoleId());
paraMap.put(CoeCooperationRolePermModel.PALVERSIONID, model.getPalVersionId());
paraMap.put(CoeCooperationRolePermModel.ACTIONPERM, model.getActionPerm());
String sql = DBSql.getInsertStatement(entityName(), paraMap);
r = DBSql.update(sql, paraMap);
if (r > 0) {
CoeCooperationRolePermCache.getCache().put(model.getId(), model);
}
return r;
}
@Override
public String entityName() {
return CoeCooperationRolePermModel.DATABASE_ENTITY;
}
@Override
public int update(CoeCooperationRolePermModel coeCooperationRolePermModel) throws AWSDataAccessException {
return 0;
}
@Override
public RowMapper<CoeCooperationRolePermModel> rowMapper() {
return new Mapper();
}
@Override
public String entityName() {
return CoeCooperationRolePermModel.DATABASE_ENTITY;
}
/**
* 获取指定角色下的数据权限
* @param teamId
* @param roleId
* @return
*/
public List<String> getRolePermListByRole(String teamId, String roleId) {
String sql = "SELECT "+ CoeCooperationRolePermModel.PALVERSIONID +" FROM " + entityName() + " WHERE " + CoeCooperationRolePermModel.TEAMID + " =? AND "+ CoeCooperationRolePermModel.ROLEID +" =?";
try {
return DBSql.query(sql, new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int arg1) throws SQLException {
return rs.getString(1);
}
}, new Object[]{teamId, roleId});
} catch (AWSDataAccessException e) {
e.printStackTrace(System.err);
}
return new ArrayList<String>();
}
@Override
public RowMapper<CoeCooperationRolePermModel> rowMapper() {
return new Mapper();
}
/**
* 根据小组与角色id获取数据权限模型
* @param teamId
* @param roleId
* @return
*/
public List<CoeCooperationRolePermModel> getRolePermByTeamIdAndRoleId(String teamId,String roleId){
String where = CoeCooperationRolePermModel.TEAMID + " =? AND "+ CoeCooperationRolePermModel.ROLEID +" =?";
return query(where,teamId,roleId).list();
}
/**
* 根据小组删除相关数据
*
* @param teamId
*/
public void removeByTeam(String teamId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationRolePermModel.TEAMID + "=?";
DBSql.update(sql, new Object[] { teamId });
// 处理缓存
List<CoeCooperationRolePermModel> list = CoeCooperationRolePermCache.getByTeamId(teamId);
for (CoeCooperationRolePermModel model : list) {
CoeCooperationRolePermCache.getCache().remove(model.getId());
}
}
/**
* 根据小组删除相关数据
* @param teamId
*/
public void removeByTeam(String teamId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationRolePermModel.TEAMID + "=?";
DBSql.update(sql, new Object[]{teamId});
}
/**
* 根据小组角色的模型数据权限相关数据
*
* @param palVerId
*/
public void removeByPalVersionId(String palVerId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationRolePermModel.PALVERSIONID + "=?";
DBSql.update(sql, new Object[] { palVerId });
// 处理缓存
List<CoeCooperationRolePermModel> list = CoeCooperationRolePermCache.getByPalVersionId(palVerId);
for (CoeCooperationRolePermModel model : list) {
CoeCooperationRolePermCache.getCache().remove(model.getId());
}
}
/**
* 根据小组角色的模型数据权限相关数据
* @param palVerId
*/
public void removeByPalVersionId(String palVerId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationRolePermModel.PALVERSIONID + "=?";
DBSql.update(sql, new Object[]{palVerId});
}
/**
* 根据小组和角色删除相关数据
*
* @param teamId
* @param roleId
*/
public void removeByRole(String teamId, String roleId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationRolePermModel.TEAMID + "=? AND " + CoeCooperationRolePermModel.ROLEID + "=?";
DBSql.update(sql, new Object[] { teamId, roleId });
// 处理缓存
List<CoeCooperationRolePermModel> list = CoeCooperationRolePermCache.getByTeamIdAndRoleId(teamId, roleId);
for (CoeCooperationRolePermModel model : list) {
CoeCooperationRolePermCache.getCache().remove(model.getId());
}
}
/**
* 根据小组和角色删除相关数据
* @param teamId
* @param roleId
*/
public void removeByRole(String teamId, String roleId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName()
+ " WHERE " + CoeCooperationRolePermModel.TEAMID + "=? AND " + CoeCooperationRolePermModel.ROLEID + "=?";
DBSql.update(sql, new Object[]{teamId, roleId});
}
/**
* 根据小组角色删除指定的数据
*
* @param teamId
* @param roleId
* @param palVerIds
* @throws AWSDataAccessException
*/
public void removeDataByTeamAndPalVersionIds(String teamId, String roleId, Set<String> palVerIds) throws AWSDataAccessException {
StringBuffer ids = new StringBuffer();
for (String verId : palVerIds) {
ids.append(",").append("'").append(verId).append("'");
}
String verIds = ids.substring(1, ids.length());
String sql = "delete from " + entityName() + " where " + CoeCooperationRolePermModel.TEAMID + " = '" + teamId + "' and " + CoeCooperationRolePermModel.ROLEID + " = '" + roleId + "' and " + CoeCooperationRolePermModel.PALVERSIONID + " in (" + verIds + ")";
DBSql.update(sql);
// 处理缓存
List<CoeCooperationRolePermModel> list = CoeCooperationRolePermCache.getByTeamIdAndRoleId(teamId, roleId);
for (CoeCooperationRolePermModel model : list) {
if (palVerIds.contains(model.getPalVersionId())) {
CoeCooperationRolePermCache.getCache().remove(model.getId());
}
}
}
/**
* 根据小组角色删除指定的数据
* @param teamId
* @param roleId
* @param palVerIds
* @throws AWSDataAccessException
*/
public void removeDataByTeamAndPalVersionIds(String teamId, String roleId, Set<String> palVerIds) throws AWSDataAccessException {
StringBuffer ids = new StringBuffer();
for (String verId : palVerIds) {
ids.append(",").append("'").append(verId).append("'");
}
String verIds = ids.substring(1, ids.length());
String sql = "delete from " + entityName()
+ " where " + CoeCooperationRolePermModel.TEAMID + " = '" + teamId
+ "' and " + CoeCooperationRolePermModel.ROLEID + " = '" + roleId + "' and " + CoeCooperationRolePermModel.PALVERSIONID + " in (" + verIds + ")";
DBSql.update(sql);
}
/**
* 批量插入
*
* @param list
* @return
*/
public boolean batchInsert(List<CoeCooperationRolePermModel> list) throws AWSDataAccessException {
if (list == null || list.size() == 0) {
return false;
}
Connection conn = DBSql.open();
PreparedStatement prest = null;
try {
conn.setAutoCommit(false);
prest = conn.prepareStatement("INSERT INTO " + CoeCooperationRolePermModel.DATABASE_ENTITY + "(" + CoeCooperationRolePermModel.ID + "," + CoeCooperationRolePermModel.TEAMID + "," + CoeCooperationRolePermModel.ROLEID + "," + CoeCooperationRolePermModel.PALVERSIONID + "," + CoeCooperationRolePermModel.ACTIONPERM + ")" + " VALUES (?,?,?,?,?)", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
for (CoeCooperationRolePermModel model : list) {
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
prest.setString(1, model.getId());
prest.setString(2, model.getTeamId());
prest.setString(3, model.getRoleId());
prest.setString(4, model.getPalVersionId());
prest.setString(5, model.getActionPerm());
prest.addBatch();
}
prest.executeBatch();
conn.commit();
// 处理缓存
for (CoeCooperationRolePermModel model : list) {
CoeCooperationRolePermCache.getCache().put(model.getId(), model);
}
return true;
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
} finally {
DBSql.close(conn, prest, null);
}
return false;
}
/**
* 批量插入
* @param list
* @return
*/
public boolean batchInsert(List<CoeCooperationRolePermModel> list) throws AWSDataAccessException {
if (list == null || list.size() == 0) {
return false;
}
Connection conn = DBSql.open();
PreparedStatement prest = null;
try {
conn.setAutoCommit(false);
StringBuilder sql = new StringBuilder("INSERT INTO ").append(CoeCooperationRolePermModel.DATABASE_ENTITY)
.append("(")
.append(CoeCooperationRolePermModel.ID).append(",")
.append(CoeCooperationRolePermModel.TEAMID).append(",")
.append(CoeCooperationRolePermModel.ROLEID).append(",")
.append(CoeCooperationRolePermModel.PALVERSIONID).append(",")
.append(CoeCooperationRolePermModel.ACTIONPERM).append(")")
.append(" VALUES (?,?,?,?,?)");
prest = conn.prepareStatement(sql.toString(), ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
for (CoeCooperationRolePermModel model : list) {
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
prest.setString(1, model.getId());
prest.setString(2, model.getTeamId());
prest.setString(3, model.getRoleId());
prest.setString(4, model.getPalVersionId());
prest.setString(5, model.getActionPerm());
prest.addBatch();
}
prest.executeBatch();
conn.commit();
return true;
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
} finally {
DBSql.close(conn, prest, null);
}
return false;
}
/**
* 删除所有
*/
public void removeAll() throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName();
DBSql.update(sql);
// 处理缓存
CoeCooperationRolePermCache.getCache().reload();
}
/**
* 删除所有
*/
public void removeAll() throws AWSDataAccessException{
String sql = "DELETE FROM " + entityName();
DBSql.update(sql);
}
private class Mapper implements RowMapper<CoeCooperationRolePermModel> {
public CoeCooperationRolePermModel mapRow(ResultSet rset, int rowNum) throws SQLException {
CoeCooperationRolePermModel model = new CoeCooperationRolePermModel();
try {
model.setId(rset.getString(CoeCooperationRolePermModel.ID));
model.setTeamId(rset.getString(CoeCooperationRolePermModel.TEAMID));
model.setRoleId(rset.getString(CoeCooperationRolePermModel.ROLEID));
model.setPalVersionId(rset.getString(CoeCooperationRolePermModel.PALVERSIONID));
model.setActionPerm(rset.getString(CoeCooperationRolePermModel.ACTIONPERM));
} catch (Exception e) {
e.printStackTrace();
}
return model;
}
}
private class Mapper implements RowMapper<CoeCooperationRolePermModel> {
public CoeCooperationRolePermModel mapRow(ResultSet rset, int rowNum) throws SQLException {
CoeCooperationRolePermModel model = new CoeCooperationRolePermModel();
try {
model.setId(rset.getString(CoeCooperationRolePermModel.ID));
model.setTeamId(rset.getString(CoeCooperationRolePermModel.TEAMID));
model.setRoleId(rset.getString(CoeCooperationRolePermModel.ROLEID));
model.setPalVersionId(rset.getString(CoeCooperationRolePermModel.PALVERSIONID));
model.setActionPerm(rset.getString(CoeCooperationRolePermModel.ACTIONPERM));
} catch (Exception e) {
e.printStackTrace();
}
return model;
}
}
}

View File

@ -1,5 +1,14 @@
package com.actionsoft.apps.coe.pal.cooperation.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.actionsoft.apps.coe.pal.cooperation.cache.CoeCooperationTeamPermCache;
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationTeamPermModel;
import com.actionsoft.bpms.commons.database.RowMapper;
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
@ -8,164 +17,154 @@ import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.exception.AWSDataAccessException;
import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description TODO
* @Created by sunlh
* @Date 2020-12-01
*/
public class CoeCooperationTeamPermDao extends DaoObject<CoeCooperationTeamPermModel> {
public CoeCooperationTeamPermDao() {
}
@Override
public int insert(CoeCooperationTeamPermModel model) throws AWSDataAccessException {
if (model == null) {
return 0;
}
Connection conn = DBSql.open();
int r = 0;
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put(CoeCooperationTeamPermModel.ID, model.getId());
paraMap.put(CoeCooperationTeamPermModel.TEAMID, model.getTeamId());
paraMap.put(CoeCooperationTeamPermModel.PALVERSIONID, model.getPalVersionId());
String sql = DBSql.getInsertStatement(entityName(), paraMap);
r = DBSql.update(conn, sql, paraMap);
DBSql.close(conn);
return r;
}
@Override
public int update(CoeCooperationTeamPermModel coeCooperationTeamPermModel) throws AWSDataAccessException {
return 0;
}
public CoeCooperationTeamPermDao() {
@Override
public String entityName() {
return CoeCooperationTeamPermModel.DATABASE_ENTITY;
}
}
@Override
public RowMapper<CoeCooperationTeamPermModel> rowMapper() {
return new Mapper();
}
public List<CoeCooperationTeamPermModel> getAllInstance() {
return query().list();
}
/**
* 获取小组的模型数据访问权限配置
* @param teamId
* @return
*/
public List<String> getCooperationTeamPermVerIds(String teamId) {
String sql = "SELECT " + CoeCooperationTeamPermModel.PALVERSIONID + " from " + entityName() + " WHERE "+ CoeCooperationTeamPermModel.TEAMID +"=?";
try {
return DBSql.query(sql, new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int arg1) throws SQLException {
return rs.getString(1);
}
}, new Object[]{teamId});
} catch (AWSDataAccessException e) {
e.printStackTrace(System.err);
}
@Override
public int insert(CoeCooperationTeamPermModel model) throws AWSDataAccessException {
if (model == null) {
return 0;
}
int r = 0;
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put(CoeCooperationTeamPermModel.ID, model.getId());
paraMap.put(CoeCooperationTeamPermModel.TEAMID, model.getTeamId());
paraMap.put(CoeCooperationTeamPermModel.PALVERSIONID, model.getPalVersionId());
String sql = DBSql.getInsertStatement(entityName(), paraMap);
r = DBSql.update(sql, paraMap);
if (r > 0) {
// 处理缓存
CoeCooperationTeamPermCache.getCache().put(model.getId(), model);
}
return r;
}
return new ArrayList<String>();
}
@Override
public int update(CoeCooperationTeamPermModel coeCooperationTeamPermModel) throws AWSDataAccessException {
return 0;
}
/**
* 批量插入
* @param list
* @return
*/
public boolean batchInsert(List<CoeCooperationTeamPermModel> list) throws AWSDataAccessException {
if (list == null || list.size() == 0) {
return false;
}
Connection conn = DBSql.open();
PreparedStatement prest = null;
try {
conn.setAutoCommit(false);
StringBuilder sql = new StringBuilder("INSERT INTO ").append(CoeCooperationTeamPermModel.DATABASE_ENTITY)
.append("(")
.append(CoeCooperationTeamPermModel.ID).append(",")
.append(CoeCooperationTeamPermModel.TEAMID).append(",")
.append(CoeCooperationTeamPermModel.PALVERSIONID).append(")")
.append(" VALUES (?,?,?)");
prest = conn.prepareStatement(sql.toString(), ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
for (CoeCooperationTeamPermModel model : list) {
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
prest.setString(1, model.getId());
prest.setString(2, model.getTeamId());
prest.setString(3, model.getPalVersionId());
prest.addBatch();
}
prest.executeBatch();
conn.commit();
return true;
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
} finally {
DBSql.close(conn, prest, null);
}
return false;
}
@Override
public String entityName() {
return CoeCooperationTeamPermModel.DATABASE_ENTITY;
}
/**
* 删除小组的模型数据权限配置
* @param teamId
*/
public void removeByTeam(String teamId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName()
+ " WHERE " + CoeCooperationTeamPermModel.TEAMID + "=?";
DBSql.update(sql, new Object[]{teamId});
}
@Override
public RowMapper<CoeCooperationTeamPermModel> rowMapper() {
return new Mapper();
}
/**
* 删除小组的模型数据权限配置
* @param palVerId
*/
public void removeByPalVersionId(String palVerId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName()
+ " WHERE " + CoeCooperationTeamPermModel.PALVERSIONID + "=?";
DBSql.update(sql, new Object[]{palVerId});
}
/**
* 批量插入
*
* @param list
* @return
*/
public boolean batchInsert(List<CoeCooperationTeamPermModel> list) throws AWSDataAccessException {
if (list == null || list.size() == 0) {
return false;
}
Connection conn = DBSql.open();
PreparedStatement prest = null;
try {
conn.setAutoCommit(false);
prest = conn.prepareStatement("INSERT INTO " + CoeCooperationTeamPermModel.DATABASE_ENTITY + "(" + CoeCooperationTeamPermModel.ID + "," + CoeCooperationTeamPermModel.TEAMID + "," + CoeCooperationTeamPermModel.PALVERSIONID + ")" + " VALUES (?,?,?)", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
for (CoeCooperationTeamPermModel model : list) {
if (UtilString.isEmpty(model.getId())) {
model.setId(UUIDGener.getUUID());
}
prest.setString(1, model.getId());
prest.setString(2, model.getTeamId());
prest.setString(3, model.getPalVersionId());
prest.addBatch();
}
prest.executeBatch();
conn.commit();
// 处理缓存
for (CoeCooperationTeamPermModel model : list) {
CoeCooperationTeamPermCache.getCache().put(model.getId(), model);
}
return true;
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
} finally {
DBSql.close(conn, prest, null);
}
return false;
}
/**
* 删除所有
*/
public void removeAll() throws AWSDataAccessException{
String sql = "DELETE FROM " + entityName();
DBSql.update(sql);
}
/**
* 删除小组的模型数据权限配置
*
* @param teamId
*/
public void removeByTeam(String teamId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationTeamPermModel.TEAMID + "=?";
DBSql.update(sql, new Object[] { teamId });
// 处理缓存
List<CoeCooperationTeamPermModel> list = CoeCooperationTeamPermCache.getByTeamId(teamId);
for (CoeCooperationTeamPermModel model : list) {
CoeCooperationTeamPermCache.getCache().remove(model.getId());
}
}
/**
* 删除小组的模型数据权限配置
*
* @param palVerId
*/
public void removeByPalVersionId(String palVerId) throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName() + " WHERE " + CoeCooperationTeamPermModel.PALVERSIONID + "=?";
DBSql.update(sql, new Object[] { palVerId });
// 处理缓存
List<CoeCooperationTeamPermModel> list = CoeCooperationTeamPermCache.getByPalVersionId(palVerId);
for (CoeCooperationTeamPermModel model : list) {
CoeCooperationTeamPermCache.getCache().remove(model.getId());
}
}
/**
* 删除所有
*/
public void removeAll() throws AWSDataAccessException {
String sql = "DELETE FROM " + entityName();
DBSql.update(sql);
// 处理缓存
CoeCooperationTeamPermCache.getCache().reload();
}
private class Mapper implements RowMapper<CoeCooperationTeamPermModel> {
public CoeCooperationTeamPermModel mapRow(ResultSet rset, int rowNum) throws SQLException {
CoeCooperationTeamPermModel model = new CoeCooperationTeamPermModel();
try {
model.setId(rset.getString(CoeCooperationTeamPermModel.ID));
model.setTeamId(rset.getString(CoeCooperationTeamPermModel.TEAMID));
model.setPalVersionId(rset.getString(CoeCooperationTeamPermModel.PALVERSIONID));
} catch (Exception e) {
e.printStackTrace();
}
return model;
}
}
private class Mapper implements RowMapper<CoeCooperationTeamPermModel> {
public CoeCooperationTeamPermModel mapRow(ResultSet rset, int rowNum) throws SQLException {
CoeCooperationTeamPermModel model = new CoeCooperationTeamPermModel();
try {
model.setId(rset.getString(CoeCooperationTeamPermModel.ID));
model.setTeamId(rset.getString(CoeCooperationTeamPermModel.TEAMID));
model.setPalVersionId(rset.getString(CoeCooperationTeamPermModel.PALVERSIONID));
} catch (Exception e) {
e.printStackTrace();
}
return model;
}
}
}

View File

@ -9,76 +9,75 @@ import com.actionsoft.bpms.commons.mvc.model.ModelBean;
*/
public final class CoeCooperationRolePermModel extends ModelBean {
private static final long serialVersionUID = 1L;
public static final String DATABASE_ENTITY = "APP_ACT_COE_PAL_COOP_ROLE_PERM";
public static final String ID = "ID";
public static final String TEAMID = "TEAMID";
public static final String ROLEID = "ROLEID";
public static final String PALVERSIONID = "PALVERSIONID";
public static final String ACTIONPERM = "ACTIONPERM";
private static final long serialVersionUID = 1L;
private String id;
private String teamId;
private String roleId;
private String palVersionId;
private String actionPerm;
public static final String DATABASE_ENTITY = "APP_ACT_COE_PAL_COOP_ROLE_PERM";
public static final String ID = "ID";
public static final String TEAMID = "TEAMID";
public static final String ROLEID = "ROLEID";
public static final String PALVERSIONID = "PALVERSIONID";
public static final String ACTIONPERM = "ACTIONPERM";
public CoeCooperationRolePermModel() {
}
private String id;
private String teamId;
private String roleId;
private String palVersionId;
private String actionPerm;
public CoeCooperationRolePermModel(String id, String teamId, String roleId, String palVersionId) {
this.id = id;
this.teamId = teamId;
this.roleId = roleId;
this.palVersionId = palVersionId;
this.actionPerm = "";
}
public CoeCooperationRolePermModel() {
}
public CoeCooperationRolePermModel(String id, String teamId, String roleId, String palVersionId, String actionPerm) {
this.id = id;
this.teamId = teamId;
this.roleId = roleId;
this.palVersionId = palVersionId;
this.actionPerm = actionPerm;
}
public CoeCooperationRolePermModel(String id, String teamId, String roleId, String palVersionId) {
this.id = id;
this.teamId = teamId;
this.roleId = roleId;
this.palVersionId = palVersionId;
}
public String getId() {
return id;
}
public CoeCooperationRolePermModel(String id, String teamId, String roleId, String palVersionId, String actionPerm) {
this.id = id;
this.teamId = teamId;
this.roleId = roleId;
this.palVersionId = palVersionId;
this.actionPerm = actionPerm;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public String getTeamId() {
return teamId;
}
public void setId(String id) {
this.id = id;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public String getTeamId() {
return teamId;
}
public String getRoleId() {
return roleId;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public void setRoleId(String roleId) {
this.roleId = roleId;
}
public String getRoleId() {
return roleId;
}
public String getPalVersionId() {
return palVersionId;
}
public void setRoleId(String roleId) {
this.roleId = roleId;
}
public void setPalVersionId(String palVersionId) {
this.palVersionId = palVersionId;
}
public String getPalVersionId() {
return palVersionId;
}
public String getActionPerm() {
return actionPerm == null ? "" : actionPerm;
}
public void setPalVersionId(String palVersionId) {
this.palVersionId = palVersionId;
}
public String getActionPerm() {
return actionPerm;
}
public void setActionPerm(String actionPerm) {
this.actionPerm = actionPerm;
}
public void setActionPerm(String actionPerm) {
this.actionPerm = actionPerm;
}
}

View File

@ -26,7 +26,7 @@ public class PALMethodManager {
}
public static PALMethodManager getInstance() {
return PALMethodManager.Inner.instance;
return Inner.instance;
}
private PALMethodManager() {

View File

@ -1,29 +1,31 @@
package com.actionsoft.apps.coe.pal.pal.method.cache;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.actionsoft.apps.AppsConst;
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.pal.method.constant.PALMethodConst;
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
import com.actionsoft.bpms.util.UtilFile;
import com.actionsoft.apps.coe.pal.pal.method.constant.PALMethodConst;
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.i18n.I18nRes;
import com.alibaba.fastjson.JSONObject;
/**
* PALMethodModel缓存
*
*
* @author zhouxuan
*
*/
public class PALMethodCache {
private static Map<String, PALMethodModel> pmppMap = new LinkedHashMap<>();
private static final Map<String, PALMethodModel> pmppMap = new LinkedHashMap<>();
@SuppressWarnings("rawtypes") private static final Map<String, List> temp = new LinkedHashMap<>();
private static String basicTpl;
public static String getBasicTpl() {
@ -35,16 +37,13 @@ public class PALMethodCache {
return basicTpl;
}
@SuppressWarnings("rawtypes")
private static Map<String, List> temp = new LinkedHashMap<>();
public static Map<String, PALMethodModel> getPALMethodModelMap() {
return pmppMap;
}
/**
* 根据methodId获取PALMethodModel
*
*
* @param methodId
* @return PALMethodModel对象
*/
@ -54,28 +53,28 @@ public class PALMethodCache {
/**
* 根据method获取PALMethodModel method="process";
*
*
* @param method
* @return PALMethodModel对象
*/
@SuppressWarnings("unchecked")
public static List<PALMethodModel> getPALMethodModelListByMethod(String method) {
if (true) {
// if (temp.get(method) == null) {
// if (temp.get(method) == null) {
List<PALMethodModel> list = new ArrayList<PALMethodModel>();
Iterator<String> iterator = pmppMap.keySet().iterator();
while (iterator.hasNext()) {
String k = iterator.next();
if (k.startsWith(method)) {
if(method.equals("data")){
if (method.equals("data")) {
continue;
}
//如果是控制类过滤到制度图
if(method.equals("control")){
if(k.equals("control.policy")){
continue;
}
if (method.equals("control")) {
if (k.equals("control.policy")) {
continue;
}
}
list.add(pmppMap.get(k));
}
@ -92,14 +91,14 @@ public class PALMethodCache {
/**
* 获取存在的Method
*
*
* @return
*/
@SuppressWarnings("unchecked")
public static List<String> getPALMethodList() {
String key = "PALMethodModelList";
if (true) {
// if (temp.get(key) == null) {
// if (temp.get(key) == null) {
List<String> list = new ArrayList<String>();
Map<String, String> map = new HashMap<String, String>();
Iterator<String> iterator = pmppMap.keySet().iterator();
@ -121,6 +120,7 @@ public class PALMethodCache {
/**
* 获取存在的method
*
* @param sort 是否按照processorgdataitsystemcontrol在前自定义大类在后
* @return bak
*/
@ -131,7 +131,7 @@ public class PALMethodCache {
} else {
List<String> result = new ArrayList<>();
//String[] methodArray = new String[] { "process", "org", "data", "itsystem", "control" };
String[] methodArrays = new String[] { "process","data","control","org","itsystem","engineering"};
String[] methodArrays = new String[] { "process", "data", "control", "org", "itsystem", "engineering" };
for (String method : methodArrays) {
if (list.contains(method)) {
result.add(method);
@ -148,6 +148,7 @@ public class PALMethodCache {
/**
* 查询小组权限范围内的建模大类
*
* @param teamId
* @param userId
* @param sort
@ -157,8 +158,8 @@ public class PALMethodCache {
List<String> methodList = PALMethodCache.getPALMethodList(sort);
if (UtilString.isNotEmpty(teamId)) {
List<String> permMethodList = new ArrayList<>();
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, userId, false);
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
Set<String> versionIds = CoeCooperationAPIManager.getInstance().getUserDataPermission(teamId, userId, false);
for (String verId : versionIds) {
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(verId);
if (verModels != null && verModels.size() > 0 && !permMethodList.contains(verModels.get(0).getMethodCategory())) {
@ -178,6 +179,7 @@ public class PALMethodCache {
/**
* 查询小组权限范围内的建模大类
*
* @param teamId
* @param userId
* @param sort
@ -187,8 +189,8 @@ public class PALMethodCache {
List<String> methodList = PALMethodCache.getPALMethodList(sort);
if (UtilString.isNotEmpty(teamId)) {
List<String> permMethodList = new ArrayList<>();
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, userId, false);
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
Set<String> versionIds = CoeCooperationAPIManager.getInstance().getUserDataPermission(teamId, userId, false);
for (String verId : versionIds) {
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(verId);
if (verModels != null && verModels.size() > 0 && !permMethodList.contains(verModels.get(0).getMethodCategory())) {

View File

@ -33,7 +33,7 @@ public class PALRepositoryAPIManager {
}
public static PALRepositoryAPIManager getInstance() {
return PALRepositoryAPIManager.Inner.instance;
return Inner.instance;
}
private PALRepositoryAPIManager() {

View File

@ -27,7 +27,7 @@ public class CoeProcessLevelNoCache {
public static CoeProcessLevelNoCache getInstance() {
return CoeProcessLevelNoCache.Inner.instance;
return Inner.instance;
}
public synchronized void loadProcessLevel(String wsId) {

View File

@ -1328,9 +1328,9 @@ public class PALRepository extends DaoObject<PALRepositoryModel> {
if (!ids.equals("")) {
UtilString ustr = new UtilString(ids);
List<String> v = ustr.split(",");
java.sql.Connection conn = DBSql.open();
Connection conn = DBSql.open();
PreparedStatement ps = null;
java.sql.ResultSet rset = null;
ResultSet rset = null;
try {
conn.setAutoCommit(false);
String sql = "DELETE FROM " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_UUID + "=?";
@ -1846,9 +1846,9 @@ public class PALRepository extends DaoObject<PALRepositoryModel> {
* @return
*/
public String getPlPieData(final String type, String wsId, String condition) {
java.sql.Connection conn = null;
Connection conn = null;
java.sql.Statement stmt = null;
java.sql.ResultSet rset = null;
ResultSet rset = null;
List<String> args = new ArrayList<String>();
String sql = getSqlByType(type, wsId, condition, args);
final String fieldName = getField(type);
@ -1883,9 +1883,9 @@ public class PALRepository extends DaoObject<PALRepositoryModel> {
* @return
*/
public Map<String, List<Map<String, Object>>> getProcessReportCount(final String type, String wsId, String condition) {
java.sql.Connection conn = null;
Connection conn = null;
java.sql.Statement stmt = null;
java.sql.ResultSet rset = null;
ResultSet rset = null;
List<String> args = new ArrayList<String>();
String sql = getSqlByType(type, wsId, condition, args);
final String fieldName = getField(type);
@ -1942,7 +1942,7 @@ public class PALRepository extends DaoObject<PALRepositoryModel> {
return sql.toString();
}
private String getShowName(String type, java.sql.ResultSet rset, String fieldName) throws SQLException {
private String getShowName(String type, ResultSet rset, String fieldName) throws SQLException {
String name = "";
if (type.equals(CoeProcessLevelConstant.PLM)) { // 按里程碑
name = CoeProcessLevelUtil.getPlM(String.valueOf(rset.getInt(fieldName)));
@ -4377,7 +4377,7 @@ public class PALRepository extends DaoObject<PALRepositoryModel> {
if (!map.isEmpty()) {
Connection conn = DBSql.open();
PreparedStatement ps = null;
java.sql.ResultSet rset = null;
ResultSet rset = null;
try {
conn.setAutoCommit(false);
String sql = "UPDATE " + PALRepositoryModelImpl.DATABASE_ENTITY + " set " + PALRepositoryModelImpl.FIELD_FILE_PATH + "=? where " + PALRepositoryModelImpl.FIELD_UUID + "=?";

View File

@ -9,30 +9,31 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel;
import com.actionsoft.bpms.commons.database.BatchPreparedStatementSetter;
import com.actionsoft.bpms.commons.database.RowMapper;
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel;
import com.actionsoft.exception.AWSDataAccessException;
public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyModel> {
@Override
public int insert(PALRepositoryPropertyModel model)
throws AWSDataAccessException {
public int insert(PALRepositoryPropertyModel model) throws AWSDataAccessException {
Map<String, Object> paramsMap = getModelParamsMap(model);
int result = DBSql.update(DBSql.getInsertStatement(entityName(), paramsMap), paramsMap);
if (result > 0) {
PALRepositoryPropertyCache.getCache().put(model.getId(), model);
PALRepositoryPropertyCache.getCache().put(model.getId(), model);
}
return result;
}
/**
* 批量导入
*
* @param list
* @return
* @author tanj
@ -80,9 +81,10 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
}
return false;
}
/**
* 批量导入
*
* @param list
* @return
* @author tanj
@ -116,9 +118,10 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
}
return false;
}
/**
* 刷新缓存
*
* @param list
*/
public void refreshCache(List<PALRepositoryPropertyModel> list) {
@ -129,9 +132,10 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
PALRepositoryPropertyCache.getCache().put(model.getId(), model);
}
}
/**
* 批量删除属性
*
* @param list
* @return
*/
@ -140,7 +144,7 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
int[] resultNum = null;
try {
conn.setAutoCommit(false);
String sql = "DELETE FROM " + entityName() + " WHERE "+ PALRepositoryPropertyModel.FIELD_ID +"=? ";
String sql = "DELETE FROM " + entityName() + " WHERE " + PALRepositoryPropertyModel.FIELD_ID + "=? ";
resultNum = DBSql.batch(conn, sql, new BatchPreparedStatementSetter() {
@Override
@ -149,12 +153,11 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
}
@Override
public void setValues(PreparedStatement prest, int paramInt)
throws SQLException {
public void setValues(PreparedStatement prest, int paramInt) throws SQLException {
PALRepositoryPropertyModel model = list.get(paramInt);
prest.setString(1, model.getId());
}
});
conn.commit();
if (list != null) {
@ -175,6 +178,7 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
}
return resultNum;
}
private Map<String, Object> getModelParamsMap(PALRepositoryPropertyModel model) {
Map<String, Object> paramsMap = new HashMap<String, Object>();
if (UtilString.isEmpty(model.getId())) {
@ -188,10 +192,9 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
paramsMap.put(PALRepositoryPropertyModel.FIELD_ORDERINDEX, model.getOrderIndex());
return paramsMap;
}
@Override
public int update(PALRepositoryPropertyModel model)
throws AWSDataAccessException {
public int update(PALRepositoryPropertyModel model) throws AWSDataAccessException {
String sql = "UPDATE " + entityName() + " SET PLID=:PLID, PROPERTYID=:PROPERTYID, PROPERTYNAME=:PROPERTYNAME, PROPERTYVALUE=:PROPERTYVALUE, ORDERINDEX=:ORDERINDEX WHERE ID=:ID";
Map<String, Object> paramsMap = new HashMap<String, Object>();
paramsMap.put("PLID", model.getPlId());
@ -203,7 +206,7 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
int result = DBSql.update(sql, paramsMap);
if (result > 0) {
PALRepositoryPropertyCache.getCache().remove(model.getId());
PALRepositoryPropertyCache.getCache().put(model.getId(), model);
PALRepositoryPropertyCache.getCache().put(model.getId(), model);
}
return result;
}
@ -217,29 +220,15 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
public RowMapper<PALRepositoryPropertyModel> rowMapper() {
return new PALRepositoryPropertyModelMapper();
}
private static class PALRepositoryPropertyModelMapper implements RowMapper<PALRepositoryPropertyModel> {
public PALRepositoryPropertyModel mapRow(ResultSet rs, int arg1)
throws SQLException {
PALRepositoryPropertyModel model=new PALRepositoryPropertyModel();
model.setId(rs.getString(PALRepositoryPropertyModel.FIELD_ID));
model.setPlId(rs.getString(PALRepositoryPropertyModel.FIELD_PLID));
model.setPropertyId(rs.getString(PALRepositoryPropertyModel.FIELD_PROPERTYID));
model.setPropertyName(rs.getString(PALRepositoryPropertyModel.FIELD_PROPERTYNAME));
model.setPropertyValue(rs.getString(PALRepositoryPropertyModel.FIELD_PROPERTYVALUE) == null ? "" : rs.getString(PALRepositoryPropertyModel.FIELD_PROPERTYVALUE));
model.setOrderIndex(rs.getInt(PALRepositoryPropertyModel.FIELD_ORDERINDEX));
return model;
}
}
/**
* 根据流程Id获取所有文件的自定义属性
*
*
* @param plId
* @return
*/
public List<PALRepositoryPropertyModel> getPropertysByPlid(String plId, String propertyId) {
String sql = "SELECT * FROM " + entityName() + " WHERE " + PALRepositoryPropertyModel.FIELD_PLID + "=:PLID";
String sql = "SELECT * FROM " + entityName() + " WHERE " + PALRepositoryPropertyModel.FIELD_PLID + "=:PLID";
Map<String, Object> params = new HashMap<String, Object>();
params.put("PLID", plId);
if (!UtilString.isEmpty(propertyId)) {
@ -248,10 +237,10 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
}
return DBSql.query(sql, params, rowMapper());
}
/**
* 更新流程的所有自定义属性
*
*
* @param plId
* @param propertys
* @throws SQLException
@ -301,19 +290,19 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
PALRepositoryPropertyCache.getCache().remove(model.getId());
PALRepositoryPropertyCache.getCache().put(model.getId(), model);
}
return resultNum;
} catch(SQLException e) {
} catch (SQLException e) {
conn.rollback();
throw e;
}finally {
} finally {
DBSql.close(conn);
}
}
/**
* 根据流程文件Id删除所有属性或某个属性
*
*
* @param plId
* @return
*/
@ -346,7 +335,7 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
}
return r;
}
public int updatePropertyByPropertyId(String plId, String propertyId, String propertyValue) {
String sql = "UPDATE " + entityName() + " SET PROPERTYVALUE=:PROPERTYVALUE WHERE PLID=:PLID AND PROPERTYID=:PROPERTYID";
Map<String, Object> params = new HashMap<String, Object>();
@ -359,22 +348,20 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
if (propertyModel != null) {
propertyModel.setPropertyValue(propertyValue);
PALRepositoryPropertyCache.getCache().put(propertyModel.getId(), propertyModel);
}
}
}
return r;
}
public boolean updateProperties(List<PALRepositoryPropertyModel> properties) throws SQLException {
boolean completeSuccess = false;
if (properties != null && properties.size() > 0){
if (properties != null && properties.size() > 0) {
Connection conn = DBSql.open();
PreparedStatement ps = null;
ResultSet resultSet = null;
try {
conn.setAutoCommit(false);
String sql = "update " + entityName() + " set " + PALRepositoryPropertyModel.FIELD_PROPERTYVALUE + " =? "
+ " where " + PALRepositoryPropertyModel.FIELD_PROPERTYID + " =? and "
+ PALRepositoryPropertyModel.FIELD_PLID + " != ? ";
String sql = "update " + entityName() + " set " + PALRepositoryPropertyModel.FIELD_PROPERTYVALUE + " =? " + " where " + PALRepositoryPropertyModel.FIELD_PROPERTYID + " =? and " + PALRepositoryPropertyModel.FIELD_PLID + " != ? ";
ps = conn.prepareStatement(sql);
for (PALRepositoryPropertyModel property : properties) {
ps.setString(1, property.getPropertyValue());
@ -387,27 +374,32 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
for (int i = 0; i < rs.length; i++) {
if ((rs[i] >= 0) || (rs[i] == PreparedStatement.SUCCESS_NO_INFO)) {
completeSuccess = true;
break;
}
}
if (completeSuccess){
if (completeSuccess) {
conn.commit();
PALRepositoryPropertyCache.getCache().load();
}else {
for (PALRepositoryPropertyModel model : properties) {
PALRepositoryPropertyCache.getCache().put(model.getId(), model);
}
} else {
conn.rollback();
PALRepositoryPropertyCache.getCache().load();
}
} catch (SQLException e) {
conn.rollback();
}finally {
PALRepositoryPropertyCache.getCache().load();
} finally {
DBSql.close(conn, ps, resultSet);
}
}
return completeSuccess;
}
/**
* 更新流程的所有自定义属性
*
* @param propertys
* @throws SQLException
*/
@ -438,10 +430,10 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
}
return resultNum;
} catch(SQLException e) {
} catch (SQLException e) {
conn.rollback();
throw e;
}finally {
} finally {
DBSql.close(conn);
}
}
@ -463,6 +455,7 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
/**
* 删除通过外部进行提交缓存需要单独处理
*
* @param conn
* @param prest
* @param id
@ -484,6 +477,7 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
/**
* 删除缓存
*
* @param list id集合
*/
public void removeCacheByIds(List<String> list) {
@ -498,10 +492,23 @@ public class PALRepositoryPropertyDao extends DaoObject<PALRepositoryPropertyMod
* 根据资产库和属性id查询
*/
public List<PALRepositoryPropertyModel> queryByWsId(String wsId) {
StringBuilder sql = new StringBuilder("SELECT * FROM " + entityName() + " d WHERE EXISTS (SELECT 1 FROM APP_ACT_COE_PAL_REPOSITORY r WHERE r.WSID = ? AND r.ID = d.PLID) ");
String sql = "SELECT * FROM " + entityName() + " d WHERE EXISTS (SELECT 1 FROM APP_ACT_COE_PAL_REPOSITORY r WHERE r.WSID = ? AND r.ID = d.PLID) ";
List<Object> args = new ArrayList<Object>();
args.add(wsId);
return DBSql.query(sql.toString(), rowMapper(), args.toArray());
return DBSql.query(sql, rowMapper(), args.toArray());
}
private static class PALRepositoryPropertyModelMapper implements RowMapper<PALRepositoryPropertyModel> {
public PALRepositoryPropertyModel mapRow(ResultSet rs, int arg1) throws SQLException {
PALRepositoryPropertyModel model = new PALRepositoryPropertyModel();
model.setId(rs.getString(PALRepositoryPropertyModel.FIELD_ID));
model.setPlId(rs.getString(PALRepositoryPropertyModel.FIELD_PLID));
model.setPropertyId(rs.getString(PALRepositoryPropertyModel.FIELD_PROPERTYID));
model.setPropertyName(rs.getString(PALRepositoryPropertyModel.FIELD_PROPERTYNAME));
model.setPropertyValue(rs.getString(PALRepositoryPropertyModel.FIELD_PROPERTYVALUE) == null ? "" : rs.getString(PALRepositoryPropertyModel.FIELD_PROPERTYVALUE));
model.setOrderIndex(rs.getInt(PALRepositoryPropertyModel.FIELD_ORDERINDEX));
return model;
}
}
}

View File

@ -373,7 +373,7 @@ public class PALRepositoryRemove extends DaoObject<PALRepositoryRemoveModel> {
if (!map.isEmpty()) {
Connection conn = DBSql.open();
PreparedStatement ps = null;
java.sql.ResultSet rset = null;
ResultSet rset = null;
try {
conn.setAutoCommit(false);
String sql = "UPDATE " + entityName() + " set " + PALRepositoryModelImpl.FIELD_FILE_PATH + "=? where " + PALRepositoryModelImpl.FIELD_UUID + "=?";

View File

@ -51,7 +51,7 @@ public class CoeDesignerShapeAPIManager {
}
public static CoeDesignerShapeAPIManager getInstance() {
return CoeDesignerShapeAPIManager.Inner.instance;
return Inner.instance;
}
private CoeDesignerShapeAPIManager() {
@ -851,7 +851,7 @@ public class CoeDesignerShapeAPIManager {
*/
public JSONObject getCoeDefinitionAndSort(String define, String wsid, String methodId) {
JSONObject definition = JSONObject.parseObject(define);
JSONObject localAttribute = definition.containsKey("localAttribute") ? definition.getJSONObject("localAttribute") : new com.alibaba.fastjson.JSONObject();
JSONObject localAttribute = definition.containsKey("localAttribute") ? definition.getJSONObject("localAttribute") : new JSONObject();
if (localAttribute.isEmpty()) {
//处理流程节点属性配置
handlePlShapeAttrConfig(wsid, methodId, localAttribute);

View File

@ -43,7 +43,7 @@ public class CoeListenCacheManager extends TimerTask {
if (collaborationMessages.size() > 0) {
Calendar oldDate = Calendar.getInstance();
long oldTime;
Iterator<Map.Entry<String, List<ListenEvent>>> iteratorEvent = collaborationMessages.entrySet().iterator();
Iterator<Entry<String, List<ListenEvent>>> iteratorEvent = collaborationMessages.entrySet().iterator();
while (iteratorEvent.hasNext()) {
List<ListenEvent> messagesEvents = iteratorEvent.next().getValue();
List<ListenEvent> removeMessages = new ArrayList<ListenEvent>();
@ -68,14 +68,14 @@ public class CoeListenCacheManager extends TimerTask {
if (collaborationSessions.size() > 0) {
Calendar listenTime = Calendar.getInstance();
long listenTimeLong;
Iterator<Map.Entry<String, Map<String, ListenClient>>> iteratorSession = collaborationSessions.entrySet().iterator();
Iterator<Entry<String, Map<String, ListenClient>>> iteratorSession = collaborationSessions.entrySet().iterator();
while (iteratorSession.hasNext()) {
Map<String, ListenClient> listenClients = iteratorSession.next().getValue();
if (listenClients.size() == 0) {
iteratorSession.remove();
continue;
}
Iterator<Map.Entry<String, ListenClient>> it = listenClients.entrySet().iterator();
Iterator<Entry<String, ListenClient>> it = listenClients.entrySet().iterator();
while(it.hasNext()) {
ListenClient client = it.next().getValue();
String listenTimeStr = client.getListenTime();
@ -187,7 +187,7 @@ public class CoeListenCacheManager extends TimerTask {
Map<String, ListenClient> result = null;
if (collaborationSessions.containsKey(subject) && collaborationSessions.get(subject).size() > 0) {
result = new HashMap<String, ListenClient>();
for (Map.Entry<String, ListenClient> listenClientMap : collaborationSessions.get(subject).entrySet()) {
for (Entry<String, ListenClient> listenClientMap : collaborationSessions.get(subject).entrySet()) {
ListenClient listenClient = listenClientMap.getValue();
String userId = listenClient.getUserId();
if (!result.containsKey(userId)) {

View File

@ -97,7 +97,7 @@ public class DesignerRelationShapeCacheManager extends TimerTask{
public static DesignerRelationShapeCacheManager getInstance() {
return DesignerRelationShapeCacheManager.Inner.instance;
return Inner.instance;
}
/**

View File

@ -2,35 +2,24 @@ package com.actionsoft.apps.coe.pal.pal.repository.web;
import java.io.File;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import com.actionsoft.apps.AppsConst;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst;
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.designer.constant.CoeDesignerConstant;
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.relation.cache.DesignerShapeRelationCache;
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.system.logger.CoeLogger;
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.util.*;
import com.actionsoft.apps.coe.pal.pal.repository.cache.CoeProcessLevelNoCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryRemoveCache;
@ -41,8 +30,13 @@ import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepositoryRemove;
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepositoryRemoveInfo;
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepositorySpecialPropertyDao;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.CoeDesignerShapeCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.constant.CoeDesignerConstant;
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.relation.dao.DesignerShapeRelationDao;
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.manager.DesignerRelationShapeCacheManager;
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.designer.util.ShapeUtil;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryRemoveInfoModel;
@ -51,27 +45,29 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelI
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.web.UpfileWeb;
import com.actionsoft.apps.coe.pal.pal.ws.dao.CoeWorkSpaceDaoFactory;
import com.actionsoft.apps.coe.pal.pal.ws.model.CoeWorkSpaceModel;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import com.actionsoft.apps.coe.pal.teamwork.dao.TeamPerm;
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilDate;
import com.actionsoft.bpms.util.UtilFile;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.AppAPI;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;
/**
* 流程回收站Web类
*
*
* @author zhangming
* @date 2015-7-24
* @version 6.1
* @date 2015-7-24
* @description
*/
public class CoeProcessRecycleWeb extends ActionWeb {
private UserContext _uc;
private final UserContext _uc;
public CoeProcessRecycleWeb(UserContext uc) {
super(uc);
@ -80,6 +76,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
/**
* 查询回收站数据总条数
*
* @param wsId
* @param teamId
* @param searchInput
@ -92,7 +89,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
totalNum = dao.getTotalNum(wsId, searchInput, null);
} else {
// 获取个人小组权限versionIds
List<String> permVersionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
Set<String> permVersionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
if (permVersionIds == null || permVersionIds.size() == 0) {
totalNum = 0;
} else {
@ -110,6 +107,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
/**
* 查询回收站数据
*
* @param currentPage
* @param pageStep
* @param wsId
@ -127,7 +125,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
list = dao.selectRemoveModelsByPagination(start, limit, wsId, searchInput, null);
} else {
// 获取个人小组权限versionIds
List<String> permVersionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
Set<String> permVersionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
if (permVersionIds == null || permVersionIds.size() == 0) {
list = null;
} else {
@ -156,7 +154,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
/**
* 流程放入回收站
*
*
* @param model
* @param models
* @return
@ -178,7 +176,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
/**
* 从回收站中删除流程
*
*
* @param removeIds
* @return
*/
@ -284,21 +282,19 @@ public class CoeProcessRecycleWeb extends ActionWeb {
correlateDao.deleteCorrlate(model.getId());
// 删除附件
StringBuffer sqlWhere = new StringBuffer();
sqlWhere.append(" and PALREPOSITORYID = '").append(model.getId()).append("'");
UpFileDao upFileDao = new UpFileDao();
List<UpfileModel> upfileModels = upFileDao.search(sqlWhere.toString());
List<UpfileModel> upfileModels = upFileDao.search(" and PALREPOSITORYID = '" + model.getId() + "'");
if (upfileModels != null && upfileModels.size() > 0) {
UpfileWeb upfileWeb = new UpfileWeb(_uc);
for (int i = 0; i < upfileModels.size(); i++) {
upfileWeb.delete(upfileModels.get(i).getUuid());
}
}
// 删除文件属性
PALRepositoryPropertyDao propertyDao = new PALRepositoryPropertyDao();
propertyDao.deletePropertysByPLId(null, model.getId(), null);
}
ResponseObject ro = ResponseObject.newOkResponse("删除成功");
@ -323,7 +319,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
boolean update = false;
JSONObject definition = JSONObject.parseObject(define);
JSONObject elements = definition.getJSONObject("elements");
JSONArray procedureShapeArr= getProcedureShapeArr(elements);
JSONArray procedureShapeArr = getProcedureShapeArr(elements);
for (int i = 0; i < procedureShapeArr.size(); i++) {
JSONObject shape = procedureShapeArr.getJSONObject(i);
if (matchProcedureObj(shape, removeModel.getVersionId(), removeModel.getName(), position)) {
@ -347,13 +343,13 @@ public class CoeProcessRecycleWeb extends ActionWeb {
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
// 记录操作行为日志
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_REPOSITORY_DESIGNER_UPDATE + ",文件属性["+ ("top".equals(position) ? "前置" : "后置") +"流程]被删除触发流程接口形状更新");
SDK.getLogAPI().consoleInfo("[成功][" + removeModel.getName() + "]被删除,文件属性["+ ("top".equals(position) ? "前置" : "后置") +"流程]被删除触发流程[" + model.getName() + "][" + model.getId() + "]流程接口形状更新,流程接口形状增加已删除标记");
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_REPOSITORY_DESIGNER_UPDATE + ",文件属性[" + ("top".equals(position) ? "前置" : "后置") + "流程]被删除触发流程接口形状更新");
SDK.getLogAPI().consoleInfo("[成功][" + removeModel.getName() + "]被删除,文件属性[" + ("top".equals(position) ? "前置" : "后置") + "流程]被删除触发流程[" + model.getName() + "][" + model.getId() + "]流程接口形状更新,流程接口形状增加已删除标记");
}
}
} catch (Exception e) {
e.printStackTrace();
SDK.getLogAPI().consoleErr("模型["+ model.getName() +"][" + model.getId() + "]模型文件转换JSON异常");
SDK.getLogAPI().consoleErr("模型[" + model.getName() + "][" + model.getId() + "]模型文件转换JSON异常");
continue;
}
}
@ -366,13 +362,9 @@ public class CoeProcessRecycleWeb extends ActionWeb {
return versionId.equals(shape.getJSONObject("attrMark").getString("versionId"));
} else {
if ("top".equals(position)) {// 前置多出线零入线且名称匹配
if (shape.getJSONArray("fromLinkerArr").size() > 0 && shape.getJSONArray("toLinkerArr").size() == 0 && shape.getString("shapeText").equals(name)) {
return true;
}
return shape.getJSONArray("fromLinkerArr").size() > 0 && shape.getJSONArray("toLinkerArr").size() == 0 && shape.getString("shapeText").equals(name);
} else if ("bottom".equals(position)) {// 后置多入线零出线且名称匹配
if (shape.getJSONArray("toLinkerArr").size() > 0 && shape.getJSONArray("fromLinkerArr").size() == 0 && shape.getString("shapeText").equals(name)) {
return true;
}
return shape.getJSONArray("toLinkerArr").size() > 0 && shape.getJSONArray("fromLinkerArr").size() == 0 && shape.getString("shapeText").equals(name);
}
}
return false;
@ -430,7 +422,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
/**
* 清空回收站
*
*
* @return
* @author zhangming
*/
@ -463,7 +455,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
}
String[] removeIdArray = removeIds.split(",");
Set<String> wsIds = new HashSet<String>();
//重构回收站还原逻辑sunlh
try {
for (String removeId : removeIdArray) {
@ -480,18 +472,18 @@ public class CoeProcessRecycleWeb extends ActionWeb {
List<PALRepositoryRemoveModel> result = new ArrayList<>();
String versionId = "";
for (PALRepositoryRemoveModel model : removeModels) {
if(model.getId().equals(removeInfo.getRemoveResource())) {
if (model.getId().equals(removeInfo.getRemoveResource())) {
versionId = model.getVersionId();
break;
}
}
for (PALRepositoryRemoveModel model : removeModels) {
if(model.getVersionId().equals(versionId)) {
if (model.getVersionId().equals(versionId)) {
result.add(model);
}
}
sortById(versionId, removeModels, result);
// 无父节点模型的记录
Map<String, Integer> map = new HashMap<>();
int maxOrderIndex = 0;
@ -501,7 +493,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
//如果资产库中有其他版本直接还原版本
List<PALRepositoryModel> versionList = PALRepositoryCache.getByVersionId(model.getWsId(), model.getVersionId());
if (versionList != null && versionList.size() > 0) {
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl)model;
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl) model;
// 设置levelorderIndexparentId
modelImpl.setLevel(versionList.get(0).getLevel());
modelImpl.setOrderIndex(versionList.get(0).getOrderIndex());
@ -511,27 +503,27 @@ public class CoeProcessRecycleWeb extends ActionWeb {
String parentId = model.getParentId();
boolean flag = true;
if(parentId.length() < 36) { // 父节点是根节点
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl)model;
if (parentId.length() < 36) { // 父节点是根节点
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl) model;
modelImpl.setLevel(1);
PALRepositoryRemoveCache.getCache().put(model.getId(), model);
flag = false;
} else {
List<PALRepositoryModel> models = PALRepositoryCache.getByVersionId(model.getWsId(), parentId);
if(models != null && models.size() > 0) { // 资产库有父节点
if (models != null && models.size() > 0) { // 资产库有父节点
PALRepositoryModel parentModel = models.get(0);
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl)model;
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl) model;
// 设置level orderIndex不变
modelImpl.setLevel(parentModel.getLevel() + 1);
PALRepositoryRemoveCache.getCache().put(model.getId(), model);
flag = false;
}
}
}
if(flag) { // 父节点在需要被还原的模型集合中
if (flag) { // 父节点在需要被还原的模型集合中
for (PALRepositoryModel model2 : result) {
if (model2.getVersionId().equals(parentId)) {
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl)model;
modelImpl.setLevel(model2.getLevel() +1);
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl) model;
modelImpl.setLevel(model2.getLevel() + 1);
// 暂时不对orderIndex处理依照原样
PALRepositoryRemoveCache.getCache().put(model.getId(), model);
flag = false;
@ -539,8 +531,8 @@ public class CoeProcessRecycleWeb extends ActionWeb {
}
}
}
if(flag) {// 父节点被删除设置父节点为根节点重置parentIdplLevelorderIndex
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl)model;
if (flag) {// 父节点被删除设置父节点为根节点重置parentIdplLevelorderIndex
PALRepositoryModelImpl modelImpl = (PALRepositoryModelImpl) model;
String newParentId = model.getMethodCategory();
if (maxOrderIndex == 0) {
int orderIndex = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getChildrenMaxOrderIndexByPidAndWsId(newParentId, model.getWsId());
@ -562,7 +554,7 @@ public class CoeProcessRecycleWeb extends ActionWeb {
}
}
//如果流程库中已经存在该模型说明其子文件还原时创建过模型需要替换流程库中的模型
/*PALRepositoryModelImpl removeModel = (PALRepositoryModelImpl) PALRepositoryRemoveCache.getCache().get(removeInfo.getRemoveResource());
wsIds.add(removeModel.getWsId());
@ -599,35 +591,34 @@ public class CoeProcessRecycleWeb extends ActionWeb {
}
}
}*/
dao.restoreRecycleModel(removeId);
// 操作行为日志记录
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_RECYCLE, CoEOpLogConst.OP_RESTORE, CoEOpLogConst.INFO_RECYCLE_RESTORE);
}
}
} catch (Exception e) {
PALRepositoryRemoveCache.getCache().reload();// 发生错误之后缓存已被改掉需要重新加载
e.printStackTrace();
}
// 重新装载编号
for (String wsId : wsIds) {
CoeProcessLevelNoCache.getInstance().reloadInBackground(wsId);
}
int totalNum = dao.getTotalNum(null);
ro.put("totalNum", totalNum);
return ro.toString();
}
/**
* 按照父子节点排序
* 防止后续遍历操作先遍历出子节点后出现父节点造成数据错误
* 不能使用pllevel和orderIndex进行排序历史遗留问题造成了该两个字段值错误
*
* @param parentId
* @param list
* @param result

View File

@ -5,50 +5,99 @@ import java.util.List;
import java.util.Timer;
import com.actionsoft.apps.coe.pal.addons.RefreshRoleExt2Web;
import com.actionsoft.apps.coe.pal.aslp.*;
import com.actionsoft.apps.coe.pal.aslp.DiagramAPI.QueryFileElements;
import com.actionsoft.apps.coe.pal.aslp.DiagramAPI.QueryRelationInfoByRelationShapeId;
import com.actionsoft.apps.coe.pal.aslp.DiagramAPI.QueryRelationInfoByShapeId;
import com.actionsoft.apps.coe.pal.aslp.DiagramAPI.QueryShapeList;
import com.actionsoft.apps.coe.pal.aslp.MethodAPI.QueryMethodById;
import com.actionsoft.apps.coe.pal.aslp.MethodAPI.QueryMethodListByMethod;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.*;
import com.actionsoft.apps.coe.pal.aslp.OpenRepositoryPortalHtml;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.HavingPALMethodPermissionByTeam;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.HavingPALRepositoryPermissionByTeam;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.HavingReadPALRepositoryPermissionByGroupCode;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.HavingReadPALRepositoryPermissionByGroupCodeList;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.HavingReadPALRepositoryPermissionByRoleId;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.HavingReadPALRepositoryPermissionByUserId;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.QueryTeamMemberAction;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.QueryTeamMemberActions;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.RemoveAllPerms;
import com.actionsoft.apps.coe.pal.aslp.PermAPI.RemovePermsByTeam;
import com.actionsoft.apps.coe.pal.aslp.PublishAPI.PublishPALRepository;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.*;
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
import com.actionsoft.apps.coe.pal.log.progressbar.cache.ProgressBarCache;
import com.actionsoft.apps.coe.pal.pal.home.aslp.RegisterExtendsApp;
import com.actionsoft.apps.coe.pal.pal.method.aslp.RegisterMethodApp;
import com.actionsoft.apps.coe.pal.pal.repository.addons.RepositoryDiagramExistMark;
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.manager.DesignerShapeCopyCache;
import com.actionsoft.apps.coe.pal.yili.log.batch.cache.BatchCache;
import com.actionsoft.apps.coe.pal.yili.log.datamigration.log.Cache.LogRealTimeCountCache;
import com.actionsoft.apps.listener.PluginListener;
import com.actionsoft.apps.resource.AppContext;
import com.actionsoft.apps.resource.plugin.profile.*;
import com.actionsoft.apps.coe.pal.aslp.QueryBpmGroupNameIsModify;
import com.actionsoft.apps.coe.pal.aslp.QueryBpmProcessIsLockStructure;
import com.actionsoft.apps.coe.pal.aslp.QueryBpmProcessIsShow;
import com.actionsoft.apps.coe.pal.aslp.QueryIsActiveWorkSpace;
import com.actionsoft.apps.coe.pal.aslp.QueryNotAssingedRepositoryList;
import com.actionsoft.apps.coe.pal.aslp.QueryRepositoryByAwsId;
import com.actionsoft.apps.coe.pal.aslp.QueryRepositoryById;
import com.actionsoft.apps.coe.pal.aslp.QueryRepositoryImage;
import com.actionsoft.apps.coe.pal.aslp.QueryRepositoryListByVersionid;
import com.actionsoft.apps.coe.pal.aslp.QueryShowBpmProcesseList;
import com.actionsoft.apps.coe.pal.aslp.QueryWorkspaceById;
import com.actionsoft.apps.coe.pal.aslp.QueryWorkspaceList;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryAllPALRepositoryModelsByPid;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryAllPublishedPALRepositoryModelsByPid;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryAllUsedPALRepositoryModelsByPid;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryPALRepositoryModelsByName;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryPALRepositoryModelsByPid;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryPALRepositoryModelsByTeamId;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryPALRepositoryModelsByTeamIdAndMethodId;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryPALRepositoryModelsByWsId;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryPALRepositoryModelsByWsIdAndMethodId;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryPublishedPALRepositoryModelsByPid;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryPublishedPALRepositoryModelsByWsId;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryRepositoryList;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryUsedPALRepositoryModelsByPid;
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.QueryUsedPALRepositoryModelsByWsId;
import com.actionsoft.apps.coe.pal.aslp.SaveAssignRepository;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.cache.CoeCooperationRoleCache;
import com.actionsoft.apps.coe.pal.cooperation.cache.CoeCooperationRolePermCache;
import com.actionsoft.apps.coe.pal.cooperation.cache.CoeCooperationTeamPermCache;
import com.actionsoft.apps.coe.pal.log.progressbar.cache.ProgressBarCache;
import com.actionsoft.apps.coe.pal.pal.backup.extend.CoEPALBackupProcessor;
import com.actionsoft.apps.coe.pal.pal.expression.GetDWConditionExpression;
import com.actionsoft.apps.coe.pal.pal.home.aslp.RegisterExtendsApp;
import com.actionsoft.apps.coe.pal.pal.manage.publish.cache.PublishHistoryCache;
import com.actionsoft.apps.coe.pal.pal.manage.publish.cache.PublishUserGroupCache;
import com.actionsoft.apps.coe.pal.pal.manage.publish.cache.PublishUserGroupPermCache;
import com.actionsoft.apps.coe.pal.pal.manage.publish.cache.PublishUserGroupRoleCache;
import com.actionsoft.apps.coe.pal.pal.method.aslp.RegisterMethodApp;
import com.actionsoft.apps.coe.pal.pal.output.aslp.RegisterOutputApp;
import com.actionsoft.apps.coe.pal.pal.repository.cache.*;
import com.actionsoft.apps.coe.pal.pal.repository.addons.RepositoryDiagramExistMark;
import com.actionsoft.apps.coe.pal.pal.repository.cache.CoeProcessLevelCorrelateCache;
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.PALRepositoryPropertyCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryRemoveCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryShapeAttributeCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryShapeConfigCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.CoeDesignerImageCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.CoeDesignerShapeCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.PALDesignerFileCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.cache.PALDesignerFileDragModelCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.realtime.manage.CoeListenCacheManager;
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.manager.DesignerShapeCopyCache;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.CoeFileProcessor;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
import com.actionsoft.apps.coe.pal.teamwork.cache.TeamMemberPermCache;
import com.actionsoft.apps.coe.pal.teamwork.cache.TeamPermCache;
import com.actionsoft.apps.coe.pal.yili.log.batch.cache.BatchCache;
import com.actionsoft.apps.coe.pal.yili.log.datamigration.log.Cache.LogRealTimeCountCache;
import com.actionsoft.apps.listener.PluginListener;
import com.actionsoft.apps.resource.AppContext;
import com.actionsoft.apps.resource.plugin.profile.ACPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.ASLPPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.AWSPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.AddOnsPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.AtFormulaPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.HttpASLP;
/**
* 注册CoE随平台安装的默认插件
*
*/
public class Plugins implements PluginListener {
public static boolean installed = false;
@ -82,6 +131,9 @@ public class Plugins implements PluginListener {
list.add(new CachePluginProfile(LogRealTimeCountCache.class));
list.add(new CachePluginProfile(BatchCache.class));
list.add(new CachePluginProfile(ProgressBarCache.class));
list.add(new CachePluginProfile(CoeCooperationTeamPermCache.class));
list.add(new CachePluginProfile(CoeCooperationRoleCache.class));
list.add(new CachePluginProfile(CoeCooperationRolePermCache.class));
list.add(new AtFormulaPluginProfile("PAL应用", "@getDWCondition(*fieldName,*fieldValue)", GetDWConditionExpression.class.getName(), "获取DW中的自定义查询条件", "返回DW中自定义的查询条件"));
@ -92,15 +144,15 @@ public class Plugins implements PluginListener {
}
CoEConstant.timer1 = new Timer();
try {
CoEConstant.timer1.schedule(task1, 1000, 1000 * 60 * 1);
CoEConstant.timer1.schedule(task1, 1000, 1000 * 60);
} catch (IllegalStateException e) {
}
/* new Thread(new Runnable() {
*
*
* @Override public void run() { DesignerRelationShapeCacheManager.getInstance();// 初始化缓存
*
*
* DesignerRelationShapeCacheManager task2 = DesignerRelationShapeCacheManager.getInstance(); try{ CoEConstant.timer2.cancel(); } catch (IllegalStateException e) {
*
*
* } CoEConstant.timer2 = new Timer(); try { CoEConstant.timer2.schedule(task2, 1000, 1000 * 60 * 1); } catch (IllegalStateException e) { } } }).start(); */
// 注册DC资源
@ -144,7 +196,7 @@ public class Plugins implements PluginListener {
list.add(new ASLPPluginProfile("queryMethodById", QueryMethodById.class.getName(), "获取建模方法定义请直接调用SDK.getPALMethodQueryAPI.getPALMethodModelById()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
list.add(new ASLPPluginProfile("queryMethodListByMethod", QueryMethodListByMethod.class.getName(), "获取建模方法定义集合请直接调用SDK.getPALMethodQueryAPI.getPALMethodModelListByMethod()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
// PermAPI
list.add(new ASLPPluginProfile("havingPALMethodPermissionByTeam", HavingPALMethodPermissionByTeam.class.getName(), "该小组是否有访问指定资产库某类建模方法下资源的权限如是否可以访问组织类文件请直接调用SDK.getPALPermAPI.havingPALMethodPermissionByTeam()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
list.add(new ASLPPluginProfile("havingPALMethodPermissionByTeam", HavingPALMethodPermissionByTeam.class.getName(), "该小组是否有访问指定资产库某类建模方法下资源的权限如是否可以访问组织类文件请直接调用SDK.getPALPermAPI.havingPALMethodPermissionByTeam()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
list.add(new ASLPPluginProfile("havingPALRepositoryPermissionByTeam", HavingPALRepositoryPermissionByTeam.class.getName(), "该小组是否有访问资产库指定文件的访问权限请直接调用SDK.getPALPermAPI.havingPALRepositoryPermissionByTeam()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
list.add(new ASLPPluginProfile("removePermsByTeam", RemovePermsByTeam.class.getName(), "当流程团队小组被删除时删除小组相关的配置资源和成员权限请直接调用SDK.getPALPermAPI.removePermsByTeam()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
list.add(new ASLPPluginProfile("removeAllPerms", RemoveAllPerms.class.getName(), "卸载流程团队App时删除所有权限配置请直接调用SDK.getPALPermAPI.removeAllPerms()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
@ -174,9 +226,6 @@ public class Plugins implements PluginListener {
list.add(new AddOnsPluginProfile(RepositoryDiagramExistMark.class.getName(), "PAL初始化模型图标记", null));
//小组用户权限信息cache
list.add(new CachePluginProfile(CooperationCache.class));
// 角色图刷新
list.add(new AddOnsPluginProfile(RefreshRoleExt2Web.class.getName(), "刷新角色图EXT2内容", ""));
return list;

View File

@ -1,46 +1,56 @@
/*
* Copyright(C)2001-2012 Actionsoft Co.,Ltd
* AWS(Actionsoft workflow suite) BPM(Business Process Management) PLATFORM Source code
* AWS(Actionsoft workflow suite) BPM(Business Process Management) PLATFORM Source code
* AWS is a application middleware for BPM System
* 本软件工程编译的二进制文件及源码版权归北京炎黄盈动科技发展有限责任公司所有
* 受中国国家版权局备案及相关法律保护未经书面法律许可任何个人或组织都不得泄漏
* 传播此源码文件的全部或部分文件不得对编译文件进行逆向工程违者必究
* $$本源码是炎黄盈动最高保密级别的文件$$
*
*
* http://www.actionsoft.com.cn
*
*
*/
package com.actionsoft.apps.coe.pal.portal.web;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.sql.SQLException;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import com.actionsoft.apps.AppsConst;
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.install.dao.CoeIniDaoFactory;
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
import com.actionsoft.apps.coe.pal.pal.home.extend.ExtendsAppManager;
import com.actionsoft.apps.coe.pal.pal.home.extend.ExtendsAppProfile;
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelSystemNameDaoFactory;
import com.actionsoft.apps.coe.pal.pal.repository.model.CoeProcessLevelSystemNameModel;
import com.actionsoft.apps.coe.pal.pal.ws.model.CoeWorkSpaceModel;
import com.actionsoft.apps.coe.pal.pal.ws.web.CoeWorkSpaceWeb;
import com.actionsoft.apps.coe.pal.portal.constant.CoENavConstant;
import com.actionsoft.apps.coe.pal.portal.dao.CoENavDaoFactory;
import com.actionsoft.apps.coe.pal.portal.model.CoENavButtonModel;
import com.actionsoft.apps.coe.pal.portal.model.CoENavChannelModel;
import com.actionsoft.apps.coe.pal.portal.model.CoENavSliderModel;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import com.actionsoft.apps.coe.pal.team.user.conf.LanguageUserAcConf;
import com.actionsoft.apps.coe.pal.team.user.dao.CoeUser;
import com.actionsoft.apps.coe.pal.team.user.dao.CoeUserDaoFactory;
import com.actionsoft.apps.coe.pal.team.user.web.UserWeb;
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
import com.actionsoft.apps.resource.AppContext;
import com.actionsoft.bpms.util.*;
import com.actionsoft.bpms.util.Base64;
import com.actionsoft.sdk.service.AppApi;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang.StringUtils;
import com.actionsoft.apps.AppsConst;
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
@ -53,36 +63,20 @@ import com.actionsoft.bpms.server.Quota;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.conf.portal.AWSPortalConf;
import com.actionsoft.bpms.server.conf.server.AWSServerConf;
import com.actionsoft.bpms.server.fs.DCContext;
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
import com.actionsoft.bpms.server.fs.file.ReadDCFile;
import com.actionsoft.apps.coe.pal.install.dao.CoeIniDaoFactory;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelSystemNameDaoFactory;
import com.actionsoft.apps.coe.pal.pal.repository.model.CoeProcessLevelSystemNameModel;
import com.actionsoft.apps.coe.pal.pal.ws.dao.CoeWorkSpace;
import com.actionsoft.apps.coe.pal.pal.ws.model.CoeWorkSpaceModel;
import com.actionsoft.apps.coe.pal.portal.constant.CoENavConstant;
import com.actionsoft.apps.coe.pal.portal.dao.CoENavDaoFactory;
import com.actionsoft.apps.coe.pal.portal.model.CoENavButtonModel;
import com.actionsoft.apps.coe.pal.portal.model.CoENavChannelModel;
import com.actionsoft.apps.coe.pal.portal.model.CoENavSliderModel;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import com.actionsoft.apps.coe.pal.team.user.conf.LanguageUserAcConf;
import com.actionsoft.apps.coe.pal.team.user.dao.CoeUser;
import com.actionsoft.apps.coe.pal.team.user.dao.CoeUserDaoFactory;
import com.actionsoft.apps.coe.pal.team.user.web.UserWeb;
import com.actionsoft.apps.coe.pal.teamwork.web.TeamWorkManagerWeb;
import com.actionsoft.bpms.util.ClassReflect;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.i18n.I18nRes;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.AppAPI;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
/**
* 导航
*
*
* @author liangt
* @date 2012-3-14
*/
@ -90,7 +84,7 @@ public class NavigationWeb extends ActionWeb {
private static final long serialVersionUID = 7395478327656203607L;
private UserContext _uc;
private final UserContext _uc;
public NavigationWeb(UserContext uc) {
super(uc);
@ -100,7 +94,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 获得导航头部
*
*
* @return
*/
public String getNavHeader() {
@ -226,8 +220,8 @@ public class NavigationWeb extends ActionWeb {
if (_cons != null) {
Object[] paras = {};
Object o = _cons.newInstance(paras);
Method loginCheckSecurityMethod = User.class.getMethod("getPassword", new Class[] { String.class, String.class });
Object dparams = loginCheckSecurityMethod.invoke(o, new Object[] { userModel.getUID(), AWSPortalConf.getSecurityPwdDefault() });
Method loginCheckSecurityMethod = User.class.getMethod("getPassword", String.class, String.class);
Object dparams = loginCheckSecurityMethod.invoke(o, userModel.getUID(), AWSPortalConf.getSecurityPwdDefault());
String newPwd = (String) dparams;
if (isSecurityPwdChange && userModel.getPassword().equals(newPwd)) {
forceChangePwd = true;
@ -254,7 +248,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 去提醒初始化界面
*
*
* @return
*/
public String getInitAlertHtml(String value) {
@ -264,7 +258,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 去初始化界面
*
*
* @return
*/
public String getInitHtml(String initStep) {
@ -283,7 +277,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 获得导航菜单
*
*
* @return
*/
public String getNavChannel(String condition) {
@ -292,7 +286,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 获得导航编辑界面
*
*
* @return
*/
public String getNavMain(String condition) {
@ -316,7 +310,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 获得所有导航
*
*
* @return
*/
@ -400,6 +394,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 获得指定导航的所有slider
*
* @param channelUUID
* @param json
* @return
@ -438,7 +433,7 @@ public class NavigationWeb extends ActionWeb {
private int validateJson(Integer index) {
return index == null ? 0 : index;
}
public String getSliderHtml(JSONObject json, CoENavSliderModel funModel, String butStr) {
String coePortal = json.getString("coePortal");
if (funModel == null) {
@ -495,8 +490,8 @@ public class NavigationWeb extends ActionWeb {
StringBuffer html = new StringBuffer();
html.append(" <div class='coe_nav_slider_menu radius3'>");
html.append(" <div class='coe_nav_slider_menu_button'>");
html.append(" " + I18nRes.findValue(CoEConstant.APP_ID, getContext().getLanguage(), "操作菜单") + " <span class='button blue' onmousedown='addNavButton(this);' >" + I18nRes.findValue(CoEConstant.APP_ID, getContext().getLanguage(), "添加菜单") + " </span> <span class='button blue' onmousedown='editNavButton(this);' > " + I18nRes.findValue(CoEConstant.APP_ID, getContext().getLanguage(), "编辑菜单") + " </span>&nbsp;<span class='button blue' onmousedown='delNavButton(this);' > "
+ I18nRes.findValue(CoEConstant.APP_ID, getContext().getLanguage(), "删除菜单") + "</span>");
html.append(" " + I18nRes.findValue(CoEConstant.APP_ID, getContext().getLanguage(), "操作菜单") + " <span class='button blue' onmousedown='addNavButton(this);' >" + I18nRes.findValue(CoEConstant.APP_ID, getContext().getLanguage(), "添加菜单") + " </span> <span class='button blue' onmousedown='editNavButton(this);' > " + I18nRes.findValue(CoEConstant.APP_ID, getContext().getLanguage(), "编辑菜单") + " </span>&nbsp;<span class='button blue' onmousedown='delNavButton(this);' > " + I18nRes.findValue(CoEConstant.APP_ID, getContext().getLanguage(),
"删除菜单") + "</span>");
html.append(" </div>");
html.append(" <div class='coe_nav_slider_menu_list'>");
html.append(" <table class='table table-bordered table-striped' cellpadding='0' cellspacing='1' border='0'>");
@ -527,7 +522,7 @@ public class NavigationWeb extends ActionWeb {
private String getButtonTrHtml(CoENavButtonModel model) {
StringBuffer html = new StringBuffer();
html.append(" <tr>");
html.append(" <td><input type='checkbox' value='").append(model.getUUID()).append("' />").append("").append("</td>");
html.append(" <td><input type='checkbox' value='").append(model.getUUID()).append("' />").append("</td>");
html.append(" <td>").append(model.getMenuTitle()).append("</td>");
html.append(" <td>").append(model.getMenuTip()).append("</td>");
html.append(" <td>");
@ -546,7 +541,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 获得控制台按钮
*
*
* @return
*/
private String getConsoleButton() {
@ -793,51 +788,14 @@ public class NavigationWeb extends ActionWeb {
} else {
model = new CoENavButtonModel();
}
StringBuffer html = new StringBuffer();
html.append("<div style='width:100%;height:350px;'>");
html.append(" <table cellpadding='0' cellspacing='0' class='coe_console_button_table'>");
html.append(" <tr>");
html.append(" <td style='width: 150px;' class='coe_console_button_tips'><I18N#标题></td>");
html.append(" <td><input type='text' name='menuTitle' id='menuTitle' value='").append(model.getMenuTitle()).append("'/></td>");
html.append(" </tr>");
html.append(" <tr>");
html.append(" <td class='coe_console_button_tips'><I18N#提示></td>");
html.append(" <td><input type='text' name='menuTip' id='menuTip' value='").append(model.getMenuTip()).append("'/></td>");
html.append(" </tr>");
html.append(" <tr>");
html.append(" <td class='coe_console_button_tips'><I18N#请求类型></td>");
html.append(" <td>");
html.append(" <select name='actionType' id='actionType'>");
html.append(" <option ").append(CoENavConstant.NAV_BUTTON_ACTION_TYPE_URL.equals(model.getActionType()) ? "selected='selected'" : "").append(" value='").append(CoENavConstant.NAV_BUTTON_ACTION_TYPE_URL).append("'>URL</option>");
html.append(" <option ").append(CoENavConstant.NAV_BUTTON_ACTION_TYPE_JAVASCRIPT.equals(model.getActionType()) ? "selected='selected'" : "").append(" value='").append(CoENavConstant.NAV_BUTTON_ACTION_TYPE_JAVASCRIPT).append("'>JavaScript</option>");
html.append(" </select> </td>");
html.append(" </tr>");
html.append(" <tr id='targetTr' ").append(CoENavConstant.NAV_BUTTON_ACTION_TYPE_JAVASCRIPT.equals(model.getActionType()) ? "style='display:none;'" : "").append(">");
html.append(" <td class='coe_console_button_tips'>Target</td>");
html.append(" <td>");
html.append(" <select name='target' id='target'>");
html.append(" <option ").append(CoENavConstant.NAV_BUTTON_TARGET_MAIN.equals(model.getTarget()) ? "selected=selected" : "").append(" value='").append(CoENavConstant.NAV_BUTTON_TARGET_MAIN).append("'>mainFrame</option>");
html.append(" <option ").append(CoENavConstant.NAV_BUTTON_TARGET_BLANK.equals(model.getTarget()) ? "selected=selected" : "").append(" value='").append(CoENavConstant.NAV_BUTTON_TARGET_BLANK).append("'>_blank</option>");
html.append(" <option ").append(CoENavConstant.NAV_BUTTON_TARGET_SELF.equals(model.getTarget()) ? "selected=selected" : "").append(" value='").append(CoENavConstant.NAV_BUTTON_TARGET_SELF).append("'>_self</option>");
html.append(" </select> </td>");
html.append(" </tr>");
html.append(" <tr>");
html.append(" <td class='coe_console_button_tips'><I18N#请求值></td>");
html.append(" <td><input type='text' name='actionValue' id='actionValue' value=\"").append(model.getActionValue()).append("\"/> <font color='red'>*</font></td>");
html.append(" </tr>");
html.append(" <tr>");
html.append(" <td class='coe_console_button_tips'><I18N#菜单背景图标></td>");
html.append(" <td><input type='text' name='menuIcon' id='menuIcon' value='").append(model.getMenuIcon()).append("'/></td>");
html.append(" </tr>");
html.append(" <tr>");
html.append(" <td style='border:0px;'>&nbsp;</td>");
html.append(" <td style='border:0px;'><input type='button' onclick='editConsoleButtonExit(this)' value='").append(StringUtils.isEmpty(model.getUUID()) ? "<I18N#添加>" : "<I18N#修改>").append("' style='width:100px;' /><a href='#' onclick='consoleButtonExit();' class='coe_console_button_exit'><I18N#取消></a></td>");
html.append(" </tr>");
html.append(" </table>");
html.append("<input type='hidden' name='navSliderUUID' id='navSliderUUID' value='").append(StringUtils.isEmpty(model.getNavSliderUUID()) ? navSliderUUID : model.getNavSliderUUID()).append("' />");
html.append("<input type='hidden' name='buttonUUID' id='buttonUUID' value='").append(model.getUUID()).append("' />");
html.append("</div>");
macroLibraries.put("consoleBotton", html.toString());
String html = "<div style='width:100%;height:350px;'>" + " <table cellpadding='0' cellspacing='0' class='coe_console_button_table'>" + " <tr>" + " <td style='width: 150px;' class='coe_console_button_tips'><I18N#标题></td>" + " <td><input type='text' name='menuTitle' id='menuTitle' value='" + model.getMenuTitle() + "'/></td>" + " </tr>" + " <tr>" + " <td class='coe_console_button_tips'><I18N#提示></td>" + " <td><input type='text' name='menuTip' id='menuTip' value='" + model.getMenuTip() + "'/></td>"
+ " </tr>" + " <tr>" + " <td class='coe_console_button_tips'><I18N#请求类型></td>" + " <td>" + " <select name='actionType' id='actionType'>" + " <option " + (CoENavConstant.NAV_BUTTON_ACTION_TYPE_URL.equals(model.getActionType()) ? "selected='selected'" : "") + " value='" + CoENavConstant.NAV_BUTTON_ACTION_TYPE_URL + "'>URL</option>" + " <option " + (CoENavConstant.NAV_BUTTON_ACTION_TYPE_JAVASCRIPT.equals(model.getActionType()) ? "selected='selected'" : "") + " value='"
+ CoENavConstant.NAV_BUTTON_ACTION_TYPE_JAVASCRIPT + "'>JavaScript</option>" + " </select> </td>" + " </tr>" + " <tr id='targetTr' " + (CoENavConstant.NAV_BUTTON_ACTION_TYPE_JAVASCRIPT.equals(model.getActionType()) ? "style='display:none;'" : "") + ">" + " <td class='coe_console_button_tips'>Target</td>" + " <td>" + " <select name='target' id='target'>" + " <option " + (CoENavConstant.NAV_BUTTON_TARGET_MAIN.equals(model.getTarget()) ? "selected=selected" : "")
+ " value='" + CoENavConstant.NAV_BUTTON_TARGET_MAIN + "'>mainFrame</option>" + " <option " + (CoENavConstant.NAV_BUTTON_TARGET_BLANK.equals(model.getTarget()) ? "selected=selected" : "") + " value='" + CoENavConstant.NAV_BUTTON_TARGET_BLANK + "'>_blank</option>" + " <option " + (CoENavConstant.NAV_BUTTON_TARGET_SELF.equals(model.getTarget()) ? "selected=selected" : "") + " value='" + CoENavConstant.NAV_BUTTON_TARGET_SELF + "'>_self</option>" + " </select> </td>" + " </tr>"
+ " <tr>" + " <td class='coe_console_button_tips'><I18N#请求值></td>" + " <td><input type='text' name='actionValue' id='actionValue' value=\"" + model.getActionValue() + "\"/> <font color='red'>*</font></td>" + " </tr>" + " <tr>" + " <td class='coe_console_button_tips'><I18N#菜单背景图标></td>" + " <td><input type='text' name='menuIcon' id='menuIcon' value='" + model.getMenuIcon() + "'/></td>" + " </tr>" + " <tr>" + " <td style='border:0px;'>&nbsp;</td>"
+ " <td style='border:0px;'><input type='button' onclick='editConsoleButtonExit(this)' value='" + (StringUtils.isEmpty(model.getUUID()) ? "<I18N#添加>" : "<I18N#修改>") + "' style='width:100px;' /><a href='#' onclick='consoleButtonExit();' class='coe_console_button_exit'><I18N#取消></a></td>" + " </tr>" + " </table>" + "<input type='hidden' name='navSliderUUID' id='navSliderUUID' value='" + (StringUtils.isEmpty(model.getNavSliderUUID()) ? navSliderUUID : model.getNavSliderUUID()) + "' />"
+ "<input type='hidden' name='buttonUUID' id='buttonUUID' value='" + model.getUUID() + "' />" + "</div>";
macroLibraries.put("consoleBotton", html);
return HtmlPageTemplate.merge(CoEConstant.APP_ID, "console.params.button.htm", macroLibraries);
}
@ -915,6 +873,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 进入pal导航主页
* vue
*
* @return
*/
public String getVueNavHeader(String mainType) {
@ -943,8 +902,8 @@ public class NavigationWeb extends ActionWeb {
if (_cons != null) {
Object[] paras = {};
Object o = _cons.newInstance(paras);
Method loginCheckSecurityMethod = User.class.getMethod("getPassword", new Class[] { String.class, String.class });
Object dparams = loginCheckSecurityMethod.invoke(o, new Object[] { userModel.getUID(), AWSPortalConf.getSecurityPwdDefault() });
Method loginCheckSecurityMethod = User.class.getMethod("getPassword", String.class, String.class);
Object dparams = loginCheckSecurityMethod.invoke(o, userModel.getUID(), AWSPortalConf.getSecurityPwdDefault());
String newPwd = (String) dparams;
if (isSecurityPwdChange && userModel.getPassword().equals(newPwd)) {
forceChangePwd = true;
@ -1035,22 +994,21 @@ public class NavigationWeb extends ActionWeb {
// 用户头像
ro.put("userPhoto", SDK.getPortalAPI().getUserPhoto(_uc, _uc.getUID()));
JSONObject userInfoJson=JSONObject.parseObject(SDK.getPortalAPI().getUserInfo(_uc,_uc.getUID()));
if(userInfoJson.get("result").equals("ok")){
JSONObject userInfoJson = JSONObject.parseObject(SDK.getPortalAPI().getUserInfo(_uc, _uc.getUID()));
if (userInfoJson.get("result").equals("ok")) {
//获取用户姓名
ro.put("currentUserName",userInfoJson.getJSONObject("data").get("userName"));
ro.put("currentUserName", userInfoJson.getJSONObject("data").get("userName"));
//获取用户角色
ro.put("currentUserRole", userInfoJson.getJSONObject("data").get("roleName"));
//获取用户所在部门
ro.put("crrentUserDep",userInfoJson.getJSONObject("data").get("departmentName"));
ro.put("crrentUserDep", userInfoJson.getJSONObject("data").get("departmentName"));
//获取用户账号
ro.put("crrentUserId",_uc.getUID());
ro.put("crrentUserId", _uc.getUID());
}
AppAPI appApi = SDK.getAppAPI();
// 流程发布应用是否启动
boolean isPbulishActive = appApi.isActive("com.actionsoft.apps.coe.pal.publisher");
@ -1071,7 +1029,6 @@ public class NavigationWeb extends ActionWeb {
String teamId = "";
boolean isTeamManager = false;
if ("0".equals(mainType)) {// 是管理员但是无任何管理资产库
} else if ("1".equals(mainType)) {// 是管理员并且有管理资产库
@ -1182,7 +1139,7 @@ public class NavigationWeb extends ActionWeb {
recycle.put("icon", icon3);
appList.add(recycle);
// 三员管理模式下,添加密级标定应用
if (HighSecurityUtil.isON()){
if (HighSecurityUtil.isON()) {
JSONObject mark = new JSONObject();
mark.put("appId", "mark");
mark.put("name", "密级标定");
@ -1199,7 +1156,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 = CooperationCache.getUserAPPPermission(tempTeamId, _uc.getUID());
Set<String> appPerm = CoeCooperationAPIManager.getInstance().getUserAPPPermission(tempTeamId, _uc.getUID());
JSONArray tempList = new JSONArray();
for (int j = 0; j < appList.size(); j++) {
JSONObject app = appList.getJSONObject(j);
@ -1224,6 +1181,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 获取小组成员相关权限
*
* @param wsId
* @param teamId
* @return
@ -1237,6 +1195,7 @@ public class NavigationWeb extends ActionWeb {
/**
* 记录各模块的访问日志
* 关联管理在其app中进行记录不在此记录
*
* @param moduleCategory 业务模块
* @return
*/
@ -1246,50 +1205,50 @@ public class NavigationWeb extends ActionWeb {
String tempModuleCategory = null;
String info = null;
switch (moduleCategory) {
case "workspaceManage":// 管理中心-资产库管理
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_WORKSPACE;
info = CoEOpLogConst.INFO_WORKSPACE_MANAGE_ACCESS;
break;
case "cooperationManage":// 管理中心-小组管理
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_COOPERATION;
info = CoEOpLogConst.INFO_COOPERATION_ACCESS_MANAGE;
break;
case "palUser":// 管理中心-PAL用户
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_USER;
info = CoEOpLogConst.INFO_USER_ACCESS;
break;
case "themeStyle":// 管理中心-主题风格
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_PORTAL;
info = CoEOpLogConst.INFO_PORTAL_THEME_STYLE_ACCESS;
break;
case "commonRepository":// 管理中心-常用流程
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_PORTAL;
info = CoEOpLogConst.INFO_PORTAL_COMMON_REPOSITORY_ACCESS;
break;
case "userGroup":// 管理中心-浏览用户
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_PORTAL;
info = CoEOpLogConst.INFO_PORTAL_USER_GROUP_ACCESS;
break;
case "method":// 应用中心-建模管理
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_METHOD;
info = CoEOpLogConst.INFO_METHOD_ACCESS;
break;
case "backup":// 应用中心-数据备份
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_BACKUP;
info = CoEOpLogConst.INFO_BACKUP_ACCESS;
break;
case "recycle":// 应用中心-回收站
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_RECYCLE;
info = CoEOpLogConst.INFO_RECYCLE_ACCESS;
break;
case "workspace":// 访问资产库
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_WORKSPACE;
info = CoEOpLogConst.INFO_WORKSPACE_ACCESS;
break;
case "cooperation":// 访问PAL小组
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_COOPERATION;
info = CoEOpLogConst.INFO_COOPERATION_ACCESS;
break;
case "workspaceManage":// 管理中心-资产库管理
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_WORKSPACE;
info = CoEOpLogConst.INFO_WORKSPACE_MANAGE_ACCESS;
break;
case "cooperationManage":// 管理中心-小组管理
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_COOPERATION;
info = CoEOpLogConst.INFO_COOPERATION_ACCESS_MANAGE;
break;
case "palUser":// 管理中心-PAL用户
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_USER;
info = CoEOpLogConst.INFO_USER_ACCESS;
break;
case "themeStyle":// 管理中心-主题风格
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_PORTAL;
info = CoEOpLogConst.INFO_PORTAL_THEME_STYLE_ACCESS;
break;
case "commonRepository":// 管理中心-常用流程
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_PORTAL;
info = CoEOpLogConst.INFO_PORTAL_COMMON_REPOSITORY_ACCESS;
break;
case "userGroup":// 管理中心-浏览用户
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_PORTAL;
info = CoEOpLogConst.INFO_PORTAL_USER_GROUP_ACCESS;
break;
case "method":// 应用中心-建模管理
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_METHOD;
info = CoEOpLogConst.INFO_METHOD_ACCESS;
break;
case "backup":// 应用中心-数据备份
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_BACKUP;
info = CoEOpLogConst.INFO_BACKUP_ACCESS;
break;
case "recycle":// 应用中心-回收站
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_RECYCLE;
info = CoEOpLogConst.INFO_RECYCLE_ACCESS;
break;
case "workspace":// 访问资产库
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_WORKSPACE;
info = CoEOpLogConst.INFO_WORKSPACE_ACCESS;
break;
case "cooperation":// 访问PAL小组
tempModuleCategory = CoEOpLogConst.MODULE_CATEGORY_COOPERATION;
info = CoEOpLogConst.INFO_COOPERATION_ACCESS;
break;
}
if (UtilString.isNotEmpty(tempModuleCategory)) {
CoEOpLogAPI.auditOkOp(_uc, tempModuleCategory, CoEOpLogConst.OP_ACCESS, info);

View File

@ -109,7 +109,7 @@ public class ChunkedInputStream extends InputStream {
* @return The number of bytes returned or -1 if the end of stream has been
* reached.
* @throws IOException if an IO problem occurs.
* @see java.io.InputStream#read(byte[], int, int)
* @see InputStream#read(byte[], int, int)
*/
public int read(byte[] b, int off, int len) throws IOException {
@ -139,7 +139,7 @@ public class ChunkedInputStream extends InputStream {
* @return The number of bytes returned or -1 if the end of stream has been
* reached.
* @throws IOException if an IO problem occurs.
* @see java.io.InputStream#read(byte[])
* @see InputStream#read(byte[])
*/
public int read(byte[] b) throws IOException {
return read(b, 0, b.length);

View File

@ -76,7 +76,7 @@ public class ContentLengthInputStream extends InputStream {
*
* @return The next byte or -1 if the end of stream has been reached.
* @throws IOException If an IO problem occurs
* @see java.io.InputStream#read()
* @see InputStream#read()
*/
public int read() throws IOException {
if (closed) {
@ -99,9 +99,9 @@ public class ContentLengthInputStream extends InputStream {
* @param len The number of bytes to attempt to read.
* @return The number of bytes read, or -1 if the end of content has been
* reached.
* @throws java.io.IOException Should an error occur on the wrapped stream.
* @throws IOException Should an error occur on the wrapped stream.
*/
public int read(byte[] b, int off, int len) throws java.io.IOException {
public int read(byte[] b, int off, int len) throws IOException {
if (closed) {
throw new IOException("Attempted read from closed stream.");
}
@ -125,7 +125,7 @@ public class ContentLengthInputStream extends InputStream {
* @param b The byte array to put the new data in.
* @return The number of bytes read into the buffer.
* @throws IOException If an IO problem occurs
* @see java.io.InputStream#read(byte[])
* @see InputStream#read(byte[])
*/
public int read(byte[] b) throws IOException {
return read(b, 0, b.length);

View File

@ -397,7 +397,7 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
if (userIds != null && userIds.size() > 0) {
Connection conn = DBSql.open();
PreparedStatement ps = null;
java.sql.ResultSet rset = null;
ResultSet rset = null;
try {
conn.setAutoCommit(false);
String sql = new StringBuilder("INSERT INTO ").append(entityName())

View File

@ -13,4 +13,4 @@
var mainType = "<#mainType>";
var uid = "<#uid>";
var wHref = "./w";
var jdHref = "./jd";</script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-18ba0bf3.b9b5de63.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-1fd5b92a.9170273e.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-3a7599c6.bb861d84.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-532765fe.0cca68dd.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-60daeadc.75bc7367.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-6c83edf4.6c467910.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-9d1e04c4.d1caea12.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-d87401f2.8c237dbf.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-f3e4ff48.721c4dc9.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-18ba0bf3.d0d27872.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-1fd5b92a.07c16352.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0ab156.ca03ae9d.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0b25b0.3ebfc816.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0f078a.3038704d.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d216d3a.96ada280.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224b23.e62adedc.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224ef1.44cb7f2b.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-3a7599c6.5d555915.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-532765fe.9bb04323.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-5ca06e36.c64d879b.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-60daeadc.c137d1bd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-6c83edf4.93b8726a.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-9d1e04c4.ddede9a0.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-bf7921b8.1d6eee48.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-d87401f2.e4775711.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-f3e4ff48.6d7f9787.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.634e376c.css rel=preload as=style><link href=../apps/com.actionsoft.apps.coe.pal/main/js/app.cd289fb7.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.bd2b52b4.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.634e376c.css rel=stylesheet></head><body style=margin:0;><div id=app></div><script src=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.bd2b52b4.js></script><script src=../apps/com.actionsoft.apps.coe.pal/main/js/app.cd289fb7.js></script></body></html>
var jdHref = "./jd";</script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-08487bf0.283a9f57.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-1abee27b.c5c7126f.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-2933a75e.38619268.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4cc17289.6298c290.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-591a3298.d3570084.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-6fb6e04f.adde4cab.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-9c63e2da.ef0a5aa8.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-9cbd2238.79750c14.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-cd54d348.e55cad48.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-08487bf0.cef51ed5.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-1abee27b.ece13c73.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2933a75e.9a437059.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0ab156.ff2fa9d6.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0f078a.83ef78c0.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d212b99.89ae9070.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d216d3a.5867abf3.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224b23.95cfdb5d.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224ef1.11f3f0f4.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-3178e2bf.5207f0ae.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-3a9b7577.aa0dfa28.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4cc17289.40a3944f.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-591a3298.d84f68c8.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-6fb6e04f.27eed2c2.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-9c63e2da.bf7cbc63.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-9cbd2238.1b416d48.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-cd54d348.bcb4b27c.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.20eb2063.css rel=preload as=style><link href=../apps/com.actionsoft.apps.coe.pal/main/js/app.3864c898.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.351b7061.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.20eb2063.css rel=stylesheet></head><body style=margin:0;><div id=app></div><script src=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.351b7061.js></script><script src=../apps/com.actionsoft.apps.coe.pal/main/js/app.3864c898.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
#commonRepository[data-v-5a94998a] .el-dialog__body,#commonRepository[data-v-5a94998a] .el-main{padding:0 20px}#commonRepository[data-v-5a94998a] .el-footer{padding:0}#commonRepository[data-v-5a94998a] .el-table__row .operate-icon-display{display:none}#commonRepository[data-v-5a94998a] .el-table__row:hover .operate-icon-display{display:inline-block}

View File

@ -0,0 +1 @@
#commonRepository[data-v-c633f5ea] .el-dialog__body,#commonRepository[data-v-c633f5ea] .el-main{padding:0 20px}#commonRepository[data-v-c633f5ea] .el-footer{padding:0}#commonRepository[data-v-c633f5ea] .el-table__row .operate-icon-display{display:none}#commonRepository[data-v-c633f5ea] .el-table__row:hover .operate-icon-display{display:inline-block}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0ab156"],{1485:function(a,t,e){"use strict";e.r(t);var i=function(){var a=this,t=a._self._c;return t("div",{staticStyle:{width:"100%",height:"100%"}},[t("iframe",{staticStyle:{border:"0"},attrs:{id:"iframe",width:"100%",height:"100%",name:"iframe",src:a.src}})])},s=[],n={name:"MappingManagement",data(){return{src:"./w?sid="+this.$store.state.sessionId+"&cmd=com.actionsoft.apps.coe.pal.mappingmanagement_main_page&dataType="+this.$route.params.dataType}}},r=n,c=e("0b56"),p=Object(c["a"])(r,i,s,!1,null,"56fd105e",null);t["default"]=p.exports}}]);

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0ab156"],{1485:function(t,a,e){"use strict";e.r(a);var n=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticStyle:{width:"100%",height:"100%"}},[e("iframe",{staticStyle:{border:"0"},attrs:{id:"iframe",width:"100%",height:"100%",name:"iframe",src:t.src}})])},i=[],s={name:"MappingManagement",data:function(){return{src:"./w?sid="+this.$store.state.sessionId+"&cmd=com.actionsoft.apps.coe.pal.mappingmanagement_main_page&dataType="+this.$route.params.dataType}}},r=s,c=e("2877"),p=Object(c["a"])(r,n,i,!1,null,"56fd105e",null);a["default"]=p.exports}}]);

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0f078a"],{"9d09":function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{style:{width:"100%",height:t.mainHeight}},[e("iframe",{staticStyle:{border:"0"},attrs:{id:"orgIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"orgIframe",src:t.src}})])},n=[],r={name:"BPMOrg",data(){return{src:"./w?sid="+this.$store.state.sessionId+"&cmd=com.actionsoft.apps.coe.pal_average_user_org",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},a=r,o=i("0b56"),h=Object(o["a"])(a,s,n,!1,null,"2280cc48",null);e["default"]=h.exports}}]);

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0f078a"],{"9d09":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{style:{width:"100%",height:t.mainHeight}},[i("iframe",{staticStyle:{border:"0"},attrs:{id:"orgIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"orgIframe",src:t.src}})])},s=[],r={name:"BPMOrg",data:function(){return{src:"./w?sid="+this.$store.state.sessionId+"&cmd=com.actionsoft.apps.coe.pal_average_user_org",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight:function(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},a=r,o=i("2877"),c=Object(o["a"])(a,n,s,!1,null,"2280cc48",null);e["default"]=c.exports}}]);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216d3a"],{c3b6:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{style:{width:"100%",height:t.mainHeight},attrs:{id:"cooperation"}},[i("iframe",{staticStyle:{border:"0"},attrs:{id:"coopIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"coopIframe",src:t.src}})])},a=[],o={name:"cooperationCreate",data:function(){return{src:wHref+"?sid="+this.$store.state.sessionId+"&mainPage=create&cmd=com.actionsoft.apps.coe.pal.cooperation_main",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight:function(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},s=o,r=i("2877"),c=Object(r["a"])(s,n,a,!1,null,"6a826a48",null);e["default"]=c.exports}}]);

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216d3a"],{c3b6:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t._self._c;return e("div",{style:{width:"100%",height:t.mainHeight},attrs:{id:"cooperation"}},[e("iframe",{staticStyle:{border:"0"},attrs:{id:"coopIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"coopIframe",src:t.src}})])},n=[],s={name:"cooperationCreate",data(){return{src:wHref+"?sid="+this.$store.state.sessionId+"&mainPage=create&cmd=com.actionsoft.apps.coe.pal.cooperation_main",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},o=s,r=i("0b56"),c=Object(r["a"])(o,a,n,!1,null,"6a826a48",null);e["default"]=c.exports}}]);

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224b23"],{e0df:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{style:{width:"100%",height:t.mainHeight},attrs:{id:"cooperationUpdate"}},[i("iframe",{staticStyle:{border:"0"},attrs:{id:"coopIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"coopIframe",src:t.src}})])},a=[],o={name:"CooperationUpdate",data:function(){return{src:wHref+"?sid="+this.$store.state.sessionId+"&mainPage=update&cmd=com.actionsoft.apps.coe.pal.cooperation_main",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight:function(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},s=o,r=i("2877"),p=Object(r["a"])(s,n,a,!1,null,"543345d8",null);e["default"]=p.exports}}]);

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224b23"],{e0df:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t._self._c;return e("div",{style:{width:"100%",height:t.mainHeight},attrs:{id:"cooperationUpdate"}},[e("iframe",{staticStyle:{border:"0"},attrs:{id:"coopIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"coopIframe",src:t.src}})])},n=[],s={name:"CooperationUpdate",data(){return{src:wHref+"?sid="+this.$store.state.sessionId+"&mainPage=update&cmd=com.actionsoft.apps.coe.pal.cooperation_main",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},o=s,r=i("0b56"),p=Object(r["a"])(o,a,n,!1,null,"543345d8",null);e["default"]=p.exports}}]);

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224ef1"],{e1f5:function(e,s,t){"use strict";t.r(s);var n=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"devGetSession"},[e._v(" 正在获取session ")])},a=[],o=t("a18c"),d=t("0f08"),i=t("4360");d["a"].post({url:"jd",data:{userid:devUserInfo.userid,pwd:devUserInfo.pwd,lang:"cn",cmd:"com.actionsoft.apps.getsession.get",deviceType:"pc"}}).then((function(e){"error"==e.result?alert("获取session错误"+e.msg):(i["a"].commit("edit",{sessionId:e.data.sid}),o["a"].replace("/"))}));var c={data:function(){return{dwList:[]}},methods:{},mounted:function(){}},r=c,u=t("2877"),l=Object(u["a"])(r,n,a,!1,null,null,null);s["default"]=l.exports}}]);

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224ef1"],{e1f5:function(e,s,t){"use strict";t.r(s);var n=function(){var e=this,s=e._self._c;return s("div",{staticClass:"devGetSession"},[e._v(" 正在获取session ")])},a=[],d=t("a18c"),o=t("0f08"),i=t("4360");o["a"].post({url:"jd",data:{userid:devUserInfo.userid,pwd:devUserInfo.pwd,lang:"cn",cmd:"com.actionsoft.apps.getsession.get",deviceType:"pc"}}).then((function(e){"error"==e.result?alert("获取session错误"+e.msg):(i["a"].commit("edit",{sessionId:e.data.sid}),d["a"].replace("/"))}));var r={data(){return{dwList:[]}},methods:{},mounted(){}},c=r,u=t("0b56"),l=Object(u["a"])(c,n,a,!1,null,null,null);s["default"]=l.exports}}]);

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More