优化日志的记录
This commit is contained in:
@@ -151,55 +151,6 @@ public class BusinessConstants {
|
|||||||
* 条
|
* 条
|
||||||
* */
|
* */
|
||||||
public static final String LOG_DATA_UNIT = "条";
|
public static final String LOG_DATA_UNIT = "条";
|
||||||
/**
|
|
||||||
* 模块中文名称
|
|
||||||
* 模块对应的标识
|
|
||||||
* */
|
|
||||||
public static final String LOG_MODULE_NAME_USER= "用户";
|
|
||||||
public static final String LOG_INTERFACE_NAME_USER= "user";
|
|
||||||
public static final String LOG_MODULE_NAME_ROLE= "角色";
|
|
||||||
public static final String LOG_INTERFACE_NAME_ROLE= "role";
|
|
||||||
public static final String LOG_MODULE_NAME_APP= "应用";
|
|
||||||
public static final String LOG_INTERFACE_NAME_APP= "app";
|
|
||||||
public static final String LOG_MODULE_NAME_DEPOT= "仓库";
|
|
||||||
public static final String LOG_INTERFACE_NAME_DEPOT= "depot";
|
|
||||||
public static final String LOG_MODULE_NAME_FUNCTIONS= "功能";
|
|
||||||
public static final String LOG_INTERFACE_NAME_FUNCTIONS= "functions";
|
|
||||||
public static final String LOG_MODULE_NAME_IN_OUT_ITEM= "收支项目";
|
|
||||||
public static final String LOG_INTERFACE_NAME_IN_OUT_ITEM= "inOutItem";
|
|
||||||
public static final String LOG_MODULE_NAME_UNIT= "计量单位";
|
|
||||||
public static final String LOG_INTERFACE_NAME_UNIT= "unit";
|
|
||||||
public static final String LOG_MODULE_NAME_PERSON= "经手人";
|
|
||||||
public static final String LOG_INTERFACE_NAME_PERSON= "person";
|
|
||||||
public static final String LOG_MODULE_NAME_USER_BUSINESS= "关联关系";
|
|
||||||
public static final String LOG_INTERFACE_NAME_USER_BUSINESS= "userBusiness";
|
|
||||||
public static final String LOG_MODULE_NAME_SYSTEM_CONFIG= "系统配置";
|
|
||||||
public static final String LOG_INTERFACE_NAME_SYSTEM_CONFIG= "systemConfig";
|
|
||||||
public static final String LOG_MODULE_NAME_MATERIAL_PROPERTY= "商品属性";
|
|
||||||
public static final String LOG_INTERFACE_NAME_MATERIAL_PROPERTY= "materialProperty";
|
|
||||||
public static final String LOG_MODULE_NAME_ACCOUNT= "账户";
|
|
||||||
public static final String LOG_INTERFACE_NAME_ACCOUNT= "account";
|
|
||||||
public static final String LOG_MODULE_NAME_SUPPLIER= "商家";
|
|
||||||
public static final String LOG_INTERFACE_NAME_SUPPLIER= "supplier";
|
|
||||||
public static final String LOG_MODULE_NAME_MATERIAL_CATEGORY= "商品类型";
|
|
||||||
public static final String LOG_INTERFACE_NAME_MATERIAL_CATEGORY= "materialCategory";
|
|
||||||
public static final String LOG_MODULE_NAME_MATERIAL= "商品";
|
|
||||||
public static final String LOG_INTERFACE_NAME_MATERIAL= "material";
|
|
||||||
public static final String LOG_MODULE_NAME_DEPOT_HEAD= "单据";
|
|
||||||
public static final String LOG_INTERFACE_NAME_DEPOT_HEAD= "depotHead";
|
|
||||||
public static final String LOG_MODULE_NAME_DEPOT_ITEM= "单据明细";
|
|
||||||
public static final String LOG_INTERFACE_NAME_DEPOT_ITEM= "depotItem";
|
|
||||||
public static final String LOG_MODULE_NAME_ACCOUNT_HEAD= "财务";
|
|
||||||
public static final String LOG_INTERFACE_NAME_ACCOUNT_HEAD= "accountHead";
|
|
||||||
public static final String LOG_MODULE_NAME_ACCOUNT_ITEM= "财务明细";
|
|
||||||
public static final String LOG_INTERFACE_NAME_ACCOUNT_ITEM= "accountItem";
|
|
||||||
public static final String LOG_MODULE_NAME_SERIAL_NUMBER= "序列号";
|
|
||||||
public static final String LOG_INTERFACE_NAME_SERIAL_NUMBER= "serialNumber";
|
|
||||||
public static final String LOG_MODULE_NAME_ORGANIZATION= "机构";
|
|
||||||
public static final String LOG_INTERFACE_NAME_ORGANIZATION= "organization";
|
|
||||||
|
|
||||||
public static final String TYPE_NAME_ROLE_APP = "RoleAPP";
|
|
||||||
public static final String TYPE_NAME_ROLE_FUNCTIONS = "RoleFunctions";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除类型
|
* 删除类型
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ public class DepotHeadController {
|
|||||||
throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
|
throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
|
||||||
ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);
|
ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);
|
||||||
} else {
|
} else {
|
||||||
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated,tenantId);
|
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated,tenantId, request);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -431,7 +431,7 @@ public class DepotHeadController {
|
|||||||
HttpServletRequest request) throws Exception{
|
HttpServletRequest request) throws Exception{
|
||||||
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
|
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
|
||||||
JSONObject result = ExceptionConstants.standardSuccess();
|
JSONObject result = ExceptionConstants.standardSuccess();
|
||||||
depotHeadService.updateDepotHeadAndDetail(id,beanJson,inserted,deleted,updated,preTotalPrice,tenantId);
|
depotHeadService.updateDepotHeadAndDetail(id,beanJson,inserted,deleted,updated,preTotalPrice,tenantId,request);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
|
logService.insertLog("用户",
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_LOGIN).append(user.getId()).toString(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_LOGIN).append(user.getId()).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ public class CommonQueryManager {
|
|||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int insert(String apiName, String beanJson, HttpServletRequest request) throws Exception{
|
public int insert(String apiName, String beanJson, HttpServletRequest request) throws Exception{
|
||||||
if (StringUtil.isNotEmpty(apiName)) {
|
if (StringUtil.isNotEmpty(apiName)) {
|
||||||
logService.insertLog(apiName, BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
|
||||||
return container.getCommonQuery(apiName).insert(beanJson, request);
|
return container.getCommonQuery(apiName).insert(beanJson, request);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -88,9 +87,7 @@ public class CommonQueryManager {
|
|||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int update(String apiName, String beanJson, Long id, HttpServletRequest request)throws Exception {
|
public int update(String apiName, String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
if (StringUtil.isNotEmpty(apiName)) {
|
if (StringUtil.isNotEmpty(apiName)) {
|
||||||
logService.insertLog(apiName,
|
return container.getCommonQuery(apiName).update(beanJson, id, request);
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
|
||||||
return container.getCommonQuery(apiName).update(beanJson, id);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -104,9 +101,7 @@ public class CommonQueryManager {
|
|||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int delete(String apiName, Long id, HttpServletRequest request)throws Exception {
|
public int delete(String apiName, Long id, HttpServletRequest request)throws Exception {
|
||||||
if (StringUtil.isNotEmpty(apiName)) {
|
if (StringUtil.isNotEmpty(apiName)) {
|
||||||
logService.insertLog(apiName,
|
return container.getCommonQuery(apiName).delete(id, request);
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
|
||||||
return container.getCommonQuery(apiName).delete(id);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -120,8 +115,7 @@ public class CommonQueryManager {
|
|||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDelete(String apiName, String ids, HttpServletRequest request)throws Exception {
|
public int batchDelete(String apiName, String ids, HttpServletRequest request)throws Exception {
|
||||||
if (StringUtil.isNotEmpty(apiName)) {
|
if (StringUtil.isNotEmpty(apiName)) {
|
||||||
logService.insertLog(apiName, "批量删除,id集:" + ids, request);
|
return container.getCommonQuery(apiName).batchDelete(ids, request);
|
||||||
return container.getCommonQuery(apiName).batchDelete(ids);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public interface ICommonQuery {
|
|||||||
* @param beanJson
|
* @param beanJson
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int update(String beanJson, Long id) throws Exception;
|
int update(String beanJson, Long id, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除数据
|
* 删除数据
|
||||||
@@ -58,7 +58,7 @@ public interface ICommonQuery {
|
|||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int delete(Long id) throws Exception;
|
int delete(Long id, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除数据
|
* 批量删除数据
|
||||||
@@ -66,7 +66,7 @@ public interface ICommonQuery {
|
|||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int batchDelete(String ids) throws Exception;
|
int batchDelete(String ids, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询名称是否存在
|
* 查询名称是否存在
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ public class AccountComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return accountService.updateAccount(beanJson, id);
|
return accountService.updateAccount(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return accountService.deleteAccount(id);
|
return accountService.deleteAccount(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return accountService.batchDeleteAccount(ids);
|
return accountService.batchDeleteAccount(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ public class AccountService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountMapper.insertSelective(account);
|
result = accountMapper.insertSelective(account);
|
||||||
|
logService.insertLog("账户", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -129,12 +130,14 @@ public class AccountService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateAccount(String beanJson, Long id)throws Exception {
|
public int updateAccount(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
Account account = JSONObject.parseObject(beanJson, Account.class);
|
Account account = JSONObject.parseObject(beanJson, Account.class);
|
||||||
account.setId(id);
|
account.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountMapper.updateByPrimaryKeySelective(account);
|
result = accountMapper.updateByPrimaryKeySelective(account);
|
||||||
|
logService.insertLog("账户",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -142,10 +145,12 @@ public class AccountService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteAccount(Long id) throws Exception{
|
public int deleteAccount(Long id, HttpServletRequest request) throws Exception{
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountMapper.deleteByPrimaryKey(id);
|
result = accountMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("账户",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -153,13 +158,14 @@ public class AccountService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteAccount(String ids)throws Exception {
|
public int batchDeleteAccount(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
AccountExample example = new AccountExample();
|
AccountExample example = new AccountExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountMapper.deleteByExample(example);
|
result = accountMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("账户", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -421,7 +427,7 @@ public class AccountService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateAmountIsDefault(Boolean isDefault, Long accountId) throws Exception{
|
public int updateAmountIsDefault(Boolean isDefault, Long accountId) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT,BusinessConstants.LOG_OPERATION_TYPE_EDIT+accountId,
|
logService.insertLog("账户",BusinessConstants.LOG_OPERATION_TYPE_EDIT+accountId,
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
Account account = new Account();
|
Account account = new Account();
|
||||||
account.setIsdefault(isDefault);
|
account.setIsdefault(isDefault);
|
||||||
@@ -437,7 +443,7 @@ public class AccountService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteAccountByIds(String ids) throws Exception{
|
public int batchDeleteAccountByIds(String ids) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT,
|
logService.insertLog("账户",
|
||||||
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();
|
||||||
|
|||||||
@@ -54,18 +54,18 @@ public class AccountHeadComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return accountHeadService.updateAccountHead(beanJson, id);
|
return accountHeadService.updateAccountHead(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return accountHeadService.deleteAccountHead(id);
|
return accountHeadService.deleteAccountHead(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return accountHeadService.batchDeleteAccountHead(ids);
|
return accountHeadService.batchDeleteAccountHead(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ public class AccountHeadService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountHeadMapper.insertSelective(accountHead);
|
result = accountHeadMapper.insertSelective(accountHead);
|
||||||
|
logService.insertLog("财务", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -109,12 +110,14 @@ public class AccountHeadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateAccountHead(String beanJson, Long id)throws Exception {
|
public int updateAccountHead(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class);
|
AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class);
|
||||||
accountHead.setId(id);
|
accountHead.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountHeadMapper.updateByPrimaryKeySelective(accountHead);
|
result = accountHeadMapper.updateByPrimaryKeySelective(accountHead);
|
||||||
|
logService.insertLog("财务",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -122,10 +125,12 @@ public class AccountHeadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteAccountHead(Long id)throws Exception {
|
public int deleteAccountHead(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountHeadMapper.deleteByPrimaryKey(id);
|
result = accountHeadMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("财务",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -133,13 +138,14 @@ public class AccountHeadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteAccountHead(String ids)throws Exception {
|
public int batchDeleteAccountHead(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
AccountHeadExample example = new AccountHeadExample();
|
AccountHeadExample example = new AccountHeadExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountHeadMapper.deleteByExample(example);
|
result = accountHeadMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("财务", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -257,7 +263,7 @@ public class AccountHeadService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteAccountHeadByIds(String ids)throws Exception {
|
public int batchDeleteAccountHeadByIds(String ids)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT_HEAD,
|
logService.insertLog("财务",
|
||||||
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();
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ public class AccountItemComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return accountItemService.updateAccountItem(beanJson, id);
|
return accountItemService.updateAccountItem(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return accountItemService.deleteAccountItem(id);
|
return accountItemService.deleteAccountItem(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return accountItemService.batchDeleteAccountItem(ids);
|
return accountItemService.batchDeleteAccountItem(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ public class AccountItemService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountItemMapper.insertSelective(accountItem);
|
result = accountItemMapper.insertSelective(accountItem);
|
||||||
|
logService.insertLog("财务明细", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -102,12 +103,14 @@ public class AccountItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateAccountItem(String beanJson, Long id)throws Exception {
|
public int updateAccountItem(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
AccountItem accountItem = JSONObject.parseObject(beanJson, AccountItem.class);
|
AccountItem accountItem = JSONObject.parseObject(beanJson, AccountItem.class);
|
||||||
accountItem.setId(id);
|
accountItem.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountItemMapper.updateByPrimaryKeySelective(accountItem);
|
result = accountItemMapper.updateByPrimaryKeySelective(accountItem);
|
||||||
|
logService.insertLog("财务明细",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -115,10 +118,12 @@ public class AccountItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteAccountItem(Long id)throws Exception {
|
public int deleteAccountItem(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountItemMapper.deleteByPrimaryKey(id);
|
result = accountItemMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("财务明细",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -126,13 +131,14 @@ public class AccountItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteAccountItem(String ids)throws Exception {
|
public int batchDeleteAccountItem(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
AccountItemExample example = new AccountItemExample();
|
AccountItemExample example = new AccountItemExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountItemMapper.deleteByExample(example);
|
result = accountItemMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("财务明细", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -184,7 +190,7 @@ public class AccountItemService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public String saveDetials(String inserted, String deleted, String updated, Long headerId, String listType) throws Exception {
|
public String saveDetials(String inserted, String deleted, String updated, Long headerId, String listType) throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT_ITEM,
|
logService.insertLog("财务明细",
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(",headerId:").append(headerId).toString(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(",headerId:").append(headerId).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
//转为json
|
//转为json
|
||||||
@@ -257,7 +263,7 @@ public class AccountItemService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteAccountItemByIds(String ids) throws Exception{
|
public int batchDeleteAccountItemByIds(String ids) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT_ITEM,
|
logService.insertLog("财务明细",
|
||||||
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();
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ public class DepotComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return depotService.updateDepot(beanJson, id);
|
return depotService.updateDepot(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return depotService.deleteDepot(id);
|
return depotService.deleteDepot(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return depotService.batchDeleteDepot(ids);
|
return depotService.batchDeleteDepot(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ public class DepotService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=depotMapper.insertSelective(depot);
|
result=depotMapper.insertSelective(depot);
|
||||||
|
logService.insertLog("仓库", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -110,12 +111,14 @@ public class DepotService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateDepot(String beanJson, Long id) throws Exception{
|
public int updateDepot(String beanJson, Long id, HttpServletRequest request) throws Exception{
|
||||||
Depot depot = JSONObject.parseObject(beanJson, Depot.class);
|
Depot depot = JSONObject.parseObject(beanJson, Depot.class);
|
||||||
depot.setId(id);
|
depot.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result= depotMapper.updateByPrimaryKeySelective(depot);
|
result= depotMapper.updateByPrimaryKeySelective(depot);
|
||||||
|
logService.insertLog("仓库",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -123,10 +126,12 @@ public class DepotService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteDepot(Long id)throws Exception {
|
public int deleteDepot(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result= depotMapper.deleteByPrimaryKey(id);
|
result= depotMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("仓库",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -134,13 +139,14 @@ public class DepotService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteDepot(String ids) throws Exception{
|
public int batchDeleteDepot(String ids, HttpServletRequest request) throws Exception{
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
DepotExample example = new DepotExample();
|
DepotExample example = new DepotExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result= depotMapper.deleteByExample(example);
|
result= depotMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("仓库", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -196,7 +202,7 @@ public class DepotService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteDepotByIds(String ids)throws Exception {
|
public int batchDeleteDepotByIds(String ids)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT,
|
logService.insertLog("仓库",
|
||||||
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();
|
||||||
@@ -272,7 +278,7 @@ public class DepotService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateDepotIsDefault(Boolean isDefault, Long depotID) throws Exception{
|
public int updateDepotIsDefault(Boolean isDefault, Long depotID) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT,BusinessConstants.LOG_OPERATION_TYPE_EDIT+depotID,
|
logService.insertLog("仓库",BusinessConstants.LOG_OPERATION_TYPE_EDIT+depotID,
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
Depot depot = new Depot();
|
Depot depot = new Depot();
|
||||||
depot.setIsDefault(isDefault);
|
depot.setIsDefault(isDefault);
|
||||||
|
|||||||
@@ -59,18 +59,18 @@ public class DepotHeadComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return depotHeadService.updateDepotHead(beanJson, id);
|
return depotHeadService.updateDepotHead(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return depotHeadService.deleteDepotHead(id);
|
return depotHeadService.deleteDepotHead(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return depotHeadService.batchDeleteDepotHead(ids);
|
return depotHeadService.batchDeleteDepotHead(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ public class DepotHeadService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=depotHeadMapper.insert(depotHead);
|
result=depotHeadMapper.insert(depotHead);
|
||||||
|
logService.insertLog("单据", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -149,7 +150,7 @@ public class DepotHeadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateDepotHead(String beanJson, Long id) throws Exception{
|
public int updateDepotHead(String beanJson, Long id, HttpServletRequest request) throws Exception{
|
||||||
DepotHead dh=null;
|
DepotHead dh=null;
|
||||||
try{
|
try{
|
||||||
dh = depotHeadMapper.selectByPrimaryKey(id);
|
dh = depotHeadMapper.selectByPrimaryKey(id);
|
||||||
@@ -164,6 +165,8 @@ public class DepotHeadService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = depotHeadMapper.updateByPrimaryKey(depotHead);
|
result = depotHeadMapper.updateByPrimaryKey(depotHead);
|
||||||
|
logService.insertLog("单据",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -171,10 +174,12 @@ public class DepotHeadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteDepotHead(Long id)throws Exception {
|
public int deleteDepotHead(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = depotHeadMapper.deleteByPrimaryKey(id);
|
result = depotHeadMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("单据",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -182,13 +187,14 @@ public class DepotHeadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteDepotHead(String ids)throws Exception {
|
public int batchDeleteDepotHead(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
DepotHeadExample example = new DepotHeadExample();
|
DepotHeadExample example = new DepotHeadExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = depotHeadMapper.deleteByExample(example);
|
result = depotHeadMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("单据", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -209,7 +215,7 @@ public class DepotHeadService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchSetStatus(String status, String depotHeadIDs)throws Exception {
|
public int batchSetStatus(String status, String depotHeadIDs)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
|
logService.insertLog("单据",
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHeadIDs).toString(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHeadIDs).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
List<Long> ids = StringUtil.strToLongList(depotHeadIDs);
|
List<Long> ids = StringUtil.strToLongList(depotHeadIDs);
|
||||||
@@ -469,8 +475,9 @@ public class DepotHeadService {
|
|||||||
* @return java.lang.String
|
* @return java.lang.String
|
||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void addDepotHeadAndDetail(String beanJson, String inserted, String deleted, String updated,Long tenantId) throws Exception {
|
public void addDepotHeadAndDetail(String beanJson, String inserted, String deleted, String updated,Long tenantId,
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
|
HttpServletRequest request) throws Exception {
|
||||||
|
logService.insertLog("单据",
|
||||||
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
/**处理单据主表数据*/
|
/**处理单据主表数据*/
|
||||||
@@ -494,7 +501,7 @@ public class DepotHeadService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**入库和出库处理单据子表信息*/
|
/**入库和出库处理单据子表信息*/
|
||||||
depotItemService.saveDetials(inserted,deleted,updated,depotHead.getId(),tenantId);
|
depotItemService.saveDetials(inserted,deleted,updated,depotHead.getId(),tenantId, request);
|
||||||
/**如果关联单据号非空则更新订单的状态为2 */
|
/**如果关联单据号非空则更新订单的状态为2 */
|
||||||
if(depotHead.getLinknumber()!=null) {
|
if(depotHead.getLinknumber()!=null) {
|
||||||
DepotHead depotHeadOrders = new DepotHead();
|
DepotHead depotHeadOrders = new DepotHead();
|
||||||
@@ -523,8 +530,8 @@ public class DepotHeadService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void updateDepotHeadAndDetail(Long id, String beanJson, String inserted, String deleted, String updated,
|
public void updateDepotHeadAndDetail(Long id, String beanJson, String inserted, String deleted, String updated,
|
||||||
BigDecimal preTotalPrice, Long tenantId)throws Exception {
|
BigDecimal preTotalPrice, Long tenantId,HttpServletRequest request)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
|
logService.insertLog("单据",
|
||||||
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());
|
||||||
/**更新单据主表信息*/
|
/**更新单据主表信息*/
|
||||||
@@ -546,7 +553,7 @@ public class DepotHeadService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**入库和出库处理单据子表信息*/
|
/**入库和出库处理单据子表信息*/
|
||||||
depotItemService.saveDetials(inserted,deleted,updated,depotHead.getId(),tenantId);
|
depotItemService.saveDetials(inserted,deleted,updated,depotHead.getId(),tenantId,request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -559,7 +566,7 @@ public class DepotHeadService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void deleteDepotHeadAndDetail(Long id) throws Exception {
|
public void deleteDepotHeadAndDetail(Long id) throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
|
logService.insertLog("单据",
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
//查询单据主表信息
|
//查询单据主表信息
|
||||||
@@ -604,7 +611,7 @@ public class DepotHeadService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void batchDeleteDepotHeadAndDetail(String ids) throws Exception{
|
public void batchDeleteDepotHeadAndDetail(String ids) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
|
logService.insertLog("单据",
|
||||||
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());
|
||||||
if(StringUtil.isNotEmpty(ids)){
|
if(StringUtil.isNotEmpty(ids)){
|
||||||
@@ -616,7 +623,7 @@ public class DepotHeadService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteDepotHeadByIds(String ids)throws Exception {
|
public int batchDeleteDepotHeadByIds(String ids)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD,
|
logService.insertLog("单据",
|
||||||
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();
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ public class DepotItemComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return depotItemService.updateDepotItem(beanJson, id);
|
return depotItemService.updateDepotItem(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return depotItemService.deleteDepotItem(id);
|
return depotItemService.deleteDepotItem(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return depotItemService.batchDeleteDepotItem(ids);
|
return depotItemService.batchDeleteDepotItem(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public class DepotItemService {
|
|||||||
int result =0;
|
int result =0;
|
||||||
try{
|
try{
|
||||||
result=depotItemMapper.insertSelective(depotItem);
|
result=depotItemMapper.insertSelective(depotItem);
|
||||||
|
logService.insertLog("单据明细", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -114,12 +115,14 @@ public class DepotItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateDepotItem(String beanJson, Long id)throws Exception {
|
public int updateDepotItem(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
DepotItem depotItem = JSONObject.parseObject(beanJson, DepotItem.class);
|
DepotItem depotItem = JSONObject.parseObject(beanJson, DepotItem.class);
|
||||||
depotItem.setId(id);
|
depotItem.setId(id);
|
||||||
int result =0;
|
int result =0;
|
||||||
try{
|
try{
|
||||||
result=depotItemMapper.updateByPrimaryKeySelective(depotItem);
|
result=depotItemMapper.updateByPrimaryKeySelective(depotItem);
|
||||||
|
logService.insertLog("单据明细",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -127,10 +130,12 @@ public class DepotItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteDepotItem(Long id)throws Exception {
|
public int deleteDepotItem(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result =0;
|
int result =0;
|
||||||
try{
|
try{
|
||||||
result=depotItemMapper.deleteByPrimaryKey(id);
|
result=depotItemMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("单据明细",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -138,13 +143,14 @@ public class DepotItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteDepotItem(String ids)throws Exception {
|
public int batchDeleteDepotItem(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
DepotItemExample example = new DepotItemExample();
|
DepotItemExample example = new DepotItemExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result =0;
|
int result =0;
|
||||||
try{
|
try{
|
||||||
result=depotItemMapper.deleteByExample(example);
|
result=depotItemMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("单据明细", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -284,8 +290,8 @@ public class DepotItemService {
|
|||||||
* 这里重点重申一下:BasicNumber=OperNumber*ratio
|
* 这里重点重申一下:BasicNumber=OperNumber*ratio
|
||||||
* */
|
* */
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public String saveDetials(String inserted, String deleted, String updated, Long headerId, Long tenantId) throws Exception{
|
public String saveDetials(String inserted, String deleted, String updated, Long headerId, Long tenantId, HttpServletRequest request) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_ITEM,
|
logService.insertLog("单据明细",
|
||||||
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
//查询单据主表信息
|
//查询单据主表信息
|
||||||
@@ -330,7 +336,7 @@ public class DepotItemService {
|
|||||||
userInfo);
|
userInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.deleteDepotItem(tempDeletedJson.getLong("Id"));
|
this.deleteDepotItem(tempDeletedJson.getLong("Id"), request);
|
||||||
bf.append(tempDeletedJson.getLong("Id"));
|
bf.append(tempDeletedJson.getLong("Id"));
|
||||||
if(i<(deletedJson.size()-1)){
|
if(i<(deletedJson.size()-1)){
|
||||||
bf.append(",");
|
bf.append(",");
|
||||||
@@ -598,7 +604,7 @@ public class DepotItemService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteDepotItemByIds(String ids)throws Exception {
|
public int batchDeleteDepotItemByIds(String ids)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT_ITEM,
|
logService.insertLog("单据明细",
|
||||||
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();
|
||||||
|
|||||||
@@ -51,18 +51,18 @@ public class FunctionsComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return functionsService.updateFunctions(beanJson, id);
|
return functionsService.updateFunctions(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return functionsService.deleteFunctions(id);
|
return functionsService.deleteFunctions(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return functionsService.batchDeleteFunctions(ids);
|
return functionsService.batchDeleteFunctions(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ public class FunctionsService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=functionsMapper.insertSelective(depot);
|
result=functionsMapper.insertSelective(depot);
|
||||||
|
logService.insertLog("功能", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -95,12 +96,14 @@ public class FunctionsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateFunctions(String beanJson, Long id) throws Exception{
|
public int updateFunctions(String beanJson, Long id, HttpServletRequest request) throws Exception{
|
||||||
Functions depot = JSONObject.parseObject(beanJson, Functions.class);
|
Functions depot = JSONObject.parseObject(beanJson, Functions.class);
|
||||||
depot.setId(id);
|
depot.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=functionsMapper.updateByPrimaryKeySelective(depot);
|
result=functionsMapper.updateByPrimaryKeySelective(depot);
|
||||||
|
logService.insertLog("功能",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -108,10 +111,12 @@ public class FunctionsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteFunctions(Long id)throws Exception {
|
public int deleteFunctions(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=functionsMapper.deleteByPrimaryKey(id);
|
result=functionsMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("功能",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -119,13 +124,14 @@ public class FunctionsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteFunctions(String ids)throws Exception {
|
public int batchDeleteFunctions(String ids, HttpServletRequest request)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);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=functionsMapper.deleteByExample(example);
|
result=functionsMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("功能", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -189,7 +195,7 @@ public class FunctionsService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteFunctionsByIds(String ids)throws Exception {
|
public int batchDeleteFunctionsByIds(String ids)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_FUNCTIONS,
|
logService.insertLog("功能",
|
||||||
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();
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ public class InOutItemComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return inOutItemService.updateInOutItem(beanJson, id);
|
return inOutItemService.updateInOutItem(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return inOutItemService.deleteInOutItem(id);
|
return inOutItemService.deleteInOutItem(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return inOutItemService.batchDeleteInOutItem(ids);
|
return inOutItemService.batchDeleteInOutItem(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public class InOutItemService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=inOutItemMapper.insertSelective(depot);
|
result=inOutItemMapper.insertSelective(depot);
|
||||||
|
logService.insertLog("收支项目", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -96,12 +97,14 @@ public class InOutItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateInOutItem(String beanJson, Long id)throws Exception {
|
public int updateInOutItem(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
InOutItem depot = JSONObject.parseObject(beanJson, InOutItem.class);
|
InOutItem depot = JSONObject.parseObject(beanJson, InOutItem.class);
|
||||||
depot.setId(id);
|
depot.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=inOutItemMapper.updateByPrimaryKeySelective(depot);
|
result=inOutItemMapper.updateByPrimaryKeySelective(depot);
|
||||||
|
logService.insertLog("收支项目",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -109,10 +112,12 @@ public class InOutItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteInOutItem(Long id)throws Exception {
|
public int deleteInOutItem(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=inOutItemMapper.deleteByPrimaryKey(id);
|
result=inOutItemMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("收支项目",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -120,13 +125,14 @@ public class InOutItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteInOutItem(String ids)throws Exception {
|
public int batchDeleteInOutItem(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
InOutItemExample example = new InOutItemExample();
|
InOutItemExample example = new InOutItemExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=inOutItemMapper.deleteByExample(example);
|
result=inOutItemMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("收支项目", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -164,7 +170,7 @@ public class InOutItemService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteInOutItemByIds(String ids)throws Exception {
|
public int batchDeleteInOutItemByIds(String ids)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_IN_OUT_ITEM,
|
logService.insertLog("收支项目",
|
||||||
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();
|
||||||
|
|||||||
@@ -61,18 +61,18 @@ public class LogComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return logService.updateLog(beanJson, id);
|
return logService.updateLog(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return logService.deleteLog(id);
|
return logService.deleteLog(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return logService.batchDeleteLog(ids);
|
return logService.batchDeleteLog(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class LogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateLog(String beanJson, Long id)throws Exception {
|
public int updateLog(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
Log log = JSONObject.parseObject(beanJson, Log.class);
|
Log log = JSONObject.parseObject(beanJson, Log.class);
|
||||||
log.setId(id);
|
log.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
@@ -109,7 +109,7 @@ public class LogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteLog(Long id)throws Exception {
|
public int deleteLog(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=logMapper.deleteByPrimaryKey(id);
|
result=logMapper.deleteByPrimaryKey(id);
|
||||||
@@ -120,7 +120,7 @@ public class LogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteLog(String ids)throws Exception {
|
public int batchDeleteLog(String ids, HttpServletRequest request)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);
|
||||||
@@ -148,64 +148,15 @@ public class LogService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getModule(String apiName)throws Exception{
|
public void insertLog(String moduleName, String type, HttpServletRequest request)throws Exception{
|
||||||
String moduleName = null;
|
|
||||||
switch (apiName) {
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_USER:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_USER; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_ROLE:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_ROLE; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_APP:
|
|
||||||
moduleName =BusinessConstants.LOG_MODULE_NAME_APP; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_DEPOT:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_DEPOT; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_FUNCTIONS:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_FUNCTIONS; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_IN_OUT_ITEM:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_IN_OUT_ITEM; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_UNIT:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_UNIT; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_PERSON:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_PERSON; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_USER_BUSINESS:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_USER_BUSINESS; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_SYSTEM_CONFIG:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_SYSTEM_CONFIG; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_PROPERTY:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_MATERIAL_PROPERTY; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_ACCOUNT; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_SUPPLIER:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_SUPPLIER; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_CATEGORY:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_MATERIAL_CATEGORY; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_MATERIAL:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_MATERIAL; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_DEPOT_HEAD:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_DEPOT_HEAD; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_DEPOT_ITEM:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_DEPOT_ITEM; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT_HEAD:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_ACCOUNT_HEAD; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_ACCOUNT_ITEM:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_ACCOUNT_ITEM; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_SERIAL_NUMBER; break;
|
|
||||||
case BusinessConstants.LOG_INTERFACE_NAME_ORGANIZATION:
|
|
||||||
moduleName = BusinessConstants.LOG_MODULE_NAME_ORGANIZATION; break;
|
|
||||||
}
|
|
||||||
return moduleName;
|
|
||||||
}
|
|
||||||
|
|
||||||
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(moduleName);
|
||||||
log.setClientip(getLocalIp(request));
|
log.setClientip(getLocalIp(request));
|
||||||
log.setCreatetime(new Date());
|
log.setCreatetime(new Date());
|
||||||
Byte status = 0;
|
Byte status = 0;
|
||||||
log.setStatus(status);
|
log.setStatus(status);
|
||||||
log.setContentdetails(type + getModule(apiName));
|
log.setContentdetails(type + moduleName);
|
||||||
try{
|
try{
|
||||||
logMapper.insertSelective(log);
|
logMapper.insertSelective(log);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|||||||
@@ -56,18 +56,18 @@ public class MaterialComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return materialService.updateMaterial(beanJson, id);
|
return materialService.updateMaterial(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return materialService.deleteMaterial(id);
|
return materialService.deleteMaterial(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return materialService.batchDeleteMaterial(ids);
|
return materialService.batchDeleteMaterial(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ public class MaterialService {
|
|||||||
int result =0;
|
int result =0;
|
||||||
try{
|
try{
|
||||||
result= materialMapper.insertSelective(material);
|
result= materialMapper.insertSelective(material);
|
||||||
|
logService.insertLog("商品", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -132,7 +133,7 @@ public class MaterialService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateMaterial(String beanJson, Long id) throws Exception{
|
public int updateMaterial(String beanJson, Long id, HttpServletRequest request) throws Exception{
|
||||||
Material material = JSONObject.parseObject(beanJson, Material.class);
|
Material material = JSONObject.parseObject(beanJson, Material.class);
|
||||||
material.setId(id);
|
material.setId(id);
|
||||||
int res =0;
|
int res =0;
|
||||||
@@ -144,6 +145,8 @@ public class MaterialService {
|
|||||||
} else {
|
} else {
|
||||||
materialMapperEx.updateUnitIdNullByPrimaryKey(id); //将多单位置空
|
materialMapperEx.updateUnitIdNullByPrimaryKey(id); //将多单位置空
|
||||||
}
|
}
|
||||||
|
logService.insertLog("商品",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -152,10 +155,12 @@ public class MaterialService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteMaterial(Long id)throws Exception {
|
public int deleteMaterial(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result =0;
|
int result =0;
|
||||||
try{
|
try{
|
||||||
result= materialMapper.deleteByPrimaryKey(id);
|
result= materialMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("商品",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -163,13 +168,14 @@ public class MaterialService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteMaterial(String ids)throws Exception {
|
public int batchDeleteMaterial(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
MaterialExample example = new MaterialExample();
|
MaterialExample example = new MaterialExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result =0;
|
int result =0;
|
||||||
try{
|
try{
|
||||||
result= materialMapper.deleteByExample(example);
|
result= materialMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("商品", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -215,7 +221,7 @@ public class MaterialService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchSetEnable(Boolean enabled, String materialIDs)throws Exception {
|
public int batchSetEnable(Boolean enabled, String materialIDs)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL,
|
logService.insertLog("商品",
|
||||||
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());
|
||||||
List<Long> ids = StringUtil.strToLongList(materialIDs);
|
List<Long> ids = StringUtil.strToLongList(materialIDs);
|
||||||
@@ -292,7 +298,7 @@ public class MaterialService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public BaseResponseInfo importExcel(List<Material> mList) throws Exception {
|
public BaseResponseInfo importExcel(List<Material> mList) throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL,
|
logService.insertLog("商品",
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_IMPORT).append(mList.size()).append(BusinessConstants.LOG_DATA_UNIT).toString(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_IMPORT).append(mList.size()).append(BusinessConstants.LOG_DATA_UNIT).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
BaseResponseInfo info = new BaseResponseInfo();
|
BaseResponseInfo info = new BaseResponseInfo();
|
||||||
@@ -324,7 +330,7 @@ public class MaterialService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteMaterialByIds(String ids) throws Exception{
|
public int batchDeleteMaterialByIds(String ids) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL,
|
logService.insertLog("商品",
|
||||||
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();
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ public class MaterialCategoryComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return materialCategoryService.updateMaterialCategory(beanJson, id);
|
return materialCategoryService.updateMaterialCategory(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return materialCategoryService.deleteMaterialCategory(id);
|
return materialCategoryService.deleteMaterialCategory(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return materialCategoryService.batchDeleteMaterialCategory(ids);
|
return materialCategoryService.batchDeleteMaterialCategory(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ public class MaterialCategoryService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=materialCategoryMapper.insertSelective(materialCategory);
|
result=materialCategoryMapper.insertSelective(materialCategory);
|
||||||
|
logService.insertLog("商品类型", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -125,12 +126,14 @@ public class MaterialCategoryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateMaterialCategory(String beanJson, Long id) throws Exception{
|
public int updateMaterialCategory(String beanJson, Long id, HttpServletRequest request) throws Exception{
|
||||||
MaterialCategory materialCategory = JSONObject.parseObject(beanJson, MaterialCategory.class);
|
MaterialCategory materialCategory = JSONObject.parseObject(beanJson, MaterialCategory.class);
|
||||||
materialCategory.setId(id);
|
materialCategory.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=materialCategoryMapper.updateByPrimaryKeySelective(materialCategory);
|
result=materialCategoryMapper.updateByPrimaryKeySelective(materialCategory);
|
||||||
|
logService.insertLog("商品类型",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -138,10 +141,12 @@ public class MaterialCategoryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteMaterialCategory(Long id)throws Exception {
|
public int deleteMaterialCategory(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=materialCategoryMapper.deleteByPrimaryKey(id);
|
result=materialCategoryMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("商品类型",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -149,13 +154,14 @@ public class MaterialCategoryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteMaterialCategory(String ids)throws Exception {
|
public int batchDeleteMaterialCategory(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
MaterialCategoryExample example = new MaterialCategoryExample();
|
MaterialCategoryExample example = new MaterialCategoryExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=materialCategoryMapper.deleteByExample(example);
|
result=materialCategoryMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("商品类型", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -204,7 +210,7 @@ public class MaterialCategoryService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int addMaterialCategory(MaterialCategory mc) throws Exception {
|
public int addMaterialCategory(MaterialCategory mc) throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_CATEGORY,
|
logService.insertLog("商品类型",
|
||||||
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
if(mc==null){
|
if(mc==null){
|
||||||
@@ -238,7 +244,7 @@ public class MaterialCategoryService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteMaterialCategoryByIds(String ids) throws Exception {
|
public int batchDeleteMaterialCategoryByIds(String ids) throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_CATEGORY,
|
logService.insertLog("商品类型",
|
||||||
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());
|
||||||
//更新时间
|
//更新时间
|
||||||
@@ -260,7 +266,7 @@ public class MaterialCategoryService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int editMaterialCategory(MaterialCategory mc) throws Exception{
|
public int editMaterialCategory(MaterialCategory mc) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_CATEGORY,
|
logService.insertLog("商品类型",
|
||||||
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());
|
||||||
if(mc.getParentid()==null){
|
if(mc.getParentid()==null){
|
||||||
|
|||||||
@@ -48,18 +48,18 @@ public class MaterialPropertyComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return materialPropertyService.updateMaterialProperty(beanJson, id);
|
return materialPropertyService.updateMaterialProperty(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return materialPropertyService.deleteMaterialProperty(id);
|
return materialPropertyService.deleteMaterialProperty(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return materialPropertyService.batchDeleteMaterialProperty(ids);
|
return materialPropertyService.batchDeleteMaterialProperty(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public class MaterialPropertyService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=materialPropertyMapper.insertSelective(materialProperty);
|
result=materialPropertyMapper.insertSelective(materialProperty);
|
||||||
|
logService.insertLog("商品属性", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -94,12 +95,14 @@ public class MaterialPropertyService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateMaterialProperty(String beanJson, Long id)throws Exception {
|
public int updateMaterialProperty(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
MaterialProperty materialProperty = JSONObject.parseObject(beanJson, MaterialProperty.class);
|
MaterialProperty materialProperty = JSONObject.parseObject(beanJson, MaterialProperty.class);
|
||||||
materialProperty.setId(id);
|
materialProperty.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=materialPropertyMapper.updateByPrimaryKeySelective(materialProperty);
|
result=materialPropertyMapper.updateByPrimaryKeySelective(materialProperty);
|
||||||
|
logService.insertLog("商品属性",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -107,10 +110,12 @@ public class MaterialPropertyService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteMaterialProperty(Long id)throws Exception {
|
public int deleteMaterialProperty(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=materialPropertyMapper.deleteByPrimaryKey(id);
|
result=materialPropertyMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("商品属性",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -118,13 +123,14 @@ public class MaterialPropertyService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteMaterialProperty(String ids)throws Exception {
|
public int batchDeleteMaterialProperty(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
MaterialPropertyExample example = new MaterialPropertyExample();
|
MaterialPropertyExample example = new MaterialPropertyExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=materialPropertyMapper.deleteByExample(example);
|
result=materialPropertyMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("商品属性", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -136,7 +142,7 @@ public class MaterialPropertyService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteMaterialPropertyByIds(String ids) throws Exception{
|
public int batchDeleteMaterialPropertyByIds(String ids) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_MATERIAL_PROPERTY,
|
logService.insertLog("商品属性",
|
||||||
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();
|
||||||
|
|||||||
@@ -49,18 +49,18 @@ public class MsgComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return msgService.updateMsg(beanJson, id);
|
return msgService.updateMsg(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return msgService.deleteMsg(id);
|
return msgService.deleteMsg(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return msgService.batchDeleteMsg(ids);
|
return msgService.batchDeleteMsg(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ public class MsgService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=msgMapper.insertSelective(msg);
|
result=msgMapper.insertSelective(msg);
|
||||||
|
logService.insertLog("消息", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||||
@@ -107,12 +108,14 @@ public class MsgService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateMsg(String beanJson, Long id) throws Exception{
|
public int updateMsg(String beanJson, Long id, HttpServletRequest request) throws Exception{
|
||||||
Msg msg = JSONObject.parseObject(beanJson, Msg.class);
|
Msg msg = JSONObject.parseObject(beanJson, Msg.class);
|
||||||
msg.setId(id);
|
msg.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=msgMapper.updateByPrimaryKeySelective(msg);
|
result=msgMapper.updateByPrimaryKeySelective(msg);
|
||||||
|
logService.insertLog("消息",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||||
@@ -123,10 +126,12 @@ public class MsgService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteMsg(Long id)throws Exception {
|
public int deleteMsg(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=msgMapper.deleteByPrimaryKey(id);
|
result=msgMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("消息",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||||
@@ -137,13 +142,14 @@ public class MsgService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteMsg(String ids) throws Exception{
|
public int batchDeleteMsg(String ids, HttpServletRequest request) throws Exception{
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
MsgExample example = new MsgExample();
|
MsgExample example = new MsgExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=msgMapper.deleteByExample(example);
|
result=msgMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("消息", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||||
@@ -179,7 +185,7 @@ public class MsgService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteMsgByIds(String ids) throws Exception{
|
public int batchDeleteMsgByIds(String ids) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
|
logService.insertLog("序列号",
|
||||||
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());
|
||||||
String [] idArray=ids.split(",");
|
String [] idArray=ids.split(",");
|
||||||
|
|||||||
@@ -45,18 +45,18 @@ public class OrgaUserRelComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return orgaUserRelService.updateOrgaUserRel(beanJson,id);
|
return orgaUserRelService.updateOrgaUserRel(beanJson,id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return orgaUserRelService.deleteOrgaUserRel(id);
|
return orgaUserRelService.deleteOrgaUserRel(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return orgaUserRelService.batchDeleteOrgaUserRel(ids);
|
return orgaUserRelService.batchDeleteOrgaUserRel(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -53,41 +53,47 @@ public class OrgaUserRelService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=orgaUserRelMapper.insertSelective(orgaUserRel);
|
result=orgaUserRelMapper.insertSelective(orgaUserRel);
|
||||||
|
logService.insertLog("用户与机构关系", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateOrgaUserRel(String beanJson, Long id) throws Exception{
|
public int updateOrgaUserRel(String beanJson, Long id, HttpServletRequest request) throws Exception{
|
||||||
OrgaUserRel orgaUserRel = JSONObject.parseObject(beanJson, OrgaUserRel.class);
|
OrgaUserRel orgaUserRel = JSONObject.parseObject(beanJson, OrgaUserRel.class);
|
||||||
orgaUserRel.setId(id);
|
orgaUserRel.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=orgaUserRelMapper.updateByPrimaryKeySelective(orgaUserRel);
|
result=orgaUserRelMapper.updateByPrimaryKeySelective(orgaUserRel);
|
||||||
|
logService.insertLog("用户与机构关系",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteOrgaUserRel(Long id)throws Exception {
|
public int deleteOrgaUserRel(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=orgaUserRelMapper.deleteByPrimaryKey(id);
|
result=orgaUserRelMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("用户与机构关系",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteOrgaUserRel(String ids)throws Exception {
|
public int batchDeleteOrgaUserRel(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
OrgaUserRelExample example = new OrgaUserRelExample();
|
OrgaUserRelExample example = new OrgaUserRelExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=orgaUserRelMapper.deleteByExample(example);
|
result=orgaUserRelMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("用户与机构关系", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,18 +46,18 @@ public class OrganizationComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return organizationService.updateOrganization(beanJson,id);
|
return organizationService.updateOrganization(beanJson,id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return organizationService.deleteOrganization(id);
|
return organizationService.deleteOrganization(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return organizationService.batchDeleteOrganization(ids);
|
return organizationService.batchDeleteOrganization(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -56,41 +56,47 @@ public class OrganizationService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=organizationMapper.insertSelective(organization);
|
result=organizationMapper.insertSelective(organization);
|
||||||
|
logService.insertLog("机构", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateOrganization(String beanJson, Long id)throws Exception {
|
public int updateOrganization(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
Organization organization = JSONObject.parseObject(beanJson, Organization.class);
|
Organization organization = JSONObject.parseObject(beanJson, Organization.class);
|
||||||
organization.setId(id);
|
organization.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=organizationMapper.updateByPrimaryKeySelective(organization);
|
result=organizationMapper.updateByPrimaryKeySelective(organization);
|
||||||
|
logService.insertLog("机构",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteOrganization(Long id)throws Exception {
|
public int deleteOrganization(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=organizationMapper.deleteByPrimaryKey(id);
|
result=organizationMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("机构",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteOrganization(String ids)throws Exception {
|
public int batchDeleteOrganization(String ids, HttpServletRequest request)throws Exception {
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
OrganizationExample example = new OrganizationExample();
|
OrganizationExample example = new OrganizationExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=organizationMapper.deleteByExample(example);
|
result=organizationMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("机构", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -98,7 +104,7 @@ public class OrganizationService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int addOrganization(Organization org) throws Exception{
|
public int addOrganization(Organization org) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ORGANIZATION,
|
logService.insertLog("机构",
|
||||||
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
//新增时间
|
//新增时间
|
||||||
@@ -133,7 +139,7 @@ public class OrganizationService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int editOrganization(Organization org)throws Exception {
|
public int editOrganization(Organization org)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ORGANIZATION,
|
logService.insertLog("机构",
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(org.getId()).toString(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(org.getId()).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
//修改时间
|
//修改时间
|
||||||
@@ -233,7 +239,7 @@ public class OrganizationService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteOrganizationByIds(String ids) throws Exception{
|
public int batchDeleteOrganizationByIds(String ids) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_ORGANIZATION,
|
logService.insertLog("机构",
|
||||||
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();
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ public class PersonComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return personService.updatePerson(beanJson, id);
|
return personService.updatePerson(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return personService.deletePerson(id);
|
return personService.deletePerson(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return personService.batchDeletePerson(ids);
|
return personService.batchDeletePerson(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public class PersonService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=personMapper.insertSelective(person);
|
result=personMapper.insertSelective(person);
|
||||||
|
logService.insertLog("经手人", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -99,12 +100,14 @@ public class PersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updatePerson(String beanJson, Long id)throws Exception {
|
public int updatePerson(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
Person person = JSONObject.parseObject(beanJson, Person.class);
|
Person person = JSONObject.parseObject(beanJson, Person.class);
|
||||||
person.setId(id);
|
person.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=personMapper.updateByPrimaryKeySelective(person);
|
result=personMapper.updateByPrimaryKeySelective(person);
|
||||||
|
logService.insertLog("经手人",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -112,10 +115,12 @@ public class PersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deletePerson(Long id)throws Exception {
|
public int deletePerson(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=personMapper.deleteByPrimaryKey(id);
|
result=personMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("经手人",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -123,13 +128,14 @@ public class PersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeletePerson(String ids) throws Exception{
|
public int batchDeletePerson(String ids, HttpServletRequest request) throws Exception{
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
PersonExample example = new PersonExample();
|
PersonExample example = new PersonExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=personMapper.deleteByExample(example);
|
result=personMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("经手人", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -183,7 +189,7 @@ public class PersonService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeletePersonByIds(String ids)throws Exception {
|
public int batchDeletePersonByIds(String ids)throws Exception {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_PERSON,
|
logService.insertLog("经手人",
|
||||||
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();
|
||||||
|
|||||||
@@ -49,18 +49,18 @@ public class RoleComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return roleService.updateRole(beanJson, id);
|
return roleService.updateRole(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return roleService.deleteRole(id);
|
return roleService.deleteRole(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return roleService.batchDeleteRole(ids);
|
return roleService.batchDeleteRole(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public class RoleService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=roleMapper.insertSelective(role);
|
result=roleMapper.insertSelective(role);
|
||||||
|
logService.insertLog("角色", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -93,12 +94,14 @@ public class RoleService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateRole(String beanJson, Long id) throws Exception{
|
public int updateRole(String beanJson, Long id, HttpServletRequest request) throws Exception{
|
||||||
Role role = JSONObject.parseObject(beanJson, Role.class);
|
Role role = JSONObject.parseObject(beanJson, Role.class);
|
||||||
role.setId(id);
|
role.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=roleMapper.updateByPrimaryKeySelective(role);
|
result=roleMapper.updateByPrimaryKeySelective(role);
|
||||||
|
logService.insertLog("角色",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -106,10 +109,12 @@ public class RoleService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int deleteRole(Long id)throws Exception {
|
public int deleteRole(Long id, HttpServletRequest request)throws Exception {
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=roleMapper.deleteByPrimaryKey(id);
|
result=roleMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("角色",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -117,13 +122,14 @@ public class RoleService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteRole(String ids) throws Exception{
|
public int batchDeleteRole(String ids, HttpServletRequest request) throws Exception{
|
||||||
List<Long> idList = StringUtil.strToLongList(ids);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
RoleExample example = new RoleExample();
|
RoleExample example = new RoleExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=roleMapper.deleteByExample(example);
|
result=roleMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("角色", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -153,7 +159,7 @@ public class RoleService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteRoleByIds(String ids) throws Exception{
|
public int batchDeleteRoleByIds(String ids) throws Exception{
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
|
logService.insertLog("序列号",
|
||||||
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();
|
||||||
|
|||||||
@@ -56,18 +56,18 @@ public class SerialNumberComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return serialNumberService.updateSerialNumber(beanJson, id);
|
return serialNumberService.updateSerialNumber(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return serialNumberService.deleteSerialNumber(id);
|
return serialNumberService.deleteSerialNumber(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return serialNumberService.batchDeleteSerialNumber(ids);
|
return serialNumberService.batchDeleteSerialNumber(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -94,10 +94,11 @@ public class SerialNumberService {
|
|||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int insertSerialNumber(String beanJson, HttpServletRequest request)throws Exception {
|
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_OPERATION_TYPE_ADD, request);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=serialNumberMapper.insertSelective(serialNumber);
|
result=serialNumberMapper.insertSelective(serialNumber);
|
||||||
|
logService.insertLog("序列号", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -105,12 +106,14 @@ public class SerialNumberService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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 serialNumber = JSONObject.parseObject(beanJson, SerialNumber.class);
|
||||||
serialNumber.setId(id);
|
serialNumber.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=serialNumberMapper.updateByPrimaryKeySelective(serialNumber);
|
result=serialNumberMapper.updateByPrimaryKeySelective(serialNumber);
|
||||||
|
logService.insertLog("序列号",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -118,10 +121,12 @@ public class SerialNumberService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=serialNumberMapper.deleteByPrimaryKey(id);
|
result=serialNumberMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("序列号",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -129,13 +134,14 @@ public class SerialNumberService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
SerialNumberExample example = new SerialNumberExample();
|
SerialNumberExample example = new SerialNumberExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=serialNumberMapper.deleteByExample(example);
|
result=serialNumberMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("序列号", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -246,7 +252,7 @@ public class SerialNumberService {
|
|||||||
* */
|
* */
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public SerialNumberEx addSerialNumber(SerialNumberEx serialNumberEx) throws Exception{
|
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());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
if(serialNumberEx==null){
|
if(serialNumberEx==null){
|
||||||
return null;
|
return null;
|
||||||
@@ -276,7 +282,7 @@ public class SerialNumberService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public SerialNumberEx updateSerialNumber(SerialNumberEx serialNumberEx)throws Exception {
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(serialNumberEx.getId()).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
if(serialNumberEx==null){
|
if(serialNumberEx==null){
|
||||||
@@ -454,7 +460,7 @@ public class SerialNumberService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void batAddSerialNumber(String materialName, String serialNumberPrefix, Integer batAddTotal, String remark)throws Exception {
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_BATCH_ADD).append(batAddTotal).append(BusinessConstants.LOG_DATA_UNIT).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
if(StringUtil.isNotEmpty(materialName)){
|
if(StringUtil.isNotEmpty(materialName)){
|
||||||
@@ -505,7 +511,7 @@ public class SerialNumberService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteSerialNumberByIds(String ids) throws Exception{
|
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(),
|
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();
|
||||||
|
|||||||
@@ -58,18 +58,18 @@ public class SupplierComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return supplierService.updateSupplier(beanJson, id);
|
return supplierService.updateSupplier(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return supplierService.deleteSupplier(id);
|
return supplierService.deleteSupplier(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return supplierService.batchDeleteSupplier(ids);
|
return supplierService.batchDeleteSupplier(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public class SupplierService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=supplierMapper.insertSelective(supplier);
|
result=supplierMapper.insertSelective(supplier);
|
||||||
|
logService.insertLog("商家", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -140,7 +141,7 @@ public class SupplierService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
Supplier supplier = JSONObject.parseObject(beanJson, Supplier.class);
|
||||||
if(supplier.getBeginneedpay() == null) {
|
if(supplier.getBeginneedpay() == null) {
|
||||||
supplier.setBeginneedpay(BigDecimal.ZERO);
|
supplier.setBeginneedpay(BigDecimal.ZERO);
|
||||||
@@ -152,6 +153,8 @@ public class SupplierService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=supplierMapper.updateByPrimaryKeySelective(supplier);
|
result=supplierMapper.updateByPrimaryKeySelective(supplier);
|
||||||
|
logService.insertLog("商家",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -159,10 +162,12 @@ public class SupplierService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=supplierMapper.deleteByPrimaryKey(id);
|
result=supplierMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("商家",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -170,13 +175,14 @@ public class SupplierService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
SupplierExample example = new SupplierExample();
|
SupplierExample example = new SupplierExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=supplierMapper.deleteByExample(example);
|
result=supplierMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("商家", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -197,7 +203,7 @@ public class SupplierService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateAdvanceIn(Long supplierId, BigDecimal advanceIn)throws Exception{
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplierId).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
Supplier supplier=null;
|
Supplier supplier=null;
|
||||||
@@ -275,7 +281,7 @@ public class SupplierService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchSetEnable(Boolean enabled, String supplierIDs)throws Exception {
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(supplierIDs).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
List<Long> ids = StringUtil.strToLongList(supplierIDs);
|
List<Long> ids = StringUtil.strToLongList(supplierIDs);
|
||||||
@@ -318,7 +324,7 @@ public class SupplierService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public BaseResponseInfo importExcel(List<Supplier> mList) throws Exception {
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_IMPORT).append(mList.size()).append(BusinessConstants.LOG_DATA_UNIT).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
BaseResponseInfo info = new BaseResponseInfo();
|
BaseResponseInfo info = new BaseResponseInfo();
|
||||||
@@ -339,7 +345,7 @@ public class SupplierService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteSupplierByIds(String ids)throws Exception {
|
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(),
|
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();
|
||||||
|
|||||||
@@ -50,18 +50,18 @@ public class SystemConfigComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return systemConfigService.updateSystemConfig(beanJson, id);
|
return systemConfigService.updateSystemConfig(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return systemConfigService.deleteSystemConfig(id);
|
return systemConfigService.deleteSystemConfig(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return systemConfigService.batchDeleteSystemConfig(ids);
|
return systemConfigService.batchDeleteSystemConfig(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public class SystemConfigService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=systemConfigMapper.insertSelective(systemConfig);
|
result=systemConfigMapper.insertSelective(systemConfig);
|
||||||
|
logService.insertLog("系统配置", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -94,12 +95,14 @@ public class SystemConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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 systemConfig = JSONObject.parseObject(beanJson, SystemConfig.class);
|
||||||
systemConfig.setId(id);
|
systemConfig.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=systemConfigMapper.updateByPrimaryKeySelective(systemConfig);
|
result=systemConfigMapper.updateByPrimaryKeySelective(systemConfig);
|
||||||
|
logService.insertLog("系统配置",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -107,10 +110,12 @@ public class SystemConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=systemConfigMapper.deleteByPrimaryKey(id);
|
result=systemConfigMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("系统配置",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -118,13 +123,14 @@ public class SystemConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
SystemConfigExample example = new SystemConfigExample();
|
SystemConfigExample example = new SystemConfigExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=systemConfigMapper.deleteByExample(example);
|
result=systemConfigMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("系统配置", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -145,7 +151,7 @@ public class SystemConfigService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteSystemConfigByIds(String ids)throws Exception {
|
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(),
|
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();
|
||||||
|
|||||||
@@ -49,18 +49,18 @@ public class TenantComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return tenantService.updateTenant(beanJson, id);
|
return tenantService.updateTenant(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return tenantService.deleteTenant(id);
|
return tenantService.deleteTenant(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return tenantService.batchDeleteTenant(ids);
|
return tenantService.batchDeleteTenant(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class TenantService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
Tenant tenant = JSONObject.parseObject(beanJson, Tenant.class);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
@@ -96,7 +96,7 @@ public class TenantService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result= tenantMapper.deleteByPrimaryKey(id);
|
result= tenantMapper.deleteByPrimaryKey(id);
|
||||||
@@ -107,7 +107,7 @@ public class TenantService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
TenantExample example = new TenantExample();
|
TenantExample example = new TenantExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
|
|||||||
@@ -48,18 +48,18 @@ public class UnitComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return unitService.updateUnit(beanJson, id);
|
return unitService.updateUnit(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return unitService.deleteUnit(id);
|
return unitService.deleteUnit(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return unitService.batchDeleteUnit(ids);
|
return unitService.batchDeleteUnit(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public class UnitService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=unitMapper.insertSelective(unit);
|
result=unitMapper.insertSelective(unit);
|
||||||
|
logService.insertLog("计量单位", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -96,12 +97,14 @@ public class UnitService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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 unit = JSONObject.parseObject(beanJson, Unit.class);
|
||||||
unit.setId(id);
|
unit.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=unitMapper.updateByPrimaryKeySelective(unit);
|
result=unitMapper.updateByPrimaryKeySelective(unit);
|
||||||
|
logService.insertLog("计量单位",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -109,10 +112,12 @@ public class UnitService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=unitMapper.deleteByPrimaryKey(id);
|
result=unitMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("计量单位",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -120,13 +125,14 @@ public class UnitService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
UnitExample example = new UnitExample();
|
UnitExample example = new UnitExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=unitMapper.deleteByExample(example);
|
result=unitMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("计量单位", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -146,7 +152,7 @@ public class UnitService {
|
|||||||
}
|
}
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteUnitByIds(String ids)throws Exception {
|
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(),
|
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();
|
||||||
|
|||||||
@@ -50,18 +50,18 @@ public class UserComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return userService.updateUser(beanJson, id);
|
return userService.updateUser(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return userService.deleteUser(id);
|
return userService.deleteUser(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return userService.batchDeleteUser(ids);
|
return userService.batchDeleteUser(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ public class UserService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=userMapper.insertSelective(user);
|
result=userMapper.insertSelective(user);
|
||||||
|
logService.insertLog("用户", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -135,12 +136,14 @@ public class UserService {
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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 user = JSONObject.parseObject(beanJson, User.class);
|
||||||
user.setId(id);
|
user.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=userMapper.updateByPrimaryKeySelective(user);
|
result=userMapper.updateByPrimaryKeySelective(user);
|
||||||
|
logService.insertLog("用户",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -156,7 +159,7 @@ public class UserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateUserByObj(User user) throws Exception{
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
int result=0;
|
int result=0;
|
||||||
@@ -178,7 +181,7 @@ public class UserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int resetPwd(String md5Pwd, Long id) throws Exception{
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
User user = new User();
|
User user = new User();
|
||||||
@@ -194,10 +197,12 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result= userMapper.deleteByPrimaryKey(id);
|
result= userMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("用户",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -205,13 +210,14 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
UserExample example = new UserExample();
|
UserExample example = new UserExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result= userMapper.deleteByExample(example);
|
result= userMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("用户", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -307,7 +313,7 @@ public class UserService {
|
|||||||
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
||||||
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
||||||
} else {
|
} else {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
|
logService.insertLog("用户",
|
||||||
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
BusinessConstants.LOG_OPERATION_TYPE_ADD,
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
//检查用户名和登录名
|
//检查用户名和登录名
|
||||||
@@ -438,7 +444,7 @@ public class UserService {
|
|||||||
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
||||||
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
||||||
} else {
|
} else {
|
||||||
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
|
logService.insertLog("用户",
|
||||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ue.getId()).toString(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ue.getId()).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
//检查用户名和登录名
|
//检查用户名和登录名
|
||||||
@@ -586,7 +592,7 @@ public class UserService {
|
|||||||
* */
|
* */
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void batDeleteUser(String ids) throws Exception{
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
String idsArray[]=ids.split(",");
|
String idsArray[]=ids.split(",");
|
||||||
|
|||||||
@@ -46,18 +46,18 @@ public class UserBusinessComponent implements ICommonQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(String beanJson, Long id)throws Exception {
|
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
|
||||||
return userBusinessService.updateUserBusiness(beanJson, id);
|
return userBusinessService.updateUserBusiness(beanJson, id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(Long id)throws Exception {
|
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||||
return userBusinessService.deleteUserBusiness(id);
|
return userBusinessService.deleteUserBusiness(id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchDelete(String ids)throws Exception {
|
public int batchDelete(String ids, HttpServletRequest request)throws Exception {
|
||||||
return userBusinessService.batchDeleteUserBusiness(ids);
|
return userBusinessService.batchDeleteUserBusiness(ids, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public class UserBusinessService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=userBusinessMapper.insertSelective(userBusiness);
|
result=userBusinessMapper.insertSelective(userBusiness);
|
||||||
|
logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -79,12 +80,14 @@ public class UserBusinessService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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 userBusiness = JSONObject.parseObject(beanJson, UserBusiness.class);
|
||||||
userBusiness.setId(id);
|
userBusiness.setId(id);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
|
result=userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
|
||||||
|
logService.insertLog("关联关系",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -92,10 +95,12 @@ public class UserBusinessService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=userBusinessMapper.deleteByPrimaryKey(id);
|
result=userBusinessMapper.deleteByPrimaryKey(id);
|
||||||
|
logService.insertLog("关联关系",
|
||||||
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -103,13 +108,14 @@ public class UserBusinessService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@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);
|
List<Long> idList = StringUtil.strToLongList(ids);
|
||||||
UserBusinessExample example = new UserBusinessExample();
|
UserBusinessExample example = new UserBusinessExample();
|
||||||
example.createCriteria().andIdIn(idList);
|
example.createCriteria().andIdIn(idList);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result=userBusinessMapper.deleteByExample(example);
|
result=userBusinessMapper.deleteByExample(example);
|
||||||
|
logService.insertLog("关联关系", "批量删除,id集:" + ids, request);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -175,7 +181,7 @@ public class UserBusinessService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int updateBtnStr(Long userBusinessId, String btnStr) throws Exception{
|
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(),
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(userBusinessId).toString(),
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
UserBusiness userBusiness = new UserBusiness();
|
UserBusiness userBusiness = new UserBusiness();
|
||||||
@@ -220,7 +226,7 @@ public class UserBusinessService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchDeleteUserBusinessByIds(String ids) throws Exception{
|
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(),
|
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();
|
||||||
|
|||||||
Reference in New Issue
Block a user