| | |
| | | // 读取dat数据 |
| | | commonService.readDatData(); |
| | | |
| | | // xlsReportService.createDayReport(); |
| | | // xlsReportService.createWeekReport(); |
| | | // xlsReportService.createMonthReport(); |
| | | |
| | | //test(); |
| | | logger.info("***************** 系统启动完毕 *****************" + "\n"); |
| | | test(); |
| | | } |
| | | |
| | | private void test() { |
| | | //task.corpReserveDataSync(); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MONTH, 5); |
| | | calendar.set(Calendar.DAY_OF_MONTH, 8); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 16); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | |
| | | //warningAnalyseService.warningOperationStorage(calendar.getTime()); |
| | | |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.set(Calendar.MONTH, 6); |
| | | cal.set(Calendar.DAY_OF_MONTH, 25); |
| | | cal.set(Calendar.HOUR_OF_DAY, 14); |
| | | cal.set(Calendar.MINUTE, 0); |
| | | cal.set(Calendar.SECOND, 0); |
| | | cal.set(Calendar.MILLISECOND, 0); |
| | | |
| | | xlsReportService.createDayReport(cal.getTime()); |
| | | // xlsReportService.createWeekReport(); |
| | | // xlsReportService.createMonthReport(); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 查询日均值 |
| | | */ |
| | | double selectDayAvg(@Param("time") String time, @Param("name") String name); |
| | | Double selectDayAvg(@Param("time") String time, @Param("name") String name); |
| | | |
| | | /** |
| | | * 查询累计值 |
| | | */ |
| | | double selectAccumulate(@Param("start") Integer start, @Param("end") Integer end, @Param("name") String name); |
| | | Double selectAccumulate(@Param("start") Integer start, @Param("end") Integer end, @Param("name") String name); |
| | | |
| | | /** |
| | | * 查询年累计值 |
| | | */ |
| | | double selectYearAccumulate(@Param("time") String time, @Param("name") String name); |
| | | Double selectYearAccumulate(@Param("time") String time, @Param("name") String name); |
| | | |
| | | /** |
| | | * 根据时间查询溯源 |
| | |
| | | public void createDayReport(Date date) { |
| | | try { |
| | | Date yesterday = DateUtils.getAPeriodOfTime(date, -1, Calendar.DATE); |
| | | String yyyy = DateUtils.parseDateToStr(DateUtils.YYYY, yesterday); |
| | | String yyyymmdd = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, yesterday); |
| | | String yyyy_mm_dd = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, yesterday); |
| | | Integer start = Integer.parseInt(yyyy + "0101"); |
| | | Integer end = Integer.parseInt(yyyymmdd); |
| | | String lastYear = DateUtils.parseDateToStr(DateUtils.YYYY, DateUtils.lastYear(yesterday)); |
| | | String yyyy = DateUtils.parseDateToStr(DateUtils.YYYY, yesterday); // 2023 |
| | | String yyyymmdd = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, yesterday); // 20230724 |
| | | String yyyy_mm_dd = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, yesterday); // 2023-07-24 |
| | | Integer start = Integer.parseInt(yyyy + "010100"); // 2023010100 |
| | | Integer end = Integer.parseInt(yyyymmdd + "23"); // 2023072423 |
| | | String lastYear = DateUtils.parseDateToStr(DateUtils.YYYY, DateUtils.lastYear(yesterday)); // 2022 |
| | | |
| | | List<DayExcel> list = new ArrayList<>(); |
| | | for (int i = 1; i < 47; i++) { |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yssh.mapper.QxshMapper"> |
| | | <mapper namespace="com.yssh.mapper.XlsReportMapper"> |
| | | <!-- 分页查询报告 --> |
| | | <select id="selectReportByPage" resultType="com.yssh.entity.xls.XlsReport"> |
| | | select * |