|
|
@ -73,9 +73,6 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) { |
|
|
|
public Map<String, Object> createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
if (isNotAdmin(loginUser, result)) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (name == null) { |
|
|
|
if (name == null) { |
|
|
|
putMsg(result, Status.NAME_NULL); |
|
|
|
putMsg(result, Status.NAME_NULL); |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -116,9 +113,6 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> updateTaskGroup(User loginUser, int id, String name, String description, int groupSize) { |
|
|
|
public Map<String, Object> updateTaskGroup(User loginUser, int id, String name, String description, int groupSize) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
if (isNotAdmin(loginUser, result)) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (name == null) { |
|
|
|
if (name == null) { |
|
|
|
putMsg(result, Status.NAME_NULL); |
|
|
|
putMsg(result, Status.NAME_NULL); |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -127,7 +121,11 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe |
|
|
|
putMsg(result, Status.TASK_GROUP_SIZE_ERROR); |
|
|
|
putMsg(result, Status.TASK_GROUP_SIZE_ERROR); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
Integer exists = taskGroupMapper.selectCount(new QueryWrapper<TaskGroup>().lambda().eq(TaskGroup::getName, name).ne(TaskGroup::getId, id)); |
|
|
|
Integer exists = taskGroupMapper.selectCount(new QueryWrapper<TaskGroup>().lambda() |
|
|
|
|
|
|
|
.eq(TaskGroup::getName, name) |
|
|
|
|
|
|
|
.eq(TaskGroup::getUserId, loginUser.getId()) |
|
|
|
|
|
|
|
.ne(TaskGroup::getId, id)); |
|
|
|
|
|
|
|
|
|
|
|
if (exists > 0) { |
|
|
|
if (exists > 0) { |
|
|
|
putMsg(result, Status.TASK_GROUP_NAME_EXSIT); |
|
|
|
putMsg(result, Status.TASK_GROUP_NAME_EXSIT); |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -262,9 +260,6 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> closeTaskGroup(User loginUser, int id) { |
|
|
|
public Map<String, Object> closeTaskGroup(User loginUser, int id) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
if (isNotAdmin(loginUser, result)) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
TaskGroup taskGroup = taskGroupMapper.selectById(id); |
|
|
|
TaskGroup taskGroup = taskGroupMapper.selectById(id); |
|
|
|
if (taskGroup.getStatus() == Flag.NO.getCode()) { |
|
|
|
if (taskGroup.getStatus() == Flag.NO.getCode()) { |
|
|
|
putMsg(result, Status.TASK_GROUP_STATUS_CLOSED); |
|
|
|
putMsg(result, Status.TASK_GROUP_STATUS_CLOSED); |
|
|
@ -286,9 +281,7 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> startTaskGroup(User loginUser, int id) { |
|
|
|
public Map<String, Object> startTaskGroup(User loginUser, int id) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
if (isNotAdmin(loginUser, result)) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
TaskGroup taskGroup = taskGroupMapper.selectById(id); |
|
|
|
TaskGroup taskGroup = taskGroupMapper.selectById(id); |
|
|
|
if (taskGroup.getStatus() == Flag.YES.getCode()) { |
|
|
|
if (taskGroup.getStatus() == Flag.YES.getCode()) { |
|
|
|
putMsg(result, Status.TASK_GROUP_STATUS_OPENED); |
|
|
|
putMsg(result, Status.TASK_GROUP_STATUS_OPENED); |
|
|
@ -311,9 +304,7 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> forceStartTask(User loginUser, int queueId) { |
|
|
|
public Map<String, Object> forceStartTask(User loginUser, int queueId) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
if (isNotAdmin(loginUser, result)) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
taskGroupQueueService.forceStartTask(queueId, Flag.YES.getCode()); |
|
|
|
taskGroupQueueService.forceStartTask(queueId, Flag.YES.getCode()); |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -322,9 +313,7 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> modifyPriority(User loginUser, Integer queueId, Integer priority) { |
|
|
|
public Map<String, Object> modifyPriority(User loginUser, Integer queueId, Integer priority) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
if (isNotAdmin(loginUser, result)) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
taskGroupQueueService.modifyPriority(queueId, priority); |
|
|
|
taskGroupQueueService.modifyPriority(queueId, priority); |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|