燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2024-11-01 99042da077ad98e38340f96cb03ffcf4d249ab87
1
已修改4个文件
50 ■■■■ 文件已修改
src/main/java/com/yssh/config/ScheduleConfig.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/entity/DistanceSuYuan.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/SuYuanService.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-scheduled.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/config/ScheduleConfig.java
@@ -85,7 +85,6 @@
            try {
                calendar.add(Calendar.HOUR, 1);
                String time = format.format(calendar.getTime());
                System.out.println(time);
                String filePath = csvFilePathConfig.getFilePath() + File.separator + time + ".csv";
                File file = new File(filePath);
src/main/java/com/yssh/entity/DistanceSuYuan.java
@@ -11,8 +11,6 @@
import lombok.NoArgsConstructor;
import lombok.ToString;
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class DistanceSuYuan implements Serializable, Comparable<DistanceSuYuan> {
    private static final long serialVersionUID = -115407591473808022L;
@@ -48,6 +46,25 @@
    private double lat;
    public DistanceSuYuan() {
    }
    public DistanceSuYuan(String name, String vocsName, double vocsValue, String id, Integer x, Integer y, double u, double v, String addr, double windSpeed, double windDirection, double lon, double lat) {
        this.name = name;
        this.vocsName = vocsName;
        this.vocsValue = vocsValue;
        this.id = id;
        this.x = x;
        this.y = y;
        this.u = u;
        this.v = v;
        this.addr = addr;
        this.windSpeed = windSpeed;
        this.windDirection = windDirection;
        this.lon = lon;
        this.lat = lat;
    }
    public String getId() {
        return id;
    }
src/main/java/com/yssh/service/SuYuanService.java
@@ -126,7 +126,8 @@
        }
        if (suYuanMapper.isTableExists(dictRecord.getTableName()) == 0) return null;
        List<DistanceSuYuan> list = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d);
        List<DistanceSuYuan> source = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d);
        List<DistanceSuYuan> list = getList(ids3d, source);
        AtomicInteger i = new AtomicInteger(0);
        list.stream().forEach(s -> {
            s.setName(checkPoint.getName());
@@ -145,6 +146,20 @@
        return result;
    }
    private List<DistanceSuYuan> getList(List<String> ids3d, List<DistanceSuYuan> source) {
        List<DistanceSuYuan> list = new ArrayList<>();
        for (String id : ids3d) {
            DistanceSuYuan suYuan = source.stream().filter(db -> id.equals(db.getId())).findFirst().orElse(null);
            if (null == suYuan) {
                String[] strs = id.split("_");
                suYuan = new DistanceSuYuan(null, null, 0.0, id, Integer.parseInt(strs[0]), Integer.parseInt(strs[1]), 0, 0, null, 0.0, 0.0, 0.0, 0.0);
            }
            list.add(suYuan);
        }
        return list;
    }
    public Map<String, Object> selectSuYuan200(String name, Date date) {
        Map<String, Object> result = new HashMap<String, Object>();
        MonitorPointPosition checkPoint = commonService.select3dCheckPointByName(name);
@@ -160,7 +175,8 @@
        }
        if (suYuanMapper.isTableExists(dictRecord.getTableName()) == 0) return null;
        List<DistanceSuYuan> list = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d);
        List<DistanceSuYuan> source = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d);
        List<DistanceSuYuan> list = getList(ids3d, source);
        AtomicInteger i = new AtomicInteger(0);
        list.stream().forEach(s -> {
            s.setName(checkPoint.getName());
@@ -194,7 +210,8 @@
        }
        if (suYuanMapper.isTableExists(dictRecord.getTableName()) == 0) return null;
        List<DistanceSuYuan> list = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d);
        List<DistanceSuYuan> source = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d);
        List<DistanceSuYuan> list = getList(ids3d, source);
        AtomicInteger i = new AtomicInteger(0);
        list.stream().forEach(s -> {
            s.setName(checkPoint.getName());
@@ -228,7 +245,8 @@
        }
        if (suYuanMapper.isTableExists(dictRecord.getTableName()) == 0) return null;
        List<DistanceSuYuan> list = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d);
        List<DistanceSuYuan> source = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d);
        List<DistanceSuYuan> list = getList(ids3d, source);
        AtomicInteger i = new AtomicInteger(0);
        list.stream().forEach(s -> {
            s.setName(checkPoint.getName());
src/main/resources/application-scheduled.yml
@@ -1,6 +1,6 @@
csv:
  # 221Mb CSV入库时间,35,720
  cron: '0/5 * * * * ?'
  cron: '* 35 * * * ?'
  cron_max: 5200
  # 112Kb CSV入库时间