Merge remote-tracking branch 'origin/master'
# Conflicts:
# hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java
96个文件已修改
42个文件已添加
1个文件已删除
| | |
| | | export default { |
| | | serverUrl: "10.153.19.150:88/api", |
| | | |
| | | // serverUrl: "192.168.1.199:88/api", |
| | | serverUrl2: "10.153.19.150:88" |
| | | // serverUrl2: "192.168.1.199:88" |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | |
| | | "@vue-macros/reactivity-transform": "^0.3.23", |
| | | "axios": "^1.6.8", |
| | | "chart.js": "^4.4.3", |
| | | "echarts": "^5.5.0", |
| | | "echarts": "^5.5.1", |
| | | "element-plus": "^2.4.0", |
| | | "moment": "^2.30.1", |
| | | "pinia": "^2.1.6", |
| | |
| | | "sweetalert2": "^11.10.7", |
| | | "vue": "^3.3.4", |
| | | "vue-draggable-plus": "^0.5.0", |
| | | "vue-echarts": "^6.7.3", |
| | | "vue-i18n": "^9.10.1", |
| | | "vue-router": "^4.2.4", |
| | | "vxe-table": "^4.5.15", |
| | |
| | | "integrity": "sha512-M/MERVDZ8hguvjl6MAlLWSLYLS7PzEyXaTb5gEeJ+SF+e9iUC0sdvlzqe91MMDHBoy+nqw7wKcUOrDSyvMCrRg==" |
| | | }, |
| | | "node_modules/echarts": { |
| | | "version": "5.5.0", |
| | | "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.5.0.tgz", |
| | | "integrity": "sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==", |
| | | "version": "5.5.1", |
| | | "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.5.1.tgz", |
| | | "integrity": "sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==", |
| | | "dependencies": { |
| | | "tslib": "2.3.0", |
| | | "zrender": "5.5.0" |
| | | "zrender": "5.6.0" |
| | | } |
| | | }, |
| | | "node_modules/element-plus": { |
| | |
| | | "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", |
| | | "dev": true |
| | | }, |
| | | "node_modules/resize-detector": { |
| | | "version": "0.3.0", |
| | | "resolved": "https://registry.npmmirror.com/resize-detector/-/resize-detector-0.3.0.tgz", |
| | | "integrity": "sha512-R/tCuvuOHQ8o2boRP6vgx8hXCCy87H1eY9V5imBYeVNyNVpuL9ciReSccLj2gDcax9+2weXy3bc8Vv+NRXeEvQ==" |
| | | }, |
| | | "node_modules/reusify": { |
| | | "version": "1.0.4", |
| | | "resolved": "https://registry.npmmirror.com/reusify/-/reusify-1.0.4.tgz", |
| | |
| | | } |
| | | } |
| | | }, |
| | | "node_modules/vue-echarts": { |
| | | "version": "6.7.3", |
| | | "resolved": "https://registry.npmmirror.com/vue-echarts/-/vue-echarts-6.7.3.tgz", |
| | | "integrity": "sha512-vXLKpALFjbPphW9IfQPOVfb1KjGZ/f8qa/FZHi9lZIWzAnQC1DgnmEK3pJgEkyo6EP7UnX6Bv/V3Ke7p+qCNXA==", |
| | | "hasInstallScript": true, |
| | | "dependencies": { |
| | | "resize-detector": "^0.3.0", |
| | | "vue-demi": "^0.13.11" |
| | | }, |
| | | "peerDependencies": { |
| | | "@vue/composition-api": "^1.0.5", |
| | | "@vue/runtime-core": "^3.0.0", |
| | | "echarts": "^5.4.1", |
| | | "vue": "^2.6.12 || ^3.1.1" |
| | | }, |
| | | "peerDependenciesMeta": { |
| | | "@vue/composition-api": { |
| | | "optional": true |
| | | }, |
| | | "@vue/runtime-core": { |
| | | "optional": true |
| | | } |
| | | } |
| | | }, |
| | | "node_modules/vue-echarts/node_modules/vue-demi": { |
| | | "version": "0.13.11", |
| | | "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.13.11.tgz", |
| | | "integrity": "sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==", |
| | | "hasInstallScript": true, |
| | | "bin": { |
| | | "vue-demi-fix": "bin/vue-demi-fix.js", |
| | | "vue-demi-switch": "bin/vue-demi-switch.js" |
| | | }, |
| | | "engines": { |
| | | "node": ">=12" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/antfu" |
| | | }, |
| | | "peerDependencies": { |
| | | "@vue/composition-api": "^1.0.0-rc.1", |
| | | "vue": "^3.0.0-0 || ^2.6.0" |
| | | }, |
| | | "peerDependenciesMeta": { |
| | | "@vue/composition-api": { |
| | | "optional": true |
| | | } |
| | | } |
| | | }, |
| | | "node_modules/vue-i18n": { |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.13.1.tgz", |
| | |
| | | } |
| | | }, |
| | | "node_modules/zrender": { |
| | | "version": "5.5.0", |
| | | "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.5.0.tgz", |
| | | "integrity": "sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==", |
| | | "version": "5.6.0", |
| | | "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.0.tgz", |
| | | "integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==", |
| | | "dependencies": { |
| | | "tslib": "2.3.0" |
| | | } |
| | |
| | | "integrity": "sha512-M/MERVDZ8hguvjl6MAlLWSLYLS7PzEyXaTb5gEeJ+SF+e9iUC0sdvlzqe91MMDHBoy+nqw7wKcUOrDSyvMCrRg==" |
| | | }, |
| | | "echarts": { |
| | | "version": "5.5.0", |
| | | "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.5.0.tgz", |
| | | "integrity": "sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==", |
| | | "version": "5.5.1", |
| | | "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.5.1.tgz", |
| | | "integrity": "sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==", |
| | | "requires": { |
| | | "tslib": "2.3.0", |
| | | "zrender": "5.5.0" |
| | | "zrender": "5.6.0" |
| | | } |
| | | }, |
| | | "element-plus": { |
| | |
| | | "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", |
| | | "dev": true |
| | | }, |
| | | "resize-detector": { |
| | | "version": "0.3.0", |
| | | "resolved": "https://registry.npmmirror.com/resize-detector/-/resize-detector-0.3.0.tgz", |
| | | "integrity": "sha512-R/tCuvuOHQ8o2boRP6vgx8hXCCy87H1eY9V5imBYeVNyNVpuL9ciReSccLj2gDcax9+2weXy3bc8Vv+NRXeEvQ==" |
| | | }, |
| | | "reusify": { |
| | | "version": "1.0.4", |
| | | "resolved": "https://registry.npmmirror.com/reusify/-/reusify-1.0.4.tgz", |
| | |
| | | "@types/sortablejs": "^1.15.8" |
| | | } |
| | | }, |
| | | "vue-echarts": { |
| | | "version": "6.7.3", |
| | | "resolved": "https://registry.npmmirror.com/vue-echarts/-/vue-echarts-6.7.3.tgz", |
| | | "integrity": "sha512-vXLKpALFjbPphW9IfQPOVfb1KjGZ/f8qa/FZHi9lZIWzAnQC1DgnmEK3pJgEkyo6EP7UnX6Bv/V3Ke7p+qCNXA==", |
| | | "requires": { |
| | | "resize-detector": "^0.3.0", |
| | | "vue-demi": "^0.13.11" |
| | | }, |
| | | "dependencies": { |
| | | "vue-demi": { |
| | | "version": "0.13.11", |
| | | "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.13.11.tgz", |
| | | "integrity": "sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==", |
| | | "requires": {} |
| | | } |
| | | } |
| | | }, |
| | | "vue-i18n": { |
| | | "version": "9.13.1", |
| | | "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.13.1.tgz", |
| | |
| | | } |
| | | }, |
| | | "zrender": { |
| | | "version": "5.5.0", |
| | | "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.5.0.tgz", |
| | | "integrity": "sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==", |
| | | "version": "5.6.0", |
| | | "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.0.tgz", |
| | | "integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==", |
| | | "requires": { |
| | | "tslib": "2.3.0" |
| | | } |
| | |
| | | "@vue-macros/reactivity-transform": "^0.3.23", |
| | | "axios": "^1.6.8", |
| | | "chart.js": "^4.4.3", |
| | | "echarts": "^5.5.0", |
| | | "echarts": "^5.5.1", |
| | | "element-plus": "^2.4.0", |
| | | "moment": "^2.30.1", |
| | | "pinia": "^2.1.6", |
| | |
| | | "sweetalert2": "^11.10.7", |
| | | "vue": "^3.3.4", |
| | | "vue-draggable-plus": "^0.5.0", |
| | | "vue-echarts": "^6.7.3", |
| | | "vue-i18n": "^9.10.1", |
| | | "vue-router": "^4.2.4", |
| | | "vxe-table": "^4.5.15", |
| | |
| | | width:'宽', |
| | | height:'高', |
| | | startstatus:'启用状态', |
| | | disable:'禁用', |
| | | start:'启用', |
| | | disable:'已禁用', |
| | | start:'已启用', |
| | | deficiencieste:'报缺', |
| | | updown:'人工下片', |
| | | operate:'操作', |
| | |
| | | inglassgaps:'请输入玻璃间隙', |
| | | sure:'确认', |
| | | cancel:'取消', |
| | | glassID:'玻璃ID', |
| | | operate:'操作', |
| | | breakage:'破损', |
| | | delete:'删除', |
| | |
| | | gridnumber:'栅格号', |
| | | gridnumbera:'栅格号:', |
| | | grid:'请输入栅格号', |
| | | enable:'启用', |
| | | disable:'禁用', |
| | | enable:'已启用', |
| | | disable:'已禁用', |
| | | remainingwidth:'剩余宽度', |
| | | add:'添加', |
| | | sheetID:'钢化小片信息表ID', |
| | |
| | | state:'状态', |
| | | devicenumber:'设备号', |
| | | startstatus:'启用状态', |
| | | enable:'启用', |
| | | enable:'已启用', |
| | | unenable:'未启用', |
| | | operate:'操作', |
| | | bindingshelves:'绑定架子', |
| | |
| | | materialName :'物料名称', |
| | | createTime :'返库日期', |
| | | }, |
| | | large:{ |
| | | time: '次破时间', |
| | | number: '订单号', |
| | | jobnumber: '报工编号', |
| | | productionnumber: '生产订单号', |
| | | cardnumber: '流程卡号', |
| | | projectname: '项目名称', |
| | | batch: '批次', |
| | | detailID: '明细ID', |
| | | building: '楼号', |
| | | serialnumber: '订单序号', |
| | | productname: '产品名称', |
| | | serial: '工艺确认序号', |
| | | slicemarker: '片标记(位置)', |
| | | numberpatches: '补片数量', |
| | | width: '宽', |
| | | height: '高', |
| | | shape: '形状', |
| | | responsibleprocess: '责任工序', |
| | | process: '本工序', |
| | | numberfractions: '次破未补数量', |
| | | breakreason: '次破原因', |
| | | breaktype: '次破类型', |
| | | responsiblepersonnel: '责任人员', |
| | | responsiblequipment: '责任设备', |
| | | responsibleteam: '责任班组', |
| | | area: '次破面积', |
| | | inspector: '质检员', |
| | | operate: '操作', |
| | | mes: '详情', |
| | | projectnumber: '工程单号', |
| | | brokeno: '报次破未补', |
| | | close: '关闭', |
| | | orderId: '订单ID', |
| | | customerName: '客户名称', |
| | | project: '项目名称', |
| | | are: '面积', |
| | | quantity: '包装方式', |
| | | warehousing: '状态', |
| | | deliveryDate: '送货时间', |
| | | notstocked: '未入库', |
| | | inboundstatus: '部分入库状态', |
| | | allstatus: '全部入库状态', |
| | | completedquantity: '完成数量', |
| | | scrapquantity: '报废数量', |
| | | } |
| | | } |
| | |
| | | let token = userInfo; // 提取 token |
| | | // 退出登录方法 |
| | | function quit() { |
| | | // removeToken() |
| | | // localStorage.removeItem('token'); |
| | | store.$patch({ |
| | | user: null, |
| | | }) |
| | | router.push('/login') |
| | | } |
| | | // const quit = async () => { |
| | | // try { |
| | | |
| | | // const response = await request.get('/loadGlass/sys/user/logout', { |
| | | // token: token, |
| | | // user: null, |
| | | // }) |
| | | // store.$patch({user: null}) |
| | | // const response = await request.post('/loadGlass/sys/user/logout') |
| | | // if (response.code === 200) { |
| | | // // 登出成功,清除本地存储的 userInfo |
| | | // localStorage.removeItem('userInfo'); |
| | | // // 可以在这里重置应用状态,如导航到登录页等 |
| | | // console.log('登出成功'); |
| | | // } else { |
| | | // // 处理错误情况 |
| | |
| | | import VXETable from 'vxe-table' |
| | | 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 |
| | | const app = createApp(App) |
| | | const pinia = createPinia() |
| | | pinia.use(piniaPluginPersistedstate ) |
| | |
| | | } |
| | | ] |
| | | }, |
| | | /*----------- 大屏显示 ----------------*/ |
| | | { |
| | | path: 'largescreen', |
| | | name: 'largescreen', |
| | | component: () => import('../views/largescreen/largescreen.vue'), |
| | | children:[ |
| | | { |
| | | path: '/largescreen/largescreen', |
| | | name: 'largescreen', |
| | | component: () => import('../views/largescreen/largescreen.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 报工管理 ----------------*/ |
| | | { |
| | | path: 'reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue'), |
| | | children:[ |
| | | { |
| | | path: '/ReportWork/reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 管理系统 ----------------*/ |
| | | { |
| | | path: 'sys', |
New file |
| | |
| | | // tableData.js
|
| | |
|
| | | import { ref } from 'vue';
|
| | |
|
| | | export const tableData = ref([
|
| | | {
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },{
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },{
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | }
|
| | | // Add more data as needed
|
| | | ]);
|
| | |
| | | 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 }); |
| | | 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; |
| | | row.enable_state = newState; |
| | | }; |
| | | const open = async(row) => { |
| | | try { |
| | |
| | | </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" |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <div id="awatch"> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;position: relative;"> |
| | | <div style="position: absolute; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;"> |
| | | <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" |
| | |
| | | backgroundColor: '#409EFF' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | <!-- <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -30px;margin-left: 850px;"></div> |
| | | <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | #awatch{ |
| | | .awatch{ |
| | | height: 460px; |
| | | width: 1500px; |
| | | /* margin-top: -60px; */ |
| | | max-width: 100%; |
| | | } |
| | | </style> |
| | | |
| | | </style> |
| | |
| | | <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" |
| | |
| | | <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" |
| | | align="center" |
| | | :label="$t('sorter.startstatus')" |
| | | min-width="80" |
| | | prop="enable_state" |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <div id="awatch"> |
| | | <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;position: relative;"> |
| | | <div style="position: absolute; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;"> |
| | | <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" |
| | |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | |
| | | const toggleEnableState = async (row) => { |
| | | const newState = row.enable_state === 1 ? 0 : 1; |
| | | // 发送请求到后端更新状态(这里省略了实际的请求逻辑) |
| | | const response = await request.post('/unLoadGlass/downStorage/updateDownStorageCage', { id: row.id, enablestate: newState }); |
| | | const response = await request.post('/unLoadGlass/downStorage/updateDownStorageCage', { id: row.id, enableState: newState }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | |
| | | } |
| | | row.enable_state = newState; |
| | | }; |
| | | |
| | | |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | #awatch{ |
| | | .awatch{ |
| | | height: 460px; |
| | | width: 1500px; |
| | | max-width: 100%; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | </style> |
| | |
| | |
|
| | | <!-- 左侧按钮组 -->
|
| | | <div >
|
| | | <el-button type="success" size="mini" @click="storage()">原片仓储详情</el-button>
|
| | | <el-button type="success" size="mini" @click="handleInbound()">入库</el-button>
|
| | | <el-button type="success" size="mini" >吊装位入库</el-button>
|
| | |
|
| | |
| | | </el-form-item>
|
| | |
|
| | | </div>
|
| | |
|
| | | <el-dialog v-model="Hidden" top="10vh" width="80%" >
|
| | | <el-table
|
| | | :data="tableData"
|
| | | :data="tableData" v-model="dialogVisible3"
|
| | |
|
| | | style="width: 98%; height: 200px"
|
| | | @selection-change="handleSelectionChange"
|
| | |
| | | </el-table-column>
|
| | |
|
| | | <!-- 操作列 -->
|
| | | <el-table-column label="操作" width="350">
|
| | | <el-table-column label="操作" width="250">
|
| | | <template #default="{ row }">
|
| | | <el-button type="primary" size="mini" @click="edithandleRowClick(row)">修改</el-button>
|
| | | <el-button type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
|
| | | <el-button type="warning" size="mini" @click="handleCheckout(row)">出库</el-button>
|
| | | <el-button type="success" size="mini" @click="addglass()">添加原片</el-button>
|
| | | <!-- <el-button type="success" size="mini" @click="addglass()">添加原片</el-button> -->
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <el-table
|
| | |
|
| | | |
| | | </el-dialog>
|
| | |
|
| | |
|
| | | <el-table
|
| | | :data="tasktableData"
|
| | | style="width: 98%; height: 150px"
|
| | | @selection-change="handleSelectionChange"
|
| | |
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | </el-card>
|
| | |
|
| | | <div ref="chart" id="chart" style="width: 100%; height: 250px;"></div>
|
| | | |
| | |
|
| | |
|
| | |
|
| | | |
| | | <div class="img-ypcc" >
|
| | |
|
| | |
|
| | | <div class="img-car1" :style="'z-index:999;left:397px;top:205px;position:absolute;'">
|
| | | <div v-show="cellshow1" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
|
| | | </div>
|
| | | |
| | | </div>
|
| | |
|
| | | <!-- 入库对话框 -->
|
| | | <el-dialog
|
| | |
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="长度">
|
| | | <el-input v-model="formData.wid" required style="width: 250px; font-size: 20px" @focus="clearInput('wid')"></el-input>
|
| | | <el-input v-model="formData.width" required style="width: 250px; font-size: 20px" @focus="clearInput('wid')"></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="高度">
|
| | | <el-input v-model="formData.heig" required style="width: 250px; font-size: 20px" @focus="clearInput('heig')"></el-input>
|
| | | <el-input v-model="formData.height" required style="width: 250px; font-size: 20px" @focus="clearInput('heig')"></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="厚度">
|
| | | <el-input v-model="formData.thinkness" required style="width: 250px; font-size: 20px" @focus="clearInput('thinkness')"></el-input>
|
| | | <el-input v-model="formData.thickness" required style="width: 250px; font-size: 20px" @focus="clearInput('thinkness')"></el-input>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="数量">
|
| | | <el-input-number v-model="formData.num" required :min="0" :max="9000" style="width: 250px; font-size: 20px" @focus="clearInput('num')"></el-input-number>
|
| | | <el-input-number v-model="formData.quantity" required :min="0" :max="9000" style="width: 250px; font-size: 20px" @focus="clearInput('num')"></el-input-number>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | |
| | | <el-form-item label="批次号">
|
| | | <el-input v-model="editForm.batchnumber"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="长度">
|
| | | <el-input v-model="editForm.length"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="高度">
|
| | | <el-input v-model="editForm.height"></el-input>
|
| | | </el-form-item>
|
| | | <el-form-item label="厚度">
|
| | | <el-input v-model="editForm.thickness"></el-input>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <div class="dialog-footer">
|
| | |
| | | </el-dialog>
|
| | |
|
| | |
|
| | | <!-- <div ref="chart" id="chart" style="width: 100%; height: 400px;"></div> -->
|
| | | </div>
|
| | | </template>
|
| | |
|
| | |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; // 导入 Vue 3 的模块
|
| | | import * as echarts from 'echarts';
|
| | | import { ElMessage, ElMessageBox } from 'element-plus'
|
| | | import {tableData} from '@/stores/tableData.js';
|
| | |
|
| | |
|
| | |
|
| | | const loading = ref(false);
|
| | | const tableData = ref([
|
| | | {
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber:"444",
|
| | | shelf_status: 1
|
| | | }
|
| | | // Add more data as needed
|
| | | ]);
|
| | | |
| | |
|
| | | const Hidden = ref(false)
|
| | |
|
| | | const getTagType2 =(status) => {
|
| | | switch (status) {
|
| | |
| | | dialogVisible.value = true;
|
| | | };
|
| | |
|
| | | const storage = () => {
|
| | | // 打开入库对话框
|
| | | Hidden.value = true;
|
| | | };
|
| | | |
| | |
|
| | | const handleCloseDialog = () => {
|
| | | // 关闭对话框时重置表单数据
|
| | | formData.value = {
|
| | |
| | | const editdialogVisible = ref(false);
|
| | | const editForm = ref({
|
| | | quantity: '',
|
| | | batchnumber: ''
|
| | | batchnumber: '',
|
| | | length:'',
|
| | | height:'',
|
| | | thickness:''
|
| | | });
|
| | | const editFormRef = ref(null);
|
| | | let currentRow = ref(null);
|
| | |
| | | // 处理行点击事件
|
| | | const edithandleRowClick = (row) => {
|
| | | currentRow.value = row;
|
| | | console.log(row)
|
| | | editForm.value.quantity = row.quantity.toString();
|
| | | editForm.value.batchnumber = row.batchnumber;
|
| | | editForm.value.length = row.length;
|
| | | editForm.value.height = row.height;
|
| | | editForm.value.thickness = row.thickness;
|
| | | editdialogVisible.value = true;
|
| | | console.log(editForm.value)
|
| | | };
|
| | |
| | | const edithandleDialogClose = () => {
|
| | | editForm.value.quantity = '';
|
| | | editForm.value.batchnumber = '';
|
| | | editForm.value.width = '';
|
| | | editForm.value.height = '';
|
| | | editForm.value.thickness = '';
|
| | | |
| | |
|
| | | currentRow.value = null;
|
| | | };
|
| | |
|
| | |
| | |
|
| | |
|
| | |
|
| | | let chartInstance = null;
|
| | | |
| | |
|
| | | onMounted(() => {
|
| | | // Initialize the chart
|
| | | chartInstance = echarts.init(document.getElementById('chart'));
|
| | |
|
| | | // Simulated data for demonstration
|
| | | const chartData = {
|
| | | labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
|
| | | datasets: [
|
| | | { name: '使用情况统计', data: [{ remaining: 4, total: 5 }, { remaining: 9, total: 10 }, { remaining: 0, total: 30 }, { remaining: 0, total: 10 },{ remaining: 4, total: 5 }] }
|
| | | ]
|
| | | };
|
| | |
|
| | | const options = {
|
| | | tooltip: {
|
| | | trigger: 'axis',
|
| | | axisPointer: {
|
| | | type: 'shadow'
|
| | | }
|
| | | },
|
| | | legend: {
|
| | | data: ['使用情况统计']
|
| | | },
|
| | | xAxis: {
|
| | | type: 'category',
|
| | | data: chartData.labels
|
| | | },
|
| | | yAxis: {
|
| | | type: 'value'
|
| | | },
|
| | | series: chartData.datasets.map(item => ({
|
| | | name: item.name,
|
| | | type: 'bar',
|
| | | stack: '总量',
|
| | | label: {
|
| | | show: true,
|
| | | position: 'inside',
|
| | | formatter: '{c}%'
|
| | | },
|
| | | data: item.data.map(dataItem => ({
|
| | | value: (dataItem.remaining / dataItem.total * 100).toFixed(2), // 计算剩余量占比,保留两位小数
|
| | | remaining: dataItem.remaining,
|
| | | total: dataItem.total,
|
| | | itemStyle: {
|
| | | color: getColorByRemaining(dataItem.remaining, dataItem.total)
|
| | | }
|
| | | }))
|
| | | }))
|
| | | };
|
| | |
|
| | | function getColorByRemaining(remaining, total) {
|
| | | // 根据剩余量与总量的比例,设置不同的颜色逻辑
|
| | | const percentage = remaining / total;
|
| | | if (percentage >= 0.8) {
|
| | | return '#FF6666'; // Red
|
| | | } else if (percentage >= 0.5) {
|
| | | return '#FFCC66'; // Yellow
|
| | | } else {
|
| | | return '#66CC66'; // Green
|
| | | }
|
| | | }
|
| | |
|
| | | // Set options and render chart
|
| | | if (chartInstance) {
|
| | | chartInstance.setOption(options);
|
| | | }
|
| | | });
|
| | |
|
| | | onBeforeUnmount(() => {
|
| | | if (chartInstance) {
|
| | | chartInstance.dispose();
|
| | | chartInstance = null;
|
| | | }
|
| | | });
|
| | |
|
| | | const handleSelectionChange = (selection) => {
|
| | | console.log('Selection changed:', selection);
|
| | | };
|
| | |
|
| | | </script>
|
| | |
|
| | |
| | |
|
| | |
|
| | |
|
| | | .img-ypcc{
|
| | | margin-left: 80px;
|
| | | background-image:url('../../assets/ypcc.png');
|
| | | background-repeat: no-repeat;
|
| | | background-attachment: local;
|
| | | min-height: 600px;
|
| | | width: 1400px;
|
| | | max-width: 100%;
|
| | | background-size: 1400px 600px;
|
| | | overflow: hidden;
|
| | | position:relative;
|
| | | margin-top:0px
|
| | | }
|
| | |
|
| | | .img-car1{
|
| | | background-image:url('../../assets/ypccche.png');
|
| | | position: absolute;
|
| | | background-repeat: no-repeat;
|
| | | background-attachment: local;
|
| | | min-height: 400px;
|
| | | width: 200px;
|
| | | max-width: 100%;
|
| | | background-size: 200px 170px;
|
| | | overflow: hidden;
|
| | | position:relative
|
| | | }
|
| | |
|
| | | .custom-dialog {
|
| | | max-height: 90vh; /* 最大高度为视口高度的90% */
|
| | |
| | | |
| | | //登陆方法 |
| | | const submitForm = (formEl: FormInstance | undefined) => { |
| | | store.$patch({ |
| | | user: null, |
| | | }) |
| | | if (!formEl) return |
| | | formEl.validate((valid) => { |
| | | if (valid) { |
| | |
| | | <el-button :loading="loginLoadings" |
| | | type="primary" |
| | | native-type="submit" |
| | | style="width: 80px;" |
| | | @click="submitForm(ruleFormRef)" |
| | | @keyup.enter.native="keyDown(e)" |
| | | plain>{{ $t('login.login') }} |
| | | </el-button> |
| | | <el-button :loading="registerLoadings" |
| | | <!-- <el-button :loading="registerLoadings" |
| | | type="primary" |
| | | @click="register" |
| | | plain>{{ $t('login.register') }} |
| | | </el-button> |
| | | </el-button> --> |
| | | |
| | | </el-form-item> |
| | | </div> |
| | |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | > |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | backgroundColor: rect.state === 0 ? '#dedfe0' : '#d1edc4' }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | })); |
| | | console.log(data.intoGlass[0]); |
| | | console.log(adjustedRects.value); |
| | | }; |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | |
| | | backgroundColor: rect.state === 4 ? '#d1edc4' : '#f8e3c5' }"> |
| | | <div class="centered-text"> |
| | | <div >{{ rect.flowcardId }}</div> |
| | | <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | <div style="text-align: center;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <span class="demonstration">生产时间</span> |
| | | <el-date-picker v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" |
| | | start-placeholder="开始时间" end-placeholder="结束时间" :default-time="defaultTime" /> |
| | | <el-select v-model="report.type" placeholder="清选择类型"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="完工" value="1"></el-option> |
| | | <el-option label="破损" value="2"></el-option> |
| | | <el-option label="拿走" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.status" placeholder="清选择状态"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="未报工" value="1"></el-option> |
| | | <el-option label="待报工" value="2"></el-option> |
| | | <el-option label="已报工" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.workProcedure" placeholder="清选择工序"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="切割" value="1"></el-option> |
| | | <el-option label="磨边" value="2"></el-option> |
| | | <el-option label="钢化" value="3"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" @click="selectReportData()">查询</el-button> |
| | | <el-button type="success">报工</el-button> |
| | | <el-table height="100%" ref="table" :data="reportData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="reportData.line" align="center" label="线路" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="工序" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="玻璃id" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="钢化版图id" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="生产时间" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="备注" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="类型" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="状态" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="流程卡" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="序号" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="层" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="破损类型" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="破损原因" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任工序" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任人员" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任班组" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任设备" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="报工班组" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="报工设备" min-width="120" /> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue"; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | const report = ref({ |
| | | type: '', |
| | | status: '', |
| | | workProcedure: '', |
| | | }); |
| | | const reportData = ref([]) |
| | | const timeRange = ref([new Date(2000, 10, 10), new Date(2200, 10, 11)]) |
| | | |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | console.log(timeRange.value[0]) |
| | | const response = await request.post("/loadGlass/damage/selectDamage", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | | type: report.value.type, |
| | | status: report.value.status, |
| | | workProcedure: report.value.workProcedure, |
| | | }) |
| | | if (response.code === 200) { |
| | | reportData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | |
| | | 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(); |
| | | }; |
| | | // }; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | |
| | | const tableDatad = ref([]) |
| | | const tableDataf = ref([]) |
| | | const tableDatae = ref([]) |
| | | const carPosition = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const project = ref([]); |
| | | const adjust = ref([]); |
| | | const adjusta = ref([]); |
| | | const adjustedRectsa = ref([]); |
| | | const adjustedRectsb = ref([]); |
| | | const adjustedRectsc = ref([]); |
| | |
| | | const adjustedRectse = ref([]); |
| | | const adjustedRectsf = ref([]); |
| | | const adjustedRectsg = ref([]); |
| | | const adjustedRectsh = ref([]); |
| | | const currentRow = reactive({}); // 当前行的数据 |
| | | const add = ref(false) |
| | | const flowCardId = ref(''); |
| | |
| | | const temperingLayoutId = ref(''); |
| | | const thickness = ref(''); |
| | | const width = ref(''); |
| | | const carposition1 = ref(60); |
| | | const carposition2 = ref(220); |
| | | const carposition3 = ref(60); |
| | | const carposition4 = ref(260); |
| | | const timers1 =ref(true); |
| | | const timers2 =ref(true); |
| | | const timers3 =ref(true); |
| | | const timers4 =ref(true); |
| | | const cellshow5=ref(false); |
| | | const c1=ref(false); |
| | | const c2=ref(false); |
| | | const cellshow1=ref(true); |
| | | const cellshow2=ref(true); |
| | | const cellshow3=ref(true); |
| | |
| | | const cell6=ref(true); |
| | | const cell7=ref(true); |
| | | const cell8=ref(true); |
| | | const cell9=ref(true); |
| | | const selectedRow = ref(null); // 存储选中的行数据 |
| | | |
| | | |
| | | |
| | | |
| | | // 当前页码和每页显示的条数 |
| | | const currentPage = ref(1); |
| | | const itemsPerPage = computed(() => { |
| | | if (currentPage.value === 1) { |
| | | return 21; |
| | | return 55; |
| | | } else if (currentPage.value === 2) { |
| | | return 21; |
| | | return 55; |
| | | } else if (currentPage.value === 3) { |
| | | return 21; |
| | | return 55; |
| | | } else if (currentPage.value === 4) { |
| | | return 20; |
| | | return 55; |
| | | } else if (currentPage.value === 5) { |
| | | return 21; |
| | | return 55; |
| | | } else if (currentPage.value === 6) { |
| | | return 25; |
| | | } else if (currentPage.value === 7) { |
| | | return 51; |
| | | return 30; |
| | | } else if (currentPage.value === 8) { |
| | | return 25; |
| | | } else { |
| | | return 25; // 默认值,可以根据实际需求修改 |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 计算分页后的数据 |
| | | const paginatedUsers = computed(() => { |
| | | const startIndex = calculateStartIndex(); |
| | | const endIndex = startIndex + itemsPerPage.value; |
| | | return tableData.value.slice(startIndex, endIndex); |
| | | }); |
| | | |
| | | |
| | | // 计算当前页的起始索引 |
| | | function calculateStartIndex() { |
| | | let index = 0; |
| | | for (let i = 1; i < currentPage.value; i++) { |
| | | if (i === 1) { |
| | | index += 21; |
| | | index += 55; |
| | | } else if (i === 2) { |
| | | index += 21; |
| | | index += 55; |
| | | } else if (i === 3) { |
| | | index += 21; |
| | | index += 55; |
| | | }else if (i === 4) { |
| | | index += 20; |
| | | index += 55; |
| | | }else if (i === 5) { |
| | | index += 21; |
| | | index += 55; |
| | | }else if (i === 6) { |
| | | index += 25; |
| | | }else if (i === 7) { |
| | | index += 51; |
| | | index += 30; |
| | | }else if (i === 8) { |
| | | index += 25; |
| | | } else { |
| | |
| | | } |
| | | return index; |
| | | } |
| | | |
| | | function jumpToPage(page: number) { |
| | | if (page >= 1 && page <= totalPages.value) { |
| | | currentPage.value = page; |
| | | } |
| | | } |
| | | // 上一页和下一页方法 |
| | | const prevPage = () => { |
| | | if (currentPage.value > 1) { |
| | |
| | | currentPage.value++; |
| | | } |
| | | }; |
| | | |
| | | |
| | | // 总页数计算 |
| | | const totalPages = computed(() => { |
| | | // let total = 0; |
| | |
| | | // } |
| | | return 9; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | ElMessage.success(response.message); |
| | | glassId.value = ''; |
| | | tableDataf.value = ''; |
| | | |
| | | |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | tableDatac.value = data.bigStorageCageDetailsOutTask[0] |
| | | tableDatad.value = data.bigStorageCageDetailsFeedTask[0] |
| | | if(data.bigStorageCageDetailsOutTask!=null){ |
| | | tableDatac.value = data.bigStorageCageDetailsOutTask[0] |
| | | adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | } |
| | | if(data.bigStorageCageDetailsFeedTask!=null){ |
| | | tableDatad.value = data.bigStorageCageDetailsFeedTask[0] |
| | | adjust.value = data.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | } |
| | | |
| | | // adjust.value = data.bigStorageCageDetailsFeedTask[0].map(rect => ({ |
| | | // ...rect, |
| | | // })); |
| | | |
| | | // const adjust = computed(() => { |
| | | // return data.value.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); |
| | | // }); |
| | | if(data.bigStorageCageInfo!=null){ |
| | | tableData.value = data.bigStorageCageInfo[0] |
| | | } |
| | | if(data.temperingGlassInfoList!=null){ |
| | | tableDatab.value = data.temperingGlassInfoList[0] |
| | | } |
| | | if(data.bigStorageCageUsage!=null){ |
| | | tableDatae.value = data.bigStorageCageUsage[0] |
| | | // adjustedRects.value = data.bigStorageCageInfo1[0] |
| | | window.localStorage.setItem('length', data.bigStorageCageInfo1[0].length) |
| | | } |
| | | if(data.carPostion!=null){ |
| | | carPosition.value = data.carPostion[0] |
| | | } |
| | | |
| | | |
| | | if(data.bigStorageCageInfos!=null){ |
| | | window.localStorage.setItem('length', data.bigStorageCageInfos[0][1].length) |
| | | let length = window.localStorage.getItem('length') |
| | | adjustedRects.value = data.bigStorageCageInfo1[0].map(rect => ({ |
| | | adjustedRects.value = data.bigStorageCageInfos[0][1].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | let small = data.bigStorageCageInfo1[0] |
| | | console.log(small[0].bigStorageCageDetails); |
| | | adjustedRectsa.value = data.bigStorageCageInfo2[0].map(rect => ({ |
| | | adjustedRectsa.value = data.bigStorageCageInfos[0][2].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsb.value = data.bigStorageCageInfo3[0].map(rect => ({ |
| | | adjustedRectsb.value = data.bigStorageCageInfos[0][3].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsc.value = data.bigStorageCageInfo4[0].map(rect => ({ |
| | | adjustedRectsc.value = data.bigStorageCageInfos[0][4].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsd.value = data.bigStorageCageInfo5[0].map(rect => ({ |
| | | adjustedRectsd.value = data.bigStorageCageInfos[0][5].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectse.value = data.bigStorageCageInfo6[0].map(rect => ({ |
| | | adjustedRectse.value = data.bigStorageCageInfos[0][6].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsf.value = data.bigStorageCageInfo7[0].map(rect => ({ |
| | | adjustedRectsf.value = data.bigStorageCageInfos[0][7].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsg.value = data.bigStorageCageInfo8[0].map(rect => ({ |
| | | adjustedRectsg.value = data.bigStorageCageInfos[0][8].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | adjustedRectsh.value = data.bigStorageCageInfos[0][9].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | | })); |
| | | } |
| | | |
| | | |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | |
| | | |
| | | }); |
| | | function getStatusType(enableState: number) { |
| | | switch (enableState) { |
| | |
| | | <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100%" ref="table" |
| | | <el-table height="100px" ref="table" |
| | | :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="bigStorageCageOutTask.glassId" align="center" :label="$t('searchOrder.outputglassID')" min-width="100" /> |
| | | <el-table-column prop="bigStorageCageOutTask.glassId" align="center" :label="$t('searchOrder.outputglassID')" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.startSlot" align="center" :label="$t('searchOrder.startposition')" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.endSlot" align="center" :label="$t('searchOrder.targetlocation')" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageOutTask.trainNumber" align="center" :label="$t('searchOrder.trips')" min-width="120" /> |
| | |
| | | <el-table-column prop="id" align="center" :label="$t('searchOrder.tabid')" min-width="150"/> |
| | | <el-table-column prop="deviceId" align="center" :label="$t('searchOrder.tid')" min-width="100"/> |
| | | <el-table-column prop="slot" align="center" :label="$t('searchOrder.gridnumber')" min-width="100"/> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="100"/> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120"/> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="150"/> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="100"/> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="140"/> |
| | | <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="100"/> |
| | | <el-table-column prop="width" align="center" :label="$t('searchOrder.width')" min-width="100"/> |
| | | <el-table-column prop="height" align="center" :label="$t('searchOrder.height')" min-width="100"/> |
| | |
| | | </el-card> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 3px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> |
| | | <el-table height="100%" ref="table" |
| | | <el-table height="100px" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" :label="$t('searchOrder.intoglassid')" min-width="100" /> |
| | | <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" :label="$t('searchOrder.intoglassid')" min-width="120" /> |
| | | <el-table-column prop="bigStorageCageFeedTask.targetSlot" align="center" :label="$t('searchOrder.targetlocation')" min-width="120" /> |
| | | <!-- <el-table-column prop="task_type" align="center" label="任务类型" min-width="120" />没有返回字段 --> |
| | | <el-table-column prop="bigStorageCageFeedTask.taskState" align="center" :label="$t('searchOrder.taskstatus')" min-width="120"> |
| | |
| | | <el-table-column prop="id" align="center" :label="$t('searchOrder.tabid')" min-width="150"/> |
| | | <el-table-column prop="deviceId" align="center" :label="$t('searchOrder.tid')" min-width="100"/> |
| | | <el-table-column prop="slot" align="center" :label="$t('searchOrder.gridnumber')" min-width="100"/> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="100"/> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120"/> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="150"/> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="100"/> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="140"/> |
| | | <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="100"/> |
| | | <el-table-column prop="width" align="center" :label="$t('searchOrder.width')" min-width="100"/> |
| | | <el-table-column prop="height" align="center" :label="$t('searchOrder.height')" min-width="100"/> |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <div style="padding: 10px;display: flex;height:110px;"> |
| | | <div style="padding: 10px;display: flex;height:130px;"> |
| | | <div v-for="(item, index) in tableDatae" :key="index" id="occupy"> |
| | | <el-col style="text-align:left;font-weight: bold;">#{{ item.device_id }}</el-col> |
| | | <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;"> |
| | |
| | | </div> |
| | | <!-- // 父级框 --> |
| | | <div class="img-dlpl" > |
| | | <div class="img-car1" :style="'z-index:999;left:247px;top:' + carposition1 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow1" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div> |
| | | <div class="img-car1" :style="'z-index:999;left:270px;top:' + 350*carPosition[0] + 'px;position:absolute;'"> |
| | | <div |
| | | v-for="(rect, index) in adjusta" |
| | | :key="rect.id" |
| | | :style="{ |
| | | width: '30px', |
| | | height: '5px', |
| | | backgroundColor: '#409EFF', |
| | | marginLeft: 5+ `px`, |
| | | top: '10px', |
| | | }" |
| | | > |
| | | </div> |
| | | <div v-show="c1" class="img-car2" :style="'z-index:999;left:704px;top:' + carposition2 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow2" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div> |
| | | </div> |
| | | |
| | | <div v-show="c2" class="img-car3" :style="'z-index:999;left:247px;top:' + carposition3 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow3" style="margin-top:10px;width:220px;height:5px;background-color:#409EFF;"></div> |
| | | <div class="img-car4" :style="'z-index:999;left:740px;top:' + 350*carPosition[1] + 'px;position:absolute;'"> |
| | | <div |
| | | v-for="(rect, index) in adjust" |
| | | :key="rect.id" |
| | | :style="{ |
| | | width: '30px', |
| | | height: '5px', |
| | | backgroundColor: '#409EFF', |
| | | marginLeft: 5+ `px`, |
| | | top: '10px', |
| | | }" |
| | | > |
| | | </div> |
| | | <div class="img-car4" :style="'z-index:999;left:704px;top:' + carposition4 + 'px;position:absolute;'"> |
| | | <div v-show="cellshow4" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div> |
| | | </div> |
| | | <div style="position: relative;"> |
| | | <div v-show="cell1" style="width: 227px;height: 29px;position: relative;top:55px;left: 465px;"> |
| | | <div v-show="cell1" style="width: 227px;height: 29px;position: relative;top:50px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect.id" |
| | | :key="rect" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell2" style="width: 227px;height: 29px;position: relative;top:56px;left: 465px;"> |
| | | <div v-show="cell2" style="width: 227px;height: 29px;position: relative;top:51px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsa" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;"> |
| | | <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:110px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsb" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;"> |
| | | <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:140px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsc" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;"> |
| | | <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:170px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsd" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;"> |
| | | <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:241px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectse" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;"> |
| | | <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:271px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsf" |
| | | :key="rect.id" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;"> |
| | | <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:301px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsg" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | | // display:'flex', |
| | | position: 'absolute', |
| | | width: '227px', |
| | | // backgroundColor: 'red', |
| | | left: '0px', |
| | | top: index*rect.top+`px`, |
| | | height: `${rect.height}px`, |
| | | }" |
| | | > |
| | | <div |
| | | v-for="(rects, index) in rect.bigStorageCageDetails" |
| | | :key="rects" |
| | | :style="{ |
| | | float:'left', |
| | | width: '18px', |
| | | height: `${rect.height}px`, |
| | | backgroundColor: '#911005', |
| | | // border:'1px solid black', |
| | | top: '0px', |
| | | marginRight: rects.gap/5000*227+'px' |
| | | }" |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-show="cell9" style="width: 227px;height: 29px;position: absolute;top:332px;left: 495px;"> |
| | | <div |
| | | v-for="(rect, index) in adjustedRectsh" |
| | | :key="rect.id" |
| | | :style="{ |
| | | |
| | |
| | | </el-input> |
| | | <el-button type="primary" plain style="margin-left: 10px;" @click="searchout">{{ $t('searchOrder.search') }}</el-button> |
| | | </div> |
| | | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 500px;"> |
| | | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 200px;"> |
| | | <el-table height="100%" ref="table" |
| | | :data="tableDataf" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120" /> |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisiblea" top="5vh" width="97%" :title="$t('searchOrder.cageinformation')"> |
| | | <el-dialog v-model="dialogFormVisiblea" top="2vh" width="97%" :title="$t('searchOrder.cageinformation')"> |
| | | <el-table |
| | | :data="paginatedUsers" |
| | | @row-click="handleRowClick" |
| | |
| | | :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | > |
| | | <!-- <el-table-column prop="menuName" label="二级菜单栏" align="center" min-width="140" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"/> --> |
| | | <el-table-column prop="glassId" :label="$t('searchOrder.glassID')" align="center" min-width="90"/> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="110" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="120" /> |
| | | <el-table-column prop="glassId" :label="$t('searchOrder.glassID')" align="center" min-width="130"/> |
| | | <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="130" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="130" /> |
| | | <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="80" /> |
| | | <el-table-column prop="width" align="center" :label="$t('searchOrder.width')" min-width="80" /> |
| | | <el-table-column prop="height" align="center" :label="$t('searchOrder.height')" min-width="80" /> |
| | |
| | | <div style="margin-top: 20px; text-align: center;"> |
| | | <!-- 上一页按钮 --> |
| | | <el-button @click="prevPage" :disabled="currentPage === 1">{{ $t('searchOrder.up') }}</el-button> |
| | | |
| | | <div style="display: inline-block; margin: 0 20px;"> |
| | | <el-button |
| | | v-for="page in totalPages" |
| | | :key="page" |
| | | :class="{ 'is-active': currentPage === page }" |
| | | @click="jumpToPage(page)" |
| | | > |
| | | {{ page }} |
| | | </el-button> |
| | | </div> |
| | | <!-- 下一页按钮 --> |
| | | <el-button @click="nextPage" :disabled="currentPage >= totalPages">{{ $t('searchOrder.down') }}</el-button> |
| | | |
| | |
| | | } |
| | | |
| | | .img-dlpl{ |
| | | margin-left: 80px; |
| | | background-image:url('../../assets/dlpl.png'); |
| | | margin-left: 20px; |
| | | margin-top: 20px; |
| | | background-image:url('../../assets/dlpl9.png'); |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | | min-height: 400px; |
| | |
| | | position:relative |
| | | } |
| | | .img-car1{ |
| | | background-image:url('../../assets/lp.png'); |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | | min-height: 200px; |
| | | width: 200px; |
| | | max-width: 100%; |
| | | background-size: 200px 70px; |
| | | overflow: hidden; |
| | | position:relative |
| | | } |
| | | .img-car2{ |
| | | background-image:url('../../assets/lpa.png'); |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | | min-height: 200px; |
| | | width: 200px; |
| | | max-width: 100%; |
| | | background-size: 200px 70px; |
| | | overflow: hidden; |
| | | position:relative |
| | | } |
| | | .img-car3{ |
| | | background-image:url('../../assets/lp.png'); |
| | | display: flex; |
| | | background-image:url('../../assets/lp9.png'); |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | |
| | | position:relative |
| | | } |
| | | .img-car4{ |
| | | background-image:url('../../assets/lpa.png'); |
| | | display: flex; |
| | | background-image:url('../../assets/lpa9.png'); |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | |
| | | <template> |
| | | <div class="glass-rack"> |
| | | <div > |
| | | <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"> |
| | | <svg width="500" height="370" xmlns="http://www.w3.org/2000/svg"> |
| | | <g stroke="null" id="Layer_1"> |
| | | <!-- 使用 v-for 循环渲染数据 --> |
| | | <g v-for="(rack, index) in racks" :key="index" :data="tableData"> |
| | |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678',downGlassInfoList:"" } }, |
| | | |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' ,downGlassInfoList:""} } |
| | | { x: 140, y: 280, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' ,downGlassInfoList:""} } |
| | | |
| | | ]); |
| | | |
| | |
| | | |
| | | Swal.fire({ |
| | | // title: '玻璃信息', |
| | | title: "$t('reportWork.glassinformation')", |
| | | title: t('reportWork.glassinformation'), |
| | | html: tableContent, |
| | | customClass: { |
| | | popup: 'format-pre' |
| | |
| | | |
| | | <style scoped> |
| | | .glass-rack { |
| | | margin-left: 20px; |
| | | /* margin-left: 10px; */ |
| | | width: 500px; |
| | | margin-top: 5px; |
| | | } |
| | |
| | | <template> |
| | | <div class="glass-rack"> |
| | | <div > |
| | | <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"> |
| | | <svg width="500" height="370" xmlns="http://www.w3.org/2000/svg"> |
| | | <g stroke="null" id="Layer_1"> |
| | | <!-- 使用 v-for 循环渲染数据 --> |
| | | <g v-for="(rack, index) in racks" :key="index"> |
| | |
| | | |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | |
| | | { x: 140, y: 320, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | { x: 140, y: 280, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | |
| | | ]); |
| | | |
| | |
| | | tableContent += '</table>'; |
| | | |
| | | Swal.fire({ |
| | | title: "$t('reportWork.glassinformation')", |
| | | title: t('reportWork.glassinformation'), |
| | | // title: '玻璃信息', |
| | | html: tableContent, |
| | | customClass: { |
| | |
| | | |
| | | <style scoped> |
| | | .glass-rack { |
| | | margin-left: 20px; |
| | | /* margin-left: 20px; */ |
| | | width: 500px; |
| | | margin-top: 10px; |
| | | margin-top: 5px; |
| | | } |
| | | .rack-rect:hover { |
| | | cursor: pointer; |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive, onMounted, onBeforeUnmount} from "vue"; |
| | | |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | const dialogFormVisiblea = ref(false) |
| | | |
| | | const dialogFormVisiblea2 = ref(false) |
| | | |
| | | // 数据 |
| | | const loading = ref(false); |
| | | |
| | | // 弹框显示控制 |
| | | const dialogFormVisible = ref(false); |
| | | // 表单数据 |
| | | const workstationId = ref(''); |
| | | const selectedProjectNoa = ref(null); // 当前选中的角色 |
| | | const flowCardId = ref(''); |
| | | const flowCardOptions = ref('[]'); |
| | | const tableData = reactive([]); |
| | |
| | | const handleSelectionChange = () => { |
| | | // 处理表格行选择事件 |
| | | }; |
| | | |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | console.log(row.flowCardId); |
| | | flowCardId.value = row.flowCardId; |
| | | // 发起接口请求获取流程卡号 |
| | | fetchFlowCardId(); |
| | | dialogFormVisiblea.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | |
| | | //获取流程卡号 |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | |
| | | //确认 |
| | | const handleConfirm = async () => { |
| | | try { |
| | | const firstPart = flowCardId.value.split('|')[0].trim(); // |
| | | const twoPart = flowCardId.value.split('|')[1].trim(); // |
| | | const response = await request.post('unLoadGlass/downWorkStation/updateFlowCardId', { |
| | | workstationId: workstationId.value, |
| | | flowCardId: flowCardId.value |
| | | flowCardId: firstPart, |
| | | layer:twoPart |
| | | }); |
| | | |
| | | console.log(response) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | |
| | | |
| | | const updatePageData = () => { |
| | | // 假设你的页面上有一个名为 tableData 的 Vue 组件 |
| | | // 你可以直接更新 tableData 的数据 |
| | | fetchTableData() |
| | | // 使用 $forceUpdate() 强制更新组件 |
| | | |
| | | }; |
| | | |
| | | const handleBindRack2 = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | dialogFormVisiblea2.value = true; // 打开绑定架子对话框 |
| | |
| | | dialogFormVisiblea2.value = false; |
| | | } |
| | | }; |
| | | |
| | | |
| | | // 发送获取表格数据的请求 |
| | | const fetchTableData = async () => { |
| | | try { |
| | |
| | | ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | |
| | | // 更新 tableData 的数据 |
| | | |
| | | tableData.splice(0, tableData.length, ...data.params[0]); |
| | | // console.log("更新后数据", data.params[0]); |
| | | |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | |
| | | onMounted(() => { |
| | | fetchFlowCardId(); |
| | | fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | // beforeUnmount(() => { |
| | | // closeWebSocket(); |
| | | // }); |
| | | |
| | | |
| | | // setInterval(fetchTableData, 2000) |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 200px;"> |
| | | <el-table height="100%" ref="table" |
| | | <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="200px" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="workstationId" align="center" :label="$t('reportWork.lowerbit')" min-width="80" /> |
| | | <el-table-column prop="workstationId" align="center" :label="$t('reportWork.shelfnumber')" min-width="120" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="120" /> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="150" /> |
| | | <el-table-column prop="totalquantity" align="center" :label="$t('reportWork.totalquantity')" min-width="120" /> |
| | | <el-table-column prop="racksnumber" align="center" :label="$t('reportWork.beendropped')" min-width="120" /> |
| | | <el-table-column prop="layer" align="center" label="层数" min-width="120" /> |
| | | <el-table-column prop="artificialnumber" align="center" label="人工下片数" min-width="120" /> |
| | | <el-table-column prop="work_state" align="center" :label="$t('reportWork.state')" min-width="120" /> |
| | | <el-table-column prop="deviceId" align="center" :label="$t('reportWork.devicenumber')" min-width="120" /> |
| | | <el-table-column |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | |
| | | <!-- workstationId: '1', |
| | | workstationId: '1005', |
| | | flowCardId: '183.6', |
| | | totalquantity: '1991', |
| | | racksnumber:"1", |
| | | work_state: '待识别', --> |
| | | <div style="display: flex;" class="awatch"> |
| | | <div id="main-body"> |
| | | <Landingindication></Landingindication> |
| | | </div> |
| | | <div id="main-bodya"> |
| | | <Landingindicationtwo></Landingindicationtwo> |
| | | </div> |
| | | </div> |
| | | </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;"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | |
| | | <el-dialog v-model="dialogFormVisiblea2" top="21vh" width="30%" :title="$t('reportWork.clearglass')"> |
| | | |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleclear"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | <!-- workstationId: '1', |
| | | workstationId: '1005', |
| | | flowCardId: '183.6', |
| | | totalquantity: '1991', |
| | | racksnumber:"1", |
| | | work_state: '待识别', --> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div id="main-body"> |
| | | <Landingindication></Landingindication> |
| | | </div> |
| | | <div id="main-bodya"> |
| | | <Landingindicationtwo></Landingindicationtwo> |
| | | </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{ |
| | |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | #awatch{ |
| | | height: 450px; |
| | | .awatch{ |
| | | max-width: 100%; |
| | | } |
| | | #main-body{ |
| | | margin-top: -20px; |
| | | margin-left: 200px; |
| | | margin-top: -40px; |
| | | margin-left: 150px; |
| | | } |
| | | #main-bodya{ |
| | | margin-top: -10px; |
| | | margin-top: -40px; |
| | | margin-left: 100px; |
| | | } |
| | | </style> |
| | |
| | | // window.localStorage.setItem('slot', row.slot) |
| | | addb.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | function closeDialog(row) { |
| | | add.value = false; |
| | | menuName.value = ''; |
| | | listSort.value = ''; |
| | | url.value = ''; |
| | | } |
| | | function closeDialoga(row) { |
| | | adda.value = false; |
| | | menuName.value = ''; |
| | | listSort.value = ''; |
| | | url.value = ''; |
| | | } |
| | | function closeDialogb(row) { |
| | | addb.value = false; |
| | | menuName.value = ''; |
| | | listSort.value = ''; |
| | | url.value = ''; |
| | | } |
| | | function closeDialogc(row) { |
| | | addc.value = false; |
| | | menuName.value = ''; |
| | | listSort.value = ''; |
| | | url.value = ''; |
| | | } |
| | | // 添加一级菜单 |
| | | const getTableRow = async () => { |
| | | try { |
| | |
| | | <el-button type="primary" @click="getTableRow"> |
| | | {{ $t('customer.sure') }} |
| | | </el-button> |
| | | <el-button @click="add = false">{{ $t('customer.cancel') }}</el-button> |
| | | <el-button @click="closeDialog">{{ $t('customer.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | <el-button type="primary" @click="getTableRowb"> |
| | | {{ $t('customer.sure') }} |
| | | </el-button> |
| | | <el-button @click="addb = false">{{ $t('customer.cancel') }}</el-button> |
| | | <el-button @click="closeDialogb">{{ $t('customer.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | <el-button type="primary" @click="getTableRowa"> |
| | | {{ $t('customer.sure') }} |
| | | </el-button> |
| | | <el-button @click="adda = false">{{ $t('customer.cancel') }}</el-button> |
| | | <el-button @click="closeDialoga">{{ $t('customer.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | <el-button type="primary" @click="getTableRowac"> |
| | | {{ $t('customer.sure') }} |
| | | </el-button> |
| | | <el-button @click="addc = false">{{ $t('customer.cancel') }}</el-button> |
| | | <el-button @click="closeDialogc">{{ $t('customer.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | // import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | const selectedProjectNoa = ref(''); // 当前选中的角色 |
| | | const selectedProjectNoa = ref(null); // 当前选中的角色 |
| | | // const options = ref<any[]>([]); // 下拉选项列表 |
| | | const name = ref(''); |
| | | const tableData = ref([]) |
| | |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | // 添加 |
| | | // 添加 |
| | | const getTableRow = async () => { |
| | | try { |
| | | let menuList = []; |
| | | selectedOptions.value.forEach(array => { |
| | | if (array.length >= 2) { |
| | | let id = array[0]; |
| | | let parentId = array[1]; |
| | | menuList.push({ |
| | | id: id, |
| | | parentId: 0, |
| | | children: [ |
| | | { |
| | | id: parentId, |
| | | parentId: id, |
| | | } |
| | | ], |
| | | }); |
| | | let parentIdMap = {}; // 用于存储已经添加的父项 |
| | | selectedOptions.value.forEach(array => { |
| | | if (array.length >= 2) { |
| | | let id = array[0]; |
| | | let parentId = array[1]; |
| | | // 如果id还未作为父项添加,则添加它 |
| | | if (!parentIdMap[id]) { |
| | | menuList.push({ |
| | | id: id, |
| | | parentId: 0, // 通常,顶级项的parentId可能是null或特定的根ID,这里设为0可能是个特殊用途 |
| | | children: [] |
| | | }); |
| | | parentIdMap[id] = menuList[menuList.length - 1]; // 更新映射 |
| | | } |
| | | // 向对应的父项添加子项 |
| | | if (!parentIdMap[id].children.some(child => child.id === parentId)) { |
| | | // 检查是否已存在相同的子项(基于id),避免重复添加 |
| | | parentIdMap[id].children.push({ |
| | | id: parentId, |
| | | parentId: id |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | const dataToSend = { |
| | | name: name.value, |
| | | menuList: menuList |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | name.value = row.name; |
| | | selectedOptions.value = row.selectedOptions |
| | | // options.value = res.data.tree |
| | | adda.value = true; // 显示对话框 |
| | | window.localStorage.setItem('id', row.id) |
| | | name.value = row.name; |
| | | adda.value = true; |
| | | window.localStorage.setItem('ids', row.id); |
| | | const parentIdMap = {}; |
| | | const menuItemsById = {}; // 快速查找菜单项 |
| | | let topLevelItems = []; // 存储顶级菜单项 |
| | | row.menuList.forEach(item => { |
| | | const parentId = item.parentId === 0 ? null : item.parentId; |
| | | const menuItem = { |
| | | id: item.id, |
| | | parentId: parentId, |
| | | menuName: item.menuName, |
| | | children: [] |
| | | }; |
| | | menuItemsById[item.id] = menuItem; |
| | | // 初始化或更新parentIdMap中的数组 |
| | | if (!parentIdMap[parentId]) { |
| | | parentIdMap[parentId] = []; |
| | | } |
| | | if (parentId === null) { |
| | | // 顶级菜单项直接添加到topLevelItems |
| | | topLevelItems.push(menuItem); |
| | | } else { |
| | | // 非顶级菜单项添加到parentIdMap中 |
| | | parentIdMap[parentId].push(menuItem); |
| | | } |
| | | }); |
| | | for (const parentId in parentIdMap) { |
| | | if (parentId !== 'null') { // 跳过顶级菜单项 |
| | | parentIdMap[parentId].forEach(child => { |
| | | // 查找父项并添加子项 |
| | | if (menuItemsById[parentId]) { |
| | | menuItemsById[parentId].children.push(child); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | if (selectedOptions.value !== topLevelItems) { |
| | | selectedOptions.value = topLevelItems; |
| | | } |
| | | console.log(topLevelItems); |
| | | // selectedOptions.value = topLevelItems; |
| | | const topLevelItemsWithChildren = topLevelItems; // 包含顶级菜单项及其子菜单项的数组 |
| | | let selectedPath = []; |
| | | // 循环遍历 topLevelItemsWithChildren 数组 |
| | | for (let i = 0; i < topLevelItemsWithChildren.length; i++) { |
| | | // 添加顶级菜单项的 id |
| | | selectedPath.push(topLevelItemsWithChildren[i].id); |
| | | // 如果有子菜单项,添加第一个子菜单项的 id |
| | | if (topLevelItemsWithChildren[i].children && topLevelItemsWithChildren[i].children.length > 0) { |
| | | for (let j = 0; j < topLevelItemsWithChildren[i].children.length; j++) { |
| | | // 将每个子菜单项的 id 添加到 selectedPath 中 |
| | | selectedPath.push(topLevelItemsWithChildren[i].children[j].id); |
| | | } |
| | | } |
| | | } |
| | | console.log(selectedPath); |
| | | selectedOptions.value = selectedPath; |
| | | } |
| | | // 编辑 |
| | | const getTableRowa = async () => { |
| | | let id = window.localStorage.getItem('id') |
| | | let ids = window.localStorage.getItem('ids') |
| | | try { |
| | | let menuList = []; |
| | | selectedOptions.value.forEach(array => { |
| | | if (array.length >= 2) { |
| | | let id = array[0]; |
| | | let parentId = array[1]; |
| | | menuList.push({ |
| | | id: id, |
| | | parentId: 0, |
| | | children: [ |
| | | { |
| | | id: parentId, |
| | | parentId: id, |
| | | } |
| | | ], |
| | | }); |
| | | let parentIdMap = {}; // 用于存储已经添加的父项 |
| | | selectedOptions.value.forEach(array => { |
| | | if (array.length >= 2) { |
| | | let id = array[0]; |
| | | let parentId = array[1]; |
| | | // 如果id还未作为父项添加,则添加它 |
| | | if (!parentIdMap[id]) { |
| | | menuList.push({ |
| | | id: id, |
| | | parentId: 0, // 通常,顶级项的parentId可能是null或特定的根ID,这里设为0可能是个特殊用途 |
| | | children: [] |
| | | }); |
| | | parentIdMap[id] = menuList[menuList.length - 1]; // 更新映射 |
| | | } |
| | | // 向对应的父项添加子项 |
| | | if (!parentIdMap[id].children.some(child => child.id === parentId)) { |
| | | // 检查是否已存在相同的子项(基于id),避免重复添加 |
| | | parentIdMap[id].children.push({ |
| | | id: parentId, |
| | | parentId: id |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | const dataToSend = { |
| | | id:id, |
| | | id:ids, |
| | | name: name.value, |
| | | menuList: menuList |
| | | }; |
| | | const response = await request.post('/loadGlass/sys/role/updateRole', dataToSend); |
| | | // try { |
| | | // const response = await request.post('/loadGlass/sys/role/updateRole', { |
| | | // id: id, |
| | | // name: name.value, |
| | | // }); |
| | | |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | adda.value = false; |
| | | name.value = ''; |
| | | selectedOptions.value = ''; |
| | | fetchOptionsa() |
| | | tableData.value = response.data; |
| | | selectedOptions.value = ''; |
| | | fetchOptionsa(); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | | function closeDialog(row) { |
| | | add.value = false; |
| | | name.value = ''; |
| | | selectedOptions.value = ''; |
| | | } |
| | | function closeDialoga(row) { |
| | | adda.value = false; |
| | | name.value = ''; |
| | | selectedOptions.value = ''; |
| | | } |
| | | // 删除 |
| | | const opena = async(row) => { |
| | | try { |
| | |
| | | <el-button type="primary" @click="getTableRow"> |
| | | {{ $t('delivery.sure') }} |
| | | </el-button> |
| | | <el-button @click="add = false"> {{ $t('delivery.cancel') }}</el-button> |
| | | <el-button @click="closeDialog"> {{ $t('delivery.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | <el-button type="primary" @click="getTableRowa"> |
| | | {{ $t('delivery.sure') }} |
| | | </el-button> |
| | | <el-button @click="adda = false">{{ $t('delivery.cancel') }}</el-button> |
| | | <el-button @click="closeDialoga">{{ $t('delivery.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | const { t } = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | // import LanguageMixin from './lang/LanguageMixin' |
| | | const selectedProjectNoa = ref(''); // 当前选中的角色 |
| | | const selectedProjectNoa = ref(null); // 当前选中的角色 |
| | | // const options = ref<any[]>([]); // 下拉选项列表 |
| | | const userName = ref(''); |
| | | const password = ref(''); |
| | |
| | | }; |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | userName.value = row.userName; |
| | | userName.value = row.userName; |
| | | if (row.roleList && row.roleList.length > 0) { |
| | | const firstRole = row.roleList[0]; |
| | | selectedProjectNoa.value = firstRole.id; // 设置为ID,而不是name |
| | | } |
| | | adda.value = true; // 显示对话框 |
| | | window.localStorage.setItem('id', row.id) |
| | | |
| | | } |
| | | |
| | | function closeDialog(row) { |
| | | add.value = false; |
| | | userName.value = ''; |
| | | nickName.value = ''; |
| | | password.value = ''; |
| | | selectedProjectNoa.value = ''; |
| | | } |
| | | function closeDialoga(row) { |
| | | adda.value = false; |
| | | userName.value = ''; |
| | | nickName.value = ''; |
| | | password.value = ''; |
| | | } |
| | | // 添加 |
| | | const getTableRow = async () => { |
| | | try { |
| | |
| | | tableData.value = response.data; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | |
| | | <el-button type="primary" @click="getTableRow"> |
| | | {{ $t('productStock.sure') }} |
| | | </el-button> |
| | | <el-button @click="add = false">{{ $t('productStock.cancel') }}</el-button> |
| | | <el-button @click="closeDialog">{{ $t('productStock.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | <el-button type="primary" @click="getTableRowa"> |
| | | {{ $t('productStock.sure') }} |
| | | </el-button> |
| | | <el-button @click="adda = false">{{ $t('productStock.cancel') }}</el-button> |
| | | <el-button @click="closeDialoga">{{ $t('productStock.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
New file |
| | |
| | | <template> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <el-scrollbar height="600px"> |
| | | <div id="top" style="height: 150px;display: flex;"> |
| | | <div class="echarts-container"> |
| | | <div v-for="(processData, index) in processesData" :key="index" class="echarts-item"> |
| | | <div :id="'pieChart_' + index" class="pie-chart"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div id="centerleft" style="margin-top: 10px;height: 240px;width: 340px;background-color: #911005;"> |
| | | <el-table height="240" ref="table" width="340px" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column fixed prop="orderId" align="center" :label="$t('large.number')" min-width="110" /> |
| | | <el-table-column prop="project" align="center" :label="$t('large.projectname')" min-width="100" /> |
| | | <el-table-column prop="responsibleProcess" align="center" :label="$t('large.responsibleprocess')" min-width="100" /> |
| | | <el-table-column prop="breakageQuantity" align="center" :label="$t('large.numberfractions')" min-width="110" /> |
| | | <el-table-column prop="patchProcesses" align="center" :label="$t('large.process')" min-width="100" /> |
| | | <el-table-column fixed="right" :label="$t('large.operate')" align="center" width="100"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="handleBinda">{{ $t('large.mes') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div id="center" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 750px;"> |
| | | <img src="../../assets/d1a.png" alt="" style="margin-left: -10px; width: 100%;height: 100%;position: relative;"> |
| | | </div> |
| | | <div id="centerright" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 240px;background-color: #911005;"> |
| | | <el-table height="240" ref="table" width="340px" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="projectNo" align="center" :label="$t('large.projectnumber')" min-width="50" /> |
| | | <el-table-column prop="projectName" align="center" :label="$t('large.projectname')" min-width="50" /> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <div id="bottom" style="margin-top: 10px;height: 190px;background-color: #911005;"> |
| | | <el-table height="190" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="orderId" align="center" :label="$t('large.orderId')" min-width="50" /> |
| | | <el-table-column prop="customerName" align="center" :show-overflow-tooltip="true" :label="$t('large.customerName')" min-width="90" /> |
| | | <el-table-column prop="project" align="center" :label="$t('large.project')" min-width="50" /> |
| | | <el-table-column prop="area" align="center" :label="$t('large.are')" min-width="50" /> |
| | | <el-table-column prop="quantity" align="center" :label="$t('large.quantity')" min-width="50" /> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('large.warehousing')" |
| | | min-width="50" |
| | | prop="warehousing" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType(scope.row.warehousing)"> |
| | | {{ getStatusText(scope.row.warehousing) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deliveryDate" align="center" :label="$t('large.deliveryDate')" min-width="50" /> |
| | | </el-table> |
| | | </div> |
| | | </el-scrollbar> |
| | | </el-card> |
| | | <el-dialog v-model="blinda" top="5vh" width="80%" :title="$t('large.brokeno')"> |
| | | <el-table height="400" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="reportingWorkTime" fixed align="center" :label="$t('large.time')" min-width="110" /> |
| | | <el-table-column prop="orderId" fixed align="center" :label="$t('large.number')" min-width="110" /> |
| | | <el-table-column prop="reportingWorkId" align="center" :label="$t('large.jobnumber')" min-width="120" /> |
| | | <el-table-column prop="productionId" align="center" :label="$t('large.productionnumber')" min-width="130" /> |
| | | <el-table-column prop="processId" align="center" :label="$t('large.cardnumber')" min-width="140" /> |
| | | <el-table-column prop="project" align="center" :label="$t('large.projectname')" min-width="110" /> |
| | | <el-table-column prop="batch" align="center" :label="$t('large.batch')" min-width="110" /> |
| | | <el-table-column prop="reviewer" align="center" :label="$t('large.detailID')" min-width="110" /> |
| | | <el-table-column prop="orderSort" align="center" :label="$t('large.serialnumber')" min-width="110" /> |
| | | <el-table-column prop="productName" align="center" :label="$t('large.productname')" :show-overflow-tooltip="true" min-width="220" /> |
| | | <el-table-column prop="technologyNumber" align="center" :label="$t('large.serial')" min-width="110" /> |
| | | <el-table-column prop="glassAddress" align="center" :label="$t('large.slicemarker')" min-width="130" /> |
| | | <el-table-column prop="patchNum" align="center" :label="$t('large.numberpatches')" min-width="110" /> |
| | | <el-table-column prop="width" align="center" :label="$t('large.width')" min-width="110" /> |
| | | <el-table-column prop="height" align="center" :label="$t('large.height')" min-width="110" /> |
| | | <el-table-column prop="shape" align="center" :label="$t('large.shape')" min-width="110" /> |
| | | <el-table-column prop="responsibleProcess" align="center" :label="$t('large.responsibleprocess')" min-width="110" /> |
| | | <el-table-column prop="patchProcesses" align="center" :label="$t('large.process')" min-width="110" /> |
| | | <el-table-column prop="breakageQuantity" align="center" :label="$t('large.numberfractions')" min-width="110" /> |
| | | <el-table-column prop="patchReason" align="center" :label="$t('large.breakreason')" min-width="110" /> |
| | | <el-table-column prop="patchType" align="center" :label="$t('large.breaktype')" min-width="110" /> |
| | | <el-table-column prop="responsiblePersonnel" align="center" :label="$t('large.responsiblepersonnel')" min-width="110" /> |
| | | <el-table-column prop="responsibleEquipment" align="center" :label="$t('large.responsiblequipment')" min-width="110" /> |
| | | <el-table-column prop="responsibleTeam" align="center" :label="$t('large.responsibleteam')" min-width="110" /> |
| | | <el-table-column prop="patchArea" align="center" :label="$t('large.area')" min-width="110" /> |
| | | <el-table-column prop="qualityInspector" align="center" :label="$t('large.inspector')" min-width="110" /> |
| | | </el-table> |
| | | <template #footer> |
| | | <div id="dialog-footer" style="text-align: center;"> |
| | | <el-button @click="blinda = false">{{ $t('large.close') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </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 } 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 * as echarts from 'echarts'; |
| | | const tableData = ref([]) |
| | | const tableDatab = ref([]) |
| | | const tableDatac = ref([]) |
| | | const adjustedRects = ref([]); |
| | | const chartRefs = ref([]); |
| | | const thisProcess = ref(); // 用于存储process_id的响应式引用 |
| | | // 定义一个响应式引用来存储图表实例 |
| | | const chartDom = ref(null); |
| | | let chartInstance = null; |
| | | const blinda = ref(false) |
| | | const handleBinda = (row) => { |
| | | blinda.value = true; |
| | | }; |
| | | const processesData = ref([ |
| | | |
| | | ]); |
| | | function getStatusType(warehousing) { |
| | | switch (warehousing) { |
| | | case 0: |
| | | return 'info'; |
| | | case 1: |
| | | return 'warning'; |
| | | case 2: |
| | | return 'success'; |
| | | } |
| | | } |
| | | function getStatusText(warehousing) { |
| | | switch (warehousing) { |
| | | case 0: |
| | | return t('large.notstocked'); |
| | | case 1: |
| | | return t('large.inboundstatus'); |
| | | case 2: |
| | | return t('large.allstatus'); |
| | | } |
| | | } |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | tableData.value = data.awaitingRepairs[0] |
| | | tableDatab.value = data.DoingTask[0] |
| | | tableDatac.value = data.orders[0] |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completed: rect.completedQuantity, |
| | | // breakage: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | }; |
| | | let socket; |
| | | // 设置图表 DOM 引用 |
| | | function setChartDom(index, el) { |
| | | if (!chartRefs.value[index]) { |
| | | chartRefs.value[index] = { dom: el, chart: null }; |
| | | } else { |
| | | chartRefs.value[index].dom = el; |
| | | } |
| | | } |
| | | onMounted(() => { |
| | | socket = new WebSocket(socketUrl); |
| | | socket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | processesData.value = data.device[0].map(rect => ({ |
| | | ...rect, |
| | | completedQuantity: rect.completedQuantity, |
| | | breakageQuantity: rect.breakageQuantity, |
| | | thisProcess: rect.thisProcess, |
| | | })); |
| | | renderPieCharts(); |
| | | console.log(processesData.value); |
| | | // updateCharts(); |
| | | }; |
| | | |
| | | // }; |
| | | }); |
| | | const renderPieCharts = () => { |
| | | processesData.value.forEach((data, index) => { |
| | | const chart = echarts.init(document.getElementById('pieChart_' + index)); |
| | | const options = { |
| | | title: { |
| | | text: `${data.thisProcess} `, |
| | | left: 'center', |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item', |
| | | }, |
| | | series: [ |
| | | { |
| | | name: `${data.thisProcess} `, |
| | | type: 'pie', |
| | | radius: ['40%', '70%'], |
| | | avoidLabelOverlap: false, |
| | | data: [ |
| | | { value: data.completedQuantity, name: t('large.completedquantity') }, |
| | | { value: data.breakageQuantity, name: t('large.scrapquantity') } |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | }, |
| | | label: { |
| | | show: false, |
| | | position: 'center', |
| | | }, |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | chart.setOption(options); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | |
| | | |
| | | .echarts-container { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 20px; |
| | | } |
| | | |
| | | .echarts-item { |
| | | width: 150px; |
| | | height: 150px; |
| | | margin: 20px; |
| | | } |
| | | |
| | | .pie-chart { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | </style> |
| | |
| | | * A09出片目标位置 d02卧转立 钢化出片 3001 |
| | | * A10出片目标位置 d05卧转立 人工出片 3002 |
| | | */ |
| | | //todo:临时将钢化出片线路改为人工出片 |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 3002; |
| | | public static final Integer TEMPERING_OUT_TARGET_POSITION = 3001; |
| | | public static final Integer ARTIFICIAL_OUT_TARGET_POSITION = 3002; |
| | | |
| | | /** |
| | |
| | | * 2 卧转立进片完成 |
| | | * 3 大车进片完成 |
| | | * 4 大理片笼进片完成 |
| | | * 5 大理片笼进片失败 |
| | | * 6 大理片笼进片破损 |
| | | */ |
| | | public static final Integer BIG_STORAGE_IN_NEW = 1; |
| | | public static final Integer BIG_STORAGE_IN_UP = 2; |
| | | public static final Integer BIG_STORAGE_IN_CAR = 3; |
| | | public static final Integer BIG_STORAGE_IN_SLOT = 4; |
| | | public static final Integer BIG_STORAGE_IN_ERROR = 5; |
| | | public static final Integer BIG_STORAGE_IN_DAMAGE = 6; |
| | | public static final List<Integer> BIG_STORAGE_IN_UP_ALL = Arrays.asList(1, 2); |
| | | /** |
| | | * 卧转立出片请求 |
| | | * 1 任务生成 |
| | | * 2 玻璃进大车完成 |
| | | * 3 大车出片完成 |
| | | * 4 大理片笼进片失败 |
| | | * 5 大理片笼进片破损 |
| | | */ |
| | | public static final Integer BIG_STORAGE_OUT_NEW = 1; |
| | | public static final Integer BIG_STORAGE_OUT_CAR = 2; |
| | | public static final Integer BIG_STORAGE_OUT_SUCCESS = 3; |
| | | public static final Integer BIG_STORAGE_OUT_ERROR = 4; |
| | | public static final Integer BIG_STORAGE_OUT_DAMAGE = 5; |
| | | |
| | | /** |
| | | * 卧转立出片请求 |
| | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author wu |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Api(description = "报工信息") |
| | | @RestController |
| | | @RequestMapping("/damage") |
| | | public class DamageController { |
| | |
| | | @Autowired |
| | | private DamageService damageService; |
| | | @ApiOperation("报工数据查询") |
| | | @GetMapping("/selectDamage") |
| | | public Result selectDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedureId)); |
| | | @ResponseBody |
| | | @PostMapping("/selectDamage") |
| | | public Result selectDamage(@RequestBody Map map) { |
| | | String startTime=map.get("startTime").toString(); |
| | | String endTime=map.get("endTime").toString(); |
| | | int type =Integer.parseInt(map.get("type").toString()); |
| | | int status =Integer.parseInt(map.get("status").toString()); |
| | | int workingProcedure =Integer.parseInt(map.get("workingProcedure").toString()); |
| | | // String startTime , String endTime, int type, int status, int workingProcedure |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedure)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | | @GetMapping("/submitDamage") |
| | | @PostMapping("/submitDamage") |
| | | public Result submitDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | damageService.submitDamage(startTime,endTime,type,status,workingProcedureId); |
| | | return Result.build(200,"报工成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据修改") |
| | | @GetMapping("/updateDamage") |
| | | @PostMapping("/updateDamage") |
| | | public Result updateDamage(List<Damage> damageList) { |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"修改成功",1); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | /** |
| | | * 工序 |
| | | */ |
| | | private Integer workingProcedure; |
| | | private String workingProcedure; |
| | | |
| | | /** |
| | | * 玻璃id |
| | |
| | | /** |
| | | * 生产时间 |
| | | */ |
| | | private LocalDateTime damageTime; |
| | | private Timestamp damageTime; |
| | | |
| | | /** |
| | | * 备注 |
| | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface DamageService extends IService<Damage> { |
| | | |
| | | List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | List<Damage> selectDamage(String startTime, String endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.work_assignment.entity.WorkAssignment; |
| | | import com.mes.work_assignment.mapper.WorkAssignmentMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | * 查询报工信息 |
| | | */ |
| | | @Override |
| | | public List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | public List<Damage> selectDamage(String startTime, String endTime, int type, int status, int workingProcedure){ |
| | | LambdaQueryWrapper<Damage> damageSelectWrapper =new LambdaQueryWrapper<>(); |
| | | damageSelectWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | |
| | | if (status!=0){ |
| | | damageSelectWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedure,workingProcedureId); |
| | | if(workingProcedure!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedure,workingProcedure); |
| | | } |
| | | return baseMapper.selectList(damageSelectWrapper); |
| | | } |
| | |
| | | LambdaQueryWrapper<GlassInfo> glassInfoSelectWrapper=new LambdaQueryWrapper<>(); |
| | | glassInfoSelectWrapper.eq(GlassInfo::getGlassId,damage.getGlassId()); |
| | | GlassInfo glassInfo=glassInfoMapper.selectOne(glassInfoSelectWrapper); |
| | | BeanUtils.copyProperties(glassInfo, damage); |
| | | |
| | | LambdaQueryWrapper<WorkAssignment> workAssignmentSelectWrapper=new LambdaQueryWrapper<>(); |
| | | workAssignmentSelectWrapper |
| | | .eq(WorkAssignment::getLine,damage.getLine()) |
| | | .eq(WorkAssignment::getWorkProcesses,damage.getWorkingProcedure()); |
| | | WorkAssignment workAssignment=workAssignmentMapper.selectOne(workAssignmentSelectWrapper); |
| | | |
| | | damage.setTeamsGroupsName(workAssignment.getTeamsGroupsName()); |
| | | damage.setDeviceName(workAssignment.getDeviceName()); |
| | | |
| | | damage.setEngineerId(glassInfo.getEngineerId()); |
| | | damage.setTemperingLayoutId(glassInfo.getTemperingLayoutId()); |
| | | damage.setProcessId(glassInfo.getFlowCardId()); |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(LocalDateTime.now()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | damage.setType(2); |
| | | baseMapper.insert(damage); |
| | | } |
| | | } |
| | |
| | | package com.mes.glassinfo.service; |
| | | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | void saveGlassInfo(List<GlassInfo> glassinfo); |
| | | |
| | | /** |
| | | * @param flowCardId |
| | | * @return 根据流程卡号查询玻璃信息 |
| | | */ |
| | | int getGlassInfoCountByFlowCardId(String flowCardId); |
| | | int getGlassInfoCountByFlowCardId(String flowCardId, int layer); |
| | | |
| | | /** |
| | | * @return |
| | | * 查询所有工程状态不为300不同流程卡号 |
| | | * @return 查询所有工程状态不为300不同流程卡号 |
| | | */ |
| | | List<Map<String, Object>> getFlowCardId(); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.mapper.OptimizeProjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Service |
| | | @Slf4j |
| | | public class GlassInfoServiceImpl extends MPJBaseServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService { |
| | | @Autowired |
| | | @Resource |
| | | OptimizeProjectMapper optimizeProjectMapper; |
| | | |
| | | @Override |
| | |
| | | optimizeGlassinfos = optimizeProjectMapper.selectJoinList(OptimizeGlassinfo.class, new MPJQueryWrapper<OptimizeProject>() |
| | | .select("b.process_id,t.glass_type,b.o_width,b.o_height,t.glass_thickness,b.order_sort,b.p_width,b.p_height,b.layer, b.total_layer, b.stock_id,b.heat_layout_id,b.heat_layout_sort,c.x_axis,c.y_axis,b.project_no,b.glass_id,c.rotate_angle") |
| | | .leftJoin("optimize_detail b on t.project_no=b.project_no") |
| | | .leftJoin("optimize_heat_detail c on c.project_no=t.project_no and b.heat_layout_id=c.layout_id and b.heat_layout_sort=c.sort") |
| | | .leftJoin("optimize_heat_detail c on c.project_no=t.project_no and b.heat_layout_id=c.layout_id and b.heat_layout_sort=c.sort") |
| | | //.eq("t.state",100) |
| | | .eq("t.project_no", engineeringId)); |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId) { |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId, int layer) { |
| | | return baseMapper.selectCount(new QueryWrapper<GlassInfo>().lambda() |
| | | .eq(GlassInfo::getFlowCardId, flowCardId)); |
| | | .eq(GlassInfo::getFlowCardId, flowCardId) |
| | | .eq(GlassInfo::getLayer, layer)); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | new QueryWrapper<GlassInfo>() |
| | | .in("engineer_id", engineerIds) |
| | | .groupBy("flow_card_id") |
| | | .groupBy("layer") |
| | | ); |
| | | |
| | | // 转换为 List<Map<String, Object>> |
| | | List<Map<String, Object>> result = glassInfos.stream() |
| | | .map(glassInfo -> { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("flow_card_id", glassInfo.getFlowCardId()); |
| | | map.put("flow_card_id", glassInfo.getFlowCardId() + " | " + glassInfo.getLayer()); |
| | | // 如果还有其他字段需要添加到 map 中,在这里继续添加 |
| | | return map; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | log.info("result: {}", result); |
| | | log.info("result666: {}", result); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("pp") |
| | | @Mapper |
| | | public interface OptimizeDetailMapper extends MPJBaseMapper<OptimizeDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("pp") |
| | | public interface OptimizeLayoutMapper extends MPJBaseMapper<OptimizeLayout> { |
| | | |
| | | } |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @Mapper |
| | | @DS("pp") |
| | | public interface OptimizeProjectMapper extends MPJBaseMapper<OptimizeProject> { |
| | | List<OptimizeProject> saveProject(OptimizeRequest optimizeRequest); |
New file |
| | |
| | | package com.mes.pp.service; |
| | | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | public interface OptimizeLayoutService extends MPJBaseService<OptimizeLayout> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.pp.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import com.mes.pp.mapper.OptimizeLayoutMapper; |
| | | import com.mes.pp.service.OptimizeLayoutService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @Service |
| | | @DS("pp") |
| | | public class OptimizeLayoutServiceImpl extends MPJBaseServiceImpl<OptimizeLayoutMapper, OptimizeLayout> implements OptimizeLayoutService { |
| | | |
| | | } |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @DS("salve_hangzhoumes_1") |
| | | @DS("salve_hangzhoumes") |
| | | public interface TemperingGlassInfoMapper extends MPJBaseMapper<TemperingGlassInfo> { |
| | | |
| | | boolean saveBatch(@Param(value = "list") List<TemperingGlassInfo> list); |
| | |
| | | public void onOpen(Session session, @PathParam("username") String username) { |
| | | this.username = username; |
| | | this.session = session; |
| | | this.session.setMaxTextMessageBufferSize(12*1024*1024); |
| | | this.session.setMaxBinaryMessageBufferSize(12*1024*1024); |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | if (webSocketServers == null) { |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | |
| | | * |
| | | * @param message 客户端发送过来的消息 |
| | | */ |
| | | @OnMessage |
| | | @OnMessage(maxMessageSize = 5242880) |
| | | public void onMessage(String message, Session session, @PathParam("username") String username) { |
| | | log.info("服务端收到用户username={}的消息:{}", username, message); |
| | | JSONObject obj = JSONUtil.parseObj(message); |
| | |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import com.mes.work_assignment.service.WorkAssignmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | * @author wu |
| | | * @since 2024-07-01 |
| | | */ |
| | | @Api(description = "值班信息") |
| | | @RestController |
| | | @RequestMapping("/work_assignment/work-assignment") |
| | | @RequestMapping("/work_assignment") |
| | | public class WorkAssignmentController { |
| | | |
| | | @Autowired |
| | | private WorkAssignmentService workAssignmentService; |
| | | @ApiOperation("报工数据查询") |
| | | @GetMapping("/selectWorkAssignment") |
| | | public Result selectDamage(int line,String workingProcedure) { |
| | | @ApiOperation("值班数据查询") |
| | | @PostMapping("/selectWorkAssignment") |
| | | public Result selectWorkAssignment(int line,String workingProcedure) { |
| | | return Result.build(200,"查询成功",workAssignmentService.selectWorkAssignment(line,workingProcedure)); |
| | | } |
| | | |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.menu.entity.SysMenu; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface SysMenuMapper extends MPJBaseMapper<SysMenu> { |
| | | |
| | | List<String> selectPermsByUserId(long parseLong); |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.role.entity.SysRole; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | public interface SysRoleMapper extends MPJBaseMapper<SysRole> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.role.entity.SysRoleMenu; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface SysUserMapper extends MPJBaseMapper<SysUser> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface SysUserRoleMapper extends MPJBaseMapper<SysUserRole> { |
| | | |
| | | } |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | private Integer status; |
| | | |
| | | private Integer line; |
| | | |
| | | |
| | | private Date time; |
| | | |
| | | } |
| | |
| | | @PostMapping("/updateEdgStorageCage") |
| | | @ResponseBody |
| | | public Result updateEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"【启用/禁用】成功",1); |
| | | String isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage)?"成功":"失败"; |
| | | return Result.build(200,"【启用/禁用】"+isSucess,1); |
| | | } |
| | | |
| | | @ApiOperation("磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除/更换/绑定】 EdgStorageCage格子信息,EdgStorageCageDetails 玻璃信息 ") |
| | | @PostMapping("/edgStorageCageGlass") |
| | | @ResponseBody |
| | | public Result edgStorageCageGlass(@RequestBody EdgStorageCageDetails edgStorageCageDetails,int edgStorageCageId) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCageDetails(edgStorageCageId,edgStorageCageDetails); |
| | | return Result.build(200,"【清除/更换/绑定】成功",1); |
| | | String isSucess=edgStorageCageService.updateEdgStorageCageDetails(edgStorageCageId,edgStorageCageDetails)?"成功":"失败"; |
| | | return Result.build(200,"【清除/更换/绑定】"+isSucess,1); |
| | | } |
| | | |
| | | @ApiOperation("磨边模块汇报玻璃状态 功能:对笼内栅格玻璃进行【破损/拿走】 ") |
| | |
| | | public Result edgReportStatus(@RequestBody Map<String, String> arguments) { |
| | | String edgStorageCageDetailsId=arguments.get("glassId"); |
| | | int controlsId=Integer.valueOf(arguments.get("controlsId")); |
| | | boolean isSucess=edgStorageCageDetailsService.identWorn(edgStorageCageDetailsId,controlsId); |
| | | return Result.build(200,"【破损/拿走】成功",1); |
| | | String isSucess=edgStorageCageDetailsService.identWorn(edgStorageCageDetailsId,controlsId)?"成功":"失败"; |
| | | return Result.build(200,"【破损/拿走】"+isSucess,1); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.edgstoragecage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | */ |
| | | EdgStorageCage selectNearestEmpty(int currentSlot, boolean flag); |
| | | |
| | | /** |
| | | * 查询笼内空格 |
| | | * @return |
| | | */ |
| | | List<EdgStorageCage> selectCacheEmpty(); |
| | | |
| | | /** |
| | | * 查询笼内出片顺序详情 |
| | |
| | | |
| | | /** |
| | | * 修改理片笼信息 |
| | | * |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCage(EdgStorageCage edgStorageCage); |
| | | |
| | | /** |
| | | * 更新理片笼详情信息 |
| | | * |
| | | * @param edgStorageCageId |
| | | * @param edgStorageCageDetails |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCageDetails(int edgStorageCageId, EdgStorageCageDetails edgStorageCageDetails); |
| | | |
| | | } |
| | |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.print.attribute.standard.MediaSize; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public List<Map<String, Object>> selectCutTerritory() { |
| | | List<UpPattenUsage> upPattenUsage = upPattenUsageMapper.selectList(new MPJLambdaWrapper<UpPattenUsage>() |
| | | .selectAll(UpPattenUsage.class) |
| | | .eq(UpPattenUsage::getState, 1).or().eq(UpPattenUsage::getState, 0).orderByDesc(UpPattenUsage::getState)); |
| | | .orderByDesc(UpPattenUsage::getState) |
| | | .orderByDesc(UpPattenUsage::getId)); |
| | | if (!upPattenUsage.isEmpty()) { |
| | | UpPattenUsage upPattenUsage1 = upPattenUsage.get(0); |
| | | List<Map<String, Object>> cutTerritorys=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | |
| | | for (Map<String, Object> cutTerritory : cutTerritorys) { |
| | | EdgStorageCageDetails edgStorageCageDetails=baseMapper.selectOne(new MPJLambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .eq(EdgStorageCageDetails::getGlassId, cutTerritory.get("glass_id"))); |
| | | .eq(EdgStorageCageDetails::getGlassId, cutTerritory.get("glass_id")) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | // log.info("内容:{}-------{}",cutTerritory,edgStorageCageDetails); |
| | | if(edgStorageCageDetails!=null){ |
| | | cutTerritory.put("glass_state",edgStorageCageDetails.getState()); |
| | |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Service |
| | | public class EdgStorageCageServiceImpl extends MPJBaseServiceImpl<EdgStorageCageMapper, EdgStorageCage> implements EdgStorageCageService { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | @Autowired |
| | | @Resource |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | |
| | | @Override |
| | |
| | | .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot) |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON) |
| | | .last("order by abs(t.slot - " + currentSlot + ") asc limit 2") |
| | | ); |
| | | if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | |
| | | return null; |
| | | } |
| | | return emptyList.get(0); |
| | | } |
| | | |
| | | /** |
| | | * 查询笼内空格 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EdgStorageCage> selectCacheEmpty() { |
| | | return baseMapper.selectJoinList(EdgStorageCage.class, new MPJLambdaWrapper<EdgStorageCage>() |
| | | .selectAll(EdgStorageCage.class) |
| | | .leftJoin(EdgStorageCageDetails.class, on -> on |
| | | .eq(EdgStorageCageDetails::getSlot, EdgStorageCage::getSlot) |
| | | .eq(EdgStorageCageDetails::getState, "100")) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | .last("order by abs(t.slot - 4) asc") |
| | | ); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public boolean updateEdgStorageCage(EdgStorageCage edgStorageCage) { |
| | | EdgStorageCage edgItem = baseMapper.selectById(edgStorageCage.getId()); |
| | | edgItem.setEnableState(edgStorageCage.getEnableState()); |
| | | baseMapper.updateById(edgItem); |
| | | return true; |
| | | if(edgItem!=null){ |
| | | edgItem.setEnableState(edgStorageCage.getEnableState()); |
| | | baseMapper.updateById(edgItem); |
| | | log.info("卧室缓存:【启用/禁用】 参数:{} 结果:成功",edgStorageCage); |
| | | return true; |
| | | } |
| | | log.info("卧室缓存:【启用/禁用】 参数:{} 结果:失败",edgStorageCage); |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | @Value("${mes.firstLength}") |
| | | @Value("${mes.max.firstLength}") |
| | | private String firstLength; |
| | | |
| | | @Value("${mes.secondLength}") |
| | | @Value("${mes.max.secondLength}") |
| | | private String secondLength; |
| | | |
| | | @Value("${mes.min.firstLength}") |
| | | private String minFirstLength; |
| | | |
| | | @Value("${mes.min.secondLength}") |
| | | private String minSecondLength; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | | Date startDate = new Date(); |
| | | log.info("本次任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String taskRequestTypeValue = plcParameterObject.getPlcParameter("A06_request_word").getValue(); |
| | | String glassIdeValue = plcParameterObject.getPlcParameter("A05_scanning_ID").getValue(); |
| | |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void plcToHomeEdgTask() { |
| | | // log.info("推数据"); |
| | | // jsonObject.append("params", new short[] { 30, 40, }); |
| | | // ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home"); |
| | | // if (sendwServer != null) { |
| | | // for (WebSocketServer webserver : sendwServer) { |
| | | // webserver.sendMessage(jsonObject.toString()); |
| | | // if (webserver != null) { |
| | | // |
| | | // List<String> messages = webserver.getMessages(); |
| | | // |
| | | // if (!messages.isEmpty()) { |
| | | // // // 将最后一个消息转换为整数类型的列表 |
| | | // webserver.clearMessages(); |
| | | // } |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | Date endDate = new Date(); |
| | | log.info("本次任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 1.2.3、按照出片信息去详情表查询格子在笼子里面剩余相同尺寸的玻璃数据且以版图id、版序升序排序 取第一块玻璃出片 |
| | | // 2、如果没有历史出片任务 |
| | | // 2.1、出当前版图id最小版序最小的玻璃(问题:两条线都没有历史任务,出片时两条线的玻璃尺寸相同,是否找尺寸不同的) |
| | | if (out08Glassstate == 2 && out10Glassstate == 2) { |
| | | if ((out08Glassstate == 2 && out10Glassstate == 2) || (out08Glassstate == 0 && out10Glassstate == 0)) { |
| | | log.info("A09、A10为{},{}非自动状态,无法出片"); |
| | | return Boolean.FALSE; |
| | | } |
| | |
| | | EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | endcell = queryLineByGlassInfo(a09EdgGlass, a10EdgGlass, glassInfo, out08Glassstate, out10Glassstate); |
| | | } else { |
| | | //判断两条线是否都空闲 |
| | | endcell = out10Glassstate == 2 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | //按照状态判断两条线走那条线 |
| | | endcell = computerLineByState(out08Glassstate, out10Glassstate); |
| | | |
| | | if ((out08Glassstate == 0 && out10Glassstate == 0) || (out08Glassstate == 1 && out10Glassstate == 1)) { |
| | | if (out08Glassstate == 1 && out10Glassstate == 1) { |
| | | EdgStorageCageDetails a09EdgGlass = queryGlassByTaskCache(Const.A09_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | EdgStorageCageDetails a10EdgGlass = queryGlassByTaskCache(Const.A10_OUT_TARGET_POSITION, Const.GLASS_CACHE_TYPE_OUT_ALL); |
| | | if (a09EdgGlass == null && a10EdgGlass == null) { |
| | | MPJQueryWrapper<EdgStorageCageDetails> wrapper = new MPJQueryWrapper<>(); |
| | | wrapper.select("count(t.glass_id), t.width, t.height") |
| | | .eq("t.state", Const.GLASS_STATE_IN) |
| | | .inSql("t.slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .groupBy("t.width, t.height"); |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | } else { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") "); |
| | | } |
| | | wrapper.last("order by count(t.glass_id) desc limit 2"); |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); |
| | |
| | | .selectAll(GlassInfo.class).eq("t.glass_id", glassId); |
| | | // .inSql("t.engineer_id", "select engineer_id from engineering where state = 1"); |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | queryWrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from glass_info) t1 " + |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | } else { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") "); |
| | | } |
| | | GlassInfo one = glassInfoService.getOne(queryWrapper); |
| | | if (one != null) { |
| | |
| | | glassList.add(resultDetails); |
| | | } |
| | | //获取笼内玻璃 |
| | | List<EdgStorageCageDetails> details = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | List<EdgStorageCageDetails> details = edgStorageCageDetailsService.selectJoinList(EdgStorageCageDetails.class, new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class) |
| | | .leftJoin(EdgStorageCage.class, on -> on.eq(EdgStorageCage::getSlot, EdgStorageCageDetails::getSlot).eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON)); |
| | | glassList.addAll(details); |
| | | return glassList; |
| | | |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | private boolean queryMaxMinDiff(int threshold) { |
| | | 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); |
| | | .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); |
| | | int diff = (int) list.get(0); |
| | | return diff > threshold; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | .eq(EdgStorageCageDetails::getState, 100) |
| | | .eq(width != 0, EdgStorageCageDetails::getWidth, width) |
| | | .eq(height != 0, EdgStorageCageDetails::getHeight, height) |
| | | .inSql(EdgStorageCageDetails::getSlot, "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .orderByAsc(EdgStorageCageDetails::getTemperingLayoutId) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, EdgStorageCageDetails::getTemperingFeedSequence) |
| | | .last("limit 1")); |
| | |
| | | .eq("t.glass_id", taskCache.getGlassId()) |
| | | .ne("t1.glass_id", taskCache.getGlassId()) |
| | | .eq("t1.state", Const.GLASS_STATE_IN) |
| | | .inSql("t1.slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .orderByAsc("t1.tempering_layout_id") |
| | | .orderBy(Boolean.TRUE, sequenceOrder, "t1.tempering_feed_sequence"); |
| | | List<EdgStorageCageDetails> details = edgStorageCageDetailsService.selectJoinList(EdgStorageCageDetails.class, mpjLambdaWrapper); |
| | |
| | | return null; |
| | | } |
| | | return edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getGlassId, taskCache.getGlassId()) |
| | | // .inSql(EdgStorageCageDetails::getEngineerId, "select engineer_id from engineering where state = 1") |
| | | .inSql(EdgStorageCageDetails::getSlot, "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .last(" limit 1 ")); |
| | | } |
| | | |
| | |
| | | */ |
| | | private Integer queryLineByGlassInfo(EdgStorageCageDetails a08EdgStorageCageDetails, EdgStorageCageDetails a10EdgStorageCageDetails, |
| | | EdgStorageCageDetails glassInfo, int out08Glassstate, int out10Glassstate) { |
| | | boolean b08 = a08EdgStorageCageDetails != null && a08EdgStorageCageDetails.getHeight() == glassInfo.getHeight() |
| | | && a08EdgStorageCageDetails.getWidth() == glassInfo.getWidth(); |
| | | boolean b10 = a10EdgStorageCageDetails != null && a10EdgStorageCageDetails.getHeight() == glassInfo.getHeight() |
| | | && a10EdgStorageCageDetails.getWidth() == glassInfo.getWidth(); |
| | | //存在出片任务 07为空 |
| | | if (b10) { |
| | | return out10Glassstate == 2 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | if (out08Glassstate == 1 && out10Glassstate == 1) { |
| | | boolean b08 = a08EdgStorageCageDetails != null && a08EdgStorageCageDetails.getHeight() == glassInfo.getHeight() |
| | | && a08EdgStorageCageDetails.getWidth() == glassInfo.getWidth(); |
| | | boolean b10 = a10EdgStorageCageDetails != null && a10EdgStorageCageDetails.getHeight() == glassInfo.getHeight() |
| | | && a10EdgStorageCageDetails.getWidth() == glassInfo.getWidth(); |
| | | if (b08) { |
| | | return Const.A09_OUT_TARGET_POSITION; |
| | | } |
| | | if (b10) { |
| | | return Const.A10_OUT_TARGET_POSITION; |
| | | } |
| | | } |
| | | if (b08) { |
| | | return out08Glassstate == 2 ? Const.A10_OUT_TARGET_POSITION : Const.A09_OUT_TARGET_POSITION; |
| | | } |
| | | return out10Glassstate == 2 ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | return computerLineByState(out08Glassstate, out10Glassstate); |
| | | } |
| | | |
| | | /** |
| | |
| | | MPJQueryWrapper<EdgStorageCageDetails> wrapper = new MPJQueryWrapper<>(); |
| | | wrapper.select("count(t.glass_id) as count, t.width, t.height") |
| | | .eq("t.state", Const.GLASS_STATE_IN) |
| | | .inSql("t.slot", "select slot from edg_storage_cage where enable_state = " + Const.SLOT_ON) |
| | | .groupBy("t.width, t.height"); |
| | | if (endcell == Const.A09_OUT_TARGET_POSITION) { |
| | | if (endcell == Const.A10_OUT_TARGET_POSITION) { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") "); |
| | | } else { |
| | | wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + |
| | | "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + |
| | | "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") "); |
| | | } |
| | | wrapper.last("order by count(t.glass_id) desc limit 2"); |
| | | List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); |
| | |
| | | boolean taskCacheStatus = saveTaskCache(glassInfo.getGlassId(), glassInfo.getSlot(), endcell, Const.GLASS_CACHE_TYPE_OUT); |
| | | log.info("6、添加出片任务是否完成:{}", taskCacheStatus); |
| | | } |
| | | boolean glassSizeStatus = saveGlassSize(glassInfo); |
| | | boolean glassSizeStatus = saveGlassSize(glassInfo, endcell); |
| | | log.info("7、添加出片玻璃尺寸信息到磨边前玻璃表是否完成:{}", glassSizeStatus); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("8、发送确认字已完成"); |
| | |
| | | * 添加理片笼任务 |
| | | * |
| | | * @param glassInfo |
| | | * @param endcell |
| | | * @return |
| | | */ |
| | | private boolean saveGlassSize(EdgStorageCageDetails glassInfo) { |
| | | private boolean saveGlassSize(EdgStorageCageDetails glassInfo, int endcell) { |
| | | EdgGlassTaskInfo edgGlassTaskInfo = new EdgGlassTaskInfo(); |
| | | BeanUtils.copyProperties(glassInfo, edgGlassTaskInfo); |
| | | edgGlassTaskInfo.setHeight((int) (glassInfo.getHeight() * ratio)); |
| | | edgGlassTaskInfo.setWidth((int) (glassInfo.getWidth() * ratio)); |
| | | edgGlassTaskInfo.setThickness((int) (glassInfo.getThickness() * ratio)); |
| | | edgGlassTaskInfo.setStatus(Const.EDG_GLASS_BEFORE); |
| | | edgGlassTaskInfo.setLine(endcell); |
| | | edgGlassTaskInfo.setTime(new Date()); |
| | | return edgGlassTaskInfoService.save(edgGlassTaskInfo); |
| | | } |
| | | |
| | | /** |
| | | * 当前切割版图信息 |
| | | * 计算出片线路 |
| | | * 已排除都为2 都为0 的情况 |
| | | * |
| | | * @param |
| | | * @param out08Glassstate |
| | | * @param out10Glassstate |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void currentCutTerritory() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | private int computerLineByState(int out08Glassstate, int out10Glassstate) { |
| | | if (out08Glassstate == 0) { |
| | | if (out10Glassstate == 2) { |
| | | return Const.A09_OUT_TARGET_POSITION; |
| | | } else { |
| | | return Const.A10_OUT_TARGET_POSITION; |
| | | } |
| | | } else if (out08Glassstate == 1) { |
| | | return Const.A09_OUT_TARGET_POSITION; |
| | | } else { |
| | | return Const.A10_OUT_TARGET_POSITION; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 磨边任务 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgTask() { |
| | | public void CacheGlassTasks() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //识别摆片 |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | //磨边信息 |
| | | List<Map<String, Object>> EdgTasks1 = taskCacheService.selectEdgInfo("2001"); |
| | | List<Map<String, Object>> EdgTasks2 = taskCacheService.selectEdgInfo("2002"); |
| | | jsonObject.append("EdgTasks1", EdgTasks1); |
| | | jsonObject.append("EdgTasks2", EdgTasks2); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 磨边前 缓存内信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgStorageCage() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //卧室缓存笼内信息 |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: prod |
| | | application: |
| | | name: cacheGlass |
| | | mybatis-plus: |
| | |
| | | mes: |
| | | threshold: 3 |
| | | ratio: 10 |
| | | firstLength: 3500 |
| | | secondLength: 2500 |
| | | max: |
| | | firstLength: 3500 |
| | | secondLength: 2500 |
| | | min: |
| | | firstLength: 600 |
| | | secondLength: 350 |
| | | sequence: |
| | | order: false |
| | | |
| | |
| | | @PostMapping("/insertBigStorageCageDetails") |
| | | public Result insertBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.insertBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"添加成功",bigStorageCageService.querybigStorageCageDetail(0)); |
| | | return Result.build(200,"添加成功",bigStorageCageService.querybigStorageCageDetail()); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情删除") |
| | | @PostMapping("/deleteBigStorageCageDetails") |
| | | public Result deleteBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.deleteBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"删除成功",bigStorageCageService.querybigStorageCageDetail(0)); |
| | | return Result.build(200,"删除成功",bigStorageCageService.querybigStorageCageDetail()); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务破损0/拿走1") |
| | |
| | | private Integer slot; |
| | | |
| | | /** |
| | | * 栅格号 |
| | | */ |
| | | @ApiModelProperty(value = "最小厚度", position = 5) |
| | | private Integer minThickness; |
| | | /** |
| | | * 栅格号 |
| | | */ |
| | | @ApiModelProperty(value = "最大厚度", position = 6) |
| | | private Integer maxThickness; |
| | | |
| | | /** |
| | | * 启用状态 |
| | | */ |
| | | @ApiModelProperty(value = "启用状态", position = 5) |
| | | @ApiModelProperty(value = "启用状态", position = 7) |
| | | private Integer enableState; |
| | | |
| | | /** |
| | | * 剩余宽度 |
| | | */ |
| | | @ApiModelProperty(value = "剩余宽度", position = 6) |
| | | @ApiModelProperty(value = "剩余宽度", position = 8) |
| | | private Integer remainWidth; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO temperingIsAll(); |
| | | List<TemperingLayoutDTO> temperingIsAll(); |
| | | |
| | | /** |
| | | * 获取每个钢化版图占用的格子数量 |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | TemperingLayoutDTO temperingIsAll(); |
| | | List<TemperingLayoutDTO> temperingIsAll(); |
| | | |
| | | /** |
| | | * 获取每个钢化版图占用的格子数量 |
| | |
| | | |
| | | boolean outGlass(); |
| | | |
| | | List<BigStorageCage> querybigStorageCageDetail(int deviceId); |
| | | List<BigStorageCage> querybigStorageCageDetailAll(); |
| | | |
| | | Map<Integer, List<BigStorageCage>> querybigStorageCageDetail(); |
| | | |
| | | List<Map<String, Object>> selectBigStorageCageUsage(); |
| | | |
| | | void updateStorageCageDisabled(int slot,int enableState); |
| | | void updateStorageCageDisabled(int slot, int enableState); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | @Value("${mes.galssGap}") |
| | | private Integer galssGap; |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | /** |
| | | * 查询进/出片任务 |
| | | */ |
| | | @Override |
| | | public List<BigStorageCageDetails> selectTask(int taskType) { |
| | | return null; |
| | | // if (taskType == 1) { |
| | | // //进片任务数据 |
| | | // LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | // feedWrapper.eq(BigStorageCageDetails::getState, Const.BIG_STORAGE_IN); |
| | | // List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | // |
| | | // LambdaQueryWrapper<BigStorageCageFeedTask> feedTaskWrapper = new LambdaQueryWrapper<>(); |
| | | // feedTaskWrapper.lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT); |
| | | // List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(feedTaskWrapper); |
| | | // |
| | | // Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream() |
| | | // .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task)); |
| | | // |
| | | // for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) { |
| | | // BigStorageCageFeedTask bigStorageCageFeedTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | // bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | // } |
| | | // return bigStorageCageDetailsList; |
| | | // } else { |
| | | // //出片任务数据 |
| | | // LambdaQueryWrapper<BigStorageCageDetails> outWrapper = new LambdaQueryWrapper<>(); |
| | | // outWrapper.eq(BigStorageCageDetails::getState, Const.BIG_STORAGE_OUT); |
| | | // List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper); |
| | | // |
| | | // LambdaQueryWrapper<BigStorageCageOutTask> outTaskWrapper = new LambdaQueryWrapper<>(); |
| | | // outTaskWrapper.lt(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_SUCCESS); |
| | | // List<BigStorageCageOutTask> bigStorageCageOutTaskList = bigStorageCageOutTaskMapper.selectList(outTaskWrapper); |
| | | // |
| | | // Map<String, BigStorageCageOutTask> listMap = bigStorageCageOutTaskList.stream() |
| | | // .collect(Collectors.toMap(BigStorageCageOutTask::getGlassId, task -> task)); |
| | | // for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) { |
| | | // BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | // bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask); |
| | | // } |
| | | // return bigStorageCageDetailsList; |
| | | // } |
| | | if (taskType == 1) { |
| | | //进片任务数据 |
| | | LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | feedWrapper.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> feedTaskWrapper = new LambdaQueryWrapper<>(); |
| | | feedTaskWrapper |
| | | .lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT) |
| | | .isNotNull(BigStorageCageFeedTask::getTargetSlot); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(feedTaskWrapper); |
| | | |
| | | Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task)); |
| | | Iterator<BigStorageCageDetails> iterator = bigStorageCageDetailsList.iterator(); |
| | | while (iterator.hasNext()) { |
| | | BigStorageCageDetails bigStorageCageDetails = iterator.next(); |
| | | BigStorageCageFeedTask bigStorageCageFeedTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask() == null) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> feedTaskNoTargetWrapper = new LambdaQueryWrapper<>(); |
| | | feedTaskNoTargetWrapper |
| | | .lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT) |
| | | .isNull(BigStorageCageFeedTask::getTargetSlot); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskNoTargetList = bigStorageCageFeedTaskMapper.selectList(feedTaskNoTargetWrapper); |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : bigStorageCageFeedTaskNoTargetList |
| | | ) { |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId, bigStorageCageFeedTask.getGlassId()); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | } else { |
| | | //出片任务数据 |
| | | LambdaQueryWrapper<BigStorageCageDetails> outWrapper = new LambdaQueryWrapper<>(); |
| | | outWrapper.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageOutTask> outTaskWrapper = new LambdaQueryWrapper<>(); |
| | | outTaskWrapper.lt(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_SUCCESS); |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = bigStorageCageOutTaskMapper.selectList(outTaskWrapper); |
| | | |
| | | Map<String, BigStorageCageOutTask> listMap = bigStorageCageOutTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageOutTask::getGlassId, task -> task)); |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) { |
| | | BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask); |
| | | } |
| | | Iterator<BigStorageCageDetails> iterator = bigStorageCageDetailsList.iterator(); |
| | | while (iterator.hasNext()) { |
| | | BigStorageCageDetails bigStorageCageDetails = iterator.next(); |
| | | BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask); |
| | | if (bigStorageCageDetails.getBigStorageCageOutTask() == null) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState() == 0) { |
| | | carWidth = carWidth - bigStorageCageDetails.getWidth() - galssGap; |
| | | carWidth = carWidth - bigStorageCageDetails.getWidth() - glassGap; |
| | | } |
| | | } |
| | | return carWidth; |
| | |
| | | if (glassInfo != null) { |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(1); |
| | | bigStorageCageDetails.setGap(galssGap); |
| | | bigStorageCageDetails.setGap(glassGap); |
| | | } |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>(); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | return bigStorageDTO; |
| | | } |
| | | //todo:获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择 |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .gt(BigStorageCage::getMaxThickness, glassInfo.getThickness()) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .last("limit 1")); |
| | | Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TemperingLayoutDTO temperingIsAll() { |
| | | public List<TemperingLayoutDTO> temperingIsAll() { |
| | | return baseMapper.temperingIsAll(); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | public BigStorageCageDetails feedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails) { |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | //玻璃不钢化时 |
| | | if(glassInfo.getTemperingLayoutId()==null){ |
| | | if (glassInfo.getTemperingLayoutId() == null) { |
| | | |
| | | BigStorageCage bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | BigStorageCage bigStorageCage = baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | |
| | | .last("limit 1") |
| | | ); |
| | | |
| | | if(bigStorageCage.getSlot()!=null){ |
| | | if (bigStorageCage.getSlot() != null) { |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCage.getDeviceId()); |
| | | } |
| | | }else{ |
| | | } else { |
| | | //玻璃钢化时 |
| | | BigStorageCage bigStorageCage=new BigStorageCage(); |
| | | BigStorageCage bigStorageCage = new BigStorageCage(); |
| | | |
| | | bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | bigStorageCage = baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() - 1) |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | ); |
| | | log.info("1、查询理片笼内片序-1等于当前玻璃片序的玻璃"+bigStorageCage); |
| | | log.info("1、查询理片笼内片序-1等于当前玻璃片序的玻璃" + bigStorageCage); |
| | | |
| | | log.info("2、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果不为空时"+bigStorageCage.getSlot()); |
| | | log.info("2、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果不为空时" + bigStorageCage.getSlot()); |
| | | if (bigStorageCage.getSlot() != null) { |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCage.getDeviceId()); |
| | | } else { |
| | | log.info("3、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果为空时获取当前玻璃版图id是否存在理片笼内"); |
| | | |
| | | bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | bigStorageCage = baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | ); |
| | | |
| | | if(bigStorageCage != null){ |
| | | if (bigStorageCage != null) { |
| | | log.info("4、获取笼子内适合的格子"); |
| | | BigStorageCage bigStorageCages=bigStorageCageSlot(bigStorageCage.getDeviceId()); |
| | | BigStorageCage bigStorageCages = bigStorageCageSlot(bigStorageCage.getDeviceId()); |
| | | bigStorageCageDetails.setSlot(bigStorageCages.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCages.getDeviceId()); |
| | | }else{ |
| | | } else { |
| | | log.info("5、获取每个笼子版图id的个数"); |
| | | QueryWrapper<BigStorageCageDetails> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("a.device_id", "COUNT(DISTINCT b.tempering_layout_id) AS layoutCount") |
| | |
| | | .apply("LEFT JOIN (SELECT device_id, tempering_layout_id FROM big_storage_cage_details) b ON a.device_id = b.device_id AND a.slot = b.slot") |
| | | .orderByAsc("layoutCount") |
| | | .orderByAsc("a.device_id"); |
| | | List<Map<String, Object>> bigStorageCageDetailsCount= bigStorageCageDetailsMapper.selectMaps(queryWrapper); |
| | | List<Map<String, Object>> bigStorageCageDetailsCount = bigStorageCageDetailsMapper.selectMaps(queryWrapper); |
| | | |
| | | log.info("5、查询笼子内是否有合适的格子"); |
| | | boolean found=false; |
| | | boolean found = false; |
| | | for (Map<String, Object> map : bigStorageCageDetailsCount) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | int deviceId = Integer.parseInt(entry.getKey()); |
| | | BigStorageCage bigStorageCages=bigStorageCageSlot(deviceId); |
| | | if(bigStorageCage!=null){ |
| | | BigStorageCage bigStorageCages = bigStorageCageSlot(deviceId); |
| | | if (bigStorageCage != null) { |
| | | bigStorageCageDetails.setSlot(bigStorageCages.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(deviceId); |
| | | found=true; |
| | | found = true; |
| | | break; |
| | | } |
| | | } |
| | | if(found){ |
| | | if (found) { |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | if (bigStorageCageDetails.getSlot() != null) { |
| | | log.info("6、当找到合适的格子时添加玻璃到笼子表"); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetailsMapper.insert(bigStorageCageDetails); |
| | | updateRemainWidth(bigStorageCageDetails.getSlot()) ; |
| | | updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | } |
| | | return bigStorageCageDetails; |
| | | } |
| | | |
| | | //获取笼子内的空格子 |
| | | private BigStorageCage bigStorageCageSlot(Integer deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper=new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper |
| | | .eq(BigStorageCage::getRemainWidth,"5000") |
| | | .eq(BigStorageCage::getEnableState,"0") |
| | | .eq(BigStorageCage::getDeviceId,deviceId) |
| | | .orderByAsc(BigStorageCage::getSlot) |
| | | .last("LIMIT 1"); |
| | | return bigStorageCageMapper.selectOne(bigStorageCageWrapper); |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper |
| | | .eq(BigStorageCage::getRemainWidth, "5000") |
| | | .eq(BigStorageCage::getEnableState, "0") |
| | | .eq(BigStorageCage::getDeviceId, deviceId) |
| | | .orderByAsc(BigStorageCage::getSlot) |
| | | .last("LIMIT 1"); |
| | | return bigStorageCageMapper.selectOne(bigStorageCageWrapper); |
| | | } |
| | | |
| | | //出片逻辑 |
| | | @Override |
| | | public boolean outGlass() { |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getState,-1); |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getState, -1); |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(temperingGlassInfoWrapper); |
| | | log.info("1、查询钢化小片任务表是否有待出玻璃"+temperingGlassInfoList.size()); |
| | | if(temperingGlassInfoList.size()>0){ |
| | | log.info("1、查询钢化小片任务表是否有待出玻璃" + temperingGlassInfoList.size()); |
| | | if (temperingGlassInfoList.size() > 0) { |
| | | temperingGlassInfoService.addOutTask(temperingGlassInfoList); |
| | | log.info("2、添加任务到任务表"); |
| | | return true; |
| | | }else{ |
| | | } else { |
| | | log.info("3、没有可出的玻璃时获取是否有小片到齐的版图"); |
| | | |
| | | QueryWrapper<BigStorageCageDetails> wrapper = Wrappers.query(); |
| | |
| | | .groupBy("tempering_layout_id"); |
| | | List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(wrapper); |
| | | |
| | | boolean key=false; |
| | | boolean key = false; |
| | | for (Map<String, Object> row : temperingLayoutIdList) { |
| | | for (Map.Entry<String, Object> entry : row.entrySet()) { |
| | | String temperingId = entry.getKey(); |
| | | Object temperingNo = entry.getValue(); |
| | | |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getTemperingLayoutId,temperingId) |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence); |
| | | List<GlassInfo> glassInfoList= glassInfoService.list(glassInfoWrapper); |
| | | if(glassInfoList.size()==Integer.parseInt(temperingNo.toString())){ |
| | | for (GlassInfo glassInfo:glassInfoList |
| | | ) { |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getTemperingLayoutId, temperingId) |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence); |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(glassInfoWrapper); |
| | | if (glassInfoList.size() == Integer.parseInt(temperingNo.toString())) { |
| | | for (GlassInfo glassInfo : glassInfoList |
| | | ) { |
| | | |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfoService.save(temperingGlassInfo); |
| | | TemperingGlassInfo temperingGlassInfo = new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfoService.save(temperingGlassInfo); |
| | | |
| | | } |
| | | key=true; |
| | | } |
| | | if(key){ |
| | | key = true; |
| | | } |
| | | if (key) { |
| | | return false; |
| | | } |
| | | } |
| | |
| | | public void updateRemainWidth(int slot) { |
| | | log.info("获取该格子内玻璃信息,计算格子剩余宽度"); |
| | | double width = 5000; |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper=new LambdaQueryWrapper(); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper = new LambdaQueryWrapper(); |
| | | bigStorageCageDetailsWrapper |
| | | .eq(BigStorageCageDetails::getSlot,slot) |
| | | .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_IN) |
| | | .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_ARTIFICIAL); |
| | | .eq(BigStorageCageDetails::getSlot, slot) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL); |
| | | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper); |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | double widths=bigStorageCageDetails.getWidth(); |
| | | double gap=bigStorageCageDetails.getGap(); |
| | | width -= widths+gap; |
| | | double widths = bigStorageCageDetails.getWidth(); |
| | | double gap = bigStorageCageDetails.getGap(); |
| | | width -= widths + gap; |
| | | } |
| | | //修改格子剩余宽度 |
| | | BigStorageCage bigStorageCage = new BigStorageCage(); |
| | | bigStorageCage.setRemainWidth((int)width); |
| | | bigStorageCage.setRemainWidth((int) width); |
| | | UpdateWrapper<BigStorageCage> bigStorageCageWrapper = new UpdateWrapper<>(); |
| | | bigStorageCageWrapper.eq("slot", slot); |
| | | bigStorageCageMapper.update(bigStorageCage, bigStorageCageWrapper); |
| | |
| | | |
| | | //查询大理片信息,前端展示用 |
| | | @Override |
| | | public List<BigStorageCage> querybigStorageCageDetail(int deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper =new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .or() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL); |
| | | if(deviceId!=0){ |
| | | bigStorageCageWrapper.eq(BigStorageCage::getDeviceId,deviceId); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getDeviceId,deviceId); |
| | | } |
| | | public List<BigStorageCage> querybigStorageCageDetailAll() { |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .orderByAsc(BigStorageCage::getSlot); |
| | | return bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | } |
| | | |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectList(bigStorageCageWrapper); |
| | | log.info("1、获取大理片笼信息完成,获取到的数据{}", bigStorageCages.size()); |
| | | //查询大理片信息,前端展示用 |
| | | @Override |
| | | public Map<Integer, List<BigStorageCage>> querybigStorageCageDetail() { |
| | | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper); |
| | | |
| | | Map<Integer, List<BigStorageCageDetails>> listMap = bigStorageCageDetailsList.stream().collect(Collectors.groupingBy(BigStorageCageDetails::getSlot)); |
| | | for (BigStorageCage bigStorageCage : bigStorageCages) { |
| | | List<BigStorageCageDetails> bigStorageCageDetails = listMap.get(bigStorageCage.getSlot()); |
| | | bigStorageCage.setBigStorageCageDetails(bigStorageCageDetails); |
| | | } |
| | | return bigStorageCages; |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)); |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | Map<Integer, List<BigStorageCage>> listMap = bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | return listMap; |
| | | } |
| | | |
| | | //笼子使用情况,界面展示用 |
| | | @Override |
| | | public List<Map<String, Object>> selectBigStorageCageUsage() { |
| | | QueryWrapper<BigStorageCage> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage,COUNT(device_id) - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) AS count") |
| | | wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage,SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) AS count") |
| | | |
| | | .groupBy("device_id"); |
| | | List<Map<String, Object>> bigStorageCageUsages=baseMapper.selectMaps(wrapper); |
| | | List<Map<String, Object>> bigStorageCageUsages = baseMapper.selectMaps(wrapper); |
| | | |
| | | return bigStorageCageUsages; |
| | | } |
| | | |
| | | //笼子的启用/禁用 |
| | | @Override |
| | | public void updateStorageCageDisabled(int slot,int enableState){ |
| | | BigStorageCage bigStorageCage=new BigStorageCage(); |
| | | public void updateStorageCageDisabled(int slot, int enableState) { |
| | | BigStorageCage bigStorageCage = new BigStorageCage(); |
| | | bigStorageCage.setEnableState(enableState); |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper.eq(BigStorageCage::getSlot,slot); |
| | | baseMapper.update(bigStorageCage,bigStorageCageWrapper); |
| | | bigStorageCageWrapper.eq(BigStorageCage::getSlot, slot); |
| | | baseMapper.update(bigStorageCage, bigStorageCageWrapper); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("salve_hangzhoumes_1") |
| | | @DS("salve_hangzhoumes") |
| | | public interface BigStorageCageFeedTaskMapper extends MPJBaseMapper<BigStorageCageFeedTask> { |
| | | |
| | | List<Integer> querySitToUpGlass(); |
| | | |
| | | BigStorageDTO querySitToUpRemainWidth(@Param(value = "line") Integer line); |
| | | BigStorageDTO querySitToUpRemainWidth(@Param(value = "line") Integer line, @Param(value = "glassGap") Integer glassGap); |
| | | } |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("salve_hangzhoumes_1") |
| | | @DS("salve_hangzhoumes") |
| | | public interface BigStorageCageOutTaskMapper extends BaseMapper<BigStorageCageOutTask> { |
| | | |
| | | boolean saveBatch(@Param(value = "list") List<BigStorageCageOutTask> list); |
| | |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | @Service |
| | | public class BigStorageCageFeedTaskServiceImpl extends ServiceImpl<BigStorageCageFeedTaskMapper, BigStorageCageFeedTask> implements BigStorageCageFeedTaskService { |
| | | |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | @Override |
| | | public void addFeedTask(BigStorageCageDetails slotInfo, Integer plcFeedReqLine, int taskType){ |
| | | BigStorageCageFeedTask bigStorageCageFeedTask=new BigStorageCageFeedTask(); |
| | | public void addFeedTask(BigStorageCageDetails slotInfo, Integer plcFeedReqLine, int taskType) { |
| | | BigStorageCageFeedTask bigStorageCageFeedTask = new BigStorageCageFeedTask(); |
| | | bigStorageCageFeedTask.setId(slotInfo.getId()); |
| | | bigStorageCageFeedTask.setTaskState(0); |
| | | bigStorageCageFeedTask.setLine(plcFeedReqLine); |
| | |
| | | |
| | | @Override |
| | | public BigStorageDTO querySitToUpRemainWidth(Integer line) { |
| | | return baseMapper.querySitToUpRemainWidth(line); |
| | | return baseMapper.querySitToUpRemainWidth(line, glassGap); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.tools.InitUtil; |
| | | import com.mes.tools.S7control; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | |
| | | * @Date: 2024/4/9 15:13 |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | public class S7object extends Thread { |
| | | public S7control plccontrol; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼读取plc数据开始时间:{}", startDate); |
| | | byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength()); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼读取plc数据结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | if (getplcvlues != null) { |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | } |
| | |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | private JSONObject jsonObject = new JSONObject(); |
| | | private JSONObject jsonObject1 = new JSONObject(); |
| | | public void queryDataSource1() throws InterruptedException { |
| | | List<Double> carPostion=new ArrayList<>(); |
| | | carPostion.add(0.25); |
| | | carPostion.add(0.5); |
| | | jsonObject.append("carPostion",carPostion); |
| | | //界面展示笼子信息 |
| | | jsonObject1.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); |
| | | |
| | | //进片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1); |
| | | jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask); |
| | | |
| | | //出片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2); |
| | | jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask); |
| | | |
| | | //理片笼使用情况 |
| | | List<Map<String, Object>> bigStorageCageUsage=bigStorageCageService.selectBigStorageCageUsage(); |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | |
| | | //理片笼表格信息 |
| | | jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll()); |
| | | |
| | | } |
| | | |
| | | public void queryDataSource2() throws InterruptedException { |
| | | //出片队列 |
| | | List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list(); |
| | | jsonObject.append("temperingGlassInfoList", temperingGlassInfoList); |
| | | |
| | | } |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject = new JSONObject(); |
| | | jsonObject1 = new JSONObject(); |
| | | try { |
| | | //界面展示笼子信息 |
| | | jsonObject.append("bigStorageCageInfo1", bigStorageCageService.querybigStorageCageDetail(1)); |
| | | jsonObject.append("bigStorageCageInfo2", bigStorageCageService.querybigStorageCageDetail(2)); |
| | | jsonObject.append("bigStorageCageInfo3", bigStorageCageService.querybigStorageCageDetail(3)); |
| | | jsonObject.append("bigStorageCageInfo4", bigStorageCageService.querybigStorageCageDetail(4)); |
| | | jsonObject.append("bigStorageCageInfo5", bigStorageCageService.querybigStorageCageDetail(5)); |
| | | jsonObject.append("bigStorageCageInfo6", bigStorageCageService.querybigStorageCageDetail(6)); |
| | | jsonObject.append("bigStorageCageInfo7", bigStorageCageService.querybigStorageCageDetail(7)); |
| | | jsonObject.append("bigStorageCageInfo8", bigStorageCageService.querybigStorageCageDetail(8)); |
| | | |
| | | //进片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1); |
| | | jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask); |
| | | |
| | | //出片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2); |
| | | jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask); |
| | | |
| | | //理片笼使用情况 |
| | | List<Map<String, Object>> bigStorageCageUsage=bigStorageCageService.selectBigStorageCageUsage(); |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | |
| | | //出片队列 |
| | | List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list(); |
| | | jsonObject.append("temperingGlassInfoList", temperingGlassInfoList); |
| | | |
| | | //理片笼表格信息 |
| | | jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetail(0)); |
| | | |
| | | //查询使用数据源1查询数据 |
| | | queryDataSource1(); |
| | | //查询使用数据源2查询数据 |
| | | queryDataSource2(); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | webserver.sendMessage(jsonObject1.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | |
| | | private EdgGlassTaskInfoService edgGlassTaskInfoService; |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Resource |
| | | private DamageService damageService; |
| | | |
| | | private static final String REQUEST_WORD = "1"; |
| | | |
| | |
| | | @Value("${mes.outCarMaxSize}") |
| | | private Integer outCarMaxSize; |
| | | |
| | | @Value("${mes.galssGap}") |
| | | private Integer galssGap; |
| | | @Value("${mes.glassGap}") |
| | | private Integer glassGap; |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgScan() { |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼扫码任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | |
| | | String d02State = plcParameterObject.getPlcParameter("D02ID").getValue(); |
| | | String d03State = plcParameterObject.getPlcParameter("D03State").getValue(); |
| | | String d05State = plcParameterObject.getPlcParameter("D05State").getValue(); |
| | | String mesD01Value = plcParameterObject.getPlcParameter("MESToD01").getValue(); |
| | | String mesD04Value = plcParameterObject.getPlcParameter("MESToD04").getValue(); |
| | | String mesD01Address = plcParameterObject.getPlcParameter("MESToD01").getAddress(); |
| | | String mesD04Address = plcParameterObject.getPlcParameter("MESToD04").getAddress(); |
| | | String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue(); |
| | | if (!REQUEST_WORD.equals(d01ToMES)) { |
| | | log.info("请求字为{},结束本次扫描进卧转立任务", d01ToMES); |
| | | return; |
| | | } |
| | | String d04ToMES = plcParameterObject.getPlcParameter("D04ToMES").getValue(); |
| | | |
| | | log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id); |
| | | if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) { |
| | | log.info("1、获取d01Id扫描ID为:{},请求字为{};获取d04Id扫描ID为:{},请求字为{};", d01Id, d01ToMES, d04Id, d04ToMES); |
| | | if (StringUtils.isBlank(d01ToMES) && StringUtils.isBlank(d04ToMES)) { |
| | | log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | return; |
| | | } |
| | |
| | | log.info("两条线卧转立均在执行任务,结束本次扫描进卧转立任务"); |
| | | return; |
| | | } |
| | | // Boolean flag01 = Boolean.FALSE; |
| | | // Boolean flag04 = Boolean.FALSE; |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃 |
| | | if (StringUtils.isNotBlank(d01Id) && (StringUtils.isBlank(d02State) || !REQUEST_WORD.equals(d03State))) { |
| | | //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃: 状态为0不操作(D01送片,0不操作,1允许送片),请求字为1, (02玻璃id为空或者卧转立未启动) |
| | | if (!REQUEST_WORD.equals(mesD01Value) && REQUEST_WORD.equals(d01ToMES) && (StringUtils.isBlank(d02State) || !REQUEST_WORD.equals(d03State))) { |
| | | judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD01Address); |
| | | } |
| | | if (StringUtils.isNotBlank(d04Id) && !REQUEST_WORD.equals(d05State)) { |
| | | // 状态为0不操作(D01送片,0不操作,1允许送片),请求字为1, 卧转立未启动 |
| | | if (!REQUEST_WORD.equals(mesD04Value) && REQUEST_WORD.equals(d04ToMES) && !REQUEST_WORD.equals(d05State)) { |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD04Address); |
| | | } |
| | | log.info("结束扫码任务"); |
| | | // if (flag01 && flag04) { |
| | | // //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | // Integer startLine = getStartLine(); |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else if (flag01 || flag04) { |
| | | // Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else { |
| | | // log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | // } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼扫码任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgFreeCarTask() { |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼空车进片任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String e01Status = plcParameterObject.getPlcParameter("E01State").getValue(); |
| | | String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); |
| | | String d05ToMES = plcParameterObject.getPlcParameter("D05ToMES").getValue(); |
| | | log.info("执行空车送片任务,获取到的大车状态为{},卧转立状态分别为d03:{},d05:{}", e01Status, d03ToMES, d05ToMES); |
| | | if (REQUEST_WORD.equals(e01Status)) { |
| | | log.info("进片大车非空闲,结束送片任务"); |
| | | Date endDate = new Date(); |
| | | log.info("进片大车非空闲,结束送片任务,任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | if (!REQUEST_WORD.equals(d03ToMES) && !REQUEST_WORD.equals(d05ToMES)) { |
| | | log.info("卧转立没有送片请求,结束送片任务"); |
| | | Date endDate = new Date(); |
| | | log.info("卧转立没有送片请求,结束送片任务,任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> wrapper = new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | |
| | | if (CollectionUtils.isNotEmpty(feedTaskList)) { |
| | | if (feedTaskList.size() == 1) { |
| | | computeTargetByLine(feedTaskList.get(0).getLine()); |
| | | return; |
| | | } else { |
| | | //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | Integer startLine = getStartLine(); |
| | | // //计算目标格子,发送启动任务 |
| | | computeTargetByLine(startLine); |
| | | return; |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue(); |
| | | String d04Id = plcParameterObject.getPlcParameter("D04ID").getValue(); |
| | |
| | | //获取两条线卧转立是否有玻璃,且任务状态都为2 |
| | | List<Integer> lineList = bigStorageCageFeedTaskService.querySitToUpGlass(); |
| | | if (CollectionUtils.isEmpty(lineList)) { |
| | | log.info("两条线卧转立为空或者有进片任务未完成,结束任务"); |
| | | Date endDate = new Date(); |
| | | log.info("两条线卧转立为空或者有进片任务未完成,结束任务,大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | Integer lineFirst = lineList.get(0); |
| | |
| | | computeTargetByLine(lineFirst); |
| | | } |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | //两条先均可执行进片任务,判断两条线是否进片请求是否都为空 |
| | |
| | | Integer line = getStartLine(); |
| | | //计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(line); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } else if (StringUtils.isNotBlank(d01Id) && StringUtils.isNotBlank(d04Id)) { |
| | | // todo:两个都有进片玻璃 |
| | |
| | | } else if (computeIsRun(Const.A10_OUT_TARGET_POSITION, d04Id)) { |
| | | computeTargetByLine(Const.A10_OUT_TARGET_POSITION); |
| | | } else { |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | } else { |
| | |
| | | //获取进片请求玻璃为空的,计算任务表进片格子 发送进片任务 |
| | | computeTargetByLine(outLine); |
| | | } |
| | | |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼空车进片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgOutTask() { |
| | | |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼空车进片任务开始执行时间:{}", startDate); |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String mesToPLCAddress = plcMesObject.getPlcParameter("MESToPLC").getAddress(); |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | | Assert.isTrue(CollectionUtils.isEmpty(outingList), "有正在执行出片的任务,结束当前出片线程"); |
| | | |
| | |
| | | .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE, mesToPLCAddress); |
| | | 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).orderByDesc(BigStorageCageDetails::getWidth)); |
| | | if (CollectionUtils.isNotEmpty(artificialList)) { |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.FALSE); |
| | | computeOutGlassInfo(artificialList, Boolean.FALSE, mesToPLCAddress); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | TemperingLayoutDTO temperingLayoutDTO = bigStorageCageDetailsService.temperingIsAll(); |
| | | if (null != temperingLayoutDTO) { |
| | | //玻璃到齐 |
| | | List<TemperingLayoutDTO> temperingLayoutDTOList = bigStorageCageDetailsService.temperingIsAll(); |
| | | if (CollectionUtils.isNotEmpty(temperingLayoutDTOList)) { |
| | | //玻璃到齐包括已出片的 |
| | | //到齐,将玻璃小片数据存入钢化小片表,逻辑生成出片任务 结束 |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.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, temperingLayoutDTO.getTemperingLayoutId()) |
| | | .eq(GlassInfo::getEngineerId, temperingLayoutDTO.getEngineerId())); |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE); |
| | | return; |
| | | for (TemperingLayoutDTO item : temperingLayoutDTOList) { |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.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())); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE, mesToPLCAddress); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | //未到齐 执行内部调度任务 |
| | | TemperingLayoutDTO temperingOccupySlot = bigStorageCageDetailsService.queryTemperingOccupySlot(); |
| | |
| | | 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() - galssGap; |
| | | int slotWidth = carWidth - first.getRemainWidth() - glassGap; |
| | | if (first.getMinSequence() == second.getMaxSequence() + 1 |
| | | && second.getRemainWidth() > slotWidth) { |
| | | List<BigStorageCageDetails> list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | |
| | | List<BigStorageCageOutTask> outTasks = list.stream().map(e -> new BigStorageCageOutTask(e.getGlassId(), first.getSlot(), second.getSlot(), |
| | | slotWidth, 0, 0, 1)).collect(Collectors.toList()); |
| | | bigStorageCageOutTaskService.saveBatch(outTasks); |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | log.info("已向plc发送出片任务确认,地址为:{}", mesToPLCAddress); |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理破损表任务 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | public void dealDamageTask() { |
| | | Date startDate = new Date(); |
| | | log.info("大理片笼破损玻璃清除任务开始执行时间:{}", startDate); |
| | | //获取进片任务表中状态为破损的数据 |
| | | List<BigStorageCageFeedTask> inDamageTaskInfoList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>() |
| | | .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | if (CollectionUtils.isNotEmpty(inDamageTaskInfoList)) { |
| | | bigStorageCageFeedTaskService.remove(new LambdaQueryWrapper<BigStorageCageFeedTask>().eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | //将破损信息新增入破损表 |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask : inDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(bigStorageCageFeedTask.getGlassId()); |
| | | damage.setLine(bigStorageCageFeedTask.getLine()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setRemark("进笼前卧转立"); |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | } |
| | | //获取出片任务表中状态为破损的数据 |
| | | List<BigStorageCageOutTask> outDamageTaskInfoList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_DAMAGE)); |
| | | if (CollectionUtils.isNotEmpty(outDamageTaskInfoList)) { |
| | | bigStorageCageOutTaskService.remove(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_IN_DAMAGE)); |
| | | List<String> glassIdList = outDamageTaskInfoList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | temperingGlassInfoService.remove(new LambdaQueryWrapper<TemperingGlassInfo>().in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | | //将破损信息新增入破损表 |
| | | for (BigStorageCageOutTask bigStorageCageOutTask : outDamageTaskInfoList) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(bigStorageCageOutTask.getGlassId()); |
| | | damage.setLine(bigStorageCageOutTask.getEndSlot()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setRemark("出片后卧转立"); |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | } |
| | | Date endDate = new Date(); |
| | | log.info("大理片笼破损玻璃清除任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | |
| | | /** |
| | | * 按照玻璃id判断玻璃状态及卧转立是否可直接启动 |
| | |
| | | |
| | | Boolean flag = Boolean.TRUE; |
| | | //2、获取卧转立 |
| | | Integer widthFirst = edgGlassTaskInfoList.get(0).getWidth(); |
| | | 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 <= 5) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | if (glassCount < inCarMaxSize) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightFirst); |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst); |
| | | } |
| | | } else { |
| | | flag = Boolean.FALSE; |
| | | } |
| | | } else { |
| | | Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth(); |
| | | 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 - galssGap >= widthSecond) { |
| | | if (glassCount <= inCarMaxSize - 1) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst); |
| | | if (remainWidth - widthFirst - glassGap >= widthSecond) { |
| | | if (glassCount < inCarMaxSize) { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightSecond); |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightSecond); |
| | | } |
| | | } else { |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst); |
| | | addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightSecond); |
| | | } |
| | | } else { |
| | | flag = Boolean.FALSE; |
| | |
| | | /** |
| | | * 添加任务信息 |
| | | */ |
| | | private Boolean addFeedTask(String glassId, Integer line, Integer taskType, Integer width) { |
| | | 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()); |
| | | return bigStorageCageFeedTaskService.save(bigStorageCageFeedTask); |
| | | } |
| | |
| | | } |
| | | |
| | | 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(); |
| | |
| | | s7control.writeWord(plcMesObject.getPlcParameter("TargetAddToImport" + i).getAddress(), taskList.get(i - 1).getTargetSlot()); |
| | | } |
| | | s7control.writeWord(outLine, 2); |
| | | log.info("送片任务已发送完成,任务线路为:{},启动地址为{}", line, outLine); |
| | | log.info("送片任务已发送完成,任务线路为:{},启动地址为{},确认字为{}", line, outLine, 2); |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering) { |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { |
| | | //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | |
| | | if (bigStorageCageOutTaskList.size() > outCarMaxSize || e.getWidth() > remainWidth) { |
| | | break; |
| | | } |
| | | remainWidth = remainWidth - (int) e.getWidth() - galssGap; |
| | | remainWidth = remainWidth - (int) e.getWidth() - glassGap; |
| | | if (isTempering) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | (int) e.getWidth() * 10, 0, 0, 1)); |
| | |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | //更新笼子内格子的剩余尺寸 |
| | | updateSlotRemain(list, glassIds); |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | log.info("已向plc发送出片任务确认,地址为:{}", mesToPLCAddress); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | |
| | | List<Integer> slotList = list.stream().map(T::getSlot).distinct().collect(Collectors.toList()); |
| | | //获取待出去的玻璃信息(等下车出去的玻璃) |
| | | Map<Integer, Double> slotRemainMap = list.stream().filter(e -> !taskGlassIds.contains(e.getGlassId())) |
| | | .collect(Collectors.groupingBy(T::getSlot, Collectors.summingDouble(item -> item.getWidth() + galssGap))); |
| | | .collect(Collectors.groupingBy(T::getSlot, Collectors.summingDouble(item -> item.getWidth() + glassGap))); |
| | | if (CollectionUtils.isNotEmpty(slotRemainMap)) { |
| | | //按照格子号更新剩余尺寸 |
| | | slotRemainMap.forEach((e, v) -> { |
| | |
| | | public Boolean computeIsRun(int line, String glassId) { |
| | | //获取卧转立剩余宽度 |
| | | BigStorageDTO sitToUpRemainWidth = bigStorageCageFeedTaskService.querySitToUpRemainWidth(line); |
| | | if (sitToUpRemainWidth.getGlassCount() == 0) { |
| | | return Boolean.FALSE; |
| | | } |
| | | //获取玻璃信息 |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | return sitToUpRemainWidth.getWidth() < glassInfo.getWidth(); |
| | |
| | | |
| | | @Override |
| | | public boolean saveBatch(List<TemperingGlassInfo> list) { |
| | | log.info("需要钢化的玻璃为:{}", list); |
| | | return baseMapper.saveBatch(list); |
| | | } |
| | | |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | salve_hangzhoumes_1: |
| | | url: jdbc:sqlserver://192.168.20.24:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | salve_hangzhoumes_1: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | salve_hangzhoumes_1: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | slotWidth: 5000 #大车宽度 |
| | | inCarMaxSize: 6 #进片大车最大存放玻璃数量 |
| | | outCarMaxSize: 1 #出片大车最大存放玻璃数量 |
| | | galssGap: 300 #玻璃间距 |
| | | glassGap: 300 #玻璃间距 |
| | |
| | | WHERE STATE in (100, 101, 102) |
| | | GROUP BY ENGINEER_ID, TEMPERING_LAYOUT_ID) T3 ON T2.ENGINEER_ID = T3.ENGINEER_ID |
| | | AND T2.TEMPERING_LAYOUT_ID = T3.TEMPERING_LAYOUT_ID |
| | | AND T2.COUNT = T3.COUNT LIMIT 1 |
| | | AND T2.COUNT = T3.COUNT |
| | | </select> |
| | | |
| | | <select id="queryTemperingOccupySlot" resultMap="temperingLayoutDTO"> |
| | |
| | | where t.total_count = t.real_count |
| | | </select> |
| | | <select id="querySitToUpRemainWidth" resultMap="bigStorageDTO"> |
| | | SELECT cast(5000 - sum(width + 20) as INT) as REMAIN_WIDTH, |
| | | count(glass_id) as GLASS_COUNT |
| | | FROM big_storage_cage_feed_task |
| | | WHERE line = #{line} |
| | | AND task_state in (1, 2) |
| | | SELECT CAST |
| | | (5000 - SUM(MAX_LENGTH + #{glassGap}) AS INT) AS REMAIN_WIDTH, |
| | | COUNT(GLASS_ID) AS GLASS_COUNT |
| | | FROM ( |
| | | SELECT GLASS_ID, |
| | | CASE |
| | | |
| | | WHEN WIDTH >= HEIGHT THEN |
| | | WIDTH |
| | | ELSE HEIGHT |
| | | END MAX_LENGTH |
| | | FROM BIG_STORAGE_CAGE_FEED_TASK |
| | | WHERE LINE = #{line} |
| | | AND TASK_STATE IN (1, 2) |
| | | ) T |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.job.PlcStorageCageTask; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | PlcStorageCageTask plcStorageCageTask; |
| | | @Autowired |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Autowired |
| | | DamageService damageService; |
| | | |
| | | @Autowired |
| | | BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper; |
| | | |
| | | @Test |
| | | public void testInsertSlot() { |
| | | List<BigStorageCage> list = new ArrayList(); |
| | | for (int j = 1; j <= 5; j++) { |
| | | for (int i = 1 + (55 * (j - 1)); i <= 55 * j; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(j); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(4); |
| | | cage.setMaxThickness(6); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | } |
| | | for (int i = 276; i <= 300; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(6); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 301; i <= 330; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(7); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 331; i <= 355; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(8); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(8); |
| | | cage.setMaxThickness(12); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | for (int i = 356; i <= 380; i++) { |
| | | BigStorageCage cage = new BigStorageCage(); |
| | | cage.setDeviceId(9); |
| | | cage.setSlot(i); |
| | | cage.setMinThickness(15); |
| | | cage.setMaxThickness(19); |
| | | cage.setEnableState(1); |
| | | cage.setRemainWidth(5000); |
| | | list.add(cage); |
| | | } |
| | | bigStorageCageService.saveBatch(list); |
| | | } |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | |
| | | log.info("获取大理片笼信息:{}", bigStorageCageDetailsService.selectBigStorageCageDetails("P24060403|3|6")); |
| | | } |
| | | |
| | | @Test |
| | | public void insertDamage() { |
| | | Damage damage=new Damage(); |
| | | damage.setGlassId("P24060403|3|6"); |
| | | damage.setLine(2001); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setRemark(""); |
| | | damage.setStatus(2); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>moduleService</artifactId> |
| | | <groupId>com.mes</groupId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | <relativePath>../pom.xml</relativePath> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>glassStorage</artifactId> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>5.2.4</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.code.gson</groupId> |
| | | <artifactId>gson</artifactId> |
| | | <version>2.8.9</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/4/7 14:36RRRR |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableSwagger2 |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | | public class GlassStorageApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(GlassStorageApplication.class, args); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.loadposition.controller;
|
| | |
|
| | | import com.mes.loadposition.entity.LoadPosition;
|
| | | import com.mes.loadposition.service.LoadPositionService;
|
| | | import com.mes.utils.Result;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import io.swagger.annotations.ApiResponse;
|
| | | import io.swagger.annotations.ApiResponses;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.http.ResponseEntity;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/api/loadPosition")
|
| | | @Api(tags = " 控制器")
|
| | | public class LoadPositionController {
|
| | |
|
| | | @Autowired
|
| | | private LoadPositionService loadPositionService;
|
| | |
|
| | | /**
|
| | | * 列表查询
|
| | | *
|
| | | * @param params
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @PostMapping("/findList")
|
| | | public Result findList(@RequestBody LoadPosition params) {
|
| | | List<LoadPosition> result = loadPositionService.findList(params);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "查询", notes = "查询详情")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/{id}")
|
| | | public Result findById(@PathVariable("id") Long id) {
|
| | | LoadPosition loadPosition = loadPositionService.getBaseMapper().selectById(id);
|
| | | return Result.success(loadPosition);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | *
|
| | | * @param loadPosition
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "新增", notes = "新增数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PostMapping
|
| | | public Result insert( @RequestBody LoadPosition loadPosition) {
|
| | | boolean result = loadPositionService.save(loadPosition);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改
|
| | | *
|
| | | * @param loadPosition
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "修改", notes = "修改数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PutMapping
|
| | | public Result update( @RequestBody LoadPosition loadPosition) {
|
| | | boolean result = loadPositionService.updateById(loadPosition);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "删除", notes = "删除数据")
|
| | | @DeleteMapping("/{id}")
|
| | | public Result delete(@PathVariable("id") Long id) {
|
| | | int result = loadPositionService.getBaseMapper().deleteById(id);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.loadposition.entity;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import io.swagger.annotations.ApiModel;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Data
|
| | | @Component
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | | @TableName("load_position")
|
| | | @ApiModel(value = "LoadPosition", description = " ")
|
| | | public class LoadPosition implements Serializable{
|
| | |
|
| | | private static final long serialVersionUID=1L;
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | @ApiModelProperty(" ")
|
| | | private Long id;
|
| | |
|
| | | /**
|
| | | * 架子编号
|
| | | */
|
| | | @ApiModelProperty("架子编号")
|
| | | private String number;
|
| | |
|
| | | /**
|
| | | * 机器编号
|
| | | */
|
| | | @ApiModelProperty("机器编号")
|
| | | private Long machineId;
|
| | |
|
| | | /**
|
| | | * 启用标记
|
| | | */
|
| | | @ApiModelProperty("启用标记")
|
| | | private String flag;
|
| | |
|
| | | /**
|
| | | * 工作状态
|
| | | */
|
| | | @ApiModelProperty("工作状态")
|
| | | private String state;
|
| | |
|
| | | /**
|
| | | * 仓储任务编号
|
| | | */
|
| | | @ApiModelProperty("仓储任务编号")
|
| | | private Long storageTaskId;
|
| | |
|
| | | /**
|
| | | * 上片位类型
|
| | | */
|
| | | @ApiModelProperty("上片位类型")
|
| | | private Integer typeFlag;
|
| | |
|
| | | /**
|
| | | * 线路
|
| | | */
|
| | | @ApiModelProperty("线路")
|
| | | private Integer routeGroup;
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.loadposition.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.loadposition.entity.LoadPosition;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | |
|
| | | public interface LoadPositionMapper extends BaseMapper<LoadPosition> {
|
| | |
|
| | | } |
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.mapper.LoadPositionMapper">
|
| | |
|
| | | </mapper>
|
New file |
| | |
| | | package com.mes.loadposition.service;
|
| | |
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.mes.loadposition.entity.LoadPosition;
|
| | |
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | public interface LoadPositionService extends IService<LoadPosition> {
|
| | |
|
| | | List<LoadPosition> findList(LoadPosition params);
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.loadposition.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.mes.loadposition.entity.LoadPosition;
|
| | |
|
| | | import com.mes.loadposition.service.LoadPositionService;
|
| | | import com.mes.loadposition.mapper.LoadPositionMapper;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Service
|
| | | public class LoadPositionServiceImpl extends ServiceImpl<LoadPositionMapper, LoadPosition> implements LoadPositionService {
|
| | |
|
| | | @Autowired
|
| | | private LoadPositionMapper loadPositionMapper;
|
| | |
|
| | | @Override
|
| | | public List<LoadPosition> findList(LoadPosition params){
|
| | | LambdaQueryWrapper<LoadPosition> query = Wrappers.lambdaQuery(LoadPosition.class);
|
| | | return loadPositionMapper.selectList(query);
|
| | | }
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.rawusage.controller;
|
| | |
|
| | | import com.mes.utils.Result;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.http.ResponseEntity;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiResponse;
|
| | | import io.swagger.annotations.ApiResponses;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import com.mes.rawusage.service.RawUsageService;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/api/rawUsage")
|
| | | @Api(tags = " 控制器")
|
| | | public class RawUsageController {
|
| | |
|
| | | @Autowired
|
| | | private RawUsageService rawUsageService;
|
| | |
|
| | | /**
|
| | | * 列表查询
|
| | | *
|
| | | * @param params
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @PostMapping("/findList")
|
| | | public Result findList(@RequestBody RawUsage params) {
|
| | | List<RawUsage> result = rawUsageService.findList(params);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "查询", notes = "查询详情")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/{id}")
|
| | | public Result findById(@PathVariable("id") Long id) {
|
| | | RawUsage rawUsage = rawUsageService.getById(id);
|
| | | return Result.success(rawUsage);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | *
|
| | | * @param rawUsage
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "新增", notes = "新增数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PostMapping
|
| | | public Result insert( @RequestBody RawUsage rawUsage) {
|
| | | boolean result = rawUsageService.save(rawUsage);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改
|
| | | *
|
| | | * @param rawUsage
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "修改", notes = "修改数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PutMapping
|
| | | public Result update( @RequestBody RawUsage rawUsage) {
|
| | | boolean result = rawUsageService.updateById(rawUsage);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "删除", notes = "删除数据")
|
| | | @DeleteMapping("/{id}")
|
| | | public Result delete(@PathVariable("id") Long id) {
|
| | | int result = rawUsageService.getBaseMapper().deleteById(id);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.rawusage.entity;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import io.swagger.annotations.ApiModel;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Data
|
| | | @Component
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | | @TableName("raw_usage")
|
| | | @ApiModel(value = "RawUsage", description = " ")
|
| | | public class RawUsage implements Serializable{
|
| | |
|
| | | private static final long serialVersionUID=1L;
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | @ApiModelProperty(" ")
|
| | | private Long id;
|
| | |
|
| | | /**
|
| | | * 玻璃类型
|
| | | */
|
| | | @ApiModelProperty("玻璃类型")
|
| | | private String rawType;
|
| | |
|
| | | /**
|
| | | * 宽度
|
| | | */
|
| | | @ApiModelProperty("宽度")
|
| | | private Float rawWidth;
|
| | |
|
| | | /**
|
| | | * 高度
|
| | | */
|
| | | @ApiModelProperty("高度")
|
| | | private Float rawHeight;
|
| | |
|
| | | /**
|
| | | * 厚度
|
| | | */
|
| | | @ApiModelProperty("厚度")
|
| | | private Float rawThickness;
|
| | |
|
| | | /**
|
| | | * 状态
|
| | | */
|
| | | @ApiModelProperty("状态")
|
| | | private String state;
|
| | |
|
| | | /**
|
| | | * 颜色
|
| | | */
|
| | | @ApiModelProperty("颜色")
|
| | | private String color;
|
| | |
|
| | | /**
|
| | | * 总数量
|
| | | */
|
| | | @ApiModelProperty("总数量")
|
| | | private Integer pieces;
|
| | |
|
| | | /**
|
| | | * 剩余数量
|
| | | */
|
| | | @ApiModelProperty("剩余数量")
|
| | | private Integer leftPieces;
|
| | |
|
| | | /**
|
| | | * 物料编码
|
| | | */
|
| | | @ApiModelProperty("物料编码")
|
| | | private String qrcode;
|
| | |
|
| | | /**
|
| | | * 创建时间
|
| | | */
|
| | | @ApiModelProperty("创建时间")
|
| | | private Date createTime;
|
| | |
|
| | | /**
|
| | | * 生产日期
|
| | | */
|
| | | @ApiModelProperty("生产日期")
|
| | | private Date productionTime;
|
| | |
|
| | | /**
|
| | | * 批次号
|
| | | */
|
| | | @ApiModelProperty("批次号")
|
| | | private String batchId;
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.rawusage.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | |
|
| | | public interface RawUsageMapper extends BaseMapper<RawUsage> {
|
| | |
|
| | | } |
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.rawusage.mapper.RawUsageMapper">
|
| | |
|
| | | </mapper>
|
New file |
| | |
| | | package com.mes.rawusage.service;
|
| | |
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | |
|
| | | import java.util.List;
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | public interface RawUsageService extends IService<RawUsage> {
|
| | |
|
| | | List<RawUsage> findList(RawUsage params);
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.rawusage.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.mes.rawusage.mapper.RawUsageMapper;
|
| | | import com.mes.rawusage.entity.RawUsage;
|
| | | import com.mes.rawusage.service.RawUsageService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Service
|
| | | public class RawUsageServiceImpl extends ServiceImpl<RawUsageMapper, RawUsage> implements RawUsageService {
|
| | |
|
| | | @Autowired
|
| | | private RawUsageMapper rawUsageMapper;
|
| | |
|
| | | @Override
|
| | | public List<RawUsage> findList(RawUsage params){
|
| | | LambdaQueryWrapper<RawUsage> query = Wrappers.lambdaQuery(RawUsage.class);
|
| | | return rawUsageMapper.selectList(query);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.controller;
|
| | |
|
| | | import com.mes.utils.Result;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.http.ResponseEntity;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiResponse;
|
| | | import io.swagger.annotations.ApiResponses;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.mes.shelfrack.service.ShelfRackService;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/api/shelfRack")
|
| | | @Api(tags = " 控制器")
|
| | | public class ShelfRackController {
|
| | |
|
| | | @Autowired
|
| | | private ShelfRackService shelfRackService;
|
| | |
|
| | | /**
|
| | | * 列表查询
|
| | | *
|
| | | * @param params
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @PostMapping("/findList")
|
| | | public Result findList(@RequestBody ShelfRack params) {
|
| | | List<ShelfRack> result = shelfRackService.findList(params);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "查询", notes = "查询详情")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/{id}")
|
| | | public Result findById(@PathVariable("id") Long id) {
|
| | | ShelfRack shelfRack = shelfRackService.getBaseMapper().selectById(id);
|
| | | return Result.success(shelfRack);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | *
|
| | | * @param shelfRack
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "新增", notes = "新增数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PostMapping
|
| | | public Result insert( @RequestBody ShelfRack shelfRack) {
|
| | | boolean result = shelfRackService.save(shelfRack);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改
|
| | | *
|
| | | * @param shelfRack
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "修改", notes = "修改数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PutMapping
|
| | | public Result update( @RequestBody ShelfRack shelfRack) {
|
| | | boolean result = shelfRackService.updateById(shelfRack);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "删除", notes = "删除数据")
|
| | | @DeleteMapping("/{id}")
|
| | | public Result delete(@PathVariable("id") Long id) {
|
| | | int result = shelfRackService.getBaseMapper().deleteById(id);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.entity;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import io.swagger.annotations.ApiModel;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Data
|
| | | @Component
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | | @TableName("shelf_rack")
|
| | | @ApiModel(value = "ShelfRack", description = " ")
|
| | | public class ShelfRack implements Serializable{
|
| | |
|
| | | private static final long serialVersionUID=1L;
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | @ApiModelProperty(" ")
|
| | | private Long id;
|
| | |
|
| | | /**
|
| | | * 架子编号
|
| | | */
|
| | | @ApiModelProperty("架子编号")
|
| | | private String number;
|
| | |
|
| | | /**
|
| | | * 工作状态
|
| | | */
|
| | | @ApiModelProperty("工作状态")
|
| | | private String state;
|
| | |
|
| | | /**
|
| | | * 包号编号
|
| | | */
|
| | | @ApiModelProperty("包号编号")
|
| | | private Long rawPackageId;
|
| | |
|
| | | /**
|
| | | * 修改时间
|
| | | */
|
| | | @ApiModelProperty("修改时间")
|
| | | private Date modTime;
|
| | |
|
| | | /**
|
| | | * 启用状态
|
| | | */
|
| | | @ApiModelProperty("启用状态")
|
| | | private String enableState;
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | |
|
| | | public interface ShelfRackMapper extends BaseMapper<ShelfRack> {
|
| | |
|
| | | } |
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.shelfrack.mapper.ShelfRackMapper">
|
| | |
|
| | | </mapper>
|
New file |
| | |
| | | package com.mes.shelfrack.service;
|
| | |
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | |
|
| | | import java.util.List;
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | public interface ShelfRackService extends IService<ShelfRack> {
|
| | |
|
| | | List<ShelfRack> findList(ShelfRack params);
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.shelfrack.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.mes.shelfrack.mapper.ShelfRackMapper;
|
| | | import com.mes.shelfrack.entity.ShelfRack;
|
| | | import com.mes.shelfrack.service.ShelfRackService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Service
|
| | | public class ShelfRackServiceImpl extends ServiceImpl<ShelfRackMapper, ShelfRack> implements ShelfRackService {
|
| | |
|
| | | @Autowired
|
| | | private ShelfRackMapper shelfRackMapper;
|
| | |
|
| | | @Override
|
| | | public List<ShelfRack> findList(ShelfRack params){
|
| | | LambdaQueryWrapper<ShelfRack> query = Wrappers.lambdaQuery(ShelfRack.class);
|
| | | return shelfRackMapper.selectList(query);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.storagetask.controller;
|
| | |
|
| | | import com.mes.utils.Result;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.http.ResponseEntity;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiResponse;
|
| | | import io.swagger.annotations.ApiResponses;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import com.mes.storagetask.service.StorageTaskService;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/api/storageTask")
|
| | | @Api(tags = " 控制器")
|
| | | public class StorageTaskController {
|
| | |
|
| | | @Autowired
|
| | | private StorageTaskService storageTaskService;
|
| | |
|
| | | /**
|
| | | * 列表查询
|
| | | *
|
| | | * @param params
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @PostMapping("/findList")
|
| | | public Result findList(@RequestBody StorageTask params) {
|
| | | List<StorageTask> result = storageTaskService.findList(params);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "查询", notes = "查询详情")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/{id}")
|
| | | public Result findById(@PathVariable("id") Long id) {
|
| | | StorageTask storageTask = storageTaskService.getBaseMapper().selectById(id);
|
| | | return Result.success(storageTask);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | *
|
| | | * @param storageTask
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "新增", notes = "新增数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PostMapping
|
| | | public Result insert( @RequestBody StorageTask storageTask) {
|
| | | boolean result = storageTaskService.save(storageTask);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改
|
| | | *
|
| | | * @param storageTask
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "修改", notes = "修改数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PutMapping
|
| | | public Result update( @RequestBody StorageTask storageTask) {
|
| | | boolean result = storageTaskService.updateById(storageTask);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "删除", notes = "删除数据")
|
| | | @DeleteMapping("/{id}")
|
| | | public Result delete(@PathVariable("id") Long id) {
|
| | | int result = storageTaskService.getBaseMapper().deleteById(id);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.storagetask.entity;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import io.swagger.annotations.ApiModel;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Data
|
| | | @Component
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | | @TableName("storage_task")
|
| | | @ApiModel(value = "StorageTask", description = " ")
|
| | | public class StorageTask implements Serializable{
|
| | |
|
| | | private static final long serialVersionUID=1L;
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | @ApiModelProperty(" ")
|
| | | private Long id;
|
| | |
|
| | | /**
|
| | | * 任务类型
|
| | | */
|
| | | @ApiModelProperty("任务类型")
|
| | | private String taskType;
|
| | |
|
| | | /**
|
| | | * 工作状态
|
| | | */
|
| | | @ApiModelProperty("工作状态")
|
| | | private String taskState;
|
| | |
|
| | | /**
|
| | | * 仓储架号
|
| | | */
|
| | | @ApiModelProperty("仓储架号")
|
| | | private String shelfRack;
|
| | |
|
| | | /**
|
| | | * 上片位编号
|
| | | */
|
| | | @ApiModelProperty("上片位编号")
|
| | | private String loadRack;
|
| | |
|
| | | /**
|
| | | * 线路
|
| | | */
|
| | | @ApiModelProperty("线路")
|
| | | private Integer routeGroup;
|
| | |
|
| | | /**
|
| | | * 创建时间
|
| | | */
|
| | | @ApiModelProperty("创建时间")
|
| | | private Date startTime;
|
| | |
|
| | | /**
|
| | | * 完成时间
|
| | | */
|
| | | @ApiModelProperty("完成时间")
|
| | | private Date finishTime;
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.storagetask.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | *
|
| | | */
|
| | |
|
| | | public interface StorageTaskMapper extends BaseMapper<StorageTask> {
|
| | |
|
| | | } |
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.storagetask.mapper.StorageTaskMapper">
|
| | |
|
| | | </mapper>
|
New file |
| | |
| | | package com.mes.storagetask.service;
|
| | |
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | |
|
| | | import java.util.List;
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | public interface StorageTaskService extends IService<StorageTask> {
|
| | |
|
| | | List<StorageTask> findList(StorageTask params);
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.mes.storagetask.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.mes.storagetask.mapper.StorageTaskMapper;
|
| | | import com.mes.storagetask.entity.StorageTask;
|
| | | import com.mes.storagetask.service.StorageTaskService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @Service
|
| | | public class StorageTaskServiceImpl extends ServiceImpl<StorageTaskMapper, StorageTask> implements StorageTaskService {
|
| | |
|
| | | @Autowired
|
| | | private StorageTaskMapper storageTaskMapper;
|
| | |
|
| | | @Override
|
| | | public List<StorageTask> findList(StorageTask params){
|
| | | LambdaQueryWrapper<StorageTask> query = Wrappers.lambdaQuery(StorageTask.class);
|
| | | return storageTaskMapper.selectList(query);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | 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 |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.150:8848 |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
New file |
| | |
| | | server: |
| | | port: 8086 |
| | | |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | application: |
| | | name: glassStorage |
| | | |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | |
| | |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | sd: |
| | | url: jdbc:mysql://192.168.1.199:3306/sd?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.1.199:3306/sd?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | sd: |
| | | 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 |
| | | 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 |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://192.168.1.199:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | sd: |
| | | url: jdbc:mysql://192.168.1.199:3306/sd?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | # hangzhoumes: |
| | | # url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # salve_hangzhoumes: |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | # username: sa |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | hangzhoumes: |
| | | url: jdbc:mysql:10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | username: sa |
| | |
| | | } |
| | | |
| | | byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength()); |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | if (getplcvlues != null) { |
| | | PlcMesObject.setPlcParameterList(getplcvlues); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 任务类型 1:进 2:出 |
| | | */ |
| | | private String taskType; |
| | | private Integer taskType; |
| | | |
| | | /** |
| | | * 宽 |
| | |
| | | /** |
| | | * 任务状态 0 未开始 1正在进行 2完成 |
| | | */ |
| | | private Integer taskStauts; |
| | | private Integer taskStatus; |
| | | |
| | | /** |
| | | * 创建时间 |
| | |
| | | |
| | | @Repository |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo> { |
| | | |
| | | |
| | | /** |
| | | * 按流程卡查询落架数量最多的流程卡及层数 |
| | | * |
| | | * @param flowCardId |
| | | * @return |
| | | */ |
| | | DownGlassInfoDTO queryDownGlassMaxLayer(@Param(value = "flowCardId") String flowCardId); |
| | | |
| | | /** |
| | | * 查询流程卡指定层数需要落架的次序 |
| | | * |
| | | * @param flowCardId |
| | | * @param layer |
| | | * @return |
| | | */ |
| | | Integer queryMaxSequence(@Param(value = "flowCardId") String flowCardId, @Param(value = "layer") int layer); |
| | | |
| | | /** |
| | | * 获取落架玻璃信息,包括已绑定流程卡、层数未落架的玻璃信息 |
| | | * |
| | | * @param isDownload 是否获取未落架玻璃信息 True 已落架 false 未落架 |
| | | * @return |
| | | */ |
| | | List<DownGlassInfoDTO> queryWorkStationIsIn(@Param(value = "isDownload") Boolean isDownload); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.mapper.DownGlassTaskMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Autowired |
| | | private DownGlassInfoService downGlassInfoService; // MySQL Mapper |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private DownGlassTaskMapper downGlassTaskMapper; // SQL Server Mapper |
| | | |
| | | @Override |
| | |
| | | |
| | | // Step 2: 从 SQL Server 中过滤掉这些玻璃 ID 并查询任务 |
| | | QueryWrapper<DownGlassTask> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("task_stauts", 1) |
| | | queryWrapper.eq("task_status", 1) |
| | | .and(qw -> qw.eq("task_type", 2).or().eq("task_type", 3)); |
| | | |
| | | List<DownGlassInfo> excludedGlassIds = downGlassInfoService.list(); |
| | |
| | | @Override |
| | | public void updateTaskState(String id) { |
| | | UpdateWrapper<DownGlassTask> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("task_stauts", 2).eq("id", id); |
| | | updateWrapper.set("task_status", 2).eq("id", id); |
| | | baseMapper.update(new DownGlassTask(), updateWrapper); |
| | | } |
| | | |
| | |
| | | // 如果主键值不存在,则进行插入操作 |
| | | DownGlassTask newDownGlassTask = new DownGlassTask(); |
| | | BeanUtils.copyProperties(downGlassTask, newDownGlassTask); |
| | | newDownGlassTask.setTaskStauts(1); // 默认任务状态为1 |
| | | newDownGlassTask.setTaskStatus(1); // 默认任务状态为1 |
| | | newDownGlassTask.setCreateTime(new Date()); |
| | | int rows = baseMapper.insert(newDownGlassTask); |
| | | return rows > 0 ? rows : null; |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | |
| | | public interface DownStorageCageDetailsMapper extends MPJBaseMapper<DownStorageCageDetails> { |
| | | |
| | | DownStorageCageDetails getGlassInfoMaxCount(); |
| | |
| | | */ |
| | | boolean DirectConnection(GlassInfo glassInfo); |
| | | |
| | | DownStorageCageDetails getGlassInfoMaxCount(); |
| | | String getGlassInfoMaxCount(String glassId); |
| | | |
| | | /** |
| | | * @param glassId |
| | |
| | | */ |
| | | public interface DownStorageCageService extends MPJBaseService<DownStorageCage> { |
| | | |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, Integer taskType); |
| | | |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, Integer taskType); |
| | | // List<Map<String, Object>> selectCacheLeisure(); |
| | | |
| | | |
| | |
| | | */ |
| | | List<Map<String, Object>> selectDownStorageCages(); |
| | | |
| | | |
| | | /** |
| | | * @return 查询缓存中最多的流程卡 |
| | | */ |
| | | List<DownStorageCageDetails> selectCacheMax(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DownStorageCageDetails getGlassInfoMaxCount() { |
| | | return baseMapper.getGlassInfoMaxCount(); |
| | | public String getGlassInfoMaxCount(String glassId) { |
| | | DownStorageCageDetails glassInfoMaxCount = baseMapper.getGlassInfoMaxCount(); |
| | | return null == glassInfoMaxCount ? glassId : glassInfoMaxCount.getGlassId(); |
| | | } |
| | | |
| | | |
| | |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, String taskType) { |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, Integer taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, String taskType) { |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, Integer taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | |
| | | .eq(DownStorageCageDetails::getSlot, DownStorageCage::getSlot) |
| | | .eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)) |
| | | .isNull(DownStorageCageDetails::getSlot) |
| | | .eq(DownStorageCage::getEnableState, Const.SLOT_ON) |
| | | .last("order by abs(t.slot - " + currentSlot + ") asc limit 2") |
| | | ); |
| | | if (flag && CollectionUtil.isNotEmpty(emptyList)) { |
| | |
| | | } |
| | | return emptyList.get(0); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> selectCacheMax() { |
| | |
| | | |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public boolean updateDownStorageCage(DownStorageCage downStorageCage) { |
| | | DownStorageCage downItem = baseMapper.selectById(downStorageCage.getId()); |
| | | downItem.setEnableState(downStorageCage.getEnableState()); |
| | | baseMapper.updateById(downItem); |
| | | return true; |
| | | if (downItem != null) { |
| | | downItem.setEnableState(downStorageCage.getEnableState()); |
| | | int rowsAffected = baseMapper.updateById(downItem); |
| | | if (rowsAffected > 0) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改理片笼信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * |
| | |
| | | |
| | | |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.request.DownWorkRequest; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | private DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | |
| | | @ApiOperation("获取工位信息") |
| | | @GetMapping("/getone") |
| | | public ResponseEntity<?> getOneDownWorkstations() { |
| | | public Result getOneDownWorkstations() { |
| | | try { |
| | | List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1,6); |
| | | List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1, 6); |
| | | // 构建符合预期格式的响应数据 |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | | // 返回 ResponseEntity 对象,包含响应数据和状态码 |
| | | return ResponseEntity.ok(responseData); |
| | | return Result.build(200, "获取工位信息成功", data); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | // 如果出现异常,返回错误信息 |
| | | Map<String, Object> errorResponse = new HashMap<>(); |
| | | errorResponse.put("code", 500); |
| | | errorResponse.put("msg", "服务器内部错误"); |
| | | return ResponseEntity.status(500).body(errorResponse); |
| | | return Result.build(500, "获取工位信息失败", 1); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("获取流程卡号") |
| | | @GetMapping("/getflowCardId") |
| | | public ResponseEntity<Map<String, Object>> getflowCardId() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | public Result getflowCardId() { |
| | | |
| | | try { |
| | | List<Map<String, Object>> data = glassInfoService.getFlowCardId(); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | | return ResponseEntity.ok(responseData); |
| | | return Result.build(200, "获取流程卡号成功", data); |
| | | } catch (Exception e) { |
| | | responseData.put("code", 500); |
| | | responseData.put("msg", "失败"); |
| | | responseData.put("data", null); |
| | | return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseData); |
| | | return Result.build(500, "获取流程卡号失败", 1); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //绑定架子 |
| | | @ApiOperation("绑定架子") |
| | | //绑定架子 |
| | | @ApiOperation("绑定架子") |
| | | @PostMapping("/updateFlowCardId") |
| | | public ResponseEntity<Map<String, Object>> updateFlowCardId(@RequestBody Map<String, Object> requestData) { |
| | | // 从 requestData 中获取传入的 flowCardId |
| | | String flowCardId = (String) requestData.get("flowCardId"); |
| | | int workstationId = (int) requestData.get("workstationId"); |
| | | public Result updateFlowCardId(@RequestBody DownWorkRequest request) { |
| | | |
| | | // 查询对应 flowCardId 的玻璃信息总数量 |
| | | int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId); |
| | | // 绑定架子 |
| | | downWorkstationService.updateFlowCardIdAndCount(request.getFlowCardId(), request.getWorkstationId(), request.getLayer()); |
| | | |
| | | // 更新 down_workstation 表中的总数量 |
| | | downWorkstationService.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId); |
| | | |
| | | // 构建响应数据 |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | responseData.put("message", "updated successfully"); |
| | | responseData.put("code", 200); |
| | | // 返回处理结果 |
| | | return ResponseEntity.ok(responseData); |
| | | return Result.build(200, "绑定架子成功", 1); |
| | | } |
| | | |
| | | @ApiOperation("清除工位信息") |
| | | @PostMapping("/clear") |
| | | public ResponseEntity<Map<String, Object>> clearWorkstationInfo(@RequestBody Map<String, Object> requestData) { |
| | | public Result clearWorkstationInfo(@RequestBody Map<String, Object> requestData) { |
| | | // 调用 DownWorkstationService 中的方法清除指定工位ID的信息 |
| | | int workstationId = (int) requestData.get("workstationId"); |
| | | |
| | |
| | | |
| | | if (downWorkstations == totalWorkstations) { |
| | | downWorkstationService.clearFlowCardId(workstationId); |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | responseData.put("message", "cleared successfully"); |
| | | responseData.put("code", 200); |
| | | // 返回处理结果 |
| | | return ResponseEntity.ok(responseData); |
| | | } |
| | | else { |
| | | return Result.build(200, "清除工位信息成功", 1); |
| | | } else { |
| | | // 如果总数量和落架数量不一致,返回错误响应 |
| | | Map<String, Object> errorResponse = new HashMap<>(); |
| | | errorResponse.put("message", "Total workstations count does not match down workstations count."); |
| | | errorResponse.put("code", 400); |
| | | return ResponseEntity.badRequest().body(errorResponse); |
| | | return Result.build(500, "清除工位信息失败", 1); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation("获取工位显示图1") |
| | | @GetMapping("/getwo") |
| | | public ResponseEntity<Map<String, Object>> getwo() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | public Result getwo() { |
| | | |
| | | try { |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | | return ResponseEntity.ok(responseData); |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(1, 3); |
| | | return Result.build(200, "获取工位显示图1成功", data); |
| | | } catch (Exception e) { |
| | | responseData.put("code", 500); |
| | | responseData.put("msg", "失败"); |
| | | responseData.put("data", null); |
| | | return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseData); |
| | | return Result.build(200, "获取工位显示图1失败", 1); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("获取工位显示图2") |
| | | @GetMapping("/getwo2") |
| | | public ResponseEntity<Map<String, Object>> getw2o() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | public Result getwo2() { |
| | | |
| | | try { |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(4,6); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | | return ResponseEntity.ok(responseData); |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(4, 6); |
| | | return Result.build(200, "获取工位显示图2成功", data); |
| | | } catch (Exception e) { |
| | | responseData.put("code", 500); |
| | | responseData.put("msg", "失败"); |
| | | responseData.put("data", null); |
| | | return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseData); |
| | | return Result.build(200, "获取工位显示图2失败", 1); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(" 功能:对工位进行【启用/禁用】") |
| | | @PostMapping("/updateDownWorkstation") |
| | | @ResponseBody |
| | | public Result updateDownWorkstation(@RequestBody DownWorkstation downWorkstation) { |
| | | boolean isSucess = downWorkstationService.updateDownWorkstationstate(downWorkstation); |
| | | return Result.build(200, "更换成功", isSucess); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | /** |
| | | * 总数量 |
| | | */ |
| | | @TableField("total_quantity") |
| | | private Integer totalquantity; |
| | | private Integer totalQuantity; |
| | | |
| | | /** |
| | | * 落架数量 |
| | | */ |
| | | @TableField("racks_number") |
| | | private Integer Racksnumber; |
| | | private Integer racksNumber; |
| | | /** |
| | | * 人工下片数量 |
| | | */ |
| | | private Integer otherNumber; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.entity;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | |
| | | @Data
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | |
|
| | | public class DownWorkstionAndDownGlassinfo
|
| | | {
|
| | | public class DownWorkstionAndDownGlassinfo {
|
| | | /**
|
| | | * 下片工位表id
|
| | | */
|
| | |
| | | private Integer workState;
|
| | |
|
| | |
|
| | | @TableField("total_quantity")
|
| | | private Integer totalquantity;
|
| | | private Integer totalQuantity;
|
| | |
|
| | | @TableField("racks_number")
|
| | | private Integer Racksnumber;
|
| | |
|
| | |
|
| | |
|
| | | private Integer racksNumber;
|
| | |
|
| | | /**
|
| | | * 顺序
|
| | |
| | | */ |
| | | private Integer layer; |
| | | /** |
| | | * 落架数量 |
| | | * 已出片数量 |
| | | */ |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 落架数量 |
| | | */ |
| | | private Integer racksNumber; |
| | | |
| | | /** |
| | | * 流程卡未进片的玻璃信息 |
| | | */ |
| | | private List<GlassInfo> glassInfoList; |
New file |
| | |
| | | package com.mes.downworkstation.entity.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2024/7/10 14:10 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class DownWorkRequest { |
| | | |
| | | |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String flowCardId; |
| | | |
| | | /** |
| | | * 工位id |
| | | */ |
| | | private int workstationId; |
| | | |
| | | /** |
| | | * 层数 |
| | | */ |
| | | private int layer; |
| | | } |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | |
| | | |
| | | @Repository |
| | | @InterceptorIgnore(tenantLine = "true") |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import org.mapstruct.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | |
| | | @DS("salve_hangzhoumes") |
| | | @Mapper |
| | | |
| | | public interface DownWorkstationTaskMapper extends BaseMapper<DownWorkstationTask> { |
| | | |
| | | List<DownWorkstationTask> selectList(); |
| | |
| | | |
| | | /** |
| | | * @param flowCardId |
| | | * @param glassInfoCount |
| | | * |
| | | * @param workstationId |
| | | * @return 更新架子和数量 |
| | | */ |
| | | int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId); |
| | | void updateFlowCardIdAndCount(String flowCardId, int workstationId,int layer); |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | DownWorkstation selectByFlowCardId(String flowcardid); |
| | | |
| | | |
| | | /** |
| | | * @param downWorkstation |
| | | * @returnq 启用禁用 |
| | | */ |
| | | boolean updateDownWorkstationstate(DownWorkstation downWorkstation); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | |
| | | import com.mes.downworkstation.mapper.DownWorkstationTaskMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private DownWorkstationMapper downWorkstationMapper; |
| | | @Autowired(required=false) |
| | | @Autowired(required = false) |
| | | private DownWorkstationTaskMapper downWorkstationTaskMapper; |
| | | @Autowired |
| | | private DownGlassInfoService downGlassInfoService; |
| | |
| | | private DownGlassInfoMapper downGlassInfoMapper; |
| | | @Autowired |
| | | private DownGlassTaskService downGlassTaskService; |
| | | |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private DamageService damageservice; |
| | | |
| | | @Autowired |
| | | private DownWorkstationTaskService downWorkstationTaskService; |
| | |
| | | @Override |
| | | public int getTotalQuantity(int workstationId) { |
| | | DownWorkstation result = baseMapper.selectOne(new QueryWrapper<DownWorkstation>().lambda() |
| | | .select(DownWorkstation::getTotalquantity) |
| | | .select(DownWorkstation::getTotalQuantity) |
| | | .eq(DownWorkstation::getWorkstationId, workstationId)); |
| | | |
| | | return result != null ? result.getTotalquantity() : 0; |
| | | return result != null ? result.getTotalQuantity() : 0; |
| | | } |
| | | |
| | | |
| | | //工位显示 |
| | | @Override |
| | | public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(int start,int end) { |
| | | public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(int start, int end) { |
| | | MPJQueryWrapper<DownWorkstation> queryWrapper = new MPJQueryWrapper<>(); |
| | | queryWrapper.select("t.workstation_id", "t.flow_card_id", "COALESCE(SUM(b.width), 0) AS totalwidth", "COALESCE(SUM(b.height), 0) AS totalheight") |
| | | .leftJoin("down_glass_info b on t.flow_card_id = b.flow_card_id") |
| | |
| | | |
| | | ; |
| | | |
| | | List<DownWorkstionAndDownGlassinfo> workstationList = downWorkstationMapper.selectJoinList(DownWorkstionAndDownGlassinfo.class, queryWrapper); |
| | | // List<DownWorkstionAndDownGlassinfo> workstationList = null; |
| | | List<DownWorkstionAndDownGlassinfo> workstationList = downWorkstationMapper.selectJoinList(DownWorkstionAndDownGlassinfo.class, queryWrapper); |
| | | // List<DownWorkstionAndDownGlassinfo> workstationList = null; |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (DownWorkstionAndDownGlassinfo downWorkstionAndDownGlassinfo : workstationList) { |
| | | Map<String, Object> rack = new HashMap<>(); |
| | |
| | | List<DownGlassInfo> downGlassInfoList = downGlassInfoMapper.selectList(glassInfoQueryWrapper); |
| | | |
| | | |
| | | if (!downGlassInfoList.isEmpty()) { |
| | | if (!downGlassInfoList.isEmpty()) { |
| | | |
| | | item.put("downGlassInfoList", downGlassInfoList); |
| | | |
| | |
| | | rack.put("item", item); |
| | | result.add(rack); |
| | | } |
| | | log.info("result"+(result)); |
| | | log.info("result" + (result)); |
| | | return result; // 返回最终结果 |
| | | } |
| | | |
| | |
| | | .eq("workstation_id", workstationId); |
| | | |
| | | DownWorkstation result = baseMapper.selectOne(queryWrapper); |
| | | return result != null ? result.getRacksnumber() : 0; |
| | | return result != null ? result.getRacksNumber() : 0; |
| | | } |
| | | |
| | | //根据条件获取工位玻璃信息 |
| | |
| | | |
| | | |
| | | @Override |
| | | public int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId) { |
| | | public void updateFlowCardIdAndCount(String flowCardId, int workstationId, int layer) { |
| | | int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId, layer); |
| | | QueryWrapper<Damage> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("process_id", flowCardId); |
| | | queryWrapper.eq("technology_number", layer); |
| | | |
| | | int otherNumber = damageservice.count(queryWrapper); |
| | | UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("total_quantity", glassInfoCount) |
| | | .set("flow_card_id", flowCardId) |
| | | .set("layer", layer) |
| | | .set("other_number", otherNumber) |
| | | .eq("workstation_id", workstationId); |
| | | |
| | | return baseMapper.update(new DownWorkstation(), updateWrapper); |
| | | this.update(updateWrapper); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | baseMapper.update(new DownWorkstation(), updateWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean updateDownWorkstationstate(DownWorkstation downWorkstation) { |
| | | |
| | | DownWorkstation downWork = baseMapper.selectById(downWorkstation.getId()); |
| | | |
| | | if (downWork != null) { |
| | | |
| | | downWork.setEnableState(downWorkstation.getEnableState()); |
| | | |
| | | baseMapper.updateById(downWork); |
| | | |
| | | return true; |
| | | } else { |
| | | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.device.PlcParameterObject; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Value("${mes.maxHeight}") |
| | | private Integer maxHeight; |
| | | |
| | | @Value("${mes.minWidth}") |
| | | private Integer minWidth; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Value("${mes.minHeight}") |
| | | private Integer minHeight; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void plcHomeEdgTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String requestWord = plcParameterObject.getPlcParameter("requestWord").getValue(); |
| | |
| | | String confirmationWrodValue = plcParameterObject.getPlcParameter("confirmationWord").getValue(); |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); |
| | | |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", |
| | | requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot); |
| | |
| | | inTo(glassIdeValue, requestWord, currentSlot); |
| | | } else if ("2".equals(requestWord)) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("2、出片请求,且确认字为0,执行进片任务"); |
| | | log.info("2、出片请求,且确认字为0,执行出片任务"); |
| | | outTo(out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, glassIdeValue, currentSlot); |
| | | } else if ("3".equals(requestWord)) { |
| | | log.info("2、进片和出片都空闲,执行出片任务"); |
| | |
| | | } |
| | | Boolean checkFlag = Boolean.FALSE; |
| | | //玻璃尺寸是否走人工下片 |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight) { |
| | | log.info("该玻璃尺寸走人工下片,直接进片"); |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight || glassInfo.getWidth() < minWidth || glassInfo.getHeight() < minHeight) { |
| | | log.info("该玻璃尺寸不符合要求,需要走人工下片直接进片"); |
| | | } else { |
| | | log.info("该玻璃尺寸非人工下片"); |
| | | //获取该玻璃的流程卡是否已绑定架子 |
| | |
| | | if (!checkFlag && !isBind) { |
| | | log.info("该玻璃的流程卡未绑定架子,获取是否有空架子"); |
| | | List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId)); |
| | | .isNull(DownWorkstation::getFlowCardId).orderByDesc(DownWorkstation::getWorkstationId)); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | log.info("有空架子,将流程卡与架子好绑定,执行进片任务 结束"); |
| | | //绑定流程卡 |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>() |
| | | .set(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId()) |
| | | .set(DownWorkstation::getLayer, glassInfo.getLayer()) |
| | | .eq(DownWorkstation::getWorkstationId, list.get(0).getWorkstationId())); |
| | | downWorkstationService.updateFlowCardIdAndCount(glassInfo.getFlowCardId(), glassInfo.getLayer(), list.get(0).getWorkstationId()); |
| | | checkFlag = Boolean.TRUE; |
| | | } |
| | | } |
| | |
| | | endLoop: |
| | | for (DownGlassInfoDTO e : downGlassInfoDTOList) { |
| | | List<GlassInfo> glassInfoList = e.getGlassInfoList(); |
| | | for (GlassInfo item : glassInfoList) { |
| | | if (item.getWidth() == glassInfo.getWidth() && item.getHeight() == glassInfo.getHeight() |
| | | && item.getThickness() == glassInfo.getThickness() && item.getFilmsid().equals(glassInfo.getFilmsid())) { |
| | | //玻璃是否为多层 |
| | | checkFlag = multilayerCheck(item, Boolean.FALSE); |
| | | if (checkFlag) { |
| | | //玻璃替换 仅替换流程卡id及层数 |
| | | String tempFlowCardId = item.getFlowCardId(); |
| | | Integer tempLayer = item.getLayer(); |
| | | String flowCardId = glassInfo.getFlowCardId(); |
| | | Integer layer = glassInfo.getLayer(); |
| | | log.info("替换流程卡信息,当前玻璃信息:{}的流程卡号{}及层数{},替换后玻璃信息:{}的流程卡号{}及层数{}", |
| | | item, glassInfo, flowCardId, layer, tempFlowCardId, tempLayer); |
| | | glassInfo.setFlowCardId(tempFlowCardId); |
| | | glassInfo.setLayer(tempLayer); |
| | | glassInfoService.updateById(glassInfo); |
| | | item.setFlowCardId(flowCardId); |
| | | item.setLayer(layer); |
| | | glassInfoService.updateById(item); |
| | | break endLoop; |
| | | } |
| | | Optional<GlassInfo> glassInfoTempOptional = glassInfoList.stream().filter(item -> item.getWidth() == glassInfo.getWidth() && item.getHeight() == glassInfo.getHeight() |
| | | && item.getThickness() == glassInfo.getThickness() && item.getFilmsid().equals(glassInfo.getFilmsid())) |
| | | .findFirst(); |
| | | if (glassInfoTempOptional.isPresent()) { |
| | | GlassInfo item = glassInfoTempOptional.get(); |
| | | //玻璃是否为多层 |
| | | checkFlag = multilayerCheck(item, Boolean.FALSE); |
| | | if (checkFlag) { |
| | | //玻璃替换 仅替换流程卡id及层数 |
| | | String tempFlowCardId = item.getFlowCardId(); |
| | | Integer tempLayer = item.getLayer(); |
| | | String flowCardId = glassInfo.getFlowCardId(); |
| | | Integer layer = glassInfo.getLayer(); |
| | | log.info("替换流程卡信息,当前玻璃信息:{}的流程卡号{}及层数{},替换后玻璃信息:{}的流程卡号{}及层数{}", |
| | | item, glassInfo, flowCardId, layer, tempFlowCardId, tempLayer); |
| | | glassInfo.setFlowCardId(tempFlowCardId); |
| | | glassInfo.setLayer(tempLayer); |
| | | glassInfoService.updateById(glassInfo); |
| | | item.setFlowCardId(flowCardId); |
| | | item.setLayer(layer); |
| | | glassInfoService.updateById(item); |
| | | break endLoop; |
| | | } |
| | | } |
| | | } |
| | |
| | | downStorageCageDetails.setState(Const.GLASS_STATE_IN); |
| | | downStorageCageDetails.setSlot(nearestEmpty.getSlot()); |
| | | downStorageCageDetailsService.save(downStorageCageDetails); |
| | | // 生成进片任务 |
| | | |
| | | // 生成进片任务 |
| | | initDownGlassTask(glassInfo, 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | | } |
| | | |
| | | public Boolean outTo(String glassStatus06, String out08Glassstate, String glassStatus11, String glassStatus13, String glassId, String currentSlot) { |
| | | public Boolean outTo(String glassStatus06, String out08Glassstate, String glassStatus11, String |
| | | glassStatus13, String glassId, String currentSlot) { |
| | | if ("2".equals(glassStatus06) && "2".equals(glassStatus11) && "2".equals(glassStatus13)) { |
| | | log.info("G06、G11、G13分别为{},{}、{}非自动状态,无法出片", glassStatus06, glassStatus11, glassStatus13); |
| | | return Boolean.FALSE; |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | Boolean flag08 = "1".equals(out08Glassstate) ? Boolean.TRUE : Boolean.FALSE; |
| | | if (!generateTaskByShelf(glassStatus11, flag08, glassStatus13, tempList, cageDetails)) { |
| | | return generateTaskByShelf(glassStatus11, !flag08, glassStatus13, tempList, cageDetails); |
| | | if (!generateTaskByShelf(glassStatus06, glassStatus11, flag08, glassStatus13, tempList, cageDetails, glassId)) { |
| | | return generateTaskByShelf(glassStatus06, glassStatus11, !flag08, glassStatus13, tempList, cageDetails, glassId); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private Boolean generateTaskByShelf(String glassStatus, Boolean flag08, String glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails) { |
| | | private Boolean generateTaskByShelf(String glassStatus06, String glassStatus11, Boolean flag08, String |
| | | glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails, String glassId) { |
| | | //获取2个机械臂范围内的架子绑定的流程卡信息 |
| | | List<Integer> workList = new ArrayList(); |
| | | |
| | | if (flag08) { |
| | | if (!"2".equals(glassStatus)) { |
| | | if (!"2".equals(glassStatus11)) { |
| | | workList.addAll(Const.G11_WORK_STATION); |
| | | } |
| | | } else { |
| | | if (!"2".equals(glassStatus)) { |
| | | if (!"2".equals(glassStatus06)) { |
| | | workList.addAll(Const.G06_WORK_STATION); |
| | | } |
| | | } |
| | |
| | | //对笼内玻璃进行过滤,仅出符合逻辑的玻璃 |
| | | if (CollectionUtils.isNotEmpty(workList)) { |
| | | List<DownWorkstation> downWorkstationList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | .eq(DownWorkstation::getEnableState, 0).in(DownWorkstation::getWorkstationId, workList)); |
| | | log.info("架子被禁用,无法出片落架"); |
| | | .eq(DownWorkstation::getEnableState, Const.SLOT_ON).in(DownWorkstation::getWorkstationId, workList)); |
| | | // log.info("架子被禁用,无法出片落架"); |
| | | if (CollectionUtils.isEmpty(downWorkstationList)) { |
| | | log.info("笼子被禁用,无法走机械臂下片"); |
| | | //走人工下片 |
| | |
| | | List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.TRUE); |
| | | List<String> downGlassFlowList = downGlassInfoDTOList.stream().map(item -> item.getFlowCardId() + ":" + item.getLayer()).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(downGlassFlowList)) { |
| | | //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃 |
| | | DownStorageCageDetails downStorageCageDetails = downStorageCageDetailsService.getGlassInfoMaxCount(); |
| | | //绑定流程卡,更新玻璃状态,生成出片任务, |
| | | tempGlassId = downStorageCageDetails.getGlassId(); |
| | | //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃id,无 则返回扫描扫到的玻璃id进行出片 |
| | | tempGlassId = downStorageCageDetailsService.getGlassInfoMaxCount(glassId); |
| | | isBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | |
| | | // List<DownWorkstation> emptyShelfList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>() |
| | | // .isNull(DownWorkstation::getFlowCardId)); |
| | | if (isEmptyShelf) { |
| | | DownStorageCageDetails downStorageCageDetails = downStorageCageDetailsService.getGlassInfoMaxCount(); |
| | | //绑定流程卡,更新玻璃状态,生成出片任务 |
| | | tempGlassId = downStorageCageDetails.getGlassId(); |
| | | //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃id,无 则返回扫描扫到的玻璃id进行出片 |
| | | tempGlassId = downStorageCageDetailsService.getGlassInfoMaxCount(glassId); |
| | | isBind = Boolean.TRUE; |
| | | break loop; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public Boolean generateDownGlassOutTask(String glassId, Integer taskType, Boolean isBind, DownStorageCageDetails cageDetails) { |
| | | public Boolean generateDownGlassOutTask(String glassId, Integer taskType, Boolean |
| | | isBind, DownStorageCageDetails cageDetails) { |
| | | //按玻璃id获取玻璃信息 |
| | | DownStorageCageDetails downStorageCageDetails = null; |
| | | if (glassId.equals(cageDetails.getGlassId())) { |
| | |
| | | taskType = 3; |
| | | } else { |
| | | downStorageCageDetails = downStorageCageDetailsService.getOne(new LambdaQueryWrapper<DownStorageCageDetails>() |
| | | .eq(DownStorageCageDetails::getGlassId, glassId)); |
| | | .eq(DownStorageCageDetails::getGlassId, glassId).eq(DownStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | } |
| | | |
| | | Integer endCell = null; |
| | | if (isBind) { |
| | | if (!isBind) { |
| | | //获取空架子信息,将空架子信息绑定流程卡 |
| | | DownWorkstation emptyDownWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | | .isNull(DownWorkstation::getFlowCardId).orderByDesc(DownWorkstation::getWorkstationId).last("limit 1")); |
| | | if (null != emptyDownWorkstation) { |
| | | log.info("获取到空架子信息,绑定流程卡"); |
| | | emptyDownWorkstation.setFlowCardId(downStorageCageDetails.getFlowCardId()); |
| | | emptyDownWorkstation.setLayer(downStorageCageDetails.getLayer()); |
| | | downWorkstationService.updateById(emptyDownWorkstation); |
| | | downWorkstationService.updateFlowCardIdAndCount(downStorageCageDetails.getFlowCardId(), downStorageCageDetails.getLayer(), emptyDownWorkstation.getWorkstationId()); |
| | | endCell = emptyDownWorkstation.getWorkstationId(); |
| | | } else { |
| | | log.info("没有空架子信息,无法绑定流程卡"); |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | //更新落架玻璃数量 |
| | | if (endCell == 7) { |
| | | downWorkstationService.update(new UpdateWrapper<DownWorkstation>().eq("flow_card_id", downStorageCageDetails.getFlowCardId()) |
| | | .eq("layer", downStorageCageDetails.getLayer()).setSql("other_number = other_number +1")); |
| | | } else { |
| | | downWorkstationService.update(new UpdateWrapper<DownWorkstation>().eq("flow_card_id", downStorageCageDetails.getFlowCardId()) |
| | | .eq("layer", downStorageCageDetails.getLayer()).setSql("racks_number = racks_number +1")); |
| | | } |
| | | |
| | | //生成任务信息 |
| | | DownGlassInfo downGlassInfo = new DownGlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo); |
| | | //todo:落架片序 |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setGlassId(glassInfo.getGlassId()); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setTaskType(taskType + ""); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setWidth((int) glassInfo.getWidth()); |
| | | downGlassTask.setHeight((int) glassInfo.getHeight()); |
| | | downGlassTask.setFlowCardId(glassInfo.getFlowCardId()); |
| | | downGlassTask.setLayer(glassInfo.getLayer()); |
| | | downGlassTask.setTaskStauts(0); |
| | | downGlassTask.setTaskStatus(0); |
| | | downGlassTask.setCreateTime(new Date()); |
| | | downGlassTaskService.save(downGlassTask); |
| | | //向plc发送命令 |
| | |
| | | startCell, endCell, taskType); |
| | | } |
| | | |
| | | private Boolean sendMessageToPlc(int width, int height, int thickness, int startCell, int endCell, int taskType) { |
| | | private Boolean sendMessageToPlc(int width, int height, int thickness, int startCell, int endCell, |
| | | int taskType) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("Glass_width").getAddress(), width); |
| | |
| | | {
|
| | | "codeId": "requestID",
|
| | | "addressIndex": "2",
|
| | | "addressLenght": "30"
|
| | | "addressLenght": "20"
|
| | | },
|
| | | {
|
| | | "codeId": "currentCell",
|
| | |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | salve_hangzhoumes: |
| | | url: jdbc:sqlserver://192.168.30.101:1433;databasename=hangzhoumes |
| | | url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | |
| | | username: sa |
| | | password: beibo.123/ |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | pp: |
| | | url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: cz |
| | | application: |
| | | name: unLoadGlass |
| | | |
| | |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | mes: |
| | | maxWidth: 1000 #下片的最大宽度 |
| | | maxHeight: 1000 #下片的最大高度 |
| | | maxWidth: 2500 #下片的最大宽度 |
| | | maxHeight: 2000 #下片的最大高度 |
| | | minWidth: 400 #下片的最小宽度 |
| | | minHeight: 400 #下片的最小高度 |
| | | throughWidth: 3000 |
| | | throughHeight: 3000 |
| | | throughHeight: 2500 |
| | | threshold: 5 #下片的最大阈值 |
| | |
| | | <resultMap id="downGlassInfo" type="com.mes.downworkstation.entity.dto.DownGlassInfoDTO"> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | | <result column="layer" property="layer"/> |
| | | <result column="count" property="count"/> |
| | | <result column="racks_number" property="racksNumber"/> |
| | | <collection property="glassInfoList" ofType="com.mes.glassinfo.entity.GlassInfo"> |
| | | <id column="id" property="id"/> |
| | | <result column="flow_card_id" property="flowCardId"/> |
| | |
| | | </select> |
| | | |
| | | <select id="queryWorkStationIsIn" resultMap="downGlassInfo"> |
| | | SELECT T.* |
| | | SELECT |
| | | T.FLOW_CARD_ID, |
| | | T.LAYER, |
| | | T.RACKS_NUMBER |
| | | <if test="!isDownload"> |
| | | ,T1.* |
| | | </if> |
| | | FROM ( |
| | | SELECT T.FLOW_CARD_ID, |
| | | T.LAYER, |
| | | COUNT(T.LAYER) AS COUNT |
| | | FROM |
| | | DOWN_WORKSTATION T |
| | | LEFT JOIN DOWN_GLASS_INFO T1 ON T.FLOW_CARD_ID = T1.FLOW_CARD_ID |
| | | GROUP BY T.FLOW_CARD_ID,LAYER |
| | | HAVING T.FLOW_CARD_ID IS NOT NULL |
| | | ) T |
| | | INNER JOIN GLASS_INFO T1 ON T.FLOW_CARD_ID = T1.FLOW_CARD_ID |
| | | AND T.LAYER = T1.LAYER |
| | | LEFT JOIN DOWN_GLASS_INFO T2 ON T1.GLASS_ID = T2.GLASS_ID |
| | | <where> |
| | | <if test="isDownload"> |
| | | <if test="!isDownload"> |
| | | AND T2.GLASS_ID IS NULL |
| | | </if> |
| | | <if test="!isDownload"> |
| | | <if test="isDownload"> |
| | | AND T2.GLASS_ID IS not NULL |
| | | </if> |
| | | </where> |
| | | order by t.count desc |
| | | ORDER BY |
| | | T.RACKS_NUMBER DESC, |
| | | T1.TEMPERING_LAYOUT_ID, |
| | | T1.TEMPERING_FEED_SEQUENCE DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.mes.downstorage.service.impl.DownStorageCageDetailsServiceImpl; |
| | | import com.mes.downstorage.service.impl.DownStorageCageServiceImpl; |
| | | |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.impl.DownWorkstationServiceImpl; |
| | | import com.mes.glassinfo.service.impl.GlassInfoServiceImpl; |
| | | import com.mes.job.DownLoadCacheGlassTask; |
| | | import com.mes.utils.Result; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | |
| | | @Test |
| | | public void testupdateFlowCardIdAndCount() { |
| | | log.info("绑定流程卡号和数量"); |
| | | downWorkstationServiceImpl.updateFlowCardIdAndCount("1", 1, 1); |
| | | downWorkstationServiceImpl.updateFlowCardIdAndCount("NG24060401A020", 1, 2); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void testplc() { |
| | | log.info("测试"); |
| | | glassInfoServiceImpl.getGlassInfoCountByFlowCardId("NG24030702A01"); |
| | | glassInfoServiceImpl.getGlassInfoCountByFlowCardId("NG24030702A01",1); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Test |
| | | public void updateDownWorkstationstate() { |
| | | |
| | | DownWorkstation downWorkstation= new DownWorkstation(); |
| | | |
| | | downWorkstation.setId(1); |
| | | downWorkstation.setEnableState(0); |
| | | downWorkstationServiceImpl.updateDownWorkstationstate(downWorkstation); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void updateDownstate() { |
| | | |
| | | DownStorageCage downStorageCage= new DownStorageCage(); |
| | | |
| | | downStorageCage.setId(1); |
| | | downStorageCage.setEnableState(0); |
| | | downStorageCageServiceImpl.updateDownStorageCage(downStorageCage); |
| | | } |
| | | |
| | | |
| | | /* @Test |
| | | public void updateDownStorageCage() { |
| | | |
| | | |
| | | DownStorageCage downStorageCage= new DownStorageCage(); |
| | | downStorageCage.setEnableState("0"); |
| | | downStorageCage.setEnableState(0); |
| | | downStorageCage.setId(1); |
| | | downStorageCageService.updateDownStorageCage(downStorageCage); |
| | | |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | <module>LoadGlassModule</module> |
| | | <module>TemperingGlassModule</module> |
| | | <module>UnLoadGlassModule</module> |
| | | <module>GlassStorageModule</module> |
| | | </modules> |
| | | |
| | | <properties> |