| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.CanFin; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.mapper.CanFinMapper; |
| | | import com.zy.asrs.service.TaskService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private CanFinMapper canFinMapper; |
| | | |
| | | @RequestMapping(value = "/task/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | taskService.completeWrkMast(workNo, getUserId()); |
| | | return R.ok("工作档已完成"); |
| | | } else if (type == 2) { |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>() |
| | | .eq("wrk_no", workNo)); |
| | | if (task != null){ |
| | | CanFin deleteCanFin = new CanFin(); |
| | | deleteCanFin.setInNo(task.getTaskNo()); |
| | | List<CanFin> canFinList = canFinMapper.selectList(new EntityWrapper<CanFin>() |
| | | .orderBy("apply_time", true) |
| | | .isNotNull("in_no")); |
| | | if (!canFinList.isEmpty()){ |
| | | for (CanFin canFin : canFinList){ |
| | | if (canFin.getInNo().equals(deleteCanFin.getInNo())){ |
| | | canFinMapper.deleteById(canFin.getId()); |
| | | } |
| | | } |
| | | } |
| | | List<CanFin> newCanFinList = canFinMapper.selectList(new EntityWrapper<CanFin>() |
| | | .orderBy("apply_time", true)); |
| | | if (!newCanFinList.isEmpty()){ |
| | | CanFin firstCanFin = newCanFinList.get(0); |
| | | firstCanFin.setTaskStatus("canout"); |
| | | canFinMapper.updateById(firstCanFin); |
| | | } |
| | | } |
| | | taskService.cancelWrkMast(workNo, getUserId()); |
| | | return R.ok("工作档已取消"); |
| | | } else if (type == 3) { |