From 11a590bda370ddad398b2c3ae68a218ee8d5a5d2 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期一, 10 十一月 2025 15:41:55 +0800
Subject: [PATCH] 项目wms功能初始化

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   64 ++++++++++++++++----------------
 1 files changed, 32 insertions(+), 32 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 1867759..ed39a44 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -626,7 +626,7 @@
             param.getCombMats().forEach(elem -> {
                 OrderPakin order = orderPakinService.selectByNo(elem.getOrderNo());
                 if (Cools.isEmpty(order) || order.getSettle() > 2) {
-                    throw new CoolException("鍗曟嵁缂栧彿宸茶繃鏈�");
+                    throw new CoolException("鍗曟嵁姝e湪浣滀笟涓�");
                 }
                 // 璁㈠崟鏄庣粏鏁伴噺鏍¢獙
                 OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
@@ -655,38 +655,38 @@
                 }
             });
 
-            BasContainer container = basContainerService.selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
-            if (Objects.isNull(container)) {
-                throw new CoolException("鏁版嵁閿欒锛氬鍣ㄧ爜涓嶅瓨鍦紒锛�");
-            }
-            if (container.getMixMax() < detlDtos.size()) {
-                throw new CoolException("瓒呭嚭瀹瑰櫒鏈�澶ф贩瑁呮暟閲忥紝褰撳墠瀹瑰櫒鏈�澶ф暟閲忎负锛�" + container.getMixMax() + "!!");
-            }
-            Set<String> matnrs = detlDtos.stream().map(DetlDto::getMatnr).collect(Collectors.toSet());
-            List<Mat> mats = matService.selectList(new EntityWrapper<Mat>().in("matnr", matnrs));
-            Set<Long> tagIds = mats.stream().map(Mat::getTagId).collect(Collectors.toSet());
-            if (tagIds.size() > 1) {
-                throw new CoolException("缁勬墭鐗╂枡绫诲瀷涓嶄竴鑷达紝鍙湁鐩稿悓鐨勭墿鏂欏垎绫绘墠鍙互缁勬墭锛侊紒");
-            }
-            //杩樺彲浠ユ斁鍏ュ灏戠鐗╂枡
-            Integer suplus = container.getMixMax();
+//            BasContainer container = basContainerService.selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
+//            if (Objects.isNull(container)) {
+//                throw new CoolException("鏁版嵁閿欒锛氬鍣ㄧ爜涓嶅瓨鍦紒锛�");
+//            }
+//            if (container.getMixMax() < detlDtos.size()) {
+//                throw new CoolException("瓒呭嚭瀹瑰櫒鏈�澶ф贩瑁呮暟閲忥紝褰撳墠瀹瑰櫒鏈�澶ф暟閲忎负锛�" + container.getMixMax() + "!!");
+//            }
+//            Set<String> matnrs = detlDtos.stream().map(DetlDto::getMatnr).collect(Collectors.toSet());
+//            List<Mat> mats = matService.selectList(new EntityWrapper<Mat>().in("matnr", matnrs));
+//            Set<Long> tagIds = mats.stream().map(Mat::getTagId).collect(Collectors.toSet());
+//            if (tagIds.size() > 1) {
+//                throw new CoolException("缁勬墭鐗╂枡绫诲瀷涓嶄竴鑷达紝鍙湁鐩稿悓鐨勭墿鏂欏垎绫绘墠鍙互缁勬墭锛侊紒");
+//            }
+//            //杩樺彲浠ユ斁鍏ュ灏戠鐗╂枡
+//            Integer suplus = container.getMixMax();
             for (DetlDto detlDto : detlDtos) {
                 Mat mat = matService.selectByMatnr(detlDto.getMatnr());
                 if (Cools.isEmpty(mat)) {
                     throw new CoolException(detlDto.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�");
                 }
-                //鏈�澶氬彲鏀炬暟閲�
-                Double singleMax = mat.getUpQty() * suplus;
-                if (singleMax.compareTo(detlDto.getAnfme()) < 0) {
-                    throw new CoolException("鐗╂枡锛�" + detlDto.getMatnr() + "鍗曟缁勬墭涓婇檺涓猴細" + mat.getUpQty() + ",褰撳墠鎬婚噺瓒呭嚭鎵樼洏瑁呰浇涓婇檺!!");
-                }
-                BigDecimal decimal = new BigDecimal(detlDto.getAnfme() / mat.getUpQty());
-                //褰撳墠鐗╂枡闇�瑕佸崰鐢ㄦ枡绠辨牸鏁�
-                Integer curr = decimal.setScale(0, RoundingMode.CEILING).intValue();
-                suplus = suplus - curr;
-                if (suplus < 0) {
-                    throw new CoolException("鐗╂枡锛�" + detlDto.getMatnr() + ", 瓒呭嚭褰撳墠鎵樼洏瑁呰浇涓婇檺锛侊紒");
-                }
+//                //鏈�澶氬彲鏀炬暟閲�
+//                Double singleMax = mat.getUpQty() * suplus;
+//                if (singleMax.compareTo(detlDto.getAnfme()) < 0) {
+//                    throw new CoolException("鐗╂枡锛�" + detlDto.getMatnr() + "鍗曟缁勬墭涓婇檺涓猴細" + mat.getUpQty() + ",褰撳墠鎬婚噺瓒呭嚭鎵樼洏瑁呰浇涓婇檺!!");
+//                }
+//                BigDecimal decimal = new BigDecimal(detlDto.getAnfme() / mat.getUpQty());
+//                //褰撳墠鐗╂枡闇�瑕佸崰鐢ㄦ枡绠辨牸鏁�
+//                Integer curr = decimal.setScale(0, RoundingMode.CEILING).intValue();
+//                suplus = suplus - curr;
+//                if (suplus < 0) {
+//                    throw new CoolException("鐗╂枡锛�" + detlDto.getMatnr() + ", 瓒呭嚭褰撳墠鎵樼洏瑁呰浇涓婇檺锛侊紒");
+//                }
 
                 WaitPakin waitPakin = new WaitPakin();
                 BeanUtils.copyProperties(mat, waitPakin);
@@ -914,7 +914,7 @@
                 boolean success = false;
                 try {
                     response = new HttpHandler.Builder()
-                            .setUri(MesConstant.URL)
+                            .setUri(MesConstant.URI)
                             .setPath(MesConstant.PACK_DOWN_URL)
                             .setJson(JSON.toJSONString(mesCombParam))
                             .build()
@@ -923,10 +923,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.URI + 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.URI + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response);
                         throw new CoolException("涓婃姤mes绯荤粺澶辫触");
                     }
                 } catch (Exception e) {
@@ -937,7 +937,7 @@
                         // 淇濆瓨鎺ュ彛鏃ュ織
                         apiLogService.save(
                                 "鎵撳寘涓嬬嚎甯墭涓婃姤",
-                                MesConstant.URL + MesConstant.PACK_DOWN_URL,
+                                MesConstant.URI + MesConstant.PACK_DOWN_URL,
                                 null,
                                 "127.0.0.1",
                                 JSON.toJSONString(mesCombParam),

--
Gitblit v1.9.1