Commit f3e93a4e by 章家宝

feat:新增定时任务传参

1 parent 17871725
package cn.com.glsx.dj.mindworkplate.service;
import cn.com.glsx.dj.mindworkplate.Main;
import cn.com.glsx.dj.mindworkplate.mapper.InspectionCustomerTagMapper;
import cn.com.glsx.dj.mindworkplate.model.ConversationBatch;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List;
import static org.junit.Assert.assertNotNull;
/**
* 历史客户标签分析服务测试
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class HistoricalCustomerTagServiceTest extends BaseServiceTest {
@Autowired
private InspectionCustomerTagMapper inspectionCustomerTagMapper;
@Autowired
private InspectionCustomerTagService inspectionCustomerTagService;
/**
* 测试查询未处理的批次
*/
@Test
public void testFindUnprocessedBatchesByTimeRange() {
String startTime = "2024-01-01 00:00:00";
String endTime = "2026-07-01 00:00:00";
List<ConversationBatch> batches = inspectionCustomerTagMapper.findUnprocessedBatchesByTimeRange(startTime, endTime);
assertNotNull("查询结果不应为null", batches);
System.out.println("查询到未处理批次数量: " + batches.size());
if (!batches.isEmpty()) {
ConversationBatch first = batches.get(0);
System.out.println("第一个批次ID: " + first.getId() + ", recordId: " + first.getRecordId());
}
}
/**
* 测试处理历史标签分析
*/
@Test
public void testProcessHistoricalTags() {
String startTime = "2024-01-01 00:00:00";
String endTime = "2026-07-01 00:00:00";
int count = inspectionCustomerTagService.processHistoricalTags(startTime, endTime);
System.out.println("处理完成的批次数量: " + count);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!