diff --git a/laws-modules/lib/bim-codec-1.0.0.jar b/laws-modules-docking/lib/bim-codec-1.0.0.jar similarity index 100% rename from laws-modules/lib/bim-codec-1.0.0.jar rename to laws-modules-docking/lib/bim-codec-1.0.0.jar diff --git a/laws-modules-docking/pom.xml b/laws-modules-docking/pom.xml index 30ad5fb4..1769f211 100644 --- a/laws-modules-docking/pom.xml +++ b/laws-modules-docking/pom.xml @@ -22,6 +22,13 @@ com.jero.boot laws-modules + + com.banboocloud + bim-codec + 1.0.0 + system + ${project.basedir}/lib/bim-codec-1.0.0.jar + \ No newline at end of file diff --git a/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/dto/IamOrgDto.java b/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/dto/IamOrgDto.java new file mode 100644 index 00000000..e38705fa --- /dev/null +++ b/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/dto/IamOrgDto.java @@ -0,0 +1,4 @@ +package com.jero.modules.docking.iam.controller.dto; + +public class IamOrgDto { +} diff --git a/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/dto/IamUserDto.java b/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/dto/IamUserDto.java new file mode 100644 index 00000000..04d8f503 --- /dev/null +++ b/laws-modules-docking/src/main/java/com/jero/modules/docking/iam/controller/dto/IamUserDto.java @@ -0,0 +1,10 @@ +package com.jero.modules.docking.iam.controller.dto; + +import lombok.Data; + +/** + * + */ +@Data +public class IamUserDto { +} diff --git a/laws-modules/pom.xml b/laws-modules/pom.xml index bf707cd3..27d894dc 100644 --- a/laws-modules/pom.xml +++ b/laws-modules/pom.xml @@ -155,13 +155,5 @@ jdk17 ${project.basedir}/lib/aspose-words-21.1-jdk17-cracked.jar - - com.banboocloud - bim-codec - 1.0.0 - system - jdk17 - ${project.basedir}/lib/bim-codec-1.0.0.jar - \ No newline at end of file diff --git a/laws-modules/src/main/java/com/jero/modules/iam/BamboocloudUtils.java b/laws-modules/src/main/java/com/jero/modules/iam/BamboocloudUtils.java index 177d6bcd..c6e83d63 100644 --- a/laws-modules/src/main/java/com/jero/modules/iam/BamboocloudUtils.java +++ b/laws-modules/src/main/java/com/jero/modules/iam/BamboocloudUtils.java @@ -1,84 +1,84 @@ -package com.jero.modules.iam; - -import com.bamboocloud.codec.BamboocloudFacade; -import lombok.extern.slf4j.Slf4j; - -import javax.servlet.http.HttpServletRequest; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.Iterator; -import java.util.Map; -import java.util.TreeMap; -@Slf4j -public class BamboocloudUtils { - public static void main(String[] args) { - String aes = BamboocloudFacade.encrypt("{\"uid\":\"104\",\"bimRequestId\":\"95d73fe7aa7a4930a3edea779708a46c\",\"resultCode\":\"0\",\"message\":\"success\"}", "123456", "AES"); - System.out.println(aes); - String aes1 = getPlaintext("KJ3jbIflWkNiEq3oxE2d5oxtKRLO3CC7edGrq57RIB02RSRgPljiNcTfuWYLS3sc1tbZMLm5fWG2guLK100g9MkWH9NhlxorPSlcP8LaYuP5NeZ1wFP8iKqr5RredwXfDA3J1fjOCAJfzPvJ4HSb1w==", "123456", "AES"); - System.out.println(aes1); - } - public static boolean checkUsernamePassword(String username, String password) { - log.info("username --->" + username + " password --- >" + password + " ----ok"); - if("bbcadmin".equals(username)&&"P@ssw0rd".equals(password)) { - return true; - } - else { - return false; - } - } - - public static String getPlaintext(String ciphertext, String key, String type) { - return BamboocloudFacade.decrypt(ciphertext, key, type); - } - - public static Boolean verify(Map reqmap, String type) { - Map verifymap = new TreeMap(); - StringBuffer sb = new StringBuffer(); - Iterator it = reqmap.keySet().iterator(); - while (it.hasNext()) { - String key = (String) it.next(); - verifymap.put(key, reqmap.get(key)); - } - Iterator ittree = verifymap.keySet().iterator(); - while (ittree.hasNext()) { - String key = (String) ittree.next(); - if (!"signature".equals(key)) { - sb.append(key).append("=").append(verifymap.get(key)).append("&"); - } - } - sb.deleteCharAt(sb.length() - 1); - System.out.println(reqmap.get("signature") + " now " + sb.toString()); - return BamboocloudFacade.verify(reqmap.get("signature").toString(), sb.toString(), type); - } - - public static String getRequestBody(HttpServletRequest request) { - BufferedReader br = null; - StringBuilder sb = new StringBuilder(); - String str = ""; - try { - br = request.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.toString(); - } -} +//package com.jero.modules.iam; +// +//import com.bamboocloud.codec.BamboocloudFacade; +//import lombok.extern.slf4j.Slf4j; +// +//import javax.servlet.http.HttpServletRequest; +//import java.io.BufferedReader; +//import java.io.IOException; +//import java.util.Iterator; +//import java.util.Map; +//import java.util.TreeMap; +//@Slf4j +//public class BamboocloudUtils { +// public static void main(String[] args) { +// String aes = BamboocloudFacade.encrypt("{\"uid\":\"104\",\"bimRequestId\":\"95d73fe7aa7a4930a3edea779708a46c\",\"resultCode\":\"0\",\"message\":\"success\"}", "123456", "AES"); +// System.out.println(aes); +// String aes1 = getPlaintext("KJ3jbIflWkNiEq3oxE2d5oxtKRLO3CC7edGrq57RIB02RSRgPljiNcTfuWYLS3sc1tbZMLm5fWG2guLK100g9MkWH9NhlxorPSlcP8LaYuP5NeZ1wFP8iKqr5RredwXfDA3J1fjOCAJfzPvJ4HSb1w==", "123456", "AES"); +// System.out.println(aes1); +// } +// public static boolean checkUsernamePassword(String username, String password) { +// log.info("username --->" + username + " password --- >" + password + " ----ok"); +// if("bbcadmin".equals(username)&&"P@ssw0rd".equals(password)) { +// return true; +// } +// else { +// return false; +// } +// } +// +// public static String getPlaintext(String ciphertext, String key, String type) { +// return BamboocloudFacade.decrypt(ciphertext, key, type); +// } +// +// public static Boolean verify(Map reqmap, String type) { +// Map verifymap = new TreeMap(); +// StringBuffer sb = new StringBuffer(); +// Iterator it = reqmap.keySet().iterator(); +// while (it.hasNext()) { +// String key = (String) it.next(); +// verifymap.put(key, reqmap.get(key)); +// } +// Iterator ittree = verifymap.keySet().iterator(); +// while (ittree.hasNext()) { +// String key = (String) ittree.next(); +// if (!"signature".equals(key)) { +// sb.append(key).append("=").append(verifymap.get(key)).append("&"); +// } +// } +// sb.deleteCharAt(sb.length() - 1); +// System.out.println(reqmap.get("signature") + " now " + sb.toString()); +// return BamboocloudFacade.verify(reqmap.get("signature").toString(), sb.toString(), type); +// } +// +// public static String getRequestBody(HttpServletRequest request) { +// BufferedReader br = null; +// StringBuilder sb = new StringBuilder(); +// String str = ""; +// try { +// br = request.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.toString(); +// } +//} diff --git a/laws-modules/src/main/java/com/jero/modules/iam/BbcController.java b/laws-modules/src/main/java/com/jero/modules/iam/BbcController.java index ac0bef32..53130408 100644 --- a/laws-modules/src/main/java/com/jero/modules/iam/BbcController.java +++ b/laws-modules/src/main/java/com/jero/modules/iam/BbcController.java @@ -1,1128 +1,1128 @@ -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; -// } -//} +//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; +//// } +////}