From a14d1594e8bd4828c12451bb911193773f7e55c9 Mon Sep 17 00:00:00 2001 From: lym <1994302445@qq.com> Date: Sat, 22 Jun 2024 09:15:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/vo/order/OrderPlatesDetailReqVO.java | 4 ++++ .../order/vo/order/OrderPlatesDetailRespVO.java | 3 +++ .../dal/mysql/orderParts/OrderPartsMapper.java | 2 +- .../executor/dal/mysql/plate/PlateMapper.java | 2 +- .../service/order/OrderServiceImpl.java | 2 ++ .../admin/api/webcad/ApiDataAchieve.java | 17 ++++++++++------- .../admin/api/webcad/ApiTypeRealize.java | 16 +++++++++------- .../mapper/orderItem/OrderItemMapper.xml | 4 ++-- .../mapper/orderParts/OrderPartsMapper.xml | 5 ++++- .../main/resources/mapper/plate/PlateMapper.xml | 6 +++++- 10 files changed, 41 insertions(+), 20 deletions(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPlatesDetailReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPlatesDetailReqVO.java index c8eeedd9f..2a88b3ff4 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPlatesDetailReqVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPlatesDetailReqVO.java @@ -67,4 +67,8 @@ public class OrderPlatesDetailReqVO { @ExcelProperty("备注") private String remark; + @Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @ExcelProperty("颜色") + private String color; + } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPlatesDetailRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPlatesDetailRespVO.java index 26158e99e..ef37c2803 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPlatesDetailRespVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPlatesDetailRespVO.java @@ -24,6 +24,9 @@ public class OrderPlatesDetailRespVO { @Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED) private String partName; + @Schema(description = "配件单位", requiredMode = Schema.RequiredMode.REQUIRED) + private String unit; + @Schema(description = "柜体中的配件数量", requiredMode = Schema.RequiredMode.REQUIRED) private Double plateNum; } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderParts/OrderPartsMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderParts/OrderPartsMapper.java index 9366adad5..e35d47934 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderParts/OrderPartsMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderParts/OrderPartsMapper.java @@ -84,7 +84,7 @@ public interface OrderPartsMapper extends BaseMapperX { return update(wrapper); } - void updateDeletedById(@Param("bodyId") List bodyIds, @Param("deleted") Integer deleted, @Param("organId") Long organId); + void updateDeletedById(@Param("partsIds") List partsIds, @Param("deleted") Integer deleted, @Param("organId") Long organId); List selectPartList( @Param("orderIds") List orderIds,@Param("organId") Long organId); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java index 664c588ee..9b9aa733e 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java @@ -106,7 +106,7 @@ public interface PlateMapper extends BaseMapperX { return update(wrapper); } - void updateDeletedById(@Param("bodyIds") List bodyId, @Param("deleted") Integer deleted, @Param("organId") Long organId); + void updateDeletedById(@Param("plateIds") List plateIds, @Param("deleted") Integer deleted, @Param("organId") Long organId); int countPlateByOrderId(@Param("orderId") Long orderId, @Param("organId") Long organId, @Param("deleted") Integer deleted); 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 978e9e4a3..9fb2e33cd 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 @@ -325,8 +325,10 @@ public class OrderServiceImpl implements OrderService { // 先查再改 List plateDOList = plateMapper.selectPlateIdListByBodyId(bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId()); + System.out.println(" plateDOList " + plateDOList); plateMapper.updateDeletedById(plateDOList, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId()); List partsList = orderPartsMapper.selectPartsIdListByBodyId(bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId()); + System.out.println(" partsList " + partsList); orderPartsMapper.updateDeletedById(partsList, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId()); }); } 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/ApiDataAchieve.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiDataAchieve.java index cb6fdd9f0..1c67d9cf7 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiDataAchieve.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiDataAchieve.java @@ -3,6 +3,7 @@ package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.cf.imes.module.executor.enums.ErrorCodeConstants; import com.cf.imes.module.system.api.application.ApplicationApi; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Async; @@ -46,12 +47,13 @@ public class ApiDataAchieve { } // 获取板件生产数据信息 - @Async +// @Async public Future getApiPlateProData(String token, String orderNo) { JSONObject jsonPlatesData = new JSONObject(); jsonPlatesData.put("order_no", orderNo);//生产单号需要传入赋值 jsonPlatesData.put("format", "json"); JSONObject dataPlates = apiDataProduction.getApiOrderMessage(token, jsonPlatesData); + System.out.println(" dataPlates " + dataPlates); if (!dataPlates.getString("err_code").equals("0")) { throw exception(PLATE_PLAN_DATA_ERROR); } @@ -59,7 +61,7 @@ public class ApiDataAchieve { } // 获取配件信息 分页获取 - @Async +// @Async public Future getApiPartsMessage(String token, String orderNo) { JSONObject jsonParts = new JSONObject(); jsonParts.put("curr_page", 1); @@ -79,7 +81,7 @@ public class ApiDataAchieve { } // 柜体信息转换 - @Async +// @Async public Future getApiBodyMessage(String token, String orderNo) { JSONObject jsonBody = new JSONObject(); jsonBody.put("curr_page", 1); @@ -99,7 +101,7 @@ public class ApiDataAchieve { } // 商品信息转换 - @Async +// @Async public Future getApiGoodsMessage(String token, String orderNo) { JSONObject jsonGoods = new JSONObject(); jsonGoods.put("curr_page", 1); @@ -119,7 +121,7 @@ public class ApiDataAchieve { } // 板材明细信息转换 - @Async +// @Async public Future getApiPlateDetailMessage(String token, String orderNo) { JSONObject jsonPlates = new JSONObject(); jsonPlates.put("curr_page", 1); @@ -139,7 +141,7 @@ public class ApiDataAchieve { } // 加工组信息转换 - @Async +// @Async public Future getApiGroupMessage(String token, String orderNo) { JSONObject jsonModule = new JSONObject(); jsonModule.put("order_no", orderNo); @@ -156,7 +158,8 @@ public class ApiDataAchieve { jsonBlocks.put("order_no", orderNo); JSONObject blocks = apiDataProduction.getApiBlocksMessage(token, jsonBlocks); if (!blocks.getString("err_code").equals("0")) { - throw exception(PLATE_DATA_ERROR); + throw new IllegalArgumentException(String.valueOf(ErrorCodeConstants.PLATE_DATA_ERROR)); +// throw exception(PLATE_DATA_ERROR); } JSONObject block = new JSONObject(); for (int i = 1; i <= blocks.getJSONObject("value").getInteger("PageCount"); i++) { 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 13d57c962..75d36be0a 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 @@ -149,7 +149,10 @@ public class ApiTypeRealize { groupLists.forEach((k, v) -> { v.forEach(v1 -> { if (items.get(v1) != null) { - if (items.get(v1).getGroupId() != null){ // 已存在值 + + if (items.containsKey(v1) && (items.get(v1).getGroupId() == null || items.get(v1).getGroupId() == 0)) { + items.get(v1).setGroupId(orderGroupDO.get(k).getId()); + } else { // 如果groupId已存在值(即不为null),则创建一个新的OrderItemDO对象 OrderItemDO item = OrderItemDO.builder() .id((Long) identifierGenerator.nextId(null)) .orderId(items.get(v1).getOrderId()) @@ -158,14 +161,14 @@ public class ApiTypeRealize { .bodyId(items.get(v1).getBodyId()) .planId(items.get(v1).getPlanId()) .packageId(items.get(v1).getPackageId()) - .groupId(items.get(v1).getGroupId()) + .groupId(orderGroupDO.get(k).getId()) .partsId(items.get(v1).getPartsId()) .plateId(items.get(v1).getPlateId()) .num(items.get(v1).getNum()) .build(); items.put(orderGroupDO.get(k).getId(), item); //再复查 } - items.get(v1).setGroupId(orderGroupDO.get(k).getId()); + if (items.get(v1).getPlateId() != null) groupNum++; } @@ -174,7 +177,7 @@ public class ApiTypeRealize { groupNum = 0; }); - System.out.println(" item " + items); + System.err.println(" item " + items); return items; } @@ -543,7 +546,7 @@ public class ApiTypeRealize { .isSculpt(plate.getBoolean("IsModel")) .isSpecialShaped(plate.getBoolean("UnRegular")) .isCancel(false) - .remark("无") + .remark(plate.getString("RemarkJson")) .build(); // item 明细 @@ -569,8 +572,7 @@ public class ApiTypeRealize { .setDrillsRemark(plate.getString("DrillsRemark")) .setInfoRemark(plate.getString("InfoRemark")) .setRemarkJsonDei(plate.getString("RemarkJson")); - plateInfo.setRemark(plateDetail.get(plate.getLong("BlockNo")).getRemark() != null ? - plateDetail.get(plate.getLong("BlockNo")).getRemark().toString() : ""); + } if (plateMap.get(plate.getLong("BlockNo")) != null) { JSONObject jsonObject = plateMap.get(plate.getLong("BlockNo")); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml index 6e6767661..148254da4 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml @@ -6,7 +6,7 @@ - SELECT DISTINCT i.order_id, i.room_id, i.body_id, i.parts_id, p.`name` as part_name, i.num as plate_num + SELECT DISTINCT i.order_id, i.room_id, i.body_id, i.parts_id, p.`name` as part_name, i.num as plate_num, p.unit FROM `order_item` i RIGHT JOIN `order_parts` p ON i.parts_id = p.id WHERE i.order_id = #{orderId} AND i.organ_id = #{organId} AND p.deleted = #{deleted} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml index b5f60056d..f4b957088 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml @@ -68,7 +68,10 @@ UPDATE order_parts SET deleted = #{deleted} - WHERE id IN #{bodyIds} AND organ_id = #{organId} + WHERE id IN + + #{partsId} + AND organ_id = #{organId} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml index 8ba3c9019..7e98fb65c 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml @@ -270,7 +270,11 @@ UPDATE order_plate SET deleted = #{deleted} - WHERE id IN #{bodyIds} AND organ_id = #{organId} + WHERE id IN + + #{plateId} + + AND organ_id = #{organId}