From 37f97c17a695aacd4f658eb86483558ba62374cd Mon Sep 17 00:00:00 2001 From: lsh <lsh@163.com> Date: 星期五, 31 五月 2024 17:56:13 +0800 Subject: [PATCH] #1 --- src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java | 91 ++++++++++++++++++++++++++++++++------------- 1 files changed, 65 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java index 97933e9..7d9fa2e 100644 --- a/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java @@ -209,20 +209,20 @@ //List<AgvLocDetl> agvLocDetlList = agvLocDetlService.selectList(new EntityWrapper<AgvLocDetl>().eq("loc_no",agvLocMast.getLocNo())); AgvBasDevp agvBasDevp = agvBasDevpService.selectById(agvWrkMast.getSourceLocNo()); - //鎷f枡鍏ュ簱 - if(ioType == 53){ - //淇敼宸ヤ綔鍏氭槑缁� - //agvWrkDetl.setAnfme(agvLocDetl.getAnfme() - agvWrkDetl.getAnfme()); - //agvWrkDetlService.update(agvWrkDetl,new EntityWrapper<AgvWrkDetl>().eq("wrk_no",agvWrkDetl.getWrkNo())); - //淇敼搴撳瓨淇℃伅 - agvWrkDetlList.forEach(agvWrkDetl -> { - AgvLocDetl agvLocDetl = agvLocDetlService.selectByMatnrAndBatchAndCsocodeAndisoCode(agvWrkMast.getLocNo(), agvWrkDetl.getMatnr(), agvWrkDetl.getBatch(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime()); - - //AgvLocDetl agvLocDetl = agvLocDetlService.selectLocdetl(agvWrkMast.getLocNo(),agvWrkDetl.getMatnr(),agvWrkDetl.getBatch(),agvWrkDetl.getThreeCode(),agvWrkDetl.getDeadTime()); - double updateAnfme = agvLocDetl.getAnfme() - agvWrkDetl.getAnfme(); - agvLocDetlService.updateAnfme(updateAnfme,agvLocDetl.getLocNo(),agvLocDetl.getMatnr(),agvLocDetl.getBatch(),agvLocDetl.getThreeCode(),agvLocDetl.getDeadTime()); - }); - } + ////鎷f枡鍏ュ簱 + //if(ioType == 53){ + // //淇敼宸ヤ綔鍏氭槑缁� + // //agvWrkDetl.setAnfme(agvLocDetl.getAnfme() - agvWrkDetl.getAnfme()); + // //agvWrkDetlService.update(agvWrkDetl,new EntityWrapper<AgvWrkDetl>().eq("wrk_no",agvWrkDetl.getWrkNo())); + // //淇敼搴撳瓨淇℃伅 + // agvWrkDetlList.forEach(agvWrkDetl -> { + // AgvLocDetl agvLocDetl = agvLocDetlService.selectByMatnrAndBatchAndCsocodeAndisoCode(agvWrkMast.getLocNo(), agvWrkDetl.getMatnr(), agvWrkDetl.getBatch(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime()); + // + // //AgvLocDetl agvLocDetl = agvLocDetlService.selectLocdetl(agvWrkMast.getLocNo(),agvWrkDetl.getMatnr(),agvWrkDetl.getBatch(),agvWrkDetl.getThreeCode(),agvWrkDetl.getDeadTime()); + // double updateAnfme = agvLocDetl.getAnfme() - agvWrkDetl.getAnfme(); + // agvLocDetlService.updateAnfme(updateAnfme,agvLocDetl.getLocNo(),agvLocDetl.getMatnr(),agvLocDetl.getBatch(),agvLocDetl.getThreeCode(),agvLocDetl.getDeadTime()); + // }); + //} //淇敼搴撲綅淇℃伅 updateAgvLocMast(agvLocMast,"Q"); //淇敼绔欑偣淇℃伅 @@ -563,6 +563,11 @@ //淇敼AGV宸ヤ綔妗g殑宸ヤ綔鐘舵�佷负205.宸ヤ綔瀹屾垚 //agvWrkMastService.updateWrkStsByWrkNo(wrkMast.getWrkNo(),205); + //if (wrkMast.getIoType() == 101) { + // agvWrkMastService.updateWrkStsByWrkNo(wrkMast.getWrkNo(),206,"鎵嬪姩瀹屾垚",userId); + //} else { + // agvWrkMastService.updateWrkStsByWrkNo(wrkMast.getWrkNo(),205,"鎵嬪姩瀹屾垚",userId); + //} agvWrkMastService.updateWrkStsByWrkNo(wrkMast.getWrkNo(),205,"鎵嬪姩瀹屾垚",userId); //鍑哄簱浠诲姟 101.鍑哄簱 || 103.鎷f枡鍑哄簱 || 107.鐩樼偣鍑哄簱 @@ -577,6 +582,10 @@ //鍑哄簱浠诲姟 110.绌烘澘鍑哄簱 if(wrkMast.getIoType() == 110){ agvBasDevpService.updateLocStsAndBarcodeByDevNo(wrkMast.getLocNo(),"F",wrkMast.getBarcode(),wrkMast.getWhsType().shortValue()); + } + if (wrkMast.getIoType() == 10) { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(wrkMast.getSourceLocNo(),"O",wrkMast.getBarcode(),wrkMast.getWhsType().shortValue()); + agvLocMastService.updateLocStsByLocNo(wrkMast.getLocNo(),"F",wrkMast.getBarcode(),(short)getContainerTypeByloc(wrkMast.getLocNo())); } } @@ -647,7 +656,10 @@ } } // 鑷姩璋冩嫧鍑哄簱鍙栨秷 - } else if(wrkMast.getIoType() == 108 || wrkMast.getIoType() == 111) { + } else if(wrkMast.getIoType() == 108 || wrkMast.getIoType() == 111 || wrkMast.getIoType() == 112) { + if (wrkMast.getIoType() == 112) { + throw new CoolException("褰撳墠浣滀笟涓嶈兘鍙栨秷锛�"); + } // 婧愬簱浣� String locNo = wrkMast.getSourceLocNo(); // 鐩爣搴撲綅 @@ -658,9 +670,15 @@ agvLocMastService.updateLocStsByLocNo(targetLocNo,"O","",null); } } else { - if (wrkMast.getWrkSts() != 22) { - agvBasDevpService.updateLocStsAndBarcodeByDevNo(targetLocNo,"O","",wrkMast.getWhsType().shortValue()); + if (wrkMast.getWrkSts() != 207L && wrkMast.getWrkSts() != 205L) { + if (wrkMast.getWrkSts() != 22) { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(targetLocNo,"O","",wrkMast.getWhsType().shortValue()); + } + } else { + throw new CoolException("褰撳墠浣滀笟涓嶈兘鍙栨秷锛�"); } + + } List<AgvLocDetl> agvLocDetls = agvLocDetlService.selectList(new EntityWrapper<AgvLocDetl>().eq("loc_no", locNo)); @@ -679,20 +697,39 @@ //鐩爣绔欑偣 String devNo = wrkMast.getLocNo(); if (wrkMast.getIoType() == 110 || wrkMast.getIoType() == 109) { - agvLocMastService.updateLocStsByLocNo(locNo,"D",wrkMast.getBarcode(),(short)getContainerTypeByloc(locNo)); - } else { - agvLocMastService.updateLocStsByLocNo(locNo,"F",wrkMast.getBarcode(),(short)getContainerTypeByloc(locNo)); - } - if (wrkMast.getIoType() == 109){ - if (Cools.isEmpty(wrkMast.getLocNo())) { + if (wrkMast.getIoType() == 109){ + // 婧愬簱浣嶆槸绔欑偣 + if ("DB".equals(locNo.substring(0,2))) { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(locNo,"F",wrkMast.getBarcode(),wrkMast.getWhsType().shortValue()); + agvLocMastService.updateLocStsByLocNo(devNo,"O","",null); + // 婧愬簱浣嶆槸搴撲綅 鐩爣搴撲綅鏄珯鐐� + } else if ("DB".equals(devNo.substring(0,2))) { + agvLocMastService.updateLocStsByLocNo(locNo,"D",wrkMast.getBarcode(),wrkMast.getWhsType().shortValue()); + agvBasDevpService.updateLocStsAndBarcodeByDevNo(locNo,"O","",null); + // 婧愬簱浣嶆槸搴撲綅 + } else { + agvLocMastService.updateLocStsByLocNo(locNo,"D",wrkMast.getBarcode(),wrkMast.getWhsType().shortValue()); + agvLocMastService.updateLocStsByLocNo(devNo,"O","",null); + } + }else { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(devNo,"O","",null); + } + } else if (wrkMast.getIoType() == 113) { + if (wrkMast.getWrkSts() == 212 || wrkMast.getWrkSts() == 213) { + agvBasDevpService.updateLocStsAndBarcodeByDevNo(locNo,"F",wrkMast.getBarcode(),(short)getContainerTypeByloc(locNo)); } else { - agvLocMastService.updateLocStsByLocNo(devNo,"O","",(short)getContainerTypeByloc(devNo)); + agvBasDevpService.updateLocStsAndBarcodeByDevNo(locNo,"F",wrkMast.getBarcode(),(short)getContainerTypeByloc(locNo)); + if (!Cools.isEmpty(devNo)) { + agvLocMastService.updateLocStsByLocNo(devNo,"0","",null); + } } - }else { + } else { agvBasDevpService.updateLocStsAndBarcodeByDevNo(devNo,"O","",null); + agvLocMastService.updateLocStsByLocNo(locNo,"F",wrkMast.getBarcode(),(short)getContainerTypeByloc(locNo)); } + } if(wrkMast.getIoType() != 1 && wrkMast.getIoType() != 10 && wrkMast.getIoType()!=111 && wrkMast.getIoType()!=108 && wrkMast.getIoType() != 12){ @@ -734,11 +771,11 @@ agvWrkDetlLogService.save(wrkMast.getWrkNo()); - //鍒犻櫎宸ヤ綔妗d互鍙婃槑缁� if(!agvWrkMastService.deleteByWrkNo(wrkMast.getWrkNo()) || !agvWrkDetlService.deleteByWrkNo(wrkMast.getWrkNo())){ throw new CoolException("鍒犻櫎澶辫触锛岃鑱旂郴绠$悊鍛�"); } + if (type == 2) { //璋冪敤agv鍙栨秷浠诲姟鎺ュ彛 agvWrkMastService.callCancelTask(wrkMast.getWrkNo()); @@ -752,6 +789,7 @@ */ private void updateAgvLocMast(AgvLocMast locMast, String locSts){ locMast.setLocSts(locSts); + locMast.setModiTime(new Date()); agvLocMastService.updateById(locMast); } @@ -761,6 +799,7 @@ private void updateAgvLocMast(AgvLocMast locMast, String locSts, short type){ locMast.setLocSts(locSts); locMast.setLocType2(type); + locMast.setModiTime(new Date()); agvLocMastService.updateById(locMast); } -- Gitblit v1.9.1