Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes
# Conflicts:
# UI-Project/src/router/index.js
# hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java
# hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageTask.java
# hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml
66个文件已修改
8 文件已重命名
23个文件已添加
| | |
| | | export default { |
| | | // serverUrl: "10.153.19.150:88/api", |
| | | // serverUrl: "10.153.19.150:88/api", |
| | | // serverUrl: "192.168.1.199:88/api", |
| | | serverUrl: "127.0.0.1:88/api", |
| | | // serverUrl2: "10.153.19.150:88" |
| | | // serverUrl2: "192.168.1.199:88" |
| | | serverUrl: "127.0.0.1:88/api", |
| | | // serverUrl2: "10.153.19.150:88" |
| | | // serverUrl2: "192.168.1.199:88" |
| | | serverUrl2: "127.0.0.1:88" |
| | | |
| | | //serverUrl:"res.abeim.cn" |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | |
| | | <title>北玻</title> |
| | | </head> |
| | | <body> |
| | | <div id="app"></div> |
| | | <div id="app" style="width: 100vw;height: 100vh;"></div> |
| | | <script type="module" src="/src/main.js"></script> |
| | | </body> |
| | | </html> |
| | |
| | | "devDependencies": { |
| | | "@types/sortablejs": "^1.15.7", |
| | | "@vitejs/plugin-vue": "^4.6.2", |
| | | "babel-polyfill": "^6.26.0", |
| | | "http-proxy-middleware": "^3.0.0", |
| | | "unplugin-auto-import": "^0.17.6", |
| | | "vite": "^4.4.9" |
| | |
| | | "proxy-from-env": "^1.1.0" |
| | | } |
| | | }, |
| | | "node_modules/babel-polyfill": { |
| | | "version": "6.26.0", |
| | | "resolved": "https://registry.npmmirror.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz", |
| | | "integrity": "sha512-F2rZGQnAdaHWQ8YAoeRbukc7HS9QgdgeyJ0rQDd485v9opwuPvjpPFcOOT/WmkKTdgy9ESgSPXDcTNpzrGr6iQ==", |
| | | "dev": true, |
| | | "dependencies": { |
| | | "babel-runtime": "^6.26.0", |
| | | "core-js": "^2.5.0", |
| | | "regenerator-runtime": "^0.10.5" |
| | | } |
| | | }, |
| | | "node_modules/babel-runtime": { |
| | | "version": "6.26.0", |
| | | "resolved": "https://registry.npmmirror.com/babel-runtime/-/babel-runtime-6.26.0.tgz", |
| | | "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", |
| | | "dev": true, |
| | | "dependencies": { |
| | | "core-js": "^2.4.0", |
| | | "regenerator-runtime": "^0.11.0" |
| | | } |
| | | }, |
| | | "node_modules/babel-runtime/node_modules/regenerator-runtime": { |
| | | "version": "0.11.1", |
| | | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", |
| | | "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", |
| | | "dev": true |
| | | }, |
| | | "node_modules/balanced-match": { |
| | | "version": "1.0.2", |
| | | "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", |
| | |
| | | "resolved": "https://registry.npmmirror.com/confbox/-/confbox-0.1.7.tgz", |
| | | "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", |
| | | "dev": true |
| | | }, |
| | | "node_modules/core-js": { |
| | | "version": "2.6.12", |
| | | "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz", |
| | | "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", |
| | | "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", |
| | | "dev": true, |
| | | "hasInstallScript": true |
| | | }, |
| | | "node_modules/crc-32": { |
| | | "version": "1.2.2", |
| | |
| | | "engines": { |
| | | "node": ">=8.10.0" |
| | | } |
| | | }, |
| | | "node_modules/regenerator-runtime": { |
| | | "version": "0.10.5", |
| | | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", |
| | | "integrity": "sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==", |
| | | "dev": true |
| | | }, |
| | | "node_modules/require-directory": { |
| | | "version": "2.1.1", |
| | |
| | | "proxy-from-env": "^1.1.0" |
| | | } |
| | | }, |
| | | "babel-polyfill": { |
| | | "version": "6.26.0", |
| | | "resolved": "https://registry.npmmirror.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz", |
| | | "integrity": "sha512-F2rZGQnAdaHWQ8YAoeRbukc7HS9QgdgeyJ0rQDd485v9opwuPvjpPFcOOT/WmkKTdgy9ESgSPXDcTNpzrGr6iQ==", |
| | | "dev": true, |
| | | "requires": { |
| | | "babel-runtime": "^6.26.0", |
| | | "core-js": "^2.5.0", |
| | | "regenerator-runtime": "^0.10.5" |
| | | } |
| | | }, |
| | | "babel-runtime": { |
| | | "version": "6.26.0", |
| | | "resolved": "https://registry.npmmirror.com/babel-runtime/-/babel-runtime-6.26.0.tgz", |
| | | "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", |
| | | "dev": true, |
| | | "requires": { |
| | | "core-js": "^2.4.0", |
| | | "regenerator-runtime": "^0.11.0" |
| | | }, |
| | | "dependencies": { |
| | | "regenerator-runtime": { |
| | | "version": "0.11.1", |
| | | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", |
| | | "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", |
| | | "dev": true |
| | | } |
| | | } |
| | | }, |
| | | "balanced-match": { |
| | | "version": "1.0.2", |
| | | "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", |
| | |
| | | "version": "0.1.7", |
| | | "resolved": "https://registry.npmmirror.com/confbox/-/confbox-0.1.7.tgz", |
| | | "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", |
| | | "dev": true |
| | | }, |
| | | "core-js": { |
| | | "version": "2.6.12", |
| | | "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz", |
| | | "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", |
| | | "dev": true |
| | | }, |
| | | "crc-32": { |
| | |
| | | "@vitejs/plugin-vue": "^4.6.2", |
| | | "@vue-macros/reactivity-transform": "^0.3.23", |
| | | "axios": "^1.6.8", |
| | | "babel-polyfill": "*", |
| | | "chart.js": "^4.4.3", |
| | | "echarts": "^5.5.1", |
| | | "element-plus": "^2.4.0", |
| | |
| | | "vue-echarts": "^6.7.3", |
| | | "vue-i18n": "^9.10.1", |
| | | "vue-print-nb": "^1.7.5", |
| | | "vue-router": "4.0.13", |
| | | "vue-router": "^4.0.13", |
| | | "vue3-print-nb": "^0.1.4", |
| | | "vxe-table": "^4.5.15", |
| | | "xe-utils": "^3.5.14", |
| | |
| | | "proxy-from-env": "^1.1.0" |
| | | } |
| | | }, |
| | | "babel-polyfill": { |
| | | "version": "6.26.0", |
| | | "resolved": "https://registry.npmmirror.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz", |
| | | "integrity": "sha512-F2rZGQnAdaHWQ8YAoeRbukc7HS9QgdgeyJ0rQDd485v9opwuPvjpPFcOOT/WmkKTdgy9ESgSPXDcTNpzrGr6iQ==", |
| | | "dev": true, |
| | | "requires": { |
| | | "babel-runtime": "^6.26.0", |
| | | "core-js": "^2.5.0", |
| | | "regenerator-runtime": "^0.10.5" |
| | | } |
| | | }, |
| | | "babel-runtime": { |
| | | "version": "6.26.0", |
| | | "resolved": "https://registry.npmmirror.com/babel-runtime/-/babel-runtime-6.26.0.tgz", |
| | | "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", |
| | | "dev": true, |
| | | "requires": { |
| | | "core-js": "^2.4.0", |
| | | "regenerator-runtime": "^0.11.0" |
| | | }, |
| | | "dependencies": { |
| | | "regenerator-runtime": { |
| | | "version": "0.11.1", |
| | | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", |
| | | "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", |
| | | "dev": true |
| | | } |
| | | } |
| | | }, |
| | | "balanced-match": { |
| | | "version": "1.0.2", |
| | | "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", |
| | |
| | | "version": "0.1.7", |
| | | "resolved": "https://registry.npmmirror.com/confbox/-/confbox-0.1.7.tgz", |
| | | "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", |
| | | "dev": true |
| | | }, |
| | | "core-js": { |
| | | "version": "2.6.12", |
| | | "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz", |
| | | "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", |
| | | "dev": true |
| | | }, |
| | | "crc-32": { |
| | |
| | | "requires": { |
| | | "picomatch": "^2.2.1" |
| | | } |
| | | }, |
| | | "regenerator-runtime": { |
| | | "version": "0.10.5", |
| | | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", |
| | | "integrity": "sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==", |
| | | "dev": true |
| | | }, |
| | | "require-directory": { |
| | | "version": "2.1.1", |
| | |
| | | "picomatch": "^2.2.1" |
| | | } |
| | | }, |
| | | "regenerator-runtime": { |
| | | "version": "0.10.5", |
| | | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", |
| | | "integrity": "sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==", |
| | | "dev": true |
| | | }, |
| | | "require-directory": { |
| | | "version": "2.1.1", |
| | | "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz", |
| | |
| | | "devDependencies": { |
| | | "@types/sortablejs": "^1.15.7", |
| | | "@vitejs/plugin-vue": "^4.6.2", |
| | | "babel-polyfill": "^6.26.0", |
| | | "http-proxy-middleware": "^3.0.0", |
| | | "unplugin-auto-import": "^0.17.6", |
| | | "vite": "^4.4.9" |
| | |
| | | <template> |
| | | |
| | | <router-view></router-view> |
| | | |
| | | </template> |
| | | <script setup> |
| | | import {ref} from 'vue' |
| | | import { RouterView } from 'vue-router' |
| | | import {onMounted} from 'vue' |
| | | import DevicePixelRatio from '@/utils/evicePixelRatio.js'; |
| | | |
| | | // 定义一个函数来调整 body 的缩放比例 |
| | | // function bodyScale() { |
| | | // const deviceheight = document.documentElement.clientHeight; |
| | | // const scale = deviceheight / 740; |
| | | // document.body.style.zoom = scale; |
| | | // } |
| | | |
| | | // 在组件挂载时执行 |
| | | // onMounted(() => { |
| | | // new DevicePixelRatio().init(); |
| | | // bodyScale(); |
| | | // }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | /* 你的样式内容 */ |
| | | </style> |
| | |
| | | station :'工位', |
| | | }, |
| | | Mounting:{ |
| | | previewproject :'选择预览工程', |
| | | loadinglinea :'上片线', |
| | | loadingline :'上片线:', |
| | | inloadingline :'请选择上片线', |
| | | oneloadingline :'一号上片线', |
| | | twoloadingline :'二号上片线', |
| | | waiting :'等待中', |
| | | setparameters :'设置参数', |
| | | project :'工程号', |
| | | projecta :'工程号:', |
| | | width :'原片宽', |
| | | height :'原片高', |
| | | thickness :'原片厚', |
| | | projectnumber :'工程原片序号', |
| | | state :'状态', |
| | | createtime :'创建时间', |
| | | all :'全选', |
| | | |
| | | } |
| | | } |
| | | previewproject: '选择预览工程', |
| | | loadinglinea: '上片线', |
| | | loadingline: '上片线:', |
| | | inloadingline: '请选择上片线', |
| | | oneloadingline: '一号上片线', |
| | | twoloadingline: '二号上片线', |
| | | waiting: '等待中', |
| | | pass: '通过', |
| | | setparameters: '设置参数', |
| | | project: '工程号', |
| | | projecta: '工程号:', |
| | | width: '原片宽', |
| | | height: '原片高', |
| | | thickness: '原片厚', |
| | | projectnumber: '工程原片序号', |
| | | state: '状态', |
| | | createtime: '创建时间', |
| | | all: '全选', |
| | | removalmethod: '请选择除膜方式', |
| | | removalmethodp: '除膜方式', |
| | | removalmethoda: '除膜方式:', |
| | | noremoval: '不除膜', |
| | | coarselyground: '粗磨', |
| | | finegrinding: '精磨', |
| | | }, |
| | | hellow: { |
| | | createtask: '创建任务', |
| | | starttask: '开始任务', |
| | | pstarttask: '是否开始任务?', |
| | | stoptask: '停止任务', |
| | | pstoptask: '是否停止任务?', |
| | | currenttask: '当前任务:', |
| | | claimednumber: '已领取配对数量:', |
| | | linenumber: '进入中空线数量:', |
| | | order: '出片顺序', |
| | | thickness: '厚度', |
| | | coatingtypes: '膜系', |
| | | height: '长', |
| | | width: '宽', |
| | | state: '状态', |
| | | cardnumber: '流程卡号', |
| | | cardnumbera: '流程卡号:', |
| | | layernumber: '层号', |
| | | totalnumber: '总片数', |
| | | pairsnumber: '已配对数量', |
| | | missingnumber: '缺片数量', |
| | | operate: '操作', |
| | | claimquest: '领取任务', |
| | | pclaimquest: '是否领取任务?', |
| | | missingfilms: '缺片详情', |
| | | forcedfilming: '强制出片', |
| | | pforcedfilming: '是否强制出片?', |
| | | brokenpieces: '破损片数', |
| | | } |
| | | } |
| | |
| | | import './assets/main.css' |
| | | |
| | | import { createApp } from 'vue' |
| | | import { createPinia } from 'pinia' |
| | | import {createApp} from 'vue' |
| | | import {createPinia} from 'pinia' |
| | | import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' |
| | | import App from './App.vue' |
| | | import router from './router' |
| | |
| | | import 'vxe-table/lib/style.css' |
| | | import i18n from '@/lang' |
| | | // import Echarts from "vue-echarts" |
| | | import * as echarts from "echarts" |
| | | // echarts.registerMap('china', china) |
| | | // Vue.prototype.$echarts = echarts |
| | | // app.component("v-chart", Echarts) |
| | | // app.config.globalProperties.$echarts = echarts |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue' |
| | | import 'babel-polyfill' |
| | | |
| | | const app = createApp(App) |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | |
| | | /*----------- 掰片/识别 ----------------*/ |
| | | { |
| | | path: 'Identify', |
| | | name: 'Identify', |
| | | component: () => import('../views/Identify/identify.vue'), |
| | | children:[ |
| | | name: 'ident', |
| | | component: () => import('../views/Identify/ident.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Identify/identify', |
| | | name: 'identify', |
| | | component: () => import('../views/Identify/identify.vue') |
| | | }, |
| | | { |
| | | path: '/Identify/identifwu', |
| | | name: 'identifwu', |
| | | component: () => import('../views/Identify/identifwu.vue') |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | name: 'cachingun', |
| | | component: () => import('../views/Caching/cachingun.vue') |
| | | }, |
| | | { |
| | | path: '/Caching/cachingyiwu', |
| | | name: 'cachingyiwu', |
| | | component: () => import('../views/Caching/cachingyiwu.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 磨边(冷加工) ----------------*/ |
| | |
| | | path: '/StockBasicData/stockBasicDatatwo', |
| | | name: 'stockBasicDatatwo', |
| | | component: () => import('../views/StockBasicData/stockBasicDatatwo.vue') |
| | | }, |
| | | { |
| | | path: '/StockBasicData/stockBasicyiwu', |
| | | name: 'stockBasicyiwu', |
| | | component: () => import('../views/StockBasicData/stockBasicyiwu.vue') |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | path: 'reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue'), |
| | | children:[ |
| | | children: [ |
| | | { |
| | | path: '/ReportWork/reportWork', |
| | | name: 'reportWork', |
| | |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 报表管理 ----------------*/ |
| | | { |
| | | path: 'reportmanage', |
| | | name: 'reportmanage', |
| | | component: () => import('../views/Reportmanage/reportmanage.vue'), |
| | | children:[ |
| | | { |
| | | path: '/Reportmanage/reportmanage', |
| | | name: 'reportmanage', |
| | | component: () => import('../views/Reportmanage/reportmanage.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | |
| | | /*----------- 中空 ----------------*/ |
| | | { |
| | | path: 'hollow', |
| | | name: 'hollowequipment', |
| | | component: () => import('../views/hollow/hollowequipment.vue'), |
| | | children: [ |
| | | { |
| | | path: '/hollow/hollowequipment', |
| | | name: 'hollowequipment', |
| | | component: () => import('../views/hollow/hollowequipment.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 管理系统 ----------------*/ |
| | | { |
| | | path: 'sys', |
New file |
| | |
| | | /** |
| | | * @description 校正windows页面在系统进行缩放后导致页面被放大的问题,通常放大比例是125%、150% |
| | | * **/ |
| | | |
| | | class DevicePixelRatio { |
| | | constructor() { |
| | | } |
| | | |
| | | //获取系统类型 |
| | | _getSystem() { |
| | | let flag = false; |
| | | var agent = navigator.userAgent.toLowerCase(); |
| | | if (agent.indexOf("windows") >= 0) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | //获取页面缩放比例 |
| | | _addHandler(element, type, handler) { |
| | | if (element.addEventListener) { |
| | | element.addEventListener(type, handler, false); |
| | | } else if (element.attachEvent) { |
| | | element.attachEvent("on" + type, handler); |
| | | } else { |
| | | element["on" + type] = handler; |
| | | } |
| | | } |
| | | |
| | | //校正浏览器缩放比例 |
| | | _correct() { |
| | | let t = this; |
| | | //页面devicePixelRatio(设备像素比例)变化后,计算页面body标签zoom修改其大小,来抵消devicePixelRatio带来的变化。 |
| | | document.getElementsByTagName('body')[0].style.zoom = 1 / window.devicePixelRatio; |
| | | } |
| | | |
| | | //监听页面缩放 |
| | | _watch() { |
| | | let t = this; |
| | | t._addHandler(window, 'resize', function () { //注意这个方法是解决全局有两个window.resize |
| | | //重新校正 |
| | | t._correct() |
| | | }) |
| | | } |
| | | |
| | | //初始化页面比例 |
| | | init() { |
| | | let t = this; |
| | | if (t._getSystem()) { //判断设备,目前只在windows系统下校正浏览器缩放比例 |
| | | //初始化页面校正浏览器缩放比例 |
| | | t._correct(); |
| | | //开启监听页面缩放 |
| | | t._watch(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | export default DevicePixelRatio; |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {onBeforeUnmount, onMounted, onUnmounted, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | import {useI18n} from 'vue-i18n' |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | const adjustedRects = ref([]); |
| | | onMounted(async () => { |
| | | try { |
| | | onMounted(async () => { |
| | | try { |
| | | const response = await request.post('/cacheGlass/edgStorageCage/selectEdgStorageCage'); // 替换为你的API端点 |
| | | if (response.code === 200) { |
| | | if (response.code === 200) { |
| | | const rawRects = response.data; // 设置矩形数据 |
| | | tableData.value = response.data |
| | | tableData.value = response.data |
| | | console.log(response.data); |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="height: 500px;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
New file |
| | |
| | | <script setup> |
| | | import {onBeforeUnmount, onMounted, onUnmounted, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | import {useI18n} from 'vue-i18n' |
| | | |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | const adjustedRects = ref([]); |
| | | onMounted(async () => { |
| | | try { |
| | | const response = await request.post('/cacheGlass/edgStorageCage/selectEdgStorageCage'); // 替换为你的API端点 |
| | | if (response.code === 200) { |
| | | const rawRects = response.data; // 设置矩形数据 |
| | | tableData.value = response.data |
| | | console.log(response.data); |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | width: rect.width * 0.5, |
| | | id: rect.id * 10, |
| | | })); |
| | | console.log(adjustedRects.value); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rects :', error); |
| | | } |
| | | }); |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enable_state === 1 ? 0 : 1; |
| | | // 发送请求到后端更新状态(这里省略了实际的请求逻辑) |
| | | const response = await request.post('/cacheGlass/edgStorageCage/updateEdgStorageCage', { |
| | | id: row.id, |
| | | enableState: newState |
| | | }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | row.enable_state = newState; |
| | | }; |
| | | const open = async (row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('sorter.information'), |
| | | t('sorter.prompt'), |
| | | { |
| | | confirmButtonText: t('sorter.yes'), |
| | | cancelButtonText: t('sorter.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | var url = "/cacheGlass/edgStorageCage/edgStorageCageGlass?edgStorageCageId=" + row.id; |
| | | console.log(row); |
| | | const response = await request.post(url, { |
| | | glassId: row.glass_id |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.EdgStorageCageinfos[0] |
| | | // adjustedRects.value = data.EdgStorageCageinfos[0] |
| | | adjustedRects.value = data.EdgStorageCageinfos[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | width: rect.width * 0.5, |
| | | id: rect.id * 10, |
| | | })); |
| | | |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | <template> |
| | | <div style="height: 500px;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="340" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="slot" align="center" :label="$t('sorter.gridnumber')" min-width="80"/> |
| | | <el-table-column prop="glass_id" align="center" :label="$t('sorter.glassnumber')" min-width="80"/> |
| | | <el-table-column prop="width" align="center" :label="$t('sorter.width')" min-width="120"/> |
| | | <el-table-column prop="height" align="center" :label="$t('sorter.height')" min-width="120"/> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('sorter.startstatus')" |
| | | min-width="80" |
| | | prop="enable_state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.enable_state === 1 ? 'success' : 'danger'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.enable_state === 1 ? $t('sorter.start') : $t('sorter.disable') }} |
| | | </el-tag> |
| | | </template> |
| | | <!-- <template #default="scope"> |
| | | <el-tag type="success" >{{ scope.row.enable_state==1?"启用":"未启用" }}</el-tag> |
| | | </template> --> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('sorter.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <!-- <el-button size="mini" type="text" plain @click="handleBindRacka(scope.row)">报缺</el-button> --> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">{{ |
| | | $t('sorter.deficiencieste') |
| | | }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <div class="awatch"> |
| | | <img src="../../assets/woshihuancun.png" alt="" |
| | | style="width: 70%;height: 90%;margin-left: 200px;margin-top: 20px;position: relative;"> |
| | | <div style="position: relative; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.id}px`, left: `10px`, width: `${rect.width}px`, height: `5px`, |
| | | backgroundColor: '#409EFF' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | #dt { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | #dta { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 80%; |
| | | } |
| | | |
| | | #dialog-footer { |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | |
| | | #message { |
| | | text-align: center; |
| | | align-items: center; |
| | | color: black; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | |
| | | .awatch { |
| | | height: 460px; |
| | | width: 1500px; |
| | | max-width: 100%; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <script lang="ts" setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {onBeforeUnmount, onMounted, reactive, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import type { TableColumnCtx } from 'element-plus' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | import {useI18n} from 'vue-i18n' |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue"; |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | |
| | | const router = useRouter() |
| | | const tableDataa = ref([]) |
| | | const tableDatab = ref([]) |
| | | const { t } = useI18n() |
| | | const {t} = useI18n() |
| | | const add = ref(false) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | |
| | | }); |
| | | onMounted(() => { |
| | | // closeWebSocket(); |
| | | debugger |
| | | // debugger // 断点 |
| | | // console.log("--------------webSocket") |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | |
| | | }); |
| | | </script> |
| | | <template> |
| | | <div> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisiblea = true">{{ $t('film.mes') }}</el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinda">{{ $t('film.warehousing') }}</el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBindc">{{ $t('film.pwarehousing') }}</el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinde">{{ $t('film.pwareout') }}</el-button> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="datetimerange" |
| | | format="YYYY/MM/DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | :start-placeholder="$t('film.starttime')" |
| | | :end-placeholder="$t('film.endtime')" |
| | | <div style="height: 500px;"> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisiblea = true"> |
| | | {{ $t('film.mes') }} |
| | | </el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinda"> |
| | | {{ $t('film.warehousing') }} |
| | | </el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBindc"> |
| | | {{ $t('film.pwarehousing') }} |
| | | </el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinde">{{ |
| | | $t('film.pwareout') |
| | | }} |
| | | </el-button> |
| | | <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="datetimerange" |
| | | format="YYYY/MM/DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | :start-placeholder="$t('film.starttime')" |
| | | :end-placeholder="$t('film.endtime')" |
| | | :default-time="defaultTime" /> |
| | | <el-select v-model="selectValuesa[0]" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('film.built')" value="1"></el-option> |
| | |
| | | </div> |
| | | </el-card> |
| | | <div class="awatch"> |
| | | <img src="../../assets/ypcc.png" alt="" style="width: 100%;height: 120%;margin-left: 10px;position: relative;margin-top: -20px;"> |
| | | </div> |
| | | <img src="../../assets/ypcc.png" alt="" |
| | | style="width: 100%;height: 120%;margin-left: -10px;position: relative;margin-top: -20px;"> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisiblea" top="5vh" width="85%" > |
| | | <el-table ref="table" style="margin-top: 20px;height: 700px;" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
New file |
| | |
| | | <script setup> |
| | | let indexFlag = $ref(1) |
| | | |
| | | function changeRouter(index) { |
| | | indexFlag = index |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <!-- <div id="main-div"> --> |
| | | |
| | | |
| | | <div id="main-body"> |
| | | <router-view/> |
| | | </div> |
| | | <!-- </div> --> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #main-div { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #div-title { |
| | | height: 2%; |
| | | width: 100%; |
| | | } |
| | | |
| | | #searchButton { |
| | | margin-top: -5px; |
| | | margin-left: 1rem; |
| | | } |
| | | |
| | | /* #searchButton1{ |
| | | //margin-left: 10rem; |
| | | } */ |
| | | /*main-body样式*/ |
| | | #main-body { |
| | | width: 100%; |
| | | height: 95%; |
| | | /* margin-top: 1%; */ |
| | | } |
| | | |
| | | #select { |
| | | margin-left: 0.5rem; |
| | | } |
| | | |
| | | :deep(.indexTag .el-breadcrumb__inner) { |
| | | color: #5CADFE !important; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div style="height: 500px;"> |
| | | <div style="display: flex;"> |
| | | <el-input v-model="inputValue" style="margin-left: 15px;margin-top: 10px;width: 240px" placeholder="请输入工程号" |
| | | @blur="handleBlur"/> |
| | | <el-pagination |
| | | v-model:current-page="currentPage" |
| | | :page-size="pageSize" |
| | | :size="size" |
| | | :disabled="disabled" |
| | | layout="prev, pager, next, jumper" |
| | | :total="totalPages" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading"> |
| | | <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect.glass_id" |
| | | class="rect" |
| | | @click="showDialog(rect.glass_id)" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.glass_state) |
| | | }" |
| | | > |
| | | <!-- 箭头 --> |
| | | <!-- <div id="arrow"></div> |
| | | <div id="line"></div> --> |
| | | <div class="centered-text"> |
| | | <div>{{ rect.glass_id }}</div> |
| | | <div>{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 8 || currentGlassRect?.glass_state === 9" type="warning" |
| | | plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 9 || currentGlassRect?.glass_state === 8" type="danger" |
| | | plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> |
| | | <el-icon class="el-icon--right"> |
| | | <Upload/> |
| | | </el-icon> |
| | | {{ $t('order.takeaway') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import {ElMessage} from 'element-plus' |
| | | import {computed, onMounted, onUnmounted, ref} from 'vue'; |
| | | import request from "@/utils/request" |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import {useI18n} from 'vue-i18n' |
| | | |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const blind = ref(false) |
| | | const olWidth = ref(); |
| | | const olHeight = ref(); |
| | | const glass_id = ref(); |
| | | const inputValue = ref(''); |
| | | const currentGlassId = ref(null); // 存储当前点击矩形的 glass_id |
| | | const currentstate = ref(null); |
| | | const adjustedRects = ref([]); |
| | | const raw = ref([]); |
| | | let webSocket: WebSocket | null = null; |
| | | const totalPages = ref(0); |
| | | const pageSize = ref(1); |
| | | const currentPage = ref(''); |
| | | const disabled = false; |
| | | const size = 'small'; |
| | | const rawData = ref([]); |
| | | // const handleBind = (row) => { |
| | | // blind.value = true; // 打开绑定架子对话框 |
| | | // }; |
| | | // 显示对话框并设置当前 glass_id |
| | | const currentGlassRect = computed(() => { |
| | | return adjustedRects.value.find(rect => rect.glass_id === currentGlassId.value); |
| | | }); |
| | | |
| | | function showDialog(glassId: number) { |
| | | currentGlassId.value = glassId; |
| | | blind.value = true; |
| | | adjustedRects.value = adjustedRects.value.map(rect => |
| | | rect.glass_id === glassId ? {...rect, isActive: true} : rect |
| | | ); |
| | | } |
| | | |
| | | const handleDialogClose = () => { |
| | | adjustedRects.value = adjustedRects.value.map(rect => ({ |
| | | ...rect, |
| | | isActive: false |
| | | })); |
| | | } |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |
| | | const response = await request.post('/cacheGlass/taskCache/identControls', { |
| | | glassId: currentGlassId.value, |
| | | state: 8, |
| | | line: 1001, |
| | | workingProcedure: '切割', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 8); |
| | | findEngineering() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 人工拿走 |
| | | const handleManualTake = async () => { |
| | | try { |
| | | // var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+200; |
| | | // console.log(url); |
| | | // const response = await request.post(url) |
| | | const response = await request.post('/cacheGlass/taskCache/identControls', { |
| | | glassId: currentGlassId.value, |
| | | state: 9, |
| | | line: 1001, |
| | | workingProcedure: '切割', |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 9); |
| | | findEngineering() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handleBlur = async () => { |
| | | if (inputValue.value) { |
| | | var url = "/cacheGlass/taskCache/cutTerritory?current=" + inputValue.value; |
| | | const response = await request.post(url) |
| | | if (response.code === 200) { |
| | | const rawRects = response.data[0]; |
| | | rawData.value = response.data; |
| | | totalPages.value = rawData.value.length; |
| | | const scaleFactor = 1621.78 / 6000; |
| | | const scaleFactory = 750 / 3300; |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, |
| | | x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * scaleFactory, |
| | | width: rect.width * scaleFactor, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | height: rect.height * scaleFactory, |
| | | glass_state: rect.glass_state |
| | | })); |
| | | // 如果WebSocket已连接,则关闭 |
| | | if (webSocket) { |
| | | webSocket.close(); |
| | | webSocket = null; |
| | | } |
| | | currentPage.value = 1; |
| | | } |
| | | } else { |
| | | connectWebSocket(); |
| | | } |
| | | }; |
| | | const findEngineering = async () => { |
| | | if (inputValue.value) { |
| | | var url = "/cacheGlass/taskCache/cutTerritory?current=" + inputValue.value; |
| | | const response = await request.post(url) |
| | | if (response.code === 200) { |
| | | rawData.value = response.data; |
| | | } |
| | | } else { |
| | | } |
| | | }; |
| | | |
| | | const handleCurrentChange = (val: number) => { |
| | | currentPage.value = val; |
| | | // window.localStorage.setItem('pagenumber', currentPage.value). |
| | | const page = currentPage.value - 1 |
| | | const scaleFactor = 1621.78 / 6000; |
| | | const scaleFactory = 750 / 3300; |
| | | adjustedRects.value = rawData.value[page]?.map(rect => ({ |
| | | // adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, |
| | | x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * scaleFactory, |
| | | width: rect.width * scaleFactor, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | height: rect.height * scaleFactory, |
| | | glass_state: rect.glass_state |
| | | })); |
| | | }; |
| | | |
| | | function getRectColor(state: number): string { |
| | | switch (state) { |
| | | case 0: |
| | | return '#e1f3d8'; |
| | | case 100: |
| | | return '#c8c9cc'; |
| | | case 110: |
| | | return '#b3e19d'; |
| | | case 120: |
| | | return '#f89898'; |
| | | case 8: |
| | | return '#911005'; |
| | | case 9: |
| | | return '#f3d19e'; |
| | | } |
| | | } |
| | | |
| | | // 更新矩形状态 |
| | | function updateRectStatus(glassId: string, status: number) { |
| | | adjustedRects.value.forEach(rect => { |
| | | if (rect.glass_id === glassId) { |
| | | rect.glass_state = status; // 更新矩形的状态 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const connectWebSocket = () => { |
| | | if (!webSocket) { |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | webSocket = new WebSocket(socketUrl); |
| | | webSocket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | const scaleFactor = 1621.78 / 6000; |
| | | const scaleFactory = 750 / 3300; |
| | | if (data.currentCutTerritory && data.currentCutTerritory.length > 0) { |
| | | const newRects = data.currentCutTerritory[0].map(rect => { |
| | | const existingRect = adjustedRects.value.find(r => r.glass_id === rect.glass_id); |
| | | |
| | | if (existingRect) { |
| | | return { |
| | | ...existingRect, |
| | | x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * scaleFactory, |
| | | width: rect.width * scaleFactor, |
| | | height: rect.height * scaleFactory, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | glass_state: rect.glass_state, |
| | | // 保持 isActive 状态不变 |
| | | }; |
| | | } else { |
| | | // 如果不存在,则添加新矩形,默认 isActive 为 false |
| | | return { |
| | | ...rect, |
| | | x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor, |
| | | y_axis: rect.y_axis * scaleFactory, |
| | | width: rect.width * scaleFactor, |
| | | height: rect.height * scaleFactory, |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | glass_state: rect.glass_state, |
| | | isActive: false, |
| | | glass_id: rect.glass_id, |
| | | }; |
| | | } |
| | | }); |
| | | adjustedRects.value = newRects; |
| | | } else if (data.currentCutTerritory == '') { |
| | | adjustedRects.value = []; |
| | | } |
| | | }; |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | // 初始时,如果输入框为空,则连接WebSocket |
| | | if (!inputValue.value) { |
| | | connectWebSocket(); |
| | | } |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | if (webSocket) { |
| | | webSocket.close(); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .rect { |
| | | border: 1px solid black; /* 设置矩形的边框 */ |
| | | /* background-color: lightblue; 设置矩形的背景色 */ |
| | | } |
| | | |
| | | .centered-text { |
| | | /* 设置文字居中样式 */ |
| | | /* display: flex; */ |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; /* 确保div占据整个矩形的高度 */ |
| | | font-size: small; |
| | | } |
| | | |
| | | #rect { |
| | | position: relative; /* 确保箭头可以相对于矩形定位 */ |
| | | /* 其他样式 */ |
| | | } |
| | | |
| | | #arrow { |
| | | position: absolute; |
| | | top: 70%; /* 箭头位于矩形中间 */ |
| | | left: 200px; /* 箭头在矩形左侧一些距离 */ |
| | | transform: translateY(-50%); /* 垂直居中 */ |
| | | width: 0; |
| | | height: 0; |
| | | border-top: 10px solid transparent; /* 上边框 */ |
| | | border-bottom: 10px solid transparent; /* 下边框 */ |
| | | border-right: 20px solid #911005; /* 右边框,形成箭头 */ |
| | | /* 根据需要调整边框大小和颜色 */ |
| | | } |
| | | |
| | | #line { |
| | | position: absolute; |
| | | top: 70%; /* 直线位于矩形中间 */ |
| | | left: 210px; /* 直线在箭头右侧一些距离 */ |
| | | transform: translateY(-50%); /* 垂直居中 */ |
| | | height: 2px; /* 直线的高度 */ |
| | | width: 240px; /* 直线的长度,根据需要调整 */ |
| | | background-color: #911005; /* 直线的颜色 */ |
| | | } |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <div style="display: flex;"> |
| | | <el-input v-model="inputValue" style="margin-left: 15px;margin-top: 10px;width: 240px" placeholder="请输入工程号" @blur="handleBlur"/> |
| | | <el-pagination |
| | | v-model:current-page="currentPage" |
| | | :page-size="pageSize" |
| | | :size="size" |
| | | :disabled="disabled" |
| | | layout="prev, pager, next, jumper" |
| | | :total="totalPages" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | <div style="height: 500px;"> |
| | | <div style="display: flex;"> |
| | | <el-input v-model="inputValue" style="margin-left: 15px;margin-top: 10px;width: 240px" placeholder="请输入工程号" |
| | | @blur="handleBlur"/> |
| | | <el-pagination |
| | | v-model:current-page="currentPage" |
| | | :page-size="pageSize" |
| | | :size="size" |
| | | :disabled="disabled" |
| | | layout="prev, pager, next, jumper" |
| | | :total="totalPages" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading"> |
| | | <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 8 || currentGlassRect?.glass_state === 9" type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | </el-scrollbar> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 8 || currentGlassRect?.glass_state === 9" type="warning" |
| | | plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | <el-button :disabled="currentGlassRect?.glass_state === 9 || currentGlassRect?.glass_state === 8" type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> |
| | | <el-icon class="el-icon--right"><Upload /></el-icon> |
| | | {{ $t('order.takeaway') }}</el-button> |
| | | </el-dialog> |
| | | </el-card> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted, computed } from 'vue'; |
| | | <el-button :disabled="currentGlassRect?.glass_state === 9 || currentGlassRect?.glass_state === 8" type="danger" |
| | | plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> |
| | | <el-icon class="el-icon--right"> |
| | | <Upload/> |
| | | </el-icon> |
| | | {{ $t('order.takeaway') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import {ElMessage} from 'element-plus' |
| | | import {computed, onMounted, onUnmounted, ref} 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() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import {useI18n} from 'vue-i18n' |
| | | |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const blind = ref(false) |
| | | const olWidth = ref(); |
| | | const olWidth = ref(); |
| | | const olHeight = ref(); |
| | | const glass_id = ref(); |
| | | const inputValue = ref(''); |
| | |
| | | <script setup lang="ts"> |
| | | import {Search ,Delete, Upload,Edit} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {nextTick, onBeforeUnmount, onMounted, ref} from "vue"; |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted, onBeforeUnmount,nextTick } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | import { useRouter } from 'vue-router' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import {ElMessage} from 'element-plus' |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | import {useI18n} from 'vue-i18n' |
| | | import {useRouter} from 'vue-router' |
| | | |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const dialogFormVisible = ref(false) |
| | | const dialogFormVisiblea = ref(true) |
| | | const dialogFormVisibleb = ref(false) |
| | |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | // console.error(error); |
| | | } |
| | | // 处理错误 |
| | | // console.error(error); |
| | | } |
| | | } |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | |
| | | }); |
| | | </script> |
| | | <template> |
| | | <div style="margin-top: 10px;"> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;dialogFormVisiblec = false;" >{{ $t('processCard.beforefurnace') }}</el-button> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;dialogFormVisiblec = false;">{{ $t('processCard.intofurnace') }}</el-button> |
| | | <el-button id="searchButton" type="success" @click="dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false;dialogFormVisiblec = false;">{{ $t('processCard.outfurnace') }}</el-button> |
| | | <el-button id="searchButton" type="info" @click="dialogFormVisiblec = true;dialogFormVisibleb = false;dialogFormVisible = false;dialogFormVisiblea = false">{{ $t('processCard.print') }}</el-button> |
| | | <div v-if="dialogFormVisible" > |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading"> |
| | | <div style="width: 49%;float: right;background-color: #f4f4f5;height: 430px;"> |
| | | <div v-if="adjustedRects1.length > 0"> |
| | | <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplay }}-{{ adjustedRects[0].temperingLayoutId }}</div> --> |
| | | <div style="text-align: center;"> {{ $t('processCard.temperinglayout') }}:{{ adjustedRects1[0].engineerId }}-{{ adjustedRects1[0].temperingLayoutId }} </div> |
| | | <div style="height: 500px;"> |
| | | <div style="margin-top: 10px;"> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;dialogFormVisiblec = false;"> |
| | | {{ $t('processCard.beforefurnace') }} |
| | | </el-button> |
| | | <el-button style="margin-left: 15px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;dialogFormVisiblec = false;"> |
| | | {{ $t('processCard.intofurnace') }} |
| | | </el-button> |
| | | <el-button id="searchButton" type="success" |
| | | @click="dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false;dialogFormVisiblec = false;"> |
| | | {{ $t('processCard.outfurnace') }} |
| | | </el-button> |
| | | <el-button id="searchButton" type="info" |
| | | @click="dialogFormVisiblec = true;dialogFormVisibleb = false;dialogFormVisible = false;dialogFormVisiblea = false"> |
| | | {{ $t('processCard.print') }} |
| | | </el-button> |
| | | <div v-if="dialogFormVisible"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" |
| | | v-loading="loading"> |
| | | <div style="width: 49%;float: right;background-color: #f4f4f5;height: 430px;"> |
| | | <div v-if="adjustedRects1.length > 0"> |
| | | <!-- <div style="text-align: center;">炉号:{{ engineerIdDisplay }}-{{ adjustedRects[0].temperingLayoutId }}</div> --> |
| | | <div style="text-align: center;"> {{ $t('processCard.temperinglayout') }}:{{ |
| | | adjustedRects1[0].engineerId |
| | | }}-{{ adjustedRects1[0].temperingLayoutId }} |
| | | </div> |
| | | <el-scrollbar height="430px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;max-width: 1400px;"> |
| | | <div |
| | |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%;height: 760px" |
| | | > |
| | | <el-table-column prop="flowCardId" :label="$t('processCard.flowcard')" width="140" align="center"/> |
| | | <el-table-column prop="layer" :label="$t('processCard.layer')" align="center" width="52"/> |
| | | <el-table-column prop="engineerId" :label="$t('processCard.project')" align="center" width="110"/> |
| | | <el-table-column prop="temperingLayoutId" :label="$t('processCard.temperinglayout')" align="center" width="52"/> |
| | | <el-table-column prop="temperingFeedSequence" :label="$t('processCard.temperingfeed')" align="center" width="52"/> |
| | | <el-table-column prop="width" :label="$t('processCard.width')" align="center" width="80"/> |
| | | <el-table-column prop="height" :label="$t('processCard.height')" align="center" width="80"/> |
| | | <el-table-column prop="thickness" :label="$t('processCard.thickness')" align="center" width="52"/> |
| | | </el-table> |
| | | </el-dialog> |
| | | > |
| | | <el-table-column prop="flowCardId" :label="$t('processCard.flowcard')" width="140" align="center"/> |
| | | <el-table-column prop="layer" :label="$t('processCard.layer')" align="center" width="52"/> |
| | | <el-table-column prop="engineerId" :label="$t('processCard.project')" align="center" width="110"/> |
| | | <el-table-column prop="temperingLayoutId" :label="$t('processCard.temperinglayout')" align="center" width="52"/> |
| | | <el-table-column prop="temperingFeedSequence" :label="$t('processCard.temperingfeed')" align="center" |
| | | width="52"/> |
| | | <el-table-column prop="width" :label="$t('processCard.width')" align="center" width="80"/> |
| | | <el-table-column prop="height" :label="$t('processCard.height')" align="center" width="80"/> |
| | | <el-table-column prop="thickness" :label="$t('processCard.thickness')" align="center" width="52"/> |
| | | </el-table> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <style scoped> |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import {onBeforeUnmount, onMounted, onUnmounted, ref} from "vue"; |
| | | import {ElMessage} from 'element-plus' |
| | | import request from "@/utils/request" |
| | | |
| | | import { ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | |
| | | const adjustedRects = ref([]); |
| | | const currentGlassId = ref(null); |
| | | const currenttemperingFeedSequence = ref(null); |
| | |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | |
| | | <template> |
| | | <div style="margin-top: 10px;"> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading"> |
| | | <!-- <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> --> |
| | | <div v-if="adjustedRects.length > 0"> |
| | | <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div> |
| | | <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | <div style="height: 500px;"> |
| | | <div style="margin-top: 10px;"> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" |
| | | v-loading="loading"> |
| | | <!-- <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> --> |
| | | <div v-if="adjustedRects.length > 0"> |
| | | <div style="text-align: center;">炉号:{{ adjustedRects[0].engineerId }}-{{ |
| | | adjustedRects[0].temperingLayoutId |
| | | }} |
| | | </div> |
| | | <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | @click="showDialog(rect)" |
| | | class="rect" |
| | | :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <el-button :disabled="!canSelectProject" type="warning" plain :icon="Delete" @click="handleDamage" style="width: 140px;margin-left: 10px;"> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <el-button :disabled="!canSelectProject" type="warning" plain :icon="Delete" @click="handleDamage" |
| | | style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | |
| | | <script lang="ts" setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {ElMessage} from 'element-plus' |
| | | import {useI18n} from 'vue-i18n' |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | |
| | | const router = useRouter() |
| | | import type { TableColumnCtx } from 'element-plus' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | const {t} = useI18n() |
| | | const dialogFormVisible = ref(false) |
| | | const blind = ref(false) |
| | | const blinda = ref(false) |
| | |
| | | const number = ref(''); |
| | | const canSelectProject = ref(true); |
| | | const canStartLoading = ref(false); |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | const ida = ref(null); |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue"; |
| | | const selectedProjectNo = ref(''); // 当前选中的工程号 |
| | | const selectedProjectNoa = ref(''); // 当前选中的工程号 |
| | | const selectedValue = ref(''); // 当前选中的宽 |
| | | const selectedValuea = ref(''); |
| | | const ida = ref(null); |
| | | const selectedProjectNo = ref(''); |
| | | const selectedProjectNoa = ref(''); |
| | | const selectedValue = ref(''); |
| | | const selectedValuea = ref(''); |
| | | const selectedValueb = ref(''); |
| | | const selectedValuec = ref(''); |
| | | // const upstatus = ref('上片机手动状态:'); // 假设这个用于显示自动/手动状态 |
| | | const selectedValuec = ref(''); |
| | | const upstatus = ref(t('basicData.machineaa')); |
| | | const cuttingMachine = ref(''); // 假设这个用于存储后端返回的状态值(0或1) |
| | | const cuttingMachine = ref(''); |
| | | const cuttingMachineStatusColor = ref('#911005'); // 用于动态设置i标签的背景色 |
| | | const inKageWord = ref(0); // 用于存储要传递给接口的inKageWord值 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | const selectOptions = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsa = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsb = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsc = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const tableDataa = ref([]) |
| | | const tableData = reactive([]); |
| | | const fetchTableData = async () => { |
| | | const options = ref<any[]>([]); |
| | | const selectOptions = ref<Array<any>>([]); |
| | | const selectOptionsa = ref<Array<any>>([]); |
| | | const selectOptionsb = ref<Array<any>>([]); |
| | | const selectOptionsc = ref<Array<any>>([]); |
| | | const tableDataa = ref([]) |
| | | const tableData = reactive([]); |
| | | const fetchTableData = async () => { |
| | | try { |
| | | const response = await request.get("/loadGlass/up-patten-usage/prioritylist"); |
| | | // 检查响应状态 |
| | | if (response.code === 200) { |
| | | // 更新表格数据 |
| | | console.log('成功获取表格数据:', response.data); |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | // window.localStorage.setItem('engineeringId', response.data[0].engineeringId) |
| | | // 获取唯一值 |
| | | const uniqueWidths = new Set(response.data.map(item => item.width)); |
| | | const uniqueHeights = new Set(response.data.map(item => item.height)); |
| | | const uniqueFilmsIds = new Set(response.data.map(item => item.filmsId)); |
| | | const uniqueWidths = new Set(response.data.map(item => item.width)); |
| | | const uniqueHeights = new Set(response.data.map(item => item.height)); |
| | | const uniqueFilmsIds = new Set(response.data.map(item => item.filmsId)); |
| | | const uniqueThicknesses = new Set(response.data.map(item => item.thickness)); |
| | | |
| | | selectOptions.value = Array.from(uniqueWidths).map(width => ({ |
| | | value: width, // 假设这是你想要作为value的属性 |
| | | label: width, // 假设这是你想要显示的label |
| | | })); |
| | | selectOptions.value = Array.from(uniqueWidths).map(width => ({ |
| | | value: width, |
| | | label: width, |
| | | })); |
| | | selectOptionsa.value = Array.from(uniqueHeights).map(height => ({ |
| | | value: height, |
| | | label: height, |
| | |
| | | } |
| | | }; |
| | | const handlezhiban = () => { |
| | | dialoglea.value = true; // 打开绑定架子对话框 |
| | | dialoglea.value = true; |
| | | fetchFlowCardId(); |
| | | }; |
| | | const selectproject = () => { |
| | | dialogFormVisible.value = true; |
| | | selectgong(); |
| | | dialogFormVisible.value = true; |
| | | selectgong(); |
| | | }; |
| | | // 值班信息 |
| | | const fetchFlowCardId = async () => { |
| | |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableDatax.value = response.data; |
| | | console.log(tableDatax.value); |
| | | console |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | list(''); |
| | | list(''); |
| | | fetchOptions(''); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | const list = async () => { |
| | | try { |
| | | const response = await request.get('/loadGlass/LoadGlass/list'); |
| | |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | // 假设这是您的响应处理函数 |
| | | // request.get("/loadGlass/LoadGlass/list").then((res) => { |
| | | // if (res.code == 200) { |
| | | // tableDataa.value = res.data |
| | | // if (tableDataa.value.length === 4) { |
| | | // if (tableDataa.value[0].patternHeight > 0) { |
| | | // flake.value = true; |
| | | // } |
| | | // if (tableDataa.value[1].patternHeight > 0) { |
| | | // flakea.value = true; |
| | | // } |
| | | // if (tableDataa.value[2].patternHeight > 0) { |
| | | // flakeb.value = true; |
| | | // } |
| | | // if (tableDataa.value[3].patternHeight > 0) { |
| | | // flakec.value = true; |
| | | // } |
| | | // } |
| | | // } else { |
| | | // ElMessage.warning(res.message) |
| | | // // router.push("/login") |
| | | // } |
| | | // }); |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | |
| | | }) |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | if(data.prioritylist!=null){ |
| | | tableData.splice(0, tableData.length, ...data.prioritylist[0]); |
| | |
| | | const requestData = { |
| | | state: 100 |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | const selectgong = async (queryString: string) => { |
| | | try { |
| | | const response = await request.post('/loadGlass/optimizeProject/listByState',{ |
| | | ...requestData, |
| | | query: queryString |
| | | ...requestData, |
| | | projectNo: queryString |
| | | }) |
| | | if (response.code == 200) { |
| | | titleSelectJson.value.processType = response.data; |
| | |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | const fetchOptions = async (queryString: string) => { |
| | | try { |
| | | // 发送请求到后端接口 |
| | | const response = await request.post('/loadGlass/optimizeProject/listByState', { |
| | | ...requestData, |
| | | query: queryString // 将查询字符串作为参数传递 |
| | | }); |
| | | if (response.code == 200) { |
| | | // titleSelectJson.value.processType = response.data; |
| | | console.log(response.data); |
| | | |
| | | } else { |
| | | ElMessage.warning(response.data); |
| | | const fetchOptions = async (queryString: string) => { |
| | | try { |
| | | const response = await request.post('/loadGlass/optimizeProject/listByState', { |
| | | ...requestData, |
| | | query: queryString |
| | | }); |
| | | if (response.code == 200) { |
| | | // titleSelectJson.value.processType = response.data; |
| | | console.log(response.data); |
| | | } else { |
| | | ElMessage.warning(response.data); |
| | | } |
| | | } catch (error) { |
| | | console.error('Error fetching options:', error); |
| | |
| | | const handleInputChange = async (value: string) => { |
| | | if (value) { |
| | | await fetchOptions(value); |
| | | } else { |
| | | options.value = []; // 清空选项列表 |
| | | } else { |
| | | options.value = []; |
| | | } |
| | | }; |
| | | // 处理用户输入变化的方法 |
| | |
| | | }); |
| | | // 添加 |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | workstationId.value = row.workstationId; |
| | | ida.value = row.id; |
| | | add.value = true; // 打开绑定架子对话框 |
| | | add.value = true; |
| | | }; |
| | | // 添加 |
| | | const handleConfirm = async () => { |
| | | // console.log('id.value:', id.value); |
| | | if ((ida.value === 2 || ida.value === 4) && (parseInt(selectedValuea.value, 10) >= 2700 )) { |
| | | const handleConfirm = async () => { |
| | | if ((ida.value === 2 || ida.value === 4) && (parseInt(selectedValuea.value, 10) >= 2700)) { |
| | | try { |
| | | const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { |
| | | id: workstationId.value, |
| | | workstationId: workstationId.value, |
| | | patternHeight: selectedValuea.value, |
| | | patternWidth: selectedValue.value, |
| | | filmsId: selectedValueb.value, |
| | | patternThickness: selectedValuec.value, |
| | | number: number.value |
| | | }); |
| | | // window.localStorage.setItem('workstationId', workstationId.value) |
| | | // window.localStorage.setItem('patternHeight', selectedValuea.value) |
| | | // window.localStorage.setItem('patternWidth', selectedValue.value) |
| | | // window.localStorage.setItem('number', number.value) |
| | | const response = await request.post('/loadGlass/LoadGlass/updateGlassMessage', { |
| | | id: workstationId.value, |
| | | workstationId: workstationId.value, |
| | | patternHeight: selectedValuea.value, |
| | | patternWidth: selectedValue.value, |
| | | filmsId: selectedValueb.value, |
| | | patternThickness: selectedValuec.value, |
| | | number: number.value |
| | | }); |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | add.value = false; |
| | | tableDataa.value = response.data; |
| | | // let workstationId = window.localStorage.getItem('workstationId') |
| | | // let patternHeight = window.localStorage.getItem('patternHeight') |
| | | // let patternWidth = window.localStorage.getItem('patternWidth') |
| | | // let number = window.localStorage.getItem('number') |
| | | if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') { |
| | | flake.value = true |
| | | } else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '2'){ |
| | |
| | | }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '4'){ |
| | | flakec.value = true |
| | | } |
| | | // if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '1') { |
| | | // flake.value = true |
| | | // } else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '2'){ |
| | | // flakea.value = true |
| | | // }else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '3'){ |
| | | // flakeb.value = true |
| | | // }else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '4'){ |
| | | // flakec.value = true |
| | | // } |
| | | selectedValuea.value = ''; |
| | | selectedValue.value = ''; |
| | | selectedValueb.value = ''; |
| | | selectedValuec.value = ''; |
| | | number.value = ''; |
| | | list() |
| | | list() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | |
| | | number: number.value |
| | | }); |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | add.value = false; |
| | | tableDataa.value = response.data; |
| | | if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') { |
| | |
| | | number: 0 |
| | | }); |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | adda.value = false; |
| | | tableDataa.value = response.data; |
| | | // window.localStorage.setItem('workstationId', response.data.workstationId) |
| | | // let workstationId = window.localStorage.getItem('workstationId') |
| | | tableDataa.value = response.data; |
| | | if (workstationId.value == '1') { |
| | | flake.value = false |
| | | } else if (workstationId.value == '2'){ |
| | | flakea.value = false |
| | | }else if (workstationId.value == '3'){ |
| | | flakeb.value = false |
| | | }else if (workstationId.value == '4'){ |
| | | flakec.value = false |
| | | } |
| | | list() |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | flake.value = false |
| | | } else if (workstationId.value == '2') { |
| | | flakea.value = false |
| | | } else if (workstationId.value == '3') { |
| | | flakeb.value = false |
| | | } else if (workstationId.value == '4') { |
| | | flakec.value = false |
| | | } |
| | | list() |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | |
| | | }) |
| | | window.localStorage.setItem('engineeringId', selectedProjectNo.value) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | dialogFormVisible.value = false; |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | selectedProjectNo.value = '' |
| | |
| | | label: thickness, |
| | | })); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | // ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | |
| | | state: 1, |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | selectedProjectNoa.value = ''; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } else if (markingMachineStatus.value === '#911005' || cuttingMachineStatus.value === '#911005') { |
| | |
| | | } |
| | | // 暂停 |
| | | const handlea = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pauseTask', { |
| | | engineeringId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | // tableData.splice([]); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pauseTask', { |
| | | engineeringId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | // tableData.splice([]); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | else { |
| | |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blindb.value = false; |
| | | tableData.splice([]); |
| | | |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | |
| | | } |
| | | // 开始上片 |
| | | const handleBind = (row) => { |
| | | blind.value = true; // 打开绑定架子对话框 |
| | | blind.value = true; |
| | | }; |
| | | // 暂停 |
| | | const handleBinda = (row) => { |
| | |
| | | const handleBindb = (row) => { |
| | | blindb.value = true; |
| | | }; |
| | | |
| | | // 删除 |
| | | const handleBindRacka = (row) => { |
| | | workstationId.value = row.workstationId; |
| | | adda.value = true; |
| | | adda.value = true; |
| | | }; |
| | | // 定义一个响应式引用,用于存储颜色状态 |
| | | const markingMachineStatus = ref('#911005'); |
| | |
| | | const newState = row.state === 100 ? 0 : 100; |
| | | try { |
| | | // 发送请求到后端更新状态 |
| | | const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | row.state = newState; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | row.state = newState; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | }; |
| | | // 上片机联机状态 |
| | | // const wsUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | // const ws = new WebSocket(wsUrl); |
| | | // ws.onopen = () => { |
| | | // console.log('WebSocket连接已打开'); |
| | | // }; |
| | | |
| | | // // 监听WebSocket的错误事件 |
| | | // ws.onerror = (error) => { |
| | | // console.error('WebSocket发生错误:', error); |
| | | // }; |
| | | |
| | | // // 监听WebSocket的关闭事件 |
| | | // ws.onclose = (event) => { |
| | | // if (event.wasClean) { |
| | | // console.log('WebSocket连接已正常关闭'); |
| | | // } else { |
| | | // console.error('WebSocket连接异常关闭'); |
| | | // } |
| | | // }; |
| | | // // 监听WebSocket的消息事件 |
| | | // ws.onmessage = (event) => { |
| | | // try { |
| | | // const data = JSON.parse(event.data.replace('<END>', '')); // 解析消息为JSON |
| | | // if (data && Array.isArray(data.InkageStatus) && data.InkageStatus.length > 0) { |
| | | // if(data.InkageStatus!=null){ |
| | | // const status = data.InkageStatus[0]; |
| | | // cuttingMachine.value = status; |
| | | // upstatus.value = status === '1' ? t('basicData.machine') : t('basicData.machineaa'); |
| | | // cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005'; |
| | | // inKageWord.value = status === '1' ? 0 : 1; |
| | | // } |
| | | // } else { |
| | | // // 处理错误情况或无效数据 |
| | | // // console.error('接收到的数据无效', data); |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('解析WebSocket消息时发生错误', error); |
| | | // } |
| | | // }; |
| | | const confirmCutting = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/LoadGlass/updateMesInkageLoad', |
| | | inKageWord.value |
| | | ); |
| | | if (response.code == 200) { |
| | | const status = response.data.status; |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | }; |
| | | const confirmCutting = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/LoadGlass/updateMesInkageLoad', |
| | | inKageWord.value |
| | | ); |
| | | if (response.code == 200) { |
| | | const status = response.data.status; |
| | | upstatus.value = status === '1' ? t('basicData.machine') : t('basicData.machineaa'); |
| | | cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005'; |
| | | // 显示成功消息 |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message || '请求失败'); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error('请求时发生错误', error); |
| | | ElMessage.error('请求时发生错误'); |
| | | } |
| | | cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005'; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message || '请求失败'); |
| | | } |
| | | } catch (error) { |
| | | console.error('请求时发生错误', error); |
| | | ElMessage.error('请求时发生错误'); |
| | | } |
| | | }; |
| | | </script> |
| | | <template> |
| | | <div> |
| | | <div id="dotClass"> |
| | | <div>{{ $t('basicData.laserprinting') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">{{ $t('basicData.yes') }}</el-button> |
| | | <div style="margin-left: 70px;">{{ $t('basicData.cuttingmachine') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;" >{{ $t('basicData.yes') }}</el-button> |
| | | <div style="margin-left: 70px;">{{ upstatus }} </div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;" >{{ $t('basicData.change') }}</el-button> |
| | | <div style="height: 500px;"> |
| | | <div> |
| | | <div id="dotClass"> |
| | | <div>{{ $t('basicData.laserprinting') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.yes') |
| | | }} |
| | | </el-button> |
| | | <div style="margin-left: 70px;">{{ $t('basicData.cuttingmachine') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.yes') |
| | | }} |
| | | </el-button> |
| | | <div style="margin-left: 70px;">{{ upstatus }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.change') |
| | | }} |
| | | </el-button> |
| | | |
| | | </div> |
| | | <el-button :disabled="!canSelectProject" style="margin-top: 5px;margin-left: 15px;" type="primary" @click="selectproject">{{ $t('basicData.selectproject') }}</el-button> |
| | |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">{{ $t('basicData.stop') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button> |
| | | <!-- <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">停止任务</el-button> --> |
| | | |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table |
| | | height="350" |
| | | ref="table" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | :data="tableData" |
| | | height="350" |
| | | ref="table" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | :data="tableData" |
| | | > |
| | | <el-table-column prop="layoutSequence" :label="$t('basicData.layoutSequence')" width="100" align="center"/> |
| | | <el-table-column prop="engineeringId" :label="$t('basicData.projectnumber')" width="200" align="center"/> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <el-dialog v-model="add" top="23vh" width="45%" :title="$t('basicData.addglass')" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | |
| | | <el-dialog v-model="dialogFormVisible" top="24vh" width="30%" :title="$t('basicData.project')" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item :label="$t('basicData.projectnumber')" :required="true"> |
| | | <el-select |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.plselectproject')" |
| | | style="width: 220px" |
| | | @input="handleInputChange" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <el-select |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.plselectproject')" |
| | | style="width: 220px" |
| | | @input="handleInputChange" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleup"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |
| | | #dta { display:block; float:left;line-height: 20px;margin-left: 80%;} |
| | | #dialog-footer{ |
| | |
| | | margin-top: -45px; |
| | | margin-left: 703px; |
| | | } |
| | | |
| | | </style> |
| | |
| | | const router = useRouter() |
| | | const {t} = useI18n() |
| | | const selectValuesa = reactive([]); |
| | | const selectedProjectNo = ref(''); // 当前选中的工程号 |
| | | const loadingline = ref(''); // 当前选中的上片线 |
| | | const selectedProjectNo = ref(''); |
| | | const stationCell = ref('1'); |
| | | const filmRemove = ref(''); |
| | | const dialogFormVisible = ref(false) |
| | | |
| | | |
| | | |
| | | |
| | | const blind = ref(false) |
| | | const blinda = ref(false) |
| | | const blindb = ref(false) |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | const dialoglea = ref(false) |
| | | const tableDatax = ref([]) |
| | | const user = ref(''); |
| | | const projectNo = ref(''); |
| | | const workstationId = ref(''); |
| | | const id = ref(''); |
| | | const patternHeight = ref(''); |
| | | const patternWidth = ref(''); |
| | | const filmsId = ref(''); |
| | | const patternThickness = ref(''); |
| | | const number = ref(''); |
| | | const canSelectProject = ref(true); |
| | | const canStartLoading = ref(false); |
| | | const selectedValue = ref(''); // 当前选中的宽 |
| | | const selectedValuea = ref(''); |
| | | const selectedValueb = ref(''); |
| | | const selectedValuec = ref(''); |
| | | // const upstatus = ref('上片机手动状态:'); // 假设这个用于显示自动/手动状态 |
| | | const upstatus = ref(t('basicData.machineaa')); |
| | | const cuttingMachine = ref(''); // 假设这个用于存储后端返回的状态值(0或1) |
| | | const cuttingMachineStatusColor = ref('#911005'); // 用于动态设置i标签的背景色 |
| | | const inKageWord = ref(0); // 用于存储要传递给接口的inKageWord值 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | const ida = ref(null); |
| | | const selectOptions = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsa = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsb = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsc = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const tableDataa = ref([]) |
| | | const tableData = reactive([]); |
| | | const tableDataa = ref<any[]>([]); |
| | | const tableDatab = ref<any[]>([]); |
| | | const tableData = ref([]) |
| | | // const tableData = reactive([]); |
| | | const titleSelectJson = ref({ |
| | | engineerId: [], |
| | | }) |
| | | const handlezhiban = () => { |
| | | dialoglea.value = true; // 打开绑定架子对话框 |
| | | dialoglea.value = true; |
| | | fetchFlowCardId(); |
| | | }; |
| | | const selectproject = () => { |
| | | dialogFormVisible.value = true; |
| | | selectgong(); |
| | | }; |
| | | |
| | | |
| | | const markingMachineStatus = ref('#911005'); |
| | | const cuttingMachineStatus = ref('#911005'); |
| | | const confirmMarkingMachine = () => { |
| | | markingMachineStatus.value = 'green'; |
| | | }; |
| | | const confirmCuttingMachine = () => { |
| | | cuttingMachineStatus.value = 'green'; |
| | | }; |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | const handleMessage = (data) => { |
| | | |
| | | } |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | const fetchTableData = async () => { |
| | | try { |
| | | const response = await request.get("/loadGlass/up-patten-usage/prioritylist"); |
| | | if (response.code === 200) { |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | ElMessage.error(response.message); |
| | | } |
| | | }); |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | engineerId: [], |
| | | }) |
| | | } catch (error) { |
| | | // 处理请求失败的情况 |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/uploadGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | |
| | | const handleMessage = (data: any) => { |
| | | tableDataa.value = data.list[0].slice(0, 2); |
| | | // tableDatab.value = data.list[0].slice(2, 4); |
| | | }; |
| | | onBeforeUnmount(() => { |
| | | closeWebSocket(); |
| | | }); |
| | | const selectgong = async () => { |
| | | const requestData = { |
| | | state: 100 |
| | | }; |
| | | const selectgong = async (queryString: string) => { |
| | | try { |
| | | const response = await request.post('/loadGlass/engineering/engineering/selectTask') |
| | | const response = await request.post('/loadGlass/optimizeProject/listByState', { |
| | | ...requestData, |
| | | query: queryString |
| | | }); |
| | | if (response.code == 200) { |
| | | titleSelectJson.value.engineerId = response.data; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | | //选择工程预览确认 |
| | | const handlesure = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', { |
| | | stationCell: 5, |
| | | engineerId: selectedProjectNo.value, |
| | | // filmRemove: filmRemove.value, |
| | | filmRemove: parseInt(filmRemove.value, 10), |
| | | }) |
| | | window.localStorage.setItem('engineeringId', selectedProjectNo.value) |
| | | window.localStorage.setItem('filmRemove', filmRemove.value) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableData.value = response.data; |
| | | dialogFormVisible.value = false; |
| | | selectedProjectNo.value = ''; |
| | | filmRemove.value = ''; |
| | | markingMachineStatus.value = '#911005'; |
| | | cuttingMachineStatus.value = '#911005'; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 添加 |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | ida.value = row.id; |
| | | add.value = true; // 打开绑定架子对话框 |
| | | // 开始上片 |
| | | const handleon = async () => { |
| | | let filmRemove = window.localStorage.getItem('filmRemove') |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | if (markingMachineStatus.value === 'green' && cuttingMachineStatus.value === 'green') { |
| | | try { |
| | | // const response = await request.post('/loadGlass/engineering/engineering/pause', { |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | stationCell: 5, |
| | | filmRemove: filmRemove, |
| | | engineerId: engineeringId, |
| | | state: 1, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } else if (markingMachineStatus.value === '#911005' || cuttingMachineStatus.value === '#911005') { |
| | | // 提示用户打标机未就绪 |
| | | ElMessage.warning(t('basicData.pausea')); |
| | | } |
| | | } |
| | | // 暂停 |
| | | const handleup = async () => { |
| | | try { |
| | | let filmRemove = window.localStorage.getItem('filmRemove') |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pause', { |
| | | stationCell: 5, |
| | | filmRemove: filmRemove, |
| | | engineerId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('basicData.infonull'), |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | let stateList = [] |
| | | if (selectValuesa[0] != null && selectValuesa[0] != 'undefined') { |
| | | if (selectValuesa[0] != "") { |
| | | stateList = [selectValuesa[0]]; |
| | | } |
| | | } |
| | | const response = await request.post("/loadGlass/up-patten-usage/setUpPattenRequest", { |
| | | state: selectValuesa[0], |
| | | // state: stateList, |
| | | stationCell: 5 |
| | | }) |
| | | if (response.code === 200) { |
| | | tableData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | |
| | | function getStatusText(state: number) { |
| | | switch (state) { |
| | | case 0: |
| | | return t('basicData.waiting'); |
| | | case 1: |
| | | return t('basicData.up'); |
| | | case 2: |
| | | return t('basicData.up'); |
| | | case 100: |
| | | return t('basicData.finish'); |
| | | } |
| | | } |
| | | function getStatusType(state: number) { |
| | | switch (state) { |
| | | case 0: |
| | | return 'warning'; |
| | | case 1: |
| | | return 'primary'; |
| | | case 2: |
| | | return 'primary'; |
| | | case 100: |
| | | return 'success'; |
| | | } |
| | | } |
| | | // 值班信息 |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/work_assignment/selectWorkAssignment', { |
| | | line: 2001, |
| | | workingProcedure: '冷加工' |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableDatax.value = response.data; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | onMounted(fetchTableData); |
| | | // 开始上片 |
| | | const handleBind = (row) => { |
| | | blind.value = true; // 打开绑定架子对话框 |
| | | blind.value = true; |
| | | }; |
| | | // 暂停 |
| | | const handleBinda = (row) => { |
| | | blinda.value = true; |
| | | }; |
| | | // 停止任务 |
| | | const handleBindb = (row) => { |
| | | blindb.value = true; |
| | | }; |
| | | |
| | | |
| | | const toggleEnableState = async (row: any) => { |
| | | const toggleEnableState = async (row: any) => { |
| | | // 检查 id 是否为空 |
| | | if (!row.id) { |
| | | ElMessage.error(t('basicData.updatanull')); |
| | | return; // 如果 id 为空,则不执行后续操作 |
| | | } |
| | | const newState = row.state === 100 ? 0 : 100; |
| | | try { |
| | | // 发送请求到后端更新状态 |
| | | const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | row.state = newState; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | const newState = row.state === 100 ? 0 : 100; |
| | | try { |
| | | const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', {id: row.id, state: newState}); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | row.state = newState; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | }; |
| | | |
| | | function getStatusType2(filmRemove) { |
| | | switch (filmRemove) { |
| | | case 0: |
| | | return 'success'; |
| | | case 1: |
| | | return 'info'; |
| | | case 2: |
| | | return 'warning'; |
| | | } |
| | | } |
| | | |
| | | function getStatusText2(filmRemove) { |
| | | switch (filmRemove) { |
| | | case 0: |
| | | return t('Mounting.noremoval');//完成 |
| | | case 1: |
| | | return t('Mounting.coarselyground');//新建 |
| | | case 2: |
| | | return t('Mounting.finegrinding');//执行中 |
| | | } |
| | | } |
| | | </script> |
| | | <template> |
| | | <div> |
| | | <div id="dotClass"> |
| | | <div>{{ $t('basicData.laserprinting') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">{{ $t('basicData.yes') }}</el-button> |
| | | <div style="margin-left: 70px;">{{ $t('basicData.cuttingmachine') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;" >{{ $t('basicData.yes') }}</el-button> |
| | | <div style="margin-left: 70px;">{{ upstatus }} </div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;" >{{ $t('basicData.change') }}</el-button> |
| | | |
| | | <div style="height: 500px;"> |
| | | <div> |
| | | <div id="dotClass"> |
| | | <div>{{ $t('basicData.laserprinting') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.yes') |
| | | }} |
| | | </el-button> |
| | | <div style="margin-left: 70px;">{{ $t('basicData.cuttingmachine') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.yes') |
| | | }} |
| | | </el-button> |
| | | <div style="margin-left: 70px;">{{ upstatus }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.change') |
| | | }} |
| | | </el-button> |
| | | </div> |
| | | <el-button style="margin-top: 5px;margin-left: 15px;" type="primary" @click="selectproject">{{ $t('Mounting.previewproject') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" type="success" @click="handleBind">{{ $t('basicData.startloading') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">{{ $t('basicData.stop') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button> |
| | | <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.loadinglinea')" style="margin-top: 5px;margin-left: 20px;" > |
| | | <el-select disabled v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.oneloadingline')" |
| | | style="margin-top: 5px;margin-left: 20px;"> |
| | | <el-option :label="$t('Mounting.all')" value="0"></el-option> |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('Mounting.setparameters') }}</el-button> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table |
| | | height="350" |
| | | ref="table" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | :data="tableData" |
| | | > |
| | | <el-table-column prop="layoutSequence" :label="$t('Mounting.project')" width="100" align="center"/> |
| | | <el-table-column prop="engineeringId" :label="$t('Mounting.width')" width="200" align="center"/> |
| | | <el-table-column prop="width" :label="$t('Mounting.height')" align="center"/> |
| | | <el-table-column prop="height" :label="$t('Mounting.thickness')" align="center"/> |
| | | <el-table-column prop="filmsId" :label="$t('Mounting.loadinglinea')" align="center"/> |
| | | <el-table-column :label="$t('Mounting.projectnumber')" align="center"> |
| | | <template #default="{ row }"> |
| | | <!-- 这里总是显示 1 --> |
| | | <span>{{ 1 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('Mounting.state')" |
| | | <el-table |
| | | height="350" |
| | | ref="table" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | :data="tableData" |
| | | > |
| | | <el-table-column prop="engineeringId" :label="$t('Mounting.project')" width="100" align="center"/> |
| | | <el-table-column prop="width" :label="$t('Mounting.width')" width="200" align="center"/> |
| | | <el-table-column prop="height" :label="$t('Mounting.height')" align="center"/> |
| | | <el-table-column prop="thickness" :label="$t('Mounting.thickness')" align="center"/> |
| | | <el-table-column prop="filmsId" :label="$t('Mounting.loadinglinea')" align="center"/> |
| | | <el-table-column :label="$t('Mounting.projectnumber')" align="center"> |
| | | <template #default="{ row }"> |
| | | <!-- 这里总是显示 1 --> |
| | | <span>{{ 1 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('Mounting.state')" |
| | | min-width="80" |
| | | prop="state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.state === 100 ? 'success' : 'warning'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.state === 100 ? $t('Mounting.pass') : $t('Mounting.waiting') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="filmsId" :label="$t('Mounting.createtime')" align="center"/> |
| | | </el-table> |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.state === 100 ? 'success' : 'warning'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.state === 100 ? $t('Mounting.pass') : $t('Mounting.waiting') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column prop="filmRemove" :label="$t('Mounting.removalmethodp')" align="center"/> --> |
| | | <!-- <el-table-column |
| | | align="center" |
| | | :label="$t('Mounting.removalmethodp')" |
| | | prop="filmRemove" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType2(scope.row.filmRemove)"> |
| | | {{ getStatusText2(scope.row.filmRemove) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> --> |
| | | <!-- <el-table-column prop="stationCell" :label="$t('Mounting.loadinglinea')" align="center"/> --> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <div style="display: flex;"> |
| | | <div style="width: 49%;float: left;"> |
| | | <div style="display: flex;"> |
| | | <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;"> |
| | | <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" /> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" /> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" /> |
| | | <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" /> |
| | | </el-table> |
| | | <div style="width: 49%;float: left;margin-left: 300px;"> |
| | | <div style="display: flex;"> |
| | | <img src="../../assets/shangpianji.png" alt="" |
| | | style="max-width: 20%;max-height: 25%;margin-left: 10%;margin-top: 5%;"> |
| | | <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 8%;" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60"/> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80"/> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80"/> |
| | | <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80"/> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <div style="width: 48%;float: right;"> |
| | | <div style="display: flex;"> |
| | | <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;"> |
| | | <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" /> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" /> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" /> |
| | | <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" /> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <!-- <div style="width: 48%;float: right;"> |
| | | <div style="display: flex;"> |
| | | <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;"> |
| | | <el-table :data="tableDatab" border style="width: 75%;margin-top: 10%;margin-left: 2%;" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" /> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" /> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" /> |
| | | <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" /> |
| | | </el-table> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <el-dialog v-model="blind" top="30vh" width="25%" :title="$t('basicData.startfilm')"> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handle"> |
| | | <el-button type="primary" @click="handleon"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="blind = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/> |
| | | <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')" /> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/> |
| | | </template> |
| | | |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/> |
| | | <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')"/> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')"> |
| | | <!-- <template #default="{ row }"> |
| | | <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/> |
| | | </template> --> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')"> |
| | | <!-- <template #default="{ row }"> |
| | | <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/> |
| | | </template> --> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('searchOrder.add') }} |
| | | </el-button> |
| | | <el-button @click="dialoglea = false">{{ $t('searchOrder.cancel') }}</el-button> |
| | | <el-button @click="dialoglea = false">{{ $t('large.close') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="blinda" top="24vh" width="30%" :title="$t('basicData.whetherpause')"> |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item :label="$t('Mounting.loadingline')" :required="true"> |
| | | <el-select v-model="loadingline" clearable :placeholder="$t('Mounting.inloadingline')" style="margin-left: 20px;" > |
| | | <el-option :label="$t('Mounting.all')" value="0"></el-option> |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | | </el-select> |
| | | <el-select disabled v-model="stationCell" clearable :placeholder="$t('Mounting.inloadingline')" |
| | | style="margin-left: 20px;"> |
| | | <el-option :label="$t('Mounting.all')" value="0"></el-option> |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="add" top="23vh" width="45%" :title="$t('basicData.addglass')" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form label-width="70px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.widtha')" :required="true" style="width: 14vw"> |
| | | <el-select |
| | | v-model="selectedValue" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.selectwidth')" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptions" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.heighta')" :required="true" style="width: 14vw"> |
| | | <el-select |
| | | v-model="selectedValuea" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.selectheight')" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsa" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.coatingtypesa')" :required="true" style="width: 14vw;"> |
| | | <el-select |
| | | v-model="selectedValueb" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.selectcoatingtypes')" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsb" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.thicknessa')" :required="true" style="width: 14vw"> |
| | | <el-select |
| | | v-model="selectedValuec" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.selectthickness')" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsc" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-input v-model="patternThickness" autocomplete="off" /> --> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.quantitya')" :required="true" style="width: 14vw;"> |
| | | <el-input :placeholder="$t('basicData.selectquantity')" v-model="number" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="add = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="30vh" width="25%" :title="$t('basicData.deletemessage')"> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirma"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="adda = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" top="24vh" width="50%" > |
| | | <el-dialog v-model="dialogFormVisible" top="24vh" width="70%"> |
| | | <div class="flex-container" style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item :label="$t('Mounting.loadingline')" :required="true"> |
| | | <el-select v-model="loadingline" clearable :placeholder="$t('Mounting.inloadingline')" > |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('Mounting.loadingline')" :required="true"> |
| | | <el-select disabled v-model="stationCell" clearable :placeholder="$t('Mounting.inloadingline')"> |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('Mounting.projecta')" :required="true"> |
| | | <el-select |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.plselectproject')" |
| | | style="width: 220px" |
| | | @input="handleInputChange" |
| | | > |
| | | <el-select |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.plselectproject')" |
| | | style="width: 220px" |
| | | @input="handleInputChange" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['engineerId']" |
| | | :key="item.id" |
| | | :label="item.engineerId" |
| | | :value="item.engineerId" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('Mounting.removalmethoda')" :required="true"> |
| | | <el-select v-model="filmRemove" clearable :placeholder="$t('Mounting.removalmethod')"> |
| | | <el-option :label="$t('Mounting.noremoval')" value="0"></el-option> |
| | | <el-option :label="$t('Mounting.coarselyground')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.finegrinding')" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleup"> |
| | | <el-button type="primary" @click="handlesure"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="dialogFormVisible = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | |
| | | <script lang="ts" setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | import type { TableColumnCtx } from 'element-plus' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import {ElMessage} from 'element-plus' |
| | | import {useI18n} from 'vue-i18n' |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue"; |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | |
| | | const router = useRouter() |
| | | const {t} = useI18n() |
| | | const selectValuesa = reactive([]); |
| | | const selectedProjectNo = ref(''); // 当前选中的工程号 |
| | | const loadingline = ref(''); // 当前选中的上片线 |
| | | const selectedProjectNo = ref(''); |
| | | const stationCell = ref('2'); |
| | | const filmRemove = ref(''); |
| | | const dialogFormVisible = ref(false) |
| | | const blind = ref(false) |
| | | const blinda = ref(false) |
| | | const blindb = ref(false) |
| | | const add = ref(false) |
| | | const adda = ref(false) |
| | | const dialoglea = ref(false) |
| | | const tableDatax = ref([]) |
| | | const user = ref(''); |
| | | const projectNo = ref(''); |
| | | const workstationId = ref(''); |
| | | const id = ref(''); |
| | | const patternHeight = ref(''); |
| | | const patternWidth = ref(''); |
| | | const filmsId = ref(''); |
| | | const patternThickness = ref(''); |
| | | const number = ref(''); |
| | | const canSelectProject = ref(true); |
| | | const canStartLoading = ref(false); |
| | | const selectedValue = ref(''); // 当前选中的宽 |
| | | const selectedValuea = ref(''); |
| | | const selectedValueb = ref(''); |
| | | const selectedValuec = ref(''); |
| | | // const upstatus = ref('上片机手动状态:'); // 假设这个用于显示自动/手动状态 |
| | | const upstatus = ref(t('basicData.machineaa')); |
| | | const cuttingMachine = ref(''); // 假设这个用于存储后端返回的状态值(0或1) |
| | | const cuttingMachineStatusColor = ref('#911005'); // 用于动态设置i标签的背景色 |
| | | const inKageWord = ref(0); // 用于存储要传递给接口的inKageWord值 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | const ida = ref(null); |
| | | const selectOptions = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsa = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsb = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const selectOptionsc = ref<Array<any>>([]); // 下拉选选项数组 |
| | | const tableDataa = ref([]) |
| | | const tableData = reactive([]); |
| | | const tableDataa = ref<any[]>([]); |
| | | const tableDatab = ref<any[]>([]); |
| | | const tableData = ref([]) |
| | | // const tableData = reactive([]); |
| | | const titleSelectJson = ref({ |
| | | engineerId: [], |
| | | }) |
| | | const handlezhiban = () => { |
| | | dialoglea.value = true; // 打开绑定架子对话框 |
| | | dialoglea.value = true; |
| | | fetchFlowCardId(); |
| | | }; |
| | | const selectproject = () => { |
| | | dialogFormVisible.value = true; |
| | | selectgong(); |
| | | }; |
| | | |
| | | |
| | | const markingMachineStatus = ref('#911005'); |
| | | const cuttingMachineStatus = ref('#911005'); |
| | | const confirmMarkingMachine = () => { |
| | | markingMachineStatus.value = 'green'; |
| | | }; |
| | | const confirmCuttingMachine = () => { |
| | | cuttingMachineStatus.value = 'green'; |
| | | }; |
| | | onMounted(() => { |
| | | // socket = initializeWebSocket(socketUrl, handleMessage); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | const fetchTableData = async () => { |
| | | try { |
| | | const response = await request.get("/loadGlass/up-patten-usage/prioritylist"); |
| | | if (response.code === 200) { |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | ElMessage.error(response.message); |
| | | } |
| | | }); |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | const titleSelectJsona = ref({ |
| | | processTypea: [], |
| | | }) |
| | | } catch (error) { |
| | | // 处理请求失败的情况 |
| | | // ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | |
| | | const requestData = { |
| | | state: 100 |
| | | }; |
| | | |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/uploadGlass`; |
| | | const handleMessage = (data: any) => { |
| | | // tableDataa.value = data.list[0].slice(0, 2); |
| | | tableDataa.value = data.list[0].slice(2, 4); |
| | | }; |
| | | onBeforeUnmount(() => { |
| | | closeWebSocket(); |
| | | }); |
| | | // 添加 |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | ida.value = row.id; |
| | | add.value = true; // 打开绑定架子对话框 |
| | | const requestData = { |
| | | state: 100 |
| | | }; |
| | | // 暂停 |
| | | const handlea = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pauseTask', { |
| | | engineeringId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | const selectgong = async (queryString: string) => { |
| | | try { |
| | | const response = await request.post('/loadGlass/optimizeProject/listByState', { |
| | | ...requestData, |
| | | query: queryString |
| | | }); |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | // tableData.splice([]); |
| | | titleSelectJson.value.engineerId = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | else { |
| | | }; |
| | | //选择工程预览确认 |
| | | const handlesure = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', { |
| | | stationCell: 6, |
| | | engineerId: selectedProjectNo.value, |
| | | // filmRemove: filmRemove.value, |
| | | filmRemove: parseInt(filmRemove.value, 10), |
| | | }) |
| | | window.localStorage.setItem('engineeringId', selectedProjectNo.value) |
| | | window.localStorage.setItem('filmRemove', filmRemove.value) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableData.value = response.data; |
| | | dialogFormVisible.value = false; |
| | | selectedProjectNo.value = ''; |
| | | filmRemove.value = ''; |
| | | markingMachineStatus.value = '#911005'; |
| | | cuttingMachineStatus.value = '#911005'; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 开始上片 |
| | | const handleon = async () => { |
| | | let filmRemove = window.localStorage.getItem('filmRemove') |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | if (markingMachineStatus.value === 'green' && cuttingMachineStatus.value === 'green') { |
| | | try { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pause', { |
| | | // const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | // stationCell: 6, |
| | | // filmRemove: filmRemove, |
| | | engineerId: engineeringId, |
| | | state: 1, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } else if (markingMachineStatus.value === '#911005' || cuttingMachineStatus.value === '#911005') { |
| | | // 提示用户打标机未就绪 |
| | | ElMessage.warning(t('basicData.pausea')); |
| | | } |
| | | } |
| | | // 暂停 |
| | | const handleup = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pause', { |
| | | // stationCell: 6, |
| | | engineerId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('basicData.infonull'), |
| | | }) |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | function getStatusText(state: number) { |
| | | switch (state) { |
| | | case 0: |
| | | return t('basicData.waiting'); |
| | | case 1: |
| | | return t('basicData.up'); |
| | | case 2: |
| | | return t('basicData.up'); |
| | | case 100: |
| | | return t('basicData.finish'); |
| | | } |
| | | } |
| | | function getStatusType(state: number) { |
| | | switch (state) { |
| | | case 0: |
| | | return 'warning'; |
| | | case 1: |
| | | return 'primary'; |
| | | case 2: |
| | | return 'primary'; |
| | | case 100: |
| | | return 'success'; |
| | | } |
| | | } |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | let stateList = [] |
| | | if (selectValuesa[0] != null && selectValuesa[0] != 'undefined') { |
| | | if (selectValuesa[0] != "") { |
| | | stateList = [selectValuesa[0]]; |
| | | } |
| | | } |
| | | const response = await request.post("/loadGlass/up-patten-usage/setUpPattenRequest", { |
| | | state: selectValuesa[0], |
| | | // state: stateList, |
| | | stationCell: 6 |
| | | }) |
| | | if (response.code === 200) { |
| | | tableData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | |
| | | // 值班信息 |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | | const response = await request.post('/loadGlass/work_assignment/selectWorkAssignment', { |
| | | line: 2001, |
| | | workingProcedure: '冷加工' |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableDatax.value = response.data; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | onMounted(fetchTableData); |
| | | // 开始上片 |
| | | const handleBind = (row) => { |
| | | blind.value = true; // 打开绑定架子对话框 |
| | | blind.value = true; |
| | | }; |
| | | // 暂停 |
| | | const handleBinda = (row) => { |
| | | blinda.value = true; |
| | | }; |
| | | // 停止任务 |
| | | const handleBindb = (row) => { |
| | | blindb.value = true; |
| | | }; |
| | | |
| | | // 删除 |
| | | const handleBindRacka = (row) => { |
| | | workstationId.value = row.workstationId; |
| | | adda.value = true; |
| | | }; |
| | | const toggleEnableState = async (row: any) => { |
| | | const toggleEnableState = async (row: any) => { |
| | | // 检查 id 是否为空 |
| | | if (!row.id) { |
| | | ElMessage.error(t('basicData.updatanull')); |
| | | return; // 如果 id 为空,则不执行后续操作 |
| | | } |
| | | const newState = row.state === 100 ? 0 : 100; |
| | | try { |
| | | // 发送请求到后端更新状态 |
| | | const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | row.state = newState; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求错误 |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | const newState = row.state === 100 ? 0 : 100; |
| | | try { |
| | | const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', {id: row.id, state: newState}); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | row.state = newState; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | }; |
| | | |
| | | function getStatusType2(filmRemove) { |
| | | switch (filmRemove) { |
| | | case 0: |
| | | return 'success'; |
| | | case 1: |
| | | return 'info'; |
| | | case 2: |
| | | return 'warning'; |
| | | } |
| | | } |
| | | |
| | | function getStatusText2(filmRemove) { |
| | | switch (filmRemove) { |
| | | case 0: |
| | | return t('Mounting.noremoval');//完成 |
| | | case 1: |
| | | return t('Mounting.coarselyground');//新建 |
| | | case 2: |
| | | return t('Mounting.finegrinding');//执行中 |
| | | } |
| | | } |
| | | </script> |
| | | <template> |
| | | <div> |
| | | <div id="dotClass"> |
| | | <div>{{ $t('basicData.laserprinting') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">{{ $t('basicData.yes') }}</el-button> |
| | | <div style="margin-left: 70px;">{{ $t('basicData.cuttingmachine') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;" >{{ $t('basicData.yes') }}</el-button> |
| | | <div style="margin-left: 70px;">{{ upstatus }} </div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;" >{{ $t('basicData.change') }}</el-button> |
| | | |
| | | <div style="height: 500px;"> |
| | | <div> |
| | | <div id="dotClass"> |
| | | <div>{{ $t('basicData.laserprinting') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: markingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmMarkingMachine" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.yes') |
| | | }} |
| | | </el-button> |
| | | <div style="margin-left: 70px;">{{ $t('basicData.cuttingmachine') }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatus, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.yes') |
| | | }} |
| | | </el-button> |
| | | <div style="margin-left: 70px;">{{ upstatus }}</div> |
| | | <i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i> |
| | | <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;">{{ |
| | | $t('basicData.change') |
| | | }} |
| | | </el-button> |
| | | </div> |
| | | <el-button style="margin-top: 5px;margin-left: 15px;" type="primary" @click="selectproject">{{ $t('Mounting.previewproject') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" type="success" @click="handleBind">{{ $t('basicData.startloading') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">{{ $t('basicData.stop') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button> |
| | | <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.loadinglinea')" style="margin-top: 5px;margin-left: 20px;" > |
| | | <el-select disabled v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.twoloadingline')" |
| | | style="margin-top: 5px;margin-left: 20px;"> |
| | | <el-option :label="$t('Mounting.all')" value="0"></el-option> |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | |
| | | min-width="80" |
| | | prop="state" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.state === 100 ? 'success' : 'warning'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.state === 100 ? $t('Mounting.pass') : $t('Mounting.waiting') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.state === 100 ? 'success' : 'warning'" |
| | | @click="toggleEnableState(scope.row)" |
| | | > |
| | | {{ scope.row.state === 100 ? $t('Mounting.pass') : $t('Mounting.waiting') }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="filmsId" :label="$t('Mounting.createtime')" align="center"/> |
| | | <!-- <el-table-column prop="filmRemove" :label="$t('Mounting.removalmethodp')" align="center"/> --> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('Mounting.removalmethodp')" |
| | | prop="filmRemove" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType2(scope.row.filmRemove)"> |
| | | {{ getStatusText2(scope.row.filmRemove) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="stationCell" :label="$t('Mounting.loadinglinea')" align="center"/> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <div style="display: flex;"> |
| | | <div style="width: 49%;float: left;"> |
| | | <div style="display: flex;"> |
| | | <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;"> |
| | | <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" /> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" /> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" /> |
| | | <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" /> |
| | | </el-table> |
| | | <div style="width: 49%;float: left;margin-left: 300px;"> |
| | | <div style="display: flex;"> |
| | | <img src="../../assets/shangpianji.png" alt="" |
| | | style="max-width: 20%;max-height: 25%;margin-left: 10%;margin-top: 5%;"> |
| | | <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 8%;" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60"/> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80"/> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80"/> |
| | | <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80"/> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <div style="width: 48%;float: right;"> |
| | | <div style="display: flex;"> |
| | | <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;"> |
| | | <el-table :data="tableDataa" border style="width: 75%;margin-top: 10%;margin-left: 2%;" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" /> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" /> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" /> |
| | | <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" /> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <!-- <div style="width: 48%;float: right;"> |
| | | <div style="display: flex;"> |
| | | <img src="../../assets/shangpianji.png" alt="" style="max-width: 25%;max-height: 25%;margin-left: 10%;margin-top: 5%;"> |
| | | <el-table :data="tableDatab" border style="width: 75%;margin-top: 10%;margin-left: 2%;" |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <el-table-column prop="workstationId" align="center" :label="$t('basicData.station')" min-width="60" /> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('basicData.width')" min-width="80" /> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('basicData.height')" min-width="80" /> |
| | | <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" /> |
| | | <el-table-column prop="number" align="center" :label="$t('basicData.quantity')" min-width="80" /> |
| | | </el-table> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <el-dialog v-model="blind" top="30vh" width="25%" :title="$t('basicData.startfilm')"> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handle"> |
| | | <el-button type="primary" @click="handleon"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="blind = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/> |
| | | <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')" /> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/> |
| | | </template> |
| | | |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="line" fixed align="center" :label="$t('searchOrder.line')"/> |
| | | <el-table-column prop="workProcesses" fixed align="center" :label="$t('searchOrder.process')"/> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('searchOrder.team')"> |
| | | <!-- <template #default="{ row }"> |
| | | <el-input v-model="row.teamsGroupsName" autocomplete="off" min-width="150"/> |
| | | </template> --> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('searchOrder.basic')"> |
| | | <!-- <template #default="{ row }"> |
| | | <el-input v-model="row.deviceName" autocomplete="off" min-width="150"/> |
| | | </template> --> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('searchOrder.add') }} |
| | | </el-button> |
| | | <el-button @click="dialoglea = false">{{ $t('searchOrder.cancel') }}</el-button> |
| | | <el-button @click="dialoglea = false">{{ $t('large.close') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="blinda" top="24vh" width="30%" :title="$t('basicData.whetherpause')"> |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item :label="$t('Mounting.loadingline')" :required="true"> |
| | | <el-select v-model="loadingline" clearable :placeholder="$t('Mounting.inloadingline')" style="margin-left: 20px;" > |
| | | <el-option :label="$t('Mounting.all')" value="0"></el-option> |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | | </el-select> |
| | | <el-select disabled v-model="stationCell" clearable :placeholder="$t('Mounting.inloadingline')" |
| | | style="margin-left: 20px;"> |
| | | <el-option :label="$t('Mounting.all')" value="0"></el-option> |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="add" top="23vh" width="45%" :title="$t('basicData.addglass')" > |
| | | <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form label-width="70px" label-position="right"> |
| | | <el-row style="margin-top: -15px;margin-bottom: -2px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.widtha')" :required="true" style="width: 14vw"> |
| | | <el-select |
| | | v-model="selectedValue" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.selectwidth')" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptions" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.heighta')" :required="true" style="width: 14vw"> |
| | | <el-select |
| | | v-model="selectedValuea" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.selectheight')" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsa" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.coatingtypesa')" :required="true" style="width: 14vw;"> |
| | | <el-select |
| | | v-model="selectedValueb" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.selectcoatingtypes')" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsb" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.thicknessa')" :required="true" style="width: 14vw"> |
| | | <el-select |
| | | v-model="selectedValuec" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.selectthickness')" |
| | | style="width: 220px" |
| | | @input="handleInputChangea" |
| | | > |
| | | <el-option |
| | | v-for="item in selectOptionsc" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-input v-model="patternThickness" autocomplete="off" /> --> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px;"> |
| | | <el-col :span="6"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <div> |
| | | <el-form-item :label="$t('basicData.quantitya')" :required="true" style="width: 14vw;"> |
| | | <el-input :placeholder="$t('basicData.selectquantity')" v-model="number" autocomplete="off" /> |
| | | </el-form-item></div></div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="add = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="adda" top="30vh" width="25%" :title="$t('basicData.deletemessage')"> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirma"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="adda = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" top="24vh" width="50%" > |
| | | <el-dialog v-model="dialogFormVisible" top="24vh" width="70%"> |
| | | <div class="flex-container" style="margin-left: 50px;margin-bottom: 10px;"> |
| | | <el-form-item :label="$t('Mounting.loadingline')" :required="true"> |
| | | <el-select v-model="loadingline" clearable :placeholder="$t('Mounting.inloadingline')" > |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('Mounting.loadingline')" :required="true"> |
| | | <el-select disabled v-model="stationCell" clearable :placeholder="$t('Mounting.inloadingline')"> |
| | | <el-option :label="$t('Mounting.oneloadingline')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.twoloadingline')" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('Mounting.projecta')" :required="true"> |
| | | <el-select |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.plselectproject')" |
| | | style="width: 220px" |
| | | @input="handleInputChange" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <el-select |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.plselectproject')" |
| | | style="width: 220px" |
| | | @input="handleInputChange" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['engineerId']" |
| | | :key="item.id" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('Mounting.removalmethoda')" :required="true"> |
| | | <el-select v-model="filmRemove" clearable :placeholder="$t('Mounting.removalmethod')"> |
| | | <el-option :label="$t('Mounting.noremoval')" value="0"></el-option> |
| | | <el-option :label="$t('Mounting.coarselyground')" value="1"></el-option> |
| | | <el-option :label="$t('Mounting.finegrinding')" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleup"> |
| | | <el-button type="primary" @click="handlesure"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="dialogFormVisible = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | import {useI18n} from 'vue-i18n' |
| | | |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | const requestData = { |
| | | line: 2001 |
| | | }; |
| | | const requestData = { |
| | | line: 2001 |
| | | }; |
| | | const timeRange = ref([]) |
| | | const selectValuesa = reactive([]); |
| | | // request.post("/cacheGlass/taskCache/selectEdgTask",{ |
| | |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | <template> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('workOrder.cway')" clearable style="margin-left: 20px;margin-bottom: 10px;"> |
| | | <el-option :label="$t('workOrder.edgingone')" value="2001"></el-option> |
| | | <el-option :label="$t('workOrder.edgingtwo')" value="2002"></el-option> |
| | | </el-select> |
| | | |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('workOrder.cstate')" clearable style="margin-left: 20px;margin-bottom: 10px;" > |
| | | <el-option :label="$t('workOrder.nedging')" value="0"></el-option> |
| | | <el-option :label="$t('workOrder.edging')" value="1"></el-option> |
| | | <el-option :label="$t('workOrder.finedging')" value="2"></el-option> |
| | | <div style="height: 500px;"> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('workOrder.cway')" clearable |
| | | style="margin-left: 20px;margin-bottom: 10px;"> |
| | | <el-option :label="$t('workOrder.edgingone')" value="2001"></el-option> |
| | | <el-option :label="$t('workOrder.edgingtwo')" value="2002"></el-option> |
| | | </el-select> |
| | | |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('workOrder.cstate')" clearable |
| | | style="margin-left: 20px;margin-bottom: 10px;"> |
| | | <el-option :label="$t('workOrder.nedging')" value="0"></el-option> |
| | | <el-option :label="$t('workOrder.edging')" value="1"></el-option> |
| | | <el-option :label="$t('workOrder.finedging')" value="2"></el-option> |
| | | </el-select> |
| | | <span class="demonstration" style="margin-left: 20px;margin-bottom: 10px;">{{ $t('workOrder.time') }}</span> |
| | | <el-date-picker v-model="timeRange" type="datetimerange" range-separator="至" :start-placeholder="$t('reportmanage.starttime')" style="margin-left: 20px;margin-bottom: 10px;" value-format = "YYYY-MM-DD hh:mm:ss" |
| | |
| | | {{ scope.row.status==0?"未磨边":scope.row.status==1?"磨边中":"已磨边" }} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | |
| | | |
| | | |
| | | <el-table-column fixed="right" :label="$t('workOrder.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">{{ $t('workOrder.breakage') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ $t('workOrder.takeout') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">{{ |
| | | $t('workOrder.breakage') |
| | | }} |
| | | </el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ |
| | | $t('workOrder.takeout') |
| | | }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {onBeforeUnmount, onMounted, onUnmounted, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | import {useI18n} from 'vue-i18n' |
| | | |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | const requestData = { |
| | | const requestData = { |
| | | line: 2002 |
| | | }; |
| | | }; |
| | | // request.post("/cacheGlass/taskCache/selectEdgTask",{ |
| | | // ...requestData, |
| | | |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <div style="height: 500px;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="240" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glass_id" align="center" :label="$t('workOrder.glassID')" min-width="180" /> |
| | | <el-table-column prop="width" align="center" :label="$t('workOrder.width')" min-width="120" /> |
| | | <el-table-column prop="height" align="center" :label="$t('workOrder.height')" min-width="80" /> |
| | | <el-table-column prop="thickness" align="center" :label="$t('workOrder.thickness')" min-width="120" /> |
| | | <el-table-column prop="glass_type" align="center" :label="$t('workOrder.glasstype')" min-width="120" /> |
| | | <el-table height="240" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glass_id" align="center" :label="$t('workOrder.glassID')" min-width="180"/> |
| | | <el-table-column prop="width" align="center" :label="$t('workOrder.width')" min-width="120"/> |
| | | <el-table-column prop="height" align="center" :label="$t('workOrder.height')" min-width="80"/> |
| | | <el-table-column prop="thickness" align="center" :label="$t('workOrder.thickness')" min-width="120"/> |
| | | <el-table-column prop="glass_type" align="center" :label="$t('workOrder.glasstype')" min-width="120"/> |
| | | <el-table-column fixed="right" :label="$t('workOrder.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">{{ $t('workOrder.breakage') }}</el-button> |
New file |
| | |
| | | <script setup> |
| | | import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | // import { ref } from 'vue' |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | import {useI18n} from 'vue-i18n' |
| | | |
| | | const router = useRouter() |
| | | const adda = ref(false) |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | |
| | | const tableData = ref([]) |
| | | const slot = ref('') |
| | | const requestData = { |
| | | line: 2001 |
| | | }; |
| | | const timeRange = ref([]) |
| | | const selectValuesa = reactive([]); |
| | | // request.post("/cacheGlass/taskCache/selectEdgTask",{ |
| | | // ...requestData, |
| | | |
| | | // }).then((res) => { |
| | | // if (res.code == 200) { |
| | | |
| | | // console.log(res.data); |
| | | // tableData.value = res.data |
| | | // console.log(res.data[0].slot); |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | |
| | | // } |
| | | // }); |
| | | |
| | | // 磨边任务查询 |
| | | const setEdgGlassInfoRequest = async () => { |
| | | let celllist = [] |
| | | let stateList = [] |
| | | if (selectValuesa[0] != null && selectValuesa[0] != 'undefined') { |
| | | if (selectValuesa[0] != "") { |
| | | celllist = [selectValuesa[0]]; |
| | | } |
| | | } |
| | | if (selectValuesa[1] != null && selectValuesa[1] != 'undefined') { |
| | | if (selectValuesa[1] != "") { |
| | | stateList = [selectValuesa[1]]; |
| | | } |
| | | } |
| | | console.log(timeRange.value[0], timeRange.value[1]); |
| | | const response = await request.post("/cacheGlass/edgGlassTaskInfo/setEdgGlassInfoRequest", { |
| | | cellList: celllist, |
| | | stateList: stateList, |
| | | beginDate: timeRange.value[0], |
| | | endDate: timeRange.value[1], |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 破损 |
| | | const open = async (row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('workOrder.messagedamaged'), |
| | | t('workOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('workOrder.yes'), |
| | | cancelButtonText: t('workOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { |
| | | glassId: row.glassId, |
| | | state: 8, |
| | | line: row.line, |
| | | workingProcedure: '磨边', |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.msg); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 拿走 |
| | | const opena = async (row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('workOrder.takemessage'), |
| | | t('workOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('workOrder.yes'), |
| | | cancelButtonText: t('workOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | // 用户点击了“是”,现在调用删除接口 |
| | | const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { |
| | | glassId: row.glassId, |
| | | state: 9, |
| | | line: row.line, |
| | | workingProcedure: '磨边', |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | // 删除失败,您可以处理错误或显示错误信息给用户 |
| | | ElMessage.error(response.msg); |
| | | // alert('删除失败:' + deleteResponse.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 处理可能出现的错误,比如 ElMessageBox 抛出的异常等 |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/edgTasks`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableData.value = data.edgTasks[0] |
| | | }; |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | <template> |
| | | <div style="height: 500px;"> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('workOrder.cway')" clearable |
| | | style="margin-left: 20px;margin-bottom: 10px;"> |
| | | <el-option :label="$t('workOrder.edgingone')" value="2001"></el-option> |
| | | <el-option :label="$t('workOrder.edgingtwo')" value="2002"></el-option> |
| | | </el-select> |
| | | |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('workOrder.cstate')" clearable |
| | | style="margin-left: 20px;margin-bottom: 10px;"> |
| | | <el-option :label="$t('workOrder.nedging')" value="0"></el-option> |
| | | <el-option :label="$t('workOrder.edging')" value="1"></el-option> |
| | | <el-option :label="$t('workOrder.finedging')" value="2"></el-option> |
| | | </el-select> |
| | | <span class="demonstration" style="margin-left: 20px;margin-bottom: 10px;">{{ $t('workOrder.time') }}</span> |
| | | <el-date-picker v-model="timeRange" type="datetimerange" range-separator="至" |
| | | :start-placeholder="$t('reportmanage.starttime')" style="margin-left: 20px;margin-bottom: 10px;" |
| | | value-format="YYYY-MM-DD hh:mm:ss" |
| | | |
| | | :end-placeholder="$t('reportmanage.endtime')"> |
| | | </el-date-picker> |
| | | <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="setEdgGlassInfoRequest()">{{ |
| | | $t('reportmanage.inquire') |
| | | }} |
| | | </el-button> |
| | | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="750" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glassId" align="center" :label="$t('workOrder.glassID')" min-width="180"/> |
| | | <el-table-column prop="width" align="center" :label="$t('workOrder.width')" min-width="120"/> |
| | | <el-table-column prop="height" align="center" :label="$t('workOrder.height')" min-width="80"/> |
| | | <el-table-column prop="thickness" align="center" :label="$t('workOrder.thickness')" min-width="120"/> |
| | | <el-table-column prop="glassType" align="center" :label="$t('workOrder.glasstype')" min-width="120"/> |
| | | <el-table-column prop="line" align="center" :label="$t('workOrder.line')" min-width="120"/> |
| | | <el-table-column prop="status" :label="$t('workOrder.status')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | {{ scope.row.status == 0 ? "未磨边" : scope.row.status == 1 ? "磨边中" : "已磨边" }} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | |
| | | <el-table-column fixed="right" :label="$t('workOrder.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="open(scope.row)">{{ |
| | | $t('workOrder.breakage') |
| | | }} |
| | | </el-button> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ |
| | | $t('workOrder.takeout') |
| | | }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #dt { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | #dta { |
| | | display: block; |
| | | float: left; |
| | | line-height: 20px; |
| | | margin-left: 80%; |
| | | } |
| | | |
| | | #dialog-footer { |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | |
| | | #message { |
| | | text-align: center; |
| | | align-items: center; |
| | | color: black; |
| | | width: 200px; |
| | | height: 100px; |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | |
| | | #awatch { |
| | | height: 460px; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | </style> |
| | |
| | | <script setup> |
| | | import { onBeforeUnmount, onMounted, onUnmounted, reactive, ref } from "vue"; |
| | | import { useRouter } from "vue-router" |
| | | import { useI18n } from 'vue-i18n' |
| | | import { ElMessage } from 'element-plus' |
| | | import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {useI18n} from 'vue-i18n' |
| | | import {ElMessage} from 'element-plus' |
| | | import request from "@/utils/request"; |
| | | import { closeWebSocket, initializeWebSocket } from '@/utils/WebSocketService'; |
| | | import { host, WebSocketHost } from '@/utils/constants' |
| | | import PrintFlow from "@/views/UnLoadGlass/PrintFlow.vue"; |
| | | import Landingindication from "./Landingindication.vue"; |
| | | import Landingindicationtwo from "./Landingindicationtwo.vue"; |
| | | import PrintLabel from "@/views/UnLoadGlass/PrintCustomLabelSemi1.vue"; |
| | | |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | |
| | | const router = useRouter() |
| | | const { t } = useI18n() |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const printLoading = ref(true) |
| | | const fullFlowCard = ref('') |
| | |
| | | body.removeChild(style); |
| | | }, 20); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // beforeUnmount(() => { |
| | | // closeWebSocket(); |
| | | // }); |
| | | // setInterval(fetchTableData, 2000) |
| | | </script> |
| | | <template> |
| | | <div> |
| | | <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisibleaDownGlass = true">{{ $t('reportWork.details') }} |
| | | </el-button> |
| | | <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisibleaDownGlasss = true">{{ $t('reportWork.filming') }} |
| | | </el-button> |
| | | <el-switch style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;" v-model="autoPrint" class="mb-2" |
| | | :inactive-text="$t('basicData.printing')" @change="handleChange" /> |
| | | <el-card style="flex: 1;" v-loading="loading"> |
| | | <el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading"> |
| | | <div style="height: 500px;"> |
| | | <div> |
| | | <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisibleaDownGlass = true">{{ $t('reportWork.details') }} |
| | | </el-button> |
| | | <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary" |
| | | @click="dialogFormVisibleaDownGlasss = true">{{ $t('reportWork.filming') }} |
| | | </el-button> |
| | | <el-switch style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;" v-model="autoPrint" class="mb-2" |
| | | :inactive-text="$t('basicData.printing')" @change="handleChange"/> |
| | | <el-card style="flex: 1;" v-loading="loading"> |
| | | <el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="350px" ref="table" @selection-change="handleSelectionChange" :data="tableData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | |
| | | </el-card> |
| | | |
| | | </div> |
| | | |
| | | <el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" :title="$t('reportWork.bindingshelves')"> |
| | | <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="100px"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close> |
| | | <print-flow id="child" :printFlowCardId="printFlowCardId" :printLayer="printLayer" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | <el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close> |
| | | <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" :printGlassId="printGlassId" style="" /> |
| | | </el-dialog> |
| | | |
| | | <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close> |
| | | <print-flow id="child" :printFlowCardId="printFlowCardId" :printLayer="printLayer" |
| | | style="width: 100%;height: 100%"/> |
| | | </el-dialog> |
| | | <el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close> |
| | | <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" |
| | | :printGlassId="printGlassId" style=""/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <style scoped> |
| | | #dt { |
New file |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;" v-loading="loading"> |
| | | <div style="display: flex; flex-direction: row; align-items: center; margin-bottom: 10px;"> |
| | | <el-button id="searchButton" type="success" @click="dialogFormVisiblea = true"> |
| | | {{ $t('hellow.createtask') }} |
| | | </el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinda"> |
| | | {{ $t('hellow.starttask') }} |
| | | </el-button> |
| | | <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBindb">{{ |
| | | $t('hellow.stoptask') |
| | | }} |
| | | </el-button> |
| | | </div> |
| | | <div style="margin-bottom: -5px;margin-left: 5px;"> |
| | | <el-form> |
| | | <el-row> |
| | | <el-col :span="4"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('hellow.currenttask')" style="width: 14vw"> |
| | | {{ temperingtotal }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <div id="dta" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('hellow.claimednumber')" style="width: 14vw"> |
| | | {{ glasstotal }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div id="dt" style="font-size: 15px;"> |
| | | <el-form-item :label="$t('hellow.linenumber')" style="width: 14vw"> |
| | | {{ fulltotals }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="480" ref="table" :data="tableDataa" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.order')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.thickness')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.coatingtypes')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.height')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.width')" align="center"/> |
| | | <el-table-column prop="layoutSequence" :label="$t('hellow.state')" align="center"/> |
| | | </el-table> |
| | | <div style="float: right;"> |
| | | <el-pagination layout="prev, pager, next" :total="50"/> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisiblea" top="5vh" width="85%"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 500px;" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="deviceId" fixed align="center" :label="$t('hellow.cardnumber')" min-width="80"/> |
| | | <el-table-column prop="slot" fixed align="center" :label="$t('hellow.layernumber')" min-width="80"/> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('hellow.thickness')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.coatingtypes')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.totalnumber')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.pairsnumber')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.missingnumber')" min-width="80"/> |
| | | <el-table-column fixed="right" :label="$t('hellow.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="finisha(scope.row)">{{ $t('hellow.claimquest') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="dialogFormVisibleb = true">{{ |
| | | $t('hellow.missingfilms') |
| | | }} |
| | | </el-button> |
| | | <el-button size="mini" type="text" plain @click="finishb(scope.row)">{{ |
| | | $t('hellow.forcedfilming') |
| | | }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleb" top="7vh" width="70%" height="500"> |
| | | <div style="margin-top: -20px;text-align: center;margin-left: 400px;"> |
| | | <el-form-item :label="$t('hellow.cardnumbera')" style="width: 14vw"> |
| | | {{ temperingtotal }} |
| | | </el-form-item> |
| | | </div> |
| | | <el-table ref="table" style="margin-top: 20px;height: 400px;" |
| | | :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="patternWidth" align="center" :label="$t('hellow.thickness')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.coatingtypes')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.height')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.width')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.totalnumber')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.missingnumber')" min-width="80"/> |
| | | <el-table-column prop="patternHeight" align="center" :label="$t('hellow.brokenpieces')" min-width="80"/> |
| | | <div style="float: right;margin-bottom: 5px;"> |
| | | <el-pagination layout="prev, pager, next" :total="50"/> |
| | | </div> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog v-model="blinda" top="30vh" width="25%" :title="$t('hellow.pstarttask')"> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handlea"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="blinda = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="blindb" top="30vh" width="25%" :title="$t('hellow.pstoptask')"> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handlea"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="blindb = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <script setup> |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | import {onBeforeUnmount, onMounted, onUnmounted, ref} from "vue"; |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket} from '@/utils/WebSocketService'; |
| | | import {useI18n} from 'vue-i18n' |
| | | |
| | | const {t} = useI18n() |
| | | const blinda = ref(false) |
| | | const blindb = ref(false) |
| | | const tableDataa = ref([]) |
| | | const tableDatac = ref([]) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | |
| | | const tableDatab = [ |
| | | { |
| | | layoutSequence: 'Tom', |
| | | }, |
| | | { |
| | | layoutSequence: '2016-05-02', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | ] |
| | | let socket = null; |
| | | // const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | // const handleMessage = (data) => { |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completed: rect.completedQuantity, |
| | | // breakage: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | // }; |
| | | // let socket; |
| | | onMounted(() => { |
| | | // socket = new WebSocket(socketUrl); |
| | | // socket.onmessage = (event) => { |
| | | // const data = JSON.parse(event.data); |
| | | |
| | | // // updateCharts(); |
| | | // }; |
| | | // }; |
| | | }); |
| | | // 开始任务 |
| | | const handleBinda = (row) => { |
| | | blinda.value = true; |
| | | }; |
| | | // 停止任务 |
| | | const handleBindb = (row) => { |
| | | blindb.value = true; |
| | | }; |
| | | // 开始任务 |
| | | const handlea = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | console.log(engineeringId); |
| | | if (engineeringId !== '') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/pauseTask', { |
| | | engineeringId: engineeringId, |
| | | state: 0, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('basicData.infonull'), |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 领取任务 |
| | | const finisha = async (row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('hellow.pclaimquest'), |
| | | t('searchOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('searchOrder.yes'), |
| | | cancelButtonText: t('searchOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/finishBigStorageCageDetails", row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 强制出片 |
| | | const finishb = async (row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('hellow.pforcedfilming'), |
| | | t('searchOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('searchOrder.yes'), |
| | | cancelButtonText: t('searchOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/finishBigStorageCageDetails", row) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | onMounted(() => { |
| | | // fetchTableData(); |
| | | // socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | |
| | | <template> |
| | | <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" v-loading="loading"> |
| | | <el-scrollbar height="800px"> |
| | | <div style="font-size: 20px;font-weight: bold;">{{ $t('large.loading') }}{{ temperingtotal }} </div> |
| | | <div id="top" style="height: 150px;display: flex; justify-content: center; align-items: center;"> |
| | | <div class="echarts-container"> |
| | | <div v-for="(processData, index) in processesData" :key="index" class="echarts-item" @click="showDialog"> |
| | | <div :id="'pieChart_' + index" class="pie-chart"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <template> |
| | | <div style="height: 500px;"> |
| | | <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" v-loading="loading"> |
| | | <el-scrollbar height="800px"> |
| | | <div style="font-size: 20px;font-weight: bold;">{{ $t('large.loading') }}{{ temperingtotal }}</div> |
| | | <div id="top" style="height: 150px;display: flex; justify-content: center; align-items: center;"> |
| | | <div class="echarts-container"> |
| | | <div v-for="(processData, index) in processesData" :key="index" class="echarts-item" @click="showDialog"> |
| | | <div :id="'pieChart_' + index" class="pie-chart"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div class="parter" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;"> |
| | | <img src="../../assets/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image"> |
| | | <div class="moving-rect lipiana" v-show="woshia"></div> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="blind" top="10vh" width="70%" > |
| | | <el-date-picker style="margin-left: 1px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" |
| | | :start-placeholder="$t('large.starttime')" :end-placeholder="$t('large.endtime')" :default-time="defaultTime" /> |
| | | <el-button type="primary" style="margin-left: 10px;margin-top: -6px;" @click="selectReportData()">{{ $t('large.inquire') }}</el-button> |
| | | <div style="height: 550px;display: flex;margin-top: 10px;justify-content: center; align-items: center;"> |
| | | <div class="echarts-container"> |
| | | <div v-for="(processData, index) in dialogprocesses" :key="index" class="echarts-item"> |
| | | <div :id="'dialogPieChart_' + index" class="pie-chart"></div> |
| | | <el-date-picker style="margin-left: 1px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" |
| | | :start-placeholder="$t('large.starttime')" :end-placeholder="$t('large.endtime')" |
| | | :default-time="defaultTime"/> |
| | | <el-button type="primary" style="margin-left: 10px;margin-top: -6px;" @click="selectReportData()"> |
| | | {{ $t('large.inquire') }} |
| | | </el-button> |
| | | <div style="height: 550px;display: flex;margin-top: 10px;justify-content: center; align-items: center;"> |
| | | <div class="echarts-container"> |
| | | <div v-for="(processData, index) in dialogprocesses" :key="index" class="echarts-item"> |
| | | <div :id="'dialogPieChart_' + index" class="pie-chart"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </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,nextTick } from "vue"; |
| | | </template> |
| | | <script setup> |
| | | import {ElMessage} from 'element-plus' |
| | | import {nextTick, onBeforeUnmount, onMounted, onUnmounted, ref} 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() |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | import {useI18n} from 'vue-i18n' |
| | | import * as echarts from 'echarts'; |
| | | |
| | | const {t} = useI18n() |
| | | const tableData = ref([]) |
| | | const tableDatab = ref([]) |
| | | const tableDatac = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const chartRefs = ref([]); |
| | | const adjustedRects = ref([]); |
| | | const chartRefs = ref([]); |
| | | const timeRange = ref([]) |
| | | const flake = ref(false) |
| | | const flakeb = ref(false) |
| | |
| | | assetsDir: 'static', |
| | | parallel: false, |
| | | publicPath: './', |
| | | presets: [ |
| | | // '@vue/cli-plugin-babel/preset', |
| | | '@vue/app', |
| | | [ |
| | | '@babel/preset-env', |
| | | { |
| | | useBuiltIns: 'entry' |
| | | } |
| | | ] |
| | | ], |
| | | sourceType: 'unambiguous', |
| | | |
| | | }; |
| | |
| | | * A09出片目标位置 d02卧转立 钢化出片 3001 |
| | | * A10出片目标位置 d05卧转立 人工出片 3002 |
| | | */ |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 3001; |
| | | public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 3002; |
| | | // public static final Integer TEMPERING_OUT_TARGET_POSITION = 3001; |
| | | // public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 3002; |
| | | // public static final List<Integer> OUT_TARGET_POSITION_ALL = Arrays.asList(3001, 3002); |
| | | |
| | | /** |
| | | * 义乌磨边线 |
| | | * A09出片目标位置 d02卧转立 钢化出片 930 |
| | | * A10出片目标位置 d05卧转立 人工出片 931 |
| | | */ |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 930; |
| | | public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 931; |
| | | public static final List<Integer> OUT_TARGET_POSITION_ALL = Arrays.asList(930, 931); |
| | | |
| | | /** |
| | | * 卧式理片笼详情表玻璃状态 |
| | |
| | | public static final Integer EDG_GLASS_SUCCESS = 2; |
| | | |
| | | /** |
| | | * 磨边任务玻璃状态 |
| | | * 大理片笼状态 |
| | | * 1单机自动状态 |
| | | * 2联机自动状态 |
| | | * 3手动状态 |
| | |
| | | public static final Integer BIG_STORAGE_STAND_ALONE = 1; |
| | | public static final Integer BIG_STORAGE_ONLINE = 2; |
| | | public static final Integer BIG_STORAGE_MT = 3; |
| | | |
| | | /** |
| | | * 大理片笼任务类型 |
| | | * 1、钢化前进片 |
| | | * 2、钢化前出片 |
| | | * 3、钢化后进片 |
| | | * 4、钢化后出片 |
| | | */ |
| | | public static final Integer BIG_STORAGE_BEFORE_IN = 1; |
| | | public static final Integer BIG_STORAGE_BEFORE_OUT = 2; |
| | | public static final Integer BIG_STORAGE_BEFORE_DISPATCH = 3; |
| | | public static final Integer BIG_STORAGE_AFTER_IN = 4; |
| | | public static final Integer BIG_STORAGE_AFTER_OUT = 5; |
| | | public static final Integer BIG_STORAGE_AFTER_DISPATCH = 6; |
| | | |
| | | /** |
| | | * 大理片笼请求 |
| | |
| | | public static final Integer LOAD_RAW_GLASS_NEW = 0; |
| | | public static final Integer LOAD_RAW_GLASS_SUCCESS = 100; |
| | | |
| | | /** |
| | | * 大理片笼任务启动信号 |
| | | * 0 空任务 |
| | | * 1 启动 |
| | | */ |
| | | public static final Integer BIG_STORAGE_TASK_EMPTY = 0; |
| | | public static final Integer BIG_STORAGE_TASK_RUNNING = 1; |
| | | |
| | | } |
| | |
| | | * 备注 |
| | | */ |
| | | private String notes; |
| | | |
| | | /** |
| | | * 上片机线路 |
| | | */ |
| | | private int stationCell; |
| | | private Integer stationCell; |
| | | |
| | | |
| | | /** |
| | | * 除膜方式 |
| | | */ |
| | | private Integer filmRemove; |
| | | } |
File was renamed from hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/opctask/entity/LoadGlassDeviceTask.java |
| | |
| | | /** |
| | | * 任务状态 0默认空任务 1执行中 2结束任务 |
| | | */ |
| | | private Integer inkageState; |
| | | /** |
| | | * 任务状态 0默认空任务 1执行中 2结束任务 |
| | | */ |
| | | private Integer taskState; |
| | | /** |
| | | * 创建时间 |
| | |
| | | @TableField("strRemark") |
| | | private String strRemark; |
| | | |
| | | public double getWidth() |
| | | { |
| | | return width; |
| | | } |
| | | |
| | | public double getHeigth() |
| | | { |
| | | return height; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | // /** |
| | | // * 除膜方式 |
| | | // */ |
| | | // private Integer filmRemove; |
| | | // |
| | | // /** |
| | | // * 设备 |
| | | // */ |
| | | // private Integer stationCell; |
| | | /** |
| | | * 预留,使用需注明 |
| | | */ |
| | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeHeatDetail; |
| | | import com.mes.pp.entity.OptimizeHeatLayout; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface OptimizeHeatDetailService extends MPJBaseService<OptimizeHeatDetail> { |
| | | |
| | | /** |
| | | * 返回指定工程 指定版图号的小片玻璃信息 |
| | | * @return |
| | | */ |
| | | List<OptimizeHeatDetail> selectHeatDetailGlassInfo(String engineerId, Integer temperingid); |
| | | } |
| | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeHeatLayout; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-04-16 |
| | | */ |
| | | public interface OptimizeHeatLayoutService extends MPJBaseService<OptimizeHeatLayout> { |
| | | |
| | | /** |
| | | * 返回指定工程 指定版图号的版图信息 |
| | | * @return |
| | | */ |
| | | OptimizeHeatLayout selectHeatLayoutInfo(String engineerId,Integer temperingid); |
| | | } |
| | |
| | | package com.mes.pp.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeHeatDetail; |
| | | import com.mes.pp.entity.OptimizeHeatLayout; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.pp.mapper.OptimizeHeatDetailMapper; |
| | | import com.mes.pp.service.OptimizeDetailService; |
| | | import com.mes.pp.service.OptimizeHeatDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @DS("pp") |
| | | public class OptimizeHeatDetailServiceImpl extends MPJBaseServiceImpl<OptimizeHeatDetailMapper, OptimizeHeatDetail> implements OptimizeHeatDetailService { |
| | | |
| | | @Override |
| | | public List<OptimizeHeatDetail> selectHeatDetailGlassInfo(String engineerId, Integer temperingid) { |
| | | QueryWrapper<OptimizeHeatDetail> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("project_no", engineerId) |
| | | .eq("layout_id", temperingid) |
| | | .orderByAsc("sort"); |
| | | return baseMapper.selectList(wrapper); |
| | | } |
| | | } |
| | |
| | | package com.mes.pp.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeHeatLayout; |
| | |
| | | import com.mes.pp.mapper.OptimizeHeatLayoutMapper; |
| | | import com.mes.pp.service.OptimizeDetailService; |
| | | import com.mes.pp.service.OptimizeHeatLayoutService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @DS("pp") |
| | | public class OptimizeHeatLayoutServiceImpl extends MPJBaseServiceImpl<OptimizeHeatLayoutMapper, OptimizeHeatLayout> implements OptimizeHeatLayoutService { |
| | | |
| | | |
| | | |
| | | @Override |
| | | public OptimizeHeatLayout selectHeatLayoutInfo(String engineerId, Integer temperingid) { |
| | | |
| | | QueryWrapper<OptimizeHeatLayout> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("Top 1 *").eq("project_no", engineerId) |
| | | .eq("layout_id", temperingid); |
| | | return baseMapper.selectOne(wrapper); |
| | | } |
| | | } |
| | |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<Integer> listBySlotState(@Param("leftingStation") List<Integer> liftingStation, @Param("state") List<Integer> state); |
| | | List<RawGlassStorageDetails> listBySlotState(@Param("leftingStation") List<Integer> liftingStation, @Param("state") List<Integer> state); |
| | | } |
| | |
| | | |
| | | String outWarehousing(Long slotId); |
| | | |
| | | List<Integer> listBySlotState(List<Integer> liftingStation, List<Integer> state); |
| | | List<RawGlassStorageDetails> listBySlotState(List<Integer> liftingStation, List<Integer> state); |
| | | |
| | | String warehousingRequest(int leftingStation); |
| | | |
| | |
| | | @Override |
| | | public String warehousingRequest(int leftingStation) { |
| | | RawGlassStorageDetails storageDetails = getOne(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | | .in(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN_ALL)); |
| | | .in(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN_ALL) |
| | | .eq(RawGlassStorageDetails::getSlot, leftingStation)); |
| | | if (null != storageDetails) { |
| | | log.info("当前吊装位有架子,结束本地入库请求"); |
| | | return "fail"; |
| | | } |
| | | List<Integer> shelfList = listBySlotState(Const.RAW_GLASS_DEVICE, Const.RAW_GLASS_STATE_IN_ALL); |
| | | List<RawGlassStorageDetails> shelfList = listBySlotState(Const.RAW_GLASS_DEVICE, Const.RAW_GLASS_STATE_IN_ALL); |
| | | if (CollectionUtils.isEmpty(shelfList)) { |
| | | log.info("当前工位不存在可用的空架子"); |
| | | return "fail"; |
| | | } |
| | | Integer shelf = shelfList.get(0); |
| | | Integer shelf = shelfList.get(0).getSlot(); |
| | | Integer deviceId = shelfList.get(0).getDeviceId(); |
| | | log.info("生成任务"); |
| | | try { |
| | | generateTask(shelf, leftingStation, shelf, 0, Const.RAW_GLASS_TASK_TYPE_IN_REQUEST); |
| | |
| | | RawGlassStorageDetails details = new RawGlassStorageDetails(); |
| | | details.setSlot(shelf); |
| | | details.setShelf(shelf); |
| | | details.setDeviceId(deviceId); |
| | | details.setState(Const.RAW_GLASS_STATE_RUNNING); |
| | | save(details); |
| | | return "success"; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> listBySlotState(List<Integer> liftingStation, List<Integer> state) { |
| | | public List<RawGlassStorageDetails> listBySlotState(List<Integer> liftingStation, List<Integer> state) { |
| | | return baseMapper.listBySlotState(liftingStation, state); |
| | | } |
| | | |
| | |
| | | .shelf(shelf) |
| | | .createTime(new Date()).build(); |
| | | rawGlassStorageTaskService.save(task); |
| | | |
| | | |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | list.add(generateReadWriteEntity("A01-CC.dev.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskSending", 1)); |
| | | list.add(generateReadWriteEntity("A01-CC.dev.startSlot", startSlot)); |
| | | list.add(generateReadWriteEntity("A01-CC.dev.endSlot", endSlot)); |
| | | list.add(generateReadWriteEntity("PLC.CC.taskWord", 1)); |
| | | list.add(generateReadWriteEntity("PLC.CC.startSlot", startSlot)); |
| | | list.add(generateReadWriteEntity("PLC.CC.endSlot", endSlot)); |
| | | miloService.writeToOpcWord(list); |
| | | return Boolean.TRUE; |
| | | } |
New file |
| | |
| | | package com.mes.temperingglass.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * (TemperingGlassInfo)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-18 08:36:18 |
| | | */ |
| | | @Data |
| | | @TableName("tempering_glass_info") |
| | | public class TemperingGlass extends BigStorageCageBaseInfo implements Serializable { |
| | | /** |
| | | * 钢化小片信息表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private String flowCardId; |
| | | /** |
| | | * 流程卡玻璃类型 |
| | | */ |
| | | private Integer glassType; |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | private Double thickness; |
| | | /** |
| | | * 膜系 |
| | | */ |
| | | private String filmsid; |
| | | /** |
| | | * 总层数 |
| | | */ |
| | | private Integer totalLayer; |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private Integer layer; |
| | | /** |
| | | * 钢化是否接受横放 |
| | | */ |
| | | private Integer ishorizontal; |
| | | /** |
| | | * 钢化版图id |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | /** |
| | | * 钢化版图片序 |
| | | */ |
| | | private Integer temperingFeedSequence; |
| | | /** |
| | | * 旋转角度(逆时针) |
| | | */ |
| | | private Integer angle; |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | /** |
| | | * 状态 |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 钢化类型 |
| | | */ |
| | | private Integer temperingType; |
| | | |
| | | private String deleted; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.temperingglass.mapper; |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlass; |
| | | |
| | | /** |
| | | * (TemperingGlassInfo)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-18 08:36:17 |
| | | */ |
| | | public interface TemperingGlassMapper extends MPJBaseMapper<TemperingGlass> { |
| | | |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo); |
| | | /** |
| | | * 根据炉号查钢化版图玻璃信息 |
| | | * @return |
| | | */ |
| | | List<TemperingGlassInfo> selectGlassInfoById(Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.temperingglass.service; |
| | | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.temperingglass.entity.TemperingGlass; |
| | | |
| | | /** |
| | | * (TemperingGlassInfo)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-18 08:36:18 |
| | | */ |
| | | public interface TemperingGlassService extends MPJBaseService<TemperingGlass> { |
| | | |
| | | } |
| | | |
| | |
| | | return 100; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectGlassInfoById(Integer id) |
| | | { |
| | | List<TemperingGlassInfo> result=null; |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("Top 1 *").in("state",1,0).eq("temperingLayoutId",id); |
| | | TemperingGlassInfo glass=temperingMapper.selectOne(wrapper); |
| | | if(glass!=null) { |
| | | QueryWrapper<TemperingGlassInfo> glassinfo = new QueryWrapper<>(); |
| | | glassinfo.eq("engineer_id", glass.getEngineerId()) |
| | | .eq("tempering_layout_id", id); |
| | | //return temperingMapper.selectList(glassinfo); |
| | | result= temperingMapper.selectByEngineerIdAndLayoutId(glass.getEngineerId(),glass.getTemperingLayoutId()); |
| | | } |
| | | return result; |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.temperingglass.service.impl; |
| | | |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.mes.temperingglass.entity.TemperingGlass; |
| | | import com.mes.temperingglass.mapper.TemperingGlassMapper; |
| | | import com.mes.temperingglass.service.TemperingGlassService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (TemperingGlass)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-18 08:36:18 |
| | | */ |
| | | @Service |
| | | public class TemperingGlassServiceImpl extends MPJBaseServiceImpl<TemperingGlassMapper, TemperingGlass> implements TemperingGlassService { |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | private Integer state; |
| | | |
| | | // /** |
| | | // * 除膜方式 |
| | | // */ |
| | | // private Integer filmRemove; |
| | | // |
| | | // /** |
| | | // * 设备 |
| | | // */ |
| | | // private Integer stationCell; |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | public interface UpPattenUsageMapper extends MPJBaseMapper<UpPattenUsage> { |
| | | |
| | | List<UpPattenUsageVO> queryRawGlassByEngineeringId(@Param("engineeringId") String engineerId); |
| | | |
| | | List<Integer> queryFinishByEngineering(@Param("stationCell") Integer deviceId, @Param("finishCount") int finishCount); |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.rawglassdetails.mapper.RawGlassStorageDetailsMapper"> |
| | | |
| | | <select id="listBySlotState" resultType="java.lang.Integer"> |
| | | <resultMap id="baseMap" type="com.mes.rawglassdetails.entity.RawGlassStorageDetails"> |
| | | <result column="DEVICE_ID" property="deviceId"/> |
| | | <result column="SLOT" property="slot"/> |
| | | </resultMap> |
| | | |
| | | <select id="listBySlotState" resultMap="baseMap"> |
| | | SELECT |
| | | T.SLOT |
| | | T.SLOT, |
| | | T.DEVICE_ID |
| | | FROM |
| | | RAW_GLASS_STORAGE_STATION T |
| | | LEFT JOIN RAW_GLASS_STORAGE_DETAILS AS T1 ON T.DEVICE_ID = T1.DEVICE_ID |
| | |
| | | <result column="state" property="state"/> |
| | | <result column="group_number" property="groupNumber"/> |
| | | </resultMap> |
| | | <select id="queryRawGlassByEngineeringId" resultType="com.mes.uppattenusage.entity.vo.UpPattenUsageVO"> |
| | | <select id="queryRawGlassByEngineeringId" resultMap="baseMap"> |
| | | SET @prev_width := NULL; |
| | | SET @prev_height := NULL; |
| | | SET @counter := 0; |
| | | |
| | | SELECT t.*, |
| | | @counter := IF(@prev_width = width and @prev_height = height, @counter, @counter + 1) AS group_number, |
| | | @prev_width := width, |
| | |
| | | and t.state = 0 |
| | | ORDER BY t.layout_sequence |
| | | </select> |
| | | <select id="queryFinishByEngineering" resultType="java.lang.Integer"> |
| | | SELECT id |
| | | FROM up_patten_usage |
| | | WHERE engineering_id IN (SELECT engineer_id FROM engineering WHERE station_cell = #{stationCell} AND state = 1) |
| | | and state = 0 |
| | | order by id |
| | | LIMIT ${finishCount} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | |
| | | @Resource |
| | | BCryptPasswordEncoder passwordEncoder; |
| | | @Autowired |
| | | @Resource |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | |
| | | @Override |
| | |
| | | filters: |
| | | - StripPrefix=2 |
| | | |
| | | |
| | | - id: glassStorage |
| | | uri: lb://glassStorage |
| | | predicates: |
| | |
| | | */ |
| | | public interface EdgStorageCageDetailsMapper extends MPJBaseMapper<EdgStorageCageDetails> { |
| | | |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(double width, double height); |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height); |
| | | } |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | |
| | | /** |
| | | * 获取 切割当前版图 |
| | | * |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> selectCutTerritory(); |
| | | |
| | | /** |
| | | * 获取 工程下的当前版图 |
| | | * |
| | | * @param current |
| | | * @return |
| | | */ |
| | | List<List<Map<String, Object>>> selectCurrentCutTerritory(String current); |
| | | |
| | | /** |
| | | * 获取 工程下的钢化版图 |
| | | * |
| | | * @param current |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询笼内版图差值范围内的 此尺寸玻璃 如无则按照 钢化版图序号 以及玻璃序号 |
| | | * |
| | | * @param glassId |
| | | * @param threshold |
| | | * @return |
| | |
| | | /** |
| | | * 按照尺寸 |
| | | * |
| | | * @param deviceId |
| | | * @param width |
| | | * @param height |
| | | * @return |
| | | */ |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(double width, double height); |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public EdgStorageCageDetails queryEdgStorageDetailsBySize(double width, double height) { |
| | | return baseMapper.queryEdgStorageDetailsBySize(width, height); |
| | | public EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height) { |
| | | return baseMapper.queryEdgStorageDetailsBySize(deviceId, currentSlot, width, height); |
| | | } |
| | | } |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.lang.Assert; |
| | | 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.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.runner.subscription.SubscriptionCallback; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.edgglasstaskqueueinfo.entity.EdgGlassTaskQueueInfo; |
| | | import com.mes.edgglasstaskqueueinfo.service.EdgGlassTaskQueueInfoService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.opctask.entity.EdgStorageDeviceTask; |
| | | import com.mes.opctask.entity.EdgStorageDeviceTaskHistory; |
| | | import com.mes.opctask.service.EdgStorageDeviceTaskHistoryService; |
| | | import com.mes.opctask.service.EdgStorageDeviceTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | MiloService miloService; |
| | | |
| | | |
| | | @Resource(name = "cacheGlassStartCallback") |
| | | SubscriptionCallback cacheGlassStartCallback; |
| | | |
| | | @Resource(name = "cacheGlassTestCallback") |
| | | SubscriptionCallback cacheGlassTestCallback; |
| | | // @Resource(name = "cacheGlassStartCallback") |
| | | // SubscriptionCallback cacheGlassStartCallback; |
| | | // |
| | | // @Resource(name = "cacheGlassTestCallback") |
| | | // SubscriptionCallback cacheGlassTestCallback; |
| | | |
| | | @Resource |
| | | EdgStorageDeviceTaskService edgStorageDeviceTaskService; |
| | | @Resource |
| | | EdgGlassTaskQueueInfoService edgGlassTaskQueueInfoService; |
| | | private int sum = 0; |
| | | @Resource |
| | | GlassInfoService glassInfoService; |
| | | @Resource |
| | | EdgStorageCageDetailsService edgStorageCageDetailsService; |
| | | @Resource |
| | | EdgStorageCageService edgStorageCageService; |
| | | @Resource |
| | | EdgStorageDeviceTaskHistoryService edgStorageDeviceTaskHistoryService; |
| | | |
| | | // @Scheduled(fixedDelay = 10) |
| | | public void startOpcTask() throws Exception { |
| | | // miloService.subscriptionFromOpcUa(Arrays.asList("C101-WL.S7-1200.plc_task_state", "D101-WL.S7-1200.plc_task_state"), cacheGlassStartCallback); |
| | | // miloService.subscriptionFromOpcUa(Arrays.asList("mes.dec.edg_storage_device_one_task[1].task_state", "D101-WL.S7-1200.plc_task_state"), cacheGlassTestCallback); |
| | | // log.info("--------------------s---------------------------"); |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage("edg_storage_device_one_task"); |
| | | @Value("${mes.glassGap}") |
| | | private int glassGap; |
| | | @Value("${mes.threshold}") |
| | | private int threshold; |
| | | @Value("${mes.cellLength}") |
| | | private int cellLength; |
| | | |
| | | private String glassIdOne = ""; |
| | | private String glassIdTwo = ""; |
| | | |
| | | // @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | // public void startOneOpcTask() throws Exception { |
| | | // miloService.subscriptionFromOpcUa(Arrays.asList("mes.WL1.edg_storage_device_one_task[1].task_state"), cacheGlassStartCallback); |
| | | // } |
| | | // |
| | | // @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | // public void startTwoOpcTask() throws Exception { |
| | | // miloService.subscriptionFromOpcUa(Arrays.asList("mes.WL2.edg_storage_device_two_task[1].task_state"), cacheGlassStartCallback); |
| | | // } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void startOneOpcTask() { |
| | | startOneOpcTaskChild(EDG_STORAGE_DEVICE_ONE_TASK, 1); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void startTwoOpcTask() { |
| | | startOneOpcTaskChild(EDG_STORAGE_DEVICE_TWO_TASK, 2); |
| | | } |
| | | |
| | | private void startOneOpcTaskChild(String tableName, int device) { |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(tableName); |
| | | try { |
| | | if (task == null) { |
| | | log.info("任务表基础数据录入失败,请检查数据是否录入成功"); |
| | | return; |
| | | } |
| | | if (task.getTaskState() == sum) { |
| | | return; |
| | | if (task.getTaskState() == 2) { |
| | | //防止出片任务且笼前有玻璃的情况,将进片id置空,即出片仅考虑笼内的玻璃 |
| | | task.setGlassIdIn(""); |
| | | } |
| | | sum = task.getTaskState(); |
| | | task.setTaskRunning(sum); |
| | | log.info("当前第{}次执行", task.getTaskRunning()); |
| | | // task.setTaskState(task.getTaskRunning()); |
| | | edgStorageDeviceTaskService.updateTaskMessage("edg_storage_device_one_task", task); |
| | | int request = task.getTaskState(); |
| | | log.info("开始执行任务,任务请信息为{}", task); |
| | | if (request == 0) { |
| | | log.info("未收到任务请求,结束本次任务"); |
| | | } else if (request == 1) { |
| | | //进片任务 |
| | | log.info("进片任务:进片玻璃id为:{}", task.getGlassIdIn()); |
| | | intoTask(task, tableName, device); |
| | | } else if (request == 2) { |
| | | //出片任务 |
| | | outTask(task, tableName, device); |
| | | } else if (request == 3) { |
| | | //直通任务 |
| | | if (!outTask(task, tableName, device)) { |
| | | intoTask(task, tableName, device); |
| | | } |
| | | } else if (request == 4) { |
| | | log.info("将启动子改为0"); |
| | | task.setTaskRunning(Const.GLASS_CACHE_TYPE_RUNNING); |
| | | edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | } else { |
| | | finishTask(task, tableName); |
| | | } |
| | | } catch (Exception e) { |
| | | log.info("{}", e.getMessage()); |
| | | log.info("执行任务过程中发生异常,任务字{},{}", task.getTaskState(), e.getMessage()); |
| | | log.info("将启动子改为0"); |
| | | task.setTaskState(Const.GLASS_CACHE_TYPE_EMPTY); |
| | | edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | } |
| | | } |
| | | |
| | | // mesControlWord glassId |
| | | // width height |
| | | // thickness filmRemove |
| | | // deviceControlWord deviceWarnState |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void edgOpcTask() throws Exception { |
| | | ReadWriteEntity controlEntity = miloService.readFromOpcUa("A001-MB1.dev.deviceControlWord"); |
| | | String deviceControlWord = (String) controlEntity.getValue(); |
| | | if ("0".equals(deviceControlWord)) { |
| | | ReadWriteEntity messageEntity = miloService.readFromOpcUa("A001-MB1.dev.mesControlWord"); |
| | | String messageValue = (String) messageEntity.getValue(); |
| | | if ("1".equals(messageValue)) { |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | list.add(generateReadWriteEntity("A001-MB1.dev.mesControlWord", 0)); |
| | | miloService.writeToOpcWord(list); |
| | | } |
| | | log.info("当前未收到磨边机的请求任务"); |
| | | return; |
| | | } |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void edgOneOpcTask() throws Exception { |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(EDG_STORAGE_DEVICE_ONE_TASK); |
| | | String glassId = task.getGlassId(); |
| | | if (StringUtils.isBlank(glassId)) { |
| | | log.info("磨边前的架子没有玻璃信息"); |
| | | if (StringUtils.isBlank(glassId) || glassId.equals(glassIdOne)) { |
| | | log.info("{}号线磨边前玻璃未就位,结束本次任务", 1); |
| | | return; |
| | | } |
| | | //获取磨边对列 |
| | | EdgGlassTaskQueueInfo edgInfo = edgGlassTaskQueueInfoService.getOne(new LambdaQueryWrapper<EdgGlassTaskQueueInfo>() |
| | | .eq(EdgGlassTaskQueueInfo::getGlassId, glassId) |
| | | .eq(EdgGlassTaskQueueInfo::getState, Const.GLASS_STATE_NEW)); |
| | | if (edgInfo == null) { |
| | | edgTaskChild(glassId, 1); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void edgTwoOpcTask() throws Exception { |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(EDG_STORAGE_DEVICE_TWO_TASK); |
| | | String glassId = task.getGlassId(); |
| | | if (StringUtils.isBlank(glassId) || glassId.equals(glassIdTwo)) { |
| | | log.info("{}号线磨边前玻璃未就位,结束本次任务", 2); |
| | | return; |
| | | } |
| | | edgTaskChild(glassId, 2); |
| | | } |
| | | |
| | | private void edgTaskChild(String glassId, int cell) throws Exception { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId).last("limit 1")); |
| | | if (glassInfo == null) { |
| | | log.info("对列表中的玻璃id错误,请检查数据,玻璃id:{}", glassId); |
| | | return; |
| | | } |
| | | String toEndingId = glassInfo.getTemperingLayoutId() + "" + glassInfo.getTemperingFeedSequence(); |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | list.add(generateReadWriteEntity("A001-MB1.dev.mesControlWord", 1)); |
| | | list.add(generateReadWriteEntity("A001-MB1.dev.glassId", glassId)); |
| | | list.add(generateReadWriteEntity("A001-MB1.dev.width", edgInfo.getWidth())); |
| | | list.add(generateReadWriteEntity("A001-MB1.dev.height", edgInfo.getHeight())); |
| | | list.add(generateReadWriteEntity("A001-MB1.dev.thickness", edgInfo.getThickness())); |
| | | list.add(generateReadWriteEntity("A001-MB1.dev.filmRemove", 0)); |
| | | miloService.writeToOpcWord(list); |
| | | // list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".mesControl", true)); |
| | | list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".glassId", Integer.parseInt(toEndingId))); |
| | | list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".toEdingId", Integer.parseInt(toEndingId))); |
| | | list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".width", (int) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))); |
| | | list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".height", (int) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))); |
| | | |
| | | miloService.writeToOpcUa(list); |
| | | miloService.writeToOpcWord(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".thickness", (int) glassInfo.getThickness() * 10)); |
| | | //修改磨边对列中的磨边线路及状态 |
| | | edgGlassTaskQueueInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskQueueInfo>() |
| | | .set(EdgGlassTaskQueueInfo::getLine, cell) |
| | | .set(EdgGlassTaskQueueInfo::getState, Const.EDG_GLASS_START) |
| | | .eq(EdgGlassTaskQueueInfo::getGlassId, glassId) |
| | | .eq(EdgGlassTaskQueueInfo::getState, Const.EDG_GLASS_BEFORE)); |
| | | if (cell == 1) { |
| | | glassIdOne = glassId; |
| | | } else { |
| | | glassIdTwo = glassId; |
| | | } |
| | | |
| | | } |
| | | |
| | | private boolean intoTask(EdgStorageDeviceTask task, String tableName, int deviceId) { |
| | | //获取玻璃的基本信息 |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn())); |
| | | if (null == glassInfo) { |
| | | log.info("进片玻璃信息不存在,玻璃id:{}", task.getGlassIdIn()); |
| | | return Boolean.FALSE; |
| | | } |
| | | //获取当前进片玻璃id和进片格子 相同尺寸可以放下的格子 |
| | | EdgStorageCage edgStorageCage = edgStorageCageService.getEdgStorageCageBySize(deviceId, glassInfo.getWidth(), glassInfo.getHeight(), task.getCurrentCell()); |
| | | if (edgStorageCage == null) { |
| | | log.info("相同尺寸可以放下的格子未找到,格子id:{}", task.getCurrentCell()); |
| | | // SELECT * from edg_storage_cage where device_id = 1 and remain_width > 1000 order by abs(slot - 10) |
| | | List<EdgStorageCage> storageCageList = edgStorageCageService.list(new LambdaQueryWrapper<EdgStorageCage>() |
| | | .eq(EdgStorageCage::getDeviceId, deviceId) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON) |
| | | .ge(EdgStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight())).last("order by abs(slot - " + task.getCurrentCell() + ")")); |
| | | // //直通任务 |
| | | // if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | | // return emptyList.get(0); |
| | | // } |
| | | if (CollectionUtil.isEmpty(storageCageList) || storageCageList.size() == 1) { |
| | | log.info("没有多余的空格子"); |
| | | return Boolean.FALSE; |
| | | } |
| | | edgStorageCage = storageCageList.get(0); |
| | | } |
| | | log.info("4、将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | EdgStorageCageDetails details = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | | details.setState(Const.GLASS_STATE_IN); |
| | | details.setSlot(edgStorageCage.getSlot()); |
| | | details.setDeviceId(edgStorageCage.getDeviceId()); |
| | | edgStorageCageDetailsService.save(details); |
| | | |
| | | //更新任务信息 |
| | | task.setStartCell(edgStorageCage.getSlot()); |
| | | task.setTaskRunning(Const.GLASS_CACHE_TYPE_IN); |
| | | edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | saveHistoryTask(task); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private boolean outTask(EdgStorageDeviceTask task, String tableName, int deviceId) { |
| | | EdgStorageCageDetails edgStorageCageDetails = null; |
| | | //笼内是版图相差是否超过阈值 |
| | | boolean flag = queryMaxMinDiff(threshold); |
| | | if (flag) { |
| | | EdgStorageCageDetails minEdgDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .inSql(EdgStorageCageDetails::getSlot, "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId) |
| | | .orderBy(Boolean.TRUE, Boolean.TRUE, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | | // select * from edg_storage_cage_details where width = 551 and height = 1151 and id in (select min(id ) from edg_storage_cage_details where state = 100 group by slot ) |
| | | edgStorageCageDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getWidth, minEdgDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, minEdgDetails.getHeight()) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .inSql(EdgStorageCageDetails::getId, "select min(id) from edg_storage_cage_details where state = 100 group by slot ") |
| | | .last("order by abs(slot - " + task.getCurrentCell() + ") asc limit 1") |
| | | ); |
| | | //给直通任务 |
| | | if (null == edgStorageCageDetails && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, task.getGlassIdIn()) |
| | | .eq(GlassInfo::getWidth, minEdgDetails.getWidth()) |
| | | .eq(GlassInfo::getHeight, minEdgDetails.getHeight())); |
| | | if (null != glassInInfo) { |
| | | edgStorageCageDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInInfo, edgStorageCageDetails); |
| | | } |
| | | } |
| | | if (null == edgStorageCageDetails) { |
| | | edgStorageCageDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, minEdgDetails.getSlot()) |
| | | .orderByAsc(EdgStorageCageDetails::getId) |
| | | .last("limit 1") |
| | | ); |
| | | } |
| | | } |
| | | if (null == edgStorageCageDetails) { |
| | | // 获取上次任务 |
| | | // 获取历史表中上次任务最后一片尺寸 |
| | | EdgStorageDeviceTaskHistory edgeData = edgStorageDeviceTaskHistoryService.getOne(new LambdaQueryWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_SUCCESS) |
| | | .in(EdgStorageDeviceTaskHistory::getTaskType, Const.GLASS_CACHE_TYPE_OUT, Const.GLASS_CACHE_TYPE_THROUGH) |
| | | .orderByDesc(EdgStorageDeviceTaskHistory::getId).last("limit 1")); |
| | | if (null != edgeData) { |
| | | GlassInfo glassOutInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, edgeData.getGlassIdOut())); |
| | | //笼内的玻璃的尺寸是否和上一次任务一致 |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), glassOutInfo.getWidth(), glassOutInfo.getHeight()); |
| | | if (null == edgStorageCageDetails && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, task.getGlassIdIn()) |
| | | .eq(GlassInfo::getWidth, glassOutInfo.getWidth()) |
| | | .eq(GlassInfo::getHeight, glassOutInfo.getHeight())); |
| | | if (null != glassInInfo) { |
| | | edgStorageCageDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInInfo, edgStorageCageDetails); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (null == edgStorageCageDetails) { |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), 0, 0); |
| | | } |
| | | if (edgStorageCageDetails == null && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | //和上次任务不存在相同尺寸 |
| | | GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn())); |
| | | edgStorageCageDetails = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInInfo, edgStorageCageDetails); |
| | | } |
| | | if (edgStorageCageDetails == null) { |
| | | //和上次任务不存在相同尺寸 |
| | | log.info("笼内没有玻璃了"); |
| | | return Boolean.FALSE; |
| | | } |
| | | int taskType = Const.GLASS_CACHE_TYPE_OUT; |
| | | String glassId = edgStorageCageDetails.getGlassId(); |
| | | if (glassId.equals(task.getGlassIdIn())) { |
| | | if (3 != task.getTaskState()) { |
| | | return Boolean.FALSE; |
| | | } |
| | | log.info("5、直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", edgStorageCageDetails); |
| | | //玻璃信息替换 |
| | | String glassIdChange = queryAndChangeGlass(glassId); |
| | | //处理在卧理内的玻璃信息:笼内的数据处理 |
| | | queryEdgAndChangeGlass(edgStorageCageDetails.getGlassId(), glassIdChange); |
| | | if (StringUtils.isNotBlank(glassIdChange)) { |
| | | edgStorageCageDetails = new EdgStorageCageDetails(); |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | BeanUtils.copyProperties(one, edgStorageCageDetails); |
| | | } |
| | | EdgStorageCage storageCage = edgStorageCageService.getOne(new LambdaQueryWrapper<EdgStorageCage>() |
| | | .eq(EdgStorageCage::getDeviceId, deviceId) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON) |
| | | .ge(EdgStorageCage::getRemainWidth, cellLength) |
| | | .last("order by abs(slot - " + task.getCurrentCell() + ") limit 1")); |
| | | Assert.isTrue(null != storageCage, "格子已满,无法执行直通任务"); |
| | | log.info("3、查询卧式理片笼里面的空格:{}", storageCage); |
| | | edgStorageCageDetails.setSlot(storageCage.getSlot()); |
| | | edgStorageCageDetails.setDeviceId(storageCage.getDeviceId()); |
| | | edgStorageCageDetails.setState(Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.save(edgStorageCageDetails); |
| | | taskType = Const.GLASS_CACHE_TYPE_THROUGH; |
| | | } else { |
| | | log.info("5、非直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", edgStorageCageDetails); |
| | | if (!edgStorageCageDetails.getSlot().equals(task.getCurrentCell())) { |
| | | EdgStorageCageDetails currentGlass = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, task.getCurrentCell()).eq(EdgStorageCageDetails::getWidth, edgStorageCageDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, edgStorageCageDetails.getHeight()).eq(EdgStorageCageDetails::getThickness, edgStorageCageDetails.getThickness()) |
| | | .orderByAsc(EdgStorageCageDetails::getId).last("limit 1") |
| | | ); |
| | | if (null != currentGlass) { |
| | | edgStorageCageDetails = currentGlass; |
| | | } |
| | | } |
| | | //玻璃信息替换 |
| | | String glassIdChange = queryAndChangeGlass(edgStorageCageDetails.getGlassId()); |
| | | //处理在卧理内的玻璃信息:笼内的数据处理 |
| | | queryEdgAndChangeGlass(edgStorageCageDetails.getGlassId(), glassIdChange); |
| | | LambdaUpdateWrapper<EdgStorageCageDetails> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(EdgStorageCageDetails::getGlassId, edgStorageCageDetails.getGlassId()).set(EdgStorageCageDetails::getState, Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.update(wrapper); |
| | | log.info("5、更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT); |
| | | } |
| | | //生成出片任务 |
| | | task.setGlassIdOut(edgStorageCageDetails.getGlassId()); |
| | | task.setStartCell(edgStorageCageDetails.getSlot()); |
| | | task.setTaskRunning(taskType); |
| | | |
| | | edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | saveHistoryTask(task); |
| | | //更新详情表任务出片中 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .set(EdgStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .eq(EdgStorageCageDetails::getGlassId, edgStorageCageDetails.getGlassId())); |
| | | //磨边对列表新增一条数据 |
| | | EdgGlassTaskQueueInfo edgInfo = new EdgGlassTaskQueueInfo(); |
| | | BeanUtils.copyProperties(task, edgInfo); |
| | | edgInfo.setGlassId(edgStorageCageDetails.getGlassId()); |
| | | edgInfo.setCreateTime(new Date()); |
| | | edgInfo.setWidth((int) edgStorageCageDetails.getWidth()); |
| | | edgInfo.setHeight((int) edgStorageCageDetails.getHeight()); |
| | | edgInfo.setThickness((int) edgStorageCageDetails.getThickness()); |
| | | edgInfo.setState(Const.EDG_GLASS_BEFORE); |
| | | edgGlassTaskQueueInfoService.save(edgInfo); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private boolean finishTask(EdgStorageDeviceTask task, String tableName) { |
| | | log.info("当前任务信息为:{}", task); |
| | | if (task.getTaskState() <= 4 && task.getTaskRunning() == 0) { |
| | | log.info("有正在执行的任务或这任务已执行任务状态{},任务启动情况{},结束", task.getTaskState(), task.getTaskRunning()); |
| | | return Boolean.FALSE; |
| | | } |
| | | Integer cell = task.getStartCell(); |
| | | Integer state = task.getTaskState(); |
| | | task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY); |
| | | task.setGlassIdOut(""); |
| | | task.setStartCell(0); |
| | | edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | edgStorageDeviceTaskHistoryService.update(new LambdaUpdateWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | | .set(EdgStorageDeviceTaskHistory::getTaskState, |
| | | Const.GLASS_CACHE_TYPE_FINISH.equals(state) ? Const.RAW_GLASS_TASK_SUCCESS : Const.RAW_GLASS_TASK_FAILURE) |
| | | ); |
| | | int device = tableName.equals("edg_storage_device_one_task") ? 1 : 2; |
| | | updateCellRemainWidth(cell, device); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | /** |
| | | * 查询玻璃并进行交换 |
| | | * |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | public String queryAndChangeGlass(String glassId) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | // .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); //按照玻璃尺寸 |
| | | LambdaQueryWrapper<GlassInfo> queryWrapper = new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getWidth, glassInfo.getWidth()) |
| | | .eq(GlassInfo::getHeight, glassInfo.getHeight()) |
| | | .eq(GlassInfo::getThickness, glassInfo.getThickness()) |
| | | .eq(GlassInfo::getFilmsid, glassInfo.getFilmsid()) |
| | | .eq(GlassInfo::getFlowCardId, glassInfo.getFlowCardId()) |
| | | .eq(GlassInfo::getTotalLayer, glassInfo.getTotalLayer()) |
| | | .eq(GlassInfo::getLayer, glassInfo.getLayer()) |
| | | .eq(GlassInfo::getEngineerId, glassInfo.getEngineerId()) |
| | | .notInSql(GlassInfo::getGlassId, "select distinct glass_id from edg_storage_cage_details " + |
| | | "where engineer_id = '" + glassInfo.getEngineerId() + "' and width = " + glassInfo.getWidth() + " and height = " + glassInfo.getHeight() |
| | | + " and state != 100") |
| | | .orderByAsc(GlassInfo::getTemperingLayoutId) |
| | | .orderBy(Boolean.TRUE, Boolean.TRUE, GlassInfo::getTemperingFeedSequence) |
| | | .last("Limit 1"); |
| | | GlassInfo swapGlassInfo = glassInfoService.getOne(queryWrapper); |
| | | if (swapGlassInfo != null && !glassInfo.getGlassId().equals(swapGlassInfo.getGlassId())) { |
| | | String swapGlassId = swapGlassInfo.getGlassId(); |
| | | log.info("将玻璃{}和玻璃{},信息互换,进玻璃 {}", glassInfo, swapGlassInfo, swapGlassInfo); |
| | | swapGlassInfo.setGlassId(glassId); |
| | | glassInfo.setGlassId(swapGlassId); |
| | | glassInfoService.updateById(swapGlassInfo); |
| | | glassInfoService.updateById(glassInfo); |
| | | return swapGlassId; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询卧式理片玻璃并进行交换 |
| | | * |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | public void queryEdgAndChangeGlass(String glassId, String swapGlassId) { |
| | | if (StringUtils.isBlank(swapGlassId)) { |
| | | log.info("当前出笼玻璃不存在需要替换的玻璃"); |
| | | return; |
| | | } |
| | | //获取待出笼的玻璃 |
| | | EdgStorageCageDetails glassInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId).eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | // 获取待出笼的玻璃需要替换的玻璃信息 |
| | | EdgStorageCageDetails swapGlassDetailInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, swapGlassId).eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | |
| | | // 玻璃小片表中玻璃已经替换,更新卧理笼内现有的准备出笼的玻璃信息, |
| | | if (null == swapGlassDetailInfo) { |
| | | GlassInfo glassInfoBase = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassId)); |
| | | //需要替换的玻璃为存进卧理,仅需更新当前需要出笼的玻璃信息即可 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId) |
| | | .set(EdgStorageCageDetails::getTemperingLayoutId, glassInfoBase.getTemperingLayoutId()) |
| | | .set(EdgStorageCageDetails::getTemperingFeedSequence, glassInfoBase.getTemperingFeedSequence())); |
| | | } else { |
| | | //需要替换的玻璃都在卧理内,按照玻璃id对调玻璃信息:对调玻璃id即可 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getId, glassInfo.getId()) |
| | | .set(EdgStorageCageDetails::getTemperingLayoutId, swapGlassDetailInfo.getTemperingLayoutId()) |
| | | .set(EdgStorageCageDetails::getTemperingFeedSequence, swapGlassDetailInfo.getTemperingFeedSequence()) |
| | | ); |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getId, swapGlassDetailInfo.getId()) |
| | | .set(EdgStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .set(EdgStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence()) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取详情表内最大最小版图id的差值,判断是否出最小版图玻璃 |
| | | * |
| | | * @return |
| | | */ |
| | | public boolean queryMaxMinDiff(int threshold) { |
| | | //获取笼子内最大版图id和最小版图id插值,判断是否大于阈值,大于阈值直接出最小版图玻璃 |
| | | QueryWrapper<EdgStorageCageDetails> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("max(tempering_layout_id)-min(tempering_layout_id) as diff") |
| | | .eq("state", Const.GLASS_STATE_IN) |
| | | .inSql("slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON); |
| | | List<Object> list = edgStorageCageDetailsService.listObjs(queryWrapper); |
| | | //获取笼内玻璃版图差值是否大于阈值 |
| | | if (CollectionUtil.isNotEmpty(list)) { |
| | | Long diff = (Long) list.get(0); |
| | | return diff > threshold; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | } |
| | | } |
| | | |
| | | public boolean saveHistoryTask(EdgStorageDeviceTask task) { |
| | | EdgStorageDeviceTaskHistory taskHistory = new EdgStorageDeviceTaskHistory(); |
| | | BeanUtils.copyProperties(task, taskHistory); |
| | | taskHistory.setTaskType(task.getTaskRunning()); |
| | | taskHistory.setCreateTime(new Date()); |
| | | taskHistory.setTaskState(Const.RAW_GLASS_TASK_NEW); |
| | | edgStorageDeviceTaskHistoryService.save(taskHistory); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private boolean updateCellRemainWidth(int slot, int device) { |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot, slot) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | int remainWidth = cellLength; |
| | | if (CollectionUtil.isNotEmpty(list)) { |
| | | int widthTotal = (int) list.stream().map(e -> Math.max(e.getWidth(), e.getHeight()) + glassGap).mapToDouble(Double::intValue).sum(); |
| | | remainWidth = cellLength - widthTotal >= 0 ? cellLength - widthTotal : 0; |
| | | } |
| | | edgStorageCageService.update(new LambdaUpdateWrapper<EdgStorageCage>(). |
| | | set(EdgStorageCage::getRemainWidth, remainWidth).eq(EdgStorageCage::getSlot, slot).eq(EdgStorageCage::getDeviceId, device)); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private ReadWriteEntity generateReadWriteEntity(String identifier, Object value) { |
| | | ReadWriteEntity readWriteEntity = new ReadWriteEntity(); |
| | | readWriteEntity.setIdentifier(identifier); |
| | | readWriteEntity.setValue(value); |
| | | return readWriteEntity; |
| | | return ReadWriteEntity.builder() |
| | | .identifier(identifier) |
| | | //Kep中是Long类型,即:Int32,Java中的int类型 |
| | | .value(value) |
| | | .build(); |
| | | } |
| | | } |
| | |
| | | @Value("${mes.cellLength}") |
| | | private int cellLength; |
| | | |
| | | private Date startDate; |
| | | |
| | | @Override |
| | | public void onSubscribe(String identifier, Object value) { |
| | | |
| | | log.info("当前正在执行的任务为{}", value); |
| | | String tableName = identifier.contains("edg_storage_device_one_task") ? EDG_STORAGE_DEVICE_ONE_TASK : EDG_STORAGE_DEVICE_TWO_TASK; |
| | | int device = tableName.equals("edg_storage_device_one_task") ? 1 : 2; |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(tableName); |
| | | try { |
| | | if (task == null) { |
| | | log.info("任务表基础数据录入失败,请检查数据是否录入成功"); |
| | | return; |
| | | } |
| | | int request = task.getTaskState(); |
| | | if (task.getTaskState() == 2) { |
| | | //防止出片任务且笼前有玻璃的情况,将进片id置空,即出片仅考虑笼内的玻璃 |
| | | task.setGlassIdIn(""); |
| | | } |
| | | int request = Integer.parseInt("" + value); |
| | | log.info("开始执行任务,任务请信息为{}", task); |
| | | if (request == 0) { |
| | | log.info("未收到任务请求,结束本次任务"); |
| | | } else if (request == 1) { |
| | | //进片任务 |
| | | intoTask(task, tableName); |
| | | log.info("进片任务:进片玻璃id为:{}", task.getGlassIdIn()); |
| | | intoTask(task, tableName, device); |
| | | } else if (request == 2) { |
| | | //出片任务 |
| | | outTask(task, tableName); |
| | | outTask(task, tableName, device); |
| | | } else if (request == 3) { |
| | | //直通任务 |
| | | if (!outTask(task, tableName)) { |
| | | intoTask(task, tableName); |
| | | if (!outTask(task, tableName, device)) { |
| | | intoTask(task, tableName, device); |
| | | } |
| | | } else if (request == 4) { |
| | | log.info("将启动子改为0"); |
| | |
| | | } |
| | | } |
| | | |
| | | private boolean intoTask(EdgStorageDeviceTask task, String tableName) { |
| | | private boolean intoTask(EdgStorageDeviceTask task, String tableName, int deviceId) { |
| | | //获取玻璃的基本信息 |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn())); |
| | | if (null == glassInfo) { |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | //获取当前进片玻璃id和进片格子 相同尺寸可以放下的格子 |
| | | EdgStorageCage edgStorageCage = edgStorageCageService.getEdgStorageCageBySize(1, glassInfo.getWidth(), glassInfo.getHeight(), task.getCurrentCell()); |
| | | EdgStorageCage edgStorageCage = edgStorageCageService.getEdgStorageCageBySize(deviceId, glassInfo.getWidth(), glassInfo.getHeight(), task.getCurrentCell()); |
| | | if (edgStorageCage == null) { |
| | | log.info("相同尺寸可以放下的格子未找到,格子id:{}", task.getCurrentCell()); |
| | | // SELECT * from edg_storage_cage where device_id = 1 and remain_width > 1000 order by abs(slot - 10) |
| | | List<EdgStorageCage> storageCageList = edgStorageCageService.list(new LambdaQueryWrapper<EdgStorageCage>().eq(EdgStorageCage::getDeviceId, 1) |
| | | List<EdgStorageCage> storageCageList = edgStorageCageService.list(new LambdaQueryWrapper<EdgStorageCage>() |
| | | .eq(EdgStorageCage::getDeviceId, deviceId) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON) |
| | | .ge(EdgStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight())).last("order by abs(slot - " + task.getCurrentCell() + ")")); |
| | | // //直通任务 |
| | |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private boolean outTask(EdgStorageDeviceTask task, String tableName) { |
| | | private boolean outTask(EdgStorageDeviceTask task, String tableName, int deviceId) { |
| | | EdgStorageCageDetails edgStorageCageDetails = null; |
| | | //笼内是版图相差是否超过阈值 |
| | | boolean flag = queryMaxMinDiff(threshold); |
| | |
| | | EdgStorageCageDetails minEdgDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .inSql(EdgStorageCageDetails::getSlot, "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId) |
| | | .orderBy(Boolean.TRUE, Boolean.TRUE, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | |
| | | edgStorageCageDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getWidth, minEdgDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, minEdgDetails.getHeight()) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .inSql(EdgStorageCageDetails::getId, "select min(id) from edg_storage_cage_details where state = 100 group by slot ") |
| | | .last("order by abs(slot - " + task.getCurrentCell() + ") asc limit 1") |
| | | ); |
| | |
| | | if (null == edgStorageCageDetails) { |
| | | edgStorageCageDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, minEdgDetails.getSlot()) |
| | | .orderByAsc(EdgStorageCageDetails::getId) |
| | | .last("limit 1") |
| | |
| | | if (null != edgeData) { |
| | | GlassInfo glassOutInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, edgeData.getGlassIdOut())); |
| | | //笼内的玻璃的尺寸是否和上一次任务一致 |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(glassOutInfo.getWidth(), glassOutInfo.getHeight()); |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), glassOutInfo.getWidth(), glassOutInfo.getHeight()); |
| | | if (null == edgStorageCageDetails && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, task.getGlassIdIn()) |
| | |
| | | } |
| | | } |
| | | if (null == edgStorageCageDetails) { |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(0, 0); |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), 0, 0); |
| | | } |
| | | if (edgStorageCageDetails == null && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | //和上次任务不存在相同尺寸 |
| | |
| | | int taskType = Const.GLASS_CACHE_TYPE_OUT; |
| | | String glassId = edgStorageCageDetails.getGlassId(); |
| | | if (glassId.equals(task.getGlassIdIn())) { |
| | | if (3 != task.getTaskState()) { |
| | | return Boolean.FALSE; |
| | | } |
| | | log.info("5、直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", edgStorageCageDetails); |
| | | //玻璃信息替换 |
| | | String glassIdChange = queryAndChangeGlass(glassId); |
| | | //处理在卧理内的玻璃信息:笼内的数据处理 |
| | | queryEdgAndChangeGlass(edgStorageCageDetails.getGlassId(), glassIdChange); |
| | | if (StringUtils.isNotBlank(glassIdChange)) { |
| | | edgStorageCageDetails = new EdgStorageCageDetails(); |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | BeanUtils.copyProperties(one, edgStorageCageDetails); |
| | | } |
| | | EdgStorageCage storageCage = edgStorageCageService.getOne(new LambdaQueryWrapper<EdgStorageCage>().eq(EdgStorageCage::getDeviceId, 1) |
| | | EdgStorageCage storageCage = edgStorageCageService.getOne(new LambdaQueryWrapper<EdgStorageCage>() |
| | | .eq(EdgStorageCage::getDeviceId, deviceId) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON) |
| | | .ge(EdgStorageCage::getRemainWidth, cellLength).last("order by abs(slot - " + task.getCurrentCell() + ")") |
| | | .last("limit 1")); |
| | | .ge(EdgStorageCage::getRemainWidth, cellLength) |
| | | .last("order by abs(slot - " + task.getCurrentCell() + ") limit 1")); |
| | | Assert.isTrue(null != storageCage, "格子已满,无法执行直通任务"); |
| | | log.info("3、查询卧式理片笼里面的空格:{}", storageCage); |
| | | edgStorageCageDetails.setSlot(storageCage.getSlot()); |
| | | edgStorageCageDetails.setDeviceId(storageCage.getDeviceId()); |
| | | edgStorageCageDetails.setState(Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.save(edgStorageCageDetails); |
| | | taskType = Const.GLASS_CACHE_TYPE_THROUGH; |
| | |
| | | if (!edgStorageCageDetails.getSlot().equals(task.getCurrentCell())) { |
| | | EdgStorageCageDetails currentGlass = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getDeviceId, deviceId) |
| | | .eq(EdgStorageCageDetails::getSlot, task.getCurrentCell()).eq(EdgStorageCageDetails::getWidth, edgStorageCageDetails.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, edgStorageCageDetails.getHeight()).eq(EdgStorageCageDetails::getThickness, edgStorageCageDetails.getThickness()) |
| | | .orderByAsc(EdgStorageCageDetails::getId).last("limit 1") |
| | | ); |
| | | if (null != currentGlass) { |
| | | edgStorageCageDetails = currentGlass; |
| | |
| | | edgStorageCageDetailsService.update(wrapper); |
| | | log.info("5、更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT); |
| | | } |
| | | |
| | | //玻璃信息替换 |
| | | // String glassIdChange = queryAndChangeGlass(edgStorageCageDetails.getGlassId()); |
| | | //处理在卧理内的玻璃信息:笼内的数据处理 |
| | | // queryEdgAndChangeGlass(edgStorageCageDetails.getGlassId(), glassIdChange); |
| | | //生成出片任务 |
| | | task.setGlassIdOut(edgStorageCageDetails.getGlassId()); |
| | | task.setStartCell(edgStorageCageDetails.getSlot()); |
| | | task.setTaskRunning(taskType); |
| | | task.setWidth((int) edgStorageCageDetails.getWidth() * 10); |
| | | task.setHeight((int) edgStorageCageDetails.getHeight() * 10); |
| | | task.setThickness((int) edgStorageCageDetails.getThickness() * 10); |
| | | task.setFilmRemove(0); |
| | | |
| | | edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | saveHistoryTask(task); |
| | | //更新详情表任务出片中 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .set(EdgStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .eq(EdgStorageCageDetails::getGlassId, edgStorageCageDetails.getGlassId())); |
| | | //todo:磨边对列表新增一条数据 |
| | | //磨边对列表新增一条数据 |
| | | EdgGlassTaskQueueInfo edgInfo = new EdgGlassTaskQueueInfo(); |
| | | BeanUtils.copyProperties(task, edgInfo); |
| | | edgInfo.setCreateTime(new Date()); |
| | | edgInfo.setWidth((int) edgStorageCageDetails.getWidth()); |
| | | edgInfo.setHeight((int) edgStorageCageDetails.getWidth()); |
| | | edgInfo.setThickness((int) edgStorageCageDetails.getWidth()); |
| | | edgInfo.setState(Const.GLASS_STATE_NEW); |
| | | edgGlassTaskQueueInfoService.save(edgInfo); |
| | | return Boolean.TRUE; |
| | |
| | | Integer cell = task.getStartCell(); |
| | | Integer state = task.getTaskState(); |
| | | task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY); |
| | | // task.setTaskState(Const.GLASS_CACHE_TYPE_EMPTY); |
| | | task.setGlassIdOut(""); |
| | | task.setStartCell(0); |
| | | task.setWidth(0); |
| | | task.setHeight(0); |
| | | task.setThickness(0); |
| | | task.setFilmRemove(0); |
| | | edgStorageDeviceTaskService.updateTaskMessage(tableName, task); |
| | | edgStorageDeviceTaskHistoryService.update(new LambdaUpdateWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | | .set(EdgStorageDeviceTaskHistory::getTaskState, |
| | | Const.GLASS_CACHE_TYPE_FINISH.equals(state) ? Const.RAW_GLASS_TASK_SUCCESS : Const.RAW_GLASS_TASK_FAILURE) |
| | | ); |
| | | updateCellRemainWidth(cell); |
| | | int device = tableName.equals("edg_storage_device_one_task") ? 1 : 2; |
| | | updateCellRemainWidth(cell, device); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | private boolean updateCellRemainWidth(int slot) { |
| | | private boolean updateCellRemainWidth(int slot, int device) { |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot, slot) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | int remainWidth = cellLength; |
| | |
| | | remainWidth = cellLength - widthTotal >= 0 ? cellLength - widthTotal : 0; |
| | | } |
| | | edgStorageCageService.update(new LambdaUpdateWrapper<EdgStorageCage>(). |
| | | set(EdgStorageCage::getRemainWidth, remainWidth).eq(EdgStorageCage::getSlot, slot)); |
| | | set(EdgStorageCage::getRemainWidth, remainWidth).eq(EdgStorageCage::getSlot, slot).eq(EdgStorageCage::getDeviceId, device)); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String glassId; |
| | | /** |
| | | * 是否就位 |
| | | */ |
| | | private Integer inPlace; |
| | | /** |
| | | * 进片玻璃id |
| | | */ |
| | | private String glassIdIn; |
| | |
| | | * 任务类型 |
| | | */ |
| | | private Integer taskType; |
| | | /** |
| | | * 宽 |
| | | */ |
| | | private Integer width; |
| | | /** |
| | | * 高 |
| | | */ |
| | | private Integer height; |
| | | /** |
| | | * 厚 |
| | | */ |
| | | private Integer thickness; |
| | | /** |
| | | * 是否除膜 |
| | | */ |
| | | private Integer filmRemove; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | |
| | | } |
| | |
| | | select slot, min(id) as id, count(*) as glass_count |
| | | from edg_storage_cage_details |
| | | where state = 100 |
| | | and device_id = #{deviceId} |
| | | group by slot |
| | | ), |
| | | size_max_temp as ( |
| | |
| | | and t.height = #{height} |
| | | </if> |
| | | </where> |
| | | order by total_count desc, glass_count, abs(t.slot - 10) |
| | | order by total_count desc, glass_count, abs(t.slot - #{currentSlot}) |
| | | ) |
| | | select * |
| | | from slot_temp limit 1 |
| | |
| | | left join edg_storage_cage_details t1 on t.slot = t1.slot |
| | | where t.device_id = #{deviceId} |
| | | and t1.state = 100 |
| | | and t.remain_width >= #{width} |
| | | and t.remain_width >= GREATEST(#{width}, #{height}) |
| | | and t1.width = #{width} |
| | | and t1.height = #{height} |
| | | and t.enable_state = 1 |
| | |
| | | |
| | | <resultMap id="baseMap" type="com.mes.opctask.entity.EdgStorageDeviceTask"> |
| | | <id column="task_running" property="taskRunning"/> |
| | | <id column="glass_id" property="glassId"/> |
| | | <id column="in_place" property="inPlace"/> |
| | | <id column="glass_id_in" property="glassIdIn"/> |
| | | <id column="glass_id_out" property="glassIdOut"/> |
| | | <id column="current_cell" property="currentCell"/> |
| | |
| | | <id column="task_state" property="taskState"/> |
| | | <id column="create_time" property="createTime"/> |
| | | <id column="update_time" property="updateTime"/> |
| | | <id column="width" property="width"/> |
| | | <id column="height" property="height"/> |
| | | <id column="thickness" property="thickness"/> |
| | | <id column="film_remove" property="filmRemove"/> |
| | | </resultMap> |
| | | |
| | | <select id="queryTaskMessage" resultMap="baseMap"> |
| | |
| | | glass_id_out = #{task.glassIdOut}, |
| | | current_cell = #{task.currentCell}, |
| | | start_cell = #{task.startCell}, |
| | | end_cell = #{task.endCell}, |
| | | width = #{task.width}, |
| | | height = #{task.height}, |
| | | thickness = #{task.thickness}, |
| | | film_remove = #{task.filmRemove} |
| | | end_cell = #{task.endCell} |
| | | <if test="task.taskState == 0"> |
| | | ,task_state = #{task.taskState} |
| | | </if> |
| | |
| | | */ |
| | | private Integer temperingLayoutId; |
| | | /** |
| | | * 玻璃数量 |
| | | */ |
| | | private Integer glassCount; |
| | | /** |
| | | * 大理片详情中格子号 |
| | | */ |
| | | private Integer slot; |
New file |
| | |
| | | package com.mes.bigstoragecagetask.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (BigStorageCageHistoryTask)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-13 22:46:49 |
| | | */ |
| | | @Data |
| | | public class BigStorageCageHistoryTask { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | /** |
| | | * 起始格子 |
| | | */ |
| | | private Integer startSlot; |
| | | /** |
| | | * 目标格子 |
| | | */ |
| | | private Integer targetSlot; |
| | | /** |
| | | * 任务状态 |
| | | */ |
| | | private Integer taskState; |
| | | /** |
| | | * 玻璃数量 |
| | | */ |
| | | private Integer glassCount; |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | private Integer taskType; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateTime; |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.bigstoragecagetask.entity; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * (BigStorageCageInOneTask)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-08 21:40:17 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | public class BigStorageCageTask { |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | /** |
| | | * 起始格子 |
| | | */ |
| | | private Integer startSlot; |
| | | /** |
| | | * 目标格子 |
| | | */ |
| | | private Integer targetSlot; |
| | | /** |
| | | * 任务状态 |
| | | */ |
| | | private Integer taskState; |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.bigstoragecagetask.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | |
| | | /** |
| | | * (BigStorageCageHistoryTask)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-13 22:46:47 |
| | | */ |
| | | public interface BigStorageCageHistoryTaskMapper extends BaseMapper<BigStorageCageHistoryTask> { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.bigstoragecagetask.mapper; |
| | | |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (BigStorageCageInOneTask)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-08 21:40:15 |
| | | */ |
| | | public interface BigStorageCageTaskMapper { |
| | | |
| | | List<BigStorageCageTask> queryTaskMessage(String tableName); |
| | | |
| | | boolean updateTaskMessage(@Param("tableName") String tableName, @Param("task") BigStorageCageTask bigStorageCageInTask); |
| | | |
| | | int saveTaskMessage(@Param("tableName") String tableName, @Param("list") List<BigStorageCageTask> taskList); |
| | | |
| | | int removeAll(String tableName); |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.bigstoragecagetask.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | |
| | | /** |
| | | * (BigStorageCageHistoryTask)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-13 22:46:53 |
| | | */ |
| | | public interface BigStorageCageHistoryTaskService extends IService<BigStorageCageHistoryTask> { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.bigstoragecagetask.service; |
| | | |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (BigStorageCageInOneTask)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-08 21:40:20 |
| | | */ |
| | | public interface BigStorageCageTaskService { |
| | | |
| | | |
| | | List<BigStorageCageTask> queryTaskMessage(String tableName); |
| | | |
| | | boolean updateTaskMessage(@Param("tableName") String tableName, @Param("task") BigStorageCageTask bigStorageCageInTask); |
| | | |
| | | int saveTaskMessage(@Param("tableName") String tableName, List<BigStorageCageTask> taskList); |
| | | |
| | | int removeAll(@Param("tableName") String tableName); |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.bigstoragecagetask.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.bigstoragecagetask.mapper.BigStorageCageHistoryTaskMapper; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (BigStorageCageHistoryTask)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-13 22:46:56 |
| | | */ |
| | | @Service |
| | | public class BigStorageCageHistoryTaskServiceImpl extends ServiceImpl<BigStorageCageHistoryTaskMapper, BigStorageCageHistoryTask> implements BigStorageCageHistoryTaskService { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.bigstoragecagetask.service.impl; |
| | | |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import com.mes.bigstoragecagetask.mapper.BigStorageCageTaskMapper; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (BigStorageCageInOneTask)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-11-08 21:40:23 |
| | | */ |
| | | @Service |
| | | public class BigStorageCageTaskServiceImpl implements BigStorageCageTaskService { |
| | | |
| | | @Resource |
| | | BigStorageCageTaskMapper bigStorageCageInTaskMapper; |
| | | |
| | | @Override |
| | | public List<BigStorageCageTask> queryTaskMessage(String tableName) { |
| | | return bigStorageCageInTaskMapper.queryTaskMessage(tableName); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateTaskMessage(String tableName, BigStorageCageTask bigStorageCageTask) { |
| | | return bigStorageCageInTaskMapper.updateTaskMessage(tableName, bigStorageCageTask); |
| | | } |
| | | |
| | | @Override |
| | | public int saveTaskMessage(String tableName, List<BigStorageCageTask> taskList) { |
| | | return bigStorageCageInTaskMapper.saveTaskMessage(tableName, taskList); |
| | | } |
| | | |
| | | @Override |
| | | public int removeAll(String tableName) { |
| | | return bigStorageCageInTaskMapper.removeAll(tableName); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.mes.job; |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.kangaroohy.milo.runner.subscription.SubscriptionCallback; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageTaskService; |
| | | import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlass; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.temperingglass.service.TemperingGlassService; |
| | | import com.mes.utils.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @Component |
| | | @Slf4j |
| | | public class OpcPlcStorageCageTask { |
| | | |
| | | @Resource |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | @Resource |
| | | private BigStorageCageFeedTaskService bigStorageCageFeedTaskService; |
| | | @Resource |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | @Resource |
| | | private EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | private TemperingGlassService temperingGlassService; |
| | | @Resource |
| | | private DamageService damageService; |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | | @Resource |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private BigStorageCageHistoryTaskService bigStorageCageHistoryTaskService; |
| | | @Resource |
| | | private BigStorageCageTaskService bigStorageCageTaskService; |
| | | |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | | |
| | | @Resource(name = "bigStorageStartCallback") |
| | | SubscriptionCallback bigStorageStartCallback; |
| | | |
| | | @Value("${mes.carWidth}") |
| | | private Integer carWidth; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | // @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | public void startOpcTask() throws Exception { |
| | | //设备一二的进片请求 |
| | | miloService.subscriptionFromOpcUa(Arrays.asList("my.device01.x1", "my.device02.x1"), bigStorageStartCallback); |
| | | @Value("${mes.carWidth}") |
| | | private Integer carWidth; |
| | | |
| | | @Value("${mes.outCarMaxSize}") |
| | | private Integer outCarMaxSize; |
| | | |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void inBigStorageTask() throws Exception { |
| | | ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1A.DLP1A.mesControl"); |
| | | if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { |
| | | log.info("当前为非联机状态,结束进片任务"); |
| | | return; |
| | | } |
| | | ReadWriteEntity requestEntity = miloService.readFromOpcUa("DLP1A.DLP1A.RequestMes"); |
| | | if (!"1".equals(requestEntity.getValue() + "")) { |
| | | log.info("当前未收到进片请求,结束进片任务"); |
| | | return; |
| | | } |
| | | ReadWriteEntity mesReplyEntity = miloService.readFromOpcUa("DLP1A.DLP1A.MesReply"); |
| | | if ("1".equals(mesReplyEntity.getValue() + "")) { |
| | | log.info("有正在执行的任务,结束进片任务"); |
| | | return; |
| | | } |
| | | //获取进片任务表 |
| | | List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task"); |
| | | if (CollectionUtils.isEmpty(inTaskList)) { |
| | | log.info("当前大车无进片玻璃,结束进片任务"); |
| | | } |
| | | List<String> glassIdList = inTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | log.info("获取任务的玻璃id:{}", glassIdList); |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList)); |
| | | Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | |
| | | //计算目标格子 |
| | | List<BigStorageCageHistoryTask> historyTasks = new ArrayList<>(); |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | //获取目标格子信息 |
| | | BigStorageDTO bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info); |
| | | // 临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>() |
| | | .set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | task.setTargetSlot(bigStorageDTO.getSlot()); |
| | | task.setGlassId(info.getGlassId()); |
| | | bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", task); |
| | | //存放历史任务 |
| | | BigStorageCageHistoryTask historyTask = new BigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | | historyTask.setTaskType(Const.BIG_STORAGE_BEFORE_IN); |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | BigStorageCageDetails cageDetails = new BigStorageCageDetails(); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setSlot(bigStorageDTO.getSlot()); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setDeviceId(bigStorageDTO.getDeviceId()); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setId(null); |
| | | bigStorageCageDetailsService.save(cageDetails); |
| | | } |
| | | //历史数据入库 |
| | | bigStorageCageHistoryTaskService.saveBatch(historyTasks); |
| | | //向opc发送启动信号 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 1)); |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | public void outOpcTask() throws Exception { |
| | | //设备1的出片请求 |
| | | miloService.subscriptionFromOpcUa(Arrays.asList("my.device03.x1"), bigStorageStartCallback); |
| | | } |
| | | |
| | | |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void updateInGlassStateTask() { |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void outBigStorageTask() throws Exception { |
| | | Date startDate = new Date(); |
| | | log.info("1、大理片笼进片完成后更新大理片笼数据任务开始执行时间:{}", startDate); |
| | | //因为大理片笼和出片任务是两个库的数据,所以要分开查找 |
| | | List<Object> list = bigStorageCageDetailsService.listObjs(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .select(BigStorageCageDetails::getGlassId).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("2、获取所有正在进片的玻璃信息id:{}", list); |
| | | List<String> glassIds = list.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | List<BigStorageCageFeedTask> inSuccessGlass = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .in(BigStorageCageFeedTask::getGlassId, glassIds) |
| | | .in(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT)); |
| | | if (CollectionUtils.isNotEmpty(inSuccessGlass)) { |
| | | log.info("3、获取进片已完成的玻璃信息id:{}", inSuccessGlass); |
| | | List<Integer> inSuccessGlassSlot = inSuccessGlass.stream().map(BigStorageCageFeedTask::getTargetSlot).collect(Collectors.toList()); |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = inSuccessGlass.stream().map(e -> { |
| | | ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl"); |
| | | if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { |
| | | log.info("当前为非联机状态,结束进片任务"); |
| | | return; |
| | | } |
| | | ReadWriteEntity requestEntity = miloService.readFromOpcUa("DLP1B.DLP1B.RequestMes"); |
| | | if (!"1".equals(requestEntity.getValue() + "")) { |
| | | log.info("当前未收到出片请求,结束出片任务"); |
| | | return; |
| | | } |
| | | //获取出片任务表 |
| | | List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task"); |
| | | if (CollectionUtils.isNotEmpty(outTaskList)) { |
| | | log.info("有正在执行的出片任务,结束本次出片任务"); |
| | | return; |
| | | } |
| | | //todo:是否允许钢化 |
| | | if (redisUtil.getCacheObject("temperingSwitch")) { |
| | | //是否有正在钢化的玻璃:钢化小片表关联历史任务表,筛选未出笼的玻璃信息 |
| | | List<TemperingGlass> temperingGlassList = temperingGlassService.selectJoinList(TemperingGlass.class, new MPJLambdaWrapper<TemperingGlass>() |
| | | .selectAll(TemperingGlass.class) |
| | | .leftJoin(BigStorageCageHistoryTask.class, BigStorageCageHistoryTask::getGlassId, TemperingGlass::getGlassId) |
| | | .eq(TemperingGlass::getState, Const.TEMPERING_NEW) |
| | | .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_OUT) |
| | | .isNull(BigStorageCageHistoryTask::getGlassId) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlass::getTemperingFeedSequence)); |
| | | //todo:历史任务表 |
| | | if (CollectionUtils.isNotEmpty(temperingGlassList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | computeOutGlassInfo(temperingGlassList, "big_storage_cage_out_one_task", Const.TEMPERING_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | List<TemperingLayoutDTO> temperingLayoutDTOList = bigStorageCageDetailsService.temperingIsAll(); |
| | | if (CollectionUtils.isNotEmpty(temperingLayoutDTOList)) { |
| | | //玻璃到齐包括已出片的 |
| | | //到齐,将玻璃小片数据存入钢化小片表,逻辑生成出片任务 结束 |
| | | for (TemperingLayoutDTO item : temperingLayoutDTOList) { |
| | | // if (item.getEngineerId().equals(redisUtil.getCacheObject("temperingengineerId"))) { |
| | | List<TemperingGlass> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlass.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .selectAll(GlassInfo.class) |
| | | .select("-1 as state") |
| | | .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot) |
| | | .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(GlassInfo::getTemperingLayoutId, item.getTemperingLayoutId()) |
| | | .eq(GlassInfo::getEngineerId, item.getEngineerId()) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | temperingGlassService.saveBatch(temperingGlassInfos); |
| | | computeOutGlassInfo(temperingGlassInfos, "big_storage_cage_out_one_task", Const.TEMPERING_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | //是否有人工下片任务 有直接出 |
| | | List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL) |
| | | .orderByAsc(BigStorageCageDetails::getSlot) |
| | | .orderByDesc(BigStorageCageDetails::getId)); |
| | | if (CollectionUtils.isNotEmpty(artificialList)) { |
| | | computeOutGlassInfo(artificialList, "big_storage_cage_out_one_task", Const.ARTIFICIAL_OUT_TARGET_POSITION, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | //是否存在需要内部调度的格子:执行内部调度任务 |
| | | List<TemperingLayoutDTO> temperingOccupySlotList = bigStorageCageDetailsService.queryTemperingOccupySlot(); |
| | | if (CollectionUtils.isNotEmpty(temperingOccupySlotList)) { |
| | | loop: |
| | | for (TemperingLayoutDTO temperingOccupySlot : temperingOccupySlotList) { |
| | | List<SlotSequenceDTO> slotSequenceList = bigStorageCageDetailsService.queryGlassMaxAndMin(temperingOccupySlot.getEngineerId(), temperingOccupySlot.getTemperingLayoutId()); |
| | | for (int i = 0; i < slotSequenceList.size() - 1; i++) { |
| | | SlotSequenceDTO first = slotSequenceList.get(i); |
| | | SlotSequenceDTO second = slotSequenceList.get(i + 1); |
| | | int slotWidth = carWidth - first.getRemainWidth() - glassGap; |
| | | int totalCount = first.getGlassCount() + second.getGlassCount(); |
| | | if (totalCount <= 6 && first.getMinSequence() == second.getMaxSequence() + 1 |
| | | && second.getRemainWidth() > slotWidth && slotWidth >= 0) { |
| | | |
| | | List<BigStorageCageDetails> list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getSlot, first.getSlot()).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, BigStorageCageDetails::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | computeOutGlassInfo(list, "big_storage_cage_out_one_task", second.getSlot(), Const.GLASS_STATE_SCHEDULE_ING, Const.BIG_STORAGE_BEFORE_DISPATCH); |
| | | } |
| | | updateSlotRemainBySlots(Arrays.asList(second.getSlot())); |
| | | break loop; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void finishInBigStorageTask() throws Exception { |
| | | ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1A.DLP1A.mesControl"); |
| | | if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { |
| | | log.info("当前为非联机状态,结束完成进片任务"); |
| | | return; |
| | | } |
| | | //获取进片任务表 |
| | | List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task"); |
| | | if (CollectionUtils.isEmpty(inTaskList)) { |
| | | log.info("当前大车无进片玻璃,结束完成进片任务"); |
| | | return; |
| | | } |
| | | List<BigStorageCageTask> unFinishTaskList = inTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(unFinishTaskList)) { |
| | | log.info("存在未完成的玻璃信息,玻璃:{}", unFinishTaskList); |
| | | return; |
| | | } |
| | | Map<Integer, List<BigStorageCageTask>> taskMap = inTaskList.stream().collect(Collectors.groupingBy(BigStorageCageTask::getTaskState)); |
| | | //按照任务状态修改大理片笼内的玻璃数据 |
| | | // 重新计算大理片笼内的剩余尺寸 |
| | | taskMap.forEach((e1, v) -> { |
| | | if (e1 == 2) { |
| | | //进片完成 |
| | | log.info("3、获取进片已完成的玻璃信息id:{}", v); |
| | | List<Integer> inSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList()); |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> { |
| | | UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO(); |
| | | BeanUtils.copyProperties(e, storageCageDTO); |
| | | return storageCageDTO; |
| | | }).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN); |
| | | log.info("4、大理片笼进片状态已完成已完成的玻璃信息id:{}", inSuccessGlass); |
| | | //更新理片笼玻璃尺寸 |
| | | log.info("4、大理片笼进片状态已完成已完成的玻璃信息id:{}", v); |
| | | updateSlotRemainBySlots(inSuccessGlassSlot); |
| | | log.info("5、大理片笼进片目标格子尺寸更新完成"); |
| | | } else if (e1 == 3) { |
| | | //破损处理 |
| | | dealDamageInTask(v); |
| | | } else { |
| | | //清空理片笼空数据 |
| | | noDealInTask(v); |
| | | } |
| | | |
| | | }); |
| | | for (BigStorageCageTask item : inTaskList) { |
| | | //更新历史任务表中的任务状态 |
| | | bigStorageCageHistoryTaskService.update(new LambdaUpdateWrapper<BigStorageCageHistoryTask>() |
| | | .set(BigStorageCageHistoryTask::getTaskState, item.getTaskState()) |
| | | .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_IN) |
| | | .eq(BigStorageCageHistoryTask::getTargetSlot, item.getTargetSlot()) |
| | | .eq(BigStorageCageHistoryTask::getGlassId, item.getGlassId())); |
| | | item.setTargetSlot(0); |
| | | //清空任务表数据 |
| | | bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_one_task", item); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("end:大理片笼进片完成后更新大理片笼数据任务结束时间:{},共耗时:{}ms,结束任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | |
| | | //清空启动状态 |
| | | //向opc发送启动信号 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.MesReply", 0)); |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void updateOutGlassStateTask() { |
| | | Date startDate = new Date(); |
| | | log.info("1、大理片笼出片完成后更新大理片笼数据任务开始执行时间:{}", startDate); |
| | | //因为大理片笼和出片任务是两个库的数据,所以要分开查找 |
| | | List<Object> list = bigStorageCageDetailsService.listObjs(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .select(BigStorageCageDetails::getGlassId).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("2、获取所有正在出片的玻璃信息id:{}", list); |
| | | List<String> glassIds = list.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | List<BigStorageCageOutTask> outSuccessGlass = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .in(BigStorageCageOutTask::getGlassId, glassIds).in(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_ALL)); |
| | | if (CollectionUtils.isNotEmpty(outSuccessGlass)) { |
| | | for (BigStorageCageOutTask bigStorageCageOutTask : outSuccessGlass |
| | | ) { |
| | | if (bigStorageCageOutTask.getEndSlot().equals(Const.ARTIFICIAL_OUT_TARGET_POSITION)) { |
| | | temperingGlassInfoService.update( |
| | | new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | | .set(TemperingGlassInfo::getState, Const.TEMPERING_END) |
| | | .eq(TemperingGlassInfo::getGlassId, bigStorageCageOutTask.getGlassId()) |
| | | ); |
| | | } |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void finishOutBigStorageTask() throws Exception { |
| | | // ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl"); |
| | | // if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { |
| | | // log.info("当前为非联机状态,结束完成出片任务"); |
| | | // return; |
| | | // } |
| | | //获取进片任务表 |
| | | List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task"); |
| | | if (CollectionUtils.isEmpty(outTaskList)) { |
| | | log.info("当前大车无进片玻璃,结束完成进片任务"); |
| | | return; |
| | | } |
| | | List<BigStorageCageTask> unFinishTaskList = outTaskList.stream().filter(e -> e.getTaskState() <= 1 || e.getStartSlot() == 0).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(unFinishTaskList)) { |
| | | log.info("存在未完成的玻璃信息,玻璃:{}", unFinishTaskList); |
| | | return; |
| | | } |
| | | Map<Integer, List<BigStorageCageTask>> taskMap = outTaskList.stream().collect(Collectors.groupingBy(BigStorageCageTask::getTaskState)); |
| | | int taskType = 0; |
| | | if (Const.OUT_TARGET_POSITION_ALL.contains(outTaskList.get(0).getTargetSlot())) { |
| | | taskType = Const.BIG_STORAGE_BEFORE_OUT; |
| | | } else { |
| | | taskType = Const.BIG_STORAGE_BEFORE_DISPATCH; |
| | | } |
| | | //按照任务状态修改大理片笼内的玻璃数据 |
| | | // 重新计算大理片笼内的剩余尺寸 |
| | | Integer finalTaskType = taskType; |
| | | taskMap.forEach((e1, v) -> { |
| | | if (e1 == 2) { |
| | | //进片完成 |
| | | log.info("3、获取进片已完成的玻璃信息id:{}", v); |
| | | List<Integer> outSuccessGlassSlot = new ArrayList<>(); |
| | | if (finalTaskType.equals(Const.BIG_STORAGE_BEFORE_OUT)) { |
| | | outSuccessGlassSlot = v.stream().map(BigStorageCageTask::getStartSlot).collect(Collectors.toList()); |
| | | } else { |
| | | outSuccessGlassSlot = v.stream().map(BigStorageCageTask::getTargetSlot).collect(Collectors.toList()); |
| | | } |
| | | log.info("3、获取出片已完成的玻璃信息id:{}", outSuccessGlass); |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = outSuccessGlass.stream().map(e -> { |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = v.stream().map(e -> { |
| | | UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO(); |
| | | storageCageDTO.setGlassId(e.getGlassId()); |
| | | storageCageDTO.setTargetSlot(e.getStartSlot()); |
| | | if (finalTaskType.equals(Const.BIG_STORAGE_BEFORE_OUT)) { |
| | | storageCageDTO.setTargetSlot(e.getStartSlot()); |
| | | } else { |
| | | storageCageDTO.setTargetSlot(e.getTargetSlot()); |
| | | } |
| | | return storageCageDTO; |
| | | }).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_OUT); |
| | | List<Integer> outSuccessSlotList = outSuccessGlass.stream().map(BigStorageCageOutTask::getStartSlot).collect(Collectors.toList()); |
| | | log.info("4、大理片笼出片状态已完成已完成的玻璃信息id:{}", outSuccessGlass); |
| | | //更新理片笼玻璃尺寸 |
| | | updateSlotRemainBySlots(outSuccessSlotList); |
| | | log.info("5、大理片笼进片目标格子尺寸更新完成"); |
| | | bigStorageCageDetailsService.updateBySlot(storageCageDTOList, finalTaskType); |
| | | log.info("4、大理片笼进片状态已完成已完成的玻璃信息id:{}", v); |
| | | updateSlotRemainBySlots(outSuccessGlassSlot); |
| | | } else if (e1 == 3) { |
| | | //破损处理 |
| | | dealDamageOutTask(v); |
| | | } else { |
| | | //清空理片笼空数据 |
| | | noDealOutTask(v); |
| | | } |
| | | }); |
| | | for (BigStorageCageTask item : outTaskList) { |
| | | //更新历史任务表中的任务状态 |
| | | bigStorageCageHistoryTaskService.update(new LambdaUpdateWrapper<BigStorageCageHistoryTask>() |
| | | .set(BigStorageCageHistoryTask::getTaskState, item.getTaskState()) |
| | | .eq(BigStorageCageHistoryTask::getTaskType, taskType) |
| | | .eq(BigStorageCageHistoryTask::getGlassId, item.getGlassId())); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("end:大理片笼出片完成后更新大理片笼数据任务结束时间:{},共耗时:{}ms,结束任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | |
| | | //清空任务表数据 |
| | | bigStorageCageTaskService.removeAll("big_storage_cage_out_one_task"); |
| | | //清空启动状态 |
| | | //向opc发送启动信号 |
| | | miloService.writeToOpcWord(generateReadWriteEntity("DLP1B.DLP1B.MesReply", 0)); |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void updateScheduleGlassStateTask() { |
| | | Date startDate = new Date(); |
| | | log.info("1、大理片笼调度完成后更新大理片笼数据任务开始执行时间:{}", startDate); |
| | | //因为大理片笼和调度任务是两个库的数据,所以要分开查找 |
| | | List<Object> list = bigStorageCageDetailsService.listObjs(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .select(BigStorageCageDetails::getGlassId).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_SCHEDULE_ING)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("2、获取所有正在出片的玻璃信息id:{}", list); |
| | | List<String> glassIds = list.stream().map(String::valueOf).collect(Collectors.toList()); |
| | | List<BigStorageCageOutTask> scheduleSuccessGlass = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .in(BigStorageCageOutTask::getGlassId, glassIds).eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_SUCCESS) |
| | | .notIn(BigStorageCageOutTask::getEndSlot, Const.TEMPERING_OUT_TARGET_POSITION, Const.ARTIFICIAL_OUT_TARGET_POSITION)); |
| | | if (CollectionUtils.isNotEmpty(scheduleSuccessGlass)) { |
| | | log.info("3、获取调度已完成的玻璃信息id:{}", scheduleSuccessGlass); |
| | | List<UpdateBigStorageCageDTO> storageCageDTOList = scheduleSuccessGlass.stream().map(e -> { |
| | | UpdateBigStorageCageDTO storageCageDTO = new UpdateBigStorageCageDTO(); |
| | | storageCageDTO.setGlassId(e.getGlassId()); |
| | | storageCageDTO.setTargetSlot(e.getEndSlot()); |
| | | return storageCageDTO; |
| | | }).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.updateBySlot(storageCageDTOList, Const.GLASS_STATE_IN); |
| | | List<String> scheduleSuccessGlassIds = scheduleSuccessGlass.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | log.info("4、大理片笼出片状态已完成已完成的玻璃信息id:{}", scheduleSuccessGlassIds); |
| | | //更新理片笼玻璃尺寸 |
| | | List<Integer> slotList = scheduleSuccessGlass.stream().map(BigStorageCageOutTask::getStartSlot).distinct().collect(Collectors.toList()); |
| | | slotList.addAll(scheduleSuccessGlass.stream().map(BigStorageCageOutTask::getEndSlot).distinct().collect(Collectors.toList())); |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("5、大理片笼进片目标格子尺寸更新完成"); |
| | | private void dealDamageInTask(List<BigStorageCageTask> damageTaskList) { |
| | | // 获取进片任务表中状态为破损的数据 |
| | | log.info("破损的玻璃信息有:{}", damageTaskList); |
| | | //移除理片笼详情表任务执行过程中破损的玻璃 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW) |
| | | .in(BigStorageCageDetails::getGlassId, damageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()))); |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageTask item : damageTaskList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(item.getGlassId()); |
| | | damage.setLine(item.getStartSlot()); |
| | | damage.setWorkingProcedure("磨边"); |
| | | damage.setRemark("进笼前卧转立"); |
| | | damage.setStatus(1); |
| | | damage.setType(item.getTaskState()); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(item.getTargetSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("进片任务-破损任务执行完成"); |
| | | } |
| | | |
| | | private void dealDamageOutTask(List<BigStorageCageTask> damageTaskList) { |
| | | // 获取进片任务表中状态为破损的数据 |
| | | log.info("破损的玻璃信息有:{}", damageTaskList); |
| | | //移除理片笼详情表任务执行过程中破损的玻璃 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO) |
| | | .in(BigStorageCageDetails::getGlassId, damageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()))); |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageTask item : damageTaskList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(item.getGlassId()); |
| | | damage.setLine(item.getStartSlot()); |
| | | damage.setWorkingProcedure("钢化前"); |
| | | damage.setRemark("进笼后卧转立"); |
| | | damage.setStatus(1); |
| | | damage.setType(item.getTaskState()); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(item.getTargetSlot()); |
| | | slotList.add(item.getStartSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("出片任务-破损任务执行完成"); |
| | | } |
| | | |
| | | private void noDealInTask(List<BigStorageCageTask> noDealTaskList) { |
| | | // 获取进片任务表中状态为破损的数据 |
| | | log.info("破损的玻璃信息有:{}", noDealTaskList); |
| | | //移除理片笼详情表未执行任务的空记录信息 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW) |
| | | .in(BigStorageCageDetails::getGlassId, noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()))); |
| | | //记录格子号,按格子号更新剩余尺寸 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageTask item : noDealTaskList) { |
| | | slotList.add(item.getTargetSlot()); |
| | | slotList.add(item.getStartSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("进片任务-无动作执行完成"); |
| | | } |
| | | |
| | | private void noDealOutTask(List<BigStorageCageTask> noDealTaskList) { |
| | | // 获取进片任务表中状态为破损的数据 |
| | | log.info("破损的玻璃信息有:{}", noDealTaskList); |
| | | if (Const.OUT_TARGET_POSITION_ALL.contains(noDealTaskList.get(0).getTargetSlot())) { |
| | | //出片任务:将出片中状态恢复为在笼内 |
| | | List<String> glassList = noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .in(BigStorageCageDetails::getGlassId, glassList)); |
| | | |
| | | } else { |
| | | //调度任务:将调度中状态改为在笼内,格子号恢复为调度前的格子 |
| | | for (BigStorageCageTask item : noDealTaskList) { |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getSlot, item.getStartSlot()) |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(BigStorageCageDetails::getGlassId, item.getGlassId())); |
| | | } |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("end:大理片笼出片完成后更新大理片笼数据任务结束时间:{},共耗时:{}ms,结束任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageTask item : noDealTaskList) { |
| | | slotList.add(item.getTargetSlot()); |
| | | slotList.add(item.getStartSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("出片任务-无动作执行完成"); |
| | | } |
| | | |
| | | /** |
| | | * 处理破损表任务 |
| | | * 出片一次仅生成一车玻璃 |
| | | * |
| | | * @param list |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void dealDamageTask() { |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼破损玻璃清除任务开始执行时间:{}", startDate); |
| | | //获取进片任务表中状态为破损的数据 |
| | | List<BigStorageCageFeedTask> inDamageTaskInfoList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .in(BigStorageCageFeedTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | if (CollectionUtils.isNotEmpty(inDamageTaskInfoList)) { |
| | | log.info("获取进片任务表中破损的玻璃信息{}", inDamageTaskInfoList); |
| | | bigStorageCageFeedTaskService.remove(new LambdaQueryWrapper<BigStorageCageFeedTask>().in(BigStorageCageFeedTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | //理片笼详情表数据状态更新 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW).in(BigStorageCageDetails::getGlassId, inDamageTaskInfoList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()))); |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : inDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(bigStorageCageFeedTask.getGlassId()); |
| | | damage.setLine(bigStorageCageFeedTask.getLine()); |
| | | damage.setWorkingProcedure("磨边"); |
| | | damage.setRemark("进笼前卧转立"); |
| | | damage.setStatus(1); |
| | | damage.setType(bigStorageCageFeedTask.getTaskState()); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(bigStorageCageFeedTask.getTargetSlot()); |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType) { |
| | | //任务数据:获取车子存放玻璃最大数量,玻璃间隔 |
| | | List<BigStorageCageTask> bigStorageCageTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | | Integer remainWidth = carWidth; |
| | | for (T e : list) { |
| | | if (bigStorageCageTaskList.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) { |
| | | break; |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("进片任务执行完成"); |
| | | //计算当前出片车剩尺寸 |
| | | remainWidth = remainWidth - Math.max((int) e.getWidth(), (int) e.getHeight()) - glassGap; |
| | | bigStorageCageTaskList.add(new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot, |
| | | 0)); |
| | | } |
| | | //获取出片任务表中状态为破损的数据 |
| | | List<BigStorageCageOutTask> outDamageTaskInfoList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .in(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | if (CollectionUtils.isNotEmpty(outDamageTaskInfoList)) { |
| | | log.info("获取出片任务表中破损的玻璃信息{}", outDamageTaskInfoList); |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().in(BigStorageCageOutTask::getTaskState, Const.GLASS_STATE_DAMAGE_TAKE)); |
| | | List<String> glassIdList = outDamageTaskInfoList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | //移除钢化下片表数据 |
| | | temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | | //理片笼详情表数据状态删除 |
| | | bigStorageCageDetailsService.remove(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, glassIdList)); |
| | | //将破损信息新增入破损表 |
| | | List<Integer> slotList = new ArrayList<>(); |
| | | for (BigStorageCageOutTask bigStorageCageOutTask : outDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(bigStorageCageOutTask.getGlassId()); |
| | | damage.setLine(bigStorageCageOutTask.getEndSlot()); |
| | | damage.setWorkingProcedure("钢化"); |
| | | damage.setRemark("出片后卧转立"); |
| | | damage.setStatus(1); |
| | | damage.setType(bigStorageCageOutTask.getTaskState()); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(bigStorageCageOutTask.getStartSlot()); |
| | | } |
| | | //更新格子剩余宽度 |
| | | updateSlotRemainBySlots(slotList); |
| | | log.info("出片任务执行完成"); |
| | | Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageTaskList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", bigStorageCageTaskList.size()); |
| | | List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | int glassCount = bigStorageCageTaskList.size(); |
| | | //生成出片任务条数不足6补全 |
| | | while (bigStorageCageTaskList.size() < 6) { |
| | | bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0)); |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼破损玻璃清除任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | bigStorageCageTaskService.saveTaskMessage(tableName, bigStorageCageTaskList); |
| | | List<BigStorageCageHistoryTask> historyList = bigStorageCageTaskList.stream().filter(e -> StringUtils.isNotBlank(e.getGlassId())).map(e -> { |
| | | BigStorageCageHistoryTask history = new BigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(e, history); |
| | | history.setGlassCount(glassCount); |
| | | history.setTaskType(taskType); |
| | | return history; |
| | | }).collect(Collectors.toList()); |
| | | bigStorageCageHistoryTaskService.saveBatch(historyList); |
| | | |
| | | log.info("将出片玻璃{}玻璃状态改为出片中", glassIds); |
| | | bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .set(BigStorageCageDetails::getState, state) |
| | | .set(Const.GLASS_STATE_SCHEDULE_ING.equals(state), BigStorageCageBaseInfo::getSlot, targetSlot) |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | |
| | | public void updateSlotRemainBySlots(List<Integer> slotList) { |
| | | //获取格子内所有的玻璃信息 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private ReadWriteEntity generateReadWriteEntity(String identifier, Object value) { |
| | | return ReadWriteEntity.builder() |
| | | .identifier(identifier) |
| | | //Kep中是Long类型,即:Int32,Java中的int类型 |
| | | .value(value) |
| | | .build(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.tools.service; |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/8 22:02 |
| | | * @Description: |
| | | */ |
| | | public interface BigStorageBaseService { |
| | | void updateSlotRemainBySlots(List<Integer> slotList); |
| | | |
| | | BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo); |
| | | } |
New file |
| | |
| | | package com.mes.tools.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | 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.toolkit.CollectionUtils; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.tools.S7control; |
| | | import com.mes.tools.service.BigStorageBaseService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/11/8 22:03 |
| | | * @Description: |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class BigStorageBaseServiceImpl implements BigStorageBaseService { |
| | | |
| | | @Resource |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | |
| | | @Resource |
| | | BigStorageCageService bigStorageCageService; |
| | | |
| | | @Resource |
| | | GlassInfoService glassInfoService; |
| | | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | @Value("${mes.carWidth}") |
| | | private Integer carWidth; |
| | | |
| | | @Value("${mes.outCarMaxSize}") |
| | | private Integer outCarMaxSize; |
| | | |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | |
| | | @Override |
| | | public void updateSlotRemainBySlots(List<Integer> slotList) { |
| | | //获取格子内所有的玻璃信息 |
| | | List<BigStorageCageDetails> inSlotGlassList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .in(BigStorageCageDetails::getSlot, slotList).in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | Map<Integer, Double> slotRemainMap = new HashMap<>(); |
| | | //是否存在有格子非空的玻璃 |
| | | if (CollectionUtils.isNotEmpty(inSlotGlassList)) { |
| | | //存在 将格子内的玻璃分别进行更新 |
| | | slotRemainMap = inSlotGlassList.stream() |
| | | .collect(Collectors.groupingBy(BigStorageCageDetails::getSlot, Collectors.summingDouble(item -> Math.max(item.getWidth(), item.getHeight()) + glassGap))); |
| | | slotRemainMap.forEach((e, v) -> { |
| | | double remainWidth = slotWidth - v >= 0 ? slotWidth - v : 0; |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, remainWidth) |
| | | .eq(BigStorageCage::getSlot, e)); |
| | | }); |
| | | } |
| | | //过滤不存在玻璃的格子 将宽度重置为原始宽度5000 |
| | | Set<Integer> remainSlotList = slotRemainMap.keySet(); |
| | | slotList.removeAll(remainSlotList); |
| | | if (CollectionUtils.isNotEmpty(slotList)) { |
| | | bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, slotWidth) |
| | | .in(BigStorageCage::getSlot, slotList)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 按照玻璃id判断玻璃状态及卧转立是否可直接启动 |
| | | */ |
| | | // public Boolean judgeGlassTypeStatus(String glassId, Integer line, String mesAddress) { |
| | | // //判断此玻璃是在笼内或已生成进片任务 |
| | | // BigStorageCageFeedTask bigStorageCageFeedTask = bigStorageCageFeedTaskService.getOne( |
| | | // new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | // .lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT) |
| | | // .eq(BigStorageCageFeedTask::getGlassId, glassId) |
| | | // ); |
| | | // BigStorageCageDetails bigStorageCageDetails = bigStorageCageDetailsService.getOne( |
| | | // new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | // .eq(BigStorageCageDetails::getGlassId, glassId) |
| | | // .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | // ); |
| | | // if (bigStorageCageFeedTask != null || bigStorageCageDetails != null) { |
| | | // log.info("此玻璃存任务或已在笼内"); |
| | | // return Boolean.TRUE; |
| | | // } |
| | | // //1、获取任务表中相邻玻璃 |
| | | // List<EdgGlassTaskInfo> edgGlassTaskInfoList; |
| | | // edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() |
| | | // .eq(EdgGlassTaskInfo::getLine, line) |
| | | // .apply("time >= (select time from edg_glass_task_info where line='" + line + "' and glass_id = '" + glassId + "' and deleted = 0)") |
| | | // .orderByAsc(EdgGlassTaskInfo::getTime)); |
| | | // if (edgGlassTaskInfoList.size() == 0) { |
| | | // edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>() |
| | | // .select("Top 1 *") |
| | | // .eq("glass_id", glassId) |
| | | // ); |
| | | // log.info("在尺寸表中获取玻璃信息{}", edgGlassTaskInfoList); |
| | | // if (edgGlassTaskInfoList.size() == 0) { |
| | | // GlassInfo glassInfo = glassInfoService.getOne( |
| | | // new LambdaQueryWrapper<GlassInfo>() |
| | | // .eq(GlassInfo::getGlassId, glassId) |
| | | // ); |
| | | // EdgGlassTaskInfo edgGlassTaskInfo = new EdgGlassTaskInfo(); |
| | | // BeanUtils.copyProperties(glassInfo, edgGlassTaskInfo); |
| | | // edgGlassTaskInfo.setWidth((int) glassInfo.getWidth()); |
| | | // edgGlassTaskInfo.setHeight((int) glassInfo.getHeight()); |
| | | // edgGlassTaskInfoList.add(edgGlassTaskInfo); |
| | | // log.info("在玻璃信息表中获取玻璃信息{}", edgGlassTaskInfoList); |
| | | // } |
| | | // } |
| | | // Assert.isFalse(CollectionUtils.isEmpty(edgGlassTaskInfoList), "识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败"); |
| | | // //2、获取卧转立剩余宽度 |
| | | // BigStorageDTO sitToUpRemainWidth = bigStorageCageFeedTaskService.querySitToUpRemainWidth(line); |
| | | // Integer remainWidth; |
| | | // Integer glassCount; |
| | | // if (0 == sitToUpRemainWidth.getGlassCount()) { |
| | | // remainWidth = carWidth; |
| | | // glassCount = 0; |
| | | // } else { |
| | | // remainWidth = sitToUpRemainWidth.getWidth(); |
| | | // glassCount = sitToUpRemainWidth.getGlassCount(); |
| | | // } |
| | | // |
| | | // Boolean flag = Boolean.TRUE; |
| | | // //2、获取卧转立 |
| | | // Integer widthFirst = Math.max(edgGlassTaskInfoList.get(0).getWidth() / 10, edgGlassTaskInfoList.get(0).getHeight() / 10); |
| | | // Integer heightFirst = Math.min(edgGlassTaskInfoList.get(0).getWidth() / 10, edgGlassTaskInfoList.get(0).getHeight() / 10); |
| | | // if (edgGlassTaskInfoList.size() == 1) { |
| | | // if (remainWidth >= widthFirst) { |
| | | // if (glassCount < inCarMaxSize) { |
| | | // addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightFirst); |
| | | // } else { |
| | | // if (glassCount < inCarMaxSize + 1) { |
| | | // addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst); |
| | | // } else { |
| | | // return Boolean.FALSE; |
| | | // } |
| | | // } |
| | | // } else { |
| | | // flag = Boolean.FALSE; |
| | | // } |
| | | // } else { |
| | | // Integer widthSecond = Math.max(edgGlassTaskInfoList.get(1).getWidth() / 10, edgGlassTaskInfoList.get(1).getHeight() / 10); |
| | | // Integer heightSecond = Math.min(edgGlassTaskInfoList.get(1).getWidth() / 10, edgGlassTaskInfoList.get(1).getHeight() / 10); |
| | | // if (remainWidth >= widthFirst) { |
| | | // if (remainWidth - widthFirst - glassGap >= widthSecond) { |
| | | // if (glassCount < inCarMaxSize) { |
| | | // addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightFirst); |
| | | // } else { |
| | | // if (glassCount < inCarMaxSize + 1) { |
| | | // addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst); |
| | | // } else { |
| | | // return Boolean.FALSE; |
| | | // } |
| | | // } |
| | | // } else { |
| | | // if (glassCount < inCarMaxSize + 1) { |
| | | // addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst); |
| | | // } else { |
| | | // return Boolean.FALSE; |
| | | // } |
| | | // } |
| | | // } else { |
| | | // flag = Boolean.FALSE; |
| | | // } |
| | | // } |
| | | // //向plc发送进片确认 |
| | | // if (flag) { |
| | | // //向plc写入确认字 |
| | | // PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | // int returnData = 1; |
| | | // int count = 1; |
| | | // while (returnData != 0) { |
| | | // S7object.getinstance().plccontrol.writeWord(mesAddress, 1); |
| | | // |
| | | // if (Const.A10_OUT_TARGET_POSITION.equals(line)) { |
| | | // returnData = Integer.parseInt(plcParameterObject.getPlcParameter("D04ToMES").getValue()); |
| | | // } else { |
| | | // returnData = Integer.parseInt(plcParameterObject.getPlcParameter("D01ToMES").getValue()); |
| | | // } |
| | | //// returnData = S7object.getinstance().plccontrol.readWord(mesAddress, 1).get(0); |
| | | // log.info("进卧转立第{}次发送确认字完成,地址为:{},写入的内容为{}", count++, mesAddress, 1); |
| | | // } |
| | | // } |
| | | // //记录无法放下玻璃,后续判断启动 |
| | | // return flag; |
| | | // } |
| | | |
| | | /** |
| | | * 添加任务信息 |
| | | */ |
| | | // private Boolean addFeedTask(String glassId, Integer line, Integer taskType, Integer width, Integer height) { |
| | | // BigStorageCageFeedTask bigStorageCageFeedTask = new BigStorageCageFeedTask(); |
| | | // bigStorageCageFeedTask.setGlassId(glassId); |
| | | // bigStorageCageFeedTask.setTaskState(Const.BIG_STORAGE_IN_NEW); |
| | | // bigStorageCageFeedTask.setLine(line); |
| | | // bigStorageCageFeedTask.setTaskType(taskType); |
| | | // bigStorageCageFeedTask.setWidth(width); |
| | | // bigStorageCageFeedTask.setHeight(height); |
| | | // bigStorageCageFeedTask.setCreateTime(new Date()); |
| | | // //删除理片笼表拿走/破损数据数据 |
| | | // damageService.deleteByGlassId(glassId); |
| | | // Damage damage = new Damage(); |
| | | // damage.setGlassId(glassId); |
| | | // damage.setWorkingProcedure("磨边"); |
| | | // damage.setLine(line); |
| | | // damage.setType(1); |
| | | // damage.setRemark("进大理片"); |
| | | // damageService.insertDamage(damage); |
| | | // return bigStorageCageFeedTaskService.save(bigStorageCageFeedTask); |
| | | // } |
| | | |
| | | /** |
| | | * 获取需要启动的线路:两条线都可启动 获取第一片玻璃版图id最小 版序最大的线路 |
| | | * |
| | | * @return 需要启动的线路 |
| | | */ |
| | | // public Integer getStartLine() { |
| | | // List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | // .inSql(BigStorageCageFeedTask::getId, "select min(id) from big_storage_cage_feed_task where task_state = 2" + |
| | | // "and (target_slot = 0 or target_slot is null) group by line")); |
| | | // Assert.isFalse(CollectionUtils.isEmpty(taskList), "卧转立两条线都没有玻璃进片任务"); |
| | | // Map<String, Integer> taskMap = taskList.stream().collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, |
| | | // BigStorageCageFeedTask::getLine)); |
| | | // GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | // .in(GlassInfo::getGlassId, taskMap.keySet()) |
| | | // .orderByAsc(GlassInfo::getTemperingLayoutId) |
| | | // .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence) |
| | | // .last("limit 1")); |
| | | // return taskMap.get(glassInfo.getGlassId()); |
| | | // } |
| | | |
| | | /** |
| | | * 计算任务表进片线路的目标格子,并启动任务 |
| | | */ |
| | | // public boolean computeTargetByLine(Integer line) { |
| | | // //1、获取任务表中的所有玻璃(指定线路且已经进卧转立完成) |
| | | // List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | // .eq(BigStorageCageFeedTask::getLine, line) |
| | | // .and(e -> e.isNull(BigStorageCageFeedTask::getTargetSlot).or().eq(BigStorageCageFeedTask::getTargetSlot, Const.OUT_TARGET_POSITION_ZERO)) |
| | | // .in(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP_ALL) |
| | | // .orderByAsc(BigStorageCageFeedTask::getId)); |
| | | // //2、去笼子内查找是否可以继续存放的笼子 |
| | | // List<String> glassIds = taskList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList()); |
| | | // List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIds)); |
| | | // return computeIsTemperingTargetByLine(glassInfos, taskList); |
| | | // } |
| | | |
| | | // /** |
| | | // * 是否钢化玻璃进笼目标位置 |
| | | // * |
| | | // * @param glassInfos 当条线卧转立所有玻璃 |
| | | // * @param taskList 当条线卧转立所有任务 |
| | | // */ |
| | | // private boolean computeIsTemperingTargetByLine(List<GlassInfo> glassInfos, List<BigStorageCageFeedTask> taskList) { |
| | | // //1、将玻璃信息集合转为glassid为key的map |
| | | // Map<String, GlassInfo> glassInfoMap = glassInfos.stream() |
| | | // .collect(Collectors.toMap(GlassInfo::getGlassId, p -> p)); |
| | | // for (BigStorageCageFeedTask e : taskList) { |
| | | // GlassInfo info = glassInfoMap.get(e.getGlassId()); |
| | | // if (info == null) { |
| | | // continue; |
| | | // } |
| | | // BigStorageCageDetails cageDetails = new BigStorageCageDetails(); |
| | | // BeanUtils.copyProperties(info, cageDetails); |
| | | // //todo:2、获取目标格子信息 |
| | | // BigStorageDTO bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info); |
| | | // //3、临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | | // bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | // .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | // //4、更新进片任务表,目标格子及状态(状态改为2 电气扫到自行处理) 遇到问题:无法批量更新,批量更新无法走指定从库 |
| | | // e.setTargetSlot(bigStorageDTO.getSlot()); |
| | | // bigStorageCageFeedTaskService.updateById(e); |
| | | // |
| | | // //5、将进片信息存入大理片笼详情表 |
| | | // cageDetails.setSlot(bigStorageDTO.getSlot()); |
| | | // cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | // cageDetails.setDeviceId(bigStorageDTO.getDeviceId()); |
| | | // cageDetails.setGap(glassGap); |
| | | // bigStorageCageDetailsService.save(cageDetails); |
| | | // |
| | | // } |
| | | // return Boolean.TRUE; |
| | | // } |
| | | private void sendTaskListToPLC(List<BigStorageCageFeedTask> taskList, Integer line) { |
| | | log.info("送片任务发送进片玻璃信息"); |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String mesD03Address = plcMesObject.getPlcParameter("MESToD03").getAddress(); |
| | | String mesD05Address = plcMesObject.getPlcParameter("MESToD05").getAddress(); |
| | | String outLine = line.equals(Const.A09_OUT_TARGET_POSITION) ? mesD03Address : mesD05Address; |
| | | for (int i = 1; i <= taskList.size(); i++) { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("StartAddToImport" + i).getAddress(), taskList.get(i - 1).getLine()); |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), taskList.get(i - 1).getTargetSlot()); |
| | | log.info("向plc发送第{}片玻璃已完成,起始位置是{},目标位置是", i, taskList.get(i - 1).getLine(), taskList.get(i - 1).getTargetSlot()); |
| | | } |
| | | int returnData = 1; |
| | | int count = 1; |
| | | while (returnData != 0) { |
| | | s7control.writeWord(outLine, 2); |
| | | if (line.equals(Const.A09_OUT_TARGET_POSITION)) { |
| | | returnData = Integer.parseInt(plcMesObject.getPlcParameter("D03ToMES").getValue()); |
| | | } else { |
| | | returnData = Integer.parseInt(plcMesObject.getPlcParameter("D05ToMES").getValue()); |
| | | } |
| | | // returnData = s7control.readWord(outLine, 1).get(0); |
| | | log.info("已向plc第{}次发送进片任务确认,地址为:{},写入的内容为{}", count++, outLine, 2); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 出片一次仅生成一车玻璃 |
| | | // * |
| | | // * @param list |
| | | // * @param isTempering |
| | | // * @param mesToPLCAddress |
| | | // * @param <T> |
| | | // * @return |
| | | // */ |
| | | // private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { |
| | | // //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | // List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | // //打车剩余尺寸 |
| | | // Integer remainWidth = carWidth; |
| | | // int maxX = 0; |
| | | // for (T e : list) { |
| | | // if (bigStorageCageOutTaskList.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) { |
| | | // break; |
| | | // } |
| | | // remainWidth = remainWidth - Math.max((int) e.getWidth(), (int) e.getHeight()) - glassGap; |
| | | // if (isTempering) { |
| | | // int minLength = Math.min((int) e.getWidth(), (int) e.getHeight()); |
| | | // if (maxX + minLength <= xMaxSize) { |
| | | // bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | // e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1, new Date())); |
| | | // maxX = Math.max(maxX, e.getXCoordinate()); |
| | | // } else { |
| | | // break; |
| | | // } |
| | | // |
| | | // } else { |
| | | // bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
| | | // e.getWidth() * 10, e.getHeight(), 0, 0, 1, new Date())); |
| | | // } |
| | | // } |
| | | // Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageOutTaskList), "未获取出片数据,结束出片任务"); |
| | | // log.info("获取出片任务数据{}条,执行保存", bigStorageCageOutTaskList.size()); |
| | | // bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | // List<String> glassIds = bigStorageCageOutTaskList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | // log.info("将出片玻璃{}玻璃状态改为已出片", glassIds); |
| | | // bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | // .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING) |
| | | // .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | // int returnData = 0; |
| | | // int count = 1; |
| | | // while (returnData == 0) { |
| | | // S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | // returnData = S7object.getinstance().plccontrol.readWord(mesToPLCAddress, 1).get(0); |
| | | // log.info("已向plc第{}次发送出片任务确认,地址为:{},写入的内容为{}", count++, mesToPLCAddress, returnData); |
| | | // } |
| | | // return Boolean.TRUE; |
| | | // } |
| | | |
| | | // /** |
| | | // * 出片一次生成一炉玻璃 |
| | | // * |
| | | // * @param list |
| | | // * @param isTempering |
| | | // * @param mesToPLCAddress |
| | | // * @param <T> |
| | | // * @return |
| | | // */ |
| | | // public <T extends BigStorageCageBaseInfo> Boolean computeOutMoreGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { |
| | | // //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | // List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | // //打车剩余尺寸 |
| | | // Integer remainWidth = carWidth; |
| | | // int trainNumber = 1; |
| | | // int serialNumber = 1; |
| | | // int maxX = 0; |
| | | // for (T e : list) { |
| | | // int maxLength = Math.max((int) e.getWidth(), (int) e.getHeight()); |
| | | // if (serialNumber > outCarMaxSize || maxLength > remainWidth) { |
| | | // remainWidth = carWidth; |
| | | // trainNumber = trainNumber + 1; |
| | | // serialNumber = 1; |
| | | // maxX = 0; |
| | | // } |
| | | // remainWidth = remainWidth - maxLength - glassGap; |
| | | // if (isTempering) { |
| | | // int minLength = Math.min((int) e.getWidth(), (int) e.getHeight()); |
| | | // if (maxX + minLength <= xMaxSize) { |
| | | // bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | // e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1, new Date())); |
| | | // maxX = Math.max(maxX, e.getXCoordinate()); |
| | | // } else { |
| | | // remainWidth = carWidth - maxLength - glassGap; |
| | | // trainNumber = trainNumber + 1; |
| | | // serialNumber = 1; |
| | | // maxX = e.getXCoordinate(); |
| | | // bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | // e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1, new Date())); |
| | | // } |
| | | // } else { |
| | | // bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
| | | // e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1, new Date())); |
| | | // } |
| | | // } |
| | | // Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageOutTaskList), "未获取出片数据,结束出片任务"); |
| | | // log.info("获取出片任务数据{}条,执行保存", bigStorageCageOutTaskList.size()); |
| | | // for (BigStorageCageOutTask bigStorageCageOutTask : bigStorageCageOutTaskList |
| | | // ) { |
| | | // bigStorageCageOutTaskService.save(bigStorageCageOutTask); |
| | | // } |
| | | //// bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | // List<String> glassIds = bigStorageCageOutTaskList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | // log.info("将出片玻璃{}玻璃状态改为已出片", glassIds); |
| | | // bigStorageCageDetailsService.update(new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | // .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING) |
| | | // .in(BigStorageCageDetails::getGlassId, glassIds) |
| | | // .ne(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT)); |
| | | // |
| | | // return Boolean.TRUE; |
| | | // } |
| | | |
| | | @Override |
| | | public BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo) { |
| | | // BigStorageDTO bigStorageDTO = null; |
| | | // MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class) |
| | | // .selectAll(BigStorageCage.class) |
| | | // .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | // .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | // .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO) |
| | | // .eq(BigStorageCageDetails::getEngineerId, glassInfo.getEngineerId()) |
| | | // .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | // .gt(BigStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight())) |
| | | // .last("limit 1"); |
| | | // if (glassInfo.getTemperingLayoutId() == 0) { |
| | | // wrapper.eq(BigStorageCageDetails::getFlowCardId, glassInfo.getFlowCardId()) |
| | | // .eq(BigStorageCageDetails::getLayer, glassInfo.getLayer()); |
| | | //// wrapper.eq(BigStorageCageDetails::getWidth, glassInfo.getWidth()).eq(BigStorageCageDetails::getHeight, glassInfo.getHeight()); |
| | | // } else { |
| | | // wrapper.eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1); |
| | | // } |
| | | // BigStorageCage bigStorageCage = bigStorageCageService.selectJoinOne(BigStorageCage.class, wrapper); |
| | | // if (null != bigStorageCage) { |
| | | // log.info("无钢化版图id或根据当前玻璃片序+1找到目标格子:{},玻璃id:{}", bigStorageCage.getSlot(), glassInfo.getGlassId()); |
| | | // bigStorageDTO = new BigStorageDTO(); |
| | | // bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | // bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | // bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | // return bigStorageDTO; |
| | | // } |
| | | // bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | // .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | // .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | //// .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0") |
| | | // .inSql(BigStorageCage::getDeviceId, |
| | | // "select distinct device_id from big_storage_cage_details where engineer_id = '" + glassInfo.getEngineerId() + "' and tempering_layout_id = " + glassInfo.getTemperingLayoutId()) |
| | | // .last("limit 1")); |
| | | // if (null != bigStorageCage) { |
| | | // log.info("根据版图id找到笼子内的目标格子:{},玻璃id:{}", bigStorageCage.getSlot(), glassInfo.getGlassId()); |
| | | // bigStorageDTO = new BigStorageDTO(); |
| | | // bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | // bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | // bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | // return bigStorageDTO; |
| | | // } |
| | | // |
| | | // //获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择 因为子查询排序对主sql无影响,所以先执行子查询获取顺序,然后一次去查询 |
| | | // List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(glassInfo.getThickness()); |
| | | // List<Integer> deviceUseds = bigStorageCageService.queryFreeDeviceByUsed(glassInfo.getThickness()); |
| | | // List<BigStorageCageDetails> engineerCount1 = baseMapper.selectList( |
| | | // new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | // .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | // .select(BigStorageCageDetails::getEngineerId) |
| | | // .groupBy(BigStorageCageDetails::getEngineerId) |
| | | // .between(BigStorageCageDetails::getDeviceId, 1, 5) |
| | | // ); |
| | | // List<BigStorageCageDetails> engineerCount2 = baseMapper.selectList( |
| | | // new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | // .notIn(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | // .select(BigStorageCageDetails::getEngineerId) |
| | | // .groupBy(BigStorageCageDetails::getEngineerId) |
| | | // .between(BigStorageCageDetails::getDeviceId, 6, 8) |
| | | // ); |
| | | // if (engineerCount1.size() > engineerCount2.size()) { |
| | | // deviceUsedList.removeIf(device -> device < 6); |
| | | // } else { |
| | | // deviceUsedList.removeIf(device -> device > 5); |
| | | // } |
| | | // if (CollectionUtils.isEmpty(deviceUsedList)) { |
| | | // deviceUsedList = deviceUseds; |
| | | // } |
| | | // for (Integer item : deviceUsedList) { |
| | | // bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | // .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | // .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | // .eq(BigStorageCage::getDeviceId, item) |
| | | // .last("limit 1")); |
| | | // if (null != bigStorageCage) { |
| | | // log.info("按照存笼玻璃格子数占用最少方式获取信息格子为:{},玻璃id:{}", bigStorageCage.getSlot(), glassInfo.getGlassId()); |
| | | // bigStorageDTO = new BigStorageDTO(); |
| | | // bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | // bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | // bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | // return bigStorageDTO; |
| | | // } |
| | | // } |
| | | |
| | | //获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择 |
| | | // List<Integer> deviceNotUsedList = bigStorageCageService.queryFreeDeviceByNotUsed(glassInfo.getThickness()); |
| | | // for (Integer item : deviceNotUsedList) { |
| | | // bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | // .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | // .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | // .eq(BigStorageCage::getDeviceId, item) |
| | | // .last("limit 1")); |
| | | // if (null != bigStorageCage) { |
| | | // log.info("按照存笼玻璃格子数剩余最多得方式获取信息版图id:{},格子:{},玻璃id:{}", glassInfo.getTemperingLayoutId(), bigStorageCage.getSlot(), glassInfo.getGlassId()); |
| | | // bigStorageDTO = new BigStorageDTO(); |
| | | // bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | // bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | // bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | // return bigStorageDTO; |
| | | // } |
| | | // } |
| | | // Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | // return bigStorageDTO; |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void querySizeByEngineerTask() { |
| | | log.info("查询结果:{}", querySizeByEngineer("P24072402", 1, 10, 8)); |
| | | log.info("查询结果:{}", querySizeByEngineer("P24072402", 1, 5, 8)); |
| | | |
| | | } |
| | | |
| | | public BigStorageDTO querySizeByEngineer(String engineerId, int temperingLayoutId, int temperingFeedSequence, double thickness) { |
| | | BigStorageDTO bigStorageDTO = null; |
| | | BigStorageCage bigStorageCage = null; |
| | | //获取笼内当前版图每个格子已有玻璃的最小版序 获取笼内当前版图的所有玻璃信息 |
| | | List<BigStorageCageDetails> cageDetailsList = bigStorageCageDetailsService.list(new QueryWrapper<BigStorageCageDetails>() |
| | | .select("slot", "min(tempering_feed_sequence) as tempering_feed_sequence") |
| | | .eq("engineer_id", engineerId).eq("tempering_layout_id", temperingLayoutId) |
| | | .in("state", Const.GLASS_STATE_IN_ALL_ZERO).groupBy("slot").orderByAsc("min(tempering_feed_sequence)")); |
| | | if (CollectionUtils.isNotEmpty(cageDetailsList)) { |
| | | Integer minLength = cageDetailsList.stream().filter(e -> e.getTemperingFeedSequence() > temperingFeedSequence) |
| | | .mapToInt(BigStorageCageDetails::getTemperingFeedSequence).min().orElse(1000); |
| | | List<GlassInfo> infoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>() |
| | | .notInSql(GlassInfo::getGlassId, "select glass_id from damage where tempering_layout_id = " + temperingLayoutId + " and engineer_id = '" + engineerId + "'") |
| | | .eq(GlassInfo::getTemperingLayoutId, temperingLayoutId).eq(GlassInfo::getEngineerId, engineerId).orderByAsc(GlassInfo::getTemperingFeedSequence)); |
| | | int remainWidth = carWidth; |
| | | int trainNumber = 1; |
| | | int serialNumber = 0; |
| | | int min = 0; |
| | | int temp = infoList.get(0).getTemperingFeedSequence(); |
| | | int slot = 0; |
| | | int resultTrainNumber = 0; |
| | | for (GlassInfo e : infoList) { |
| | | int maxLength = Math.max((int) e.getWidth(), (int) e.getHeight()); |
| | | if (serialNumber >= outCarMaxSize || maxLength > remainWidth || e.getTemperingFeedSequence() >= minLength) { |
| | | if (resultTrainNumber != 0) { |
| | | min = temp; |
| | | break; |
| | | } |
| | | temp = e.getTemperingFeedSequence(); |
| | | remainWidth = carWidth; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 0; |
| | | } |
| | | if (temperingFeedSequence == e.getTemperingFeedSequence()) { |
| | | resultTrainNumber = trainNumber; |
| | | } |
| | | remainWidth = remainWidth - maxLength - glassGap > 0 ? remainWidth - maxLength - glassGap : 0; |
| | | serialNumber += 1; |
| | | log.info("{},{},{}", trainNumber, remainWidth, serialNumber); |
| | | if (e.getTemperingFeedSequence().equals(infoList.get(infoList.size() - 1).getTemperingFeedSequence())) { |
| | | min = temp; |
| | | } |
| | | } |
| | | for (BigStorageCageDetails item : cageDetailsList) { |
| | | if (min <= item.getTemperingFeedSequence() && item.getTemperingFeedSequence() < minLength) { |
| | | slot = item.getSlot(); |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getSlot, slot).eq(BigStorageCage::getEnableState, Const.SLOT_ON)); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (bigStorageCage != null) { |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | return bigStorageDTO; |
| | | } |
| | | |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where engineer_id = '" + engineerId + "' and tempering_layout_id = " + temperingLayoutId) |
| | | .last("limit 1")); |
| | | if (null != bigStorageCage) { |
| | | log.info("根据版图id找到笼子内的目标格子:{}", bigStorageCage.getSlot()); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | return bigStorageDTO; |
| | | |
| | | } |
| | | |
| | | //获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择 因为子查询排序对主sql无影响,所以先执行子查询获取顺序,然后一次去查询 |
| | | List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(thickness); |
| | | for (Integer item : deviceUsedList) { |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getDeviceId, item) |
| | | .last("limit 1")); |
| | | if (null != bigStorageCage) { |
| | | log.info("按照存笼玻璃格子数占用最少方式获取信息格子为:{}", bigStorageCage.getSlot()); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId()); |
| | | return bigStorageDTO; |
| | | } |
| | | } |
| | | Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | return bigStorageDTO; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <result column="engineer_id" property="engineerId"/> |
| | | <result column="tempering_layout_id" property="temperingLayoutId"/> |
| | | <result column="slot" property="slot"/> |
| | | <result column="glass_count" property="glassCount"/> |
| | | <result column="max_sequence" property="maxSequence"/> |
| | | <result column="min_sequence" property="minSequence"/> |
| | | <result column="remain_width" property="remainWidth"/> |
| | |
| | | SELECT ENGINEER_ID, |
| | | TEMPERING_LAYOUT_ID, |
| | | SLOT, |
| | | count(*) as glass_count, |
| | | MAX(TEMPERING_FEED_SEQUENCE) AS MAX_SEQUENCE, |
| | | MIN(TEMPERING_FEED_SEQUENCE) AS MIN_SEQUENCE |
| | | FROM BIG_STORAGE_CAGE_DETAILS |
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.bigstoragecagetask.mapper.BigStorageCageTaskMapper"> |
| | | |
| | | <resultMap id="baseMap" type="com.mes.bigstoragecagetask.entity.BigStorageCageTask"> |
| | | <result column="glass_id" property="glassId"/> |
| | | <result column="start_slot" property="startSlot"/> |
| | | <result column="target_slot" property="targetSlot"/> |
| | | <result column="task_state" property="taskState"/> |
| | | </resultMap> |
| | | <insert id="saveTaskMessage"> |
| | | INSERT INTO ${tableName} (glass_id, start_slot, target_slot,task_state) |
| | | VALUES |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.glassId}, #{item.startSlot},#{item.targetSlot},#{item.taskState}) |
| | | </foreach> |
| | | </insert> |
| | | <delete id="removeAll"> |
| | | delete |
| | | from ${tableName} |
| | | </delete> |
| | | |
| | | <select id="queryTaskMessage" resultMap="baseMap"> |
| | | select * |
| | | from ${tableName} |
| | | where glass_id is not null |
| | | and glass_id != '' |
| | | </select> |
| | | |
| | | |
| | | <update id="updateTaskMessage"> |
| | | UPDATE ${tableName} |
| | | SET target_slot = #{task.targetSlot} |
| | | where glass_id = #{task.glassId} |
| | | </update> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import com.mes.common.config.Const; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.opctask.entity.LoadGlassDeviceTask; |
| | | import com.mes.opctask.service.LoadGlassDeviceTaskService; |
| | | import com.mes.rawglassdetails.entity.RawGlassStorageDetails; |
| | | import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; |
| | | import com.mes.rawglassstation.entity.RawGlassStorageStation; |
| | | import com.mes.rawglassstation.service.RawGlassStorageStationService; |
| | | import com.mes.rawglasstask.entity.RawGlassStorageTask; |
| | | import com.mes.rawglasstask.service.RawGlassStorageTaskService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.entity.vo.UpPattenUsageVO; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Autowired |
| | | private RawGlassStorageTaskService rawGlassStorageTaskService; |
| | | @Autowired |
| | | private RawGlassStorageStationService rawGlassStorageStationService; |
| | | |
| | | @Resource |
| | | private EngineeringMapper engineeringMapper; |
| | | @Resource |
| | | private UpPattenUsageMapper upPattenUsageMapper; |
| | | |
| | | @Resource |
| | | private LoadGlassDeviceTaskService loadGlassDeviceTaskService; |
| | | |
| | | @Autowired(required = false) |
| | | private MiloService miloService; |
| | | |
| | | private static final List<Integer> LIFTING_STATION = Arrays.asList(4); |
| | | private static final List<String> LOAD_STATION_01 = Arrays.asList("101", "102"); |
| | | private static final List<String> LOAD_STATION_02 = Arrays.asList("103", "104"); |
| | | private static final List<Integer> LOAD_STATION_MAX = Arrays.asList(102, 104); |
| | | |
| | | private static final String LOAD_GLASS_DEVICE_ONE_TASK = "load_glass_device_one_task"; |
| | | |
| | | private static final String LOAD_GLASS_DEVICE_TWO_TASK = "load_glass_device_two_task"; |
| | | |
| | | private static final List<Integer> LOAD_STATION_01 = Arrays.asList(101, 102); |
| | | private static final List<Integer> LOAD_STATION_02 = Arrays.asList(103, 104); |
| | | private static final Integer LEFTING_01 = 98; |
| | | private static final Integer LEFTING_02 = 99; |
| | | private static final Integer LOAD_GLASS_01_01 = 101; |
| | | private static final Integer LOAD_GLASS_01_02 = 102; |
| | | private static final Integer LOAD_GLASS_02_01 = 103; |
| | | private static final Integer LOAD_GLASS_02_02 = 104; |
| | | private static final Integer LOAD_GLASS_ONE_DEVICE = 5; |
| | | private static final Integer LOAD_GLASS_TWO_DEVICE = 6; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void rawStorageTask() throws Exception { |
| | | ReadWriteEntity requestWord = miloService.readFromOpcUa("A01-CC.dev.request"); |
| | | ReadWriteEntity confireWord = miloService.readFromOpcUa("A01-CC.dev.confirmationWord"); |
| | | ReadWriteEntity reportWord = miloService.readFromOpcUa("A01-CC.dev.reportWord"); |
| | | ReadWriteEntity taskWord = miloService.readFromOpcUa("A01-CC.dev.taskWord"); |
| | | ReadWriteEntity requestWord = miloService.readFromOpcUa("PLC.CC.request"); |
| | | ReadWriteEntity confireWord = miloService.readFromOpcUa("PLC.CC.confirmation"); |
| | | ReadWriteEntity reportWord = miloService.readFromOpcUa("PLC.CC.reportWord"); |
| | | ReadWriteEntity taskWord = miloService.readFromOpcUa("PLC.CC.taskWord"); |
| | | String requestValue = requestWord.getValue() + ""; |
| | | if ("0".equals(requestValue)) { |
| | | if ("1".equals(confireWord.getValue() + "") && "0".equals(reportWord.getValue() + "")) { |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | list.add(generateReadWriteEntity("A01-CC.dev.confirmationWord", 0)); |
| | | list.add(generateReadWriteEntity("PLC.CC.confirmation", 0)); |
| | | miloService.writeToOpcWord(list); |
| | | } |
| | | if ("1".equals(taskWord.getValue() + "")) { |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | list.add(generateReadWriteEntity("A01-CC.dev.taskWord", 0)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskSending", 0)); |
| | | list.add(generateReadWriteEntity("A01-CC.dev.startSlot", 0)); |
| | | list.add(generateReadWriteEntity("A01-CC.dev.endSlot", 0)); |
| | | list.add(generateReadWriteEntity("PLC.CC.taskWord", 0)); |
| | | list.add(generateReadWriteEntity("PLC.CC.startSlot", 0)); |
| | | list.add(generateReadWriteEntity("PLC.CC.endSlot", 0)); |
| | | miloService.writeToOpcWord(list); |
| | | } |
| | | return; |
| | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void rawStorageInCar() throws Exception { |
| | | ReadWriteEntity entity = miloService.readFromOpcUa("A01-CC.dev.inCar"); |
| | | ReadWriteEntity entity = miloService.readFromOpcUa("PLC.CC.inCar"); |
| | | String value = entity.getValue() + ""; |
| | | if (!"1".equals(value)) { |
| | | log.info("大车上没有架子"); |
| | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void rawStorageFinish() throws Exception { |
| | | ReadWriteEntity entity = miloService.readFromOpcUa("A01-CC.dev.reportWord"); |
| | | ReadWriteEntity entity = miloService.readFromOpcUa("PLC.CC.reportWord"); |
| | | String value = entity.getValue() + ""; |
| | | if ("0".equals(value)) { |
| | | log.info("当前任务未汇报,结束本次任务"); |
| | |
| | | RawGlassStorageTask task = rawGlassStorageTaskService.getOne(new LambdaQueryWrapper<RawGlassStorageTask>() |
| | | .in(RawGlassStorageTask::getTaskState, Const.RAW_GLASS_TASK_NEW)); |
| | | RawGlassStorageDetails targetDetails = generateDetails(details, task.getEndSlot()); |
| | | int deviceId = details.getDeviceId(); |
| | | Integer taskType = task.getTaskType(); |
| | | if ("1".equals(value)) { |
| | | log.info("将详情表的状态改为已出库"); |
| | |
| | | .set(RawGlassStorageTask::getTaskState, Const.RAW_GLASS_TASK_SUCCESS)); |
| | | switch (taskType) { |
| | | case 1: |
| | | case 3: |
| | | log.info("1、入库,3、调度任务。{}", taskType); |
| | | if (targetDetails.getRemainQuantity() > 0) { |
| | | rawGlassStorageDetailsService.save(targetDetails); |
| | |
| | | log.info("2、出片,4、入库请求。{}", taskType); |
| | | targetDetails = new RawGlassStorageDetails(); |
| | | targetDetails.setSlot(task.getEndSlot()); |
| | | targetDetails.setDeviceId(deviceId); |
| | | targetDetails.setShelf(task.getStartSlot()); |
| | | targetDetails.setState(Const.RAW_GLASS_STATE_IN); |
| | | rawGlassStorageDetailsService.save(targetDetails); |
| | |
| | | |
| | | } |
| | | List<ReadWriteEntity> list = new ArrayList<>(); |
| | | list.add(generateReadWriteEntity("A01-CC.dev.confirmationWord", 1)); |
| | | list.add(generateReadWriteEntity("PLC.CC.confirmation", 1)); |
| | | miloService.writeToOpcWord(list); |
| | | } |
| | | |
| | |
| | | rawGlassStorageDetailsService.generateTask(startSlot, lefting, startSlot, rawGlassList.get(0).getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_OUT); |
| | | |
| | | // List<ReadWriteEntity> list = new ArrayList<>(); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskSending", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.startSlot", startSlot)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.endSlot", lefting)); |
| | | // list.add(generateReadWriteEntity("PLC.CC.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("PLC.CC.taskSending", 1)); |
| | | // list.add(generateReadWriteEntity("PLC.CC.startSlot", startSlot)); |
| | | // list.add(generateReadWriteEntity("PLC.CC.endSlot", lefting)); |
| | | // miloService.writeToOpcWord(list); |
| | | |
| | | //修改出片任务状态 |
| | |
| | | rawGlassStorageDetailsService.generateTask(details.getSlot(), details.getShelf(), details.getShelf(), |
| | | details.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_IN); |
| | | // List<ReadWriteEntity> list = new ArrayList<>(); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskSending", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.startSlot", details.getSlot())); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.endSlot", details.getShelf())); |
| | | // list.add(generateReadWriteEntity("PLC.CC.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("PLC.CC.taskSending", 1)); |
| | | // list.add(generateReadWriteEntity("PLC.CC.startSlot", details.getSlot())); |
| | | // list.add(generateReadWriteEntity("PLC.CC.endSlot", details.getShelf())); |
| | | // miloService.writeToOpcWord(list); |
| | | //生成工位任务,将吊装位的玻璃状态改位进笼中 |
| | | //修改吊装位的原片状态为103 出片中 |
| | |
| | | log.info("正在执行的工程原片无可上片的原片信息"); |
| | | return Boolean.FALSE; |
| | | } |
| | | //获取当前上片位1号架子信息 |
| | | int endSlot = stationCell == LOAD_GLASS_01_01 ? LOAD_GLASS_01_01 : LOAD_GLASS_02_01; |
| | | int endSlot02 = stationCell == LOAD_GLASS_01_02 ? LOAD_GLASS_01_01 : LOAD_GLASS_02_02; |
| | | //获取当前需要上片的原片数据 |
| | | Map<String, List<UpPattenUsageVO>> upListMap = pattenUsageList.stream() |
| | | .collect(Collectors.groupingBy(UpPattenUsageVO::getGroupNumber)); |
| | | //1、查询2个上片的原片详情 |
| | | List<RawGlassStorageDetails> rawGlassDetailsList = rawGlassStorageDetailsService.list(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getState, Const.GLASS_STATE_IN).in(RawGlassStorageDetails::getDeviceId, stationCell) |
| | | .orderByAsc(RawGlassStorageDetails::getSlot)); |
| | | List<UpPattenUsageVO> upPattenUsage01VOS = upListMap.get("1"); |
| | | UpPattenUsageVO usageVO = upPattenUsage01VOS.get(0); |
| | | if (CollectionUtils.isEmpty(rawGlassDetailsList)) { |
| | | //表示1上片位没有架子,直接找原片放入对应路线的1号上片位 |
| | | RawGlassStorageDetails details = rawGlassStorageDetailsService.getOne(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getFilmsId, usageVO.getFilmsId()) |
| | | .eq(RawGlassStorageDetails::getPatternWidth, usageVO.getWidth()) |
| | | .eq(RawGlassStorageDetails::getPatternHeight, usageVO.getHeight()) |
| | | .eq(RawGlassStorageDetails::getPatternThickness, usageVO.getThickness()) |
| | | .inSql(RawGlassStorageDetails::getSlot, "select slot from raw_glass_storage_station where enable_state = 1") |
| | | .eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | // .gt(RawGlassStorageDetails::getRemainQuantity, upPattenUsage01VOS.size()) |
| | | .orderByAsc(RawGlassStorageDetails::getRemainQuantity) |
| | | .last("limit 1") |
| | | ); |
| | | rawGlassStorageDetailsService.generateTask(details.getSlot(), endSlot, details.getSlot(), details.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | List<UpPattenUsageVO> usageVOS = upListMap.get("1"); |
| | | //获取当前上片位1号架子信息 |
| | | List<Integer> loadStation = LOAD_GLASS_ONE_DEVICE.equals(stationCell) ? LOAD_STATION_01 : LOAD_STATION_02; |
| | | List<RawGlassStorageStation> stations = rawGlassStorageStationService.list(new LambdaQueryWrapper<RawGlassStorageStation>() |
| | | .in(RawGlassStorageStation::getSlot, loadStation) |
| | | .eq(RawGlassStorageStation::getEnableState, Const.SLOT_ON).orderByAsc(RawGlassStorageStation::getSlot)); |
| | | if (CollectionUtils.isEmpty(stations)) { |
| | | log.info("没有可用的上片位"); |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | |
| | | List<RawGlassStorageDetails> loadStationList = rawGlassStorageDetailsService.list(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | | .inSql(RawGlassStorageDetails::getSlot, "select slot from raw_glass_storage_station where enable_state = 1") |
| | | .eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .eq(RawGlassStorageDetails::getDeviceId, stationCell)); |
| | | if (stations.size() == 1) { |
| | | if (CollectionUtils.isEmpty(loadStationList)) { |
| | | RawGlassStorageDetails rawDetails = getRawGlassStorageDetailsBySize(usageVOS.get(0), usageVOS.size()); |
| | | rawGlassStorageDetailsService.generateTask(rawDetails.getSlot(), stations.get(0).getSlot(), rawDetails.getShelf(), rawDetails.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | //结束调度任务 修改工位状态(起始位)状态为103 RAW_GLASS_STATE_RUNNING 任务完成后将状态改为101 目标位新增一条数据,架子号为(起始位) |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, rawDetails.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | RawGlassStorageDetails oneLoadStation = loadStationList.get(0); |
| | | if (oneLoadStation.getRemainQuantity() <= 0 || !compareRawSize(usageVOS.get(0), oneLoadStation)) { |
| | | rawGlassStorageDetailsService.generateTask(stations.get(0).getSlot(), oneLoadStation.getShelf(), oneLoadStation.getShelf(), oneLoadStation.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, oneLoadStation.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getDeviceId, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.FALSE; |
| | | } |
| | | } |
| | | |
| | | log.info("获取{}上片线的工位信息{}", stationCell, loadStationList); |
| | | if (CollectionUtils.isEmpty(loadStationList)) { |
| | | log.info("1号上片位生成调度任务"); |
| | | RawGlassStorageDetails rawDetails = getRawGlassStorageDetailsBySize(usageVOS.get(0), usageVOS.size()); |
| | | rawGlassStorageDetailsService.generateTask(rawDetails.getSlot(), loadStation.get(0), rawDetails.getShelf(), rawDetails.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | //结束调度任务 修改工位状态(起始位)状态为103 RAW_GLASS_STATE_RUNNING 任务完成后将状态改为101 目标位新增一条数据,架子号为(起始位) |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, details.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getDeviceId, Const.RAW_GLASS_STATE_RUNNING)); |
| | | .eq(RawGlassStorageDetails::getSlot, rawDetails.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | RawGlassStorageDetails glassStorageDetails = rawGlassDetailsList.get(0); |
| | | if (rawGlassDetailsList.size() == 2) { |
| | | if (!((usageVO.getWidth() == glassStorageDetails.getPatternWidth() && usageVO.getHeight() == glassStorageDetails.getPatternHeight() && |
| | | usageVO.getThickness() == glassStorageDetails.getPatternThickness() && usageVO.getFilmsId().equals(glassStorageDetails.getFilmsId()))) |
| | | || ((usageVO.getWidth() == glassStorageDetails.getPatternWidth() && usageVO.getHeight() == glassStorageDetails.getPatternHeight() && |
| | | usageVO.getThickness() == glassStorageDetails.getPatternThickness() && usageVO.getFilmsId().equals(glassStorageDetails.getFilmsId())) |
| | | && glassStorageDetails.getRemainQuantity() == 0)) { |
| | | //将架子放回原工位上 |
| | | rawGlassStorageDetailsService.generateTask(endSlot, glassStorageDetails.getShelf(), glassStorageDetails.getShelf(), 0, Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | // List<ReadWriteEntity> list = new ArrayList<>(); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskSending", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.startSlot", endSlot)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.endSlot", glassStorageDetails.getShelf())); |
| | | // miloService.writeToOpcWord(list); |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, glassStorageDetails.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | return Boolean.FALSE; |
| | | } |
| | | //todo:1条线且当条线为2号上片为 |
| | | if (LOAD_STATION_MAX.contains(glassStorageDetails.getSlot())) { |
| | | log.info("上片位2号有架子,结束本条线{}的调度任务", stationCell); |
| | | if (!((usageVO.getWidth() == glassStorageDetails.getPatternWidth() && usageVO.getHeight() == glassStorageDetails.getPatternHeight() && |
| | | usageVO.getThickness() == glassStorageDetails.getPatternThickness() && usageVO.getFilmsId().equals(glassStorageDetails.getFilmsId()))) |
| | | || ((usageVO.getWidth() == glassStorageDetails.getPatternWidth() && usageVO.getHeight() == glassStorageDetails.getPatternHeight() && |
| | | usageVO.getThickness() == glassStorageDetails.getPatternThickness() && usageVO.getFilmsId().equals(glassStorageDetails.getFilmsId())) |
| | | && glassStorageDetails.getRemainQuantity() == 0)) { |
| | | //将架子放回原工位上 |
| | | rawGlassStorageDetailsService.generateTask(endSlot02, glassStorageDetails.getShelf(), glassStorageDetails.getShelf(), 0, Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | // List<ReadWriteEntity> list = new ArrayList<>(); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskSending", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.startSlot", endSlot02)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.endSlot", glassStorageDetails.getShelf())); |
| | | // miloService.writeToOpcWord(list); |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, glassStorageDetails.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | return Boolean.FALSE; |
| | | } else { |
| | | //比较当前1号架子上的玻璃剩余数量是否为0或者已用完 |
| | | if (usageVO.getWidth() == glassStorageDetails.getPatternWidth() && usageVO.getHeight() == glassStorageDetails.getPatternHeight() && |
| | | usageVO.getThickness() == glassStorageDetails.getPatternThickness() && usageVO.getFilmsId().equals(glassStorageDetails.getFilmsId())) { |
| | | RawGlassStorageDetails details = null; |
| | | if (upPattenUsage01VOS.size() > glassStorageDetails.getRemainQuantity()) { |
| | | //2号位上片:继续当前尺寸的原片 |
| | | details = rawGlassStorageDetailsService.getOne(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getFilmsId, usageVO.getFilmsId()) |
| | | .eq(RawGlassStorageDetails::getPatternWidth, usageVO.getWidth()) |
| | | .eq(RawGlassStorageDetails::getPatternHeight, usageVO.getHeight()) |
| | | .eq(RawGlassStorageDetails::getPatternThickness, usageVO.getThickness()) |
| | | .gt(RawGlassStorageDetails::getRemainQuantity, upPattenUsage01VOS.size()) |
| | | .orderByAsc(RawGlassStorageDetails::getRemainQuantity) |
| | | .last("limit 1")); |
| | | RawGlassStorageDetails oneLoadStation = loadStationList.stream().filter(e -> e.getSlot().equals(loadStation.get(0))).findFirst().orElse(null); |
| | | if (null == oneLoadStation) { |
| | | RawGlassStorageDetails twoLoadStation = loadStationList.stream().filter(e -> e.getSlot().equals(loadStation.get(1))).findFirst().orElse(null); |
| | | if (twoLoadStation.getRemainQuantity() > 0) { |
| | | if (compareRawSize(usageVOS.get(0), twoLoadStation)) { |
| | | // 2号上片位的原片信息源工程信息一致,可上片操作,结束本次任务 |
| | | return Boolean.FALSE; |
| | | } else { |
| | | //2号位上片:获取第二种尺寸的原片 |
| | | List<UpPattenUsageVO> upPattenUsage02VOS = upListMap.get("2"); |
| | | if (CollectionUtils.isEmpty(upPattenUsage01VOS)) { |
| | | return Boolean.FALSE; |
| | | } |
| | | usageVO = upPattenUsage02VOS.get(0); |
| | | details = rawGlassStorageDetailsService.getOne(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getFilmsId, usageVO.getFilmsId()) |
| | | .eq(RawGlassStorageDetails::getPatternWidth, usageVO.getWidth()) |
| | | .eq(RawGlassStorageDetails::getPatternHeight, usageVO.getHeight()) |
| | | .eq(RawGlassStorageDetails::getPatternThickness, usageVO.getThickness()) |
| | | .gt(RawGlassStorageDetails::getRemainQuantity, upPattenUsage01VOS.size()) |
| | | .orderByAsc(RawGlassStorageDetails::getRemainQuantity) |
| | | .last("limit 1")); |
| | | // 生成1号位入库任务 |
| | | log.info("2号上片位玻璃尺寸不一致,1号上片位生成调度任务"); |
| | | //按照尺寸及数量获取数量最接近的格子信息 |
| | | RawGlassStorageDetails rawDetails = getRawGlassStorageDetailsBySize(usageVOS.get(0), usageVOS.size()); |
| | | rawGlassStorageDetailsService.generateTask(rawDetails.getSlot(), loadStation.get(0), rawDetails.getShelf(), rawDetails.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | //结束调度任务 修改工位状态(起始位)状态为103 RAW_GLASS_STATE_RUNNING 任务完成后将状态改为101 目标位新增一条数据,架子号为(起始位) |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, rawDetails.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getDeviceId, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | //将工位的架子传送到上片位 |
| | | rawGlassStorageDetailsService.generateTask(details.getSlot(), endSlot02, details.getShelf(), details.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, details.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getDeviceId, Const.RAW_GLASS_STATE_RUNNING)); |
| | | |
| | | // List<ReadWriteEntity> list = new ArrayList<>(); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskSending", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.startSlot", glassStorageDetails.getShelf())); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.endSlot", endSlot02)); |
| | | // miloService.writeToOpcWord(list); |
| | | |
| | | return Boolean.TRUE; |
| | | } else { |
| | | //将架子放回原工位上 |
| | | rawGlassStorageDetailsService.generateTask(endSlot, glassStorageDetails.getShelf(), glassStorageDetails.getShelf(), glassStorageDetails.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | // 生成1号位入库任务 |
| | | log.info("2号上片位仅剩空架子,1号上片位生成调度任务"); |
| | | RawGlassStorageDetails rawDetails = getRawGlassStorageDetailsBySize(usageVOS.get(0), usageVOS.size()); |
| | | rawGlassStorageDetailsService.generateTask(rawDetails.getSlot(), loadStation.get(0), rawDetails.getShelf(), rawDetails.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, endSlot).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .eq(RawGlassStorageDetails::getSlot, rawDetails.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getDeviceId, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | } else { |
| | | String tableName = stationCell == 5 ? LOAD_GLASS_DEVICE_ONE_TASK : LOAD_GLASS_DEVICE_TWO_TASK; |
| | | if (oneLoadStation.getRemainQuantity() > 0) { |
| | | if (compareRawSize(usageVOS.get(0), oneLoadStation)) { |
| | | //结束仓储调度,等待上片任务 |
| | | //在上片任务执行空闲过程中,可执行二号位出入库任务 二号架子的信息是否需要调度,不需要调度直接放回false |
| | | log.info("获取二号位原片信息"); |
| | | RawGlassStorageDetails twoLoadStation = loadStationList.stream().filter(e -> e.getSlot().equals(loadStation.get(1))).findFirst().orElse(null); |
| | | if (null == twoLoadStation) { |
| | | //按照尺寸生成二号位上片任务信息 |
| | | LoadGlassDeviceTask loadTask = loadGlassDeviceTaskService.queryTaskMessage(tableName); |
| | | RawGlassStorageDetails rawDetails = null; |
| | | if (oneLoadStation.getRemainQuantity() > (loadTask.getTotalCount() + loadTask.getDamageCount())) { |
| | | usageVOS = upListMap.get("2"); |
| | | if (CollectionUtils.isEmpty(usageVOS)) { |
| | | log.info("当前工程的原片即将用完,结束本次调度"); |
| | | return Boolean.FALSE; |
| | | } |
| | | rawDetails = getRawGlassStorageDetailsBySize(usageVOS.get(0), usageVOS.size()); |
| | | } else { |
| | | rawDetails = getRawGlassStorageDetailsBySize(usageVOS.get(0), usageVOS.size()); |
| | | |
| | | // List<ReadWriteEntity> list = new ArrayList<>(); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskWord", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.taskSending", 1)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.startSlot", endSlot)); |
| | | // list.add(generateReadWriteEntity("A01-CC.dev.endSlot", glassStorageDetails.getShelf())); |
| | | // miloService.writeToOpcWord(list); |
| | | } |
| | | if (null == rawDetails) { |
| | | log.info("原片仓储没有相同尺寸的玻璃"); |
| | | return Boolean.FALSE; |
| | | } |
| | | rawGlassStorageDetailsService.generateTask(rawDetails.getSlot(), loadStation.get(1), rawDetails.getShelf(), rawDetails.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | //结束调度任务 修改工位状态(起始位)状态为103 RAW_GLASS_STATE_RUNNING 任务完成后将状态改为101 目标位新增一条数据,架子号为(起始位) |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, rawDetails.getSlot()).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } else { |
| | | //todo:当二号为的尺寸大于0时,是否执行调度任务,更换当前原片的尺寸,等待下一次任务的直接执行;还是继续等待,当尺寸不一样,等待一号工位的进出库调度任务。 |
| | | if (twoLoadStation.getRemainQuantity() > 0) { |
| | | LoadGlassDeviceTask loadTask = loadGlassDeviceTaskService.queryTaskMessage(tableName); |
| | | if (oneLoadStation.getRemainQuantity() > (loadTask.getTotalCount() + loadTask.getDamageCount())) { |
| | | usageVOS = upListMap.get("2"); |
| | | if (CollectionUtils.isEmpty(usageVOS)) { |
| | | log.info("当前工程的原片即将用完,结束本次调度"); |
| | | return Boolean.FALSE; |
| | | } |
| | | } |
| | | if (compareRawSize(usageVOS.get(0), twoLoadStation)) { |
| | | // //2号上片位的原片信息源工程信息一致,可上片操作,结束本次任务 |
| | | return Boolean.FALSE; |
| | | } else { |
| | | // 生成1号位入库任务 |
| | | log.info("2号上片位玻璃尺寸不一致,2号上片位生成出片调度任务"); |
| | | //按照尺寸及数量获取数量最接近的格子信息 |
| | | rawGlassStorageDetailsService.generateTask(loadStation.get(1), twoLoadStation.getShelf(), twoLoadStation.getShelf(), twoLoadStation.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | //结束调度任务 修改工位状态(起始位)状态为103 RAW_GLASS_STATE_RUNNING 任务完成后将状态改为101 目标位新增一条数据,架子号为(起始位) |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, loadStation.get(1)).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | } else { |
| | | //todo:生成出库任务 |
| | | rawGlassStorageDetailsService.generateTask(loadStation.get(1), twoLoadStation.getShelf(), twoLoadStation.getShelf(), twoLoadStation.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | //结束调度任务 修改工位状态(起始位)状态为103 RAW_GLASS_STATE_RUNNING 任务完成后将状态改为101 目标位新增一条数据,架子号为(起始位) |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, loadStation.get(1)).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | // return Boolean.FALSE; |
| | | } else { |
| | | log.info("2号上片位仅剩空架子,1号上片位生成出库调度任务"); |
| | | rawGlassStorageDetailsService.generateTask(loadStation.get(0), oneLoadStation.getShelf(), oneLoadStation.getShelf(), oneLoadStation.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, loadStation.get(0)).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | } else { |
| | | log.info("1号上片位玻璃尺寸不一致,1号上片位生成出库调度任务"); |
| | | rawGlassStorageDetailsService.generateTask(loadStation.get(0), oneLoadStation.getSlot(), oneLoadStation.getShelf(), oneLoadStation.getRemainQuantity(), Const.RAW_GLASS_TASK_TYPE_DISPATCH); |
| | | rawGlassStorageDetailsService.update(new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getSlot, loadStation.get(0)).eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | | .set(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_RUNNING)); |
| | | return Boolean.TRUE; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private RawGlassStorageDetails generateDetails(RawGlassStorageDetails details, Integer targetSlot) { |
| | | |
| | | RawGlassStorageDetails targetDetails = new RawGlassStorageDetails(); |
| | | // details.setDeviceId(); |
| | | RawGlassStorageStation station = rawGlassStorageStationService.getOne(new LambdaQueryWrapper<RawGlassStorageStation>() |
| | | .eq(RawGlassStorageStation::getSlot, targetSlot)); |
| | | targetDetails.setDeviceId(station.getDeviceId()); |
| | | targetDetails.setSlot(targetSlot); |
| | | targetDetails.setShelf(details.getShelf()); |
| | | targetDetails.setPatternWidth(details.getPatternWidth()); |
| | |
| | | return readWriteEntity; |
| | | } |
| | | |
| | | private RawGlassStorageDetails getRawGlassStorageDetailsBySize(UpPattenUsageVO usageVO, int remainQuantity) { |
| | | return rawGlassStorageDetailsService.getOne(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | | .eq(RawGlassStorageDetails::getFilmsId, usageVO.getFilmsId()) |
| | | .eq(RawGlassStorageDetails::getPatternWidth, usageVO.getWidth()) |
| | | .eq(RawGlassStorageDetails::getPatternHeight, usageVO.getHeight()) |
| | | .eq(RawGlassStorageDetails::getPatternThickness, usageVO.getThickness()) |
| | | .eq(RawGlassStorageDetails::getState, Const.GLASS_STATE_IN) |
| | | .orderByAsc(RawGlassStorageDetails::getRemainQuantity) |
| | | .last("order by abs(t.remain_quantity - " + remainQuantity + ") asc") |
| | | .last("limit 1")); |
| | | } |
| | | |
| | | /** |
| | | * 尺寸一样并且原片数量大于0 |
| | | * |
| | | * @param upPattenUsage |
| | | * @param details |
| | | * @return |
| | | */ |
| | | private boolean compareRawSize(UpPattenUsage upPattenUsage, RawGlassStorageDetails details) { |
| | | boolean flag = upPattenUsage.getWidth() == details.getPatternWidth() && upPattenUsage.getHeight() == details.getPatternHeight() && |
| | | upPattenUsage.getThickness() == details.getPatternThickness() && upPattenUsage.getFilmsId().equals(details.getFilmsId()); |
| | | return flag; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8&allowMultiQueries=true |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | druid: |
| | | wall: |
| | | multi-statement-allow: true |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | |
| | | @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); |
| | | return Result.build(200, "成功", null); |
| | | }else { |
| | | return Result.build(100,"成功",glass); |
| | | return Result.build(100, "成功", null); |
| | | } |
| | | } |
| | | |
| | |
| | | log.info("engineeringId:{}", engineering); |
| | | UpPattenUsage upPattenUsage = upPattenUsageService.selectedEngineering(engineering.getEngineerId()); |
| | | if (upPattenUsage != null) { |
| | | boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState()); |
| | | boolean work = engineeringService.changeTask(engineering.getEngineerId(), engineering.getState()); |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist(); |
| | | optimizeProjectService.changeTask(engineering.getEngineerId(), 200); |
| | | return Result.build(200, "已保存过", work); |
| | |
| | | engineeringService.saveEngineering(listEngineering); |
| | | log.info("更改pp表状态为已领取"); |
| | | //将engineering表状态为正在上片 |
| | | boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState()); |
| | | boolean work = engineeringService.changeTask(engineering.getEngineerId(), engineering.getState()); |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist(); |
| | | optimizeProjectService.changeTask(engineering.getEngineerId(), 200); |
| | | if (work) { |
New file |
| | |
| | | package com.mes.engineering.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class Engineering implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 工程表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 设备 |
| | | */ |
| | | private Integer stationCell; |
| | | |
| | | /** |
| | | * 除膜方式 |
| | | */ |
| | | private Integer filmRemove; |
| | | |
| | | /** |
| | | * 工程名称 |
| | | */ |
| | | private String engineerName; |
| | | |
| | | /** |
| | | * 平均利用率 |
| | | */ |
| | | private double avgAvailability; |
| | | |
| | | /** |
| | | * 有效利用率 |
| | | */ |
| | | private double validAvailability; |
| | | |
| | | /** |
| | | * 尾片利用率 |
| | | */ |
| | | private double lastAvailability; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | private Integer state; |
| | | |
| | | /** |
| | | * 小片总数 |
| | | */ |
| | | private Integer glassTotal; |
| | | |
| | | /** |
| | | * 小片总面积 |
| | | */ |
| | | private double glassTotalArea; |
| | | |
| | | /** |
| | | * 计划原片总数 |
| | | */ |
| | | private Integer planPatternTotal; |
| | | |
| | | /** |
| | | * 计划原片总面积 |
| | | */ |
| | | private double planPatternTotalArea; |
| | | |
| | | /** |
| | | * 实际原片总数 |
| | | */ |
| | | private Integer realityPatternTotal; |
| | | |
| | | /** |
| | | * 实际原片总面积 |
| | | */ |
| | | private double realityPatternTotalArea; |
| | | |
| | | /** |
| | | * 膜系id |
| | | */ |
| | | private String filmsId; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String notes; |
| | | |
| | | } |
| | |
| | | List<Engineering> selectTask(); |
| | | |
| | | boolean pauseTask(String engineerId, Integer state); |
| | | |
| | | boolean changeTask(String engineerId, Integer state, Integer filmRemove, Integer stationCell); |
| | | } |
| | |
| | | public Engineering selectInitiate(Integer state) { |
| | | //查询是否有开始上片的工程任务 |
| | | QueryWrapper<Engineering> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("state", state); |
| | | wrapper.eq("state", state) |
| | | .last("limit 1"); |
| | | return engineeringMapper.selectOne(wrapper); |
| | | } |
| | | |
| | |
| | | public boolean pauseTask(String engineerId, Integer state) { |
| | | //暂停正在进行工程 |
| | | LambdaUpdateChainWrapper<Engineering> pauseWrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper()); |
| | | pauseWrapper.set(Engineering::getState,0); |
| | | pauseWrapper.eq(Engineering::getState,1); |
| | | return pauseWrapper.update(); |
| | | pauseWrapper.set(Engineering::getState, state); |
| | | pauseWrapper.eq(Engineering::getEngineerId, engineerId); |
| | | return pauseWrapper.update(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | //2、1号上片位是否有原片,原片尺寸是否和上片待上片的尺寸一致 |
| | | //3、1号无原片,且没有架子,2号上片位尺寸是否和带上片尺寸一致 |
| | | //4、不一致可能出现玻璃破损导致的上一架原片数量不够 |
| | | @Scheduled(fixedDelay = 300) |
| | | public void opcLoadGlassOne() { |
| | | opcLoadGlassChild(LOAD_GLASS_DEVICE_ONE_TASK, LOAD_GLASS_ONE_DEVICE); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void opcLoadGlassTwo() { |
| | | opcLoadGlassChild(LOAD_GLASS_DEVICE_TWO_TASK, LOAD_GLASS_TWO_DEVICE); |
| | | } |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void opcLoadGlassOneFinish() { |
| | | opcLoadGlassFinishChid(LOAD_GLASS_DEVICE_ONE_TASK, LOAD_GLASS_ONE_DEVICE); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void opcLoadGlassTwoFinish() { |
| | | opcLoadGlassFinishChid(LOAD_GLASS_DEVICE_TWO_TASK, LOAD_GLASS_TWO_DEVICE); |
| | | } |
| | |
| | | .eq(Engineering::getState, Const.ENGINEERING_RUNNING).eq(Engineering::getStationCell, deviceId)); |
| | | if (null == engineering) { |
| | | log.info("{}上片线,没有工程任务", deviceId); |
| | | return; |
| | | } |
| | | //任务暂停 |
| | | LoadGlassDeviceTask task = loadGlassDeviceTaskService.queryTaskMessage(tableName); |
| | | if ("1".equals(task.getTaskState())) { |
| | | log.info("有正在执行的上片任务,结束本地上片请求"); |
| | | if (0 == task.getInkageState()) { |
| | | log.info("{}上片线,处于离线状态:{},结束本地上片请求", deviceId, task.getInkageState()); |
| | | return; |
| | | } |
| | | if (task.getTaskRunning().equals(Const.ENGINEERING_RUNNING)) { |
| | | log.info("{}上片线,有正在执行的任务,结束本地上片请求", deviceId); |
| | | return; |
| | | } |
| | | List<UpPattenUsageVO> pattenUsageList = upPattenUsageMapper.queryRawGlassByEngineeringId(engineering.getEngineerId()); |
| | |
| | | Map<String, List<UpPattenUsageVO>> upListMap = pattenUsageList.stream() |
| | | .collect(Collectors.groupingBy(UpPattenUsageVO::getGroupNumber)); |
| | | log.info("获取当前需要上片的原片数据"); |
| | | List<UpPattenUsageVO> usageVOS = upListMap.get(0); |
| | | List<UpPattenUsageVO> usageVOS = upListMap.get("1"); |
| | | // 获取1号上片位是有架子且有玻璃 |
| | | List<Integer> loadStation = LOAD_GLASS_DEVICE_ONE_TASK.equals(tableName) ? LOAD_STATION_01 : LOAD_STATION_02; |
| | | List<RawGlassStorageDetails> loadStationList = rawGlassStorageDetailsService.list(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | |
| | | RawGlassStorageDetails oneLoadStation = loadStationList.stream().filter(e -> e.getSlot().equals(loadStation.get(0))).findFirst().orElse(null); |
| | | if (null == oneLoadStation) { |
| | | RawGlassStorageDetails twoLoadStation = loadStationList.stream().filter(e -> e.getSlot().equals(loadStation.get(1))).findFirst().orElse(null); |
| | | if (!compareRawSize(usageVOS.get(0), oneLoadStation)) { |
| | | if (!compareRawSize(usageVOS.get(0), twoLoadStation)) { |
| | | log.info("二号上片位有架子,原片数量为0或者原片信息与待上片尺寸不一致,结束本次上片任务,等待仓储调度任务"); |
| | | return; |
| | | } |
| | |
| | | |
| | | private void opcLoadGlassFinishChid(String tableName, Integer deviceId) { |
| | | LoadGlassDeviceTask task = loadGlassDeviceTaskService.queryTaskMessage(tableName); |
| | | if (task.getTaskRunning().equals(Const.ENGINEERING_NEW)) { |
| | | log.info("无任务,结束"); |
| | | return; |
| | | } |
| | | if (task.getTaskState() <= 1) { |
| | | log.info("无任务或任务正在执行中"); |
| | | log.info("任务正在执行,结束"); |
| | | return; |
| | | } |
| | | //获取任务完成情况 |
| | |
| | | .inSql("slot", "select slot from raw_glass_storage_station where enable_state = 1") |
| | | .eq("slot", task.getSlot()) |
| | | .eq("state", Const.RAW_GLASS_STATE_IN) |
| | | .set("remain_quantity", "remain_quantity - " + (finishCount + damageCount))); |
| | | .setSql("remain_quantity = remain_quantity - " + (finishCount + damageCount))); |
| | | //更新工程下的原片数量 todo:sql待优化 |
| | | upPattenUsageMapper.update(null, new LambdaUpdateWrapper<UpPattenUsage>() |
| | | .inSql(UpPattenUsage::getId, " SELECT id FROM up_patten_usage ORDER BY id ASC LIMIT 10") |
| | | .set(UpPattenUsage::getState, Const.LOAD_RAW_GLASS_SUCCESS)); |
| | | |
| | | if (finishCount > 0) { |
| | | List<Integer> ids = upPattenUsageMapper.queryFinishByEngineering(deviceId, finishCount); |
| | | upPattenUsageMapper.update(null, new LambdaUpdateWrapper<UpPattenUsage>() |
| | | .in(UpPattenUsage::getId, ids) |
| | | .set(UpPattenUsage::getState, Const.LOAD_RAW_GLASS_SUCCESS)); |
| | | } |
| | | //todo:任务表数据情况 |
| | | task.setTaskRunning(0); |
| | | task.setTotalCount(0); |
| | |
| | | private EngineeringService engineeringService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | |
| | | |
| | | @ApiOperation("显示选择的工程信息") |
| | | @GetMapping("/prioritylist") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | |
| | | @PostMapping("/selectUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<List<UpPattenUsage>> selectUpPattenUsage(@RequestBody Engineering engineering) { |
| | | List<UpPattenUsage> upPattenUsages=null; |
| | | List<UpPattenUsage> upPattenUsages = null; |
| | | UpPattenUsage upPattenUsage = upPattenUsageService.selectedEngineering(engineering.getEngineerId()); |
| | | if(upPattenUsage == null){ |
| | | if (upPattenUsage == null) { |
| | | // return Result.build(200, "失败无数据", null); |
| | | // upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId(), engineering.getFilmRemove(), engineering.getStationCell()); |
| | | upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId()); |
| | | }else { |
| | | upPattenUsages= upPattenUsageService.selectUpPattenUsage(upPattenUsage); |
| | | } else { |
| | | upPattenUsages = upPattenUsageService.selectUpPattenUsage(upPattenUsage); |
| | | } |
| | | |
| | | if (!upPattenUsages.isEmpty()) { |
| | | return Result.build(200, "成功", upPattenUsages); |
| | | }else { |
| | | } else { |
| | | return Result.build(100, "失败", upPattenUsages); |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public Result<Boolean> updateGlassState(@RequestBody UpPattenUsage upPattenUsage) { |
| | | Boolean whether = upPattenUsageService.updateGlassState(upPattenUsage); |
| | | if (whether){ |
| | | if (whether) { |
| | | return Result.build(200, "成功", whether); |
| | | }else { |
| | | } else { |
| | | return Result.build(100, "失败", whether); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation("设置上片查询条件") |
| | | @PostMapping("/setUpPattenRequest") |
| | | public Result setRawGlassTaskRequest(@RequestBody Engineering request) { |
| | | log.info("查询上片信息:{}", request); |
| | | return Result.build(200, "查询成功", upPattenUsageService.setRawGlassTaskRequest(request)); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.mes.uppattenusage.service; |
| | | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | |
| | | import java.util.List; |
| | |
| | | * 更新上片表状态 |
| | | */ |
| | | void updateUpPattenUsageState(UpPattenUsage upPattenUsage, Integer state); |
| | | |
| | | /** |
| | | * 判断此工程是否已保存过 |
| | | * |
| | | * @return UpPattenUsage |
| | | */ |
| | | UpPattenUsage selectedEngineering(String engineeringId); |
| | | UpPattenUsage selectedTaskEngineering(String engineeringId); |
| | | |
| | | /** |
| | | * 查询正在执行的上片任务 |
| | | * |
| | | * @return UpPattenUsage |
| | | */ |
| | | UpPattenUsage selectOverTask(); |
| | |
| | | |
| | | /** |
| | | * 更改上片玻璃状态 |
| | | * |
| | | * @return UpPattenUsage |
| | | */ |
| | | Boolean updateGlassState(UpPattenUsage upPattenUsage); |
| | | |
| | | List<Engineering> setRawGlassTaskRequest(Engineering request); |
| | | |
| | | // List<UpPattenUsage> selectSaveUpPattenUsage(String engineerId, Integer filmRemove, Integer stationCell); |
| | | |
| | | // UpPattenUsage selectedEngineering(String engineerId, Integer filmRemove, Integer stationCell); |
| | | |
| | | UpPattenUsage selectedEngineering(String engineerId); |
| | | } |
| | | |
| | |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | |
| | | //log.info("将参数传入到查询类里{}",engineering); |
| | | if(engineering!=null){ |
| | | LambdaQueryWrapper<UpPattenUsage> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(UpPattenUsage::getEngineeringId,engineering.getEngineerId()); |
| | | wrapper.eq(UpPattenUsage::getEngineeringId, engineering.getEngineerId()); |
| | | return this.list(wrapper); |
| | | }else { |
| | | return null; |
| | | } else { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | @Override |
| | | public List<UpPattenUsage> selectUpPattenUsage(UpPattenUsage upPattenUsage) { |
| | | LambdaQueryWrapper<UpPattenUsage> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(UpPattenUsage::getEngineeringId,upPattenUsage.getEngineeringId()); |
| | | wrapper.eq(UpPattenUsage::getEngineeringId, upPattenUsage.getEngineeringId()); |
| | | // .eq(UpPattenUsage::getStationCell, upPattenUsage.getStationCell()) |
| | | // .eq(UpPattenUsage::getFilmRemove, upPattenUsage.getFilmRemove()); |
| | | |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void updateUpPattenUsageState(UpPattenUsage upPattenUsage, Integer state) { |
| | | upPattenUsage.setState(state); |
| | | boolean updateSuccess=this.updateById(upPattenUsage); |
| | | log.info("更新状态{}",updateSuccess); |
| | | boolean updateSuccess = this.updateById(upPattenUsage); |
| | | log.info("更新状态{}", updateSuccess); |
| | | //更新状态 |
| | | } |
| | | |
| | | @Override |
| | | public UpPattenUsage selectedEngineering(String engineeringId) { |
| | | QueryWrapper<UpPattenUsage>wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("engineering_id",engineeringId) |
| | | public UpPattenUsage selectedTaskEngineering(String engineeringId) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public UpPattenUsage selectedEngineering(String engineerId) { |
| | | QueryWrapper<UpPattenUsage> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("engineering_id", engineerId) |
| | | // .eq("station_cell", stationCell) |
| | | // .eq("film_remove", filmRemove) |
| | | .last("limit 1"); |
| | | log.info("查询预览参数"); |
| | | log.info("查询预览参数{}", this.getOne(wrapper)); |
| | | return this.getOne(wrapper); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public Boolean updateGlassState(UpPattenUsage upPattenUsage) { |
| | | UpdateWrapper<UpPattenUsage> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id",upPattenUsage.getId()) |
| | | .set("state",upPattenUsage.getState()); |
| | | updateWrapper.eq("id", upPattenUsage.getId()) |
| | | .set("state", upPattenUsage.getState()); |
| | | return this.update(updateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Object Engineering(Engineering request) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | sd: |
| | | url: jdbc:mysql://127.0.0.1:3306/sd?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://10.153.19.150:3306/sd?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | wall: |
| | | multi-statement-allow: true |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | <result column="raw_glass_height" property="rawGlassHeight"/> |
| | | <result column="slot" property="slot"/> |
| | | <result column="task_state" property="taskState"/> |
| | | <result column="inkage_state" property="inkageState"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="total_count" property="totalCount"/> |
New file |
| | |
| | | package com.mes.job; |
| | | |
| | | |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.pp.entity.OptimizeHeatDetail; |
| | | import com.mes.pp.entity.OptimizeHeatLayout; |
| | | import com.mes.pp.service.OptimizeHeatDetailService; |
| | | import com.mes.pp.service.OptimizeHeatLayoutService; |
| | | import com.mes.temperingglass.entity.TemperingGlass; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class OpcNGTemperingTask { |
| | | |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | | |
| | | @Autowired |
| | | private TemperingGlassInfoService temperingAgoService; |
| | | |
| | | @Autowired |
| | | private OptimizeHeatLayoutService optimizeHeatLayoutService; |
| | | |
| | | @Autowired |
| | | private OptimizeHeatDetailService optimizeHeatDetailService; |
| | | |
| | | /** |
| | | * 摆片台请求进片逻辑处理 |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | //@Scheduled(fixedDelay = 1000) |
| | | public void requestTemperingTask() throws Exception { |
| | | ReadWriteEntity requestInTempering = miloService.readFromOpcUa("GH1S7.GH1S7.requestInTempering");//请求进片 |
| | | ReadWriteEntity requestTemperingId = miloService.readFromOpcUa("GH1S7.GH1S7.requestTemperingId");//请求进片 炉号ID |
| | | Integer request = Integer.parseInt(requestInTempering.getValue().toString()); |
| | | Integer id = Integer.parseInt(requestTemperingId.getValue().toString()); |
| | | if (request == 0) { |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1S7.GH1S7.responseInTempering", 0));//允许送片清零 |
| | | } else { |
| | | ReadWriteEntity placedNumber = miloService.readFromOpcUa("GH1S7.GH1S7.placedNumber");//已摆片数量 |
| | | List<TemperingGlassInfo> glassList = temperingAgoService.selectGlassInfoById(id); |
| | | if (glassList.size() == Integer.parseInt(placedNumber.getValue().toString())) { |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1S7.GH1S7.responseInTempering", 1));//写入允许送片 |
| | | } else { |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1S7.GH1S7.responseInTempering", 2));//不满足进炉条件 |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 钢化上片台下发参数逻辑处理 |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | //@Scheduled(fixedDelay = 1000) |
| | | public void loadTemperingTask() throws Exception { |
| | | ReadWriteEntity loadTemperingId = miloService.readFromOpcUa("GH1S7.GH1S7.loadTemperingId");//进片完成 炉号ID |
| | | getNewTemperingID(Integer.parseInt(loadTemperingId.getValue().toString()));//进片完成 下发参数 |
| | | } |
| | | |
| | | //获取到炉号id执行参数下发任务 |
| | | private void getNewTemperingID(Integer temperingid) throws Exception { |
| | | ReadWriteEntity AutoStatus = miloService.readFromOpcUa("GH1.GH1.AutoStatus"); |
| | | if (1 != Integer.parseInt(AutoStatus.getValue().toString())) { |
| | | log.info("当前为非联机状态,结束钢化下发参数任务"); |
| | | return; |
| | | } |
| | | ReadWriteEntity QandA = miloService.readFromOpcUa("GH1.GH1.QandA"); |
| | | ReadWriteEntity RecipeStatus = miloService.readFromOpcUa("GH1.GH1.RecipeStatus"); |
| | | if (1 == Integer.parseInt(QandA.getValue().toString()) && 2 == Integer.parseInt(RecipeStatus.getValue().toString())) { |
| | | log.info("版面信息已经下发,并且已经匹配参数,结束钢化下发参数任务"); |
| | | return; |
| | | } |
| | | List<TemperingGlassInfo> glassList = temperingAgoService.selectGlassInfoById(temperingid); |
| | | if (glassList != null && glassList.size() > 0) { |
| | | int glasstype = GetGlassType(glassList.get(0).getFilmsid());//膜系 |
| | | int process = 0;//钢化类型 |
| | | int thiness = (int) glassList.get(0).getThickness();//厚度 |
| | | String engineerId = glassList.get(0).getEngineerId(); |
| | | Integer temperingLayoutId = glassList.get(0).getTemperingLayoutId(); |
| | | OptimizeHeatLayout heatLayoutinfo = optimizeHeatLayoutService.selectHeatLayoutInfo(engineerId, temperingLayoutId); |
| | | int loadingRate = (int) (heatLayoutinfo.getLayoutRate() * 100); //装载率 |
| | | loadingRate = loadingRate > 10000 ? 10000 : loadingRate; |
| | | List<OptimizeHeatDetail> heatDetailGlassInfoList = optimizeHeatDetailService.selectHeatDetailGlassInfo(engineerId, temperingLayoutId); |
| | | |
| | | Optional<Double> maxProductOpt = heatDetailGlassInfoList.stream() |
| | | .map(ohd -> ohd.getWidth() * ohd.getHeight()) |
| | | .max(Double::compareTo); |
| | | double totalarea = heatDetailGlassInfoList.stream().mapToDouble(ohd -> ohd.getWidth() * ohd.getHeight()).sum(); |
| | | |
| | | int shape = 0; //最大片占总面积的比例 |
| | | if (maxProductOpt.isPresent()) { |
| | | shape = (int) (maxProductOpt.get() / totalarea * 100); |
| | | } |
| | | shape = shape > 10000 ? 10000 : shape; |
| | | int workmode = 0; //工位数 |
| | | int furmode = 0; //双室/联室 |
| | | |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.TemperingId", temperingid));//写入炉号 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.GlassType", glasstype));//写入玻璃类型 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Process", process));//写入钢化类型 全钢 半钢 防火 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Thickness", thiness));//写入厚度 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.LoadingRate", loadingRate));//写入装载率 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Shape", shape));//写入大片比例 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.WorkMode", workmode));//写入工位数 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.FurnaceMode", furmode));//写入炉体工作方式 |
| | | log.info("炉号" + temperingid + "版面信息尝试下发"); |
| | | } |
| | | } |
| | | |
| | | |
| | | //根据膜系返回玻璃类型 |
| | | private int GetGlassType(String glasstype) { |
| | | int result = 0; |
| | | String str = glasstype.toLowerCase(); |
| | | if (str.contains("白玻")) { |
| | | result = 0; |
| | | } |
| | | if (str.contains("超白")) { |
| | | result = 4; |
| | | } |
| | | if (str.contains("lowe") || str.contains("low-e")) { |
| | | result = 1; |
| | | } |
| | | if (str.contains("双银")) { |
| | | result = 2; |
| | | } |
| | | if (str.contains("三银")) { |
| | | result = 3; |
| | | } |
| | | if (str.contains("热反射")) { |
| | | result = 5; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private ReadWriteEntity generateReadWriteEntity(String identifier, Object value) { |
| | | return ReadWriteEntity.builder() |
| | | .identifier(identifier) |
| | | //Kep中是Long类型,即:Int32,Java中的int类型 |
| | | .value(value) |
| | | .build(); |
| | | } |
| | | } |
| | |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | password: 123456 |
| | | liquibase: |
| | | change-log: classpath:changelog/changelogBase.xml |
| | |
| | | port: 8084 |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: prod |
| | | application: |
| | | name: temperingGlass |
| | | liquibase: |
| | | enabled: false |
| | | task: |
| | | scheduling: |
| | | pool: |
| | | size: 10 |
| | | thread-name-prefix: task-tempering |
| | | enabled: true |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | width: 2800 |
| | | height: 5000 |
| | |
| | | glass_id_in varchar(20) DEFAULT NULL COMMENT '进片玻璃id', |
| | | glass_id_out varchar(20) DEFAULT NULL COMMENT '出片玻璃id', |
| | | glass_id varchar(20) DEFAULT NULL COMMENT '磨边前玻璃id', |
| | | in_place int DEFAULT 0 COMMENT '就位信号', |
| | | current_cell int DEFAULT '0' COMMENT '当前层号', |
| | | start_cell int DEFAULT '0' COMMENT '层号', |
| | | end_cell int DEFAULT NULL COMMENT '预留层号', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 0默认空任务 1执行中 2结束任务', |
| | | task_type int DEFAULT NULL COMMENT '任务类型', |
| | | create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| | | width int DEFAULT NULL COMMENT '宽', |
| | | height int DEFAULT NULL COMMENT '高', |
| | | thickness int DEFAULT NULL COMMENT '厚', |
| | | film_remove int DEFAULT NULL COMMENT '是否除膜' |
| | | update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' |
| | | ); |
| | | -- rollback DROP TABLE edg_storage_device_one_task; |
| | | |
| | |
| | | -- changeset zsh:20241107002 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM edg_storage_device_one_task; |
| | | INSERT INTO edg_storage_device_one_task (task_running, glass_id, glass_id_in, glass_id_out, current_cell, start_cell, |
| | | end_cell, task_state, task_type, width, height, thickness, film_remove) |
| | | VALUES (0, NULL, NULL, NULL, 1, 0, NULL, 0, NULL, 0, 0, 0, 0); |
| | | INSERT INTO edg_storage_device_one_task (task_running, glass_id, in_place, glass_id_in, glass_id_out, current_cell, |
| | | start_cell, |
| | | end_cell, task_state, task_type) |
| | | VALUES (0, NULL, 0, NULL, NULL, 1, 0, NULL, 0, NULL, 0, 0, 0, 0); |
| | | |
| | | |
| | | -- changeset zsh:20241107003 |
| | |
| | | glass_id_in varchar(20) DEFAULT NULL COMMENT '进片玻璃id', |
| | | glass_id_out varchar(20) DEFAULT NULL COMMENT '出片玻璃id', |
| | | glass_id varchar(20) DEFAULT NULL COMMENT '磨边前玻璃id', |
| | | in_place int DEFAULT 0 COMMENT '就位信号', |
| | | current_cell int DEFAULT '0' COMMENT '当前层号', |
| | | start_cell int DEFAULT '0' COMMENT '层号', |
| | | end_cell int DEFAULT NULL COMMENT '预留层号', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 0默认空任务 1执行中 2结束任务', |
| | | task_type int DEFAULT NULL COMMENT '任务类型', |
| | | create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| | | width int DEFAULT NULL COMMENT '宽', |
| | | height int DEFAULT NULL COMMENT '高', |
| | | thickness int DEFAULT NULL COMMENT '厚', |
| | | film_remove int DEFAULT NULL COMMENT '是否除膜' |
| | | update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' |
| | | ); |
| | | -- rollback DROP TABLE edg_storage_device_two_task; |
| | | |
| | | -- changeset zsh:20241107004 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM edg_storage_device_two_task; |
| | | INSERT INTO edg_storage_device_two_task (task_running, glass_id, glass_id_in, glass_id_out, current_cell, start_cell, |
| | | end_cell, task_state, task_type, width, height, thickness, film_remove) |
| | | VALUES (0, NULL, NULL, NULL, 1, 0, NULL, 0, NULL, 0, 0, 0, 0); |
| | | INSERT INTO edg_storage_device_two_task (task_running, glass_id, in_place, glass_id_in, glass_id_out, current_cell, |
| | | start_cell, |
| | | end_cell, task_state, task_type) |
| | | VALUES (0, NULL, 0, NULL, NULL, 1, 0, NULL, 0, NULL, 0, 0, 0, 0); |
| | | |
| | | |
| | | |
| | |
| | | id bigint NOT NULL AUTO_INCREMENT COMMENT '工程表id', |
| | | glass_id_in varchar(20) DEFAULT NULL COMMENT '进片玻璃id', |
| | | glass_id_out varchar(20) DEFAULT NULL COMMENT '出片玻璃id', |
| | | glass_id varchar(20) DEFAULT NULL COMMENT '磨边前玻璃id', |
| | | in_place int DEFAULT 0 COMMENT '就位信号', |
| | | current_cell int DEFAULT '0' COMMENT '当前层号', |
| | | start_cell int DEFAULT '0' COMMENT '层号', |
| | | end_cell int DEFAULT NULL COMMENT '预留层号', |
| | |
| | | raw_glass_width int DEFAULT '0' COMMENT '原片宽', |
| | | raw_glass_height int DEFAULT '0' COMMENT '原片高', |
| | | slot int DEFAULT '0' COMMENT '上片位编号', |
| | | inkage_state int DEFAULT '0' COMMENT '联机状态', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 0默认空任务 1执行中 2结束任务', |
| | | create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| | |
| | | -- changeset zsh:20241107008 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM load_glass_device_one_task; |
| | | INSERT INTO load_glass_device_one_task (task_running, raw_glass_width, raw_glass_height, slot, task_state, total_count, |
| | | finish_count, damage_count) |
| | | VALUES (0, 0, 0, 0, 0, 0, 0, 0); |
| | | INSERT INTO load_glass_device_one_task (task_running, raw_glass_width, raw_glass_height, slot, inkage_state, task_state, |
| | | total_count, finish_count, damage_count) |
| | | VALUES (0, 0, 0, 0, 0, 0, 0, 0, 0); |
| | | |
| | | -- changeset zsh:20241107009 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | |
| | | raw_glass_width int DEFAULT '0' COMMENT '原片宽', |
| | | raw_glass_height int DEFAULT '0' COMMENT '原片高', |
| | | slot int DEFAULT '0' COMMENT '上片位编号', |
| | | inkage_state int DEFAULT '0' COMMENT '联机状态', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 0默认空任务 1执行中 2结束任务', |
| | | create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| | |
| | | -- changeset zsh:20241107010 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM load_glass_device_two_task; |
| | | INSERT INTO load_glass_device_two_task (task_running, raw_glass_width, raw_glass_height, slot, task_state, total_count, |
| | | finish_count, damage_count) |
| | | VALUES (0, 0, 0, 0, 0, 0, 0, 0); |
| | | INSERT INTO load_glass_device_two_task (task_running, raw_glass_width, raw_glass_height, slot, inkage_state, task_state, |
| | | total_count, finish_count, damage_count) |
| | | VALUES (0, 0, 0, 0, 0, 0, 0, 0, 0); |
| | | |
| | | |
| | | -- changeset zsh:20241107011 |
| | |
| | | raw_glass_height int DEFAULT '0' COMMENT '原片高', |
| | | station int DEFAULT '0' COMMENT '上片设备编号', |
| | | slot int DEFAULT '0' COMMENT '上片位编号', |
| | | inkage_state int DEFAULT '0' COMMENT '联机状态', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 0默认空任务 1执行中 2结束任务', |
| | | create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| | |
| | | damage_count int DEFAULT '0' COMMENT '破损数量', |
| | | PRIMARY KEY (id) USING BTREE |
| | | ); |
| | | -- rollback DROP TABLE load_glass_device_task_history; |
| | | -- rollback DROP TABLE load_glass_device_task_history; |
| | | |
| | | -- changeset zsh:20241112001 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'big_storage_cage_history_task' and table_schema = 'hangzhoumes'; |
| | | CREATE TABLE big_storage_cage_history_task |
| | | ( |
| | | id int NOT NULL AUTO_INCREMENT, |
| | | glass_id varchar(32) DEFAULT NULL COMMENT '玻璃id', |
| | | start_slot int DEFAULT '0' COMMENT '起始格子', |
| | | target_slot int DEFAULT '0' COMMENT '目标格子', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 ', |
| | | glass_count int DEFAULT NULL COMMENT '玻璃数量', |
| | | task_type int DEFAULT NULL COMMENT '任务类型', |
| | | create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| | | PRIMARY KEY (id) |
| | | ); |
| | | -- rollback DROP TABLE big_storage_cage_history_task; |
| | | |
| | | -- changeset zsh:20241112002 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'big_storage_cage_in_one_task' and table_schema = 'hangzhoumes'; |
| | | CREATE TABLE big_storage_cage_in_one_task |
| | | ( |
| | | glass_id varchar(32) DEFAULT NULL COMMENT '玻璃id', |
| | | start_slot int DEFAULT '0' COMMENT '起始格子', |
| | | target_slot int DEFAULT '0' COMMENT '目标格子', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 ' |
| | | ) |
| | | -- rollback DROP TABLE big_storage_cage_in_one_task; |
| | | |
| | | -- changeset zsh:20241112003 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM big_storage_cage_in_one_task; |
| | | INSERT INTO big_storage_cage_in_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | |
| | | |
| | | -- changeset zsh:20241112004 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'big_storage_cage_in_two_task' and table_schema = 'hangzhoumes'; |
| | | CREATE TABLE big_storage_cage_in_two_task |
| | | ( |
| | | glass_id VARCHAR(32) COMMENT '玻璃id', |
| | | start_slot INT DEFAULT '0' COMMENT '起始格子', |
| | | target_slot INT DEFAULT '0' COMMENT '目标格子', |
| | | task_state INT DEFAULT NULL COMMENT '任务状态 ' |
| | | ); |
| | | -- rollback DROP TABLE big_storage_cage_in_two_task; |
| | | |
| | | -- changeset zsh:20241112005 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM big_storage_cage_in_two_task; |
| | | INSERT INTO big_storage_cage_in_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_in_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | |
| | | -- changeset zsh:20241113001 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'big_storage_cage_out_one_task' and table_schema = 'hangzhoumes'; |
| | | CREATE TABLE big_storage_cage_out_one_task |
| | | ( |
| | | glass_id varchar(32) DEFAULT NULL COMMENT '玻璃id', |
| | | start_slot int DEFAULT '0' COMMENT '起始格子', |
| | | target_slot int DEFAULT '0' COMMENT '目标格子', |
| | | task_state int DEFAULT NULL COMMENT '任务状态 ' |
| | | ) |
| | | -- rollback DROP TABLE big_storage_cage_out_one_task; |
| | | |
| | | -- changeset zsh:20241113002 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM big_storage_cage_out_one_task; |
| | | INSERT INTO big_storage_cage_out_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_one_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | |
| | | |
| | | -- changeset zsh:20241113003 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'big_storage_cage_out_two_task' and table_schema = 'hangzhoumes'; |
| | | CREATE TABLE big_storage_cage_out_two_task |
| | | ( |
| | | glass_id VARCHAR(32) COMMENT '玻璃id', |
| | | start_slot INT DEFAULT '0' COMMENT '起始格子', |
| | | target_slot INT DEFAULT '0' COMMENT '目标格子', |
| | | task_state INT DEFAULT NULL COMMENT '任务状态 ' |
| | | ); |
| | | -- rollback DROP TABLE big_storage_cage_out_two_task; |
| | | -- changeset zsh:20241113004 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM big_storage_cage_out_two_task; |
| | | INSERT INTO big_storage_cage_out_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | INSERT INTO big_storage_cage_out_two_task(glass_id, start_slot, target_slot, task_state) |
| | | VALUES (NULL, 0, 0, 0); |
| | | |