feat(notify): 待办/抄送消息补 jumpApp 页面归属(B0 直批配套补提交)——bizUrl 落地页场景 jumpApp=instance.bizType(接收方按它查基址),未传 bizUrl 回落办理页留空按 bizType;UserMsgClient.sendUserMsg 增 jumpApp 形参;CallbackPushService/ConditionRouteService 跟随 B 系列回调前缀改造;测试补 jumpApp 断言
build / build-push (push) Successful in 49s
build / build-push (push) Successful in 49s
This commit is contained in:
@@ -103,8 +103,8 @@ class CallbackDispatchIT extends FlowTestSupport {
|
||||
|
||||
@Override
|
||||
public void sendUserMsg(Integer schId, List<Integer> userIds, Integer msgType, String bizType,
|
||||
String bizId, String title, String content, String jumpPath, String msgNo,
|
||||
Integer expireDays) {
|
||||
String bizId, String title, String content, String jumpPath, String jumpApp,
|
||||
String msgNo, Integer expireDays) {
|
||||
if (msgNo != null && msgNo.startsWith("hang:")) {
|
||||
hangAlerts.incrementAndGet();
|
||||
}
|
||||
|
||||
@@ -13,14 +13,16 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* 待办通知 jumpPath 两态(第三步 T-C3):办件 bizUrl 非空=直达应用详情页(应用内审批免跳
|
||||
* 流程中心);空/空白=回落流程中心办理页 /task/{taskId}。
|
||||
* 待办通知 jumpPath/jumpApp 语义(自指地址优化 Phase 2):办件 bizUrl 非空=直达业务方详情页,
|
||||
* 页面归属 jumpApp=instance.bizType(接收方按它查基址);空/空白=回落流程中心办理页
|
||||
* /task/{taskId},页面属自己(jumpApp=null,接收方按 bizType 回落)。
|
||||
*/
|
||||
class UserMsgNotifierBizUrlTest {
|
||||
|
||||
@@ -29,9 +31,10 @@ class UserMsgNotifierBizUrlTest {
|
||||
private CapturingUserMsgClient userMsg;
|
||||
private UserMsgNotifier notifier;
|
||||
|
||||
/** 捕获 jumpPath 的哑客户端 */
|
||||
/** 捕获 jumpPath/jumpApp 的哑客户端 */
|
||||
static class CapturingUserMsgClient extends UserMsgClient {
|
||||
String lastJumpPath;
|
||||
String lastJumpApp;
|
||||
|
||||
CapturingUserMsgClient() {
|
||||
super(null, null, false, "");
|
||||
@@ -39,9 +42,10 @@ class UserMsgNotifierBizUrlTest {
|
||||
|
||||
@Override
|
||||
public void sendUserMsg(Integer schId, List<Integer> userIds, Integer msgType, String bizType,
|
||||
String bizId, String title, String content, String jumpPath, String msgNo,
|
||||
Integer expireDays) {
|
||||
String bizId, String title, String content, String jumpPath, String jumpApp,
|
||||
String msgNo, Integer expireDays) {
|
||||
this.lastJumpPath = jumpPath;
|
||||
this.lastJumpApp = jumpApp;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,7 +63,7 @@ class UserMsgNotifierBizUrlTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void bizUrlPresent_jumpsToAppDetail() {
|
||||
void bizUrlPresent_relativePath_declaresBizOwner() {
|
||||
FlwTask task = new FlwTask();
|
||||
task.setId(77L);
|
||||
task.setAssigneeId(101);
|
||||
@@ -68,17 +72,41 @@ class UserMsgNotifierBizUrlTest {
|
||||
instance.setId(5L);
|
||||
instance.setSchId(1L);
|
||||
instance.setBizTitle("张三的事项");
|
||||
instance.setBizUrl("http://base.yunhaixingtong.com/notice/front/detail/27");
|
||||
instance.setBizType("notice");
|
||||
instance.setBizUrl("/list/detail?serid=27");
|
||||
when(taskRepository.findById(77L)).thenReturn(Optional.of(task));
|
||||
when(instanceRepository.findById(5L)).thenReturn(Optional.of(instance));
|
||||
|
||||
notifier.onFlowEvent(FlowEvent.of(FlowEvent.Type.TASK_CREATED, 5L, 77L, 101, "甲", null));
|
||||
|
||||
assertEquals("http://base.yunhaixingtong.com/notice/front/detail/27", userMsg.lastJumpPath);
|
||||
assertEquals("/list/detail?serid=27", userMsg.lastJumpPath);
|
||||
assertEquals("notice", userMsg.lastJumpApp);
|
||||
}
|
||||
|
||||
/** 存量兼容:业务方尚未升级仍传绝对 URL 时原样透传,jumpApp 照常按归属声明 */
|
||||
@Test
|
||||
void bizUrlLegacyAbsolute_passedThroughWithOwner() {
|
||||
FlwTask task = new FlwTask();
|
||||
task.setId(79L);
|
||||
task.setAssigneeId(101);
|
||||
task.setInstanceId(7L);
|
||||
FlwInstance instance = new FlwInstance();
|
||||
instance.setId(7L);
|
||||
instance.setSchId(1L);
|
||||
instance.setBizTitle("王五的事项");
|
||||
instance.setBizType("notice");
|
||||
instance.setBizUrl("http://base.yunhaixingtong.com/notice/#/list/detail?serid=27");
|
||||
when(taskRepository.findById(79L)).thenReturn(Optional.of(task));
|
||||
when(instanceRepository.findById(7L)).thenReturn(Optional.of(instance));
|
||||
|
||||
notifier.onFlowEvent(FlowEvent.of(FlowEvent.Type.TASK_CREATED, 7L, 79L, 101, "丙", null));
|
||||
|
||||
assertEquals("http://base.yunhaixingtong.com/notice/#/list/detail?serid=27", userMsg.lastJumpPath);
|
||||
assertEquals("notice", userMsg.lastJumpApp);
|
||||
}
|
||||
|
||||
@Test
|
||||
void bizUrlBlank_fallsBackToTaskPage() {
|
||||
void bizUrlBlank_fallsBackToTaskPage_withoutOwner() {
|
||||
FlwTask task = new FlwTask();
|
||||
task.setId(78L);
|
||||
task.setAssigneeId(101);
|
||||
@@ -94,5 +122,6 @@ class UserMsgNotifierBizUrlTest {
|
||||
notifier.onFlowEvent(FlowEvent.of(FlowEvent.Type.TASK_CREATED, 6L, 78L, 101, "乙", null));
|
||||
|
||||
assertEquals("/task/78", userMsg.lastJumpPath);
|
||||
assertNull(userMsg.lastJumpApp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user