From 315ec391b2a36a6d796a8726b57b7c2b8908db12 Mon Sep 17 00:00:00 2001 From: cjl <276999030@qq.com> Date: Mon, 10 Jul 2023 14:22:22 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into qa --- screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java | 91 ++++++++------- screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java | 163 +++++++++++++++++++++----- screen-common/src/main/java/com/moral/util/AESUtils.java | 4 screen-manage/src/main/resources/application-dev.yml | 8 screen-api/src/main/resources/application-dev.yml | 10 screen-job/src/main/resources/application-dev.yml | 8 screen-job/src/main/resources/application-qa.yml | 2 screen-job/src/main/java/com/moral/api/controller/PubController.java | 12 ++ screen-manage/src/main/java/com/moral/api/controller/PubController.java | 16 ++ screen-api/src/main/java/com/moral/api/controller/DataDisplayController.java | 6 screen-api/src/main/resources/application-local.yml | 4 11 files changed, 226 insertions(+), 98 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/controller/DataDisplayController.java b/screen-api/src/main/java/com/moral/api/controller/DataDisplayController.java index ef7c6fe..91ccf70 100644 --- a/screen-api/src/main/java/com/moral/api/controller/DataDisplayController.java +++ b/screen-api/src/main/java/com/moral/api/controller/DataDisplayController.java @@ -32,10 +32,10 @@ @Autowired DataDisplayService dataDisplayService; - @GetMapping("monitorPointDataDisplay") - public ResultMessage monitorPointDataDisplay(MonitorPointDataDisplayForm form){ + @PostMapping("monitorPointDataDisplay") + public ResultMessage monitorPointDataDisplay( @RequestBody MonitorPointDataDisplayForm form){ //������������������������ - if (!form.valid()) + if (form.getMacs()==null && form.getEndTime() ==null && form.getStartTime() ==null && form.getReportType()==null) return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); diff --git a/screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java b/screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java index 86df41a..cc43b35 100644 --- a/screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java +++ b/screen-api/src/main/java/com/moral/api/pojo/form/dataDisplay/MonitorPointDataDisplayForm.java @@ -7,6 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; +import java.util.List; /** * @ClassName MonitorPointDataDisplayForm @@ -20,21 +21,27 @@ /* * ������id - * */ - private Integer monitorPointId; + */ +// private Integer monitorPointId; + + + /** + * mac��� + */ + private List<String> macs; /* * ������������ * */ - @DateTimeFormat(pattern = "yyyy-MM-dd") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH") + @JsonFormat(pattern = "yyyy-MM-dd HH", timezone = "GMT+8") private Date startTime; /* * ������������ * */ - @DateTimeFormat(pattern = "yyyy-MM-dd") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH") + @JsonFormat(pattern = "yyyy-MM-dd HH", timezone = "GMT+8") private Date endTime; /* @@ -45,41 +52,41 @@ /* * ������������������������ * */ - public boolean valid() { - if (monitorPointId == null) - return false; - if (reportType == null) { - if (startTime == null || endTime == null) - return false; - //������������������������������������������ - String endTimeStr = DateUtils.dateToDateString(endTime,"yyyy-MM-dd"); - endTimeStr+=" 23:59:59"; - endTime = DateUtils.getDate(endTimeStr,"yyyy-MM-dd HH:mm:ss"); - } else { - if(startTime!=null&&endTime!=null) - return false; - if (reportType.equals(Constants.HOURLY_REPORT)) { - //������������������������������������������ - Date previousHour = DateUtils.getDateOfMin(new Date(), -60); - startTime = DateUtils.getHourlyStartTime(previousHour); - } else if (reportType.equals(Constants.DAILY_REPORT)) { - //������������������������������������ - Date yesterday = DateUtils.getDateOfDay(new Date(),-1); - startTime = DateUtils.getDailyStartTime(yesterday); - } else if (reportType.equals(Constants.WEEKLY_REPORT)) { - //������������������������������������ - Date previous = DateUtils.getDateOfDay(new Date(),-7); - startTime = DateUtils.getWeeklyStartTime(previous); - endTime = DateUtils.getWeeklyEndTime(previous); - } else if (reportType.equals(Constants.MONTHLY_REPORT)) { - //������������������������������������ - Date lastMonthFirstDay = DateUtils.getFirstDayOfLastMonth(); - startTime = DateUtils.getMonthlyStartTime(lastMonthFirstDay); - endTime = DateUtils.getMonthlyEndTime(lastMonthFirstDay); - } else - return false; - } - return true; - } +// public boolean valid() { +// if (monitorPointId == null) +// return false; +// if (reportType == null) { +// if (startTime == null || endTime == null) +// return false; +// //������������������������������������������ +// String endTimeStr = DateUtils.dateToDateString(endTime,"yyyy-MM-dd"); +// endTimeStr+=" 23:59:59"; +// endTime = DateUtils.getDate(endTimeStr,"yyyy-MM-dd HH:mm:ss"); +// } else { +// if(startTime!=null&&endTime!=null) +// return false; +// if (reportType.equals(Constants.HOURLY_REPORT)) { +// //������������������������������������������ +// Date previousHour = DateUtils.getDateOfMin(new Date(), -60); +// startTime = DateUtils.getHourlyStartTime(previousHour); +// } else if (reportType.equals(Constants.DAILY_REPORT)) { +// //������������������������������������ +// Date yesterday = DateUtils.getDateOfDay(new Date(),-1); +// startTime = DateUtils.getDailyStartTime(yesterday); +// } else if (reportType.equals(Constants.WEEKLY_REPORT)) { +// //������������������������������������ +// Date previous = DateUtils.getDateOfDay(new Date(),-7); +// startTime = DateUtils.getWeeklyStartTime(previous); +// endTime = DateUtils.getWeeklyEndTime(previous); +// } else if (reportType.equals(Constants.MONTHLY_REPORT)) { +// //������������������������������������ +// Date lastMonthFirstDay = DateUtils.getFirstDayOfLastMonth(); +// startTime = DateUtils.getMonthlyStartTime(lastMonthFirstDay); +// endTime = DateUtils.getMonthlyEndTime(lastMonthFirstDay); +// } else +// return false; +// } +// return true; +// } } diff --git a/screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java index 543886e..b710fdc 100644 --- a/screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java +++ b/screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java @@ -3,6 +3,7 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.moral.api.entity.*; +import com.moral.api.mapper.DeviceMapper; import com.moral.api.mapper.HistoryMonthlyMapper; import com.moral.api.pojo.dto.dataDisplay.MonitorPointDataDisplayDTO; import com.moral.api.pojo.dto.dataDisplay.SensorComparisonDisplayDTO; @@ -17,6 +18,8 @@ import org.springframework.util.ObjectUtils; import java.util.*; + +import static com.moral.util.DateUtils.dateToDateString; /** * @ClassName DataDisplayServiceImpl @@ -41,19 +44,27 @@ @Autowired HistoryMonthlyService historyMonthlyService; + @Autowired + DeviceMapper deviceMapper; + @Override public List<MonitorPointDataDisplayDTO> getMonitorPointDisplayData(MonitorPointDataDisplayForm form) { //������ - Integer monitorPointId = form.getMonitorPointId(); +// Integer monitorPointId = form.getMacs(); + List<String> macs = form.getMacs(); String reportType = form.getReportType(); Date startTime = form.getStartTime(); Date endTime = form.getEndTime(); //������������id������������������������������ - List<Device> devices = deviceService.getDevicesByMonitorPointId(monitorPointId); +// List<Device> devices = deviceService.getDevicesByMonitorPointId(monitorPointId); + QueryWrapper<Device> deviceQueryWrapper = new QueryWrapper<>(); + deviceQueryWrapper.eq("is_delete",Constants.NOT_DELETE); + deviceQueryWrapper.in("mac", macs); + List<Device> devices = deviceMapper.selectList(deviceQueryWrapper); Map<String, Device> deviceMap = new HashMap<>(); - List<String> macs = new ArrayList<>(); +// List<String> ListMacs = new ArrayList<>(); devices.forEach(value -> { - macs.add(value.getMac()); +// ListMacs.add(value.getMac()); deviceMap.put(value.getMac(), value); }); List<MonitorPointDataDisplayDTO> dtos = new ArrayList<>(); @@ -73,20 +84,26 @@ } //��������������������������������������������������������� else if (reportType.equals(Constants.HOURLY_REPORT)) { - Map<String, HistoryHourly> macDataMap = new HashMap<>(); + Map<String, List<HistoryHourly>> macDataMap = new HashMap<>(); //������������ macs.forEach(value -> { - List<HistoryHourly> datas = historyHourlyService.getValueByMacAndTime(value, startTime, startTime); + List<HistoryHourly> datas = historyHourlyService.getValueByMacAndTime(value, startTime, endTime); if (datas.size() != 0) - macDataMap.put(value, datas.get(0)); + macDataMap.put(value,datas); }); if (macDataMap.size() != 0) dtos = calculateReportData(macDataMap, deviceMap, reportType, startTime); } //��������������������������������������������� else if (reportType.equals(Constants.DAILY_REPORT)) { + Map<String, List<HistoryDaily>> macDataMap = new HashMap<>(); //������������ - Map<String, HistoryDaily> macDataMap = historyDailyService.getHistoryDailyByMacsAndDate(macs, startTime); + macs.forEach(value -> { + List<HistoryDaily> datas = historyDailyService.getHistoryDailyByMacAndTimeSlot(value, startTime, endTime); + if (datas.size() != 0) + macDataMap.put(value,datas); + }); + if (macDataMap.size() != 0) dtos = calculateReportData(macDataMap, deviceMap, reportType, startTime); } @@ -101,7 +118,15 @@ else if (reportType.equals(Constants.MONTHLY_REPORT)) { //������������������������������������������������������������������������������������������������ Map<String, List<HistoryDaily>> macDataDailyMap = new HashMap<>(); - Map<String, HistoryMonthly> macDataMonthlyMap = historyMonthlyService.getHistoryMonthlyByMacsAndDate(macs, startTime); + Map<String, List<HistoryMonthly>> macDataMonthlyMap = new HashMap<>(); + macs.forEach(mac -> { + QueryWrapper<HistoryMonthly> wrapper = new QueryWrapper<>(); + wrapper.eq("mac",mac); + wrapper.between("time",startTime,endTime); + List<HistoryMonthly> monthlyList = historyMonthlyMapper.selectList(wrapper); + if (!ObjectUtils.isEmpty(monthlyList)) + macDataMonthlyMap.put(mac, monthlyList); + }); macs.forEach(mac -> { List<HistoryDaily> dailyDatas = historyDailyService.getHistoryDailyByMacAndTimeSlot(mac, startTime, endTime); if (!ObjectUtils.isEmpty(dailyDatas)) @@ -533,35 +558,103 @@ */ private <T> List<MonitorPointDataDisplayDTO> calculateReportData(Map<String, T> macDataMap, Map<String, Device> deviceMap, String reportType, Date... date) { List<MonitorPointDataDisplayDTO> dtos = new ArrayList<>(); - macDataMap.forEach((key, valueObject) -> { - MonitorPointDataDisplayDTO dto = new MonitorPointDataDisplayDTO(); - dto.setMac(key); - //���������map - Map<String, Object> valueMap; - //���������������value��������� - Object valueO = ClassUtils.getPropertyValue(valueObject, "value"); - if (valueO == null) - return; - String value = (String) valueO; - valueMap = JSON.parseObject(value, Map.class); + Set<String> strings = macDataMap.keySet(); + for (String key : strings) { + if (reportType.equals("0")){ + List<HistoryHourly> t = (List<HistoryHourly>)macDataMap.get(key); + for (HistoryHourly historyHourly : t) { + MonitorPointDataDisplayDTO dto = new MonitorPointDataDisplayDTO(); + String value = historyHourly.getValue(); + Map map = JSON.parseObject(value, Map.class); + String time = DateUtils.dateToDateString(historyHourly.getTime(), "yyyy-MM-dd HH:00:00"); + injectDataToDto(map, false, dto, reportType); + dto.setTime(time); + dto.setMac(key); + dto.setDeviceName(deviceMap.get(key).getName()); + dtos.add(dto); + } + } + if (reportType.equals("1")){ + List<HistoryDaily> t = (List<HistoryDaily>)macDataMap.get(key); + for (HistoryDaily historyDaily : t) { + MonitorPointDataDisplayDTO dto = new MonitorPointDataDisplayDTO(); + String value = historyDaily.getValue(); + Map map = JSON.parseObject(value, Map.class); + String time = DateUtils.dateToDateString(historyDaily.getTime(), "yyyy-MM-dd"); + injectDataToDto(map, false, dto, reportType); + dto.setTime(time); + dto.setMac(key); + dto.setDeviceName(deviceMap.get(key).getName()); + dtos.add(dto); + } + + } + if (reportType.equals("2")){ + HistoryWeekly historyWeekly = (HistoryWeekly)macDataMap.get(key); + MonitorPointDataDisplayDTO dto = new MonitorPointDataDisplayDTO(); + String value = historyWeekly.getValue(); + Map map = JSON.parseObject(value, Map.class); + String time = DateUtils.dateToDateString(historyWeekly.getTime(), "yyyy-MM-dd"); + injectDataToDto(map, false, dto, reportType); + dto.setTime(time); + dto.setMac(key); + dto.setDeviceName(deviceMap.get(key).getName()); + dtos.add(dto); + + } + if (reportType.equals("3")){ + List<HistoryMonthly> t = (List<HistoryMonthly>)macDataMap.get(key); + for (HistoryMonthly historyMonthly : t) { + MonitorPointDataDisplayDTO dto = new MonitorPointDataDisplayDTO(); + String value = historyMonthly.getValue(); + Map map = JSON.parseObject(value, Map.class); + String time = DateUtils.dateToDateString(historyMonthly.getTime(), "yyyy-MM"); + injectDataToDto(map, false, dto, reportType); + dto.setTime(time); + dto.setMac(key); + dto.setDeviceName(deviceMap.get(key).getName()); + dtos.add(dto); + } + } + } + +// macDataMap.forEach((key, valueObject) -> { +// MonitorPointDataDisplayDTO dto = new MonitorPointDataDisplayDTO(); +// dto.setMac(key); +// //���������map +// Map<String, Object> valueMap; +// List<Map<String, Object>> list; +// //���������������value��������� +// Object valueO = ClassUtils.getPropertyValue(valueObject, "value"); +// if (valueO == null) +// return; +// String value = (String) valueO; +// list = JSON.parseObject(value, List.class); +// for (Map<String, Object> map : list) { +// String o = map.get("value").toString(); +// valueMap = JSON.parseObject(o, Map.class); +// injectDataToDto(valueMap, false, dto, reportType); +// String deviceName = deviceMap.get(key).getName(); +// dto.setDeviceName(deviceName); +// String startTime = DateUtils.dateToDateString((Date) map.get("time"), "yyyy-MM-dd HH:mm:ss"); +// dto.setTime(startTime); +// dtos.add(dto); +// } //������������������ - String deviceName = deviceMap.get(key).getName(); - dto.setDeviceName(deviceName); + //������������,������������������������������������������������������������������������������������������������������ - String startTime = ""; - if (valueObject instanceof HistoryHourly && date.length == 1) - startTime = DateUtils.dateToDateString(date[0], "yyyy-MM-dd HH:mm:ss"); - else if (valueObject instanceof HistoryDaily && date.length == 1) - startTime = DateUtils.dateToDateString(date[0], "yyyy-MM-dd"); - else if (valueObject instanceof HistoryWeekly && date.length == 2) - startTime = DateUtils.dateToDateString(date[0], "yyyy-MM-dd") + " -- " + DateUtils.dateToDateString(date[1], "yyyy-MM-dd"); - else if (valueObject instanceof HistoryMonthly && date.length == 1) - startTime = DateUtils.dateToDateString(date[0], "yyyy-MM"); - dto.setTime(startTime); +// String startTime = ""; +// if (valueObject instanceof HistoryHourly && date.length == 1) +// startTime = DateUtils.dateToDateString(date[0], "yyyy-MM-dd HH:mm:ss"); +// else if (valueObject instanceof HistoryDaily && date.length == 1) +// startTime = DateUtils.dateToDateString(date[0], "yyyy-MM-dd"); +// else if (valueObject instanceof HistoryWeekly && date.length == 2) +// startTime = DateUtils.dateToDateString(date[0], "yyyy-MM-dd") + " -- " + DateUtils.dateToDateString(date[1], "yyyy-MM-dd"); +// else if (valueObject instanceof HistoryMonthly && date.length == 1) +// startTime = DateUtils.dateToDateString(date[0], "yyyy-MM"); +// dto.setTime(startTime); //������������ - injectDataToDto(valueMap, false, dto, reportType); - dtos.add(dto); - }); +// }); return dtos; } diff --git a/screen-api/src/main/resources/application-dev.yml b/screen-api/src/main/resources/application-dev.yml index 44d60b5..3bb3a40 100644 --- a/screen-api/src/main/resources/application-dev.yml +++ b/screen-api/src/main/resources/application-dev.yml @@ -19,7 +19,7 @@ redis: host: r-bp1xdlb9wfc6zt0msp.redis.rds.aliyuncs.com port: 6379 - password: moral_123456 + password: moral_qx_12345 timeout: 30000 jedis: pool: @@ -36,7 +36,7 @@ tokenRedis: host: r-bp1xdlb9wfc6zt0msp.redis.rds.aliyuncs.com port: 6379 - password: moral_123456 + password: moral_qx_12345 timeout: 30000 database: 15 pool: @@ -54,9 +54,9 @@ filters: stat type: com.alibaba.druid.pool.DruidDataSource max-wait: 60000 - url: jdbc:mysql://rm-bp1pr3rx9m3fnkwsk.mysql.rds.aliyuncs.com:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai - username: root - password: moral_123456 + url: jdbc:mysql://rm-bp1pr3rx9m3fnkwsks.mysql.rds.aliyuncs.com:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: moral_qx + password: moral_qx_12345 test-on-borrow: false sql-script-encoding: utf-8 pool-prepared-statements: true diff --git a/screen-api/src/main/resources/application-local.yml b/screen-api/src/main/resources/application-local.yml index a60ee98..2091214 100644 --- a/screen-api/src/main/resources/application-local.yml +++ b/screen-api/src/main/resources/application-local.yml @@ -54,8 +54,8 @@ type: com.alibaba.druid.pool.DruidDataSource max-wait: 60000 url: jdbc:mysql://rm-bp1pr3rx9m3fnkwsk8o2.mysql.rds.aliyuncs.com:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai - username: root - password: moral_123456 + username: moral_qx + password: moral_qx_12345 test-on-borrow: false sql-script-encoding: utf-8 pool-prepared-statements: true diff --git a/screen-common/src/main/java/com/moral/util/AESUtils.java b/screen-common/src/main/java/com/moral/util/AESUtils.java index 6d6f32f..59ecd74 100644 --- a/screen-common/src/main/java/com/moral/util/AESUtils.java +++ b/screen-common/src/main/java/com/moral/util/AESUtils.java @@ -67,8 +67,8 @@ //������ public static String decrypt(String content, String key) { try { - SecretKeySpec skey = new SecretKeySpec(key.getBytes(), algorithm); - IvParameterSpec iv = new IvParameterSpec(key.getBytes(), 0, offset); + SecretKeySpec skey = new SecretKeySpec(key.getBytes("utf-8"), algorithm); + IvParameterSpec iv = new IvParameterSpec(key.getBytes("utf-8"), 0, offset); Cipher cipher = Cipher.getInstance(transformation); cipher.init(Cipher.DECRYPT_MODE, skey, iv);// ��������� byte[] result = cipher.doFinal(new Base64().decode(content)); diff --git a/screen-job/src/main/java/com/moral/api/controller/PubController.java b/screen-job/src/main/java/com/moral/api/controller/PubController.java index 82550d4..7343dd5 100644 --- a/screen-job/src/main/java/com/moral/api/controller/PubController.java +++ b/screen-job/src/main/java/com/moral/api/controller/PubController.java @@ -1,6 +1,7 @@ package com.moral.api.controller; import com.moral.api.service.HistoryDailyService; +import com.moral.api.service.HistoryFiveMinutelyService; import com.moral.constant.ResultMessage; import com.moral.util.DateUtils; import io.swagger.annotations.Api; @@ -29,6 +30,8 @@ public class PubController { @Autowired private HistoryDailyService historyDailyService; + @Autowired + private HistoryFiveMinutelyService historyFiveMinutelyService; @GetMapping("insertHistoryDaily") @ApiOperation(value = "���������������", notes = "���������������") @@ -39,6 +42,15 @@ return new ResultMessage(); } + @GetMapping("insertHistoryFiveMinutely") + @ApiOperation(value = "5������������", notes = "5������������") + public ResultMessage insertHistoryFiveMinutely() { + historyFiveMinutelyService.insertHistoryFiveMinutely(); + return new ResultMessage(); + } + + + public static void main(String[] args) { String s = "2023-9-01"; Date d = DateUtils.getDate(s,"yyyy-MM-dd"); diff --git a/screen-job/src/main/resources/application-dev.yml b/screen-job/src/main/resources/application-dev.yml index 248edec..e2c1c34 100644 --- a/screen-job/src/main/resources/application-dev.yml +++ b/screen-job/src/main/resources/application-dev.yml @@ -20,7 +20,7 @@ redis: host: r-bp1xdlb9wfc6zt0msp.redis.rds.aliyuncs.com port: 6379 - password: moral_123456 + password: moral_qx_12345 timeout: 30000 jedis: pool: @@ -37,7 +37,7 @@ tokenRedis: host: r-bp1xdlb9wfc6zt0msp.redis.rds.aliyuncs.com port: 6379 - password: moral_123456 + password: moral_qx_12345 timeout: 30000 database: 14 pool: @@ -56,8 +56,8 @@ type: com.alibaba.druid.pool.DruidDataSource max-wait: 60000 url: jdbc:mysql://rm-bp1pr3rx9m3fnkwsk.mysql.rds.aliyuncs.com:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai - username: root - password: moral_123456 + username: moral_qx + password: moral_qx_12345 test-on-borrow: false sql-script-encoding: utf-8 pool-prepared-statements: true diff --git a/screen-job/src/main/resources/application-qa.yml b/screen-job/src/main/resources/application-qa.yml index f12ffae..415d569 100644 --- a/screen-job/src/main/resources/application-qa.yml +++ b/screen-job/src/main/resources/application-qa.yml @@ -55,7 +55,7 @@ filters: stat type: com.alibaba.druid.pool.DruidDataSource max-wait: 60000 - url: jdbc:mysql://121.199.44.85:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + url: jdbc:mysql://rm-bp1pr3rx9m3fnkwsk8o2.mysql.rds.aliyuncs.com:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai username: root password: moral_123456 test-on-borrow: false diff --git a/screen-manage/src/main/java/com/moral/api/controller/PubController.java b/screen-manage/src/main/java/com/moral/api/controller/PubController.java index 76f4ded..128bf4a 100644 --- a/screen-manage/src/main/java/com/moral/api/controller/PubController.java +++ b/screen-manage/src/main/java/com/moral/api/controller/PubController.java @@ -6,6 +6,7 @@ import com.moral.api.pojo.form.user.UserQueryForm; import com.moral.api.pojo.form.user.UserUpdateForm; import com.moral.api.pojo.vo.user.UserQueryVO; +import com.moral.api.service.DeviceAdjustValueService; import com.moral.api.service.UserService; import com.moral.api.util.CacheUtils; import com.moral.constant.ResponseCodeEnum; @@ -17,6 +18,9 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Map; /** * @ClassName UserController @@ -32,6 +36,8 @@ public class PubController { @Autowired private CacheUtils cacheUtils; + @Resource + private DeviceAdjustValueService deviceAdjustValueService; @GetMapping("deviceAlarmInfo") @ApiOperation(value = "������������", notes = "������������") @@ -54,4 +60,14 @@ return new ResultMessage(); } + @GetMapping(value = "adjust") + @ApiOperation(value = "adjust������", notes = "adjust������") + @ApiImplicitParams(value = { + @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String") + }) + public ResultMessage adjust() { + Map<String,Object> resultMap = deviceAdjustValueService.refreshRedis(); + return new ResultMessage(); + } + } diff --git a/screen-manage/src/main/resources/application-dev.yml b/screen-manage/src/main/resources/application-dev.yml index 62d8fcf..9e9ca36 100644 --- a/screen-manage/src/main/resources/application-dev.yml +++ b/screen-manage/src/main/resources/application-dev.yml @@ -20,7 +20,7 @@ redis: host: r-bp1xdlb9wfc6zt0msp.redis.rds.aliyuncs.com port: 6379 - password: moral_123456 + password: moral_qx_12345 timeout: 30000 jedis: pool: @@ -37,7 +37,7 @@ tokenRedis: host: r-bp1xdlb9wfc6zt0msp.redis.rds.aliyuncs.com port: 6379 - password: moral_123456 + password: moral_qx_12345 timeout: 30000 database: 14 pool: @@ -56,8 +56,8 @@ type: com.alibaba.druid.pool.DruidDataSource max-wait: 60000 url: jdbc:mysql://rm-bp1pr3rx9m3fnkwsk.mysql.rds.aliyuncs.com:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai - username: root - password: moral_123456 + username: moral_qx + password: moral_qx_12345 test-on-borrow: false sql-script-encoding: utf-8 pool-prepared-statements: true -- Gitblit v1.8.0