Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | "@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: '全部入库状态', |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | 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 ) |
| | |
| | | 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 { |
| | |
| | | widtha: rect.width, |
| | | heighta: rect.height, |
| | | })); |
| | | console.log(data.intoGlass[0]); |
| | | console.log(adjustedRects.value); |
| | | }; |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | |
| | | <template> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading"> |
| | | <el-scrollbar height="600px"> |
| | | <div id="app" style="margin-top: 20px;"> |
| | | <div |
| | | :style="{ width: `${olWidth}px`, height: `${olHeight}px`,position: 'relative' }" |
| | | > |
| | | <div |
| | | v-for="(rect, index) in adjustedRects" |
| | | :key="rect.glass_id" |
| | | class="rect" |
| | | @click="showDialog(rect.glass_id)" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: getRectColor(rect.glass_state) |
| | | }" |
| | | > |
| | | <!-- 箭头 --> |
| | | <!-- <div id="arrow"></div> |
| | | <div id="line"></div> --> |
| | | <!-- <div class="centered-text" >NG24030401B01</div> --> |
| | | <div class="centered-text"> |
| | | <div>{{ rect.process_id }}</div> |
| | | <div style="margin-top: 50px;margin-left: -85px;">{{ rect.widtha }}*{{ rect.heighta }}</div> |
| | | </div> |
| | | <div id="top" style="height: 150px;display: flex;"> |
| | | <div v-for="(rect, index) in adjustedRects" |
| | | :key="index" |
| | | :style="{ width: '1000px', height: '100px',margin: '5px',}"> |
| | | <div ref="setChartDom(index, $el)" style="width: 100%; height: 100%;"></div> |
| | | <div style="text-align: center;"> |
| | | {{ rect.thisProcess }}</div> |
| | | </div> |
| | | </div> |
| | | <!-- 点击弹出 --> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> |
| | | <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | <el-button type="danger" plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> |
| | | <el-icon class="el-icon--right"><Upload /></el-icon> |
| | | {{ $t('order.Takeaway') }}</el-button> |
| | | </el-dialog> |
| | | </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/d1.png" alt="" style="margin-left: -30px; width: 110%;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="10vh" width="80%" :title="$t('large.brokeno')"> |
| | | <el-table height="500" 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"> |
| | | <el-button @click="blinda = false">{{ $t('large.close') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue'; |
| | | 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() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const blind = ref(false) |
| | | const olWidth = ref(); |
| | | const olHeight = ref(); |
| | | const process_id = ref(); // 用于存储process_id的响应式引用 |
| | | const glass_id = ref(); |
| | | // const rects = ref([]); // 用于存储矩形数据的响应式引用 |
| | | const currentGlassId = ref(null); // 存储当前点击矩形的 glass_id |
| | | const adjustedRects = ref([]); |
| | | // const handleBind = (row) => { |
| | | // blind.value = true; // 打开绑定架子对话框 |
| | | // }; |
| | | // 显示对话框并设置当前 glass_id |
| | | function showDialog(glassId: number) { |
| | | currentGlassId.value = glassId; |
| | | blind.value = true; |
| | | } |
| | | onMounted(async () => { |
| | | try { |
| | | const response = await request.post('/cacheGlass/taskCache/currentCutTerritory'); // 替换为你的API端点 |
| | | if (response.code === 200) { |
| | | // const process_id = response.data[0].process_id |
| | | const rawRects = response.data; // 设置矩形数据 |
| | | console.log(response.data); |
| | | const { olWidth: newolWidth, olHeight: newolHeight, process_id: newprocess_id ,glass_id:newglass_id } = response.data; // 获取尺寸 |
| | | olWidth.value = newolWidth; // 设置容器宽度 |
| | | olHeight.value = newolHeight; // 设置容器高度 |
| | | process_id.value = newprocess_id; |
| | | glass_id.value = newglass_id; |
| | | |
| | | adjustedRects.value = rawRects.map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | x_axis: (rect.x_axis*100) * 0.003, // 将x值除以3 |
| | | y_axis: (rect.y_axis*100) * 0.003, |
| | | width: (rect.width*100) * 0.002 , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height:( rect.height*100) * 0.002 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | console.log(adjustedRects.value); |
| | | |
| | | |
| | | // console.log( (rect.width*100) / 300 ); |
| | | } else { |
| | | // console.error('Failed to fetch rectangles from API.'); |
| | | console.error('Failed to fetch rects from API.'); |
| | | } |
| | | } catch (error) { |
| | | // console.error('Error fetching rectangles :', error); |
| | | console.error('Error fetching rects :', error); |
| | | } |
| | | }); |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |
| | | var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+201; |
| | | console.log(url); |
| | | const response = await request.post(url) |
| | | // const response = await request.post('/cacheGlass/taskCache/identControls', { |
| | | // identId: currentGlassId.value, |
| | | // controlsId: 201, |
| | | // }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 201); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // // 人工拿走 |
| | | const handleManualTake = async () => { |
| | | try { |
| | | var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+200; |
| | | console.log(url); |
| | | const response = await request.post(url) |
| | | // const response = await request.post('/cacheGlass/taskCache/identControls', { |
| | | // identId: currentGlassId.value, |
| | | // controlsId: 200, |
| | | // }) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | ElMessage.success(response.message); |
| | | // window.location.reload() |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 200); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | function getRectColor(state: number): string { |
| | | switch (state) { |
| | | 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; |
| | | }; |
| | | function getStatusType(warehousing) { |
| | | switch (warehousing) { |
| | | case 0: |
| | | return '#e1f3d8'; |
| | | case 100: |
| | | return '#c8c9cc'; |
| | | case 110: |
| | | return '#b3e19d'; |
| | | case 120: |
| | | return '#f89898'; |
| | | case 200: |
| | | return 'lightblue'; |
| | | case 201: |
| | | return '#f3d19e'; |
| | | default: |
| | | return '#911005'; // 默认颜色 |
| | | 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; |
| | | } |
| | | } |
| | | // 更新矩形状态 |
| | | function updateRectStatus(glassId: string, status: number) { |
| | | adjustedRects.value.forEach(rect => { |
| | | if (rect.glass_id === glassId) { |
| | | rect.glass_state = status; // 更新矩形的状态 |
| | | } |
| | | }); |
| | | } |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | | onMounted(() => { |
| | | socket = new WebSocket(socketUrl); |
| | | socket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | adjustedRects.value = data.device[0].map(rect => ({ |
| | | ...rect, |
| | | completedQuantity: rect.completedQuantity, |
| | | breakageQuantity: rect.breakageQuantity, |
| | | thisProcess: rect.thisProcess, |
| | | })); |
| | | console.log(adjustedRects.value); |
| | | // updateCharts(); |
| | | }; |
| | | adjustedRects.value.forEach((rect, index) => { |
| | | initChart(index, rect); |
| | | }); |
| | | // }; |
| | | }); |
| | | |
| | | // adjustedRects.value = data.currentCutTerritory[0] |
| | | adjustedRects.value = data.currentCutTerritory[0].map(rect => ({ |
| | | ...rect, // 复制原始对象的其他属性 |
| | | x_axis: (rect.x_axis*100) * 0.003, // 将x值除以3 |
| | | y_axis: (rect.y_axis*100) * 0.003, |
| | | width: (rect.width*100) * 0.002 , |
| | | widtha: rect.width , |
| | | heighta: rect.height , |
| | | height:( rect.height*100) * 0.002 , |
| | | glass_state: rect.glass_state |
| | | })); |
| | | // console.log("更新后数据", tableData); |
| | | |
| | | function initChart(index, rect) { |
| | | const { dom } = chartRefs.value[index] || { dom: null }; |
| | | if (dom) { |
| | | const chart = echarts.init(dom); |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left', |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '饼状图', |
| | | type: 'pie', |
| | | radius: ['50%','70%'], |
| | | data: [ |
| | | {value: rect.completedQuantity, name: '加工数量'}, |
| | | {value: rect.breakageQuantity, name: '次破数量'}, |
| | | console.log(rect.breakageQuantity) |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | chart.setOption(option); |
| | | chartRefs.value[index] = { ...chartRefs.value[index], chart }; |
| | | |
| | | }; |
| | | |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | } |
| | | console.log(chartRefs.value[index]); |
| | | } |
| | | |
| | | // 更新图表 |
| | | // function updateCharts() { |
| | | // adjustedRects.value.forEach((rect, index) => { |
| | | // const { chart } = chartRefs.value[index] || { chart: null }; |
| | | // if (chart) { |
| | | // chart.setOption({ |
| | | // series: [{ |
| | | // data: [ |
| | | // { value: rect.completedQuantity, name: '加工数量' }, |
| | | // { value: rect.breakageQuantity, name: '次破数量' }, |
| | | // ], |
| | | // }], |
| | | // }); |
| | | // } |
| | | // }); |
| | | // } |
| | | // 初始化图表 |
| | | // function initChart(index, rect) { |
| | | // const chartDom = ref(`chartDom${index}`).value; |
| | | // console.log(ref(`chartDom${index}`).value); |
| | | // const chart = echarts.init(chartDom); |
| | | // const option = { |
| | | // tooltip: { |
| | | // trigger: 'item' |
| | | // }, |
| | | // legend: { |
| | | // orient: 'vertical', |
| | | // left: 'left', |
| | | // }, |
| | | // series: [ |
| | | // { |
| | | // name: '饼状图', |
| | | // type: 'pie', |
| | | // radius: ['50%','70%'], |
| | | // data: [ |
| | | // {value: rect.completed, name: '加工数量'}, |
| | | // {value: rect.breakage, name: '次破数量'}, |
| | | // ], |
| | | // emphasis: { |
| | | // itemStyle: { |
| | | // shadowBlur: 10, |
| | | // shadowOffsetX: 0, |
| | | // shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | // } |
| | | // } |
| | | // } |
| | | // ] |
| | | // }; |
| | | // chart.setOption(option); |
| | | // } |
| | | // 清理 WebSocket 连接 |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | |
| | | align-items: center; |
| | | height: 100%; /* 确保div占据整个矩形的高度 */ |
| | | } |
| | | #rect { |
| | | position: relative; /* 确保箭头可以相对于矩形定位 */ |
| | | /* 其他样式 */ |
| | | } |
| | | |
| | | #arrow { |
| | | position: absolute; |
| | | top: 70%; /* 箭头位于矩形中间 */ |
| | | left: 200px; /* 箭头在矩形左侧一些距离 */ |
| | | transform: translateY(-50%); /* 垂直居中 */ |
| | | width: 0; |
| | | height: 0; |
| | | border-top: 10px solid transparent; /* 上边框 */ |
| | | border-bottom: 10px solid transparent; /* 下边框 */ |
| | | border-right: 20px solid #911005; /* 右边框,形成箭头 */ |
| | | /* 根据需要调整边框大小和颜色 */ |
| | | } |
| | | |
| | | #line { |
| | | position: absolute; |
| | | top: 70%; /* 直线位于矩形中间 */ |
| | | left: 210px; /* 直线在箭头右侧一些距离 */ |
| | | transform: translateY(-50%); /* 垂直居中 */ |
| | | height: 2px; /* 直线的高度 */ |
| | | width: 240px; /* 直线的长度,根据需要调整 */ |
| | | background-color: #911005; /* 直线的颜色 */ |
| | | } |
| | | |
| | | #dialog-footer{ |
| | | text-align: center; |
| | | margin-top: -15px; |
| | | } |
| | | </style> |
| | |
| | | public void saveGlassInfo(List<GlassInfo> glassinfo) { |
| | | this.saveBatch(glassinfo); |
| | | } |
| | | |
| | | /* |
| | | |
| | | @Override |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId,int layer) { |
| | |
| | | .collect(Collectors.toList()); |
| | | log.info("result666: {}", result); |
| | | return result; |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | |
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; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("pp") |
| | | @Mapper |
| | | public interface OptimizeLayoutMapper extends MPJBaseMapper<OptimizeLayout> { |
| | | |
| | | } |
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 { |
| | | |
| | | } |
| | |
| | | @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; |
| | |
| | | @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.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); |
| | | } |
| | |
| | | |
| | | @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); |
| | | } |
| | |
| | | } |
| | | return emptyList.get(0); |
| | | } |
| | | /* |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> selectCacheMax() { |
| | |
| | | |
| | | ); |
| | | } |
| | | */ |
| | | |
| | | |
| | | @Override |
| | |
| | | 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("绑定架子") |
| | | @PostMapping("/updateFlowCardId") |
| | | public ResponseEntity<Map<String, Object>> updateFlowCardId(@RequestBody DownWorkRequest request) { |
| | | public Result updateFlowCardId(@RequestBody DownWorkRequest request) { |
| | | |
| | | // 绑定架子 |
| | | downWorkstationService.updateFlowCardIdAndCount(request.getFlowCardId(), request.getWorkstationId(), request.getLayer()); |
| | | downWorkstationService.updateFlowCardIdAndCount(request.getFlowCardId(), request.getWorkstationId(), request.getLayer()); |
| | | |
| | | // 构建响应数据 |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 人工下片数量 |
| | | */ |
| | | private Integer artificialNumber; |
| | | private Integer otherNumber; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer layer; |
| | | /** |
| | | * 落架数量 |
| | | * 已出片数量 |
| | | */ |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 落架数量 |
| | | */ |
| | | private Integer racksNumber; |
| | | |
| | | /** |
| | | * 流程卡未进片的玻璃信息 |
| | | */ |
| | | private List<GlassInfo> glassInfoList; |
| | |
| | | * @param workstationId |
| | | * @return 更新架子和数量 |
| | | */ |
| | | int updateFlowCardIdAndCount(String flowCardId, int workstationId,int layer); |
| | | void updateFlowCardIdAndCount(String flowCardId, int workstationId,int layer); |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | DownWorkstation selectByFlowCardId(String flowcardid); |
| | | |
| | | |
| | | /** |
| | | * @param downWorkstation |
| | | * @returnq 启用禁用 |
| | | */ |
| | | boolean updateDownWorkstationstate(DownWorkstation downWorkstation); |
| | | } |
| | |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.entity.DownWorkstionAndDownGlassinfo; |
| | |
| | | |
| | | |
| | | @Override |
| | | public int updateFlowCardIdAndCount(String flowCardId, int workstationId,int layer) { |
| | | 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 artificialnumber=damageservice.count(queryWrapper); |
| | | int otherNumber=damageservice.count(queryWrapper); |
| | | UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("total_quantity", glassInfoCount) |
| | | .set("flow_card_id", flowCardId) |
| | | .set("layer", layer) |
| | | .set("artificial_number", artificialnumber) |
| | | .set("other_number", otherNumber) |
| | | .eq("workstation_id", workstationId); |
| | | |
| | | return baseMapper.update(new DownWorkstation(), updateWrapper); |
| | | this.update(updateWrapper); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public boolean updateDownWorkstationstate(DownWorkstation downWorkstation) { |
| | | DownWorkstation downWork = baseMapper.selectById(downWorkstation.getId()); |
| | | downWork.setEnableState(downWorkstation.getEnableState()); |
| | | baseMapper.updateById(downWork); |
| | | return true; |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | |
| | | private Boolean generateTaskByShelf(String glassStatus06, String glassStatus11, Boolean flag08, String glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails, String glassId) { |
| | | private Boolean generateTaskByShelf(String glassStatus06, String glassStatus11, Boolean flag08, String |
| | | glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails, String glassId) { |
| | | //获取2个机械臂范围内的架子绑定的流程卡信息 |
| | | List<Integer> workList = new ArrayList(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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; |
| | |
| | | .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("没有空架子信息,无法绑定流程卡"); |
| | |
| | | //更新落架玻璃数量 |
| | | if (endCell == 7) { |
| | | downWorkstationService.update(new UpdateWrapper<DownWorkstation>().eq("flow_card_id", downStorageCageDetails.getFlowCardId()) |
| | | .eq("layer", downStorageCageDetails.getLayer()).setSql("artificial_number = artificial_number +1")); |
| | | .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")); |
| | |
| | | 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); |
| | |
| | | <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> |
| | |
| | | //downGlassTaskService.getUnloadingTaskState(); |
| | | } |
| | | |
| | | @Test |
| | | /* @Test |
| | | public void updateDownStorageCage() { |
| | | |
| | | |
| | |
| | | downStorageCage.setId(1); |
| | | downStorageCageService.updateDownStorageCage(downStorageCage); |
| | | |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | |