From 7074c73ea7e429a15c39dce8329f22961e8e2e3e Mon Sep 17 00:00:00 2001 From: tqs <56479841@qq.com> Date: 星期五, 31 五月 2024 08:49:37 +0800 Subject: [PATCH] Merge remote-tracking branch 'gitbit/phyzasrs' into phyzasrs --- src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java | 93 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 80 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java index 903c93b..e70f36e 100644 --- a/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java +++ b/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java @@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional; import java.io.IOException; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -69,16 +70,25 @@ agvWrkMastService.updateById(agvWrkMast); // 绌烘澘鍏ュ簱 璁剧疆搴撲綅鐘舵�佷负D.绌烘《/绌烘爤鏉� String locSts = agvWrkMast.getIoType() == 10 ? "D" : "F"; - if (agvWrkMast.getIoType() == 10 || agvWrkMast.getIoType() == 109) { - agvLocMastService.updateLocStsByLocNo(agvWrkMast.getLocNo(),"D",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); + if (agvWrkMast.getIoType() == 10 || agvWrkMast.getIoType() == 109 || agvWrkMast.getIoType() == 111 ) { + // 搴撲綅 -- 鎺ラ┏浣� / 搴撲綅 + if ((agvWrkMast.getIoType() == 109 || agvWrkMast.getIoType() == 111) && agvWrkMast.getLocNo().substring(0,2).equals("DB")) { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getLocNo(),"F",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); + // 鎺ラ┏浣� -- 搴撲綅 + } else { + agvLocMastService.updateLocStsByLocNo(agvWrkMast.getLocNo(),"D",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); + } } else { agvLocMastService.updateLocStsByLocNo(agvWrkMast.getLocNo(),"F",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); } - //鐢熸垚AGV宸ヤ綔鍘嗗彶妗� - agvWrkMastLogService.save(agvWrkMast); - //鐢熸垚AGV宸ヤ綔鏄庣粏鍘嗗彶妗� - agvWrkDetlLogService.save(wrkNo); + if (agvWrkMast.getIoType() != 111) { + //鐢熸垚AGV宸ヤ綔鍘嗗彶妗� + agvWrkMastLogService.save(agvWrkMast); + //鐢熸垚AGV宸ヤ綔鏄庣粏鍘嗗彶妗� + agvWrkDetlLogService.save(wrkNo); + } + //绫诲瀷涓哄叆搴撴椂 if(agvWrkMast.getIoType() == 1){ //鏇存柊鐩爣搴撲綅鏄庣粏 @@ -106,16 +116,36 @@ agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",agvWrkMast.getWhsType().shortValue(),"",(short)0); } - if(agvWrkMast.getIoType() == 109){ - //淇敼婧愬簱浣嶇姸鎬佷负O - agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",agvWrkMast.getWhsType().shortValue(),"",(short)0); + if(agvWrkMast.getIoType() == 109 || agvWrkMast.getIoType() == 111 || agvWrkMast.getIoType() == 112){ + // 鎺ラ┏浣� -- 搴撲綅 + if (agvWrkMast.getSourceLocNo().substring(0,2).equals("DB")) { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getSourceLocNo(),"O","",(short)0); + // 搴撲綅 -- 鎺ラ┏浣� / 搴撲綅 + } else { + //淇敼婧愬簱浣嶇姸鎬佷负O + agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",agvWrkMast.getWhsType().shortValue(),"",(short)0); + } + } + + if(agvWrkMast.getIoType() == 113){ + // 鎺ラ┏浣� -- 搴撲綅 + if (agvWrkMast.getSourceLocNo().substring(0,2).equals("DB")) { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getSourceLocNo(),"O","",(short)0); + } + } + + if (agvWrkMast.getIoType() == 58) { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getSourceLocNo(),"O","",agvWrkMast.getWhsType().shortValue()); } - //鍒犻櫎AGV宸ヤ綔妗� - agvWrkMastService.deleteById(wrkNo); - //鍒犻櫎AGV宸ヤ綔鏄庣粏妗� - agvWrkDetlService.delete(new EntityWrapper<AgvWrkDetl>().eq("wrk_no",wrkNo)); + + if (agvWrkMast.getIoType() != 111) { + //鍒犻櫎AGV宸ヤ綔妗� + agvWrkMastService.deleteById(wrkNo); + //鍒犻櫎AGV宸ヤ綔鏄庣粏妗� + agvWrkDetlService.delete(new EntityWrapper<AgvWrkDetl>().eq("wrk_no",wrkNo)); + } if(!isJSON(orderNo)){ //妫�鏌ヨ鍗曟槸鍚﹀凡瀹屾垚 @@ -336,4 +366,41 @@ return num <= maxWrokNum; }).collect(Collectors.toList()); } + + /* + 鐢熸垚宸ヤ綔妗� + */ + private AgvWrkMast createWrkMast(int ioType, long wrkSts, String sourceLocNo, String locNo, String barcode, Date now, Long userId, int containerType, int floor){ + AgvWrkMast wrkMast = new AgvWrkMast(); + //宸ヤ綔鐘舵�� + wrkMast.setWrkSts(wrkSts); + //鍏ュ嚭搴撶被鍨� + wrkMast.setIoType(ioType); + wrkMast.setIoTime(now); + //浼樺厛绾� + wrkMast.setIoPri(300.0); + //婧愮珯鐐� + wrkMast.setSourceLocNo(sourceLocNo); + //鐩爣绔欑偣 + wrkMast.setLocNo(locNo); + //璐ф灦缂栫爜 + wrkMast.setBarcode(barcode); + //璐ф灦绫诲瀷 + wrkMast.setWhsType(containerType); + // 鐩爣妤煎眰 + wrkMast.setCrnNo(floor); + + wrkMast.setAppeUser(userId); + wrkMast.setAppeTime(now); + wrkMast.setModiUser(userId); + wrkMast.setModiTime(now); + + if (!agvWrkMastService.insertByIncrease(wrkMast)) { + throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�"); + } + + wrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("loc_no", locNo).eq("source_loc_no",sourceLocNo).eq("barcode",barcode).orderBy("modi_time",false)); + + return wrkMast; + } } -- Gitblit v1.9.1