diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java index 10d7b8f4b..3714ab615 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java @@ -1,5 +1,8 @@ package com.cf.imes.module.executor.controller.admin.plan; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPageReqVO; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO; +import com.cf.imes.module.executor.dal.dataobject.order.OrderDO; import com.cf.imes.module.executor.service.order.OrderInputProcessor; import com.cf.imes.module.executor.util.RandomUtils; import com.cf.imes.module.executor.util.deviseData.Detail; @@ -85,12 +88,18 @@ public class PlanController { @GetMapping("getPlateByPlanId") @Operation(summary = "根据排单id获取板材列表") - @Parameter(name = "id", description = "排单id", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('executor:plan:query')") public CommonResult> getPlateByPlanId(@Valid GetPlateByPlanIdVO vo) { return success(planService.getPlateByPlanId(vo)); } + @GetMapping("getOrderByPlan") + @Operation(summary = "根据排单获取生产单分页") + @PreAuthorize("@ss.hasPermission('executor:plan:query')") + public CommonResult> getOrderByPlanId(@Valid PlanOrderPageReqVO pageReqVO) { + return success(planService.getOrderByPlanId(pageReqVO)); + } + @GetMapping("/page") @Operation(summary = "获得排单分页") @PreAuthorize("@ss.hasPermission('executor:plan:query')") diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlanOrderPageReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlanOrderPageReqVO.java new file mode 100644 index 000000000..83c67fad6 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlanOrderPageReqVO.java @@ -0,0 +1,66 @@ +package com.cf.imes.module.executor.controller.admin.plan.vo; + +import com.cf.imes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; +import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * @author Beal + */ +@Data +public class PlanOrderPageReqVO extends PageParam { + + @Schema(description = "排单id") + @NotNull(message = "排单id不能空") + private Long planId; + + /*@Schema(description = "交付日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] deliveryDate; + + @Schema(description = "生产单类型,1主单 2子单", example = "1") + private Boolean type; + + @Schema(description = "生产单排序号") + private Integer sort; + + @Schema(description = "CAD数据类型,1CAD 2WebCAD 3Excel", example = "1") + private Integer dataType; + + @Schema(description = "订单状态,0未排单1已排单2生产中3加工完成4打包完成5入库完成6出库完成", example = "1") + private Integer status; + + @Schema(description = "自定义单号") + private String customOrderNo; + + @Schema(description = "客户") + private String customer; + + @Schema(description = "客户地址") + private String address; + + @Schema(description = "客户电话") + private String phoneNumber; + + @Schema(description = "经销商") + private String dealer; + + @Schema(description = "经销商电话") + private String dealerPhoneNumber; + + @Schema(description = "业务员") + private String salesman; + + @Schema(description = "拆单员") + private String splitter; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime;*/ + +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanService.java index 3725bd9bc..eb6089ce7 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanService.java @@ -2,8 +2,11 @@ package com.cf.imes.module.executor.service.plan; import java.util.*; import javax.validation.*; + +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO; import com.cf.imes.module.executor.controller.admin.plan.vo.*; import com.cf.imes.framework.common.pojo.PageResult; +import com.cf.imes.module.executor.dal.dataobject.order.OrderDO; /** * 生产单开料排单 Service 接口 @@ -59,4 +62,6 @@ public interface PlanService { Boolean cancellation(Long id); List getPlateByPlanId(GetPlateByPlanIdVO vo); + + PageResult getOrderByPlanId(PlanOrderPageReqVO pageReqVO); } \ 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/plan/PlanServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java index 8500a5376..11daeb1ba 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX; import com.cf.imes.framework.mybatis.core.query.QueryWrapperX; +import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO; import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO; import com.cf.imes.module.executor.dal.dataobject.order.OrderDO; import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO; @@ -338,7 +339,7 @@ public class PlanServiceImpl implements PlanService { List list = plateMapper.selectPlateByPlanId(queryWrapperX); Set bodyIds = list.stream().map(PlateResList::getBodyId).collect(Collectors.toSet()); Set roomIds = list.stream().map(PlateResList::getRoomId).collect(Collectors.toSet()); - if(CollectionUtil.isNotEmpty(bodyIds)) { + if (CollectionUtil.isNotEmpty(bodyIds)) { List orderBodyDOS = orderBodyMapper.selectBatchIds(bodyIds); for (PlateResList resList : list) { resList.setBodyName(orderBodyDOS.stream().filter(e -> Objects.equals(e.getId(), resList.getBodyId())).map(OrderBodyDO::getName).findAny().orElse(null)); @@ -356,4 +357,15 @@ public class PlanServiceImpl implements PlanService { return list; } + @Override + public PageResult getOrderByPlanId(PlanOrderPageReqVO pageReqVO) { + MPJLambdaWrapperX lambdaWrapperX = new MPJLambdaWrapperX<>(); + lambdaWrapperX.leftJoin(OrderItemDO.class, OrderItemDO::getOrderId, OrderDO::getId) + .leftJoin(PlanItemDO.class, PlanItemDO::getItemId, OrderItemDO::getId) + .eq(PlanItemDO::getPlanId, pageReqVO.getPlanId()); + + PageResult pageResult = orderMapper.selectJoinPage(pageReqVO, OrderDO.class, lambdaWrapperX); + return BeanUtils.toBean(pageResult, OrderRespVO.class); + } + } \ No newline at end of file