353 lines
11 KiB
Java
353 lines
11 KiB
Java
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
|
||
*/
|
||
|
||
@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 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);
|
||
}
|
||
|
||
/**
|
||
* 保存新建、修改的小组信息
|
||
* @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();
|
||
}
|
||
|
||
/**
|
||
* 查询当前用户所在的所有小组
|
||
*/
|
||
@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);
|
||
}
|
||
|
||
/**
|
||
* 修改小组的基本信息
|
||
* @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
|
||
* @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_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);
|
||
}
|
||
|
||
/**
|
||
* 修改用户的角色保存
|
||
*/
|
||
@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_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 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 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 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);
|
||
}
|
||
|
||
/**
|
||
* 添加成员,保存
|
||
* @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 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();
|
||
}
|
||
|
||
}
|