0.6.1 debug

This commit is contained in:
磷叶 2025-03-07 17:01:04 +08:00
parent 7c0d344350
commit 0ffb2ca306
4 changed files with 15 additions and 15 deletions

View File

@ -16,8 +16,7 @@ public enum TaskStatus {
WAIT_CONFIRM("3", "待确认(停用)"),
PASS("4", "通过"),
REJECT("5", "驳回(停用)"),
CANCEL("6", "取消"),
OVERDUE_PASS("7", "逾期通过");
CANCEL("6", "取消");
private final String status;
private final String name;
@ -55,7 +54,7 @@ public enum TaskStatus {
* 获取未完成任务状态
*/
public static List<String> unComplete() {
return CollectionUtils.map(TaskStatus::getStatus, PROCESSING);
return CollectionUtils.map(TaskStatus::getStatus, PROCESSING, WAIT_RECEIVE);
}
/**
@ -64,4 +63,11 @@ public enum TaskStatus {
public static List<String> complete() {
return CollectionUtils.map(TaskStatus::getStatus, PASS);
}
/**
* 获取逾期完成任务状态
*/
public static List<String> overDueComplete() {
return CollectionUtils.map(TaskStatus::getStatus);
}
}

View File

@ -319,15 +319,9 @@ public class TaskServiceImpl implements TaskService
// 更新任务状态
Integer result = transactionTemplate.execute(status -> {
LocalDateTime passTime = LocalDateTime.now();
Task data = new Task();
data.setPassTime(passTime);
if (passTime.isAfter(old.getExpireTime())) {
data.setStatus(TaskStatus.OVERDUE_PASS.getStatus());
} else {
data.setStatus(TaskStatus.PASS.getStatus());
}
data.setPassTime(LocalDateTime.now());
data.setStatus(TaskStatus.PASS.getStatus());
TaskQuery query = new TaskQuery();
query.setId(id);
query.setStatusList(TaskStatus.canPass());

View File

@ -40,16 +40,16 @@ public class TaskValidatorImpl implements TaskValidator{
if (vo.getProjectId() != null && CollectionUtils.isNotEmpty(vo.getMemberList())) {
// 验证任务成员必须是项目成员的子集
// 获取项目成员的用户ID列表
List<Long> projectMemberUserIds = CollectionUtils.map(vo.getProjectMemberList(), ProjectMemberVO::getUserId);
ServiceUtil.assertion(CollectionUtils.isEmptyElement(projectMemberUserIds), "项目成员列表不能为空");
// 过滤出不存在于项目成员中的任务成员
List<TaskMemberVO> notInProjectMemberList = vo.getMemberList().stream()
.filter(member -> !projectMemberUserIds.contains(member.getUserId()))
.collect(Collectors.toList());
ServiceUtil.assertion(CollectionUtils.isEmptyElement(notInProjectMemberList),
ServiceUtil.assertion(CollectionUtils.isNotEmptyElement(notInProjectMemberList),
"任务负责人%s不是项目【%s】的成员", CollectionUtils.map(notInProjectMemberList, TaskMemberVO::getUserName), vo.getProjectName());
}

View File

@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/pm-copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/project-manager?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
# 从库数据源