REQ-3502: fix bugs
This commit is contained in:
parent
d6f4bd957f
commit
94a7261fde
@ -108,7 +108,7 @@ public class TodoSyncCardService {
|
||||
return;
|
||||
}
|
||||
if (todo.getState() == PendingMessageStateEnum.HAS_BEEN_SENT
|
||||
|| todo.getState() == PendingMessageStateEnum.CREATED)
|
||||
|| (todo.getState() == PendingMessageStateEnum.CREATED && business.getBizFinalState() == null))
|
||||
sendCard(event, business, todo);
|
||||
else if (!TodoManager.OP_FIRE_PRESET_BUTTON_PRESSED.equals(message.getOperation()))
|
||||
updateCardState(event, business, todo);
|
||||
|
||||
@ -25,8 +25,8 @@ class CardManagerTest {
|
||||
|
||||
@Test
|
||||
void rebuildCardContent() {
|
||||
TemplateModelV3 templateModel = cardSupport.ensureImChannelPresent("a7c79c432efc4ecba71790677d35cc59");
|
||||
Card card = cardDao.findCardByBizMessageId("e4b81f64cd854e3e92a6cad8f1546760").orElse(null);
|
||||
TemplateModelV3 templateModel = cardSupport.ensureImChannelPresent("8733f93de8db49699a78eda5a342763c");
|
||||
Card card = cardDao.findCardByBizMessageId("c0d696b2178f442f9488cfc74c518042").orElse(null);
|
||||
BizAssertions.assertNotNull(card, "card not found");
|
||||
cardManager.rebuildCardContent(templateModel, Collections.singletonList(card));
|
||||
}
|
||||
|
||||
@ -2,15 +2,12 @@ package cn.axzo.msg.center.message.service.todo.card;
|
||||
|
||||
import cn.axzo.framework.rocketmq.Event;
|
||||
import cn.axzo.msg.center.MsgCenterApplication;
|
||||
import cn.axzo.msg.center.api.mq.PresetButtonPressedMessage;
|
||||
import cn.axzo.msg.center.api.mq.TodoUpdateMessage;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@ -22,9 +19,9 @@ class TodoSyncCardServiceTest {
|
||||
|
||||
@Test
|
||||
void exec() {
|
||||
String json = "{\"btnPressedRequestNo\": \"437fb871912e4f2f8d7c5d7969164061\", \"messageId\": \"ec98f521-e6a0-4330-a650-245bad478853\", \"messageSendTime\": 1737001768749, \"messageSendTimeStr\": \"2025-01-16 12:29:28\", \"presetButtonType\": \"AGREE\", \"todoInfo\": {\"bizCategory\": \"OTHER\", \"bizCode\": \"test-17\", \"bizDesc\": \"\", \"bizExtParam\": {\"assistLogName\": \"测试\"}, \"bizFinalState\": null, \"bizFlag\": \"\", \"content\": \"系统提示,无需关注\", \"deadline\": null, \"executorId\": 0, \"executorName\": \"test\", \"executorOuId\": 10616, \"executorPersonId\": 9000399522, \"executorType\": \"NOT_SUPPORT\", \"executorWorkspaceId\": 0, \"executorWorkspaceName\": \"\", \"identityCode\": \"68d6f7d480b44891a65d07e482d848e9\", \"orgType\": \"UNKNOWN\", \"promoterId\": 0, \"promoterName\": \"杨林\", \"promoterOuId\": 0, \"promoterPersonId\": 6678911, \"promoterType\": \"NOT_SUPPORT\", \"promoterWorkspaceId\": 0, \"promoterWorkspaceName\": \"\", \"requestNo\": \"c0fef3f2dc7d4264b33d3aafa1906636\", \"routerParams\": {}, \"srcTemplateCode\": \"7aceab1f31ec4570a98cdaf7f8940c61\", \"state\": \"HAS_BEEN_SENT\", \"subBizCode\": \"aaaa\", \"templateCode\": \"7aceab1f31ec4570a98cdaf7f8940c61\", \"title\": \"系统提示\", \"todoBusinessId\": 147049, \"todoId\": 843602, \"type\": \"EXECUTABLE\"}}";
|
||||
PresetButtonPressedMessage message = JSON.parseObject(json, PresetButtonPressedMessage.class);
|
||||
todoSyncCardService.syncTodoPresetButtonPressed(message);
|
||||
String json = "{\"messageId\": \"8a771827-f17f-4527-87b9-8a7d182404d6\", \"messageSendTime\": 1737022307826, \"messageSendTimeStr\": \"2025-01-16 18:11:47\", \"operation\": \"updateBusinessFinalBizState\", \"updateCard\": true, \"updatedTodo\": {\"bizCategory\": \"FLOW\", \"bizCode\": \"202501161807200000000\", \"bizDesc\": \"抄送节点\", \"bizExtParam\": {\"processInstanceId\": \"202501161807200000000\", \"[_INTERNAL_INITIATOR_]\": {\"assignerName\": \"杨期成\", \"ouId\": \"10401\", \"tenantId\": \"4949\", \"personId\": \"9000400630\", \"avatar\": \"https://axzo-public.oss-cn-chengdu.aliyuncs.com/oms/oms/cac12b80cac342b5b9fcef5f470b189e.jpg\", \"assignee\": \"1229802\", \"assigneeType\": \"3\"}, \"[_INTERNAL_PROCESS_WORKSPACE_TYPE]\": 2, \"activityName\": \"抄送节点\", \"businessName\": \"工作流开发测试项目业务\", \"processResult\": \"审批中\", \"initiatorUserName\": \"杨期成\", \"[_CREATE_INSTANCE_PARAMS]\": \"{\\\"processDefinitionKey\\\":\\\"wfTestProj\\\",\\\"tenantId\\\":\\\"4949\\\",\\\"variables\\\":{\\\"[_INTERNAL_PROCESS_WORKSPACE_TYPE]\\\":2,\\\"[_INTERNAL_INITIATOR_]\\\":\\\"{\\\\\\\"assignee\\\\\\\":\\\\\\\"1229802\\\\\\\",\\\\\\\"assigneeType\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"assignerName\\\\\\\":\\\\\\\"杨期成\\\\\\\",\\\\\\\"avatar\\\\\\\":\\\\\\\"https://axzo-public.oss-cn-chengdu.aliyuncs.com/oms/oms/cac12b80cac342b5b9fcef5f470b189e.jpg\\\\\\\",\\\\\\\"ouId\\\\\\\":\\\\\\\"10401\\\\\\\",\\\\\\\"personId\\\\\\\":\\\\\\\"9000400630\\\\\\\",\\\\\\\"tenantId\\\\\\\":\\\\\\\"4949\\\\\\\"}\\\",\\\"[_BIZ_ORG_RELATION_]\\\":{\\\"orgScopes\\\":[{\\\"workspaceType\\\":2,\\\"workspaceId\\\":4949,\\\"ouId\\\":10401,\\\"nodeId\\\":21335}]},\\\"[_WORKFLOW_ENGINE_VERSION_]\\\":\\\"1.5.2\\\",\\\"[_PENDING_VARIABLES]\\\":{},\\\"[_INTERNAL_PROCESS_AGENT]\\\":true},\\\"pendingVariables\\\":{},\\\"cooperationOrg\\\":{\\\"orgScopes\\\":[{\\\"workspaceType\\\":2,\\\"workspaceId\\\":4949,\\\"ouId\\\":10401,\\\"nodeId\\\":21335}]},\\\"businessKey\\\":\\\"40\\\",\\\"initiator\\\":{\\\"assignee\\\":\\\"1229802\\\",\\\"assigneeType\\\":\\\"3\\\",\\\"assignerName\\\":\\\"杨期成\\\",\\\"personId\\\":\\\"9000400630\\\",\\\"tenantId\\\":\\\"4949\\\",\\\"ouId\\\":\\\"10401\\\",\\\"avatar\\\":\\\"https://axzo-public.oss-cn-chengdu.aliyuncs.com/oms/oms/cac12b80cac342b5b9fcef5f470b189e.jpg\\\"},\\\"async\\\":false,\\\"startFormVariables\\\":{}}\", \"taskStartTime\": \"2025-01-16 18:07:23\", \"[_INTERNAL_PROCESS_AGENT]\": true, \"activityId\": \"node_157456498639\", \"[_WORKFLOW_ENGINE_VERSION_]\": \"1.5.2\", \"processStartTime\": \"2025-01-16 18:07:23\", \"tenantId\": \"4949\", \"businessKey\": \"40\", \"operatorType\": \"\", \"taskId\": \"202501161807200000033\", \"[_PENDING_VARIABLES]\": {}, \"processInstanceName\": \"工作流业务测试项目流程\"}, \"bizFinalState\": \"REJECTED\", \"bizFlag\": \"\", \"content\": \"杨期成发起的工作流开发测试项目业务流程抄送给您,请及时查看。\", \"deadline\": null, \"executorId\": 0, \"executorName\": \"张永强\", \"executorOuId\": 9550, \"executorPersonId\": 40695, \"executorType\": \"NOT_SUPPORT\", \"executorWorkspaceId\": 3561, \"executorWorkspaceName\": \"上海棋院(上海市棋牌运动管理中心)\", \"identityCode\": \"7a0eb00f68884824b356240eb7fb8d38\", \"orgType\": \"ENT\", \"promoterId\": 0, \"promoterName\": \"杨期成\", \"promoterOuId\": 10401, \"promoterPersonId\": 9000400630, \"promoterType\": \"NOT_SUPPORT\", \"promoterWorkspaceId\": 4949, \"promoterWorkspaceName\": \"核西南院设计有限公司\", \"requestNo\": \"54f148e904374dad95f2abf2329afa0f\", \"routerParams\": {\"processNodeCode\": \"node_157456498639\", \"processInstanceId\": \"202501161807200000000\", \"creator\": \"杨期成\", \"title\": \"工作流业务测试项目流程\", \"userAgreeSignature\": true, \"businessTypeName\": \"抄送节点\", \"tenantId\": \"3561\", \"businessKey\": \"40\", \"startTime\": \"2025-01-16 18:07:23\", \"initiatorTenantId\": \"4949\", \"taskId\": \"202501161807200000033\", \"processNodeName\": \"抄送节点\"}, \"srcTemplateCode\": \"8733f93de8db49699a78eda5a342763c\", \"state\": \"CREATED\", \"subBizCode\": \"202501161807200000033\", \"templateCode\": \"8733f93de8db49699a78eda5a342763c\", \"title\": \"抄送消息\", \"todoBusinessId\": 249849, \"todoId\": 1016974, \"type\": \"COPIED_TO_ME\"}}";
|
||||
TodoUpdateMessage message = JSON.parseObject(json, TodoUpdateMessage.class);
|
||||
todoSyncCardService.onMessage(new Event(), message);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user