异常封装之账户信息后台修改
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
package com.jsh.erp.service;
|
||||
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.Log;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.LogMapper;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -12,12 +9,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.Tools.getLocalIp;
|
||||
|
||||
/**
|
||||
* @author jishenghua 752718920 2018-10-7 15:25:58
|
||||
*/
|
||||
@@ -36,7 +30,7 @@ public class CommonQueryManager {
|
||||
* @param apiName 接口名称
|
||||
* @param id ID
|
||||
*/
|
||||
public Object selectOne(String apiName, String id) {
|
||||
public Object selectOne(String apiName, String id) throws Exception{
|
||||
if (StringUtil.isNotEmpty(apiName) && StringUtil.isNotEmpty(id)) {
|
||||
return container.getCommonQuery(apiName).selectOne(id);
|
||||
}
|
||||
@@ -49,7 +43,7 @@ public class CommonQueryManager {
|
||||
* @param parameterMap
|
||||
* @return
|
||||
*/
|
||||
public List<?> select(String apiName, Map<String, String> parameterMap) {
|
||||
public List<?> select(String apiName, Map<String, String> parameterMap)throws Exception {
|
||||
if (StringUtil.isNotEmpty(apiName)) {
|
||||
return container.getCommonQuery(apiName).select(parameterMap);
|
||||
}
|
||||
@@ -62,7 +56,7 @@ public class CommonQueryManager {
|
||||
* @param parameterMap
|
||||
* @return
|
||||
*/
|
||||
public Long counts(String apiName, Map<String, String> parameterMap) {
|
||||
public Long counts(String apiName, Map<String, String> parameterMap)throws Exception {
|
||||
if (StringUtil.isNotEmpty(apiName)) {
|
||||
return container.getCommonQuery(apiName).counts(parameterMap);
|
||||
}
|
||||
@@ -76,7 +70,7 @@ public class CommonQueryManager {
|
||||
* @return
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int insert(String apiName, String beanJson, HttpServletRequest request) {
|
||||
public int insert(String apiName, String beanJson, HttpServletRequest request) throws Exception{
|
||||
if (StringUtil.isNotEmpty(apiName)) {
|
||||
logService.insertLog(apiName, BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||
return container.getCommonQuery(apiName).insert(beanJson, request);
|
||||
@@ -92,7 +86,7 @@ public class CommonQueryManager {
|
||||
* @return
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int update(String apiName, String beanJson, Long id, HttpServletRequest request) {
|
||||
public int update(String apiName, String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||
if (StringUtil.isNotEmpty(apiName)) {
|
||||
logService.insertLog(apiName,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||
@@ -108,7 +102,7 @@ public class CommonQueryManager {
|
||||
* @return
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int delete(String apiName, Long id, HttpServletRequest request) {
|
||||
public int delete(String apiName, Long id, HttpServletRequest request)throws Exception {
|
||||
if (StringUtil.isNotEmpty(apiName)) {
|
||||
logService.insertLog(apiName,
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||
@@ -124,7 +118,7 @@ public class CommonQueryManager {
|
||||
* @return
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchDelete(String apiName, String ids, HttpServletRequest request) {
|
||||
public int batchDelete(String apiName, String ids, HttpServletRequest request)throws Exception {
|
||||
if (StringUtil.isNotEmpty(apiName)) {
|
||||
logService.insertLog(apiName, "批量删除,id集:" + ids, request);
|
||||
return container.getCommonQuery(apiName).batchDelete(ids);
|
||||
@@ -139,7 +133,7 @@ public class CommonQueryManager {
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public int checkIsNameExist(String apiName, Long id, String name) {
|
||||
public int checkIsNameExist(String apiName, Long id, String name) throws Exception{
|
||||
if (StringUtil.isNotEmpty(apiName)) {
|
||||
return container.getCommonQuery(apiName).checkIsNameExist(id, name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user