forked from BaoKaiWms/202501-Wms-Kate-Wuxi
Merge pull request '堆垛机监控提交 && 定时任务提交' (#3) from liyuqi/202501-Wms-Kate-Wuxi:master into master
Reviewed-on: http://112.4.208.194:3000/BaoKaiWms/202501-Wms-Kate-Wuxi/pulls/3
This commit is contained in:
commit
519f27ae67
13
dev_wms_client/src/api/equipment.js
Normal file
13
dev_wms_client/src/api/equipment.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getEquipmentsByPage = (params) => {
|
||||
return request({
|
||||
url: '/equipment/queryEquipmentInfoByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getEquipmentsByPage
|
||||
}
|
||||
13
dev_wms_client/src/api/job.js
Normal file
13
dev_wms_client/src/api/job.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getJobsByPage = (params) => {
|
||||
return request({
|
||||
url: '/job/queryJobInfoByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getJobsByPage
|
||||
}
|
||||
|
|
@ -304,4 +304,44 @@ export const invResultOptions = [
|
|||
value: 1,
|
||||
label: '盘盈'
|
||||
}
|
||||
]
|
||||
// 设备类型枚举
|
||||
export const equipmentTypeOptions = [
|
||||
{
|
||||
value: 1,
|
||||
label: '堆垛机'
|
||||
}
|
||||
]
|
||||
// 设备状态枚举
|
||||
export const equipmentStatusOptions = [
|
||||
{
|
||||
value: 0,
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '可用'
|
||||
}
|
||||
]
|
||||
// 定时器类型枚举
|
||||
export const timerTypeOptions = [
|
||||
{
|
||||
value: 1,
|
||||
label: '普通定时器'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: 'Cron表达式'
|
||||
}
|
||||
]
|
||||
// 任务状态枚举
|
||||
export const jobStatusOptions = [
|
||||
{
|
||||
value: 0,
|
||||
label: '不生效'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '生效'
|
||||
}
|
||||
]
|
||||
263
dev_wms_client/src/layout/equipment.vue
Normal file
263
dev_wms_client/src/layout/equipment.vue
Normal file
|
|
@ -0,0 +1,263 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="设备ID">
|
||||
<el-input v-model="searchQueryFormEntity.equipmentId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型">
|
||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.equipmentType"
|
||||
placeholder="设备类型"
|
||||
:options="addAllOptionOfOptions(equipmentTypeOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态">
|
||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.equipmentStatus"
|
||||
placeholder="设备状态"
|
||||
:options="addAllOptionOfOptions(equipmentStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model="searchQueryFormEntity.equipmentName" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.equipmentId" v-model="equipmentId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="equipmentId" label="设备ID" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="equipmentName" label="设备名称" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="equipmentType" label="设备类型" min-width="120px" :formatter="equipmentTypeFormat"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="equipmentStatus" label="设备状态" :formatter="equipmentStatusFormat"
|
||||
min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="equipmentDesc" label="设备描述" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="lastUpdateTime" label="最后更新时间" min-width="180px" sortable="custom"
|
||||
:formatter="timeFormat" show-overflow-tooltip/>
|
||||
<el-table-column prop="lastUpdateUser" label="最后更新用户" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
</el-table>
|
||||
<br/>
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import {timeFormatter} from '@/utils/formatter.js'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||
import {labelPosition} from '@/constant/form.js'
|
||||
import {getEquipmentsByPage} from "@/api/equipment";
|
||||
import {equipmentTypeOptions, equipmentStatusOptions} from "@/constant/options";
|
||||
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
const STAND_ID = store.getters.getStandId
|
||||
const USER_NAME = store.getters.getUserName
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let tableData = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['equipmentId', true]]),// 按照设备ID顺序排序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
})
|
||||
let searchQueryFormEntity = reactive({
|
||||
equipmentId: '',
|
||||
equipmentType: -99,
|
||||
equipmentStatus: -99,
|
||||
equipmentName: '',
|
||||
equipmentDesc: ''
|
||||
})
|
||||
let searchQueryFormRef = ref()
|
||||
let equipmentId = ''
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.equipmentId = searchQueryFormEntity.equipmentId.trim() || null
|
||||
request.equipmentType = searchQueryFormEntity.equipmentType === -99 ? null : searchQueryFormEntity.equipmentType
|
||||
request.equipmentStatus = searchQueryFormEntity.equipmentStatus === -99 ? null : searchQueryFormEntity.equipmentStatus
|
||||
request.equipmentName = searchQueryFormEntity.equipmentName.trim() || null
|
||||
request.equipmentDesc = searchQueryFormEntity.equipmentDesc.trim() || null
|
||||
getEquipmentsByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
tableData.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
tableData.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.equipmentId = ''
|
||||
searchQueryFormEntity.equipmentType = -99
|
||||
searchQueryFormEntity.equipmentStatus = -99
|
||||
searchQueryFormEntity.equipmentName = ''
|
||||
searchQueryFormEntity.equipmentDesc = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
equipmentId = row.equipmentId
|
||||
}
|
||||
const timeFormat = (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
}
|
||||
const equipmentTypeFormat = (row, column, cellValue, index) => {
|
||||
const option = equipmentTypeOptions.find(item => item.value === cellValue)
|
||||
return option ? option.label : cellValue
|
||||
}
|
||||
const equipmentStatusFormat = (row, column, cellValue, index) => {
|
||||
return cellValue === 1 ? '可用' : '不可用'
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input-number {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
274
dev_wms_client/src/layout/job.vue
Normal file
274
dev_wms_client/src/layout/job.vue
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="任务名">
|
||||
<el-input v-model="searchQueryFormEntity.jobName" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="定时器类型">
|
||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.timerType" placeholder="定时器类型"
|
||||
:options="addAllOptionOfOptions(timerTypeOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态">
|
||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.jobStatus" placeholder="任务状态"
|
||||
:options="addAllOptionOfOptions(jobStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类">
|
||||
<el-input v-model="searchQueryFormEntity.jobClass" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.jobName" v-model="jobName"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="jobName" label="任务名" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="jobClass" label="任务类" min-width="200px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="timerType" label="定时器类型" min-width="120px" :formatter="timerTypeFormat"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="jobStatus" label="任务状态" :formatter="jobStatusFormat"
|
||||
min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column label="定时规则" min-width="150px" sortable="custom"
|
||||
show-overflow-tooltip>
|
||||
<template v-slot="scope">
|
||||
{{ getTimerRule(scope.row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br/>
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import {timeFormatter} from '@/utils/formatter.js'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||
import {labelPosition} from '@/constant/form.js'
|
||||
import {getJobsByPage} from "@/api/job";
|
||||
import {timerTypeOptions, jobStatusOptions} from "@/constant/options";
|
||||
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
const STAND_ID = store.getters.getStandId
|
||||
const USER_NAME = store.getters.getUserName
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let tableData = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['jobName', true]]),// 按照任务名顺序排序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
})
|
||||
let searchQueryFormEntity = reactive({
|
||||
jobName: '',
|
||||
jobClass: '',
|
||||
cronExpression: '',
|
||||
timer: null,
|
||||
timerType: -99,
|
||||
jobStatus: -99
|
||||
})
|
||||
let searchQueryFormRef = ref()
|
||||
let jobName = ''
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.jobName = searchQueryFormEntity.jobName.trim() || null
|
||||
request.jobClass = searchQueryFormEntity.jobClass.trim() || null
|
||||
request.cronExpression = searchQueryFormEntity.cronExpression.trim() || null
|
||||
request.timer = searchQueryFormEntity.timer
|
||||
request.timerType = searchQueryFormEntity.timerType === -99 ? null : searchQueryFormEntity.timerType
|
||||
request.jobStatus = searchQueryFormEntity.jobStatus === -99 ? null : searchQueryFormEntity.jobStatus
|
||||
getJobsByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
tableData.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
tableData.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.jobName = ''
|
||||
searchQueryFormEntity.jobClass = ''
|
||||
searchQueryFormEntity.cronExpression = ''
|
||||
searchQueryFormEntity.timer = null
|
||||
searchQueryFormEntity.timerType = -99
|
||||
searchQueryFormEntity.jobStatus = -99
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
jobName = row.jobName
|
||||
}
|
||||
const timeFormat = (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
}
|
||||
const timerTypeFormat = (row, column, cellValue, index) => {
|
||||
const option = timerTypeOptions.find(item => item.value === cellValue)
|
||||
return option ? option.label : cellValue
|
||||
}
|
||||
const jobStatusFormat = (row, column, cellValue, index) => {
|
||||
return cellValue === 1 ? '生效' : '不生效'
|
||||
}
|
||||
const getTimerRule = (row) => {
|
||||
if (row.timerType === 2) {
|
||||
// Cron表达式
|
||||
return row.cronExpression || '-'
|
||||
} else if (row.timerType === 1) {
|
||||
// 普通定时器,显示毫秒数
|
||||
return row.timer ? `${row.timer}ms` : '-'
|
||||
}
|
||||
return '-'
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input-number {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -37,6 +37,8 @@ const routes = [
|
|||
{path: '/kittingList', component: () => import('@/layout/kittingList.vue')},// 配料单
|
||||
{path: '/kittingRelation', component: () => import('@/layout/kittingRelation.vue')},// 对应关系
|
||||
{path: '/imageTable', component: () => import('@/layout/ImageTable.vue')},
|
||||
{path: '/equipment', component: () => import('@/layout/equipment.vue')},
|
||||
{path: '/job', component: () => import('@/layout/job.vue')},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.wms_main.controller.wms;
|
||||
import com.wms_main.model.dto.query.EquipmentQuery;
|
||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||
import com.wms_main.model.vo.wms.EquipmentVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
import com.wms_main.service.controller.IEquipmentControllerService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wms/equipment")
|
||||
public class EquipmentController {
|
||||
private final IEquipmentControllerService equipmentControllerService;
|
||||
|
||||
/**
|
||||
* 查询堆垛机信息
|
||||
* @param equipmentQuery 查询参数
|
||||
* @return 查询结果
|
||||
*/
|
||||
@PostMapping("/queryEquipmentInfoByPage")
|
||||
public WmsApiResponse<PageVo<EquipmentVo>> queryEquipmentInfoByPage(@RequestBody EquipmentQuery equipmentQuery) {
|
||||
return equipmentControllerService.queryEquipmentInfoByPage(equipmentQuery);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
package com.wms_main.controller.wms;
|
||||
|
||||
import com.wms_main.model.dto.query.JobQuery;
|
||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||
import com.wms_main.model.vo.wms.JobVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
import com.wms_main.service.controller.IJobControllerService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 定时类控制类
|
||||
|
|
@ -15,4 +17,15 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wms/job")
|
||||
public class JobController {
|
||||
private final IJobControllerService jobControllerService;
|
||||
|
||||
/**
|
||||
* 查询堆垛机信息
|
||||
* @param jobQuery 查询参数
|
||||
* @return 查询结果
|
||||
*/
|
||||
@PostMapping("/queryJobInfoByPage")
|
||||
public WmsApiResponse<PageVo<JobVo>> queryJobInfoByPage(@RequestBody JobQuery jobQuery) {
|
||||
return jobControllerService.queryJobInfoByPage(jobQuery);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.wms_main.model.dto.query;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class EquipmentQuery extends PageQuery {
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@JsonProperty(value = "equipmentId")
|
||||
private Integer equipmentId;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@JsonProperty(value = "equipmentType")
|
||||
private Integer equipmentType;
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
@JsonProperty(value = "equipmentStatus")
|
||||
private Integer equipmentStatus;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@JsonProperty(value = "equipmentName")
|
||||
private String equipmentName;
|
||||
/**
|
||||
* 设备描述
|
||||
*/
|
||||
@JsonProperty(value = "equipmentDesc")
|
||||
private String equipmentDesc;
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.wms_main.model.dto.query;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JobQuery extends PageQuery {
|
||||
/**
|
||||
* 任务名
|
||||
*/
|
||||
@JsonProperty(value = "jobName")
|
||||
private String jobName;
|
||||
/**
|
||||
* 任务类class
|
||||
*/
|
||||
@JsonProperty(value = "jobClass")
|
||||
private String jobClass;
|
||||
/**
|
||||
* cron表达式
|
||||
*/
|
||||
@JsonProperty(value = "cronExpression")
|
||||
private String cronExpression;
|
||||
/**
|
||||
* 普通定时器---单位:毫秒。
|
||||
*/
|
||||
@JsonProperty(value = "timer")
|
||||
private Integer timer;
|
||||
/**
|
||||
* timer类型
|
||||
* 1: 普通定时器
|
||||
* 2:cron
|
||||
*/
|
||||
@JsonProperty(value = "timerType")
|
||||
private Integer timerType;
|
||||
/**
|
||||
* 任务状态
|
||||
* 1:启用
|
||||
* 0:未启用
|
||||
*/
|
||||
@JsonProperty(value = "jobStatus")
|
||||
private Integer jobStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.wms_main.model.vo.wms;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.wms_main.model.po.TAppEquipment;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class EquipmentVo {
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@JsonProperty(value = "equipmentId")
|
||||
private Integer equipmentId;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@JsonProperty(value = "equipmentType")
|
||||
private Integer equipmentType;
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
@JsonProperty(value = "equipmentStatus")
|
||||
private Integer equipmentStatus;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@JsonProperty(value = "equipmentName")
|
||||
private String equipmentName;
|
||||
/**
|
||||
* 设备描述
|
||||
*/
|
||||
@JsonProperty(value = "equipmentDesc")
|
||||
private String equipmentDesc;
|
||||
/**
|
||||
* 上次更新时间
|
||||
*/
|
||||
@JsonProperty(value = "lastUpdateTime")
|
||||
private LocalDateTime lastUpdateTime;
|
||||
/**
|
||||
* 上次更新用户
|
||||
*/
|
||||
@JsonProperty(value = "lastUpdateUser")
|
||||
private String lastUpdateUser;
|
||||
|
||||
/**
|
||||
* 将po对象转换为vo对象
|
||||
* @param po po对象
|
||||
* @return vo
|
||||
*/
|
||||
public static EquipmentVo of(TAppEquipment po) {
|
||||
if (po == null) {
|
||||
return new EquipmentVo();
|
||||
}
|
||||
// 返回vo
|
||||
return new EquipmentVo(
|
||||
po.getEquipmentId(),
|
||||
po.getEquipmentType(),
|
||||
po.getEquipmentStatus(),
|
||||
po.getEquipmentName(),
|
||||
po.getEquipmentDesc(),
|
||||
po.getLastUpdateTime(),
|
||||
po.getLastUpdateUser()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.wms_main.model.vo.wms;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.wms_main.model.po.TAppJobs;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JobVo {
|
||||
/**
|
||||
* 任务名
|
||||
*/
|
||||
@JsonProperty(value = "jobName")
|
||||
private String jobName;
|
||||
/**
|
||||
* 任务类class
|
||||
*/
|
||||
@JsonProperty(value = "jobClass")
|
||||
private String jobClass;
|
||||
/**
|
||||
* cron表达式
|
||||
*/
|
||||
@JsonProperty(value = "cronExpression")
|
||||
private String cronExpression;
|
||||
/**
|
||||
* 普通定时器---单位:毫秒。
|
||||
*/
|
||||
@JsonProperty(value = "timer")
|
||||
private Integer timer;
|
||||
/**
|
||||
* timer类型
|
||||
* 1: 普通定时器
|
||||
* 2:cron
|
||||
*/
|
||||
@JsonProperty(value = "timerType")
|
||||
private Integer timerType;
|
||||
/**
|
||||
* 任务状态
|
||||
* 1:启用
|
||||
* 0:未启用
|
||||
*/
|
||||
@JsonProperty(value = "jobStatus")
|
||||
private Integer jobStatus;
|
||||
|
||||
/**
|
||||
* 将po对象转换为vo对象
|
||||
* @param po po对象
|
||||
* @return vo
|
||||
*/
|
||||
public static JobVo of(TAppJobs po) {
|
||||
if (po == null) {
|
||||
return new JobVo();
|
||||
}
|
||||
// 返回vo
|
||||
return new JobVo(
|
||||
po.getJobName(),
|
||||
po.getJobClass(),
|
||||
po.getCronExpression(),
|
||||
po.getTimer(),
|
||||
po.getTimerType(),
|
||||
po.getJobStatus()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.wms_main.service.controller;
|
||||
import com.wms_main.model.dto.query.EquipmentQuery;
|
||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||
import com.wms_main.model.vo.wms.EquipmentVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
|
||||
public interface IEquipmentControllerService {
|
||||
WmsApiResponse<PageVo<EquipmentVo>> queryEquipmentInfoByPage(EquipmentQuery equipmentQuery);
|
||||
}
|
||||
|
|
@ -1,4 +1,10 @@
|
|||
package com.wms_main.service.controller;
|
||||
|
||||
import com.wms_main.model.dto.query.JobQuery;
|
||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||
import com.wms_main.model.vo.wms.JobVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
|
||||
public interface IJobControllerService {
|
||||
WmsApiResponse<PageVo<JobVo>> queryJobInfoByPage(JobQuery jobQuery);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.wms_main.service.controller.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms_main.dao.ITAppEquipmentService;
|
||||
import com.wms_main.model.dto.query.EquipmentQuery;
|
||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||
import com.wms_main.model.po.TAppEquipment;
|
||||
import com.wms_main.model.vo.wms.EquipmentVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
import com.wms_main.repository.utils.StringUtils;
|
||||
import com.wms_main.service.controller.IEquipmentControllerService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class EquipmentControllerServiceImpl implements IEquipmentControllerService {
|
||||
private final ITAppEquipmentService equipmentService;
|
||||
|
||||
@Override
|
||||
public WmsApiResponse<PageVo<EquipmentVo>> queryEquipmentInfoByPage(EquipmentQuery equipmentQuery) {
|
||||
if (equipmentQuery == null) {
|
||||
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||
}
|
||||
Page<TAppEquipment> page = equipmentQuery.toMpPage();
|
||||
LambdaQueryWrapper<TAppEquipment> lambdaQueryWrapper = new LambdaQueryWrapper<TAppEquipment>()
|
||||
.eq(equipmentQuery.getEquipmentId() != null, TAppEquipment::getEquipmentId, equipmentQuery.getEquipmentId())
|
||||
.eq(equipmentQuery.getEquipmentType() != null, TAppEquipment::getEquipmentType, equipmentQuery.getEquipmentType())
|
||||
.eq(equipmentQuery.getEquipmentStatus() != null, TAppEquipment::getEquipmentStatus, equipmentQuery.getEquipmentStatus())
|
||||
.like(StringUtils.isNotEmpty(equipmentQuery.getEquipmentName()), TAppEquipment::getEquipmentName, equipmentQuery.getEquipmentName())
|
||||
.like(StringUtils.isNotEmpty(equipmentQuery.getEquipmentDesc()), TAppEquipment::getEquipmentDesc, equipmentQuery.getEquipmentDesc());
|
||||
Page<TAppEquipment> poPage = equipmentService.page(page, lambdaQueryWrapper);
|
||||
|
||||
PageVo<EquipmentVo> pageVo = PageVo.of(poPage, EquipmentVo::of);
|
||||
return WmsApiResponse.success("查询堆垛机成功", pageVo);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,44 @@
|
|||
package com.wms_main.service.controller.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms_main.dao.ITAppJobsService;
|
||||
import com.wms_main.model.dto.query.EquipmentQuery;
|
||||
import com.wms_main.model.dto.query.JobQuery;
|
||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||
import com.wms_main.model.po.TAppEquipment;
|
||||
import com.wms_main.model.po.TAppJobs;
|
||||
import com.wms_main.model.vo.wms.EquipmentVo;
|
||||
import com.wms_main.model.vo.wms.JobVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
import com.wms_main.repository.utils.StringUtils;
|
||||
import com.wms_main.service.controller.IJobControllerService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class JobControllerServiceImpl implements IJobControllerService {
|
||||
private final ITAppJobsService jobsService;
|
||||
|
||||
@Override
|
||||
public WmsApiResponse<PageVo<JobVo>> queryJobInfoByPage(JobQuery jobQuery) {
|
||||
if (jobQuery == null) {
|
||||
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||
}
|
||||
Page<TAppJobs> page = jobQuery.toMpPage();
|
||||
LambdaQueryWrapper<TAppJobs> lambdaQueryWrapper = new LambdaQueryWrapper<TAppJobs>()
|
||||
.like(StringUtils.isNotEmpty(jobQuery.getJobName()), TAppJobs::getJobName, jobQuery.getJobName())
|
||||
.like(StringUtils.isNotEmpty(jobQuery.getJobClass()), TAppJobs::getJobClass, jobQuery.getJobClass())
|
||||
.like(StringUtils.isNotEmpty(jobQuery.getCronExpression()), TAppJobs::getCronExpression, jobQuery.getCronExpression())
|
||||
.eq(jobQuery.getTimer() != null, TAppJobs::getTimer, jobQuery.getTimer())
|
||||
.eq(jobQuery.getTimerType() != null, TAppJobs::getTimerType, jobQuery.getTimerType())
|
||||
.eq(jobQuery.getJobStatus() != null, TAppJobs::getJobStatus, jobQuery.getJobStatus());
|
||||
Page<TAppJobs> poPage = jobsService.page(page, lambdaQueryWrapper);
|
||||
|
||||
PageVo<JobVo> pageVo = PageVo.of(poPage, JobVo::of);
|
||||
return WmsApiResponse.success("查询堆垛机成功", pageVo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user