diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PackRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PackRespVO.java index 74fb4b8f2..021f2b755 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PackRespVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/vo/PackRespVO.java @@ -1,6 +1,5 @@ package com.cf.imes.module.executor.controller.admin.manage.pack.vo; - import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.Setter; @@ -15,66 +14,70 @@ import java.util.List; public class PackRespVO { - @Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "7788") + @Schema(description = "订单号", example = "7788") private Long id; + @Schema(description = "订单号", example = "7788") + private Long orderId; - @Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7788") + + @Schema(description = "包裹ID", example = "7788") private Long packId; - @Schema(description = "自定义单号", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "自定义单号",example = "ABCD") private String customOrderNo; - @Schema(description = "经销商电话", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "经销商电话",example = "ABCD") private String dealerPhoneNumber; - @Schema(description = "经销商", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "经销商",example = "ABCD") private String dealer; - @Schema(description = "订单日期", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "订单日期",example = "ABCD") private LocalDateTime orderDate; - @Schema(description = "交付日期", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "交付日期",example = "ABCD") private LocalDateTime deliveryDate; - @Schema(description = "打包状态", requiredMode = Schema.RequiredMode.REQUIRED,example = "0") + @Schema(description = "打包状态",example = "0") private Integer packaged; - @Schema(description = "客户", requiredMode = Schema.RequiredMode.REQUIRED,example = "张三") + @Schema(description = "客户",example = "张三") private String customer; - @Schema(description = "客户地址", requiredMode = Schema.RequiredMode.REQUIRED,example = "AABB") + @Schema(description = "客户地址",example = "AABB") private String address; - @Schema(description = "客户电话", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "客户电话",example = "ABCD") private String phoneNumber; - @Schema(description = "业务员", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "业务员",example = "ABCD") private String salesman; - @Schema(description = "拆单员", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "拆单员",example = "ABCD") private String splitter; - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED,example = "ABCD") + @Schema(description = "备注",example = "ABCD") private String remark; - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "创建时间") private LocalDateTime createTime; - + @Schema(description = "板件数量") + private Integer plateNum; @Schema(description = "已打包数-包裹数") private Long packCount; @@ -97,9 +100,4 @@ public class PackRespVO { @Schema(description = "订单对应的包裹ID集") private List packIdList; - -// @Schema(description = "订单对应的板件信息", requiredMode = Schema.RequiredMode.REQUIRED) -// List plateDetailsRespVO; - - } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderItemTempDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderItemTempDO.java index 7afd4466e..65a1b5775 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderItemTempDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/orderItem/OrderItemTempDO.java @@ -11,7 +11,7 @@ import lombok.NoArgsConstructor; import lombok.ToString; /** - * 订单明细临时表 order_item DO + * 订单明细临时表 order_item_temp DO * * @author 晨丰科技 */ 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 f5fa7d714..c73f814e3 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 @@ -320,8 +320,6 @@ public interface PlateMapper extends BaseMapperX { .select(PlateDO::getId)); } - List selectPackPlateNum(@Param("orderIds") List orderIds, @Param("organId") Long organId); - List selectOrderNoPackPlateList(@Param("orderId") Long orderId, @Param("organId") Long organId); /** diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java index 218214358..e1e4dfe5b 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java @@ -937,60 +937,39 @@ public class PackServiceImpl implements PackService { } + /** + * 分页数据查询对应的板件总数、包裹数量、已打包板件数量 + * + * @param orderIds + * @param packRespVOS + * @return + */ + private PageResult buildPageResult(List orderIds, IPage packRespVOS) { - - // 打包分页页面显示数据查询 - private PageResult buildPageResult(List orderIds,IPage packRespVOS){ - - if(orderIds.isEmpty()){ + if (orderIds.isEmpty()) { return new PageResult<>(); } - - // 查询板材的总量 - List packRespVOList = orderPlateMapper.selectPackPlateNum(orderIds, getUserOrganId()); - - AssertUtils.notEmpty(packRespVOList, ORDER_PLATE_ERROR); - - for (PackRespVO packRespVO : packRespVOList) { - packRespVO.setTotalPieceCount((long) packRespVO.getPlateIdList().size()); - packRespVO.setPlateIdList(null); - } - - // 查询当前生产的包裹数量 - List respVOS = orderPackageMapper.selectPackPage(orderIds, getUserOrganId()); - - - for (PackRespVO packRespVO : respVOS) { - packRespVO.setPackCount((long) packRespVO.getPackIdList().size()); - packRespVO.setPackIdList(null); - } + List orderPackNumGroup = orderPackageMapper.selectPackPage(orderIds, getUserOrganId()); // 查询当前订单已经打包的板材数量 - List plateNum = orderPackageMapper.selectPackPieceCount(orderIds, getUserOrganId()); + List orderPackedPlateNumGroup = orderPackageMapper.selectPackPieceCount(orderIds, getUserOrganId()); - for (PackRespVO packRespVO : plateNum) { - packRespVO.setPackPieceCount((long) packRespVO.getPlateIdList().size()); - packRespVO.setPlateIdList(null); - } - - - for (PackRespVO vosRecords : packRespVOS.getRecords()) { + for (PackRespVO vosRecord : packRespVOS.getRecords()) { // 板材总数 - vosRecords.setTotalPieceCount(packRespVOList.stream().filter(f -> Objects.equals(f.getId(), vosRecords.getId())).mapToLong(PackRespVO::getTotalPieceCount).sum()); - // 已打包数 - vosRecords.setPackCount(respVOS.stream().filter(f -> Objects.equals(f.getId(), vosRecords.getId())).mapToLong(PackRespVO::getPackCount).sum()); + vosRecord.setTotalPieceCount(vosRecord.getPlateNum().longValue()); + // 已打包裹数 + vosRecord.setPackCount(orderPackNumGroup.stream().filter(f -> Objects.equals(f.getOrderId(), vosRecord.getId())).mapToLong(PackRespVO::getPackCount).sum()); // 已打包片数 - vosRecords.setPackPieceCount(plateNum.stream().filter(f -> Objects.equals(f.getId(), vosRecords.getId())).mapToLong(PackRespVO::getPackPieceCount).sum()); + vosRecord.setPackPieceCount(orderPackedPlateNumGroup.stream().filter(f -> Objects.equals(f.getOrderId(), vosRecord.getId())).mapToLong(PackRespVO::getPackPieceCount).sum()); // 待处理量 - vosRecords.setPendingNum(vosRecords.getTotalPieceCount() - vosRecords.getPackPieceCount()); + vosRecord.setPendingNum(vosRecord.getTotalPieceCount() - vosRecord.getPackPieceCount()); } - return new PageResult<>(packRespVOS.getRecords(), packRespVOS.getTotal()); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml index 1cff5feb7..82bcbb5b5 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml @@ -503,6 +503,7 @@ + @@ -554,7 +555,8 @@ salesman as salesman, splitter as splitter, packaged as packaged, - remark as remark + remark as remark, + plate_num as plateNum from orders diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/pack/OrderPackageMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/pack/OrderPackageMapper.xml index 876c30ad9..db1f0ecb1 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/pack/OrderPackageMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/pack/OrderPackageMapper.xml @@ -1,69 +1,46 @@ - - - - - - - - - - - - select order_id as orderId, - package_no as packId - + COUNT(*) AS packCount from order_package - where organ_id = #{organId} - - and status !=0 - + and status != 0 and deleted = false - and order_id in #{id} - + GROUP BY order_id 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 97e49ae4a..0a4925a6a 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 @@ -717,39 +717,6 @@ from order_plate where order_id = #{orderId} and organ_id = #{organId}; - - - - - - - - - - - - - - - -