OperateLogManagerImpl.java 2.86 KB
package com.diligrp.website.manager.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.diligrp.website.dao.OperateLogDao;
import com.diligrp.website.domain.OperateLog;
import com.diligrp.website.manager.OperateLogManager;


/**
 * <B>Description</B> TODO <br />
 * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
 * <B>Company</B> 地利集团
 * @createTime 2014年6月19日 下午3:13:59
 * @author liujie
 */
@Component
public class OperateLogManagerImpl implements OperateLogManager {
    @Resource
    private OperateLogDao operateLogDao;
    private static final Logger logger = LoggerFactory.getLogger(OperateLogManagerImpl.class);
    
    /* (non-Javadoc)
     * @see com.diligrp.website.manager.OperateLogManager#operateLog(com.diligrp.website.domain.OperateLog)
     */
    @Override
    public boolean saveOperateLog(OperateLog operateLog) {
        try{
            logger.info("操作:记录操作日志,方法:saveOperateLog,参数:"+operateLog);
            return operateLogDao.saveOperateLog(operateLog);
        }catch(Exception e){
            logger.error("操作:记录操作日志失败,方法:saveOperateLog,参数:"+operateLog,e);
            e.printStackTrace();
            return false;
        }
       
    }

    /* (non-Javadoc)
     * @see com.diligrp.website.manager.OperateLogManager#getOperateLogInfoByDataId(java.lang.Long)
     */
    @Override
    public List<OperateLog> getOperateLogInfoByDataId(OperateLog operateLog) {
        try{
            logger.info("操作:获取操作记录日志,方法:getOperateLogInfoByDataId,参数:OperateLog :"+operateLog);
            return operateLogDao.getOperateLogInfoByDataId(  operateLog) ;
        }catch(Exception e){
            logger.error("操作:获取操作记录日志失败,方法:getOperateLogInfoByDataId,参数::operateLog:"+operateLog,e);
            e.printStackTrace();
            return null;
        }
    }

    /* (non-Javadoc)
     * @see com.diligrp.website.manager.OperateLogManager#updaateOperateLogInfoByDataId(com.diligrp.website.domain.OperateLog)
     */
    @Override
    public boolean updaateOperateLogInfoByDataId(OperateLog operateLog) {
        try{
            logger.info("操作:修改操作记录日志,方法:updaateOperateLogInfoByDataId,参数:operateLog:"+operateLog);
            return operateLogDao.updaateOperateLogInfoByDataId(operateLog);
        }catch(Exception e){
            logger.error("操作:修改操作记录日志失败,方法:updaateOperateLogInfoByDataId,参数:operateLog:"+operateLog,e);
            e.printStackTrace();
            return false;
        }
    }

}