From 6ad80ed766ca364fae07a98fd8f42086c9b0aecd Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期五, 11 十月 2024 08:47:26 +0800
Subject: [PATCH] 统一文件在Git上的大小写
---
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java | 119 +++++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 90 insertions(+), 29 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java b/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
index be840ea..5c78fef 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -14,13 +14,14 @@
import com.example.springboot.component.PLCAutoMes;
import com.example.springboot.component.Plchome;
import com.example.springboot.component.S7control;
-import com.example.springboot.entity.FlowCard;
+import com.example.springboot.entity.Flowcard;
import com.example.springboot.entity.GlassInfo;
import com.example.springboot.entity.Queue;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.StorageTask;
import com.example.springboot.entity.device.PlcParameterObject;
import com.example.springboot.mapper.HomeMapper;
+import com.example.springboot.mapper.QueueMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
@Service
@@ -30,6 +31,9 @@
@Autowired
private OutSliceServive outSliceServive;
+
+ @Autowired
+ private QueueMapper QueueMapper;
@Autowired
private SpianService spianService;
@@ -219,7 +223,7 @@
homeMapper.DeleteStroageCageByCell(cell);
} else {
homeMapper.updateStroageCageByCell(cell, num);
- homeMapper.UpdateStroageCageWidthByCell(cell);
+ homeMapper.UpdateStroageCageWidthByCell(cell);// 淇敼绗煎瓙瀹藉害
}
Map<String, Object> map = new HashMap<>();
map.put("message", "200");
@@ -229,13 +233,19 @@
// 鏌ヨ杩�/鍑虹墖浠诲姟
public List<StorageTask> SelectStorageTask(int task_type) {
List<StorageTask> storageTasks = new ArrayList<>();
+ String loadrack="0";
if (task_type == 0) {
storageTasks = homeMapper.SelectStorageTask(task_type);
} else {
storageTasks = homeMapper.SelectStorageTask(task_type);
}
for (StorageTask storageTask : storageTasks) {
- storageTask.setstorageCage(homeMapper.SelectStorageByCell(storageTask.getLoadrack()));
+ if (task_type == 0) {
+ loadrack=storageTask.getLoadrack();
+ }else{
+ loadrack=storageTask.getShelfRack();
+ }
+ storageTask.setstorageCage(homeMapper.SelectStorageByCell(loadrack));
}
return storageTasks;
}
@@ -246,6 +256,7 @@
homeMapper.FinishTask(storageTask.getId());// 瀹屾垚浠诲姟
if (storageTask.getTaskType().equals("0")) {
UpdateStroageCageByCell(Integer.parseInt(storageTask.getLoadrack()), 1);// 鐜荤拑鏁伴噺+1
+ homeMapper.DeletequeueByGlassid(storageTask.getGlassId());
} else {
StorageCage storageCage = homeMapper.SelectStorageByCell(storageTask.getShelfRack());
if (storageCage.getNumber() > 1) {
@@ -278,23 +289,29 @@
}
// 鏌ヨ璁㈠崟浠诲姟
- public List<FlowCard> SelectOrderTask() {
- List<FlowCard> OrderTask = homeMapper.SelectOrderTask();
- for (FlowCard flowcard : OrderTask) {
+ public List<Flowcard> SelectOrderTask() {
+ List<Flowcard> OrderTask = homeMapper.SelectOrderTask();
+ for (Flowcard flowcard : OrderTask) {
flowcard.setglassinfo(homeMapper.SelectOrderView(flowcard.getFlowcard()));
}
return OrderTask;
}
// 寮�濮嬩换鍔�
- public Result ClaimTasks(String flowcard, Integer state) {
- if (state == 1) {
- homeMapper.ClaimTasks(flowcard, 0);
- } else {
- homeMapper.ClaimTasks(flowcard, 1);
- }
+ public Result ClaimTasks(String flowcard, Integer state, Integer line) {
+ int count=homeMapper.SelectTaskCount(flowcard,line);
Map<String, Object> map = new HashMap<>();
- map.put("message", "200");
+ if(count==0){
+ if (state == 1) {
+ homeMapper.ClaimTasks(flowcard, 0, line);
+ } else {
+ homeMapper.ClaimTasks(flowcard, 1, line);
+ }
+ map.put("message", "200");
+ }else{
+ map.put("message", "300");
+ }
+
return Result.success(map);
}
@@ -313,8 +330,10 @@
// 淇敼娴嬮噺淇℃伅
public Result UpdateQueue(GlassInfo glassInfo) {
homeMapper.UpdateQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(),
- glassInfo.getGlasstype());
+ glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier());
Map<String, Object> map = new HashMap<>();
+ PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
+ S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1);
map.put("message", "200");
return Result.success(map);
}
@@ -328,9 +347,19 @@
// 璇诲彇DB105鍖烘枃浠�
PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
// 绉婚櫎
- // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
- // (short) 3);
+ S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 3);
+ // 鍒犻櫎鏁版嵁
+ QueueMapper.DeleteErrorQueue();
+
// plcmes.getPlcParameter("GaToMES").setValue("3");
+ Map<String, Object> map = new HashMap<>();
+ map.put("message", "200");
+ return Result.success(map);
+ }
+
+ // 寮�濮嬪伐绋�
+ public Result StartChange(String flowcard) {
+ homeMapper.StartChange(flowcard, 1);
Map<String, Object> map = new HashMap<>();
map.put("message", "200");
return Result.success(map);
@@ -341,8 +370,9 @@
// 璇诲彇DB105鍖烘枃浠�
PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
// 閲嶆柊娴嬮噺
- // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
- // (short) 2);
+ S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 2);
+ // 鍒犻櫎鏁版嵁
+ QueueMapper.DeleteErrorQueue();
// plcmes.getPlcParameter("GaToMES").setValue("2");
Map<String, Object> map = new HashMap<>();
map.put("message", "200");
@@ -355,47 +385,78 @@
// 绛涢�夊鐞嗘暟鎹� 1.鍘婚櫎鏃犵敤鏁版嵁 2.璁$畻閰嶇墖ID 3.璁$畻ID 4. 璁$畻鎬诲眰鏁�
List<Map> TypeDatas = homeMapper.SelectType();
Map<String, String> TypeData = new HashMap<String, String>();// 寰楀埌澶勭悊瀹屽悗鎵�鏈夌殑绫诲瀷
-
+ Map<String, Integer> groupby = new HashMap<String, Integer>(); // 寰楀埌澶勭悊瀹屽悗鎵�鏈夋�诲眰鏁�;
+ Map<String, Integer> OrderFinishedProduct = new HashMap<String, Integer>(); // 寰楀埌澶勭悊瀹屽悗璁㈠崟鎴愬搧鎬绘暟閲�;
+ // "order zong 0 1 10 2 10"
List<Map> RemoveErrorData = IportDataStr.stream()
.filter(item -> (item.get("order") != null && item.get("glasstype") != null && item.get("tier") != null
&&
item.get("films") != null && item.get("base") != null && item.get("height") != null
- && item.get("thickness") != null && item.get("quantity") != null))
+ && item.get("thickness") != null && item.get("quantity") != null
+ && item.get("matching") != null))
.collect(Collectors.toList());
- // 鍙栧嚭RemoveErrorData 閲岄潰鐨勫垪褰撲綔TypeData鐨刱ey
TypeDatas.forEach(item -> {
TypeData.put(item.get("type").toString(), item.get("glasstype").toString());
});
+ RemoveErrorData.forEach(item -> {
+ String key = item.get("order").toString() + "_" + item.get("matching").toString();
+ String keyCount = item.get("order").toString() + "_" + item.get("matching").toString() + "_"
+ + item.get("tier").toString();
+ String keyCountSum = item.get("order").toString() + "_" + item.get("matching").toString() + "_Sum";// 璁㈠崟鎬绘暟
+ if (OrderFinishedProduct.get(keyCount) != null) {
+ Integer count = OrderFinishedProduct.get(keyCount) + 1;
+ Integer sumcount = OrderFinishedProduct.get(keyCountSum)
+ + Integer.parseInt(item.get("quantity").toString());
+ OrderFinishedProduct.put(keyCount, count);
+ OrderFinishedProduct.put(keyCountSum, sumcount);
+ } else if (OrderFinishedProduct.get(keyCount) == null && groupby.get(key) == null) {
+ OrderFinishedProduct.put(keyCount, 1);
+ OrderFinishedProduct.put(keyCountSum, Integer.parseInt(item.get("quantity").toString()));
+ }
+ if (groupby.get(key) != null) {
+ Integer Tiers = groupby.get(key) + 1;
+ groupby.put(key, Tiers);
+ } else {
+ groupby.put(key, 1);
+ }
+ });
+
System.out.println(RemoveErrorData.size());
// 澶勭悊瀹屾垚 娣诲姞鏁版嵁搴�
+ int count = 1;
for (Map map : RemoveErrorData) {
- // GlassInfo glassInfo = mapper.convertValue(map, GlassInfo.class);
-
String key = map.get("base").toString() + "_" + map.get("height").toString() + "_"
+ map.get("thickness").toString() + "_" + map.get("films").toString();
+
+ String tierkey = map.get("order").toString() + "_" + map.get("matching").toString();
+
String value = TypeData.get(key);
Integer glasstype;
if (TypeData.get(key) == null) {
glasstype = homeMapper.SelectMaxType();
+ if (glasstype == null) {
+ glasstype = 1;
+ }
} else {
glasstype = Integer.valueOf(value);
}
+ //
homeMapper.AddGlassinfo(map.get("order").toString(), glasstype,
- Integer.parseInt(map.get("glasstype").toString()) // 闇�瑕佽绠� 閰嶇墖ID
- , map.get("glasstype").toString() // 闇�瑕佽绠� 鐜荤拑ID
+ Integer.parseInt(map.get("matching").toString()) // 闇�瑕佽绠� 閰嶇墖ID
+ , map.get("order").toString() + "-" + count + "" // 闇�瑕佽绠� 鐜荤拑ID
, Integer.parseInt(map.get("tier").toString()), map.get("films").toString(),
Double.parseDouble(map.get("base").toString()), Double.parseDouble(map.get("height").toString()),
Double.parseDouble(map.get("thickness").toString()),
- Integer.parseInt(map.get("quantity").toString()), 1);// 闇�瑕佽绠楁�诲眰鏁�
+ Integer.parseInt(map.get("quantity").toString()), groupby.get(tierkey));// 闇�瑕佽绠楁�诲眰鏁�
+ // 璁㈠崟鍐呮�诲眰鏁�
+ homeMapper.InsertFlowcard(map.get("order").toString(), OrderFinishedProduct.get(tierkey + "_Sum"));
+ count++;
}
Map<String, Object> ResultCode = new HashMap<>();
ResultCode.put("message", "200");
return Result.success(ResultCode);
}
-
-
-
}
--
Gitblit v1.8.0