10 changed files with 160 additions and 16 deletions
@ -0,0 +1,58 @@ |
|||
package com.zdxt.rest.test.cp; |
|||
|
|||
import com.zdxt.enforcementcode.service.IEfcodeCpPlanService; |
|||
import org.dromara.ZdxtAdminApplication; |
|||
import org.junit.jupiter.api.*; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
import org.springframework.test.context.ActiveProfiles; |
|||
|
|||
/** |
|||
* 计划到期自动生成任务测试 |
|||
* <p> |
|||
* 调用 ignoreTime=true 模式,忽略时间窗口限制, |
|||
* 将所有未生成任务的计划全部处理(取消待确认预约并生成任务)。 |
|||
* </p> |
|||
*/ |
|||
@SpringBootTest(classes = ZdxtAdminApplication.class) |
|||
@ActiveProfiles({"dev", "dev-cust-zrb"}) |
|||
@DisplayName("计划到期自动生成任务测试") |
|||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) |
|||
public class AppEnfCpPlanDeadlineGenTaskTest { |
|||
|
|||
@Autowired |
|||
private IEfcodeCpPlanService cpPlanService; |
|||
|
|||
/** |
|||
* 忽略时间 - 处理所有未生成任务的计划 |
|||
* <p>将所有符合条件的计划(reserveStatus∈{1,2,4,5,6}且无taskId)全部处理: |
|||
* 取消待确认预约、为已同意的生成共享任务、为无联合记录的生成独立任务</p> |
|||
*/ |
|||
@DisplayName("忽略时间 - 计划到期自动生成任务") |
|||
@Test |
|||
@Order(1) |
|||
public void testProcessPlanDeadline_ignoreTime() { |
|||
System.out.println("========== 开始执行计划到期自动生成任务(忽略时间) =========="); |
|||
|
|||
int processedCount = cpPlanService.processPlanDeadlineAutoGenTask(true); |
|||
|
|||
System.out.println("处理计划数: " + processedCount); |
|||
System.out.println("========== 计划到期自动生成任务完毕 =========="); |
|||
} |
|||
|
|||
/** |
|||
* 正常模式 - 仅处理到期窗口内的计划 |
|||
* <p>按 CP_SETTING_MANUAL_MATCH_DAYS 配置的天数窗口处理即将到期的计划</p> |
|||
*/ |
|||
@DisplayName("正常模式 - 仅处理到期窗口内的计划") |
|||
@Test |
|||
@Order(2) |
|||
public void testProcessPlanDeadline_normal() { |
|||
System.out.println("========== 开始执行计划到期自动生成任务(正常模式) =========="); |
|||
|
|||
int processedCount = cpPlanService.processPlanDeadlineAutoGenTask(false); |
|||
|
|||
System.out.println("处理计划数: " + processedCount); |
|||
System.out.println("========== 计划到期自动生成任务完毕 =========="); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue