From 96ffc9779885b70bbd886954fc756465f833374d Mon Sep 17 00:00:00 2001
From: L <L@132>
Date: 星期四, 17 七月 2025 16:46:55 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/asrs/controller/MonitorController.java | 64 +++++++++++++++++++++++++++++--
1 files changed, 59 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/MonitorController.java b/src/main/java/com/zy/asrs/controller/MonitorController.java
index c769b5e..e6c188b 100644
--- a/src/main/java/com/zy/asrs/controller/MonitorController.java
+++ b/src/main/java/com/zy/asrs/controller/MonitorController.java
@@ -13,16 +13,17 @@
import com.zy.core.CrnThread;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
+import com.zy.core.model.DevpSlave;
import com.zy.core.model.LedSlave;
import com.zy.core.model.command.LedCommand;
import com.zy.core.model.protocol.CrnProtocol;
+import com.zy.core.model.protocol.StaProtocol;
import com.zy.core.properties.SlaveProperties;
+import com.zy.core.thread.BarcodeThread;
import com.zy.core.thread.LedThread;
+import com.zy.core.thread.SiemensDevpThread;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -42,6 +43,58 @@
private SlaveProperties slaveProperties;
@Autowired
private WrkDetlService wrkDetlService;
+
+ /**
+ * 鑾峰彇褰撳墠鏃堕棿
+ */
+ @PostMapping("/barcode/two")
+ public R barcodeTwo(@RequestParam Integer palletizingNo) {
+ Date now = new Date();
+
+ String barcode = "";
+ for (DevpSlave devp : slaveProperties.getDevp()) {
+ // 閬嶅巻鍏ュ簱鍙�
+ for (DevpSlave.Sta inSta : devp.getDriveSta()) {
+ if (inSta.getStaNo().equals(palletizingNo)){
+ SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2);
+ StaProtocol staProtocolPall = devpThread.getStation().get(palletizingNo);
+ if (staProtocolPall == null) {
+ continue;
+ } else {
+ staProtocolPall = staProtocolPall.clone();
+ }
+
+ if (!staProtocolPall.isAutoing() || !staProtocolPall.isLoading() || staProtocolPall.getWorkNo() != 0 || !staProtocolPall.isPakMk()){
+ return R.error("鏈氨缁紒锛侊紒");
+ }
+
+ // 鑾峰彇鏉$爜鎵弿浠俊鎭�
+ BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
+ if (barcodeThread == null) {
+ continue;
+ }
+ barcode = barcodeThread.getBarcode();
+
+ if (!Cools.isEmpty(barcode)) {
+// log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode);
+ if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode) || "000000".equals(barcode)) {
+ barcode = "";
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ }
+// Calendar calendar = Calendar.getInstance();
+// calendar.setTime(now);
+ if (Cools.isEmpty(barcode) || barcode.equals("")){
+ return R.error("鏈氨缁紒锛侊紒鎵樼洏鏉$爜涓虹┖锛侊紒锛佽妫�鏌ワ紒锛侊紒");
+ }
+ return R.ok(
+ Cools.add("barcode", barcode).add("Date",now)
+ );
+ }
/**
* 鑾峰彇褰撳墠鏃堕棿
@@ -306,9 +359,10 @@
@GetMapping("/led/useInfo")
public R monitorLedUseInfo(@RequestParam("ledId") Integer ledId) {
Integer count1 = wrkDetlService.count1();
+ Integer count11 = wrkDetlService.count11();
Integer count3 = wrkDetlService.count3();
Map<String, Object> map = new HashMap<>();
- map.put("count1", count1);
+ map.put("count1", count1+count11);
map.put("count2", count3);
return R.ok().add(map);
}
--
Gitblit v1.9.1