aijinhui
2023-10-10 182b43ff052176b182a32eff9c928717f8f4c61a
设备健康列表
已修改2个文件
30 ■■■■■ 文件已修改
ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java
@@ -101,7 +101,7 @@
    public Results alarmMonth(String month,String type){
        LocalDate today = LocalDate.now();
        int year = today.getYear();
        int day =  getDaysInMonth(Integer.valueOf(month),year);
        int day =  getDaysInMonth(Integer.valueOf(month));
        ESParam esParam = new ESParam();
        esParam.setStart(year+"-"+month+"-01");
        esParam.setEnd(year+"-"+month+"-"+day);
@@ -143,23 +143,19 @@
    }
    //返回每月天数
    public int getDaysInMonth(int month, int year) {
    public int getDaysInMonth(int month) {
        Calendar calendar = Calendar.getInstance();
        switch (month) {
            case Calendar.JANUARY:
            case Calendar.MARCH:
            case Calendar.MAY:
            case Calendar.JULY:
            case Calendar.AUGUST:
            case Calendar.OCTOBER:
            case Calendar.DECEMBER:
            case 1: case 3: case 5: case 7: case 8: case 10: case 12:
                return 31;
            case Calendar.APRIL:
            case Calendar.JUNE:
            case Calendar.SEPTEMBER:
            case Calendar.NOVEMBER:
            case 4: case 6: case 9: case 11:
                return 30;
            case Calendar.FEBRUARY:
                return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 29 : 28;
            case 2:
                if (calendar.get(Calendar.YEAR) % 4 == 0 && (calendar.get(Calendar.YEAR) % 100 != 0 || calendar.get(Calendar.YEAR) % 400 == 0)) {
                    return 29;
                } else {
                    return 28;
                }
            default:
                throw new IllegalArgumentException("Invalid Month");
        }
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
@@ -427,11 +427,11 @@
        String month = end.substring(5,7);
        for (int i = 1; i <= day ; i++) {
            CountVo vo = new CountVo();
            String d = month + "月" + i + "日";
            String d = month + "-" + i ;
            Boolean bo = false;
            for (int j = 0; j < list.size(); j++) {
                CountVo countVo = list.get(j);
                String mon = month + "月" + Integer.valueOf(countVo.getDate()) + "日";
                String mon = month + "-" + Integer.valueOf(countVo.getDate());
                if(mon.equals(d)){
                    bo = true;
                    vo.setDate(mon);