fei.wang
2025-03-17 e8dc9598b482830ca7fa60c6869687a32448137d
src/main/java/com/hxzkmonitor/service/impl/TbEvrydayweiyi2024ServiceImpl.java
@@ -20,6 +20,7 @@
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@@ -56,7 +57,7 @@
    public IPage<TbEvrydayweiyi2024> geteveryday(Page page, String keyword, String username, String time, String isdp) {
        Calendar calendar = Calendar.getInstance();
        String datey = DateUtil.formatDate4(calendar.getTime(), "yyyy-MM-dd");
        int i1 = (Integer.parseInt(datey.split("-")[2])) - 1;
        int i1 = (Integer.parseInt(datey.split("-")[2])-1) ;
        String s = datey.split("-")[0] + "-" + datey.split("-")[1] + "-" + i1;
        QueryWrapper queryWrapper2 = new QueryWrapper<>();
@@ -145,7 +146,7 @@
    public List<TbEvrydayweiyi2024> geteverydaydp(String username) {
        Calendar calendar = Calendar.getInstance();
        String datey = DateUtil.formatDate4(calendar.getTime(), "yyyy-MM-dd");
        int i1 = (Integer.parseInt(datey.split("-")[2])) - 1;
        int i1 = (Integer.parseInt(datey.split("-")[2])-1) ;
        String s = datey.split("-")[0] + "-" + datey.split("-")[1] + "-" + i1;
        QueryWrapper queryWrapper2 = new QueryWrapper<>();
@@ -337,6 +338,61 @@
    }
    @Override
    public TbEvrydayweiyi2024 getweiyi( String tagid) {
        Calendar calendar = Calendar.getInstance();
        String datey = DateUtil.formatDate4(calendar.getTime(), "yyyy");
//        Calendar date = Calendar.getInstance();
//        String date1 = DateUtil.formatDate(calendar.getTime(), "yyyy-MM-dd");
        Date date = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
//        Calendar calendar = Calendar.getInstance();
        String dated = DateUtil.formatDate4(calendar.getTime(), "yyyy-MM-dd");
        int i1 = (Integer.parseInt(dated.split("-")[2])-1) ;
        String s = dated.split("-")[0] + "-" + dated.split("-")[1] + "-" + i1;
            return tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid, s);
    }
    @Override
    public Map<String, Object> gettagidweiyi( String tagid) {
//        List<TbEvrydayweiyi2024> tbEvrydayweiyi2024s = new ArrayList<>();
        Map<String, Object> result = new HashMap<>();
        String[] hd = new String[tagid.split(",").length];
        String[] ed = new String[tagid.split(",").length];
        String[] nd = new String[tagid.split(",").length];
        String[] x = new String[tagid.split(",").length];
        for (int i = 0; i < tagid.split(",").length; i++) {
            Calendar calendar = Calendar.getInstance();
            String datey = DateUtil.formatDate4(calendar.getTime(), "yyyy");
//        Calendar date = Calendar.getInstance();
//        String date1 = DateUtil.formatDate(calendar.getTime(), "yyyy-MM-dd");
            Date date = new Date();
            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
//        Calendar calendar = Calendar.getInstance();
            String dated = DateUtil.formatDate4(calendar.getTime(), "yyyy-MM-dd");
            int i1 = (Integer.parseInt(dated.split("-")[2])-1) ;
            String s = dated.split("-")[0] + "-" + dated.split("-")[1] + "-" + i1;
            if (tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.split(",")[i], s)!=null){
                hd[i] = tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.split(",")[i], s).getTdmm();
                ed[i] = tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.split(",")[i], s).getEdmm();
                nd[i] =tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.split(",")[i], s).getNdmm();
                x[i] = tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.split(",")[i], s).getFilename();
            }else{
                hd[i] = "0";
                ed[i] = "0";
                nd[i] ="0";
                x[i] = "0";
            }
        }
        result.put("ed", ed);
        result.put("nd", nd);
        result.put("hd", hd);
//            result.put("x", x);
        return result;
    }
    @Override
    public IPage<TbEvrydayweiyi2024> searcheveryday(Page page, String keyword, String username, String time) {
@@ -360,7 +416,7 @@
                }
            }
            if (time != null) {
                int i1 = (Integer.parseInt(time.split("-")[2])) - 1;
                int i1 = (Integer.parseInt(time.split("-")[2])-1) ;
                String s = time.split("-")[0] + "-" + time.split("-")[1] + "-" + i1;
                queryWrapper.eq("filename", s);
@@ -409,7 +465,7 @@
                    }
                }
                if (time != null) {
                    int i1 = (Integer.parseInt(time.split("-")[2])) - 1;
                    int i1 = (Integer.parseInt(time.split("-")[2])-1) ;
                    String s = time.split("-")[0] + "-" + time.split("-")[1] + "-" + i1;
                    queryWrapper1.eq("filename", s);
                }