From fa6bebf3478bbea5c570851de91acf40fc40bbc4 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期二, 12 十一月 2024 18:13:45 +0800
Subject: [PATCH] 增加指定格子出片
---
springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java | 40 ++++++++++++++++++++++++++++++----------
1 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java b/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
index 4842b26..9a4cc37 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
@@ -21,6 +21,7 @@
import com.example.springboot.entity.GlassInfo;
import com.example.springboot.entity.MeasureSetting;
+import com.example.springboot.entity.Queue;
import com.example.springboot.mapper.GlassInfoMapper;
import com.example.springboot.mapper.MeasureSettingMapper;
import com.example.springboot.mapper.QueueMapper;
@@ -41,14 +42,23 @@
List<GlassInfo> Results = new ArrayList<GlassInfo>();
// 鑾峰彇鍖归厤璁剧疆
MeasureSetting MeasureSetting = MeasureSettingMapper.SelectMeasureSetting(line);
+ System.out.println("鑾峰彇鍖归厤璁剧疆:"+MeasureSetting);
if (height > 0 && width > 0 && MeasureSetting != null) {
// 鏈夋晥鍙傛暟 璇锋眰=1 闀�/瀹�>0
double maxheight = height + MeasureSetting.getErrorHeight();
double minheight = height - MeasureSetting.getErrorHeight();
double maxwidth = width + MeasureSetting.getErrorWidth();
double minwidth = width - MeasureSetting.getErrorWidth();
- // 鏌ヨ褰撳墠娴嬮噺鏁版嵁
- List<GlassInfo> GlassInfos = GlassInfoMapper.selectGlassInfos(maxwidth, minwidth, maxheight, minheight);
+ Integer Thickness = MeasureSetting.getThickness();
+ String Films = MeasureSetting.getFilms();
+ // 鏌ヨ褰撳墠娴嬮噺鏁版嵁
+ List<GlassInfo> GlassInfos = GlassInfoMapper.selectGlassInfos(maxwidth, minwidth, maxheight, minheight,Thickness,Films);
+ System.out.println("鍘氬害"+Thickness+"鑶�"+Films);
+ System.out.println("GlassInfos鏁伴噺:"+GlassInfos.size());
+ if(Thickness==0||Films==""){
+ System.out.println("鍘氬害"+Thickness+"鑶�"+Films);
+ return null;
+ }
List types = new ArrayList<>();
for (int i = 0; i < GlassInfos.size(); i++) {
Integer glasstype = GlassInfos.get(i).getGlasstype();
@@ -63,29 +73,35 @@
// 鍖归厤閫昏緫
public boolean Normal(double width, double height, String line) {
+ List<Queue> ErrowQueues= QueueMapper.selectErrorQueues();
+ if (ErrowQueues.size()>0) {
+ System.out.println("鏈夊尮閰嶅け璐ユ暟鎹湭鍘婚櫎");
+ return false;
+ }
+ //鏌ヨ褰撳墠棰嗗彇鐨勪换鍔�
List<GlassInfo> Result = NormalGlassInfo(width, height, "1");
+ System.out.println("Result:"+Result);
if (Result.size() == 1) {
// 鍖归厤鎴愬姛 灏变竴绉嶇被鍨� 娣诲姞鏁版嵁
GlassInfo GlassInfo = Result.get(0);
- QueueMapper.insert(GlassInfo.getGlassid(), width, height, 1);
+ int insertCount=QueueMapper.insert(GlassInfo.getId(), width, height, 1);
GlassInfoMapper.updatemeasurenumber(GlassInfo.getId());
- System.out.println("鍖归厤鎴愬姛");
- // S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(),
- // (short) 1);
+ System.out.println("娣诲姞鏉℃暟锛�"+insertCount);
+ System.out.println("鍖归厤鎴愬姛");
System.out.println(GlassInfo.getGlassid());
return true;
} else if (Result.size() > 1) {
// 鍖归厤澶辫触 鍖归厤鍒板鏉$鍚堢殑鏁版嵁 娣诲姞鏁版嵁
- QueueMapper.insert(null, width, height, 2);
+ QueueMapper.insertMatchFailure(width, height, 0);
System.out.println("鍖归厤澶辫触");
- return false;
+
} else {
// 鍖归厤澶辫触 鏈壘鍒扮鍚堢殑鏁版嵁 娣诲姞鏁版嵁
- QueueMapper.insert(null, width, height, 3);
+ QueueMapper.insertMatchFailure(width, height, -1);
System.out.println("鏈壘鍒扮鍚堢殑鏁版嵁");
- return false;
}
+ return false;
}
// Execl琛ㄦ牸 浼犲叆鏂囦欢璺緞
@@ -93,6 +109,10 @@
try {
// 鍒涘缓鏂囦欢瀵硅薄
File file = new File(filename);
+ if (!file.exists()) {
+ System.out.println("鏂囦欢涓嶅瓨鍦紒 "+filename);
+ return new ArrayList<>();
+ }
// 鍒涘缓鏂囦欢杈撳叆娴佸璞�
FileInputStream inputStream = new FileInputStream(file);
// 鍒涘缓宸ヤ綔绨垮璞�
--
Gitblit v1.8.0