From abda546a9cbcefd5bfe3abb563361f371f36faaa Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期三, 24 四月 2024 02:29:35 +0800
Subject: [PATCH] 根据现场调试增加判断条件
---
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java | 37 +++++++++++++++++++++++++++++--------
1 files changed, 29 insertions(+), 8 deletions(-)
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 296a397..0a3d5a4 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,10 +1,12 @@
package com.example.springboot.component;
+import java.sql.SQLException;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.service.JdbcConnections;
import com.example.springboot.service.SpianService;
+
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.mapper.AlarmMapper;
import com.example.springboot.mapper.SpianMapper;
@@ -17,6 +19,7 @@
private JdbcConnections jdbcConnections;
private SpianMapper spianMapper;
private SpianService spianService;
+
int aaa;
@Override
@@ -30,21 +33,27 @@
// \\ TODO Auto-generated catch block
e.printStackTrace();
}
-
+
// if (S7control.getinstance().CheckConnected() == false) {
spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
+
jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
// 鏍规嵁鐜荤拑id鑾峰彇璁㈠崟鍙�,鍗曠嫭鏁版嵁婧�
+
// try {
- // north_glass_buffer1 glass = jdbcConnections.selectGlass(112);
- // // System.out.println(glass.getOrderId());
+ // spianService.selectAll(jdbcConnections.SelectGlassByGlassIdOrderIdFrameId("X12345610102GV","",""));
+
// } catch (SQLException e) {
- // // TODO Auto-generated catch block
- // e.printStackTrace();
+ // // TODO Auto-generated catch block
+ // e.printStackTrace();
// }
+ //spianService.selectout2("X12345610102GV");
+
// 鍑虹墖浠诲姟////////////////////////////////
+ //spianService.selectout2("X21942613103GV");
+
List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 鍑虹墖杞︾姸鎬�
List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 鍑虹墖浠诲姟鏄惁鍚姩
@@ -150,13 +159,25 @@
StringBuilder queueid2 = spianService.queGlassid("DB103.58", 14);
int questate = spianMapper.Selectquecount(queueid1.toString());// 鍒ゆ柇鎵爜浣嶆槸鍚︽湁鐜荤拑宸茬‘璁�
- // queueid1.toString().isEmpty()
+ queueid1.toString().isEmpty()
north_glass_buffer1 glass1 = spianMapper.selectGlass(queueid1.toString());// D01鐨勭幓鐠冧俊鎭�
north_glass_buffer1 glass2 = spianMapper.selectGlass(queueid2.toString());// D02鐜荤拑淇℃伅
+ // north_glass_buffer1 glass1=null;
+ // north_glass_buffer1 glass2=null;
+ // String queueid1="123";
+ // String queueid2="123";
+ // int questate=0;
+ try {
+ glass1 = jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(queueid1.toString(),"","");// D01鐜荤拑淇℃伅
+ glass2 = jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(queueid2.toString(),"","");// D02鐜荤拑淇℃伅
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+
// 褰撴壂鐮佷綅鐜荤拑id涓虹┖鏃� 瀹藉害涓�0
if (queueid1 != null && questate == 0) {
// 鍐欏叆D01鐨勬暟鎹埌涓婄墖闃熷垪琛�
- if (glass1 == null) { // 褰撴病鏈夊�兼椂浼犵┖
+ if (glass1 == null ||glass1.getordernumber()==null) { // 褰撴病鏈夊�兼椂浼犵┖
spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 1);
} else {
@@ -169,7 +190,7 @@
if (queueid2 != null) {
// 鍐欏叆D02鐨勬暟鎹埌涓婄墖闃熷垪琛�
- if (glass2 == null) {
+ if (glass2 == null ||glass2.getordernumber()==null) {
spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 2);
} else {
spianMapper.Updatequeue(queueid2.toString(), glass2.getordernumber(), glass2.getlistnumber(),
--
Gitblit v1.8.0