From 305828f35209712b5df8247887027869987879f9 Mon Sep 17 00:00:00 2001 From: yangsb Date: Wed, 8 May 2024 15:08:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BA=E6=8E=92?= =?UTF-8?q?=E5=8D=95=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/plan/vo/PlanSaveReqVO.java | 19 +++++++++++++++++-- .../executor/dal/mysql/plate/PlateMapper.java | 3 +++ .../service/plan/PlanServiceImpl.java | 5 ++++- .../resources/mapper/plate/PlateMapper.xml | 8 ++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlanSaveReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlanSaveReqVO.java index e5ffdee4b..e5f417c78 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlanSaveReqVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlanSaveReqVO.java @@ -4,6 +4,7 @@ import com.cf.imes.framework.es.core.valid.CreateGroup; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; +import javax.validation.Valid; import javax.validation.constraints.*; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; @@ -45,8 +46,11 @@ public class PlanSaveReqVO { /*@Schema(description = "生产单id列表", requiredMode = Schema.RequiredMode.REQUIRED) private List orderIds;*/ - @Schema(description = "板件id列表") - private List plateIds; + /*@Schema(description = "板件id列表") + private List plateIds;*/ + + @Schema(description = "生产单id与商品id 列表") + private List itemList; @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") private String remark; @@ -58,4 +62,15 @@ public class PlanSaveReqVO { @Schema(description = "生产时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "生产时间不能为空", groups = CreateGroup.class) private LocalDateTime produceTime; + + @Valid + @Data + public static class Item { + @Schema(description = "生产单id") + @NotNull + private Long orderId; + @Schema(description = "商品id") + @NotNull + private Long goodsId; + } } \ 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 ce4b887e2..6ccb2ae93 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 @@ -10,6 +10,7 @@ import com.cf.imes.framework.common.pojo.PageResult; import com.cf.imes.framework.common.util.object.BeanUtils; import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX; +import com.cf.imes.module.executor.controller.admin.plan.vo.PlanSaveReqVO; import com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage; import com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam; import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList; @@ -88,4 +89,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); } \ 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 91c8c7141..b71ac5b98 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 @@ -110,7 +110,10 @@ public class PlanServiceImpl implements PlanService { } planOrderMapper.insertBatch(planOrderDOS); }*/ - List plateIds = createReqVO.getPlateIds(); + //List plateIds = createReqVO.getPlateIds(); + List itemList = createReqVO.getItemList(); + Set plateIds = plateMapper.selectBatchOrderIdsAndGoodsIds(itemList); + if (CollectionUtil.isNotEmpty(plateIds)) { ArrayList planItemDOS = new ArrayList<>(); for (Long plateId : plateIds) { 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 b92678619..c43392258 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 @@ -55,4 +55,12 @@ AND (#{bodyId} IS NULL OR b.body_id = #{bodyId}) GROUP BY a.id, c.material, c.color; + + \ No newline at end of file