feat:导出功能完善
This commit is contained in:
parent
4410bf68d3
commit
a704571b04
|
@ -0,0 +1,41 @@
|
||||||
|
package org.jeecg.common.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
import static com.google.common.net.MediaType.OCTET_STREAM;
|
||||||
|
|
||||||
|
public class ExportUtil {
|
||||||
|
|
||||||
|
private static final String UTF_8 = StandardCharsets.UTF_8.name();
|
||||||
|
|
||||||
|
public static OutputStream xls(HttpServletResponse response,String fileName) throws IOException {
|
||||||
|
response.setCharacterEncoding(UTF_8);
|
||||||
|
response.setContentType("application/vnd.ms-excel");
|
||||||
|
String name = URLEncoder.encode(fileName, UTF_8);
|
||||||
|
response.setHeader("Content-disposition", "attachment;filename=" + name);
|
||||||
|
return response.getOutputStream();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OutputStream xlsx(HttpServletResponse response,String fileName) throws IOException {
|
||||||
|
response.setCharacterEncoding(UTF_8);
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
String name = URLEncoder.encode(fileName, UTF_8);
|
||||||
|
response.setHeader("Content-disposition", "attachment;filename=" + name);
|
||||||
|
return response.getOutputStream();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OutputStream stream(HttpServletResponse response,String fileName) throws IOException {
|
||||||
|
response.setCharacterEncoding(UTF_8);
|
||||||
|
response.setContentType("application/octet-stream");
|
||||||
|
String name = URLEncoder.encode(fileName, UTF_8);
|
||||||
|
response.setHeader("Content-disposition", "attachment;filename=" + name);
|
||||||
|
return response.getOutputStream();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package org.jeecg.modules.base.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SampleDataDto implements Serializable {
|
||||||
|
|
||||||
|
@Excel(name = "NO" ,orderNum = "1")
|
||||||
|
private Integer no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台站名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "STATION" ,orderNum = "2")
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 样品采集开始时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "START TIME",format = "yyyy-MM-dd HH:mm:ss",orderNum = "3",width = 30)
|
||||||
|
private Date collectStart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 样品采集结束时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "STOP TIME",format = "yyyy-MM-dd HH:mm:ss",orderNum = "4",width = 30)
|
||||||
|
private Date collectStop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 样品id
|
||||||
|
*/
|
||||||
|
@Excel(name = "SID" ,orderNum = "5")
|
||||||
|
private Integer sampleId;
|
||||||
|
|
||||||
|
public SampleDataDto(GardsSampleData sampleData) {
|
||||||
|
this.no = sampleData.getNo();
|
||||||
|
this.stationName = sampleData.getStationName();
|
||||||
|
this.collectStart = sampleData.getCollectStart();
|
||||||
|
this.collectStop = sampleData.getCollectStop();
|
||||||
|
this.sampleId = sampleData.getSampleId();
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Email;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -37,6 +39,7 @@ public class GardsMetData implements Serializable {
|
||||||
@TableField(value = "START_TIME")
|
@TableField(value = "START_TIME")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "START TIME",orderNum = "2",width = 30,format = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,18 +48,21 @@ public class GardsMetData implements Serializable {
|
||||||
@TableField(value = "END_TIME")
|
@TableField(value = "END_TIME")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "END TIME",orderNum = "3",width = 30,format = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平均湿度(%)
|
* 平均湿度(%)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "AVE_HUMIDITY")
|
@TableField(value = "AVE_HUMIDITY")
|
||||||
|
@Excel(name = "AVG.REL.HUMIDITY",orderNum = "5",width = 30)
|
||||||
private Integer aveHumidity;
|
private Integer aveHumidity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平均温度(℃)
|
* 平均温度(℃)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "AVGTEMPERATURE")
|
@TableField(value = "AVGTEMPERATURE")
|
||||||
|
@Excel(name = "AVG.TEMP",orderNum = "7",width = 30)
|
||||||
private Integer avgtemperature;
|
private Integer avgtemperature;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,18 +75,21 @@ public class GardsMetData implements Serializable {
|
||||||
* 平均风向(偏离正北的度数)
|
* 平均风向(偏离正北的度数)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "AVE_WIND_DIR")
|
@TableField(value = "AVE_WIND_DIR")
|
||||||
|
@Excel(name = "AVG.WIND.DIRECTION",orderNum = "8",width = 30)
|
||||||
private Integer aveWindDir;
|
private Integer aveWindDir;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平均风速(m/s)
|
* 平均风速(m/s)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "AVE_WIND_SPEED")
|
@TableField(value = "AVE_WIND_SPEED")
|
||||||
|
@Excel(name = "AVG.WIND.SPEED",orderNum = "9",width = 30)
|
||||||
private Integer aveWindSpeed;
|
private Integer aveWindSpeed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 降雨量(mm)
|
* 降雨量(mm)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "RAINFALL")
|
@TableField(value = "RAINFALL")
|
||||||
|
@Excel(name = "RAINFALL", orderNum = "4",width = 20)
|
||||||
private Integer rainfall;
|
private Integer rainfall;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,4 +106,8 @@ public class GardsMetData implements Serializable {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date moddate;
|
private Date moddate;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "NO",orderNum = "1")
|
||||||
|
private Integer no;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.ExcelIgnore;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.ExcelTarget;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -16,12 +19,14 @@ public class GardsSampleData implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 探测器编码
|
* 探测器编码
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "DETECTOR CODE",orderNum = "3",width = 20)
|
||||||
@TableField(value = "SITE_DET_CODE")
|
@TableField(value = "SITE_DET_CODE")
|
||||||
private String siteDetCode;
|
private String siteDetCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 样品id
|
* 样品id
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "SAMPLE_ID")
|
@TableField(value = "SAMPLE_ID")
|
||||||
private Integer sampleId;
|
private Integer sampleId;
|
||||||
|
|
||||||
|
@ -34,12 +39,14 @@ public class GardsSampleData implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 探测器id
|
* 探测器id
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "DETECTOR_ID")
|
@TableField(value = "DETECTOR_ID")
|
||||||
private Integer detectorId;
|
private Integer detectorId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入文件名称
|
* 导入文件名称
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "INPUT_FILE_NAME")
|
@TableField(value = "INPUT_FILE_NAME")
|
||||||
private String inputFileName;
|
private String inputFileName;
|
||||||
|
|
||||||
|
@ -48,6 +55,7 @@ public class GardsSampleData implements Serializable {
|
||||||
* γ-spectrometry or 2-D β-γ coincidence
|
* γ-spectrometry or 2-D β-γ coincidence
|
||||||
* detection))
|
* detection))
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "SAMPLE_TYPE")
|
@TableField(value = "SAMPLE_TYPE")
|
||||||
private String sampleType;
|
private String sampleType;
|
||||||
|
|
||||||
|
@ -59,6 +67,7 @@ public class GardsSampleData implements Serializable {
|
||||||
* C:CALIBPHD
|
* C:CALIBPHD
|
||||||
* Q:QCPHD)
|
* Q:QCPHD)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "DATA_TYPE")
|
@TableField(value = "DATA_TYPE")
|
||||||
private String dataType;
|
private String dataType;
|
||||||
|
|
||||||
|
@ -71,6 +80,7 @@ public class GardsSampleData implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 能谱限定符: 过程谱(PREL) 和 全谱(FULL)
|
* 能谱限定符: 过程谱(PREL) 和 全谱(FULL)
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "SPECTRAL QUALIFIER",orderNum = "4",width = 30)
|
||||||
@TableField(value = "SPECTRAL_QUALIFIE")
|
@TableField(value = "SPECTRAL_QUALIFIE")
|
||||||
private String spectralQualifie;
|
private String spectralQualifie;
|
||||||
|
|
||||||
|
@ -88,6 +98,7 @@ public class GardsSampleData implements Serializable {
|
||||||
@TableField(value = "COLLECT_START")
|
@TableField(value = "COLLECT_START")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Excel(name = "COLLECTION START TIME",format = "yyyy-MM-dd HH:mm:ss",orderNum = "5",width = 30)
|
||||||
private Date collectStart;
|
private Date collectStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,6 +107,7 @@ public class GardsSampleData implements Serializable {
|
||||||
@TableField(value = "COLLECT_STOP")
|
@TableField(value = "COLLECT_STOP")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Excel(name = "COLLECTION STOP TIME",format = "yyyy-MM-dd HH:mm:ss",orderNum = "6",width = 30)
|
||||||
private Date collectStop;
|
private Date collectStop;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -104,6 +116,7 @@ public class GardsSampleData implements Serializable {
|
||||||
@TableField(value = "ACQUISITION_START")
|
@TableField(value = "ACQUISITION_START")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Excel(name = "ACQUISITION START TIME",format = "yyyy-MM-dd HH:mm:ss",orderNum = "5",width = 30)
|
||||||
private Date acquisitionStart;
|
private Date acquisitionStart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,29 +125,34 @@ public class GardsSampleData implements Serializable {
|
||||||
@TableField(value = "ACQUISITION_STOP")
|
@TableField(value = "ACQUISITION_STOP")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Excel(name = "ACQUISITION STOP TIME",format = "yyyy-MM-dd HH:mm:ss",orderNum = "6",width = 30)
|
||||||
private Date acquisitionStop;
|
private Date acquisitionStop;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 能谱获取实时间
|
* 能谱获取实时间
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "ACQUISITION_REAL_SEC")
|
@TableField(value = "ACQUISITION_REAL_SEC")
|
||||||
private Double acquisitionRealSec;
|
private Double acquisitionRealSec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 能谱获取活时间
|
* 能谱获取活时间
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "ACQUISITION_LIVE_SEC")
|
@TableField(value = "ACQUISITION_LIVE_SEC")
|
||||||
private Double acquisitionLiveSec;
|
private Double acquisitionLiveSec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采样量(立方米)
|
* 采样量(立方米)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "QUANTITY")
|
@TableField(value = "QUANTITY")
|
||||||
private Double quantity;
|
private Double quantity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 样品处理状态
|
* 样品处理状态
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@TableField(value = "STATUS")
|
@TableField(value = "STATUS")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@ -142,6 +160,7 @@ public class GardsSampleData implements Serializable {
|
||||||
* 操作时间
|
* 操作时间
|
||||||
*/
|
*/
|
||||||
@TableField(value = "MODDATE")
|
@TableField(value = "MODDATE")
|
||||||
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date moddate;
|
private Date moddate;
|
||||||
|
|
||||||
|
@ -149,6 +168,7 @@ public class GardsSampleData implements Serializable {
|
||||||
* 台站名称
|
* 台站名称
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "STATION" ,orderNum = "2")
|
||||||
private String stationName;
|
private String stationName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -159,9 +179,13 @@ public class GardsSampleData implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "CALIB REPORTS" ,orderNum = "7")
|
||||||
private String calibReports;
|
private String calibReports;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String dbName;
|
private String dbName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "NO" ,orderNum = "1")
|
||||||
|
private Integer no;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -22,6 +23,7 @@ public class GardsSohData implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 台站代码
|
* 台站代码
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "STATION",orderNum = "2")
|
||||||
@TableField(value = "STATION_CODE")
|
@TableField(value = "STATION_CODE")
|
||||||
private String stationCode;
|
private String stationCode;
|
||||||
|
|
||||||
|
@ -29,6 +31,7 @@ public class GardsSohData implements Serializable {
|
||||||
* 报警ID号
|
* 报警ID号
|
||||||
*/
|
*/
|
||||||
@TableField(value = "SOH_ID")
|
@TableField(value = "SOH_ID")
|
||||||
|
@Excel(name = "SID",orderNum = "5")
|
||||||
private Integer sohId;
|
private Integer sohId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,6 +40,7 @@ public class GardsSohData implements Serializable {
|
||||||
@TableField(value = "START_TIME")
|
@TableField(value = "START_TIME")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@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")
|
||||||
|
@Excel(name = "START TIME",orderNum = "3",width = 30,format = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,6 +93,10 @@ public class GardsSohData implements Serializable {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@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")
|
||||||
|
@Excel(name = "START TIME",orderNum = "4",width = 30,format = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "NO",orderNum = "1")
|
||||||
|
private Integer no;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package org.jeecg.modules.base.enums;
|
package org.jeecg.modules.base.enums;
|
||||||
|
|
||||||
public enum PageType {
|
public enum PageType {
|
||||||
ARR("arr"), RRR("rrr");
|
ARR("arr"), RRR("rrr"),
|
||||||
|
ACQ("ACQ"), CALIB("CALIB"), COLL("COLL");
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.jeecg.modules.controller;
|
package org.jeecg.modules.controller;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.jeecg.common.api.QueryRequest;
|
import org.jeecg.common.api.QueryRequest;
|
||||||
import org.jeecg.common.api.dto.message.MessageDTO;
|
import org.jeecg.common.api.dto.message.MessageDTO;
|
||||||
|
@ -17,6 +18,7 @@ import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("alarmLog")
|
@RequestMapping("alarmLog")
|
||||||
|
@Api(value = "报警日志服务", tags = "报警日志服务")
|
||||||
public class AlarmLogController {
|
public class AlarmLogController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -67,19 +69,4 @@ public class AlarmLogController {
|
||||||
public Result deleteById(String id){
|
public Result deleteById(String id){
|
||||||
return alarmLogService.deleteById(id);
|
return alarmLogService.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("test")
|
|
||||||
public void test(){
|
|
||||||
MessageDTO message = new MessageDTO();
|
|
||||||
message.setFromUser("admin");
|
|
||||||
message.setToUser("nieziyan");
|
|
||||||
message.setTitle("测试消息");
|
|
||||||
message.setType(MessageTypeEnum.XT.getType());
|
|
||||||
message.setTemplateCode("SYS001");
|
|
||||||
Map<String,Object> data = new HashMap<>();
|
|
||||||
data.put("userName","聂子炎");
|
|
||||||
data.put("taskName","请假申请");
|
|
||||||
message.setData(data);
|
|
||||||
sysBaseAPI.sendTemplateMessage(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.jeecg.modules.controller;
|
package org.jeecg.modules.controller;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.constant.EmailConstant;
|
import org.jeecg.common.constant.EmailConstant;
|
||||||
import org.jeecg.common.util.RedisStreamUtil;
|
import org.jeecg.common.util.RedisStreamUtil;
|
||||||
|
@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("sysEmailLog")
|
@RequestMapping("sysEmailLog")
|
||||||
@Api(value = "邮箱日志", tags = "邮箱日志")
|
@Api(value = "邮箱日志服务", tags = "邮箱日志服务")
|
||||||
public class SysEmailLogController {
|
public class SysEmailLogController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysEmailLogService sysEmailLogService;
|
private ISysEmailLogService sysEmailLogService;
|
||||||
|
@ -25,15 +26,8 @@ public class SysEmailLogController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisStreamUtil redisStreamUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 邮箱服务器连接状态 正常/断开
|
|
||||||
*
|
|
||||||
* @param emailId 电子邮件id
|
|
||||||
*/
|
|
||||||
@GetMapping("status")
|
@GetMapping("status")
|
||||||
|
@ApiOperation("邮箱服务器状态")
|
||||||
public Result status(@RequestParam("emailId") String emailId){
|
public Result status(@RequestParam("emailId") String emailId){
|
||||||
String key = EmailConstant.EMAIL_STATUS_PREFIX;
|
String key = EmailConstant.EMAIL_STATUS_PREFIX;
|
||||||
Boolean emailSatus = (Boolean) redisUtil.hget(key, emailId);
|
Boolean emailSatus = (Boolean) redisUtil.hget(key, emailId);
|
||||||
|
@ -41,49 +35,28 @@ public class SysEmailLogController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("space")
|
@GetMapping("space")
|
||||||
|
@ApiOperation("邮箱服务器空间")
|
||||||
public Result space(@RequestParam("emailId") String emailId){
|
public Result space(@RequestParam("emailId") String emailId){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 分别获取今天、昨天、过去一周邮件量
|
|
||||||
*
|
|
||||||
* @param emailId 电子邮件id
|
|
||||||
*/
|
|
||||||
@GetMapping("total")
|
@GetMapping("total")
|
||||||
|
@ApiOperation("今天|昨天|过去一周邮件量")
|
||||||
public Result totalEmail(@RequestParam("emailId") String emailId){
|
public Result totalEmail(@RequestParam("emailId") String emailId){
|
||||||
return sysEmailLogService.totalEmail(emailId);
|
return sysEmailLogService.totalEmail(emailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 今天邮件接收量 按小时划分
|
|
||||||
*
|
|
||||||
* @param emailId 电子邮件id
|
|
||||||
*/
|
|
||||||
@GetMapping("today")
|
@GetMapping("today")
|
||||||
|
@ApiOperation("今日邮件接收量")
|
||||||
public Result today(@RequestParam("emailId") String emailId){
|
public Result today(@RequestParam("emailId") String emailId){
|
||||||
return sysEmailLogService.today(emailId);
|
return sysEmailLogService.today(emailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据日期筛选(折线图)
|
|
||||||
*
|
|
||||||
* @param emailId 电子邮件id
|
|
||||||
*/
|
|
||||||
@GetMapping("analysis")
|
@GetMapping("analysis")
|
||||||
|
@ApiOperation("根据日期统计-折线图")
|
||||||
public Result analysis(@RequestParam("emailId") String emailId,
|
public Result analysis(@RequestParam("emailId") String emailId,
|
||||||
@RequestParam("startDate") String startDate,
|
@RequestParam("startDate") String startDate,
|
||||||
@RequestParam("endDate") String endDate){
|
@RequestParam("endDate") String endDate){
|
||||||
return sysEmailLogService.analysis(emailId, startDate, endDate);
|
return sysEmailLogService.analysis(emailId, startDate, endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("test")
|
|
||||||
public void test(String groupId){
|
|
||||||
// sendMessage.send(groupId);
|
|
||||||
WarnDto warnDto = new WarnDto();
|
|
||||||
warnDto.setSourceType(SourceType.DATABASE).setValue(80d)
|
|
||||||
.setSourceId("1").setItem(Item.CPU_UTILIZ);
|
|
||||||
redisStreamUtil.pushWarn(warnDto);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package org.jeecg.modules.feignclient;
|
||||||
|
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@FeignClient(name = "monitorClient",url = "${monitor.url}")
|
||||||
|
public interface MonitorClient {
|
||||||
|
@GetMapping("list")
|
||||||
|
Result<?> monList(@RequestParam String code,
|
||||||
|
@RequestParam String hostId,
|
||||||
|
@RequestParam Integer pageNo,
|
||||||
|
@RequestParam Integer pageSize,
|
||||||
|
@RequestParam String status,
|
||||||
|
@RequestParam String type);
|
||||||
|
|
||||||
|
@GetMapping("log")
|
||||||
|
Result<?> monLog(@RequestParam String code,
|
||||||
|
@RequestParam String deviceType,
|
||||||
|
@RequestParam String end,
|
||||||
|
@RequestParam Integer pageNo,
|
||||||
|
@RequestParam Integer pageSize,
|
||||||
|
@RequestParam String start,
|
||||||
|
@RequestParam String status);
|
||||||
|
|
||||||
|
@GetMapping("log/{hostId}")
|
||||||
|
Result<?> monOneLog(@PathVariable("hostId") String hostId,
|
||||||
|
@RequestParam String end,
|
||||||
|
@RequestParam Integer pageNo,
|
||||||
|
@RequestParam Integer pageSize,
|
||||||
|
@RequestParam String start,
|
||||||
|
@RequestParam String status);
|
||||||
|
|
||||||
|
@GetMapping("queryHostDetails")
|
||||||
|
Result<?> monDetail(@RequestParam String hostId,
|
||||||
|
@RequestParam String pageName,
|
||||||
|
@RequestParam String end,
|
||||||
|
@RequestParam Integer pageNo,
|
||||||
|
@RequestParam Integer pageSize,
|
||||||
|
@RequestParam String start);
|
||||||
|
|
||||||
|
@GetMapping("queryItemHistory")
|
||||||
|
Result<?> itemHistory(@RequestParam String end,
|
||||||
|
@RequestParam String itemId,
|
||||||
|
@RequestParam Integer itemType,
|
||||||
|
@RequestParam String start);
|
||||||
|
|
||||||
|
@GetMapping("queryItemHistoryData")
|
||||||
|
Result<?> itemHistoryData(@RequestParam String end,
|
||||||
|
@RequestParam String itemId,
|
||||||
|
@RequestParam Integer itemType,
|
||||||
|
@RequestParam String start);
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
#code_generate_project_path
|
#code_generate_project_path
|
||||||
project_path=E:\\workspace\\jeecg-boot
|
project_path=C:\\Users\\a\\Desktop
|
||||||
#bussi_package[User defined]
|
#bussi_package[User defined]
|
||||||
bussi_package=org.jeecg.modules.demo
|
bussi_package=org.jeecg.modules.demo
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
#mysql
|
#mysql
|
||||||
diver_name=com.mysql.jdbc.Driver
|
#diver_name=com.mysql.jdbc.Driver
|
||||||
url=jdbc:mysql://localhost:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
|
#url=jdbc:mysql://localhost:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
|
||||||
username=root
|
#username=root
|
||||||
password=root
|
#password=root
|
||||||
database_name=jeecg-boot
|
#database_name=jeecg-boot
|
||||||
|
|
||||||
#oracle
|
#oracle
|
||||||
#diver_name=oracle.jdbc.driver.OracleDriver
|
diver_name=oracle.jdbc.driver.OracleDriver
|
||||||
#url=jdbc:oracle:thin:@192.168.1.200:1521:ORCL
|
url=jdbc:oracle:thin:@82.157.234.81:1521:orcl
|
||||||
#username=scott
|
username=original
|
||||||
#password=tiger
|
password=123456
|
||||||
#database_name=ORCL
|
database_name=original
|
||||||
|
|
||||||
#postgre
|
#postgre
|
||||||
#diver_name=org.postgresql.Driver
|
#diver_name=org.postgresql.Driver
|
||||||
|
|
|
@ -12,16 +12,16 @@
|
||||||
<artifactId>jeecg-module-web-statistics</artifactId>
|
<artifactId>jeecg-module-web-statistics</artifactId>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-base-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 引入jeecg-boot-starter-cloud依赖 -->
|
<!-- 引入jeecg-boot-starter-cloud依赖 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
<artifactId>jeecg-boot-starter-cloud</artifactId>
|
<artifactId>jeecg-boot-starter-cloud</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
|
||||||
<artifactId>jeecg-boot-base-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -10,6 +10,7 @@ import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.net.ftp.FTP;
|
import org.apache.commons.net.ftp.FTP;
|
||||||
import org.apache.commons.net.ftp.FTPClient;
|
import org.apache.commons.net.ftp.FTPClient;
|
||||||
import org.apache.commons.net.ftp.FTPFile;
|
import org.apache.commons.net.ftp.FTPFile;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.constant.SymbolConstant;
|
import org.jeecg.common.constant.SymbolConstant;
|
||||||
import org.jeecg.common.enums.SampleFileHeader;
|
import org.jeecg.common.enums.SampleFileHeader;
|
||||||
import org.jeecg.modules.entity.data.HistogramData;
|
import org.jeecg.modules.entity.data.HistogramData;
|
||||||
|
@ -142,14 +143,12 @@ public class ReadLineUtil {
|
||||||
OutputStream outputStream = null;
|
OutputStream outputStream = null;
|
||||||
try {
|
try {
|
||||||
String fileName = FileUtil.getName(filePath);
|
String fileName = FileUtil.getName(filePath);
|
||||||
// 设置响应头
|
|
||||||
response.setContentType("application/octet-stream");
|
|
||||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
|
|
||||||
// 获取文件输入流
|
// 获取文件输入流
|
||||||
inputStream = new FileInputStream(filePath);
|
inputStream = new FileInputStream(filePath);
|
||||||
|
|
||||||
// 获取输出流
|
// 获取输出流
|
||||||
outputStream = response.getOutputStream();
|
outputStream = ExportUtil.stream(response,fileName);
|
||||||
|
|
||||||
// 缓冲区大小
|
// 缓冲区大小
|
||||||
byte[] buffer = new byte[4096];
|
byte[] buffer = new byte[4096];
|
||||||
|
@ -160,7 +159,7 @@ public class ReadLineUtil {
|
||||||
outputStream.write(buffer, 0, bytesRead);
|
outputStream.write(buffer, 0, bytesRead);
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e){
|
} catch (FileNotFoundException e){
|
||||||
log.error("文件["+filePath+"]不存在!");
|
log.error("File["+filePath+"]does not exist!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -175,7 +174,7 @@ public class ReadLineUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFtpFile(String filePath, HttpServletResponse response){
|
public Result readFtpFile(String filePath, HttpServletResponse response){
|
||||||
// 连接FTP
|
// 连接FTP
|
||||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||||
// 判断FTP是否连接成功
|
// 判断FTP是否连接成功
|
||||||
|
@ -192,14 +191,16 @@ public class ReadLineUtil {
|
||||||
// 判断FTP服务器上是否存在此文件
|
// 判断FTP服务器上是否存在此文件
|
||||||
String[] files = ftpClient.listNames(filePath);
|
String[] files = ftpClient.listNames(filePath);
|
||||||
if (ArrayUtil.isEmpty(files)){
|
if (ArrayUtil.isEmpty(files)){
|
||||||
log.error("文件["+filePath+"]不存在!");
|
String message = "File["+filePath+"]does not exist!";
|
||||||
return;
|
log.error(message);
|
||||||
|
return Result.error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 存在多个文件名表示此路径为目录而非文件
|
// 存在多个文件名表示此路径为目录而非文件
|
||||||
if (ArrayUtil.length(files) > 1){
|
if (ArrayUtil.length(files) > 1){
|
||||||
log.error("路径["+filePath+"]存在多个文件名,可能是一个目录!");
|
String message = "["+filePath+"]There are multiple files, possibly one directory!";
|
||||||
return;
|
log.error(message);
|
||||||
|
return Result.error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取文件名
|
// 获取文件名
|
||||||
|
@ -212,10 +213,8 @@ public class ReadLineUtil {
|
||||||
ftpClient.setControlEncoding(encoding);
|
ftpClient.setControlEncoding(encoding);
|
||||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||||
inputStream = ftpClient.retrieveFileStream(filePath);
|
inputStream = ftpClient.retrieveFileStream(filePath);
|
||||||
outputStream = response.getOutputStream();
|
outputStream = ExportUtil.stream(response,fileName);
|
||||||
// 设置响应头
|
|
||||||
response.setContentType("application/octet-stream");
|
|
||||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
|
|
||||||
// 缓冲区大小
|
// 缓冲区大小
|
||||||
byte[] buffer = new byte[4096];
|
byte[] buffer = new byte[4096];
|
||||||
int bytesRead;
|
int bytesRead;
|
||||||
|
@ -227,6 +226,7 @@ public class ReadLineUtil {
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
return Result.error(e.getMessage());
|
||||||
}finally {
|
}finally {
|
||||||
try {
|
try {
|
||||||
if (ObjectUtil.isNotNull(inputStream))inputStream.close();
|
if (ObjectUtil.isNotNull(inputStream))inputStream.close();
|
||||||
|
@ -236,6 +236,7 @@ public class ReadLineUtil {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,41 +1,23 @@
|
||||||
package org.jeecg.modules.controller;
|
package org.jeecg.modules.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
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.common.util.ReadLineUtil;
|
|
||||||
import org.jeecg.modules.base.enums.PageType;
|
|
||||||
import org.jeecg.modules.entity.GardsAnalysesAuto;
|
|
||||||
import org.jeecg.modules.entity.GardsAnalysesMan;
|
|
||||||
import org.jeecg.modules.service.IAutoService;
|
import org.jeecg.modules.service.IAutoService;
|
||||||
import org.jeecg.modules.service.IManService;
|
|
||||||
import org.jeecg.modules.service.IReviewedService;
|
import org.jeecg.modules.service.IReviewedService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("radionuclide")
|
@RequestMapping("radionuclide")
|
||||||
public class RadionuclideController {
|
public class RadionuclideController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ReadLineUtil readLineUtil;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IManService manService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAutoService autoService;
|
private IAutoService autoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IReviewedService reviewedService;
|
private IReviewedService reviewedService;
|
||||||
|
|
||||||
|
@ -52,29 +34,4 @@ public class RadionuclideController {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")Date startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
|
@DateTimeFormat(pattern = "yyyy-MM-dd")Date startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
|
||||||
return reviewedService.findReviewedPage(queryRequest, stationIds, startTime, endTime);
|
return reviewedService.findReviewedPage(queryRequest, stationIds, startTime, endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("reportContent")
|
|
||||||
public void reportContent(@RequestParam String type,
|
|
||||||
@RequestParam Integer sampleId,
|
|
||||||
HttpServletResponse response){
|
|
||||||
String reportPath = "";
|
|
||||||
if (PageType.ARR.getType().equals(type)){ // 自动处理
|
|
||||||
LambdaQueryWrapper<GardsAnalysesAuto> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.eq(GardsAnalysesAuto::getSampleId,sampleId);
|
|
||||||
GardsAnalysesAuto gardsAnalyses = autoService.getOne(wrapper);
|
|
||||||
reportPath = Optional.ofNullable(gardsAnalyses)
|
|
||||||
.orElse(new GardsAnalysesAuto())
|
|
||||||
.getReportPath();
|
|
||||||
}else if (PageType.RRR.getType().equals(type)){ // 人工交互
|
|
||||||
LambdaQueryWrapper<GardsAnalysesMan> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.eq(GardsAnalysesMan::getSampleId,sampleId);
|
|
||||||
GardsAnalysesMan gardsAnalyses = manService.getOne(wrapper);
|
|
||||||
reportPath = Optional.ofNullable(gardsAnalyses)
|
|
||||||
.orElse(new GardsAnalysesMan())
|
|
||||||
.getReportPath();
|
|
||||||
}
|
|
||||||
if (StrUtil.isBlank(reportPath))return;
|
|
||||||
// 将FTP上的文件转为文件流返回到前端
|
|
||||||
readLineUtil.readFtpFile(reportPath,response);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,44 @@
|
||||||
package org.jeecg.modules.controller;
|
package org.jeecg.modules.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
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.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.common.util.ReadLineUtil;
|
||||||
|
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||||
|
import org.jeecg.modules.base.entity.GardsSohData;
|
||||||
|
import org.jeecg.modules.base.enums.PageType;
|
||||||
|
import org.jeecg.modules.entity.GardsAnalysesAuto;
|
||||||
|
import org.jeecg.modules.entity.GardsAnalysesMan;
|
||||||
import org.jeecg.modules.service.*;
|
import org.jeecg.modules.service.*;
|
||||||
import org.jeecg.modules.system.entity.GardsStations;
|
import org.jeecg.modules.system.entity.GardsStations;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("webStatistics")
|
@RequestMapping("webStatistics")
|
||||||
@Api(value = "统计分析管理", tags = "统计分析管理")
|
@Api(value = "统计分析管理", tags = "统计分析管理")
|
||||||
public class WebStatisticsController {
|
public class WebStatisticsController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IReviewedService reviewedService;
|
||||||
|
@Autowired
|
||||||
|
private IAutoService autoService;
|
||||||
|
@Autowired
|
||||||
|
private ReadLineUtil readLineUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IGardsSampleDataWebService gardsSampleDataWebService;
|
private IGardsSampleDataWebService gardsSampleDataWebService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -28,10 +46,9 @@ public class WebStatisticsController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IGardsSohDataService gardsSohDataService;
|
private IGardsSohDataService gardsSohDataService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMenuNameService menuNameService;
|
private IGardsAlertDataService gardsAlertDataService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IGardsSampleCertService gardsSampleCertService;
|
private IMenuNameService menuNameService;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("findStationList")
|
@GetMapping("findStationList")
|
||||||
@ApiOperation(value = "根据菜单名称查询对应的台站信息", notes = "根据菜单名称查询对应的台站信息")
|
@ApiOperation(value = "根据菜单名称查询对应的台站信息", notes = "根据菜单名称查询对应的台站信息")
|
||||||
|
@ -73,4 +90,100 @@ public class WebStatisticsController {
|
||||||
return gardsSampleDataWebService.findGeneratedReport(sampleId);
|
return gardsSampleDataWebService.findGeneratedReport(sampleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("radionuclideFile")
|
||||||
|
@ApiOperation("查看Radionuclide的文件")
|
||||||
|
public Result radionuclideFile(@RequestParam Integer sampleId,
|
||||||
|
HttpServletResponse response){
|
||||||
|
GardsSampleData sampleData = gardsSampleDataWebService.getOneSample(sampleId);
|
||||||
|
String filePath = sampleData.getInputFileName();
|
||||||
|
if (StrUtil.isBlank(filePath))
|
||||||
|
return Result.error("The file you are looking for does not exist!");
|
||||||
|
return readLineUtil.readFtpFile(filePath,response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sohFile")
|
||||||
|
@ApiOperation(value = "查看RMSSHO的文件",notes = "查看RMSSHO的文件")
|
||||||
|
public Result sohFile(@RequestParam Integer sohId,
|
||||||
|
HttpServletResponse response){
|
||||||
|
GardsSohData soh = gardsSohDataService.getOneSoh(sohId);
|
||||||
|
String filePath = soh.getInputFileName();
|
||||||
|
if (StrUtil.isBlank(filePath))
|
||||||
|
return Result.error("The file you are looking for does not exist!");
|
||||||
|
return readLineUtil.readFtpFile(filePath,response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("arFile")
|
||||||
|
@ApiOperation(value = "查看ARR/RRR的文件", notes = "查看ARR/RRR的文件")
|
||||||
|
public Result arFile(@RequestParam String type,
|
||||||
|
@RequestParam Integer sampleId,
|
||||||
|
HttpServletResponse response){
|
||||||
|
String reportPath = "";
|
||||||
|
if (PageType.ARR.getType().equals(type)){ // 自动处理
|
||||||
|
reportPath = autoService.getOne(sampleId).getReportPath();
|
||||||
|
}else if (PageType.RRR.getType().equals(type)){ // 人工交互
|
||||||
|
reportPath = reviewedService.getOne(sampleId).getReportPath();
|
||||||
|
}
|
||||||
|
if (StrUtil.isBlank(reportPath))
|
||||||
|
return Result.error("The file you are looking for does not exist!");
|
||||||
|
// 将FTP上的文件转为文件流返回到前端
|
||||||
|
return readLineUtil.readFtpFile(reportPath,response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("radionuclideExport")
|
||||||
|
@ApiOperation(value = "导出Radionuclide的Excel",notes = "导出Radionuclide的Excel")
|
||||||
|
public void radionuclideExport(@RequestParam Integer[] stationIds,
|
||||||
|
@RequestParam String dataType,
|
||||||
|
@RequestParam String pageType,
|
||||||
|
String spectralQualifie,
|
||||||
|
@RequestParam String startTime,
|
||||||
|
@RequestParam String endTime,
|
||||||
|
HttpServletResponse response){
|
||||||
|
gardsSampleDataWebService.radionuclideExport(stationIds,
|
||||||
|
dataType, pageType, spectralQualifie, startTime, endTime, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("alertsExport")
|
||||||
|
@ApiOperation(value = "导出Alerts的Excel",notes = "导出Alerts的Excel")
|
||||||
|
public void alertsExport(@RequestParam Integer[] stationIds,
|
||||||
|
@RequestParam String startTime,
|
||||||
|
@RequestParam String endTime,
|
||||||
|
HttpServletResponse response){
|
||||||
|
gardsAlertDataService.alertsExport(stationIds, startTime, endTime,response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sohExport")
|
||||||
|
@ApiOperation(value = "导出RMSSOH的Excel",notes = "导出RMSSOH的Excel")
|
||||||
|
public void sohExport(@RequestParam Integer[] stationIds,
|
||||||
|
@RequestParam String startTime,
|
||||||
|
@RequestParam String endTime,
|
||||||
|
HttpServletResponse response){
|
||||||
|
gardsSohDataService.sohExport(stationIds, startTime, endTime, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("metExport")
|
||||||
|
@ApiOperation(value = "导出Met的Excel",notes = "导出Met的Excel")
|
||||||
|
public void metExport(@RequestParam Integer[] stationIds,
|
||||||
|
@RequestParam String startTime,
|
||||||
|
@RequestParam String endTime,
|
||||||
|
HttpServletResponse response){
|
||||||
|
gardsMetDataService.metExport(stationIds, startTime, endTime, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("arrExport")
|
||||||
|
@ApiOperation(value = "导出ARR的Excel",notes = "导出ARR的Excel")
|
||||||
|
public void arrExport(@RequestParam Integer[] stationIds,
|
||||||
|
@RequestParam String startTime,
|
||||||
|
@RequestParam String endTime,
|
||||||
|
HttpServletResponse response){
|
||||||
|
autoService.arrExport(stationIds,startTime,endTime,response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("rrrExport")
|
||||||
|
@ApiOperation(value = "导出RRR的Excel",notes = "导出RRR的Excel")
|
||||||
|
public void rrrExport(@RequestParam Integer[] stationIds,
|
||||||
|
@RequestParam String startTime,
|
||||||
|
@RequestParam String endTime,
|
||||||
|
HttpServletResponse response){
|
||||||
|
reviewedService.rrrExport(stationIds, startTime, endTime,response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -16,6 +17,7 @@ public class GardsAlertData implements Serializable {
|
||||||
@TableField(value = "STATION_ID")
|
@TableField(value = "STATION_ID")
|
||||||
private Integer stationId;
|
private Integer stationId;
|
||||||
|
|
||||||
|
@Excel(name = "STATION",orderNum = "4")
|
||||||
@TableField(value = "STATION_CODE")
|
@TableField(value = "STATION_CODE")
|
||||||
private String stationCode;
|
private String stationCode;
|
||||||
|
|
||||||
|
@ -25,15 +27,21 @@ public class GardsAlertData implements Serializable {
|
||||||
@TableField(value = "TIME")
|
@TableField(value = "TIME")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Excel(name = "TIME",orderNum = "3" ,format = "yyyy-MM-dd HH:mm:ss",width = 30)
|
||||||
private Date time;
|
private Date time;
|
||||||
|
|
||||||
|
@Excel(name = "TYPE",orderNum = "2")
|
||||||
@TableField(value = "ALERT_TYPE")
|
@TableField(value = "ALERT_TYPE")
|
||||||
private String alertType;
|
private String alertType;
|
||||||
|
|
||||||
|
@Excel(name = "ENTRIES",orderNum = "5",width = 30)
|
||||||
@TableField(value = "ALERT_TEXT")
|
@TableField(value = "ALERT_TEXT")
|
||||||
private String alertText;
|
private String alertText;
|
||||||
|
|
||||||
@TableField(value = "INPUT_FILE_NAME")
|
@TableField(value = "INPUT_FILE_NAME")
|
||||||
private String inputFileName;
|
private String inputFileName;
|
||||||
|
|
||||||
|
@Excel(name = "NO",orderNum = "1")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer no;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.jeecg.modules.entity.GardsAlertData;
|
import org.jeecg.modules.entity.GardsAlertData;
|
||||||
|
|
||||||
public interface GardsAlertDataMapper extends BaseMapper<GardsAlertData> {
|
public interface GardsAlertDataMapper extends BaseMapper<GardsAlertData> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,16 @@ 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.entity.GardsAnalysesAuto;
|
import org.jeecg.modules.entity.GardsAnalysesAuto;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public interface IAutoService extends IService<GardsAnalysesAuto> {
|
public interface IAutoService extends IService<GardsAnalysesAuto> {
|
||||||
|
|
||||||
Result findAutoPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
Result findAutoPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
||||||
|
|
||||||
|
GardsAnalysesAuto getOne(Integer sampleId);
|
||||||
|
|
||||||
|
void arrExport(Integer[] stationIds, String startTime, String endTime, HttpServletResponse response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.modules.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.common.api.QueryRequest;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.modules.base.entity.GardsSohData;
|
||||||
|
import org.jeecg.modules.entity.GardsAlertData;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public interface IGardsAlertDataService extends IService<GardsAlertData> {
|
||||||
|
|
||||||
|
void alertsExport(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response);
|
||||||
|
}
|
|
@ -4,7 +4,9 @@ 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.GardsMetData;
|
import org.jeecg.modules.base.entity.GardsMetData;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public interface IGardsMetDataService extends IService<GardsMetData> {
|
public interface IGardsMetDataService extends IService<GardsMetData> {
|
||||||
|
@ -19,4 +21,8 @@ public interface IGardsMetDataService extends IService<GardsMetData> {
|
||||||
*/
|
*/
|
||||||
Result findMetPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
Result findMetPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
||||||
|
|
||||||
|
void metExport(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ 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.GardsSampleData;
|
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -36,4 +37,18 @@ public interface IGardsSampleDataWebService extends IService<GardsSampleData> {
|
||||||
*/
|
*/
|
||||||
Result findPageBySampleIds(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime, List<Integer> sampleIds);
|
Result findPageBySampleIds(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime, List<Integer> sampleIds);
|
||||||
|
|
||||||
|
GardsSampleData getOneSample(Integer sampleId);
|
||||||
|
|
||||||
|
void radionuclideExport(Integer[] stationIds,
|
||||||
|
String dataType,
|
||||||
|
String pageType,
|
||||||
|
String spectralQualifie,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response);
|
||||||
|
|
||||||
|
List<GardsSampleData> listBySampleIds(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
List<Integer> sampleIds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,9 @@ 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 org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public interface IGardsSohDataService extends IService<GardsSohData> {
|
public interface IGardsSohDataService extends IService<GardsSohData> {
|
||||||
|
@ -30,4 +32,15 @@ public interface IGardsSohDataService extends IService<GardsSohData> {
|
||||||
*/
|
*/
|
||||||
Result findAlertSohPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
Result findAlertSohPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单个SOH对象
|
||||||
|
*
|
||||||
|
* @param sohId
|
||||||
|
*/
|
||||||
|
GardsSohData getOneSoh(Integer sohId);
|
||||||
|
|
||||||
|
void sohExport(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
package org.jeecg.modules.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import org.jeecg.common.api.QueryRequest;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.modules.entity.GardsAnalysesAuto;
|
|
||||||
import org.jeecg.modules.entity.GardsAnalysesMan;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public interface IManService extends IService<GardsAnalysesMan> {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -5,10 +5,14 @@ import org.jeecg.common.api.QueryRequest;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.entity.GardsAnalysesMan;
|
import org.jeecg.modules.entity.GardsAnalysesMan;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public interface IReviewedService extends IService<GardsAnalysesMan> {
|
public interface IReviewedService extends IService<GardsAnalysesMan> {
|
||||||
|
|
||||||
Result findReviewedPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
Result findReviewedPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);
|
||||||
|
|
||||||
|
GardsAnalysesMan getOne(Integer sampleId);
|
||||||
|
|
||||||
|
void rrrExport(Integer[] stationIds, String startTime, String endTime, HttpServletResponse response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,35 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
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.common.util.ExportUtil;
|
||||||
|
import org.jeecg.modules.base.dto.SampleDataDto;
|
||||||
|
import org.jeecg.modules.base.entity.GardsMetData;
|
||||||
|
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||||
import org.jeecg.modules.entity.GardsAnalysesAuto;
|
import org.jeecg.modules.entity.GardsAnalysesAuto;
|
||||||
import org.jeecg.modules.mapper.GardsAnalysesAutoMapper;
|
import org.jeecg.modules.mapper.GardsAnalysesAutoMapper;
|
||||||
import org.jeecg.modules.service.IAutoService;
|
import org.jeecg.modules.service.IAutoService;
|
||||||
import org.jeecg.modules.service.IGardsSampleDataWebService;
|
import org.jeecg.modules.service.IGardsSampleDataWebService;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service("autoService")
|
@Service("autoService")
|
||||||
|
@ -40,4 +55,61 @@ public class AutoServiceImpl extends ServiceImpl<GardsAnalysesAutoMapper, GardsA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GardsAnalysesAuto getOne(Integer sampleId) {
|
||||||
|
LambdaQueryWrapper<GardsAnalysesAuto> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(GardsAnalysesAuto::getSampleId,sampleId);
|
||||||
|
GardsAnalysesAuto gardsAnalyses = getOne(wrapper);
|
||||||
|
return Optional.ofNullable(gardsAnalyses)
|
||||||
|
.orElse(new GardsAnalysesAuto());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void arrExport(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
// 查询自动处理后的
|
||||||
|
List<GardsAnalysesAuto> gardsAnalyses = this.list();
|
||||||
|
|
||||||
|
// 获取全部样品id
|
||||||
|
List<Integer> sampleIds = gardsAnalyses
|
||||||
|
.stream()
|
||||||
|
.map(GardsAnalysesAuto::getSampleId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollUtil.isEmpty(sampleIds)) return;
|
||||||
|
|
||||||
|
// 查询全部样品基础数据
|
||||||
|
List<GardsSampleData> sampleData = gardsSampleDataService.listBySampleIds(stationIds,
|
||||||
|
startTime, endTime, sampleIds);
|
||||||
|
|
||||||
|
// 导出Excel文件
|
||||||
|
List<SampleDataDto> sampleDataDtos = sampleData
|
||||||
|
.stream()
|
||||||
|
.map(SampleDataDto::new)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
ExportParams params = new ExportParams();
|
||||||
|
params.setSheetName("ARR");
|
||||||
|
Workbook workbook = null;
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
// 设置文件名、Excel类型(xls|xlsx)
|
||||||
|
outputStream = ExportUtil.xls(response,"ARR.xls");
|
||||||
|
workbook = ExcelExportUtil.
|
||||||
|
exportExcel(params, SampleDataDto.class, sampleDataDtos);
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally {
|
||||||
|
try {
|
||||||
|
if (ObjectUtil.isNotNull(outputStream))
|
||||||
|
outputStream.close();
|
||||||
|
if (ObjectUtil.isNotNull(workbook))
|
||||||
|
workbook.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.jeecg.common.api.QueryRequest;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.util.DateUtils;
|
||||||
|
import org.jeecg.common.util.ExportUtil;
|
||||||
|
import org.jeecg.common.util.RedisUtil;
|
||||||
|
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||||
|
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.service.IGardsAlertDataService;
|
||||||
|
import org.jeecg.modules.service.IGardsSohDataService;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import static org.jeecg.modules.base.enums.PageType.*;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@DS("ora")
|
||||||
|
public class GardsAlertDataServiceImpl extends ServiceImpl<GardsAlertDataMapper, GardsAlertData> implements IGardsAlertDataService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void alertsExport(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
|
||||||
|
if (ArrayUtil.isEmpty(stationIds))return;
|
||||||
|
|
||||||
|
Date startDate = DateUtil
|
||||||
|
.parse(startTime + " 00:00:00","yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
Date endDate = DateUtil
|
||||||
|
.parse(endTime + " 23:59:59","yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
// 获取redis中缓存的探测器信息
|
||||||
|
// Map<Integer, String> detectorsMap = (Map<Integer, String>)redisUtil.get("detectorsMap");
|
||||||
|
LambdaQueryWrapper<GardsAlertData> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.in(GardsAlertData::getStationId, stationIds);
|
||||||
|
wrapper.ge(GardsAlertData::getTime, startDate);
|
||||||
|
wrapper.le(GardsAlertData::getTime, endDate);
|
||||||
|
List<GardsAlertData> gardsAlertData = this.list(wrapper);
|
||||||
|
int no = 1;
|
||||||
|
for (GardsAlertData alertData : gardsAlertData) {
|
||||||
|
alertData.setNo(no++);
|
||||||
|
}
|
||||||
|
// 导出Excel文件
|
||||||
|
ExportParams params = new ExportParams();
|
||||||
|
params.setSheetName("Alerts");
|
||||||
|
Workbook workbook = null;
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
// 设置文件名、Excel类型(xls|xlsx)
|
||||||
|
outputStream = ExportUtil.xls(response,"Alerts.xls");
|
||||||
|
workbook = ExcelExportUtil.
|
||||||
|
exportExcel(params, GardsAlertData.class, gardsAlertData);
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally {
|
||||||
|
try {
|
||||||
|
if (ObjectUtil.isNotNull(outputStream))
|
||||||
|
outputStream.close();
|
||||||
|
if (ObjectUtil.isNotNull(workbook))
|
||||||
|
workbook.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,20 +1,32 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
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.common.util.DateUtils;
|
import org.jeecg.common.util.DateUtils;
|
||||||
|
import org.jeecg.common.util.ExportUtil;
|
||||||
import org.jeecg.modules.base.entity.GardsMetData;
|
import org.jeecg.modules.base.entity.GardsMetData;
|
||||||
|
import org.jeecg.modules.entity.GardsAlertData;
|
||||||
import org.jeecg.modules.mapper.GardsMetDataMapper;
|
import org.jeecg.modules.mapper.GardsMetDataMapper;
|
||||||
import org.jeecg.modules.service.IGardsMetDataService;
|
import org.jeecg.modules.service.IGardsMetDataService;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Service("gardsMetDataService")
|
@Service("gardsMetDataService")
|
||||||
|
@ -53,4 +65,52 @@ public class GardsMetDataServiceImpl extends ServiceImpl<GardsMetDataMapper, Gar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void metExport(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
|
||||||
|
if (ArrayUtil.isEmpty(stationIds)) return;
|
||||||
|
|
||||||
|
Date startDate = DateUtil
|
||||||
|
.parse(startTime + " 00:00:00","yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
Date endDate = DateUtil
|
||||||
|
.parse(endTime + " 23:59:59","yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
LambdaQueryWrapper<GardsMetData> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.in(GardsMetData::getStationId, stationIds);
|
||||||
|
wrapper.ge(GardsMetData::getStartTime, startDate);
|
||||||
|
wrapper.le(GardsMetData::getEndTime, endDate);
|
||||||
|
List<GardsMetData> gardsMetData = this.list(wrapper);
|
||||||
|
int no = 1;
|
||||||
|
for (GardsMetData metData : gardsMetData) {
|
||||||
|
metData.setNo(no++);
|
||||||
|
}
|
||||||
|
// 导出Excel文件
|
||||||
|
ExportParams params = new ExportParams();
|
||||||
|
params.setSheetName("Met");
|
||||||
|
Workbook workbook = null;
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
// 设置文件名、Excel类型(xls|xlsx)
|
||||||
|
outputStream = ExportUtil.xls(response,"Met.xls");
|
||||||
|
workbook = ExcelExportUtil.
|
||||||
|
exportExcel(params, GardsMetData.class, gardsMetData);
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally {
|
||||||
|
try {
|
||||||
|
if (ObjectUtil.isNotNull(outputStream))
|
||||||
|
outputStream.close();
|
||||||
|
if (ObjectUtil.isNotNull(workbook))
|
||||||
|
workbook.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,52 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
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.common.enums.SampleFileHeader;
|
import org.jeecg.common.enums.SampleFileHeader;
|
||||||
import org.jeecg.common.util.DateUtils;
|
import org.jeecg.common.util.DateUtils;
|
||||||
|
import org.jeecg.common.util.ExportUtil;
|
||||||
import org.jeecg.common.util.ReadLineUtil;
|
import org.jeecg.common.util.ReadLineUtil;
|
||||||
import org.jeecg.common.util.RedisUtil;
|
import org.jeecg.common.util.RedisUtil;
|
||||||
import org.jeecg.modules.base.entity.GardsSampleData;
|
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||||
|
import org.jeecg.modules.base.entity.GardsSohData;
|
||||||
|
import org.jeecg.modules.base.enums.PageType;
|
||||||
import org.jeecg.modules.entity.*;
|
import org.jeecg.modules.entity.*;
|
||||||
import org.jeecg.modules.entity.data.*;
|
import org.jeecg.modules.entity.data.*;
|
||||||
import org.jeecg.modules.mapper.*;
|
import org.jeecg.modules.mapper.*;
|
||||||
import org.jeecg.modules.service.IGardsSampleDataWebService;
|
import org.jeecg.modules.service.IGardsSampleDataWebService;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.jeecg.modules.base.enums.PageType.*;
|
||||||
|
|
||||||
@Service("gardsSampleDataWebService")
|
@Service("gardsSampleDataWebService")
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWebMapper,GardsSampleData> implements IGardsSampleDataWebService {
|
public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWebMapper,GardsSampleData> implements IGardsSampleDataWebService {
|
||||||
|
@ -497,4 +518,137 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GardsSampleData getOneSample(Integer sampleId) {
|
||||||
|
LambdaQueryWrapper<GardsSampleData> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(GardsSampleData::getSampleId,sampleId);
|
||||||
|
return Optional.ofNullable(getOne(wrapper))
|
||||||
|
.orElse(new GardsSampleData());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void radionuclideExport(Integer[] stationIds,
|
||||||
|
String dataType,
|
||||||
|
String pageType,
|
||||||
|
String spectralQualifie,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
|
||||||
|
Date startDate = DateUtil
|
||||||
|
.parse(startTime + " 00:00:00","yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
Date endDate = DateUtil
|
||||||
|
.parse(endTime + " 23:59:59","yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
|
||||||
|
// 声明Lambda 传递参数进行条件查询
|
||||||
|
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(GardsSampleData::getDataType, dataType);
|
||||||
|
// 数据分为全谱与过程谱则使用采集日期进行日期查询
|
||||||
|
if (StringUtils.isNotBlank(spectralQualifie)) {
|
||||||
|
queryWrapper.eq(GardsSampleData::getSpectralQualifie, spectralQualifie);
|
||||||
|
queryWrapper.ge(GardsSampleData::getCollectStart, startDate);
|
||||||
|
queryWrapper.le(GardsSampleData::getCollectStop, endDate);
|
||||||
|
} else { //数据不区分全谱与过程谱则使用
|
||||||
|
queryWrapper.ge(GardsSampleData::getAcquisitionStart, startDate);
|
||||||
|
queryWrapper.le(GardsSampleData::getAcquisitionStop, endDate);
|
||||||
|
}
|
||||||
|
boolean notEmpty = ArrayUtil.isNotEmpty(stationIds);
|
||||||
|
queryWrapper.in(notEmpty, GardsSampleData::getStationId, stationIds);
|
||||||
|
|
||||||
|
// 封装信息
|
||||||
|
List<GardsSampleData> sampleDatas = this.list(queryWrapper);
|
||||||
|
// 获取redis中缓存的台站信息
|
||||||
|
Map<String, String> stationMap = (Map<String, String>) redisUtil.get("stationMap");
|
||||||
|
int no = 1;
|
||||||
|
for (GardsSampleData sampleData : sampleDatas) {
|
||||||
|
sampleData.setNo(no++);
|
||||||
|
sampleData.setSiteDetCode(StringUtils.trim(sampleData.getSiteDetCode()));
|
||||||
|
String stationId = sampleData.getStationId().toString();
|
||||||
|
boolean noEmpty = MapUtil.isNotEmpty(stationMap);
|
||||||
|
boolean hasKey = noEmpty ? stationMap.containsKey(stationId) : false;
|
||||||
|
if (noEmpty && hasKey) {
|
||||||
|
String stationName = stationMap.get(stationId);
|
||||||
|
sampleData.setStationName(stationName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> commonFiled = ListUtil
|
||||||
|
.toList("no","stationName","siteDetCode","spectralQualifie");
|
||||||
|
// 根据页面类型导出不同列字段的Execl文档
|
||||||
|
ExportParams params = new ExportParams();
|
||||||
|
params.setSheetName("Radionuclide");
|
||||||
|
|
||||||
|
Workbook workbook = null;
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
// 设置文件名、Excel类型(xls|xlsx)
|
||||||
|
outputStream = ExportUtil.xls(response,"Radionuclide.xls");
|
||||||
|
if (ACQ.getType().equals(pageType)){
|
||||||
|
commonFiled.addAll(ListUtil.toList("acquisitionStart","acquisitionStop"));
|
||||||
|
String[] fileds = ArrayUtil.toArray(commonFiled,String.class);
|
||||||
|
workbook = ExcelExportUtil.
|
||||||
|
exportExcel(params, GardsSampleData.class, sampleDatas, fileds);
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} else if (COLL.getType().equals(pageType)) {
|
||||||
|
commonFiled.addAll(ListUtil.toList("collectStart","collectStop"));
|
||||||
|
String[] fileds = ArrayUtil.toArray(commonFiled,String.class);
|
||||||
|
workbook = ExcelExportUtil.
|
||||||
|
exportExcel(params, GardsSampleData.class, sampleDatas,fileds);
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} else if (CALIB.getType().equals(pageType)) {
|
||||||
|
commonFiled.addAll(ListUtil.toList("acquisitionStart","acquisitionStop","calibReports"));
|
||||||
|
String[] fileds = ArrayUtil.toArray(commonFiled,String.class);
|
||||||
|
workbook = ExcelExportUtil.
|
||||||
|
exportExcel(params, GardsSampleData.class, sampleDatas, fileds);
|
||||||
|
workbook.write(outputStream);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally {
|
||||||
|
try {
|
||||||
|
if (ObjectUtil.isNotNull(outputStream))
|
||||||
|
outputStream.close();
|
||||||
|
if (ObjectUtil.isNotNull(workbook))
|
||||||
|
workbook.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GardsSampleData> listBySampleIds(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
List<Integer> sampleIds) {
|
||||||
|
Date startDate = DateUtil
|
||||||
|
.parse(startTime + " 00:00:00","yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
Date endDate = DateUtil
|
||||||
|
.parse(endTime + " 23:59:59","yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
LambdaQueryWrapper<GardsSampleData> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.in(GardsSampleData::getStationId, stationIds);
|
||||||
|
wrapper.in(GardsSampleData::getSampleId, sampleIds);
|
||||||
|
wrapper.ge(GardsSampleData::getCollectStart, startDate);
|
||||||
|
wrapper.le(GardsSampleData::getCollectStop, endDate);
|
||||||
|
List<GardsSampleData> sampleData = this.list(wrapper);
|
||||||
|
|
||||||
|
// 获取redis中缓存的台站信息
|
||||||
|
Map<Integer, String> stationMap = (Map<Integer, String>)redisUtil.get("stationMap");
|
||||||
|
int no = 1;
|
||||||
|
boolean emptyMap = MapUtil.isEmpty(stationMap);
|
||||||
|
for (GardsSampleData sampleDatum : sampleData) {
|
||||||
|
sampleDatum.setNo(no++);
|
||||||
|
String stationId = sampleDatum.getStationId().toString();
|
||||||
|
boolean hasKey = emptyMap ? false : stationMap.containsKey(stationId) ;
|
||||||
|
if (hasKey){
|
||||||
|
String stationName = stationMap.get(stationId);
|
||||||
|
sampleDatum.setStationName(stationName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sampleData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,35 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
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.common.util.DateUtils;
|
import org.jeecg.common.util.DateUtils;
|
||||||
|
import org.jeecg.common.util.ExportUtil;
|
||||||
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.entity.GardsAlertData;
|
||||||
import org.jeecg.modules.mapper.GardsAlertDataMapper;
|
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.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
@Service("gardsSohDataService")
|
@Service("gardsSohDataService")
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
|
@ -111,4 +120,76 @@ public class GardsSohDataServiceImpl extends ServiceImpl<GardsSohDataMapper, Gar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GardsSohData getOneSoh(Integer sohId) {
|
||||||
|
LambdaQueryWrapper<GardsSohData> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(GardsSohData::getSohId,sohId);
|
||||||
|
return Optional.ofNullable(getOne(wrapper))
|
||||||
|
.orElse(new GardsSohData());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sohExport(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
if (ArrayUtil.isEmpty(stationIds)) return;
|
||||||
|
|
||||||
|
Date startDate = DateUtil
|
||||||
|
.parse(startTime + " 00:00:00", "yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
Date endDate = DateUtil
|
||||||
|
.parse(endTime + " 23:59:59", "yyyy-MM-dd HH:mm:ss")
|
||||||
|
.toJdkDate();
|
||||||
|
// 获取redis中缓存的探测器信息
|
||||||
|
// Map<Integer, String> detectorsMap = (Map<Integer, String>) redisUtil.get("detectorsMap");
|
||||||
|
LambdaQueryWrapper<GardsSohData> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.in(GardsSohData::getStationId, stationIds);
|
||||||
|
wrapper.ge(GardsSohData::getStartTime, startDate);
|
||||||
|
wrapper.le(GardsSohData::getStartTime, endDate);
|
||||||
|
|
||||||
|
List<GardsSohData> sohData = this.list(wrapper);
|
||||||
|
|
||||||
|
int no = 1;
|
||||||
|
for (GardsSohData sohDatum : sohData) {
|
||||||
|
sohDatum.setNo(no++);
|
||||||
|
/*String detectorId = sohDatum.getDetectorId().toString();
|
||||||
|
boolean hasKey = MapUtil.isEmpty(detectorsMap) ? false : detectorsMap.containsKey(detectorId) ;
|
||||||
|
if (hasKey) {
|
||||||
|
String detectorName = detectorsMap.get(detectorId);
|
||||||
|
sohDatum.setDetectorName(detectorName);
|
||||||
|
}*/
|
||||||
|
Date startT = sohDatum.getStartTime();
|
||||||
|
if (ObjectUtil.isNotNull(startT)) {
|
||||||
|
long stratSecod = startT.getTime() / 1000;
|
||||||
|
long endSecond = stratSecod + Long.valueOf(sohDatum.getTime());
|
||||||
|
Date endDateTime = new Date(endSecond * 1000);
|
||||||
|
sohDatum.setEndTime(endDateTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出Excel文件
|
||||||
|
ExportParams params = new ExportParams();
|
||||||
|
params.setSheetName("RMSSOH");
|
||||||
|
Workbook workbook = null;
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
// 设置文件名、Excel类型(xls|xlsx)
|
||||||
|
outputStream = ExportUtil.xls(response,"RMSSOH.xls");
|
||||||
|
workbook = ExcelExportUtil.
|
||||||
|
exportExcel(params, GardsSohData.class, sohData);
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally {
|
||||||
|
try {
|
||||||
|
if (ObjectUtil.isNotNull(outputStream))
|
||||||
|
outputStream.close();
|
||||||
|
if (ObjectUtil.isNotNull(workbook))
|
||||||
|
workbook.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
package org.jeecg.modules.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import org.jeecg.common.api.QueryRequest;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.modules.entity.GardsAnalysesAuto;
|
|
||||||
import org.jeecg.modules.entity.GardsAnalysesMan;
|
|
||||||
import org.jeecg.modules.mapper.GardsAnalysesAutoMapper;
|
|
||||||
import org.jeecg.modules.mapper.GardsAnalysesManMapper;
|
|
||||||
import org.jeecg.modules.service.IAutoService;
|
|
||||||
import org.jeecg.modules.service.IGardsSampleDataWebService;
|
|
||||||
import org.jeecg.modules.service.IManService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Service("manService")
|
|
||||||
@DS("ora")
|
|
||||||
public class ManServiceImpl extends ServiceImpl<GardsAnalysesManMapper, GardsAnalysesMan> implements IManService {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,20 +1,33 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
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.common.util.ExportUtil;
|
||||||
|
import org.jeecg.modules.base.dto.SampleDataDto;
|
||||||
|
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||||
|
import org.jeecg.modules.entity.GardsAnalysesAuto;
|
||||||
import org.jeecg.modules.entity.GardsAnalysesMan;
|
import org.jeecg.modules.entity.GardsAnalysesMan;
|
||||||
import org.jeecg.modules.mapper.GardsAnalysesManMapper;
|
import org.jeecg.modules.mapper.GardsAnalysesManMapper;
|
||||||
import org.jeecg.modules.service.IGardsSampleDataWebService;
|
import org.jeecg.modules.service.IGardsSampleDataWebService;
|
||||||
import org.jeecg.modules.service.IReviewedService;
|
import org.jeecg.modules.service.IReviewedService;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service("reviewedService")
|
@Service("reviewedService")
|
||||||
|
@ -39,4 +52,61 @@ public class ReviewedServiceImpl extends ServiceImpl<GardsAnalysesManMapper, Gar
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GardsAnalysesMan getOne(Integer sampleId) {
|
||||||
|
LambdaQueryWrapper<GardsAnalysesMan> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(GardsAnalysesMan::getSampleId,sampleId);
|
||||||
|
GardsAnalysesMan gardsAnalyses = getOne(wrapper);
|
||||||
|
return Optional.ofNullable(gardsAnalyses)
|
||||||
|
.orElse(new GardsAnalysesMan());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void rrrExport(Integer[] stationIds,
|
||||||
|
String startTime,
|
||||||
|
String endTime,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
// 查询自动处理后的
|
||||||
|
List<GardsAnalysesMan> gardsAnalyses = this.list();
|
||||||
|
|
||||||
|
// 获取全部样品id
|
||||||
|
List<Integer> sampleIds = gardsAnalyses
|
||||||
|
.stream()
|
||||||
|
.map(GardsAnalysesMan::getSampleId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollUtil.isEmpty(sampleIds)) return;
|
||||||
|
|
||||||
|
// 查询全部样品基础数据
|
||||||
|
List<GardsSampleData> sampleData = gardsSampleDataService.listBySampleIds(stationIds,
|
||||||
|
startTime, endTime, sampleIds);
|
||||||
|
|
||||||
|
// 导出Excel文件
|
||||||
|
List<SampleDataDto> sampleDataDtos = sampleData
|
||||||
|
.stream()
|
||||||
|
.map(SampleDataDto::new)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
ExportParams params = new ExportParams();
|
||||||
|
params.setSheetName("RRR");
|
||||||
|
Workbook workbook = null;
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
// 设置文件名、Excel类型(xls|xlsx)
|
||||||
|
outputStream = ExportUtil.xls(response,"RRR.xls");
|
||||||
|
workbook = ExcelExportUtil.
|
||||||
|
exportExcel(params, SampleDataDto.class, sampleDataDtos);
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally {
|
||||||
|
try {
|
||||||
|
if (ObjectUtil.isNotNull(outputStream))
|
||||||
|
outputStream.close();
|
||||||
|
if (ObjectUtil.isNotNull(workbook))
|
||||||
|
workbook.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,3 +16,9 @@ spring:
|
||||||
import:
|
import:
|
||||||
- optional:nacos:jeecg.yaml
|
- optional:nacos:jeecg.yaml
|
||||||
- optional:nacos:jeecg-@profile.name@.yaml
|
- optional:nacos:jeecg-@profile.name@.yaml
|
||||||
|
|
||||||
|
# 调用监控服务配置信息
|
||||||
|
monitor:
|
||||||
|
username: wmhr
|
||||||
|
password: Wmhr.123
|
||||||
|
url: http://218.249.158.97:7008/mobile/monitor
|
Loading…
Reference in New Issue
Block a user