| | |
| | | */ |
| | | package me.zhengjie.modules.task.service.impl; |
| | | |
| | | import me.zhengjie.exception.BadRequestException; |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import me.zhengjie.modules.project.domain.Project; |
| | | import me.zhengjie.modules.project.repository.ProjectRepository; |
| | | import me.zhengjie.modules.system.repository.DictDetailRepository; |
| | | import me.zhengjie.modules.task.domain.Task; |
| | | import me.zhengjie.modules.task.domain.TaskDaliy; |
| | | import me.zhengjie.modules.task.domain.TaskUser; |
| | | import me.zhengjie.modules.task.repository.TaskDaliyRepository; |
| | | import me.zhengjie.modules.task.repository.TaskUserRepository; |
| | | import me.zhengjie.utils.*; |
| | |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.function.Function; |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public void deleteAll(Long[] ids) { |
| | | // 根据多任务ID查询任务分配列表 |
| | | List<TaskUser> taskUserList = taskUserRepository.findByTaskIdIn(Arrays.asList(ids)); |
| | | // 判断任务分配列表长度 |
| | | if (taskUserList.size() > 0) { |
| | | throw new BadRequestException("已分配的任务无法删除!"); |
| | | } |
| | | for (Long id : ids) { |
| | | taskRepository.deleteById(id); |
| | | } |
| | |
| | | String priority = task.getPriority() != null ? dictDetailRepository.findByDictNameAndValue(Constant.PRIORITY, task.getPriority()).getLabel() : ""; |
| | | String taskClassification = task.getTaskClassification() != null ? dictDetailRepository.findByDictNameAndValue(Constant.TASK_CLASSIFICATION, task.getTaskClassification()).getLabel() : ""; |
| | | String planWorkloadUnit = task.getPlanWorkloadUnit() != null ? dictDetailRepository.findByDictNameAndValue(Constant.STANDARD_WORKLOAD_UNIT, task.getPlanWorkloadUnit()).getLabel() : ""; |
| | | String taskStatus = task.getTaskStatus() != null ? dictDetailRepository.findByDictNameAndValue(Constant.TASK_STATUS, task.getTaskStatus()).getLabel() : ""; |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("项目名称", projectName); |
| | | map.put("父任务名称", pidName); |
| | |
| | | map.put("计划工时", task.getPlanHours()); |
| | | map.put("计划工作量", task.getPlanWorkload()); |
| | | map.put("计划工作量单位", planWorkloadUnit); |
| | | map.put("任务状态", taskStatus); |
| | | map.put("备注", task.getRemarks()); |
| | | map.put("创建者", task.getCreateBy()); |
| | | map.put("创建时间", task.getCreateTime()); |