Commit b186ae16 authored by 季圣华's avatar 季圣华
Browse files

优化日志的记录

parent 47c90a0e
......@@ -94,10 +94,11 @@ public class SerialNumberService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertSerialNumber(String beanJson, HttpServletRequest request)throws Exception {
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_OPERATION_TYPE_ADD, request);
int result=0;
try{
result=serialNumberMapper.insertSelective(serialNumber);
logService.insertLog("序列号", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -105,12 +106,14 @@ public class SerialNumberService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateSerialNumber(String beanJson, Long id) throws Exception{
public int updateSerialNumber(String beanJson, Long id, HttpServletRequest request) throws Exception{
SerialNumber serialNumber = JSONObject.parseObject(beanJson, SerialNumber.class);
serialNumber.setId(id);
int result=0;
try{
result=serialNumberMapper.updateByPrimaryKeySelective(serialNumber);
logService.insertLog("序列号",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -118,10 +121,12 @@ public class SerialNumberService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteSerialNumber(Long id)throws Exception {
public int deleteSerialNumber(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result=serialNumberMapper.deleteByPrimaryKey(id);
logService.insertLog("序列号",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -129,13 +134,14 @@ public class SerialNumberService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSerialNumber(String ids)throws Exception {
public int batchDeleteSerialNumber(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids);
SerialNumberExample example = new SerialNumberExample();
example.createCriteria().andIdIn(idList);
int result=0;
try{
result=serialNumberMapper.deleteByExample(example);
logService.insertLog("序列号", "批量删除,id集:" + ids, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -246,7 +252,7 @@ public class SerialNumberService {
* */
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public SerialNumberEx addSerialNumber(SerialNumberEx serialNumberEx) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,BusinessConstants.LOG_OPERATION_TYPE_ADD,
logService.insertLog("序列号",BusinessConstants.LOG_OPERATION_TYPE_ADD,
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
if(serialNumberEx==null){
return null;
......@@ -276,7 +282,7 @@ public class SerialNumberService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public SerialNumberEx updateSerialNumber(SerialNumberEx serialNumberEx)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
logService.insertLog("序列号",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(serialNumberEx.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
if(serialNumberEx==null){
......@@ -454,7 +460,7 @@ public class SerialNumberService {
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void batAddSerialNumber(String materialName, String serialNumberPrefix, Integer batAddTotal, String remark)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
logService.insertLog("序列号",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_BATCH_ADD).append(batAddTotal).append(BusinessConstants.LOG_DATA_UNIT).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
if(StringUtil.isNotEmpty(materialName)){
......@@ -505,7 +511,7 @@ public class SerialNumberService {
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSerialNumberByIds(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
logService.insertLog("序列号",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
......
......@@ -58,18 +58,18 @@ public class SupplierComponent implements ICommonQuery {
}
@Override
public int update(String beanJson, Long id)throws Exception {
return supplierService.updateSupplier(beanJson, id);
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
return supplierService.updateSupplier(beanJson, id, request);
}
@Override
public int delete(Long id)throws Exception {
return supplierService.deleteSupplier(id);
public int delete(Long id, HttpServletRequest request)throws Exception {
return supplierService.deleteSupplier(id, request);
}
@Override
public int batchDelete(String ids)throws Exception {
return supplierService.batchDeleteSupplier(ids);
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
return supplierService.batchDeleteSupplier(ids, request);
}
@Override
......
......@@ -133,6 +133,7 @@ public class SupplierService {
int result=0;
try{
result=supplierMapper.insertSelective(supplier);
logService.insertLog("商家", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -140,7 +141,7 @@ public class SupplierService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateSupplier(String beanJson, Long id)throws Exception {
public int updateSupplier(String beanJson, Long id, HttpServletRequest request)throws Exception {
Supplier supplier = JSONObject.parseObject(beanJson, Supplier.class);
if(supplier.getBeginneedpay() == null) {
supplier.setBeginneedpay(BigDecimal.ZERO);
......@@ -152,6 +153,8 @@ public class SupplierService {
int result=0;
try{
result=supplierMapper.updateByPrimaryKeySelective(supplier);
logService.insertLog("商家",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -159,10 +162,12 @@ public class SupplierService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteSupplier(Long id)throws Exception {
public int deleteSupplier(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result=supplierMapper.deleteByPrimaryKey(id);
logService.insertLog("商家",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -170,13 +175,14 @@ public class SupplierService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSupplier(String ids) throws Exception{
public int batchDeleteSupplier(String ids, HttpServletRequest request) throws Exception{
List<Long> idList = StringUtil.strToLongList(ids);
SupplierExample example = new SupplierExample();
example.createCriteria().andIdIn(idList);
int result=0;
try{
result=supplierMapper.deleteByExample(example);
logService.insertLog("商家", "批量删除,id集:" + ids, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -197,7 +203,7 @@ public class SupplierService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateAdvanceIn(Long supplierId, BigDecimal advanceIn)throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER,
logService.insertLog("商家",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplierId).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
Supplier supplier=null;
......@@ -275,7 +281,7 @@ public class SupplierService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchSetEnable(Boolean enabled, String supplierIDs)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER,
logService.insertLog("商家",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplierIDs).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
List<Long> ids = StringUtil.strToLongList(supplierIDs);
......@@ -318,7 +324,7 @@ public class SupplierService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public BaseResponseInfo importExcel(List<Supplier> mList) throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER,
logService.insertLog("商家",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_IMPORT).append(mList.size()).append(BusinessConstants.LOG_DATA_UNIT).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
BaseResponseInfo info = new BaseResponseInfo();
......@@ -339,7 +345,7 @@ public class SupplierService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSupplierByIds(String ids)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER,
logService.insertLog("商家",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
......
......@@ -50,18 +50,18 @@ public class SystemConfigComponent implements ICommonQuery {
}
@Override
public int update(String beanJson, Long id)throws Exception {
return systemConfigService.updateSystemConfig(beanJson, id);
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
return systemConfigService.updateSystemConfig(beanJson, id, request);
}
@Override
public int delete(Long id)throws Exception {
return systemConfigService.deleteSystemConfig(id);
public int delete(Long id, HttpServletRequest request)throws Exception {
return systemConfigService.deleteSystemConfig(id, request);
}
@Override
public int batchDelete(String ids)throws Exception {
return systemConfigService.batchDeleteSystemConfig(ids);
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
return systemConfigService.batchDeleteSystemConfig(ids, request);
}
@Override
......
......@@ -87,6 +87,7 @@ public class SystemConfigService {
int result=0;
try{
result=systemConfigMapper.insertSelective(systemConfig);
logService.insertLog("系统配置", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -94,12 +95,14 @@ public class SystemConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateSystemConfig(String beanJson, Long id) throws Exception{
public int updateSystemConfig(String beanJson, Long id, HttpServletRequest request) throws Exception{
SystemConfig systemConfig = JSONObject.parseObject(beanJson, SystemConfig.class);
systemConfig.setId(id);
int result=0;
try{
result=systemConfigMapper.updateByPrimaryKeySelective(systemConfig);
logService.insertLog("系统配置",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -107,10 +110,12 @@ public class SystemConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteSystemConfig(Long id)throws Exception {
public int deleteSystemConfig(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result=systemConfigMapper.deleteByPrimaryKey(id);
logService.insertLog("系统配置",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -118,13 +123,14 @@ public class SystemConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSystemConfig(String ids)throws Exception {
public int batchDeleteSystemConfig(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids);
SystemConfigExample example = new SystemConfigExample();
example.createCriteria().andIdIn(idList);
int result=0;
try{
result=systemConfigMapper.deleteByExample(example);
logService.insertLog("系统配置", "批量删除,id集:" + ids, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -145,7 +151,7 @@ public class SystemConfigService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSystemConfigByIds(String ids)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SYSTEM_CONFIG,
logService.insertLog("系统配置",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
......
......@@ -49,18 +49,18 @@ public class TenantComponent implements ICommonQuery {
}
@Override
public int update(String beanJson, Long id)throws Exception {
return tenantService.updateTenant(beanJson, id);
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
return tenantService.updateTenant(beanJson, id, request);
}
@Override
public int delete(Long id)throws Exception {
return tenantService.deleteTenant(id);
public int delete(Long id, HttpServletRequest request)throws Exception {
return tenantService.deleteTenant(id, request);
}
@Override
public int batchDelete(String ids)throws Exception {
return tenantService.batchDeleteTenant(ids);
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
return tenantService.batchDeleteTenant(ids, request);
}
@Override
......
......@@ -83,7 +83,7 @@ public class TenantService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateTenant(String beanJson, Long id)throws Exception {
public int updateTenant(String beanJson, Long id, HttpServletRequest request)throws Exception {
Tenant tenant = JSONObject.parseObject(beanJson, Tenant.class);
int result=0;
try{
......@@ -96,7 +96,7 @@ public class TenantService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteTenant(Long id)throws Exception {
public int deleteTenant(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result= tenantMapper.deleteByPrimaryKey(id);
......@@ -107,7 +107,7 @@ public class TenantService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteTenant(String ids)throws Exception {
public int batchDeleteTenant(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids);
TenantExample example = new TenantExample();
example.createCriteria().andIdIn(idList);
......
......@@ -48,18 +48,18 @@ public class UnitComponent implements ICommonQuery {
}
@Override
public int update(String beanJson, Long id)throws Exception {
return unitService.updateUnit(beanJson, id);
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
return unitService.updateUnit(beanJson, id, request);
}
@Override
public int delete(Long id)throws Exception {
return unitService.deleteUnit(id);
public int delete(Long id, HttpServletRequest request)throws Exception {
return unitService.deleteUnit(id, request);
}
@Override
public int batchDelete(String ids)throws Exception {
return unitService.batchDeleteUnit(ids);
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
return unitService.batchDeleteUnit(ids, request);
}
@Override
......
......@@ -89,6 +89,7 @@ public class UnitService {
int result=0;
try{
result=unitMapper.insertSelective(unit);
logService.insertLog("计量单位", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -96,12 +97,14 @@ public class UnitService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateUnit(String beanJson, Long id)throws Exception {
public int updateUnit(String beanJson, Long id, HttpServletRequest request)throws Exception {
Unit unit = JSONObject.parseObject(beanJson, Unit.class);
unit.setId(id);
int result=0;
try{
result=unitMapper.updateByPrimaryKeySelective(unit);
logService.insertLog("计量单位",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -109,10 +112,12 @@ public class UnitService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteUnit(Long id)throws Exception {
public int deleteUnit(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result=unitMapper.deleteByPrimaryKey(id);
logService.insertLog("计量单位",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -120,13 +125,14 @@ public class UnitService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteUnit(String ids) throws Exception{
public int batchDeleteUnit(String ids, HttpServletRequest request) throws Exception{
List<Long> idList = StringUtil.strToLongList(ids);
UnitExample example = new UnitExample();
example.createCriteria().andIdIn(idList);
int result=0;
try{
result=unitMapper.deleteByExample(example);
logService.insertLog("计量单位", "批量删除,id集:" + ids, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -146,7 +152,7 @@ public class UnitService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteUnitByIds(String ids)throws Exception {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_UNIT,
logService.insertLog("计量单位",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
......
......@@ -50,18 +50,18 @@ public class UserComponent implements ICommonQuery {
}
@Override
public int update(String beanJson, Long id)throws Exception {
return userService.updateUser(beanJson, id);
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
return userService.updateUser(beanJson, id, request);
}
@Override
public int delete(Long id)throws Exception {
return userService.deleteUser(id);
public int delete(Long id, HttpServletRequest request)throws Exception {
return userService.deleteUser(id, request);
}
@Override
public int batchDelete(String ids)throws Exception {
return userService.batchDeleteUser(ids);
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
return userService.batchDeleteUser(ids, request);
}
@Override
......
......@@ -120,6 +120,7 @@ public class UserService {
int result=0;
try{
result=userMapper.insertSelective(user);
logService.insertLog("用户", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -135,12 +136,14 @@ public class UserService {
* @return int
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateUser(String beanJson, Long id) throws Exception{
public int updateUser(String beanJson, Long id, HttpServletRequest request) throws Exception{
User user = JSONObject.parseObject(beanJson, User.class);
user.setId(id);
int result=0;
try{
result=userMapper.updateByPrimaryKeySelective(user);
logService.insertLog("用户",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -156,7 +159,7 @@ public class UserService {
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateUserByObj(User user) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
logService.insertLog("用户",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
int result=0;
......@@ -178,7 +181,7 @@ public class UserService {
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int resetPwd(String md5Pwd, Long id) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
logService.insertLog("用户",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User user = new User();
......@@ -194,10 +197,12 @@ public class UserService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteUser(Long id)throws Exception {
public int deleteUser(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result= userMapper.deleteByPrimaryKey(id);
logService.insertLog("用户",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -205,13 +210,14 @@ public class UserService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteUser(String ids)throws Exception {
public int batchDeleteUser(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids);
UserExample example = new UserExample();
example.createCriteria().andIdIn(idList);
int result=0;
try{
result= userMapper.deleteByExample(example);
logService.insertLog("用户", "批量删除,id集:" + ids, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -307,7 +313,7 @@ public class UserService {
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
} else {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
logService.insertLog("用户",
BusinessConstants.LOG_OPERATION_TYPE_ADD,
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
//检查用户名和登录名
......@@ -438,7 +444,7 @@ public class UserService {
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
} else {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
logService.insertLog("用户",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ue.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
//检查用户名和登录名
......@@ -586,7 +592,7 @@ public class UserService {
* */
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void batDeleteUser(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
logService.insertLog("用户",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
String idsArray[]=ids.split(",");
......
......@@ -46,18 +46,18 @@ public class UserBusinessComponent implements ICommonQuery {
}
@Override
public int update(String beanJson, Long id)throws Exception {
return userBusinessService.updateUserBusiness(beanJson, id);
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
return userBusinessService.updateUserBusiness(beanJson, id, request);
}
@Override
public int delete(Long id)throws Exception {
return userBusinessService.deleteUserBusiness(id);
public int delete(Long id, HttpServletRequest request)throws Exception {
return userBusinessService.deleteUserBusiness(id, request);
}
@Override
public int batchDelete(String ids)throws Exception {
return userBusinessService.batchDeleteUserBusiness(ids);
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
return userBusinessService.batchDeleteUserBusiness(ids, request);
}
@Override
......
......@@ -72,6 +72,7 @@ public class UserBusinessService {
int result=0;
try{
result=userBusinessMapper.insertSelective(userBusiness);
logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -79,12 +80,14 @@ public class UserBusinessService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateUserBusiness(String beanJson, Long id) throws Exception {
public int updateUserBusiness(String beanJson, Long id, HttpServletRequest request) throws Exception {
UserBusiness userBusiness = JSONObject.parseObject(beanJson, UserBusiness.class);
userBusiness.setId(id);
int result=0;
try{
result=userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
logService.insertLog("关联关系",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -92,10 +95,12 @@ public class UserBusinessService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteUserBusiness(Long id)throws Exception {
public int deleteUserBusiness(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result=userBusinessMapper.deleteByPrimaryKey(id);
logService.insertLog("关联关系",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -103,13 +108,14 @@ public class UserBusinessService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteUserBusiness(String ids)throws Exception {
public int batchDeleteUserBusiness(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids);
UserBusinessExample example = new UserBusinessExample();
example.createCriteria().andIdIn(idList);
int result=0;
try{
result=userBusinessMapper.deleteByExample(example);
logService.insertLog("关联关系", "批量删除,id集:" + ids, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
......@@ -175,7 +181,7 @@ public class UserBusinessService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateBtnStr(Long userBusinessId, String btnStr) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER_BUSINESS,
logService.insertLog("关联关系",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(userBusinessId).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
UserBusiness userBusiness = new UserBusiness();
......@@ -220,7 +226,7 @@ public class UserBusinessService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteUserBusinessByIds(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER_BUSINESS,
logService.insertLog("关联关系",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment