燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2024-11-13 2f55cebbad3dea187a5f91d16ec80a9677dab699
1
已修改59个文件
668 ■■■■■ 文件已修改
src/main/java/com/yssh/Application.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/config/CorsConfig.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/config/Knife4jConfig.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/config/ScheduleConfig.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/config/ThreadPoolConfig.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/config/WebSocketConfig.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/controller/EmissionController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/controller/LocationController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/controller/SuYuanController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/controller/WarningAnalyseController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/controller/WeatherController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/Coordinate.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/DictRecord.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/Location.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/Qxsh.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/Report.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/SuYuan700.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/SuYuanFast.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/Weather.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/xls/DayExcel.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/xls/ExcelHead.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/xls/MonthExcel.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/xls/WeekExcel.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/xls/XlsReport.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/CommonMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/DictRecordMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/EmissionMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/LocationMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/QxshMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/ThuAccuracyMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/VocValsMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/WeatherMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/XlsReportMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/CommonService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/DictRecordService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/EmailService.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/EmissionService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/LocationService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/SocketService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/SuYuanService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/VocValsService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/WeatherService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/XlsReportService.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/AjaxResult.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/CacheUtils.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/CalculateUtils.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/CommonConstant.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/DateUtils.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/ExcelUtils.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/FileUtils.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/GisUtil.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/HttpStatus.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/Result.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/ServletInitializer.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/SpringUtils.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/StringUtils.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/VocParser.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/WebUtils.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ys.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/Application.java
@@ -7,8 +7,6 @@
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
 * 应用程序
 * @author WWW
 * 排除Security:, exclude = {SecurityAutoConfiguration.class, SecurityFilterAutoConfiguration.class}
 *
 * jar -> war:继承 SpringBootServletInitializer,实现 configure 函数
src/main/java/com/yssh/config/CorsConfig.java
@@ -11,20 +11,11 @@
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
/**
 * @author wMeng
 * @ClassName CorsConfig
 * @Description 跨域配置
 * @date 2022/10/31 16:42
 * @Version 1.0
 */
@Configuration
public class CorsConfig extends WebMvcConfigurationSupport {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // 设置访问路径为 “/” 跳转到指定页面
        registry.addViewController("/").setViewName("redirect:/doc.html");
        // 设置为最高优先级
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }
@@ -40,7 +31,6 @@
    
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //设置静态资源映射
        registry.addResourceHandler("/backend/**").addResourceLocations("classpath:/backend/");
        registry.addResourceHandler("/front/**").addResourceLocations("classpath:/front/");
        
src/main/java/com/yssh/config/Knife4jConfig.java
@@ -16,13 +16,6 @@
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
/**
 * @author wMeng
 * @ClassName SwaggerConfig
 * @Description TODO
 * @date 2022/10/31 18:55
 * @Version 1.0
 */
@Configuration
@EnableKnife4j
public class Knife4jConfig {
@@ -30,9 +23,6 @@
    @Value("${knife4j.enabled}")
    private boolean enabled;
    /**
     * 设置请求的统一前缀
     */
    @Value("${knife4j.pathMapping}")
    private String pathMapping;
@@ -61,7 +51,6 @@
    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                //描述字段支持Markdown语法
                .description("我的接口测试文档")
                .contact(new Contact("张腾飞", "http://127.0.0.1:9001/doc.html", "893732661@qq.com"))
                .version("2.0.0")
src/main/java/com/yssh/config/ScheduleConfig.java
@@ -149,12 +149,12 @@
            //String md5 = FileUtils.getFileMd5(filePath);
            //if (null != md5 && md5List.contains(md5)) {
            //    continue; // csv已入库
            //    continue;
            //}
            int count = vocValsService.countByTime(time);
            if (count > 0) {
                //vocValsService.deleteByTime(time); // 删除已入库
                //vocValsService.deleteByTime(time);
                continue;
            }
@@ -186,12 +186,12 @@
            logger.info(file.getAbsolutePath() + " is not exist !");
            return;
        }
        //创建表
        String newTableName = TableStrategy.getTableStrategy(time);
        suYuanService.createNewTable(newTableName);
        dictRecordService.insertDictRecord(new DictRecord(1L, newTableName, Long.parseLong(time), ""));
        EasyCsv.read(filePath, SuYuan.class, new CsvParser(suYuanService, time)).doRead();
        //计算预警/报警,并且进行入库操作
        try {
            Thread.sleep(60 * 1000);
        } catch (InterruptedException e) {
@@ -201,9 +201,6 @@
        warningAnalyseService.warningOperationStorage(date);
    }
    /**
     * 创建日报:每日0时1分
     */
    @Scheduled(cron = "0 1 0 * * ?")
    public void createDayReport() {
        Calendar calendar = getCalendar(1);
@@ -218,9 +215,6 @@
        }
    }
    /**
     * 创建周报:每周一0时5分
     */
    @Scheduled(cron = "0 5 0 ? * MON")
    public void createWeekReport() {
        Calendar calendar = getCalendar(7 * 24);
@@ -235,9 +229,6 @@
        }
    }
    /**
     * 创建月报:每月1日0时9分
     */
    @Scheduled(cron = "0 9 0 1 * ?")
    public void createMonthReport() {
        Calendar calendar = Calendar.getInstance();
src/main/java/com/yssh/config/ThreadPoolConfig.java
@@ -7,27 +7,17 @@
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/**
 * 线程池配置
 *
 * @author tam
 **/
@Configuration
@EnableAsync
public class ThreadPoolConfig {
    // 核心线程池大小
    private int corePoolSize = 50;
    // 最大可创建的线程数
    private int maxPoolSize = 200;
    // 队列最大长度
    private int queueCapacity = 1000;
    // 线程池维护线程所允许的空闲时间
    private int keepAliveSeconds = 300;
    //配置线程池中的线程的名称前缀
    private String threadNamePrefix = "async-importDB-";
    @Bean(name = "threadPoolTaskExecutor")
@@ -38,9 +28,7 @@
        executor.setQueueCapacity(queueCapacity);
        executor.setKeepAliveSeconds(keepAliveSeconds);
        executor.setThreadNamePrefix(threadNamePrefix);
        // 线程池对拒绝任务(无线程可用)的处理策略
        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
        return executor;
    }
}
src/main/java/com/yssh/config/WebSocketConfig.java
@@ -4,15 +4,8 @@
import org.springframework.stereotype.Component;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
 * WebSocket配置类
 * @author WWW
 */
@Component
public class WebSocketConfig {
    /**
     * 自动注册使用@ServerEndpoint
     */
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
src/main/java/com/yssh/controller/EmissionController.java
@@ -20,13 +20,6 @@
import javax.annotation.Resource;
/**
 * @author lishijia
 * @ClassName YsshPfshController
 * @Description TODO
 * @date 2022/11/24 14:44
 * @Version 1.0
 */
@Api(tags="排放点")
@RestController
@RequestMapping("/emission")
src/main/java/com/yssh/controller/LocationController.java
@@ -21,13 +21,6 @@
import javax.annotation.Resource;
/**
 * @author wMeng
 * @ClassName YsshLocationController
 * @Description YsshLocationController
 * @date 2022/10/30 13:21
 * @Version 1.0
 */
@Api(tags="厂区热点点位")
@RestController
@RequestMapping("/location")
src/main/java/com/yssh/controller/SuYuanController.java
@@ -27,13 +27,6 @@
import javax.annotation.Resource;
/**
 * @author lishijia
 * @ClassName Yssh2dreliController
 * @Description Yssh2dreliController
 * @date 2022/12/3 21:21
 * @Version 1.0
 */
@Api(tags="溯源信息")
@RestController
@RequestMapping("/suYuan")
src/main/java/com/yssh/controller/WarningAnalyseController.java
@@ -1,6 +1,5 @@
package com.yssh.controller;
import com.yssh.entity.Qxsh;
import com.yssh.entity.Report;
import com.yssh.utils.CacheUtils;
import com.yssh.utils.DateUtils;
src/main/java/com/yssh/controller/WeatherController.java
@@ -1,6 +1,5 @@
package com.yssh.controller;
import com.yssh.entity.Location;
import com.yssh.entity.Weather;
import com.yssh.service.WeatherService;
import com.yssh.utils.CacheUtils;
@@ -15,18 +14,10 @@
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
 * @author wMeng
 * @ClassName YsshWeatherController
 * @Description TODO
 * @date 2022/10/30 13:21
 * @Version 1.0
 */
@Api(tags="天气")
@RestController
@RequestMapping("/weather")
src/main/java/com/yssh/entity/Coordinate.java
@@ -1,10 +1,5 @@
package com.yssh.entity;
/**
 * 坐标
 * @author WWW
 * @date 2023-06-18
 */
public class Coordinate {
    private double x;
src/main/java/com/yssh/entity/DictRecord.java
@@ -8,13 +8,6 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
/**
 * 字典记录对象 yssh_dict_record
 *
 * @author xingjinshuang@smartearth.cn
 * @date 2023-02-06
 */
@ToString
@Data
public class DictRecord implements Serializable {
src/main/java/com/yssh/entity/Location.java
@@ -6,12 +6,6 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * 厂区热点点位
 * @author wMeng
 * @date 2022/10/30 13:16
 * @version 1.0
 */
@Data
@ApiModel(value = "厂区热点点位",description = "厂区热点点位")
public class Location implements Serializable {
src/main/java/com/yssh/entity/Qxsh.java
@@ -4,11 +4,6 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author WWW
 * @date 2023-05-18
 * qxsh
 */
@Data
@ApiModel(value = "Qxsh",description = "Qxsh")
public class Qxsh {
src/main/java/com/yssh/entity/Report.java
@@ -3,11 +3,6 @@
import com.yssh.utils.CalculateUtils;
import io.swagger.annotations.ApiModelProperty;
/**
 * 报告
 * @author WWW
 * @date 2023-06-18
 */
public class Report {
    @ApiModelProperty(value = "溯源ID")
    private String id;
src/main/java/com/yssh/entity/SuYuan700.java
@@ -7,11 +7,6 @@
import java.io.Serializable;
import java.util.Date;
/**
 * 溯源700表
 * @author www
 * @date 2023-06-23
 */
@Data
public class SuYuan700 implements Serializable {
    private static final long serialVersionUID = 2023062302487367361L;
src/main/java/com/yssh/entity/SuYuanFast.java
@@ -6,11 +6,6 @@
import java.util.Date;
/**
 * 快速溯源表
 * @author WWW
 * @date 2023-11-05
 */
@Data
public class SuYuanFast {
    private static final long serialVersionUID = 2023110510570000000L;
src/main/java/com/yssh/entity/Weather.java
@@ -4,13 +4,6 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * @author wMeng
 * @ClassName YsshWeather
 * @Description 天气数据
 * @date 2022/10/30 13:18
 * @Version 1.0
 */
@Data
@ApiModel(value = "天气数据",description = "天气数据")
public class Weather {
src/main/java/com/yssh/entity/xls/DayExcel.java
@@ -1,10 +1,5 @@
package com.yssh.entity.xls;
/**
 * 日报Excel
 * @author WWW
 * @date 2023-08-08
 */
public class DayExcel {
    /**
     * 日均值
src/main/java/com/yssh/entity/xls/ExcelHead.java
@@ -5,25 +5,16 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
 * Excel标题头类
 * @author WWW
 * @date 2023-08-08
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcelHead {
    /**
     * Excel头行数
     *
     * @return 头行数
     */
    int headRows() default 1;
    /**
     * 排除的Sheet名称(多个用逗号隔开)
     *
     * @return
     */
    String excludeSheets() default "";
}
src/main/java/com/yssh/entity/xls/MonthExcel.java
@@ -1,10 +1,5 @@
package com.yssh.entity.xls;
/**
 * 月报Excel
 * @author WWW
 * @date 2023-08-08
 */
public class MonthExcel {
    /**
     * 上月
@@ -64,21 +59,6 @@
    public MonthExcel() {
    }
    /**
     * 月报Excel
     *
     * @param sy   上月
     * @param yhb  月环比
     * @param ytq  月同期
     * @param ytb  月同比
     * @param lj   累计
     * @param ljtb 累计同比
     * @param qyn  较前一年均值变化幅度
     * @param ys   受影响因素及原因
     * @param fs   风速
     * @param fx   风向
     * @param wd   温度
     */
    public MonthExcel(String sy, String yhb, String ytq, String ytb, String lj, String ljtb, String qyn, String ys, String fs, String fx, String wd) {
        this.sy = sy;
        this.yhb = yhb;
src/main/java/com/yssh/entity/xls/WeekExcel.java
@@ -1,10 +1,5 @@
package com.yssh.entity.xls;
/**
 * 周报Excel
 * @author WWW
 * @date 2023-08-08
 */
public class WeekExcel {
    /**
     * 上周
@@ -64,21 +59,6 @@
    public WeekExcel() {
    }
    /**
     * 周报Excel
     *
     * @param sz   上周
     * @param zhb  周环比
     * @param ztq  周同期
     * @param ztb  周同比
     * @param lj   累计
     * @param ljtb 累计同比
     * @param syn  较上一年度变化幅度
     * @param ys   受影响因素及原因
     * @param fs   风速
     * @param fx   风向
     * @param wd   温度
     */
    public WeekExcel(String sz, String zhb, String ztq, String ztb, String lj, String ljtb, String syn, String ys, String fs, String fx, String wd) {
        this.sz = sz;
        this.zhb = zhb;
src/main/java/com/yssh/entity/xls/XlsReport.java
@@ -4,11 +4,6 @@
import java.util.Date;
/**
 * Excel报告实体类
 * @author WWW
 * @date 2023-08-09
 */
public class XlsReport {
    @ApiModelProperty(value = "主键")
    private Long id;
src/main/java/com/yssh/mapper/CommonMapper.java
@@ -5,15 +5,8 @@
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @ClassName: CommonMapper
 * @Description: 通用的mapper
 * @author zhangtengfei
 * @date 2023年2月27日下午2:27:55
 */
@Mapper
public interface CommonMapper{
    /**
     * 使用information_schema检查表是否存在
     * @param tableSchema
src/main/java/com/yssh/mapper/DictRecordMapper.java
@@ -6,15 +6,8 @@
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * 字典记录Mapper接口
 *
 * @author xingjinshuang@smartearth.cn
 * @date 2023-02-06
 */
@Mapper
public interface DictRecordMapper {
    /**
     * 查询字典记录列表
     * @param dictRecord 字典记录
src/main/java/com/yssh/mapper/EmissionMapper.java
@@ -6,13 +6,6 @@
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @author wMeng
 * @ClassName YsshQxshMapper
 * @Description TODO
 * @date 2022/10/31 14:45
 * @Version 1.0
 */
@Mapper
public interface EmissionMapper {
    List<Emission> query(@Param("name") String name);
src/main/java/com/yssh/mapper/LocationMapper.java
@@ -6,11 +6,6 @@
import java.util.List;
/**
 * @author wMeng
 * @date 2022/10/30 13:37
 * @version 1.0
 */
@Mapper
public interface LocationMapper {
    List<Location> query(@Param("name") String name, @Param("type") String type);
src/main/java/com/yssh/mapper/QxshMapper.java
@@ -8,11 +8,6 @@
import java.util.List;
import java.util.Map;
/**
 * @author WWW
 * @date 2023-05-18
 * QxshMapper
 */
@Mapper
public interface QxshMapper {
    List<SuYuanMonitorData> getNewMonitorData(String name, String start, String end);
src/main/java/com/yssh/mapper/ThuAccuracyMapper.java
@@ -9,7 +9,6 @@
@Mapper
public interface ThuAccuracyMapper {
    //查询过去七天精确平均值统计
    public Double selectSevenDayAccuracyAvg(Long beginTime);
    
src/main/java/com/yssh/mapper/VocValsMapper.java
@@ -7,11 +7,6 @@
import java.util.List;
/**
 * Voc值Mapper接口
 * @author WWW
 * @date 2023-06-05
 */
@Mapper
public interface VocValsMapper {
    /**
src/main/java/com/yssh/mapper/WeatherMapper.java
@@ -6,13 +6,6 @@
import java.util.List;
/**
 * @author wMeng
 * @ClassName YsshWeatherMapper
 * @Description TODO
 * @date 2022/10/30 14:16
 * @Version 1.0
 */
@Mapper
public interface WeatherMapper {
    List<Weather> query(@Param("begin") String begin, @Param("end") String end);
src/main/java/com/yssh/mapper/XlsReportMapper.java
@@ -7,11 +7,6 @@
import java.util.List;
/**
 * XlsReportMapper
 * @author WWW
 * @date 2023-08-09
 */
@Mapper
public interface XlsReportMapper {
    /**
src/main/java/com/yssh/service/CommonService.java
@@ -37,9 +37,6 @@
    @Resource
    protected DatFilePathConfig datFilePathConfig;
    /**
     * 检查表是否存在
     */
    public boolean checkTableExists(String tableName) {
        try {
            Integer count = commonMapper.checkTableExistsWithSchema(TABLE_SCHEMA, tableName);
src/main/java/com/yssh/service/DictRecordService.java
@@ -12,11 +12,6 @@
import javax.annotation.Resource;
/**
 * 字典记录Service业务层处理
 * @author xingjinshuang@smartearth.cn
 * @date 2023-02-06
 */
@Service
public class DictRecordService {
    @Resource
src/main/java/com/yssh/service/EmailService.java
@@ -15,12 +15,6 @@
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * 邮件服务类
 *
 * @author www
 * @date 2024-03-21
 */
@Service
public class EmailService {
    @Value("${email.userName}")
@@ -86,14 +80,13 @@
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
    public Session createSession() {
        // 创建一个配置文件,并保存
        Properties props = new Properties();
        // SMTP服务器连接信息:126—smtp.126.com,163—smtp.163.com,qq-smtp.qq.com"
        props.put("mail.smtp.host", smtpHost); // SMTP主机名
        props.put("mail.smtp.port", smtpPort); // 主机端口号:126—25,163—645,qq-587
        props.put("mail.smtp.auth", smtpAuth); // 是否需要用户认证
        props.put("mail.smtp.starttls.enale", smtpTls); // 启用TlS加密
        // 126—smtp.126.com,163—smtp.163.com,qq-smtp.qq.com"
        props.put("mail.smtp.host", smtpHost);
        props.put("mail.smtp.port", smtpPort);
        props.put("mail.smtp.auth", smtpAuth);
        props.put("mail.smtp.starttls.enale", smtpTls);
        Session session = Session.getInstance(props, new Authenticator() {
            @Override
@@ -102,7 +95,6 @@
            }
        });
        // 控制台打印调试信息
        session.setDebug(debug);
        return session;
@@ -114,10 +106,8 @@
                return null;
            }
            // 创建Session会话
            Session session = createSession();
            // 创建邮件对象
            MimeMessage message = new MimeMessage(session);
            message.setSubject(title);
            message.setText(text);
@@ -133,7 +123,6 @@
                message.setRecipients(Message.RecipientType.CC, ias);
            }
            // 发送
            Transport.send(message);
            return true;
src/main/java/com/yssh/service/EmissionService.java
@@ -9,13 +9,6 @@
import javax.annotation.Resource;
/**
 * @author wMeng
 * @ClassName YsshQxshServiceImpl
 * @Description TODO
 * @date 2022/10/31 14:45
 * @Version 1.0
 */
@Service
public class EmissionService {
    @Resource
src/main/java/com/yssh/service/LocationService.java
@@ -9,11 +9,6 @@
import java.util.ArrayList;
import java.util.List;
/**
 * @author wMeng
 * @date 2022/10/30 13:25
 * @version 1.0
 */
@Service
public class LocationService {
    @Resource
src/main/java/com/yssh/service/SocketService.java
@@ -10,54 +10,32 @@
import java.io.PrintWriter;
import java.net.Socket;
/**
 * Socket服务类
 * @author WWW
 * @date 2023-11-06
 */
@Service
public class SocketService {
    /**
     * Socket的IP
     */
    @Value("${socket.ip}")
    private String ip;
    /**
     * Socket的端口
     */
    @Value("${socket.port}")
    private int port;
    /**
     * Socket的端口
     */
    @Value("${cmd.runPy}")
    private String runPy;
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    /**
     * 发送消息
     */
    public String sendMsg(String msg) throws Exception {
        try {
            // 创建Socket对象,指定服务端的IP地址和端口号
            Socket socket = new Socket(ip, port);
            // 获取输入流和输出流 输入流和输出流是通过socket对象来进行数据传输的。
            BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
            // 将用户输入的信息发送给服务端
            out.println(msg);
            // 接收服务端的响应并打印
            String rs = in.readLine();
            socket.close();
            // 执行Python脚本
            exec(runPy);
            return rs;
@@ -67,11 +45,6 @@
        }
    }
    /**
     * 执行命令
     *
     * @param cmd 命令
     */
    public void exec(String cmd) {
        try {
            Process process = Runtime.getRuntime().exec(cmd);
src/main/java/com/yssh/service/SuYuanService.java
@@ -59,7 +59,6 @@
    //@Transactional
    @Async("threadPoolTaskExecutor")
    public void insertSuYuanDatasAsync(List<SuYuan> lists, String time) throws Exception {
        //插入数据
        List<List<SuYuan>> list = Lists.partition(lists, AsyncService.BATCH_INSERT_NUMBER);
        CountDownLatch countDownLatch = new CountDownLatch(list.size());
        for (List<SuYuan> corpReserveList : list) {
@@ -365,9 +364,6 @@
        return suYuanId;
    }
    /**
     * 根据ID查询快速溯源
     */
    public List<SuYuanFast> selectFastById(String id, Date date) {
        String time = DateUtils.getYyyyMmDdHhMmSs(date);
src/main/java/com/yssh/service/VocValsService.java
@@ -72,10 +72,8 @@
    private void executeAsync(List<VocVals> corpList, CountDownLatch countDownLatch) {
        try {
            // 异步线程要做的事情
            vocValsMapper.inserts(corpList);
        } finally {
            // 很关键, 无论上面程序是否异常必须执行countDown,否则await无法释放
            countDownLatch.countDown();
        }
    }
src/main/java/com/yssh/service/WeatherService.java
@@ -7,13 +7,6 @@
import javax.annotation.Resource;
import java.util.List;
/**
 * @author wMeng
 * @ClassName YsshWeatherServiceImpl
 * @Description TODO
 * @date 2022/10/30 14:11
 * @Version 1.0
 */
@Service
public class WeatherService {
    @Resource
src/main/java/com/yssh/service/XlsReportService.java
@@ -23,11 +23,6 @@
import java.io.IOException;
import java.util.*;
/**
 * Excel导出服务类
 * @author WWW
 * @author 2023-08-05
 */
@Service
public class XlsReportService {
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -62,9 +57,6 @@
    @Value("${report.templates}")
    private String templates;
    /**
     * 获取导出路径
     */
    private String getExpPath(String type) {
        String path = reportPath + File.separator + type;
@@ -76,9 +68,6 @@
        return path;
    }
    /**
     * 获取Excel模板
     */
    private String getXslTemplate(String type) throws IOException {
        //ClassPathResource resource = new ClassPathResource(String.format("templates/%s.xlsx", type));
        //return resource.exists() ? resource.getFile().getPath() : null;
@@ -86,9 +75,6 @@
        return String.format(templates + File.separator + type + ".xlsx");
    }
    /**
     * 创建Excel
     */
    private <T> void createExcel(String source, String target, List<T> list) {
        Map<String, List<T>> map = new HashMap<>();
        map.put("data", list);
@@ -96,25 +82,16 @@
        ExcelUtils.writeToTemplate(source, target, map);
    }
    /**
     * 获取字符串日期
     */
    private String getStrDate(String type, Date date) {
        return DateUtils.parseDateToStr("month".equals(type) ? DateUtils.YYYYMM : DateUtils.YYYYMMDD, date);
    }
    /**
     * 获取目标文件
     */
    private String getTarget(String type, Date date) {
        String strData = getStrDate(type, date);
        return String.format("%s\\%s.xlsx", getExpPath(type), strData);
    }
    /**
     * Excel是/否存在
     */
    private boolean xlsExists(String type, Date date) {
        String target = getTarget(type, date);
        File f = new File(target);
@@ -122,9 +99,6 @@
        return f.exists() && !f.isDirectory();
    }
    /**
     * 创建Excel
     */
    private <T> String createExcel(String type, Date date, List<T> list) throws Exception {
        String source = getXslTemplate(type);
        String strData = getStrDate(type, date);
@@ -137,9 +111,6 @@
        return String.format("%s\\%s.xlsx", type, strData);
    }
    /**
     * 记录是/否存在
     */
    private boolean recordExists(String type, Date date) {
        String name = String.format("%s.xlsx", getStrDate(type, date));
        int rows = mapper.reportExists(type, name);
@@ -147,9 +118,6 @@
        return rows > 0;
    }
    /**
     * 保存结果
     */
    private <T> void saveResult(String type, Date date, List<T> list) throws Exception {
        String filePath = createExcel(type, date, list);
        if (recordExists(type, date)) return;
@@ -166,9 +134,6 @@
        mapper.insertReport(xls);
    }
    /**
     * 获取受影响因素及原因
     */
    public String getYs(List<SuYuan700> suList) {
        if (null == suList || 0 == suList.size()) return "";
@@ -353,9 +318,6 @@
        }
    }
    /**
     * 根据ID下载
     */
    public void downloadById(Integer id, HttpServletResponse res) {
        XlsReport xlsReport = mapper.selectById(id);
        if (null == xlsReport) return;
src/main/java/com/yssh/utils/AjaxResult.java
@@ -2,12 +2,6 @@
import java.util.HashMap;
/**
 * 操作消息提醒
 *
 * @author xingjinshuang@smartearth.cn
 * @date 2023-02-06
 */
public class AjaxResult extends HashMap<String, Object> {
    private static final long serialVersionUID = 1L;
src/main/java/com/yssh/utils/CacheUtils.java
@@ -63,10 +63,8 @@
            BigInteger bigInt = new BigInteger(1, byteArray);
            // 参数16表示16进制
            String result = bigInt.toString(16);
            // 不足32位高位补零
            while (result.length() < 32) {
                result = "0" + result;
            }
src/main/java/com/yssh/utils/CalculateUtils.java
@@ -12,22 +12,14 @@
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@SuppressWarnings("ALL")
public class CalculateUtils {
    /**
     * 默认地球半径,赤道半径(单位m)
     */
    private final static double EARTH_RADIUS1 = 6371000;
    /**
     * 转化为弧度(rad)
     */
    private static double rad(double d) {
        return d * Math.PI / 180.0;
    }
    /**
     * 计算距离1
     */
    public static double getDistance1(double lon1, double lat1, double lon2, double lat2) {
        double radLat1 = rad(lat1);
        double radLat2 = rad(lat2);
@@ -40,9 +32,6 @@
        return round2(s);
    }
    /**
     * 计算距离2
     */
    public static double getDistance2(double x1, double y1, double x2, double y2) {
        // 84坐标系构造GeodeticCalculator
        GeodeticCalculator geodeticCalculator = new GeodeticCalculator(DefaultGeographicCRS.WGS84);
@@ -59,23 +48,14 @@
        return round2(distance);
    }
    /**
     * 保留2位小数
     */
    public static double round2(double d) {
        return ((long) (d * 100)) / 100D;
    }
    /**
     * 保留6位小数
     */
    public static double round6(double d) {
        return ((long) (d * 1000000)) / 1000000D;
    }
    /**
     * 计算角度
     */
    public static double getAngle(double x1, double y1, double x2, double y2) {
        try {
            CoordinateReferenceSystem crs = CRS.decode("EPSG:4326");
@@ -94,9 +74,6 @@
        }
    }
    /**
     * 计算角度2
     */
    public static double getAngle2(double x1, double y1, double x2, double y2) {
        try {
            DirectPosition2D p1 = new DirectPosition2D(x1, y1);
@@ -114,12 +91,6 @@
        }
    }
    /**
     * 获取坐标
     *
     * @param su
     * @return
     */
    public static Coordinate getCoordinate(DistanceSuYuan su) {
        String[] sirs = su.getId().split("_");
@@ -131,17 +102,6 @@
        return new Coordinate(lon, lat);
    }
    /**
     * 计算经度
     *
     * @param @param  x
     * @param @param  y
     * @param @return 参数
     * @return double 返回类型
     * @throws
     * @Title: getLon
     * @Description: 计算经度
     */
    public static double getLon(int x, int y) {
        double lon = 115.9165227 + 0.000116732 * (x - 0.5) + 0.00000116862 * (y - 0.5);
        if (lon < 115 || lon > 116) {
@@ -151,17 +111,6 @@
        return round6(lon);
    }
    /**
     * 计算维度
     *
     * @param @param  x
     * @param @param  y
     * @param @return 参数
     * @return double 返回类型
     * @throws
     * @Title: getLat
     * @Description: 计算维度
     */
    public static double getLat(int x, int y) {
        double lat = 39.77250000 + 0.000001000 * (x - 0.5) - 0.00009000000 * (y - 0.5);
        if (lat < 39 || lat > 40) {
@@ -171,14 +120,6 @@
        return round6(lat);
    }
    /**
     * @param @param  checkPoints
     * @param @return 参数
     * @return List<String> 返回类型
     * @throws
     * @Title: assembleId
     * @Description: 组装id
     */
    public static List<String> assembleId(List<MonitorPointPosition> checkPoints) {
        List<String> ids2d = new ArrayList<>();
        for (MonitorPointPosition point : checkPoints) {
@@ -188,15 +129,6 @@
        return ids2d;
    }
    /**
     * @param @param  checkPoint
     * @param @param  range
     * @param @return 参数
     * @return List<String> 返回类型
     * @Title: aloneCrosswiseScope
     * @Description: 单独点位横向范围扩展
     * @backup 强制将层级改为 0
     */
    public static List<String> aloneCrosswiseExtend(MonitorPointPosition checkPoint, int range) {
        List<String> ids = new ArrayList<>();
        Integer x = checkPoint.getX();
@@ -210,9 +142,6 @@
        return ids;
    }
    /**
     * 根据范围获取查询条件
     */
    public static String getFilterByExtend(MonitorPointPosition point, int range) {
        Integer x = point.getX();
        Integer y = point.getY();
@@ -235,9 +164,6 @@
        return ids3d;
    }
    /**
     * 获取方向
     */
    public static String getDir(double direction) {
        if (direction < 0) {
            direction = direction + 360;
@@ -264,9 +190,6 @@
        return "北";
    }
    /**
     * 计算X、Y值的矩形框
     */
    public static List<Coordinate> calcRect(double x, double y) {
        double buffer = 10;
        double dis = round6(Math.sqrt(Math.pow(buffer / 2, 2) * 2));
@@ -280,9 +203,6 @@
        return list;
    }
    /**
     * 根据距离和角度获取目标点
     */
    private static Coordinate getPointByDisAndAngle(double x, double y, double angle, double dis) {
        try {
            DirectPosition2D p1 = new DirectPosition2D(x, y);
@@ -301,26 +221,10 @@
        }
    }
    /**
     * @param @return 参数
     * @return Double 返回类型
     * @throws
     * @Title: getWindSpeed
     * @Description: 计算风速
     */
    public static Double getWindSpeed(double v, double u) {
        return round6(Math.sqrt(v * v + u * u));
    }
    /**
     * @param @param  v
     * @param @param  u
     * @param @return 参数
     * @return double 返回类型
     * @throws
     * @Title: getWindDirection
     * @Description: 计算风向
     */
    public static double getWindDirection(double v, double u) {
        double result = Math.atan(u / (v + Math.pow(10, -5))) / Math.PI * 180;
        if (result < 0) {
@@ -332,16 +236,6 @@
        return round6(result);
    }
    /**
     * @param @param  list 排序对象
     * @param @param  property 排序参数
     * @param @param  order 排序顺序
     * @param @return 参数
     * @return List<Map < String, Object>> 返回类型
     * @throws
     * @Title: sort
     * @Description: 排序
     */
    public static List<Map<String, Object>> sort(List<Map<String, Object>> list, final String property, final boolean order) {
        if (list == null || property == null) {
            return null;
src/main/java/com/yssh/utils/CommonConstant.java
@@ -1,22 +1,17 @@
package com.yssh.utils;
/**
 * @author wMeng
 * @ClassName CommonConstant
 * @Description TODO
 * @date 2022/10/30 13:30
 * @Version 1.0
 */
public interface CommonConstant {
    /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
    /**
     * {@code 500 Server Error} (HTTP/1.0 - RFC 1945)
     */
    public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
    /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
    /**
     * {@code 200 OK} (HTTP/1.0 - RFC 1945)
     */
    public static final Integer SC_OK_200 = 200;
    /**访问权限认证未通过 510*/
    public static final Integer SC_JEECG_NO_AUTHZ=510;
    /**
     * 访问权限认证未通过 510
     */
    public static final Integer SC_JEECG_NO_AUTHZ = 510;
}
src/main/java/com/yssh/utils/DateUtils.java
@@ -7,11 +7,6 @@
import org.apache.commons.lang3.time.DateFormatUtils;
/**
 * 时间工具类
 *
 * @author tam
 */
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
    public static String YYYY = "yyyy";
@@ -37,20 +32,10 @@
            "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss",
            "yyyy.MM.dd HH:mm", "yyyy.MM"};
    /**
     * 获取当前Date型日期
     *
     * @return Date() 当前日期
     */
    public static Date getNowDate() {
        return new Date();
    }
    /**
     * 获取当前日期, 默认格式为yyyy-MM-dd
     *
     * @return String
     */
    public static String getDate() {
        return dateTimeNow(YYYY_MM_DD);
    }
src/main/java/com/yssh/utils/ExcelUtils.java
@@ -14,19 +14,7 @@
import java.util.*;
/**
 * Excel帮助类
 * @author WWW
 * @date 2023-08-08
 */
public class ExcelUtils {
    /**
     * 读取Excel
     *
     * @param pathName 文件路径
     * @param <T>      泛型类
     * @return 泛型类集合
     */
    public static <T> List<T> readExcel(Class<?> clazz, String pathName) {
        ExcelHead head = getExcelHead(clazz);
        int headRowNumber = head == null ? 1 : head.headRows();
@@ -59,40 +47,21 @@
        return list;
    }
    /**
     * 获取Excel头注解类
     *
     * @param clazz Class
     * @param <T>   泛型类
     * @return 头行数
     */
    public static <T> ExcelHead getExcelHead(Class<?> clazz) {
        ExcelHead head = clazz.getAnnotation(ExcelHead.class);
        return head;
    }
    /**
     * 写入Excel模板
     *
     * @param source 源文件(模板)
     * @param target 目录文件
     * @param map    数据源
     */
    public static <T> void writeToTemplate(String source, String target, Map<String, List<T>> map) {
        // 根据模板写入数据,如果目标文件不存在,则自动创建文件
        ExcelWriter excelWriter = EasyExcel.write(target).withTemplate(source).build();
        // 在工作簿0中写入数据,如果模板中不存在练习工作簿,则会在目标文件中自动创建
        WriteSheet writeSheet = EasyExcel.writerSheet(0).build();
        // 垂直写入数据,如果要水平写入,将VERTICAL替换为HORIZONTAL
        FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build();
        // 写入数据
        map.forEach((k, v) -> excelWriter.fill(new FillWrapper(k, v), fillConfig, writeSheet));
        // 结束写入
        excelWriter.finish();
    }
}
src/main/java/com/yssh/utils/FileUtils.java
@@ -7,19 +7,11 @@
import java.nio.channels.FileChannel;
import java.security.MessageDigest;
/**
 * 文件工具类
 * @author WWW
 * @date 2023-06-06
 */
public class FileUtils {
    public final static int SIXTEEN = 16;
    public static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
    /**
     * 1.获取文件的MD5
     */
    @SuppressWarnings("unused")
    public static String getFileMd5(String filePath) {
        FileInputStream fis = null;
@@ -52,25 +44,16 @@
        }
    }
    /**
     * 字节码转16进制
     */
    public static String byteToHexString(byte[] tmp) {
        // 每个字节用 16 进制表示的话,使用两个字符,
        char[] str = new char[16 * 2];
        // 所以表示成 16 进制需要 32 个字符,表示转换结果中对应的字符位置
        int k = 0;
        // 从第一个字节开始,对 MD5 的每一个字节
        for (int i = 0; i < SIXTEEN; i++) {
            // 转换成 16 进制字符的转换
            byte byte0 = tmp[i];
            // 取字节中高 4 位的数字转换
            str[k++] = HEX_DIGITS[byte0 >>> 4 & 0xf];
            // >>> 为逻辑右移,将符号位一起右移, 取字节中低 4 位的数字转换
            str[k++] = HEX_DIGITS[byte0 & 0xf];
        }
        // 换后的结果转换为字符串
        return new String(str);
    }
}
src/main/java/com/yssh/utils/GisUtil.java
@@ -7,18 +7,6 @@
import org.opengis.referencing.operation.MathTransform;
public class GisUtil {
    /**
     * @param srcNo
     *            源坐标系EPSG代号
     * @param targetNo
     *            目标坐标系EPSG代号
     * @param x
     *            源坐标x
     * @param y
     *            源坐标y
     * @Description: 坐标系转换
     */
    public static Coordinate coordinateTransform(String sourceCRS, String targetCRS,
            double x, double y) {
        Coordinate tar = new Coordinate();
src/main/java/com/yssh/utils/HttpStatus.java
@@ -1,12 +1,5 @@
package com.yssh.utils;
/**
 * 返回状态码
 *
 * @author xingjinshuang@smartearth.cn
 * @date 2023-02-06
 */
public class HttpStatus
{
    /**
src/main/java/com/yssh/utils/Result.java
@@ -8,13 +8,6 @@
import java.io.Serializable;
/**
 * @author wMeng
 * @ClassName Result
 * @Description TODO
 * @date 2022/10/30 13:29
 * @Version 1.0
 */
@Data
@ApiModel(value = "通用结果集",description = "通用结果集")
public class Result<T> implements Serializable {
src/main/java/com/yssh/utils/ServletInitializer.java
@@ -5,14 +5,6 @@
import com.yssh.Application;
/**
 * @author wMeng
 * @ClassName ServletInitializer
 * @Description TODO
 * @date 2022/10/31 18:46
 * @Version 1.0
 */
public class ServletInitializer extends SpringBootServletInitializer {
    @Override
src/main/java/com/yssh/utils/SpringUtils.java
@@ -9,12 +9,6 @@
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
 * spring工具类 方便在非spring管理环境中获取bean
 *
 * @author tam
 */
@Component
public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware {
    /** Spring应用上下文环境 */
src/main/java/com/yssh/utils/StringUtils.java
@@ -8,13 +8,6 @@
import java.util.Set;
import org.springframework.util.AntPathMatcher;
/**
 * 字符串工具类
 *
 * @author xingjinshuang@smartearth.cn
 * @date 2023-02-06
 */
public class StringUtils extends org.apache.commons.lang3.StringUtils {
    /** 空字符串 */
    private static final String NULLSTR = "";
src/main/java/com/yssh/utils/VocParser.java
@@ -12,19 +12,11 @@
import java.util.Date;
import java.util.List;
/**
 * VOC转换类
 * @author WWW
 * @date 2023-06-05
 */
public class VocParser extends AbstractCsvFileParser<VocVals> {
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
    private final SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH0000");
    /**
     * 每隔5000条入库一次
     */
    public static final int BATCH_COUNT = 100000;
    private BigInteger startId;
src/main/java/com/yssh/utils/WebUtils.java
@@ -6,25 +6,9 @@
import java.net.URLEncoder;
import java.util.Date;
/**
 * Web工具类
 * @author WWW
 * @date 2023-08-09
 */
public class WebUtils {
    /**
     * 字符点
     */
    public final static String POINT = ".";
    /**
     * 下载文件
     *
     * @param file     文件
     * @param fileName 文件名
     * @param res      响应
     * @throws Exception 异常
     */
    public static void download(String file, String fileName, boolean inline, HttpServletResponse res) throws Exception {
        if (StringUtils.isEmpty(fileName)) {
            fileName = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date());
@@ -32,37 +16,27 @@
        fileName = URLEncoder.encode(fileName, "UTF-8").replace("+", "%20");
        String dispose = inline ? "inline" : "attachment";
        // 设置响应头中文件的下载方式为附件方式,以及设置文件名
        res.setHeader("Content-Disposition", dispose + "; filename*=UTF-8''" + fileName);
        // 设置响应头的编码格式为 UTF-8
        res.setCharacterEncoding("UTF-8");
        // 通过response对象设置响应数据格式(如:"text/plain; charset=utf-8")
        String ext = getExtension(file);
        String mime = getMime(ext);
        res.setContentType(mime);
        // 通过response对象,获取到输出流
        ServletOutputStream outputStream = res.getOutputStream();
        // 定义输入流,通过输入流读取文件内容
        FileInputStream fileInputStream = new FileInputStream(file);
        int len = 0;
        byte[] bytes = new byte[1024];
        while ((len = fileInputStream.read(bytes)) != -1) {
            // 通过输入流读取文件数据,然后通过上述的输出流写回浏览器
            outputStream.write(bytes, 0, len);
            outputStream.flush();
        }
        // 关闭资源
        fileInputStream.close();
        outputStream.close();
    }
    /**
     * 获取文件扩展名
     */
    public static String getExtension(String fileName) {
        if (StringUtils.isEmpty(fileName)) {
            return "";
@@ -76,15 +50,8 @@
        return fileName.substring(idx).toLowerCase();
    }
    /**
     * 获取多用途互联网邮件扩展类型
     *
     * @param ext 文件扩展名
     * @return MIME
     */
    public static String getMime(String ext) {
        switch (ext) {
            // 图片
            case ".tif":
            case ".tiff":
                return "image/tiff";
@@ -97,7 +64,6 @@
                return "image/jpeg";
            case ".png":
                return "image/png";
            // 音/视频
            case ".mp3":
                return "audio/mp3";
            case ".mp4":
@@ -119,7 +85,6 @@
                return "application/vnd.rn-realmedia";
            case ".rmvb":
                return "application/vnd.rn-realmedia-vbr";
            // 网页
            case ".js":
                return "application/x-javascript";
            case ".css":
@@ -136,7 +101,6 @@
            case ".xml":
            case ".svg":
                return "text/xml";
            // 文件
            case ".txt":
                return "text/plain";
            case ".dbf":
@@ -160,7 +124,6 @@
                return "application/x-dwg";
            case ".ext":
                return "application/x-msdownload";
            // 默认
            default:
                return "application/octet-stream";
        }
ys.sql
@@ -4,6 +4,11 @@
SHOW BINARY LOGS;
RESET MASTER;
create index index_yssh_gcsj_time on yssh_gcsj(time);
drop index index_yssh_gcsj_time on yssh_gcsj;
https://blog.csdn.net/qq_63161848/article/details/141591514
----------------------------------------------------------------------
create table voc_vals (
    id bigint not null primary key comment '主键',
@@ -12,6 +17,7 @@
    val double(25, 10) comment '值',
    create_time datetime comment '值'
);
create index voc_vals_val on voc_vals (val);
create index voc_vals_time on voc_vals (create_time);
----------------------------------------------------------------------