修复了交接时会将已完成或关闭的项目一并交接的问题
parent
f2f6bb8d8a
commit
7dbf52d915
|
@ -519,11 +519,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
|
|||
if (projectGroupService.compareProjectAccessLevel(projectId, token, transferredStaffId) > 0) {
|
||||
throw new ForbiddenException(ForbiddenException.UNABLE_TO_OPERATE);
|
||||
}
|
||||
Long transferredTaskCount = baseMapper.selectCount(Wrappers.<Task>lambdaQuery().eq(Task::getTaskHolderId, transferredStaffId));
|
||||
Long transferredTaskCount = baseMapper.selectCount(Wrappers.<Task>lambdaQuery()
|
||||
.eq(Task::getTaskHolderId, transferredStaffId)
|
||||
.and(wrapper -> wrapper
|
||||
.eq(Task::getTaskStatus, Task.STATUS_WAITING)
|
||||
.or()
|
||||
.eq(Task::getTaskStatus, Task.STATUS_PROCESSING)
|
||||
));
|
||||
int updatedTaskCount = baseMapper.update(
|
||||
null,
|
||||
Wrappers.<Task>lambdaUpdate()
|
||||
.eq(Task::getTaskHolderId, transferredStaffId)
|
||||
.and(wrapper -> wrapper
|
||||
.eq(Task::getTaskStatus, Task.STATUS_WAITING)
|
||||
.or()
|
||||
.eq(Task::getTaskStatus, Task.STATUS_PROCESSING)
|
||||
)
|
||||
.set(Task::getTaskHolderId, targetStaffId)
|
||||
);
|
||||
return transferredTaskCount.intValue() == updatedTaskCount;
|
||||
|
|
|
@ -24,7 +24,7 @@ public class SerializeTests {
|
|||
public void serializeTime() {
|
||||
String timestamp = objectMapper.writeValueAsString(LocalDateTime.now());
|
||||
System.out.println(timestamp);
|
||||
System.out.println(objectMapper.readValue(timestamp, LocalDateTime.class));
|
||||
System.out.println(objectMapper.readValue("1657693261", LocalDateTime.class));
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
|
|
Loading…
Reference in New Issue