From 4142b96426da5346f5e2143a54775dbe5b154d2c Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期三, 20 十二月 2023 15:05:46 +0800
Subject: [PATCH] 修改终止任务功能
---
springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java | 54 ++++++++++++++++++++++++++++++++++--------------------
1 files changed, 34 insertions(+), 20 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java b/springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
index e29eb16..7457865 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
@@ -6,52 +6,66 @@
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoProperties.Storage;
import org.springframework.stereotype.Service;
import com.example.springboot.common.Result;
+import com.example.springboot.component.S7control;
import com.example.springboot.entity.Out_slice;
+import com.example.springboot.entity.StorageCage;
import com.example.springboot.mapper.HomeMapper;
+import com.example.springboot.mapper.SpianMapper;
@Service
public class OutSliceServive {
@Autowired
private HomeMapper homeMapper;
+ @Autowired
+ private SpianMapper spianMapper;
@Autowired
private JdbcConnections jdbcConnections;
public void AddOutSliceS(String[][] AluminumFrames) throws SQLException {
- int sequence = homeMapper.SelectMaxSquence();
+ // int sequence = homeMapper.SelectMaxSquence();
// 娣诲姞鍒版暟鎹簱
- for (String[] item : AluminumFrames) {
- if (item[1] == "true") {
- String position = jdbcConnections.SelectPositionByFrameBarcode(item[3]);
- homeMapper.AddOutSliceS(item[0], item[2], item[3], item[4], item[5], sequence, position);
- sequence += 1;
- }
- }
+ // for (String[] item : AluminumFrames) {
+ // if (item[1] == "true") {
+ // Short state=0;
+ // String position = jdbcConnections.SelectPositionByFrameBarcode(item[3]);
+ // homeMapper.AddOutSliceS(item[0], item[2], item[3], item[4], item[5], sequence, position,state );
+ // sequence += 1;
+ // }
+ // }
}
// 鏌ヨ鍑虹墖闃熷垪
public List<Out_slice> SelectProductionqueue() {
List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
- for (Out_slice out_slice : listoutslice) {
- out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
- }
+ // for (Out_slice out_slice : listoutslice) {
+ // out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
+ // }
return listoutslice;
}
-public Result CompleteQueue(String id, String frameid) {
- homeMapper.CompleteQueue(id);
- Short num=homeMapper.SelectCountByFrameNo(frameid);
- if(num==0){
- homeMapper.CompleteQueueByFrameNo(frameid);
+ //瀹屾垚鍑虹墖浠诲姟
+ public Result CompleteQueue(String id, String frameid, String glassid) {
+ homeMapper.CompleteQueue(id);
+ Short num = homeMapper.SelectCountByFrameNo(frameid);
+ if (num == 0) {
+ homeMapper.CompleteQueueByFrameNo(frameid);
+ }
+ StorageCage storageCage = homeMapper.SelectGlassInfo(glassid);
+ if(storageCage!=null){
+ spianMapper.UpdataOutCage1(storageCage.getGlassWidth(), storageCage.getCage(), storageCage.getCell());
+ }
+ homeMapper.DeleteByGlassID(glassid);
+ S7control.getinstance().WriteWord("DB105.12", (short) 0);
+ Map<String, Object> map = new HashMap<>();
+ map.put("message", "200");
+ return Result.success(map);
}
- Map<String, Object> map = new HashMap<>();
- map.put("message", "200");
- return Result.success(map);
-}
}
--
Gitblit v1.8.0