package com.nokia.tsl_data; import com.nokia.common.scheduling.service.DemoService; import com.nokia.tsl_data.service.TslReportService; import com.nokia.tsl_data.service.UserCountService; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; @SpringBootTest class TslDataApplicationTest { @Autowired private UserCountService userCountService; /** * 更新管理端用户数--当前阶段需要修改一下模式 */ @Test void test1() throws IOException { String path = "D:/src/管理端用户数.txt"; Files.lines(Paths.get(path), StandardCharsets.UTF_8) .forEach(line -> { String[] split = line.split("\t"); System.out.println(split[0] + Double.parseDouble(split[2])); userCountService.updateManagementUserCount("202311", split[0], Double.parseDouble(split[2])); }); } /** * 更新客户端用户数 */ @Test void test2() throws IOException { String path = "D:/src/客户端用户数.txt"; Files.lines(Paths.get(path), StandardCharsets.UTF_8) .forEach(line -> { String[] split = line.split("\t"); System.out.println(split[0] + Double.parseDouble(split[1])); userCountService.updateCustomerUserCount("202311", split[0], Double.parseDouble(split[1])); }); } @Autowired private TslReportService tslReportService; @Test void test() { tslReportService.generateReport("20231126"); tslReportService.screenShot("20231126"); } @Autowired private DemoService demoService; @Test void test3() { demoService.test1(); } }