| | |
| | | import com.zy.asrs.mapper.WrkMastLogMapper; |
| | | import com.zy.asrs.service.WrkMastLogService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.util.Objects; |
| | | |
| | | @Service("wrkMastLogService") |
| | | @Slf4j |
| | | public class WrkMastLogServiceImpl extends ServiceImpl<WrkMastLogMapper, WrkMastLog> implements WrkMastLogService { |
| | | |
| | | @Autowired |
| | |
| | | private WrkMastLogService wrkMastLogService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean save(Integer workNo) { |
| | | WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", workNo)); |
| | | if (Objects.isNull(mast)) { |
| | | throw new CoolException("数据错误:任务不存在!!"); |
| | | } |
| | | WrkMastLog mastLog = new WrkMastLog(); |
| | | BeanUtils.copyProperties(mast, mastLog); |
| | | mastLog.setLogId(mast.getId()); |
| | | |
| | | if (!wrkMastLogService.insert(mastLog)) { |
| | | throw new CoolException("任务日志保存失败!!"); |
| | | } |
| | | |
| | | return true; |
| | | return this.baseMapper.save(workNo) > 0; |
| | | } |
| | | |
| | | @Override |