From 0ef38b522f993c7a9478d3694ad49c92abc3384d Mon Sep 17 00:00:00 2001 From: zer0Black <694429613@qq.com> Date: Mon, 2 Oct 2023 15:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=88=A0=E9=99=A4=E3=80=91=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E7=A4=BA=E4=BE=8Bcontroller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docking/iam/controller/BbcController.java | 1128 ----------------- .../controller/BbcControllerUnencrypted.java | 1013 --------------- 2 files changed, 2141 deletions(-) delete mode 100644 laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/BbcController.java delete mode 100644 laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/BbcControllerUnencrypted.java diff --git a/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/BbcController.java b/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/BbcController.java deleted file mode 100644 index 53130408..00000000 --- a/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/BbcController.java +++ /dev/null @@ -1,1128 +0,0 @@ -//package com.jero.modules.iam; -//import com.alibaba.fastjson.JSON; -//import com.alibaba.fastjson.JSONObject; -// -//import com.bamboocloud.codec.BamboocloudFacade; -//import com.jero.modules.system.service.ISysDepartService; -//import com.jero.modules.system.service.ISysRoleService; -//import com.jero.modules.system.service.ISysUserService; -//import io.swagger.annotations.Api; -//import io.swagger.annotations.ApiImplicitParam; -//import io.swagger.annotations.ApiOperation; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.web.bind.annotation.PostMapping; -//import org.springframework.web.bind.annotation.RequestMapping; -//import org.springframework.web.bind.annotation.ResponseBody; -//import org.springframework.web.bind.annotation.RestController; -// -//import javax.servlet.ServletException; -//import javax.servlet.http.HttpServletRequest; -//import javax.servlet.http.HttpServletResponse; -//import java.io.BufferedReader; -//import java.io.IOException; -//import java.io.PrintWriter; -//import java.util.*; -////public class BbcController { -//// -//// @Autowired -//// private ISysUserService userService; -//// -//// @Autowired -//// private ISysRoleService roleService; -//// -//// @Autowired -//// private IPostService postService; -//// -//// @Autowired -//// private ISysDepartService deptService; -//// -//// @Autowired -//// private IDictDataService dictDataService; -//// -//// @Autowired -//// private SysPasswordService passwordService; -//// -//// private String bimRequestId; -//// -//// private static Logger logger = LoggerFactory.getLogger(BbcController.class); -//// -//// @ApiOperation("测试") -//// @RequestMapping() -//// public JSONObject bbcUser() { -//// -//// JSONObject jsonObject = new JSONObject(); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// return jsonObject; -//// -//// } -//// -//// @ApiOperation("对象属性字段查询") -//// @PostMapping("/schemaService") -//// public String SchemaService(HttpServletRequest req, HttpServletResponse resp) { -//// -//// JSONObject jsonObject = new JSONObject(); -//// -//// // StringBuilder sb = stringBuilder(req); -//// String bodyparam= BamboocloudUtils.getRequestBody(req); -//// logger.info("json--param-->" + bodyparam); -//// // String bodyparam = sb.toString(); -//// //解密json字符传 -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// //判断接口中的调用名及调用密码是否正确 -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// //添加返回的对象及属性字段名 -//// MapJson mapJson = new MapJson(); -//// Map>> map = new HashMap<>(); -//// jsonObject.put("account", mapJson.accountList()); -//// jsonObject.put("organization", mapJson.organizationList()); -//// jsonObject.put("role", mapJson.roleList()); -//// jsonObject.put("post", mapJson.postList()); -//// jsonObject.put("dict", mapJson.dictDataList()); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJs = JSON.toJSONString(jsonObject); -//// logger.info(jsonObject.toJSONString()); -//// //返回加密的json字符串 -//// mapJs = BamboocloudFacade.encrypt(mapJs, "123456", "AES"); -//// //jsonObject.put(map); -//// // values = jsonObject.values(); -//// return mapJs; -//// } -//// } -//// jsonObject.put("bimRequestId", bimRequestId); -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "连接失败,请检查连接器配置的参数"); -//// logger.info(jsonObject.toJSONString()); -//// String mapJs = JSON.toJSONString(jsonObject); -//// //返回加密的json字符串 -//// mapJs = BamboocloudFacade.encrypt(mapJs, "123456", "AES"); -//// return mapJs; -//// } -//// -//// @ApiOperation("新增用户") -//// @ApiImplicitParam(name = "user", value = "新增用户信息", dataType = "User") -//// @PostMapping("/UserCreateService") -//// @ResponseBody -//// public String userCreateService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { -//// -//// Map schema = new HashMap(); -//// -//// JSONObject jsonObject = new JSONObject(); -//// -//// StringBuilder sb = stringBuilder(req); -//// //修改多值的属性格式方便转换 -//// String bodyparam = sb.toString(); -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// String p = bodyparam; -//// String z = "[\""; -//// String y = "\"]"; -//// bodyparam.indexOf(z); -//// bodyparam.indexOf(y); -//// while (bodyparam.contains(z)) { -//// p = bodyparam.substring(bodyparam.indexOf(z), bodyparam.indexOf(y) + 2).replace(z, "\"").replace(y, "\"").replace("\",\"", ","); -//// bodyparam = bodyparam.substring(0, bodyparam.indexOf(z)) + p + bodyparam.substring(bodyparam.indexOf(y) + 2, bodyparam.length()); -//// } -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// //获取用户创建所需的参数 -//// User user = createUpdateUser(reqmap); -//// //用户创建 -//// userService.insertBbcUser(user); -//// //获取返回给IAM连接器的唯一标识,用于后续该条数据的更新修改删除 -//// String uid = user.getUserId() + ""; -//// if (uid != null) { -//// schema.put("uid", uid); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// } else { -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "账号创建失败"); -//// } -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// return mapJson; -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "账号创建失败,请检查连接器配置的参数"); -//// String mapJson = JSON.toJSONString(schema); -//// //返回加密的json字符串 -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// return mapJson; -//// } -//// -//// /** -//// *填充用户的属性值 -//// * @param reqmap json -//// * @return 用户 -//// */ -//// private User createUpdateUser(Map reqmap) { -//// User user = new User(); -//// if (reqmap.get("__NAME__") != null) { -//// user.setLoginName((String) reqmap.get("__NAME__")); -//// } -//// if (reqmap.get("login_name") != null) { -//// user.setLoginName((String) reqmap.get("login_name")); -//// } -//// if (reqmap.get("password") != null) { -//// user.setPassword((String) reqmap.get("password")); -//// } -//// if (reqmap.get("dept_id") != null) { -//// user.setDeptId(Long.valueOf(String.valueOf(reqmap.get("dept_id")))); -//// } -//// if (reqmap.get("user_name") != null) { -//// user.setUserName((String) reqmap.get("user_name")); -//// } -//// if (reqmap.get("phonenumber") != null) { -//// user.setPhonenumber((String) reqmap.get("phonenumber")); -//// } -//// if (reqmap.get("sex") != null) { -//// String sex = (String) reqmap.get("sex"); -//// if (sex.equals("1")) { -//// sex = "0"; -//// } -//// if (sex.equals("2")) { -//// sex = "1"; -//// } -//// if (sex.equals("3")) { -//// sex = "2"; -//// } -//// user.setSex(sex); -//// } -//// if (reqmap.get("email") != null) { -//// user.setEmail((String) reqmap.get("email")); -//// } -//// if (reqmap.get("status") != null) { -//// if (Boolean.valueOf(String.valueOf(reqmap.get("status")))) -//// user.setStatus("1"); -//// else user.setStatus("0"); -//// } -//// if (reqmap.get("__ENABLE__") != null) { -//// if (Boolean.valueOf(String.valueOf(reqmap.get("__ENABLE__")))) -//// user.setStatus("0"); -//// else user.setStatus("1"); -//// } -//// if (reqmap.get("user_role") != null) { -//// String user_role = ((String) reqmap.get("user_role")).replaceAll(" ", ""); -//// if (user_role.contains(",")) { -//// String[] userRole = user_role.split(","); -//// List roleIds = new ArrayList<>(); -//// for (String up : userRole) { -//// roleIds.add(Long.valueOf(String.valueOf(up))); -//// } -//// user.setRoleIds(roleIds.toArray(new Long[roleIds.size()])); -//// } else { -//// List roleIds = new ArrayList<>(); -//// roleIds.add(Long.valueOf(String.valueOf(user_role))); -//// user.setRoleIds(roleIds.toArray(new Long[roleIds.size()])); -//// } -//// } -//// if (reqmap.get("user_post") != null) { -//// String user_post = ((String) reqmap.get("user_post")).replaceAll(" ", ""); -//// if (user_post.contains(",")) { -//// String[] userPost = user_post.split(","); -//// List postIds = new ArrayList<>(); -//// for (String up : userPost) { -//// postIds.add(Long.valueOf(String.valueOf(up))); -//// } -//// user.setPostIds(postIds.toArray(new Long[postIds.size()])); -//// } else { -//// List postIds = new ArrayList<>(); -//// postIds.add(Long.valueOf(String.valueOf(user_post))); -//// user.setPostIds(postIds.toArray(new Long[postIds.size()])); -//// } -//// } -//// /* userService.selectUserByLoginName((String) reqmap.get("__NAME__")).getUserId();*/ -//// return user; -//// } -//// -//// @ApiOperation("修改用户") -//// @ApiImplicitParam(name = "user", value = "修改用户信息", dataType = "User") -//// @PostMapping("/UserUpdateService") -//// @ResponseBody -//// public String userUpdateService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { -//// -//// Map schema = new HashMap(); -//// -//// JSONObject jsonObject = new JSONObject(); -//// -//// StringBuilder sb = stringBuilder(req); -//// -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// //修改多值的属性格式方便转换 -//// String p = bodyparam; -//// String bdp = bodyparam; -//// String z = "[\""; -//// String y = "\"]"; -//// bodyparam.indexOf(z); -//// bodyparam.indexOf(y); -//// while (bodyparam.contains(z)) { -//// p = bodyparam.substring(bodyparam.indexOf(z), bodyparam.indexOf(y) + 2).replace(z, "\"").replace(y, "\"").replace("\",\"", ","); -//// bodyparam = bodyparam.substring(0, bodyparam.indexOf(z)) + p + bodyparam.substring(bodyparam.indexOf(y) + 2, bodyparam.length()); -//// } -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// User user = new User(); -//// //获取用于更新的参数 -//// user = createUpdateUser(reqmap); -//// //获取用于更新的唯一标识 -//// user.setUserId(Long.valueOf(String.valueOf(reqmap.get("bimUid")))); -//// //更新用户 -//// userService.updateBbcUser(user); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "账号更新失败,请检查连接器配置的参数"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// -//// @ApiOperation("删除用户") -//// @ApiImplicitParam(name = "user", value = "删除用户信息", dataType = "User") -//// @PostMapping("/UserDeleteService") -//// @ResponseBody -//// public String userDeleteService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { -//// -//// Map schema = new HashMap(); -//// -//// JSONObject jsonObject = new JSONObject(); -//// -//// StringBuilder sb = stringBuilder(req); -//// -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// //调用删除方法 -//// int n = userService.deleteUserById(Long.valueOf(String.valueOf(reqmap.get("bimUid")))); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "账号删除失败"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// -//// @ApiOperation("获取用户id") -//// @ApiImplicitParam(name = "user", value = "获取用户id", dataType = "User") -//// @PostMapping("/QueryAllUserIdsService") -//// @ResponseBody -//// public String Idlist(HttpServletRequest request, HttpServletResponse response) { -//// JSONObject jsonObject = new JSONObject(); -//// -//// StringBuilder sb = stringBuilder(request); -//// -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// try { -//// //获取所有用户id -//// List list = userService.selectUserIdList(); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("userIdList", list); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } catch (Exception e) { -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } -//// } -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// -//// @ApiOperation("通过用户id获取信息") -//// @ApiImplicitParam(name = "user", value = "获取用户id", dataType = "User") -//// @PostMapping("/QueryUserByIdService") -//// @ResponseBody -//// public String IdUserlist(HttpServletRequest request, HttpServletResponse response) { -//// JSONObject jsonObject = new JSONObject(); -//// -//// StringBuilder sb = stringBuilder(request); -//// -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// try { -//// //获取用户信息 -//// User userAll = userService.selectUserByIdq(Long.valueOf((String) reqmap.get("bimUid"))); -//// //获取用户所担任的角色 -//// List roles = roleService.selectRoleId(Long.valueOf((String) reqmap.get("bimUid"))); -//// //获取用户所在的岗位 -//// List posts = postService.selectPostId(Long.valueOf((String) reqmap.get("bimUid"))); -//// //用于将对象的属性改为仅需要的对象 -//// DeptGai deptGai = new DeptGai(); -//// UserZhuan userZhuan = deptGai.zhuanHuan(userAll, roles, posts); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("account", userZhuan); -//// jsonObject.put("bimRequestId", request.getParameter("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } catch (Exception e) { -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } -//// } -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// -//// @ApiOperation("创建机构信息") -//// @ApiImplicitParam(name = "dept", value = "创建机构信息", dataType = "Dept") -//// @PostMapping("/OrgCreateService") -//// @ResponseBody -//// public String OrgCreate(HttpServletRequest req, HttpServletResponse resp) { -//// Map schema = new HashMap(); -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(req); -//// String bodyparam = sb.toString(); -//// //json字符串解密 -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// //机构的属性填值 -//// Dept dept = createUpdateOrg(reqmap); -//// deptService.insertBbcDept(dept); -//// String uid = dept.getDeptId() + ""; -//// if (uid != null) { -//// schema.put("uid", uid); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// } -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "机构创建失败,报错信息自定义"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// -//// private Dept createUpdateOrg(Map reqmap) { -//// Dept dept = new Dept(); -//// if (reqmap.get("dept_id") != null) { -//// dept.setDeptId(Long.valueOf(String.valueOf(reqmap.get("dept_id")))); -//// } -//// if (reqmap.get("__UID__") != null) { -//// dept.setDeptId(Long.valueOf(String.valueOf(reqmap.get("__UID__")))); -//// } -//// if (reqmap.get("parent_id") != null) { -//// dept.setParentId(Long.valueOf(String.valueOf(reqmap.get("parent_id")))); -//// } -//// if (reqmap.get("status") != null) { -//// if (Boolean.valueOf(String.valueOf(reqmap.get("status")))) -//// dept.setStatus("1"); -//// else dept.setStatus("0"); -//// } -//// if (reqmap.get("__ENABLE__") != null) { -//// if (Boolean.valueOf(String.valueOf(reqmap.get("__ENABLE__")))) -//// dept.setStatus("0"); -//// else dept.setStatus("1"); -//// } -//// -//// if (reqmap.get("dept_name") != null) { -//// dept.setDeptName((String) reqmap.get("dept_name")); -//// } -//// if (reqmap.get("__NAME__") != null) { -//// dept.setDeptName((String) reqmap.get("__NAME__")); -//// } -//// return dept; -//// } -//// -//// @ApiOperation("修改机构信息") -//// @ApiImplicitParam(name = "dept", value = "修改机构信息", dataType = "Dept") -//// @PostMapping("/OrgUpdateService") -//// @ResponseBody -//// public String orgUpdateService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { -//// Map schema = new HashMap(); -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(req); -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// Dept dept = new Dept(); -//// dept = createUpdateOrg(reqmap); -//// dept.setDeptId(Long.valueOf(String.valueOf(reqmap.get("bimOrgId")))); -//// deptService.updateBbcDept(dept); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "机构更新失败,报错信息自定义"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// -//// @ApiOperation("删除机构信息") -//// @ApiImplicitParam(name = "dept", value = "删除机构信息", dataType = "Dept") -//// @PostMapping("/OrgDeleteService") -//// @ResponseBody -//// public String orgDeleteService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { -//// Map schema = new HashMap(); -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(req); -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// int n = deptService.deleteDeptById(Long.valueOf(String.valueOf(reqmap.get("bimOrgId")))); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "机构删除失败,报错信息自定义"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// -//// } -//// -//// @ApiOperation("获取机构id") -//// @ApiImplicitParam(name = "BodyParam", value = "获取机构id", dataType = "BodyParam") -//// @PostMapping("/QueryAllOrgIdsService") -//// @ResponseBody -//// public String QueryAllOrgIds(HttpServletRequest request, HttpServletResponse response) { -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(request); -//// String bodyparam = sb.toString(); -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// try { -//// -//// List list = deptService.selectDeptIdList(new Dept()); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("orgIdList", list); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } catch (Exception e) { -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } -//// } -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// -//// @ApiOperation("通过机构id获取信息") -//// @ApiImplicitParam(name = "dept", value = "获取用户id", dataType = "Dept") -//// @PostMapping("/QueryOrgByIdService") -//// @ResponseBody -//// public String IdDeptlist(HttpServletRequest request, HttpServletResponse response) { -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(request); -//// String bodyparam = sb.toString(); -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// try { -//// Dept deptAll = deptService.selectDeptById(Long.valueOf((String) reqmap.get("bimOrgId"))); -//// DeptGai deptGai = new DeptGai(); -//// DeptZhuan deptZhuan = deptGai.zhuanHuan(deptAll); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("organization", deptZhuan); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } catch (Exception e) { -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取机构信息失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } -//// } -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "回收机构失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// -//// @ApiOperation("创建角色信息") -//// @ApiImplicitParam(name = "role", value = "创建角色信息", dataType = "Role") -//// @PostMapping("/RoleCreateService") -//// @ResponseBody -//// public String RoleCreateService(HttpServletRequest req, HttpServletResponse resp) { -//// Map schema = new HashMap(); -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(req); -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// Role role = createUpdateRole(reqmap); -//// if (reqmap.get("roleSort") != null) { -//// role.setRoleSort((String) reqmap.get("roleSort")); -//// } -//// if (reqmap.get("roleSort") == null || "".equals((String) reqmap.get("roleSort"))) { -//// role.setRoleSort("1"); -//// } -//// if (reqmap.get("status") == null && reqmap.get("__ENABLE__") == null) { -//// role.setStatus("0"); -//// } -//// roleService.insertBbcRole(role); -//// String uid = role.getRoleId().toString(); -//// if (uid != null) { -//// schema.put("uid", uid); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// } -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "角色创建失败,报错信息自定义"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// -//// private Role createUpdateRole(Map reqmap) { -//// Role role = new Role(); -//// if (reqmap.get("bimRid") != null) { -//// role.setRoleId(Long.valueOf(String.valueOf(reqmap.get("bimRid")))); -//// } -//// if (reqmap.get("roleId") != null) { -//// role.setRoleId(Long.valueOf(String.valueOf(reqmap.get("roleId")))); -//// } -//// if (reqmap.get("__UID__") != null) { -//// role.setRoleId(Long.valueOf(String.valueOf(reqmap.get("roleId")))); -//// } -//// if (reqmap.get("__NAME__") != null) { -//// role.setRoleName((String) reqmap.get("__NAME__")); -//// } -//// if (reqmap.get("roleName") != null) { -//// role.setRoleName((String) reqmap.get("roleName")); -//// } -//// if (reqmap.get("dataScope") != null) { -//// role.setDataScope((String) reqmap.get("dataScope")); -//// } -//// if (reqmap.get("roleKey") != null) { -//// role.setRoleKey((String) reqmap.get("roleKey")); -//// } -//// if (reqmap.get("status") != null) { -//// if (Boolean.valueOf(String.valueOf(reqmap.get("status")))) -//// role.setStatus("1"); -//// else role.setStatus("0"); -//// } -//// if (reqmap.get("__ENABLE__") != null) { -//// if (Boolean.valueOf(String.valueOf(reqmap.get("__ENABLE__")))) -//// role.setStatus("0"); -//// else role.setStatus("1"); -//// } -//// return role; -//// } -//// -//// @ApiOperation("修改角色信息") -//// @ApiImplicitParam(name = "role", value = "修改角色信息", dataType = "Role") -//// @PostMapping("/RoleUpdateService") -//// @ResponseBody -//// public String RoleUpdateService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { -//// Map schema = new HashMap(); -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(req); -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// Role role = createUpdateRole(reqmap); -//// roleService.updateBbcRole(role); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "角色更新失败,报错信息自定义"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// -//// -//// @ApiOperation("删除角色信息") -//// @ApiImplicitParam(name = "role", value = "删除角色信息", dataType = "Role") -//// @PostMapping("/RoleDeleteService") -//// @ResponseBody -//// public String RoleDeleteService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { -//// Map schema = new HashMap(); -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(req); -//// String bodyparam = sb.toString(); -//// -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// boolean n = roleService.deleteRoleById(Long.valueOf(String.valueOf(reqmap.get("bimRid")))); -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "0"); -//// schema.put("message", "success"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// } -//// schema.put("bimRequestId", reqmap.get("bimRequestId")); -//// schema.put("resultCode", "500"); -//// schema.put("message", "机构删除失败,报错信息自定义"); -//// String mapJson = JSON.toJSONString(schema); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + schema); -//// return mapJson; -//// } -//// -//// @ApiOperation("获取角色id") -//// @ApiImplicitParam(name = "BodyParam", value = "获取角色id", dataType = "BodyParam") -//// @PostMapping("/QueryAllRoleIdsService") -//// @ResponseBody -//// public String QueryAllRoleIdsService(HttpServletRequest request, HttpServletResponse response) { -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(request); -//// String bodyparam = sb.toString(); -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// try { -//// -//// List list = roleService.selectRoleIdList(new Role()); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("roleIdList", list); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } catch (Exception e) { -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } -//// } -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// -//// @ApiOperation("通过角色id获取信息") -//// @ApiImplicitParam(name = "role", value = "获取角色id", dataType = "Role") -//// @PostMapping("/QueryRoleByIdService") -//// @ResponseBody -//// public String QueryRoleByIdService(HttpServletRequest request, HttpServletResponse response) { -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(request); -//// String bodyparam = sb.toString(); -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// try { -//// Role roleAll = roleService.selectRoleById(Long.valueOf((String) reqmap.get("bimRid"))); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("role", roleAll); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } catch (Exception e) { -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取角色信息失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } -//// } -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "回收角色失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// -//// @ApiOperation("获取资源id") -//// @ApiImplicitParam(name = "BodyParam", value = "获取资源id", dataType = "获取资源id") -//// @PostMapping("/QueryAllResourceIdsService") -//// @ResponseBody -//// public String QueryAllResourceIdsService(HttpServletRequest request, HttpServletResponse response) { -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(request); -//// String bodyparam = sb.toString(); -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// String resourceType = (String) reqmap.get("resourceType"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// try { -//// if ("post".equals(resourceType)) { -//// List list = postService.selectPostIdList(new Post()); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("resourceIdList", list); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// if ("dict".equals(resourceType)) { -//// DictData dictData = new DictData(); -//// dictData.setDictType("sys_user_sex"); -//// List list = dictDataService.selectDictDataIdList(dictData); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("resourceIdList", list); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } catch (Exception e) { -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } -//// } -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取id失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// -//// @ApiOperation("通过资源id获取信息") -//// @ApiImplicitParam(name = "resource", value = "获取资源id", dataType = "Resource") -//// @PostMapping("/QueryResourceByIdService") -//// @ResponseBody -//// public String QueryResourceByIdService(HttpServletRequest request, HttpServletResponse response) { -//// JSONObject jsonObject = new JSONObject(); -//// StringBuilder sb = stringBuilder(request); -//// String bodyparam = sb.toString(); -//// bodyparam = BamboocloudUtils.getPlaintext(bodyparam, "123456", "AES"); -//// -//// logger.info("json--param-->" + bodyparam); -//// Map reqmap = (Map) JSON.parse(bodyparam); -//// //验证签名 -//// if (BamboocloudUtils.verify(reqmap, "MD5").booleanValue()) { -//// String username = (String) reqmap.get("bimRemoteUser"); -//// String password = (String) reqmap.get("bimRemotePwd"); -//// String resourceType = (String) reqmap.get("resourceType"); -//// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -//// try { -//// if ("post".equals(resourceType)) { -//// Post postAll = postService.selectPostById(Long.valueOf((String) reqmap.get("resourceId"))); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("resource", postAll); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// if ("dict".equals(resourceType)) { -//// DictData dictDataAll = dictDataService.selectDictDataById(Long.valueOf((String) reqmap.get("resourceId"))); -//// jsonObject.put("resultCode", "0"); -//// jsonObject.put("message", "success"); -//// jsonObject.put("resource", dictDataAll); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } catch (Exception e) { -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "获取资源信息失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// } -//// } -//// jsonObject.put("resultCode", "505"); -//// jsonObject.put("message", "回收资源失败"); -//// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -//// String mapJson = JSON.toJSONString(jsonObject); -//// mapJson = BamboocloudFacade.encrypt(mapJson, "123456", "AES"); -//// logger.info("response----->" + jsonObject); -//// return mapJson; -//// } -//// -//// -//// public StringBuilder stringBuilder(HttpServletRequest req) { -//// BufferedReader br = null; -//// StringBuilder sb = new StringBuilder(); -//// String str = ""; -//// try { -//// br = req.getReader(); -//// while ((str = br.readLine()) != null) { -//// sb.append(str); -//// } -//// br.close(); -//// } catch (IOException e) { -//// e.printStackTrace(); -//// if (br != null) -//// try { -//// br.close(); -//// } catch (IOException eo) { -//// eo.printStackTrace(); -//// } -//// } finally { -//// if (br != null) { -//// try { -//// br.close(); -//// } catch (IOException e) { -//// e.printStackTrace(); -//// } -//// } -//// } -//// return sb; -//// } -////} diff --git a/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/BbcControllerUnencrypted.java b/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/BbcControllerUnencrypted.java deleted file mode 100644 index 11d3a50a..00000000 --- a/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/BbcControllerUnencrypted.java +++ /dev/null @@ -1,1013 +0,0 @@ -//package com.jero.modules.iam; -// -//import com.alibaba.fastjson.JSON; -//import com.alibaba.fastjson.JSONObject; -//import com.banboocloud.Codec.BamboocloudFacade; -//import com.ruoyi.common.utils.reflect.ReflectUtils; -//import com.ruoyi.framework.web.controller.BaseController; -//import com.ruoyi.project.system.dept.domain.Dept; -//import com.ruoyi.project.system.dept.service.IDeptService; -//import com.ruoyi.project.system.dict.domain.DictData; -//import com.ruoyi.project.system.dict.service.IDictDataService; -//import com.ruoyi.project.system.post.domain.Post; -//import com.ruoyi.project.system.post.service.IPostService; -//import com.ruoyi.project.system.role.domain.Role; -//import com.ruoyi.project.system.role.service.IRoleService; -//import com.ruoyi.project.system.user.domain.User; -//import com.ruoyi.project.system.user.service.IUserService; -//import com.ruoyi.project.tool.swagger.accessory.*; -//import io.swagger.annotations.Api; -//import io.swagger.annotations.ApiImplicitParam; -//import io.swagger.annotations.ApiImplicitParams; -//import io.swagger.annotations.ApiOperation; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.web.bind.annotation.*; -// -//import javax.servlet.ServletException; -//import javax.servlet.http.HttpServletRequest; -//import javax.servlet.http.HttpServletResponse; -//import java.io.BufferedReader; -//import java.io.IOException; -//import java.util.ArrayList; -//import java.util.HashMap; -//import java.util.List; -//import java.util.Map; -// -///** -// * swagger 用户测试方法 -// * 未加密 -// * @author ruoyi -// */ -//@Api("bbc用户信息") -//@RestController -//@RequestMapping("/bbc/userUnencrypted") -//public class BbcControllerUnencrypted extends BaseController { -// @Autowired -// private IUserService userService; -// -// @Autowired -// private IRoleService roleService; -// -// @Autowired -// private IPostService postService; -// -// @Autowired -// private IDeptService deptService; -// -// @Autowired -// private IDictDataService dictDataService; -// -// @Autowired -// private SysPasswordService passwordService; -// -// private String bimRequestId; -// -// private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class); -// -// @ApiOperation("测试") -// @RequestMapping() -// public JSONObject bbcUser() { -// -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// return jsonObject; -// -// } -// -// @ApiOperation("对象属性字段查询") -// @ApiImplicitParam(name = "json", value = "调用账号密码id", dataType = "String") -// @PostMapping("/SchemaService") -// public String SchemaService(@RequestBody String json) { -// -// JSONObject jsonObject = new JSONObject(); -// String bodyparam= json; -// logger.info("json--param-->" + bodyparam); -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// //判断接口中的调用名及调用密码是否正确 -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// //添加返回的对象及属性字段名 -// MapJson mapJson = new MapJson(); -// Map>> map = new HashMap<>(); -// jsonObject.put("account", mapJson.accountList()); -// jsonObject.put("organization", mapJson.organizationList()); -// jsonObject.put("role", mapJson.roleList()); -// jsonObject.put("post", mapJson.postList()); -// jsonObject.put("dict", mapJson.dictDataList()); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJs = JSON.toJSONString(jsonObject); -// logger.info(jsonObject.toJSONString()); -// return mapJs; -// } -// jsonObject.put("bimRequestId", bimRequestId); -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "连接失败,请检查连接器配置的参数"); -// logger.info(jsonObject.toJSONString()); -// String mapJs = JSON.toJSONString(jsonObject); -// return mapJs; -// } -// -// @ApiOperation("新增用户") -// @ApiImplicitParam(name = "json", value = "新增用户信息", dataType = "String") -// @PostMapping("/UserCreateService") -// @ResponseBody -// public String userCreateService(@RequestBody String json) throws ServletException, IOException { -// -// Map schema = new HashMap(); -// -// JSONObject jsonObject = new JSONObject(); -// -// //修改多值的属性格式方便转换 -// String bodyparam = json; -// -// String p = bodyparam; -// String z = "[\""; -// String y = "\"]"; -// bodyparam.indexOf(z); -// bodyparam.indexOf(y); -// while (bodyparam.contains(z)) { -// p = bodyparam.substring(bodyparam.indexOf(z), bodyparam.indexOf(y) + 2).replace(z, "\"").replace(y, "\"").replace("\",\"", ","); -// bodyparam = bodyparam.substring(0, bodyparam.indexOf(z)) + p + bodyparam.substring(bodyparam.indexOf(y) + 2, bodyparam.length()); -// } -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// //获取用户创建所需的参数 -// User user = createUpdateUser(reqmap); -// //用户创建 -// userService.insertBbcUser(user); -// //获取返回给IAM连接器的唯一标识,用于后续该条数据的更新修改删除 -// String uid = user.getUserId() + ""; -// if (uid != null) { -// schema.put("uid", uid); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// } else { -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "账号创建失败"); -// } -// String mapJson = JSON.toJSONString(schema); -// return mapJson; -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "账号创建失败,请检查连接器配置的参数"); -// String mapJson = JSON.toJSONString(schema); -// return mapJson; -// } -// -// /** -// *填充用户的属性值 -// * @param reqmap json -// * @return 用户 -// */ -// private User createUpdateUser(Map reqmap) { -// User user = new User(); -// if (reqmap.get("__NAME__") != null) { -// user.setLoginName((String) reqmap.get("__NAME__")); -// } -// if (reqmap.get("login_name") != null) { -// user.setLoginName((String) reqmap.get("login_name")); -// } -// if (reqmap.get("password") != null) { -// user.setPassword((String) reqmap.get("password")); -// } -// if (reqmap.get("dept_id") != null) { -// user.setDeptId(Long.valueOf(String.valueOf(reqmap.get("dept_id")))); -// } -// if (reqmap.get("user_name") != null) { -// user.setUserName((String) reqmap.get("user_name")); -// } -// if (reqmap.get("phonenumber") != null) { -// user.setPhonenumber((String) reqmap.get("phonenumber")); -// } -// if (reqmap.get("sex") != null) { -// String sex = (String) reqmap.get("sex"); -// if (sex.equals("1")) { -// sex = "0"; -// } -// if (sex.equals("2")) { -// sex = "1"; -// } -// if (sex.equals("3")) { -// sex = "2"; -// } -// user.setSex(sex); -// } -// if (reqmap.get("email") != null) { -// user.setEmail((String) reqmap.get("email")); -// } -// if (reqmap.get("status") != null) { -// if (Boolean.valueOf(String.valueOf(reqmap.get("status")))) -// user.setStatus("1"); -// else user.setStatus("0"); -// } -// if (reqmap.get("__ENABLE__") != null) { -// if (Boolean.valueOf(String.valueOf(reqmap.get("__ENABLE__")))) -// user.setStatus("0"); -// else user.setStatus("1"); -// } -// //角色为多值情况下的处理 -// if (reqmap.get("user_role") != null) { -// String user_role = ((String) reqmap.get("user_role")).replaceAll(" ", ""); -// if (user_role.contains(",")) { -// String[] userRole = user_role.split(","); -// List roleIds = new ArrayList<>(); -// for (String up : userRole) { -// roleIds.add(Long.valueOf(String.valueOf(up))); -// } -// user.setRoleIds(roleIds.toArray(new Long[roleIds.size()])); -// } else { -// List roleIds = new ArrayList<>(); -// roleIds.add(Long.valueOf(String.valueOf(user_role))); -// user.setRoleIds(roleIds.toArray(new Long[roleIds.size()])); -// } -// } -// if (reqmap.get("user_post") != null) { -// String user_post = ((String) reqmap.get("user_post")).replaceAll(" ", ""); -// if (user_post.contains(",")) { -// String[] userPost = user_post.split(","); -// List postIds = new ArrayList<>(); -// for (String up : userPost) { -// postIds.add(Long.valueOf(String.valueOf(up))); -// } -// user.setPostIds(postIds.toArray(new Long[postIds.size()])); -// } else { -// List postIds = new ArrayList<>(); -// postIds.add(Long.valueOf(String.valueOf(user_post))); -// user.setPostIds(postIds.toArray(new Long[postIds.size()])); -// } -// } -// /* userService.selectUserByLoginName((String) reqmap.get("__NAME__")).getUserId();*/ -// return user; -// } -// -// @ApiOperation("修改用户") -// @ApiImplicitParam(name = "json", value = "修改用户信息", dataType = "String") -// @PostMapping("/UserUpdateService") -// @ResponseBody -// public String userUpdateService(@RequestBody String json) throws ServletException, IOException { -// -// Map schema = new HashMap(); -// -// JSONObject jsonObject = new JSONObject(); -// -// String bodyparam =json; -// -// //修改多值的属性格式方便转换 -// String p = bodyparam; -// String bdp = bodyparam; -// String z = "[\""; -// String y = "\"]"; -// bodyparam.indexOf(z); -// bodyparam.indexOf(y); -// while (bodyparam.contains(z)) { -// p = bodyparam.substring(bodyparam.indexOf(z), bodyparam.indexOf(y) + 2).replace(z, "\"").replace(y, "\"").replace("\",\"", ","); -// bodyparam = bodyparam.substring(0, bodyparam.indexOf(z)) + p + bodyparam.substring(bodyparam.indexOf(y) + 2, bodyparam.length()); -// } -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// User user = new User(); -// //获取用于更新的参数 -// user = createUpdateUser(reqmap); -// //获取用于更新的唯一标识 -// user.setUserId(Long.valueOf(String.valueOf(reqmap.get("bimUid")))); -// //更新用户 -// userService.updateBbcUser(user); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "账号更新失败,请检查连接器配置的参数"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// -// @ApiOperation("删除用户") -// @ApiImplicitParam(name = "json", value = "删除用户信息", dataType = "String") -// @PostMapping("/UserDeleteService") -// @ResponseBody -// public String userDeleteService(@RequestBody String json) throws ServletException, IOException { -// -// Map schema = new HashMap(); -// -// JSONObject jsonObject = new JSONObject(); -// -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// //验证签名 -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// //调用删除方法 -// int n = userService.deleteUserById(Long.valueOf(String.valueOf(reqmap.get("bimUid")))); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "账号删除失败"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// -// @ApiOperation("获取用户id") -// @ApiImplicitParam(name = "json", value = "获取用户id", dataType = "String") -// @PostMapping("/QueryAllUserIdsService") -// @ResponseBody -// public String Idlist(@RequestBody String json) { -// JSONObject jsonObject = new JSONObject(); -// -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// //验证签名 -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// try { -// //获取所有用户id -// List list = userService.selectUserIdList(); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("userIdList", list); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } catch (Exception e) { -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// -// @ApiOperation("通过用户id获取信息") -// @ApiImplicitParam(name = "json", value = "用户ID相关信息", dataType = "String") -// @PostMapping("/QueryUserByIdService") -// @ResponseBody -// public String IdUserlist(@RequestBody String json) { -// JSONObject jsonObject = new JSONObject(); -// -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// try { -// //获取用户信息 -// User userAll = userService.selectUserByIdq(Long.valueOf((String) reqmap.get("bimUid"))); -// //获取用户所担任的角色 -// List roles = roleService.selectRoleId(Long.valueOf((String) reqmap.get("bimUid"))); -// //获取用户所在的岗位 -// List posts = postService.selectPostId(Long.valueOf((String) reqmap.get("bimUid"))); -// //用于将对象的属性改为仅需要的对象 -// DeptGai deptGai = new DeptGai(); -// UserZhuan userZhuan = deptGai.zhuanHuan(userAll, roles, posts); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("account", userZhuan); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } catch (Exception e) { -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// -// @ApiOperation("创建机构信息") -// @ApiImplicitParam(name = "json", value = "创建机构信息", dataType = "String") -// @PostMapping("/OrgCreateService") -// @ResponseBody -// public String OrgCreate(@RequestBody String json) { -// Map schema = new HashMap(); -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// //机构的属性填值 -// Dept dept = createUpdateOrg(reqmap); -// deptService.insertBbcDept(dept); -// String uid = dept.getDeptId() + ""; -// if (uid != null) { -// schema.put("uid", uid); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "机构创建失败,报错信息自定义"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// -// private Dept createUpdateOrg(Map reqmap) { -// Dept dept = new Dept(); -// if (reqmap.get("dept_id") != null) { -// dept.setDeptId(Long.valueOf(String.valueOf(reqmap.get("dept_id")))); -// } -// if (reqmap.get("__UID__") != null) { -// dept.setDeptId(Long.valueOf(String.valueOf(reqmap.get("__UID__")))); -// } -// if (reqmap.get("parent_id") != null) { -// dept.setParentId(Long.valueOf(String.valueOf(reqmap.get("parent_id")))); -// } -// if (reqmap.get("status") != null) { -// if (Boolean.valueOf(String.valueOf(reqmap.get("status")))) -// dept.setStatus("1"); -// else dept.setStatus("0"); -// } -// if (reqmap.get("__ENABLE__") != null) { -// if (Boolean.valueOf(String.valueOf(reqmap.get("__ENABLE__")))) -// dept.setStatus("0"); -// else dept.setStatus("1"); -// } -// -// if (reqmap.get("dept_name") != null) { -// dept.setDeptName((String) reqmap.get("dept_name")); -// } -// if (reqmap.get("__NAME__") != null) { -// dept.setDeptName((String) reqmap.get("__NAME__")); -// } -// return dept; -// } -// -// @ApiOperation("修改机构信息") -// @ApiImplicitParam(name = "json", value = "修改机构信息", dataType = "String") -// @PostMapping("/OrgUpdateService") -// @ResponseBody -// public String orgUpdateService(@RequestBody String json) throws ServletException, IOException { -// Map schema = new HashMap(); -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// Dept dept = new Dept(); -// dept = createUpdateOrg(reqmap); -// dept.setDeptId(Long.valueOf(String.valueOf(reqmap.get("bimOrgId")))); -// deptService.updateBbcDept(dept); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "机构更新失败,报错信息自定义"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// -// @ApiOperation("删除机构信息") -// @ApiImplicitParam(name = "json", value = "删除机构信息", dataType = "String") -// @PostMapping("/OrgDeleteService") -// @ResponseBody -// public String orgDeleteService(@RequestBody String json) throws ServletException, IOException { -// Map schema = new HashMap(); -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// int n = deptService.deleteDeptById(Long.valueOf(String.valueOf(reqmap.get("bimOrgId")))); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "机构删除失败,报错信息自定义"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// -// } -// -// @ApiOperation("获取机构id") -// @ApiImplicitParam(name = "json", value = "获取机构id", dataType = "String") -// @PostMapping("/QueryAllOrgIdsService") -// @ResponseBody -// public String QueryAllOrgIds(@RequestBody String json) { -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// try { -// -// List list = deptService.selectDeptIdList(new Dept()); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("orgIdList", list); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } catch (Exception e) { -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// -// @ApiOperation("通过机构id获取信息") -// @ApiImplicitParam(name = "json", value = "机构ID等相关信息", dataType = "String") -// @PostMapping("/QueryOrgByIdService") -// @ResponseBody -// public String IdDeptlist(@RequestBody String json) { -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// //验证签名 -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// try { -// Dept deptAll = deptService.selectDeptById(Long.valueOf((String) reqmap.get("bimOrgId"))); -// DeptGai deptGai = new DeptGai(); -// DeptZhuan deptZhuan = deptGai.zhuanHuan(deptAll); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("organization", deptZhuan); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } catch (Exception e) { -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取机构信息失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "回收机构失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// -// @ApiOperation("创建角色信息") -// @ApiImplicitParam(name = "json", value = "创建角色信息", dataType = "String") -// @PostMapping("/RoleCreateService") -// @ResponseBody -// public String RoleCreateService(@RequestBody String json) { -// Map schema = new HashMap(); -// JSONObject jsonObject = new JSONObject(); -// -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// Role role = createUpdateRole(reqmap); -// if (reqmap.get("roleSort") != null) { -// role.setRoleSort((String) reqmap.get("roleSort")); -// } -// if (reqmap.get("roleSort") == null || "".equals((String) reqmap.get("roleSort"))) { -// role.setRoleSort("1"); -// } -// if (reqmap.get("status") == null && reqmap.get("__ENABLE__") == null) { -// role.setStatus("0"); -// } -// roleService.insertBbcRole(role); -// String uid = role.getRoleId().toString(); -// if (uid != null) { -// schema.put("uid", uid); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "角色创建失败,报错信息自定义"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// -// private Role createUpdateRole(Map reqmap) { -// Role role = new Role(); -// if (reqmap.get("bimRid") != null) { -// role.setRoleId(Long.valueOf(String.valueOf(reqmap.get("bimRid")))); -// } -// if (reqmap.get("roleId") != null) { -// role.setRoleId(Long.valueOf(String.valueOf(reqmap.get("roleId")))); -// } -// if (reqmap.get("__UID__") != null) { -// role.setRoleId(Long.valueOf(String.valueOf(reqmap.get("roleId")))); -// } -// if (reqmap.get("__NAME__") != null) { -// role.setRoleName((String) reqmap.get("__NAME__")); -// } -// if (reqmap.get("roleName") != null) { -// role.setRoleName((String) reqmap.get("roleName")); -// } -// if (reqmap.get("dataScope") != null) { -// role.setDataScope((String) reqmap.get("dataScope")); -// } -// if (reqmap.get("roleKey") != null) { -// role.setRoleKey((String) reqmap.get("roleKey")); -// } -// if (reqmap.get("status") != null) { -// if (Boolean.valueOf(String.valueOf(reqmap.get("status")))) -// role.setStatus("1"); -// else role.setStatus("0"); -// } -// if (reqmap.get("__ENABLE__") != null) { -// if (Boolean.valueOf(String.valueOf(reqmap.get("__ENABLE__")))) -// role.setStatus("0"); -// else role.setStatus("1"); -// } -// return role; -// } -// -// @ApiOperation("修改角色信息") -// @ApiImplicitParam(name = "json", value = "修改角色信息", dataType = "String") -// @PostMapping("/RoleUpdateService") -// @ResponseBody -// public String RoleUpdateService(@RequestBody String json) throws ServletException, IOException { -// Map schema = new HashMap(); -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// Role role = createUpdateRole(reqmap); -// roleService.updateBbcRole(role); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "角色更新失败,报错信息自定义"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// -// -// @ApiOperation("删除角色信息") -// @ApiImplicitParam(name = "json", value = "删除角色信息", dataType = "String") -// @PostMapping("/RoleDeleteService") -// @ResponseBody -// public String RoleDeleteService(@RequestBody String json) throws ServletException, IOException { -// Map schema = new HashMap(); -// JSONObject jsonObject = new JSONObject(); -// -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// boolean n = roleService.deleteRoleById(Long.valueOf(String.valueOf(reqmap.get("bimRid")))); -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "0"); -// schema.put("message", "success"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// schema.put("bimRequestId", reqmap.get("bimRequestId")); -// schema.put("resultCode", "500"); -// schema.put("message", "机构删除失败,报错信息自定义"); -// String mapJson = JSON.toJSONString(schema); -// logger.info("response----->" + schema); -// return mapJson; -// } -// -// @ApiOperation("获取角色id") -// @ApiImplicitParam(name = "json", value = "获取角色id", dataType = "String") -// @PostMapping("/QueryAllRoleIdsService") -// @ResponseBody -// public String QueryAllRoleIdsService(@RequestBody String json) { -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// try { -// -// List list = roleService.selectRoleIdList(new Role()); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("roleIdList", list); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } catch (Exception e) { -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// -// @ApiOperation("通过角色id获取信息") -// @ApiImplicitParam(name = "json", value = "获取角色id", dataType = "String") -// @PostMapping("/QueryRoleByIdService") -// @ResponseBody -// public String QueryRoleByIdService(@RequestBody String json) { -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// try { -// Role roleAll = roleService.selectRoleById(Long.valueOf((String) reqmap.get("bimRid"))); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("role", roleAll); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } catch (Exception e) { -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取角色信息失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "回收角色失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// -// @ApiOperation("获取资源id") -// @ApiImplicitParam(name = "json", value = "获取资源id", dataType = "String") -// @PostMapping("/QueryAllResourceIdsService") -// @ResponseBody -// public String QueryAllResourceIdsService(@RequestBody String json) { -// JSONObject jsonObject = new JSONObject(); -// String bodyparam = json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// String resourceType = (String) reqmap.get("resourceType"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// try { -// if ("post".equals(resourceType)) { -// List list = postService.selectPostIdList(new Post()); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("resourceIdList", list); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// if ("dict".equals(resourceType)) { -// DictData dictData = new DictData(); -// dictData.setDictType("sys_user_sex"); -// List list = dictDataService.selectDictDataIdList(dictData); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("resourceIdList", list); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } catch (Exception e) { -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取id失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// -// @ApiOperation("通过资源id获取信息") -// @ApiImplicitParam(name = "json", value = "资源id等相关信息", dataType = "String") -// @PostMapping("/QueryResourceByIdService") -// @ResponseBody -// public String QueryResourceByIdService(@RequestBody String json) { -// JSONObject jsonObject = new JSONObject(); -// String bodyparam =json; -// -// logger.info("json--param-->" + bodyparam); -// Map reqmap = (Map) JSON.parse(bodyparam); -// String username = (String) reqmap.get("bimRemoteUser"); -// String password = (String) reqmap.get("bimRemotePwd"); -// //根据resourceType的值进行资源类的判断如下面dict和post两个对象类 -// String resourceType = (String) reqmap.get("resourceType"); -// if (BamboocloudUtils.checkUsernamePassword(username, password)) { -// try { -// if ("post".equals(resourceType)) { -// Post postAll = postService.selectPostById(Long.valueOf((String) reqmap.get("resourceId"))); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("resource", postAll); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// if ("dict".equals(resourceType)) { -// DictData dictDataAll = dictDataService.selectDictDataById(Long.valueOf((String) reqmap.get("resourceId"))); -// jsonObject.put("resultCode", "0"); -// jsonObject.put("message", "success"); -// jsonObject.put("resource", dictDataAll); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } catch (Exception e) { -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "获取资源信息失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// } -// jsonObject.put("resultCode", "505"); -// jsonObject.put("message", "回收资源失败"); -// jsonObject.put("bimRequestId", reqmap.get("bimRequestId")); -// String mapJson = JSON.toJSONString(jsonObject); -// logger.info("response----->" + jsonObject); -// return mapJson; -// } -// -// -// public StringBuilder stringBuilder(HttpServletRequest req) { -// BufferedReader br = null; -// StringBuilder sb = new StringBuilder(); -// String str = ""; -// try { -// br = req.getReader(); -// while ((str = br.readLine()) != null) { -// sb.append(str); -// } -// br.close(); -// } catch (IOException e) { -// e.printStackTrace(); -// if (br != null) { -// try { -// br.close(); -// } catch (IOException eo) { -// eo.printStackTrace(); -// } -// } -// } finally { -// if (br != null) { -// try { -// br.close(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// } -// } -// return sb; -// } -// -//} -// -//