|
|
@@ -1,19 +1,11 @@
|
|
|
package com.ruoyi;
|
|
|
|
|
|
-import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
-import com.ruoyi.common.core.domain.entity.SysRole;
|
|
|
-import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SM4Util;
|
|
|
-import com.ruoyi.common.utils.SecurityUtils;
|
|
|
-import com.ruoyi.common.utils.file.FileUtils;
|
|
|
-import com.ruoyi.interfaces.domain.MdModelInfo;
|
|
|
-import com.ruoyi.interfaces.domain.PtService;
|
|
|
-import com.ruoyi.interfaces.domain.SysMetaDatasource;
|
|
|
-import com.ruoyi.interfaces.mapper.MdModelInfoMapper;
|
|
|
-import com.ruoyi.interfaces.mapper.PtServiceMapper;
|
|
|
-import com.ruoyi.interfaces.mapper.SysMetaDatasourceMapper;
|
|
|
-import com.ruoyi.interfaces.service.ISysMetaDatasourceService;
|
|
|
-import com.ruoyi.interfaces.service.PtServiceService;
|
|
|
+import com.ruoyi.interfaces.domain.*;
|
|
|
+import com.ruoyi.interfaces.domain.job.JobTaskBatch;
|
|
|
+import com.ruoyi.interfaces.domain.vo.JobTaskVo;
|
|
|
+import com.ruoyi.interfaces.mapper.*;
|
|
|
import com.ruoyi.interfaces.service.impl.MdModelInfoServiceImpl;
|
|
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
|
|
import com.ruoyi.system.mapper.SysRoleMapper;
|
|
|
@@ -27,8 +19,9 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Random;
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
|
|
|
|
@@ -54,13 +47,72 @@ public class JasyptTest {
|
|
|
@Autowired
|
|
|
private SysRoleMapper roleMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PtServiceLogMapper serviceLogMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SnailJobMapper snailJobMapper;
|
|
|
+
|
|
|
|
|
|
@Test
|
|
|
public void test() throws IOException {
|
|
|
- String s = SecurityUtils.encryptPassword( "Gw#$1601");
|
|
|
+ Random random = new Random();
|
|
|
+
|
|
|
+
|
|
|
+ List<JobTaskBatch> jobTaskVos = snailJobMapper.selectJobTaskBatch();
|
|
|
+ Long dayLong = DateUtils.DAY_LONG;
|
|
|
+ Date stateDate = DateUtils.dateTime(DateUtils.YYYY_MM_DD, "2025-10-15");
|
|
|
+
|
|
|
+
|
|
|
+ for (long i = stateDate.getTime(); i < DateUtils.getNowDate().getTime(); i += dayLong) {
|
|
|
+ List<Job> jobs = snailJobMapper.selectJobList(new Job());
|
|
|
+
|
|
|
+ for (int j = 0; j < 100; j++) {
|
|
|
+ JobTaskBatch jobTaskVo = jobTaskVos.get(random.nextInt(jobTaskVos.size() - 1));
|
|
|
+ Job job = jobs.get(random.nextInt(jobs.size() - 1));
|
|
|
+
|
|
|
+ jobTaskVo.setJobId(job.getId());
|
|
|
+ jobTaskVo.setTaskBatchStatus(3);
|
|
|
+ jobTaskVo.setCreateDt(new Date(i + random.nextInt(Integer.parseInt(dayLong + ""))));
|
|
|
+ jobTaskVo.setExecutionAt(jobTaskVo.getCreateDt().getTime()+random.nextInt(500000)+50000);
|
|
|
+ jobTaskVo.setUpdateDt(new Date(jobTaskVo.getExecutionAt()+random.nextInt(500000)+50000));
|
|
|
+ //System.out.println(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,serviceLog.getTm()));
|
|
|
+ snailJobMapper.insertJobTaskBatch(jobTaskVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* List<PtService> ptServices = ptServiceMapper.selectAll(new PtService());
|
|
|
+
|
|
|
+
|
|
|
+ Long dayLong = DateUtils.DAY_LONG;
|
|
|
+
|
|
|
+ Date stateDate = DateUtils.dateTime(DateUtils.YYYY_MM_DD, "2025-10-15");
|
|
|
+ for (long i = stateDate.getTime(); i < DateUtils.getNowDate().getTime(); i += dayLong) {
|
|
|
+ List<PtServiceLog> serviceLogs = serviceLogMapper.selectDbmsRandom();
|
|
|
+ for (int j = 0; j < 300; j++) {
|
|
|
+ PtService ptService = ptServices.get(random.nextInt(ptServices.size() - 1));
|
|
|
+ PtServiceLog serviceLog = serviceLogs.get(random.nextInt(199));
|
|
|
+ serviceLog.setSerId(serviceLog.getSerId());
|
|
|
+ serviceLog.setMdId(serviceLog.getMdId());
|
|
|
+ serviceLog.setUrl(ptService.getUrl());
|
|
|
+ serviceLog.setTm(new Date(i + random.nextInt(Integer.parseInt(dayLong + ""))));
|
|
|
+ //System.out.println(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,serviceLog.getTm()));
|
|
|
+ serviceLog.setLogId(null);
|
|
|
+ serviceLogMapper.insertPtServiceLog(serviceLog);
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/* String s = SecurityUtils.encryptPassword( "Gw#$1601");
|
|
|
System.out.println(s);
|
|
|
boolean b = SecurityUtils.matchesPassword( "Gw#$1601", s);
|
|
|
- System.out.println(b);
|
|
|
+ System.out.println(b);*/
|
|
|
|
|
|
/*
|
|
|
List<MdModelInfo> mdModelInfos = modelMapper.selectMdModelInfoList(new MdModelInfo());
|
|
|
@@ -137,9 +189,6 @@ public class JasyptTest {
|
|
|
});*/
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//System.out.println(sm4Util.encrypt("Gw#$1601"));
|
|
|
/*
|
|
|
|