package cn.superdesk.uniorder.dubbo.provider.scheduler;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLog;
import cn.superdesk.uniorder.dto.param.scheduler.SysQuartzLogParam;
import cn.superdesk.uniorder.dubbo.facade.scheduler.DubboSysQuartzLogService;
import cn.superdesk.uniorder.service.scheduler.SysQuartzLogService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * @Description: 定时任务日志
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2020-12-17 16:35:26
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020-12-17 16:35:26
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSysQuartzLogServiceImpl implements DubboSysQuartzLogService {

	@Autowired
	private SysQuartzLogService sysQuartzLogService;


	/****************************************** extends BaseService 部分 start ******************************************/

	@Override
	public void addObj(SysQuartzLogParam param) {

		SysQuartzLog sysQuartzLog = AnBeanUtils.copy(param, SysQuartzLog.class);
		sysQuartzLogService.insertSelective(sysQuartzLog);

	}

	@Override
	public void updateObj(SysQuartzLogParam param) {

		SysQuartzLog sysQuartzLog = AnBeanUtils.copy(param, SysQuartzLog.class);
		sysQuartzLogService.updateByPrimaryKeySelective(sysQuartzLog);
	}

	@Override
	public void deleteObj(Long id) {
		sysQuartzLogService.deleteObj(id);
	}

	@Override
	public SysQuartzLog findById(Long id) {
		return sysQuartzLogService.findById(id);
	}

	@Override
	public PageInfo<SysQuartzLog> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {
		return sysQuartzLogService.findByPaging(conditions, pageNun, pageSize);
	}

	@Override
	public List<SysQuartzLog> findAll(Map<String, Object> queryMap) {

		return sysQuartzLogService.findAll(queryMap);
	}

	/****************************************** extends BaseService 部分   end ******************************************/


	@Override
	public void addSysQuartzLog(SysQuartzLogParam param) {

		SysQuartzLog sysQuartzLog = AnBeanUtils.copy(param, SysQuartzLog.class);
		sysQuartzLogService.addSysQuartzLog(sysQuartzLog);
	}

	@Override
	public void updateSysQuartzLog(SysQuartzLogParam param) {

		SysQuartzLog sysQuartzLog = AnBeanUtils.copy(param, SysQuartzLog.class);
		sysQuartzLogService.updateSysQuartzLog(sysQuartzLog);
	}

	@Override
	public void deleteSysQuartzLog(Long id) {
		sysQuartzLogService.deleteSysQuartzLog(id);
	}

	@Override
	public SysQuartzLog findSysQuartzLogById(Long id) {
		return sysQuartzLogService.findSysQuartzLogById(id);
	}

	@Override
	public R<List<SysQuartzLog>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {
		return sysQuartzLogService.pageQuery(conditions, pageNun, pageSize);

	}
}
