版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/liuyunshengsir/article/details/78183058
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;

---------------------
作者:liuyunshengsir
来源:CSDN
原文:https://blog.csdn.net/liuyunshengsir/article/details/78183058
版权声明:本文为博主原创文章,转载请附上博文链接!

最新文章

  1. Jsp字符编码过滤器
  2. 认识WebSocket理论篇
  3. PDF解决方案(4)--在线浏览
  4. TreeView控制消息
  5. php项目报错 Warning: session_start(): open(D:/software/wamp/wamp/tmp\sess_msrjot7f32ciqb1p2hr4ahejg4, O_RDWR) f
  6. JSP和Servlet笔记
  7. Js默认参数(多参数情况)
  8. ioctl,unlocked_ioctl 处理方法
  9. jquert 判断checkbox 是否选中
  10. jacascript 原生选项卡插件
  11. FWT(快速沃尔什变换)小结
  12. win32: WM_PAINT 实现双缓冲缓图
  13. linux更好看的top界面htop
  14. Spring源码分析之IoC容器初始化
  15. Frps 家庭服务器访问解决方案
  16. MySQL性能管理及架构设计
  17. mapreduce 多种输入
  18. 编程入门python之定义函数【转】
  19. nginx之gzlib压缩,expires缓存
  20. Socket服务端

热门文章

  1. pandas的基本功能
  2. mariadb增删改查
  3. java面试01-网络知识
  4. tensorflow中张量_常量_变量_占位符
  5. Python线程学习
  6. STM32Cube IDE配置串口发送与接收
  7. Noip2018退役记。
  8. Linux系统中的硬件问题如何排查?(1)
  9. 《Head First 软件开发》阅读二
  10. 故障检测、性能调优与Java类加载机制