jinpengyong
2024-01-23 4f90163c268bdeb3f8233326f16cf21fe17a24c0
chore:疾控中心修改时间问题提交
2 files modified
20 ■■■■ changed files
screen-job/src/main/java/com/moral/api/controller/PubController.java 12 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/HistoryHourlyServiceImpl.java 8 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/controller/PubController.java
@@ -69,13 +69,13 @@
    }
    @GetMapping("dateInsertHistoryHourlyJKAvg")
    @ApiOperation(value = "小时数据", notes = "小时数据")
    public ResultMessage dateInsertHistoryHourlyJKAvg(String start, String end) {
        String format = DateUtils.yyyy_MM_dd_HH_mm_EN;
//        String start ="2023-11-19 09:00";
    @ApiOperation(value = "疾控中心小时数据", notes = "疾控中心小时数据")
    public ResultMessage dateInsertHistoryHourlyJKAvg(String start,String end) {
//        String format = DateUtils.yyyy_MM_dd_HH_mm_EN;
//        String start ="2023-11-19 09:00"
//        String end ="2023-11-19 10:00";
//        Date start = DateUtils.getDate(s,format);
//        Date end = DateUtils.getDate(s1,format);
//        Date start1 = DateUtils.getDate(start,format);
//        Date end1 = DateUtils.getDate(end,format);
        historyHourlyService.dateInsertHistoryHourlyJKAvg(start, end);
        return new ResultMessage();
    }
screen-job/src/main/java/com/moral/api/service/impl/HistoryHourlyServiceImpl.java
@@ -626,9 +626,9 @@
        }
        //从数据库获取数据参数
        Map<String, Object> params = new HashMap<>();
        Date startTime=null;
        Date endTime=null;
        if (!ObjectUtils.isEmpty(start) || !ObjectUtils.isEmpty(end)){
        Date startTime;
        Date endTime;
        if (!ObjectUtils.isEmpty(start) && !ObjectUtils.isEmpty(end)){
            startTime = DateUtils.getDate(start, DateUtils.yyyy_MM_dd_HH_mm_ss_EN);
            endTime = DateUtils.getDate(end, DateUtils.yyyy_MM_dd_HH_mm_ss_EN);
        }else {
@@ -665,7 +665,7 @@
        data.forEach((key, value) -> {
            Map<String, Object> historyHourly = new HashMap<>();
            historyHourly.put("mac", key);
            historyHourly.put("time",start);
            historyHourly.put("time",startTime);
            Map<String, Object> jsonMap = new HashMap<>();
            Map<String, Object> map = new HashMap<>();