From 9e6d4880ca1ce6ae5cb9b9dc1b865f0ee9f65fe8 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期五, 19 九月 2025 17:02:45 +0800 Subject: [PATCH] 缓冲区库存调整 --- src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 172 +++++++++++++++++++++++++++++---------------------------- 1 files changed, 88 insertions(+), 84 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 c401b70..09fcff6 100644 --- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java @@ -101,11 +101,11 @@ public R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId, Long userId) { //鍒ゆ柇搴撲綅鐘舵�� LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getLocNo())); - if (Cools.isEmpty(locMast)){ + if (Cools.isEmpty(locMast)) { return R.error("璇ュ簱浣嶄笉瀛樺湪"); } - if (!locMast.getLocSts().equals("P")){ - return R.error("璇ュ簱浣嶇姸鎬佷负锛�"+locMast.getLocSts()+",涓嶆弧瓒虫嫞鏂欓�斾腑骞舵澘鏉′欢锛侊紒锛�"); + if (!locMast.getLocSts().equals("P")) { + return R.error("璇ュ簱浣嶇姸鎬佷负锛�" + locMast.getLocSts() + ",涓嶆弧瓒虫嫞鏂欓�斾腑骞舵澘鏉′欢锛侊紒锛�"); } Date now = new Date(); @@ -135,7 +135,7 @@ wrkMastService.insert(wrkMast); for (OrderDetl orderDetl : param.getCombMats()) { - Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr",orderDetl.getMatnr())); + Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", orderDetl.getMatnr())); if (mat == null) { throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐ワ紝鐗╂枡淇℃伅涓嶅瓨鍦細" + orderDetl.getMatnr()); } @@ -151,7 +151,7 @@ wrkDetl.setModiUser(userId); wrkDetl.setZpallet(wrkMast.getBarcode()); wrkDetl.setBatch(orderDetl.getBatch()); - if(Cools.isEmpty(orderDetl.getBatch())){ + if (Cools.isEmpty(orderDetl.getBatch())) { wrkDetl.setBatch(""); } wrkDetl.setBoxType1(orderDetl.getBoxType1()); @@ -165,11 +165,11 @@ if (!Cools.isEmpty(orderDetl.getOrderNo())) { OrderPakin order = orderPakinService.selectByNo(orderDetl.getOrderNo()); - if (Cools.isEmpty(order)){ + if (Cools.isEmpty(order)) { continue; } - OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); - if (Cools.isEmpty(orderDetlPakin)){ + OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(), orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3()); + if (Cools.isEmpty(orderDetlPakin)) { continue; } if (orderDetlPakin.getAnfme() < (orderDetlPakin.getWorkQty() + orderDetl.getAnfme())) { @@ -177,11 +177,11 @@ } // 淇敼璁㈠崟鏄庣粏浣滀笟鏁伴噺 if (!orderDetlPakinService.increaseWorkQty(orderDetlPakin.getOrderId(), orderDetlPakin.getMatnr(), orderDetlPakin.getBatch(), orderDetlPakin.getBrand(), - orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(),orderDetl.getAnfme())) { + orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(), orderDetl.getAnfme())) { throw new CoolException("淇敼鍗曟嵁鏄庣粏宸ヤ綔鏁伴噺澶辫触"); } - if (order.getSettle() == 1){ + if (order.getSettle() == 1) { orderPakinService.updateSettle(order.getId(), 2L, userId); } } @@ -192,7 +192,7 @@ @Override @Transactional - public R pickConfirm(PickConfirmParam param,Long userId) { + public R pickConfirm(PickConfirmParam param, Long userId) { LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() .eq("loc_no", param.getLocNo())); @@ -216,9 +216,9 @@ //妫�楠屼紶鍙傛槸鍚﹀拰璁㈠崟鏄庣粏鍖归厤 for (PickMatParam matParam : param.getList()) { orderDetlPakin = orderDetlPakinService.selectItem - (matParam.getOrderNo(), matParam.getMatnr(),matParam.getBatch(),matParam.getBrand(), - matParam.getStandby1(),matParam.getStandby2(),matParam.getStandby3(), - matParam.getBoxType1(),matParam.getBoxType2(),matParam.getBoxType3()); + (matParam.getOrderNo(), matParam.getMatnr(), matParam.getBatch(), matParam.getBrand(), + matParam.getStandby1(), matParam.getStandby2(), matParam.getStandby3(), + matParam.getBoxType1(), matParam.getBoxType2(), matParam.getBoxType3()); if (orderDetlPakin == null) { return R.error("鐗╂枡鏁版嵁涓嶅瓨鍦�"); } @@ -282,7 +282,7 @@ wrkDetl.setModiTime(now); wrkDetl.setModiUser(userId); wrkDetl.setZpallet(wrkMast.getBarcode()); - if(Cools.isEmpty(matParam.getBatch())){ + if (Cools.isEmpty(matParam.getBatch())) { wrkDetl.setBatch(""); } if (!wrkDetlService.insert(wrkDetl)) { @@ -291,10 +291,10 @@ //鏇存柊璁㈠崟宸ヤ綔鏁伴噺 orderDetlPakinService.increaseWorkQty(orderDetlPakin.getOrderId(), matParam.getMatnr(), - matParam.getBatch(),matParam.getBrand(),matParam.getStandby1(),matParam.getStandby2(),matParam.getStandby3(), - matParam.getBoxType1(),matParam.getBoxType2(),matParam.getBoxType3(),matParam.getUseCount()); + matParam.getBatch(), matParam.getBrand(), matParam.getStandby1(), matParam.getStandby2(), matParam.getStandby3(), + matParam.getBoxType1(), matParam.getBoxType2(), matParam.getBoxType3(), matParam.getUseCount()); // 鏇存柊宸ヤ綔妗g姸鎬� - orderPakinService.updateSettle(orderDetlPakin.getOrderId(),2L,userId); + orderPakinService.updateSettle(orderDetlPakin.getOrderId(), 2L, userId); } // 淇敼搴撲綅鐘舵��: F.鍦ㄥ簱 ====>>> R.鍑哄簱棰勭害/P.鎷f枡/鐩樼偣/骞舵澘鍑哄簱涓� locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getLocNo())); @@ -317,47 +317,47 @@ public R WarehouseOutV1(CombParam combParam, Long hostId, Long userId) { //鍒ゆ柇搴撲綅鐘舵�� LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", combParam.getLocNo())); - if (Cools.isEmpty(locMast)){ + if (Cools.isEmpty(locMast)) { return R.error("璇ュ簱浣嶄笉瀛樺湪"); } - if (!locMast.getLocSts().equals("P")){ - return R.error("璇ュ簱浣嶇姸鎬佷负锛�"+locMast.getLocSts()+",涓嶆弧瓒冲苟鏉块�斾腑鎷i�夋潯浠讹紒锛侊紒"); + if (!locMast.getLocSts().equals("P")) { + return R.error("璇ュ簱浣嶇姸鎬佷负锛�" + locMast.getLocSts() + ",涓嶆弧瓒冲苟鏉块�斾腑鎷i�夋潯浠讹紒锛侊紒"); } //鏌ヨ搴撳瓨鏁版嵁 - for (CombParam.CombMat combMat :combParam.getCombMats()){ + for (CombParam.CombMat combMat : combParam.getCombMats()) { List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>() - .eq("loc_no", combParam.getLocNo()) - .eq("matnr", combMat.getMatnr()) + .eq("loc_no", combParam.getLocNo()) + .eq("matnr", combMat.getMatnr()) ); - if (locDetlList.isEmpty()){ + if (locDetlList.isEmpty()) { return R.error("鏈煡璇㈠埌搴撳瓨鏁版嵁"); } - if (locDetlList.size()>1){ + if (locDetlList.size() > 1) { return R.error("搴撳瓨鏁版嵁澶т簬1鏉★紝涓轰繚璇佹暟鎹噯纭�э紝璇风敤姝e父娴佺▼鍑哄簱锛侊紒锛�"); } LocDetl locDetl = locDetlList.get(0); - if (combMat.getAnfme() > locDetl.getAnfme()){ + if (combMat.getAnfme() > locDetl.getAnfme()) { return R.error("鎷i�夋暟閲忛敊璇紝瓒呭嚭搴撳瓨鏁伴噺"); } - if (!Cools.isEmpty(combMat.getOrderNo())){ + if (!Cools.isEmpty(combMat.getOrderNo())) { OrderPakout orderPakout = orderPakoutService.selectByNo(combMat.getOrderNo()); - if (Cools.isEmpty(orderPakout)){ + if (Cools.isEmpty(orderPakout)) { continue; } - if (orderPakout.getSettle() == 1){ - OrderInAndOutUtil.updateOrder(false,orderPakout.getId(), 2L, 9527L); + if (orderPakout.getSettle() == 1) { + OrderInAndOutUtil.updateOrder(false, orderPakout.getId(), 2L, 9527L); } OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderPakout.getId(), combMat.getMatnr(), combMat.getBatch(), combMat.getBrand(), combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3()); - if (Cools.isEmpty(orderDetlPakout)){ + if (Cools.isEmpty(orderDetlPakout)) { continue; } - if (orderDetlPakout.getAnfme() < (orderDetlPakout.getWorkQty()+combMat.getAnfme())){ + if (orderDetlPakout.getAnfme() < (orderDetlPakout.getWorkQty() + combMat.getAnfme())) { throw new CoolException("鎷i�夋暟閲忓嚭閿�,璁㈠崟鍓╀綑鍑哄簱鏁伴噺灏忎簬宸插嚭搴撴暟閲忎笌灏嗘嫞閫夋暟閲忎箣鍜岋紒锛侊紒"); } // 淇敼璁㈠崟鏄庣粏浣滀笟鏁伴噺 if (!orderDetlPakoutService.increaseWorkQty(orderDetlPakout.getOrderId(), combMat.getMatnr(), combMat.getBatch(), combMat.getBrand(), - combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3(),combMat.getAnfme())) { + combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3(), combMat.getAnfme())) { throw new CoolException("淇敼鍗曟嵁鏄庣粏宸ヤ綔鏁伴噺澶辫触"); } // // 淇敼璁㈠崟鏄庣粏瀹屾垚鏁伴噺 @@ -395,7 +395,7 @@ wrkMast.setModiUser(userId); wrkMastService.insert(wrkMast); - Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr",combMat.getMatnr())); + Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", combMat.getMatnr())); if (mat == null) { throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐ワ紝鐗╂枡淇℃伅涓嶅瓨鍦細" + combMat.getMatnr()); } @@ -412,7 +412,7 @@ wrkDetl.setModiUser(userId); wrkDetl.setZpallet(wrkMast.getBarcode()); wrkDetl.setBatch(combMat.getBatch()); - if(Cools.isEmpty(combMat.getBatch())){ + if (Cools.isEmpty(combMat.getBatch())) { wrkDetl.setBatch(""); } wrkDetl.setBoxType1(combMat.getBoxType1()); @@ -425,8 +425,8 @@ wrkDetlService.insert(wrkDetl); System.out.println("姝e父"); - }catch (Exception e) { - throw new CoolException("鎿嶄綔鏁版嵁寮傚父锛�"+e.getMessage()); + } catch (Exception e) { + throw new CoolException("鎿嶄綔鏁版嵁寮傚父锛�" + e.getMessage()); } } return R.ok("鎿嶄綔鎴愬姛锛�"); @@ -509,7 +509,7 @@ Wrapper<OrderDetl> wrapper1 = new EntityWrapper<>(); wrapper1.eq("status", 1); wrapper1.in("order_id", orderIds); - wrapper1.orderBy("create_time",false); + wrapper1.orderBy("create_time", false); if (!Cools.isEmpty(matnr)) { wrapper1.like("matnr", matnr); } @@ -539,12 +539,12 @@ } @Override - @Transactional + @Transactional(rollbackFor = Exception.class) public void comb(CombParam param, Long userId) { if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { throw new CoolException(BaseRes.PARAM); } - if(param.getCombMats().size()>1){ + if (param.getCombMats().size() > 1) { throw new CoolException("璇锋彁鍙栦竴涓晢鍝侊紝鎴栬�呭埛鏂伴噸鏂扮粍鎵橈紒"); } // 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁 @@ -553,16 +553,16 @@ throw new CoolException(param.getBarcode() + "鏁版嵁姝e湪杩涜鍏ュ簱"); } - if(param.getBarcode().length()!=8){ + if (param.getBarcode().length() != 8) { throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode()); } - if (param.getCombMats().size()>1){ + if (param.getCombMats().size() > 1) { throw new CoolException("涓嶅厑璁告贩鏂�===>>" + param.getBarcode()); } - int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); - int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); - int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode())); + int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); + int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", 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()); } @@ -575,8 +575,8 @@ // 鐢熸垚鍏ュ簱閫氱煡妗� List<DetlDto> detlDtos = new ArrayList<>(); param.getCombMats().forEach(elem -> { - DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), - elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme()); + DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), + elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); if (DetlDto.has(detlDtos, detlDto)) { DetlDto one = DetlDto.findDto(detlDtos, detlDto); assert one != null; @@ -607,7 +607,7 @@ throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�"); } } - // 鍏宠仈缁勬墭 + // 鍏宠仈缁勬墭 } else { // Order order = orderService.selectByNo(param.getOrderNo()); Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, param.getOrderNo()); @@ -620,8 +620,8 @@ // 璁㈠崟鏄庣粏鏁伴噺鏍¢獙 // OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); - OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), - elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3()); + OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), + elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3()); if (elem.getAnfme() > orderDetl.getEnableQty()) { throw new CoolException(orderDetl.getMatnr() + "鍏ュ簱鏁伴噺涓嶅悎娉�"); } @@ -629,10 +629,10 @@ // if (!orderDetlService.increaseWorkQty(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme())) { // throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触"); // } - OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE,order.getId(), elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), - elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme()); - DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), - elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme()); + OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), + elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); + DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), + elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); if (DetlDto.has(detlDtos, detlDto)) { DetlDto one = DetlDto.findDto(detlDtos, detlDto); assert one != null; @@ -663,7 +663,7 @@ } } // orderService.updateSettle(order.getId(), 2L, userId); - OrderInAndOutUtil.updateOrder(Boolean.TRUE,order.getId(), 2L, userId); + OrderInAndOutUtil.updateOrder(Boolean.TRUE, order.getId(), 2L, userId); } } @@ -680,15 +680,15 @@ } // 鑾峰彇鍟嗗搧鍒楄〃 - for(CombParam.CombMat combMat : param.getCombMats()){ + for (CombParam.CombMat combMat : param.getCombMats()) { Mat mat = matService.selectByMatnr(combMat.getMatnr()); - if (Cools.isEmpty(mat)){ + if (Cools.isEmpty(mat)) { throw new CoolException(combMat.getMatnr() + ":鍟嗗搧妗f涓嶅瓨鍦紒"); } - if (Cools.isEmpty(combMat.getAnfme()) || combMat.getAnfme()==0){ + if (Cools.isEmpty(combMat.getAnfme()) || combMat.getAnfme() == 0) { throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鏁伴噺鏈夎锛�"); } - if (Cools.isEmpty(combMat.getBatch())){ + if (Cools.isEmpty(combMat.getBatch())) { // throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鎵瑰彿鏈夎锛�"); } ManLocDetl manLocDetl = new ManLocDetl(); @@ -709,16 +709,16 @@ @Override public void offSale(OffSaleParam offSaleParam) { ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); - if (Cools.isEmpty(manLocDetl)){ + if (Cools.isEmpty(manLocDetl)) { throw new CoolException("鏃犳鍟嗗搧锛�"); } double anfme = manLocDetl.getAnfme() - offSaleParam.getAnfme(); if (anfme < 0) { throw new CoolException("鍟嗗搧搴撳瓨涓嶈冻锛�"); - } else if (anfme == 0){ + } else if (anfme == 0) { manLocDetlMapper.deleteLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); } - manLocDetlMapper.updateAnfme0(anfme,manLocDetl.getNodeId()); + manLocDetlMapper.updateAnfme0(anfme, manLocDetl.getNodeId()); } // 鏌ユ壘鍟嗗搧 @@ -777,7 +777,9 @@ // 娣诲姞鏄庣粏 for (WrkDetl wrkDetl : list) { - if (wrkDetl.getAnfme() == 0.0D) { continue; } + if (wrkDetl.getAnfme() == 0.0D) { + continue; + } // todo 鐩樼偣璁板綍銆佷繚瀛樿皟鏁磋褰� String orderNo = wrkDetl.getOrderNo(); Mat mat = matService.selectByMatnr(wrkDetl.getMatnr()); @@ -793,7 +795,7 @@ } // 淇敼鐩樼偣浠诲姟涓绘。鐘舵�� - wrkMast.setFullPlt(wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()).size() != 0?"Y":"N"); + wrkMast.setFullPlt(wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()).size() != 0 ? "Y" : "N"); wrkMast.setModiTime(now); wrkMast.setModiUser(userId); if (!wrkMastService.updateById(wrkMast)) { @@ -835,8 +837,8 @@ } Mat analyse = MatUtils.analyseMat(elem.getMatnr()); // 鏉$爜銆佺墿鏂欎唬鐮併�佸簭鍒楀彿銆佹暟閲� - DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),analyse.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(), - elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme()); + DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), analyse.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), + elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); // DetlDto detlDto = new DetlDto(elem.getMatnr(), analyse.getMatnr(), analyse.getBarcode(), elem.getAnfme()); // DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); @@ -873,10 +875,10 @@ if (jsonObject.getInteger("code").equals(200)) { success = true; } else if (jsonObject.getInteger("code").equals(500)) { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); + log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); throw new CoolException(jsonObject.getString("msg")); } else { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); + log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); throw new CoolException("涓婃姤mes绯荤粺澶辫触"); } } catch (Exception e) { @@ -894,7 +896,9 @@ response, success ); - } catch (Exception e) { log.error("", e); } + } catch (Exception e) { + log.error("", e); + } } } @@ -924,8 +928,8 @@ // 淇敼浣滀笟鏁伴噺 ---------------------------------------- // 璁㈠崟鏄庣粏鏁伴噺鏍¢獙 // OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), detlDto.getMatnr(), detlDto.getBatch()); - OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3() - ,detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3()); + OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3() + , detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3()); if (detlDto.getAnfme() > orderDetl.getEnableQty()) { throw new CoolException(orderDetl.getMatnr() + "鍏ュ簱鏁伴噺涓嶅悎娉�"); } @@ -933,8 +937,8 @@ // if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) { // throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触"); // } - OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE,order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3() - ,detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme()); + OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3() + , detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme()); // 淇濆瓨鍏ュ簱閫氱煡妗� Mat mat = matService.selectByMatnr(detlDto.getMatnr()); if (Cools.isEmpty(mat)) { @@ -978,7 +982,7 @@ //鏍规嵁璁㈠崟鍙风敓鎴愬嚭搴撲换鍔″伐浣滄。 Order order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, orderNo); // Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", orderNo)); - if (order.getSettle() != 1 && order.getSettle() != 2){ + if (order.getSettle() != 1 && order.getSettle() != 2) { throw new CoolException("璇ヨ鍗曞凡澶勭悊"); } @@ -986,13 +990,13 @@ List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId()); Date now = new Date(); - for(OrderDetl orderDetl : orderDetls){ + for (OrderDetl orderDetl : orderDetls) { //鏌ヨ鎵�鏈夊簱浣嶇姸鎬佷负F鐨勫簱浣嶄俊鎭� - List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(),orderDetl.getBatch(),null,null); + List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null, null); if (locDetls.size() == 0) { throw new CoolException("搴撳瓨涓病鏈夎鐗╂枡"); } - for(LocDetl locDetl : locDetls){ + for (LocDetl locDetl : locDetls) { //濡傛灉璇ュ簱浣嶅嚭搴撹矾绾挎墍鐢ㄧ殑鍫嗗灈鏈簅ut_enable涓嶄负Y,璺宠繃璇ュ惊鐜� LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() .eq("loc_no", locDetl.getLocNo())); @@ -1001,13 +1005,13 @@ } BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>() .eq("crn_no", locMast.getCrnNo())); - if (Cools.isEmpty(crn_no) || !crn_no.getOutEnable().equals("Y")){ + if (Cools.isEmpty(crn_no) || !crn_no.getOutEnable().equals("Y")) { continue; } //鍙嚭搴撴暟閲� = 璁㈠崟鏁伴噺 - 浣滀笟涓暟閲� Double outQty = orderDetl.getAnfme() - orderDetl.getWorkQty(); - if(outQty <= 0){ + if (outQty <= 0) { break; } // 鍒ゆ柇鍏ュ嚭搴撶被鍨嬶細101.鍏ㄦ澘鍑哄簱 or 103.鎷f枡鍑哄簱 @@ -1022,19 +1026,19 @@ // if(!orderService.update(order, new EntityWrapper<Order>().eq("order_no", orderNo))){ // throw new CoolException("鏇存柊璁㈠崟鐘舵�佸け璐�"); // } - OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),2L,userId); + OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 2L, userId); orderDetl.setWorkQty(orderDetl.getWorkQty() + curOutQty); orderDetl.setUpdateBy(userId); orderDetl.setUpdateTime(now); Wrapper wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo) - .eq("matnr",orderDetl.getMatnr()); - if(!Cools.isEmpty(orderDetl.getBatch())){ + .eq("matnr", orderDetl.getMatnr()); + if (!Cools.isEmpty(orderDetl.getBatch())) { wrapper.eq("batch", orderDetl.getBatch()); } // if(!orderDetlService.update(orderDetl, wrapper)){ // throw new CoolException("鏇存柊璁㈠崟鏄庣粏澶辫触"); // } - OrderInAndOutUtil.updateOrderDetl(order.getPakinPakoutStatus$(),order,orderDetl); + OrderInAndOutUtil.updateOrderDetl(order.getPakinPakoutStatus$(), order, orderDetl); } -- Gitblit v1.9.1