From 5780c58879296cfced72012c8831c1d3cf4dafb2 Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期四, 14 十一月 2024 00:33:13 +0800 Subject: [PATCH] 增加任务队列 任务日志,客户名称字段 --- springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 50 insertions(+), 9 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 f9d3b9c..47c8255 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 @@ -238,6 +238,23 @@ return Result.success(map); } + // 鎸囧畾鏍煎瓙鍑虹墖 + public Result AddOutGlass(Integer cell,Integer glasstype) { + GlassInfo glass = albaniaMapper.SelectGlassInfo(glasstype); + Map<String, Object> map = new HashMap<>(); + if(glass!=null){ + albaniaMapper.AddFinishNumber(glass.getFlowcard(),glass.getMateid(), glass.getTier()); + UpdateStroageCageByCell(cell, -1);// 鐜荤拑鏁伴噺-1 + // 澧炲姞鍑虹墖闃熷垪鐨勪换鍔� + albaniaMapper.InsertOutTask(1, 0, cell, 2001,glass.getGlassid(), + glass.getGlasstype(), glass.getFlowcard(),glass.getMateid(),glass.getTier()); + map.put("message", "200"); + }else{ + map.put("message", "300"); + } + return Result.success(map); + } + // 鏌ヨ杩�/鍑虹墖浠诲姟 public List<StorageTask> SelectStorageTask(int task_type) { List<StorageTask> storageTasks = new ArrayList<>(); @@ -255,9 +272,18 @@ } // storageTask.setstorageCage(homeMapper.SelectStorageByCell(loadrack)); storageTask.setstorageCage(homeMapper.SelectStorageByCellGlass(storageTask.getId())); - + } return storageTasks; + } + + //鏌ヨ鍑虹墖闃熷垪 + public List<Map> SelectOutTask() { + return homeMapper.SelectOutTask(); + } + //鏌ヨ鍑虹墖闃熷垪 + public List<Map> SelectOutLog() { + return homeMapper.SelectOutLog(); } // 鏌ヨ杩�/鍑虹墖浠诲姟 @@ -274,7 +300,8 @@ public Map StorageCageForm() { return homeMapper.SelectMeasureWidthHeight(); } - //鎵嬪姩缁撴潫浠诲姟 + + // 鎵嬪姩缁撴潫浠诲姟 public Result TerminateTask(int id) { for (int i = 1; i < 7; i++) { int taskcont = albaniaMapper.SelectTaskcount(); // 姝e湪杩涜鐨勪换鍔℃暟閲� @@ -287,7 +314,7 @@ System.out.println("缁撴潫杩涚墖浠诲姟:" + storageTask.getId()); homeMapper.FinishTask(storageTask.getId(), 2);// 瀹屾垚浠诲姟 homeMapper.DeletequeueByGlassid(storageTask.getGlasstype().toString()); - glassInfoMapper.updateGlassNumber(storageTask.getGlasstype());//鍑忓皯鎵弿娆℃暟 + glassInfoMapper.updateGlassNumber(storageTask.getGlasstype());// 鍑忓皯鎵弿娆℃暟 } else { System.out.println("缁撴潫鍑虹墖浠诲姟:" + storageTask.getId()); homeMapper.FinishTask(storageTask.getId(), 2);// 瀹屾垚浠诲姟 @@ -423,6 +450,7 @@ // 鍒犻櫎鏁版嵁 Map<String, Object> map = new HashMap<>(); // QueueMapper.DeleteQueue(); + System.out.println("浜哄伐鍖归厤ID锛�"+glassInfo.getMateid()+"鑶滅郴:"+glassInfo.getFilms()); int count = homeMapper.SelectQueue(); if (count > 0) { homeMapper.UpdateQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(), @@ -430,9 +458,9 @@ PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1); map.put("message", "200"); - }else { + } else { map.put("message", "300"); - } + } return Result.success(map); } @@ -460,6 +488,20 @@ homeMapper.StartChange(flowcard, orderstate); Map<String, Object> map = new HashMap<>(); int state = homeMapper.selectStartChange(flowcard); + map.put("message", "200"); + return Result.success(map); + } + // 寮�濮�/鏆傚仠鍑虹墖闃熷垪 + public Result UpdateOutTask(Integer id, Integer state) { + homeMapper.UpdateOutTask(id, state); + Map<String, Object> map = new HashMap<>(); + map.put("message", "200"); + return Result.success(map); + } + //鍒犻櫎鍑虹墖闃熷垪 + public Result DeleteOutTask(Integer id) { + homeMapper.DeleteOutTask(id); + Map<String, Object> map = new HashMap<>(); map.put("message", "200"); return Result.success(map); } @@ -511,7 +553,7 @@ && item.get("films") != null && item.get("base") != null && item.get("height") != null && item.get("thickness") != null && item.get("quantity") != null - && item.get("matching") != null)) + && item.get("matching") != null)&& item.get("Customer") != null) .collect(Collectors.toList()); TypeDatas.forEach(item -> { @@ -567,16 +609,15 @@ glasstype = Integer.valueOf(value); } // - homeMapper.AddGlassinfo(map.get("order").toString(), glasstype, 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()), groupby.get(tierkey));// 闇�瑕佽绠楁�诲眰鏁� + Integer.parseInt(map.get("quantity").toString()), groupby.get(tierkey),map.get("Customer").toString());// 闇�瑕佽绠楁�诲眰鏁� // 璁㈠崟鍐呮�诲眰鏁� - homeMapper.InsertFlowcard(map.get("order").toString(), OrderFinishedProduct.get(tierkey + "_Sum")); + homeMapper.InsertFlowcard(map.get("order").toString(), OrderFinishedProduct.get(tierkey + "_Sum"), map.get("Customer").toString()); count++; } Map<String, Object> ResultCode = new HashMap<>(); -- Gitblit v1.8.0