Merge remote-tracking branch 'origin/master'
commit
3ff5374347
|
@ -33,7 +33,8 @@ public class Task {
|
|||
private Boolean deleted;
|
||||
|
||||
public Boolean checkInsert() {
|
||||
if (this.getTaskName() == null || this.getTaskName().length() <= 0 || this.getTaskName().length() >= 100)
|
||||
if (this.getTaskName() == null || this.getTaskName().length() <= 0 || this.getTaskName().length() >= 100||
|
||||
(this.getAttachedInfo()!=null&&this.getAttachedInfo().length() > 250))
|
||||
return false;
|
||||
return !this.getTaskEndTime().isBefore(this.getTaskStartTime());
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@ public interface ITaskService extends IService<Task> {
|
|||
List<List<Long>> getTaskAndSubTask(Long taskId);
|
||||
Boolean deleteTaskAndSubTask(String token, Integer projectId, Long taskId) throws BadRequestException;
|
||||
Boolean closeTaskAndSubTask(String token, Integer projectId, Long taskId) throws BadRequestException;
|
||||
Boolean checkHolder(Integer staffId,Long taskId);
|
||||
Boolean checkHolder(String token,Long taskId);
|
||||
Integer checkHolder(Integer staffId,Long taskId);
|
||||
Integer checkHolder(String token,Long taskId);
|
||||
List<Task> getMyTaskList(String token,Integer projectId) throws BadRequestException;
|
||||
Boolean canBeDone(Long taskId);
|
||||
Task insertTask(String token,Task task) throws BadRequestException;
|
||||
|
|
|
@ -102,23 +102,35 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return 1:all rights 2:father holder 3:current holder 0:no right
|
||||
*/
|
||||
@Override
|
||||
public Integer checkHolder(Integer staffId, Long taskId) {
|
||||
try {
|
||||
Task task = baseMapper.selectOne(Wrappers.<Task>lambdaQuery().eq(Task::getTaskId, taskId));
|
||||
if (task == null || staffId <= 0)
|
||||
return false;
|
||||
while (task.getTaskFatherId() != 0) {
|
||||
return 0;
|
||||
int count=0;
|
||||
if(task.getTaskHolderId().equals(staffId))
|
||||
count++;
|
||||
task = baseMapper.selectOne(Wrappers.<Task>lambdaQuery().eq(Task::getTaskId, task.getTaskFatherId()));
|
||||
while (task.getTaskId() != 0) {
|
||||
if (Objects.equals(task.getTaskHolderId(), staffId))
|
||||
return true;
|
||||
return 2;
|
||||
task = baseMapper.selectOne(Wrappers.<Task>lambdaQuery().eq(Task::getTaskId, task.getTaskFatherId()));
|
||||
}
|
||||
return false;
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return 1:all rights 2:father holder 3:current holder 0:no right
|
||||
*/
|
||||
@Override
|
||||
public Integer checkHolder(String token, Long taskId) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue