package com.zy.asrs.service.impl; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.zy.asrs.entity.Job; import com.zy.asrs.entity.JobLog; import com.zy.asrs.mapper.JobLogMapper; import com.zy.asrs.mapper.JobMapper; import com.zy.asrs.service.JobService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service public class JobServiceImpl extends ServiceImpl implements JobService { @Autowired private JobLogMapper jobLogMapper; @Override @Transactional public void saveJobLog(Job job) { JobLog jobLog = new JobLog(); BeanUtils.copyProperties(job, jobLog); jobLogMapper.insert(jobLog); baseMapper.deleteById(job.getId()); } }