Merge remote-tracking branch 'origin/main'

This commit is contained in:
2026-07-08 10:56:39 +08:00
9 changed files with 42 additions and 3 deletions

View File

@@ -19,7 +19,6 @@ public class MonthlyReportApproveReqVO extends WorkReportStatusActionReqVO {
@Schema(description = "面谈时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@NotNull
private LocalDate meetingDate;
@Schema(description = "优势描述")

View File

@@ -0,0 +1,18 @@
package com.njcn.rdms.module.project.framework.notify;
/**
* 站内信跳转参数常量。
*/
public final class NotifyJumpConstants {
private NotifyJumpConstants() {
}
public static final String PARAM_JUMP_TYPE = "jumpType";
public static final String PARAM_PROJECT_ID = "projectId";
public static final String JUMP_TYPE_PROJECT = "project";
public static final String JUMP_TYPE_EXECUTION = "execution";
public static final String JUMP_TYPE_TASK = "task";
}

View File

@@ -49,6 +49,7 @@ import com.njcn.rdms.module.project.dal.mysql.status.ObjectStatusModelMapper;
import com.njcn.rdms.module.project.dal.mysql.status.ObjectStatusTransitionMapper;
import com.njcn.rdms.module.project.enums.ErrorCodeConstants;
import com.njcn.rdms.module.project.enums.ProjectDictTypeConstants;
import com.njcn.rdms.module.project.framework.notify.NotifyJumpConstants;
import com.njcn.rdms.framework.mybatis.core.dataobject.BaseDO;
import com.njcn.rdms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.njcn.rdms.module.project.service.datascope.ObjectDataScope;
@@ -279,6 +280,8 @@ class ProjectServiceImpl implements ProjectService {
Map<String, Object> params = new HashMap<>();
params.put("projectName", project.getProjectName());
params.put("roleName", r.roleName());
params.put(NotifyJumpConstants.PARAM_JUMP_TYPE, NotifyJumpConstants.JUMP_TYPE_PROJECT);
params.put(NotifyJumpConstants.PARAM_PROJECT_ID, String.valueOf(project.getId()));
applicationEventPublisher.publishEvent(
com.njcn.rdms.module.project.framework.notify.NotifySendEvent.of(
java.util.List.of(r.userId()),

View File

@@ -43,6 +43,7 @@ import com.njcn.rdms.module.project.dal.mysql.status.ObjectStatusModelMapper;
import com.njcn.rdms.module.project.dal.mysql.status.ObjectStatusTransitionMapper;
import com.njcn.rdms.module.project.enums.ErrorCodeConstants;
import com.njcn.rdms.module.project.enums.ProjectDictTypeConstants;
import com.njcn.rdms.module.project.framework.notify.NotifyJumpConstants;
import com.njcn.rdms.module.project.framework.notify.NotifySendEvent;
import com.njcn.rdms.module.project.framework.notify.NotifyTemplateCodeConstants;
import com.njcn.rdms.module.project.util.DueRangeSupport;
@@ -193,6 +194,8 @@ public class ProjectExecutionServiceImpl implements ProjectExecutionService {
ProjectDO project = projectMapper.selectById(execution.getProjectId());
params.put("projectName", project == null ? "" : project.getProjectName());
params.put("executionName", execution.getExecutionName());
params.put(NotifyJumpConstants.PARAM_JUMP_TYPE, NotifyJumpConstants.JUMP_TYPE_EXECUTION);
params.put(NotifyJumpConstants.PARAM_PROJECT_ID, String.valueOf(execution.getProjectId()));
applicationEventPublisher.publishEvent(NotifySendEvent.of(recipients,
NotifyTemplateCodeConstants.EXECUTION_ASSIGNED, params,
NotifyMessageLevelConstants.NORMAL, SecurityFrameworkUtils.getLoginUserId()));

View File

@@ -41,6 +41,7 @@ import com.njcn.rdms.module.project.dal.mysql.status.ObjectStatusTransitionMappe
import com.njcn.rdms.module.project.enums.ErrorCodeConstants;
import com.njcn.rdms.module.project.framework.attachment.AttachmentFileIdResolver;
import com.njcn.rdms.module.project.framework.attachment.AttachmentValidator;
import com.njcn.rdms.module.project.framework.notify.NotifyJumpConstants;
import com.njcn.rdms.module.project.framework.notify.NotifySendEvent;
import com.njcn.rdms.module.project.framework.notify.NotifyTemplateCodeConstants;
import com.njcn.rdms.module.project.framework.security.annotation.CheckObjectPermission;
@@ -207,6 +208,8 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
ProjectDO project = projectMapper.selectById(projectId);
params.put("projectName", project == null ? "" : project.getProjectName());
params.put("taskName", task.getTaskTitle());
params.put(NotifyJumpConstants.PARAM_JUMP_TYPE, NotifyJumpConstants.JUMP_TYPE_TASK);
params.put(NotifyJumpConstants.PARAM_PROJECT_ID, String.valueOf(projectId));
applicationEventPublisher.publishEvent(NotifySendEvent.of(recipients,
NotifyTemplateCodeConstants.TASK_ASSIGNED, params,
NotifyMessageLevelConstants.NORMAL, SecurityFrameworkUtils.getLoginUserId()));

View File

@@ -67,6 +67,7 @@ import static com.njcn.rdms.framework.common.exception.util.ServiceExceptionUtil
public class WorkReportDefaultDraftService {
private static final String WORK_ITEM_MY_ITEMS = "我的事项";
private static final String WORKLOG_DAY_SEPARATOR = "[[WR_DAY_SPLIT]]";
@Resource
private ObjectStatusModelMapper objectStatusModelMapper;
@@ -759,7 +760,7 @@ public class WorkReportDefaultDraftService {
builder.append(lineTitle);
appendBracket(builder, priority, latestProgressRate, totalWorkHours);
if (!workContents.isEmpty()) {
builder.append("").append(String.join("", workContents));
builder.append("").append(String.join(WORKLOG_DAY_SEPARATOR, workContents));
}
return builder.toString();
}
@@ -860,7 +861,7 @@ public class WorkReportDefaultDraftService {
builder.append("").append(String.join(" / ", parts)).append("");
}
if (weeklyMode && worklogAggregate.hasWorkContent()) {
builder.append("").append(String.join("", worklogAggregate.workContents()));
builder.append("").append(String.join(WORKLOG_DAY_SEPARATOR, worklogAggregate.workContents()));
}
return builder.toString();
}

View File

@@ -811,6 +811,10 @@ class ProjectServiceImplTest extends BaseMockitoUnitTest {
com.njcn.rdms.module.project.framework.notify.NotifySendEvent first = captor.getAllValues().get(0);
assertEquals("project_created", first.getTemplateCode());
assertEquals(9L, first.getOperatorUserId());
assertEquals(com.njcn.rdms.module.project.framework.notify.NotifyJumpConstants.JUMP_TYPE_PROJECT,
first.getParams().get(com.njcn.rdms.module.project.framework.notify.NotifyJumpConstants.PARAM_JUMP_TYPE));
assertEquals("10",
first.getParams().get(com.njcn.rdms.module.project.framework.notify.NotifyJumpConstants.PARAM_PROJECT_ID));
assertEquals("项目经理", first.getParams().get("roleName"));
assertEquals("灿能项目", first.getParams().get("projectName"));
assertTrue(first.getUserIds().contains(5L));

View File

@@ -33,6 +33,7 @@ import com.njcn.rdms.module.project.dal.mysql.status.ObjectStatusModelMapper;
import com.njcn.rdms.module.project.dal.mysql.status.ObjectStatusTransitionMapper;
import com.njcn.rdms.module.project.enums.ErrorCodeConstants;
import com.njcn.rdms.module.project.enums.ProjectDictTypeConstants;
import com.njcn.rdms.module.project.framework.notify.NotifyJumpConstants;
import com.njcn.rdms.module.project.framework.notify.NotifySendEvent;
import com.njcn.rdms.module.project.service.project.ProjectRequirementService;
import com.njcn.rdms.module.system.api.dict.DictDataApi;
@@ -919,6 +920,9 @@ class ProjectExecutionServiceImplTest extends BaseMockitoUnitTest {
assertEquals("execution_assigned", ev.getTemplateCode());
assertEquals(7L, ev.getOperatorUserId());
assertTrue(ev.getUserIds().containsAll(List.of(5L, 6L)));
assertEquals(NotifyJumpConstants.JUMP_TYPE_EXECUTION,
ev.getParams().get(NotifyJumpConstants.PARAM_JUMP_TYPE));
assertEquals("10", ev.getParams().get(NotifyJumpConstants.PARAM_PROJECT_ID));
assertEquals("灿能项目", ev.getParams().get("projectName"));
assertEquals("一阶段", ev.getParams().get("executionName"));
}

View File

@@ -7,6 +7,7 @@ import com.njcn.rdms.module.project.dal.dataobject.project.task.ProjectTaskDO;
import com.njcn.rdms.module.project.dal.dataobject.project.task.TaskAssigneeDO;
import com.njcn.rdms.module.project.dal.mysql.project.ProjectMapper;
import com.njcn.rdms.module.project.dal.mysql.project.task.TaskAssigneeMapper;
import com.njcn.rdms.module.project.framework.notify.NotifyJumpConstants;
import com.njcn.rdms.module.project.framework.notify.NotifySendEvent;
import com.njcn.rdms.module.project.framework.notify.NotifyTemplateCodeConstants;
import org.junit.jupiter.api.Test;
@@ -63,6 +64,9 @@ class ProjectTaskServiceImplTest extends BaseMockitoUnitTest {
ArgumentCaptor<NotifySendEvent> captor = ArgumentCaptor.forClass(NotifySendEvent.class);
verify(applicationEventPublisher).publishEvent(captor.capture());
NotifySendEvent event = captor.getValue();
assertEquals(NotifyJumpConstants.JUMP_TYPE_TASK,
event.getParams().get(NotifyJumpConstants.PARAM_JUMP_TYPE));
assertEquals("50", event.getParams().get(NotifyJumpConstants.PARAM_PROJECT_ID));
assertEquals(NotifyTemplateCodeConstants.TASK_ASSIGNED, event.getTemplateCode());
assertTrue(event.getUserIds().contains(1L)); // 负责人
assertTrue(event.getUserIds().contains(2L)); // 协办人