From bcc3ae4e8d01e5eaca00112f729fc08f974eb15f Mon Sep 17 00:00:00 2001 From: qiankunpingtai Date: Fri, 19 Apr 2019 15:21:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=B0=81=E8=A3=85=E4=B9=8B?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=90=8E=E5=8F=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsh/erp/controller/UserController.java | 12 +- .../jsh/erp/service/user/UserComponent.java | 18 +- .../com/jsh/erp/service/user/UserService.java | 283 +++++++++++++++--- 3 files changed, 251 insertions(+), 62 deletions(-) diff --git a/src/main/java/com/jsh/erp/controller/UserController.java b/src/main/java/com/jsh/erp/controller/UserController.java index a0e9a03f..0699139f 100644 --- a/src/main/java/com/jsh/erp/controller/UserController.java +++ b/src/main/java/com/jsh/erp/controller/UserController.java @@ -59,7 +59,7 @@ public class UserController { @PostMapping(value = "/login") public BaseResponseInfo login(@RequestParam(value = "loginame", required = false) String loginame, @RequestParam(value = "password", required = false) String password, - HttpServletRequest request) { + HttpServletRequest request)throws Exception { logger.info("============用户登录 login 方法调用开始=============="); String msgTip = ""; User user=null; @@ -150,7 +150,7 @@ public class UserController { } @GetMapping(value = "/getUserSession") - public BaseResponseInfo getSessionUser(HttpServletRequest request) { + public BaseResponseInfo getSessionUser(HttpServletRequest request)throws Exception { BaseResponseInfo res = new BaseResponseInfo(); try { Map data = new HashMap(); @@ -171,7 +171,7 @@ public class UserController { } @GetMapping(value = "/logout") - public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse response) { + public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse response)throws Exception { BaseResponseInfo res = new BaseResponseInfo(); try { request.getSession().removeAttribute("user"); @@ -206,7 +206,7 @@ public class UserController { @PostMapping(value = "/updatePwd") public String updatePwd(@RequestParam("userId") Long userId, @RequestParam("password") String password, - @RequestParam("oldpwd") String oldpwd, HttpServletRequest request) { + @RequestParam("oldpwd") String oldpwd, HttpServletRequest request)throws Exception { Integer flag = 0; Map objectMap = new HashMap(); try { @@ -242,7 +242,7 @@ public class UserController { * @return */ @GetMapping(value = "/getAllList") - public BaseResponseInfo getAllList(HttpServletRequest request) { + public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception { BaseResponseInfo res = new BaseResponseInfo(); try { Map data = new HashMap(); @@ -425,7 +425,7 @@ public class UserController { } @GetMapping("/getTenantStatus") - public BaseResponseInfo getTenantStatus(HttpServletRequest request) { + public BaseResponseInfo getTenantStatus(HttpServletRequest request)throws Exception { BaseResponseInfo res = new BaseResponseInfo(); try { Map data = new HashMap(); diff --git a/src/main/java/com/jsh/erp/service/user/UserComponent.java b/src/main/java/com/jsh/erp/service/user/UserComponent.java index 7a4b3b73..3a7bc58d 100644 --- a/src/main/java/com/jsh/erp/service/user/UserComponent.java +++ b/src/main/java/com/jsh/erp/service/user/UserComponent.java @@ -18,16 +18,16 @@ public class UserComponent implements ICommonQuery { private UserService userService; @Override - public Object selectOne(String condition) { + public Object selectOne(String condition)throws Exception { return null; } @Override - public List select(Map map) { + public List select(Map map)throws Exception { return getUserList(map); } - private List getUserList(Map map) { + private List getUserList(Map map)throws Exception { String search = map.get(Constants.SEARCH); String userName = StringUtil.getInfo(search, "userName"); String loginName = StringUtil.getInfo(search, "loginName"); @@ -37,7 +37,7 @@ public class UserComponent implements ICommonQuery { } @Override - public Long counts(Map map) { + public Long counts(Map map)throws Exception { String search = map.get(Constants.SEARCH); String userName = StringUtil.getInfo(search, "userName"); String loginName = StringUtil.getInfo(search, "loginName"); @@ -45,27 +45,27 @@ public class UserComponent implements ICommonQuery { } @Override - public int insert(String beanJson, HttpServletRequest request) { + public int insert(String beanJson, HttpServletRequest request)throws Exception { return userService.insertUser(beanJson, request); } @Override - public int update(String beanJson, Long id) { + public int update(String beanJson, Long id)throws Exception { return userService.updateUser(beanJson, id); } @Override - public int delete(Long id) { + public int delete(Long id)throws Exception { return userService.deleteUser(id); } @Override - public int batchDelete(String ids) { + public int batchDelete(String ids)throws Exception { return userService.batchDeleteUser(ids); } @Override - public int checkIsNameExist(Long id, String name) { + public int checkIsNameExist(Long id, String name)throws Exception { return userService.checkIsNameExist(id, name); } diff --git a/src/main/java/com/jsh/erp/service/user/UserService.java b/src/main/java/com/jsh/erp/service/user/UserService.java index 031109ed..57aa07a9 100644 --- a/src/main/java/com/jsh/erp/service/user/UserService.java +++ b/src/main/java/com/jsh/erp/service/user/UserService.java @@ -11,16 +11,17 @@ import com.jsh.erp.datasource.entities.UserEx; import com.jsh.erp.datasource.entities.UserExample; import com.jsh.erp.datasource.mappers.UserMapper; import com.jsh.erp.datasource.mappers.UserMapperEx; -import com.jsh.erp.datasource.vo.TreeNode; import com.jsh.erp.datasource.vo.TreeNodeEx; import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.orgaUserRel.OrgaUserRelService; import com.jsh.erp.service.userBusiness.UserBusinessService; -import com.jsh.erp.utils.*; +import com.jsh.erp.utils.ExceptionCodeConstants; +import com.jsh.erp.utils.JshException; +import com.jsh.erp.utils.StringUtil; +import com.jsh.erp.utils.Tools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.context.request.RequestContextHolder; @@ -28,9 +29,11 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.net.URLEncoder; import java.security.NoSuchAlgorithmException; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; @Service public class UserService { @@ -51,21 +54,57 @@ public class UserService { private UserBusinessService userBusinessService; - public User getUser(long id) { - return userMapper.selectByPrimaryKey(id); + public User getUser(long id)throws Exception { + User result=null; + try{ + result=userMapper.selectByPrimaryKey(id); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; } - public List getUser() { + public List getUser()throws Exception { UserExample example = new UserExample(); - return userMapper.selectByExample(example); + List list=null; + try{ + list=userMapper.selectByExample(example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; } - public List select(String userName, String loginName, int offset, int rows) { - return userMapperEx.selectByConditionUser(userName, loginName, offset, rows); + public List select(String userName, String loginName, int offset, int rows)throws Exception { + List list=null; + try{ + list=userMapperEx.selectByConditionUser(userName, loginName, offset, rows); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; } - public Long countUser(String userName, String loginName) { - return userMapperEx.countsByUser(userName, loginName); + public Long countUser(String userName, String loginName)throws Exception { + Long result=null; + try{ + result=userMapperEx.countsByUser(userName, loginName); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; } /** * create by: cjl @@ -77,7 +116,7 @@ public class UserService { * @return int */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int insertUser(String beanJson, HttpServletRequest request) { + public int insertUser(String beanJson, HttpServletRequest request)throws Exception { User user = JSONObject.parseObject(beanJson, User.class); String password = "123456"; //因密码用MD5加密,需要对密码进行转化 @@ -88,7 +127,16 @@ public class UserService { e.printStackTrace(); logger.error(">>>>>>>>>>>>>>转化MD5字符串错误 :" + e.getMessage()); } - return userMapper.insertSelective(user); + int result=0; + try{ + result=userMapper.insertSelective(user); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; } /** * create by: cjl @@ -100,10 +148,19 @@ public class UserService { * @return int */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int updateUser(String beanJson, Long id) { + public int updateUser(String beanJson, Long id) throws Exception{ User user = JSONObject.parseObject(beanJson, User.class); user.setId(id); - return userMapper.updateByPrimaryKeySelective(user); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; } /** * create by: cjl @@ -118,7 +175,16 @@ public class UserService { logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER, new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - return userMapper.updateByPrimaryKeySelective(user); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; } /** * create by: cjl @@ -137,20 +203,47 @@ public class UserService { User user = new User(); user.setId(id); user.setPassword(md5Pwd); - return userMapper.updateByPrimaryKeySelective(user); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; } @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int deleteUser(Long id) { - return userMapper.deleteByPrimaryKey(id); + public int deleteUser(Long id)throws Exception { + int result=0; + try{ + result= userMapper.deleteByPrimaryKey(id); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; } @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int batchDeleteUser(String ids) { + public int batchDeleteUser(String ids)throws Exception { List idList = StringUtil.strToLongList(ids); UserExample example = new UserExample(); example.createCriteria().andIdIn(idList); - return userMapper.deleteByExample(example); + int result=0; + try{ + result= userMapper.deleteByExample(example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; } public int validateUser(String username, String password) throws JshException { @@ -162,6 +255,8 @@ public class UserService { example.createCriteria().andLoginameEqualTo(username); list = userMapper.selectByExample(example); } catch (Exception e) { + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); logger.error(">>>>>>>>访问验证用户姓名是否存在后台信息异常", e); return ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION; } @@ -188,22 +283,41 @@ public class UserService { } } - public User getUserByUserName(String username) { + public User getUserByUserName(String username)throws Exception { UserExample example = new UserExample(); example.createCriteria().andLoginameEqualTo(username); - List list = userMapper.selectByExample(example); - User user = list.get(0); + List list=null; + try{ + list= userMapper.selectByExample(example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + User user =null; + if(list!=null&&list.size()>0){ + user = list.get(0); + } return user; } - public int checkIsNameExist(Long id, String name) { + public int checkIsNameExist(Long id, String name)throws Exception { UserExample example = new UserExample(); List userStatus=new ArrayList(); userStatus.add(BusinessConstants.USER_STATUS_DELETE); userStatus.add(BusinessConstants.USER_STATUS_BANNED); example.createCriteria().andIdNotEqualTo(id).andLoginameEqualTo(name).andStatusNotIn(userStatus); - List list = userMapper.selectByExample(example); - return list.size(); + List list=null; + try{ + list= userMapper.selectByExample(example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list==null?0:list.size(); } /** * create by: cjl @@ -213,13 +327,22 @@ public class UserService { * @Param: * @return com.jsh.erp.datasource.entities.User */ - public User getCurrentUser(){ + public User getCurrentUser()throws Exception{ HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); return (User)request.getSession().getAttribute("user"); } public List getUserList(Map parameterMap) throws Exception{ - return userMapperEx.getUserList(parameterMap); + List list=null; + try{ + list= userMapperEx.getUserList(parameterMap); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; } @Transactional(value = "transactionManager", rollbackFor = Exception.class) public void addUserAndOrgUserRel(UserEx ue) throws Exception{ @@ -277,8 +400,16 @@ public class UserService { ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); } ue.setStatus(BusinessConstants.USER_STATUS_NORMAL); - int i=userMapperEx.addUser(ue); - if(i>0){ + int result=0; + try{ + result= userMapperEx.addUser(ue); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + if(result>0){ return ue; } return null; @@ -303,7 +434,15 @@ public class UserService { ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); } ue.setStatus(BusinessConstants.USER_STATUS_NORMAL); - int i = userMapperEx.addUser(ue); + int result=0; + try{ + result= userMapperEx.addUser(ue); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } //更新租户id User user = new User(); user.setId(ue.getId()); @@ -317,7 +456,7 @@ public class UserService { ubArr.add(manageRoleId); ubObj.put("value", ubArr.toString()); userBusinessService.insertUserBusiness(ubObj.toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - if (i > 0) { + if (result > 0) { return ue; } return null; @@ -328,7 +467,14 @@ public class UserService { public void updateUserTenant(User user) throws Exception{ UserExample example = new UserExample(); example.createCriteria().andIdEqualTo(user.getId()); - userMapper.updateByPrimaryKeySelective(user); + try{ + userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } } @Transactional(value = "transactionManager", rollbackFor = Exception.class) @@ -380,9 +526,17 @@ public class UserService { } } @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public UserEx updateUser(UserEx ue){ - int i=userMapperEx.updateUser(ue); - if(i>0){ + public UserEx updateUser(UserEx ue)throws Exception{ + int result =0; + try{ + result=userMapperEx.updateUser(ue); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + if(result>0){ return ue; } return null; @@ -395,7 +549,7 @@ public class UserService { * @Param: userEx * @return void */ - public void checkUserNameAndLoginName(UserEx userEx){ + public void checkUserNameAndLoginName(UserEx userEx)throws Exception{ List list=null; if(userEx==null){ return; @@ -454,14 +608,32 @@ public class UserService { /** * 通过用户名获取用户列表 * */ - public List getUserListByUserName(String userName){ - return userMapperEx.getUserListByUserNameOrLoginName(userName,null); + public List getUserListByUserName(String userName)throws Exception{ + List list =null; + try{ + list=userMapperEx.getUserListByUserNameOrLoginName(userName,null); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; } /** * 通过登录名获取用户列表 * */ public List getUserListByloginName(String loginName){ - return userMapperEx.getUserListByUserNameOrLoginName(null,loginName); + List list =null; + try{ + list=userMapperEx.getUserListByUserNameOrLoginName(null,loginName); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; } /** * 批量删除用户 @@ -472,8 +644,16 @@ public class UserService { new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); String idsArray[]=ids.split(","); - int i= userMapperEx.batDeleteOrUpdateUser(idsArray,BusinessConstants.USER_STATUS_DELETE); - if(i<1){ + int result =0; + try{ + result=userMapperEx.batDeleteOrUpdateUser(idsArray,BusinessConstants.USER_STATUS_DELETE); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + if(result<1){ logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", ExceptionConstants.USER_DELETE_FAILED_CODE,ExceptionConstants.USER_DELETE_FAILED_MSG,ids); throw new BusinessRunTimeException(ExceptionConstants.USER_DELETE_FAILED_CODE, @@ -481,7 +661,16 @@ public class UserService { } } - public List getOrganizationUserTree() { - return userMapperEx.getNodeTree(); + public List getOrganizationUserTree()throws Exception { + List list =null; + try{ + list=userMapperEx.getNodeTree(); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; } }