From 6bad812c69f2adbcc7ffc386e18db701f5c8fe93 Mon Sep 17 00:00:00 2001 From: 野心家 <1051256694@qq.com> Date: 星期六, 21 十二月 2024 15:22:06 +0800 Subject: [PATCH] 找库位:深浅一起找 --- src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 38 +++++++++++++++++++++++++++----------- 1 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java index 2e8c7f3..201f8ef 100644 --- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java @@ -91,10 +91,15 @@ throw new CoolException(param.getBarcode() + "鏁版嵁姝e湪杩涜鍏ュ簱"); } + if(param.getBarcode().length()!=8){ + throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode()); + } + int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); - if (countLoc > 0 || countWrk > 0) { - throw new CoolException("宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode()); + int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode())); + if (countLoc > 0 || countWrk > 0 || countwait > 0) { + throw new CoolException("缁勬墭妗�/宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode()); } Date now = new Date(); @@ -123,7 +128,7 @@ } WaitPakin waitPakin = new WaitPakin(); waitPakin.sync(mat); - waitPakin.setBatch(detlDto.getBatch()); + waitPakin.setBatch(Cools.isEmpty(detlDto.getBatch())? "鏃�":detlDto.getBatch()); waitPakin.setZpallet(param.getBarcode()); // 鎵樼洏鐮� waitPakin.setIoStatus("N"); // 鍏ュ嚭鐘舵�� waitPakin.setAnfme(detlDto.getAnfme()); // 鏁伴噺 @@ -139,7 +144,7 @@ // 鍏宠仈缁勬墭 } else { Order order = orderService.selectByNo(param.getOrderNo()); - if (order.getSettle() > 2) { + if (Cools.isEmpty(order) || order.getSettle() > 2) { throw new CoolException("鍗曟嵁缂栧彿宸茶繃鏈�"); } // 鐢熸垚鍏ュ簱閫氱煡妗� @@ -191,6 +196,7 @@ } + // 鍟嗗搧涓婃灦 @Override public void onSale(CombParam param) { Date now = new Date(); @@ -211,14 +217,14 @@ throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鏁伴噺鏈夎锛�"); } if (Cools.isEmpty(combMat.getBatch())){ - throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鎵瑰彿鏈夎锛�"); +// throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鎵瑰彿鏈夎锛�"); } ManLocDetl manLocDetl = new ManLocDetl(); manLocDetl.setLocNo(locno); manLocDetl.setNodeId(node.getId()); manLocDetl.setMaktx(mat.getMaktx()); manLocDetl.setMatnr(mat.getMatnr()); - manLocDetl.setBatch(combMat.getBatch()); + manLocDetl.setBatch(Cools.isEmpty(combMat.getBatch()) ? "" : combMat.getBatch()); manLocDetl.setAnfme(combMat.getAnfme()); manLocDetl.setModiTime(now); if (!manLocDetlService.insert(manLocDetl)) { @@ -227,15 +233,25 @@ } } + // 鍟嗗搧涓嬫灦 @Override public void offSale(OffSaleParam offSaleParam) { - List<ManLocDetl> manLocDetls = manLocDetlMapper.selectLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); - if (Cools.isEmpty(manLocDetls)){ - throw new CoolException("鍟嗗搧涓嬫灦澶辫触锛�"); + ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); + if (Cools.isEmpty(manLocDetl)){ + throw new CoolException("鏃犳鍟嗗搧锛�"); } - int i = manLocDetlMapper.deleteLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); - System.out.println(i); + double anfme = manLocDetl.getAnfme() - offSaleParam.getAnfme(); + if (anfme < 0) { + throw new CoolException("鍟嗗搧搴撳瓨涓嶈冻锛�"); + } else if (anfme == 0){ + manLocDetlMapper.deleteLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); + } + manLocDetlMapper.updateAnfme0(anfme,manLocDetl.getNodeId()); } + + // 鏌ユ壘鍟嗗搧 + + @Override @Transactional public void adjust(MobileAdjustParam param, Long userId) { -- Gitblit v1.9.1