From 8c65f898ed6e5b0c7a94c792c4562f6ec831dccd Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 07 十一月 2026 08:50:53 +0800
Subject: [PATCH] feat: 完善质检、生产、销售、财务与人事模块并接入审批流程
---
yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleServiceTest.java | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleServiceTest.java b/yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleServiceTest.java
index ad1f2bf..bd17175 100644
--- a/yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleServiceTest.java
+++ b/yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleServiceTest.java
@@ -13,7 +13,6 @@
import cn.iocoder.yudao.module.mes.dal.mysql.dv.machinery.MesDvMachineryMapper;
import cn.iocoder.yudao.module.mes.dal.mysql.pro.task.MesProTaskMapper;
import cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder.MesProWorkOrderMapper;
-import cn.iocoder.yudao.module.mes.service.cal.holiday.MesCalHolidayService;
import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService;
import cn.iocoder.yudao.module.mes.service.md.workstation.MesMdWorkstationService;
import cn.iocoder.yudao.module.mes.service.pro.process.MesProProcessService;
@@ -188,7 +187,17 @@
}
private static <T> T stub(Class<T> type, InvocationHandler handler) {
- return type.cast(Proxy.newProxyInstance(type.getClassLoader(), new Class<?>[]{type}, handler));
+ return type.cast(Proxy.newProxyInstance(type.getClassLoader(), new Class<?>[]{type}, (proxy, method, args) -> {
+ if (method.getDeclaringClass() == Object.class) {
+ return switch (method.getName()) {
+ case "toString" -> type.getSimpleName() + "Stub";
+ case "hashCode" -> System.identityHashCode(proxy);
+ case "equals" -> proxy == args[0];
+ default -> throw new AssertionError(method.getName());
+ };
+ }
+ return handler.invoke(proxy, method, args);
+ }));
}
static class Fixture {
@@ -233,7 +242,6 @@
new MesMdWorkstationDO().setId(2L).setName("宸ヤ綔绔橞").setProcessId(2L).setStatus(0))));
set("machineryMapper", stub(MesDvMachineryMapper.class, (p,m,a) -> machines));
set("customerApi", stub(CrmCustomerApi.class, (p,m,a) -> null));
- set("holidayService", stub(MesCalHolidayService.class, (p,m,a) -> List.of()));
set("workOrderProcessService", stub(MesProWorkOrderProcessService.class, (p,m,a) -> processes));
var quantities = new MesProScheduleQuantityService();
ReflectionTestUtils.setField(quantities, "workOrderProcessService", stub(MesProWorkOrderProcessService.class, (p,m,a) -> processes));
--
Gitblit v1.9.3