From 25f19f22753337b1818fce43f4ddfbb4eb64dd56 Mon Sep 17 00:00:00 2001 From: lym <1994302445@qq.com> Date: Mon, 10 Feb 2025 16:50:49 +0800 Subject: [PATCH] =?UTF-8?q?bug=201060=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/order/OrderServiceImpl.java | 5 + .../admin/api/webcad/ApiTypeRealize.java | 63 +- .../main/resources/type/order_add_xml2.xml | 973 ++++++++++++------ 3 files changed, 685 insertions(+), 356 deletions(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java index 0066faf7c..d86d72091 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java @@ -427,6 +427,11 @@ public class OrderServiceImpl implements OrderService { if (order.getSplitter() == null || order.getSplitter().equals("")) { order.setSplitter(nickName); } + + if (order.getStatus() == 0) { + orderMapper.insert(order); + return order.getId(); + } } List goodsDO = new ArrayList<>(apiDataTypeVo.getMapGoodsDO().values()); List rawGoodsDO = new ArrayList<>(apiDataTypeVo.getMapRawGoodsDO().values()); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java index 7e6600225..4b20756f9 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java @@ -89,7 +89,7 @@ public class ApiTypeRealize { ConcurrentHashMap> results = new ConcurrentHashMap<>(); // 添加各个API调用到映射中,并指定结果字段名 - results.put("order", CompletableFuture.supplyAsync(() -> orderInfoChange(token, orderId, orderNo, organId))); +// results.put("order", CompletableFuture.supplyAsync(() -> orderInfoChange(token, orderId, orderNo, organId))); results.put("good", CompletableFuture.supplyAsync(() -> goodsInfoChange(token, orderId, orderNo, organId))); results.put("body", CompletableFuture.supplyAsync(() -> bodyInfoChange(token, orderId, orderNo, organId))); results.put("group", CompletableFuture.supplyAsync(() -> groupInfoChange(token, orderId, orderNo, organId))); @@ -98,9 +98,10 @@ public class ApiTypeRealize { results.put("plate", CompletableFuture.supplyAsync(() -> platesInfoChange(token, orderId, orderNo, organId))); // 等待所有异步任务完成 - CompletableFuture.allOf(results.values().toArray(new CompletableFuture[7])).join(); + CompletableFuture.allOf(results.values().toArray(new CompletableFuture[6])).join(); - ApiDataTypeVo order = results.get("order").get(); +// ApiDataTypeVo order = results.get("order").get(); + ApiDataTypeVo order = orderInfoChange(token, orderId, orderNo, organId); ApiDataTypeVo goodsData = results.get("good").get(); ApiDataTypeVo bodyData = results.get("body").get(); ApiDataTypeVo groupData = results.get("group").get(); @@ -108,6 +109,10 @@ public class ApiTypeRealize { ApiDataTypeVo plateDetailData = results.get("plateDetail").get(); ApiDataTypeVo platesData = results.get("plate").get(); +// 判断是不是空单 + if (order.getOrderDO().getStatus() == 0) { + return order; + } // 判断生产数据是否可以为空 if (!platesData.getMapPlatesInfos().isEmpty() && plateDetailData.getMapPlateDetails().isEmpty() ) { @@ -123,7 +128,10 @@ public class ApiTypeRealize { plateDetailData.getMapPlateDetails()); Map> mapItemList = new HashMap<>(); - mergeMaps(mapItemList, partsData.getMapItemByGroup()); + if (partsData.getMapItemByGroup() != null && partsData.getMapItemByGroup().size() > 0) { + mergeMaps(mapItemList, partsData.getMapItemByGroup()); + } +// mergeMaps(mapItemList, partsData.getMapItemByGroup()); mergeMaps(mapItemList, platesData.getMapItemByGroup()); @@ -179,7 +187,7 @@ public class ApiTypeRealize { // item中配件更换id mapItem.forEach(itemDO -> { - if (itemDO.getPartsId() != null) { + if (itemDO.getPartsId() != null && partsData.getMapPartsInfos() != null) { String goodsId = String.valueOf(itemDO.getPartsId()); OrderPartsDO newPartsDO = partsData.getMapPartsInfos().get(goodsId); if (newPartsDO != null) { @@ -203,18 +211,20 @@ public class ApiTypeRealize { Map mapPlateDetails, Map mapPlatesInfos, Map mapPlateDetailsRemarks) { +// 这里需要修改 + // 第一步判断是否存在需要进行数据添加的小板 if (mapPlatesInfos == null || mapPlatesInfos.isEmpty()) { log.error("小板信息:{}" , PLATE_DATA_ERROR); - throw exception(PLATE_DATA_ERROR); +// throw exception(PLATE_DATA_ERROR); } if (mapPlateDetails == null || mapPlateDetails.isEmpty()) { log.error("小板信息:{}" , PLATE_PRODUCE_DATA_ERROR); - throw exception(PLATE_PRODUCE_DATA_ERROR); +// throw exception(PLATE_PRODUCE_DATA_ERROR); } if (mapGoodsDO == null || mapGoodsDO.isEmpty()) { log.error("板材信息:{}" , GOODS_DATA_ERROR); - throw exception(GOODS_DATA_ERROR); +// throw exception(GOODS_DATA_ERROR); } mapPlatesInfos.forEach((k, v) -> { // 判断是否有造型数据可以进行整合 @@ -414,14 +424,19 @@ public class ApiTypeRealize { JSONArray bodyLists = bodyMessage.getJSONArray(ProduceApiConstants.LIST); - if (bodyLists == null || bodyLists.isEmpty()) { - log.error("{}房间柜体信息获取失败",orderNo); - throw exception(ORDER_BODY_NOT_EXISTS); - - } +// if (bodyLists == null || bodyLists.isEmpty()) { +// log.error("{}房间柜体信息获取失败",orderNo); +// throw exception(ORDER_BODY_NOT_EXISTS); +// +// } Map bodyInfos = new HashMap<>(); + if (bodyLists == null || bodyLists.isEmpty()) { + return new ApiDataTypeVo().setMapOrderBodyDO(bodyInfos); + + } + for (int i = 0; i < bodyLists.size(); i++) { JSONObject body = bodyLists.getJSONObject(i); OrderBodyDO bodyInfo = OrderBodyDO.builder() @@ -504,16 +519,24 @@ public class ApiTypeRealize { jsonParts.put(ProduceApiConstants.PAGE_COUNT_KEY, PARTS_PAGE_MAX); jsonParts.put(ProduceApiConstants.ORDER_NO_KEY, "N" + orderNo); - if (apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts) == null) { - return new ApiDataTypeVo(); - } - - Integer pageCount = apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts).getJSONObject(ProduceApiConstants.VALUE).getInteger(ProduceApiConstants.PAGE_COUNT); // 获取页码总数 - // 根据总页码总数进行多线程循环 Map partsInfos = new HashMap<>(); Map> partsItem = new HashMap<>(); Map remarks = new HashMap<>(); + if (apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts) == null) { + return new ApiDataTypeVo().setMapPartsInfos(partsInfos).setMapItemByGroup(partsItem).setMapPartRemarks(remarks); + } + +// if (apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts) == null) { +// return new ApiDataTypeVo(); +// } + + Integer pageCount = apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts).getJSONObject(ProduceApiConstants.VALUE).getInteger(ProduceApiConstants.PAGE_COUNT); // 获取页码总数 + // 根据总页码总数进行多线程循环 +// Map partsInfos = new HashMap<>(); +// Map> partsItem = new HashMap<>(); +// Map remarks = new HashMap<>(); + List>> futures = new ArrayList<>(); for (int i = 1; i <= pageCount; i++) { @@ -1478,7 +1501,7 @@ public class ApiTypeRealize { if (map == null || map.isEmpty()) { log.error("明细信息:{}" , CHANGE_DETAILS_ITEM_ERROR); - throw exception(CHANGE_DETAILS_ITEM_ERROR); +// throw exception(CHANGE_DETAILS_ITEM_ERROR); } // 处理第一个 Map diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/type/order_add_xml2.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/type/order_add_xml2.xml index b323ebb98..9bce6bfb7 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/type/order_add_xml2.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/type/order_add_xml2.xml @@ -1,5 +1,5 @@  - + @@ -11,7 +11,10 @@ - + + + + @@ -20,7 +23,7 @@ - + @@ -53,14 +56,23 @@ - - - - - - - - + + + + + + + + + + + + + + + + + @@ -73,12 +85,12 @@ - + - - - - + + + + @@ -100,37 +112,60 @@ - + + + + + + + + + + + - - - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + - + - - - - + + + + @@ -152,37 +187,60 @@ - + + + + + + + + + + + - - - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + - + - - - - + + + + @@ -224,15 +282,15 @@ - + - + - - - - + + + + @@ -251,34 +309,51 @@ - + + + + + + + + + + + + + + + + + + - - - + - + + + - - - - + + + + - + - - - - + + + + @@ -299,7 +374,21 @@ - + + + + + + + + + + + + + + + @@ -310,18 +399,18 @@ - + - + - - - - + + + + @@ -342,7 +431,21 @@ - + + + + + + + + + + + + + + + @@ -353,18 +456,18 @@ - + - + - - - - + + + + @@ -385,7 +488,21 @@ - + + + + + + + + + + + + + + + @@ -396,18 +513,18 @@ - + - + - - - - + + + + @@ -428,7 +545,21 @@ - + + + + + + + + + + + + + + + @@ -439,18 +570,18 @@ - + - + - - - - + + + + @@ -461,64 +592,85 @@ - - + + + + + + + + - - + + + + + + + + - - - - - - + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - + - + - - - - + + + + @@ -548,15 +700,15 @@ - + - + - - - - + + + + @@ -586,15 +738,15 @@ - + - + - - - - + + + + @@ -624,15 +776,15 @@ - + - + - - - - + + + + @@ -659,7 +811,13 @@ - + + + + + + + @@ -668,15 +826,15 @@ - + - + - - - - + + + + @@ -703,7 +861,13 @@ - + + + + + + + @@ -712,15 +876,15 @@ - + - + - - - - + + + + @@ -749,14 +913,28 @@ - + + + + + + + - + + + + + + + + + @@ -765,15 +943,15 @@ - + - + - - - - + + + + @@ -802,14 +980,28 @@ - + + + + + + + - + + + + + + + + + @@ -818,15 +1010,15 @@ - + - + - - - - + + + + @@ -843,18 +1035,18 @@ - + - + - - - - - - - + + + + + + + @@ -894,18 +1086,18 @@ - + - + - - - - - - - + + + + + + + @@ -945,15 +1137,15 @@ - + - + - - - - + + + + @@ -983,15 +1175,15 @@ - + - + - - - - + + + + @@ -1029,15 +1221,15 @@ - + - + - - - - + + + + @@ -1058,7 +1250,13 @@ - + + + + + + + @@ -1067,15 +1265,15 @@ - + - + - - - - + + + + @@ -1096,7 +1294,13 @@ - + + + + + + + @@ -1105,15 +1309,15 @@ - + - + - - - - + + + + @@ -1138,7 +1342,13 @@ - + + + + + + + @@ -1147,15 +1357,15 @@ - + - + - - - - + + + + @@ -1180,7 +1390,13 @@ - + + + + + + + @@ -1189,15 +1405,15 @@ - + - + - - - - + + + + @@ -1213,28 +1429,47 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - - - - + + + + @@ -1255,7 +1490,13 @@ - + + + + + + + @@ -1264,15 +1505,15 @@ - + - + - - - - + + + + @@ -1293,7 +1534,13 @@ - + + + + + + + @@ -1302,15 +1549,15 @@ - + - + - - - - + + + + @@ -1335,7 +1582,13 @@ - + + + + + + + @@ -1344,15 +1597,15 @@ - + - + - - - - + + + + @@ -1377,7 +1630,13 @@ - + + + + + + + @@ -1386,15 +1645,15 @@ - + - + - - - - + + + + @@ -1410,32 +1669,51 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - - - - + + + + @@ -1452,15 +1730,15 @@ - + - + - - - - + + + + @@ -1477,15 +1755,15 @@ - + - + - - - - + + + + @@ -1502,19 +1780,19 @@ - + - + - - - - + + + + @@ -1528,17 +1806,40 @@ - + + + + + + + + + + + + + + + + + + - - - + - + + + - + + + + + + + @@ -1556,10 +1857,10 @@ - - - - + + + + @@ -1584,28 +1885,28 @@ - + - + - + - + - + - + - + - +