Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
| | |
| | | } |
| | | |
| | | |
| | | export function currentUsername() { |
| | | return request({ |
| | | url: '/api/user/currentUsername', |
| | | method: 'get', |
| | | |
| | | }) |
| | | } |
| | | |
| | | export function resetPass(data) { |
| | | return request({ |
| | | url: '/api/user/resetPass', |
| | |
| | | {
|
| | |
|
| | | "ip": "192.168.10.21",
|
| | | "ip": "localhost",
|
| | | "systemTitle": "Login System",
|
| | | "usernamePlaceholder": "Please enter username",
|
| | | "passwordPlaceholder": "Please enter password",
|
| | |
| | | "有效": "Valid",
|
| | | "无效": "Invalid",
|
| | | "请输入名称": "Please enter a name",
|
| | | "请输入角色": "Please enter a role",
|
| | | "请输入权限描述":"Please enter a permission description",
|
| | | "长度在 2 到 15 个字符": "Length between 2 and 15 characters",
|
| | | "请输入状态": "Please enter the status",
|
| | | "添加角色": "Add Role",
|
| | |
| | | "Confirm Modification":"Confirm modification",
|
| | | "The glass ID already exists in the loading queue":"The glass ID already exists in the loading queue",
|
| | | "This glass ID already exists in the sorting cage":"This glass ID already exists in the sorting cage",
|
| | | "Production queue":"Production queue",
|
| | | "Outing Queue":"Outing Queue",
|
| | | "Enter the Frame No":"Enter the Frame No",
|
| | | "Frame No":"Frame No",
|
| | | "Glass information corresponding to aluminum frame":"Glass information corresponding to aluminum frame",
|
| | |
| | | "Start":"Start",
|
| | | "Sequence":"Sequence",
|
| | | "Position":"Position",
|
| | | "Top":"Top",
|
| | | "Up":"Up",
|
| | | "Down":"Down",
|
| | | "ServoManualone": {
|
| | | "A01 所在格子": "A01 Current Grid",
|
| | | "数量": "Quantity",
|
| | |
| | |
|
| | | "A01~A02输送": "A01~A02 Conveying",
|
| | | "B01~B02输送": "B01~B02 Conveying",
|
| | | "D01~D02输送": "D01~D02 Conveying",
|
| | | "D01~D06输送": "D01~D06 Conveying",
|
| | | "翻转点动速度": "Flip Jog Speed",
|
| | | "小车点动速度": "Cart Jog Speed",
|
| | | "最高速度": "Max Speed",
|
| | |
| | | "A02手动位置": "A02 turn Target Angle(Manual)",
|
| | | "A02定位速度": "A02 TURN POS Velocity manual",
|
| | | "A02翻转实时位置": "A02 turn Actual angle",
|
| | | "A02翻转启动": "SERVE TURN",
|
| | | "A02翻转启动": "A02 SERVE TURN",
|
| | | "A02复位": "Reset",
|
| | | "未回零": "NotZero",
|
| | | "回零": "Zero"
|
| | |
| | | {
|
| | | "ip": "192.168.10.21",
|
| | | "ip": "localhost",
|
| | | "systemTitle": "登录系统",
|
| | | "usernamePlaceholder": "请输入用户名",
|
| | | "passwordPlaceholder": "请输入密码",
|
| | |
| | | "Confirm Modification": "确认修改",
|
| | | "The glass ID already exists in the loading queue": "上片队列已存在此玻璃id",
|
| | | "This glass ID already exists in the sorting cage": "理片笼内已存在此玻璃id",
|
| | | "Production queue":"上片队列",
|
| | | "Outing Queue":"出片队列",
|
| | | "Enter the Aluminum Frame No":"请输入铝框id",
|
| | | "Frame No":"铝框id",
|
| | | "Glass information corresponding to aluminum frame":"铝框对应的玻璃信息",
|
| | |
| | | "Start":"开始",
|
| | | "Sequence":"顺序",
|
| | | "Position":"位置",
|
| | | "Top":"置顶",
|
| | | "Up":"上移",
|
| | | "Down":"下移",
|
| | | "langparameter": {
|
| | | "conveyor Velocity(Auto FAST)": "D01-D06 皮带输送自动快速",
|
| | | "conveyor Velocity(Auto SLOW)": "D01-D06 皮带输送自动慢速",
|
| | |
| | | |
| | | <div class="button-row" style="display: flex; justify-content: flex-start;flex-wrap:wrap;"> |
| | | <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" style="margin: 10px;"> |
| | | <el-button v-if="item.button" :name="item.button.name" :class="getStatusClass(item.button.value)" |
| | | class="action-button" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend();">{{ |
| | | item.button.name |
| | | }}</el-button> |
| | | <el-button v-if="item.button" :name="item.button.name" |
| | | :class="{ 'dow': false, 'op': item.button.value === 1 }" class="action-button" |
| | | @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend();">{{ |
| | | item.button.name |
| | | }}</el-button> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | |
| | | |
| | | // console.log(parms); |
| | | |
| | | if(obj.params){ |
| | | |
| | | for (let i = 0; i < jsonData2.length; i++) { |
| | | let arr = jsonData2[i]; |
| | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | .action-button { |
| | | margin-right: 10px; |
| | | background: #66b1ff; |
| | | background: #A0A0A0; |
| | | color: #FFF; |
| | | } |
| | | |
| | |
| | | const handleMouseMove = throttle(function (event) {
|
| | | const inputBox = document.querySelectorAll('.el-card__body');
|
| | | const target = event.target;
|
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
|
| | | if (obj.zuhe1 &&inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
|
| | | // 执行更新逻辑
|
| | | for (let i = 0; i < 4; i++) {
|
| | | jsonData2[i].forEach((item, index) => {
|
| | |
| | | const handleMouseMove = throttle(function (event) {
|
| | | const inputBox = document.querySelectorAll('.el-card__body');
|
| | | const target = event.target;
|
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
|
| | | if (obj.zuhe1 && inputBox && Array.from(inputBox).every(box => !box.contains(target))) {
|
| | | // 执行更新逻辑
|
| | | for (let i = 0; i < 2; i++) {
|
| | | jsonData2[i].forEach((item, index) => {
|
| | |
| | | updateButtonValue (dataGroup, itemIndex) { |
| | | this.$set(dataGroup[itemIndex].button, 'value', 1); // 点击按钮后将值改为1 |
| | | }, |
| | | //提交数据到后端 |
| | | submitDataToBackend () { |
| | | const inputData = this.jsonData.map(dataGroup => { |
| | | return dataGroup.map(item => { |
| | |
| | | const handleMouseMove = throttle(function (event) { |
| | | const inputBox = document.querySelectorAll('.el-card__body'); |
| | | const target = event.target; |
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | const parms = obj.params; |
| | | const parms = obj.params; |
| | | const fanzhuan = obj.fanzhuan; |
| | | const xiaoche = obj.xiaoche; |
| | | if (parms && inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | |
| | | // console.log(obj); |
| | | // console.log('parms:', parms); |
| | | // console.log('fanzhuan:', fanzhuan); |
| | |
| | | } |
| | | |
| | | }, |
| | | //语言替换 |
| | | replaceChineseWithEnglish() { |
| | | |
| | | |
| | |
| | | <div class="item-row"> |
| | | |
| | | |
| | | <span class="name" v-if="groupIndex === 13" style="width:250px;">{{ item.name }}</span> |
| | | <span class="name" v-if="groupIndex === 12" style="width:250px;">{{ item.name }}</span> |
| | | <span class="name" v-else style="width:150px;">{{ item.name }}</span> |
| | | <el-input v-if="item.type === '0'" v-model="item.value" readonly="readonly" style="width:400px;" class="input-box"></el-input> |
| | | |
| | | <el-input v-if="item.type === '0'" v-model="item.value" readonly="readonly" style="width:300px;" class="input-box"></el-input> |
| | | |
| | | |
| | | |
| | |
| | | let obj = JSON.parse(msg.data); |
| | | |
| | | const jsonData2 = this.jsonData; |
| | | // console.log(jsonData2); |
| | | // 如果鼠标不在输入框内,更新输入框的值 |
| | | // this.submitDataToBackend() |
| | | |
| | | const parms = obj.params; |
| | | // const xiaoche = obj.params[3]; |
| | | |
| | | |
| | | // console.log(obj); |
| | | |
| | |
| | | const inputBox = document.querySelectorAll('.action-button'); |
| | | const target = event.target; |
| | | |
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | if (parms && inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | //清除id |
| | | |
| | | for (let i = 0; i < jsonData2.length; i++) { |
| | | let arr = jsonData2[i]; |
| | | for (let j = 0; j < arr.length; j++) { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | //ID |
| | | const specialChars = /[^\w\s]/g; // 正则表达式匹配非字母、数字、下划线和空格的字符 |
| | | |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | html,body{ |
| | | width:100%; |
| | | height:85%; |
| | | |
| | | } |
| | | .item-row { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | updateButtonValue (dataGroup, itemIndex) { |
| | | this.$set(dataGroup[itemIndex].button, 'value', 1); // 点击按钮后将值改为1 |
| | | }, |
| | | //提交数据到后端 |
| | | submitDataToBackend () { |
| | | const inputData = this.jsonData.map(dataGroup => { |
| | | return dataGroup.map(item => { |
| | |
| | | document.addEventListener('mouseover', function (event) { |
| | | const inputBox = document.querySelectorAll('.el-card__body'); |
| | | const target = event.target; |
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | const parms = obj.params; |
| | | if (parms && inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | // 如果鼠标不在输入框内,更新输入框的值 |
| | | // this.submitDataToBackend() |
| | | const parms = obj.params; |
| | | |
| | | // console.log(parms) |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | }, |
| | | //语言替换 |
| | | replaceChineseWithEnglish() { |
| | | |
| | | |
| | |
| | | }}</router-link> |
| | | </el-breadcrumb> |
| | | |
| | | <el-row :gutter="18" class='card'> |
| | | <el-row :gutter="18" class='card'> |
| | | <el-col :span="7" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex"> |
| | | <el-card class="json-block"> |
| | | <div class="button-row" style="display: flex; justify-content: space-between;"> |
| | |
| | | jsonData: data // 加载整个data.json文件作为jsonData |
| | | } |
| | | }, |
| | | activated(){ |
| | | activated(){ |
| | | // 激活组件时调用 |
| | | // 初始化WebSocket |
| | | |
| | | this.initWebSocket (); |
| | | // 获取当前语言 |
| | | const language = this.$i18n.locale; |
| | | console.log(language); |
| | | // 如果当前语言是英语,则将中文替换为英文 |
| | | if (language === 'en-US') { |
| | | this.replaceChineseWithEnglish(); |
| | | } |
| | |
| | | updateButtonValue (dataGroup, itemIndex) { |
| | | this.$set(dataGroup[itemIndex].button, 'value', 1); // 点击按钮后将值改为1 |
| | | }, |
| | | submitDataToBackend () { |
| | | //提交数据到后端 |
| | | submitDataToBackend () { |
| | | // 将jsonData转换为数组 |
| | | const inputData = this.jsonData.map(dataGroup => { |
| | | return dataGroup.map(item => { |
| | | // 如果是数字类型,则转换为整数 |
| | | if (item.type === '0') { |
| | | return { value: parseInt(item.value) }; |
| | | // 如果是按钮类型,则转换为整数 |
| | | } else if (item.button) { |
| | | return { value: parseInt(item.title.value) }; |
| | | } |
| | | // 否则返回null |
| | | return null; |
| | | }); |
| | | }); |
| | |
| | | // 将inputData转换为整数数组 |
| | | const integerArray = inputData.map(dataGroup => { |
| | | return dataGroup.map(item => { |
| | | // 如果item不为null,则返回item.value |
| | | if (item !== null) { |
| | | return item.value; |
| | | } |
| | | // 否则返回null |
| | | return null; |
| | | }); |
| | | }); |
| | |
| | | document.addEventListener('mouseover', function (event) { |
| | | const inputBox = document.querySelectorAll('.el-card__body'); |
| | | const target = event.target; |
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | const parms = obj.params; |
| | | if ( parms && inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | // 如果鼠标不在输入框内,更新输入框的值 |
| | | // this.submitDataToBackend() |
| | | const parms = obj.params; |
| | | |
| | | |
| | | // console.log(parms) |
| | | |
| | | let index = 0; |
| | | for (let i = 0; i < jsonData2.length; i++) { |
| | | let arr = jsonData2[i]; |
| | |
| | | |
| | | } |
| | | }, |
| | | //语言替换 |
| | | replaceChineseWithEnglish() { |
| | | |
| | | |
| | |
| | | // console.log(this.jsonData) |
| | | |
| | | }, |
| | | send () { |
| | | send () { |
| | | |
| | | |
| | | // 向服务器发送消息 |
| | | |
| | | // 向服务器发送消息 |
| | | socket?.send(JSON.stringify(this.messagepack)); |
| | | }, |
| | | |
| | |
| | | } |
| | | }, |
| | | submitDataToBackend(currentButtonName) { |
| | | |
| | | //A01半自动启动提交 |
| | | if (currentButtonName === 'A01半自动启动' ||currentButtonName === 'A01 Semi-Auto Start') { |
| | | const data = []; |
| | | |
| | |
| | | socket?.send(jsonString); |
| | | |
| | | } |
| | | //A02半自动启动 提交 |
| | | |
| | | if (currentButtonName === 'A02半自动启动' ||currentButtonName === 'A02 Semi-Auto Start') { |
| | | const data2 = []; |
| | |
| | | |
| | | } |
| | | |
| | | //复位提交 |
| | | |
| | | if (currentButtonName === '复位' || currentButtonName === 'Reset') { |
| | | const data2 = []; |
| | | const resetButtonValues = this.jsonData.map(item => { |
| | |
| | | // ) |
| | | |
| | | } |
| | | |
| | | ////回零提交 |
| | | if (currentButtonName === '回零' || currentButtonName === 'Home') { |
| | | const data3 = []; |
| | | const resetButtonValues3 = this.jsonData.map(item => { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | //A01半自动提交 |
| | | |
| | | if (currentButtonName === 'A01半自动' || currentButtonName === 'A01 Semi-Auto' ) { |
| | | const elements = document.getElementsByClassName('special-class'); |
| | |
| | | |
| | | |
| | | if (currentButtonName === 'A02半自动' || currentButtonName === 'A02 Semi-Auto' ) { |
| | | // 获取所有class为special-class2的元素 |
| | | const elements = document.getElementsByClassName('special-class2'); |
| | | |
| | | const data = []; |
| | | // 遍历所有元素 |
| | | for (let i = 0; i < elements.length; i++) { |
| | | // 如果元素隐藏 |
| | | if (elements[i].style.display === 'none') { |
| | | // 显示元素 |
| | | elements[i].style.display = ''; // 显示元素 |
| | | this.zhi2=1; |
| | | // 遍历jsonData |
| | | for (let i = 0; i < this.jsonData.length; i++) { |
| | | let arr = this.jsonData[i]; |
| | | // 遍历arr |
| | | for (let j = 0; j < arr.length; j++) { |
| | | let obj2 = arr[j]; |
| | | // 如果button的name为A02半自动或者A02 Semi-Auto |
| | | if (obj2.button && (obj2.button.name === "A02半自动" || obj2.button.name === "A02 Semi-Auto")) { |
| | | // 设置button的value为1 |
| | | obj2.button.value = 1; |
| | | // console.log(obj2.button.value) |
| | | } |
| | |
| | | } |
| | | |
| | | }else{ |
| | | // 如果元素显示 |
| | | elements[i].style.display = 'none'; |
| | | this.zhi2=0; |
| | | // 遍历jsonData |
| | | for (let i = 0; i < this.jsonData.length; i++) { |
| | | let arr = this.jsonData[i]; |
| | | // 遍历arr |
| | | for (let j = 0; j < arr.length; j++) { |
| | | let obj2 = arr[j]; |
| | | // 如果button的name为A02半自动或者A02 Semi-Auto |
| | | if (obj2.button && (obj2.button.name === "A02半自动" || obj2.button.name === "A02 Semi-Auto")) { |
| | | // 设置button的value为0 |
| | | obj2.button.value = 0; |
| | | // console.log(obj2.button.value) |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | // 将zhi2添加到data数组中 |
| | | data.push([this.zhi2]); |
| | | |
| | | // 将data数组添加到jsonObject中 |
| | | data.unshift([],[],[],[],[],[],[]); |
| | | |
| | | |
| | |
| | | const handleMouseMove = throttle(function(event) { |
| | | const inputBox = document.querySelectorAll('.el-card__body'); |
| | | const target = event.target; |
| | | if (inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | if (obj.zuhe1 && inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | // 执行更新逻辑 |
| | | for (let i = 0; i < 6; i++) { |
| | | jsonData2[i].forEach((item, index) => { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | //故障更新 |
| | | |
| | | for (let i = 0; i < jsonData2.length; i++) { |
| | | let arr = jsonData2[i]; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | // 复位更新 |
| | | for (let i = 0; i < jsonData2.length; i++) { |
| | | let arr = jsonData2[i]; |
| | | for (let j = 0; j < arr.length; j++) { |
| | |
| | | |
| | | |
| | | } |
| | | //未回零更新 |
| | | |
| | | for (let i = 3; i < jsonData2.length; i++) { |
| | | let arr2 = jsonData2[i]; |
| | |
| | | |
| | | } |
| | | // console.log(jsonData2) |
| | | //进片id |
| | | jsonData2.forEach((item) => { |
| | | item.forEach((subItem) => { |
| | | if (subItem.read === 9999) { |
| | |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //取片id |
| | | jsonData2.forEach((item) => { |
| | | item.forEach((subItem) => { |
| | | if (subItem.read === 8888) { |
| | |
| | | |
| | | socket?.send(JSON.stringify(this.messagepack)); |
| | | }, |
| | | //替换语言 |
| | | replaceChineseWithEnglish() { |
| | | |
| | | |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | html,body{ |
| | | width:100%; |
| | | height:85%; |
| | | |
| | | } |
| | | |
| | | .item-row { |
| | | display: flex; |
| | |
| | | font-size: 25px;
|
| | | }
|
| | |
|
| | | @media screen and (min-width: 1900px) { |
| | | .blocks{transform: scale(1.5,1.05);width: 1210px;}
|
| | | } |
| | |
|
| | | .el-message-box__btns {
|
| | | padding: 0px 15px 0;
|
| | | text-align: right;
|
| | |
| | | <div class="blocks-img2"></div>
|
| | | <div class="blocks-img3"></div>
|
| | | <el-button class="orderbutton1" type="primary" @click="showform2()">{{ $t('OrderInfo') }}</el-button>
|
| | | <el-button class="orderbutton2" type="primary" @click="showform6()">{{ $t('Production queue') }}</el-button>
|
| | | <el-button class="orderbutton2" type="primary" @click="showform6()">{{ $t('Outing Queue') }}</el-button>
|
| | |
|
| | | <!-- <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:328px;">
|
| | | <div :class="getStatusClass(item.state)" v-for="(item,index) in cagelist1" :key="item['date']"
|
| | |
| | | <el-button type="primary" @click="showcageinfo(1)">{{ $t('Query') }}</el-button>
|
| | | <el-table :data="cageinfo.slice((currentPages - 1) * pagesizes, currentPages * pagesizes)" :height="700" border
|
| | | style="width: 100%;overflow: auto;">
|
| | | <el-table-column :width="90" prop="cage" :label="$t('Cage No')"></el-table-column>
|
| | | <el-table-column :width="90" prop="cell" :label="$t('Slot No')"></el-table-column>
|
| | | <el-table-column :width="55" prop="tier" :label="$t('The Side')"></el-table-column>
|
| | | <el-table-column :width="145" prop="glassId" :label="$t('Barcode')"></el-table-column>
|
| | | <el-table-column :width="100" prop="orderId" :label="$t('Order No')"></el-table-column>
|
| | | <el-table-column :width="80" prop="listId" :label="$t('List No')"></el-table-column>
|
| | | <el-table-column :width="100" prop="boxId" :label="$t('Box No')"></el-table-column>
|
| | | <el-table-column :width="100" prop="state" :label="$t('State')">
|
| | | <el-table-column :min-width="50" prop="cage" :label="$t('Cage No')"></el-table-column>
|
| | | <el-table-column :min-width="50" prop="cell" :label="$t('Slot No')"></el-table-column>
|
| | | <el-table-column :min-width="55" prop="tier" :label="$t('The Side')"></el-table-column>
|
| | | <el-table-column :min-width="145" prop="glassId" :label="$t('Barcode')"></el-table-column>
|
| | | <el-table-column :min-width="100" prop="orderId" :label="$t('Order No')"></el-table-column>
|
| | | <el-table-column :min-width="80" prop="listId" :label="$t('List No')"></el-table-column>
|
| | | <el-table-column :min-width="100" prop="boxId" :label="$t('Box No')"></el-table-column>
|
| | | <el-table-column :min-width="90" prop="state" :label="$t('State')">
|
| | | <template slot-scope='scope'>
|
| | | {{
|
| | | scope.row.state == 1 ? $t('Normal') : scope.row.state == 2 ? $t('Entering') : scope.row.state == 3 ?
|
| | |
| | | }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column :width="150" prop="lengthWidth" :label="$t('Dim')">
|
| | | <el-table-column :min-width="150" prop="lengthWidth" :label="$t('Dim')">
|
| | | <template slot-scope='scope'>
|
| | | {{ scope.row.glassWidthMm }}{{ scope.row.glassWidthMm > 0 ? "*" : "" }}{{ scope.row.glassHeightMm }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column :width="280" :label="$t('Operate')">
|
| | | <el-table-column :min-width="250" :label="$t('Operate')">
|
| | | <template slot-scope='scope'>
|
| | | <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
|
| | | @click="deleteglass(scope.row.glassId, scope.row.state)">{{ $t('Delete') }}</el-button>
|
| | |
| | | </template>
|
| | | </el-dialog>
|
| | |
|
| | | <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Production queue')" top="5vh">
|
| | | <!-- <el-button type="primary" @click="showform7()">{{ $t('Increase') }}</el-button> -->
|
| | | <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Outing Queue')" top="5vh">
|
| | | <el-button type="primary" @click="isAllowQueueState()">{{ this.isAllowQueue == true ? $t('Start') : $t('Stop')
|
| | | }}</el-button>
|
| | |
|
| | | <el-table :data="this.OutSlice" :height="700" :span-method="objectSpanMethod" border
|
| | | style="width: 100%;overflow: auto;">
|
| | | <el-table-column prop="glassId" :label="$t('Barcode')"></el-table-column>
|
| | |
| | | <el-table-column prop="barcode" :label="$t('Frame No')"></el-table-column>
|
| | | <el-table-column :width="280" :label="$t('Operate')">
|
| | | <template slot-scope='scope'>
|
| | | <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)"
|
| | | <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)" style="font-size: 15px;"
|
| | | :disabled="(scope.$index == 0 || isAllowQueue == true || scope.row.state == 1)">
|
| | | 置顶
|
| | | {{$t('Top')}}
|
| | | </el-button>
|
| | | <el-button type="text" size="small" @click="getUpMove(scope.row, scope.$index)"
|
| | | <el-button type="text" size="small" @click="getUpMove(scope.row, scope.$index)" style="font-size: 15px;"
|
| | | :disabled="(scope.$index == 0 || isAllowQueue == true || scope.row.state == 1)">
|
| | | 上移
|
| | | {{$t('Up')}}
|
| | | </el-button>
|
| | | <el-button type="text" size="small" @click="getDownMove(scope.row, scope.$index)"
|
| | | :disabled="(OutSlice.length - 1 == scope.$index || isAllowQueue == true || scope.row.state == 1)">下移
|
| | | <el-button type="text" size="small" @click="getDownMove(scope.row, scope.$index)" style="font-size: 15px;"
|
| | | :disabled="(OutSlice.length - 1 == scope.$index || isAllowQueue == true || scope.row.state == 1)">
|
| | | {{$t('Down')}}
|
| | | </el-button>
|
| | | <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" :disabled="isAllowQueue"
|
| | | @click="deleteproductionqueueglass(scope.row.barcode)">{{ $t('Delete') }}</el-button>
|
| | |
| | | <el-table-column prop="storageCage.cage" :label="$t('Cage No')"></el-table-column>
|
| | | <el-table-column prop="storageCage.cell" :label="$t('Slot No')"></el-table-column>
|
| | | <el-table-column prop="storageCage.tier" :label="$t('The Side')"></el-table-column>
|
| | |
|
| | | <el-table-column prop="FrameNo" :label="$t('Frame No')"></el-table-column>
|
| | |
|
| | | <el-table-column prop="Flip" :label="$t('Flip')"></el-table-column>
|
| | | <el-table-column prop="out_slice.state" :label="$t('In the queue')">
|
| | | <template slot-scope='scope'>
|
| | |
| | | console.log("您的浏览器不支持WebSocket");
|
| | | } else {
|
| | | //console.log("您的浏览器支持WebSocket");
|
| | | let socketUrl = "ws://" + this.$t('ip')+":8888" + "/springboot-vue3/api/talk/" + viewname;
|
| | | let socketUrl = "ws://" + this.$t('ip') + ":8888" + "/springboot-vue3/api/talk/" + viewname;
|
| | | if (socket != null) {
|
| | | socket.close();
|
| | | socket = null;
|
| | |
| | | if (this.isAllowQueue == true) {
|
| | | this.OutSlice = obj.listoutslice[0];
|
| | | }
|
| | | //获取上片位玻璃信息
|
| | | this.loadglassheight = obj.loadglassheight;
|
| | | if (obj.zhuangtai != null) {
|
| | | this.zhuangtai = obj.zhuangtai[0];
|
| | | }
|
| | | // if (this.dialogFormVisible7 == true) {
|
| | | // this.showform7();
|
| | | // } else {
|
| | | // if (obj.FrameNo != null && obj.FrameNo != "") {
|
| | | // this.framebarcode = obj.FrameNo[0];
|
| | | // this.showform7();
|
| | | // this.addoutslice();
|
| | | // }
|
| | | // }
|
| | | //上片位玻璃信息
|
| | | if (obj.form2 != null && obj.form2 != "") {
|
| | | this.form2 = obj.form2[0];
|
| | | } else {
|
| | | this.form2 = {};
|
| | | }
|
| | | |
| | | //是否需要手动确认上片
|
| | | this.isConfirm = obj.isConfirm[0];
|
| | | //扫码位玻璃信息
|
| | | if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 1) {
|
| | | this.form3 = obj.form3[0];
|
| | | } else {
|
| | | this.form3 = {};
|
| | | }
|
| | | this.isConfirm = obj.isConfirm[0];
|
| | | if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) {
|
| | | this.form5 = obj.form3[0];
|
| | | this.showform3();
|
| | | this.Sizerange(this.form5);
|
| | | this.Sizerange(this.form5, 3);
|
| | |
|
| | | } else {
|
| | | this.Sizerange(this.form5);
|
| | | this.Sizerange(this.form5, 3);
|
| | | }
|
| | | //数据库连接是否正常
|
| | | if (obj.dbconnected == "false") {
|
| | | this.text = this.$t('DataBase Connection failed');
|
| | | }
|
| | | //理片笼玻璃信息
|
| | | if (this.dialogFormVisible3 == true) {
|
| | | SelectCageInfo(this.cageglassid).then(res => {
|
| | | this.cageinfo = res.data.cageinfo;
|
| | |
| | | home().then(res => {
|
| | | this.tableData = res.data.list;
|
| | | });
|
| | | SelectCageInfo(1).then(res => {
|
| | | //加载理片笼玻璃信息
|
| | | SelectCageInfo("").then(res => {
|
| | | this.cageinfo = res.data.cageinfo;
|
| | | this.currentPages = 1;
|
| | | });
|
| | |
| | | },
|
| | | //获取扫码位和上片位数据
|
| | | SelectGlassByGlassIDs(parameter) {
|
| | |
|
| | | this.showform3();
|
| | | if (parameter == 1) {
|
| | | SelectGlassByGlassID(this.glassid2).then(res => {
|
| | | if (res.data.form != null) {
|
| | | this.form4 = res.data.form;
|
| | | this.$message.success(this.$t('query was successful'));
|
| | | this.Sizerange(this.form4);
|
| | | if (res.data.form.glassId != null) {
|
| | | this.form4 = res.data.form;
|
| | | this.$message.success(this.$t('query was successful'));
|
| | | this.Sizerange(this.form4, 2);
|
| | | } else {
|
| | | this.$message.error(this.$t('There is no such glass'));
|
| | | }
|
| | |
|
| | | } else {
|
| | | this.$message.error(this.$t('There is no such glass'));
|
| | | }
|
| | | if (this.form4.length > 0) {
|
| | | if (this.form4.glassId == "") {
|
| | | this.disabled = false;
|
| | | } else {
|
| | | this.disabled = true;
|
| | | }
|
| | | }
|
| | |
|
| | | });
|
| | | } else {
|
| | | SelectGlassByGlassID(this.glassid1).then(res => {
|
| | | if (res.data.form != null) {
|
| | | this.form5 = res.data.form;
|
| | | this.$message.success(this.$t('query was successful'));
|
| | | this.Sizerange(this.form5);
|
| | | if (res.data.form.glassId != null) {
|
| | | this.form5 = res.data.form;
|
| | | this.$message.success(this.$t('query was successful'));
|
| | | this.Sizerange(this.form5, 1);
|
| | | } else {
|
| | | this.$message.error(this.$t('There is no such glass'));
|
| | | }
|
| | | } else {
|
| | | this.$message.error(this.$t('There is no such glass'));
|
| | | }
|
| | | if (this.form5.length > 0) {
|
| | | if (this.form5.glassId == "") {
|
| | | this.disabled = false;
|
| | | } else {
|
| | | this.disabled = true;
|
| | | }
|
| | | }
|
| | |
|
| | | });
|
| | | }
|
| | |
|
| | | },
|
| | | //查询客户玻璃信息
|
| | | selectglassinfo() {
|
| | | SelectGlass(this.orderid).then(res => {
|
| | | this.currentPage = 1;
|
| | | this.GlassInfo = res.data.glass;
|
| | | });
|
| | | },
|
| | | //显示客户玻璃信息
|
| | | showform2() {
|
| | | SelectGlass(this.orderid).then(res => {
|
| | | this.GlassInfo = res.data.glass;
|
| | | });
|
| | | this.dialogFormVisible4 = true;
|
| | | },
|
| | | //显示出片队列
|
| | | showform6() {
|
| | | this.dialogFormVisible6 = true;
|
| | | },
|
| | | //显示铝框对应玻璃信息
|
| | | showform7() {
|
| | | //查询铝框id对应玻璃信息
|
| | | SelectAluminumFrameInfoById(this.framebarcode).then(res => {
|
| | |
| | | this.dialogFormVisible1 = false;
|
| | | this.form1 = {};
|
| | | },
|
| | | //取消操作时关闭页面
|
| | | cancel3() {
|
| | | this.dialogFormVisible5 = false;
|
| | | this.form1 = {};
|
| | |
| | | showcageinfo(cage) {
|
| | | cage = this.cageglassid;
|
| | | SelectCageInfo(cage).then(res => {
|
| | |
|
| | | this.cageinfo = res.data.cageinfo;
|
| | | this.currentPages = 1;
|
| | | this.dialogFormVisible3 = true;
|
| | |
| | | message: this.$t('Operation canceled')
|
| | | });
|
| | | });
|
| | | }, handleEdit(index, row) {
|
| | | console.log(index, row);
|
| | | },
|
| | | //表格删除
|
| | | handleDelete(index, row) {
|
| | |
| | | }
|
| | | });
|
| | | },
|
| | | //铝框对应玻璃信息添加铝框id和是否添加到队列
|
| | | CheckBoxchange(glassid, isChecked) {
|
| | | this.AluminumFrame.forEach(item => { item.barcode = glassid; item.isCheck = isChecked })
|
| | | },
|
| | | //添加到出片队列
|
| | | addoutslice() {
|
| | | var dats_ = new Array();
|
| | | this.AluminumFrame.forEach(item => {
|
| | |
| | | this.$message.success(this.$t('Operation successful'));
|
| | | }
|
| | | });
|
| | | }, getTopMove(row, index) {
|
| | | }, |
| | | //置顶
|
| | | getTopMove(row, index) {
|
| | | let Sequence = [];
|
| | | this.OutSlice.forEach(item => {
|
| | | Sequence.push(item.sequence);
|
| | |
| | | }
|
| | | this.UpdateSequence(Sequence);
|
| | | },
|
| | | //修改顺序
|
| | | UpdateSequence(Sequence) {
|
| | | let i = 0;
|
| | | this.OutSlice.forEach(item => {
|
| | |
| | | });
|
| | | }
|
| | | ,
|
| | | arraySpanMethod({ row, column, rowIndex, columnIndex }) {
|
| | | console.log(row, column);
|
| | | if (rowIndex % 2 === 0) {
|
| | | if (columnIndex === 0) {
|
| | | return [1, 2];
|
| | | } else if (columnIndex === 1) {
|
| | | return [0, 0];
|
| | | }
|
| | | }
|
| | | },
|
| | | //合并行
|
| | | objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
| | | // console.log(row, column, "ss");
|
| | |
| | | if (rowIndex != 0) {
|
| | | barcode2 = arrOutSlice[rowIndex - 1].barcode;
|
| | | }
|
| | | if (columnIndex === 9) {
|
| | | if (columnIndex === 10) {
|
| | | if (barcode != barcode2) {
|
| | | // this.FrameNoFlag = barcode;
|
| | | for (let i = rowIndex; i < this.OutSlice.length; i++) {
|
| | |
| | | }
|
| | | },
|
| | | //判断玻璃是否超出范围
|
| | | Sizerange(Glass) {
|
| | | Sizerange(Glass, position) {
|
| | | if ((Glass.glassheight < 380 || Glass.glasswidth < 390 || Glass.glassheight > 1810 || Glass.glasswidth > 2760) || (Glass.glassheight < 390 || Glass.glasswidth < 380 || Glass.glassheight > 2760 || Glass.glasswidth > 1810)) {
|
| | | // if (this.disabled == false) {
|
| | | this.$alert(this.$t('The glass size is not within the range'), this.$t('confirm'), {
|
| | | confirmButtonText: this.$t('Yes'),
|
| | | type: 'info',
|
| | | callback: (action) => {
|
| | | this.$message({
|
| | | type: 'info',
|
| | | message: `action: ${ action }`
|
| | | }).then(
|
| | | this.DeleteBarcodeGlass()
|
| | | );
|
| | | }
|
| | | });
|
| | | if (position == 1 || position == 3) {
|
| | | this.disabled1 = true;
|
| | | } else {
|
| | | this.disabled = true;
|
| | | // this.$message.error(this.$t('The glass size is not within the range'));
|
| | | this.$alert(this.$t('The glass size is not within the range'), this.$t('confirm'), {
|
| | | confirmButtonText: this.$t('Yes'),
|
| | | type:'info',
|
| | | callback: action => {
|
| | | this.$message({
|
| | | type: 'info',
|
| | | action: action
|
| | | }).then(
|
| | | this.DeleteBarcodeGlass()
|
| | | );
|
| | | }
|
| | | });
|
| | | // }
|
| | | // this.$message(this.$t('The glass size is not within the range'), this.$t('confirm'), {
|
| | | // // confirmwidth: 7000,
|
| | | // // height: 8000,
|
| | | // confirmButtonText: this.$t('Yes'),
|
| | | // type: 'info'
|
| | | // }).then(() => {
|
| | | // this.$message.success(this.$t('Operation successful'));
|
| | | // }).catch(() => {
|
| | | // this.$message({
|
| | | // type: 'warning',
|
| | | // message: this.$t('Operation canceled')
|
| | | // });
|
| | | // });
|
| | | // }
|
| | | this.disabled1 = true;
|
| | | } else {
|
| | | this.disabled1 = false;
|
| | | }
|
| | | } else {
|
| | | if (position == 1 || position == 3) {
|
| | | this.disabled1 = false;
|
| | | } else {
|
| | | this.disabled = false;
|
| | | }
|
| | | if (position == 3&&this.isConfirmState==true) {
|
| | | this.InsertQueueGlass(1);
|
| | | }
|
| | | }
|
| | | },
|
| | | //清空待确认玻璃信息
|
| | | DeleteBarcodeGlass() {
|
| | | this.form5 = {};
|
| | | }
|
| | | },
|
| | | DeleteBarcodeGlass(){
|
| | | this.form5={};
|
| | | }
|
| | | }
|
| | | }
|
| | | </script> |
| | |
| | | // 添加权限的验证规则 |
| | | powerRules: { |
| | | roleId: [ |
| | | {required: true, message: '请输入角色', trigger: 'blur'} |
| | | {required: true, message: this.$t('请输入角色'), trigger: 'blur'} |
| | | ], |
| | | permissionId: [ |
| | | {required: true, message: '请输入权限描述', trigger: 'blur'}, |
| | | {required: true, message: this.$t('请输入权限描述'), trigger: 'blur'}, |
| | | ] |
| | | }, |
| | | options: [ |
| | | {label: '生效', value: 1}, |
| | | {label: '无效', value: 0} |
| | | {label: this.$t('生效'), value: 1}, |
| | | {label: this.$t('无效'), value: 0} |
| | | ], |
| | | roleList: [], |
| | | permissionList: [] |
| | |
| | | <el-form label-width="130px"> |
| | | <el-form-item :label="$t('langPermissions')" prop="permissionList"> |
| | | <el-checkbox-group v-model="selectedPermissions"> |
| | | <el-checkbox |
| | | v-for="(permission, index) in permissionList" |
| | | :key="index" |
| | | :label="permission.name" |
| | | :checked="permission.state === 1" |
| | | @change="updatePermissionState(permission.name, $event)" |
| | | >{{ permission.name }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | <el-checkbox |
| | | v-for="(permission, index) in permissionList" |
| | | :key="index" |
| | | :label="permission.name" |
| | | @change="updatePermissionState(permission.name, $event)" |
| | | >{{ permission.name }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | // 添加角色的验证规则 |
| | | addRoleRules: { |
| | | name: [ |
| | | {required: true, message: '请输入名称', trigger: 'blur'}, |
| | | {min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur'} |
| | | {required: true, message: this.$t('请输入名称'), trigger: 'blur'}, |
| | | {min: 2, max: 15, message: this.$t('长度在 2 到 15 个字符'), trigger: 'blur'} |
| | | ], |
| | | state: [ |
| | | {required: true, message: '请输入状态', trigger: 'blur'} |
| | | {required: true, message: this.$t('请输入状态'), trigger: 'blur'} |
| | | ] |
| | | }, |
| | | options: [ |
| | | {label: '有效', value: 1}, |
| | | {label: '无效', value: 0} |
| | | {label: this.$t('有效'), value: 1}, |
| | | {label: this.$t('无效'), value: 0} |
| | | ] |
| | | } |
| | | }, |
| | |
| | | }, |
| | | |
| | | |
| | | showPermissionDialog(role) { |
| | | this.selectedPermissions=[]; |
| | | this.permissionList=[]; |
| | | |
| | | getById2({ roleId: role.id }).then((res) => { |
| | | this.permissionList = res.data.permissionList; |
| | | |
| | | // 在 showPermissionDialog 方法中,只将选中的权限名称添加到 selectedPermissions 数组中 |
| | | showPermissionDialog(role) { |
| | | this.selectedPermissions = []; |
| | | this.permissionList = []; |
| | | |
| | | getById2({ roleId: role.id }).then((res) => { |
| | | this.permissionList = res.data.permissionList; |
| | | // 只有状态为 1 的权限名称会被添加到 selectedPermissions 数组中 |
| | | this.selectedPermissions = this.permissionList |
| | | .filter(permission => permission.state === 1) |
| | | .map(permission => permission.name); |
| | | this.permissionDialogVisible = true; |
| | | }); |
| | | }, |
| | | |
| | | this.selectedPermissions = this.permissionList.map(({ name, state }) => ({ |
| | | name, |
| | | state: state === 1, |
| | | })); |
| | | console.log(this.selectedPermissions); |
| | | this.permissionDialogVisible = true; |
| | | }); |
| | | }, |
| | | // 在 updatePermissionState 方法中,根据复选框的勾选状态更新 selectedPermissions 数组 |
| | | // updatePermissionState(name, isChecked) { |
| | | // if (isChecked) { |
| | | // // 如果复选框被勾选,将权限名称添加到数组中 |
| | | // if (!this.selectedPermissions.includes(name)) { |
| | | // this.selectedPermissions.push(name); |
| | | // } |
| | | // } else { |
| | | // // 如果复选框被取消勾选,将权限名称从数组中移除 |
| | | // const index = this.selectedPermissions.indexOf(name); |
| | | // if (index !== -1) { |
| | | // this.selectedPermissions.splice(index, 1); |
| | | // } |
| | | // } |
| | | // }, |
| | | |
| | | // 取消编辑权限弹出框 |
| | | cancelEditPermissions() { |
| | | this.permissionDialogVisible = false; |
| | |
| | | if (permission) { |
| | | permission.state = isChecked ? 1 : 0; |
| | | } |
| | | |
| | | }, |
| | | |
| | | |
| | |
| | | // 成功更新权限后执行的操作 |
| | | const 更新状态成功 = this.$t('更新状态成功'); |
| | | this.$message.success(更新状态成功); |
| | | this.permissionDialogVisible = false; |
| | | }); |
| | | }, |
| | | // 展示添加角色的对话框 |
| | |
| | | |
| | | |
| | | <script> |
| | | import { getById, removeById, saveOrUpdate, selectPage, resetPass } from "../../api/user"; |
| | | import { getById, removeById, saveOrUpdate, selectPage, resetPass,currentUsername } from "../../api/user"; |
| | | import { select } from "../../api/role"; |
| | | |
| | | import LanguageMixin from '../../lang/LanguageMixin' |
| | |
| | | }, |
| | | created () { |
| | | this.getUserList(); |
| | | this.getyonghu(); |
| | | |
| | | }, |
| | | methods: { |
| | | getUserList () { |
| | |
| | | const successMessage = this.$t('updateSuccessMessage'); |
| | | this.$message.success(successMessage); |
| | | }); |
| | | |
| | | }, |
| | | resetPassword (info) { |
| | | this.$confirm(this.$t('confirmResetPassword'), this.$t('resetPassword'), { |
| | |
| | | this.roleList = res.data; |
| | | }); |
| | | }, |
| | | |
| | | getyonghu () { |
| | | currentUsername().then(res => { |
| | | console.log(res) |
| | | }); |
| | | |
| | | |
| | | }, |
| | | removeUserById (user) { |
| | | // 弹框询问用户是否删除分类 |
| | | this.$confirm(this.$t('confirmDeleteCategory'), this.$t('prompt'), { |
New file |
| | |
| | | package com.example.springboot.component;
|
| | |
|
| | | import java.io.FileNotFoundException;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.util.Properties;
|
| | |
|
| | | // Configuration 类用于加载配置文件并提供访问配置项的方法。
|
| | | public class Configuration {
|
| | | private Properties properties; // Properties 对象,用于存储配置文件中的键值对。
|
| | |
|
| | | // 构造函数,根据传入的文件名加载配置文件。
|
| | | public Configuration(String fileName) throws IOException {
|
| | | // 使用类加载器获取资源文件的输入流。
|
| | | InputStream inputStream = getClass().getClassLoader().getResourceAsStream(fileName);
|
| | | // 如果输入流为null,表示未找到文件,抛出FileNotFoundException。
|
| | | if (inputStream == null) {
|
| | | throw new FileNotFoundException("Property file '" + fileName + "' not found in the classpath");
|
| | | }
|
| | | properties = new Properties(); // 实例化Properties对象。
|
| | | properties.load(inputStream); // 从输入流加载配置项。
|
| | | }
|
| | |
|
| | | // 根据配置项的键获取其对应的值。
|
| | | public String getProperty(String key) {
|
| | | return properties.getProperty(key);
|
| | | }
|
| | | }
|
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Base64; |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.javassist.compiler.ast.Symbol; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import com.example.springboot.service.JdbcConnections; |
| | | import com.example.springboot.service.SpianService; |
| | | import com.example.springboot.entity.Glass; |
| | | import com.example.springboot.entity.north_glass_buffer1; |
| | | import com.example.springboot.mapper.AlarmMapper; |
| | | import com.example.springboot.mapper.SpianMapper; |
| | |
| | | private JdbcConnections jdbcConnections; |
| | | private SpianMapper spianMapper; |
| | | private SpianService spianService; |
| | | |
| | | |
| | | @Override |
| | | public void run() { |
| | | boolean inglassbegin = false; |
| | |
| | | outglassbegin = false; |
| | | } |
| | | |
| | | if (outstate == true & glass.getbarcode() != null) { // 当出片车空闲且有出片任务待完成时 |
| | | if (outstate == true & glass.getbarcode() != null&&Plchome.isAllowQueue==true) { // 当出片车空闲且有出片任务待完成时 |
| | | // 判断有两个出片或调拨任务时并且出片id和未完成的出片任务id不一样时执行出片 |
| | | if (!writedstrIdOut.toString().equals(glass.getbarcode().toString())) { |
| | | spianService.selectout2(glass.getbarcode().toString()); |
| | |
| | | // 判断当前是否有未执行的任务 |
| | | int outnum = spianMapper.SelectOutSliceshu(); |
| | | // 当没有任务执行并且出片车空闲时 |
| | | if (outnum == 0 && outstate == true) { |
| | | if (outnum == 0 && outstate == true&&Plchome.isAllowQueue==true) { |
| | | // 判断铝框出片队列表是否有待出片的玻璃 |
| | | String outglassid = spianMapper.SelectOutSlice(); |
| | | if (outglassid != null) { |
| | |
| | | addresses.add("DB100.38"); |
| | | addresses.add("DB100.40"); |
| | | List<Short> arraylist = S7control.getinstance().readWords(addresses); |
| | | |
| | | //翻转 |
| | | List<Short> fanzhuan1 = S7control.getinstance().ReadWord("DB100.8", 1); |
| | | List<Short> xiaoche1 = S7control.getinstance().ReadWord("DB100.12", 1); |
| | | // Short[] values1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; |
| | |
| | | addressList0.add("DB101.10.2"); |
| | | addressList0.add("DB101.10.3"); |
| | | |
| | | |
| | | // 扫码枪 |
| | | List<Boolean> data2 = S7control.getinstance().readBits(addressList0); |
| | | List<String> addressList3 = new ArrayList<>(); |
| | | addressList3.add("DB103.256"); |
| | | addressList3.add("DB103.270"); |
| | | List<String> data3 = S7control.getinstance().readStrings(addressList3); |
| | | |
| | | // A01 A02 B01 B02 |
| | | List<String> addresses4 = new ArrayList<>(); |
| | | addresses4.add("DB103.52"); |
| | | addresses4.add("DB103.54"); |
| | |
| | | |
| | | // String[] values6 = { ".x1 ","x2 ","x3",";;x4","x5","x6","x7","x8","x9","x10","x11"}; |
| | | // List<String> paramlist = new ArrayList<>(Arrays.asList(values6)); |
| | | // Short[] values1 = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; |
| | | // Short[] values1 = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}; |
| | | // List<Short> data = new ArrayList<>(Arrays.asList(values1)); |
| | | // Boolean[] value4 = { true, true, true, true, true, true, true, true, true, |
| | | // true}; |
| | | // Boolean[] value4 = { false, false, false, false, false, false, false, false, false, |
| | | // false}; |
| | | // List<Boolean> data2 = new ArrayList<>(Arrays.asList(value4)); |
| | | // String[] values3 = { ".x11 ","x21 "}; |
| | | // List<String> data3 = new ArrayList<>(Arrays.asList(values3)); |
| | |
| | | } |
| | | |
| | | // 将布尔列表写入 PLC |
| | | // S7control.getinstance().WriteBit(addressList, messageBooleans); |
| | | S7control.getinstance().WriteBit(addressList, messageBooleans); |
| | | System.out.println("messageValues:" + messageBooleans); |
| | | System.out.println("addressList:" + addressList); |
| | | // 清空消息列表 |
| | |
| | | import java.util.List; |
| | | |
| | | public class PlcServoManualone extends Thread { |
| | | String name = ""; |
| | | Integer count = 0; |
| | | |
| | | public static String readFileToString(String filePath) throws IOException { |
| | | File file = new File(filePath); |
| | | return FileUtils.readFileToString(file, "UTF-8"); |
| | | |
| | | |
| | | private Configuration config; |
| | | |
| | | public PlcServoManualone() throws IOException { |
| | | config = new Configuration("config.properties"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // public void insertDataToList(List<Short> list, String rangeAddress, int insertIndex) { |
| | | // if (list.size() >= insertIndex + 14) { |
| | | // List<Short> rangeData = new ArrayList<>(); |
| | | // byte[] byteData = S7control.getinstance().ReadByte(rangeAddress, 14); |
| | | // if (byteData != null && byteData.length >= 13) { |
| | | // for (byte b : byteData) { |
| | | // rangeData.add((short) b); |
| | | // } |
| | | // } else { |
| | | // // 读取数据失败,添加默认值 |
| | | // for (int i = 0; i < 14; i++) { |
| | | // rangeData.add((short) -1); |
| | | // } |
| | | // } |
| | | // |
| | | // list.addAll(insertIndex, rangeData); |
| | | // }else{ |
| | | // List<Short> rangeData = new ArrayList<>(); |
| | | // rangeData.add((short) 0); |
| | | // list.addAll(insertIndex, rangeData); |
| | | // } |
| | | // } |
| | | |
| | | //读取id |
| | | public StringBuilder queGlassid(String address,int count) { |
| | | StringBuilder writedstrIdOut = new StringBuilder(); |
| | | byte[] writedglassidbytesOut = S7control.getinstance().ReadByte(address, count); |
| | |
| | | } |
| | | return writedstrIdOut; |
| | | } |
| | | |
| | | //写入id |
| | | public void outmesid(String glassid,String address) { |
| | | //System.out.println("outmesid:" + glassid); |
| | | List<Byte> glassidlist = new ArrayList(); |
| | |
| | | } |
| | | byte[] bytes = Bytes.toArray(glassidlist); |
| | | System.out.println("outmesidbytes:" + bytes.length); |
| | | S7control.getinstance().WriteByte(address, bytes);// 派发出片id |
| | | S7control.getinstance().WriteByte(address, bytes); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | //A01组合中地址表集合 |
| | | List<String> addresses = new ArrayList<>(); |
| | | addresses.add("DB103.32"); |
| | | addresses.add("DB100.144"); |
| | | addresses.add("DB100.184"); |
| | | addresses.add("DB100.186"); |
| | | addresses.add("DB100.180"); |
| | | addresses.add("DB100.182"); |
| | | List<String> addresses = Arrays.asList(config.getProperty("A01.addresses").split(",")); |
| | | //System.out.println(addresses); |
| | | |
| | | List<Short> arraylist = S7control.getinstance().readWords(addresses); |
| | | |
| | | // String rangeAddress = "DB100.148-161"; |
| | | // String rangeAddress = "DB100.148"; |
| | | // int insertIndex = 2; |
| | | // insertDataToList(arraylist, rangeAddress, insertIndex); |
| | | |
| | | //A02组合中地址表集合 |
| | | List<String> addresses2 = new ArrayList<>(); |
| | | addresses2.add("DB103.26"); |
| | | addresses2.add("DB100.188"); |
| | | addresses2.add("DB100.190"); |
| | | addresses2.add("DB100.146"); |
| | | // addresses2.add("DB100.162-175"); |
| | | List<String> addresses2 = Arrays.asList(config.getProperty("A02.addresses").split(",")); |
| | | List<Short> arraylist2 = S7control.getinstance().readWords(addresses2); |
| | | // String rangeAddress2 = "DB100.148-161"; |
| | | // String rangeAddress2 = "DB100.162"; |
| | | // int insertIndex2 = 4; |
| | | // insertDataToList(arraylist2, rangeAddress2, insertIndex2); |
| | | // System.out.println(arraylist2); |
| | | |
| | | //A01翻转地址 |
| | | List<String> addresses3 = new ArrayList<>(); |
| | | addresses3.add("DB103.42"); |
| | | List<String> addresses3 = Arrays.asList(config.getProperty("A01.flipAddress")); |
| | | List<Short> arraylist3 = S7control.getinstance().readWords(addresses3); |
| | | |
| | | |
| | | //A02翻转地址 |
| | | List<String> addresses4 = new ArrayList<>(); |
| | | addresses4.add("DB103.46"); |
| | | List<String> addresses4 = Arrays.asList(config.getProperty("A02.flipAddress")); |
| | | |
| | | List<Short> arraylist4 = S7control.getinstance().readWords(addresses4); |
| | | //B01组合中地址 |
| | | List<Short> arraylist5 = S7control.getinstance().ReadWord("DB103.27", 2); |
| | | String b01Address = config.getProperty("B01.address"); |
| | | List<Short> arraylist5 = S7control.getinstance().ReadWord(b01Address, 2); |
| | | //B02组合地址 |
| | | List<Short> arraylist6 = S7control.getinstance().ReadWord("DB103.29", 2); |
| | | |
| | | String b02Address = config.getProperty("B02.address"); |
| | | List<Short> arraylist6 = S7control.getinstance().ReadWord(b02Address, 2); |
| | | System.out.println(b02Address); |
| | | // 所有故障按钮地址 |
| | | List<String> addresses7 = new ArrayList<>(); |
| | | addresses7.add("DB104.1.4"); |
| | | addresses7.add("DB104.1.5"); |
| | | addresses7.add("DB104.1.2"); |
| | | addresses7.add("DB104.1.3"); |
| | | addresses7.add("DB104.1.6"); |
| | | addresses7.add("DB104.1.7"); |
| | | List<String> addresses7 = Arrays.asList(config.getProperty("faultButtonAddresses").split(",")); |
| | | List<Boolean> arraylist7 = S7control.getinstance().readBits(addresses7); |
| | | // 进片id地址 |
| | | String inputGlassIdAddress = config.getProperty("inputGlassIdAddress"); |
| | | String outputGlassIdAddress = config.getProperty("outputGlassIdAddress"); |
| | | StringBuilder queueid1 = queGlassid(inputGlassIdAddress, 14); |
| | | // 存片id地址 |
| | | StringBuilder queueid2 = queGlassid(outputGlassIdAddress, 14); |
| | | //A01启动地址 |
| | | List<String> A01start = Arrays.asList(config.getProperty("A01start")); |
| | | //A02启动地址 |
| | | List<String> A02start = Arrays.asList(config.getProperty("A02start")); |
| | | //A01半自动地址 |
| | | List<String> A01Bstart = Arrays.asList(config.getProperty("A01Bstart")); |
| | | //A02半自动地址 |
| | | List<String> A02Bstart = Arrays.asList(config.getProperty("A02Bstart")); |
| | | //回零按钮地址 |
| | | List<String> waddresses4 = Arrays.asList(config.getProperty("HomedButtonAddresses").split(",")); |
| | | // 所有复位按钮地址 |
| | | List<String> Reset = Arrays.asList(config.getProperty("resetButtonAddresses")); |
| | | // 所有未回零按钮地址 |
| | | List<String> addresses8 = Arrays.asList(config.getProperty("notHomedButtonAddresses")); |
| | | |
| | | // 所有故障按钮转换为1和0 |
| | | short[] params2 = new short[arraylist7.size()]; |
| | |
| | | } |
| | | |
| | | |
| | | // 所有复位按钮地址 |
| | | List<String> Reset = new ArrayList<>(); |
| | | Reset.add("DB101.4.0"); |
| | | Reset.add("DB101.4.3"); |
| | | Reset.add("DB101.3.6"); |
| | | Reset.add("DB101.4.1"); |
| | | Reset.add("DB101.4.4"); |
| | | Reset.add("DB101.4.6"); |
| | | List<Boolean> Reset1 = S7control.getinstance().readBits(Reset); |
| | | |
| | | // 所有故障按钮转换为1和0 |
| | |
| | | rReset[i] = value ? (short) 1 : (short) 0; |
| | | } |
| | | |
| | | // 所有未回零按钮地址 |
| | | List<String> addresses8 = new ArrayList<>(); |
| | | addresses8.add("DB104.9.0"); |
| | | addresses8.add("DB104.9.1"); |
| | | addresses8.add("DB104.9.0"); |
| | | addresses8.add("DB104.9.1"); |
| | | addresses8.add("DB104.9.4"); |
| | | addresses8.add("DB104.9.5"); |
| | | |
| | | |
| | | List<Boolean> arraylist8 = S7control.getinstance().readBits(addresses8); |
| | | short[] params = new short[arraylist8.size()]; |
| | | for (int i = 0; i < arraylist8.size(); i++) { |
| | |
| | | params[i] = value ? (short) 1 : (short) 0; |
| | | } |
| | | |
| | | // 进片id地址 |
| | | StringBuilder queueid1 = queGlassid("DB100.148", 14); |
| | | // 存片id地址 |
| | | StringBuilder queueid2 = queGlassid("DB100.162", 14); |
| | | |
| | | |
| | | |
| | | |
| | |
| | | WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("ServoManualone"); |
| | | if (webSocketServer != null) { |
| | | List<String> messages = webSocketServer.getMessages(); |
| | | // A01组合地址 |
| | | List<String> waddresses1 = new ArrayList<>(); |
| | | waddresses1.add("DB103.32"); |
| | | waddresses1.add("DB100.144"); |
| | | // waddresses1.add("DB100.148-161"); |
| | | waddresses1.add("DB100.184"); |
| | | waddresses1.add("DB100.186"); |
| | | waddresses1.add("DB100.180"); |
| | | waddresses1.add("DB100.182"); |
| | | |
| | | // A02组合地址 |
| | | List<String> waddresses2 = new ArrayList<>(); |
| | | waddresses2.add("DB103.26"); |
| | | waddresses2.add("DB100.188"); |
| | | waddresses2.add("DB100.190"); |
| | | waddresses2.add("DB100.146"); |
| | | // waddresses2.add("DB100.162-175"); |
| | | |
| | | |
| | | // 复位按钮地址 |
| | | List<String> waddresses3 = new ArrayList<>(); |
| | | waddresses3.add("DB101.4.0"); |
| | | waddresses3.add("DB101.4.3"); |
| | | waddresses3.add("DB101.3.6"); |
| | | waddresses3.add("DB101.4.1"); |
| | | waddresses3.add("DB101.4.4"); |
| | | waddresses3.add("DB101.4.6"); |
| | | |
| | | //回零按钮地址 |
| | | List<String> waddresses4 = new ArrayList<>(); |
| | | waddresses4.add("DB101.3.7"); |
| | | waddresses4.add("DB101.4.2"); |
| | | waddresses4.add("DB101.4.5"); |
| | | waddresses4.add("DB101.4.7"); |
| | | |
| | | |
| | | String waddresses5="DB100.148"; |
| | | String waddresses6="DB100.162"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | String lastMessage = messages.get(messages.size() - 1); |
| | | // System.out.println("lastMessage:" + lastMessage); |
| | | JSONArray messageArray = new JSONArray(lastMessage); |
| | | |
| | | |
| | | |
| | | |
| | | // 写入AO1组合 |
| | |
| | | } |
| | | if (!sValue.isEmpty()) { |
| | | |
| | | |
| | | |
| | | S7control.getinstance().WriteWord(waddresses1, sValue); |
| | | List<String> A01start = new ArrayList<>(); |
| | | A01start.add("DB101.5.0"); |
| | | S7control.getinstance().WriteWord(addresses, sValue); |
| | | Boolean[] a01values7 = { true}; |
| | | List<Boolean> a01startval = new ArrayList<>(Arrays.asList(a01values7)); |
| | | S7control.getinstance().WriteBit(A01start, a01startval); |
| | | System.out.println("Values " + sValue + " written to PLC at address " + waddresses1); |
| | | System.out.println("Values " + sValue + " written to PLC at address " + addresses); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | if (!sValue2.isEmpty()) { |
| | | S7control.getinstance().WriteWord(waddresses2, sValue2); |
| | | List<String> A02start = new ArrayList<>(); |
| | | A02start.add("DB101.5.1"); |
| | | S7control.getinstance().WriteWord(addresses2, sValue2); |
| | | |
| | | Boolean[] a02values7 = {true}; |
| | | List<Boolean> a02startval = new ArrayList<>(Arrays.asList(a02values7)); |
| | | S7control.getinstance().WriteBit(A02start, a02startval); |
| | | System.out.println("Values " + sValue2 + " written to PLC at address " + waddresses2); |
| | | System.out.println("Values " + sValue2 + " written to PLC at address " + addresses2); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | if (!sValue3.isEmpty()) { |
| | | S7control.getinstance().WriteBit(waddresses3, sValue3); |
| | | System.out.println("Values " + sValue3 + " written to PLC at address " + waddresses3); |
| | | S7control.getinstance().WriteBit(Reset, sValue3); |
| | | System.out.println("Values " + sValue3 + " written to PLC at address " + Reset); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | //进片ID写入 |
| | | if (messageArray.getJSONArray(4).size() > 0) { |
| | | // JSONArray jsonArray5 = messageArray.getJSONArray(4); |
| | |
| | | if (!jsonArray5.isEmpty()) { |
| | | // String value = (String) jsonArray5.get(0); |
| | | jsonArray5 = jsonArray5.replaceAll("[\\[\\]\"]", ""); // 去除方括号和双引号 |
| | | outmesid( jsonArray5,waddresses5); |
| | | System.out.println("Values " + jsonArray5 + " written to PLC at address " + waddresses5); |
| | | outmesid( jsonArray5,inputGlassIdAddress); |
| | | System.out.println("Values " + jsonArray5 + " written to PLC at address " + inputGlassIdAddress); |
| | | } |
| | | } |
| | | // 存片ID写入 |
| | |
| | | |
| | | if (!jsonArray6.isEmpty()) { |
| | | String value2 = (String) jsonArray6.get(0); |
| | | outmesid( value2,waddresses6); |
| | | System.out.println("Values " + value2 + " written to PLC at address " + waddresses6); |
| | | outmesid( value2,outputGlassIdAddress); |
| | | System.out.println("Values " + value2 + " written to PLC at address " + outputGlassIdAddress); |
| | | } |
| | | } |
| | | if (messageArray.getJSONArray(6).size() > 0) { |
| | |
| | | } |
| | | if (!sValueb4.isEmpty()) { |
| | | |
| | | List<String> A01Bstart = new ArrayList<>(); |
| | | A01Bstart.add("DB101.11.0"); |
| | | // Boolean[] a01values7 = {true}; |
| | | // List<Boolean> a01Bstartval = new ArrayList<>(Arrays.asList(a01values7)); |
| | | S7control.getinstance().WriteBit(A01Bstart, sValueb4); |
| | | System.out.println("Values " + sValueb4 + " written to PLC at address " + A01Bstart); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if (messageArray.getJSONArray(7).size() > 0) { |
| | |
| | | } |
| | | if (!sValueb5.isEmpty()) { |
| | | |
| | | List<String> A02Bstart = new ArrayList<>(); |
| | | A02Bstart.add("DB101.11.1"); |
| | | // Boolean[] a01values7 = {true}; |
| | | // List<Boolean> a01Bstartval = new ArrayList<>(Arrays.asList(a01values7)); |
| | | S7control.getinstance().WriteBit(A02Bstart, sValueb5); |
| | | System.out.println("Values " + sValueb5 + " written to PLC at address " + A02Bstart); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // if (messageArray.getJSONArray(6).size() > 0) { |
| | | // JSONArray jsonArray6 = messageArray.getJSONArray(6); |
| | | // |
| | | // if (!jsonArray6.isEmpty()) { |
| | | // String value2 = (String) jsonArray6.get(0); |
| | | // List<String> A01Bstart = new ArrayList<>(); |
| | | // A01Bstart.add("DB101.11.0"); |
| | | // Boolean[] a01values7 = {true}; |
| | | // List<Boolean> a01Bstartval = new ArrayList<>(Arrays.asList(a01values7)); |
| | | // S7control.getinstance().WriteBit(A01Bstart, a01Bstartval); |
| | | // System.out.println("Values " + value2 + " written to PLC at address " + waddresses6); |
| | | // } |
| | | // } |
| | | |
| | | // if (messageArray.getJSONArray(7).size() > 0) { |
| | | // JSONArray jsonArray6 = messageArray.getJSONArray(7); |
| | | // |
| | | // if (!jsonArray6.isEmpty()) { |
| | | // String value2 = (String) jsonArray6.get(0); |
| | | // List<String> A02Bstart = new ArrayList<>(); |
| | | // A02Bstart.add("DB101.11.1"); |
| | | // Boolean[] a02values7 = {true}; |
| | | // List<Boolean> a02Bstartval = new ArrayList<>(Arrays.asList(a02values7)); |
| | | // S7control.getinstance().WriteBit(A02Bstart, a02Bstartval); |
| | | // System.out.println("Values " + value2 + " written to PLC at address " + waddresses6); |
| | | // } |
| | | // } |
| | | |
| | | // 清空消息列表 |
| | | webSocketServer.clearMessages(); |
| | |
| | | // 铝框id |
| | | public static String FrameNo; |
| | | // 是否需要手动确认玻璃 |
| | | public static Boolean isConfirm = true; |
| | | public static Boolean isConfirm = false; |
| | | |
| | | // public static Map b=new HashMap<>(); |
| | | // b.put() |
| | |
| | | // 获取进是否有待确认的玻璃id |
| | | String queid = spianMapper.Selectqueueid(); |
| | | int state = spianMapper.Selectqueuestate(); |
| | | jsonObject.append("queid", queid); |
| | | jsonObject.append("state", queid); |
| | | jsonObject.append("state", state); |
| | | // 获取扫码位与上片位玻璃信息 |
| | | Queue form2 = homeMapper.GetQueueInfo(2); |
| | |
| | | package com.example.springboot.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.example.springboot.component.*; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.example.springboot.component.PLCAutomaticParameterSetting; |
| | | import com.example.springboot.component.PlcHold; |
| | | import com.example.springboot.component.PlcParameter; |
| | | import com.example.springboot.component.Plcaction; |
| | | import com.example.springboot.component.Plchome; |
| | | import com.example.springboot.component.Plcalarm; |
| | | import com.example.springboot.component.Plcsign; |
| | | import com.example.springboot.component.Plcstate; |
| | | import com.example.springboot.component.PlcPositioning1; |
| | | import com.example.springboot.component.PlcPositioning2; |
| | | import com.example.springboot.component.PlcParameter2; |
| | | import com.example.springboot.component.PlcParameter1; |
| | | import com.example.springboot.component.PlcServoManualone; |
| | | import com.example.springboot.component.PLCAutomaticParameterSetting; |
| | | import com.example.springboot.component.PlcManualonePosition; |
| | | import com.example.springboot.component.PlcManualonePosition2; |
| | | import com.example.springboot.component.PLCManualJog; |
| | | |
| | | @Component |
| | | @Order(1) |
| | |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | new PlcHold().start(); |
| | | // |
| | | new PlcHold().start(); |
| | | // |
| | | // |
| | | |
| | | new Plchome().start(); |
| | | // // |
| | | new PlcParameter().start(); |
| | | // |
| | | // new Plcalarm().start(); |
| | | // |
| | | new Plcsign().start(); |
| | | // |
| | | new Plcaction().start(); |
| | | new Plcstate().start(); |
| | | new PlcPositioning1().start(); |
| | | new PlcPositioning2().start(); |
| | | new PlcParameter2().start(); |
| | | new PlcParameter1().start(); |
| | | new PLCAutomaticParameterSetting().start(); |
| | | |
| | | // new PlcParameter().start(); |
| | | // // |
| | | // // new Plcalarm().start(); |
| | | // // |
| | | // new Plcsign().start(); |
| | | // // |
| | | // new Plcaction().start(); |
| | | // new Plcstate().start(); |
| | | // new PlcPositioning1().start(); |
| | | // new PlcPositioning2().start(); |
| | | // new PlcParameter2().start(); |
| | | // new PlcParameter1().start(); |
| | | // new PLCAutomaticParameterSetting().start(); |
| | | |
| | | new PlcManualonePosition().start(); |
| | | new PlcManualonePosition2().start(); |
| | | new PlcServoManualone().start(); |
| | | new PLCManualJog().start(); |
| | | // new PlcManualonePosition().start(); |
| | | // new PlcManualonePosition2().start(); |
| | | // new PlcServoManualone().start(); |
| | | // new PLCManualJog().start(); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | @GetMapping("/getByRoleId") |
| | | |
| | | public com.example.springboot.common.Result selectquanxian(@RequestParam("roleId") int roleId) { |
| | | List<Map<String, Object>> resultSet = RolePermissionMapper.selectquanxian(roleId); |
| | | |
| | |
| | | @GetMapping("/all2") |
| | | public void selectdd(String orderid){ |
| | | SpianService service=new SpianService(); |
| | | service.selectout(orderid); |
| | | service.selectout2(orderid); |
| | | |
| | | } |
| | | |
| | |
| | | private class UpdatePasswordRequest { |
| | | } |
| | | |
| | | @ApiOperation(value = "获取当前登录用户的用户名") |
| | | @GetMapping("/currentUsername") |
| | | @RequiresAuthentication // 确保只有认证过的用户可以访问此接口 |
| | | public Result getCurrentUsername() { |
| | | User currentUser = SecurityUtil.getCurrentUser(); |
| | | if (currentUser != null) { |
| | | // 假设User类有getUsername方法可以获取用户名 |
| | | String username = currentUser.getUsername(); |
| | | return Result.success(username); |
| | | } else { |
| | | return Result.fail("用户未登录或会话已过期"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | //小车信息表 |
| | | public class CarPosition { |
| | | public int carid; |
| | | public int start; |
| | | public int end; |
| | | public int carid;//小车id |
| | | public int start;//小车起始位置 |
| | | public int end;//小车终点位置 |
| | | |
| | | public void setcarId(Integer carid) { |
| | | this.carid = carid; |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | //玻璃信息表 |
| | | public class Glass { |
| | | private Integer id; |
| | | private Integer id;//自增id |
| | | private String orderId;//订单id |
| | | private double width;//宽度 |
| | | private double height;//高度 |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | import java.sql.Date; |
| | | |
| | | //按订单出片表 |
| | | public class OrderOut { |
| | | private Integer id; |
| | | private Integer id;//自增id |
| | | private String orderid;//订单id |
| | | private Integer state;//状态 |
| | | private Date modtime; |
| | | private Date modtime;//修改时间 |
| | | |
| | | public Integer id() { |
| | | return id; |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | //出片队列表 |
| | | public class Out_slice { |
| | | private int id; |
| | | private String glassId; |
| | | private String barcode; |
| | | private double glasswidth; |
| | | private double glassheight; |
| | | private int state; |
| | | private String time; |
| | | private int sequence; |
| | | private String position; |
| | | private int id;//自增id |
| | | private String glassId;//玻璃id |
| | | private String barcode;//铝框id |
| | | private double glasswidth;//玻璃宽 |
| | | private double glassheight;//玻璃高 |
| | | private int state;//出片状态 |
| | | private int flip;//是否翻转 |
| | | private String time;//修改时间 |
| | | private int sequence;//出片顺序 |
| | | private String position;//玻璃摆放位置 |
| | | |
| | | public String getPosition() { |
| | | return position; |
| | |
| | | this.time = time; |
| | | } |
| | | |
| | | public int getFlip() { |
| | | return flip; |
| | | } |
| | | |
| | | public void setFlip(int flip) { |
| | | this.flip = flip; |
| | | } |
| | | |
| | | public int getID() { |
| | | return id; |
| | | } |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | //上片队列表 |
| | | public class Queue { |
| | | private int id; |
| | | private String glassId; |
| | | private String orderId; |
| | | private String listId; |
| | | private String boxId; |
| | | private double glasswidth; |
| | | private double glassheight; |
| | | private double glasswidthmm; |
| | | private double glassheightmm; |
| | | private int type; |
| | | private int state; |
| | | private String time; |
| | | private int id;//自增id |
| | | private String glassId;//玻璃id |
| | | private String orderId;//订单id |
| | | private String listId;//列表id |
| | | private String boxId;//箱子id |
| | | private double glasswidth;//玻璃宽 |
| | | private double glassheight;//玻璃高 |
| | | private double glasswidthmm;//玻璃宽英制 |
| | | private double glassheightmm;//玻璃高英制 |
| | | private int type;//类型 |
| | | private int state;//状态 |
| | | private String time;//修改时间 |
| | | |
| | | public int getid() { |
| | | return id; |
| | |
| | | private Long permissionId; |
| | | @ApiModelProperty("状态") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("名字") |
| | | private String name; |
| | | |
| | | |
| | | |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | //理片笼表 |
| | | public class StorageCage { |
| | | private Integer id; //自序id |
| | | private Integer prcId;//plcid |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | //出片任务表 |
| | | public class StorageTask{ |
| | | private Integer id;//自序 |
| | | private String taskType;//类型 |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | //报警信息表 |
| | | public class alarmmg { |
| | | private Integer id; |
| | | private String content; |
| | | private Date timeon; |
| | | private Date endTime; |
| | | |
| | | private String timeons; |
| | | private Integer id;//自增id |
| | | private String content;//报警内容 |
| | | private Date timeon;//报警时间 |
| | | private Date endTime;//报警结束时间 |
| | | private String timeons;//报警时间,非时间戳类型 |
| | | |
| | | // 自增id |
| | | public void setid(Integer id) { |
| | |
| | | package com.example.springboot.entity; |
| | | |
| | | //客户玻璃信息表 |
| | | public class north_glass_buffer1 { |
| | | private Integer id; //自增id |
| | | private String ordernumber;//订单id |
| | |
| | | private String glassinside;// |
| | | private String glassbetween;// |
| | | private String itemtype;// |
| | | private String slotnumber;// |
| | | private String slotnumber;//格子 |
| | | private String datemodified;// |
| | | private String datecreated;// |
| | | private String FrameBarcode;//铝框id |
| | |
| | | private Integer state; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | private String name; |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.*; |
| | | |
| | | |
| | | import com.example.springboot.entity.Glass; |
| | | import com.example.springboot.entity.StorageCage; |
| | | import com.example.springboot.entity.StorageTask; |
| | | import com.example.springboot.entity.north_glass_buffer1; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.print.DocFlavor.STRING; |
| | | |
| | | @Mapper |
| | | |
| | |
| | | StorageCage selectGlassCage(int cage,double width,int cage1,int cage2); |
| | | |
| | | //删除笼子信息(出片) |
| | | @Update("update storage_cage as a set state=#{state},glass_id=null,order_id=null,glasswidth=0,a.glassheight=null,a.glasswidthmm=null,a.glassheightmm=null,a.listid=null,a.boxid=null where glassid=#{glassid};") |
| | | @Update("update storage_cage as a set state=#{state},glass_id=null,order_id=null,glasswidth=0,a.glassheight=null,a.glasswidthmm=null,a.glassheightmm=null,a.listid=null,a.boxid=null where glass_id=#{glassid};") |
| | | void UpdataGlassCage(String glassid,int state); |
| | | //改变玻璃状态为出片中 |
| | | @Update("update storage_cage as a set state=#{state} where glass_id=#{glassid};") |
| | |
| | | package com.example.springboot.service; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.example.springboot.common.Result; |
| | | import com.example.springboot.component.S7control; |
| | | import com.example.springboot.entity.Glass; |
| | | import com.example.springboot.entity.StorageCage; |
| | | import com.example.springboot.entity.north_glass_buffer1; |
| | | import com.example.springboot.mapper.SpianMapper; |
New file |
| | |
| | | #PlcServoManualone 地址 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
| | | # A01组合中地址表集合
|
| | | A01.addresses=DB103.32,DB100.144,DB100.184,DB100.186,DB100.180,DB100.182
|
| | | # A02组合中地址表集合
|
| | | A02.addresses=DB103.26,DB100.188,DB100.190,DB100.146
|
| | | # A01翻转地址
|
| | | A01.flipAddress=DB103.42
|
| | | # A02翻转地址
|
| | | A02.flipAddress=DB103.46
|
| | | # B01组合中地址
|
| | | B01.address=DB103.27
|
| | | # B02组合地址
|
| | | B02.address=DB103.29
|
| | | # 所有故障按钮地址
|
| | | faultButtonAddresses=DB104.1.4,DB104.1.5,DB104.1.2,DB104.1.3,DB104.1.6,DB104.1.7
|
| | | # 复位按钮地址
|
| | | resetButtonAddresses=DB101.4.0,DB101.4.3,DB101.3.6,DB101.4.1,DB101.4.4,DB101.4.6
|
| | | # 所有未回零按钮地址
|
| | | notHomedButtonAddresses=DB104.9.0,DB104.9.1,DB104.9.0,DB104.9.1,DB104.9.4,DB104.9.5
|
| | | # 进片id地址
|
| | | inputGlassIdAddress=DB100.148
|
| | | # 存片id地址
|
| | | outputGlassIdAddress=DB100.162
|
| | | #回零按钮地址
|
| | | HomedButtonAddresses=DB101.3.7,DB101.4.2,DB101.4.5,DB101.4.7
|
| | | #A02start
|
| | | A02start=DB101.5.1
|
| | | #A01start
|
| | | A01start=DB101.5.0
|
| | | #A02start
|
| | | A02Bstart=DB101.11.1
|
| | | #A01start
|
| | | A01Bstart=DB101.11.0
|
| | | #------------------------------------------------------------ |