Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
# Conflicts:
# springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
# springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
# springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
| | |
| | | import request from "../utils/request";
|
| | |
|
| | |
|
| | | export function SelectPermissionByUserName(username) {
|
| | | return request({
|
| | | url: '/home/SelectPermissionByUserName?username='+username,
|
| | | method: 'get',
|
| | | data:""
|
| | | })
|
| | | }
|
| | |
|
| | | export function currentUsername() {
|
| | | return request({
|
| | | url: '/api/user/currentUsername',
|
| | | method: 'get',
|
| | | |
| | | })
|
| | | }
|
| | |
|
| | | /**
|
| | | *登录
|
| | | * @param data
|
| | |
| | | "page": "1" |
| | | }, |
| | | { |
| | | "name": "B01 YV TURN", |
| | | "name": "B01 Solenoid TURN", |
| | | "value": 1, |
| | | "state": "1", |
| | | "type": "1", |
| | | "page": "1" |
| | | }, |
| | | { |
| | | "name": "B01 YV UP DOWN", |
| | | "name": "B01 Solenoid UP DOWN", |
| | | "value": 1, |
| | | "state": "1", |
| | | "type": "1", |
| | | "page": "1" |
| | | }, |
| | | { |
| | | "name": "B02 YV TURN", |
| | | "name": "B02 Solenoid TURN", |
| | | "value": 1, |
| | | "state": "1", |
| | | "type": "1", |
| | | "page": "1" |
| | | }, |
| | | { |
| | | "name": "B02 YV UP DOWN", |
| | | "name": "B02 Solenoid UP DOWN", |
| | | "value": 1, |
| | | "state": "1", |
| | | "type": "1", |
| | | "page": "1" |
| | | }, |
| | | { |
| | | "name": "B01 YV Gassing", |
| | | "name": "B01 Solenoid Gassing", |
| | | "value": 1, |
| | | "state": "1", |
| | | "type": "1", |
| | | "page": "1" |
| | | }, |
| | | { |
| | | "name": "B02 YV Gassing", |
| | | "name": "B02 Solenoid Gassing", |
| | | "value": 1, |
| | | "state": "1", |
| | | "type": "1", |
| | |
| | | { |
| | | "button": { |
| | | "name": "D02输送", |
| | | "value": 1, |
| | | "value": 0, |
| | | "address": "DB10.0", |
| | | "state": 0 |
| | | }, |
| | |
| | | { |
| | | "button": { |
| | | "name": "D03输送", |
| | | "value": 1, |
| | | "value": 0, |
| | | "address": "DB10.0", |
| | | "state": 1 |
| | | }, |
| | |
| | | "button": { |
| | | "name": "A01半自动", |
| | | "value":0, |
| | | "type":66, |
| | | "address":"DB10.0" |
| | | } |
| | | }, |
| | |
| | | "button": { |
| | | "name": "A01半自动启动", |
| | | "value":0, |
| | | "type":66, |
| | | "address":"DB10.0" |
| | | } |
| | | } |
| | |
| | | "button": { |
| | | "name": "A02半自动", |
| | | "value":0, |
| | | "type":66, |
| | | "address":"DB10.0" |
| | | } |
| | | }, |
| | |
| | | "button": { |
| | | "name": "A02半自动启动", |
| | | "value":0, |
| | | "type":66, |
| | | "address":"DB10.0" |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | ] |
| | | , [ |
| | | { |
| | | "button": { |
| | | "name": "急停后中止/继续选择", |
| | | "value":0, |
| | | "address":"DB10.0", |
| | | "type":"66" |
| | | } |
| | | } |
| | | |
| | | ] |
| | | |
| | | |
| | | ] |
| | |
| | | "Top":"Top",
|
| | | "Up":"Up",
|
| | | "Down":"Down",
|
| | | "You do not have this permission":"You do not have this permission",
|
| | | "ServoManualone": {
|
| | | "A01 所在格子": "A01 Current Grid",
|
| | | "数量": "Quantity",
|
| | |
| | | "A02半自动": "A02 Semi-Auto",
|
| | | "A02半自动启动": "A02 Semi-Auto Start",
|
| | | "B01 所在格子": "B01 Current Grid",
|
| | | "B02 所在格子": "B02 Current Grid"
|
| | | "B02 所在格子": "B02 Current Grid",
|
| | | "急停后中止/继续选择": "Abort/ResumeTasks"
|
| | | },
|
| | | "langParameter1": {
|
| | |
|
| | |
| | | "B01行走点动": "B01 SERVE TRAVEL",
|
| | | "B02行走点动": "B02 SERVE TRAVEL",
|
| | | "B02翻转气缸": "B02 YV TURN",
|
| | | "B02升降气缸": "B02 YV UP DOWN",
|
| | | "B02电磁阀": "B02 YV Gassing",
|
| | | "B01翻转气缸": "B01 YV TURN",
|
| | | "B01升降气缸": "B01 YV UP DOWN",
|
| | | "B01电磁阀": "B01 YV Gassing",
|
| | | "B02升降气缸": "B02 Solenoid UP DOWN",
|
| | | "B02电磁阀": "B02 Solenoid Gassing",
|
| | | "B01翻转气缸": "B01 Solenoid TURN",
|
| | | "B01升降气缸": "B01 Solenoid UP DOWN",
|
| | | "B01电磁阀": "B01 Solenoid Gassing",
|
| | | "A01输送反向": "A01 VFD conveyor reverse",
|
| | | "A02输送反向": "A02 VFD conveyor reverse",
|
| | | "A01注电泵": "A01 oil pump",
|
| | |
| | | "Top":"置顶",
|
| | | "Up":"上移",
|
| | | "Down":"下移",
|
| | | "You do not have this permission":"You do not have this permission",
|
| | | "langparameter": {
|
| | | "conveyor Velocity(Auto FAST)": "D01-D06 皮带输送自动快速",
|
| | | "conveyor Velocity(Auto SLOW)": "D01-D06 皮带输送自动慢速",
|
| | |
| | | 'A02 SERVE TRAVEL POS', |
| | | 'B01 SERVE TRAVEL POS', |
| | | 'B02 SERVE TRAVEL POS', |
| | | 'B01 YV TURN', |
| | | 'B01 YV UP DOWN', |
| | | 'B02 YV TURN', |
| | | 'B02 YV UP DOWN', |
| | | 'B01 Solenoid TURN', |
| | | 'B01 Solenoid UP DOWN', |
| | | 'B02 Solenoid TURN', |
| | | 'B02 Solenoid UP DOWN', |
| | | ], |
| | | xyData: [ |
| | | { name: 'D01 VFD conveyor', value: "0" }, |
| | |
| | | { name: 'A02 SERVE TRAVEL POS', value: "0" }, |
| | | { name: 'B01 SERVE TRAVEL POS', value: "0" }, |
| | | { name: 'B02 SERVE TRAVEL POS', value: "0" }, |
| | | { name: 'B01 YV TURN', value: "0" }, |
| | | { name: 'B01 YV UP DOWN', value: "0" }, |
| | | { name: 'B02 YV TURN', value: "0" }, |
| | | { name: 'B02 YV UP DOWN', value: "0" }, |
| | | { name: 'B01 Solenoid TURN', value: "0" }, |
| | | { name: 'B01 Solenoid UP DOWN', value: "0" }, |
| | | { name: 'B02 Solenoid TURN', value: "0" }, |
| | | { name: 'B02 Solenoid UP DOWN', value: "0" }, |
| | | ] |
| | | , |
| | | }, |
| | |
| | | }, |
| | | //根据读取PLC的值,根据名称改变颜色1打开,0关闭 |
| | | getStatusClass (zhuangtai) { |
| | | console.log(zhuangtai); |
| | | // console.log(zhuangtai); |
| | | if (zhuangtai === 1) { |
| | | return "op"; |
| | | } |
| | |
| | |
|
| | | }
|
| | |
|
| | | for (let i = 0; i < jsonData2.length; i++) {
|
| | | let arr4 = jsonData2[i];
|
| | | for (let j = 0; j < arr4.length; j++) {
|
| | | let obj4 = arr4[j];
|
| | | if (obj4.button && (obj4.button.name.includes("启动") || obj4.button.name.includes("Start"))) {
|
| | | obj4.button.value = obj.qidong[0][i];
|
| | | // console.log(obj2.button.value)
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | for (let i = 2; i < jsonData2.length; i++) {
|
| | | let arr2 = jsonData2[i];
|
| | | for (let j = 2; j < arr2.length; j++) {
|
| | |
| | | if (obj3.button) {
|
| | | if (obj3.button && (obj3.button.name === "未回零" || obj3.button.name === "NotZero")) {
|
| | | obj3.button.value = weihuiling[0][i];
|
| | | console.log(obj3.button.value)
|
| | | // console.log(obj3.button.value)
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | for (let i = 0; i < jsonData2.length; i++) {
|
| | | let arr2 = jsonData2[i];
|
| | | for (let j = 0; j < arr2.length; j++) {
|
| | |
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | //启动
|
| | | for (let i = 0; i < jsonData2.length; i++) {
|
| | | let arr4 = jsonData2[i];
|
| | | for (let j = 0; j < arr4.length; j++) {
|
| | | let obj4 = arr4[j];
|
| | | if (obj4.button && (obj4.button.name.includes("启动") || obj4.button.name.includes("Start"))) {
|
| | | obj4.button.value = obj.qidong[0][i];
|
| | | // console.log(obj2.button.value)
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | });
|
| | |
|
| | |
|
| | | console.log(this.jsonData)
|
| | | // console.log(this.jsonData)
|
| | |
|
| | | }
|
| | |
|
| | |
| | | </el-row> |
| | | <div class="button-row" style="display: flex; justify-content: space-between;"> |
| | | <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex"> |
| | | <el-button v-if="item.button && language === 'en-US' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1,'error-button2': item.button.name === 'NotZero' && item.button.value === 0,'fuwei': item.button.name === 'Reset' && item.button.value === 1,'qidong': item.button.name === 'A01 Semi-Auto' && item.button.value === 1,'qidong2': item.button.name === 'A02 Semi-Auto' && item.button.value === 1}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> |
| | | <el-button v-if="item.button && language === 'zh-CN' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '故障' && item.button.value === 1,'error-button2': item.button.name === '未回零' && item.button.value === 0,'fuwei': item.button.name === '复位' && item.button.value === 1,'qidong': item.button.name === 'A01半自动' && item.button.value === 1,'qidong2': item.button.name === 'A02半自动' && item.button.value === 1 }" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> |
| | | <el-button v-if="item.button && language === 'en-US' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1,'error-button2': item.button.name === 'NotZero' && item.button.value === 0,'fuwei': item.button.name === 'Reset' && item.button.value === 1,'huiling': item.button.name === 'Home' && item.button.value === 1,'qidong': item.button.name === 'A01 Semi-Auto' && item.button.value === 1,'qidong2': item.button.name === 'A02 Semi-Auto' && item.button.value === 1,'qidong3': item.button.name === 'A01 Semi-Auto Start' && item.button.value === 1,'qidong4': item.button.name === 'A02 Semi-Auto Start' && item.button.value === 1,'qidong5': item.button.name === 'A02 Semi-Auto Start' && item.button.value === 1}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> |
| | | <el-button v-if="item.button && language === 'zh-CN' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '故障' && item.button.value === 1,'error-button2': item.button.name === '未回零' && item.button.value === 0,'fuwei': item.button.name === '复位' && item.button.value === 1,'huiling': item.button.name === '回零' && item.button.value === 1,'qidong': item.button.name === 'A01半自动' && item.button.value === 1,'qidong2': item.button.name === 'A02半自动' && item.button.value === 1,'qidong3': item.button.name === 'A01半自动启动' && item.button.value === 1,'qidong4': item.button.name === 'A02半自动启动' && item.button.value === 1,'qidong5': item.button.name === 'A02半自动' && item.button.value === 1 }" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | |
| | | |
| | | this.initWebSocket(); |
| | | const language = this.$i18n.locale; |
| | | console.log(language); |
| | | // console.log(language); |
| | | if (language === 'en-US') { |
| | | this.replaceChineseWithEnglish(); |
| | | } |
| | |
| | | socket.close(); |
| | | socket = null; |
| | | } |
| | | |
| | | // 开启一个websocket服务 |
| | | socket = new WebSocket(socketUrl); |
| | | |
| | |
| | | const inputBox = document.querySelectorAll('.el-card__body'); |
| | | const target = event.target; |
| | | if (obj.zuhe1 && inputBox && Array.from(inputBox).every(box => !box.contains(target))) { |
| | | |
| | | //启动按钮 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | jsonData2[0][9].button.value = obj.qidong[0][0]; // 第一个子数组中第一个 type=66 的 button |
| | | jsonData2[0][10].button.value = obj.qidong[0][1]; // 第一个子数组中第二个 type=66 的 button |
| | | jsonData2[1][7].button.value = obj.qidong[0][2]; // 第二个子数组中第一个 type=66 的 button |
| | | jsonData2[1][8].button.value = obj.qidong[0][3]; |
| | | |
| | | |
| | | |
| | | // 输出更新后的 jsonData2 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 执行更新逻辑 |
| | | for (let i = 0; i < 6; i++) { |
| | | jsonData2[i].forEach((item, index) => { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //未回零更新 |
| | | |
| | | for (let i = 3; i < jsonData2.length; i++) { |
| | |
| | | } |
| | | }); |
| | | }); |
| | | //急停 |
| | | |
| | | |
| | | for (let i = 0; i < jsonData2.length; i++) { |
| | | let arr2 = jsonData2[i]; |
| | | for (let j = 0; j < arr2.length; j++) { |
| | | let obj3 = arr2[j]; |
| | | if(obj3.button){ |
| | | if (obj3.button && (obj3.button.name === "急停后中止/继续选择" || obj3.button.name === "Abort/ResumeTasks" )) { |
| | | obj3.button.value = obj.resumeTasks[0][i]; |
| | | console.log(obj3.button.value) |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | background-color: green; |
| | | } |
| | | |
| | | .qidong2 { |
| | | .qidong3 { |
| | | background-color: green; |
| | | } |
| | | .qidong { |
| | | background-color: green; |
| | | } |
| | | |
| | | .qidong4 { |
| | | background-color: green; |
| | | } |
| | | |
| | | |
| | | .qidong5 { |
| | | background-color: green; |
| | | } |
| | | |
| | | .huiling { |
| | | background-color: green; |
| | | } |
| | | </style> |
| | |
| | | font-size: 25px;
|
| | | }
|
| | |
|
| | | @media screen and (min-width: 1900px) { |
| | | .blocks{transform: scale(1.5,1.05);width: 1210px;}
|
| | | } |
| | | @media screen and (min-width: 1900px) {
|
| | | .blocks {
|
| | | transform: scale(1.5, 1.05);
|
| | | width: 1210px;
|
| | | }
|
| | | }
|
| | |
|
| | | .el-message-box__btns {
|
| | | padding: 0px 15px 0;
|
| | |
| | | </div>
|
| | | <div style="display:flex;justify-content: space-around;width: 9zz5%;margin: 0 auto;">
|
| | | <el-input style="width:15%;" :placeholder="$t('Enter the glass barcode')" v-model="glassid1"></el-input>
|
| | | <el-button type="primary" @click="SelectGlassByGlassIDs(2)">{{ $t('Manually Infeed Glass') }}</el-button>
|
| | | <el-button type="primary" @click="SelectGlassByGlassIDs(2)" :disabled="ManuallyInfeedGlass">
|
| | | {{ $t('Manually Infeed Glass') }}</el-button>
|
| | | <!-- <el-input style="width:15%;" :placeholder="$t('Enter the Order No')" v-model="order"></el-input>
|
| | | <el-button type="warning" @click="showform1();">{{ $t('Exit the glass by order number') }}</el-button> -->
|
| | | </div>
|
| | |
| | | @click="showcageinfo(item['cage'])"></div>
|
| | | </div>
|
| | | <div class="blue gezi"
|
| | | :style="{ display: 'flex', position: 'absolute', float: 'left', top: 105 + 'px', left: 1050 + 'px', height: loadglassheight + 'px', width: 5 + 'px' }">
|
| | | :style="{ display: 'flex', position: 'absolute', float: 'left', top: 28 + 'px', left: 1050 + 'px', height: loadglassheight1 + 'px', width: 4 + 'px' }">
|
| | | </div>
|
| | | <div class="blue gezi"
|
| | | :style="{ display: 'flex', position: 'absolute', float: 'left', top: 105 + 'px', left: 1050 + 'px', height: loadglassheight2 + 'px', width: 4 + 'px' }">
|
| | | </div>
|
| | | <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
|
| | | <div class="blocks-img" :style="{ left: car2 + 'px', top: '175px' }"></div>
|
| | | <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('Outing Queue') }}</el-button>
|
| | | <el-button class="orderbutton1" type="primary" @click="showform2()" :disabled="OrderInfo">{{ $t('OrderInfo')
|
| | | }}</el-button>
|
| | | <el-button class="orderbutton2" type="primary" @click="showform6()" :disabled="OutingQueue">
|
| | | {{ $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-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)" style="font-size: 15px;"
|
| | | <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')}}
|
| | | {{ $t('Top') }}
|
| | | </el-button>
|
| | | <el-button type="text" size="small" @click="getUpMove(scope.row, scope.$index)" style="font-size: 15px;"
|
| | | <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')}}
|
| | | {{ $t('Up') }}
|
| | | </el-button>
|
| | | <el-button type="text" size="small" @click="getDownMove(scope.row, scope.$index)" style="font-size: 15px;"
|
| | | <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')}}
|
| | | {{ $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>
|
| | |
| | | import {
|
| | | home, home2, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist,
|
| | | SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState, DeleteQueueGlass, SelectGlassNo,
|
| | | SelectAluminumFrameInfoById, DeleteProductionQueueGlass, AddOutSliceS, isAllowQueues, isConfirmStates
|
| | | SelectAluminumFrameInfoById, DeleteProductionQueueGlass, AddOutSliceS, isAllowQueues, isConfirmStates, SelectPermissionByUserName, currentUsername
|
| | | } from "../../api/home";
|
| | |
|
| | |
|
| | |
| | | cageinfo: [],
|
| | | cage: 0,
|
| | | carlist: [],
|
| | | loadglassheight: 0,
|
| | | loadglassheight1: 0,
|
| | | loadglassheight2: 0,
|
| | | password: 1,
|
| | | text: "",
|
| | | zhuangtai: "",
|
| | |
| | | currentPages: 1, //默认初始页
|
| | | pagesizes: 21, //每页默认显示的数据
|
| | | pageCounts: 0,
|
| | |
|
| | | OutSlice: [],
|
| | | AluminumFrame: [],
|
| | | framebarcode: "",
|
| | | isAllowQueue: true,
|
| | | FrameNoFlag: "",
|
| | | isConfirm: true
|
| | | isConfirm: true,
|
| | | ManuallyInfeedGlass: true,
|
| | | OutingQueue: true,
|
| | | OrderInfo: true,
|
| | | CageDetails: true
|
| | | };
|
| | | },
|
| | | created() {
|
| | |
| | | this.OutSlice = obj.listoutslice[0];
|
| | | }
|
| | | //获取上片位玻璃信息
|
| | | this.loadglassheight = obj.loadglassheight;
|
| | |
|
| | | if (obj.zhuangtai != null) {
|
| | | this.zhuangtai = obj.zhuangtai[0];
|
| | | }
|
| | | //上片位玻璃信息
|
| | | if (obj.form2 != null && obj.form2 != "") {
|
| | | this.form2 = obj.form2[0];
|
| | | this.loadglassheight2 = 70;
|
| | | } else {
|
| | | this.form2 = {};
|
| | | }
|
| | | |
| | |
|
| | | //是否需要手动确认上片
|
| | | this.isConfirm = obj.isConfirm[0];
|
| | | //扫码位玻璃信息
|
| | | if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 1) {
|
| | | this.form3 = obj.form3[0];
|
| | | this.loadglassheight1 = 70;
|
| | | } else {
|
| | | this.form3 = {};
|
| | | }
|
| | | if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) {
|
| | | this.loadglassheight1 = 70;
|
| | | this.form5 = obj.form3[0];
|
| | | this.showform3();
|
| | | this.Sizerange(this.form5, 3);
|
| | |
|
| | | this.glassid1="";
|
| | | } else {
|
| | | this.Sizerange(this.form5, 3);
|
| | | if(this.glassid1==""){
|
| | | this.DeleteBarcodeGlass();
|
| | | }
|
| | | }
|
| | | //数据库连接是否正常
|
| | | if (obj.dbconnected == "false") {
|
| | |
| | | }
|
| | | },
|
| | | load() {
|
| | | //加载用户权限
|
| | | currentUsername().then(res => {
|
| | | SelectPermissionByUserName(res.data).then(res => {
|
| | | res.data.permission.forEach(item => {
|
| | | if (item.permissionId == "32" && item.state == 1) {
|
| | | this.ManuallyInfeedGlass = false;
|
| | | }
|
| | | if (item.permissionId == "32" && item.state == 1) {
|
| | | this.OutingQueue = false;
|
| | | }
|
| | | if (item.permissionId == "33" && item.state == 1) {
|
| | | this.OrderInfo = false;
|
| | | }
|
| | | if (item.permissionId == "34" && item.state == 1) {
|
| | | this.CageDetails = false;
|
| | | }
|
| | | });
|
| | | });
|
| | |
|
| | | });
|
| | | //加载笼子使用情况数据
|
| | | home().then(res => {
|
| | | this.tableData = res.data.list;
|
| | |
| | | },
|
| | | //显示理片笼详情信息
|
| | | showcageinfo(cage) {
|
| | | cage = this.cageglassid;
|
| | | SelectCageInfo(cage).then(res => {
|
| | | this.cageinfo = res.data.cageinfo;
|
| | | this.currentPages = 1;
|
| | | this.dialogFormVisible3 = true;
|
| | | });
|
| | | if (this.CageDetails == false) {
|
| | | cage = this.cageglassid;
|
| | | SelectCageInfo(cage).then(res => {
|
| | | this.cageinfo = res.data.cageinfo;
|
| | | this.currentPages = 1;
|
| | | this.dialogFormVisible3 = true;
|
| | | });
|
| | | } else {
|
| | | this.$message.error(this.$t('You do not have this permission'));
|
| | | }
|
| | |
|
| | | },
|
| | | //删除理片笼玻璃
|
| | | deleteglass(glassid, state) {
|
| | |
| | | this.$message.success(this.$t('Operation successful'));
|
| | | }
|
| | | });
|
| | | }, |
| | | },
|
| | | //置顶
|
| | | getTopMove(row, index) {
|
| | | let Sequence = [];
|
| | |
| | | },
|
| | | //判断玻璃是否超出范围
|
| | | 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)) {
|
| | | 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 (this.ManuallyInfeedGlass == true) {
|
| | | 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)) {
|
| | | 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;
|
| | | }
|
| | | });
|
| | | if (position == 1 || position == 3) {
|
| | | this.disabled1 = true;
|
| | | } else {
|
| | | this.disabled = true;
|
| | | }
|
| | | } else {
|
| | | if (position == 1 || position == 3) {
|
| | | this.disabled1 = false;
|
| | | } else {
|
| | | this.disabled = false;
|
| | | }
|
| | | if (position == 3&&this.isConfirmState==true) {
|
| | | this.InsertQueueGlass(1);
|
| | | if (position == 1 || position == 3) {
|
| | | this.disabled1 = false;
|
| | | } else {
|
| | | this.disabled = false;
|
| | | }
|
| | | if (position == 3 && this.isConfirmState == true) {
|
| | | this.InsertQueueGlass(1);
|
| | | }
|
| | | }
|
| | | }
|
| | | },
|
| | |
| | | spianService = WebSocketServer.applicationContext.getBean(SpianService.class); |
| | | spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); |
| | | jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class); |
| | | |
| | | // List<String> adddresslist = new ArrayList<>(); |
| | | // adddresslist.add("DB105.0");// 进片车起始位置 |
| | | // adddresslist.add("DB105.2");// 进片车目标位置 |
| | | // adddresslist.add("DB105.4");// 进片玻璃宽 |
| | | // adddresslist.add("DB105.8");//进片笼内已有玻璃数 |
| | | // adddresslist.add("DB105.16");// 进片车启动 1为启动 |
| | | // List<Short> datas = new ArrayList<>(); |
| | | // datas.add((short) 1000);//起始位置 |
| | | // datas.add((short) 5);//目标位置 |
| | | // datas.add((short) 610);//进片玻璃宽 |
| | | // datas.add((short) 1); //玻璃数 |
| | | // spianService.outmesid("123321","DB105.20"); |
| | | // datas.add((short) 1);//任务启动 |
| | | // S7control.getinstance().WriteWord(adddresslist, datas); |
| | | // 根据玻璃id获取订单号,单独数据源 |
| | | // try { |
| | | // north_glass_buffer1 glass = jdbcConnections.selectGlass(112); |
| | |
| | | StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02的玻璃id |
| | | // 当进片小车完成任务时 |
| | | if (B01backs == true) { |
| | | // 当B01小车汇报完成时更改玻璃状态为1 |
| | | // 当B01小车汇报完成时更改玻璃状态 为1 |
| | | spianMapper.UpdateCageOver(B01glassid.toString(), 1);// 更改笼子表进片状态 |
| | | spianMapper.Updatetask(1, 0);// 更改进片任务状态为1 |
| | | spianMapper.UpdatetaskOut(B01glassid.toString()); // 完成上一次出片或者进片任务 |
| | |
| | | StringBuilder queueid1 = spianService.queGlassid("DB106.26", 14);// 获取请求的id跟DO1同时清 |
| | | // 获取DO2数据 |
| | | StringBuilder queueid2 = spianService.queGlassid("DB103.58", 14); |
| | | System.out.println("D01|" + queueid1); |
| | | System.out.println("D02|" + queueid2); |
| | | // System.out.println("D01|" + queueid1); |
| | | // System.out.println("D02|" + queueid2); |
| | | |
| | | int questate = spianMapper.Selectquecount(queueid1.toString());// 判断扫码位是否有玻璃已确认 |
| | | // queueid1.toString().isEmpty() |
| | |
| | | import java.util.List; |
| | | |
| | | public class PlcManualonePosition extends Thread { |
| | | String name = ""; |
| | | Integer count = 0; |
| | | private Configuration config; |
| | | |
| | | public static String readFileToString(String filePath) throws IOException { |
| | | File file = new File(filePath); |
| | | return FileUtils.readFileToString(file, "UTF-8"); |
| | | public PlcManualonePosition() throws IOException { |
| | | config = new Configuration("config.properties"); |
| | | } |
| | | |
| | | public void readValue() { |
| | | String str = ""; |
| | | BufferedReader bufferedReader = null; |
| | | FileInputStream fileInputStream; |
| | | try { |
| | | // 从文件中读取字节数据存入 fileInputStream |
| | | fileInputStream = new FileInputStream("CanadaMes-ui/src/configuration/address.json"); |
| | | // 读取 fileInputStream 中字节并将其解码为字符 |
| | | InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8"); |
| | | // 提高读取效率,在 BufferedReader 内包装 InputStreamReader |
| | | bufferedReader = new BufferedReader(inputStreamReader); |
| | | String line = null; |
| | | // 将 bufferedReader 内容一行一行赋值给str |
| | | while ((line = bufferedReader.readLine()) != null) { |
| | | str += line; |
| | | public static class PLCBooleanConverter { |
| | | |
| | | public static short[] convertListsToBinaryShortArray(List<Boolean>... lists) { |
| | | // 计算所有列表中元素的总数 |
| | | int totalSize = 0; |
| | | for (List<Boolean> list : lists) { |
| | | totalSize += list.size(); |
| | | } |
| | | |
| | | // 将str字符串格式转为json |
| | | JSONObject jsonObject = new JSONObject(str); |
| | | // 创建一个足够大的数组来存放所有的二进制值 |
| | | short[] binaryShortArray = new short[totalSize]; |
| | | |
| | | // 获取json中的值 |
| | | JSONArray address = jsonObject.getJSONArray("ManualonePosition"); |
| | | for (int i = 0; i < address.size(); i++) { |
| | | JSONObject ress = (JSONObject) address.get(i); |
| | | // 当前数组填充位置指针 |
| | | int currentIndex = 0; |
| | | |
| | | this.name = ress.getStr("name"); |
| | | this.count = ress.getInt("count"); |
| | | |
| | | // 遍历所有的列表 |
| | | for (List<Boolean> list : lists) { |
| | | // 将每个布尔值转换为 0 或 1 并填入数组 |
| | | for (Boolean value : list) { |
| | | binaryShortArray[currentIndex++] = (short) (value ? 1 : 0); |
| | | } |
| | | } |
| | | |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return binaryShortArray; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void run() { |
| | |
| | | addresses10.add("DB104.9.4"); |
| | | addresses10.add("DB104.9.5"); |
| | | List<Boolean> arraylist10 = S7control.getinstance().readBits(addresses10); |
| | | |
| | | //A01启动地址 |
| | | List<String> A01start = Arrays.asList(config.getProperty("mlp.A01start")); |
| | | //A02启动地址 |
| | | List<String> A02start = Arrays.asList(config.getProperty("mlp.A02start")); |
| | | |
| | | List<String> B01start = Arrays.asList(config.getProperty("mlp.B01start")); |
| | | |
| | | List<String> B02start = Arrays.asList(config.getProperty("mlp.B02start")); |
| | | |
| | | List<Boolean> A01readstart = S7control.getinstance().readBits(A01start); |
| | | List<Boolean> A02readstart = S7control.getinstance().readBits(A02start); |
| | | List<Boolean> B01readstart = S7control.getinstance().readBits(B01start); |
| | | List<Boolean> B02readstart = S7control.getinstance().readBits(B02start); |
| | | |
| | | short[] combinedBinaryShortArray = PlcManualonePosition.PLCBooleanConverter.convertListsToBinaryShortArray( |
| | | A01readstart, A02readstart,B01readstart, B02readstart |
| | | ); |
| | | |
| | | // Short[] values1 = { 1, 2, 3 }; |
| | | // List<Short> arraylist = new ArrayList<>(Arrays.asList(values1)); |
| | | // Short[] values2 = { 1, 2, 3 }; |
| | |
| | | jsonObject.append("shishi1", arraylist5); |
| | | jsonObject.append("guzhang", params2); |
| | | jsonObject.append("weihuiling", params3); |
| | | // jsonObject.append("weihuiling", arraylist8); |
| | | jsonObject.append("qidong", combinedBinaryShortArray); |
| | | |
| | | WebSocketServer sendwServer = WebSocketServer.sessionMap.get("ManualonePosition"); |
| | | if (sendwServer != null) { |
| | |
| | | } |
| | | if (!sValue.isEmpty()) { |
| | | S7control.getinstance().WriteWord(waddresses1, sValue); |
| | | List<String> A01start = new ArrayList<>(); |
| | | A01start.add("DB101.2.2"); |
| | | Boolean[] a01values7 = { true}; |
| | | List<Boolean> a01startval = new ArrayList<>(Arrays.asList(a01values7)); |
| | | S7control.getinstance().WriteBit(A01start, a01startval); |
| | | if (A01readstart != null && !A01readstart.isEmpty()) { |
| | | // 创建一个新的列表用于写入新值 |
| | | List<Boolean> a01startval = new ArrayList<>(); |
| | | // 遍历所有读取到的位值 |
| | | for (Boolean bit : A01readstart) { |
| | | // 取反当前位的值并添加到新的列表中 |
| | | a01startval.add(!bit); |
| | | } |
| | | // 写入新的位值列表 |
| | | S7control.getinstance().WriteBit(A01start, a01startval); |
| | | } |
| | | |
| | | |
| | | |
| | | System.out.println("Values " + sValue + " written to PLC at address " + waddresses1); |
| | | } |
| | | } |
| | |
| | | } |
| | | if (!sValue2.isEmpty()) { |
| | | S7control.getinstance().WriteWord(waddresses2, sValue2); |
| | | List<String> A02start = new ArrayList<>(); |
| | | A02start.add("DB101.2.3"); |
| | | Boolean[] a02values7 = { true}; |
| | | List<Boolean> a01startval = new ArrayList<>(Arrays.asList(a02values7)); |
| | | S7control.getinstance().WriteBit(A02start, a01startval); |
| | | if (A02readstart != null && !A02readstart.isEmpty()) { |
| | | // 创建一个新的列表用于写入新值 |
| | | List<Boolean> a02startval = new ArrayList<>(); |
| | | // 遍历所有读取到的位值 |
| | | for (Boolean bit : A02readstart) { |
| | | // 取反当前位的值并添加到新的列表中 |
| | | a02startval.add(!bit); |
| | | } |
| | | // 写入新的位值列表 |
| | | S7control.getinstance().WriteBit(A02start, a02startval); |
| | | } |
| | | |
| | | |
| | | |
| | | System.out.println("Values " + sValue2 + " written to PLC at address " + waddresses2); |
| | | } |
| | | } |
| | |
| | | } |
| | | if (!sValue2.isEmpty()) { |
| | | S7control.getinstance().WriteWord(waddresses3, sValue2); |
| | | List<String> B01start = new ArrayList<>(); |
| | | B01start.add("DB101.2.4"); |
| | | Boolean[]B01values7 = { true}; |
| | | List<Boolean> B01startval = new ArrayList<>(Arrays.asList(B01values7)); |
| | | S7control.getinstance().WriteBit(B01start, B01startval); |
| | | if (B01readstart != null && !B01readstart.isEmpty()) { |
| | | // 创建一个新的列表用于写入新值 |
| | | List<Boolean> b01startval = new ArrayList<>(); |
| | | // 遍历所有读取到的位值 |
| | | for (Boolean bit : B01readstart) { |
| | | // 取反当前位的值并添加到新的列表中 |
| | | b01startval.add(!bit); |
| | | } |
| | | // 写入新的位值列表 |
| | | S7control.getinstance().WriteBit(B01start, b01startval); |
| | | } |
| | | System.out.println("Values " + sValue2 + " written to PLC at address " + waddresses3); |
| | | } |
| | | } |
| | |
| | | } |
| | | if (!sValue2.isEmpty()) { |
| | | S7control.getinstance().WriteWord(waddresses4, sValue2); |
| | | List<String> B02start = new ArrayList<>(); |
| | | B02start.add("DB101.2.5"); |
| | | Boolean[] B02values7 = { true}; |
| | | List<Boolean> B02startval = new ArrayList<>(Arrays.asList(B02values7)); |
| | | S7control.getinstance().WriteBit(B02start, B02startval); |
| | | if (B02readstart != null && !B02readstart.isEmpty()) { |
| | | // 创建一个新的列表用于写入新值 |
| | | List<Boolean> b02startval = new ArrayList<>(); |
| | | // 遍历所有读取到的位值 |
| | | for (Boolean bit : B02readstart) { |
| | | // 取反当前位的值并添加到新的列表中 |
| | | b02startval.add(!bit); |
| | | } |
| | | // 写入新的位值列表 |
| | | S7control.getinstance().WriteBit(B02start, b02startval); |
| | | System.out.println("Values " + b02startval + " written to PLC at address " + B02start); |
| | | } |
| | | System.out.println("Values " + sValue2 + " written to PLC at address " + waddresses4); |
| | | } |
| | | } |
| | |
| | | import java.util.List;
|
| | |
|
| | | public class PlcManualonePosition2 extends Thread {
|
| | | String name = "";
|
| | | Integer count = 0;
|
| | | private Configuration config;
|
| | |
|
| | | public static String readFileToString(String filePath) throws IOException {
|
| | | File file = new File(filePath);
|
| | | return FileUtils.readFileToString(file, "UTF-8");
|
| | | public PlcManualonePosition2() throws IOException {
|
| | | config = new Configuration("config.properties");
|
| | | }
|
| | |
|
| | | public void readValue() {
|
| | | String str = "";
|
| | | BufferedReader bufferedReader = null;
|
| | | FileInputStream fileInputStream;
|
| | | try {
|
| | | // 从文件中读取字节数据存入 fileInputStream
|
| | | fileInputStream = new FileInputStream("CanadaMes-ui/src/configuration/address.json");
|
| | | // 读取 fileInputStream 中字节并将其解码为字符
|
| | | InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
|
| | | // 提高读取效率,在 BufferedReader 内包装 InputStreamReader
|
| | | bufferedReader = new BufferedReader(inputStreamReader);
|
| | | String line = null;
|
| | | // 将 bufferedReader 内容一行一行赋值给str
|
| | | while ((line = bufferedReader.readLine()) != null) {
|
| | | str += line;
|
| | | public static class PLCBooleanConverter {
|
| | |
|
| | | public static short[] convertListsToBinaryShortArray(List<Boolean>... lists) {
|
| | | // 计算所有列表中元素的总数
|
| | | int totalSize = 0;
|
| | | for (List<Boolean> list : lists) {
|
| | | totalSize += list.size();
|
| | | }
|
| | |
|
| | | // 将str字符串格式转为json
|
| | | JSONObject jsonObject = new JSONObject(str);
|
| | | // 创建一个足够大的数组来存放所有的二进制值
|
| | | short[] binaryShortArray = new short[totalSize];
|
| | |
|
| | | // 获取json中的值
|
| | | JSONArray address = jsonObject.getJSONArray("ServoManualone");
|
| | | for (int i = 0; i < address.size(); i++) {
|
| | | JSONObject ress = (JSONObject) address.get(i);
|
| | | // 当前数组填充位置指针
|
| | | int currentIndex = 0;
|
| | |
|
| | | this.name = ress.getStr("name");
|
| | | this.count = ress.getInt("count");
|
| | |
|
| | | // 遍历所有的列表
|
| | | for (List<Boolean> list : lists) {
|
| | | // 将每个布尔值转换为 0 或 1 并填入数组
|
| | | for (Boolean value : list) {
|
| | | binaryShortArray[currentIndex++] = (short) (value ? 1 : 0);
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (FileNotFoundException e) {
|
| | | e.printStackTrace();
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | return binaryShortArray;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | |
| | | params3[i] = value ? (short) 1 : (short) 0;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | //A01启动地址
|
| | | List<String> A01start = Arrays.asList(config.getProperty("mlp2.A01start"));
|
| | | //A02启动地址
|
| | | List<String> A02start = Arrays.asList(config.getProperty("mlp2.A02start"));
|
| | |
|
| | |
|
| | |
|
| | | List<Boolean> A01readstart = S7control.getinstance().readBits(A01start);
|
| | | List<Boolean> A02readstart = S7control.getinstance().readBits(A02start);
|
| | |
|
| | |
|
| | | short[] combinedBinaryShortArray = PlcManualonePosition2.PLCBooleanConverter.convertListsToBinaryShortArray(
|
| | | A01readstart, A02readstart
|
| | | );
|
| | |
|
| | | JSONObject jsonObject = new JSONObject();
|
| | |
|
| | | jsonObject.append("zuhe1", arraylist);
|
| | | jsonObject.append("zuhe2", arraylist2);
|
| | | jsonObject.append("guzhang", params2);
|
| | | jsonObject.append("weihuiling", params3);
|
| | | jsonObject.append("qidong", combinedBinaryShortArray);
|
| | | // System.out.println(jsonObject);
|
| | | WebSocketServer sendwServer = WebSocketServer.sessionMap.get("ManualonePosition2");
|
| | | if (sendwServer != null) {
|
| | |
| | | }
|
| | | if (!sValue.isEmpty()) {
|
| | | S7control.getinstance().WriteWord(waddresses1, sValue);
|
| | | List<String> A01start = new ArrayList<>();
|
| | | A01start.add("DB101.2.0");
|
| | | Boolean[] a01values7 = { true};
|
| | | List<Boolean> a01startval = new ArrayList<>(Arrays.asList(a01values7));
|
| | | S7control.getinstance().WriteBit(A01start, a01startval);
|
| | | if (A01readstart != null && !A01readstart.isEmpty()) {
|
| | | // 创建一个新的列表用于写入新值
|
| | | List<Boolean> a01startval = new ArrayList<>();
|
| | | // 遍历所有读取到的位值
|
| | | for (Boolean bit : A01readstart) {
|
| | | // 取反当前位的值并添加到新的列表中
|
| | | a01startval.add(!bit);
|
| | | }
|
| | | // 写入新的位值列表
|
| | | S7control.getinstance().WriteBit(A01start, a01startval);
|
| | | }
|
| | | System.out.println("Values " + sValue + " written to PLC at address " + waddresses1);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | if (!sValue2.isEmpty()) {
|
| | | S7control.getinstance().WriteWord(waddresses2, sValue2);
|
| | | List<String> A02start = new ArrayList<>();
|
| | | A02start.add("DB101.2.1");
|
| | | Boolean[] a02values7 = { true};
|
| | | List<Boolean> a01startval = new ArrayList<>(Arrays.asList(a02values7));
|
| | | S7control.getinstance().WriteBit(A02start, a01startval);
|
| | | if (A02readstart != null && !A02readstart.isEmpty()) {
|
| | | // 创建一个新的列表用于写入新值
|
| | | List<Boolean> a02startval = new ArrayList<>();
|
| | | // 遍历所有读取到的位值
|
| | | for (Boolean bit : A02readstart) {
|
| | | // 取反当前位的值并添加到新的列表中
|
| | | a02startval.add(!bit);
|
| | | }
|
| | | // 写入新的位值列表
|
| | | S7control.getinstance().WriteBit(A02start, a02startval);
|
| | | }
|
| | | System.out.println("Values " + sValue2 + " written to PLC at address " + waddresses2);
|
| | | }
|
| | | }
|
| | |
| | | config = new Configuration("config.properties"); |
| | | } |
| | | |
| | | public static class PLCBooleanConverter { |
| | | |
| | | public static short[] convertListsToBinaryShortArray(List<Boolean>... lists) { |
| | | // 计算所有列表中元素的总数 |
| | | int totalSize = 0; |
| | | for (List<Boolean> list : lists) { |
| | | totalSize += list.size(); |
| | | } |
| | | |
| | | // 创建一个足够大的数组来存放所有的二进制值 |
| | | short[] binaryShortArray = new short[totalSize]; |
| | | |
| | | // 当前数组填充位置指针 |
| | | int currentIndex = 0; |
| | | |
| | | // 遍历所有的列表 |
| | | for (List<Boolean> list : lists) { |
| | | // 将每个布尔值转换为 0 或 1 并填入数组 |
| | | for (Boolean value : list) { |
| | | binaryShortArray[currentIndex++] = (short) (value ? 1 : 0); |
| | | } |
| | | } |
| | | |
| | | return binaryShortArray; |
| | | } |
| | | } |
| | | |
| | | //读取id |
| | | public StringBuilder queGlassid(String address,int count) { |
| | |
| | | //B02组合地址 |
| | | String b02Address = config.getProperty("B02.address"); |
| | | List<Short> arraylist6 = S7control.getinstance().ReadWord(b02Address, 2); |
| | | System.out.println(b02Address); |
| | | // System.out.println(b02Address); |
| | | // 所有故障按钮地址 |
| | | 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> A01Bstart = Arrays.asList(config.getProperty("A01Bstart")); |
| | | //A02半自动地址 |
| | | List<String> A02Bstart = Arrays.asList(config.getProperty("A02Bstart")); |
| | | // |
| | | List<String> abortresumeTasks = Arrays.asList(config.getProperty("abortresumeTasks")); |
| | | //回零按钮地址 |
| | | List<String> waddresses4 = Arrays.asList(config.getProperty("HomedButtonAddresses").split(",")); |
| | | // 所有复位按钮地址 |
| | | List<String> Reset = Arrays.asList(config.getProperty("resetButtonAddresses")); |
| | | List<String> Reset = Arrays.asList(config.getProperty("resetButtonAddresses").split(",")); |
| | | // System.out.println(Reset); |
| | | // 所有未回零按钮地址 |
| | | List<String> addresses8 = Arrays.asList(config.getProperty("notHomedButtonAddresses")); |
| | | List<String> addresses8 = Arrays.asList(config.getProperty("notHomedButtonAddresses").split(",")); |
| | | // 进片id地址 |
| | | String inputGlassIdAddress = config.getProperty("inputGlassIdAddress"); |
| | | String outputGlassIdAddress = config.getProperty("outputGlassIdAddress"); |
| | | StringBuilder queueid1 = queGlassid(inputGlassIdAddress, 14); |
| | | // 存片id地址 |
| | | StringBuilder queueid2 = queGlassid(outputGlassIdAddress, 14); |
| | | |
| | | List<Boolean> A01readstart = S7control.getinstance().readBits(A01start); |
| | | List<Boolean> A02readstart = S7control.getinstance().readBits(A02start); |
| | | List<Boolean> A01readBstart = S7control.getinstance().readBits(A01Bstart); |
| | | List<Boolean> A02readsBtart = S7control.getinstance().readBits(A02Bstart); |
| | | |
| | | List<Boolean> resumeTasks = S7control.getinstance().readBits(abortresumeTasks); |
| | | |
| | | short[] combinedBinaryShortArray = PLCBooleanConverter.convertListsToBinaryShortArray( |
| | | A01readstart, A01readBstart, A02readstart, A02readsBtart |
| | | ); |
| | | |
| | | |
| | | // 所有故障按钮转换为1和0 |
| | | short[] params2 = new short[arraylist7.size()]; |
| | |
| | | |
| | | |
| | | List<Boolean> Reset1 = S7control.getinstance().readBits(Reset); |
| | | |
| | | // System.out.println(Reset1); |
| | | // 所有故障按钮转换为1和0 |
| | | short[] rReset = new short[Reset1.size()]; |
| | | for (int i = 0; i < Reset1.size(); i++) { |
| | |
| | | jsonObject.append("jinpianid", queueid1); |
| | | jsonObject.append("qupianid", queueid2); |
| | | jsonObject.append("fuwei", rReset); |
| | | jsonObject.append("qidong", combinedBinaryShortArray); |
| | | jsonObject.append("resumeTasks", resumeTasks); |
| | | |
| | | |
| | | |
| | |
| | | if (!sValue.isEmpty()) { |
| | | |
| | | S7control.getinstance().WriteWord(addresses, sValue); |
| | | Boolean[] a01values7 = { true}; |
| | | List<Boolean> a01startval = new ArrayList<>(Arrays.asList(a01values7)); |
| | | S7control.getinstance().WriteBit(A01start, a01startval); |
| | | // 检查是否读取到了位值,并且列表不为空 |
| | | if (A01readstart != null && !A01readstart.isEmpty()) { |
| | | // 创建一个新的列表用于写入新值 |
| | | List<Boolean> a01startval = new ArrayList<>(); |
| | | // 遍历所有读取到的位值 |
| | | for (Boolean bit : A01readstart) { |
| | | // 取反当前位的值并添加到新的列表中 |
| | | a01startval.add(!bit); |
| | | } |
| | | // 写入新的位值列表 |
| | | S7control.getinstance().WriteBit(A01start, a01startval); |
| | | } |
| | | System.out.println("Values " + sValue + " written to PLC at address " + addresses); |
| | | } |
| | | } |
| | |
| | | if (!sValue2.isEmpty()) { |
| | | S7control.getinstance().WriteWord(addresses2, sValue2); |
| | | |
| | | Boolean[] a02values7 = {true}; |
| | | List<Boolean> a02startval = new ArrayList<>(Arrays.asList(a02values7)); |
| | | S7control.getinstance().WriteBit(A02start, a02startval); |
| | | if (A02readstart != null && !A02readstart.isEmpty()) { |
| | | // 创建一个新的列表用于写入新值 |
| | | List<Boolean> a02startval = new ArrayList<>(); |
| | | // 遍历所有读取到的位值 |
| | | for (Boolean bit : A02readstart) { |
| | | // 取反当前位的值并添加到新的列表中 |
| | | a02startval.add(!bit); |
| | | } |
| | | // 写入新的位值列表 |
| | | S7control.getinstance().WriteBit(A02start, a02startval); |
| | | } |
| | | System.out.println("Values " + sValue2 + " written to PLC at address " + addresses2); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (messageArray.getJSONArray(8).size() > 0) { |
| | | JSONArray jsonArray5 = messageArray.getJSONArray(8); |
| | | List<Boolean> sValueb5 = new ArrayList<>(); |
| | | for (int i = 0; i < jsonArray5.size(); i++) { |
| | | Object value = jsonArray5.get(i); |
| | | if (value != null && !value.toString().equals("null")) { |
| | | try { |
| | | String cleanedValue = value.toString().replaceAll("[^0-9-]", ""); |
| | | boolean val = "1".equals(cleanedValue.trim()); |
| | | sValueb5.add(val); |
| | | System.out.println("messageValue: " + Arrays.asList(val) + " added to the list"); |
| | | } catch (NumberFormatException e) { |
| | | // 如果无法解析为 boolean 类型,则忽略该部分 |
| | | System.err.println("Could not parse value: " + value); |
| | | } |
| | | } |
| | | } |
| | | if (!sValueb5.isEmpty()) { |
| | | |
| | | S7control.getinstance().WriteBit(abortresumeTasks, sValueb5); |
| | | System.out.println("Values " + sValueb5 + " written to PLC at address " + A02Bstart); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 清空消息列表 |
| | | webSocketServer.clearMessages(); |
| | |
| | | FileInputStream fileInputStream; |
| | | try { |
| | | // 从文件中读取字节数据存入 fileInputStream |
| | | fileInputStream = new FileInputStream("CanadaMes-ui/src/configuration/Alarm.json"); |
| | | fileInputStream = new FileInputStream("src/main/resources/Alarm.json"); |
| | | // 读取 fileInputStream 中字节并将其解码为字符 |
| | | InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8"); |
| | | // 提高读取效率,在 BufferedReader 内包装 InputStreamReader |
| | |
| | | List<String> myCollection; |
| | | myCollection = readValue(); |
| | | String[] array1 = myCollection.toArray(new String[myCollection.size()]); |
| | | |
| | | // System.out.println(array1.length); |
| | | alarmMapper = WebSocketServer.applicationContext.getBean(AlarmMapper.class); |
| | | for (short i = 0; i < array1.length; i++) { |
| | | // 查询对应报警信息结束时间为null的条数 |
| | |
| | | // System.out.println(result); |
| | | if (shuzu1[i] == 1 && result == 0) { |
| | | // 填加一条报警信息,有开始时间 |
| | | // alarmMapper.Insertalarm(array1[i]); |
| | | alarmMapper.Insertalarm(array1[i]); |
| | | } else if (shuzu1[i] == 0 && result > 0) { |
| | | // 修改该条报警信息的结束时间 |
| | | alarmMapper.updatealarm(array1[i]); |
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.poi.excel.sax.handler.MapRowHandler; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | import com.example.springboot.service.North_Glass_Buffer1Service; |
| | | import com.example.springboot.service.SpianService; |
| | | |
| | | |
| | | public class Plchome extends Thread { |
| | | |
| | | @Autowired |
| | |
| | | private SpianService spianService; |
| | | private North_Glass_Buffer1Service north_Glass_Buffer1Service; |
| | | private JdbcConnections dbserve; |
| | | // 出片队列是否允许出片 |
| | | public static Boolean isAllowQueue = true; |
| | | // 铝框id |
| | | //出片队列是否允许出片 |
| | | public static Boolean isAllowQueue=true; |
| | | //铝框id |
| | | public static String FrameNo; |
| | | // 是否需要手动确认玻璃 |
| | | public static Boolean isConfirm = false; |
| | | |
| | | //是否需要手动确认玻璃 |
| | | public static Boolean isConfirm=false; |
| | | // public static Map b=new HashMap<>(); |
| | | // b.put() |
| | | @Override |
| | |
| | | List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo(); |
| | | jsonObject.append("alarmmg", alarmmg); |
| | | // 读去Plc进片车与出片车位置W |
| | | List<String> addressList = new ArrayList<String>(); |
| | | if (addressList != null) { |
| | | addressList.add("DB106.12"); |
| | | addressList.add("DB106.0"); |
| | | } |
| | | |
| | | List<Short> paramlist = S7control.getinstance().ReadWord(addressList); |
| | | if (paramlist != null) { |
| | | jsonObject.append("params", paramlist); |
| | | } |
| | | // 获取进片车状态 |
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", |
| | | 1);// 获取进片车状态 |
| | | boolean exist1 = datas1ListState.contains((short) 0); |
| | | jsonObject.append("zhuangtai", exist1); |
| | | // 获取进片玻璃信息 |
| | | List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1); |
| | | if (inglassInfo != null) { |
| | | if (inglassInfo.size() > 0) |
| | | jsonObject.append("loadglassheight", inglassInfo.get(0) * 70); |
| | | } |
| | | // 获取进是否有待确认的玻璃id |
| | | // List<String> addressList = new ArrayList<String>(); |
| | | // addressList.add("DB106.12"); |
| | | // addressList.add("DB106.0"); |
| | | // List<Short> paramlist = S7control.getinstance().ReadWord(addressList); |
| | | // if (paramlist != null) { |
| | | // jsonObject.append("params", paramlist); |
| | | // } |
| | | // // 获取进片车状态 |
| | | // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", |
| | | // 1);// 获取进片车状态 |
| | | // boolean exist1 = datas1ListState.contains((short) 0); |
| | | // jsonObject.append("zhuangtai", exist1); |
| | | // //获取进片玻璃信息 |
| | | // List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1); |
| | | // if (inglassInfo != null) { |
| | | // if (inglassInfo.size() > 0) |
| | | // jsonObject.append("loadglassheight", inglassInfo.get(0) * 70); |
| | | // } |
| | | |
| | | // 伍 获取进是否有待确认的玻璃id |
| | | String queid = spianMapper.Selectqueueid(); |
| | | int state = spianMapper.Selectqueuestate(); |
| | | jsonObject.append("state", queid); |
| | | jsonObject.append("queid", queid); |
| | | jsonObject.append("state", state); |
| | | // 获取扫码位与上片位玻璃信息 |
| | | Queue form2 = homeMapper.GetQueueInfo(2); |
| | | Queue form3 = homeMapper.GetQueueInfo(1); |
| | | if (form2.getglassId() != null && form2.getglassId() != "") { |
| | | if(form2.getglassId()!=null&&form2.getglassId()!=""){ |
| | | jsonObject.append("form2", form2); |
| | | } |
| | | if (form3.getglassId() != null && form3.getglassId() != "") { |
| | | if(form3.getglassId()!=null&&form3.getglassId()!=""){ |
| | | jsonObject.append("form3", form3); |
| | | } |
| | | // 获取出片队列信息 |
| | |
| | | out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId())); |
| | | } |
| | | jsonObject.append("listoutslice", listoutslice); |
| | | // 获取当前出片队列状态 |
| | | jsonObject.append("isAllowQueue", Plchome.isAllowQueue); |
| | | //获取当前出片队列状态 |
| | | jsonObject.append("isAllowQueue",Plchome.isAllowQueue); |
| | | |
| | | // 获取铝框idDB106.DBW64 |
| | | //获取铝框idDB106.DBW64 |
| | | // String frameno=spianService.queGlassid("DB106.24",14).toString(); |
| | | // if(frameno!=Plchome.FrameNo){ |
| | | // Plchome.FrameNo=frameno; |
| | | // Plchome.FrameNo=frameno; |
| | | // } |
| | | // Plchome.FrameNo="123"; |
| | | // try { |
| | | // north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo); |
| | | // north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo); |
| | | // } catch (SQLException e) { |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // } |
| | | // 是否需要人工确认上片玻璃 |
| | | //是否需要人工确认上片玻璃 |
| | | jsonObject.append("isConfirm", isConfirm); |
| | | |
| | | // 铝框线交互 |
| | | //铝框线交互 |
| | | |
| | | // //铝框id请求字 |
| | | // List<Short> framerequest = S7control.getinstance().ReadWord("铝框id请求字地址", 1); |
| | | // if(framerequest!=null){ |
| | | // //铝框id |
| | | // String franmeno= spianService.queGlassid("铝框id地址", 14).toString(); |
| | | // String position; |
| | | // try { |
| | | // position=dbserve.SelectPositionByFrameBarcode(franmeno); |
| | | // } catch (SQLException e) { |
| | | // // TODO Auto-generated catch block |
| | | // position="0"; |
| | | // e.printStackTrace(); |
| | | // //铝框id |
| | | // String franmeno= spianService.queGlassid("铝框id地址", 14).toString(); |
| | | // String position; |
| | | // try { |
| | | // position=dbserve.SelectPositionByFrameBarcode(franmeno); |
| | | // } catch (SQLException e) { |
| | | // // TODO Auto-generated catch block |
| | | // position="0"; |
| | | // e.printStackTrace(); |
| | | // } |
| | | // Short send; |
| | | // if(position=="0"){ |
| | | // send=0; |
| | | // }else{ |
| | | // send=1; |
| | | // } |
| | | // S7control.getinstance().WriteWord("铝框翻转发送地址", (short)send); |
| | | // } |
| | | // Short send; |
| | | // if(position=="0"){ |
| | | // send=0; |
| | | // }else{ |
| | | // send=1; |
| | | // } |
| | | // S7control.getinstance().WriteWord("铝框翻转发送地址", (short)send); |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class); |
| | | boolean dbconnected = false; |
| | | try { |
| | |
| | | sendwServer.sendMessage(jsonObject.toString()); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | List<String> Intlist = new ArrayList<>(); |
| | | for (Short value : plclist) { |
| | | Intlist.add(value == 1 ? "自动" : "手动"); |
| | | Intlist.add(value == 1 ? "AUTO" : "Manual"); |
| | | |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | |
| | | import com.example.springboot.mapper.HomeMapper; |
| | | import com.example.springboot.mapper.SpianMapper; |
| | | import com.example.springboot.security.constant.SystemConstant; |
| | | import com.example.springboot.security.util.JwtUtil; |
| | | import com.example.springboot.security.util.SecurityUtil; |
| | | import com.example.springboot.service.HomeService; |
| | | import com.example.springboot.service.JdbcConnections; |
| | | import com.example.springboot.service.North_Glass_Buffer1Service; |
| | | import com.example.springboot.service.OutSliceServive; |
| | | import com.example.springboot.service.PermissionService; |
| | | import com.example.springboot.service.SpianService; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | |
| | | import com.example.springboot.common.Result; |
| | | import com.example.springboot.component.Plchome; |
| | | import com.example.springboot.component.S7control; |
| | | import com.example.springboot.entity.CarPosition; |
| | | import com.example.springboot.entity.StorageCage; |
| | | import com.example.springboot.entity.User; |
| | | import com.example.springboot.entity.alarmmg; |
| | | import com.example.springboot.entity.north_glass_buffer1; |
| | | import com.example.springboot.entity.Out_slice; |
| | | import com.example.springboot.entity.Permission; |
| | | import com.example.springboot.entity.Queue; |
| | | import com.example.springboot.entity.RolePermission; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | @RestController |
| | | @RequestMapping("/home") |
| | |
| | | @Autowired |
| | | private JdbcConnections jdbcConnections; |
| | | |
| | | // 获取当前登录用户权限 |
| | | @GetMapping("/SelectPermissionByUserName") |
| | | public Result SelectPermissionByUserName(String username) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<RolePermission> permission = homeMapper.SelectPermissionByUserName(username); |
| | | map.put("permission", permission); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 查询理片笼使用情况 |
| | | @GetMapping("/load") |
| | | public Result selectAll() { |
| | |
| | | // 查询理片笼玻璃情况 |
| | | @GetMapping("/loads") |
| | | public Result selectRack() { |
| | | |
| | | List<StorageCage> storageCagelist1 = homeMapper.selectRack1(); |
| | | List<StorageCage> storageCagelist2 = homeMapper.selectRack2(); |
| | | List<StorageCage> storageCagelist3 = homeMapper.selectRack3(); |
| | |
| | | north_glass_buffer1 north_glass_buffer1 = jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(glassid, "", ""); |
| | | String flip = jdbcConnections.SelectFlipByFrameBarcode(north_glass_buffer1.getFrameBarcode()); |
| | | String position = jdbcConnections.SelectPositionByFrameBarcode(north_glass_buffer1.getFrameBarcode()); |
| | | int sequence=homeMapper.SelectMaxSquence(); |
| | | int sequence = homeMapper.SelectMaxSquence(); |
| | | homeMapper.AddOutSliceS(glassid, flip, north_glass_buffer1.getFrameBarcode(), |
| | | north_glass_buffer1.getglasslengthmm().toString(), north_glass_buffer1.getglassheightmm().toString(),sequence,position); |
| | | north_glass_buffer1.getglasslengthmm().toString(), north_glass_buffer1.getglassheightmm().toString(), |
| | | sequence, position); |
| | | map.put("message2", "200"); |
| | | } else { |
| | | map.put("message2", "500"); |
| | |
| | | @PostMapping("/SelectAluminumFrameInfoById") |
| | | public Result SelectAluminumFrameInfoById(String FrameBarcode) throws SQLException { |
| | | String flip = jdbcConnections.SelectFlipByFrameBarcode(FrameBarcode); |
| | | List<north_glass_buffer1> listAluminumFrame=north_Glass_Buffer1Service.SelectAluminumFrameInfoById(FrameBarcode); |
| | | List<north_glass_buffer1> listAluminumFrame = north_Glass_Buffer1Service.SelectAluminumFrameInfoById(FrameBarcode); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("listAluminumFrame", listAluminumFrame); |
| | | map.put("flip", flip); |
| | |
| | | Plchome.isAllowQueue = isAllowQueue; |
| | | if (isAllowQueue == true) { |
| | | for (Out_slice out_slice2 : out_slice) { |
| | | homeMapper.UpdateOutSliceSequence(out_slice2.getGlassId(),out_slice2.getSequence()); |
| | | homeMapper.UpdateOutSliceSequence(out_slice2.getGlassId(), out_slice2.getSequence()); |
| | | } |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | import com.example.springboot.entity.north_glass_buffer1; |
| | | import com.example.springboot.entity.Out_slice; |
| | | import com.example.springboot.entity.Queue; |
| | | import com.example.springboot.entity.RolePermission; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @Select("select ifnull(max(sequence),0)+1 from out_slice ") |
| | | Short SelectMaxSquence(); |
| | | |
| | | @Select("select rp.* from role_permission rp inner join role r on rp.role_id=r.id and r.name=#{token} and (permission_id=32 or permission_id=33 or permission_id=34 or permission_id=35)") |
| | | List<RolePermission> SelectPermissionByUserName(String token); |
| | | |
| | | } |
| | |
| | | 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 |
| | | |
| | |
| | | @Select("select cage,cell,tier,id,ROUND(id/2)as prcId,width from storage_cage where cage=#{cage1} and cell=#{cell} and state=0 and disabled=0 and width>=#{width} ORDER BY cell asc,tier asc LIMIT 1") |
| | | StorageCage selectCage1(int cage1,int cell,double width); |
| | | //判断笼子内玻璃数 |
| | | @Select("select COUNT(tier)as tier from storage_cage where cage=#{cage} and cell=#{cell} and state=1;") |
| | | @Select("select COUNT(tier)as tier from storage_cage where cage=#{cage} and cell=#{cell} and state!=0;") |
| | | int selectsum(int cage,int cell); |
| | | //完成进片中的玻璃状态 |
| | | @Update("update storage_cage set state=#{state} where glass_id=#{glassid};") |
| | |
| | | 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 glass_id=#{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} and state=3;") |
| | | void UpdataGlassCage(String glassid,int state); |
| | | //改变玻璃状态为出片中 |
| | | @Update("update storage_cage as a set state=#{state} where glass_id=#{glassid};") |
| | |
| | | spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度 |
| | | spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString());// 新增任务 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | System.out.println("汇报时任务|" + datas); |
| | | |
| | | }else{ |
| | | // 数据库修改笼子表新增一条玻璃 |
| | |
| | | spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度 |
| | | spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString());// 新增任务 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | System.out.println("汇报时任务|" + datas); |
| | | |
| | | |
| | | // S7control.getinstance().WriteByte("DB105.16",glassid); |
| | | } |