3d8f3e62 张雷

厂区驾驶舱接口开发

1 个父辈 1d7c30d4
......@@ -83,7 +83,6 @@
<select id="getYhylqs" resultType="java.util.HashMap">
SELECT
LEFT( v3.time, 7 ) time,
( v3.time, 7 ) time,
(SUM( v3.NACLO ) + SUM( v3.PFS ) + SUM( v3.FHTY ) + SUM( v3.RYXNJ ) + SUM( v3.YWL ) + SUM( v3.GXCLJ ) + SUM( v3.CH3COONA )
+ SUM( v3.HXT ) + SUM( v3.FECL3 ) + SUM( v3.SH ) + SUM( v3.CH3COOH ) + SUM( v3.FESO4G ) + SUM( v3.FESO4Y ) + SUM( v3.H2O2 ) ) AS zyl,
v2.clsl,
......
......@@ -133,9 +133,9 @@ skua:
web-url: http://103.85.171.27:8096
path:
#文件上传根目录 设置
upload: ../file
upload: /home/skboot/file
#webapp文件路径
webapp: ../file
webapp: /home/skboot/file
# 断点续传路径
chunk: /home/skboot/file/files
#创蓝短信秘钥
......
package com.skua.modules.dataAnalysis.controller;
import com.skua.core.api.vo.Result;
import com.skua.modules.dataAnalysis.service.IFactoryCenterService;
import com.skua.modules.dataAnalysis.vo.StatisticsParam;
import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO;
import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@Api(tags = "厂区驾驶舱")
@RestController
@RequestMapping("/v1/factoryCenter")
public class FactoryCenterController {
@Autowired
private IFactoryCenterService factoryCenterService;
@ApiOperation(value="厂区驾驶舱实时数据查询", notes="厂区驾驶舱实时数据查询")
@GetMapping(value = "/getRealTimeData")
public Result<List<WaterQualityMonitoringDetailVO>> getRealTimeData(String departId) {
Result<List<WaterQualityMonitoringDetailVO>> result = new Result<List<WaterQualityMonitoringDetailVO>>();
List<WaterQualityMonitoringDetailVO> list = factoryCenterService.queryMonitoringData(departId);
result.setSuccess(true);
result.setResult(list);
return result;
}
@ApiOperation(value="厂区驾驶舱统计数据", notes="厂区驾驶舱统计数据")
@GetMapping(value = "/getData")
public Result<Map<String,Object>> getData(String departId,String month) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = factoryCenterService.getData(departId,month);
result.setSuccess(true);
result.setResult(map);
return result;
}
@ApiOperation(value="厂区驾驶舱产泥量统计", notes="厂区驾驶舱产泥量统计")
@GetMapping(value = "/getCnltj")
public Result<List<Map<String, Object>>> getCnltj(StatisticsParam statisticsParam) {
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
List<Map<String, Object>> list = factoryCenterService.getCnltj(statisticsParam);
result.setSuccess(true);
result.setResult(list);
return result;
}
@ApiOperation(value="厂区驾驶舱耗电量统计", notes="厂区驾驶舱耗电量统计")
@GetMapping(value = "/getHdltj")
public Result<List<Map<String, Object>>> getHdltj(StatisticsParam statisticsParam) {
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
List<Map<String, Object>> list = factoryCenterService.getHdltj(statisticsParam);
result.setSuccess(true);
result.setResult(list);
return result;
}
//污水处理水量统计
@ApiOperation(value="厂区驾驶舱污水处理水量统计", notes="厂区驾驶舱污水处理水量统计")
@GetMapping(value = "/getWssltj")
public Result<List<Map<String, Object>>> getWssltj(StatisticsParam statisticsParam) {
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
List<Map<String, Object>> list = factoryCenterService.getWssltj(statisticsParam);
result.setSuccess(true);
result.setResult(list);
return result;
}
//厂区驾驶舱药耗统计
@ApiOperation(value="厂区驾驶舱药耗统计", notes="厂区驾驶舱药耗统计")
@GetMapping(value = "/getYhtj")
public Result<List<Map<String, Object>>> getYhtj(StatisticsParam statisticsParam) {
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
List<Map<String, Object>> list = factoryCenterService.getYhtj(statisticsParam);
result.setSuccess(true);
result.setResult(list);
return result;
}
/**
* <pre>
* <获取指定厂站报警阈值
* </pre>
* @return
*/
@ApiOperation(value="获取指定厂站报警阈值", notes="获取指定厂站报警阈值")
@GetMapping(value = "/getMonitorThreshold")
public Result<Map<String,Object>> getMonitorThreshold(String departId) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String, Object> map = factoryCenterService.getMonitorThreshold(departId);
result.setSuccess(true);
result.setResult(map);
return result;
}
@ApiOperation(value="获取水质变化趋势", notes="获取水质变化趋势")
@GetMapping(value = "/getHourWaterData")
public Result<Map<String,Object>> getHourWaterData(StatisticsParam statisticsParam) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = new HashMap<>();
map = factoryCenterService.getHourWaterData(statisticsParam);
result.setSuccess(true);
result.setResult(map);
return result;
}
}
package com.skua.modules.dataAnalysis.mapper;
import com.skua.modules.system.datestandard.entity.SysMonitorMetricInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface FactoryCenterMapper {
List<SysMonitorMetricInfo> getMonitorListByDepart(@Param("departId") String departId);
List<Map<String, Object>> getHourWaterData(@Param("departId") String departId, @Param("startDate") String startDate, @Param("endDate") String endDate);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.dataAnalysis.mapper.FactoryCenterMapper">
<select id="getMonitorListByDepart" resultType="com.skua.modules.system.datestandard.entity.SysMonitorMetricInfo">
SELECT
*
FROM
sys_monitor_metric_info
WHERE
depart_id = #{departId}
AND metric_uid_tag IN ( 'JSTP', 'JSTN', 'JSPH', 'JSNH3N', 'JSCOD', 'CSTP', 'CSTN', 'CSPH', 'CSNH3N', 'CSCOD' )
</select>
<select id="getHourWaterData" resultType="java.util.HashMap">
select * from sys_monitor_metric_info
</select>
</mapper>
package com.skua.modules.dataAnalysis.service;
import com.skua.modules.dataAnalysis.vo.StatisticsParam;
import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO;
import java.util.List;
import java.util.Map;
public interface IFactoryCenterService {
/**
* 获取水质监测数据
* @param departId
* @return
*/
List<WaterQualityMonitoringDetailVO> queryMonitoringData(String departId);
Map<String, Object> getData(String departId,String month);
List<Map<String, Object>> getCnltj(StatisticsParam statisticsParam);
List<Map<String, Object>> getHdltj(StatisticsParam statisticsParam);
List<Map<String, Object>> getWssltj(StatisticsParam statisticsParam);
List<Map<String, Object>> getYhtj(StatisticsParam statisticsParam);
Map<String, Object> getMonitorThreshold(String departId);
Map<String, Object> getHourWaterData(StatisticsParam statisticsParam);
}
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 统计功能配置表
*/
@Data
@ApiModel(value="大屏接口参数", description="大屏接口参数")
public class StatisticsParam {
/**厂区*/
@ApiModelProperty(value = "厂区")
private String departId;
/**开始时间*/
@ApiModelProperty(value = "开始时间")
private String startDate;
/**结束时间*/
@ApiModelProperty(value = "结束时间")
private String endDate;
}
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 调度中心vo对象
*
*/
@Data
@ApiModel(value="调度中心vo对象", description="调度中心vo对象")
public class WaterQualityMonitorVO {
/**
* 片区id
*/
@ApiModelProperty(value = "所属片区")
private String areaId;
/**
* 厂id
*/
@ApiModelProperty(value = "所属厂区")
private String factoryId;
private String factoryName;
/**
* 流量
*/
@ApiModelProperty(value = "流量")
private String inFlow;
private String outFlow;
private String inFlowState;
private String outFlowState;
/**
* cod
*/
@ApiModelProperty(value = "cod")
private String inCod;
private String outCod;
private String inCodState;
private String outCodState;
/**
* 氨氮
*/
@ApiModelProperty(value = "氨氮")
private String inNh3;
private String outNh3;
private String inNh3State;
private String outNh3State;
/**
* 总磷
*/
@ApiModelProperty(value = "总磷")
private String inTp;
private String outTp;
private String inTpState;
private String outTpState;
/**
* 总氮
*/
@ApiModelProperty(value = "总氮")
private String inTn;
private String outTn;
private String inTnState;
private String outTnState;
/**
* ph
*/
@ApiModelProperty(value = "ph")
private String inPh;
private String outPh;
private String inPhState;
private String outPhState;
private List<Map<String,Object>> equipList;
}
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 水质监测明细vo对象
* @author liyy
*
*/
@Data
@ApiModel(value="水质监控明细对象", description="封装水质监控明细数据")
public class WaterQualityMonitoringDetailVO {
@ApiModelProperty(value = "进出水类型")
private Integer num;
/**
* 进出水类型
*/
@ApiModelProperty(value = "进出水类型")
private String parmType;
/**
* 厂id
*/
@ApiModelProperty(value = "厂id")
private String departId;
/**
* 厂站名称
*/
@ApiModelProperty(value = "厂站名称")
private String departName;
@ApiModelProperty(value = "厂区排序")
private int departOrder;
@ApiModelProperty(value = "厂区负责人")
private String proPerson;
@ApiModelProperty(value = "厂区负责人电话")
private String proPhone;
/**
* 监测时间
*/
@ApiModelProperty(value = "监测时间")
private String monitorTime;
/**
* 流量
*/
@ApiModelProperty(value = "流量")
private String flowVal;
private String flowUpper;
private String flowLower;
private String flowAbnormal;
/**
* cod
*/
@ApiModelProperty(value = "cod")
private String codVal;
private String codUpper;
private String codLower;
private String codAbnormal;
private String codWarnMessage;//预警
/**
* 氨氮
*/
@ApiModelProperty(value = "氨氮")
private String nh3Val;
private String nh3Upper;
private String nh3Lower;
private String nh3Abnormal;
private String nh3WarnMessage;
/**
* 总磷
*/
@ApiModelProperty(value = "总磷")
private String tpVal;
private String tpUpper;
private String tpLower;
private String tpAbnormal;
private String tpWarnMessage;
/**
* 总氮
*/
@ApiModelProperty(value = "总氮")
private String tnVal;
private String tnUpper;
private String tnLower;
private String tnAbnormal;
private String tnWarnMessage;
/**
* 温度
*/
@ApiModelProperty(value = "温度")
private String temperatureVal;
private String temperatureWarnMessage;
/**
* ph
*/
@ApiModelProperty(value = "ph")
private String phVal;
private String phUpper;
private String phLower;
private String phAbnormal;
/**
* 摄像头
*/
@ApiModelProperty(value = "摄像头")
private String cameraVal;
/**
* 出水标准
*/
@ApiModelProperty(value = "出水标准")
private String outLevel;
/**
* 是否水质正常
*/
private String isHaveNormal;
/**
* 是否水质超标
*/
private String isHaveAbnormal;
/**
* 超标指标个数
*/
private int abnormalCount;
/**
* 指标未配置
*/
private int notConfiguredCount;
/**
* 厂站指标没有配置标记
*/
private String isNotHaveConfigured;
/**
* 是否含有0值
*/
private String isHaveZero;
/**
* 是否脱机
*/
private String isHaveOffline;
/**
* 是否预警
*/
private String isHaveWarn;
/**
* 预警个数
*/
private int abWarnCount;
private int offLineCount;
}
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value="水质监控对象", description="封装水质监控数据")
public class WaterQualityMonitoringVO {
@ApiModelProperty(value = "总数")
private String all;//全部
@ApiModelProperty(value = "在线")
private String normal;//正常
@ApiModelProperty(value = "异常")
private String abnormal;//异常
@ApiModelProperty(value = "脱机")
private String offline;//脱机
@ApiModelProperty(value = "零值")
private String zeroVal;//零值
@ApiModelProperty(value = "预警")
private String warnVal;//零值
@ApiModelProperty(value = "水质监控明细")
private List<WaterQualityMonitoringDetailVO> list;//明细
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!