| | |
| | | package com.dy.pmsGlobal.aop; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.daoBa.BaLogMapper; |
| | | import com.dy.pmsGlobal.pojoBa.BaLog; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class LogSv { |
| | | |
| | | @Autowired |
| | | private BaLogMapper logMapper; |
| | | private BaLogMapper dao; |
| | | |
| | | public void save(long operator, String operation,String resIp) { |
| | | BaLog log = new BaLog(); |
| | |
| | | log.setContent(operation); |
| | | log.setCreateDt(new Date()); |
| | | log.setResIp(resIp); |
| | | logMapper.insert(log); |
| | | dao.insert(log); |
| | | } |
| | | |
| | | /** |
| | | * 得到日志 |
| | | * |
| | | * @param id 日志ID |
| | | * @return 实体 |
| | | */ |
| | | public BaLog selectById(Long id) { |
| | | return dao.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取日志列表 |
| | | */ |
| | | public QueryResultVo<List<BaLog>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | //查询符合条件的记录总数 |
| | | Long itemTotal = dao.selectSomeCount(params); |
| | | |
| | | QueryResultVo<List<BaLog>> rsVo = new QueryResultVo<>(queryVo.pageSize, queryVo.pageCurr) ; |
| | | //计算分页等信息 |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | |
| | | //查询符合条件的记录 |
| | | rsVo.obj = this.dao.selectSome(params) ; |
| | | return rsVo ; |
| | | } |
| | | } |