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 | 129 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 109 insertions(+), 20 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 9fb31c8..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,11 +70,25 @@ agvWrkMastService.updateById(agvWrkMast); // 绌烘澘鍏ュ簱 璁剧疆搴撲綅鐘舵�佷负D.绌烘《/绌烘爤鏉� String locSts = agvWrkMast.getIoType() == 10 ? "D" : "F"; - agvLocMastService.updateLocStsByLocNo(agvWrkMast.getLocNo(),locSts,agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); - //鐢熸垚AGV宸ヤ綔鍘嗗彶妗� - agvWrkMastLogService.save(agvWrkMast); - //鐢熸垚AGV宸ヤ綔鏄庣粏鍘嗗彶妗� - agvWrkDetlLogService.save(wrkNo); + 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()); + } + + if (agvWrkMast.getIoType() != 111) { + //鐢熸垚AGV宸ヤ綔鍘嗗彶妗� + agvWrkMastLogService.save(agvWrkMast); + //鐢熸垚AGV宸ヤ綔鏄庣粏鍘嗗彶妗� + agvWrkDetlLogService.save(wrkNo); + } + //绫诲瀷涓哄叆搴撴椂 if(agvWrkMast.getIoType() == 1){ //鏇存柊鐩爣搴撲綅鏄庣粏 @@ -86,17 +101,51 @@ agvWaitPakinService.delete(new EntityWrapper<AgvWaitPakin>().eq("supp_code",barcode)); } //绫诲瀷涓哄簱浣嶇Щ杞椂 - if(agvWrkMast.getIoType() == 11){ + if(agvWrkMast.getIoType() == 11 || agvWrkMast.getIoType() == 12){ //鏇存柊搴撳瓨鏄庣粏 agvLocDetlService.updateStock(agvWrkMast.getSourceLocNo(),agvWrkMast.getLocNo()); //淇敼婧愬簱浣嶇姸鎬佷负O agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",null); } - //鍒犻櫎AGV宸ヤ綔妗� - agvWrkMastService.deleteById(wrkNo); - //鍒犻櫎AGV宸ヤ綔鏄庣粏妗� - agvWrkDetlService.delete(new EntityWrapper<AgvWrkDetl>().eq("wrk_no",wrkNo)); + //绫诲瀷涓哄簱浣嶇Щ杞椂 + if(agvWrkMast.getIoType() == 108){ + //鏇存柊搴撳瓨鏄庣粏 + agvLocDetlService.updateStock(agvWrkMast.getSourceLocNo(),agvWrkMast.getLocNo()); + //淇敼婧愬簱浣嶇姸鎬佷负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()); + } + + + + if (agvWrkMast.getIoType() != 111) { + //鍒犻櫎AGV宸ヤ綔妗� + agvWrkMastService.deleteById(wrkNo); + //鍒犻櫎AGV宸ヤ綔鏄庣粏妗� + agvWrkDetlService.delete(new EntityWrapper<AgvWrkDetl>().eq("wrk_no",wrkNo)); + } if(!isJSON(orderNo)){ //妫�鏌ヨ鍗曟槸鍚﹀凡瀹屾垚 @@ -108,11 +157,6 @@ orderService.checkComplete(o); }); } - AgvBasDevp basDevp = agvBasDevpService.selectByDevNo(agvBasDevp); - basDevp.setLocSts("O"); - basDevp.setBarcode(""); - basDevp.setLocType2(null); - agvBasDevpService.updateById(basDevp); return SUCCESS; } @@ -199,11 +243,6 @@ orderService.checkComplete(o); }); } - AgvBasDevp basDevp = agvBasDevpService.selectByDevNo(agvBasDevp); - basDevp.setLocSts("O"); - basDevp.setBarcode(""); - basDevp.setLocType2(null); - agvBasDevpService.updateById(basDevp); return SUCCESS; } @@ -222,6 +261,19 @@ if(agvWrkMast.getIoType() == 1){ //淇敼AGV鍏ュ簱閫氱煡妗g姸鎬佸叆鍑虹姸鎬佷负Y agvWaitPakinService.updateIoStatus(agvWrkMast.getWrkNo(),"Y"); + } + return SUCCESS; + + } + + @Transactional + @Synchronized + public ReturnT<String> startAllcationIn(AgvWrkMast agvWrkMast) throws IOException { + + //涓嬪彂浠诲姟 + int startWrkCode = agvWrkMastService.startAllcationIn(agvWrkMast); + if(startWrkCode != 0){ + throw new CoolException("浠诲姟涓嬪彂澶辫触"); } return SUCCESS; @@ -314,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