fei.wang
2025-04-18 8c63366bfaa0b5f6e0db00abbabe0e770fc0d8dc
src/main/java/com/hxzkmonitor/service/impl/TbEquipmentServiceImpl.java
@@ -76,6 +76,27 @@
                        tagid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
//                tagid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s) != null) {
                        tagid.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getEd());
                        tagid.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getNd());
                        tagid.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        tagid.getRecords().get(i).setEd("0");
                        tagid.getRecords().get(i).setNd("0");
                        tagid.getRecords().get(i).setTd("0");
                    }
                }
                return tagid;
            } else if (anchorname1.size() > 0) {
@@ -88,6 +109,27 @@
                        anchorname.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
//                anchorname.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s) != null) {
                        anchorname.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getEd());
                        anchorname.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getNd());
                        anchorname.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        anchorname.getRecords().get(i).setEd("0");
                        anchorname.getRecords().get(i).setNd("0");
                        anchorname.getRecords().get(i).setTd("0");
                    }
                }
                return anchorname;
@@ -101,6 +143,27 @@
                        cid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
//                cid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s) != null) {
                        cid.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getEd());
                        cid.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getNd());
                        cid.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        cid.getRecords().get(i).setEd("0");
                        cid.getRecords().get(i).setNd("0");
                        cid.getRecords().get(i).setTd("0");
                    }
                }
                return cid;
@@ -136,6 +199,27 @@
                        tagid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
//                tagid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s) != null) {
                        tagid.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getEd());
                        tagid.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getNd());
                        tagid.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        tagid.getRecords().get(i).setEd("0");
                        tagid.getRecords().get(i).setNd("0");
                        tagid.getRecords().get(i).setTd("0");
                    }
                }
                return tagid;
            } else if (anchorname1.size() > 0) {
@@ -148,6 +232,27 @@
                        anchorname.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
//                anchorname.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s) != null) {
                        anchorname.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getEd());
                        anchorname.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getNd());
                        anchorname.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        anchorname.getRecords().get(i).setEd("0");
                        anchorname.getRecords().get(i).setNd("0");
                        anchorname.getRecords().get(i).setTd("0");
                    }
                }
                return anchorname;
@@ -161,6 +266,27 @@
                        cid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
//                cid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s) != null) {
                        cid.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getEd());
                        cid.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getNd());
                        cid.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        cid.getRecords().get(i).setEd("0");
                        cid.getRecords().get(i).setNd("0");
                        cid.getRecords().get(i).setTd("0");
                    }
                }
                return cid;
@@ -215,6 +341,27 @@
                        anchorname.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
//                anchorname.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s) != null) {
                        anchorname.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getEd());
                        anchorname.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getNd());
                        anchorname.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        anchorname.getRecords().get(i).setEd("0");
                        anchorname.getRecords().get(i).setNd("0");
                        anchorname.getRecords().get(i).setTd("0");
                    }
                }
                return anchorname;
@@ -227,6 +374,28 @@
                    if (tbCompany != null) {
                        cid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s) != null) {
                        cid.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getEd());
                        cid.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getNd());
                        cid.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        cid.getRecords().get(i).setEd("0");
                        cid.getRecords().get(i).setNd("0");
                        cid.getRecords().get(i).setTd("0");
                    }
//                cid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                }
                return cid;
@@ -262,6 +431,28 @@
                    if (tbCompany != null) {
                        tagid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s) != null) {
                        tagid.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getEd());
                        tagid.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getNd());
                        tagid.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, tagid.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        tagid.getRecords().get(i).setEd("0");
                        tagid.getRecords().get(i).setNd("0");
                        tagid.getRecords().get(i).setTd("0");
                    }
//                tagid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                }
                return tagid;
@@ -274,6 +465,28 @@
                    if (tbCompany != null) {
                        anchorname.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s) != null) {
                        anchorname.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getEd());
                        anchorname.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getNd());
                        anchorname.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, anchorname.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        anchorname.getRecords().get(i).setEd("0");
                        anchorname.getRecords().get(i).setNd("0");
                        anchorname.getRecords().get(i).setTd("0");
                    }
//                anchorname.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                }
                return anchorname;
@@ -287,6 +500,28 @@
                    if (tbCompany != null) {
                        cid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                    }
                    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;
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                    if (tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s) != null) {
                        cid.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getEd());
                        cid.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getNd());
                        cid.getRecords().get(i).setTd(tbEvrydayweiyi2024Mapper.getweiyi(datey, cid.getRecords().get(i).getTagid(), s).getTd());
                    } else {
                        cid.getRecords().get(i).setEd("0");
                        cid.getRecords().get(i).setNd("0");
                        cid.getRecords().get(i).setTd("0");
                    }
//                cid.getRecords().get(i).setCompany(tbCompany.getCompanyname());
                }
                return cid;
@@ -357,7 +592,7 @@
                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;
                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
//                System.out.println(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s));
                if (tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s) != null) {
                    userPage.getRecords().get(i).setEd(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s).getEd());
                    userPage.getRecords().get(i).setNd(tbEvrydayweiyi2024Mapper.getweiyi(datey, userPage.getRecords().get(i).getTagid(), s).getNd());
@@ -562,8 +797,8 @@
            queryWrapper.eq("companyid", tbUser.getCsname());
        }
        queryWrapper.eq("type", 1);
        queryWrapper.orderByDesc("jxtime");
        queryWrapper.last("LIMIT 20");
//        queryWrapper.orderByDesc("jxtime");
//        queryWrapper.last("LIMIT 20");
        return baseMapper.selectList(queryWrapper);
    }