| | |
| | | */ |
| | | package org.springblade.modules.task.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.modules.task.entity.TaskEntity; |
| | | import org.springblade.modules.task.vo.TaskVO; |
| | | import org.springblade.modules.task.mapper.TaskMapper; |
| | | import org.springblade.modules.task.service.ITaskService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.modules.task.vo.TaskVO; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 任务表 服务实现类 |
| | |
| | | return page.setRecords(baseMapper.selectTaskPage(page, task)); |
| | | } |
| | | |
| | | /** |
| | | * 新增任务 |
| | | * |
| | | * @param type |
| | | * @param name |
| | | * @param frequency |
| | | * @param remark |
| | | * @param createUser |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Long saveTask(Integer type, String name, Integer frequency, String remark, Long createUser) { |
| | | TaskEntity taskEntity = new TaskEntity(); |
| | | taskEntity.setType(type); |
| | | taskEntity.setName(name); |
| | | taskEntity.setFrequency(frequency); |
| | | taskEntity.setRemark(remark); |
| | | taskEntity.setCreateTime(new Date()); |
| | | taskEntity.setCreateUser(createUser); |
| | | return baseMapper.insert(taskEntity) > 0 ? taskEntity.getId() : 0; |
| | | } |
| | | |
| | | @Override |
| | | public Long updateTask(Integer type, String name, Integer frequency, String remark, Long updateUser, Long id, Integer status) { |
| | | TaskEntity taskEntity = new TaskEntity(); |
| | | taskEntity.setId(id); |
| | | taskEntity.setType(type); |
| | | taskEntity.setName(name); |
| | | taskEntity.setFrequency(frequency); |
| | | taskEntity.setRemark(remark); |
| | | taskEntity.setUpdateTime(new Date()); |
| | | taskEntity.setUpdateUser(updateUser); |
| | | taskEntity.setStatus(status); |
| | | return baseMapper.updateById(taskEntity) > 0 ? 1L : 0; |
| | | } |
| | | } |