Service层获取HttpServletRequest request
来源:互联网 发布:十大巅峰网络小说知乎 编辑:程序博客网 时间:2024/06/14 06:26
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder .getRequestAttributes()).getRequest(); //操作日志基本字段 OperationLog operationLog=new OperationLog(); operationLog.setOperationLogId(UUIDUtils.create()); operationLog.setOperationPeople(request.getSession().getAttribute("userName").toString()); operationLog.setOperationDate(new Date()); operationLog.setOperationModule("组织架构管理"); //操作前 sysDepartmentDao.selectByPrimaryKey(sysDepartment.getCreateId()); String beforeContent="部门名称:"+sysDepartment.getDepartmentName()+ ",部门简介:"+sysDepartment.getDepartmentInfo()+ ",状态:"+sysDepartment.getIsValid(); operationLog.setOperationIp(request.getLocalAddr()); int count = 0; count = sysDepartmentDao.updateByPrimaryKeySelective(sysDepartment); if(count==1){ //操作后 sysDepartmentDao.selectByPrimaryKey(sysDepartment.getCreateId()); String afterContent="部门名称:"+sysDepartment.getDepartmentName()+ ",部门简介:"+sysDepartment.getDepartmentInfo()+ ",状态:"+sysDepartment.getIsValid(); operationLog.setOperationContent("操作前:("+beforeContent+")操作后:("+afterContent+")"); operationLog.setOperationResult("成功"); operationLogDao.insertOperationLogInfo(operationLog); }else{ operationLog.setOperationResult("失败"); operationLogDao.insertOperationLogInfo(operationLog); } return count;
阅读全文
0 0
- Service层获取HttpServletRequest request
- HttpServletRequest request 获取当前路径
- spring mvc获取request HttpServletRequest
- java中在Service层获取request,获取绝对路径
- spring在service层获取session和request
- spring在service层获取session和request
- spring在service层和dao层如何获取request和session
- spring-mvc 非 controller 层获取HttpServletRequest
- 定时器 获取 service层
- spring mvc Service 获取request
- HttpServletRequest request 获取form参数的两种方式
- 在Weblogic Web Service中获取 HttpServletRequest/Response 对象
- 如何理解HttpServletRequest request
- HttpServletRequest、 ServletRequest、Request
- httpservletRequest 与Map request
- HttpServletRequest request ServletRequestUtils
- Struts非Action层获取request
- Grails Service 获取session,response,request,servletContext
- Yaw Pitch Roll的变换顺序问题
- jquery的ajax提交form表单
- HTTP与HTTPS的区别(2)
- jQuery操作input值总结
- imageloader的配置
- Service层获取HttpServletRequest request
- imageloader的配置
- 链表的简单认识ios
- Java中的UML
- 最佳缝合线拼接算法
- Java内存管理
- android中获取TextView行数
- oracle 标识无效
- 集合框架专题6—HashMap