From 4fb3d8b70a6e15a82e0da5159fd33827a83a41ff Mon Sep 17 00:00:00 2001 From: lty <876263681@qq.com> Date: 星期三, 28 五月 2025 10:42:48 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/locDetl/locDetl.js | 6 ++- src/main/webapp/static/js/order/out.js | 8 ++-- src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java | 16 ++++++++ src/main/java/com/zy/common/model/TaskDto.java | 51 ++++++++++++++++++------- src/main/webapp/static/js/common.js | 2 5 files changed, 62 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java index 3f36284..395bd6a 100644 --- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java @@ -26,6 +26,7 @@ import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; /** * Created by vincent on 2020/6/11 @@ -295,6 +296,21 @@ } // 鑾峰彇搴撲綅 LocMast locMast = locMastService.selectById(taskDto.getLocNo()); + // 鏋勫缓鍑哄簱鏄庣粏锛堢敤浜� isAll 鍒ゆ柇锛� + List<LocDetlDto> locDetlDtos = locDtos.stream().map(locDto -> { + LocDetl locDetl = new LocDetl(); + locDetl.setMatnr(locDto.getMatnr()); + locDetl.setBatch(locDto.getBatch()); + locDetl.setAnfme(locDto.getAnfme()); + + LocDetlDto dto = new LocDetlDto(); + dto.setLocDetl(locDetl); + dto.setCount(locDto.getAnfme()); + return dto; + }).collect(Collectors.toList()); + + taskDto.setLocDetlDtos(locDetlDtos); + // 鑾峰彇璺緞 int ioType = taskDto.isAll() ? 101 : 103; StaDesc staDesc = staDescService.queryCrnStnAuto(ioType, locMast.getCrnNo(), staNo.getDevNo()); diff --git a/src/main/java/com/zy/common/model/TaskDto.java b/src/main/java/com/zy/common/model/TaskDto.java index 0c467ff..2da937d 100644 --- a/src/main/java/com/zy/common/model/TaskDto.java +++ b/src/main/java/com/zy/common/model/TaskDto.java @@ -119,36 +119,59 @@ // } // return sameNumber == locDetls.size(); // } -public boolean isAll(){ +public boolean isAll() { + // 娣辨嫹璐濓紝闃叉鍘熼泦鍚堣淇敼 List<LocDetlDto> locDetlDtosCp = new ArrayList<>(this.locDetlDtos); - // 鏌ヨ褰撳墠搴撲綅鍙锋墍鏈夌殑搴撳瓨鏄庣粏 + + // 鏌ヨ褰撳墠搴撲綅鍙锋墍鏈夊簱瀛樻槑缁� LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class); - List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", this.locNo)); - if (locDetls == null || locDetls.isEmpty()){ + List<LocDetl> locDetls = locDetlService.selectList( + new EntityWrapper<LocDetl>().eq("loc_no", this.locNo) + ); + + if (locDetls == null || locDetls.isEmpty()) { throw new CoolException("妫�绱㈠簱瀛樻槑缁嗗け璐ワ紝搴撲綅鍙�=" + this.locNo); } + int sameNumber = 0; + for (LocDetl locDetl : locDetls) { + boolean matched = false; + + System.out.println("褰撳墠搴撳瓨鏄庣粏: matnr=" + locDetl.getMatnr() + ", batch=" + locDetl.getBatch() + ", anfme=" + locDetl.getAnfme()); + Iterator<LocDetlDto> iterator = locDetlDtosCp.iterator(); while (iterator.hasNext()) { - LocDetlDto next = iterator.next(); - if (!next.getLocDetl().getMatnr().equals(locDetl.getMatnr())) { - continue; + LocDetlDto dto = iterator.next(); + String dtoMatnr = dto.getLocDetl().getMatnr(); + String dtoBatch = dto.getLocDetl().getBatch(); + Double dtoCount = dto.getCount(); + + System.out.println("姣旇緝瀵硅薄: matnr=" + dtoMatnr + ", batch=" + dtoBatch + ", count=" + dtoCount); + + if (!dtoMatnr.equals(locDetl.getMatnr())) continue; + if (!Cools.eq(dtoBatch, locDetl.getBatch())) continue; + + if (dtoCount > locDetl.getAnfme()) { + throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇紝鏁伴噺澶т簬搴撳瓨"); } - if (!Cools.eq(next.getLocDetl().getBatch(), locDetl.getBatch())) { - continue; - } - if (next.getCount() > locDetl.getAnfme()) { - throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇�"); - } - if (next.getCount().equals(locDetl.getAnfme())) { + + if (dtoCount.equals(locDetl.getAnfme())) { sameNumber++; + matched = true; iterator.remove(); + System.out.println("鍖归厤鎴愬姛骞剁Щ闄よ椤癸紝褰撳墠 sameNumber = " + sameNumber + "锛屽墿浣欏尮閰嶆暟: " + locDetlDtosCp.size()); break; } } + + if (!matched) { + System.out.println("鏈尮閰嶆垚鍔�: matnr=" + locDetl.getMatnr() + ", batch=" + locDetl.getBatch()); + } } + return sameNumber == locDetls.size(); } + } diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js index ff83bb2..67723c6 100644 --- a/src/main/webapp/static/js/common.js +++ b/src/main/webapp/static/js/common.js @@ -219,7 +219,7 @@ ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳', hide: true} ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿', hide: true} ,{field: 'memo', align: 'center',title: '澶囨敞', hide: true} - ,{field: 'proType', align: 'center',title: '灞炴��', hide: true} + ,{field: 'proType', align: 'center',title: '灞炴��', hide: false} ,{field: 'temp1', align: 'center',title: '鍚嶇О鎬荤О', hide: false} ,{field: 'outOrderNo', align: 'center',title: '鍚堝悓鍙�', hide: true} diff --git a/src/main/webapp/static/js/locDetl/locDetl.js b/src/main/webapp/static/js/locDetl/locDetl.js index a6ded71..ca8e66f 100644 --- a/src/main/webapp/static/js/locDetl/locDetl.js +++ b/src/main/webapp/static/js/locDetl/locDetl.js @@ -7,7 +7,7 @@ ,{field: 'model', align: 'center',title: '浠g爜'} ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', sort:true} ,{field: 'spgNO', align: 'center',title: '娲惧伐鍗曞彿', hide:true,sort:true} - ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', hide: true} + ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', hide: false} ,{field: 'batch', align: 'center',title: '鎵瑰彿', width: 200,hide:true, sort:true} ,{field: 'outOrderNo', align: 'center',title: '鍚堝悓鍙�'} ,{field: 'anfme', align: 'center',title: '鏁伴噺'} @@ -25,7 +25,7 @@ ,{field: 'manuDate', align: 'center',title: '鐢熶骇鏃ユ湡', hide: true} ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�', hide: true} ,{field: 'safeQty', align: 'center',title: '瀹夊叏搴撳瓨閲�', hide: true} - ,{field: 'weight', align: 'center',title: '鎬婚噸', hide: true} + ,{field: 'weight', align: 'center',title: '鎬婚噸', hide: false} ,{field: 'length', align: 'center',title: '鍗曠姣涢噸', hide: true} ,{field: 'volume', align: 'center',title: '鍗曠浣撶Н', hide: true} ,{field: 'threeCode', align: 'center',title: '绠卞瓙灏哄', hide: true} @@ -37,6 +37,8 @@ ,{field: 'source$', align: 'center',title: '鍒惰喘', hide: true} ,{field: 'check$', align: 'center',title: '瑕佹眰妫�楠�', hide: true} ,{field: 'danger$', align: 'center',title: '鍗遍櫓鍝�', hide: true} + ,{field: 'proType', align: 'center',title: '灞炴��', hide: false} + ,{field: 'temp1', align: 'center',title: '鍚嶇О鎬荤О', hide: false} ]; diff --git a/src/main/webapp/static/js/order/out.js b/src/main/webapp/static/js/order/out.js index 5eb388c..27a69e2 100644 --- a/src/main/webapp/static/js/order/out.js +++ b/src/main/webapp/static/js/order/out.js @@ -34,7 +34,7 @@ ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl', width: 160} ,{field: 'matnr', align: 'center',title: '鍟嗗搧缂栫爜', width: 160} ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', width: 200} - ,{field: 'batch', align: 'center',title: '搴忓垪鐮�'} + ,{field: 'batch', align: 'center',title: '鎵瑰彿'} ,{field: 'specs', align: 'center',title: '瑙勬牸'} ,{field: 'sPgNO', align: 'center',title: '娲惧伐鍗曞彿',hide:true} // ,{field: 'anfme', align: 'center',title: '鏁伴噺'} @@ -160,17 +160,17 @@ // {type: 'checkbox', merge: ['orderNo']}, {field: 'orderNo', title: '鍗曟嵁缂栧彿', merge: true, align: 'center'}, {field: 'title', title: '鍟嗗搧', merge: true, align: 'center', width: 350}, - {field: 'model', title: '浜у搧缂栧彿', align: 'center'}, + {field: 'model', title: '浠e彿', align: 'center'}, {field: 'batch', title: '鎵规', align: 'center'}, {field: 'sPgNO', title: '娲惧伐鍗曞彿', align: 'center',hide:true}, {field: 'anfme', title: '鏁伴噺', align: 'center', width: 90, style: 'font-weight: bold'}, {field: 'zpallet', align: 'center',title: '鎵樼洏鐮�'}, {field: 'locNo', title: '璐т綅', align: 'center', width: 100, templet: '#locNoTpl'}, {field: 'staNos', align: 'center', title: '鍑哄簱绔�', merge: ['locNo'], templet: '#tbBasicTbStaNos'}, - {field: 'outOrderNo', hide: true}, + {field: 'outOrderNo', hide: false}, {field: 'luHao', hide: true}, {field: 'packing', hide: true}, - {field: 'proType', hide: true}, + {field: 'proType', hide: false}, {type: 'checkbox', merge: ['locNo']}, ]], done: function (res) { -- Gitblit v1.9.1