异常封装之日志信息后台修改

This commit is contained in:
qiankunpingtai
2019-04-18 21:09:37 +08:00
parent 94c64dd905
commit fd7df68740
18 changed files with 141 additions and 63 deletions

View File

@@ -68,7 +68,7 @@ public class MaterialController {
@PostMapping(value = "/batchSetEnable") @PostMapping(value = "/batchSetEnable")
public String batchSetEnable(@RequestParam("enabled") Boolean enabled, public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
@RequestParam("materialIDs") String materialIDs, @RequestParam("materialIDs") String materialIDs,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int res = materialService.batchSetEnable(enabled, materialIDs); int res = materialService.batchSetEnable(enabled, materialIDs);
if(res > 0) { if(res > 0) {

View File

@@ -61,7 +61,7 @@ public class SerialNumberController {
*/ */
@PostMapping("/serialNumber/addSerialNumber") @PostMapping("/serialNumber/addSerialNumber")
@ResponseBody @ResponseBody
public Object addSerialNumber(@RequestParam("info") String beanJson){ public Object addSerialNumber(@RequestParam("info") String beanJson)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class); SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class);
serialNumberService.addSerialNumber(sne); serialNumberService.addSerialNumber(sne);
@@ -78,7 +78,7 @@ public class SerialNumberController {
*/ */
@PostMapping("/serialNumber/updateSerialNumber") @PostMapping("/serialNumber/updateSerialNumber")
@ResponseBody @ResponseBody
public Object updateSerialNumber(@RequestParam("info") String beanJson){ public Object updateSerialNumber(@RequestParam("info") String beanJson)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class); SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class);
@@ -100,7 +100,7 @@ public class SerialNumberController {
@PostMapping("/serialNumber/batAddSerialNumber") @PostMapping("/serialNumber/batAddSerialNumber")
@ResponseBody @ResponseBody
public Object batAddSerialNumber(@RequestParam("materialName") String materialName, @RequestParam("serialNumberPrefix") String serialNumberPrefix, public Object batAddSerialNumber(@RequestParam("materialName") String materialName, @RequestParam("serialNumberPrefix") String serialNumberPrefix,
@RequestParam("batAddTotal") Integer batAddTotal,@RequestParam("remark") String remark){ @RequestParam("batAddTotal") Integer batAddTotal,@RequestParam("remark") String remark)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
serialNumberService.batAddSerialNumber(materialName,serialNumberPrefix,batAddTotal,remark); serialNumberService.batAddSerialNumber(materialName,serialNumberPrefix,batAddTotal,remark);

View File

@@ -57,7 +57,7 @@ public class SupplierController {
@PostMapping(value = "/updateAdvanceIn") @PostMapping(value = "/updateAdvanceIn")
public String updateAdvanceIn(@RequestParam("supplierId") Long supplierId, public String updateAdvanceIn(@RequestParam("supplierId") Long supplierId,
@RequestParam("advanceIn") BigDecimal advanceIn, @RequestParam("advanceIn") BigDecimal advanceIn,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int res = supplierService.updateAdvanceIn(supplierId, advanceIn); int res = supplierService.updateAdvanceIn(supplierId, advanceIn);
if(res > 0) { if(res > 0) {
@@ -221,7 +221,7 @@ public class SupplierController {
@PostMapping(value = "/batchSetEnable") @PostMapping(value = "/batchSetEnable")
public String batchSetEnable(@RequestParam("enabled") Boolean enabled, public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
@RequestParam("supplierIDs") String supplierIDs, @RequestParam("supplierIDs") String supplierIDs,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int res = supplierService.batchSetEnable(enabled, supplierIDs); int res = supplierService.batchSetEnable(enabled, supplierIDs);
if(res > 0) { if(res > 0) {

View File

@@ -192,7 +192,7 @@ public class UserController {
@PostMapping(value = "/resetPwd") @PostMapping(value = "/resetPwd")
public String resetPwd(@RequestParam("id") Long id, public String resetPwd(@RequestParam("id") Long id,
HttpServletRequest request) throws NoSuchAlgorithmException { HttpServletRequest request) throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
String password = "123456"; String password = "123456";
String md5Pwd = Tools.md5Encryp(password); String md5Pwd = Tools.md5Encryp(password);

View File

@@ -19,16 +19,16 @@ public class LogComponent implements ICommonQuery {
private LogService logService; private LogService logService;
@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 getUserList(map); return getUserList(map);
} }
private List<?> getUserList(Map<String, String> map) { private List<?> getUserList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH); String search = map.get(Constants.SEARCH);
String operation = StringUtil.getInfo(search, "operation"); String operation = StringUtil.getInfo(search, "operation");
Integer usernameID = StringUtil.parseInteger(StringUtil.getInfo(search, "usernameID")); Integer usernameID = StringUtil.parseInteger(StringUtil.getInfo(search, "usernameID"));
@@ -43,7 +43,7 @@ public class LogComponent 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 operation = StringUtil.getInfo(search, "operation"); String operation = StringUtil.getInfo(search, "operation");
Integer usernameID = StringUtil.parseInteger(StringUtil.getInfo(search, "usernameID")); Integer usernameID = StringUtil.parseInteger(StringUtil.getInfo(search, "usernameID"));
@@ -56,27 +56,27 @@ public class LogComponent implements ICommonQuery {
} }
@Override @Override
public int insert(String beanJson, HttpServletRequest request) { public int insert(String beanJson, HttpServletRequest request)throws Exception {
return logService.insertLog(beanJson, request); return logService.insertLog(beanJson, request);
} }
@Override @Override
public int update(String beanJson, Long id) { public int update(String beanJson, Long id)throws Exception {
return logService.updateLog(beanJson, id); return logService.updateLog(beanJson, id);
} }
@Override @Override
public int delete(Long id) { public int delete(Long id)throws Exception {
return logService.deleteLog(id); return logService.deleteLog(id);
} }
@Override @Override
public int batchDelete(String ids) { public int batchDelete(String ids)throws Exception {
return logService.batchDeleteLog(ids); return logService.batchDeleteLog(ids);
} }
@Override @Override
public int checkIsNameExist(Long id, String name) { public int checkIsNameExist(Long id, String name)throws Exception {
return 0; return 0;
} }

View File

@@ -2,16 +2,15 @@ package com.jsh.erp.service.log;
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.Log; import com.jsh.erp.datasource.entities.Log;
import com.jsh.erp.datasource.entities.LogExample; import com.jsh.erp.datasource.entities.LogExample;
import com.jsh.erp.datasource.entities.User; import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.datasource.mappers.LogMapper; import com.jsh.erp.datasource.mappers.LogMapper;
import com.jsh.erp.datasource.mappers.LogMapperEx; import com.jsh.erp.datasource.mappers.LogMapperEx;
import com.jsh.erp.datasource.vo.LogVo4List; import com.jsh.erp.datasource.vo.LogVo4List;
import com.jsh.erp.utils.ExceptionCodeConstants; import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.utils.JshException;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -19,7 +18,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.security.NoSuchAlgorithmException;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -34,50 +32,122 @@ public class LogService {
@Resource @Resource
private LogMapperEx logMapperEx; private LogMapperEx logMapperEx;
public Log getLog(long id) { public Log getLog(long id)throws Exception {
return logMapper.selectByPrimaryKey(id); Log result=null;
try{
result=logMapper.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<Log> getLog() { public List<Log> getLog()throws Exception {
LogExample example = new LogExample(); LogExample example = new LogExample();
return logMapper.selectByExample(example); List<Log> list=null;
try{
list=logMapper.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<LogVo4List> select(String operation, Integer usernameID, String clientIp, Integer status, String beginTime, String endTime, public List<LogVo4List> select(String operation, Integer usernameID, String clientIp, Integer status, String beginTime, String endTime,
String contentdetails, int offset, int rows) { String contentdetails, int offset, int rows)throws Exception {
return logMapperEx.selectByConditionLog(operation, usernameID, clientIp, status, beginTime, endTime, List<LogVo4List> list=null;
contentdetails, offset, rows); try{
list=logMapperEx.selectByConditionLog(operation, usernameID, clientIp, status, beginTime, endTime,
contentdetails, 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 countLog(String operation, Integer usernameID, String clientIp, Integer status, String beginTime, String endTime, public Long countLog(String operation, Integer usernameID, String clientIp, Integer status, String beginTime, String endTime,
String contentdetails) { String contentdetails)throws Exception {
return logMapperEx.countsByLog(operation, usernameID, clientIp, status, beginTime, endTime, contentdetails); Long result=null;
try{
result=logMapperEx.countsByLog(operation, usernameID, clientIp, status, beginTime, endTime, contentdetails);
}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 insertLog(String beanJson, HttpServletRequest request) { public int insertLog(String beanJson, HttpServletRequest request) throws Exception{
Log log = JSONObject.parseObject(beanJson, Log.class); Log log = JSONObject.parseObject(beanJson, Log.class);
return logMapper.insertSelective(log); int result=0;
try{
result=logMapper.insertSelective(log);
}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 updateLog(String beanJson, Long id) { public int updateLog(String beanJson, Long id)throws Exception {
Log log = JSONObject.parseObject(beanJson, Log.class); Log log = JSONObject.parseObject(beanJson, Log.class);
log.setId(id); log.setId(id);
return logMapper.updateByPrimaryKeySelective(log); int result=0;
try{
result=logMapper.updateByPrimaryKeySelective(log);
}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 deleteLog(Long id) { public int deleteLog(Long id)throws Exception {
return logMapper.deleteByPrimaryKey(id); int result=0;
try{
result=logMapper.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 batchDeleteLog(String ids) { public int batchDeleteLog(String ids)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids); List<Long> idList = StringUtil.strToLongList(ids);
LogExample example = new LogExample(); LogExample example = new LogExample();
example.createCriteria().andIdIn(idList); example.createCriteria().andIdIn(idList);
return logMapper.deleteByExample(example); int result=0;
try{
result=logMapper.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;
} }
/** /**
@@ -85,7 +155,7 @@ public class LogService {
* @param request * @param request
* @return * @return
*/ */
public Long getUserId(HttpServletRequest request) { public Long getUserId(HttpServletRequest request) throws Exception{
Object userInfo = request.getSession().getAttribute("user"); Object userInfo = request.getSession().getAttribute("user");
if(userInfo!=null) { if(userInfo!=null) {
User user = (User) userInfo; User user = (User) userInfo;
@@ -95,7 +165,7 @@ public class LogService {
} }
} }
public String getModule(String apiName){ public String getModule(String apiName)throws Exception{
String moduleName = null; String moduleName = null;
switch (apiName) { switch (apiName) {
case BusinessConstants.LOG_INTERFACE_NAME_USER: case BusinessConstants.LOG_INTERFACE_NAME_USER:
@@ -144,7 +214,7 @@ public class LogService {
return moduleName; return moduleName;
} }
public void insertLog(String apiName, String type, HttpServletRequest request){ public void insertLog(String apiName, String type, HttpServletRequest request)throws Exception{
Log log = new Log(); Log log = new Log();
log.setUserid(getUserId(request)); log.setUserid(getUserId(request));
log.setOperation(getModule(apiName)); log.setOperation(getModule(apiName));
@@ -154,7 +224,15 @@ public class LogService {
log.setStatus(status); log.setStatus(status);
log.setContentdetails(type + getModule(apiName)); log.setContentdetails(type + getModule(apiName));
log.setRemark(type + getModule(apiName)); log.setRemark(type + getModule(apiName));
logMapper.insertSelective(log); try{
logMapper.insertSelective(log);
}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);
}
} }
} }

View File

@@ -150,7 +150,7 @@ public class MaterialService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchSetEnable(Boolean enabled, String materialIDs) { public int batchSetEnable(Boolean enabled, String materialIDs)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialIDs).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialIDs).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
@@ -217,7 +217,7 @@ public class MaterialService {
return materialMapperEx.getMaterialEnableSerialNumberList(parameterMap); return materialMapperEx.getMaterialEnableSerialNumberList(parameterMap);
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteMaterialByIds(String ids) { public int batchDeleteMaterialByIds(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL,
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());

View File

@@ -164,7 +164,7 @@ public class MaterialCategoryService {
return materialCategoryMapperEx.batchDeleteMaterialCategoryByIds(updateDate,updater,strArray); return materialCategoryMapperEx.batchDeleteMaterialCategoryByIds(updateDate,updater,strArray);
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int editMaterialCategory(MaterialCategory mc) { public int editMaterialCategory(MaterialCategory mc) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_CATEGORY, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_CATEGORY,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(mc.getId()).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(mc.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());

View File

@@ -84,7 +84,7 @@ public class MaterialPropertyService {
return 0; return 0;
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteMaterialPropertyByIds(String ids) { public int batchDeleteMaterialPropertyByIds(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_PROPERTY, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_PROPERTY,
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());

View File

@@ -117,7 +117,7 @@ public class PersonService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeletePersonByIds(String ids) { public int batchDeletePersonByIds(String ids)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_PERSON, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_PERSON,
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());

View File

@@ -98,7 +98,7 @@ public class RoleService {
* @return int * @return int
*/ */
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteRoleByIds(String ids) { public int batchDeleteRoleByIds(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
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());

View File

@@ -51,7 +51,7 @@ public class SerialNumberComponent implements ICommonQuery {
} }
@Override @Override
public int insert(String beanJson, HttpServletRequest request) { public int insert(String beanJson, HttpServletRequest request)throws Exception {
return serialNumberService.insertSerialNumber(beanJson, request); return serialNumberService.insertSerialNumber(beanJson, request);
} }

View File

@@ -67,7 +67,7 @@ public class SerialNumberService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertSerialNumber(String beanJson, HttpServletRequest request) { public int insertSerialNumber(String beanJson, HttpServletRequest request)throws Exception {
SerialNumber serialNumber = JSONObject.parseObject(beanJson, SerialNumber.class); SerialNumber serialNumber = JSONObject.parseObject(beanJson, SerialNumber.class);
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER, BusinessConstants.LOG_OPERATION_TYPE_ADD, request); logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER, BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
return serialNumberMapper.insertSelective(serialNumber); return serialNumberMapper.insertSelective(serialNumber);
@@ -169,7 +169,7 @@ public class SerialNumberService {
* 新增序列号信息 * 新增序列号信息
* */ * */
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public SerialNumberEx addSerialNumber(SerialNumberEx serialNumberEx) { public SerialNumberEx addSerialNumber(SerialNumberEx serialNumberEx) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,BusinessConstants.LOG_OPERATION_TYPE_ADD, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,BusinessConstants.LOG_OPERATION_TYPE_ADD,
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
if(serialNumberEx==null){ if(serialNumberEx==null){
@@ -194,7 +194,7 @@ public class SerialNumberService {
return null; return null;
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public SerialNumberEx updateSerialNumber(SerialNumberEx serialNumberEx) { public SerialNumberEx updateSerialNumber(SerialNumberEx serialNumberEx)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(serialNumberEx.getId()).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(serialNumberEx.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
@@ -351,7 +351,7 @@ public class SerialNumberService {
* @return java.lang.Object * @return java.lang.Object
*/ */
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void batAddSerialNumber(String materialName, String serialNumberPrefix, Integer batAddTotal, String remark) { public void batAddSerialNumber(String materialName, String serialNumberPrefix, Integer batAddTotal, String remark)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_BATCH_ADD).append(batAddTotal).append(BusinessConstants.LOG_DATA_UNIT).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_BATCH_ADD).append(batAddTotal).append(BusinessConstants.LOG_DATA_UNIT).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
@@ -401,7 +401,7 @@ public class SerialNumberService {
* @return * @return
*/ */
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSerialNumberByIds(String ids) { public int batchDeleteSerialNumberByIds(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
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());

View File

@@ -99,7 +99,7 @@ public class SupplierService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateAdvanceIn(Long supplierId, BigDecimal advanceIn){ public int updateAdvanceIn(Long supplierId, BigDecimal advanceIn)throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplierId).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplierId).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
@@ -145,7 +145,7 @@ public class SupplierService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchSetEnable(Boolean enabled, String supplierIDs) { public int batchSetEnable(Boolean enabled, String supplierIDs)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplierIDs).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplierIDs).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
@@ -191,7 +191,7 @@ public class SupplierService {
return info; return info;
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSupplierByIds(String ids) { public int batchDeleteSupplierByIds(String ids)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER,
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());

View File

@@ -87,7 +87,7 @@ public class SystemConfigService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSystemConfigByIds(String ids) { public int batchDeleteSystemConfigByIds(String ids)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SYSTEM_CONFIG, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SYSTEM_CONFIG,
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());

View File

@@ -94,7 +94,7 @@ public class UnitService {
return list.size(); return list.size();
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteUnitByIds(String ids) { public int batchDeleteUnitByIds(String ids)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_UNIT, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_UNIT,
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());

View File

@@ -114,7 +114,7 @@ public class UserService {
* @return int * @return int
*/ */
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateUserByObj(User user) { public int updateUserByObj(User user) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
@@ -130,7 +130,7 @@ public class UserService {
* @return int * @return int
*/ */
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int resetPwd(String md5Pwd, Long id) { public int resetPwd(String md5Pwd, Long id) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
@@ -467,7 +467,7 @@ public class UserService {
* 批量删除用户 * 批量删除用户
* */ * */
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void batDeleteUser(String ids) { public void batDeleteUser(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
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());

View File

@@ -142,7 +142,7 @@ public class UserBusinessService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateBtnStr(Long userBusinessId, String btnStr) { public int updateBtnStr(Long userBusinessId, String btnStr) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER_BUSINESS, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER_BUSINESS,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(userBusinessId).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(userBusinessId).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
@@ -171,7 +171,7 @@ public class UserBusinessService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteUserBusinessByIds(String ids) { public int batchDeleteUserBusinessByIds(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER_BUSINESS, logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER_BUSINESS,
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());