异常封装之功能信息后台修改
This commit is contained in:
@@ -41,7 +41,7 @@ public class FunctionsController {
|
|||||||
@PostMapping(value = "/findMenu")
|
@PostMapping(value = "/findMenu")
|
||||||
public JSONArray findMenu(@RequestParam(value="pNumber") String pNumber,
|
public JSONArray findMenu(@RequestParam(value="pNumber") String pNumber,
|
||||||
@RequestParam(value="hasFunctions") String hasFunctions,
|
@RequestParam(value="hasFunctions") String hasFunctions,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request)throws Exception {
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
try {
|
try {
|
||||||
@@ -124,7 +124,7 @@ public class FunctionsController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping(value = "/findRoleFunctions")
|
@PostMapping(value = "/findRoleFunctions")
|
||||||
public JSONArray findRoleFunctions(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
public JSONArray findRoleFunctions(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request)throws Exception {
|
||||||
JSONArray arr = new JSONArray();
|
JSONArray arr = new JSONArray();
|
||||||
try {
|
try {
|
||||||
List<Functions> dataListFun = functionsService.findRoleFunctions("0");
|
List<Functions> dataListFun = functionsService.findRoleFunctions("0");
|
||||||
@@ -277,7 +277,7 @@ public class FunctionsController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping(value = "/findByIds")
|
@GetMapping(value = "/findByIds")
|
||||||
public BaseResponseInfo findByIds(@RequestParam("functionsIds") String functionsIds,
|
public BaseResponseInfo findByIds(@RequestParam("functionsIds") String functionsIds,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request)throws Exception {
|
||||||
BaseResponseInfo res = new BaseResponseInfo();
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
try {
|
try {
|
||||||
List<Functions> dataList = functionsService.findByIds(functionsIds);
|
List<Functions> dataList = functionsService.findByIds(functionsIds);
|
||||||
|
|||||||
@@ -35,6 +35,14 @@ public class GlobalExceptionHandler {
|
|||||||
status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, ExceptionConstants.SERVICE_SYSTEM_ERROR_CODE);
|
status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, ExceptionConstants.SERVICE_SYSTEM_ERROR_CODE);
|
||||||
status.put(ExceptionConstants.GLOBAL_RETURNS_MESSAGE, ExceptionConstants.SERVICE_SYSTEM_ERROR_MSG);
|
status.put(ExceptionConstants.GLOBAL_RETURNS_MESSAGE, ExceptionConstants.SERVICE_SYSTEM_ERROR_MSG);
|
||||||
log.error("Global Exception Occured => url : {}, msg : {}", request.getRequestURL(), e.getMessage());
|
log.error("Global Exception Occured => url : {}, msg : {}", request.getRequestURL(), e.getMessage());
|
||||||
|
/**
|
||||||
|
* create by: qiankunpingtai
|
||||||
|
* create time: 2019/4/18 17:41
|
||||||
|
* website:https://qiankunpingtai.cn
|
||||||
|
* description:
|
||||||
|
* 这里输出完整的堆栈信息,否则有些异常完全不知道哪里出错了。
|
||||||
|
*/
|
||||||
|
log.error("Global Exception Occured => url : {}", request.getRequestURL(), e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,16 @@ public class FunctionsComponent implements ICommonQuery {
|
|||||||
private FunctionsService functionsService;
|
private FunctionsService functionsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object selectOne(String condition) {
|
public Object selectOne(String condition)throws Exception {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<?> select(Map<String, String> map) {
|
public List<?> select(Map<String, String> map)throws Exception {
|
||||||
return getFunctionsList(map);
|
return getFunctionsList(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<?> getFunctionsList(Map<String, String> map) {
|
private List<?> getFunctionsList(Map<String, String> map) throws Exception{
|
||||||
String search = map.get(Constants.SEARCH);
|
String search = map.get(Constants.SEARCH);
|
||||||
String name = StringUtil.getInfo(search, "name");
|
String name = StringUtil.getInfo(search, "name");
|
||||||
String type = StringUtil.getInfo(search, "type");
|
String type = StringUtil.getInfo(search, "type");
|
||||||
@@ -39,7 +39,7 @@ public class FunctionsComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long counts(Map<String, String> map) {
|
public Long counts(Map<String, String> map) throws Exception{
|
||||||
String search = map.get(Constants.SEARCH);
|
String search = map.get(Constants.SEARCH);
|
||||||
String name = StringUtil.getInfo(search, "name");
|
String name = StringUtil.getInfo(search, "name");
|
||||||
String type = StringUtil.getInfo(search, "type");
|
String type = StringUtil.getInfo(search, "type");
|
||||||
@@ -47,27 +47,27 @@ public class FunctionsComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insert(String beanJson, HttpServletRequest request) {
|
public int insert(String beanJson, HttpServletRequest request)throws Exception {
|
||||||
return functionsService.insertFunctions(beanJson, request);
|
return functionsService.insertFunctions(beanJson, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id) {
|
public int update(String beanJson, Long id)throws Exception {
|
||||||
return functionsService.updateFunctions(beanJson, id);
|
return functionsService.updateFunctions(beanJson, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id) {
|
public int delete(Long id)throws Exception {
|
||||||
return functionsService.deleteFunctions(id);
|
return functionsService.deleteFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids) {
|
public int batchDelete(String ids)throws Exception {
|
||||||
return functionsService.batchDeleteFunctions(ids);
|
return functionsService.batchDeleteFunctions(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int checkIsNameExist(Long id, String name) {
|
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||||
return functionsService.checkIsNameExist(id, name);
|
return functionsService.checkIsNameExist(id, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,14 @@ package com.jsh.erp.service.functions;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jsh.erp.constants.BusinessConstants;
|
import com.jsh.erp.constants.BusinessConstants;
|
||||||
|
import com.jsh.erp.constants.ExceptionConstants;
|
||||||
|
import com.jsh.erp.datasource.entities.DepotItem;
|
||||||
import com.jsh.erp.datasource.entities.Functions;
|
import com.jsh.erp.datasource.entities.Functions;
|
||||||
import com.jsh.erp.datasource.entities.FunctionsExample;
|
import com.jsh.erp.datasource.entities.FunctionsExample;
|
||||||
import com.jsh.erp.datasource.entities.User;
|
import com.jsh.erp.datasource.entities.User;
|
||||||
import com.jsh.erp.datasource.mappers.FunctionsMapper;
|
import com.jsh.erp.datasource.mappers.FunctionsMapper;
|
||||||
import com.jsh.erp.datasource.mappers.FunctionsMapperEx;
|
import com.jsh.erp.datasource.mappers.FunctionsMapperEx;
|
||||||
|
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||||
import com.jsh.erp.service.log.LogService;
|
import com.jsh.erp.service.log.LogService;
|
||||||
import com.jsh.erp.service.user.UserService;
|
import com.jsh.erp.service.user.UserService;
|
||||||
import com.jsh.erp.utils.StringUtil;
|
import com.jsh.erp.utils.StringUtil;
|
||||||
@@ -36,92 +39,205 @@ public class FunctionsService {
|
|||||||
@Resource
|
@Resource
|
||||||
private LogService logService;
|
private LogService logService;
|
||||||
|
|
||||||
public Functions getFunctions(long id) {
|
public Functions getFunctions(long id)throws Exception {
|
||||||
return functionsMapper.selectByPrimaryKey(id);
|
Functions result=null;
|
||||||
|
try{
|
||||||
|
result=functionsMapper.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<Functions> getFunctions() {
|
public List<Functions> getFunctions()throws Exception {
|
||||||
FunctionsExample example = new FunctionsExample();
|
FunctionsExample example = new FunctionsExample();
|
||||||
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
return functionsMapper.selectByExample(example);
|
List<Functions> list=null;
|
||||||
|
try{
|
||||||
|
list=functionsMapper.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<Functions> select(String name, String type, int offset, int rows) {
|
public List<Functions> select(String name, String type, int offset, int rows)throws Exception {
|
||||||
return functionsMapperEx.selectByConditionFunctions(name, type, offset, rows);
|
List<Functions> list=null;
|
||||||
|
try{
|
||||||
|
list=functionsMapperEx.selectByConditionFunctions(name, type, 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 countFunctions(String name, String type) {
|
public Long countFunctions(String name, String type)throws Exception {
|
||||||
return functionsMapperEx.countsByFunctions(name, type);
|
Long result=null;
|
||||||
|
try{
|
||||||
|
result=functionsMapperEx.countsByFunctions(name, type);
|
||||||
|
}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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int insertFunctions(String beanJson, HttpServletRequest request) {
|
public int insertFunctions(String beanJson, HttpServletRequest request)throws Exception {
|
||||||
Functions depot = JSONObject.parseObject(beanJson, Functions.class);
|
Functions depot = JSONObject.parseObject(beanJson, Functions.class);
|
||||||
return functionsMapper.insertSelective(depot);
|
int result=0;
|
||||||
|
try{
|
||||||
|
result=functionsMapper.insertSelective(depot);
|
||||||
|
}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)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateFunctions(String beanJson, Long id) {
|
public int updateFunctions(String beanJson, Long id) throws Exception{
|
||||||
Functions depot = JSONObject.parseObject(beanJson, Functions.class);
|
Functions depot = JSONObject.parseObject(beanJson, Functions.class);
|
||||||
depot.setId(id);
|
depot.setId(id);
|
||||||
return functionsMapper.updateByPrimaryKeySelective(depot);
|
int result=0;
|
||||||
|
try{
|
||||||
|
result=functionsMapper.updateByPrimaryKeySelective(depot);
|
||||||
|
}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)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteFunctions(Long id) {
|
public int deleteFunctions(Long id)throws Exception {
|
||||||
return functionsMapper.deleteByPrimaryKey(id);
|
int result=0;
|
||||||
|
try{
|
||||||
|
result=functionsMapper.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)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteFunctions(String ids) {
|
public int batchDeleteFunctions(String ids)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
FunctionsExample example = new FunctionsExample();
|
FunctionsExample example = new FunctionsExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
return functionsMapper.deleteByExample(example);
|
int result=0;
|
||||||
|
try{
|
||||||
|
result=functionsMapper.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 checkIsNameExist(Long id, String name) {
|
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||||
FunctionsExample example = new FunctionsExample();
|
FunctionsExample example = new FunctionsExample();
|
||||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
List<Functions> list = functionsMapper.selectByExample(example);
|
List<Functions> list=null;
|
||||||
return list.size();
|
try{
|
||||||
|
list = functionsMapper.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();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Functions> getRoleFunctions(String pNumber) {
|
public List<Functions> getRoleFunctions(String pNumber)throws Exception {
|
||||||
FunctionsExample example = new FunctionsExample();
|
FunctionsExample example = new FunctionsExample();
|
||||||
example.createCriteria().andEnabledEqualTo(true).andPnumberEqualTo(pNumber)
|
example.createCriteria().andEnabledEqualTo(true).andPnumberEqualTo(pNumber)
|
||||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
example.setOrderByClause("Sort");
|
example.setOrderByClause("Sort");
|
||||||
List<Functions> list = functionsMapper.selectByExample(example);
|
List<Functions> list=null;
|
||||||
|
try{
|
||||||
|
list = functionsMapper.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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Functions> findRoleFunctions(String pnumber){
|
public List<Functions> findRoleFunctions(String pnumber)throws Exception{
|
||||||
FunctionsExample example = new FunctionsExample();
|
FunctionsExample example = new FunctionsExample();
|
||||||
example.createCriteria().andEnabledEqualTo(true).andPnumberEqualTo(pnumber)
|
example.createCriteria().andEnabledEqualTo(true).andPnumberEqualTo(pnumber)
|
||||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
example.setOrderByClause("Sort");
|
example.setOrderByClause("Sort");
|
||||||
List<Functions> list = functionsMapper.selectByExample(example);
|
List<Functions> list=null;
|
||||||
|
try{
|
||||||
|
list =functionsMapper.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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Functions> findByIds(String functionsIds){
|
public List<Functions> findByIds(String functionsIds)throws Exception{
|
||||||
List<Long> idList = StringUtil.strToLongList(functionsIds);
|
List<Long> idList = StringUtil.strToLongList(functionsIds);
|
||||||
FunctionsExample example = new FunctionsExample();
|
FunctionsExample example = new FunctionsExample();
|
||||||
example.createCriteria().andEnabledEqualTo(true).andIdIn(idList)
|
example.createCriteria().andEnabledEqualTo(true).andIdIn(idList)
|
||||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
example.setOrderByClause("Sort asc");
|
example.setOrderByClause("Sort asc");
|
||||||
List<Functions> list = functionsMapper.selectByExample(example);
|
List<Functions> list=null;
|
||||||
|
try{
|
||||||
|
list =functionsMapper.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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteFunctionsByIds(String ids) {
|
public int batchDeleteFunctionsByIds(String ids)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_FUNCTIONS,
|
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_FUNCTIONS,
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
User userInfo=userService.getCurrentUser();
|
User userInfo=userService.getCurrentUser();
|
||||||
String [] idArray=ids.split(",");
|
String [] idArray=ids.split(",");
|
||||||
return functionsMapperEx.batchDeleteFunctionsByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
int result=0;
|
||||||
|
try{
|
||||||
|
result =functionsMapperEx.batchDeleteFunctionsByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||||
|
}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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user