| | |
| | | package com.ruoyi.web.controller.api; |
| | | import com.google.common.collect.Lists; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.dto.TTaskDTO; |
| | | import com.ruoyi.system.dto.TTemplateDTO; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.query.TaskListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.*; |
| | |
| | | @RequestMapping("/t-task") |
| | | public class TTaskController { |
| | | @Resource |
| | | private TTaskService taskService; |
| | | private TTaskCleanService taskCleanerService; |
| | | |
| | | @Resource |
| | | private TTaskDetailService taskDetailService; |
| | |
| | | private TLocationService locationService; |
| | | @Resource |
| | | private TProjectDeptService projectDeptService; |
| | | @Resource |
| | | private TCleanerService cleanerService; |
| | | @Resource |
| | | private TTaskService tTaskService; |
| | | |
| | | @Resource |
| | | private TTaskDetailService tTaskDetailService; |
| | | @Resource |
| | |
| | | query.setLocationIds(collect); |
| | | } |
| | | } |
| | | return R.ok(taskService.pageList(query)); |
| | | return R.ok(taskCleanerService.pageList(query)); |
| | | } |
| | | |
| | | @Log(title = "新增任务", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增任务") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@RequestBody TTaskDTO dto) { |
| | | taskService.save(dto); |
| | | taskCleanerService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "审核任务", businessType = BusinessType.UPDATE) |
| | |
| | | if (dto.getAuditStatus()==2){ |
| | | dto.setHandleType(3); |
| | | // 将任务修改为待整改 |
| | | TTask byId = taskService.getById(dto.getTaskId()); |
| | | TTask byId = taskCleanerService.getById(dto.getTaskId()); |
| | | byId.setStatus(4); |
| | | taskService.updateById(byId); |
| | | taskCleanerService.updateById(byId); |
| | | }else{ |
| | | dto.setHandleType(2); |
| | | } |
| | |
| | | if (dto.getAuditStatus()==2){ |
| | | tTaskDetail.setHandleType(3); |
| | | // 将任务修改为待整改 |
| | | TTask byId = taskService.getById(tTaskDetail.getTaskId()); |
| | | TTask byId = taskCleanerService.getById(tTaskDetail.getTaskId()); |
| | | byId.setStatus(4); |
| | | taskService.updateById(byId); |
| | | taskCleanerService.updateById(byId); |
| | | }else{ |
| | | tTaskDetail.setHandleType(2); |
| | | } |
| | |
| | | List<TTaskDetail> list = taskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, id) |
| | | .orderByDesc(BaseModel::getCreateTime).list(); |
| | | TaskDetailVO taskDetailVO = new TaskDetailVO(); |
| | | TTask byId = taskService.getById(id); |
| | | TTask byId = taskCleanerService.getById(id); |
| | | BeanUtils.copyProperties(byId, taskDetailVO); |
| | | TLocation byId1 = locationService.getById(byId.getLocationId()); |
| | | TLocationType byId2 = locationTypeService.getById(byId1.getLocationType()); |
| | |
| | | |
| | | TaskRecordDetailVO taskDetailVO = new TaskRecordDetailVO(); |
| | | TTaskDetail byId4 = taskDetailService.getById(id); |
| | | TTask byId = taskService.getById(byId4.getTaskId()); |
| | | TTask byId = taskCleanerService.getById(byId4.getTaskId()); |
| | | BeanUtils.copyProperties(byId, taskDetailVO); |
| | | TLocation byId1 = locationService.getById(byId.getLocationId()); |
| | | TLocationType byId2 = locationTypeService.getById(byId1.getLocationType()); |
| | |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | taskService.removeBatchByIds(Arrays.asList(split)); |
| | | taskCleanerService.removeBatchByIds(Arrays.asList(split)); |
| | | return R.ok(); |
| | | } |
| | | |