From 81826e66f68a37486516ee93c4e11d92a00c3fb6 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期四, 21 十二月 2023 14:43:21 +0800
Subject: [PATCH] 增加清除id调用终止出片任务
---
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java | 67 +++++++++++++++++++++++++--------
1 files changed, 50 insertions(+), 17 deletions(-)
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 d749f6d..6c25db4 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
@@ -30,6 +30,7 @@
import com.example.springboot.component.S7control;
import com.example.springboot.entity.CarPosition;
import com.example.springboot.entity.StorageCage;
+import com.example.springboot.entity.StorageTask;
import com.example.springboot.entity.User;
import com.example.springboot.entity.alarmmg;
import com.example.springboot.entity.north_glass_buffer1;
@@ -46,18 +47,21 @@
@RequestMapping("/home")
public class HomeController {
@Autowired
+ static
HomeMapper homeMapper;
@Autowired
HomeService storageRackService;
@Autowired
+ static
SpianService spianService;
@Autowired
SpianMapper spianMapper;
@Autowired
+ static
OutSliceServive outSliceServive;
@Autowired
@@ -136,20 +140,47 @@
return Result.success(map);
}
- // 鎵嬪姩瀹屾垚杩�/鍑虹墖浠诲姟
+ // 鎵嬪姩瀹屾垚杩�/鍑虹墖浠诲姟 缁堟杩涚墖/鍑虹墖浠诲姟
@GetMapping("/UpdateTask")
- public Result UpdateTask(Integer types, Integer shelfrack, String glassid) {
+ public static Result UpdateTask(Integer types, Integer shelfrack, String glassid) {
Map<String, Object> map = new HashMap<>();
- homeMapper.UpdateTask(types, glassid);
- // StorageCage glass = homeMapper.SelectGlassInfo(glassid);
- if (types == 0) {
- homeMapper.UpdateCageTask1(glassid);
- // S7control.getinstance().WriteWord("DB105.16", (short) 0);
- } else {
- // spianMapper.UpdataOutCage1(glass.getGlassWidth(), glass.getCage(), glass.getCell());
- homeMapper.DeleteByGlassID(glassid);
- // S7control.getinstance().WriteWord("DB105.18", (short) 0);
+ if (types == 0) {// 瀹屾垚杩涚墖
+ spianService.overtask(glassid);
+ } else if (types == 1) {// 瀹屾垚鍑虹墖
+ spianService.overtask(glassid);
+ } else if (types == 2) {// 缁堟杩涚墖浠诲姟
+ outSliceServive.StopTask(glassid, 0);
+ // 鍙戦�佺粓姝㈣繘鐗囦换鍔′俊鍙�
+ } else {// 缁堟鍑虹墖浠诲姟
+ outSliceServive.StopTask(glassid, 1);
}
+ map.put("message3", "200");
+ return Result.success(map);
+ }
+
+ //缁堟杩涚墖/鍑虹墖浠诲姟
+ @GetMapping("/EndTask")
+ public static Result EndTask(int types) {
+ if (types == 0) {// 缁堟杩涚墖浠诲姟
+ List<StorageTask> cageList = homeMapper.SelectTaskByState(types);
+ for (StorageTask storageTask : cageList) {
+ outSliceServive.StopTask(storageTask.getGlassId(), types);
+ }
+ // 鍙戦�佺粓姝㈣繘鐗囦换鍔′俊鍙�
+ } else {// 缁堟鍑虹墖浠诲姟
+ List<StorageCage> storageCages =homeMapper.selectinout(types);
+ for (StorageCage storageCage : storageCages) {
+ List<StorageCage> storageCagess=homeMapper.SelectStoragesGlassById(storageCage.getGlassId());
+ for (StorageCage storageCagez : storageCagess) {
+ if (storageCagez.getState().equals("2")) {//璋冩嫧杩涚墖
+ outSliceServive.StopTask(storageCagez.getGlassId(), 0);
+ }else{//鍑虹墖
+ outSliceServive.StopTask(storageCagez.getGlassId(), types);
+ }
+ }
+ }
+ }
+ Map<String, Object> map = new HashMap<>();
map.put("message3", "200");
return Result.success(map);
}
@@ -175,9 +206,7 @@
// 鎵嬪姩鍒犻櫎鐞嗙墖绗肩幓鐠�
@GetMapping("/DeleteByGlassID")
public Result DeleteByGlassID(String glassid) {
- StorageCage glassinfor = homeMapper.SelectGlassInfo(glassid);
- spianMapper.UpdataOutCage1(glassinfor.getGlassWidth(), glassinfor.getCage(), glassinfor.getCell());
- homeMapper.DeleteByGlassID(glassid);
+ outSliceServive.DeleteByGlassID(glassid);
Map<String, Object> map = new HashMap<>();
map.put("message3", "200");
return Result.success(map);
@@ -195,9 +224,13 @@
String position = jdbcConnections.SelectPositionByFrameBarcode(north_glass_buffer1.getFrameBarcode());
if (position != null) {
int sequence = homeMapper.SelectMaxSquence();
+
homeMapper.AddOutSliceS(glassid, flip, north_glass_buffer1.getFrameBarcode(),
north_glass_buffer1.getglasslengthmm().toString(), north_glass_buffer1.getglassheightmm().toString(),
- sequence, position, (short)0);
+ sequence, position, (short) 0, north_glass_buffer1.getordernumber(), north_glass_buffer1.getlistnumber(),
+ north_glass_buffer1.getboxnumber(), north_glass_buffer1.getglasslength().toString(),
+ north_glass_buffer1.getglassheight().toString());
+
map.put("message2", "200");
} else {
map.put("message2", "300");
@@ -267,7 +300,7 @@
map.put("message", "200");
}
}
- return Result.success(map);
+ return Result.success(map);
}
// 鏌ヨ鐜荤拑淇℃伅
@@ -339,6 +372,7 @@
@PostMapping("/DeleteProductionQueueGlass")
public Result DeleteProductionQueueGlass(String FrameNo) {
homeMapper.CompleteQueueByFrameNo(FrameNo);
+
Map<String, Object> map = new HashMap<>();
map.put("message", "200");
return Result.success(map);
@@ -380,7 +414,6 @@
@PostMapping("/CompleteQueue")
public Result CompleteQueue(String id, String frameid, String glassid) {
return outSliceServive.CompleteQueue(id, frameid, glassid);
-
}
}
--
Gitblit v1.8.0