From 92c1cf60b4b804b97b54876b5140132a16765333 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期一, 25 三月 2024 08:09:11 +0800
Subject: [PATCH] 测试更新
---
springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java | 13 ++++++++++---
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java | 6 +++---
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java | 3 ++-
springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java | 4 ++++
springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java | 11 +++++++----
5 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java
index e9e5ee3..1edd60f 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java
@@ -75,10 +75,11 @@
// System.out.println(jsonFilePath);
//readAndUpdateWordValues(PlcReadObject);
+ List<Short> ss=S7control.getinstance().ReadWord("DB14.0", 1);
readAndUpdateWordValues(PlcMesObject);
//readAndUpdateWordValues(PlcframeObject);
// readAndUpdateWordValues(PlcframeObject);
-
+
// readAndUpdateWordValues(plcStateObject);
int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex();
// System.out.println(index);
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
index 6e88a46..c0fa68e 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
@@ -25,14 +25,15 @@
// \\ TODO Auto-generated catch block
e.printStackTrace();
}
-
+
+ //S7control.getinstance().ReadWord("DB14.0", 1);
// if (S7control.getinstance().CheckConnected() == false) {
spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class);
albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class);
- // spianService.selectAll(albaniaMapper.SelectGlass());
+ spianService.selectAll(albaniaMapper.SelectGlass());
//璇诲彇DB14鍖烘枃浠�
PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
-
+
String ExportTOMES1=plcmes.getPlcParameter("ExportTOMES1").getValue();//鍑虹墖璇锋眰涓�绾�
String ExportToMES2=plcmes.getPlcParameter("ExportToMES2").getValue();//鍑虹墖璇锋眰浜岀嚎
@@ -69,8 +70,10 @@
for(int i=1;i<7;i++){
String Glassid=plcmes.getPlcParameter("MESID"+i).getValue();//渚濇鑾峰彇浠诲姟ID
int tastid=albaniaMapper.SelectTaskId(Glassid.substring(0,14));
- storageCageService.FinishTask(tastid);
//璋冪敤瀹屾垚浠诲姟 Glassid
+ storageCageService.FinishTask(tastid);
+ //鍒犻櫎queue琛ㄧ殑鏁版嵁
+ albaniaMapper.DeleteQueue(Glassid.substring(0,14));
S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus"+i).getAddress(), (short) 1);//瀹屾垚纭瀛�
}
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 bf310e4..a6eaa4c 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
@@ -16,12 +16,12 @@
// TODO Auto-generated method stub
//
System.out.println("鍚姩瀹屾垚");
- // new PLCAutoMes().start();
+ //new PLCAutoMes().start();
// new PlcHold().start();
- // new PlcHoldNew().start();
+ new PlcHoldNew().start();
- new Plchome().start();
+ // new Plchome().start();
// new PlcLayout().start();
// new Plcalarm().start();
// new Plcsign().start();
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
index 7827fb4..fb02810 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
@@ -1,4 +1,5 @@
package com.example.springboot.mapper;
+import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@@ -11,10 +12,10 @@
@Repository
public interface AlbaniaMapper {
//鍒ゆ柇绗煎唴鏄惁鏈夊悎閫傜殑绫诲瀷绌烘牸
- @Select("select id from storage_cage where glasstype=#{glasstype} and width>=#{width}+#{widths} and state=0 order by id limit 1")
+ @Select("select id from storage_cage where glasstype=#{glasstype} and width>=#{width}+#{widths} and state=0 and disabled=0 order by id limit 1")
int SelectCage(int glasstype,Double width,int widths);
//鍒ゆ柇绗煎唴娌℃湁鐜荤拑鐨勭┖鏍�
- @Select("select id from storage_cage where number=0 and cage>#{cage} and cage<#{cage2} order by id limit 1")
+ @Select("select id from storage_cage where number=0 and cage>#{cage} and cage<#{cage2} and disabled=0 order by id limit 1")
int SelectNewCell(int cage,int cage2);
//澧炲姞鐜荤拑鏁�
@Update("update storage_cage set number=number+1,width=width-glasswidth where id=#{id}")
@@ -29,7 +30,7 @@
@Update("UPDATE `albania`.`storage_cage` SET `glass_id` =#{glassid}, `width` =width-#{glasswidth}, `glasswidth` =#{glasswidth}, `glassheight` =#{glassheight}, `glasswidthmm` =#{glasswidthmm}, `glassheightmm` = #{glassheightmm}, `state` = #{state}, `glasstype` = #{glasstype}, `number` = #{number} WHERE `id` =#{id};")
void AddCage(int id,String glassid,Double glasswidth,Double glassheight,Double glasswidthmm,Double glassheightmm,int state,int glasstype,int number);
//鑾峰彇杩涚墖鏁版嵁
- @Select("select glassid,flowcard,glasswidth as width,glassheight as height,glasswidthmm,glassheightmm,glasstype from queue where state=0 limit 1")
+ @Select("select glassid,flowcard,glasswidth as width,glassheight as height,glasswidthmm,glassheightmm,glasstype from queue where state=1 limit 1")
GlassInfo SelectGlass();
//涓�鍙风嚎鏌ヨ浠诲姟
@Select("select * from v_cagerelease1 where mateid not in(select mateid from v_cagerelease1 where surplus=0 group by mateid);")
@@ -46,7 +47,13 @@
//鍙戦�佸嚭鐗囧悗澧炲姞宸插彂鏁伴噺
@Update("update glassinfo set finishnumber=finishnumber+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{tier};")
void AddFinishNumber(String flowcard,int mateid,int tier);
+ //鑾峰彇褰撳墠浠诲姟鐨刬d
@Select("select id from storage_task where state=0 glassid=#{glassid} LIMIT 1")
int SelectTaskId(String glassid);
+ //鍒犻櫎娴嬮噺琛ㄧ殑淇℃伅
+ @Delete("delete from queue where glassid=#{glassid}")
+ int DeleteQueue(String glassid);
+
+
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java b/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
index 7b49fa8..5c4474a 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
@@ -21,6 +21,10 @@
//璇诲彇DB105鍖烘枃浠�
private PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
public Short selectAll(GlassInfo glassInfo) {
+ if(glassInfo==null){
+ //鏈夎繘鐗囪姹備絾鏄祴閲忓彴娌℃湁鐜荤拑
+ return 400;
+ }
//瀹氫箟鍒濆瀛楁
int cageid;
String glassid=glassInfo.getGlassid();
--
Gitblit v1.8.0