修复了交接时会将已完成或关闭的项目一并交接的问题

master
ArgonarioD 2022-07-13 14:54:32 +08:00
parent f2f6bb8d8a
commit 7dbf52d915
2 changed files with 15 additions and 4 deletions

View File

@ -519,11 +519,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
if (projectGroupService.compareProjectAccessLevel(projectId, token, transferredStaffId) > 0) { if (projectGroupService.compareProjectAccessLevel(projectId, token, transferredStaffId) > 0) {
throw new ForbiddenException(ForbiddenException.UNABLE_TO_OPERATE); 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( int updatedTaskCount = baseMapper.update(
null, null,
Wrappers.<Task>lambdaUpdate() Wrappers.<Task>lambdaUpdate()
.eq(Task::getTaskHolderId, transferredStaffId) .eq(Task::getTaskHolderId, transferredStaffId)
.and(wrapper -> wrapper
.eq(Task::getTaskStatus, Task.STATUS_WAITING)
.or()
.eq(Task::getTaskStatus, Task.STATUS_PROCESSING)
)
.set(Task::getTaskHolderId, targetStaffId) .set(Task::getTaskHolderId, targetStaffId)
); );
return transferredTaskCount.intValue() == updatedTaskCount; return transferredTaskCount.intValue() == updatedTaskCount;

View File

@ -24,7 +24,7 @@ public class SerializeTests {
public void serializeTime() { public void serializeTime() {
String timestamp = objectMapper.writeValueAsString(LocalDateTime.now()); String timestamp = objectMapper.writeValueAsString(LocalDateTime.now());
System.out.println(timestamp); System.out.println(timestamp);
System.out.println(objectMapper.readValue(timestamp, LocalDateTime.class)); System.out.println(objectMapper.readValue("1657693261", LocalDateTime.class));
} }
@SneakyThrows @SneakyThrows