| | |
| | | import com.whyc.mapper.OperationLogMapper; |
| | | import com.whyc.pojo.db_user.OperationLog; |
| | | import com.whyc.pojo.db_user.UserInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.HttpUtil; |
| | | import com.whyc.util.UserUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private OperationLogMapper mapper; |
| | | |
| | | @Autowired(required = false) |
| | | private AreaInfService areaInfService; |
| | | |
| | | @Autowired(required = false) |
| | | private AreaUserService areaUserService; |
| | | |
| | | |
| | | |
| | | public void record(Integer type1, Integer type2, String msg, String detail) { |
| | |
| | | public Response getPage(OperationLog param) { |
| | | Integer pageNum = param.getPageNum(); |
| | | Integer pageSize = param.getPageSize(); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | QueryWrapper<OperationLog> query = Wrappers.query(); |
| | | if(param.getUserName() != null){ |
| | | query.eq("user_name",param.getUserName()); |
| | | } |
| | | UserInf uinf= ActionUtil.getUser(); |
| | | List areaList=areaInfService.getAllAreaUser(uinf.getUid(),uinf.getUrole()); |
| | | List<String> unameList=areaUserService.getUserNameByAreaIds(areaList); |
| | | if(unameList != null){ |
| | | query.in("user_name",unameList); |
| | | } |
| | | if(param.getType1() != null){ |
| | | query.eq("type1",param.getType1()); |
| | |
| | | query.le("create_time", param.getEndTime()); |
| | | } |
| | | query.orderByDesc("id"); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<OperationLog> operationLogs = mapper.selectList(query); |
| | | injectTypeName(operationLogs); |
| | | PageInfo<OperationLog> pageInfo = new PageInfo<>(operationLogs); |