修改报表,界面添加查询流程卡个数,调整推送数据到前端的间隔
| | |
| | | export default { |
| | | // serverUrl: "10.153.19.150:88/api", |
| | | // serverUrl: "10.153.19.44:88/api", |
| | | serverUrl: "192.168.1.199:88/api", |
| | | // serverUrl: "127.0.0.1:88/api", |
| | | // serverUrl: "192.168.1.199:88/api", |
| | | serverUrl: "127.0.0.1:88/api", |
| | | // serverUrl2: "10.153.19.150:88" |
| | | // serverUrl2: "10.153.19.44:88" |
| | | serverUrl2: "192.168.1.199:88" |
| | | // serverUrl2: "127.0.0.1:88" |
| | | // serverUrl2: "192.168.1.199:88" |
| | | serverUrl2: "127.0.0.1:88" |
| | | |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | |
| | | takeon:'The arrangement is complete', |
| | | }, |
| | | searchOrder:{ |
| | | cageTemper: 'Cage temperature', |
| | | cageArea: 'Cage area', |
| | | totalAreas: 'Total area', |
| | | totalTemper: 'Total temper', |
| | | "processcardinquiry": "process card inquiry", |
| | | searchlayout:'Non-tempered process card inquiry', |
| | | fullfurnaces:'Number of full furnaces', |
| | | specifiedproject:'The currently specified project', |
| | |
| | | now:'The current page is displayed', |
| | | tit:'data', |
| | | temperingqueries:'Tempering queries', |
| | | processcardqueriesa: 'Process card queries', |
| | | specifytempering:'Specify a furnace', |
| | | specifyengineerid:'Specify the project', |
| | | projectnumber:'Project number', |
| | |
| | | loading :'In the process of uploading:', |
| | | }, |
| | | reportmanage:{ |
| | | feed: 'feed', |
| | | out: 'out', |
| | | straightthrough: 'straightthrough', |
| | | complete: 'complete', |
| | | incomplete: 'incomplete', |
| | | outed: 'outed', |
| | | scan: 'scan', |
| | | feeding: 'feeding', |
| | | in: 'in', |
| | | car: 'car', |
| | | cage: 'cage', |
| | | oneline: 'oneline', |
| | | twoline: 'twoline', |
| | | id: 'id', |
| | | targetSlot: 'targetSlot', |
| | | endSlot: 'endSlot', |
| | | state: 'state', |
| | | width: 'width', |
| | | height: 'height', |
| | | createTime: 'createTime', |
| | | totalCounts: 'totalCounts', |
| | | totalAreas: 'totalAreas', |
| | | totalDamages: 'totalDamages', |
| | | totalTakes: 'totalTakes', |
| | | productiontime :'production time', |
| | | starttime :'Start Time', |
| | | endtime :'End Time', |
| | |
| | | takeall:'全部拿走', |
| | | }, |
| | | searchOrder:{ |
| | | cageTemper: '笼内炉数', |
| | | cageArea: '笼内面积', |
| | | totalAreas:'总面积', |
| | | totalTemper:'总炉数', |
| | | deleteTask:'删除工程', |
| | | pdeleteTask:'是否删除工程?', |
| | | processcardinquiry:"工程查询", |
| | | searchlayout:'非钢化流程卡查询', |
| | | fullfurnaces:'满炉数量', |
| | | specifiedproject:'当前指定工程', |
| | |
| | | now:'当前页显示', |
| | | tit:'条数据', |
| | | temperingqueries:'钢化查询', |
| | | processcardqueriesa:'工程查询', |
| | | specifytempering:'指定一炉', |
| | | specifyout:'指定人工出片', |
| | | specifyengineerid:'指定工程', |
| | |
| | | loading :'正在上片:', |
| | | }, |
| | | reportmanage:{ |
| | | feed: '进片', |
| | | out: '出片', |
| | | straightthrough: '直通', |
| | | complete:'已完成', |
| | | incomplete:'未完成', |
| | | outed:'已出片', |
| | | scan:'扫码', |
| | | feeding:'正在进卧转立', |
| | | in:'在卧转立', |
| | |
| | | twoline:'二线', |
| | | id:'编号', |
| | | targetSlot:'目标格子', |
| | | endSlot:'目标架子', |
| | | state:'任务状态', |
| | | width:'宽', |
| | | height:'高', |
| | |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 报表管理 ----------------*/ |
| | | /*----------- 大理片进片报表 ----------------*/ |
| | | { |
| | | path: 'reportManage', |
| | | name: 'reportManage', |
| | | component: () => import('../views/Reportmanage/reportmanage.vue'), |
| | | path: 'reportBigFeed', |
| | | name: 'reportBigFeed', |
| | | component: () => import('../views/Reportmanage/reportBigFeed.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Reportmanage/reportmanage', |
| | | name: 'reportManage', |
| | | component: () => import('../views/Reportmanage/reportmanage.vue') |
| | | path: '/Reportmanage/reportBigFeed', |
| | | name: 'reportBigFeed', |
| | | component: () => import('../views/Reportmanage/reportBigFeed.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 大理片出片报表 ----------------*/ |
| | | { |
| | | path: 'reportBigOut', |
| | | name: 'reportBigOut', |
| | | component: () => import('../views/Reportmanage/reportBigOut.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Reportmanage/reportBigOut', |
| | | name: 'reportBigOut', |
| | | component: () => import('../views/Reportmanage/reportBigOut.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 磨边卧理片报表 ----------------*/ |
| | | { |
| | | path: 'reportEdgCache', |
| | | name: 'reportEdgCache', |
| | | component: () => import('../views/Reportmanage/reportEdgCache.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Reportmanage/reportEdgCache', |
| | | name: 'reportEdgCache', |
| | | component: () => import('../views/Reportmanage/reportEdgCache.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 下片卧理片报表 ----------------*/ |
| | | { |
| | | path: 'reportDownCache', |
| | | name: 'reportDownCache', |
| | | component: () => import('../views/Reportmanage/reportDownCache.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Reportmanage/reportDownCache', |
| | | name: 'reportDownCache', |
| | | component: () => import('../views/Reportmanage/reportDownCache.vue') |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | export const WebSocketHost = "192.168.1.199"; |
| | | // export const WebSocketHost = "192.168.1.199"; |
| | | // export const WebSocketHost = "10.153.19.150"; |
| | | // export const WebSocketHost = "10.153.19.44"; |
| | | // export const WebSocketHost = "127.0.0.1"; |
| | | export const WebSocketHost = "127.0.0.1"; |
| | | export const host = "88"; |
| | |
| | | height: `${rect.height}px`, |
| | | backgroundColor: 'lightblue'}"> |
| | | <div class="centered-text"> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.sort }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.process_id }}</div> |
| | | <div style="font-size: 15px;font-weight: bold;">{{ rect.project_no }}</div> |
| | | <div style="font-size: 30px;font-weight: bold;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 钢化炉 |
| | | const handleal11 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | | temperingLayoutId: currenttemperingLayoutId.value, |
| | | engineerId: currentengineerId.value, |
| | | state: 2, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | | blinda.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 进炉前人工拿走 |
| | | const takeouta = async () => { |
| | | try { |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleall1 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | | temperingLayoutId: currenttemperingLayoutId.value, |
| | | engineerId: currentengineerId.value, |
| | | state: 3, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | | blind1.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handletakeall33 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | | temperingLayoutId: currenttemperingLayoutId.value, |
| | | engineerId: currentengineerId.value, |
| | | state: 9, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | | blind3.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleall3 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | | temperingLayoutId: currenttemperingLayoutId.value, |
| | | engineerId: currentengineerId.value, |
| | | state: 3, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleall2 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | | temperingLayoutId: currenttemperingLayoutId.value, |
| | | engineerId: currentengineerId.value, |
| | | state: 3, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | | blind2.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handletakeall44 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleall4 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | | temperingLayoutId: currenttemperingLayoutId.value, |
| | | engineerId: currentengineerId.value, |
| | | state: 3, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | | blind4.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handletakeall4 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | | temperingLayoutId: currenttemperingLayoutId.value, |
| | | engineerId: currentengineerId.value, |
| | | state: 9, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | | blind4.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 出片 |
| | | const handleall14 = async () => { |
| | | try { |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', { |
| | | temperingLayoutId: currenttemperingLayoutId.value, |
| | | engineerId: currentengineerId.value, |
| | | state: 4, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | |
| | | <el-button type="info" plain @click="handletakeall1" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('order.takeall') }} |
| | | </el-button> |
| | | <el-button type="info" plain @click="handleall1" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('processCard.outfurnace') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <el-dialog v-model="blind2" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose2"> |
| | | <el-button :disabled="!canSelectProject2" type="warning" plain :icon="Delete" @click="handleDamage2" style="width: 150px;margin-left: 10px;"> |
| | |
| | | </el-button> |
| | | <el-button type="info" plain @click="handletakeall2" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('order.takeall') }} |
| | | </el-button> |
| | | <el-button type="info" plain @click="handleall2" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('processCard.outfurnace') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <el-dialog v-model="blind3" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose3"> |
| | |
| | | <el-button type="info" plain @click="handletakeall33" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('order.takeall') }} |
| | | </el-button> |
| | | <el-button type="info" plain @click="handleall3" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('processCard.outfurnace') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <el-dialog v-model="blind4" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose4"> |
| | | <el-button :disabled="!canSelectProject4" type="warning" plain :icon="Delete" @click="handleDamage4" style="width: 150px;margin-left: 10px;"> |
| | |
| | | </el-button> |
| | | <el-button type="info" plain @click="handletakeall44" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('order.takeall') }} |
| | | </el-button> |
| | | <el-button type="info" plain @click="handleall4" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('processCard.outfurnace') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <!-- 进炉前 --> |
| | |
| | | <el-button type="info" plain @click="handletakeall3" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('order.takeall') }} |
| | | </el-button> |
| | | <el-button type="info" plain @click="handleal11" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('processCard.intofurnace') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <!-- 已出炉 --> |
| | | <el-dialog v-model="blindb" top="30vh" width="15%" style="text-align: center;" @close="handleDialogCloseb"> |
| | |
| | | <el-button type="info" plain @click="handletakeall4" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('order.takeall') }} |
| | | </el-button> |
| | | |
| | | <el-button type="info" plain @click="handleall14" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('searchOrder.outfilm') }} |
| | | </el-button> |
| | | <!-- <el-button type="success" plain :icon="Edit" @click="takeonb" :disabled="!canonb" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('order.takeon') }} |
| | | </el-button> --> |
New file |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> |
| | | <span style="margin-left: 10px;" class="demonstration">{{ $t('reportmanage.productiontime') }}</span> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" |
| | | :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> |
| | | <el-input v-model="report.targetSlot" style="margin-left: 15px;width: 150px" placeholder="请输入格子号" /> |
| | | <el-input v-model="report.width" style="margin-left: 15px;width: 150px" placeholder="请输入宽" /> |
| | | <el-input v-model="report.height" style="margin-left: 15px;width: 150px" placeholder="请输入高" /> |
| | | <!-- <el-select v-model="report.taskType" :placeholder="$t('reportmanage.ctype')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.go')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.nogo')" value="2"></el-option> |
| | | </el-select> --> |
| | | <el-select v-model="report.taskState" :placeholder="$t('reportmanage.cstate')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="-1"></el-option> |
| | | <el-option :label="$t('reportmanage.scan')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.feeding')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.in')" value="2"></el-option> |
| | | <el-option :label="$t('reportmanage.car')" value="3"></el-option> |
| | | <el-option :label="$t('reportmanage.cage')" value="4"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.line" :placeholder="$t('reportmanage.cprocess')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.oneline')" value="2001"></el-option> |
| | | <el-option :label="$t('reportmanage.twoline')" value="2002"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('reportmanage.inquire') |
| | | }}</el-button> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="3"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalCounts')" style="width: 14vw"> |
| | | {{ totalCounts }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalAreas')" style="width: 14vw"> |
| | | {{ totalAreas }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalDamages')" style="width: 14vw"> |
| | | {{ totalDamages }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalTakes')" style="width: 14vw"> |
| | | {{ totalTakes }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="700" ref="table" :data="reportData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="id" align="center" :label="$t('reportmanage.id')" |
| | | min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('reportmanage.glassID')" min-width="130" /> |
| | | <el-table-column prop="targetSlot" align="center" :label="$t('reportmanage.targetSlot')" |
| | | min-width="120" /> |
| | | <el-table-column prop="line" align="center" :label="$t('reportmanage.line')" min-width="120" /> |
| | | <el-table-column prop="taskState" align="center" :label="$t('reportmanage.state')" min-width="120" /> |
| | | <el-table-column prop="width" align="center" :label="$t('reportmanage.width')" min-width="120" /> |
| | | <el-table-column prop="height" align="center" :label="$t('reportmanage.height')" |
| | | min-width="120" /> |
| | | <el-table-column prop="createTime" align="center" :label="$t('reportmanage.createTime')" |
| | | min-width="230" /> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue"; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | const report = ref({ |
| | | targetSlot: '', |
| | | taskType: '0', |
| | | taskState: '-1', |
| | | line: '0', |
| | | width: '', |
| | | height: '' |
| | | }); |
| | | const reportData = ref([]) |
| | | const endDate = new Date(); |
| | | const startDate = new Date(); |
| | | startDate.setDate(endDate.getDate() - 100); // 获取一个星期前的时间 |
| | | // 格式化为 "YYYY-MM-DD" 格式 |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | return `${year}-${month}-${day}`; |
| | | }; |
| | | |
| | | const timeRange = ref([formatDate(startDate), formatDate(endDate)]); |
| | | const totalCounts = ref(0); |
| | | const totalAreas = ref(0); |
| | | const totalDamages = ref(0); |
| | | const totalTakes = ref(0); |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageFeedTask/selectBigStorageCageFeedTask?startTime="+timeRange.value[0]+"&&endTime="+timeRange.value[1]+"", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | | targetSlot: report.value.targetSlot, |
| | | width: report.value.width, |
| | | height: report.value.height, |
| | | taskType: report.value.taskType, |
| | | taskState: report.value.taskState, |
| | | line: report.value.line |
| | | }) |
| | | if (response.code === 200) { |
| | | reportData.value = response.data; |
| | | let totalCount = 0; |
| | | let totalArea = 0; |
| | | let totalDamage = 0; |
| | | let totalTake = 0; |
| | | response.data.forEach(item => { |
| | | if(item.taskState == 4){ |
| | | totalCount+=1; |
| | | totalArea+=item.width*item.height/1000000; |
| | | } |
| | | if(item.taskState == 8){ |
| | | totalDamage+=1; |
| | | } |
| | | if(item.taskState == 9){ |
| | | totalTake+=1; |
| | | } |
| | | }); |
| | | totalCounts.value = totalCount; |
| | | totalAreas.value = totalArea.toFixed(2); |
| | | totalDamages.value = totalDamage; |
| | | totalTakes.value = totalTake; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | }; |
| | | |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> |
| | | <span style="margin-left: 10px;" class="demonstration">{{ $t('reportmanage.productiontime') }}</span> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" |
| | | :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> |
| | | <el-input v-model="report.targetSlot" style="margin-left: 15px;width: 150px" placeholder="请输入格子号" /> |
| | | <el-input v-model="report.width" style="margin-left: 15px;width: 150px" placeholder="请输入宽" /> |
| | | <el-input v-model="report.height" style="margin-left: 15px;width: 150px" placeholder="请输入高" /> |
| | | <!-- <el-select v-model="report.taskType" :placeholder="$t('reportmanage.ctype')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.go')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.nogo')" value="2"></el-option> |
| | | </el-select> --> |
| | | <el-select v-model="report.taskState" :placeholder="$t('reportmanage.cstate')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="-1"></el-option> |
| | | <el-option :label="$t('reportmanage.cage')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.car')" value="2"></el-option> |
| | | <el-option :label="$t('reportmanage.outed')" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.line" :placeholder="$t('reportmanage.cprocess')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.oneline')" value="3001"></el-option> |
| | | <el-option :label="$t('reportmanage.twoline')" value="3002"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('reportmanage.inquire') |
| | | }}</el-button> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;" v-loading="loading"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="3"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalCounts')" style="width: 14vw"> |
| | | {{ totalCounts }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalAreas')" style="width: 14vw"> |
| | | {{ totalAreas }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalDamages')" style="width: 14vw"> |
| | | {{ totalDamages }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalTakes')" style="width: 14vw"> |
| | | {{ totalTakes }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="700" ref="table" :data="reportData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="id" align="center" :label="$t('reportmanage.id')" min-width="120" /> |
| | | <el-table-column prop="glassId" align="center" :label="$t('reportmanage.glassID')" min-width="130" /> |
| | | <el-table-column prop="startSlot" align="center" :label="$t('reportmanage.targetSlot')" min-width="120" /> |
| | | <el-table-column prop="endSlot" align="center" :label="$t('reportmanage.line')" min-width="120" /> |
| | | <el-table-column prop="taskState" align="center" :label="$t('reportmanage.state')" min-width="120"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.taskState == 1">{{ $t('reportmanage.cage') }}</span> |
| | | <span v-if="scope.row.taskState == 2">{{ $t('reportmanage.car') }}</span> |
| | | <span v-if="scope.row.taskState == 3">{{ $t('reportmanage.outed') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="width" align="center" :label="$t('reportmanage.width')" min-width="120"> |
| | | <template #default="scope"> |
| | | {{scope.row.width/10}} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="height" align="center" :label="$t('reportmanage.height')" min-width="120" > |
| | | <template #default="scope"> |
| | | {{scope.row.height/10}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" align="center" :label="$t('reportmanage.createTime')" min-width="230" /> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue"; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | const report = ref({ |
| | | targetSlot: '', |
| | | taskType: '0', |
| | | taskState: '-1', |
| | | line: '0', |
| | | width: '', |
| | | height: '' |
| | | }); |
| | | const reportData = ref([]) |
| | | const endDate = new Date(); |
| | | const startDate = new Date(); |
| | | startDate.setDate(endDate.getDate() - 100); // 获取一个星期前的时间 |
| | | // 格式化为 "YYYY-MM-DD" 格式 |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | return `${year}-${month}-${day}`; |
| | | }; |
| | | |
| | | const timeRange = ref([formatDate(startDate), formatDate(endDate)]); |
| | | const totalCounts = ref(0); |
| | | const totalAreas = ref(0); |
| | | const totalDamages = ref(0); |
| | | const totalTakes = ref(0); |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageOutTask/selectBigStorageCageOutTask?startTime=" + timeRange.value[0] + "&&endTime=" + timeRange.value[1] + "", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | | startSlot: report.value.targetSlot, |
| | | width: report.value.width, |
| | | height: report.value.height, |
| | | taskType: report.value.taskType, |
| | | taskState: report.value.taskState, |
| | | endSlot: report.value.line |
| | | }) |
| | | if (response.code === 200) { |
| | | reportData.value = response.data; |
| | | let totalCount = 0; |
| | | let totalArea = 0; |
| | | let totalDamage = 0; |
| | | let totalTake = 0; |
| | | response.data.forEach(item => { |
| | | if (item.taskState == 3) { |
| | | totalCount += 1; |
| | | totalArea += item.width * item.height / 100000000; |
| | | } |
| | | if (item.taskState == 8) { |
| | | totalDamage += 1; |
| | | } |
| | | if (item.taskState == 9) { |
| | | totalTake += 1; |
| | | } |
| | | }); |
| | | totalCounts.value = totalCount; |
| | | totalAreas.value = totalArea.toFixed(2); |
| | | totalDamages.value = totalDamage; |
| | | totalTakes.value = totalTake; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | }; |
| | | |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> |
| | | <span style="margin-left: 10px;" class="demonstration">{{ $t('reportmanage.productiontime') }}</span> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" |
| | | :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> |
| | | <el-input v-model="report.targetSlot" style="margin-left: 15px;width: 150px" placeholder="请输入格子号" /> |
| | | <!-- <el-input v-model="report.width" style="margin-left: 15px;width: 150px" placeholder="请输入宽" /> |
| | | <el-input v-model="report.height" style="margin-left: 15px;width: 150px" placeholder="请输入高" /> --> |
| | | <el-select v-model="report.taskType" :placeholder="$t('reportmanage.ctype')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="-1"></el-option> |
| | | <el-option :label="$t('reportmanage.incomplete')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.complete')" value="1"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.taskState" :placeholder="$t('reportmanage.cstate')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="-1"></el-option> |
| | | <el-option :label="$t('reportmanage.feed')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.out')" value="2"></el-option> |
| | | <el-option :label="$t('reportmanage.straightthrough')" value="3"></el-option> |
| | | </el-select> |
| | | <!-- <el-select v-model="report.line" :placeholder="$t('reportmanage.cprocess')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.oneline')" value="2001"></el-option> |
| | | <el-option :label="$t('reportmanage.twoline')" value="2002"></el-option> |
| | | </el-select> --> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('reportmanage.inquire') |
| | | }}</el-button> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;" v-loading="loading"> |
| | | <!-- <div style="margin-bottom: 20px"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="3"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalCounts')" style="width: 14vw"> |
| | | {{ totalCounts }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalAreas')" style="width: 14vw"> |
| | | {{ totalAreas }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalDamages')" style="width: 14vw"> |
| | | {{ totalDamages }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalTakes')" style="width: 14vw"> |
| | | {{ totalTakes }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> --> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="750" ref="table" :data="reportData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="glassId" align="center" :label="$t('reportmanage.glassID')" min-width="130" /> |
| | | <el-table-column prop="startCell" align="center" :label="$t('reportmanage.targetSlot')" min-width="120" /> |
| | | <el-table-column prop="endCell" align="center" :label="$t('reportmanage.endSlot')" min-width="120" /> |
| | | <el-table-column prop="taskStatus" align="center" :label="$t('reportmanage.state')" min-width="120"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.taskStatus == 0">{{ $t('reportmanage.incomplete') }}</span> |
| | | <span v-if="scope.row.taskStatus == 1">{{ $t('reportmanage.complete') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="taskType" align="center" :label="$t('reportmanage.type')" min-width="120"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.taskType == 1">{{ $t('reportmanage.cage') }}</span> |
| | | <span v-if="scope.row.taskType == 2">{{ $t('reportmanage.out') }}</span> |
| | | <span v-if="scope.row.taskType == 3">{{ $t('reportmanage.straightthrough') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" align="center" :label="$t('reportmanage.createTime')" min-width="230" /> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue"; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | const report = ref({ |
| | | targetSlot: '', |
| | | taskType: '-1', |
| | | taskState: '-1', |
| | | line: '0', |
| | | width: '', |
| | | height: '' |
| | | }); |
| | | const reportData = ref([]) |
| | | const endDate = new Date(); |
| | | const startDate = new Date(); |
| | | startDate.setDate(endDate.getDate() - 100); // 获取一个星期前的时间 |
| | | // 格式化为 "YYYY-MM-DD" 格式 |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | return `${year}-${month}-${day}`; |
| | | }; |
| | | |
| | | const timeRange = ref([formatDate(startDate), formatDate(endDate)]); |
| | | const totalCounts = ref(0); |
| | | const totalAreas = ref(0); |
| | | const totalDamages = ref(0); |
| | | const totalTakes = ref(0); |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | const response = await request.post("/unLoadGlass/downGlassTask/selectDownGlassTask?startTime=" + timeRange.value[0] + "&&endTime=" + timeRange.value[1] + "", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | | startCell: report.value.targetSlot, |
| | | width: report.value.width, |
| | | height: report.value.height, |
| | | taskType: report.value.taskType, |
| | | taskStatus: report.value.taskState, |
| | | endCell: report.value.line |
| | | }) |
| | | if (response.code === 200) { |
| | | reportData.value = response.data; |
| | | let totalCount = 0; |
| | | let totalArea = 0; |
| | | let totalDamage = 0; |
| | | let totalTake = 0; |
| | | // response.data.forEach(item => { |
| | | // if (item.taskState == 3) { |
| | | // totalCount += 1; |
| | | // totalArea += item.width * item.height / 100000000; |
| | | // } |
| | | // if (item.taskState == 8) { |
| | | // totalDamage += 1; |
| | | // } |
| | | // if (item.taskState == 9) { |
| | | // totalTake += 1; |
| | | // } |
| | | // }); |
| | | totalCounts.value = totalCount; |
| | | totalAreas.value = totalArea.toFixed(2); |
| | | totalDamages.value = totalDamage; |
| | | totalTakes.value = totalTake; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | }; |
| | | |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> |
| | | <span style="margin-left: 10px;" class="demonstration">{{ $t('reportmanage.productiontime') }}</span> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" |
| | | :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> |
| | | <el-input v-model="report.targetSlot" style="margin-left: 15px;width: 150px" placeholder="请输入格子号" /> |
| | | <!-- <el-input v-model="report.width" style="margin-left: 15px;width: 150px" placeholder="请输入宽" /> |
| | | <el-input v-model="report.height" style="margin-left: 15px;width: 150px" placeholder="请输入高" /> --> |
| | | <el-select v-model="report.taskType" :placeholder="$t('reportmanage.ctype')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="-1"></el-option> |
| | | <el-option :label="$t('reportmanage.incomplete')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.complete')" value="1"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.taskState" :placeholder="$t('reportmanage.cstate')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="-1"></el-option> |
| | | <el-option :label="$t('reportmanage.feed')" value="1"></el-option> |
| | | <el-option :label="$t('reportmanage.out')" value="2"></el-option> |
| | | <el-option :label="$t('reportmanage.straightthrough')" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.line" :placeholder="$t('reportmanage.cprocess')" style="margin-left: 10px;"> |
| | | <el-option :label="$t('reportmanage.all')" value="0"></el-option> |
| | | <el-option :label="$t('reportmanage.oneline')" value="2001"></el-option> |
| | | <el-option :label="$t('reportmanage.twoline')" value="2002"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('reportmanage.inquire') |
| | | }}</el-button> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;" v-loading="loading"> |
| | | <!-- <div style="margin-bottom: 20px"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="3"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalCounts')" style="width: 14vw"> |
| | | {{ totalCounts }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalAreas')" style="width: 14vw"> |
| | | {{ totalAreas }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalDamages')" style="width: 14vw"> |
| | | {{ totalDamages }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('reportmanage.totalTakes')" style="width: 14vw"> |
| | | {{ totalTakes }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> --> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="750" ref="table" :data="reportData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="glassId" align="center" :label="$t('reportmanage.glassID')" min-width="130" /> |
| | | <el-table-column prop="startCell" align="center" :label="$t('reportmanage.targetSlot')" min-width="120" /> |
| | | <el-table-column prop="endCell" align="center" :label="$t('reportmanage.line')" min-width="120" /> |
| | | <el-table-column prop="taskStatus" align="center" :label="$t('reportmanage.state')" min-width="120"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.taskStatus == 0">{{ $t('reportmanage.incomplete') }}</span> |
| | | <span v-if="scope.row.taskStatus == 1">{{ $t('reportmanage.complete') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="taskType" align="center" :label="$t('reportmanage.type')" min-width="120"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.taskType == 1">{{ $t('reportmanage.cage') }}</span> |
| | | <span v-if="scope.row.taskType == 2">{{ $t('reportmanage.out') }}</span> |
| | | <span v-if="scope.row.taskType == 3">{{ $t('reportmanage.straightthrough') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" align="center" :label="$t('reportmanage.createTime')" min-width="230" /> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue"; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | const report = ref({ |
| | | targetSlot: '', |
| | | taskType: '-1', |
| | | taskState: '-1', |
| | | line: '0', |
| | | width: '', |
| | | height: '' |
| | | }); |
| | | const reportData = ref([]) |
| | | const endDate = new Date(); |
| | | const startDate = new Date(); |
| | | startDate.setDate(endDate.getDate() - 100); // 获取一个星期前的时间 |
| | | // 格式化为 "YYYY-MM-DD" 格式 |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | return `${year}-${month}-${day}`; |
| | | }; |
| | | |
| | | const timeRange = ref([formatDate(startDate), formatDate(endDate)]); |
| | | const totalCounts = ref(0); |
| | | const totalAreas = ref(0); |
| | | const totalDamages = ref(0); |
| | | const totalTakes = ref(0); |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | const response = await request.post("/cacheGlass/taskCache/selectTaskCache?startTime=" + timeRange.value[0] + "&&endTime=" + timeRange.value[1] + "", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | | startCell: report.value.targetSlot, |
| | | width: report.value.width, |
| | | height: report.value.height, |
| | | taskType: report.value.taskType, |
| | | taskStatus: report.value.taskState, |
| | | endCell: report.value.line |
| | | }) |
| | | if (response.code === 200) { |
| | | reportData.value = response.data; |
| | | let totalCount = 0; |
| | | let totalArea = 0; |
| | | let totalDamage = 0; |
| | | let totalTake = 0; |
| | | // response.data.forEach(item => { |
| | | // if (item.taskState == 3) { |
| | | // totalCount += 1; |
| | | // totalArea += item.width * item.height / 100000000; |
| | | // } |
| | | // if (item.taskState == 8) { |
| | | // totalDamage += 1; |
| | | // } |
| | | // if (item.taskState == 9) { |
| | | // totalTake += 1; |
| | | // } |
| | | // }); |
| | | totalCounts.value = totalCount; |
| | | totalAreas.value = totalArea.toFixed(2); |
| | | totalDamages.value = totalDamage; |
| | | totalTakes.value = totalTake; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | }; |
| | | |
| | | </script> |
| | |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | | const dialogFormVisibles = ref(false) |
| | | const dialogFormVisibleq = ref(false) |
| | | const tableData = ref([]) |
| | | const tableDatagh = ref([]) |
| | | const tableDatab = ref([]) |
| | |
| | | const tableDatae = ref([]) |
| | | const tableDatax = ref([]) |
| | | const tableDatas = ref([]) |
| | | const tableDataq = ref([]) |
| | | const carPosition = ref([]) |
| | | const ganghua = ref('') |
| | | const adjustedRects = ref([]); |
| | |
| | | } |
| | | } |
| | | |
| | | const fetchFlowss = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectFlowCardCount'); |
| | | if (response.code === 200) { |
| | | tableDataq.value = response.data |
| | | } else { |
| | | ElMessage.warning(response.msg) |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rects :', error); |
| | | } |
| | | } |
| | | |
| | | const scheduleTime = async () => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/scheduleTime') |
| | |
| | | $t('searchOrder.dutyinformation') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" |
| | | @click="dialogFormVisibles = true; fetchFlows()">{{ $t('searchOrder.searchlayout') }}</el-button> |
| | | |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" |
| | | @click="dialogFormVisibleq = true; fetchFlowss()">{{ $t('searchOrder.processcardinquiry') }}</el-button> |
| | | |
| | | <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" |
| | | :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" /> |
| | | <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary" |
| | | <!-- <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisibleaDownGlasss = true">标签打印 |
| | | </el-button> |
| | | </el-button> --> |
| | | <div style="display: flex;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 240px;"> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleq" top="5vh" width="85%" :title="$t('searchOrder.processcardqueriesa')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" :data="tableDataq" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="engineerId" fixed align="center" :label="$t('searchOrder.projectnumber')" /> |
| | | <el-table-column prop="flowCardIdCount" align="center" :label="$t('searchOrder.cardnumber')" /> |
| | | <el-table-column prop="totalTemper" align="center" :label="$t('searchOrder.totalTemper')" /> |
| | | <el-table-column prop="glassTotalArea" align="center" :label="$t('searchOrder.totalAreas')" /> |
| | | <el-table-column prop="cageTemper" align="center" :label="$t('searchOrder.cageTemper')" /> |
| | | <el-table-column prop="cageArea" align="center" :label="$t('searchOrder.cageArea')" /> |
| | | |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleaDownGlasss" top="2vh" width="97%" title="人工下片信息"> |
| | | <div style="display:flex;justify-content: space-around;"> |
| | | <el-card |
| | |
| | | import com.mes.order.entity.Orderdetail; |
| | | import com.mes.order.entity.Orders; |
| | | import com.mes.order.service.OrdersService; |
| | | import com.mes.pp.entity.OrderChange; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | log.info("显示订单详情信息:{}", glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | @ApiOperation("订单变更") |
| | | @PostMapping("/orderChange") //显示工程选择信息 |
| | | public Result orderChange(@RequestBody List<OrderChange> orderChanges) { |
| | | return Result.build(200, "传入参数"+orderChanges, ordersService.orderChange(orderChanges)); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.mes.order.entity.Order; |
| | | import com.mes.order.entity.Orderdetail; |
| | | import com.mes.order.entity.Orders; |
| | | import com.mes.pp.entity.OrderChange; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | List<Orders> selectOrders(); |
| | | |
| | | List<Orderdetail> selectOrderdetail(Orders orders); |
| | | |
| | | List<OrderChange> orderChange(List<OrderChange> orderChanges); |
| | | } |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.order.entity.Orderdetail; |
| | | import com.mes.order.entity.Orders; |
| | | import com.mes.order.mapper.OrderdetailMapper; |
| | | import com.mes.order.mapper.OrdersMapper; |
| | | import com.mes.order.service.OrdersService; |
| | | import com.mes.pp.entity.OrderChange; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | @DS("sd") |
| | | @Slf4j |
| | | public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements OrdersService { |
| | | @Autowired |
| | | @Resource |
| | | private OrderdetailMapper orderdetailMapper; |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | @Resource |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Override |
| | | public List<Orders> selectOrders() { |
| | | //获取所有未完成的订单 |
| | |
| | | queryWrapper.eq("order_id", orders.getOrderId()); |
| | | return orderdetailMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderChange> orderChange(List<OrderChange> orderChanges) { |
| | | for (OrderChange orderChange : orderChanges) { |
| | | int affectedRows = glassInfoMapper.update(null, |
| | | new LambdaUpdateWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getFlowCardId, orderChange.getOldProcessId()) |
| | | .eq(GlassInfo::getGlassType, orderChange.getOldOrderNumber()) |
| | | .eq(GlassInfo::getLayer, orderChange.getOldTechnologyNumber()) |
| | | .set(GlassInfo::getFlowCardId, orderChange.getNewProcessId()) |
| | | .set(GlassInfo::getGlassType, orderChange.getNewOrderNumber()) |
| | | .set(GlassInfo::getLayer, orderChange.getNewTechnologyNumber()) |
| | | .last("limit " + orderChange.getChangeNumber()) |
| | | .inSql(GlassInfo::getGlassId, "select glass_id from edg_storage_cage_details where flow_card_id ='" + orderChange.getOldProcessId() + |
| | | "' and glass_id not in (select glass_id from damage where (type=8 or type=9) and process_id='" + orderChange.getOldProcessId() + "')")); |
| | | orderChange.setChangedNumber(affectedRows); |
| | | } |
| | | log.info("订单变更:" + orderChanges); |
| | | return orderChanges; |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.pp.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class OrderChange implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 旧流程卡号 |
| | | */ |
| | | private String oldProcessId; |
| | | |
| | | /** |
| | | * 旧序号 |
| | | */ |
| | | private Integer oldOrderNumber; |
| | | |
| | | /** |
| | | * 旧层号 |
| | | */ |
| | | private Integer oldTechnologyNumber; |
| | | |
| | | /** |
| | | * 信流程卡号 |
| | | */ |
| | | private String newProcessId; |
| | | |
| | | /** |
| | | * 新序号 |
| | | */ |
| | | private Integer newOrderNumber; |
| | | |
| | | /** |
| | | * 新层号 |
| | | */ |
| | | private Integer newTechnologyNumber; |
| | | |
| | | /** |
| | | * 变更数量 |
| | | */ |
| | | private Integer changeNumber; |
| | | |
| | | /** |
| | | * 已变更数量 |
| | | */ |
| | | private Integer changedNumber; |
| | | } |
| | |
| | | |
| | | boolean saveBatch(@Param(value = "list") List<TemperingGlassInfo> list); |
| | | //绕过全局逻辑进行查询 |
| | | @Select("SELECT * FROM tempering_glass_info " + "WHERE tempering_layout_id = #{temperingLayoutId} " + "AND engineer_id = #{engineerId} " + "ORDER BY tempering_layout_id DESC, tempering_feed_sequence ASC") |
| | | @Select("SELECT * FROM tempering_glass_info " + "WHERE tempering_layout_id = #{temperingLayoutId} " + "AND engineer_id = #{engineerId} " + "AND deleted=0 ORDER BY tempering_layout_id DESC, tempering_feed_sequence ASC") |
| | | List<TemperingGlassInfo> selectByEngineerIdAndLayoutId(String engineerId, Integer temperingLayoutId); |
| | | //绕过全局逻辑进行修改 |
| | | @Update("UPDATE tempering_glass_info " + |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 500) |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void CacheGlassTasks() { |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | |
| | | //卧室缓存笼内信息 |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 500) |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void cacheGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 500) |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void CacheGlassTaskss() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | |
| | | |
| | | import com.mes.edgglasstask.entity.request.IdentWornRequest; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return Result.build(200, "成功", EdgTasks); |
| | | } |
| | | |
| | | @ApiOperation("卧理任务报表") |
| | | @PostMapping("/selectTaskCache") |
| | | public Result selectTaskCache(@RequestBody TaskCache taskCache, |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime) { |
| | | return Result.build(200, "查询成功", taskCacheService.selectTaskCache(taskCache, startTime, endTime)); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | |
| | | /** |
| | | * 起始 |
| | | */ |
| | | private int startCell; |
| | | private Integer startCell; |
| | | /** |
| | | * 结束 |
| | | */ |
| | | private int endCell; |
| | | private Integer endCell; |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | private int taskType; |
| | | private Integer taskType; |
| | | /** |
| | | * 任务状态 |
| | | */ |
| | | private int taskStatus; |
| | | private Integer taskStatus; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | |
| | | */ |
| | | TaskCache selectLastOutCacheInfo(int line); |
| | | |
| | | |
| | | /** |
| | | * 查询 任务条件 |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectTaskCache(TaskCache taskCache, String startTime, String endTime); |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class TaskCacheServiceImpl extends MPJBaseServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | GlassInfoMapper glassInfoMapper; |
| | | @Autowired |
| | | @Resource |
| | | private TaskCacheMapper taskCacheMapper; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<TaskCache> selectTaskCache(TaskCache taskCache, String startTime, String endTime){ |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | LambdaQueryWrapper<TaskCache> wrapper = new LambdaQueryWrapper<>(); |
| | | if (taskCache.getStartCell() != null) { |
| | | wrapper.eq(TaskCache::getStartCell, taskCache.getStartCell()); |
| | | } |
| | | if (taskCache.getEndCell() != 0) { |
| | | wrapper.eq(TaskCache::getEndCell, taskCache.getEndCell()); |
| | | } |
| | | if (taskCache.getTaskStatus() != -1) { |
| | | wrapper.eq(TaskCache::getTaskStatus, taskCache.getTaskStatus()); |
| | | } |
| | | if (taskCache.getTaskType() != -1) { |
| | | wrapper.eq(TaskCache::getTaskType, taskCache.getTaskType()); |
| | | } |
| | | if (startTime != null && !startTime.isEmpty()) { |
| | | wrapper.ge(TaskCache::getCreateTime, startTime); |
| | | } |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | wrapper.le(TaskCache::getCreateTime, endTime); |
| | | } |
| | | wrapper.orderByDesc(TaskCache::getCreateTime); |
| | | wrapper.and(item -> item.eq(TaskCache::getDeleted, 0) |
| | | .or() |
| | | .eq(TaskCache::getDeleted, 1)); |
| | | wrapper.between(TaskCache::getCreateTime, startTime, endTime); |
| | | return baseMapper.selectList(wrapper); |
| | | } |
| | | |
| | | } |
| | |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: task-cache |
| | | druid: |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 10 |
| | | time-between-eviction-runs-millis: 60000 |
| | | connection-properties: druid,stat,mergeSql=true,druid,stat ,slowSalMillis=5000 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
| | |
| | | return Result.build(200, "查询成功", flowCardIdCount); |
| | | } |
| | | |
| | | @ApiOperation("流程卡个数查询") |
| | | @PostMapping("/selectFlowCardCount") |
| | | public Result selectFlowCardCount() { |
| | | return Result.build(200, "查询成功", bigStorageCageDetailsService.selectFlowCardCount()); |
| | | } |
| | | |
| | | @ApiOperation("指定流程卡") |
| | | @PostMapping("/appointFlowCard") |
| | | public Result appointFlowCard(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
New file |
| | |
| | | package com.mes.bigstorage.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/6/13 15:51 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class FlowCardDTO { |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 流程卡个数 |
| | | */ |
| | | private Integer flowCardIdCount; |
| | | |
| | | /** |
| | | * 总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | |
| | | /** |
| | | * 总炉数 |
| | | */ |
| | | private Integer totalTemper; |
| | | |
| | | /** |
| | | * 笼内炉数 |
| | | */ |
| | | private Integer cageTemper; |
| | | |
| | | /** |
| | | * 笼内面积 |
| | | */ |
| | | private Double cageArea; |
| | | } |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.dto.FlowCardDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO; |
| | |
| | | void updateBySlot(@Param(value = "list") List<UpdateBigStorageCageDTO> glassList, @Param(value = "state") int state); |
| | | |
| | | List<Map<String, Object>> selectTemperingGlassCount(); |
| | | |
| | | List<FlowCardDTO> selectFlowCardCount(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.FlowCardDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO; |
| | |
| | | long scheduleTime(); |
| | | |
| | | void cancelOutTask(); |
| | | |
| | | List<FlowCardDTO> selectFlowCardCount(); |
| | | } |
| | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.FlowCardDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | |
| | | .in(BigStorageCageOutTask::getEndSlot, Const.OUT_TARGET_POSITION_ALL) |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW) |
| | | ); |
| | | if(bigStorageCageOutTasks.size()>0){ |
| | | List<String> outGlassId = bigStorageCageOutTasks.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | temperingGlassInfoService.remove( |
| | | new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | |
| | | .in(BigStorageCageDetails::getGlassId, outGlassId) |
| | | ); |
| | | bigStorageCageOutTaskService.deleteTask(bigStorageCageOutTasks); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowCardDTO> selectFlowCardCount(){ |
| | | return baseMapper.selectFlowCardCount(); |
| | | } |
| | | } |
| | |
| | | public Result selectBigStorageCageFeedTask(@RequestBody BigStorageCageFeedTask bigStorageCageFeedTask, |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime) { |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> wrapper = new LambdaQueryWrapper<>(); |
| | | if (bigStorageCageFeedTask.getTargetSlot() != null) { |
| | | wrapper.eq(BigStorageCageFeedTask::getTargetSlot, bigStorageCageFeedTask.getTargetSlot()); |
| | | } |
| | | if (bigStorageCageFeedTask.getWidth() != null) { |
| | | wrapper.eq(BigStorageCageFeedTask::getWidth, bigStorageCageFeedTask.getWidth()); |
| | | } |
| | | if (bigStorageCageFeedTask.getHeight() != null) { |
| | | wrapper.eq(BigStorageCageFeedTask::getHeight, bigStorageCageFeedTask.getHeight()); |
| | | } |
| | | if (bigStorageCageFeedTask.getLine() != 0) { |
| | | wrapper.eq(BigStorageCageFeedTask::getLine, bigStorageCageFeedTask.getLine()); |
| | | } |
| | | if (bigStorageCageFeedTask.getTaskState() != -1) { |
| | | wrapper.eq(BigStorageCageFeedTask::getTaskState, bigStorageCageFeedTask.getTaskState()); |
| | | } |
| | | if (bigStorageCageFeedTask.getTaskType() != 0) { |
| | | wrapper.eq(BigStorageCageFeedTask::getTaskType, bigStorageCageFeedTask.getTaskType()); |
| | | } |
| | | if (startTime != null && !startTime.isEmpty()) { |
| | | wrapper.ge(BigStorageCageFeedTask::getCreateTime, startTime); |
| | | } |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | wrapper.le(BigStorageCageFeedTask::getCreateTime, endTime); |
| | | } |
| | | wrapper.orderByDesc(BigStorageCageFeedTask::getId); |
| | | wrapper.and(item -> item.eq(BigStorageCageFeedTask::getDeleted, 0) |
| | | .or() |
| | | .eq(BigStorageCageFeedTask::getDeleted, 1)); |
| | | wrapper.between(BigStorageCageFeedTask::getCreateTime, startTime, endTime); |
| | | return Result.build(200, "查询成功", bigStorageCageFeedTaskService.list(wrapper)); |
| | | return Result.build(200, "查询成功", bigStorageCageFeedTaskService.selectBigStorageCageFeedTask(bigStorageCageFeedTask, startTime, endTime)); |
| | | } |
| | | |
| | | |
| | |
| | | package com.mes.bigstoragetask.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.tomcat.util.bcel.Const; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | @Autowired |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | @ApiOperation("出片任务修改") |
| | | @PostMapping("/updatebigStorageCageOutTask") |
| | | public Result deleteBigStorageCageDetails(@RequestBody BigStorageCageOutTask bigStorageCageOutTask) { |
| | | if (bigStorageCageOutTask.getTaskState() > 3) { |
| | | temperingGlassInfoService.remove( |
| | | new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | | .in(TemperingGlassInfo::getGlassId, bigStorageCageOutTask.getGlassId()) |
| | | ); |
| | | } else { |
| | | temperingGlassInfoService.update( |
| | | new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | | .in(TemperingGlassInfo::getGlassId, bigStorageCageOutTask.getGlassId()) |
| | | .set(TemperingGlassInfo::getState, 0) |
| | | ); |
| | | } |
| | | bigStorageCageOutTaskService.updateById(bigStorageCageOutTask); |
| | | return Result.build(200, "修改成功", 1); |
| | | } |
| | | |
| | | @ApiOperation("出片任务报表") |
| | | @PostMapping("/selectBigStorageCageOutTask") |
| | | public Result selectBigStorageCageOutTask(@RequestBody BigStorageCageOutTask bigStorageCageOutTask, |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime) { |
| | | return Result.build(200, "查询成功", bigStorageCageOutTaskService.selectBigStorageCageOutTask(bigStorageCageOutTask, startTime, endTime)); |
| | | } |
| | | } |
| | | |
| | |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 5) |
| | | private double width; |
| | | private Double width; |
| | | /** |
| | | * 目标位置 |
| | | */ |
| | | @ApiModelProperty(value = "目标位置", position = 5) |
| | | private double height; |
| | | private Double height; |
| | | |
| | | /** |
| | | * 车次 |
| | |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * 查询卧转立玻璃是否进片完成 |
| | | */ |
| | | List<Integer> querySitToUpGlass(); |
| | | |
| | | List<BigStorageCageFeedTask> selectBigStorageCageFeedTask(BigStorageCageFeedTask bigStorageCageFeedTask, String startTime, String endTime); |
| | | } |
| | |
| | | void deleteOutTask(String glassId); |
| | | |
| | | void deleteTask(List<BigStorageCageOutTask> outGlassId); |
| | | |
| | | List<BigStorageCageOutTask> selectBigStorageCageOutTask(BigStorageCageOutTask bigStorageCageOutTask, String startTime, String endTime); |
| | | } |
| | |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | public List<Integer> querySitToUpGlass() { |
| | | return baseMapper.querySitToUpGlass(); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCageFeedTask> selectBigStorageCageFeedTask(BigStorageCageFeedTask bigStorageCageFeedTask, String startTime, String endTime) { |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> wrapper = new LambdaQueryWrapper<>(); |
| | | if (bigStorageCageFeedTask.getTargetSlot() != null) { |
| | | wrapper.eq(BigStorageCageFeedTask::getTargetSlot, bigStorageCageFeedTask.getTargetSlot()); |
| | | } |
| | | if (bigStorageCageFeedTask.getWidth() != null) { |
| | | wrapper.eq(BigStorageCageFeedTask::getWidth, bigStorageCageFeedTask.getWidth()); |
| | | } |
| | | if (bigStorageCageFeedTask.getHeight() != null) { |
| | | wrapper.eq(BigStorageCageFeedTask::getHeight, bigStorageCageFeedTask.getHeight()); |
| | | } |
| | | if (bigStorageCageFeedTask.getLine() != 0) { |
| | | wrapper.eq(BigStorageCageFeedTask::getLine, bigStorageCageFeedTask.getLine()); |
| | | } |
| | | if (bigStorageCageFeedTask.getTaskState() != -1) { |
| | | wrapper.eq(BigStorageCageFeedTask::getTaskState, bigStorageCageFeedTask.getTaskState()); |
| | | } |
| | | if (bigStorageCageFeedTask.getTaskType() != 0) { |
| | | wrapper.eq(BigStorageCageFeedTask::getTaskType, bigStorageCageFeedTask.getTaskType()); |
| | | } |
| | | if (startTime != null && !startTime.isEmpty()) { |
| | | wrapper.ge(BigStorageCageFeedTask::getCreateTime, startTime); |
| | | } |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | wrapper.le(BigStorageCageFeedTask::getCreateTime, endTime); |
| | | } |
| | | wrapper.orderByDesc(BigStorageCageFeedTask::getId); |
| | | wrapper.and(item -> item.eq(BigStorageCageFeedTask::getDeleted, 0) |
| | | .or() |
| | | .eq(BigStorageCageFeedTask::getDeleted, 1)); |
| | | wrapper.between(BigStorageCageFeedTask::getCreateTime, startTime, endTime); |
| | | return baseMapper.selectList(wrapper); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | |
| | | public void deleteTask(List<BigStorageCageOutTask> outGlassId){ |
| | | baseMapper.deleteTask(outGlassId); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCageOutTask> selectBigStorageCageOutTask(BigStorageCageOutTask bigStorageCageOutTask, String startTime, String endTime){ |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageOutTask> wrapper = new LambdaQueryWrapper<>(); |
| | | if (bigStorageCageOutTask.getStartSlot() != null) { |
| | | wrapper.eq(BigStorageCageOutTask::getStartSlot, bigStorageCageOutTask.getStartSlot()); |
| | | } |
| | | if (bigStorageCageOutTask.getWidth() != null) { |
| | | wrapper.eq(BigStorageCageOutTask::getWidth, bigStorageCageOutTask.getWidth()); |
| | | } |
| | | if (bigStorageCageOutTask.getHeight() != null) { |
| | | wrapper.eq(BigStorageCageOutTask::getHeight, bigStorageCageOutTask.getHeight()); |
| | | } |
| | | if (bigStorageCageOutTask.getEndSlot() != 0) { |
| | | wrapper.eq(BigStorageCageOutTask::getEndSlot, bigStorageCageOutTask.getEndSlot()); |
| | | } |
| | | if (bigStorageCageOutTask.getTaskState() != -1) { |
| | | wrapper.eq(BigStorageCageOutTask::getTaskState, bigStorageCageOutTask.getTaskState()); |
| | | } |
| | | if (startTime != null && !startTime.isEmpty()) { |
| | | wrapper.ge(BigStorageCageOutTask::getCreateTime, startTime); |
| | | } |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | wrapper.le(BigStorageCageOutTask::getCreateTime, endTime); |
| | | } |
| | | wrapper.orderByDesc(BigStorageCageOutTask::getId); |
| | | wrapper.and(item -> item.eq(BigStorageCageOutTask::getDeleted, 0) |
| | | .or() |
| | | .eq(BigStorageCageOutTask::getDeleted, 1)); |
| | | wrapper.between(BigStorageCageOutTask::getCreateTime, startTime, endTime); |
| | | return baseMapper.selectList(wrapper); |
| | | } |
| | | } |
| | |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | jsonObject = new JSONObject(); |
| | | try { |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage"); |
| | | if (sendwServer != null) { |
| | | //查询使用数据源1查询数据 |
| | | queryDataSource1(); |
| | | //查询使用数据源2查询数据 |
| | | queryDataSource2(); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void temperingIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //进片任务数据 |
| | |
| | | bigStorageCageFeedTask.setWidth(width); |
| | | bigStorageCageFeedTask.setHeight(height); |
| | | bigStorageCageFeedTask.setCreateTime(new Date()); |
| | | bigStorageCageFeedTask.setTargetSlot(0); |
| | | //删除理片笼表拿走/破损数据数据 |
| | | damageService.deleteByGlassId(glassId); |
| | | Damage damage = new Damage(); |
| | |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: task-cacheVertical |
| | | druid: |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 10 |
| | | time-between-eviction-runs-millis: 60000 |
| | | connection-properties: druid,stat,mergeSql=true,druid,stat ,slowSalMillis=5000 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
| | |
| | | TEMPERING_LAYOUT_ID, |
| | | COUNT(DISTINCT SLOT) as SLOT_COUNT |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
| | | WHERE STATE = 100 AND TEMPERING_LAYOUT_ID!=0 AND THICKNESS < 8 |
| | | WHERE STATE = 100 |
| | | AND TEMPERING_LAYOUT_ID!=0 AND THICKNESS < 8 |
| | | GROUP BY ENGINEER_ID, |
| | | TEMPERING_LAYOUT_ID |
| | | HAVING SLOT_COUNT >= #{count} |
| | |
| | | </update> |
| | | |
| | | <select id="selectTemperingGlassCount" resultType="java.util.Map"> |
| | | select a.engineer_id,a.tempering_layout_id,count2,count1,count2-count1 as count3,count(c.glass_id) as count4,slots from |
| | | (select engineer_id,tempering_layout_id,count(*) as count1,group_concat(distinct slot order by tempering_feed_sequence) as slots from big_storage_cage_details where state=100 and tempering_layout_id!=0 group by engineer_id,tempering_layout_id) as a |
| | | select a.engineer_id, |
| | | a.tempering_layout_id, |
| | | count2, |
| | | count1, |
| | | count2 - count1 as count3, |
| | | count(c.glass_id) as count4, |
| | | slots |
| | | from (select engineer_id, |
| | | tempering_layout_id, |
| | | count(*) as count1, |
| | | group_concat(distinct slot order by tempering_feed_sequence) as slots |
| | | from big_storage_cage_details |
| | | where state = 100 |
| | | and tempering_layout_id!=0 |
| | | group by engineer_id, tempering_layout_id) as a |
| | | left join |
| | | (select engineer_id,tempering_layout_id,count(*) as count2 from glass_info group by engineer_id,tempering_layout_id) as b |
| | | (select engineer_id, tempering_layout_id, count(*) as count2 |
| | | from glass_info |
| | | group by engineer_id, tempering_layout_id) as b |
| | | on a.engineer_id=b.engineer_id and a.tempering_layout_id=b.tempering_layout_id |
| | | left join damage as c on a.engineer_id=c.engineer_id and a.tempering_layout_id=c.tempering_layout_id and (type = 8 or type = 9) |
| | | left join damage as c |
| | | on a.engineer_id = c.engineer_id and a.tempering_layout_id = c.tempering_layout_id and |
| | | (type = 8 or type = 9) |
| | | group by a.engineer_id,a.tempering_layout_id |
| | | order by a.engineer_id,a.tempering_layout_id |
| | | </select> |
| | | |
| | | <select id="selectFlowCardCount" resultType="com.mes.bigstorage.entity.dto.FlowCardDTO"> |
| | | SELECT fc.engineer_id AS engineerId, |
| | | count(DISTINCT fc.flow_card_id, fc.layer) AS flowCardIdCount, |
| | | count(DISTINCT gi.tempering_layout_id) AS totalTemper, |
| | | e.glass_total_area, |
| | | count(distinct bscd.tempering_layout_id) as cageTemper, |
| | | round(sum(bscd.width*bscd.height/1000000),2) as cageArea |
| | | FROM ( |
| | | SELECT engineer_id, |
| | | flow_card_id, |
| | | IF |
| | | (combine = 0, layer, 1) AS layer, |
| | | combine |
| | | FROM glass_info |
| | | WHERE engineer_id IN (SELECT DISTINCT engineer_id FROM big_storage_cage_details WHERE state = 100) |
| | | GROUP BY engineer_id, |
| | | flow_card_id, |
| | | IF |
| | | (combine = 0, layer, 1), |
| | | combine |
| | | ) AS fc |
| | | INNER JOIN glass_info gi ON fc.engineer_id = gi.engineer_id |
| | | AND gi.tempering_layout_id != 0 |
| | | INNER JOIN engineering e |
| | | ON fc.engineer_id = e.engineer_id |
| | | left join big_storage_cage_details bscd on gi.glass_id=bscd.glass_id and bscd.state=100 and fc.flow_card_id=bscd.flow_card_id and fc.layer=bscd.layer |
| | | GROUP BY |
| | | fc.engineer_id |
| | | </select> |
| | | </mapper> |
| | |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | |
| | | @ApiOperation("开始/暂停任务/传递工程号和状态,开始是1 暂停是0") |
| | | @PostMapping("/pauseTask") //暂停上片任务 |
| | | @ResponseBody |
| | |
| | | @ResponseBody |
| | | public Result <List<UpPattenUsage>> pause(@RequestBody Engineering engineering) { |
| | | boolean work=engineeringService.pauseTask(engineering.getEngineerId(),engineering.getState()); |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist();String message; |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist(); |
| | | String message; |
| | | if(work){ |
| | | return Result.build(200,"成功",glass); |
| | | }else { |
| | |
| | | @ResponseBody |
| | | public Result <Boolean> deleteTask(@RequestBody Engineering engineering) { |
| | | //删除工程表、小片表、上片表,更改优化表状态 |
| | | boolean work=engineeringService.deleteTask(engineering.getEngineerId()); |
| | | boolean work = false; |
| | | Engineering engineeringState = engineeringService.selectEngineeringState(engineering.getEngineerId()); |
| | | if (engineeringState == null) { |
| | | work = engineeringService.deleteTask(engineering.getEngineerId()); |
| | | glassInfoService.deleteTask(engineering.getEngineerId()); |
| | | upPattenUsageService.deleteTask(engineering.getEngineerId()); |
| | | optimizeProjectService.changeTask(engineering.getEngineerId(), 100); |
| | | } |
| | | |
| | | if (work) { |
| | | return Result.build(200, "删除成功"+engineering.getEngineerId(), true); |
| | | }else { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.workstation.entity.UpWorkSequence; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface EngineeringMapper extends BaseMapper<Engineering> { |
| | | |
| | | //获取工位信息 |
| | | Engineering selectEngineeringState(@Param("engineerId") String engineerId); |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.engineering.mapper.EngineeringMapper"> |
| | | |
| | | |
| | | <select id="selectEngineeringState" resultMap="com.mes.engineering.entity.Engineering"> |
| | | select DISTINCT engineer_id from edg_storage_cage_details |
| | | <where> |
| | | engineer_id=#{engineerId} |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | boolean pauseTask(String engineerId, Integer state); |
| | | |
| | | boolean deleteTask(String engineerId); |
| | | |
| | | Engineering selectEngineeringState(String engineerId); |
| | | } |
| | | |
| | |
| | | return this.remove(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Engineering selectEngineeringState(String engineerId){ |
| | | //查询工程状态 |
| | | return baseMapper.selectEngineeringState(engineerId); |
| | | } |
| | | |
| | | } |
| | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadGlassHome() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | if (sendwServer != null) { |
| | | //正在进行的任务 |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.prioritylist(); |
| | | if(upPattenUsages!=null){ |
| | |
| | | //是否开始工程 |
| | | Engineering engineering = engineeringService.selectInitiate(1); |
| | | jsonObject.append("engineering", engineering); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | |
| | | name: loadGlass |
| | | liquibase: |
| | | enabled: false |
| | | druid: |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 10 |
| | | time-between-eviction-runs-millis: 60000 |
| | | connection-properties: druid,stat,mergeSql=true,druid,stat ,slowSalMillis=5000 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.engineering.mapper.EngineeringMapper"> |
| | | <resultMap id="sequenceMap" type="com.mes.engineering.entity.Engineering"> |
| | | <id property="engineerId" column="engineer_id"/> |
| | | <!-- <result property="number" column="number"/>--> |
| | | </resultMap> |
| | | |
| | | <select id="selectEngineeringState" resultMap="sequenceMap"> |
| | | select DISTINCT engineer_id from edg_storage_cage_details |
| | | <where> |
| | | engineer_id=#{engineerId} |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.order.entity.Orders; |
| | | import com.mes.order.service.OrdersService; |
| | |
| | | private OptimizeProjectService optimizeProjectService; |
| | | @Autowired |
| | | private OrdersService ordersService; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | |
| | | @Scheduled(fixedDelay = 10000) |
| | | public void screenHome() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | |
| | | /*现场规划图显示*/ |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("screen"); |
| | | if (sendwServer != null) { |
| | | Reportingdamage reportingdamage = new Reportingdamage(); |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | |
| | | //获取当前订单 |
| | | List<Orders> orders = ordersService.selectOrders(); |
| | | jsonObject.append("orders", orders); |
| | | |
| | | /*现场规划图显示*/ |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("screen"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingGlassHome() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |
| | | if (sendwServer != null) { |
| | | //正在等待进片的玻璃 |
| | | List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlass(); |
| | | if (waitingGlass != null) { |
| | |
| | | if (outGlass != null) { |
| | | jsonObject.append("overGlass", overGlass); |
| | | } |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | |
| | | port: 8084 |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: cz |
| | | application: |
| | | name: temperingGlass |
| | | liquibase: |
| | |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: task-tempering |
| | | druid: |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 10 |
| | | time-between-eviction-runs-millis: 60000 |
| | | connection-properties: druid,stat,mergeSql=true,druid,stat ,slowSalMillis=5000 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
| | |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | ); |
| | | return Result.build(200, "清空成功", true); |
| | | } |
| | | |
| | | @ApiOperation("卧理任务报表") |
| | | @PostMapping("/selectDownGlassTask") |
| | | public Result selectDownGlassTask(@RequestBody DownGlassTask downGlassTask, |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime) { |
| | | return Result.build(200, "查询成功", downGlassTaskService.selectDownGlassTask(downGlassTask, startTime, endTime)); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<DownGlassTask> selectOutTaskCache(); |
| | | |
| | | /** |
| | | * 查询下片卧理任务 |
| | | * |
| | | * @return |
| | | */ |
| | | List<DownGlassTask> selectDownGlassTask(DownGlassTask downGlassTask, String startTime, String endTime); |
| | | |
| | | } |
| | |
| | | return baseMapper.selectList(new QueryWrapper<DownGlassTask>().eq("task_status", 0).eq("task_type", 2)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DownGlassTask> selectDownGlassTask(DownGlassTask downGlassTask, String startTime, String endTime){ |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | | LambdaQueryWrapper<DownGlassTask> wrapper = new LambdaQueryWrapper<>(); |
| | | if (downGlassTask.getStartCell() != null) { |
| | | wrapper.eq(DownGlassTask::getStartCell, downGlassTask.getStartCell()); |
| | | } |
| | | if (downGlassTask.getEndCell() != 0) { |
| | | wrapper.eq(DownGlassTask::getEndCell, downGlassTask.getEndCell()); |
| | | } |
| | | if (downGlassTask.getTaskStatus() != -1) { |
| | | wrapper.eq(DownGlassTask::getTaskStatus, downGlassTask.getTaskStatus()); |
| | | } |
| | | if (downGlassTask.getTaskType() != -1) { |
| | | wrapper.eq(DownGlassTask::getTaskType, downGlassTask.getTaskType()); |
| | | } |
| | | if (startTime != null && !startTime.isEmpty()) { |
| | | wrapper.ge(DownGlassTask::getCreateTime, startTime); |
| | | } |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | wrapper.le(DownGlassTask::getCreateTime, endTime); |
| | | } |
| | | wrapper.orderByDesc(DownGlassTask::getCreateTime); |
| | | wrapper.and(item -> item.eq(DownGlassTask::getDeleted, 0) |
| | | .or() |
| | | .eq(DownGlassTask::getDeleted, 1)); |
| | | wrapper.between(DownGlassTask::getCreateTime, startTime, endTime); |
| | | return baseMapper.selectList(wrapper); |
| | | } |
| | | } |
| | |
| | | package com.mes.downworkstation.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.entity.DownWorkstionAndDownGlassinfo; |
| | |
| | | import com.mes.downworkstation.mapper.DownWorkstationTaskMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.utils.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private DownWorkstationTaskMapper downWorkstationTaskMapper; |
| | | @Autowired |
| | | private DownGlassInfoMapper downGlassInfoMapper; |
| | | @Autowired |
| | | private DownGlassInfoService downGlassInfoService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public void updateFlowCardIdAndCount(String flowCardId, int workstationId, int layer) { |
| | | int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId, layer); |
| | | GlassInfo glassInfo = glassInfoService.getOne( |
| | | new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getFlowCardId, flowCardId) |
| | | .last("limit 1") |
| | | ); |
| | | QueryWrapper<Damage> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("process_id", flowCardId); |
| | | queryWrapper.eq("technology_number", layer); |
| | | int otherNumber = damageservice.count(queryWrapper); |
| | | |
| | | LambdaQueryWrapper<DownGlassInfo> wrapper = new LambdaQueryWrapper(); |
| | | wrapper.eq(DownGlassInfo::getFlowCardId, flowCardId); |
| | | wrapper.lt(DownGlassInfo::getWorkStationId, 7); |
| | | |
| | | UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | int glassInfoCount = 0; |
| | | if (glassInfo.getCombine() == 0) { |
| | | glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId, layer); |
| | | queryWrapper.eq("technology_number", layer); |
| | | wrapper.eq(DownGlassInfo::getLayer, layer); |
| | | updateWrapper.set("layer", layer); |
| | | } else { |
| | | glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId, 0); |
| | | updateWrapper.set("layer", 0); |
| | | } |
| | | int otherNumber = damageservice.count(queryWrapper); |
| | | int racksNumber = downGlassInfoService.count(wrapper); |
| | | |
| | | updateWrapper.set("total_quantity", glassInfoCount) |
| | | .set("flow_card_id", flowCardId) |
| | | .set("layer", layer) |
| | | |
| | | .set("other_number", otherNumber) |
| | | .set("racks_number", racksNumber) |
| | | .eq("workstation_id", workstationId); |
| | | // .eq("id", workstationId); |
| | | this.update(updateWrapper); |
| | |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); |
| | | |
| | | // requestWord="3"; |
| | | // glassIdeValue="P25031802|4|1"; |
| | | // out06Glassstate="1"; |
| | | // out08Glassstate="1"; |
| | | // out11Glassstate ="1"; |
| | | // out13Glassstate="1"; |
| | | // currentSlot="1"; |
| | | // confirmationWrodValue="0"; |
| | | |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", |
| | | requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot); |
| | |
| | | //玻璃尺寸是否走人工下片 |
| | | if (glassWidth > maxWidth || glassHeight > maxHeight || glassWidth < minWidth || glassHeight < minHeight) { |
| | | log.info("该玻璃尺寸不符合要求,需要走人工下片直接进片"); |
| | | return; |
| | | } else { |
| | | log.info("该玻璃尺寸非人工下片"); |
| | | //获取该玻璃的流程卡是否已绑定架子 |
| | |
| | | wrapper.eq(DownGlassInfo::getLayer, downGlassInfo.getLayer()); |
| | | } |
| | | // downGlassInfo.setSequence(downGlassInfoService.queryMaxSequence(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer())); |
| | | int k = 0; |
| | | DownGlassInfo downGlassInfo1 = downGlassInfoService.getOne(wrapper); |
| | | if (downGlassInfo1 != null) { |
| | | k = 1; |
| | | } else { |
| | | k = 1; |
| | | } |
| | | downGlassInfo.setSequence(k); |
| | | downGlassInfo.setWorkStationId(endCell); |
| | | downGlassInfo.setGmtCreate(new Date()); |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | int k = 1; |
| | | // DownGlassInfo downGlassInfo1 = downGlassInfoService.getOne(wrapper); |
| | | // if (downGlassInfo1 != null) { |
| | | // k = 1; |
| | | // } else { |
| | | // k = 1; |
| | | // } |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, glassInfo); |
| | | //删除理片笼表拿走/破损数据数据 |
| | | GlassInfo glassInfo1 = glassInfoService.getOne( |
| | | new LambdaUpdateWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassInfo.getGlassId()) |
| | | ); |
| | | downGlassInfo.setSequence(k); |
| | | downGlassInfo.setWorkStationId(endCell); |
| | | downGlassInfo.setGmtCreate(new Date()); |
| | | downGlassInfo.setLayer(glassInfo1.getLayer()); |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | |
| | | |
| | | //删除理片笼表拿走/破损数据数据 |
| | | glassInfo.setLayer(glassInfo1.getLayer()); |
| | | damageService.deleteByGlassId(glassInfo.getGlassId()); |
| | | return initDownGlassTask(glassInfo, downStorageCageDetails.getSlot(), endCell, taskType); |
| | |
| | | @Autowired
|
| | | private RedisUtil redisUtil;
|
| | |
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | @Scheduled(fixedDelay = 3000)
|
| | | public void sendDownWorkstations() {
|
| | | log.info("发送工位玻璃信息");
|
| | | JSONObject jsonObject = new JSONObject();
|
| | |
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer != null) {
|
| | | log.info("发送工位玻璃信息");
|
| | | List<DownWorkstation> data = downWorkstationService.list();
|
| | | List<DownGlassTask> downGlassTasks = downGlassTaskService.list(
|
| | | new LambdaQueryWrapper<DownGlassTask>()
|
| | |
| | | data.add(downWorkstation);
|
| | | jsonObject.append("params", data);
|
| | | log.info(jsonObject.toString());
|
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer != null) {
|
| | | for (WebSocketServer webserver : sendwServer) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | log.info("已发送");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 1000)
|
| | | @Scheduled(fixedDelay = 3000)
|
| | | public void sendGlassInfoData() {
|
| | |
|
| | | ArrayList<WebSocketServer> sendwServer2 = WebSocketServer.sessionMap.get("unloadglass2");
|
| | | if (sendwServer2 != null) {
|
| | | log.info("发送工位显示图信息1");
|
| | | JSONObject jsonObject2 = new JSONObject();
|
| | | List<Map<String, Object>> glassinfodata = downWorkstationService.getTotalGlassDimensionsByWorkstation(1, 3);
|
| | | jsonObject2.append("glassinfo", glassinfodata);
|
| | | log.info(jsonObject2.toString());
|
| | | ArrayList<WebSocketServer> sendwServer2 = WebSocketServer.sessionMap.get("unloadglass2");
|
| | | if (sendwServer2 != null) {
|
| | | for (WebSocketServer webserver : sendwServer2) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject2.toString());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 1000)
|
| | | @Scheduled(fixedDelay = 3000)
|
| | | public void sendGlassInfoData2() {
|
| | | ArrayList<WebSocketServer> sendwServer3 = WebSocketServer.sessionMap.get("unloadglass3");
|
| | | if (sendwServer3 != null) {
|
| | | log.info("发送工位显示图信息2");
|
| | | JSONObject jsonObject3 = new JSONObject();
|
| | | List<Map<String, Object>> glassinfodata2 = downWorkstationService.getTotalGlassDimensionsByWorkstation(4, 6);
|
| | | jsonObject3.append("glassinfo2", glassinfodata2);
|
| | | log.info(jsonObject3.toString());
|
| | | ArrayList<WebSocketServer> sendwServer3 = WebSocketServer.sessionMap.get("unloadglass3");
|
| | | if (sendwServer3 != null) {
|
| | | for (WebSocketServer webserver : sendwServer3) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject3.toString());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | @Scheduled(fixedDelay = 3000)
|
| | | public void sendDownStorageCages() {
|
| | | log.info("发送缓存玻璃信息");
|
| | | JSONObject jsonObject4 = new JSONObject();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Scheduled(fixedDelay = 2000)
|
| | | @Scheduled(fixedDelay = 3000)
|
| | | public void sendDownGlassInfo() {
|
| | |
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer4 != null) {
|
| | | DownGlassInfoRequest request = redisUtil.getCacheObject("downGlassRequest");
|
| | | if (null == request) {
|
| | | request = new DownGlassInfoRequest();
|
| | |
| | | jsonObject4.append("takeGlass", takeGlass);
|
| | | }
|
| | |
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer4 != null) {
|
| | | for (WebSocketServer webserver : sendwServer4) {
|
| | | if (webserver != null && webserver.session.isOpen()) {
|
| | | webserver.sendMessage(jsonObject4.toString());
|
| | |
| | |
|
| | | @Scheduled(fixedDelay = 1000)
|
| | | public void isRun() {
|
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unLoadGlassIsRun");
|
| | | if (sendwServer != null) {
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | //正在进行的任务
|
| | | List<DownWorkstation> downWorkstation = downWorkstationService.getoneDownWorkstations(1, 6);
|
| | | jsonObject.append("downWorkstation", downWorkstation);
|
| | | List<DownGlassTask> downGlassTask = downGlassTaskService.selectOutTaskCache();
|
| | | jsonObject.append("downGlassTask", downGlassTask);
|
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unLoadGlassIsRun");
|
| | | if (sendwServer != null) {
|
| | | for (WebSocketServer webserver : sendwServer) {
|
| | | if (webserver != null) {
|
| | | webserver.sendMessage(jsonObject.toString());
|
| | |
| | | log.info("扫描任务已启动");
|
| | | while (true) {
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | try (Socket socket = new Socket(scanIp, scanPort);
|
| | | BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {
|
| | | try (Socket socket = new Socket(scanIp, scanPort)) {
|
| | | socket.setSoTimeout(1000);
|
| | | BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
|
| | | // 接收服务器响应
|
| | | log.info("等待扫码中......");
|
| | | String glassId = in.readLine();
|
| | |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: task-unLoad |
| | | |
| | | druid: |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 10 |
| | | time-between-eviction-runs-millis: 60000 |
| | | connection-properties: druid,stat,mergeSql=true,druid,stat ,slowSalMillis=5000 |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |