From a48548b110cc1c80e5ee5e5eedeca8bb31e3f295 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期五, 31 五月 2024 19:02:30 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java | 73 ++++++++++++++++++++++++++++++++++-- 1 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java index 2b26325..825a213 100644 --- a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java @@ -118,7 +118,8 @@ for (PickParam.Pick pick : pickParams.getPicks()) { if (pick.getCount().equals(0D)) continue; - AgvWrkDetl agvWrkDetl = agvWrkDetlService.selectOne(new EntityWrapper<AgvWrkDetl>().eq("matnr", pick.getMatnr()).eq("three_code", pick.getThreeCode())); + Double count = 0.0D; + AgvWrkDetl agvWrkDetl = agvWrkDetlService.selectOne(new EntityWrapper<AgvWrkDetl>().eq("matnr", pick.getMatnr()).eq("three_code", pick.getThreeCode()).eq("supp_code",pick.getSuppCode())); if (Cools.isEmpty(agvWrkDetl)) { AgvWrkDetl wrkDetl = new AgvWrkDetl(); Mat mat = matService.selectByMatnr(pick.getMatnr()); @@ -140,7 +141,7 @@ } else { Double anfme = agvWrkDetl.getAnfme() + pick.getCount(); agvWrkDetl.setAnfme(anfme); - agvWrkDetlService.update(agvWrkDetl,new EntityWrapper<AgvWrkDetl>().eq("matnr",agvWrkDetl.getMatnr()).eq("three_code",agvWrkDetl.getThreeCode())); + agvWrkDetlService.update(agvWrkDetl,new EntityWrapper<AgvWrkDetl>().eq("matnr",agvWrkDetl.getMatnr()).eq("three_code",agvWrkDetl.getThreeCode()).eq("supp_code",pick.getSuppCode())); } @@ -393,7 +394,15 @@ } } else { if (agvLocMast.getFloor() != floor) { - ioType = 12; + if (floor==1 && agvLocMast.getFloor()!=1){ + ioType = 121; + }else { + if (agvLocMast.getFloor() == 1) { + throw new CoolException("褰撳墠搴撲綅璇烽�夋嫨璋冩嫧鍗曡皟鎷紒"); + } else { + ioType = 12; + } + } } else { ioType = 11; } @@ -412,7 +421,11 @@ //鐢熸垚宸ヤ綔妗� AgvWrkMast mast = new AgvWrkMast(); //宸ヤ綔鐘舵�� - mast.setWrkSts(201L); + if (ioType==121) { + mast.setWrkSts(11L); + }else { + mast.setWrkSts(201L); + } //鍏ュ嚭搴撶被鍨� mast.setIoType(ioType); mast.setIoTime(now); @@ -453,6 +466,7 @@ } }); } + // 濡傛灉褰撳墠浠诲姟鏄澹充簩涓夋ゼ鍥為��涓�妤肩殑 鍥炴粴璋冩嫧鍗� if (ioType == 12 && locMast.getFloor() == 1) { List<AgvLocDetl> agvLocDetls = agvLocDetlService.selectList(new EntityWrapper<AgvLocDetl>().eq("loc_no", agvLocMast.getLocNo())); @@ -520,6 +534,9 @@ public String allocationIn(AgvMobileStartPakin param, Long userId) { Date now = new Date(); AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", param.getBarcode())); + if (agvWrkMast.getIoType() != 111) { + throw new CoolException("闈炴墜鍔ㄨ皟鎷ㄤ换鍔★紝涓嶆敮鎸佹鍔熻兘"); + } AgvBasDevp agvBasDevp = agvBasDevpService.selectByDevNo(param.getDevNo()); if (Cools.isEmpty(agvWrkMast)) { throw new CoolException("宸ヤ綔妗d腑娌℃湁姝よ揣鏋朵换鍔�"); @@ -527,6 +544,7 @@ if (agvWrkMast.getCrnNo() != agvBasDevp.getFloor()) { throw new CoolException("璇风Щ鍔ㄥ埌->" + agvWrkMast.getCrnNo() + "妤煎叆搴撶偣鍏ュ簱"); } + AgvLocMast locNo = agvCommonService.getLocNo(3, 1); //宸ヤ綔鐘舵�� agvWrkMast.setWrkSts(211L); //鍏ュ嚭搴撶被鍨� @@ -537,12 +555,57 @@ if (!agvWrkMastService.update(agvWrkMast,new EntityWrapper<AgvWrkMast>().eq("wrk_no",agvWrkMast.getWrkNo()))) { throw new CoolException("鏇存柊宸ヤ綔妗eけ璐�"); } + // + agvLocMastService.updateLocStsByLocNo(locNo.getLocNo(),"S",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); // 鏇存柊婧愬簱浣嶇姸鎬� - agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); + agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"R",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); //鍒犻櫎AGV宸ヤ綔妗� return "ok"; } /* + 绌烘灦绂诲満 + */ + @Override + @Transactional + @Synchronized + public String empOut(AgvMobileStartPakin param, Long userId) { + Date now = new Date(); + AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("source_loc_no", param.getDevNo())); + Integer oldWrkNo = agvWrkMast.getWrkNo(); + if (Cools.isEmpty(agvWrkMast)) { + throw new CoolException("宸ヤ綔妗d腑娌℃湁姝ょ珯鐐逛换鍔�"); + } + agvWrkMast.setWrkSts(213L); + agvWrkMast.setSourceLocNo(""); + if (!agvWrkMastService.update(agvWrkMast,new EntityWrapper<AgvWrkMast>().eq("wrk_no",agvWrkMast.getWrkNo()))) { + throw new CoolException("鏇存柊宸ヤ綔妗eけ璐�"); + } + // 鏇存柊婧愬簱浣嶇姸鎬� + agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"O","",agvWrkMast.getWhsType().shortValue()); + return "ok"; + } + /* + 绌烘灦杩涘満 + */ + @Override + @Transactional + @Synchronized + public String empIn(AgvMobileStartPakin param, Long userId) { + Date now = new Date(); + AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", param.getBarcode())); + if (Cools.isEmpty(agvWrkMast)) { + throw new CoolException("宸ヤ綔妗d腑娌℃湁姝ょ珯鐐逛换鍔�"); + } + agvWrkMast.setWrkSts(214L); + agvWrkMast.setSourceLocNo(param.getDevNo()); + if (!agvWrkMastService.update(agvWrkMast,new EntityWrapper<AgvWrkMast>().eq("wrk_no",agvWrkMast.getWrkNo()))) { + throw new CoolException("鏇存柊宸ヤ綔妗eけ璐�"); + } + // 鏇存柊婧愬簱浣嶇姸鎬� + agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",param.getBarcode(),agvWrkMast.getWhsType().shortValue()); + return "ok"; + } + /* * 绔欑偣鍥為�� */ @Override -- Gitblit v1.9.1