Commit 40114f1a by yuwei

项目初始化

parent a9ce480c
......@@ -5,6 +5,7 @@ import cn.datax.common.utils.ThrowableUtil;
import cn.datax.service.data.masterdata.api.entity.ModelEntity;
import cn.datax.service.data.masterdata.dao.ModelDao;
import cn.datax.service.workflow.api.enums.VariablesEnum;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
......@@ -41,10 +42,10 @@ public class RabbitMqListenerConfig {
String businessKey = (String) map.get(VariablesEnum.businessKey.toString());
String businessCode = (String) map.get(VariablesEnum.businessCode.toString());
String flowStatus = (String) map.get("flowStatus");
ModelEntity model = new ModelEntity();
model.setId(businessKey);
model.setFlowStatus(flowStatus);
modelDao.updateById(model);
LambdaUpdateWrapper<ModelEntity> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(ModelEntity::getFlowStatus, flowStatus);
updateWrapper.eq(ModelEntity::getId, businessKey);
modelDao.update(null, updateWrapper);
} catch (Exception e) {
log.error("全局异常信息ex={}, StackTrace={}", e.getMessage(), ThrowableUtil.getStackTrace(e));
if (message.getMessageProperties().getRedelivered()){
......
......@@ -178,7 +178,8 @@ export default {
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
// this.$router.push(`/login?redirect=${this.$route.fullPath}`)
this.$router.push('/login')
},
handlePassword() {
this.dialogHandlePasswordVisible = true
......
......@@ -115,3 +115,12 @@ export function param2Obj(url) {
})
return obj
}
export function formatDuration(mss) {
const days = Math.floor(mss / (1000 * 60 * 60 * 24))
const hours = Math.floor((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
const minutes = Math.floor((mss % (1000 * 60 * 60)) / (1000 * 60))
const seconds = Math.round((mss % (1000 * 60)) / 1000)
return ((days > 0) ? days + '天' : '') + ((hours > 0) ? hours + '小时' : '') +
((minutes > 0) ? minutes + '分钟' : '') + ((seconds > 0) ? seconds + '秒' : '')
}
......@@ -43,8 +43,8 @@ export default {
return {
background: background,
loginForm: {
username: 'admin',
password: '123456'
username: '',
password: ''
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
......
......@@ -77,6 +77,7 @@
<script>
import { pageMyInvolvedInstance } from '@/api/workflow/instance'
import FlowImage from '../components/FlowImage'
import { formatDuration } from '@/utils'
export default {
name: 'MyInvolvedInstanceList',
......@@ -98,7 +99,7 @@ export default {
{ prop: 'name', label: '流程实列名称', show: true },
{ prop: 'startTime', label: '开始时间', show: true },
{ prop: 'endTime', label: '结束时间', show: true },
{ prop: 'durationInMillis', label: '耗时', show: true }
{ prop: 'durationInMillis', label: '耗时', show: true, formatter: this.durationFormatter }
],
// 表格数据
tableDataList: [],
......@@ -159,6 +160,9 @@ export default {
console.log(`当前页: ${val}`)
this.queryParams.pageNum = val
this.getList()
},
durationFormatter(row, column, cellValue, index) {
return formatDuration(cellValue)
}
}
}
......
......@@ -77,6 +77,7 @@
<script>
import { pageMyStartedInstance } from '@/api/workflow/instance'
import FlowImage from '../components/FlowImage'
import { formatDuration } from '@/utils'
export default {
name: 'MyStartedInstanceList',
......@@ -98,7 +99,7 @@ export default {
{ prop: 'name', label: '流程实列名称', show: true },
{ prop: 'startTime', label: '开始时间', show: true },
{ prop: 'endTime', label: '结束时间', show: true },
{ prop: 'durationInMillis', label: '耗时', show: true }
{ prop: 'durationInMillis', label: '耗时', show: true, formatter: this.durationFormatter }
],
// 表格数据
tableDataList: [],
......@@ -159,6 +160,9 @@ export default {
console.log(`当前页: ${val}`)
this.queryParams.pageNum = val
this.getList()
},
durationFormatter(row, column, cellValue, index) {
return formatDuration(cellValue)
}
}
}
......
......@@ -66,6 +66,7 @@
<script>
import { pageDoneTask } from '@/api/workflow/task'
import { formatDuration } from '@/utils'
export default {
name: 'TaskDoneList',
......@@ -85,7 +86,7 @@ export default {
{ prop: 'businessName', label: '业务名称', show: true },
{ prop: 'createTime', label: '开始时间', show: true },
{ prop: 'endTime', label: '结束时间', show: true },
{ prop: 'durationInMillis', label: '耗时', show: true }
{ prop: 'durationInMillis', label: '耗时', show: true, formatter: this.durationFormatter }
],
// 表格数据
tableDataList: [],
......@@ -142,12 +143,8 @@ export default {
this.queryParams.pageNum = val
this.getList()
},
statusFormatter(row, column, cellValue, index) {
if (cellValue === 1) {
return <el-tag type='success'>激活</el-tag>
} else if (cellValue === 2) {
return <el-tag type='warning'>挂起</el-tag>
}
durationFormatter(row, column, cellValue, index) {
return formatDuration(cellValue)
}
}
}
......
......@@ -249,13 +249,6 @@ export default {
console.log(`当前页: ${val}`)
this.queryParams.pageNum = val
this.getList()
},
statusFormatter(row, column, cellValue, index) {
if (cellValue === 1) {
return <el-tag type='success'>激活</el-tag>
} else if (cellValue === 2) {
return <el-tag type='warning'>挂起</el-tag>
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment