郊县管网监测指标
This commit is contained in:
parent
bd52ac30c5
commit
ceac0d6996
|
|
@ -54,6 +54,36 @@ public class HeatanalysisHistoryController extends JeecgController<HeatanalysisH
|
||||||
return Result.ok(pageList);
|
return Result.ok(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param heatanalysisHistory
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/jxpage")
|
||||||
|
public Result<?> queryJxPageList(HeatanalysisHistory heatanalysisHistory, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
@RequestParam(name = "SDateStr", required = false) String SDateStr,
|
||||||
|
@RequestParam(name = "EDateStr", required = false) String EDateStr, HttpServletRequest req) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
try {
|
||||||
|
if(StringUtils.isNotBlank(SDateStr)){
|
||||||
|
heatanalysisHistory.setSDate(sdf.parse(SDateStr));
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(EDateStr)){
|
||||||
|
heatanalysisHistory.setEDate(sdf.parse(EDateStr));
|
||||||
|
}
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Page<HeatanalysisHistory> page = new Page<HeatanalysisHistory>(pageNo, pageSize);
|
||||||
|
IPage<HeatanalysisHistory> pageList = service.findJxPage(page, heatanalysisHistory);
|
||||||
|
return Result.ok(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/queryHistoryList")
|
@GetMapping(value = "/queryHistoryList")
|
||||||
public Result<?> queryHistoryList(HeatanalysisHistory heatanalysisHistory, HttpServletRequest req) {
|
public Result<?> queryHistoryList(HeatanalysisHistory heatanalysisHistory, HttpServletRequest req) {
|
||||||
return service.findHistoryList(heatanalysisHistory);
|
return service.findHistoryList(heatanalysisHistory);
|
||||||
|
|
|
||||||
|
|
@ -100,22 +100,22 @@ public class Heatanalysis extends JeecgEntity {
|
||||||
private Integer reportType;//数据采集类型 1设备自动上报 2定时模拟
|
private Integer reportType;//数据采集类型 1设备自动上报 2定时模拟
|
||||||
private String fromFlow; // 温度是否从流量取 0否 1是
|
private String fromFlow; // 温度是否从流量取 0否 1是
|
||||||
private String view031; // 流量设备SN,view031到view047全是从流量表上获取的数据
|
private String view031; // 流量设备SN,view031到view047全是从流量表上获取的数据
|
||||||
private String view032; // 流量数据上报时间
|
private Date view032; // 流量数据上报时间
|
||||||
private String view033; // 仪表ID
|
private String view033; // 仪表ID
|
||||||
private String view034; // 数据有效标识 0无效 1有效
|
private int view034; // 数据有效标识 0无效 1有效
|
||||||
private String view035; // 供水温度
|
private Double view035; // 供水温度
|
||||||
private String view036; // 回水温度
|
private Double view036; // 回水温度
|
||||||
private String view037; // 瞬时流量
|
private Double view037; // 瞬时流量
|
||||||
private String view038; // 正累积流量
|
private Double view038; // 正累积流量
|
||||||
private String view039; // 负累积流量
|
private Double view039; // 负累积流量
|
||||||
private String view040; // 净累积流量
|
private Double view040; // 净累积流量
|
||||||
private String view041; // 瞬时热量
|
private Double view041; // 瞬时热量
|
||||||
private String view042; // 正累积热量
|
private Double view042; // 正累积热量
|
||||||
private String view043; // 负累积热量
|
private Double view043; // 负累积热量
|
||||||
private String view044; // 净累积热量
|
private Double view044; // 净累积热量
|
||||||
private String view045; // 流体速度
|
private Double view045; // 流体速度
|
||||||
private String view046; // 流量因子
|
private Double view046; // 流量因子
|
||||||
private String view047; // 热量因子
|
private Double view047; // 热量因子
|
||||||
private Integer isExtract;//是否抽取 0否 1是
|
private Integer isExtract;//是否抽取 0否 1是
|
||||||
/**地区类型*/
|
/**地区类型*/
|
||||||
@Excel(name = "地区类型", width = 15)
|
@Excel(name = "地区类型", width = 15)
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,25 @@ public class HeatanalysisHistory extends JeecgEntity {
|
||||||
private String sim; // sim
|
private String sim; // sim
|
||||||
private String code; // code
|
private String code; // code
|
||||||
private Integer reportType;//数据采集类型 1设备自动上报 2定时模拟
|
private Integer reportType;//数据采集类型 1设备自动上报 2定时模拟
|
||||||
|
private String fromFlow; // 温度是否从流量取 0否 1是
|
||||||
|
private String view031; // 流量设备SN,view031到view047全是从流量表上获取的数据
|
||||||
|
private Date view032; // 流量数据上报时间
|
||||||
|
private String view033; // 仪表ID
|
||||||
|
private int view034; // 数据有效标识 0无效 1有效
|
||||||
|
private Double view035; // 供水温度
|
||||||
|
private Double view036; // 回水温度
|
||||||
|
private Double view037; // 瞬时流量
|
||||||
|
private Double view038; // 正累积流量
|
||||||
|
private Double view039; // 负累积流量
|
||||||
|
private Double view040; // 净累积流量
|
||||||
|
private Double view041; // 瞬时热量
|
||||||
|
private Double view042; // 正累积热量
|
||||||
|
private Double view043; // 负累积热量
|
||||||
|
private Double view044; // 净累积热量
|
||||||
|
private Double view045; // 流体速度
|
||||||
|
private Double view046; // 流量因子
|
||||||
|
private Double view047; // 热量因子
|
||||||
|
private Integer isExtract;//是否抽取 0否 1是
|
||||||
/**地区类型*/
|
/**地区类型*/
|
||||||
@Excel(name = "地区类型", width = 15)
|
@Excel(name = "地区类型", width = 15)
|
||||||
@ApiModelProperty(value = "地区类型")
|
@ApiModelProperty(value = "地区类型")
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,10 @@ import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送消息任务
|
* 发送消息任务
|
||||||
|
*
|
||||||
* @author: jeecg-boot
|
* @author: jeecg-boot
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -67,11 +69,11 @@ public class FlowanalysisJob implements Job {
|
||||||
heatanalysisQueryWrapper.last("limit 1");
|
heatanalysisQueryWrapper.last("limit 1");
|
||||||
Heatanalysis heatanalysis = heatanalysisService.getOne(heatanalysisQueryWrapper);
|
Heatanalysis heatanalysis = heatanalysisService.getOne(heatanalysisQueryWrapper);
|
||||||
if (heatanalysis != null) {
|
if (heatanalysis != null) {
|
||||||
String view032_old = heatanalysis.getView032();
|
Date view032_old = heatanalysis.getView032();
|
||||||
String data = jsonObject.getStr("data");
|
String data = jsonObject.getStr("data");
|
||||||
JSONObject dataObject = new JSONObject(data);
|
JSONObject dataObject = new JSONObject(data);
|
||||||
String view032 = dataObject.getStr("logat");
|
String view032 = dataObject.getStr("logat");
|
||||||
if(StringUtils.equals(view032,view032_old)){
|
if (StringUtils.equals(view032, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(view032_old))) {
|
||||||
log.info("--------数据重复---------");
|
log.info("--------数据重复---------");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -95,38 +97,38 @@ public class FlowanalysisJob implements Job {
|
||||||
String view046 = dataObject.getStr("n");
|
String view046 = dataObject.getStr("n");
|
||||||
String view047 = dataObject.getStr("m");
|
String view047 = dataObject.getStr("m");
|
||||||
heatanalysis.setView031(sn);
|
heatanalysis.setView031(sn);
|
||||||
heatanalysis.setView032(view032);
|
heatanalysis.setView032(new Date(view032));
|
||||||
heatanalysis.setView033(view033);
|
heatanalysis.setView033(view033);
|
||||||
heatanalysis.setView034(view034);
|
heatanalysis.setView034(Integer.parseInt(view034));
|
||||||
heatanalysis.setView035(view035);
|
heatanalysis.setView035(Double.parseDouble(view035));
|
||||||
heatanalysis.setView036(view036);
|
heatanalysis.setView036(Double.parseDouble(view036));
|
||||||
if (StringUtils.isEmpty(view037)) {
|
if (StringUtils.isEmpty(view037)) {
|
||||||
heatanalysis.setView037(view037_2);
|
heatanalysis.setView037(Double.parseDouble(view037_2));
|
||||||
} else {
|
} else {
|
||||||
heatanalysis.setView037(view037);
|
heatanalysis.setView037(Double.parseDouble(view037));
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(view038)) {
|
if (StringUtils.isEmpty(view038)) {
|
||||||
heatanalysis.setView038(view038_2);
|
heatanalysis.setView038(Double.parseDouble(view038_2));
|
||||||
} else {
|
} else {
|
||||||
heatanalysis.setView038(view038);
|
heatanalysis.setView038(Double.parseDouble(view038));
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(view039)) {
|
if (StringUtils.isEmpty(view039)) {
|
||||||
heatanalysis.setView039(view039_2);
|
heatanalysis.setView039(Double.parseDouble(view039_2));
|
||||||
} else {
|
} else {
|
||||||
heatanalysis.setView039(view039);
|
heatanalysis.setView039(Double.parseDouble(view039));
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(view040)) {
|
if (StringUtils.isEmpty(view040)) {
|
||||||
heatanalysis.setView040(view040_2);
|
heatanalysis.setView040(Double.parseDouble(view040_2));
|
||||||
} else {
|
} else {
|
||||||
heatanalysis.setView040(view040);
|
heatanalysis.setView040(Double.parseDouble(view040));
|
||||||
}
|
}
|
||||||
heatanalysis.setView041(view041);
|
heatanalysis.setView041(Double.parseDouble(view041));
|
||||||
heatanalysis.setView042(view042);
|
heatanalysis.setView042(Double.parseDouble(view042));
|
||||||
heatanalysis.setView043(view043);
|
heatanalysis.setView043(Double.parseDouble(view043));
|
||||||
heatanalysis.setView044(view044);
|
heatanalysis.setView044(Double.parseDouble(view044));
|
||||||
heatanalysis.setView045(view045);
|
heatanalysis.setView045(Double.parseDouble(view045));
|
||||||
heatanalysis.setView046(view046);
|
heatanalysis.setView046(Double.parseDouble(view046));
|
||||||
heatanalysis.setView047(view047);
|
heatanalysis.setView047(Double.parseDouble(view047));
|
||||||
heatanalysisService.exeWater(heatanalysis);
|
heatanalysisService.exeWater(heatanalysis);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -139,7 +141,6 @@ public class FlowanalysisJob implements Job {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String getWebInfo(String sn) {
|
public static String getWebInfo(String sn) {
|
||||||
String result = "false";
|
String result = "false";
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,6 @@ import java.util.List;
|
||||||
|
|
||||||
public interface HeatanalysisHistoryMapper extends BaseMapper<HeatanalysisHistory> {
|
public interface HeatanalysisHistoryMapper extends BaseMapper<HeatanalysisHistory> {
|
||||||
Page<HeatanalysisHistory> findPage(Page<HeatanalysisHistory> page, @Param("params") HeatanalysisHistory heatanalysisHistory);
|
Page<HeatanalysisHistory> findPage(Page<HeatanalysisHistory> page, @Param("params") HeatanalysisHistory heatanalysisHistory);
|
||||||
|
Page<HeatanalysisHistory> findJxPage(Page<HeatanalysisHistory> page, @Param("params") HeatanalysisHistory heatanalysisHistory);
|
||||||
List<HeatanalysisHistory> findHistoryList(HeatanalysisHistory heatanalysisHistory);
|
List<HeatanalysisHistory> findHistoryList(HeatanalysisHistory heatanalysisHistory);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,103 @@
|
||||||
ORDER BY view001 asc ,view002 asc,view004 asc,DATATIME DESC
|
ORDER BY view001 asc ,view002 asc,view004 asc,DATATIME DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="findJxPage" resultType="org.jeecg.modules.heating.entity.HeatanalysisHistory">
|
||||||
|
select * from (
|
||||||
|
SELECT
|
||||||
|
a.id AS "id",
|
||||||
|
a.view001 AS "view001",
|
||||||
|
a.view002 AS "view002",
|
||||||
|
a.view003 AS "view003",
|
||||||
|
a.view004 AS "view004",
|
||||||
|
a.datatime AS "datatime",
|
||||||
|
a.caveat AS "caveat",
|
||||||
|
a.view005 AS "view005",
|
||||||
|
a.view006 AS "view006",
|
||||||
|
a.view007 AS "view007",
|
||||||
|
a.view008 AS "view008",
|
||||||
|
a.view009 AS "view009",
|
||||||
|
a.view010 AS "view010",
|
||||||
|
a.view011 AS "view011",
|
||||||
|
a.view012 AS "view012",
|
||||||
|
a.view013 AS "view013",
|
||||||
|
a.view014 AS "view014",
|
||||||
|
a.view015 AS "view015",
|
||||||
|
a.view016 AS "view016",
|
||||||
|
a.view017 AS "view017",
|
||||||
|
a.view018 AS "view018",
|
||||||
|
a.view019 AS "view019",
|
||||||
|
a.view020 AS "view020",
|
||||||
|
a.view021 AS "view021",
|
||||||
|
a.view022 AS "view022",
|
||||||
|
a.view023 AS "view023",
|
||||||
|
a.view024 AS "view024",
|
||||||
|
a.view025 AS "view025",
|
||||||
|
a.view026 AS "view026",
|
||||||
|
a.view027 AS "view001Name",
|
||||||
|
a.view028 AS "view002Name",
|
||||||
|
a.view029 AS "view003Name",
|
||||||
|
a.view030 AS "view004Name",
|
||||||
|
a.from_flow AS "fromFlow",
|
||||||
|
a.view031 AS "view031",
|
||||||
|
a.view032 AS "view032",
|
||||||
|
a.view033 AS "view033",
|
||||||
|
a.view034 AS "view034",
|
||||||
|
a.view035 AS "view035",
|
||||||
|
a.view036 AS "view036",
|
||||||
|
a.view037 AS "view037",
|
||||||
|
a.view038 AS "view038",
|
||||||
|
a.view039 AS "view039",
|
||||||
|
a.view040 AS "view040",
|
||||||
|
a.view041 AS "view041",
|
||||||
|
a.view042 AS "view042",
|
||||||
|
a.view043 AS "view043",
|
||||||
|
a.view044 AS "view044",
|
||||||
|
a.view045 AS "view045",
|
||||||
|
a.view046 AS "view046",
|
||||||
|
a.view047 AS "view047",
|
||||||
|
a.sim AS "sim",
|
||||||
|
a.create_by AS "createBy.id",
|
||||||
|
a.create_date AS "createDate",
|
||||||
|
a.update_by AS "updateBy.id",
|
||||||
|
a.update_date AS "updateDate",
|
||||||
|
a.del_flag AS "delFlag",
|
||||||
|
a.report_type AS "reportType"
|
||||||
|
FROM ${params.tableName} a
|
||||||
|
<where>
|
||||||
|
a.region_type = #{params.regionType}
|
||||||
|
And a.del_flag = '0'
|
||||||
|
<if test="params.view001 != null and params.view001 != ''">
|
||||||
|
AND a.view001 = #{params.view001}
|
||||||
|
</if>
|
||||||
|
<if test="params.view002 != null and params.view002 != ''">
|
||||||
|
AND a.view002 = #{params.view002}
|
||||||
|
</if>
|
||||||
|
<if test="params.view004 != null and params.view004 != '' and params.view004 != -1">
|
||||||
|
AND a.view004 = #{params.view004}
|
||||||
|
</if>
|
||||||
|
<if test="params.view004 != null and params.view004 != '' and params.view004 == -1">
|
||||||
|
AND a.view004 is null
|
||||||
|
</if>
|
||||||
|
<if test="params.SDate != null">
|
||||||
|
AND a.view032 >= #{params.SDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.EDate != null">
|
||||||
|
AND a.view032 <= #{params.EDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.caveat != null">
|
||||||
|
AND a.caveat = #{params.caveat}
|
||||||
|
</if>
|
||||||
|
<if test="params.reportType != null">
|
||||||
|
AND a.report_type = #{params.reportType}
|
||||||
|
</if>
|
||||||
|
<if test="params.sim != null and params.sim != ''">
|
||||||
|
AND a.sim = #{params.sim}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
) t
|
||||||
|
ORDER BY view001 asc ,view002 asc,view004 asc,DATATIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="findHistoryList" resultType="org.jeecg.modules.heating.entity.HeatanalysisHistory">
|
<select id="findHistoryList" resultType="org.jeecg.modules.heating.entity.HeatanalysisHistory">
|
||||||
select * from (
|
select * from (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,6 @@ import java.util.List;
|
||||||
|
|
||||||
public interface HeatanalysisHistoryService extends JeecgService<HeatanalysisHistory> {
|
public interface HeatanalysisHistoryService extends JeecgService<HeatanalysisHistory> {
|
||||||
IPage<HeatanalysisHistory> findPage(Page<HeatanalysisHistory> page,HeatanalysisHistory heatanalysisHistory);
|
IPage<HeatanalysisHistory> findPage(Page<HeatanalysisHistory> page,HeatanalysisHistory heatanalysisHistory);
|
||||||
|
IPage<HeatanalysisHistory> findJxPage(Page<HeatanalysisHistory> page,HeatanalysisHistory heatanalysisHistory);
|
||||||
Result<?> findHistoryList(HeatanalysisHistory heatanalysisHistory);
|
Result<?> findHistoryList(HeatanalysisHistory heatanalysisHistory);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,26 @@ public class HeatanalysisHistoryServiceImpl extends JeecgServiceImpl<Heatanalysi
|
||||||
return baseMapper.findPage(page,heatanalysisHistory);
|
return baseMapper.findPage(page,heatanalysisHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IPage<HeatanalysisHistory> findJxPage(Page<HeatanalysisHistory> page,HeatanalysisHistory heatanalysisHistory){
|
||||||
|
Date sDate = heatanalysisHistory.getSDate();
|
||||||
|
String sDateStr = "";
|
||||||
|
SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
if(sDate!=null){
|
||||||
|
sDateStr = sdf.format(sDate);
|
||||||
|
}else{
|
||||||
|
sDateStr = sdf.format(new Date());
|
||||||
|
heatanalysisHistory.setSDate(sDate);
|
||||||
|
}
|
||||||
|
String tableName = "bl_heatanalysis_"+sDateStr.substring(2, 4)+sDateStr.substring(5, 7);
|
||||||
|
heatanalysisHistory.setTableName(tableName);
|
||||||
|
Date eDate = heatanalysisHistory.getEDate();
|
||||||
|
if(eDate==null){
|
||||||
|
eDate = new Date();
|
||||||
|
heatanalysisHistory.setEDate(eDate);
|
||||||
|
}
|
||||||
|
return baseMapper.findJxPage(page,heatanalysisHistory);
|
||||||
|
}
|
||||||
|
|
||||||
public Result<?> findHistoryList(HeatanalysisHistory heatanalysisHistory){
|
public Result<?> findHistoryList(HeatanalysisHistory heatanalysisHistory){
|
||||||
Map<String,Object> map = new HashMap<>();
|
Map<String,Object> map = new HashMap<>();
|
||||||
SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue