Compare commits
No commits in common. "4057e9abf7d03e6a070ce01c0713cf34c8fb04a3" and "e9e7fc15ad08c0b51b1cb3e7ac779f44a749fa13" have entirely different histories.
4057e9abf7
...
e9e7fc15ad
|
@ -4,7 +4,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.unissense.pms.business.examine.config.domain.ExamineConfig;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.domain.TaskQueryDto;
|
||||
import tech.unissense.pms.business.examine.task.service.TaskService;
|
||||
|
@ -37,7 +36,6 @@ public class TaskSetUpController extends BaseController {
|
|||
List<ExamineTask> tasks = taskService.getTasks(queryDto);
|
||||
return getDataTable(tasks);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult listTask(TaskQueryDto queryDto) {
|
||||
return success(taskService.listTask(queryDto));
|
||||
|
@ -53,12 +51,6 @@ public class TaskSetUpController extends BaseController {
|
|||
return AjaxResult.success(taskService.updateTask(updatedTask));
|
||||
}
|
||||
|
||||
// 编辑任务
|
||||
@PutMapping("/config/update")
|
||||
public AjaxResult updateConfigTask(@RequestBody List<ExamineConfig> list) {
|
||||
return AjaxResult.success(taskService.updateConfigTask(list));
|
||||
}
|
||||
|
||||
// 删除任务
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult deleteTask(@PathVariable Integer id) {
|
||||
|
@ -66,7 +58,7 @@ public class TaskSetUpController extends BaseController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
//获取指标配置
|
||||
//指标配置
|
||||
@GetMapping("/target/{id}")
|
||||
public AjaxResult getTarget(@PathVariable Integer id){
|
||||
return AjaxResult.success(taskService.getTarget(id));
|
||||
|
|
|
@ -40,7 +40,5 @@ public class ExamineTask implements Serializable {
|
|||
|
||||
|
||||
private List<Integer> userIdList;
|
||||
|
||||
private Integer year;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,4 @@ public class TaskQueryDto extends BaseEntity {
|
|||
private String taskName;
|
||||
|
||||
private Integer taskStatus;
|
||||
|
||||
private Integer year;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,4 @@ public interface TaskService {
|
|||
List<ExamineConfig> getTarget(Integer id);
|
||||
|
||||
Map<Integer,List<ExamineTask>> listTask(TaskQueryDto queryDto);
|
||||
|
||||
List<ExamineConfig> updateConfigTask(List<ExamineConfig> list);
|
||||
}
|
||||
|
|
|
@ -34,8 +34,6 @@ public class TaskServiceImpl implements TaskService {
|
|||
|
||||
@Resource
|
||||
private ExamineUserMapper userMapper;
|
||||
|
||||
@Autowired
|
||||
private ExamineUserServiceImpl examineUserService;
|
||||
|
||||
@Override
|
||||
|
@ -65,17 +63,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
|
||||
@Override
|
||||
public List<ExamineTask> getTasks(TaskQueryDto queryDto) {
|
||||
List<ExamineTask> tasks = examineTaskDao.getTasks(queryDto);
|
||||
tasks.forEach(item -> {
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setTaskId(item.getId());
|
||||
List<ExamineUser> existingUsers = userMapper.list(examineUser);
|
||||
List<Integer> existingUserIds = existingUsers.stream()
|
||||
.map(ExamineUser::getUserId)
|
||||
.collect(Collectors.toList());
|
||||
item.setUserIdList(existingUserIds);
|
||||
});
|
||||
return tasks;
|
||||
return examineTaskDao.getTasks(queryDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -112,12 +100,6 @@ public class TaskServiceImpl implements TaskService {
|
|||
public void deleteTask(Integer id) {
|
||||
examineTaskDao.deleteTask(id);
|
||||
examineUserService.deleteUserByTaskId(id);
|
||||
ExamineConfig examineConfig = new ExamineConfig();
|
||||
examineConfig.setExamineTaskId(id);
|
||||
List<ExamineConfig> list = examineConfigMapper.list(examineConfig);
|
||||
for (ExamineConfig config : list) {
|
||||
examineConfigMapper.deleteById(config.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,15 +130,4 @@ public class TaskServiceImpl implements TaskService {
|
|||
}
|
||||
return examineTasks.stream().collect(Collectors.groupingBy(ExamineTask::getTaskStatus));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamineConfig> updateConfigTask(List<ExamineConfig> list) {
|
||||
for (ExamineConfig examineConfig : list) {
|
||||
if (examineConfig.getId() == null) {
|
||||
continue;
|
||||
}
|
||||
examineConfigMapper.update(examineConfig);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
<if test="taskStatus != null">
|
||||
AND task_status = #{taskStatus}
|
||||
</if>
|
||||
<if test="year != null">
|
||||
AND year = #{year}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="listTask" resultType="ExamineTask">
|
||||
|
|
Loading…
Reference in New Issue