From a62fc01c617ed7d6837d897a120905c2b307ad89 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期一, 22 一月 2024 09:02:28 +0800
Subject: [PATCH] 增加汇报写入判断限制
---
springboot-vue3/src/main/resources/config.properties | 6
CanadaMes-ui/src/views/home/index.vue | 156 ++++++++-----
springboot-vue3/src/main/java/com/example/springboot/component/PlcLayout.java | 116 ++++++++++
CanadaMes-ui/src/configuration/InteractionState.json | 4
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java | 72 ++++--
CanadaMes-ui/src/views/Electrical/Parameter2.vue | 3
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java | 5
CanadaMes-ui/src/views/Electrical/InteractionState.vue | 2
springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java | 2
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java | 42 ++-
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java | 73 +++--
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java | 4
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java | 17 +
CanadaMes-ui/src/lang/locales/zh-CN.json | 3
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java | 27 +-
springboot-vue3/src/main/java/com/example/springboot/component/PlcInteractionState.java | 10
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java | 45 ++--
CanadaMes-ui/src/api/home.js | 4
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview.java | 8
CanadaMes-ui/src/lang/locales/en-US.json | 4
springboot-vue3/src/main/java/com/example/springboot/component/PlcManualonePosition.java | 26 +
21 files changed, 431 insertions(+), 198 deletions(-)
diff --git a/CanadaMes-ui/src/api/home.js b/CanadaMes-ui/src/api/home.js
index 905bef3..ed2fb1a 100644
--- a/CanadaMes-ui/src/api/home.js
+++ b/CanadaMes-ui/src/api/home.js
@@ -286,9 +286,9 @@
})
}
-export function SwitchScanMethod(scansmethod) {s
+export function SwitchScanMethod(scansmethod) {
return request({
- url: '/home/SwitchScanMethod?Scanmethod='+scanmethod,
+ url: '/home/SwitchScanMethod?scansmethod='+scansmethod,
method: 'post',
data:""
})
diff --git a/CanadaMes-ui/src/configuration/InteractionState.json b/CanadaMes-ui/src/configuration/InteractionState.json
index c89820d..6011afe 100644
--- a/CanadaMes-ui/src/configuration/InteractionState.json
+++ b/CanadaMes-ui/src/configuration/InteractionState.json
@@ -334,7 +334,7 @@
"max":9999
},
{
- "name": "B01灏忚溅褰撳墠浠诲姟浣�",
+ "name": "B01灏忚溅褰撳墠浠诲姟浣嶇疆",
"read": 22,
"sending": 0,
"unit": "mm",
@@ -368,7 +368,7 @@
}, "type": "1"
},
{
- "name": "B02灏忚溅褰撳墠浣嶇疆",
+ "name": "B02灏忚溅褰撳墠浠诲姟浣嶇疆",
"read": 22,
"sending": 0,
"unit": "mm",
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 2a568e0..562e83d 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -1,6 +1,6 @@
{
-
- "ip": "localhost",
+ "Clear":"Clear",
+ "ip":"localhost",
"systemTitle": "Login System",
"usernamePlaceholder": "Please enter username",
"passwordPlaceholder": "Please enter password",
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index 5273df5..1135939 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -1,5 +1,6 @@
{
- "ip": "localhost",
+ "Clear":"娓呴櫎",
+ "ip":"localhost",
"systemTitle": "鐧诲綍绯荤粺",
"usernamePlaceholder": "璇疯緭鍏ョ敤鎴峰悕",
"passwordPlaceholder": "璇疯緭鍏ュ瘑鐮�",
diff --git a/CanadaMes-ui/src/views/Electrical/InteractionState.vue b/CanadaMes-ui/src/views/Electrical/InteractionState.vue
index 456c315..6bc920a 100644
--- a/CanadaMes-ui/src/views/Electrical/InteractionState.vue
+++ b/CanadaMes-ui/src/views/Electrical/InteractionState.vue
@@ -229,7 +229,7 @@
const specialChars = /[^\w\s]/g;
if(obj.zuhe1){
-//console.log(obj);
+console.log(obj);
for (let i = 0; i < jsondata2.length; i++) {
const item = jsondata2[i];
diff --git a/CanadaMes-ui/src/views/Electrical/Parameter2.vue b/CanadaMes-ui/src/views/Electrical/Parameter2.vue
index ddcf02d..df63997 100644
--- a/CanadaMes-ui/src/views/Electrical/Parameter2.vue
+++ b/CanadaMes-ui/src/views/Electrical/Parameter2.vue
@@ -285,6 +285,9 @@
},
updateButtonValue(dataGroup, itemIndex) {
+ console.log(dataGroup)
+ console.log(itemIndex)
+
if (dataGroup[itemIndex].button.value2 === 1) {
// 濡傛灉褰撳墠鎸夐挳鐨勫�兼槸 0锛屽皢鍏惰涓� 1
this.$set(dataGroup[itemIndex].button, "value2", 0);
diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index b1e9558..c7eab6f 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -252,7 +252,7 @@
<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"
:class="ManuallyInfeedGlass == true ? 'hide' : ''"></el-input> -->
- <el-button type="primary" @click="SelectGlassByGlassIDs(2)" :disabled="ManuallyInfeedGlass"
+ <el-button type="primary" @click="SelectGlassByGlassIDs()" :disabled="ManuallyInfeedGlass"
:class="ManuallyInfeedGlass == true ? 'hide' : ''">
{{ $t('Manually Infeed Glass') }}</el-button>
<el-button type="primary" @click="showform2()" :disabled="OrderInfo"
@@ -375,37 +375,70 @@
<div class="device" :style="'top: 262px;left: 150px;background-color: ' + ShowDeviceList(8) + ';'">D05</div>
<div class="device" :style="'top: 339px;left: 150px;background-color: ' + ShowDeviceList(9) + ';'">D06</div>
- <div class="glass D01" style="top: 54px;left: 1055px;position: absolute;"
- @click="ClearGlassId('DB101.9.2', 0)">{{ ShowGlassIdList(0) }}</div>
- <div class="glass D02" style="top: 132px;left: 1055px;position: absolute;"
- @click="ClearGlassId('DB101.9.2', 1)">{{ ShowGlassIdList(1) }}</div>
- <div class="glass B01" style="top: 270px;left: 640px;position: absolute;"
- @click="ClearGlassId('DB101.10.2', 2)">
- B01:{{ ShowGlassIdList(2) }}</div>
- <div class="glass B02" style="top: 290px;left: 640px;position: absolute;"
- @click="ClearGlassId('DB101.10.3', 3)">B02:{{ ShowGlassIdList(3) }}</div>
- <div class="glass A01" style="top: 270px;left: 289px;position: absolute;"
- @click="ClearGlassId('DB101.10.0', 4)">
- A01.1:{{ ShowGlassIdList(4) }}</div>
+ <div class="glass D01" style="top: 39px;left: 1055px;position: absolute;">{{ ShowGlassIdList(0) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 0)">
+ {{ $t('Clear') }}</el-button>
+ </div>
+ <div class="glass D02" style="top: 117px;left: 1055px;position: absolute;">{{ ShowGlassIdList(1) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 1)">
+ {{ $t('Clear') }}</el-button>
+ </div>
+ <div class="glass B01" style="top: 270px;left: 640px;position: absolute;">
+ B01:{{ ShowGlassIdList(2) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2', 2)">
+ {{ $t('Clear') }}</el-button>
+ </div>
+ <div class="glass B02" style="top: 315px;left: 640px;position: absolute;">B02:{{ ShowGlassIdList(3) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.3', 3)">
+ {{ $t('Clear') }}</el-button>
+ </div>
+ <div class="glass A01" style="top: 270px;left: 289px;position: absolute;">
+ A01.1:{{ ShowGlassIdList(4) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.0', 4)">
+ {{ $t('Clear') }}</el-button>
+ </div>
- <div class="glass A01" style="top: 290px;left: 289px;position: absolute;"
- @click="ClearGlassId('DB101.10.1,5')">A01.2:{{ ShowGlassIdList(5) }}</div>
+ <div class="glass A01" style="top: 315px;left: 289px;position: absolute;">A01.2:{{ ShowGlassIdList(5) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1,5', 5)">
+ {{ $t('Clear') }}</el-button>
+ </div>
- <div class="glass A02" style="top: 310px;left: 289px;position: absolute;"
- @click="ClearGlassId('DB101.10.2,6')">A02:{{ ShowGlassIdList(6) }}</div>
+ <div class="glass A02" style="top: 360px;left: 289px;position: absolute;">A02:{{ ShowGlassIdList(6) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2,6', 6)">
+ {{ $t('Clear') }}</el-button>
+ </div>
- <div class="glass D03" style="top: 137px;left: 42px;position: absolute;"
- @click="ClearGlassId('DB101.9.4', 7)">
- {{ ShowGlassIdList(7) }}</div>
- <div class="glass D04" style="top: 213px;left: 42px;position: absolute;"
- @click="ClearGlassId('DB101.9.5', 8)">
- {{ ShowGlassIdList(8) }}</div>
- <div class="glass D05" style="top: 290px;left: 42px;position: absolute;"
- @click="ClearGlassId('DB101.9.6', 9)">
- {{ ShowGlassIdList(9) }}</div>
- <div class="glass D06" style="top: 367px;left: 42px;position: absolute;"
- @click="ClearGlassId('DB101.9.5', 10)">
- {{ ShowGlassIdList(10) }}</div>
+ <div class="glass D03" style="top: 122px;left: 42px;position: absolute;">
+ {{ ShowGlassIdList(7) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.4', 7)">
+ {{ $t('Clear') }}</el-button>
+ </div>
+ <div class="glass D04" style="top: 198px;left: 42px;position: absolute;">
+ {{ ShowGlassIdList(8) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.5', 8)">
+ {{ $t('Clear') }}</el-button>
+ </div>
+ <div class="glass D05" style="top: 275px;left: 42px;position: absolute;">
+ {{ ShowGlassIdList(9) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.6', 9)">
+ {{ $t('Clear') }}</el-button>
+ </div>
+ <div class="glass D06" style="top: 352px;left: 42px;position: absolute;">
+ {{ ShowGlassIdList(10) }}
+ <br />
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.5', 10)">
+ {{ $t('Clear') }}</el-button>
+ </div>
</div>
@@ -573,29 +606,29 @@
}}</el-button>
</el-form-item> -->
<el-form-item>
- {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Not Allow') : $t('Allow') }}
+ {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}
<el-button type="primary" @click="isConfirmState()">
- {{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}</el-button>
+ {{ this.isConfirm == true ? $t('Not Allow') : $t('Allow') }}</el-button>
</el-form-item>
<el-form-item>
- {{ $t('Current State') }}:{{ this.Scanningmethod==true?$t('Automatic'):$t('Hand Movement')}}
+ {{ $t('Current State') }}:{{ this.Scanningmethod == false ? $t('Automatic') : $t('Hand Movement') }}
<el-button type="primary" @click="SwitchScanMethod()">{{ $t('Switch')
}}</el-button>
</el-form-item>
<el-form-item>
- <el-input style="width:70%;" maxlength="14" :placeholder="$t('Enter the glass barcode')"
+ <el-input style="width:70%;" maxlength="13" :placeholder="$t('Enter the glass barcode')"
v-model="glassid1"></el-input>
- <el-button type="primary" :disabled="Scanningmethod" @click="WriteGlassID()">{{ $t('Add')
+ <el-button type="primary" :disabled="!Scanningmethod" @click="WriteGlassID()">{{ $t('Add')
}}</el-button>
</el-form-item>
<el-form-item>
{{ $t('Barcode') }}:
- <el-input style="width:70%;" maxlength="14" :disabled="true" v-model="glassid1"></el-input>
+ <el-input style="width:70%;" maxlength="14" :disabled="true" v-model="CurrrentGlassId"></el-input>
</el-form-item>
</div>
<div style="display: flex;justify-content: space-around;">
<label for="">{{ $t('Upper film position') }}</label>
-
+
<label for="">{{ $t('Scan Code Point') }}</label>
</div>
<div style="display: flex;justify-content: space-around;height: 40px;">
@@ -701,11 +734,11 @@
{{ $t('Confirm') }}</el-button>
</div>
</el-form>
- <template #footer>
+ <!-- <template #footer>
<span class="dialog-footer">
<el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
</span>
- </template>
+ </template> -->
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible6" :title="$t('Outing Queue')" top="5vh">
@@ -980,12 +1013,12 @@
CurrentFrame: [],
DeviceList: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
GlassIdList: [],
- Scanningmethod: true
+ Scanningmethod: true,
+ CurrrentGlassId: ""
};
},
created() {
this.load();
-
this.init();
}
,
@@ -1028,12 +1061,13 @@
this.alarm = obj.alarmmg[0];
//鑾峰彇褰撳墠鎵爜鏂瑰紡
if (obj.Scanningmethod != null) {
- if (obj.Scanningmethod == 0) {
- this.Scanningmethod = true;
- }
- else {
- this.Scanningmethod = false;
- }
+ this.Scanningmethod = obj.Scanningmethod[0];
+ }
+
+ //鑾峰彇褰撳墠鎵爜鏋幓鐠僫d
+ if (obj.CurrrentGlassId != null) {
+ const specialChars = /[^\w\s]/g;
+ this.CurrrentGlassId = obj.CurrrentGlassId[0].replace(specialChars, "");
}
//鏌ヨ褰撳墠閾濇淇℃伅
@@ -1120,10 +1154,13 @@
} else {
this.form3 = {};
}
+
if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) {
this.loadglassheight1 = 70;
+ if (this.form5.glassId != obj.form3[0].glassId) {
+ this.showform3();
+ }
this.form5 = obj.form3[0];
- this.showform3();
this.glassid1 = "";
if (this.D01RequestState == true) {
this.Sizerange(this.form5, 3);
@@ -1256,6 +1293,7 @@
},
//鎵嬪姩涓婄墖
sbumitglassid() {
+ console.log(1111111);
if (this.form.order != "") {
if (this.form.height < 380 || this.form.width < 390 || this.form.height > 1810 || this.form.width > 2760) {
this.$message.error(this.$t('The glass size is not within the range'));
@@ -1318,17 +1356,17 @@
},
//鎵嬪姩鍐欏叆plc鎵爜浣嶇幓鐠僫d
WriteGlassID() {
- if (this.glassid1.length ==14) {
+ if (this.glassid1.length == 14) {
WriteGlassID(this.glassid1).then(res => {
console.log(res.data);
this.$message.success(this.$t('Successful operation'));
});
- }else{
+ } else {
this.$message.error(this.$t('Please enter the correct glassID'));
}
},
//鑾峰彇鎵爜浣嶅拰涓婄墖浣嶆暟鎹�
- SelectGlassByGlassIDs(parameter) {
+ SelectGlassByGlassIDs() {
this.showform3();
// if (parameter == 1) {
// SelectGlassByGlassID(this.glassid2).then(res => {
@@ -1629,6 +1667,9 @@
if (res.data.message == 200) {
this.form5 = {};
this.$message.success(this.$t('Operation successful'));
+ }
+ else if (res.data.message == 400) {
+ this.$message.error(this.$t('The glass size is not within the range'));
} else {
this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
}
@@ -2039,8 +2080,9 @@
//娓呴櫎鐜荤拑id
ClearGlassId(position, num) {
if (this.ClearGlassID == false) {
- if (this.DeviceList[position] == 0) {
- if (this.GlassIdList[num].length == 14) {
+ console.log(this.DeviceList, num);
+ if (this.DeviceList[num] == 0) {
+ if (this.GlassIdList[num].length <= 14) {
this.$confirm(this.$t('Are you sure to clear this barcode ?'), this.$t('confirm'), {
confirmButtonText: this.$t('Yes'),
cancelButtonText: this.$t('No'),
@@ -2098,14 +2140,8 @@
});
},
//鍒囨崲浜岀淮鐮佽幏鍙栨柟寮�
- SwitchScanMethod(){
- var Scanmethod;
- if(this.Scanningmethod == true){
- this.Scanmethod = 1;
- }else{
- this.Scanmethod = 0;
- }
- SwitchScanMethod(Scanmethod).then(res => {
+ SwitchScanMethod() {
+ SwitchScanMethod(!this.Scanningmethod).then(res => {
if (res.data.message == 200) {
this.$message.success(this.$t('Operation successful'));
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview.java b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview.java
index b1c3859..31a404a 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview.java
@@ -26,10 +26,10 @@
this.storageCageService = storageCageService;
this.plcParameterObject = new PlcParameterObject();
this.plcBitObject = new PlcBitObject();
- String jsonFilePath = "JsonFile/PlcParameter.json";
- InitUtil.initword(jsonFilePath); // 鍒濆鍖� PlcParameterObject
- String jsonFilePath2 = "JsonFile/PlcSign.json";
- InitUtil.initbit(jsonFilePath2); // 鍒濆鍖� PlcSign
+ // String jsonFilePath = "JsonFile/PlcParameter.json";
+ // InitUtil.initword(jsonFilePath); // 鍒濆鍖� PlcParameterObject
+ // String jsonFilePath2 = "JsonFile/PlcSign.json";
+ // InitUtil.initbit(jsonFilePath2); // 鍒濆鍖� PlcSign
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
index 5129112..0b9ea37 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -1,5 +1,6 @@
package com.example.springboot.component;
+import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.service.JdbcConnections;
@@ -24,11 +25,12 @@
while (this != null) {
try {
- Thread.sleep(50);
+ Thread.sleep(100);
} catch (InterruptedException e) {
// \\ TODO Auto-generated catch block
e.printStackTrace();
}
+
// if (S7control.getinstance().CheckConnected() == false) {
spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
@@ -41,10 +43,19 @@
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
-
+
// 鍑虹墖浠诲姟////////////////////////////////
List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 鍑虹墖杞︾姸鎬�
List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 鍑虹墖浠诲姟鏄惁鍚姩
+
+ boolean Plcadd = spianService.listbool("DB106.62"); // 鍑虹墖璇锋眰瀛�
+
+ if(Plcadd==false){
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负0
+ }
+
+
+
// StringBuilder writedstrIdOut = new StringBuilder();
// 鑾峰彇宸蹭笅鍙戠殑鍑虹墖id
byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14);
@@ -82,6 +93,8 @@
if (outstate == true) {// 褰撳嚭鐗囪溅绌洪棽鏃�,涓斿嚭鐗囧惎鍔ㄤ负1鏃讹紝浠诲姟鍚姩鏀逛负0
if (outstate1 == true) {
S7control.getinstance().WriteWord("DB105.18", (short) 0);// 鍑虹墖浠诲姟鍚姩鏀逛负0
+ System.out.println("鍏抽棴鍚姩" + LocalDateTime.now());
+
}
}
}
@@ -92,30 +105,51 @@
List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.16", 1);// 鑾峰彇杩涚墖杞︿换鍔℃槸鍚﹀惎鍔�
boolean B01backs = spianService.listbool("DB106.60");// b01姹囨姤
- boolean B02backs = spianService.listbool("DB106.62");// b02姹囨姤
+ boolean B02backs = spianService.listbool("DB106.62");// b02姹囨姤
StringBuilder B01glassid = spianService.queGlassid("DB103.184", 14);// BO1鐨勭幓鐠僫d
StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02鐨勭幓鐠僫d
// 褰撹繘鐗囧皬杞﹀畬鎴愪换鍔℃椂
if (B01backs == true) {
- // 褰揃01灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬� 涓�1
- // spianService.overtask(B01glassid.toString());// 瀹屾垚浠诲姟
- // S7control.getinstance().WriteWord("DB106.60", (short) 0);// 鎭㈠B01灏忚溅搴旂瓟鏀逛负0
- boolean yingda = spianService.listbool("DB106.60");// b01姹囨姤
- System.out.println("姹囨姤鏃禕01|绗�" + aaa + "娆�" + B01glassid + "搴旂瓟" + yingda);
- aaa += 1;
+ // 鍒ゆ柇鏄惁姹囨姤姝g‘鐨刬d
+ int HB = spianMapper.SelectHB(B01glassid.toString());
+ if (HB > 0) {
+ // 褰揃01灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬� 涓�1
+ S7control.getinstance().WriteWord("DB106.60", (short) 0);// 鎭㈠B01灏忚溅搴旂瓟鏀逛负0
+ boolean yingda = spianService.listbool("DB106.60");// b01姹囨姤
+ if (yingda == false) {
+ spianService.overtask(B01glassid.toString());// 瀹屾垚浠诲姟
+ }
+ System.out.println("姹囨姤鏃禕01|绗�" + aaa + "娆�" + B01glassid + "搴旂瓟" + yingda);
+ aaa += 1;
+ }
+
}
// 褰撳嚭鐗囧皬杞﹀畬鎴愪换鍔℃椂
if (B02backs == true) {
- // 褰揃02灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬佷负0
- // spianService.overtask(B02glassid.toString());// 瀹屾垚浠诲姟
- // S7control.getinstance().WriteWord("DB106.62", (short) 0);// 鎭㈠B02灏忚溅搴旂瓟鏀逛负0
+ // 鍒ゆ柇鏄惁姹囨姤姝g‘鐨刬d
+ int HB = spianMapper.SelectHB(B02glassid.toString());
System.out.println("姹囨姤鏃禕02|" + B02glassid);
- boolean yingda1 = spianService.listbool("DB106.62");// b02姹囨姤
- System.out.println("姹囨姤鏃禕02|绗�" + aaa + "娆�" + B02glassid + "搴旂瓟" + yingda1);
+ if (HB > 0) {
+ // 褰揃02灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬佷负0
+
+ S7control.getinstance().WriteWord("DB106.62", (short) 0);// 鎭㈠B02灏忚溅搴旂瓟鏀逛负0
+ System.out.println("姹囨姤鏃禕02|" + B02glassid);
+ boolean yingda = spianService.listbool("DB106.62");// b02姹囨姤
+ if (yingda == false) {
+ spianService.overtask(B02glassid.toString());// 瀹屾垚浠诲姟
+ }
+ System.out.println("姹囨姤鏃禕02|绗�" + aaa + "娆�" + B02glassid + "搴旂瓟" + yingda);
+ }
}
+
+
+ boolean Plcout = spianService.listbool("DB106.62"); // 杩涚墖璇锋眰瀛�
+ if(Plcout==false){
+ S7control.getinstance().WriteWord("DB105.18", (short) 0);// 杩涚墖浠诲姟鍙戦�佸瓧鏀逛负0
+ }
// 鑾峰彇DO1鏁版嵁
@@ -140,6 +174,7 @@
}
}
+
if (queueid2 != null) {
// 鍐欏叆D02鐨勬暟鎹埌涓婄墖闃熷垪琛�
if (glass2 == null) {
@@ -154,14 +189,7 @@
}
- // if (outstate == true) { // 鍑虹墖杞︾姸鎬佺┖闂叉椂
- // Integer state = spianMapper.Selectoutstate();
- // String orderid = spianMapper.SelectOrderout();
-
- // if (orderid != null && state == 0) {
- // spianService.selectout(orderid);
- // }
- // }
+
// 鏌ヨ鏁版嵁搴�
// 鎺ㄩ�佸埌鍓嶇
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcInteractionState.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcInteractionState.java
index 416ae25..4da5ad7 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcInteractionState.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcInteractionState.java
@@ -59,6 +59,9 @@
List<String> addresses5 = Arrays.asList(config.getProperty("PlcInteractionState.MEStaskinformation").split(","));
List<String> arraylist5 = S7control.getinstance().readStringsandword(addresses5);
+ List<String> addresses6 = Arrays.asList(config.getProperty("PlcInteractionState.MEStaskinformation2").split(","));
+ List<String> arraylist6 = S7control.getinstance().readStringsandword(addresses6);
+
// String[] values = { ".x11","x21 ","x21 ","x21 ","x21 ","x21"};
// List<String> arraylist = new ArrayList<>(Arrays.asList(values));
@@ -68,8 +71,12 @@
// List<String> arraylist3 = new ArrayList<>(Arrays.asList(values3));
// String[] values4 = { ".x11 ","x21 ","x21 ","x21 "};
// List<String> arraylist4 = new ArrayList<>(Arrays.asList(values4));
-// String[] values5 = { ".x11 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 "};
+// String[] values5 = { ".x11 ","x21 ","x21 ","b02","x21 ","x21 "};
// List<String> arraylist5 = new ArrayList<>(Arrays.asList(values5));
+//
+// String[] values6 = { "x21 ","x21 ","x21 ","x21 ","x21 ","x21 ","x21 "};
+// List<String> arraylist6 = new ArrayList<>(Arrays.asList(values6));
+
JSONObject jsonObject = new JSONObject();
@@ -80,6 +87,7 @@
jsonArray.put(arraylist3);
jsonArray.put(arraylist4);
jsonArray.put(arraylist5);
+ jsonArray.put(arraylist6);
jsonObject.put("zuhe1", jsonArray);
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcLayout.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcLayout.java
new file mode 100644
index 0000000..9e9128f
--- /dev/null
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcLayout.java
@@ -0,0 +1,116 @@
+package com.example.springboot.component;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import com.example.springboot.service.*;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.example.springboot.entity.Out_slice;
+import com.example.springboot.entity.Queue;
+import com.example.springboot.entity.StorageCage;
+import com.example.springboot.entity.alarmmg;
+import com.example.springboot.entity.north_glass_buffer1;
+import com.example.springboot.mapper.HomeMapper;
+import com.example.springboot.mapper.SpianMapper;
+
+public class PlcLayout extends Thread {
+
+ @Autowired
+ private HomeMapper homeMapper;
+ @Autowired
+ // 鍑虹墖闃熷垪鏄惁鍏佽鍑虹墖
+ public static Boolean isAllowQueue = true;
+ public static Boolean isAllowReordering = true;
+ // 鍑虹墖闃熷垪璀﹀憡
+ public static Boolean isQueueWarning = false;
+ // 閾濇id
+ public static String FrameNo = "";
+ // 鏄惁闇�瑕佹墜鍔ㄧ‘璁ょ幓鐠�
+ public static Boolean isConfirm = false;
+ // 寰呯‘璁ょ殑鍑虹墖闃熷垪
+ public static List<north_glass_buffer1> AluminumFrame;
+
+ // private Configuration config;
+
+ private StorageCageService storageCageService;
+
+ // public Plchome() throws IOException {
+ // config = new Configuration("config.properties");
+ // }
+
+ // public static Map b=new HashMap<>();
+ // b.put()
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ JSONObject jsonObject = new JSONObject();
+
+ // 娉ㄥ叆mapper
+
+ homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
+
+
+ if (S7control.getinstance().CheckConnected() == true) {
+
+
+
+ // 鏌ヨ鎶ヨ淇℃伅
+ List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo();
+ jsonObject.append("alarmmg", alarmmg);
+
+ // 澶嶄綅鍊掕鏃�
+ // 鍦板潃104.9.6
+ List<Boolean> countdown = S7control.getinstance().ReadBits("DB104.9.6", 1);
+ for (Boolean countdowns : countdown) {
+ jsonObject.append("countdown", countdowns);
+ }
+ // jsonObject.append("countdown", true);
+ // 澶嶄綅瀹屾垚淇″彿ss
+ List<Boolean> resetss = S7control.getinstance().ReadBits("DB103.284", 1);
+ for (Boolean reset : resetss) {
+ jsonObject.append("reset", reset);
+ }
+
+ // 鏄惁鎬ュ仠
+ List<Boolean> emergencystops = S7control.getinstance().ReadBits("DB104.5.1", 1);
+ for (Boolean emergencystop : emergencystops) {
+ jsonObject.append("emergencystop", emergencystop);
+ }
+
+ }
+
+ // jsonObject.append("params", new short[] { 30, 40, });
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Layout");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ webserver.sendMessage(jsonObject.toString());
+
+ if (webserver != null) {
+
+ List<String> messages = webserver.getMessages();
+
+ if (!messages.isEmpty()) {
+ // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+ webserver.clearMessages();
+ }
+
+ }
+
+ }
+ }
+ }
+ }
+}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcManualonePosition.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcManualonePosition.java
index 6247785..fa3faf1 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcManualonePosition.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcManualonePosition.java
@@ -108,6 +108,20 @@
List<String> B02start = Arrays.asList(config.getProperty("mlp.B02start"));
+ // 鏁呴殰鍦板潃
+ List<String> waddresses5 = Arrays.asList(config.getProperty("PlcManualonePosition.fault2").split(","));
+
+
+ // 澶嶄綅鍦板潃
+ List<String> waddresses6 = Arrays.asList(config.getProperty("PlcManualonePosition.Reset").split(","));
+ List<Boolean> readreast = S7control.getinstance().readBits(waddresses6);
+ short[] reast6 = PLCBooleanConverter.convertListsToBinaryShortArray(readreast);
+
+ // 鍥為浂鍦板潃
+ List<String> waddresses7 = Arrays.asList(config.getProperty("PlcManualonePosition.Zero").split(","));
+ List<Boolean> readhuiling = S7control.getinstance().readBits(waddresses7);
+ short[] huiling7 = PLCBooleanConverter.convertListsToBinaryShortArray(readhuiling);
+
List<Boolean> A01readstart = S7control.getinstance().readBits(A01start);
List<Boolean> A02readstart = S7control.getinstance().readBits(A02start);
List<Boolean> B01readstart = S7control.getinstance().readBits(B01start);
@@ -163,6 +177,8 @@
jsonObject.append("guzhang", params2);
jsonObject.append("weihuiling", params3);
jsonObject.append("qidong", combinedBinaryShortArray);
+ jsonObject.append("fuwei", reast6);
+ jsonObject.append("huiling", huiling7);
// WebSocketServer sendwServer = WebSocketServer.sessionMap.get("ManualonePosition");
// if (sendwServer != null) {
@@ -179,16 +195,6 @@
List<String> messages = webserver.getMessages();
- // 鏁呴殰鍦板潃
- List<String> waddresses5 = Arrays.asList(config.getProperty("PlcManualonePosition.fault2").split(","));
-
-
- // 澶嶄綅鍦板潃
- List<String> waddresses6 = Arrays.asList(config.getProperty("PlcManualonePosition.Reset").split(","));
-
-
- // 鍥為浂鍦板潃
- List<String> waddresses7 = Arrays.asList(config.getProperty("PlcManualonePosition.Zero").split(","));
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
index 2d0c98d..4de113f 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
@@ -28,7 +28,7 @@
FileInputStream fileInputStream;
try {
// 浠庢枃浠朵腑璇诲彇瀛楄妭鏁版嵁瀛樺叆 fileInputStream
- fileInputStream = new FileInputStream("D:/canadames/Alarm.json");
+ fileInputStream = new FileInputStream("D:/code/canadames/Alarm.json");
// 璇诲彇 fileInputStream 涓瓧鑺傚苟灏嗗叾瑙g爜涓哄瓧绗�
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
// 鎻愰珮璇诲彇鏁堢巼锛屽湪 BufferedReader 鍐呭寘瑁� InputStreamReader
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
index 019d969..b8a0c05 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -121,48 +121,57 @@
// List<Short> listd17 = S7control.getinstance().ReadWord("DB17.0",10);
// String id=spianService.queGlassid("DB17.10", 14).toString();
- //
+ //
// // 閾濇绾夸氦浜�
// try {
- // if (CurrentFrame != null) {
- // spianService.outmesid(CurrentFrame.getBarCode(), "DB17.0");
- // }
- // List<Short> framerequests = S7control.getinstance().ReadWord("閾濇id璇锋眰瀛楀湴鍧�", 1);
- // for (Short framerequest : framerequests) {
- // if (framerequest == 1) {
- // // 閾濇id
- // String franmeno = spianService.queGlassid("DB17.10", 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);
- // }
- // }
+ // if (CurrentFrame != null) {
+ // spianService.outmesid(CurrentFrame.getBarCode(), "DB17.0");
+ // }
+ // List<Short> framerequests = S7control.getinstance().ReadWord("閾濇id璇锋眰瀛楀湴鍧�", 1);
+ // for (Short framerequest : framerequests) {
+ // if (framerequest == 1) {
+ // // 閾濇id
+ // String franmeno = spianService.queGlassid("DB17.10", 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);
+ // }
+ // }
// } catch (Exception e) {
- // // TODO: handle exception
+ // // TODO: handle exception
// }
- if (S7control.getinstance().CheckConnected() == true) {
+ // if (S7control.getinstance().CheckConnected() == true) {
// 鑾峰彇褰撳墠鎵爜鏂瑰紡
- List<Short> Scanningmethod = S7control.getinstance().ReadWord("DB103.255", 1);
- jsonObject.append("Scanningmethod", Scanningmethod);
+
+ List<Boolean> Scanningmethods = S7control.getinstance().ReadBits("DB101.11.4", 1);
+ if (Scanningmethods != null) {
+ for (Boolean Scanningmethod : Scanningmethods) {
+ jsonObject.append("Scanningmethod", Scanningmethod);
+ }
+ }
+
+ String CurrrentGlassId = spianService.queGlassid("DB103.256", 14).toString();
+ jsonObject.append("CurrrentGlassId", CurrrentGlassId);
+
// 鑾峰彇D01-D06,A01,A02,B01,B02鐘舵��
List<Short> DeviceList = S7control.getinstance().ReadWord("DB103.0", 10);
jsonObject.append("DeviceList", DeviceList);
// 鑾峰彇D01-D06,A01,A02,B01,B02鐜荤拑id
List<String> GlassIdList = new ArrayList<String>();
- GlassIdList.add(spianService.queGlassid("DB103.40", 14).toString());
+ GlassIdList.add(spianService.queGlassid("DB103.44", 14).toString());
GlassIdList.add(spianService.queGlassid("DB103.58", 14).toString());
GlassIdList.add(spianService.queGlassid("DB103.184", 14).toString());
@@ -285,7 +294,7 @@
// }
// }
- }
+ // }
storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
diff --git a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
index 3511209..6b392e3 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -17,30 +17,29 @@
//
System.out.println("鍚姩瀹屾垚");
- new PlcHold().start();
+ new PlcHold().start();
+
+ new Plchome().start();
+ new PlcLayout().start();
+ new Plcalarm().start();
+
+ new Plcsign().start();
+
+ new Plcstate().start();
+ new PlcPositioning1().start();
+
+ new PlcParameter2().start();
+
+ new PLCAutomaticParameterSetting().start();
+
+ new PlcManualonePosition().start();
+ new PlcManualonePosition2().start();
+ new PlcServoManualone().start();
+ new PLCManualJog().start();
new Plclog().start();
- // new Plchome().start();
-
- // new Plcalarm().start();
-
- // new Plcsign().start();
-
- // new Plcstate().start();
- // new PlcPositioning1().start();
-
- // new PlcParameter2().start();
-
- // new PLCAutomaticParameterSetting().start();
-
- // new PlcManualonePosition().start();
- // new PlcManualonePosition2().start();
- // new PlcServoManualone().start();
- // new PLCManualJog().start();
- // //new Plclog().start();
-
- // new PlcInteractionState().start();
- // new PlcParameter1Review().start();
- // new PLCAutomaticParameterSettingReview().start();
+ new PlcInteractionState().start();
+ //new PlcParameter1Review().start();
+ // new PLCAutomaticParameterSettingReview().start();
}
}
\ No newline at end of file
diff --git a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
index 89bddaa..69666cd 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -275,16 +275,21 @@
@PostMapping("/InsertQueueGlassId")
public Result InsertQueueGlassId(Short id, @RequestBody Queue queue) {
Map<String, Object> map = new HashMap<>();
+ Short zhi=200;
short result = homeMapper.SelectStorageByGlassId(queue.getglassId());
if (result > 0) {
map.put("message", "300");
} else {
- homeMapper.InsertQueueGlassId(queue, id);
+
if (id == 1) {
// 璋冪敤浼嶅瓨鍌ㄨ繃绋�
- spianService.selectAll(queue.getglassId());
+ zhi=spianService.selectAll(queue.getglassId());
+ if(zhi==200){
+ homeMapper.InsertQueueGlassId(queue, id);
+ }
}
- map.put("message", "200");
+
+ map.put("message",zhi);
}
return Result.success(map);
}
@@ -402,7 +407,7 @@
@PostMapping("/WriteGlassID")
public Result WriteGlassID(String glassid) {
// 鎵爜浣嶅啓鍏ョ幓鐠僫d
- spianService.outmesid(glassid, "DB103.256");
+ spianService.outmesid(glassid, "DB103.286");
Map<String, Object> map = new HashMap<>();
map.put("message", "200");
return Result.success(map);
@@ -454,8 +459,8 @@
// 鍒囨崲PLC鑾峰彇浜岀淮鐮佹柟寮�
@PostMapping("/SwitchScanMethod")
- public Result SwitchScanMethod(Short scansmethod) {
- S7control.getinstance().WriteWord("DB103.255", scansmethod);
+ public Result SwitchScanMethod(Boolean scansmethod) {
+ S7control.getinstance().WriteBit("DB101.11.4", scansmethod);
Map<String, Object> map = new HashMap<>();
map.put("message", "200");
return Result.success(map);
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
index c2f2e29..f5a7bee 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -58,7 +58,7 @@
short SelectInTask();
// 鎵嬪姩瀹屾垚浠诲姟
- @Update("update storage_task set task_state=2 where task_type=#{task_type} and glass_id=#{glassid}")
+ @Update("update storage_task set task_state=1 where task_type=#{task_type} and glass_id=#{glassid}")
void UpdateTask(@Param("task_type") Integer task_type,String glassid);
// 鎵嬪姩瀹屾垚杩涚墖浠诲姟淇敼绗煎瓙鏁版嵁
@@ -204,7 +204,7 @@
void UpdateOutSliceGlass(String glassid);
//鏌ヨ鏈畬鎴愮殑浠诲姟
- @Select("select * from storage_task where task_state!=2 and task_type=#{task_type}")
+ @Select("select * from storage_task where task_state=0 and task_type=#{task_type}")
List<StorageTask> SelectTaskByState(int task_type);
//淇敼鍑虹墖闃熷垪閾濇鐘舵��
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
index 609efd5..20a4424 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -78,7 +78,7 @@
@Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where id=#{id};")
void UpdataAddCage(String orderid, String glassid, double width, int cage, int cell, int id, int state);
- @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{glass.ordernumber},glasswidth=#{glass.glasslengthmm},glassheight=#{glass.glassheightmm},glasswidthmm=#{glass.glasslength},glassheightmm=#{glass.glassheight},listid=#{glass.listnumber},boxid=#{glass.boxnumber},FrameBarcode=#{glass.FrameBarcode} where id=#{id};")
+ @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{glass.ordernumber},glasswidth=#{glass.glasslengthmm},glassheight=#{glass.glassheightmm},glasswidthmm=#{glass.glasslength},glassheightmm=#{glass.glassheight},listid=#{glass.listnumber},boxid=#{glass.boxnumber},FrameBarcode=#{glass.frameBarcode} where id=#{id};")
void UpdataAddCage2(String orderid, String glassid, north_glass_buffer1 glass, int cage, int cell, int id,int state);
// 淇敼绗煎瓙淇℃伅(澶氱墖杩涚墖)
@@ -232,4 +232,7 @@
//鍒ゆ柇鐜荤拑鏄惁绂佺敤
@Select(" select disabled from storage_cage where glass_id=#{glassid} limit 1;")
int SelectCageGlassState(String glassid);
+ //鍒ゆ柇姹囨姤鐨刬d鏄惁姝g‘
+ @Select("SELECT count(*) FROM `storage_cage` where state!=0 and state!=1 and glass_id=#{glassid}")
+ int SelectHB(String glassid);
}
\ No newline at end of file
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java b/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
index 085f3ab..79c7d40 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -1,5 +1,11 @@
package com.example.springboot.service;
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
@@ -11,6 +17,9 @@
import com.example.springboot.mapper.SpianMapper;
import com.google.common.primitives.Bytes;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+
@Service
public class SpianService {
@Autowired
@@ -19,7 +28,7 @@
// @GetMapping("/all")
public Short selectAll(String glassid) {
- int cage1=0;
+ int cage1 = 0;
int cells;
int ids;
int prcid;
@@ -29,11 +38,11 @@
double minwidth = 0;
north_glass_buffer1 glasslist = spianMapper.selectGlass(glassid); // 鑾峰彇鐜荤拑鍙傛暟
- //濡傛灉娌℃湁姝d鏃�
+ // 濡傛灉娌℃湁姝d鏃�
if (glasslist == null) {
return (300);
}
-
+
double widths = glasslist.getglasslengthmm();
String orderids = glasslist.getordernumber();
String FrameBarcode = glasslist.getFrameBarcode();
@@ -49,10 +58,9 @@
// String orderid="A001";
// 鑾峰彇璁㈠崟鐩稿叧搴︽渶楂樼殑绗煎瓙鎺掑簭
- List<StorageCage> storageCage = spianMapper.selectAllFbarcode(FrameBarcode,widths,400);
- //鍒ゆ柇閾濇鎸囧畾绌烘牸鏄惁闇�瑕侀棿闅旂┖闂�
-
-
+ List<StorageCage> storageCage = spianMapper.selectAllFbarcode(FrameBarcode, widths, 400);
+ // 鍒ゆ柇閾濇鎸囧畾绌烘牸鏄惁闇�瑕侀棿闅旂┖闂�
+
if (storageCage.size() == 0) {
storageCage = spianMapper.selectAll(orderids, FrameBarcode);
}
@@ -105,6 +113,8 @@
spianMapper.UpdataAddCage1(widths, cage1, cells);// 鍑忓皯鏍煎瓙瀹藉害
spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(), prctier);// 鏂板浠诲姟
S7control.getinstance().WriteWord(adddresslist, datas);
+
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 杩涚墖浠诲姟鍙戦�佸瓧鏀逛负1
System.out.println("杩涚墖浠诲姟|" + datas);
} else {
@@ -114,6 +124,7 @@
spianMapper.UpdataAddCage1(widths, cage1, cells);// 鍑忓皯鏍煎瓙瀹藉害
spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(), prctier);// 鏂板浠诲姟
S7control.getinstance().WriteWord(adddresslist, datas);
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 杩涚墖浠诲姟鍙戦�佸瓧鏀逛负1
System.out.println("杩涚墖浠诲姟|" + datas);
// S7control.getinstance().WriteByte("DB105.16",glassid);
@@ -169,12 +180,13 @@
spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, state);// 鏂板浠诲姟
// int state = spianMapper.selectGlassState(cage, cell);//鑾峰彇鏍煎瓙鏁伴噺
- if (state == 2) {
- spianMapper.UpdateDBCage1(cage, cell);// 灏嗗唴鐗囨暟鎹洿鏂板埌澶栫墖閲�
- spianMapper.UpdateDBCage2(cage, cell);// 娓呴櫎鍐呯墖鏁版嵁
- }
+ // if (state == 2) {
+ // spianMapper.UpdateDBCage1(cage, cell);// 灏嗗唴鐗囨暟鎹洿鏂板埌澶栫墖閲�
+ // spianMapper.UpdateDBCage2(cage, cell);// 娓呴櫎鍐呯墖鏁版嵁
+ // }
System.out.println("鍑虹墖浠诲姟|" + datas);
S7control.getinstance().WriteWord(adddresslist, datas);// 娲惧彂鍑虹墖杞︿换鍔�
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
outmesid(glassid, "DB105.34");// 娲惧彂鍑虹墖ID
return (200);// 缁撴潫
@@ -196,6 +208,7 @@
System.out.println("鍑虹墖浠诲姟|" + datas);
outmesid(glassid, "DB105.34");// 娲惧彂鍑虹墖ID
S7control.getinstance().WriteWord(adddresslist, datas);// 娲惧彂鍑虹墖杞︿换鍔�
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
return (200);// 缁撴潫
@@ -227,7 +240,7 @@
// 浼犺緭mes鏁版嵁,鍧愭爣锛屾暟鎹�
System.out.println("鍑虹墖浠诲姟|" + datas);
S7control.getinstance().WriteWord(adddresslist, datas);// 娲惧彂鍑虹墖杞︿换鍔�
-
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
outmesid(glassids, "DB105.34");// 娲惧彂璋冩嫧鐜荤拑ID
return (200); // 缁撴潫
@@ -256,7 +269,7 @@
// 浼犺緭mes鏁版嵁,鍧愭爣锛屾暟鎹�
System.out.println("鍑虹墖浠诲姟|" + datas);
S7control.getinstance().WriteWord(adddresslist, datas);// 娲惧彂鍑虹墖杞︿换鍔�
-
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
outmesid(glassids, "DB105.34");// 娲惧彂璋冩嫧鐜荤拑ID
return (200);// 缁撴潫
@@ -277,6 +290,7 @@
byte[] bytes = Bytes.toArray(glassidlist);
System.out.println("outmesidbytes:" + bytes.length);
S7control.getinstance().WriteByte(address, bytes);// 娲惧彂鍑虹墖id
+
}
// 鑾峰彇鍦板潃鍐呯殑鐜荤拑id杞瓧绗︿覆
@@ -329,4 +343,6 @@
// }
}
+
+
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java b/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
index dc630bf..619fd1b 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -30,54 +30,57 @@
String A01glassid2 = spianService.queGlassid("DB103.142", 14).toString();
String A02glassid1 = spianService.queGlassid("DB103.156", 14).toString();
String B01glassid = spianService.queGlassid("DB103.184", 14).toString();
- String B02glassid = spianService.queGlassid("DB103.198", 14).toString();
+ String B02glassid = spianService.queGlassid("DB103.212", 14).toString();
List<Short> DeviceList = S7control.getinstance().ReadWord("DB103.0", 10);
if (types == 0) {// 缁堟杩涚墖浠诲姟
List<StorageTask> cageList = homeMapper.SelectTaskByState(types);
for (StorageTask storageTask : cageList) {
// 鍒ゆ柇鍑虹墖浠诲姟浣嶇疆骞舵竻闄ゅ搴旂幓鐠僫d
- if ((storageTask.getGlassId() == A01glassid1 || storageTask.getGlassId() == A01glassid2)&&DeviceList.get(4)==0) {
+ if ((storageTask.getGlassId().equals(A01glassid1)|| storageTask.getGlassId().equals(A01glassid2))&&DeviceList.get(4)==0) {
outSliceServive.StopTask(storageTask.getGlassId(), types);
ClearGlassId("DB101.10.0");
- } else if (storageTask.getGlassId() == B01glassid&&DeviceList.get(2)==0) {
+ }
+ if (storageTask.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0) {
outSliceServive.StopTask(storageTask.getGlassId(), types);
ClearGlassId("DB101.10.2");
- } else if (storageTask.getGlassId() == B02glassid&&DeviceList.get(3)==0) {
+ }
+ if (storageTask.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0) {
ClearGlassId("DB101.10.3");
outSliceServive.StopTask(storageTask.getGlassId(), types);
- }\
+ }
}
// 鍙戦�佺粓姝㈣繘鐗囦换鍔′俊鍙�
} else {// 缁堟鍑虹墖浠诲姟
List<StorageTask> cageLists = homeMapper.SelectTaskByState(types);
List<StorageTask> cageList2 = homeMapper.SelectTaskByState(2);
- if (cageList2!=null) {
+ if (cageList2.size()>0) {
cageLists.add(cageList2.get(0));
}
for (StorageTask cageList : cageLists) {
if (cageList.getTaskType().equals("1")) {
- if(cageList.getGlassId() ==A02glassid1&&DeviceList.get(5)==0){
+ System.out.println(DeviceList.get(5));
+ if(cageList.getGlassId().equals(A02glassid1)&&DeviceList.get(5)==0){
outSliceServive.StopTask(cageList.getGlassId(), types);
ClearGlassId("DB101.10.1");
}
- else if(cageList.getGlassId() ==B01glassid&&DeviceList.get(2)==0){
+ if(cageList.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0){
outSliceServive.StopTask(cageList.getGlassId(), types);
ClearGlassId("DB101.10.2");
}
- else if(cageList.getGlassId() ==B02glassid&&DeviceList.get(3)==0){
+ if(cageList.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0){
outSliceServive.StopTask(cageList.getGlassId(), types);
ClearGlassId("DB101.10.3");
}
}else if (cageList.getTaskType().equals("2")) {
- if(cageList.getGlassId() ==A02glassid1&&DeviceList.get(5)==0){
+ if(cageList.getGlassId().equals(A02glassid1)&&DeviceList.get(5)==0){
outSliceServive.StopTask(cageList.getGlassId(), 2);
ClearGlassId("DB101.10.1");
}
- else if(cageList.getGlassId() ==B01glassid&&DeviceList.get(2)==0){
+ if(cageList.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0){
outSliceServive.StopTask(cageList.getGlassId(), 2);
ClearGlassId("DB101.10.2");
}
- else if(cageList.getGlassId() ==B02glassid&&DeviceList.get(3)==0){
+ if(cageList.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0){
outSliceServive.StopTask(cageList.getGlassId(), 2);
ClearGlassId("DB101.10.3");
}
diff --git a/springboot-vue3/src/main/resources/config.properties b/springboot-vue3/src/main/resources/config.properties
index 4a5935c..3fc6c6f 100644
--- a/springboot-vue3/src/main/resources/config.properties
+++ b/springboot-vue3/src/main/resources/config.properties
@@ -218,10 +218,10 @@
PlcInteractionState.PLCProductiontask=DB106.20,DB106.16,DB106.18,DB103.156-169
#浠诲姟淇℃伅
-PlcInteractionState.MEStaskinformation=DB105.48,DB105.50,DB105.48,DB105.50,DB106.42,DB106.48,DB106.50,DB106.58,DB103.128-141,DB103.142-155,DB103.156-169,DB103.184-197,DB103.212-225
+PlcInteractionState.MEStaskinformation=DB105.48,DB105.50,DB105.48,DB105.50,DB106.42,DB106.48
-
-
+#浠诲姟淇℃伅2
+PlcInteractionState.MEStaskinformation2=DB106.52,DB106.58,DB103.128-141,DB103.142-155,DB103.156-169,DB103.184-197,DB103.212-225
--
Gitblit v1.8.0