feat: 2.0.0
1. 优化详情页查询
This commit is contained in:
parent
947e419299
commit
fb6dfb1019
@ -72,6 +72,10 @@ public class RetryDeadLetterServiceImpl implements RetryDeadLetterService {
|
||||
retryDeadLetterLambdaQueryWrapper.eq(RetryDeadLetter::getIdempotentId, queryVO.getIdempotentId());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(queryVO.getUniqueId())) {
|
||||
retryDeadLetterLambdaQueryWrapper.eq(RetryDeadLetter::getUniqueId, queryVO.getUniqueId());
|
||||
}
|
||||
|
||||
RequestDataHelper.setPartition(queryVO.getGroupName());
|
||||
PageDTO<RetryDeadLetter> retryDeadLetterPageDTO = retryDeadLetterMapper.selectPage(pageDTO, retryDeadLetterLambdaQueryWrapper);
|
||||
|
||||
|
@ -1,21 +1,27 @@
|
||||
package com.aizuda.easy.retry.server.service.impl;
|
||||
|
||||
import akka.actor.ActorRef;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.aizuda.easy.retry.client.model.GenerateRetryIdempotentIdDTO;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.aizuda.easy.retry.common.core.model.Result;
|
||||
import com.aizuda.easy.retry.server.akka.ActorGenerator;
|
||||
import com.aizuda.easy.retry.server.config.RequestDataHelper;
|
||||
import com.aizuda.easy.retry.server.dto.RegisterNodeInfo;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskLogMapper;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskLogMessageMapper;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskMapper;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.po.GroupConfig;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.po.RetryTask;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.po.RetryTaskLog;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.po.RetryTaskLogMessage;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.po.ServerNode;
|
||||
import com.aizuda.easy.retry.server.persistence.support.ConfigAccess;
|
||||
import com.aizuda.easy.retry.server.service.RetryTaskService;
|
||||
import com.aizuda.easy.retry.server.service.convert.RetryTaskConverter;
|
||||
import com.aizuda.easy.retry.server.service.convert.RetryTaskResponseVOConverter;
|
||||
import com.aizuda.easy.retry.server.support.dispatch.actor.log.RetryTaskLogDTO;
|
||||
import com.aizuda.easy.retry.server.support.generator.IdGenerator;
|
||||
import com.aizuda.easy.retry.server.support.handler.ClientNodeAllocateHandler;
|
||||
import com.aizuda.easy.retry.server.support.strategy.WaitStrategies;
|
||||
@ -35,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
@ -62,7 +69,10 @@ public class RetryTaskServiceImpl implements RetryTaskService {
|
||||
private ClientNodeAllocateHandler clientNodeAllocateHandler;
|
||||
@Autowired
|
||||
private List<IdGenerator> idGeneratorList;
|
||||
|
||||
@Autowired
|
||||
private RetryTaskLogMessageMapper retryTaskLogMessageMapper;
|
||||
@Autowired
|
||||
private RetryTaskLogMapper retryTaskLogMapper;
|
||||
@Autowired
|
||||
@Qualifier("configAccessProcessor")
|
||||
private ConfigAccess configAccess;
|
||||
@ -112,6 +122,7 @@ public class RetryTaskServiceImpl implements RetryTaskService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateRetryTaskStatus(RetryTaskUpdateStatusRequestVO retryTaskUpdateStatusRequestVO) {
|
||||
|
||||
RetryStatusEnum retryStatusEnum = RetryStatusEnum.getByStatus(retryTaskUpdateStatusRequestVO.getRetryStatus());
|
||||
@ -134,6 +145,22 @@ public class RetryTaskServiceImpl implements RetryTaskService {
|
||||
WaitStrategies.randomWait(1, TimeUnit.SECONDS, 60, TimeUnit.SECONDS).computeRetryTime(null));
|
||||
}
|
||||
|
||||
if (RetryStatusEnum.FINISH.getStatus().equals(retryStatusEnum.getStatus())) {
|
||||
|
||||
RetryTaskLogMessage retryTaskLogMessage = new RetryTaskLogMessage();
|
||||
retryTaskLogMessage.setUniqueId(retryTask.getUniqueId());
|
||||
retryTaskLogMessage.setGroupName(retryTask.getGroupName());
|
||||
retryTaskLogMessage.setMessage("页面操作完成");
|
||||
retryTaskLogMessage.setCreateDt(LocalDateTime.now());
|
||||
retryTaskLogMessageMapper.insert(retryTaskLogMessage);
|
||||
|
||||
RetryTaskLog retryTaskLog = new RetryTaskLog();
|
||||
retryTaskLog.setRetryStatus(RetryStatusEnum.FINISH.getStatus());
|
||||
retryTaskLogMapper.update(retryTaskLog, new LambdaUpdateWrapper<RetryTaskLog>()
|
||||
.eq(RetryTaskLog::getUniqueId, retryTask.getUniqueId())
|
||||
.eq(RetryTaskLog::getGroupName, retryTask.getGroupName()));
|
||||
}
|
||||
|
||||
RequestDataHelper.setPartition(retryTaskUpdateStatusRequestVO.getGroupName());
|
||||
return retryTaskMapper.updateById(retryTask);
|
||||
}
|
||||
|
@ -13,4 +13,5 @@ public class RetryDeadLetterQueryVO extends BaseQueryVO {
|
||||
private String sceneName;
|
||||
private String bizNo;
|
||||
private String idempotentId;
|
||||
private String uniqueId;
|
||||
}
|
||||
|
@ -29,6 +29,8 @@ public class RetryDeadLetterResponseVO {
|
||||
|
||||
private Integer taskType;
|
||||
|
||||
private String uniqueId;
|
||||
|
||||
private LocalDateTime createDt;
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class RetryTaskLogMessageResponseVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String message;
|
||||
|
||||
private LocalDateTime createDt;
|
||||
|
@ -19,6 +19,7 @@ const api = {
|
||||
deleteRetryTask: '/retry-task/batch',
|
||||
updateRetryTaskStatus: '/retry-task/status',
|
||||
retryTaskLogPage: '/retry-task-log/list',
|
||||
retryTaskLogMessagePage: '/retry-task-log/message/list',
|
||||
retryTaskLogById: '/retry-task-log/',
|
||||
retryDeadLetterPage: '/retry-dead-letter/list',
|
||||
retryDeadLetterById: '/retry-dead-letter/',
|
||||
@ -42,6 +43,14 @@ const api = {
|
||||
|
||||
export default api
|
||||
|
||||
export function getRetryTaskLogMessagePage (parameter) {
|
||||
return request({
|
||||
url: api.retryTaskLogMessagePage,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function pods (parameter) {
|
||||
return request({
|
||||
url: api.pods,
|
||||
|
@ -24,8 +24,13 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="业务id">
|
||||
<a-input v-model="queryParam.idempotentId" placeholder="请输入业务id" allowClear/>
|
||||
<a-form-item label="幂等id">
|
||||
<a-input v-model="queryParam.idempotentId" placeholder="请输入幂等id" allowClear/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="UniqueId">
|
||||
<a-input v-model="queryParam.uniqueId" placeholder="请输入唯一id" allowClear/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
@ -150,6 +155,11 @@ export default {
|
||||
dataIndex: 'sceneName',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: 'UniqueId',
|
||||
dataIndex: 'uniqueId',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: '幂等id',
|
||||
dataIndex: 'idempotentId',
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<page-header-wrapper @back="() => $router.go(-1)" style='margin: -24px -1px 0'>
|
||||
<page-header-wrapper @back="() => $router.go(-1)" style="margin: -24px -1px 0">
|
||||
<div></div>
|
||||
</page-header-wrapper>
|
||||
<a-card :bordered="false">
|
||||
<a-descriptions title="" bordered v-if='retryInfo !== null'>
|
||||
<a-descriptions title="" bordered v-if="retryInfo !== null">
|
||||
<a-descriptions-item label="组名称">
|
||||
{{ retryInfo.groupName }}
|
||||
</a-descriptions-item>
|
||||
@ -41,23 +41,27 @@
|
||||
<a-descriptions-item label="参数" :span="3">
|
||||
{{ retryInfo.argsStr }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="失败原因" :span="3">
|
||||
{{ retryInfo.errorMessage }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="扩展参数" :span="3">
|
||||
{{ retryInfo.extAttrs }}
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
<RetryTaskLogMessageList ref="retryTaskLogMessageListRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRetryTaskLogById } from '@/api/manage'
|
||||
import moment from 'moment'
|
||||
import { STable } from '@/components'
|
||||
import RetryTaskLogMessageList from '@/views/task/RetryTaskLogMessageList'
|
||||
|
||||
export default {
|
||||
name: 'RetryLogInfo',
|
||||
components: {
|
||||
RetryTaskLogMessageList,
|
||||
STable
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
retryInfo: null,
|
||||
@ -83,6 +87,11 @@ export default {
|
||||
if (id) {
|
||||
getRetryTaskLogById(id).then(res => {
|
||||
this.retryInfo = res.data
|
||||
this.queryParam = {
|
||||
groupName: this.retryInfo.groupName,
|
||||
uniqueId: this.retryInfo.uniqueId
|
||||
}
|
||||
this.$refs.retryTaskLogMessageListRef.refreshTable(this.queryParam)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -24,8 +24,13 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="业务id">
|
||||
<a-input v-model="queryParam.idempotentId" placeholder="请输入业务id" allowClear/>
|
||||
<a-form-item label="幂等id">
|
||||
<a-input v-model="queryParam.idempotentId" placeholder="请输入幂等id" allowClear/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="UniqueId">
|
||||
<a-input v-model="queryParam.uniqueId" placeholder="请输入唯一id" allowClear/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
@ -141,9 +146,9 @@ export default {
|
||||
width: '5%'
|
||||
},
|
||||
{
|
||||
title: 'uniqueId',
|
||||
title: 'UniqueId',
|
||||
dataIndex: 'uniqueId',
|
||||
width: '5%'
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: '组名称',
|
||||
@ -157,17 +162,6 @@ export default {
|
||||
ellipsis: true,
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: '幂等id',
|
||||
dataIndex: 'idempotentId',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: '业务编号',
|
||||
dataIndex: 'bizNo',
|
||||
ellipsis: true,
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: '重试状态',
|
||||
dataIndex: 'retryStatus',
|
||||
@ -181,8 +175,14 @@ export default {
|
||||
width: '5%'
|
||||
},
|
||||
{
|
||||
title: '失败原因',
|
||||
dataIndex: 'errorMessage',
|
||||
title: '幂等id',
|
||||
dataIndex: 'idempotentId',
|
||||
width: '15%'
|
||||
},
|
||||
{
|
||||
title: '业务编号',
|
||||
dataIndex: 'bizNo',
|
||||
ellipsis: true,
|
||||
width: '15%'
|
||||
},
|
||||
{
|
||||
|
@ -49,22 +49,19 @@
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
<div style="margin: 20px"></div>
|
||||
<a-card title="日志列表" style="width: 100%">
|
||||
<RetryLogList ref="retryLogListRef" :showSearch="false"/>
|
||||
</a-card>
|
||||
<RetryTaskLogMessageList ref="retryTaskLogMessageListRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRetryTaskById } from '@/api/manage'
|
||||
import moment from 'moment'
|
||||
import RetryLogList from './RetryLogList'
|
||||
import RetryTaskLogMessageList from './RetryTaskLogMessageList'
|
||||
|
||||
export default {
|
||||
name: 'RetryTaskInfo',
|
||||
components: {
|
||||
RetryLogList
|
||||
RetryTaskLogMessageList
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@ -93,7 +90,11 @@ export default {
|
||||
if (id && groupName) {
|
||||
getRetryTaskById(id, { 'groupName': groupName }).then(res => {
|
||||
this.retryTaskInfo = res.data
|
||||
this.$refs.retryLogListRef.refreshTable(res.data)
|
||||
this.queryParam = {
|
||||
groupName: this.retryTaskInfo.groupName,
|
||||
uniqueId: this.retryTaskInfo.uniqueId
|
||||
}
|
||||
this.$refs.retryTaskLogMessageListRef.refreshTable(this.queryParam)
|
||||
})
|
||||
} else {
|
||||
this.$router.push({ path: '/404' })
|
||||
|
@ -39,8 +39,13 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="业务id">
|
||||
<a-input v-model="queryParam.idempotentId" placeholder="请输入业务id" allowClear />
|
||||
<a-form-item label="幂等id">
|
||||
<a-input v-model="queryParam.idempotentId" placeholder="请输入幂等id" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="UniqueId">
|
||||
<a-input v-model="queryParam.uniqueId" placeholder="请输入唯一id" allowClear/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
@ -176,9 +181,9 @@ export default {
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
title: '唯一id',
|
||||
title: 'UniqueId',
|
||||
dataIndex: 'uniqueId',
|
||||
width: '8%'
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: '组名称',
|
||||
@ -208,10 +213,10 @@ export default {
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: '重试次数',
|
||||
title: '次数',
|
||||
dataIndex: 'retryCount',
|
||||
sorter: true,
|
||||
width: '10%'
|
||||
width: '6%'
|
||||
},
|
||||
{
|
||||
title: '重试状态',
|
||||
|
80
frontend/src/views/task/RetryTaskLogMessageList.vue
Normal file
80
frontend/src/views/task/RetryTaskLogMessageList.vue
Normal file
@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin: 20px 0; border-left: #f5222d 5px solid; font-size: medium; font-weight: bold">
|
||||
调用日志详情 (总调度次数: {{ total }})
|
||||
</div>
|
||||
<a-card>
|
||||
<s-table
|
||||
ref="table"
|
||||
size="default"
|
||||
rowKey="key"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
>
|
||||
<span slot="serial" slot-scope="text, record">
|
||||
{{ record.id }}
|
||||
</span>
|
||||
</s-table>
|
||||
</a-card>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
import { getRetryTaskLogMessagePage } from '@/api/manage'
|
||||
import { STable } from '@/components'
|
||||
|
||||
export default {
|
||||
name: 'RetryTaskLogMessageList',
|
||||
components: {
|
||||
STable
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
scopedSlots: { customRender: 'serial' },
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
title: '信息',
|
||||
dataIndex: 'message',
|
||||
width: '50%'
|
||||
},
|
||||
{
|
||||
title: '触发时间',
|
||||
dataIndex: 'createDt',
|
||||
sorter: true,
|
||||
customRender: (text) => moment(text).format('YYYY-MM-DD HH:mm:ss'),
|
||||
width: '10%'
|
||||
}
|
||||
],
|
||||
queryParam: {},
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: parameter => {
|
||||
console.log('loadData.parameter', parameter)
|
||||
return getRetryTaskLogMessagePage(Object.assign(parameter, this.queryParam))
|
||||
.then(res => {
|
||||
this.total = res.total
|
||||
return res
|
||||
})
|
||||
},
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
refreshTable (v) {
|
||||
this.queryParam = v
|
||||
this.$refs.table.refresh(true)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user