| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.UserOperation; |
| | | import com.whyc.mapper.UserLogMapper; |
| | | import com.whyc.pojo.UserLog; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.DateUtil; |
| | | import com.whyc.util.ExcelUtil; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | |
| | | String now = DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(new Date()); |
| | | ExcelUtil.exportExcel("UserLog-"+now,"测试sheet1",columnTitleArr,value,new HSSFWorkbook(),response); |
| | | } |
| | | |
| | | public void record(long uId, int operationType, String msg) { |
| | | UserLog userLog = new UserLog(); |
| | | userLog.setTerminalIp(ActionUtil.getRequest().getRemoteAddr()); |
| | | //userLog.setTerminalIp(request.getRemoteAddr()); |
| | | userLog.setOperationTime(new Date()); |
| | | userLog.setUId((int)(uId)); |
| | | userLog.setOperationType(operationType); |
| | | userLog.setOperationMsg(msg); |
| | | mapper.insert(userLog); |
| | | } |
| | | |
| | | public void record(long uId, int operationType, String msg,String msgDetail) { |
| | | UserLog userLog = new UserLog(); |
| | | userLog.setTerminalIp(ActionUtil.getRequest().getRemoteAddr()); |
| | | //userLog.setTerminalIp(request.getRemoteAddr()); |
| | | userLog.setOperationTime(new Date()); |
| | | userLog.setUId((int)(uId)); |
| | | userLog.setOperationType(operationType); |
| | | userLog.setOperationMsg(msg); |
| | | userLog.setOperationDetail(msgDetail); |
| | | mapper.insert(userLog); |
| | | } |
| | | } |