|
|
|
@ -1,15 +1,30 @@
|
|
|
|
|
package com.shxy.xymanager_admin;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import com.shxy.xymanager_common.entity.TerminalSchedule;
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.core.util.URLUtil;
|
|
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.shxy.xymanager_common.config.CustomRsaProperties;
|
|
|
|
|
import com.shxy.xymanager_common.dto.*;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Lines;
|
|
|
|
|
import com.shxy.xymanager_common.entity.RequestResults;
|
|
|
|
|
import com.shxy.xymanager_common.entity.TerminalImgAlarmParams;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Terminals;
|
|
|
|
|
import com.shxy.xymanager_common.enums.CommonStatus;
|
|
|
|
|
import com.shxy.xymanager_common.util.*;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
|
import com.shxy.xymanager_service.service.CacheService;
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
|
|
|
|
import java.sql.Time;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@SpringBootTest
|
|
|
|
|
class XymanagerAdminApplicationTests {
|
|
|
|
@ -33,6 +48,14 @@ class XymanagerAdminApplicationTests {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private TerminalScheduleDao terminalScheduleDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RequestResultsDao requestResultsDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TerminalImgAlarmParamsDao terminalImgAlarmParamsDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private CacheService cacheService;
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void contextLoads() {
|
|
|
|
|
|
|
|
|
@ -122,23 +145,180 @@ class XymanagerAdminApplicationTests {
|
|
|
|
|
// user.setPassword(MD5.toHex());
|
|
|
|
|
// userDao.save(user);
|
|
|
|
|
|
|
|
|
|
ArrayList<Integer> requestidlist = new ArrayList<>();
|
|
|
|
|
requestidlist.add(1);
|
|
|
|
|
requestidlist.add(2);
|
|
|
|
|
requestidlist.add(3);
|
|
|
|
|
// ArrayList<Integer> requestidlist = new ArrayList<>();
|
|
|
|
|
// requestidlist.add(1);
|
|
|
|
|
// requestidlist.add(2);
|
|
|
|
|
// requestidlist.add(3);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//// TerminalSchedule terminalSchedule = terminalScheduleDao.selectByPrimaryKey(1);
|
|
|
|
|
//// System.out.println(terminalSchedule.toString());
|
|
|
|
|
//
|
|
|
|
|
// ArrayList<Integer> list = new ArrayList<>();
|
|
|
|
|
// list.add(1);
|
|
|
|
|
// list.add(1);
|
|
|
|
|
// list.add(2);
|
|
|
|
|
// list.add(3);
|
|
|
|
|
// System.out.println(list.toArray());
|
|
|
|
|
// ArrayList<Integer> distinct = CollectionUtil.distinct(list);
|
|
|
|
|
// System.out.println(distinct.toArray());
|
|
|
|
|
|
|
|
|
|
// Date date = new Date();
|
|
|
|
|
// int hour = MyDateUtils.hour(date, true);
|
|
|
|
|
// int minute = MyDateUtils.minute(date);
|
|
|
|
|
// int second = MyDateUtils.second(date);
|
|
|
|
|
// System.out.println(hour + " " + minute + " " + second);
|
|
|
|
|
|
|
|
|
|
// int divisor = NumberUtil.divisor(59, 60);
|
|
|
|
|
// System.out.println(divisor+"");
|
|
|
|
|
|
|
|
|
|
// int i = 88 % 60;
|
|
|
|
|
// System.out.println(i);
|
|
|
|
|
|
|
|
|
|
// double div = XyNumberUtils.delivery(88, 60);
|
|
|
|
|
// System.out.println(div);
|
|
|
|
|
//
|
|
|
|
|
// double div2 = XyNumberUtils.remainder(88, 60);
|
|
|
|
|
// System.out.println(div2);
|
|
|
|
|
|
|
|
|
|
// List<ScheduleAndRuleDto> list = schedulesDao.selectAll(CommonStatus.EFFECTIVE.value());
|
|
|
|
|
// System.out.println(list.toArray());
|
|
|
|
|
|
|
|
|
|
// Integer hour = 19;
|
|
|
|
|
// Integer minute =21;
|
|
|
|
|
// Time time = MyDateUtils.HHMMToTime(hour, minute);
|
|
|
|
|
//
|
|
|
|
|
// System.out.println(time);
|
|
|
|
|
|
|
|
|
|
// TerminalSchedule terminalSchedule = terminalScheduleDao.selectByPrimaryKey(1);
|
|
|
|
|
// System.out.println(terminalSchedule.toString());
|
|
|
|
|
|
|
|
|
|
ArrayList<Integer> list = new ArrayList<>();
|
|
|
|
|
list.add(1);
|
|
|
|
|
list.add(1);
|
|
|
|
|
list.add(2);
|
|
|
|
|
list.add(3);
|
|
|
|
|
//
|
|
|
|
|
// DateTime startTime = MyDateUtils.offsetMinute(MyDateUtils.getNowDate(), 1000);
|
|
|
|
|
// if (startTime.isAfterOrEquals(MyDateUtils.endOfDay(MyDateUtils.getNowDate()))) {
|
|
|
|
|
// System.out.println("sdfadsa");
|
|
|
|
|
// } else {
|
|
|
|
|
// System.out.println("sa");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// List<ScheduleDetailsDto> list = new ArrayList<>();
|
|
|
|
|
//
|
|
|
|
|
//// for (int i = 0; i < 3; i++) {
|
|
|
|
|
// ScheduleDetailsDto dto1 = new ScheduleDetailsDto();
|
|
|
|
|
// dto1.setScheduleId(1);
|
|
|
|
|
// dto1.setHour(9);
|
|
|
|
|
// dto1.setMinute(0);
|
|
|
|
|
// dto1.setPreset(255);
|
|
|
|
|
//
|
|
|
|
|
// ScheduleDetailsDto dto2 = new ScheduleDetailsDto();
|
|
|
|
|
// dto2.setScheduleId(1);
|
|
|
|
|
// dto2.setHour(19);
|
|
|
|
|
// dto2.setMinute(0);
|
|
|
|
|
// dto2.setPreset(255);
|
|
|
|
|
//
|
|
|
|
|
// ScheduleDetailsDto dto3 = new ScheduleDetailsDto();
|
|
|
|
|
// dto3.setScheduleId(1);
|
|
|
|
|
// dto3.setHour(1);
|
|
|
|
|
// dto3.setMinute(0);
|
|
|
|
|
// dto3.setPreset(255);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// ScheduleDetailsDto dto4 = new ScheduleDetailsDto();
|
|
|
|
|
// dto4.setScheduleId(1);
|
|
|
|
|
// dto4.setHour(20);
|
|
|
|
|
// dto4.setMinute(0);
|
|
|
|
|
// dto4.setPreset(255);
|
|
|
|
|
//
|
|
|
|
|
// ScheduleDetailsDto dto5 = new ScheduleDetailsDto();
|
|
|
|
|
// dto5.setScheduleId(1);
|
|
|
|
|
// dto5.setHour(23);
|
|
|
|
|
// dto5.setMinute(0);
|
|
|
|
|
// dto5.setPreset(255);
|
|
|
|
|
//
|
|
|
|
|
// ScheduleDetailsDto dto6 = new ScheduleDetailsDto();
|
|
|
|
|
// dto6.setScheduleId(1);
|
|
|
|
|
// dto6.setHour(0);
|
|
|
|
|
// dto6.setMinute(50);
|
|
|
|
|
// dto6.setPreset(255);
|
|
|
|
|
// list.add(dto1);
|
|
|
|
|
// list.add(dto2);
|
|
|
|
|
// list.add(dto3);
|
|
|
|
|
// list.add(dto4);
|
|
|
|
|
// list.add(dto5);
|
|
|
|
|
// list.add(dto6);
|
|
|
|
|
//
|
|
|
|
|
//// }
|
|
|
|
|
//
|
|
|
|
|
// String s = ScheduleListUtils.relateTime(list, 0);
|
|
|
|
|
// System.out.println(s);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RequestResults results = requestResultsDao.selectByRequestId(128274841);
|
|
|
|
|
// if (null != results) {
|
|
|
|
|
// String resultsData = results.getData();
|
|
|
|
|
// if (StringUtils.isNotBlank(resultsData)) {
|
|
|
|
|
// JSONObject resultObj = JSONObject.parseObject(resultsData);
|
|
|
|
|
// if (null != resultObj.get("groupData")) {
|
|
|
|
|
// List<PhotoTimeResultDto> resultDtoList = JSONArray.parseArray(resultObj.get("groupData").toString(), PhotoTimeResultDto.class);
|
|
|
|
|
// List<String> resultDetails = ScheduleListUtils.getResultDetails(resultDtoList);
|
|
|
|
|
// System.out.println(resultDetails.toArray());
|
|
|
|
|
//// model.setList(resultDetails);
|
|
|
|
|
//// model.setIsNew(true);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// String s = SecureUtil.md5("123456");
|
|
|
|
|
// System.out.println(s);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ArrayList<Integer> termidlist = new ArrayList<>();
|
|
|
|
|
// List<DyAndLineAndTowerAndTermDto> dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(4, 114, null, null, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
// for (DyAndLineAndTowerAndTermDto item1 : dtos) {
|
|
|
|
|
// for (LineAndTowerAndTermDto item2 : item1.getList()) {
|
|
|
|
|
// for (TowerAndTermDto item3 : item2.getList()) {
|
|
|
|
|
// for (Terminals item4 : item3.getList()) {
|
|
|
|
|
// termidlist.add(item4.getId());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// System.out.println(termidlist.toArray());
|
|
|
|
|
|
|
|
|
|
// String s = "http://localhost:8093/api/doc.html";
|
|
|
|
|
// String[] split = s.split("/");
|
|
|
|
|
// System.out.println(split.toString());
|
|
|
|
|
|
|
|
|
|
// String decodedPath = URLUtil.getDecodedPath(URLUtil.url("http://localhost:8093/api/doc.html"));
|
|
|
|
|
// System.out.println(decodedPath);
|
|
|
|
|
//
|
|
|
|
|
// String userPassword = SecureUtil.md5("hnjy2023");
|
|
|
|
|
// System.out.println(userPassword);
|
|
|
|
|
// DateTime dateTime = MyDateUtils.offsetDay(new Date(), -1);
|
|
|
|
|
// System.out.println(dateTime);
|
|
|
|
|
|
|
|
|
|
// HashMap<Integer, TerminalImgAlarmParams> alarmParamMap = new HashMap<>();
|
|
|
|
|
// List<TerminalImgAlarmParams> terminalImgAlarmParams = terminalImgAlarmParamsDao.selectAll();
|
|
|
|
|
// for (TerminalImgAlarmParams item : terminalImgAlarmParams) {
|
|
|
|
|
// alarmParamMap.put(item.getLabel(), item);
|
|
|
|
|
// }
|
|
|
|
|
// System.out.println(alarmParamMap);
|
|
|
|
|
// String key = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJWKrQv7VcJMo6S32ebL1pBsxE00k0E609hGUKr9tG7CVhqr8j5epIOQgXyzgklLLf9WCPDR+nx3g77koFLg6b0SVrrQjZW/+rwuMI0U1htETrEjvKuXI+6Sh2YL+zVWA4MNEefe9XIpwr2fIXvFmxeLGeW+W0CTLzzwImQumIaNAgMBAAECgYAzOn2LlD9Nv5lzzTPNl9jaQxiAZllnyDJYbcYmvaD5LIP4wRzMdvmexHtHb+tbFnEcfqmzbguEZiDw3Tt7COepQWvNzlM+/HbFtkXzSh6WEu2TgjZwudcCDHDyjDzUNgcWnBIw8/+Sy4COOm4p+UnprYK4sdriMZyz8K5UC8CxFQJBAODTt0lg/HiZKaOX7PMmsiRisd5oAslyDHCt66oPG29KTE1j4fwKDzGJlrOo1f4Q078IDYMO1I/Y3uP8Es3FT1MCQQCqRrD+lO3YCZOUGTHm2WGmbljIoeDpnIn2TZFyqDGKXs6EAx7SXkgarY2OC5O2aifMhXElPUGChfSgPmRUFHafAkEAxFtkWuwf1NxAJ6cKxZpoP6sLGenRdUrsXoUnrBEhruM/HOA9gLjwaB14x1SQASOFK/TGiE4ti6ynjoqbiafoDQJBAI0l6FZAsiBhX9pmQD1yeUXzNtmphr1gK+TmS+lVjyt6h4pa49PSn8atkyfqZNnTiYY6H56U9pbx3+Rtk9E23VUCQEZ9/JHUaGc77s3ibpcKFVemlb0i/Uvj2V45aoNfY34iex4biAUsRq/FJNiqBk+xQWkJ4QY8nKVE45GlaCfZ8/c=";
|
|
|
|
|
// try {
|
|
|
|
|
// String pwd = RsaUtils.decryptByPrivateKey( key, "123456" );
|
|
|
|
|
// System.out.println(pwd);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// Lines line = cacheService.getLine(108);
|
|
|
|
|
// System.out.println(line);
|
|
|
|
|
|
|
|
|
|
ArrayList<String> list = new ArrayList<>();
|
|
|
|
|
list.add("dfsaf");
|
|
|
|
|
list.add("ewrqer");
|
|
|
|
|
list.add("wfsakfd");
|
|
|
|
|
System.out.println(list.toArray());
|
|
|
|
|
ArrayList<Integer> distinct = CollectionUtil.distinct(list);
|
|
|
|
|
System.out.println(distinct.toArray());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|