From 4bb523147bc6e9fef20142d1389c893f97321e02 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期三, 26 十一月 2025 09:16:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/jshdasrs' into jshdasrs

---
 src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java b/src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java
index 78a0c28..c7c2ed1 100644
--- a/src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java
+++ b/src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java
@@ -130,10 +130,9 @@
                 case "PUR_RECEIVEBIll": //宸插鏍告敹鏂欏崟鏌ヨ
 //                    jsonObject.put("start_biztime", latestUpdateTime);//涓氬姟璧峰鏃ユ湡
                     jsonObject.put("start_biztime",  "2025-01-01 00:00:00");//涓氬姟璧峰鏃ユ湡
-
                     jsonObject.put("end_biztime", sdf1.format(now));//涓氬姟缁撴潫鏃ユ湡
-                    jsonObject.put("billno", Arrays.asList("CGSL-251023-000027","CGSL-250811-000028"));
-                    jsonObject.put("billstatus", Arrays.asList("C"));//鏁版嵁鐘舵�� [A:鏆傚瓨, B:宸叉彁浜�, C:宸插鏍竇
+                    jsonObject.put("billno", Arrays.asList("CGSL-251125-000003"));
+                    jsonObject.put("billstatus", Arrays.asList("A","B","C"));//鏁版嵁鐘舵�� [A:鏆傚瓨, B:宸叉彁浜�, C:宸插鏍竇
                     jsonObject.put("start_auditdate", null);//id
                     jsonObject.put("end_auditdate", null);
                     jsonObject.put("org_number", null);
@@ -198,11 +197,17 @@
                             String matnr = jsonObjectNew.get("number").toString();
                             String name = jsonObjectNew.get("name").toString();
                             String createTime = jsonObjectNew.get("createtime").toString();
-                            Double grossweight = jsonObjectNew.get("grossweight") != null ? new BigDecimal(jsonObjectNew.get("grossweight").toString()).doubleValue() : 0.0;
-                            Double height = jsonObjectNew.get("height") != null ? new BigDecimal(jsonObjectNew.get("height").toString()).doubleValue() : 0.0;
-                            Double width = jsonObjectNew.get("width") != null ? new BigDecimal(jsonObjectNew.get("width").toString()).doubleValue() : 0.0;
-                            Double length = jsonObjectNew.get("length") != null ? new BigDecimal(jsonObjectNew.get("length").toString()).doubleValue() : 0.0;
-
+                            Double grossweight = jsonObjectNew.get("grossweight") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield6").toString()).doubleValue() : 0.0;
+                            Double height = jsonObjectNew.get("height") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield9").toString()).doubleValue() : 0.0;
+                            Double width = jsonObjectNew.get("width") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield8").toString()).doubleValue() : 0.0;
+                            Double length = jsonObjectNew.get("length") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield7").toString()).doubleValue() : 0.0;
+                            Double netweight = jsonObjectNew.get("netweight") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield").toString()).doubleValue() : 0.0;
+                            // ---- 鎺掑簭閫昏緫 ----
+                            List<Double> dims = Arrays.asList(height, width, length);
+                            dims.sort(Double::compareTo); // 鍗囧簭鎺掑垪锛氭渶灏忋�佷腑闂淬�佹渶澶�
+                            Double min = dims.get(0);
+                            Double mid = dims.get(1);
+                            Double max = dims.get(2);
                             // 鐢熸垚鍟嗗搧妗f
                             Mat mat = matService.selectByMatnr(matnr);
                             if (mat == null) {
@@ -210,10 +215,11 @@
                                 mat.setMatnr(matnr);
                                 mat.setMaktx(name);
                                 mat.setTagId(tag.getId());
-                                mat.setWeight(grossweight);
-                                mat.setManLength(length);
-                                mat.setHeight(height);
-                                mat.setWidth(width);
+                                mat.setWeight(grossweight);//鍑�閲�
+                                mat.setUnits(netweight);//姣涢噸
+                                mat.setManLength(max);
+                                mat.setHeight(min);
+                                mat.setWidth(mid);
                                 mat.setCreateTime(sdf1.parse(createTime));
                                 mat.setUpdateTime(modifyTime);
                                 mat.setStatus(1);
@@ -416,7 +422,8 @@
                                                 now,    // 娣诲姞鏃堕棿
                                                 9527L,    // 淇敼浜哄憳
                                                 now,    // 淇敼鏃堕棿
-                                                null    // 澶囨敞
+                                                null,    // 澶囨敞
+                                                kingDeeUtilType.pakIn !=1?2:1
                                         );
                                         if( orderService.insert(order)){
                                             callApiLogSaveOrder(order, kingDeeUtilType, "鍒涘缓鍏ュ簱鍗曟垚鍔燂紒鍗曞彿锛�" + billNo, true);

--
Gitblit v1.9.1