用户管理模块增加根据用户名查询用户信息
字典管理模块增加根据名称查询对应台站数据接口 web-statistics模块新增根据名称查询对应台站数据调用feign客户端 web-statistics模块新增报警状态数据实体类 web-statistics模块新增报警状态数据mapper web-statistics模块新增分页查询报警状态数据信息接口 状态数据实体类开始时间,操作时间,结束时间列增加时区
This commit is contained in:
parent
a340345cd8
commit
6003bc8cf8
|
@ -35,6 +35,8 @@ public class GardsSohData implements Serializable {
|
||||||
* 状态数据采集开始时间
|
* 状态数据采集开始时间
|
||||||
*/
|
*/
|
||||||
@TableField(value = "START_TIME")
|
@TableField(value = "START_TIME")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +73,7 @@ public class GardsSohData implements Serializable {
|
||||||
* 操作时间
|
* 操作时间
|
||||||
*/
|
*/
|
||||||
@TableField(value = "MODDATE")
|
@TableField(value = "MODDATE")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date moddate;
|
private Date moddate;
|
||||||
|
|
||||||
|
@ -87,4 +89,12 @@ public class GardsSohData implements Serializable {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String detectorName;
|
private String detectorName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -21,6 +22,6 @@ public interface ICacheTimeService {
|
||||||
Map<String, List<GardsDetectors>> findStationDetectors(@RequestBody List<String> stationIds);
|
Map<String, List<GardsDetectors>> findStationDetectors(@RequestBody List<String> stationIds);
|
||||||
|
|
||||||
@RequestMapping("/sys/user/findUserByName")
|
@RequestMapping("/sys/user/findUserByName")
|
||||||
SysUser findUserByName(String userName);
|
SysUser findUserByName(@RequestParam String userName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -701,7 +701,7 @@ public class SysDictController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/findStationListByMenuName")
|
@RequestMapping("/findStationListByMenuName")
|
||||||
public List<GardsStations> findStationListByMenuName(String menuName){
|
public List<GardsStations> findStationListByMenuName(@RequestParam String menuName){
|
||||||
return sysDictService.findStationListByMenuName(menuName);
|
return sysDictService.findStationListByMenuName(menuName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1767,7 +1767,7 @@ public class SysUserController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("findUserByName")
|
@GetMapping("findUserByName")
|
||||||
public SysUser findUserByName(String userName){
|
public SysUser findUserByName(@RequestParam String userName){
|
||||||
return sysUserService.getUserByName(userName);
|
return sysUserService.getUserByName(userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class ReadLineUtil {
|
||||||
for (String line:allLines) {
|
for (String line:allLines) {
|
||||||
//如果当前读取的行内容对应的编码是空 说明不是头部信息
|
//如果当前读取的行内容对应的编码是空 说明不是头部信息
|
||||||
if (SampleFileHeader.getCodeByMessage(line)!=null) {
|
if (SampleFileHeader.getCodeByMessage(line)!=null) {
|
||||||
index = SampleFileHeader.getCodeByMessage(line);
|
index = allLines.indexOf(line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.controller;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.jeecg.common.api.QueryRequest;
|
import org.jeecg.common.api.QueryRequest;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.service.*;
|
import org.jeecg.modules.service.*;
|
||||||
|
@ -61,6 +62,11 @@ public class WebStatisticsController {
|
||||||
return gardsSohDataService.findSohPage(queryRequest, stationIds, startTime, endTime);
|
return gardsSohDataService.findSohPage(queryRequest, stationIds, startTime, endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("findAlertSohPage")
|
||||||
|
public Result findAlertSohPage(QueryRequest queryRequest, Integer[] stationIds,@DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
|
||||||
|
return gardsSohDataService.findAlertSohPage(queryRequest, stationIds, startTime, endTime);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("findGeneratedReport")
|
@GetMapping("findGeneratedReport")
|
||||||
@ApiOperation(value = "查询报告详情页面", notes = "查询报告详情页面")
|
@ApiOperation(value = "查询报告详情页面", notes = "查询报告详情页面")
|
||||||
public Result findGeneratedReport(Integer sampleId){
|
public Result findGeneratedReport(Integer sampleId){
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package org.jeecg.modules.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("ORIGINAL.GARDS_ALERT_DATA")
|
||||||
|
public class GardsAlertData implements Serializable {
|
||||||
|
|
||||||
|
@TableField(value = "STATION_ID")
|
||||||
|
private Integer stationId;
|
||||||
|
|
||||||
|
@TableField(value = "STATION_CODE")
|
||||||
|
private String stationCode;
|
||||||
|
|
||||||
|
@TableField(value = "ALERT_ID")
|
||||||
|
private Integer alertId;
|
||||||
|
|
||||||
|
@TableField(value = "TIME")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date time;
|
||||||
|
|
||||||
|
@TableField(value = "ALERT_TYPE")
|
||||||
|
private String alertType;
|
||||||
|
|
||||||
|
@TableField(value = "ALERT_TEXT")
|
||||||
|
private String alertText;
|
||||||
|
|
||||||
|
@TableField(value = "INPUT_FILE_NAME")
|
||||||
|
private String inputFileName;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package org.jeecg.modules.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.entity.GardsAlertData;
|
||||||
|
|
||||||
|
public interface GardsAlertDataMapper extends BaseMapper<GardsAlertData> {
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.jeecg.common.api.QueryRequest;
|
import org.jeecg.common.api.QueryRequest;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.GardsSohData;
|
import org.jeecg.modules.base.entity.GardsSohData;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -19,4 +20,14 @@ public interface IGardsSohDataService extends IService<GardsSohData> {
|
||||||
*/
|
*/
|
||||||
Result findSohPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
Result findSohPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询报警状态数据信息
|
||||||
|
* @param queryRequest
|
||||||
|
* @param stationIds
|
||||||
|
* @param startTime
|
||||||
|
* @param endTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result findAlertSohPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import org.jeecg.modules.system.entity.GardsStations;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -12,6 +13,6 @@ import java.util.List;
|
||||||
public interface IMenuNameService {
|
public interface IMenuNameService {
|
||||||
|
|
||||||
@RequestMapping("/sys/dict/findStationListByMenuName")
|
@RequestMapping("/sys/dict/findStationListByMenuName")
|
||||||
List<GardsStations> findStationListByMenuName(String menuName);
|
List<GardsStations> findStationListByMenuName(@RequestParam String menuName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,9 +150,9 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
private void findInfo(Integer sampleId, Report report) {
|
private void findInfo(Integer sampleId, Report report) {
|
||||||
//声明多个对象 分别封装独立的信息
|
//声明多个对象 分别封装独立的信息
|
||||||
GeneralInformation generalInformation = new GeneralInformation();
|
GeneralInformation generalInformation = new GeneralInformation();
|
||||||
Comment comment = new Comment();
|
Comment comment = null;
|
||||||
Acquisition acquisition = new Acquisition();
|
Acquisition acquisition = null;
|
||||||
Calibration calibration = new Calibration();
|
Calibration calibration = null;
|
||||||
//获取redis中缓存的台站信息
|
//获取redis中缓存的台站信息
|
||||||
Map<Integer, String> stationMap = (Map<Integer, String>)redisUtil.get("stationMap");
|
Map<Integer, String> stationMap = (Map<Integer, String>)redisUtil.get("stationMap");
|
||||||
//根据sample_id查询sample_data内容
|
//根据sample_id查询sample_data内容
|
||||||
|
@ -172,6 +172,7 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
descriptionQueryWrapper.eq(GardsSampleDescription::getSampleId, sampleId);
|
descriptionQueryWrapper.eq(GardsSampleDescription::getSampleId, sampleId);
|
||||||
GardsSampleDescription gardsSampleDescription = gardsSampleDescriptionMapper.selectOne(descriptionQueryWrapper);
|
GardsSampleDescription gardsSampleDescription = gardsSampleDescriptionMapper.selectOne(descriptionQueryWrapper);
|
||||||
if (Objects.nonNull(gardsSampleData)){
|
if (Objects.nonNull(gardsSampleData)){
|
||||||
|
acquisition = new Acquisition();
|
||||||
//封装数据内容
|
//封装数据内容
|
||||||
generalInformation.setSiteCode(gardsSampleData.getStationName());
|
generalInformation.setSiteCode(gardsSampleData.getStationName());
|
||||||
generalInformation.setDetectorCode(gardsSampleData.getSiteDetCode());
|
generalInformation.setDetectorCode(gardsSampleData.getSiteDetCode());
|
||||||
|
@ -184,6 +185,7 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
acquisition.setAcquisitionLiveTime(gardsSampleData.getAcquisitionLiveSec());
|
acquisition.setAcquisitionLiveTime(gardsSampleData.getAcquisitionLiveSec());
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(gardsSampleAux)){
|
if (Objects.nonNull(gardsSampleAux)){
|
||||||
|
calibration = new Calibration();
|
||||||
generalInformation.setSampleReferenceIdentification(gardsSampleAux.getSampleRefId());
|
generalInformation.setSampleReferenceIdentification(gardsSampleAux.getSampleRefId());
|
||||||
generalInformation.setMeasurementIdentification(gardsSampleAux.getMeasurementId());
|
generalInformation.setMeasurementIdentification(gardsSampleAux.getMeasurementId());
|
||||||
generalInformation.setDetectorBackgroundMeasurementId(gardsSampleAux.getBkgdMeasurementId());
|
generalInformation.setDetectorBackgroundMeasurementId(gardsSampleAux.getBkgdMeasurementId());
|
||||||
|
@ -191,6 +193,7 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
calibration.setDateOfLastCalibration(DateUtils.formatDate(gardsSampleAux.getCalibrationDtg(), "yyyy-MM-dd HH:mm:ss"));
|
calibration.setDateOfLastCalibration(DateUtils.formatDate(gardsSampleAux.getCalibrationDtg(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(gardsSampleDescription)){
|
if (Objects.nonNull(gardsSampleDescription)){
|
||||||
|
comment = new Comment();
|
||||||
comment.setText(gardsSampleDescription.getDescription());
|
comment.setText(gardsSampleDescription.getDescription());
|
||||||
}
|
}
|
||||||
report.setHeaderBlock(generalInformation);
|
report.setHeaderBlock(generalInformation);
|
||||||
|
@ -200,13 +203,15 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findGEnergy(Integer sampleId, Report report) {
|
private void findGEnergy(Integer sampleId, Report report) {
|
||||||
List<GEnergy> gEnergySubBlock = new LinkedList<>();
|
List<GEnergy> gEnergySubBlock = null;
|
||||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "G");
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "G");
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||||
|
calibrationPairsOrigQueryWrapper.orderByAsc(GardsCalibrationPairsOrig::getIdcalpoint);
|
||||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||||
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("energy")).collect(Collectors.toList());
|
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("energy")).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||||
|
gEnergySubBlock = new LinkedList<>();
|
||||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||||
GEnergy gEnergy = new GEnergy();
|
GEnergy gEnergy = new GEnergy();
|
||||||
gEnergy.setEnergy(orig.getYvalue());
|
gEnergy.setEnergy(orig.getYvalue());
|
||||||
|
@ -219,13 +224,15 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findBEnergy(Integer sampleId, Report report) {
|
private void findBEnergy(Integer sampleId, Report report) {
|
||||||
List<BEnergy> bEnergySubBlock = new LinkedList<>();
|
List<BEnergy> bEnergySubBlock = null;
|
||||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "B");
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "B");
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||||
|
calibrationPairsOrigQueryWrapper.orderByAsc(GardsCalibrationPairsOrig::getIdcalpoint);
|
||||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||||
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("energy")).collect(Collectors.toList());
|
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("energy")).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||||
|
bEnergySubBlock = new LinkedList<>();
|
||||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||||
BEnergy bEnergy = new BEnergy();
|
BEnergy bEnergy = new BEnergy();
|
||||||
bEnergy.setElectronEnergy(orig.getYvalue());
|
bEnergy.setElectronEnergy(orig.getYvalue());
|
||||||
|
@ -239,13 +246,15 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findGResolution(Integer sampleId, Report report) {
|
private void findGResolution(Integer sampleId, Report report) {
|
||||||
List<GResolution> gResolutionSubBlock = new LinkedList<>();
|
List<GResolution> gResolutionSubBlock = null;
|
||||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "G");
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "G");
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||||
|
calibrationPairsOrigQueryWrapper.orderByAsc(GardsCalibrationPairsOrig::getIdcalpoint);
|
||||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||||
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("Resolution")).collect(Collectors.toList());
|
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("Resolution")).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||||
|
gResolutionSubBlock = new LinkedList<>();
|
||||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||||
GResolution gResolution = new GResolution();
|
GResolution gResolution = new GResolution();
|
||||||
gResolution.setEnergy(orig.getXvalue());
|
gResolution.setEnergy(orig.getXvalue());
|
||||||
|
@ -258,13 +267,15 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findBResolution(Integer sampleId, Report report) {
|
private void findBResolution(Integer sampleId, Report report) {
|
||||||
List<BResolution> bResolutionSubBlock = new LinkedList<>();
|
List<BResolution> bResolutionSubBlock = null;
|
||||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "B");
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "B");
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||||
|
calibrationPairsOrigQueryWrapper.orderByAsc(GardsCalibrationPairsOrig::getIdcalpoint);
|
||||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||||
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("Resolution")).collect(Collectors.toList());
|
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("Resolution")).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||||
|
bResolutionSubBlock = new LinkedList<>();
|
||||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||||
BResolution bResolution = new BResolution();
|
BResolution bResolution = new BResolution();
|
||||||
bResolution.setElectronEnergy(orig.getXvalue());
|
bResolution.setElectronEnergy(orig.getXvalue());
|
||||||
|
@ -277,13 +288,15 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findGEfficiency(Integer sampleId, Report report) {
|
private void findGEfficiency(Integer sampleId, Report report) {
|
||||||
List<GEfficiency> gEfficiencySubBlock = new LinkedList<>();
|
List<GEfficiency> gEfficiencySubBlock = null;
|
||||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "G");
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleType, "G");
|
||||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||||
|
calibrationPairsOrigQueryWrapper.orderByAsc(GardsCalibrationPairsOrig::getIdcalpoint);
|
||||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||||
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("efficiency")).collect(Collectors.toList());
|
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("efficiency")).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||||
|
gEfficiencySubBlock = new LinkedList<>();
|
||||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||||
GEfficiency gEfficiency = new GEfficiency();
|
GEfficiency gEfficiency = new GEfficiency();
|
||||||
gEfficiency.setEnergy(orig.getXvalue());
|
gEfficiency.setEnergy(orig.getXvalue());
|
||||||
|
@ -296,11 +309,12 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findBgEfficiency(Integer sampleId, Report report) {
|
private void findBgEfficiency(Integer sampleId, Report report) {
|
||||||
List<BEfficiency> bgEfficiencySubBlock = new LinkedList<>();
|
List<BEfficiency> bgEfficiencySubBlock = null;
|
||||||
LambdaQueryWrapper<GardsBgEfficiencyPairs> bgEfficiencyPairsQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsBgEfficiencyPairs> bgEfficiencyPairsQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
bgEfficiencyPairsQueryWrapper.eq(GardsBgEfficiencyPairs::getSampleId, sampleId);
|
bgEfficiencyPairsQueryWrapper.eq(GardsBgEfficiencyPairs::getSampleId, sampleId);
|
||||||
List<GardsBgEfficiencyPairs> gardsBgEfficiencyPairs = gardsBgEfficiencyPairsMapper.selectList(bgEfficiencyPairsQueryWrapper);
|
List<GardsBgEfficiencyPairs> gardsBgEfficiencyPairs = gardsBgEfficiencyPairsMapper.selectList(bgEfficiencyPairsQueryWrapper);
|
||||||
if (CollectionUtils.isNotEmpty(gardsBgEfficiencyPairs)){
|
if (CollectionUtils.isNotEmpty(gardsBgEfficiencyPairs)){
|
||||||
|
bgEfficiencySubBlock = new LinkedList<>();
|
||||||
for (GardsBgEfficiencyPairs pairs:gardsBgEfficiencyPairs) {
|
for (GardsBgEfficiencyPairs pairs:gardsBgEfficiencyPairs) {
|
||||||
BEfficiency bEfficiency = new BEfficiency();
|
BEfficiency bEfficiency = new BEfficiency();
|
||||||
bEfficiency.setRoiNumber(pairs.getRoi());
|
bEfficiency.setRoiNumber(pairs.getRoi());
|
||||||
|
@ -314,11 +328,13 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findRoiLimits(Integer sampleId, Report report) {
|
private void findRoiLimits(Integer sampleId, Report report) {
|
||||||
List<Roi> roiLimitsSubBlock = new LinkedList<>();
|
List<Roi> roiLimitsSubBlock = null;
|
||||||
LambdaQueryWrapper<GardsRoiLimits> roiLimitsQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsRoiLimits> roiLimitsQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
roiLimitsQueryWrapper.eq(GardsRoiLimits::getSampleId, sampleId);
|
roiLimitsQueryWrapper.eq(GardsRoiLimits::getSampleId, sampleId);
|
||||||
|
roiLimitsQueryWrapper.orderByAsc(GardsRoiLimits::getRoi);
|
||||||
List<GardsRoiLimits> gardsRoiLimitsList = gardsRoiLimitsMapper.selectList(roiLimitsQueryWrapper);
|
List<GardsRoiLimits> gardsRoiLimitsList = gardsRoiLimitsMapper.selectList(roiLimitsQueryWrapper);
|
||||||
if (CollectionUtils.isNotEmpty(gardsRoiLimitsList)){
|
if (CollectionUtils.isNotEmpty(gardsRoiLimitsList)){
|
||||||
|
roiLimitsSubBlock = new LinkedList<>();
|
||||||
for (GardsRoiLimits roiLimits:gardsRoiLimitsList) {
|
for (GardsRoiLimits roiLimits:gardsRoiLimitsList) {
|
||||||
Roi roi = new Roi();
|
Roi roi = new Roi();
|
||||||
roi.setRoiNumber(roiLimits.getRoi());
|
roi.setRoiNumber(roiLimits.getRoi());
|
||||||
|
@ -333,11 +349,13 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findRatios(Integer sampleId, Report report) {
|
private void findRatios(Integer sampleId, Report report) {
|
||||||
List<Ratios> ratiosSubBlock = new LinkedList<>();
|
List<Ratios> ratiosSubBlock = null;
|
||||||
LambdaQueryWrapper<GardsSampleRatios> ratiosQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsSampleRatios> ratiosQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
ratiosQueryWrapper.eq(GardsSampleRatios::getSampleId, sampleId);
|
ratiosQueryWrapper.eq(GardsSampleRatios::getSampleId, sampleId);
|
||||||
|
ratiosQueryWrapper.orderByAsc(GardsSampleRatios::getRatioId);
|
||||||
List<GardsSampleRatios> sampleRatiosList = gardsSampleRatiosMapper.selectList(ratiosQueryWrapper);
|
List<GardsSampleRatios> sampleRatiosList = gardsSampleRatiosMapper.selectList(ratiosQueryWrapper);
|
||||||
if (CollectionUtils.isNotEmpty(sampleRatiosList)){
|
if (CollectionUtils.isNotEmpty(sampleRatiosList)){
|
||||||
|
ratiosSubBlock = new LinkedList<>();
|
||||||
for (GardsSampleRatios sampleRatios:sampleRatiosList) {
|
for (GardsSampleRatios sampleRatios:sampleRatiosList) {
|
||||||
Ratios ratios = new Ratios();
|
Ratios ratios = new Ratios();
|
||||||
ratios.setCountRatio(sampleRatios.getCountRatio());
|
ratios.setCountRatio(sampleRatios.getCountRatio());
|
||||||
|
@ -352,12 +370,13 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findGSpectrum(Integer sampleId, Report report) {
|
private void findGSpectrum(Integer sampleId, Report report) {
|
||||||
GammaSpectrum gSpectrumBlock = new GammaSpectrum();
|
GammaSpectrum gSpectrumBlock = null;
|
||||||
LambdaQueryWrapper<GardsSpectrum> spectrumQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsSpectrum> spectrumQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
spectrumQueryWrapper.eq(GardsSpectrum::getSampleType, "G");
|
spectrumQueryWrapper.eq(GardsSpectrum::getSampleType, "G");
|
||||||
spectrumQueryWrapper.eq(GardsSpectrum::getSampleId, sampleId);
|
spectrumQueryWrapper.eq(GardsSpectrum::getSampleId, sampleId);
|
||||||
GardsSpectrum gardsSpectrum = gardsSpectrumMapper.selectOne(spectrumQueryWrapper);
|
GardsSpectrum gardsSpectrum = gardsSpectrumMapper.selectOne(spectrumQueryWrapper);
|
||||||
if (Objects.nonNull(gardsSpectrum)){
|
if (Objects.nonNull(gardsSpectrum)){
|
||||||
|
gSpectrumBlock = new GammaSpectrum();
|
||||||
Map<String, Object> map = readLineUtil.readLine(gardsSpectrum.getFileName(), SampleFileHeader.GSPECTRUM.getMessage());
|
Map<String, Object> map = readLineUtil.readLine(gardsSpectrum.getFileName(), SampleFileHeader.GSPECTRUM.getMessage());
|
||||||
List<Integer> gSpectrumSubBlock = new LinkedList<>();
|
List<Integer> gSpectrumSubBlock = new LinkedList<>();
|
||||||
if (CollectionUtils.isNotEmpty(map)){
|
if (CollectionUtils.isNotEmpty(map)){
|
||||||
|
@ -371,12 +390,13 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findBSpectrum(Integer sampleId, Report report) {
|
private void findBSpectrum(Integer sampleId, Report report) {
|
||||||
BetaSpectrum bSpectrumBlock = new BetaSpectrum();
|
BetaSpectrum bSpectrumBlock = null;
|
||||||
LambdaQueryWrapper<GardsSpectrum> spectrumQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsSpectrum> spectrumQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
spectrumQueryWrapper.eq(GardsSpectrum::getSampleType, "B");
|
spectrumQueryWrapper.eq(GardsSpectrum::getSampleType, "B");
|
||||||
spectrumQueryWrapper.eq(GardsSpectrum::getSampleId, sampleId);
|
spectrumQueryWrapper.eq(GardsSpectrum::getSampleId, sampleId);
|
||||||
GardsSpectrum gardsSpectrum = gardsSpectrumMapper.selectOne(spectrumQueryWrapper);
|
GardsSpectrum gardsSpectrum = gardsSpectrumMapper.selectOne(spectrumQueryWrapper);
|
||||||
if (Objects.nonNull(gardsSpectrum)){
|
if (Objects.nonNull(gardsSpectrum)){
|
||||||
|
bSpectrumBlock = new BetaSpectrum();
|
||||||
Map<String, Object> map = readLineUtil.readLine(gardsSpectrum.getFileName(), SampleFileHeader.BSPECTRUM.getMessage());
|
Map<String, Object> map = readLineUtil.readLine(gardsSpectrum.getFileName(), SampleFileHeader.BSPECTRUM.getMessage());
|
||||||
List<Integer> bSpectrumSubBlock = new LinkedList<>();
|
List<Integer> bSpectrumSubBlock = new LinkedList<>();
|
||||||
if (CollectionUtils.isNotEmpty(map)) {
|
if (CollectionUtils.isNotEmpty(map)) {
|
||||||
|
@ -390,11 +410,12 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findHistogram(Integer sampleId, Report report) {
|
private void findHistogram(Integer sampleId, Report report) {
|
||||||
Histogram histogramBlock = new Histogram();
|
Histogram histogramBlock = null;
|
||||||
LambdaQueryWrapper<GardsHistogram> histogramQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsHistogram> histogramQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
histogramQueryWrapper.eq(GardsHistogram::getSampleId, sampleId);
|
histogramQueryWrapper.eq(GardsHistogram::getSampleId, sampleId);
|
||||||
GardsHistogram gardsHistogram = gardsHistogramMapper.selectOne(histogramQueryWrapper);
|
GardsHistogram gardsHistogram = gardsHistogramMapper.selectOne(histogramQueryWrapper);
|
||||||
if (Objects.nonNull(gardsHistogram)){
|
if (Objects.nonNull(gardsHistogram)){
|
||||||
|
histogramBlock = new Histogram();
|
||||||
Map<String, Object> map = readLineUtil.readLine(gardsHistogram.getFileName(), SampleFileHeader.HISTOGRAM.getMessage());
|
Map<String, Object> map = readLineUtil.readLine(gardsHistogram.getFileName(), SampleFileHeader.HISTOGRAM.getMessage());
|
||||||
List<HistogramData> histogramSubBlock = new LinkedList<>();
|
List<HistogramData> histogramSubBlock = new LinkedList<>();
|
||||||
if (CollectionUtils.isNotEmpty(map)) {
|
if (CollectionUtils.isNotEmpty(map)) {
|
||||||
|
@ -410,12 +431,12 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findCertificate(Integer sampleId, Report report) {
|
private void findCertificate(Integer sampleId, Report report) {
|
||||||
Certificate certificateBlock = new Certificate();
|
Certificate certificateBlock = null;
|
||||||
List<CertificateLine> certificateSubBlock = new LinkedList<>();
|
|
||||||
LambdaQueryWrapper<GardsSampleCert> sampleCertQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsSampleCert> sampleCertQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
sampleCertQueryWrapper.eq(GardsSampleCert::getSampleId, sampleId);
|
sampleCertQueryWrapper.eq(GardsSampleCert::getSampleId, sampleId);
|
||||||
GardsSampleCert gardsSampleCert = gardsSampleCertMapper.selectOne(sampleCertQueryWrapper);
|
GardsSampleCert gardsSampleCert = gardsSampleCertMapper.selectOne(sampleCertQueryWrapper);
|
||||||
if (Objects.nonNull(gardsSampleCert)){
|
if (Objects.nonNull(gardsSampleCert)) {
|
||||||
|
certificateBlock = new Certificate();
|
||||||
certificateBlock.setTotalSourceActivity(gardsSampleCert.getQuantity());
|
certificateBlock.setTotalSourceActivity(gardsSampleCert.getQuantity());
|
||||||
certificateBlock.setAssayDate(DateUtils.formatDate(gardsSampleCert.getAssayDate(), "yyyy-MM-dd HH:mm:ss"));
|
certificateBlock.setAssayDate(DateUtils.formatDate(gardsSampleCert.getAssayDate(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
certificateBlock.setUnitsOfActivity(gardsSampleCert.getUnit());
|
certificateBlock.setUnitsOfActivity(gardsSampleCert.getUnit());
|
||||||
|
@ -423,7 +444,11 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
LambdaQueryWrapper<GardsSampleCertLine> sampleCertLineQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsSampleCertLine> sampleCertLineQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
sampleCertLineQueryWrapper.eq(GardsSampleCertLine::getSampleId, sampleId);
|
sampleCertLineQueryWrapper.eq(GardsSampleCertLine::getSampleId, sampleId);
|
||||||
List<GardsSampleCertLine> gardsSampleCertLines = gardsSampleCertLineMapper.selectList(sampleCertLineQueryWrapper);
|
List<GardsSampleCertLine> gardsSampleCertLines = gardsSampleCertLineMapper.selectList(sampleCertLineQueryWrapper);
|
||||||
if (CollectionUtils.isNotEmpty(gardsSampleCertLines)){
|
if (CollectionUtils.isNotEmpty(gardsSampleCertLines)) {
|
||||||
|
if (Objects.isNull(certificateBlock)){
|
||||||
|
certificateBlock = new Certificate();
|
||||||
|
}
|
||||||
|
List<CertificateLine> certificateSubBlock = new LinkedList<>();
|
||||||
for (GardsSampleCertLine sampleCertLine:gardsSampleCertLines) {
|
for (GardsSampleCertLine sampleCertLine:gardsSampleCertLines) {
|
||||||
CertificateLine certificateLine = new CertificateLine();
|
CertificateLine certificateLine = new CertificateLine();
|
||||||
certificateLine.setNuclideName(sampleCertLine.getNuclName());
|
certificateLine.setNuclideName(sampleCertLine.getNuclName());
|
||||||
|
@ -437,8 +462,8 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
certificateLine.setParticleBIntensity(sampleCertLine.getBAbundance());
|
certificateLine.setParticleBIntensity(sampleCertLine.getBAbundance());
|
||||||
certificateSubBlock.add(certificateLine);
|
certificateSubBlock.add(certificateLine);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
certificateBlock.setCertificateSubBlock(certificateSubBlock);
|
certificateBlock.setCertificateSubBlock(certificateSubBlock);
|
||||||
|
}
|
||||||
report.setCertificateBlock(certificateBlock);
|
report.setCertificateBlock(certificateBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,8 @@ import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.util.DateUtils;
|
import org.jeecg.common.util.DateUtils;
|
||||||
import org.jeecg.common.util.RedisUtil;
|
import org.jeecg.common.util.RedisUtil;
|
||||||
import org.jeecg.modules.base.entity.GardsSohData;
|
import org.jeecg.modules.base.entity.GardsSohData;
|
||||||
|
import org.jeecg.modules.entity.GardsAlertData;
|
||||||
|
import org.jeecg.modules.mapper.GardsAlertDataMapper;
|
||||||
import org.jeecg.modules.mapper.GardsSohDataMapper;
|
import org.jeecg.modules.mapper.GardsSohDataMapper;
|
||||||
import org.jeecg.modules.service.IGardsSohDataService;
|
import org.jeecg.modules.service.IGardsSohDataService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -26,6 +28,8 @@ public class GardsSohDataServiceImpl extends ServiceImpl<GardsSohDataMapper, Gar
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
@Autowired
|
||||||
|
private GardsAlertDataMapper gardsAlertDataMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result findSohPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime) {
|
public Result findSohPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime) {
|
||||||
|
@ -54,10 +58,16 @@ public class GardsSohDataServiceImpl extends ServiceImpl<GardsSohDataMapper, Gar
|
||||||
queryWrapper.le(GardsSohData::getStartTime, endDate);
|
queryWrapper.le(GardsSohData::getStartTime, endDate);
|
||||||
Page<GardsSohData> sohDataPage = this.baseMapper.selectPage(page, queryWrapper);
|
Page<GardsSohData> sohDataPage = this.baseMapper.selectPage(page, queryWrapper);
|
||||||
sohDataPage.getRecords().forEach(item->{
|
sohDataPage.getRecords().forEach(item->{
|
||||||
if (Objects.nonNull(item.getDetectorId()) && detectorsMap.containsKey(item.getDetectorId().toString())){
|
if (Objects.nonNull(item.getDetectorId()) && detectorsMap.containsKey(item.getDetectorId().toString())) {
|
||||||
String detectorName = detectorsMap.get(item.getDetectorId().toString());
|
String detectorName = detectorsMap.get(item.getDetectorId().toString());
|
||||||
item.setDetectorName(detectorName);
|
item.setDetectorName(detectorName);
|
||||||
}
|
}
|
||||||
|
if (Objects.nonNull(item.getStartTime())) {
|
||||||
|
long endSecond = (item.getStartTime().getTime() / 1000) + Long.valueOf(item.getTime());
|
||||||
|
Date endDateTime = new Date();
|
||||||
|
endDateTime.setTime(endSecond*1000);
|
||||||
|
item.setEndTime(endDateTime);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(sohDataPage);
|
result.setResult(sohDataPage);
|
||||||
|
@ -67,4 +77,38 @@ public class GardsSohDataServiceImpl extends ServiceImpl<GardsSohDataMapper, Gar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result findAlertSohPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime) {
|
||||||
|
try {
|
||||||
|
Result result = new Result();
|
||||||
|
if (Objects.isNull(stationIds)){
|
||||||
|
result.setResult(Collections.emptyList());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (Objects.isNull(startTime)){
|
||||||
|
result.error500("开始时间不能为空");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (Objects.isNull(endTime)){
|
||||||
|
result.error500("结束时间不能为空");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
Date startDate = DateUtils.parseDate(DateUtils.formatDate(startTime, "yyyy-MM-dd") + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
|
||||||
|
Date endDate = DateUtils.parseDate(DateUtils.formatDate(endTime, "yyyy-MM-dd") + " 23:59:59", "yyyy-MM-dd HH:mm:ss");
|
||||||
|
//获取redis中缓存的探测器信息
|
||||||
|
Map<Integer, String> detectorsMap = (Map<Integer, String>)redisUtil.get("detectorsMap");
|
||||||
|
Page<GardsAlertData> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
||||||
|
LambdaQueryWrapper<GardsAlertData> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.in(GardsAlertData::getStationId, stationIds);
|
||||||
|
queryWrapper.ge(GardsAlertData::getTime, startDate);
|
||||||
|
queryWrapper.le(GardsAlertData::getTime, endDate);
|
||||||
|
Page<GardsAlertData> alertDataPage = gardsAlertDataMapper.selectPage(page, queryWrapper);
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(alertDataPage);
|
||||||
|
return result;
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user