燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-06-23 e459551757a0f83d1f2670f0c7a2b516c08ed3d7
修改时间格式化
已修改4个文件
54 ■■■■■ 文件已修改
src/main/java/com/yssh/dao/SuYuanMapper.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/CalculateUtils.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/DateUtils.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/dao/SuYuanMapper.java
@@ -1,26 +1,20 @@
package com.yssh.dao;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.yssh.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.yssh.entity.DistanceSuYuan;
import com.yssh.entity.SuYuan2d;
import com.yssh.entity.SuYuan3d;
import com.yssh.entity.SuYuanMonitorData;
import com.yssh.entity.Temporary;
@Mapper
public interface SuYuanMapper extends BaseMapper{
public interface SuYuanMapper extends BaseMapper {
    Integer isTableExists(String tableName);
    int createTable(@Param("tableName") String tableName);
    List<SuYuan2d> get2d(@Param("tableName") String tableName, @Param("ids") List<String> ids);
    List<SuYuan3d> get3d(@Param("tableName") String tableName, @Param("ids") List<String> ids);
    List<DistanceSuYuan> getDistanceSuYuan(@Param("tableName") String tableName, @Param("ids") List<String> ids);
@@ -28,21 +22,23 @@
    DistanceSuYuan getSuYuan500Max(@Param("tableName") String tableName, @Param("ids") List<String> ids);
    DistanceSuYuan getSuYuanById(@Param("tableName") String tableName, @Param("id") String id);
    List<Temporary> getTemporary(@Param("tableName") String tableName, @Param("ids") List<String> ids);
    int update(@Param("tableName") String tableName, @Param("id") String id, @Param("value") String value);
    List<SuYuan2d> getAlarmsAnalyse(@Param("tableName") String tableName, @Param("ids") List<String> ids);
    List<SuYuan2d> getWarningAnalyse(@Param("tableName") String tableName, @Param("ids") List<String> ids);
    List<SuYuanMonitorData> getMonitorData(@Param("tableNames") List<String> tableNames, @Param("id") String id);
    List<SuYuanMonitorData> getNewMonitorData(String name, String start, String end);
    //获取本月指定监测站点监测值对大的数据
    Map<String, Object> getMonthValueDataMax(@Param("tableNames") List<String> tableNames, @Param("id") String id);
    int updateVocsName(String table, String id, String vocsName);
    SuYuan700 selectSuYuan700ById(String id, String time);
}
src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java
@@ -1,6 +1,5 @@
package com.yssh.service.impl;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
@@ -44,8 +43,6 @@
    @Resource
    private QxshMapper qxshMapper;
    private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHH");
    //@Transactional
    //@Override
@@ -260,18 +257,18 @@
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 23);
        String end = dateFormat.format(calendar.getTime());
        String end = DateUtils.getYyyyMmDdHh(calendar.getTime()); //dateFormat.format(calendar.getTime());
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.add(Calendar.DATE, -7);
        String start = dateFormat.format(calendar.getTime());
        String start = DateUtils.getYyyyMmDdHh(calendar.getTime());
        return suYuanMapper.getNewMonitorData(checkPoint.getName(), start, end);
    }
    @Override
    public int updateVocsName(Date date, String id, String vocsName) {
        String table = "su_yuan_" + dateFormat.format(date); // new Date()
        String table = "su_yuan_" + DateUtils.getYyyyMmDdHh(date); // new Date()
        if (isTableExists(table) == 0) {
            return 0;
        }
@@ -282,7 +279,7 @@
    @Override
    public List<Qxsh> queryQxsh(Date date) {
        String time = dateFormat.format(date);
        String time = DateUtils.getYyyyMmDdHh(date);
        return qxshMapper.selectByTime(time);
    }
@@ -299,7 +296,7 @@
    @Override
    public SuYuan700 selectSuYuan700ById(String id, Date date) {
        //
        String time = DateUtils.getYyyyMmDdHhMmSs(date);
        return null;
    }
src/main/java/com/yssh/utils/CalculateUtils.java
@@ -14,15 +14,6 @@
import org.opengis.referencing.crs.CoordinateReferenceSystem;
public class CalculateUtils {
    private final static SimpleDateFormat ymdh = new SimpleDateFormat("yyyyMMddHH");
    /**
     * 获取年月日时
     */
    public static String getYearMonthDayHour(Date date) {
        return ymdh.format(date);
    }
    /**
     * 默认地球半径,赤道半径(单位m)
     */
src/main/java/com/yssh/utils/DateUtils.java
@@ -79,6 +79,14 @@
        }
    }
    public static String getYyyyMmDdHh(Date date) {
        return new SimpleDateFormat(YYYYMMDDHH).format(date);
    }
    public static String getYyyyMmDdHhMmSs(Date date) {
        return new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS).format(date);
    }
    /**
     * 日期路径 即年/月/日 如2018/08/08
     */