Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
500392978e
|
|
@ -285,7 +285,27 @@ public interface CommonConstant {
|
|||
/**
|
||||
* 缓存所有核设施key
|
||||
*/
|
||||
String ALL_NUCLEARFACILITY = "nuclearfacility";
|
||||
String ALL_NUCLEARFACILITY = "nuclearFacility";
|
||||
|
||||
/**
|
||||
* 缓存所有核反应堆key GardsResearchReactors
|
||||
*/
|
||||
String ALL_RESEARCH_REACTORS = "researchReactors";
|
||||
|
||||
/**
|
||||
* 缓存所有后处理厂key
|
||||
*/
|
||||
String ALL_NUCLEAR_FUEL_FACILITIES = "nuclearFuelFacilities";
|
||||
|
||||
/**
|
||||
* 缓存核试验厂key
|
||||
*/
|
||||
String ALL_NUCLEAR_TEST_PLANT = "nuclearTestingPlant";
|
||||
|
||||
/**
|
||||
* 缓存加速器key
|
||||
*/
|
||||
String ALL_ACCELERATOR = "accelerator";
|
||||
|
||||
/**
|
||||
* 输运模拟贡献分析数据KEY
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package org.jeecg.common.constant.enums;
|
||||
|
||||
/**
|
||||
* 输运模拟任务状态说明枚举
|
||||
*/
|
||||
public enum TransportTaskCloseStatusEnum {
|
||||
|
||||
/**
|
||||
* 未关闭
|
||||
*/
|
||||
NOT_CLOSED(0),
|
||||
/**
|
||||
* 已关闭
|
||||
*/
|
||||
CLOSE(1);
|
||||
|
||||
private Integer value;
|
||||
|
||||
TransportTaskCloseStatusEnum(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer getValue(){
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
|
@ -20,7 +20,11 @@ public enum TransportTaskStatusEnum {
|
|||
/**
|
||||
* 已完成
|
||||
*/
|
||||
COMPLETED(2);
|
||||
COMPLETED(2),
|
||||
/**
|
||||
* 缺少气象数据
|
||||
*/
|
||||
LACK_MET_DATA(3);
|
||||
|
||||
private Integer value;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ import lombok.Data;
|
|||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "prometheus")
|
||||
|
|
@ -17,7 +20,7 @@ public class PrometheusServerProperties {
|
|||
/**
|
||||
* node-exporter实例地址
|
||||
*/
|
||||
private String instance;
|
||||
private Map<String, Integer> instances = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* 监测的网卡名称
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
public class CoordinateTransformUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 29°46’04”N
|
||||
* 经纬度转换29°37′50″N -> 29.xxxxx
|
||||
* @param lonOrLatStr
|
||||
* @return
|
||||
*/
|
||||
public static Double lonAndLatConversion(String lonOrLatStr) {
|
||||
if(lonOrLatStr.contains("°") && lonOrLatStr.contains("′") && lonOrLatStr.contains("″")){
|
||||
String cleanStr = lonOrLatStr.replaceAll("[NSEW\\s]", "");
|
||||
String[] parts = cleanStr.split("[°′″:\\s]+");
|
||||
String deg = parts[0];
|
||||
String min = parts.length > 1 && !parts[1].isEmpty() ? parts[1] : "0";
|
||||
String sec = parts.length > 2 && !parts[2].isEmpty() ? parts[2] : "0";
|
||||
BigDecimal degBigDecimal = new BigDecimal(deg);
|
||||
BigDecimal minBigDecimal = new BigDecimal(min);
|
||||
BigDecimal secBigDecimal = new BigDecimal(sec);
|
||||
minBigDecimal = minBigDecimal.divide(new BigDecimal("60"), 6, RoundingMode.HALF_UP);
|
||||
secBigDecimal = secBigDecimal.divide(new BigDecimal("3600"), 6, RoundingMode.HALF_UP);
|
||||
return degBigDecimal.doubleValue() + minBigDecimal.doubleValue() + secBigDecimal.doubleValue();
|
||||
}else {
|
||||
if(lonOrLatStr.contains("°") && !lonOrLatStr.contains("′") && !lonOrLatStr.contains("″")){
|
||||
String cleanStr = lonOrLatStr.replaceAll("[NSEW°\\s]", "");
|
||||
return Double.parseDouble(cleanStr);
|
||||
}
|
||||
}
|
||||
return 0D;
|
||||
}
|
||||
}
|
||||
|
|
@ -52,9 +52,9 @@ public class GardsNuclearTestingPlant implements Serializable {
|
|||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "类型", width = 20,height = 20,orderNum="3")
|
||||
@TableField(value = "TYPE")
|
||||
private String type;
|
||||
@Excel(name = "国家", width = 20,height = 20,orderNum="3")
|
||||
@TableField(value = "COUNTRY")
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* 详细信息(大文本字段)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,157 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* gards_analyses数据表存储谱数据分析的基本信息,包括:
|
||||
* 谱数据到达的时间、分析开始和结束时间、分析员姓名、使用的软件、谱分析使用的参数(基线类型、寻峰方式、核素识别方法)等
|
||||
*/
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_ANALYSES")
|
||||
public class GardsAnalyses implements Serializable {
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
@TableId(value = "idanalysis",type = IdType.AUTO)
|
||||
private Integer idAnalysis;
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
/**
|
||||
* 分析开始时间
|
||||
*/
|
||||
@TableField(value = "ANALYSISBEGIN")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date analysisBegin;
|
||||
/**
|
||||
* 分析结束时间
|
||||
*/
|
||||
@TableField(value = "ANALYSISEND")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date analysisEnd;
|
||||
/**
|
||||
* Reviewed:交互,auto:自动
|
||||
*/
|
||||
@TableField(value = "TYPE")
|
||||
private String type;
|
||||
/**
|
||||
* 使用的软件名称
|
||||
*/
|
||||
@TableField(value = "SOFTWARE")
|
||||
private String software;
|
||||
/**
|
||||
* 软件版本号
|
||||
*/
|
||||
@TableField(value = "SWVERSION")
|
||||
private String swVersion;
|
||||
/**
|
||||
* 分析员名称
|
||||
*/
|
||||
@TableField(value = "ANALYST")
|
||||
private String analyst;
|
||||
/**
|
||||
* 基线计数方法描述
|
||||
*/
|
||||
@TableField(value = "BASELINEMETHOD")
|
||||
private String baselineMethod;
|
||||
/**
|
||||
* 寻峰方法描述
|
||||
*/
|
||||
@TableField(value = "PEAKSMETHOD")
|
||||
private String peaksMethod;
|
||||
/**
|
||||
* 核素识别方法描述
|
||||
*/
|
||||
@TableField(value = "NUCLIDEMETHOD")
|
||||
private String nuclideMethod;
|
||||
/**
|
||||
* 不确定度计算描述
|
||||
*/
|
||||
@TableField(value = "UNCCALCMETHOD")
|
||||
private String uncCalcMethod;
|
||||
/**
|
||||
* Lc计算方法描述
|
||||
*/
|
||||
@TableField(value = "LCMETHOD")
|
||||
private String lcMethod;
|
||||
/**
|
||||
* 寻峰起始道
|
||||
*/
|
||||
@TableField(value = "SEARCHSTARTCHANNEL")
|
||||
private Integer searchStartChannel;
|
||||
/**
|
||||
* 寻峰结束道
|
||||
*/
|
||||
@TableField(value = "SEARCHENDCHANNEL")
|
||||
private Integer searchEndChannel;
|
||||
/**
|
||||
* 寻峰阈值
|
||||
*/
|
||||
@TableField(value = "SEARCHTHRESHOLD")
|
||||
private Double searchThreshold;
|
||||
/**
|
||||
* 峰数目
|
||||
*/
|
||||
@TableField(value = "NUMBEROFPEAKS")
|
||||
private Integer numberOfPeaks;
|
||||
/**
|
||||
* 总计数
|
||||
*/
|
||||
@TableField(value = "TOTALCOUNTS")
|
||||
private Float totalCounts;
|
||||
/**
|
||||
* 分级结果
|
||||
*/
|
||||
@TableField(value = "CATEGORY")
|
||||
private Integer category;
|
||||
/**
|
||||
* 注释
|
||||
*/
|
||||
@TableField(value = "COMMENTS")
|
||||
private String comments;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
@TableField(value = "USEDGASPHD")
|
||||
private String usedgasphd;
|
||||
|
||||
@TableField(value = "USEDDETPHD")
|
||||
private String useddetphd;
|
||||
|
||||
@TableField(value = "USEDGASPHD_ID")
|
||||
private Integer usedgasphdId;
|
||||
|
||||
@TableField(value = "USEDDETPHD_ID")
|
||||
private Integer useddetphdId;
|
||||
|
||||
@TableField(value = "BASELINE_PATH")
|
||||
private String baselinePath;
|
||||
|
||||
@TableField(value = "LC_PATH")
|
||||
private String lcPath;
|
||||
|
||||
@TableField(value = "SCAC_PATH")
|
||||
private String scacPath;
|
||||
|
||||
@TableField(value = "LOG_PATH")
|
||||
private String logPath;
|
||||
|
||||
@TableField(value = "REPORT_PAHT")
|
||||
private String reportPath;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package org.jeecg.modules.base.entity.rnauto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("RNAUTO.GARDS_TRANSPORT_STATUS")
|
||||
public class GardsTransportStatus {
|
||||
|
||||
|
||||
@TableId(value = "SAMPLE_ID",type = IdType.INPUT)
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "TRANSPORT_STATUS")
|
||||
private Integer transportStatus;
|
||||
|
||||
@TableField(value = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
@TableField(value = "CLOSE_STATUS")
|
||||
private Integer closeStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package org.jeecg.modules.base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsTransportStatus;
|
||||
|
||||
public interface GardsTransportStatusMapper extends BaseMapper<GardsTransportStatus> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package org.jeecg.gis.controller;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.gis.service.MapSituationDisplayService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("gis")
|
||||
@RequiredArgsConstructor
|
||||
public class MapSituationDisplayController {
|
||||
|
||||
private final MapSituationDisplayService mapSituationDisplayService;
|
||||
|
||||
@AutoLog(value = "查询全球站点信息")
|
||||
@GetMapping("getGlobalSiteInfo")
|
||||
public Result<?> getGlobalSiteInfo() {
|
||||
return Result.OK(mapSituationDisplayService.getGlobalSiteInfo());
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询IMS台站数据有效率信息")
|
||||
@GetMapping("getDataProvisionEfficiency")
|
||||
public Result<?> getDataProvisionEfficiency() {
|
||||
return Result.OK(mapSituationDisplayService.getDataProvisionEfficiency());
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询H设施站点信息")
|
||||
@GetMapping("getAllNuclearfacility")
|
||||
public Result<?> getAllNuclearfacility() {
|
||||
return Result.OK(mapSituationDisplayService.getAllNuclearfacility());
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询反应堆站点信息")
|
||||
@GetMapping("getAllResearchReactors")
|
||||
public Result<?> getAllResearchReactors() {
|
||||
return Result.OK(mapSituationDisplayService.getAllResearchReactors());
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询后处理厂站点信息")
|
||||
@GetMapping("getAllNuclearFuelFacilitiy")
|
||||
public Result<?> getAllNuclearFuelFacilitiy() {
|
||||
return Result.OK(mapSituationDisplayService.getAllNuclearFuelFacilitiy());
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询核试验厂站点信息")
|
||||
@GetMapping("getAllNuclearTestPlant")
|
||||
public Result<?> getAllNuclearTestPlant() {
|
||||
return Result.OK(mapSituationDisplayService.getAllNuclearTestPlant());
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询加速器站点信息")
|
||||
@GetMapping("getAllAccelerator")
|
||||
public Result<?> getAllAccelerator() {
|
||||
return Result.OK(mapSituationDisplayService.getAllAccelerator());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package org.jeecg.gis.enums;
|
||||
|
||||
/**
|
||||
* 全球站点信息分类枚举
|
||||
*/
|
||||
public enum GlobalSiteTypeEnum {
|
||||
|
||||
/**
|
||||
* 台站
|
||||
*/
|
||||
STATION(1),
|
||||
/**
|
||||
* 核设施
|
||||
*/
|
||||
NUCLEAR_FACILITY(2),
|
||||
/**
|
||||
* 反应堆
|
||||
*/
|
||||
NUCLEAR_REACTOR(3),
|
||||
/**
|
||||
* 后处理厂
|
||||
*/
|
||||
POST_PROCESSING_PLANT(4),
|
||||
/**
|
||||
* 核试验场
|
||||
*/
|
||||
NUCLEAR_TESTING_PLANT(5),
|
||||
/**
|
||||
* 加速器
|
||||
*/
|
||||
ACCELERATOR(6);
|
||||
|
||||
private Integer value;
|
||||
|
||||
GlobalSiteTypeEnum(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package org.jeecg.gis.service;
|
||||
|
||||
import org.jeecg.gis.vo.DataProvisionEfficiency;
|
||||
import org.jeecg.gis.vo.GlobalSiteInfoVO;
|
||||
import org.jeecg.modules.base.entity.configuration.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地图大屏态势展示
|
||||
*/
|
||||
public interface MapSituationDisplayService {
|
||||
|
||||
/**
|
||||
* 获取全球站点信息包括:台站、核设施、反应堆、后处理厂、加速器核试验厂
|
||||
*/
|
||||
List<GlobalSiteInfoVO> getGlobalSiteInfo();
|
||||
|
||||
/**
|
||||
* 查询核设施站点信息
|
||||
* @return
|
||||
*/
|
||||
List<GardsNuclearReactors> getAllNuclearfacility();
|
||||
|
||||
/**
|
||||
* 查询反应堆站点信息
|
||||
* @return
|
||||
*/
|
||||
List<GardsResearchReactors> getAllResearchReactors();
|
||||
|
||||
/**
|
||||
* 查询后处理厂站点信息
|
||||
* @return
|
||||
*/
|
||||
List<GardsNuclearFuelFacilities> getAllNuclearFuelFacilitiy();
|
||||
|
||||
/**
|
||||
* 查询核试验地点信息
|
||||
* @return
|
||||
*/
|
||||
List<GardsNuclearTestingPlant> getAllNuclearTestPlant();
|
||||
|
||||
/**
|
||||
* 查询加速器站点信息
|
||||
* @return
|
||||
*/
|
||||
List<GardsAccelerator> getAllAccelerator();
|
||||
|
||||
/**
|
||||
* 查询IMS台站数据有效率信息
|
||||
* @return
|
||||
*/
|
||||
List<DataProvisionEfficiency> getDataProvisionEfficiency();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,303 @@
|
|||
package org.jeecg.gis.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.text.StrSplitter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.gis.enums.GlobalSiteTypeEnum;
|
||||
import org.jeecg.gis.service.MapSituationDisplayService;
|
||||
import org.jeecg.gis.service.StationJsonData;
|
||||
import org.jeecg.gis.vo.DataProvisionEfficiency;
|
||||
import org.jeecg.gis.vo.GlobalSiteInfoVO;
|
||||
import org.jeecg.modules.base.entity.configuration.*;
|
||||
import org.jeecg.modules.base.mapper.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MapSituationDisplayServiceImpl implements MapSituationDisplayService {
|
||||
|
||||
private final RedisUtil redisUtil;
|
||||
private final GardsNuclearReactorsMapper nuclearReactorsMapper;
|
||||
private final GardsStationsMapper stationsMapper;
|
||||
private final GardsResearchReactorsMapper researchReactorsMapper;
|
||||
private final GardsNuclearFuelFacilitiesMapper nuclearFuelFacilitiesMapper;
|
||||
private final GardsNuclearTestingPlantMapper nuclearTestingPlantMapper;
|
||||
private final GardsAcceleratorMapper acceleratorMapper;
|
||||
|
||||
/**
|
||||
* 获取全球站点信息包括:台站、核设施、反应堆、后处理厂、加速器核试验厂
|
||||
*/
|
||||
@DS("ora")
|
||||
@Override
|
||||
public List<GlobalSiteInfoVO> getGlobalSiteInfo() {
|
||||
List<GlobalSiteInfoVO> list = new ArrayList<>();
|
||||
list.addAll(this.getIMSStations());
|
||||
list.addAll(this.getNuclearfacilitys());
|
||||
list.addAll(this.getNuclearReactors());
|
||||
list.addAll(this.getNuclearFuelFacilities());
|
||||
list.addAll(this.getNuclearTestPlant());
|
||||
list.addAll(this.getAccelerator());
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询核设施站点信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<GardsNuclearReactors> getAllNuclearfacility() {
|
||||
return (List<GardsNuclearReactors>) redisUtil.get(CommonConstant.ALL_NUCLEARFACILITY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询反应堆站点信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<GardsResearchReactors> getAllResearchReactors() {
|
||||
return (List<GardsResearchReactors>) redisUtil.get(CommonConstant.ALL_RESEARCH_REACTORS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询后处理厂站点信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<GardsNuclearFuelFacilities> getAllNuclearFuelFacilitiy() {
|
||||
return (List<GardsNuclearFuelFacilities>) redisUtil.get(CommonConstant.ALL_NUCLEAR_FUEL_FACILITIES);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询核试验厂站点信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<GardsNuclearTestingPlant> getAllNuclearTestPlant() {
|
||||
List<GardsNuclearTestingPlant> list = (List<GardsNuclearTestingPlant>) redisUtil.get(CommonConstant.ALL_NUCLEAR_TEST_PLANT);
|
||||
list.forEach(gardsNuclearTestingPlant -> {
|
||||
gardsNuclearTestingPlant.setInfo(Strings.EMPTY);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询加速器站点信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<GardsAccelerator> getAllAccelerator() {
|
||||
List<GardsAccelerator> list = (List<GardsAccelerator>) redisUtil.get(CommonConstant.ALL_ACCELERATOR);
|
||||
list.forEach(gardsAccelerator -> {
|
||||
gardsAccelerator.setFacilityName(Strings.EMPTY);
|
||||
gardsAccelerator.setWebsite(Strings.EMPTY);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询IMS台站数据有效率信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DataProvisionEfficiency> getDataProvisionEfficiency() {
|
||||
List<GardsStations> stations = (List<GardsStations>)redisUtil.get(CommonConstant.ALL_STATIONS);
|
||||
JSONObject jsonObject = JSON.parseObject(StationJsonData.getJson());
|
||||
if (jsonObject.containsKey("result")) {
|
||||
Object obj = jsonObject.get("result");
|
||||
if (obj instanceof JSONArray && Objects.nonNull(obj)) {
|
||||
List<DataProvisionEfficiency> dataProvisionEfficiency = ((JSONArray) obj).toJavaList(DataProvisionEfficiency.class);
|
||||
dataProvisionEfficiency.forEach(data -> {
|
||||
for (GardsStations station : stations) {
|
||||
if (station.getStationCode().equals(data.getStationCode())) {
|
||||
data.setElevation(station.getElevation());
|
||||
data.setDateBegin(station.getDateBegin());
|
||||
data.setDateEnd(station.getDateEnd());
|
||||
}
|
||||
}
|
||||
});
|
||||
return dataProvisionEfficiency;
|
||||
}
|
||||
}
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取台站
|
||||
* @return
|
||||
*/
|
||||
private List<GlobalSiteInfoVO> getIMSStations(){
|
||||
List<GardsStations> stations;
|
||||
if(redisUtil.hasKey(CommonConstant.ALL_STATIONS)){
|
||||
stations = (List<GardsStations>)redisUtil.get(CommonConstant.ALL_STATIONS);
|
||||
}else {
|
||||
stations = stationsMapper.selectList(new LambdaQueryWrapper<>());
|
||||
redisUtil.set(CommonConstant.ALL_STATIONS,stations);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(stations)){
|
||||
List<GlobalSiteInfoVO> list = new ArrayList<>();
|
||||
for(GardsStations station:stations){
|
||||
GlobalSiteInfoVO globalSiteInfo = new GlobalSiteInfoVO();
|
||||
globalSiteInfo.setId(station.getStationId());
|
||||
globalSiteInfo.setName(station.getStationCode());
|
||||
globalSiteInfo.setLon(station.getLon());
|
||||
globalSiteInfo.setLat(station.getLat());
|
||||
globalSiteInfo.setSiteType(GlobalSiteTypeEnum.STATION.getValue());
|
||||
list.add(globalSiteInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取核设施
|
||||
* @return
|
||||
*/
|
||||
private List<GlobalSiteInfoVO> getNuclearfacilitys(){
|
||||
List<GardsNuclearReactors> nuclearReactors;
|
||||
if(redisUtil.hasKey(CommonConstant.ALL_NUCLEARFACILITY)){
|
||||
nuclearReactors = (List<GardsNuclearReactors>) redisUtil.get(CommonConstant.ALL_NUCLEARFACILITY);
|
||||
}else {
|
||||
nuclearReactors = nuclearReactorsMapper.selectList(new LambdaQueryWrapper<>());
|
||||
redisUtil.set(CommonConstant.ALL_NUCLEARFACILITY, nuclearReactors);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(nuclearReactors)){
|
||||
List<GlobalSiteInfoVO> list = new ArrayList<>();
|
||||
for(GardsNuclearReactors nuclearReactor : nuclearReactors){
|
||||
GlobalSiteInfoVO globalSiteInfo = new GlobalSiteInfoVO();
|
||||
globalSiteInfo.setId(nuclearReactor.getId());
|
||||
globalSiteInfo.setName(nuclearReactor.getUnitName());
|
||||
globalSiteInfo.setLon(nuclearReactor.getLongitude());
|
||||
globalSiteInfo.setLat(nuclearReactor.getLatitude());
|
||||
globalSiteInfo.setSiteType(GlobalSiteTypeEnum.NUCLEAR_FACILITY.getValue());
|
||||
list.add(globalSiteInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取反应堆
|
||||
* @return
|
||||
*/
|
||||
private List<GlobalSiteInfoVO> getNuclearReactors(){
|
||||
List<GardsResearchReactors> researchReactors;
|
||||
if(redisUtil.hasKey(CommonConstant.ALL_RESEARCH_REACTORS)){
|
||||
researchReactors = (List<GardsResearchReactors>)redisUtil.get(CommonConstant.ALL_RESEARCH_REACTORS);
|
||||
}else {
|
||||
researchReactors = researchReactorsMapper.selectList(new LambdaQueryWrapper<>());
|
||||
redisUtil.set(CommonConstant.ALL_RESEARCH_REACTORS,researchReactors);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(researchReactors)){
|
||||
List<GlobalSiteInfoVO> list = new ArrayList<>();
|
||||
for(GardsResearchReactors nuclearReactor:researchReactors){
|
||||
GlobalSiteInfoVO globalSiteInfo = new GlobalSiteInfoVO();
|
||||
globalSiteInfo.setId(nuclearReactor.getId());
|
||||
globalSiteInfo.setName(nuclearReactor.getFacilityName());
|
||||
globalSiteInfo.setLon(nuclearReactor.getLongitude());
|
||||
globalSiteInfo.setLat(nuclearReactor.getLatitude());
|
||||
globalSiteInfo.setSiteType(GlobalSiteTypeEnum.NUCLEAR_REACTOR.getValue());
|
||||
list.add(globalSiteInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取后处理厂
|
||||
* @return
|
||||
*/
|
||||
private List<GlobalSiteInfoVO> getNuclearFuelFacilities(){
|
||||
List<GardsNuclearFuelFacilities> nuclearFuelFacilities;
|
||||
if(redisUtil.hasKey(CommonConstant.ALL_NUCLEAR_FUEL_FACILITIES)){
|
||||
nuclearFuelFacilities = (List<GardsNuclearFuelFacilities>)redisUtil.get(CommonConstant.ALL_NUCLEAR_FUEL_FACILITIES);
|
||||
}else {
|
||||
nuclearFuelFacilities = nuclearFuelFacilitiesMapper.selectList(new LambdaQueryWrapper<>());
|
||||
redisUtil.set(CommonConstant.ALL_NUCLEAR_FUEL_FACILITIES,nuclearFuelFacilities);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(nuclearFuelFacilities)){
|
||||
List<GlobalSiteInfoVO> list = new ArrayList<>();
|
||||
for(GardsNuclearFuelFacilities nuclearFuelFacilitie:nuclearFuelFacilities){
|
||||
GlobalSiteInfoVO globalSiteInfo = new GlobalSiteInfoVO();
|
||||
globalSiteInfo.setId(nuclearFuelFacilitie.getId());
|
||||
globalSiteInfo.setName(nuclearFuelFacilitie.getFacilityName());
|
||||
globalSiteInfo.setLon(nuclearFuelFacilitie.getLongitude());
|
||||
globalSiteInfo.setLat(nuclearFuelFacilitie.getLatitude());
|
||||
globalSiteInfo.setSiteType(GlobalSiteTypeEnum.POST_PROCESSING_PLANT.getValue());
|
||||
list.add(globalSiteInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取核试验场
|
||||
* @return
|
||||
*/
|
||||
private List<GlobalSiteInfoVO> getNuclearTestPlant(){
|
||||
List<GardsNuclearTestingPlant> nuclearTestingPlants;
|
||||
if(redisUtil.hasKey(CommonConstant.ALL_NUCLEAR_TEST_PLANT)){
|
||||
nuclearTestingPlants = (List<GardsNuclearTestingPlant>)redisUtil.get(CommonConstant.ALL_NUCLEAR_TEST_PLANT);
|
||||
}else {
|
||||
nuclearTestingPlants = nuclearTestingPlantMapper.selectList(new LambdaQueryWrapper<>());
|
||||
redisUtil.set(CommonConstant.ALL_NUCLEAR_TEST_PLANT,nuclearTestingPlants);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(nuclearTestingPlants)){
|
||||
List<GlobalSiteInfoVO> list = new ArrayList<>();
|
||||
for(GardsNuclearTestingPlant nuclearTestingPlant:nuclearTestingPlants){
|
||||
GlobalSiteInfoVO globalSiteInfo = new GlobalSiteInfoVO();
|
||||
globalSiteInfo.setId(nuclearTestingPlant.getId());
|
||||
globalSiteInfo.setName(nuclearTestingPlant.getName());
|
||||
globalSiteInfo.setLon(nuclearTestingPlant.getLongitude());
|
||||
globalSiteInfo.setLat(nuclearTestingPlant.getLatitude());
|
||||
globalSiteInfo.setSiteType(GlobalSiteTypeEnum.NUCLEAR_TESTING_PLANT.getValue());
|
||||
list.add(globalSiteInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取加速器
|
||||
* @return
|
||||
*/
|
||||
private List<GlobalSiteInfoVO> getAccelerator(){
|
||||
List<GardsAccelerator> accelerators;
|
||||
if(redisUtil.hasKey(CommonConstant.ALL_ACCELERATOR)){
|
||||
accelerators = (List<GardsAccelerator>)redisUtil.get(CommonConstant.ALL_ACCELERATOR);
|
||||
}else {
|
||||
accelerators = acceleratorMapper.selectList(new LambdaQueryWrapper<>());
|
||||
redisUtil.set(CommonConstant.ALL_ACCELERATOR,accelerators);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(accelerators)){
|
||||
List<GlobalSiteInfoVO> list = new ArrayList<>();
|
||||
for(GardsAccelerator accelerator:accelerators){
|
||||
GlobalSiteInfoVO globalSiteInfo = new GlobalSiteInfoVO();
|
||||
globalSiteInfo.setId(accelerator.getId());
|
||||
globalSiteInfo.setName(accelerator.getFacilityName());
|
||||
globalSiteInfo.setLon(accelerator.getLongitude());
|
||||
globalSiteInfo.setLat(accelerator.getLatitude());
|
||||
globalSiteInfo.setSiteType(GlobalSiteTypeEnum.ACCELERATOR.getValue());
|
||||
list.add(globalSiteInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package org.jeecg.gis.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据有效率
|
||||
*/
|
||||
@Data
|
||||
public class DataProvisionEfficiency {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String stationCode;
|
||||
|
||||
private String countryCode;
|
||||
|
||||
private String type;
|
||||
|
||||
private Double lon;
|
||||
|
||||
private Double lat;
|
||||
|
||||
private String description;
|
||||
|
||||
private String status;
|
||||
|
||||
private String phdf;
|
||||
|
||||
private String phd;
|
||||
|
||||
private String met;
|
||||
|
||||
private String soh;
|
||||
|
||||
private String phdMetSoh;
|
||||
|
||||
private String quality;
|
||||
|
||||
private Double elevation;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-Mm-dd",timezone = "GMT+8")
|
||||
private Date dateBegin;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-Mm-dd",timezone = "GMT+8")
|
||||
private Date dateEnd;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package org.jeecg.gis.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 全球站点信息包括:台站、核设施、反应堆、后处理厂、加速器核试验厂
|
||||
*/
|
||||
@Data
|
||||
public class GlobalSiteInfoVO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Double lon;
|
||||
|
||||
private Double lat;
|
||||
|
||||
private Integer siteType;
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package org.jeecg.monitor.controller;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.monitor.feign.ServiceMonitorFeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("clusterMonitor")
|
||||
@RequiredArgsConstructor
|
||||
public class ServiceClusterMonitorController {
|
||||
|
||||
private final ServiceMonitorFeignClient serviceMonitorFeignClient;
|
||||
|
||||
@AutoLog(value = "查询当前时刻的CPU使用率")
|
||||
@GetMapping("getCpuInfo")
|
||||
public Object getCpuInfo(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return serviceMonitorFeignClient.getCpuInfo(ip,conditions);
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询过去指定时间范围内的CPU使用率")
|
||||
@GetMapping("getCpuInfoList")
|
||||
public Object getCpuInfoList(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return serviceMonitorFeignClient.getCpuInfoList(ip,conditions);
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取CPU核心数")
|
||||
@GetMapping("getCpuCoreInfo")
|
||||
public Object getCpuCoreInfo(String ip) {
|
||||
return serviceMonitorFeignClient.getCpuCoreInfo(ip);
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询当前时刻的内存使用率")
|
||||
@GetMapping("getMemoryInfo")
|
||||
public Object getMemoryInfo(String ip) {
|
||||
return serviceMonitorFeignClient.getMemoryInfo(ip);
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取总内存")
|
||||
@GetMapping("getTotleMemoryInfo")
|
||||
public Object getTotleMemoryInfo(String ip) {
|
||||
return serviceMonitorFeignClient.getTotleMemoryInfo(ip);
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询过去指定时间范围内的内存使用率")
|
||||
@GetMapping("getMemoryInfoList")
|
||||
public Object getMemoryInfoList(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return serviceMonitorFeignClient.getMemoryInfoList(ip,conditions);
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询当前时刻的网络带宽吞吐量")
|
||||
@GetMapping("getNetworkInfo")
|
||||
public Object getNetworkInfo(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return serviceMonitorFeignClient.getNetworkInfo(ip,conditions);
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取网络带宽监测数据")
|
||||
@GetMapping("getNetworkInfoList")
|
||||
public Object getNetworkInfoList(String ip, @NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return serviceMonitorFeignClient.getNetworkInfoList(ip,conditions);
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取磁盘使用率")
|
||||
@GetMapping("getDiskInfo")
|
||||
public Object getDiskInfo(String ip) {
|
||||
return serviceMonitorFeignClient.getDiskInfo(ip);
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取主机服务列表")
|
||||
@GetMapping("getHostList")
|
||||
public Object getHostList() {
|
||||
return serviceMonitorFeignClient.getHostList();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package org.jeecg.monitor.feign;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@FeignClient(value = "jeecg-system")
|
||||
public interface ServiceMonitorFeignClient {
|
||||
|
||||
/**
|
||||
* 获取CPU信息
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getCpuInfo")
|
||||
Result<?> getCpuInfo(@RequestParam("ip") String ip,@RequestParam("conditions") String conditions);
|
||||
|
||||
/**
|
||||
* 获取CPU信息列表
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getCpuInfoList")
|
||||
Result<?> getCpuInfoList(@RequestParam("ip") String ip,@RequestParam("conditions") String conditions);
|
||||
|
||||
/**
|
||||
* 获取CPU核心数
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getCpuCoreInfo")
|
||||
Result<?> getCpuCoreInfo(@RequestParam("ip") String ip);
|
||||
|
||||
/**
|
||||
* 获取内存信息
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getMemoryInfo")
|
||||
Result<?> getMemoryInfo(@RequestParam("ip") String ip);
|
||||
|
||||
/**
|
||||
* 获取总内存
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getTotleMemoryInfo")
|
||||
Result<?> getTotleMemoryInfo(@RequestParam("ip") String ip);
|
||||
|
||||
/**
|
||||
* 获取内存信息列表
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getMemoryInfoList")
|
||||
Result<?> getMemoryInfoList(@RequestParam("ip") String ip,@RequestParam("conditions") String conditions);
|
||||
|
||||
/**
|
||||
* 获取网络信息
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getNetworkInfo")
|
||||
Result<?> getNetworkInfo(@RequestParam("ip") String ip,@RequestParam("conditions") String conditions);
|
||||
|
||||
/**
|
||||
* 获取网络信息列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getNetworkInfoList")
|
||||
Result<?> getNetworkInfoList(@RequestParam("ip") String ip,@RequestParam("conditions") String conditions);
|
||||
|
||||
/**
|
||||
* 获取磁盘使用率
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getDiskInfo")
|
||||
Result<?> getDiskInfo(@RequestParam("ip") String ip);
|
||||
|
||||
/**
|
||||
* 获取主机服务列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/monitor/getHostList")
|
||||
Result<?> getHostList();
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package org.jeecg.sample.controller;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.sample.service.IMSSampleAnalysesService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* IMS样品分析大屏
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("sample")
|
||||
@RequiredArgsConstructor
|
||||
public class IMSSampleAnalysesController {
|
||||
|
||||
private final IMSSampleAnalysesService sampleAnalysesService;
|
||||
|
||||
@AutoLog(value = "查询气溶胶样品统计")
|
||||
@GetMapping("countParticulateSample")
|
||||
public Result<?> countParticulateSample() {
|
||||
return Result.ok(sampleAnalysesService.countParticulateSample());
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询气体样品统计率")
|
||||
@GetMapping("countXeSample")
|
||||
public Result<?> countXeSample() {
|
||||
return Result.ok(sampleAnalysesService.countXeSample());
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询待输运的样品列表")
|
||||
@GetMapping("getSamplesTransportList")
|
||||
public Result<?> getSamplesTransportList() {
|
||||
return Result.ok(sampleAnalysesService.getSamplesTransportList());
|
||||
}
|
||||
|
||||
@AutoLog(value = "关闭样品输运记录")
|
||||
@PutMapping("closeSamplesTransportRecord")
|
||||
public Result<?> closeSamplesTransportRecord(@NotNull(message = "样品id不能为空") Integer sampleId) {
|
||||
sampleAnalysesService.closeSamplesTransportRecord(sampleId);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package org.jeecg.sample.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IMSSampleAnalysesMapper extends BaseMapper {
|
||||
|
||||
/**
|
||||
* 统计气溶胶样品数量
|
||||
* @return
|
||||
*/
|
||||
Map<String, Integer> countParticulateSample();
|
||||
|
||||
/**
|
||||
* 统计气体样品数量
|
||||
* @return
|
||||
*/
|
||||
Map<String, Integer> countXeSample();
|
||||
|
||||
/**
|
||||
* 查询待输运的样品列表
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getSamplesTransportList();
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<?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="org.jeecg.sample.mapper.IMSSampleAnalysesMapper">
|
||||
|
||||
<select id="countParticulateSample" resultType="java.util.Map">
|
||||
select
|
||||
sum(case gal.CATEGORY when 1 then 1 else 0 end) as "sample_1",
|
||||
sum(case gal.CATEGORY when 2 then 1 else 0 end) as "sample_2",
|
||||
sum(case gal.CATEGORY when 3 then 1 else 0 end) as "sample_3",
|
||||
sum(case gal.CATEGORY when 4 then 1 else 0 end) as "sample_4",
|
||||
sum(case gal.CATEGORY when 5 then 1 else 0 end) as "sample_5"
|
||||
from ORIGINAL.GARDS_SAMPLE_DATA gsd
|
||||
inner join RNAUTO.GARDS_ANALYSES gal on gsd.SAMPLE_ID = gal.SAMPLE_ID
|
||||
where gsd.SAMPLE_TYPE = 'P'
|
||||
</select>
|
||||
|
||||
<select id="countXeSample" resultType="java.util.Map">
|
||||
select
|
||||
sum(case gal.CATEGORY when 1 then 1 else 0 end) as "sample_1",
|
||||
sum(case gal.CATEGORY when 2 then 1 else 0 end) as "sample_2",
|
||||
sum(case gal.CATEGORY when 3 then 1 else 0 end) as "sample_3"
|
||||
from ORIGINAL.GARDS_SAMPLE_DATA gsd
|
||||
inner join RNAUTO.GARDS_ANALYSES gal on gsd.SAMPLE_ID = gal.SAMPLE_ID
|
||||
where gsd.SAMPLE_TYPE = 'B'
|
||||
</select>
|
||||
|
||||
<select id="getSamplesTransportList" resultType="java.util.Map">
|
||||
SELECT
|
||||
gts.SAMPLE_ID as "sampleId",
|
||||
gst.STATION_CODE as "stationCode",
|
||||
gsd.SAMPLE_TYPE as "sampleType",
|
||||
ga.CATEGORY as "categoy",
|
||||
gsd.ACQUISITION_STOP as "acquisitionStop",
|
||||
gts.TRANSPORT_STATUS as "status",
|
||||
gts.CLOSE_STATUS as "close"
|
||||
FROM
|
||||
RNAUTO.GARDS_TRANSPORT_STATUS gts
|
||||
INNER JOIN RNAUTO.GARDS_ANALYSES ga ON gts.SAMPLE_ID = ga.SAMPLE_ID
|
||||
INNER JOIN ORIGINAL.GARDS_SAMPLE_DATA gsd ON gts.SAMPLE_ID = gsd.SAMPLE_ID
|
||||
INNER JOIN CONFIGURATION.GARDS_STATIONS gst on gsd.STATION_ID = gst.STATION_ID
|
||||
WHERE CLOSE_STATUS = 0
|
||||
ORDER BY gts.MODDATE desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package org.jeecg.sample.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 统计样品数据
|
||||
*/
|
||||
public interface IMSSampleAnalysesService {
|
||||
|
||||
/**
|
||||
* 统计气溶胶样品数量
|
||||
* @return
|
||||
*/
|
||||
Map<String,Integer> countParticulateSample();
|
||||
|
||||
/**
|
||||
* 统计颗粒物样品数量
|
||||
* @return
|
||||
*/
|
||||
Map<String,Integer> countXeSample();
|
||||
|
||||
/**
|
||||
* 查询待输运的样品列表
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getSamplesTransportList();
|
||||
|
||||
/**
|
||||
* 关闭样品输运记录
|
||||
*/
|
||||
void closeSamplesTransportRecord(Integer sampleId);
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package org.jeecg.sample.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.jeecg.common.constant.enums.TransportTaskCloseStatusEnum;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsTransportStatus;
|
||||
import org.jeecg.modules.base.mapper.GardsTransportStatusMapper;
|
||||
import org.jeecg.sample.mapper.IMSSampleAnalysesMapper;
|
||||
import org.jeecg.sample.service.IMSSampleAnalysesService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class IMSSampleAnalysesServiceImpl implements IMSSampleAnalysesService {
|
||||
|
||||
private final IMSSampleAnalysesMapper sampleAnalysesMapper;
|
||||
private final GardsTransportStatusMapper transportStatusMapper;
|
||||
|
||||
/**
|
||||
* 统计气溶胶样品数量
|
||||
* @return
|
||||
*/
|
||||
@DS("ora")
|
||||
@Override
|
||||
public Map<String, Integer> countParticulateSample() {
|
||||
return sampleAnalysesMapper.countParticulateSample();
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计气体样品数量
|
||||
* @return
|
||||
*/
|
||||
@DS("ora")
|
||||
@Override
|
||||
public Map<String, Integer> countXeSample() {
|
||||
return sampleAnalysesMapper.countXeSample();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询待输运的样品列表
|
||||
* @return
|
||||
*/
|
||||
@DS("ora")
|
||||
@Override
|
||||
public List<Map<String, Object>> getSamplesTransportList() {
|
||||
return sampleAnalysesMapper.getSamplesTransportList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭样品输运记录
|
||||
*/
|
||||
@DS("ora")
|
||||
@Override
|
||||
public void closeSamplesTransportRecord(Integer sampleId) {
|
||||
GardsTransportStatus transportStatus = transportStatusMapper.selectById(sampleId);
|
||||
if(Objects.nonNull(transportStatus)){
|
||||
transportStatus.setCloseStatus(TransportTaskCloseStatusEnum.CLOSE.getValue());
|
||||
transportStatusMapper.updateById(transportStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -140,7 +140,7 @@ public class GardsNuclearTestingPlantController {
|
|||
wrapper.eq(GardsNuclearTestingPlant::getName, name);
|
||||
}
|
||||
if (type != null && !type.trim().isEmpty()) {
|
||||
wrapper.eq(GardsNuclearTestingPlant::getType, type);
|
||||
wrapper.eq(GardsNuclearTestingPlant::getCountry, type);
|
||||
}
|
||||
IPage<GardsNuclearTestingPlant> pageResult = gardsNuclearTestingPlantService.page(page, wrapper);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class GardsNuclearTestingPlantServiceImpl extends ServiceImpl<GardsNuclea
|
|||
query.eq(GardsNuclearTestingPlant::getName, name);
|
||||
}
|
||||
if (type != null&&!type.trim().isEmpty()) {
|
||||
query.eq(GardsNuclearTestingPlant::getType, type);
|
||||
query.eq(GardsNuclearTestingPlant::getCountry, type);
|
||||
}
|
||||
return this.list(query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,55 +20,61 @@ public class ServiceMonitorController {
|
|||
|
||||
@AutoLog(value = "查询当前时刻的CPU使用率")
|
||||
@GetMapping("getCpuInfo")
|
||||
public Result<?> getCpuInfo(@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getCpuInfo(conditions));
|
||||
public Result<?> getCpuInfo(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getCpuInfo(ip,conditions));
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询过去指定时间范围内的CPU使用率")
|
||||
@GetMapping("getCpuInfoList")
|
||||
public Result<?> getCpuInfoList(@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getCpuInfoList(conditions));
|
||||
public Result<?> getCpuInfoList(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getCpuInfoList(ip,conditions));
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取CPU核心数")
|
||||
@GetMapping("getCpuCoreInfo")
|
||||
public Result<?> getCpuCoreInfo() {
|
||||
return Result.OK(hostMonitorService.getCpuCoreInfo());
|
||||
public Result<?> getCpuCoreInfo(String ip) {
|
||||
return Result.OK(hostMonitorService.getCpuCoreInfo(ip));
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询当前时刻的内存使用率")
|
||||
@GetMapping("getMemoryInfo")
|
||||
public Result<?> getMemoryInfo() {
|
||||
return Result.OK(hostMonitorService.getMemoryInfo());
|
||||
public Result<?> getMemoryInfo(String ip) {
|
||||
return Result.OK(hostMonitorService.getMemoryInfo(ip));
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取总内存")
|
||||
@GetMapping("getTotleMemoryInfo")
|
||||
public Result<?> getTotleMemoryInfo() {
|
||||
return Result.OK(hostMonitorService.getTotleMemoryInfo());
|
||||
public Result<?> getTotleMemoryInfo(String ip) {
|
||||
return Result.OK(hostMonitorService.getTotleMemoryInfo(ip));
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询过去指定时间范围内的内存使用率")
|
||||
@GetMapping("getMemoryInfoList")
|
||||
public Result<?> getMemoryInfoList(@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getMemoryInfoList(conditions));
|
||||
public Result<?> getMemoryInfoList(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getMemoryInfoList(ip,conditions));
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取网络带宽监测数据")
|
||||
@GetMapping("getNetworkInfo")
|
||||
public Result<?> getNetworkInfo(@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getNetworkInfo(conditions));
|
||||
public Result<?> getNetworkInfo(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getNetworkInfo(ip,conditions));
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取网络带宽监测数据")
|
||||
@GetMapping("getNetworkInfoList")
|
||||
public Result<?> getNetworkInfoList(@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getNetworkInfoList(conditions));
|
||||
public Result<?> getNetworkInfoList(String ip,@NotBlank(message = "查询条件不能为空") String conditions) {
|
||||
return Result.OK(hostMonitorService.getNetworkInfoList(ip,conditions));
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取磁盘使用率")
|
||||
@GetMapping("getDiskInfo")
|
||||
public Result<?> getDiskInfo() {
|
||||
return Result.OK(hostMonitorService.getDiskInfo());
|
||||
public Result<?> getDiskInfo(String ip) {
|
||||
return Result.OK(hostMonitorService.getDiskInfo(ip));
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取主机服务列表")
|
||||
@GetMapping("getHostList")
|
||||
public Result<?> getHostList() {
|
||||
return Result.OK(hostMonitorService.getHostList());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,53 +3,60 @@ package org.jeecg.modules.monitor.service;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public interface HostMonitorService {
|
||||
|
||||
/**
|
||||
* 获取CPU信息
|
||||
*/
|
||||
Map<String,Object> getCpuInfo(String conditions);
|
||||
Map<String,Object> getCpuInfo(String ip,String conditions);
|
||||
|
||||
/**
|
||||
* 获取CPU信息列表
|
||||
*/
|
||||
List<Map<String,Object>> getCpuInfoList(String conditions);
|
||||
List<Map<String,Object>> getCpuInfoList(String ip,String conditions);
|
||||
|
||||
/**
|
||||
* 获取CPU核心数
|
||||
*/
|
||||
Map<String,Object> getCpuCoreInfo();
|
||||
Map<String,Object> getCpuCoreInfo(String ip);
|
||||
|
||||
/**
|
||||
* 获取内存信息
|
||||
*/
|
||||
Map<String,Object> getMemoryInfo();
|
||||
Map<String,Object> getMemoryInfo(String ip);
|
||||
|
||||
/**
|
||||
* 获取内存信息列表
|
||||
*/
|
||||
List<Map<String,Object>> getMemoryInfoList(String conditions);
|
||||
List<Map<String,Object>> getMemoryInfoList(String ip,String conditions);
|
||||
|
||||
/**
|
||||
* 获取总内存
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getTotleMemoryInfo();
|
||||
Map<String, Object> getTotleMemoryInfo(String ip);
|
||||
|
||||
/**
|
||||
* 获取网络信息
|
||||
*/
|
||||
Map<String,Object> getNetworkInfo(String conditions);
|
||||
Map<String,Object> getNetworkInfo(String ip,String conditions);
|
||||
|
||||
/**
|
||||
* 获取网络信息列表
|
||||
* @return
|
||||
*/
|
||||
Map<String,List<Map<String,Object>>> getNetworkInfoList(String conditions);
|
||||
Map<String,List<Map<String,Object>>> getNetworkInfoList(String ip,String conditions);
|
||||
|
||||
/**
|
||||
* 获取磁盘使用率
|
||||
*/
|
||||
Map<String,Object> getDiskInfo();
|
||||
Map<String,Object> getDiskInfo(String ip);
|
||||
|
||||
/**
|
||||
* 获取主机服务列表
|
||||
* @return
|
||||
*/
|
||||
Set<String> getHostList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.monitor.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.constant.enums.PrometheusHostQueryTypeEnum;
|
||||
|
|
@ -32,13 +33,13 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* 获取CPU信息
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> getCpuInfo(String conditions) {
|
||||
public Map<String,Object> getCpuInfo(String ip,String conditions) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
try {
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
//查询CPU利用率
|
||||
PrometheusHostQueryTypeEnum queryTypeEnum = PrometheusHostQueryTypeEnum.getQueryTypeEnum(conditions);
|
||||
String exprTime = queryTypeEnum.getExprTime();
|
||||
|
|
@ -70,13 +71,13 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* 获取CPU信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getCpuInfoList(String conditions) {
|
||||
public List<Map<String, Object>> getCpuInfoList(String ip,String conditions) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
try {
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
//查询CPU利用率
|
||||
PrometheusHostQueryTypeEnum queryTypeEnum = PrometheusHostQueryTypeEnum.getQueryTypeEnum(conditions);
|
||||
long end = Instant.now().getEpochSecond();
|
||||
|
|
@ -116,13 +117,13 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* 获取CPU核心数
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> getCpuCoreInfo() {
|
||||
public Map<String,Object> getCpuCoreInfo(String ip) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
try {
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
//查询CPU核数
|
||||
String cpuCoreQuery = "count(count by (cpu) (node_cpu_seconds_total{instance=\"" + instance + "\"}))";
|
||||
PrometheusResponse response = webClient.get()
|
||||
|
|
@ -150,13 +151,13 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* 获取内存信息
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> getMemoryInfo() {
|
||||
public Map<String,Object> getMemoryInfo(String ip) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
try {
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
//查询总内存
|
||||
// String totalMemoryQuery = "node_memory_MemTotal_bytes{instance=\"" + instance + "\"}";
|
||||
// PrometheusResponse totalMemoryResponse = webClient.get()
|
||||
|
|
@ -222,13 +223,13 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* @param conditions
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String,Object>> getMemoryInfoList(String conditions) {
|
||||
public List<Map<String,Object>> getMemoryInfoList(String ip,String conditions) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
try {
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
//使用率
|
||||
String usageRateQuery = "(1 - (node_memory_MemAvailable_bytes{instance=\""+instance+"\"} / node_memory_MemTotal_bytes{instance=\""+instance+"\"})) * 100";
|
||||
PrometheusHostQueryTypeEnum queryTypeEnum = PrometheusHostQueryTypeEnum.getQueryTypeEnum(conditions);
|
||||
|
|
@ -269,12 +270,12 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getTotleMemoryInfo() {
|
||||
public Map<String, Object> getTotleMemoryInfo(String ip) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
//查询总内存
|
||||
String totalMemoryQuery = "node_memory_MemTotal_bytes{instance=\"" + instance + "\"}";
|
||||
PrometheusResponse totalMemoryResponse = webClient.get()
|
||||
|
|
@ -299,13 +300,13 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* 获取网络信息
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> getNetworkInfo(String conditions) {
|
||||
public Map<String,Object> getNetworkInfo(String ip,String conditions) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
try {
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
PrometheusHostQueryTypeEnum queryTypeEnum = PrometheusHostQueryTypeEnum.getQueryTypeEnum(conditions);
|
||||
String exprTime = queryTypeEnum.getExprTime();
|
||||
//接收带宽 (Kbps)
|
||||
|
|
@ -359,13 +360,13 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, List<Map<String, Object>>> getNetworkInfoList(String conditions) {
|
||||
public Map<String, List<Map<String, Object>>> getNetworkInfoList(String ip,String conditions) {
|
||||
Map<String,List<Map<String, Object>>> result = new HashMap<>();
|
||||
try {
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
//构建查询参数
|
||||
PrometheusHostQueryTypeEnum queryTypeEnum = PrometheusHostQueryTypeEnum.getQueryTypeEnum(conditions);
|
||||
long end = Instant.now().getEpochSecond();
|
||||
|
|
@ -435,13 +436,13 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
* 获取磁盘使用率
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> getDiskInfo() {
|
||||
public Map<String,Object> getDiskInfo(String ip) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
try {
|
||||
//Prometheus 服务器地址
|
||||
String url = serverProperties.getServerUrl();
|
||||
//目标主机实例(node-exporter 的地址)
|
||||
String instance = serverProperties.getInstance();
|
||||
String instance = this.getInstance(ip);
|
||||
//磁盘使用率
|
||||
String diskUsageQuery = "((node_filesystem_size_bytes{instance=\""+instance+"\", device!~\"rootfs\"} - node_filesystem_avail_bytes{instance=\""+instance+"\", device!~\"rootfs\"}) / node_filesystem_size_bytes{instance=\""+instance+"\", device!~\"rootfs\"}) * 100";
|
||||
PrometheusResponse diskUsageResponse = webClient.get()
|
||||
|
|
@ -465,6 +466,34 @@ public class HostMonitorServiceImpl implements HostMonitorService {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主机服务列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getHostList() {
|
||||
return this.serverProperties.getInstances().keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器实例
|
||||
* @param ip
|
||||
* @return
|
||||
*/
|
||||
private String getInstance(String ip) {
|
||||
if(StrUtil.isBlank(ip)){
|
||||
Map.Entry<String, Integer> first = serverProperties.getInstances().entrySet().stream().findFirst().get();
|
||||
return first.getKey()+":"+first.getValue();
|
||||
}
|
||||
if (!serverProperties.getInstances().containsKey(ip)){
|
||||
throw new RuntimeException("此ip不在服务器列表中,请检查监控ip列表配置");
|
||||
}
|
||||
Integer port = serverProperties.getInstances().get(ip);
|
||||
return "192.168.186.143"+":"+port;
|
||||
//return ip+":"+port;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建URI
|
||||
* @param url
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.CoordinateTransformUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearfacility;
|
||||
import org.jeecg.modules.base.entity.configuration.GardsStations;
|
||||
|
|
@ -13,6 +14,7 @@ import org.jeecg.modules.base.mapper.GardsXeResultMapper;
|
|||
import org.jeecg.service.StationDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -39,9 +41,7 @@ public class StationDataServiceImpl implements StationDataService {
|
|||
if(redisUtil.hasKey(CommonConstant.ALL_STATIONS)){
|
||||
return (List<GardsStations>) redisUtil.get(CommonConstant.ALL_STATIONS);
|
||||
}else {
|
||||
LambdaQueryWrapper<GardsStations> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(GardsStations::getStationId,GardsStations::getStationCode,GardsStations::getLon,GardsStations::getLat);
|
||||
List<GardsStations> stations = stationsMapper.selectList(queryWrapper);
|
||||
List<GardsStations> stations = stationsMapper.selectList(new LambdaQueryWrapper<>());
|
||||
redisUtil.set(CommonConstant.ALL_STATIONS,stations);
|
||||
return stations;
|
||||
}
|
||||
|
|
@ -57,12 +57,11 @@ public class StationDataServiceImpl implements StationDataService {
|
|||
return (List<GardsNuclearfacility>) redisUtil.get(CommonConstant.ALL_NUCLEARFACILITY);
|
||||
}else {
|
||||
LambdaQueryWrapper<GardsNuclearfacility> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(GardsNuclearfacility::getFacilityId, GardsNuclearfacility::getFacilityName,GardsNuclearfacility::getLongitude,GardsNuclearfacility::getLatitude);
|
||||
List<GardsNuclearfacility> nuclearfacilities = nuclearfacilityMapper.selectList(queryWrapper);
|
||||
nuclearfacilities.forEach(nuclearfacility -> {
|
||||
//数据库经纬度存储的是反的,所以这里反着处理
|
||||
Double lon = this.lonAndLatConversion(nuclearfacility.getLatitude());
|
||||
Double lat = this.lonAndLatConversion(nuclearfacility.getLongitude());
|
||||
Double lon = CoordinateTransformUtil.lonAndLatConversion(nuclearfacility.getLatitude());
|
||||
Double lat = CoordinateTransformUtil.lonAndLatConversion(nuclearfacility.getLongitude());
|
||||
nuclearfacility.setLonValue(lon);
|
||||
nuclearfacility.setLatValue(lat);
|
||||
});
|
||||
|
|
@ -97,33 +96,4 @@ public class StationDataServiceImpl implements StationDataService {
|
|||
return stationsMapper.selectById(stationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 29°46’04”N
|
||||
* 经纬度转换29°37′50″N -> 29.xxxxx
|
||||
* @param lonOrLatStr
|
||||
* @return
|
||||
*/
|
||||
private Double lonAndLatConversion(String lonOrLatStr) {
|
||||
if(lonOrLatStr.contains("°") && lonOrLatStr.contains("′") && lonOrLatStr.contains("″")){
|
||||
String cleanStr = lonOrLatStr.replaceAll("[NSEW\\s]", "");
|
||||
String[] parts = cleanStr.split("[°′″:\\s]+");
|
||||
String deg = parts[0];
|
||||
String min = parts.length > 1 && !parts[1].isEmpty() ? parts[1] : "0";
|
||||
String sec = parts.length > 2 && !parts[2].isEmpty() ? parts[2] : "0";
|
||||
BigDecimal degBigDecimal = new BigDecimal(deg);
|
||||
BigDecimal minBigDecimal = new BigDecimal(min);
|
||||
BigDecimal secBigDecimal = new BigDecimal(sec);
|
||||
minBigDecimal = minBigDecimal.divide(new BigDecimal("60"), 5, BigDecimal.ROUND_HALF_UP);
|
||||
secBigDecimal = secBigDecimal.divide(new BigDecimal("3600"), 5, BigDecimal.ROUND_HALF_UP);
|
||||
double value = degBigDecimal.doubleValue() + minBigDecimal.doubleValue() + secBigDecimal.doubleValue();
|
||||
return value;
|
||||
}else {
|
||||
if(lonOrLatStr.contains("°") && !lonOrLatStr.contains("′") && !lonOrLatStr.contains("″")){
|
||||
String cleanStr = lonOrLatStr.replaceAll("[NSEW°\\s]", "");
|
||||
return Double.parseDouble(cleanStr);
|
||||
}
|
||||
}
|
||||
return 0D;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,6 +215,8 @@ public class TransportTaskServiceImpl extends ServiceImpl<TransportTaskMapper,Tr
|
|||
public List<TransportTaskLog> getTaskLog(Integer taskId) {
|
||||
LambdaQueryWrapper<TransportTaskLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TransportTaskLog::getTaskId,taskId);
|
||||
queryWrapper.select(TransportTaskLog::getCreateTime,TransportTaskLog::getLogContent);
|
||||
queryWrapper.orderByAsc(TransportTaskLog::getCreateTime);
|
||||
return transportTaskLogMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
|
@ -239,7 +241,7 @@ public class TransportTaskServiceImpl extends ServiceImpl<TransportTaskMapper,Tr
|
|||
@Override
|
||||
public void updateTaskStatusToCompleted(Integer taskId, Double minute) {
|
||||
TransportTask transportTask = this.baseMapper.selectById(taskId);
|
||||
transportTask.setTaskStatus(TransportTaskStatusEnum.FAILURE.getValue());
|
||||
transportTask.setTaskStatus(TransportTaskStatusEnum.COMPLETED.getValue());
|
||||
transportTask.setTimeConsuming(minute);
|
||||
this.baseMapper.updateById(transportTask);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.jeecg.task;
|
|||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.constant.enums.TransportTaskStatusEnum;
|
||||
import org.jeecg.modules.base.entity.TransportTaskLog;
|
||||
import org.jeecg.service.TransportTaskService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -35,6 +36,10 @@ public class ProgressMonitor{
|
|||
try {
|
||||
ProgressEvent event = ProgressQueue.getInstance().take();
|
||||
if(Objects.nonNull(event)) {
|
||||
//flexpart固定报错信息
|
||||
if(event.getContent().trim().startsWith("ERROR STOP")){
|
||||
transportTaskService.updateTaskStatus(event.getTaskId(), TransportTaskStatusEnum.FAILURE.getValue());
|
||||
}
|
||||
TransportTaskLog log = new TransportTaskLog();
|
||||
log.setTaskId(event.getTaskId());
|
||||
log.setLogContent(event.getContent());
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ public class TransportTaskExec extends Thread{
|
|||
}catch (Exception e){
|
||||
String taskErrorLog = "任务执行失败,原因:"+e.getMessage();
|
||||
ProgressQueue.getInstance().offer(new ProgressEvent(this.transportTask.getId(),taskErrorLog));
|
||||
this.transportTaskService.updateTaskStatus(this.transportTask.getId(),TransportTaskStatusEnum.FAILURE.getValue());
|
||||
throw e;
|
||||
}finally {
|
||||
//添加任务耗时
|
||||
|
|
@ -139,6 +140,11 @@ public class TransportTaskExec extends Thread{
|
|||
paramContent.append(this.transportTask.getZ2()).append("\n");
|
||||
paramContent.append(metDataPath).append("\n");
|
||||
paramContent.append(this.simulationProperties.getOutputPath()+File.separator+this.transportTask.getTaskName()).append("\n");
|
||||
if(TransportTaskModeEnum.FORWARD.getKey().equals(this.transportTask.getTaskMode())){
|
||||
paramContent.append(54).append("\n");//物种先固定写54对应XE135
|
||||
} else if (TransportTaskModeEnum.BACK_FORWARD.getKey().equals(this.transportTask.getTaskMode())) {
|
||||
paramContent.append(64).append("\n");//物种先固定对应XE135
|
||||
}
|
||||
FileUtil.writeString(paramContent.toString(),paramConfigPath,"UTF-8");
|
||||
//处理台站数据文件
|
||||
List<String> stationConfigInfo = new ArrayList<>();
|
||||
|
|
@ -151,6 +157,8 @@ public class TransportTaskExec extends Thread{
|
|||
String row = String.format(format,taskChild.getStationCode(),taskChild.getLat(),taskChild.getLon(),taskChild.getReleaseAmount());
|
||||
stationConfigInfo.add(row);
|
||||
});
|
||||
//最后一行需要换行,否则启动flexpart报错
|
||||
stationConfigInfo.add("\n");
|
||||
FileUtil.writeLines(stationConfigInfo,stationsConfigPath,"UTF-8");
|
||||
//获取脚本路径
|
||||
String scriptPath = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user