diff --git a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalPlanStatusEnum.java b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalPlanStatusEnum.java index c4cb84a85..bbdad97e9 100644 --- a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalPlanStatusEnum.java +++ b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalPlanStatusEnum.java @@ -15,7 +15,17 @@ import java.util.Arrays; @AllArgsConstructor public enum MesCalPlanStatusEnum implements ArrayValuable { + /** + * 草稿 + * + * 对应 MesCalPlanService#createPlan 方法 + */ PREPARE(0, "草稿"), + /** + * 已确认 + * + * 对应 MesCalPlanService#confirmPlan 方法 + */ CONFIRMED(1, "已确认"); public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesCalPlanStatusEnum::getStatus).toArray(Integer[]::new); diff --git a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalShiftTypeEnum.java b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalShiftTypeEnum.java index f801e1006..940cbc888 100644 --- a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalShiftTypeEnum.java +++ b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalShiftTypeEnum.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.mes.enums.cal; +import cn.hutool.core.collection.ListUtil; import cn.hutool.core.lang.Pair; import cn.iocoder.yudao.framework.common.core.ArrayValuable; import lombok.AllArgsConstructor; @@ -17,14 +18,14 @@ import java.util.List; @AllArgsConstructor public enum MesCalShiftTypeEnum implements ArrayValuable { - SINGLE(1, "单白班", List.of( + SINGLE(1, "单白班", ListUtil.of( Pair.of("白班", new String[]{"08:00", "17:00"}) )), - TWO(2, "两班倒", List.of( + TWO(2, "两班倒", ListUtil.of( Pair.of("白班", new String[]{"08:00", "20:00"}), Pair.of("夜班", new String[]{"20:00", "08:00"}) )), - THREE(3, "三班倒", List.of( + THREE(3, "三班倒", ListUtil.of( Pair.of("白班", new String[]{"08:00", "16:00"}), Pair.of("中班", new String[]{"16:00", "00:00"}), Pair.of("夜班", new String[]{"00:00", "08:00"}) diff --git a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvCheckPlanStatusEnum.java b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvCheckPlanStatusEnum.java index c37852082..0c7fa48bc 100644 --- a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvCheckPlanStatusEnum.java +++ b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvCheckPlanStatusEnum.java @@ -15,7 +15,17 @@ import java.util.Arrays; @AllArgsConstructor public enum MesDvCheckPlanStatusEnum implements ArrayValuable { + /** + * 草稿 + * + * 对应 MesDvCheckPlanService#createCheckPlan 方法 + */ PREPARE(0, "草稿"), + /** + * 已启用 + * + * 对应 MesDvCheckPlanService#enableCheckPlan 方法 + */ ENABLED(1, "已启用"); public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvCheckPlanStatusEnum::getStatus).toArray(Integer[]::new); diff --git a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvCheckRecordStatusEnum.java b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvCheckRecordStatusEnum.java index ce675a16a..df93cfbb2 100644 --- a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvCheckRecordStatusEnum.java +++ b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvCheckRecordStatusEnum.java @@ -15,7 +15,17 @@ import java.util.Arrays; @AllArgsConstructor public enum MesDvCheckRecordStatusEnum implements ArrayValuable { + /** + * 草稿 + * + * 对应 MesDvCheckRecordService#createCheckRecord 方法 + */ DRAFT(10, "草稿"), + /** + * 已完成 + * + * 对应 MesDvCheckRecordService#submitCheckRecord 方法 + */ FINISHED(20, "已完成"); public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvCheckRecordStatusEnum::getStatus).toArray(Integer[]::new); diff --git a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvMaintenRecordStatusEnum.java b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvMaintenRecordStatusEnum.java index 4ebf320f0..dd755ecec 100644 --- a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvMaintenRecordStatusEnum.java +++ b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvMaintenRecordStatusEnum.java @@ -15,7 +15,17 @@ import java.util.Arrays; @AllArgsConstructor public enum MesDvMaintenRecordStatusEnum implements ArrayValuable { + /** + * 草稿 + * + * 对应 MesDvMaintenRecordService#createMaintenRecord 方法 + */ PREPARE(1, "草稿"), + /** + * 已提交 + * + * 对应 MesDvMaintenRecordService#submitMaintenRecord 方法 + */ SUBMITTED(2, "已提交"); public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvMaintenRecordStatusEnum::getStatus) diff --git a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProAndonStatusEnum.java b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProAndonStatusEnum.java index 3a7f75922..5f79b2a9a 100644 --- a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProAndonStatusEnum.java +++ b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProAndonStatusEnum.java @@ -15,7 +15,17 @@ import java.util.Arrays; @AllArgsConstructor public enum MesProAndonStatusEnum implements ArrayValuable { + /** + * 未处置 + * + * 对应 MesProAndonRecordService#createAndonRecord 方法 + */ ACTIVE(0, "未处置"), + /** + * 已处置 + * + * 对应 MesProAndonRecordService#updateAndonRecord 方法 + */ HANDLED(1, "已处置"); public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProAndonStatusEnum::getStatus).toArray(Integer[]::new); diff --git a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProWorkOrderStatusEnum.java b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProWorkOrderStatusEnum.java index 1bd2ffa59..d1e82629f 100644 --- a/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProWorkOrderStatusEnum.java +++ b/yudao-module-mes/yudao-module-mes-api/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProWorkOrderStatusEnum.java @@ -15,9 +15,29 @@ import java.util.Arrays; @AllArgsConstructor public enum MesProWorkOrderStatusEnum implements ArrayValuable { + /** + * 草稿 + * + * 对应 MesProWorkOrderService#createWorkOrder 方法 + */ PREPARE(0, "草稿"), + /** + * 已确认 + * + * 对应 MesProWorkOrderService#confirmWorkOrder 方法 + */ CONFIRMED(1, "已确认"), + /** + * 已完成 + * + * 对应 MesProWorkOrderService#finishWorkOrder 方法 + */ FINISHED(2, "已完成"), + /** + * 已取消 + * + * 对应 MesProWorkOrderService#cancelWorkOrder 方法 + */ CANCELED(3, "已取消"); public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProWorkOrderStatusEnum::getStatus).toArray(Integer[]::new); diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/andon/MesProAndonConfigController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/andon/MesProAndonConfigController.java index 651838050..e4d9df317 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/andon/MesProAndonConfigController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/andon/MesProAndonConfigController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.andon; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; @@ -73,7 +74,7 @@ public class MesProAndonConfigController { if (config == null) { return success(null); } - return success(buildConfigRespVOList(List.of(config)).get(0)); + return success(buildConfigRespVOList(ListUtil.of(config)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/andon/MesProAndonRecordController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/andon/MesProAndonRecordController.java index 314ca40ec..a8ea391bd 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/andon/MesProAndonRecordController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/andon/MesProAndonRecordController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.andon; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; @@ -95,7 +96,7 @@ public class MesProAndonRecordController { if (record == null) { return success(null); } - return success(buildRecordRespVOList(List.of(record)).get(0)); + return success(buildRecordRespVOList(ListUtil.of(record)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/card/MesProCardController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/card/MesProCardController.java index 9481d82bd..1fe17f526 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/card/MesProCardController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/card/MesProCardController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.card; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; @@ -116,7 +117,7 @@ public class MesProCardController { if (card == null) { return success(null); } - return success(buildCardRespVOList(List.of(card)).get(0)); + return success(buildCardRespVOList(ListUtil.of(card)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/card/MesProCardProcessController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/card/MesProCardProcessController.java index 171e36d8b..458fa6aff 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/card/MesProCardProcessController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/card/MesProCardProcessController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.card; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; @@ -82,7 +83,7 @@ public class MesProCardProcessController { if (cardProcess == null) { return success(null); } - return success(buildCardProcessRespVOList(List.of(cardProcess)).get(0)); + return success(buildCardProcessRespVOList(ListUtil.of(cardProcess)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/feedback/MesProFeedbackController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/feedback/MesProFeedbackController.java index 99dde54ae..f601f05c9 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/feedback/MesProFeedbackController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/feedback/MesProFeedbackController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.feedback; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; @@ -111,7 +112,7 @@ public class MesProFeedbackController { if (feedback == null) { return success(null); } - return success(buildFeedbackRespVOList(List.of(feedback)).get(0)); + return success(buildFeedbackRespVOList(ListUtil.of(feedback)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProcessController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProcessController.java index d09cad682..ca2d03ec5 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProcessController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProcessController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.route; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; @@ -129,7 +130,7 @@ public class MesProRouteProcessController { if (routeProcess == null) { return null; } - return buildRouteProcessRespVOList(List.of(routeProcess)).get(0); + return buildRouteProcessRespVOList(ListUtil.of(routeProcess)).get(0); } } diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProductBomController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProductBomController.java index 6fc55bc2f..3c67bb453 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProductBomController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProductBomController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.route; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; @@ -120,7 +121,7 @@ public class MesProRouteProductBomController { if (routeProductBom == null) { return null; } - return buildRouteProductBomRespVOList(List.of(routeProductBom)).get(0); + return buildRouteProductBomRespVOList(ListUtil.of(routeProductBom)).get(0); } } diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProductController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProductController.java index 59a5e24c3..8aff7c2c8 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProductController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/route/MesProRouteProductController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.route; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; @@ -112,7 +113,7 @@ public class MesProRouteProductController { if (routeProduct == null) { return null; } - return buildRouteProductRespVOList(List.of(routeProduct)).get(0); + return buildRouteProductRespVOList(ListUtil.of(routeProduct)).get(0); } } diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskController.java index 08ded4df2..e43f327a7 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.task; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.hutool.core.util.ObjUtil; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import cn.iocoder.yudao.framework.common.pojo.CommonResult; @@ -110,7 +111,7 @@ public class MesProTaskController { if (task == null) { return success(null); } - return success(buildTaskRespVOList(List.of(task)).get(0)); + return success(buildTaskRespVOList(ListUtil.of(task)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskIssueController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskIssueController.java index f0f30d9ed..00fa9b52f 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskIssueController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskIssueController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.task; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; @@ -79,7 +80,7 @@ public class MesProTaskIssueController { if (taskIssue == null) { return success(null); } - return success(buildIssueRespVOList(List.of(taskIssue)).get(0)); + return success(buildIssueRespVOList(ListUtil.of(taskIssue)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkOrderBomController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkOrderBomController.java index 464d54d98..c28878c87 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkOrderBomController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkOrderBomController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.workorder; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; @@ -88,7 +89,7 @@ public class MesProWorkOrderBomController { if (workOrderBom == null) { return success(null); } - return success(buildWorkOrderBomRespVOList(List.of(workOrderBom)).get(0)); + return success(buildWorkOrderBomRespVOList(ListUtil.of(workOrderBom)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkOrderController.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkOrderController.java index 7d7b6782a..f13810b4a 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkOrderController.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkOrderController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.pro.workorder; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; @@ -92,7 +93,7 @@ public class MesProWorkOrderController { if (workOrder == null) { return success(null); } - return success(buildWorkOrderRespVOList(List.of(workOrder)).get(0)); + return success(buildWorkOrderRespVOList(ListUtil.of(workOrder)).get(0)); } @GetMapping("/page") diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/dv/checkplan/MesDvCheckPlanMachineryServiceImpl.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/dv/checkplan/MesDvCheckPlanMachineryServiceImpl.java index 73839b709..ca112e104 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/dv/checkplan/MesDvCheckPlanMachineryServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/dv/checkplan/MesDvCheckPlanMachineryServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import java.util.List; +import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; @@ -49,7 +50,7 @@ public class MesDvCheckPlanMachineryServiceImpl implements MesDvCheckPlanMachine // 1.4 跨方案类型唯一性校验(设备不能存在于同类型多个方案中) List existingMachineryList = getCheckPlanMachineryListByMachineryId(createReqVO.getMachineryId()); if (CollUtil.isNotEmpty(existingMachineryList)) { - List existingPlanIds = existingMachineryList.stream().map(MesDvCheckPlanMachineryDO::getPlanId).toList(); + List existingPlanIds = existingMachineryList.stream().map(MesDvCheckPlanMachineryDO::getPlanId).collect(Collectors.toList()); List existingPlans = checkPlanService.getCheckPlanList(existingPlanIds); for (MesDvCheckPlanDO existPlan : existingPlans) { // 如果存在不同于当前方案、但类型一致的计划方案,则拦截(一机多计划,但不允许同一机多同类型计划) diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/tm/tool/MesTmToolServiceImpl.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/tm/tool/MesTmToolServiceImpl.java index fe707fdf1..c3bf911db 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/tm/tool/MesTmToolServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/tm/tool/MesTmToolServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.mes.service.tm.tool; +import java.util.Collections; import cn.hutool.core.util.ObjUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; @@ -127,9 +128,9 @@ public class MesTmToolServiceImpl implements MesTmToolService { @Override public List getToolList(Collection ids) { if (ids == null || ids.isEmpty()) { - return List.of(); + return Collections.emptyList(); } - return toolMapper.selectBatchIds(ids); + return toolMapper.selectByIds(ids); } } diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/itemconsume/MesWmItemConsumeServiceImpl.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/itemconsume/MesWmItemConsumeServiceImpl.java index 1fc98f087..fc07815c7 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/itemconsume/MesWmItemConsumeServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/itemconsume/MesWmItemConsumeServiceImpl.java @@ -31,6 +31,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; @@ -125,7 +126,7 @@ public class MesWmItemConsumeServiceImpl implements MesWmItemConsumeService { MesWmMaterialStockListReqVO stockQuery = new MesWmMaterialStockListReqVO().setItemId(line.getItemId()) .setWarehouseId(warehouse.getId()).setLocationId(location.getId()).setAreaId(area.getId()); List stocks = materialStockService.getMaterialStockList(stockQuery) - .stream().filter(s -> s.getQuantity().compareTo(BigDecimal.ZERO) > 0).toList(); + .stream().filter(s -> s.getQuantity().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList()); if (CollUtil.isEmpty(stocks)) { // 线边库无该物料库存 → 生成不带批次的明细 diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/outsourceissue/MesWmOutsourceIssueServiceImpl.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/outsourceissue/MesWmOutsourceIssueServiceImpl.java index 3193f3cb2..5b53c2b50 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/outsourceissue/MesWmOutsourceIssueServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/outsourceissue/MesWmOutsourceIssueServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.service.wm.outsourceissue; import cn.hutool.core.collection.CollUtil; + import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.ObjUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -30,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import java.math.BigDecimal; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -146,7 +148,7 @@ public class MesWmOutsourceIssueServiceImpl implements MesWmOutsourceIssueServic allDetails, MesWmOutsourceIssueDetailDO::getLineId); // 检查每行的明细数量 for (MesWmOutsourceIssueLineDO line : lines) { - List details = detailMap.getOrDefault(line.getId(), List.of()); + List details = detailMap.getOrDefault(line.getId(), Collections.emptyList()); BigDecimal totalDetailQuantity = CollectionUtils.getSumValue(details, MesWmOutsourceIssueDetailDO::getQuantity, BigDecimal::add, BigDecimal.ZERO); // 对比行数量与明细总数量,不满足直接抛出 @@ -219,7 +221,7 @@ public class MesWmOutsourceIssueServiceImpl implements MesWmOutsourceIssueServic allDetails, MesWmOutsourceIssueDetailDO::getLineId); // 检查每行的明细数量 for (MesWmOutsourceIssueLineDO line : lines) { - List details = detailMap.getOrDefault(line.getId(), List.of()); + List details = detailMap.getOrDefault(line.getId(), Collections.emptyList()); BigDecimal totalDetailQuantity = CollectionUtils.getSumValue(details, MesWmOutsourceIssueDetailDO::getQuantity, BigDecimal::add, BigDecimal.ZERO); // 对比行数量与明细总数量 diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/outsourcereceipt/MesWmOutsourceReceiptServiceImpl.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/outsourcereceipt/MesWmOutsourceReceiptServiceImpl.java index 88270fbb5..c67b0d885 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/outsourcereceipt/MesWmOutsourceReceiptServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/outsourcereceipt/MesWmOutsourceReceiptServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.service.wm.outsourcereceipt; import cn.hutool.core.collection.CollUtil; + import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -30,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import java.math.BigDecimal; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -165,7 +167,7 @@ public class MesWmOutsourceReceiptServiceImpl implements MesWmOutsourceReceiptSe allDetails, MesWmOutsourceReceiptDetailDO::getLineId); // 检查每行的明细数量 for (MesWmOutsourceReceiptLineDO line : lines) { - List details = detailMap.getOrDefault(line.getId(), List.of()); + List details = detailMap.getOrDefault(line.getId(), Collections.emptyList()); BigDecimal totalDetailQuantity = CollectionUtils.getSumValue(details, MesWmOutsourceReceiptDetailDO::getQuantity, BigDecimal::add, BigDecimal.ZERO); // 对比行数量与明细总数量,不满足直接抛出 diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueServiceImpl.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueServiceImpl.java index 361ee803e..17b197085 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.service.wm.returnissue; import cn.hutool.core.collection.CollUtil; + import cn.hutool.core.util.ObjUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; @@ -34,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import java.math.BigDecimal; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -161,7 +163,7 @@ public class MesWmReturnIssueServiceImpl implements MesWmReturnIssueService { allDetails, MesWmReturnIssueDetailDO::getLineId); // 检查每行的明细数量 for (MesWmReturnIssueLineDO line : lines) { - List details = detailMap.getOrDefault(line.getId(), List.of()); + List details = detailMap.getOrDefault(line.getId(), Collections.emptyList()); BigDecimal totalDetailQuantity = CollectionUtils.getSumValue(details, MesWmReturnIssueDetailDO::getQuantity, BigDecimal::add, BigDecimal.ZERO); // 对比行数量与明细总数量,不满足直接抛出 diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java index 2347dfda6..62c983196 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.service.wm.returnsales; import cn.hutool.core.collection.CollUtil; + import cn.hutool.core.util.ObjUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; @@ -27,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import java.math.BigDecimal; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -163,7 +165,7 @@ public class MesWmReturnSalesServiceImpl implements MesWmReturnSalesService { allDetails, MesWmReturnSalesDetailDO::getLineId); // 检查每行的明细数量 for (MesWmReturnSalesLineDO line : lines) { - List details = detailMap.getOrDefault(line.getId(), List.of()); + List details = detailMap.getOrDefault(line.getId(), Collections.emptyList()); BigDecimal totalDetailQuantity = CollectionUtils.getSumValue(details, MesWmReturnSalesDetailDO::getQuantity, BigDecimal::add, BigDecimal.ZERO); // 对比行数量与明细总数量,不满足直接抛出 diff --git a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transfer/MesWmTransferServiceImpl.java b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transfer/MesWmTransferServiceImpl.java index 9edc490d7..8c5e30462 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transfer/MesWmTransferServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-server/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transfer/MesWmTransferServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.mes.service.wm.transfer; import cn.hutool.core.collection.CollUtil; + import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; @@ -22,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import java.math.BigDecimal; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -186,7 +188,7 @@ public class MesWmTransferServiceImpl implements MesWmTransferService { allDetails, MesWmTransferDetailDO::getLineId); // 2. 遍历行和对应的明细,创建事务 for (MesWmTransferLineDO line : lines) { - List details = detailMap.getOrDefault(line.getId(), List.of()); + List details = detailMap.getOrDefault(line.getId(), Collections.emptyList()); for (MesWmTransferDetailDO detail : details) { // 2.1 先执行出库:调拨移出(从源仓库扣减库存),出库数量基于当前明细的数量 Long outTransactionId = wmTransactionService.createTransaction(new MesWmTransactionSaveReqDTO() diff --git a/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/pro/feedback/MesProFeedbackServiceImplTest.java b/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/pro/feedback/MesProFeedbackServiceImplTest.java index f2bb17dc5..8c2486915 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/pro/feedback/MesProFeedbackServiceImplTest.java +++ b/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/pro/feedback/MesProFeedbackServiceImplTest.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.mes.service.pro.feedback; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.mes.dal.dataobject.pro.feedback.MesProFeedbackDO; import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productproduce.MesWmProductProduceLineDO; @@ -19,11 +20,11 @@ import org.springframework.context.annotation.Import; import org.springframework.test.context.bean.override.mockito.MockitoBean; import java.math.BigDecimal; -import java.util.List; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.*; /** @@ -78,7 +79,7 @@ public class MesProFeedbackServiceImplTest extends BaseDbUnitTest { .qualityStatus(MesWmQualityStatusEnum.FAIL.getStatus()) .build(); when(produceLineService.getProductProduceLineListByFeedbackId(feedback.getId())) - .thenReturn(List.of(qualifiedLine, unqualifiedLine)); + .thenReturn(ListUtil.of(qualifiedLine, unqualifiedLine)); // 调用 BigDecimal qualifiedQty = BigDecimal.valueOf(80); @@ -133,7 +134,7 @@ public class MesProFeedbackServiceImplTest extends BaseDbUnitTest { .qualityStatus(MesWmQualityStatusEnum.PASS.getStatus()) .build(); when(produceLineService.getProductProduceLineListByFeedbackId(feedback.getId())) - .thenReturn(List.of(qualifiedLine)); + .thenReturn(ListUtil.of(qualifiedLine)); // 调用 feedbackService.updateProFeedbackWhenIpqcFinish(feedback.getId(), diff --git a/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/itemconsume/MesWmItemConsumeServiceImplTest.java b/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/itemconsume/MesWmItemConsumeServiceImplTest.java index c5e2e09bf..f4b3b9d61 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/itemconsume/MesWmItemConsumeServiceImplTest.java +++ b/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/itemconsume/MesWmItemConsumeServiceImplTest.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.mes.service.wm.itemconsume; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.mes.controller.admin.wm.materialstock.vo.MesWmMaterialStockListReqVO; @@ -43,9 +45,7 @@ import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.PRO_FEEDBACK_ROUTE_PROCESS_INVALID; import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.PRO_ROUTE_NOT_EXISTS; import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyLong; -import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; /** @@ -181,7 +181,7 @@ public class MesWmItemConsumeServiceImplTest extends BaseDbUnitTest { bom.setItemId(bomItemId); bom.setQuantity(new BigDecimal("2")); // 用料比例 = 2 when(routeProductBomService.getRouteProductBomList(any(), any(), any())) - .thenReturn(List.of(bom)); + .thenReturn(ListUtil.of(bom)); when(materialStockService.getMaterialStockList(any(MesWmMaterialStockListReqVO.class))) .thenReturn(Collections.emptyList()); @@ -229,7 +229,7 @@ public class MesWmItemConsumeServiceImplTest extends BaseDbUnitTest { bom.setItemId(bomItemId); bom.setQuantity(new BigDecimal("3")); // 消耗 = 3 × 10 = 30 when(routeProductBomService.getRouteProductBomList(any(), any(), any())) - .thenReturn(List.of(bom)); + .thenReturn(ListUtil.of(bom)); Long stockId = randomLongId(); Long batchId = randomLongId(); @@ -240,7 +240,7 @@ public class MesWmItemConsumeServiceImplTest extends BaseDbUnitTest { stock.setBatchId(batchId); stock.setBatchCode("BATCH-001"); when(materialStockService.getMaterialStockList(any(MesWmMaterialStockListReqVO.class))) - .thenReturn(List.of(stock)); + .thenReturn(ListUtil.of(stock)); // 调用 MesWmItemConsumeDO result = itemConsumeService.generateItemConsume(feedback); @@ -268,7 +268,7 @@ public class MesWmItemConsumeServiceImplTest extends BaseDbUnitTest { bom.setItemId(bomItemId); bom.setQuantity(new BigDecimal("3")); // 消耗 = 3 × 10 = 30 when(routeProductBomService.getRouteProductBomList(any(), any(), any())) - .thenReturn(List.of(bom)); + .thenReturn(ListUtil.of(bom)); Long stockId1 = randomLongId(); Long stockId2 = randomLongId(); @@ -321,7 +321,7 @@ public class MesWmItemConsumeServiceImplTest extends BaseDbUnitTest { bom.setItemId(bomItemId); bom.setQuantity(new BigDecimal("3")); // 消耗 = 3 × 10 = 30 when(routeProductBomService.getRouteProductBomList(any(), any(), any())) - .thenReturn(List.of(bom)); + .thenReturn(ListUtil.of(bom)); Long stockId = randomLongId(); MesWmMaterialStockDO stock = new MesWmMaterialStockDO(); @@ -331,7 +331,7 @@ public class MesWmItemConsumeServiceImplTest extends BaseDbUnitTest { stock.setBatchId(1L); stock.setBatchCode("BATCH-001"); when(materialStockService.getMaterialStockList(any(MesWmMaterialStockListReqVO.class))) - .thenReturn(List.of(stock)); + .thenReturn(ListUtil.of(stock)); // 调用 MesWmItemConsumeDO result = itemConsumeService.generateItemConsume(feedback); @@ -383,7 +383,7 @@ public class MesWmItemConsumeServiceImplTest extends BaseDbUnitTest { when(materialStockService.getMaterialStockList(argThat((MesWmMaterialStockListReqVO req) -> req != null && itemA.equals(req.getItemId())))) - .thenReturn(List.of(stockA)); + .thenReturn(ListUtil.of(stockA)); when(materialStockService.getMaterialStockList(argThat((MesWmMaterialStockListReqVO req) -> req != null && itemB.equals(req.getItemId())))) .thenReturn(Collections.emptyList()); @@ -406,15 +406,15 @@ public class MesWmItemConsumeServiceImplTest extends BaseDbUnitTest { assertEquals(2, details.size()); // 物料 A:有批次 - MesWmItemConsumeDetailDO detailA = details.stream() - .filter(d -> itemA.equals(d.getItemId())).findFirst().orElseThrow(); + MesWmItemConsumeDetailDO detailA = CollUtil.findOne(details, + d -> itemA.equals(d.getItemId())); assertEquals(0, new BigDecimal("10").compareTo(detailA.getQuantity())); assertNotNull(detailA.getMaterialStockId()); assertEquals("BATCH-A", detailA.getBatchCode()); // 物料 B:无批次 - MesWmItemConsumeDetailDO detailB = details.stream() - .filter(d -> itemB.equals(d.getItemId())).findFirst().orElseThrow(); + MesWmItemConsumeDetailDO detailB = CollUtil.findOne(details, + d -> itemB.equals(d.getItemId())); assertEquals(0, new BigDecimal("20").compareTo(detailB.getQuantity())); assertNull(detailB.getMaterialStockId()); } diff --git a/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueLineServiceImplTest.java b/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueLineServiceImplTest.java index 4934dcafd..192d5e1d5 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueLineServiceImplTest.java +++ b/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueLineServiceImplTest.java @@ -13,6 +13,7 @@ import org.springframework.test.context.bean.override.mockito.MockitoBean; import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; import java.math.BigDecimal; +import java.util.List; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -100,7 +101,7 @@ public class MesWmReturnIssueLineServiceImplTest extends BaseDbUnitTest { assertEquals(0, qualifiedQty.compareTo(originalLine.getQuantity())); // 断言:新增了一行不合格品 - var allLines = returnIssueLineMapper.selectListByIssueId(lineDO.getIssueId()); + List allLines = returnIssueLineMapper.selectListByIssueId(lineDO.getIssueId()); assertEquals(2, allLines.size()); MesWmReturnIssueLineDO newLine = allLines.stream() .filter(l -> !l.getId().equals(lineDO.getId())) diff --git a/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesLineServiceImplTest.java b/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesLineServiceImplTest.java index 3ef35fe86..e93ffac9c 100644 --- a/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesLineServiceImplTest.java +++ b/yudao-module-mes/yudao-module-mes-server/src/test/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesLineServiceImplTest.java @@ -13,6 +13,7 @@ import org.springframework.test.context.bean.override.mockito.MockitoBean; import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; import java.math.BigDecimal; +import java.util.List; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -100,7 +101,7 @@ public class MesWmReturnSalesLineServiceImplTest extends BaseDbUnitTest { assertEquals(0, qualifiedQty.compareTo(originalLine.getQuantity())); // 断言:新增了一行不合格品 - var allLines = returnSalesLineMapper.selectListByReturnId(lineDO.getReturnId()); + List allLines = returnSalesLineMapper.selectListByReturnId(lineDO.getReturnId()); assertEquals(2, allLines.size()); MesWmReturnSalesLineDO newLine = allLines.stream() .filter(l -> !l.getId().equals(lineDO.getId()))