From e4859249d3279f550c739e51353c3721e44412bc Mon Sep 17 00:00:00 2001 From: liuzhaotian Date: Wed, 15 May 2024 16:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=8D=95=E6=9D=BF=E4=BB=B6-?= =?UTF-8?q?=E8=8E=B7=E5=BE=97=E7=94=9F=E4=BA=A7=E5=8D=95=E6=9D=BF=E4=BB=B6?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/plate/PlateController.java | 9 +-- .../admin/plate/vo/PlateDetailReqVO.java | 27 +++++++++ .../admin/plate/vo/PlateDetailRespVO.java | 26 +++++++++ .../admin/plate/vo/PlateRespVO.java | 46 +++++++++++++++ .../dal/mysql/orderItem/OrderItemMapper.java | 4 ++ .../executor/dal/mysql/plate/PlateMapper.java | 2 + .../service/order/OrderInputProcessor.java | 2 - .../executor/service/plate/PlateService.java | 4 +- .../service/plate/PlateServiceImpl.java | 43 +++++++++++++- .../mapper/orderItem/OrderItemMapper.xml | 57 +++++++++++++++++++ .../resources/mapper/plate/PlateMapper.xml | 27 +++++++++ 11 files changed, 237 insertions(+), 10 deletions(-) create mode 100644 cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateDetailReqVO.java create mode 100644 cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateDetailRespVO.java diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/PlateController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/PlateController.java index 8e4bfb876..497fd2a5d 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/PlateController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/PlateController.java @@ -66,11 +66,12 @@ public class PlateController { @GetMapping("/get") @Operation(summary = "获得生产单板件") - @Parameter(name = "id", description = "板件ID", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('executor:plate:query')") - public CommonResult getPlate(@RequestParam("id") Long id) { - PlateDO plate = plateService.getPlate(id); - return success(BeanUtils.toBean(plate, PlateRespVO.class)); + public CommonResult> getPlate(@Valid PlateDetailReqVO reqVO) { + + List plate = plateService.getPlate(reqVO); + + return success(plate); } @GetMapping("/page") diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateDetailReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateDetailReqVO.java new file mode 100644 index 000000000..133f7cd85 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateDetailReqVO.java @@ -0,0 +1,27 @@ +package com.cf.imes.module.executor.controller.admin.plate.vo; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + + +@Schema(description = "管理后台 - 查询生产单板件对应详细信息") +@Data +public class PlateDetailReqVO { + + + @Schema(description = "板件 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14195") + private Long plateId; + + @Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11087") + private Long orderId; + + @Schema(description = "柜体ID", example = "11087") + private Long bodyId; + + + + + +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateDetailRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateDetailRespVO.java new file mode 100644 index 000000000..00f13ec09 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateDetailRespVO.java @@ -0,0 +1,26 @@ +package com.cf.imes.module.executor.controller.admin.plate.vo; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 生产单的大板-余料板等信息") +@Data +public class PlateDetailRespVO { + + + @Schema(description = "大板数量") + private Long bigPlateNum; + + + @Schema(description = "余料板数量") + private Long remainPlateNum; + + @Schema(description = "排单状态") + private Long planStatus; + + @Schema(description = "用户ID") + private Long companyId; + + +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateRespVO.java index d06656e01..ccabf8e1b 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateRespVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plate/vo/PlateRespVO.java @@ -174,6 +174,52 @@ public class PlateRespVO { @Schema(description = "板材材质") private String material; + + + @Schema(description = "柜体名称") + private String bodyName; + + @Schema(description = "房间名称") + private String roomName; + + + @Schema(description = "生产单明细ID") + private Long itemId; + + @Schema(description = "加工组ID") + private Long processGroupId; + + + @Schema(description = "大板数量") + private Long bigPlateNum; + + @Schema(description = "余料板数量") + private Long remainPlateNum; + + + @Schema(description = "品牌") + private String brand; + + @Schema(description = "用户ID") + private Long companyId; + + @Schema(description = "有纹路") + private String hasTexture; + + @Schema(description = "大板长度") + private BigDecimal bigPlateLength; + + @Schema(description = "大板宽度") + private BigDecimal bigPlateWidth; + + @Schema(description = "规格") + private String spec; + + @Schema(description = "排单状态") + private Long planStatus; + + + @Schema(description = "小板详情列表") private List plateDetailList; diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderItem/OrderItemMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderItem/OrderItemMapper.java index 38a638bc5..2be3b749a 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderItem/OrderItemMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderItem/OrderItemMapper.java @@ -5,6 +5,7 @@ import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderModuleRespVO; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlatesDetailRespVO; import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO; +import com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailReqVO; import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO; import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO; import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO; @@ -27,4 +28,7 @@ public interface OrderItemMapper extends BaseMapperX { List selectPartsByOrderId(@Param("orderId") Long orderId); + + + List selectPlateList(PlateDetailReqVO reqVO); } \ No newline at end of file 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 a7ae96153..dd3ba9b7d 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 @@ -92,4 +92,6 @@ public interface PlateMapper extends BaseMapperX { IPage selectProductList(@Param("page") IPage page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId); Set selectBatchOrderIdsAndGoodsIds(@Param("itemList") List itemList); + + PlateDetailRespVO selectPlateNumList(PlateDetailReqVO reqVO); } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderInputProcessor.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderInputProcessor.java index f4c12da79..e25c5a509 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderInputProcessor.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderInputProcessor.java @@ -386,6 +386,4 @@ public class OrderInputProcessor { } } - - } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateService.java index c1ce4231d..403414730 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateService.java @@ -41,10 +41,10 @@ public interface PlateService { /** * 获得生产单板件 * - * @param id 编号 + * @param * @return 生产单板件 */ - PlateDO getPlate(Long id); + List getPlate(PlateDetailReqVO reqVO); /** * 获得生产单板件分页 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java index 56f4bdb63..898feac0d 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java @@ -1,5 +1,6 @@ package com.cf.imes.module.executor.service.plate; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import co.elastic.clients.elasticsearch.ElasticsearchClient; @@ -15,6 +16,8 @@ import com.cf.imes.framework.common.exception.ServiceException; import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil; import com.cf.imes.framework.es.core.service.ESDocumentService; import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.cf.imes.framework.security.core.LoginUser; +import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils; import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO; import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO; import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO; @@ -103,8 +106,36 @@ public class PlateServiceImpl implements PlateService { } @Override - public PlateDO getPlate(Long id) { - return plateMapper.selectById(id); + public List getPlate(PlateDetailReqVO reqVO) { + + // 获取到当前登录用户的信息 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + + // 查询生产单下的大板。余料板,排单状态的信息 + PlateDetailRespVO plateDetailRespVO = plateMapper.selectPlateNumList(reqVO); + plateDetailRespVO.setCompanyId(loginUser.getId()); + +// PlateRespVO plateRespVO = BeanUtil.toBean(plateDetailRespVO, PlateRespVO.class); + + // 查询生产单下的板材详细信息 + List plateRespVOS = orderItemMapper.selectPlateList(reqVO); + +// List plateRespVOS2 = plateRespVOS +// .stream() +// .map(item -> BeanUtil.toBean(plateDetailRespVO, PlateRespVO.class)) +// .collect(Collectors.toList()); + + // 将大板等信息循环插入 + for (PlateRespVO respVO : plateRespVOS) { + respVO.setCompanyId(plateDetailRespVO.getCompanyId()); + respVO.setPlanStatus(plateDetailRespVO.getPlanStatus()); + respVO.setBigPlateNum(plateDetailRespVO.getBigPlateNum()); + respVO.setRemainPlateNum(plateDetailRespVO.getRemainPlateNum()); + } + + return plateRespVOS; + + } @Override @@ -198,6 +229,14 @@ public class PlateServiceImpl implements PlateService { private List buildRespByPlateIds(Collection plateIds, String index) { + // + + +// // 使用Stream API将 Collection 转换成 Collection +// Collection stringPlateIds = plateIds.stream() +// .map(String::valueOf) // 将Long类型的元素转换成String类型 +// .collect(Collectors.toList()); // 收集到一个新的List中 + List fieldValues = plateIds.stream().map(FieldValue::of).toList(); SearchRequest.Builder builder = new SearchRequest.Builder(); builder.index(index); 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 9acaaefc7..335d88dba 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 @@ -42,4 +42,61 @@ RIGHT JOIN `order_parts` p ON i.parts_id = p.id WHERE i.order_id = #{orderId} + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 d2e13922e..2402a5083 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 @@ -84,4 +84,31 @@ (#{item.orderId},#{item.goodsId}) + + + + + + + + + + + + + + \ No newline at end of file