初始化项目

This commit is contained in:
root
2024-04-01 09:20:31 +08:00
commit fefd704e6e
4694 changed files with 1869737 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package com.pqs9000.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class PageController {
ObjectMapper mapper=new ObjectMapper();
/** 日志记录器 */
@RequestMapping(value = "{pageName}", method = RequestMethod.GET)
public String toPage(@PathVariable("pageName") String pageName)
{
return pageName;
}
}

View File

@@ -0,0 +1,69 @@
package com.pqs9000.controller;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.SimpleValue;
import com.njcn.service.system.ThemeService;
import com.njcn.utils.PubUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
/**
* @author hongawen
* @date: 2019/9/27 10:47
*/
@Controller
@RequestMapping("theme")
public class ThemeController {
private static final Logger logger = LoggerFactory.getLogger(ThemeController.class);
@Resource
private ThemeService themeService;
/**
* 获取主题色
*/
@PostMapping("getColor")
@ResponseBody
public HttpResult getColor() {
HttpResult result;
String color;
try{
color=themeService.getThemeColor();
result= PubUtils.assignmentResult(color,200,"获取主题色成功");
}catch (Exception e){
logger.error(e.toString());
result= PubUtils.assignmentResult("#006565",500,"获取主题色失败");
}
return result;
}
/**
* 获取主题信息
*/
@PostMapping("getThemeInfo")
@ResponseBody
public HttpResult getThemeInfo() {
HttpResult result;
SimpleValue simpleValue;
try {
simpleValue = themeService.getThemeInfo();
result = PubUtils.assignmentResult(simpleValue, 200, "获取主题信息成功");
} catch (Exception e) {
logger.error(e.toString());
simpleValue = new SimpleValue();
simpleValue.setName("国网");
simpleValue.setValue("#006565");
result = PubUtils.assignmentResult(simpleValue, 500, "获取主题信息失败");
}
return result;
}
}

View File

@@ -0,0 +1,241 @@
package com.pqs9000.controller.area;
import cn.hutool.core.io.FileUtil;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.*;
import com.njcn.pojo.data.Detailed;
import com.njcn.pojo.data.LimitrateDays;
import com.njcn.service.commons.IWaveService;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.service.user.DeptsService;
import com.njcn.shiro.cache.VCache;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.AppConfig;
import com.njcn.utils.PubUtils;
import com.njcn.utils.ZipUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.zip.ZipOutputStream;
/**
* 区域业务的controller
*/
@Controller
@RequestMapping("/area")
public class AreaController {
// 日志记录
private static final Logger logger = LoggerFactory.getLogger(AreaController.class);
@Autowired
private IWaveService waveService;
@Autowired
private AppConfig appConfig;
static VCache cache;
@Resource
private DeptsService deptsService;
@Autowired
UserLogDetailService userLog;
/**
* 暂降事件列表中波形查看 最新优化的波形数据获取方式
*
* @param session 会话
* @param eventIndex 事件索引
*/
@RequestMapping(value = "getWavedata", method = RequestMethod.POST)
@ResponseBody
public HttpResult getWavedata(HttpSession session, String eventIndex, HttpServletRequest request) {
session.removeAttribute("eventIndex");
HttpResult result;
if (StringUtils.isBlank(eventIndex)) {
result = PubUtils.assignmentResult(null, 500, "没有获取到事件的索引");
logger.error("根据事件编号获取波形数据失败方法名getWaveData");
} else {
WaveData waveData;
try {
waveData = waveService.getWavedata(eventIndex, 1);
result = PubUtils.assignmentResult(waveData, 200, "获取波形数据成功");
userLog.getLog("查询波形数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("事件编号为:" + eventIndex + ",获取波形数据异常,异常为:" + e);
result = PubUtils.assignmentResult(null, 500, "因为异常导致获取波形数据失败");
userLog.getLog("查询波形数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
}
}
return result;
}
/**
* 暂降事件列表批量下载波形,先判断波形文件存在与否
*/
@PostMapping("downloadWave")
@ResponseBody
public HttpResult downloadWave(@RequestParam("index[]") List<String> index, HttpServletRequest request) {
HttpResult result;
if (CollectionUtils.isEmpty(index)) {
result = PubUtils.assignmentResult(null, 500, "请选中需要下载的波形");
return result;
}
try {
//下载前,清空备份
String item = "njcntemp" + File.separator + "waveTemp9000";
FileUtil.clean(new File(appConfig.getTmppath() + item));
Map<String, List<String>> indexList = waveService.getEventDetailIndexList(index);
if (CollectionUtils.isEmpty(indexList)) {
result = PubUtils.assignmentResult(null, 500, "没有波形数据");
} else {
result = PubUtils.assignmentResult(indexList, 200, "波形数据准备完毕");
cache.set(TokenManager.getUserId() + TokenManager.getSysType() + "waveFiles9200", indexList);
}
userLog.getLog("下载波形文件", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("后台获取数据出错方法名为downloadWave异常为" + e);
userLog.getLog("下载波形文件", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResult(null, 500, "获取暂降事件数据出错,请联系管理员");
}
return result;
}
/**
* 下载波形文件
*/
@RequestMapping("downWaveZip")
public void downZIPFile(HttpServletResponse response) throws Exception {
Map<String, List<String>> files = cache.get(TokenManager.getUserId() + TokenManager.getSysType() + "waveFiles9200");
if (CollectionUtils.isEmpty(files)) {
return;
}
String zipName = "Comtrade.zip";
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-Disposition", "attachment; filename=" + zipName);
ZipOutputStream out = new ZipOutputStream(response.getOutputStream());
try {
Iterator<Map.Entry<String, List<String>>> it = files.entrySet().iterator();
String item = "njcntemp/waveTemp9000";
File comtrade = new File(appConfig.getTmppath() + item);
FileUtil.clean(comtrade);
while (it.hasNext()) {
Map.Entry<String, List<String>> entry = it.next();
List<String> filePaths = entry.getValue();
File directoryFile = new File(appConfig.getTmppath() + item + File.separator + entry.getKey());
for (String path : filePaths) {
FileUtils.copyFileToDirectory(new File(path), directoryFile);
}
}
ZipUtils.doCompress(comtrade.getPath(), out);
//压缩完毕后,清除这个文件夹下的所有的文件
FileUtil.clean(comtrade);
response.flushBuffer();
} catch (Exception e) {
logger.error(e.getMessage());
} finally {
out.close();
}
}
/**
* 根据当前身份或者前台区域获取父子节点地区
*/
@PostMapping("getMapInfo")
@ResponseBody
public HttpResult getMapInfo(String area, HttpServletRequest request) {
HttpResult httpResult;
SimpleValue simpleValue;
try {
simpleValue = deptsService.getMapInfo(area);
httpResult = PubUtils.assignmentResult(simpleValue, 200, "获取地图信息成功");
userLog.getLog("查询地图信息", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
httpResult = PubUtils.assignmentResult(null, 500, "获取地图信息失败");
userLog.getLog("查询地图信息", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
logger.error("获取地图信息异常,异常为:" + e.toString());
}
return httpResult;
}
@PostMapping("getDataByTime")
@ResponseBody
public HttpResult getDataByTime(String name, String start, String end, String type, HttpServletRequest request) {
HttpResult httpResult;
DatePojo datePojo;
datePojo = PubUtils.validateDate(start, end, "getDataByTime");
if (!datePojo.getValidity()) {
httpResult = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return httpResult;
}
try {
List<LimitrateDays> list = deptsService.getLimitRateDays(name, datePojo.getStartTime(), datePojo.getEndTime(), Integer.parseInt(type));
httpResult = PubUtils.assignmentResult(list, 200, "获取稳态越限天数统计成功");
userLog.getLog("查询稳态越限天数", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
httpResult = PubUtils.assignmentResult(null, 500, "获取稳态越限天数统计失败");
logger.error("获取稳态越限天数统计异常,异常为:" + e.toString());
userLog.getLog("查询稳态越限天数", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
}
return httpResult;
}
@PostMapping("getdetailed")
@ResponseBody
public HttpResult getdetailed(String guid, String time, String type, String timetype, HttpServletRequest request) {
HttpResult httpResult;
Calendar calendar = Calendar.getInstance();
Calendar calendar1 = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = sdf.parse(time);
calendar.setTime(date);
calendar1.set(Calendar.YEAR, calendar.get(Calendar.YEAR));
calendar1.set(Calendar.MONTH, calendar.get(Calendar.MONTH));
calendar1.set(Calendar.HOUR_OF_DAY, 23);
calendar1.set(Calendar.MINUTE, 59);
calendar1.set(Calendar.SECOND, 59);
if (timetype.equals("0")) { //日
calendar1.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH));
} else {
calendar1.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
}
} catch (ParseException e) {
httpResult = PubUtils.assignmentResult(null, 500, e.getMessage());
return httpResult;
}
try {
List<Detailed> list = deptsService.getDetailed(calendar.getTime(), calendar1.getTime(), guid, type);
httpResult = PubUtils.assignmentResult(list, 200, "获取越限详细信息成功");
userLog.getLog("查询越限详细信息", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
httpResult = PubUtils.assignmentResult(null, 500, "获取越限详细信息失败");
userLog.getLog("查询越限详细信息", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
logger.error("获取越限详细信息异常,异常为:" + e.toString());
}
return httpResult;
}
}

View File

@@ -0,0 +1,81 @@
package com.pqs9000.controller.area;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.device.DeviceGeneral;
import com.njcn.service.configuration.DeviceService;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.PubUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* @author hongawen
* @Date: 2018/6/22 13:23
*/
@Controller
@RequestMapping("area")
public class DeviceStatusController {
private static final Logger logger= LoggerFactory.getLogger(DeviceStatusController.class);
@Autowired
private DeviceService deviceService;
@Autowired
UserLogDetailService userLog;
/**
* 跳转区域统计的终端状态
*/
@GetMapping("status")
public String status(){
return "business/area/deviceStatus";
}
@GetMapping("/steadystatTable")
public String steadystatTable() {
return "business/area/steadystattable";
}
/**
*区域统计--》终端状态
*/
@PostMapping("deviceStatus")
@ResponseBody
public HttpResult getDeviceStatus(String overview, String area,String scale,String manc,String loadtype,
HttpServletRequest request,String startTime,String endTime) {
HttpResult result=PubUtils.initResult(TokenManager.getToken().getLoginName(),request,LogTypeEnum.BUSSINESS.toString(),0);
DeviceGeneral data ;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "deviceStatus");
if (!datePojo.getValidity()) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
try {
data=deviceService.getDeviceSiftData(overview,area,scale,manc,loadtype,datePojo.getStartTime(),datePojo.getEndTime());
if(null==data){
result = PubUtils.assignmentResultLog(null, 500, "获取终端运行数据为空","查询稳态终端状态","成功",result);
}else{
result = PubUtils.assignmentResultLog(data, 200, "获取终端运行数据成功","查询稳态终端状态","成功",result);
}
userLog.getLog("查询终端状态", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:"+e.toString());
result = PubUtils.assignmentResultLog(null, 500, "获取终端运行数据异常","查询稳态终端状态","失败",result);
userLog.getLog("查询终端状态", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
}
return result;
}
}

View File

@@ -0,0 +1,329 @@
package com.pqs9000.controller.area;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.njcn.enums.LogTypeEnum;
import com.njcn.mapper.configuration.DicDataMapper;
import com.njcn.mapper.configuration.TerminalLogsMapper;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.device.DeviceGeneral;
import com.njcn.pojo.commons.device.LineDetailInfo;
import com.njcn.pojo.commons.runmanage.IntergralityData;
import com.njcn.pojo.configuration.*;
import com.njcn.service.configuration.DeviceService;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.AppConfig;
import com.njcn.utils.PubUtils;
import com.pqs9000.pojo.report.IntegrityDetailVo;
import com.pqs9000.service.report.GetInegDataService;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author hongawen
* @Date: 2018/6/22 14:13
*/
@Controller
@RequestMapping("area")
public class IntegralityController {
private static final Logger logger = LoggerFactory.getLogger(IntegralityController.class);
@Autowired
private DeviceService deviceService;
@Autowired
UserLogDetailService userLog;
@Autowired
private AppConfig appConfig;
@Autowired
private DicDataMapper dicDataMapper;
@Autowired
private TerminalLogsMapper terminalLogsMapper;
@Autowired
private GetInegDataService getInegDataService;
/**
* 跳转区域统计的数据完整性
*/
@GetMapping("integrality")
public String status() {
return "business/area/dataIntegrality";
}
/**
* 跳转运行管理的监测点数据完整性
* type 统计类型(冀北省、国网)
*/
@GetMapping("integralitytable")
public ModelAndView integrityTable(String starttime, String endtime, String area, String interval) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("business/manage/integrityTable");
if(StringUtils.isEmpty(starttime)&&StringUtils.isEmpty(endtime)){
modelAndView.addObject("startTime", "");
modelAndView.addObject("endTime", "");
}else{
DatePojo datePojo=PubUtils.validateDate(starttime,endtime,"integralitytable");
if(!StringUtils.isEmpty(datePojo.getMsg())){
modelAndView.addObject("startTime", "");
modelAndView.addObject("endTime", "");
}else{
modelAndView.addObject("startTime", starttime);
modelAndView.addObject("endTime", endtime);
}
}
modelAndView.addObject("area", area);
modelAndView.addObject("interval", interval);
return modelAndView;
}
/**
* 运行管理--》监测点数据完整性
*
* @param startTime 起始时间
* @param endTime 截止时间
* @param area 区域
*/
@PostMapping("getIntegrityData")
@ResponseBody
public HttpResult getIntegrityData(String startTime, String endTime, String area,Integer devflag, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "getIntegrityData");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
IntergralityData intergralityData;
try {
intergralityData = deviceService.getDataIntegralityTable(datePojo.getStartTime(), datePojo.getEndTime(), area,devflag);
if (null == intergralityData) {
result = PubUtils.assignmentResultLog(null, 500, "获取监测点数据完整性数据为空", "查询完整性列表", "成功", result);
} else {
result = PubUtils.assignmentResultLog(intergralityData, 200, "获取监测点数据完整性数据成功", "查询完整性列表", "成功", result);
}
userLog.getLog("查询监测点数据完整性", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:" + e.toString());
result = PubUtils.assignmentResultLog(null, 500, "获取监测点数据完整性数据异常", "查询完整性列表", "成功", result);
userLog.getLog("查询监测点数据完整性", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
}
return result;
}
/**
* 区域统计--》数据完整性
*
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("dataIntegrality")
@ResponseBody
public HttpResult dataIntegrality(String startTime, String endTime, String overview, String area,
String scale, String manc, String loadtype, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "dataIntegrality");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
DeviceGeneral data;
try {
data = deviceService.getDataIntegrality(datePojo.getStartTime(), datePojo.getEndTime(), overview, area, scale, manc, loadtype);
if (null == data) {
result = PubUtils.assignmentResultLog(null, 500, "获取数据完整性数据为空", "查询数据完整性", "成功", result);
} else {
result = PubUtils.assignmentResultLog(data, 200, "获取数据完整性数据成功", "查询数据完整性", "成功", result);
}
userLog.getLog("查询数据完整性数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:" + e.toString());
userLog.getLog("查询数据完整性数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取数据完整性数据异常", "查询数据完整性", "失败", result);
}
return result;
}
/**
* 监测点数据补招
* @date 2023/7/27
*/
@GetMapping("integralityRepair")
@ResponseBody
public HttpResult integralityRepair(String startTime, String endTime, Long lineId,Long devId) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "integralityRepair");
if (StrUtil.isNotBlank(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
String nodeIp = "";
Device deviceInfo = deviceService.selectDeviceByIndex(devId);
if(Objects.nonNull(deviceInfo)){
NodeInformation nodeInfo = deviceService.setIp(deviceInfo.getNodeIndex().intValue());
nodeIp = nodeInfo.getNodeIP();
}
Socket socket = null;
BufferedReader in = null;
OutputStream out = null;
try{
socket = new Socket(nodeIp, Integer.parseInt(appConfig.getSocketPort()));
socket.setSoTimeout(3000);
in = new BufferedReader(new InputStreamReader(socket.getInputStream(),StandardCharsets.UTF_8));
out = socket.getOutputStream();
JSONObject jsonObject = new JSONObject();
jsonObject.put("startTime",startTime);
jsonObject.put("endTime",endTime);
jsonObject.put("lineId",lineId);
jsonObject.put("index",devId);
jsonObject.put("type","240");
JSONObject jsonObjectOne = new JSONObject();
jsonObjectOne.put("len",jsonObject.toString().length());
jsonObjectOne.put("data",jsonObject);
//System.out.println(jsonObjectOne.toString());
out.write(jsonObjectOne.toString().getBytes(StandardCharsets.UTF_8));
//socket.shutdownOutput();
String expression;
while ((expression = in.readLine())==null){break;} {
try {
logger.info("accept msg:"+expression);
JSONObject res = JSONObject.fromObject(expression);
TerminalLogs terminalLogs = new TerminalLogs();
SubStation subStation = deviceService.loadSub(deviceInfo.getSubIndex());
LineDetailInfo lineDetail = deviceService.loadLine(lineId);
DicData dicData = dicDataMapper.getSelName("监测点数据完整性补招");
terminalLogs.setLogsIndex(IdUtil.randomUUID());
terminalLogs.setTerminalType(dicData.getDicIndex());
terminalLogs.setUserIndex(TokenManager.getUserId());
terminalLogs.setUpdateTime(new Date());
terminalLogs.setObjIndex(lineId.toString());
if("10000".equalsIgnoreCase(res.get("resultcode").toString())){
//成功
terminalLogs.setTerminalDescribe(TokenManager.getNickname()+"进行对"+subStation.getName()+"_"+lineDetail.getName()+"的数据补招,补招时间段:"+startTime+""+endTime+";补招结果"+"成功:");
terminalLogsMapper.insert(terminalLogs);
return PubUtils.assignmentResult(null, 200, "数据完整性补招成功");
}else if("10010".equalsIgnoreCase(res.get("resultcode").toString())) {
//错误
terminalLogs.setTerminalDescribe(TokenManager.getNickname()+"进行对"+subStation.getName()+"_"+lineDetail.getName()+"的数据补招,补招时间段:"+startTime+""+endTime+";补招结果"+"失败;");
terminalLogsMapper.insert(terminalLogs);
return PubUtils.assignmentResult(null, 500, "当前监测点无此功能");
}else {
//错误
terminalLogs.setTerminalDescribe(TokenManager.getNickname()+"进行对"+subStation.getName()+"_"+lineDetail.getName()+"的数据补招,补招时间段:"+startTime+""+endTime+";补招结果"+"失败;");
terminalLogsMapper.insert(terminalLogs);
return PubUtils.assignmentResult(null, 500, "数据完整性补招失败");
}
} catch (Exception e) {
e.printStackTrace();
logger.info("解析服务器数据异常");
}
}
}catch(Exception e){
e.printStackTrace();
return PubUtils.assignmentResult(null, 500, "Socket建立连接异常请排查端口号前置机信息");
}finally{
//一些必要的清理工作
if(in != null){
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
in = null;
}
if(out != null){
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
out = null;
}
if(socket != null){
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
socket = null;
}
//System.out.println("end---");
}
return PubUtils.assignmentResult(null, 200, "数据完整性补招成功");
}
/**
* 完整性详情查看
*/
@PostMapping("integralityDetail")
@ResponseBody
public HttpResult integralityDetail(String lineId, String startTime, String endTime, String timeType, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "integralityDetail");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
try {
List<IntegrityDetailVo> data = getInegDataService.getDetail(lineId,startTime,endTime,timeType);
if (null == data) {
result = PubUtils.assignmentResultLog(null, 500, "获取数据完整性详情为空", "查看数据完整性列表", "成功", result);
} else {
result = PubUtils.assignmentResultLog(data, 200, "获取数据完整性详情为空", "查看数据完整性列表", "成功", result);
}
} catch (Exception e) {
logger.error("查看数据完整性详情异常,异常为:" + e.toString());
userLog.getLog("查看数据完整性详情", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "查看数据完整性详情异常", "查看数据完整性详情", "失败", result);
}
return result;
}
}

View File

@@ -0,0 +1,100 @@
package com.pqs9000.controller.area;
import cn.hutool.core.collection.CollectionUtil;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.runmanage.IntergralityData;
import com.njcn.utils.PubUtils;
import com.pqs9000.pojo.monitorMap.AreaMonitorBaseInfo;
import com.pqs9000.pojo.monitorMap.AreaSubLineVO;
import com.pqs9000.service.monitorMap.MonitorScopeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* system
* 监测点区域地图
* @author cdf
* @date 2023/7/10
*/
@RestController
@RequestMapping("/monitorScope")
public class MonitorScopeController {
// 日志记录
private static final Logger logger = LoggerFactory.getLogger(MonitorScopeController.class);
@Resource
private MonitorScopeService monitorScopeService;
/**
* 监测点信息
*
* @param startTime 起始时间
* @param endTime 截止时间
*/
@GetMapping("getAreaLineMap")
public HttpResult getAreaLineMap(@RequestParam("startTime") String startTime, @RequestParam("endTime")String endTime) {
DatePojo datePojo;
HttpResult result;
datePojo = PubUtils.validateDate(startTime, endTime, "getAreaLineMap");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
try {
List<AreaSubLineVO> areaSubLineVOList = monitorScopeService.getMonitorScope(datePojo.getStartTime(), datePojo.getEndTime());
if (CollectionUtil.isEmpty(areaSubLineVOList)) {
result = PubUtils.assignmentResult(null, 500, "获取监测点信息数据为空");
} else {
result = PubUtils.assignmentResult(areaSubLineVOList, 200, "获取监测点信息成功");
}
} catch (Exception e) {
e.printStackTrace();
logger.error("获取监测点信息数据为异常,异常为:" + e.getMessage());
result = PubUtils.assignmentResult(null, 500, "获取监测点信息数据为异常");
}
return result;
}
/**
* 获取指定部门监测点暂降事件个数
* @author cdf
* @date 2023/7/13
*/
@GetMapping("getAreaLineEventCount")
public HttpResult getAreaLineEventCount(@RequestParam("startTime") String startTime, @RequestParam("endTime")String endTime) {
DatePojo datePojo;
HttpResult result;
datePojo = PubUtils.validateDate(startTime, endTime, "getAreaLineMap");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
try {
AreaMonitorBaseInfo res = monitorScopeService.getAreaLineEventCount(datePojo.getStartTime(), datePojo.getEndTime());
if (Objects.isNull(res)) {
result = PubUtils.assignmentResult(null, 500, "获取区域信息数据为空");
} else {
result = PubUtils.assignmentResult(res, 200, "获取区域信息成功");
}
} catch (Exception e) {
//e.printStackTrace();
logger.error("获取监测点信息数据为异常,异常为:" + e.getMessage());
result = PubUtils.assignmentResult(null, 500, "获取区域信息数据为异常");
}
return result;
}
}

View File

@@ -0,0 +1,144 @@
package com.pqs9000.controller.area;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.device.DeviceGeneral;
import com.njcn.pojo.commons.runmanage.OnlineRateData;
import com.njcn.service.configuration.DeviceService;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.PubUtils;
import com.njcn.utils.XssFilterUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
* @author hongawen
* @Date: 2018/6/22 13:51
*/
@Controller
@RequestMapping("area")
public class OnlineRateController {
private static final Logger logger= LoggerFactory.getLogger(OnlineRateController.class);
@Autowired
private DeviceService deviceService;
@Autowired
UserLogDetailService userLog;
/**
* 跳转区域统计的终端状态
*/
@GetMapping("onlinerate")
public String status(){
return "business/area/onlineRate";
}
/**
* 跳转运行管理的在线率页面
*/
@GetMapping("onlineratetable")
public ModelAndView onlineRateTable(String starttime,String endtime,String area,String interval) throws UnsupportedEncodingException {
ModelAndView modelAndView=new ModelAndView();
modelAndView.setViewName("business/manage/onlineRateTable");
starttime = XssFilterUtil.dealString(starttime);
endtime = XssFilterUtil.dealString(endtime);
area = XssFilterUtil.dealString(area);
interval = XssFilterUtil.dealString(interval);
DatePojo datePojo=PubUtils.validateDate(starttime,endtime,"onlineratetable");
if(!StringUtils.isEmpty(datePojo.getMsg())){
modelAndView.addObject("startTime", "");
modelAndView.addObject("endTime", "");
}else{
modelAndView.addObject("startTime", starttime);
modelAndView.addObject("endTime", endtime);
}
modelAndView.addObject("area",area);
modelAndView.addObject("interval",interval);
return modelAndView;
}
/**
* 运行管理中的终端在线率数据查询展示
* @param startTime 起始时间
* @param endTime 截止时间
* @param area 查询的区域
*/
@PostMapping("getOnlineRateData")
@ResponseBody
public HttpResult getOnlineRateData(String startTime,String endTime,String area,HttpServletRequest request){
HttpResult result=PubUtils.initResult(TokenManager.getToken().getLoginName(),request,LogTypeEnum.BUSSINESS.toString(),0);
DatePojo datePojo;
datePojo=PubUtils.validateDate(startTime,endTime,"getOnlineRateData");
if(!StringUtils.isEmpty(datePojo.getMsg())){
result=PubUtils.assignmentResult(null,500,datePojo.getMsg());
return result;
}
List<OnlineRateData> onlineRateDatas;
try{
onlineRateDatas=deviceService.getOnlineRate(datePojo.getStartTime(),datePojo.getEndTime(),area);
if(null==onlineRateDatas){
result = PubUtils.assignmentResultLog(null, 500, "获取终端在线率数据为空","查询在线率列表","成功",result);
}else{
result = PubUtils.assignmentResultLog(onlineRateDatas, 200, "获取终端在线率数据成功","查询在线率列表","成功",result);
}
userLog.getLog("查询终端在线率", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
}catch(Exception e){
logger.error("获取终端运行数据异常,异常为:"+e.toString());
userLog.getLog("查询终端在线率", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取终端在线率数据异常","查询在线率列表","失败",result);
}
return result;
}
/**
* 区域统计--》在线率
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("onlineRate")
@ResponseBody
public HttpResult getOnlineRate(String startTime,String endTime,String overview,String area,HttpServletRequest request){
HttpResult result=PubUtils.initResult(TokenManager.getToken().getLoginName(),request,LogTypeEnum.BUSSINESS.toString(),0);
DatePojo datePojo;
datePojo=PubUtils.validateDate(startTime,endTime,"getOnlineRate");
if(!StringUtils.isEmpty(datePojo.getMsg())){
result=PubUtils.assignmentResult(null,500,datePojo.getMsg());
return result;
}
DeviceGeneral data ;
try {
data=deviceService.getDeviceOnlineRate(datePojo.getStartTime(),datePojo.getEndTime(),overview,area);
if(null==data){
result = PubUtils.assignmentResultLog(null, 500, "获取终端在线率数据为空","查询终端在线率","成功",result);
}else{
result = PubUtils.assignmentResultLog(data, 200, "获取终端在线率数据成功","查询终端在线率","成功",result);
}
userLog.getLog("查询终端运行数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:"+e.toString());
userLog.getLog("查询终端运行数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取终端在线率数据异常","查询终端在线率","失败",result);
}
return result;
}
}

View File

@@ -0,0 +1,76 @@
package com.pqs9000.controller.area;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.PubUtils;
import com.pqs9000.pojo.common.PowerQualityData;
import com.pqs9000.service.data.AssesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* @author hongawen
* @date 2018/6/21 22:41
*/
@Controller
@RequestMapping("area")
public class PowerQualityController {
@Autowired
private AssesService assesService;
@Autowired
UserLogDetailService userLog;
/**
* 跳转区域统计的电能质量
*/
@GetMapping("quality")
public String quality(){
return "business/area/powerQuality";
}
/**
* 区域统计--》电能质量指标
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("powerQualityVol")
@ResponseBody
public HttpResult getPowerQualityVol(String startTime, String endTime, String area, HttpServletRequest request){
HttpResult result=PubUtils.initResult(TokenManager.getToken().getLoginName(),request,LogTypeEnum.BUSSINESS.toString(),0);
DatePojo datePojo;
datePojo=PubUtils.validateDate(startTime,endTime,"getPowerQualityVol");
if(!StringUtils.isEmpty(datePojo.getMsg())){
result=PubUtils.assignmentResult(null,500,datePojo.getMsg());
return result;
}
PowerQualityData data;
try{
data=assesService.getPowerQualityVolArea(datePojo.getStartTime(),datePojo.getEndTime(),area);
if(null==data){
result=PubUtils.assignmentResultLog(null,500,"区域统计获取电压偏差数据为空","查询电能质量评估","成功",result);
}else{
result=PubUtils.assignmentResultLog(data,200,"区域统计获取电压偏差数据成功","查询电能质量评估","成功",result);
}
userLog.getLog("查询电能质量指标", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
}catch (Exception e){
userLog.getLog("查询电能质量指标", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result=PubUtils.assignmentResultLog(null,200,"区域统计获取电压偏差数据失败","查询电能质量评估","失败",result);
}
return result;
}
}

View File

@@ -0,0 +1,453 @@
package com.pqs9000.controller.area;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.AreaGeneralData;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.SteadyTypeData;
import com.njcn.pojo.commons.runmanage.SteadyResult;
import com.njcn.pojo.commons.runmanage.SteadyTable;
import com.njcn.pojo.data.Legder;
import com.njcn.pojo.data.LegderExcel;
import com.njcn.service.configuration.LineService;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.PubUtils;
import com.njcn.pojo.advanced.HarmonicRateInfo;
import com.njcn.utils.UserUtil;
import com.pqs9000.util.ExcelUtil;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* @author hongawen
* @Date: 2018/6/22 09:15
*/
@Controller
@RequestMapping("area")
public class SteadyStateController {
private static final Logger logger = LoggerFactory.getLogger(SteadyStateController.class);
@Autowired
private LineService lineService;
@Autowired
UserLogDetailService userLog;
List<Legder> listLegder;
/**
* 跳转区域统计的稳态指标
*/
@GetMapping("steady")
public String steady() {
return "business/area/steady";
}
@GetMapping("harmonicrate")
public String harmonicrate() {
return "business/manage/harmonicrate";
}
/**
* 跳转运行管理--》稳态指标列表
*/
@GetMapping("steadytable")
public ModelAndView steadyTable(String starttime,String endtime,String area,String interval) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("business/manage/steadyTable");
if(StringUtils.isEmpty(starttime)&&StringUtils.isEmpty(endtime)){
modelAndView.addObject("startTime", "");
modelAndView.addObject("endTime", "");
}else{
DatePojo datePojo=PubUtils.validateDate(starttime,endtime,"steadytable");
if(!StringUtils.isEmpty(datePojo.getMsg())){
modelAndView.addObject("startTime", "");
modelAndView.addObject("endTime", "");
}else{
modelAndView.addObject("startTime", starttime);
modelAndView.addObject("endTime", endtime);
}
}
modelAndView.addObject("area", area);
modelAndView.addObject("interval", interval);
return modelAndView;
}
@GetMapping("ledger")
public String ledger() {
return "business/area/ledger";
}
@GetMapping("steadystat")
public String steadystat() {
return "business/area/steadystat";
}
/**
* -
* 运行管理--》稳态指标列表
*
* @param area 区域
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("getSteadyData")
@ResponseBody
public HttpResult getSteadyData(String area, String startTime, String endTime, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "getSteadyData");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
SteadyResult steadyResult;
try {
steadyResult = lineService.getSteadyData(datePojo.getStartTime(), datePojo.getEndTime(), area);
if (null == steadyResult) {
result = PubUtils.assignmentResultLog(null, 500, "获取监测点稳态指标合格率数据为空", "查询稳态指标列表", "成功", result);
} else {
result = PubUtils.assignmentResultLog(steadyResult, 200, "获取监测点稳态指标合格率数据成功", "查询稳态指标列表", "成功", result);
}
userLog.getLog("查询稳态指标", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取监测点稳态指标合格率数据异常,异常为:" + e.toString());
userLog.getLog("查询稳态指标", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取监测点稳态指标合格率数据异常", "查询稳态指标列表", "失败", result);
}
return result;
}
/**
* 区域统计--》指标合格率全部
*
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("allData")
@ResponseBody
public HttpResult allData(String area, String startTime, String endTime, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "allData");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
SteadyTypeData steadyTypeData;
try {
steadyTypeData = lineService.getAllData(datePojo.getStartTime(), datePojo.getEndTime(), area);
if (null == steadyTypeData) {
result = PubUtils.assignmentResultLog(null, 500, "获取全部数据为空", "查询稳态指标合格率", "成功", result);
} else {
result = PubUtils.assignmentResultLog(steadyTypeData, 200, "获取全部数据成功", "查询稳态指标合格率", "成功", result);
}
userLog.getLog("查询合格率全部数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:" + e.toString());
userLog.getLog("查询合格率全部数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取全部数据异常", "查询稳态指标合格率", "失败", result);
}
return result;
}
/**
* 跳转稳态越限详情页面
*
* @param areaIndex 部门索引
* @param startTime 起始时间
* @param endTime 截止时间
*/
@GetMapping("outOfLimitDetailView")
public ModelAndView outOfLimitDetailView(String areaIndex, String startTime, String endTime) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("business/area/steadyOutOfLimitDetail");
modelAndView.addObject("startTime", startTime);
modelAndView.addObject("endTime", endTime);
modelAndView.addObject("area", areaIndex);
return modelAndView;
}
@GetMapping("statoutOfLimitDetailView")
public ModelAndView statoutOfLimitDetailView(String areaIndex, String startTime, String endTime) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("business/area/steadystatOutOfLimitDetail");
modelAndView.addObject("startTime", startTime);
modelAndView.addObject("endTime", endTime);
modelAndView.addObject("area", areaIndex);
return modelAndView;
}
/**
* 获取稳态越限详情数据
*
* @param area 部门索引
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("outOfLimitDetail")
@ResponseBody
public HttpResult outOfLimitDetail(String area, String startTime, String endTime, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "allData");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<SteadyTable> steadyTables;
try {
steadyTables = lineService.getSteadyOutOfLimitData(datePojo.getStartTime(), datePojo.getEndTime(), area);
if (null == steadyTables) {
result = PubUtils.assignmentResultLog(null, 500, "获取稳态越限详情数据为空", "查询稳态越限详情", "成功", result);
} else {
result = PubUtils.assignmentResultLog(steadyTables, 200, "获取稳态越限详情数据成功", "查询稳态越限详情", "成功", result);
}
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:" + e.toString());
result = PubUtils.assignmentResultLog(null, 500, "获取稳态越限详情数据异常", "查询稳态越限详情", "失败", result);
}
return result;
}
@PostMapping("getHarmonicRate")
@ResponseBody
public HttpResult getHarmonicRate(String startTime, String endTime, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "getHarmonicRate");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<HarmonicRateInfo> list;
try {
list = lineService.getHarmonicRate(datePojo.getStartTime(), datePojo.getEndTime());
Collections.sort(list);
if (null == list) {
result = PubUtils.assignmentResultLog(null, 500, "获取谐波总畸变率数据为空", "查询谐波总畸变率", "成功", result);
} else {
result = PubUtils.assignmentResultLog(list, 200, "获取谐波总畸变率数据成功", "查询谐波总畸变率", "成功", result);
}
} catch (Exception e) {
logger.error("获取谐波总畸变率数据异常,异常为:" + e.toString());
result = PubUtils.assignmentResultLog(null, 500, "获取谐波总畸变率数据异常", "查询谐波总畸变率", "失败", result);
}
return result;
}
@PostMapping("getledger")
@ResponseBody
public HttpResult getLedger(String area, String voltage, String factory, String type, String appear, String nature, HttpServletRequest request) {
HttpResult httpResult = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
try {
this.listLegder = lineService.getLedger(area, voltage, factory, type, appear, nature);
if (null == this.listLegder) {
httpResult = PubUtils.assignmentResultLog(null, 500, "获取台账统计数据为空", "查询台账统计", "成功", httpResult);
} else {
httpResult = PubUtils.assignmentResultLog(this.listLegder, 200, "获取谐台账统计数据成功", "查询台账统计", "成功", httpResult);
}
} catch (Exception e) {
logger.error("获取台账统计数据异常,异常为:" + e.toString());
httpResult = PubUtils.assignmentResultLog(null, 500, "获取台账统计数据异常", "查询台账统计", "失败", httpResult);
}
return httpResult;
}
@GetMapping(value = "exportExcel")
public void exportExcel(HttpServletResponse response,HttpServletRequest request) {
List<LegderExcel> list1 = new ArrayList<>();
int count = 0;
int count1 = 0;
for (Legder legder : this.listLegder) {
for (Legder.pData pData : legder.getList()) {
for (Legder.Data data : pData.getList()) {
LegderExcel legderExcel = new LegderExcel();
legderExcel.setAreaName(legder.getAreaName());
legderExcel.setTypeName(pData.getName());
legderExcel.setChildType(data.getDicName());
legderExcel.setBdCount(data.getGdCount());
legderExcel.setDeviceCount(data.getSubCount());
legderExcel.setLineCount(data.getLineCount());
count++;
count1++;
list1.add(legderExcel);
}
list1.get(list1.size() - 1).setRowCount(count);
count = 0;
}
list1.get(list1.size() - 1).setRowCount1(count1);
count1 = 0;
}
userLog.getLog("导出台账信息表", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
writeExcel(response, list1);
}
private void writeExcel(HttpServletResponse response, List<LegderExcel> list) {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet("台账统计");
int rowId = 0;
int cellId = 0;
//表头部分
XSSFRow row = sheet.createRow(rowId++);
XSSFCell cell = null;
XSSFCellStyle style = setStyleHeader(workbook, sheet);
setHeader(row, cell, "区域", cellId++, style);
setHeader(row, cell, "类型", cellId++, style);
setHeader(row, cell, "分类型", cellId++, style);
setHeader(row, cell, "变电站个数", cellId++, style);
setHeader(row, cell, "终端个数", cellId++, style);
setHeader(row, cell, "监测点个数", cellId++, style);
cellId = 0;
//表格内容
XSSFCellStyle style1 = setStyleBody(workbook, sheet);
setBody(row, cell, rowId, cellId, list, sheet, style1);
OutputStream outputStream = null;
try {
response.setContentType("application/force-download");
response.addHeader("Content-Disposition", "attachment;fileName = " + new String("台账统计".getBytes("GB2312"), "iso8859-1") + ".xlsx");// 设置文件名
outputStream = response.getOutputStream();
workbook.write(outputStream);
workbook.close();
} catch (IOException e) {
logger.error(e.getMessage());
} finally {
try {
if(null!=outputStream){
outputStream.close();
}
} catch (IOException e) {
logger.error(e.getMessage());
}
}
}
private void setBody(XSSFRow row, XSSFCell cell, int rowId, int cellId, List<LegderExcel> list, XSSFSheet sheet, XSSFCellStyle style) {
for (LegderExcel legderExcel : list) {
row = sheet.createRow(rowId++);
//第一列只考虑count1
cell = row.createCell(cellId++);
if (legderExcel.getRowCount1() == 0) {
cell.setCellValue(legderExcel.getAreaName());
} else {
cell.setCellValue(legderExcel.getAreaName());
//合并单元格
sheet.addMergedRegion(new CellRangeAddress(rowId - legderExcel.getRowCount1(), rowId - 1, 0, 0));
}
cell.setCellStyle(style);
//第二列只考虑count
cell = row.createCell(cellId++);
if (legderExcel.getRowCount() == 0) {
cell.setCellValue(legderExcel.getTypeName());
} else {
cell.setCellValue(legderExcel.getTypeName());
//合并单元格
sheet.addMergedRegion(new CellRangeAddress(rowId - legderExcel.getRowCount(), rowId - 1, 1, 1));
}
cell.setCellStyle(style);
//第三列
cell = row.createCell(cellId++);
cell.setCellValue(legderExcel.getChildType());
cell.setCellStyle(style);
//第四列
cell = row.createCell(cellId++);
cell.setCellValue(legderExcel.getBdCount());
cell.setCellStyle(style);
//第五列
cell = row.createCell(cellId++);
cell.setCellValue(legderExcel.getDeviceCount());
cell.setCellStyle(style);
//第六列
cell = row.createCell(cellId++);
cell.setCellValue(legderExcel.getLineCount());
cell.setCellStyle(style);
cellId = 0;
}
}
private void setHeader(XSSFRow row, XSSFCell cell, String value, int cellId, XSSFCellStyle style) {
cell = row.createCell(cellId++);
cell.setCellValue(value);
cell.setCellStyle(style);
}
private XSSFCellStyle setStyleHeader(XSSFWorkbook workbook, XSSFSheet sheet) {
XSSFFont font = workbook.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 10);
XSSFCellStyle style4;
style4 = workbook.createCellStyle();
font.setBold(true);
style4.setVerticalAlignment(VerticalAlignment.CENTER);
style4.setAlignment(HorizontalAlignment.CENTER_SELECTION);
style4.setFont(font);
//设置列宽
sheet.setColumnWidth(0, 20 * 256);
sheet.setColumnWidth(1, 12 * 256);
sheet.setColumnWidth(2, 20 * 256);
return style4;
}
private XSSFCellStyle setStyleBody(XSSFWorkbook workbook, XSSFSheet sheet) {
XSSFFont font = workbook.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 10);
XSSFCellStyle style6;
style6 = workbook.createCellStyle();
style6.setVerticalAlignment(VerticalAlignment.CENTER);
style6.setAlignment(HorizontalAlignment.CENTER_SELECTION);
style6.setFont(font);
return style6;
}
}

View File

@@ -0,0 +1,98 @@
package com.pqs9000.controller.area;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.data.EventDetail;
import com.njcn.pojo.data.VdListQueryVO;
import com.njcn.service.configuration.DeviceService;
import com.njcn.service.data.EventDetailService;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.PubUtils;
import com.njcn.utils.XssFilterUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
/**
* @author hongawen
* @Date: 2018/7/2 10:18
*/
@Controller
@RequestMapping("area")
public class VdListController {
private static final Logger logger= LoggerFactory.getLogger(VdListController.class);
@Autowired
private EventDetailService eventDetailService;
@Autowired
UserLogDetailService userLog;
/**
* 跳转区域统计的暂降事件列表
*/
@GetMapping("vdlist")
public String status(){
return "business/area/vdList";
}
/**
* 电压暂降列表,获取列表数据
*
*/
@PostMapping( "getVoltageDetail")
@ResponseBody
public HttpResult getVoltageDetail(@RequestBody VdListQueryVO vdListQueryVO, HttpServletRequest request) {
HttpResult result=PubUtils.initResult(TokenManager.getToken().getLoginName(),request,LogTypeEnum.BUSSINESS.toString(),0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(vdListQueryVO.getStartTime(), vdListQueryVO.getEndTime(), "getVoltageDetail");
if(!StringUtils.isEmpty(datePojo.getMsg())){
result=PubUtils.assignmentResult(null,500,datePojo.getMsg());
return result;
}
String area = vdListQueryVO.getArea();
String type = vdListQueryVO.getType();
BigDecimal minfuzhi = vdListQueryVO.getMinfuzhi();
BigDecimal maxfuzhi = vdListQueryVO.getMaxfuzhi();
BigDecimal mintime = vdListQueryVO.getMintime();
BigDecimal maxtime = vdListQueryVO.getMaxtime();
BigDecimal minseverity = vdListQueryVO.getMinseverity();
BigDecimal maxseverity = vdListQueryVO.getMaxseverity();
List eventType =vdListQueryVO.getEventType();
List eventReason =vdListQueryVO.getEventReason();
List triggerType =vdListQueryVO.getTriggerType();
Integer fileflag = vdListQueryVO.getFileflag();
// 统计时间段内的暂降原因次数、暂降类型次数
List<EventDetail> voltageList;
try {
voltageList = eventDetailService.getVolList(datePojo.getStartTime(), datePojo.getEndTime(), area,type,minfuzhi,maxfuzhi,mintime,maxtime,minseverity,maxseverity,eventType,eventReason,triggerType,fileflag);
if (null == voltageList) {
result = PubUtils.assignmentResultLog(null, 500, "暂降列表的数据为空","查询暂降事件列表","成功",result);
} else {
result = PubUtils.assignmentResultLog(voltageList, 200, "获取暂降数据成功","查询暂降事件列表","成功",result);
}
userLog.getLog("查询暂降事件列表", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
e.printStackTrace();
logger.error("后台获取数据出错方法名为getVoltageDetail异常为" + e);
userLog.getLog("查询暂降事件列表", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取暂降数据失败","查询暂降事件列表","失败",result);
}
return result;
}
}

View File

@@ -0,0 +1,24 @@
package com.pqs9000.controller.business;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* @author hongawen
* @date 2018/4/3 22:28
*/
@Controller
@RequestMapping("auth")
public class AuthController {
@RequestMapping("unauthorized")
public String unauthorized(){
return "auth/unauthorized";
}
@RequestMapping("loginError")
public String loginError(){
return "auth/loginError";
}
}

View File

@@ -0,0 +1,453 @@
package com.pqs9000.controller.business;
import com.njcn.enums.ProjectEnum;
import com.njcn.pojo.commons.WebItem;
import com.njcn.pojo.system.SubSystem;
import com.njcn.service.system.SystemService;
import com.njcn.utils.XssFilterUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;
/**
* @author hongawen
* @date 2018/3/26 22:41
*/
@Controller
@RequestMapping("business")
public class BusinessController {
@Resource
private SystemService systemService;
// @GetMapping("/doBusiness")
// public ModelAndView main() {
// ModelAndView modelAndView = new ModelAndView();
// modelAndView.setViewName("main");
// //判断是否需要显示切换系统以及待切换的系统信息
// List<SubSystem> subSystems = systemService.getActiveSystem();
// boolean displayFlag = false;
// for (SubSystem subSystem : subSystems) {
// if (!subSystem.getSystemEName().equalsIgnoreCase(ProjectEnum.PQS9000.getItem())) {
// displayFlag = true;
// modelAndView.addObject("item", subSystem.getSystemEName());
// modelAndView.addObject("name", subSystem.getSystemEName().toUpperCase() + subSystem.getSystemName());
// }
// }
// modelAndView.addObject("displayFlag", displayFlag);
// return modelAndView;
// }
@GetMapping("/doBusiness")
public ModelAndView main() {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("main");
//判断是否需要显示切换系统以及待切换的系统信息
List<SubSystem> subSystems = systemService.getActiveSystem();
List<WebItem> webItems = new ArrayList<>();
boolean displayFlag = false;
for (SubSystem subSystem : subSystems) {
if (!subSystem.getSystemEName().equalsIgnoreCase(ProjectEnum.PQS9000.getItem())) {
displayFlag = true;
WebItem webItem = new WebItem();
webItem.setItem(subSystem.getSystemEName());
webItem.setName(subSystem.getSystemEName().toUpperCase() + subSystem.getSystemName());
webItems.add(webItem);
}
}
// WebItem webItem=new WebItem();
// webItem.setItem("pqs9300");
// webItem.setName("PQS9800大屏展示系统");
// webItems.add(webItem);
modelAndView.addObject("webItems", webItems);
modelAndView.addObject("displayFlag", displayFlag);
return modelAndView;
}
//*****************概览********************* start
@GetMapping("/overview")
public String overview() {
return "overview/overview";
}
@GetMapping("/excel")
public String excel() {
return "report/excel";
}
@GetMapping("/pointInfo")
public String pointInfo() {
return "business/assessmentsis/pointInfo";
}
@GetMapping("/percent")
public String percent() {
return "report/percent";
}
@GetMapping("/fpyreport")
public String fpyreport() {
return "report/fpyReport";
}
@GetMapping("/expmodel")
public String expmodel() {
return "report/expModel";
}
@GetMapping("/platereports")
public String platereports() {
return "business/assessmentsis/platereports";
}
@GetMapping("/platereport")
public String platereport() {
return "business/assessmentsis/platereport";
}
@GetMapping("/plateShare")
public String plateShare() {
return "business/assessmentsis/plateShare";
}
@GetMapping("/excelsetting")
public String excelSetting() {
return "report/excelSetting";
}
@GetMapping("/devicestatus")
public String deviceStatus() {
return "overview/deviceStatus";
}
@GetMapping("/onlinerate")
public String onlineRate() {
return "overview/onlineRate";
}
@GetMapping("/powerquality")
public String powerquality() {
return "overview/powerQuality";
}
@GetMapping("/dataintegrality")
public String dataIntegrality() {
return "overview/dataIntegrality";
}
@GetMapping("singleonlinerate")
public String singleOnlineRate() {
return "overview/singleOnlineRate";
}
@GetMapping("singleintegrality")
public String singleIntegrality() {
return "overview/singleIntegrality";
}
@GetMapping("frequency")
public String frequency() {
return "overview/frequency";
}
//****************概览**********************end
@GetMapping("/monitor")
public String monitor() {
return "business/monitor/monitor";
}
@GetMapping("/sssj")
public String sssj() {
return "business/monitor/actualData";
}
@GetMapping("/yxzt")
public String yxzt() {
return "business/monitor/yxzt";
}
@GetMapping("/wtzb")
public String wtzb() {
return "business/monitor/wtzb";
}
@GetMapping("/wtqs")
public String wtqs() {
return "business/monitor/wtqs";
}
@GetMapping("/offlinemonitor")
public String offlinemonitor() {
return "business/monitor/offlinemonitor";
}
@GetMapping("/offwtqs")
public String offwtqs() {
return "business/monitor/offwtqs";
}
@GetMapping("offxbpp")
public String offxbpp() {
return "business/monitor/offxbpp";
}
@GetMapping("/offword")
public String offword() {
return "business/monitor/offword";
}
@GetMapping("/ploymanage")
public String ploymanage() {
return "business/monitor/ploymanage";
}
@GetMapping("/upoffploy")
public String upoffploy() {
return "business/monitor/upoffploy";
}
@RequestMapping(value = "upoffreport")
public String upoffreport(HttpSession session, String reportIndex, String reportName) {
reportIndex = XssFilterUtil.dealString(reportIndex);
reportName = XssFilterUtil.dealString(reportName);
session.setAttribute("reportIndex", reportIndex);
session.setAttribute("reportName", reportName);
return "business/monitor/upoffreport";
}
@GetMapping("/ham")
public String ham() {
return "business/assessmentsis/harmonic";
}
@GetMapping("/his")
public String his() {
return "business/assessmentsis/history";
}
@GetMapping("/plate")
public String plate() {
return "business/assessmentsis/platenormal";
}
@GetMapping("/normLimits")
public String normLimits() {
return "business/assessmentsis/normLimits";
}
@GetMapping("/normlimitdraw")
public String normlimitdraw() {
return "business/assessmentsis/normLimitDraw";
}
@GetMapping("/abnormlimit")
public String abnormlimit() {
return "business/assessmentsis/abnormLimit";
}
@GetMapping("/abnormLimits")
public String abnormLimits() {
return "business/assessmentsis/abnormLimits";
}
@GetMapping("/abnormlimitdraw")
public String abnormlimitdraw() {
return "business/assessmentsis/abnormLimitDraw";
}
//质量评估
@GetMapping("/zlpg")
public String zlpg() {
return "business/monitor/zlpg";
}
//谐波频谱
@GetMapping("/xbpp")
public String xbpp() {
return "business/monitor/xbpp";
}
//实时趋势
@GetMapping("/trend")
public String trend() {
return "business/monitor/trend";
}
//谐波数据
@GetMapping("/xbsj")
public String xbsj() {
return "business/monitor/xbsj";
}
// 跳转终端统计页面
@RequestMapping(value = "statistics")
public String statistics() {
return "business/manage/machineStatistics";
}
//间谐波数据
@GetMapping("/jxbsj")
public String jxbsj() {
return "business/monitor/jxbsj";
}
//谐波电流幅值数据
@GetMapping("/xbdl")
public String xbdl() {
return "business/monitor/xbdl";
}
/*************历史数据*************/
@GetMapping("/norm")
public String norm() {
return "business/assessmentsis/historys";
}
/***********谐波频谱************/
@GetMapping("/harmonic")
public String harmonic() {
return "business/assessmentsis/harmonics";
}
/********稳态越限统计********/
@GetMapping("/normlimit")
public String normlimit() {
return "business/assessmentsis/normLimit";
}
@GetMapping("/platenormal")
public String platenoraml() {
return "business/assessmentsis/platenormals";
}
// 资源管理下载
@RequestMapping(value = "sourcemanage")
public String sourceManage() {
return "business/manage/sourceManage";
}
/******获取波形文件********/
@RequestMapping(value = "vdwaveform")
public String vdWaveform(HttpSession session, String eventIndex) {
eventIndex = XssFilterUtil.dealString(eventIndex);
session.setAttribute("eventIndex", eventIndex);
return "business/area/waveform";
}
// 跳转终端运行管理页面
@GetMapping(value = "runtime")
public ModelAndView runtime(String area) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("business/manage/runtime");
modelAndView.addObject("area", area);
return modelAndView;
}
// // 跳转到终端状态更新列表
// @GetMapping(value = "terminallog")
// public String terminallog() {
// return "business/manage/terminalLogManage";
// }
// 跳转通讯测试页面
@RequestMapping(value = "communicate")
public String communicate() {
return "business/manage/communicate";
}
//帮助中心
@RequestMapping(value = "userhelp")
public String userHelp(HttpSession session, String parameter) {
parameter = XssFilterUtil.dealString(parameter);
session.setAttribute("parameter", parameter);
return "business/manage/userHelp";
}
/**
* 跳转404页面
*/
@RequestMapping(value = "404")
public String notFound() {
return "business/error/404";
}
@RequestMapping("/userDetail")
public String userDetail(HttpSession session, String userIndex) {
userIndex = XssFilterUtil.dealString(userIndex);
session.setAttribute("userIndex", userIndex);
return "userDetail";
}
/**
* 跳转到修改密码
*/
@RequestMapping("updatePassWord")
public String updatePassWord(HttpSession session, String userIndex) {
userIndex = XssFilterUtil.dealString(userIndex);
session.setAttribute("userIndex", userIndex);
return "updatePassWord";
}
/**
* 暂降列表页面多条件筛选按钮弹出页面
*
* @author cdf
* @date 2021/1/20
*/
@RequestMapping("vdlistquery")
public String vdlistquery() {
return "business/area/vdListQuery";
}
/**
* 跳转到监测点台账信息
*/
@RequestMapping("lineledger")
public String lineLedger() {
return "business/manage/lineLedger";
}
/**
* 跳转到监测点gis地理信息图
*/
@RequestMapping("tomonitorscope")
public String monitorScope() {
return "business/area/monitorScope";
}
/**
* 跳转到时间选择控件
*/
@RequestMapping("timerange")
public String timeRange() {
return "business/manage/timeRange";
}
/**
* 跳转到数据完整性详情界面
*/
@RequestMapping("integralityDetail")
public ModelAndView integralityDetail(String startTime, String endTime, String timeType, String lineId) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("business/manage/integralityDetail");
modelAndView.addObject("startTime", startTime);
modelAndView.addObject("endTime", endTime);
modelAndView.addObject("timeType", timeType);
modelAndView.addObject("lineId", lineId);
return modelAndView;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,356 @@
package com.pqs9000.controller.business;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.SimpleValue;
import com.njcn.pojo.commons.SteadyTypeData;
import com.njcn.pojo.commons.acceptability.AcceptabilityAllData;
import com.njcn.pojo.commons.acceptability.AcceptabilityData;
import com.njcn.pojo.commons.device.DeviceGeneral;
import com.njcn.service.configuration.DeviceService;
import com.njcn.service.configuration.LineService;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.PubUtils;
import com.pqs9000.pojo.common.OverviewData;
import com.pqs9000.pojo.common.PowerQualityData;
import com.pqs9000.service.data.AssesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import tk.mybatis.mapper.entity.Example;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author hongawen
* @date 2018/4/3 11:07
*/
@Controller
@RequestMapping("overview")
public class OverviewController {
private static final Logger logger = LoggerFactory.getLogger(OverviewController.class);
@Autowired
private DeviceService deviceService;
@Autowired
private LineService lineService;
@Autowired
private AssesService assesService;
@Autowired
UserLogDetailService userLog;
/**
* 概览--》缩略图电能质量--》电压偏差
*
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("powerQualityVol")
@ResponseBody
public HttpResult getPowerQualityVol(String startTime, String endTime, String overview, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "getPowerQualityVol");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
PowerQualityData data;
try {
data = assesService.getPowerQualityVol(datePojo.getStartTime(), datePojo.getEndTime(), overview);
result = PubUtils.assignmentResultLog(data, 200, "概览获取电压偏差数据成功", "查询概览电能质量评估", "成功", result);
userLog.getLog("查询电压偏差", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
userLog.getLog("查询电压偏差", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 200, "概览获取电压偏差数据失败", "查询概览电能质量评估", "失败", result);
}
return result;
}
/**
* 概览--》终端状态 查询稳态概览终端状态
*/
@PostMapping("deviceStatus")
@ResponseBody
public HttpResult getDeviceStatus(String overview, HttpServletRequest request, String startTime, String endTime) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DeviceGeneral data;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "deviceStatus");
if (!datePojo.getValidity()) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
try {
data = deviceService.getDeviceData(overview, datePojo.getStartTime(), datePojo.getEndTime());
if (null == data) {
result = PubUtils.assignmentResultLog(null, 500, "获取终端运行数据为空", "查询稳态概览终端状态", "成功", result);
} else {
result = PubUtils.assignmentResultLog(data, 200, "获取终端运行数据成功", "查询稳态概览终端状态", "成功", result);
}
userLog.getLog("查询终端状态", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:" + e.toString());
userLog.getLog("查询终端状态", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取终端运行数据异常", "查询稳态概览终端状态", "失败", result);
}
return result;
}
/**
* 概览--》在线率
*
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("onlineRate")
@ResponseBody
public HttpResult getOnlineRate(String startTime, String endTime, String overview, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "getOnlineRate");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
DeviceGeneral data;
try {
data = deviceService.getDeviceOnlineRate(datePojo.getStartTime(), datePojo.getEndTime(), overview);
result = PubUtils.assignmentResultLog(data, 200, "获取终端在线率数据成功", "查询概览终端在线率", "成功", result);
userLog.getLog("查询在线率", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:" + e.toString());
userLog.getLog("查询在线率", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取终端在线率数据失败", "查询概览终端在线率", "失败", result);
}
return result;
}
/**
* 概览--》数据完整性
*
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("dataIntegrality")
@ResponseBody
public HttpResult dataIntegrality(String startTime, String endTime, String overview, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "dataIntegrality");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
DeviceGeneral data;
try {
data = deviceService.getDataIntegrality(datePojo.getStartTime(), datePojo.getEndTime(), overview);
result = PubUtils.assignmentResultLog(data, 200, "获取数据完整性数据成功", "查询概览数据完整性", "成功", result);
userLog.getLog("查询数据完整性", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:" + e.toString());
userLog.getLog("查询数据完整性", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "获取数据完整性数据异常", "查询概览数据完整性", "失败", result);
}
return result;
}
/**
* 概览---》终端在线率---》区域点击查询
*
* @param startTime 起始时间
* @param endTime 截止时间
* @param gist 查询关键词
*/
@PostMapping("cityOnlineRate")
@ResponseBody
public HttpResult cityOnlineRate(String startTime, String endTime, String gist, HttpServletRequest request) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "cityOnlineRate");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<SimpleValue> values;
try {
values = deviceService.getCityOnlineRate(datePojo.getStartTime(), datePojo.getEndTime(), gist);
result = PubUtils.assignmentResult(values, 200, "获取终端在线率数据成功");
} catch (Exception e) {
logger.error("获取终端运行数据失败,方法名cityOnlineRate");
result = PubUtils.assignmentResult(null, 500, "获取终端在线率数据失败");
}
return result;
}
/**
* 概览---》终端在线率---》终端厂家点击查询
*
* @param startTime 起始时间
* @param endTime 截止时间
* @param gist 查询关键词
*/
@PostMapping("companyOnlineRate")
@ResponseBody
public HttpResult companyOnlineRate(String startTime, String endTime, String gist, HttpServletRequest request) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "companyOnlineRate");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<SimpleValue> values;
try {
values = deviceService.getCompanyOnlineRate(datePojo.getStartTime(), datePojo.getEndTime(), gist);
result = PubUtils.assignmentResult(values, 200, "获取终端在线率数据成功");
} catch (Exception e) {
logger.error("获取终端运行数据失败,方法名companyOnlineRate");
result = PubUtils.assignmentResult(null, 500, "获取终端在线率数据失败");
}
return result;
}
/**
* 概览---》数据完整性---》区域点击查询
*
* @param startTime 起始时间
* @param endTime 截止时间
* @param gist 查询关键词
*/
@PostMapping("cityIntegrality")
@ResponseBody
public HttpResult cityIntegrality(String startTime, String endTime, String gist, HttpServletRequest request) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "cityIntegrality");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<SimpleValue> values;
try {
values = deviceService.getCityIntegrality(datePojo.getStartTime(), datePojo.getEndTime(), gist);
result = PubUtils.assignmentResult(values, 200, "获取数据完整性数据成功");
} catch (Exception e) {
logger.error("获取终端运行数据失败,方法名cityIntegrality");
result = PubUtils.assignmentResult(null, 500, "获取数据完整性数据失败");
}
return result;
}
/**
* 概览---》数据完整性---》电压等级点击查询
*
* @param startTime 起始时间
* @param endTime 截止时间
* @param gist 查询关键词
*/
@PostMapping("voltageIntegrality")
@ResponseBody
public HttpResult voltageIntegrality(String startTime, String endTime, String gist, HttpServletRequest request) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "voltageIntegrality");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<SimpleValue> values;
try {
values = deviceService.getVoltageIntegrality(datePojo.getStartTime(), datePojo.getEndTime(), gist);
result = PubUtils.assignmentResult(values, 200, "获取数据完整性数据成功");
} catch (Exception e) {
logger.error("获取终端运行数据失败,方法名voltageIntegrality");
result = PubUtils.assignmentResult(null, 500, "获取数据完整性数据失败");
}
return result;
}
/**
* 概览---》数据完整性---》终端厂家点击查询
*
* @param startTime 起始时间
* @param endTime 截止时间
* @param gist 查询关键词
*/
@PostMapping("companyIntegrality")
@ResponseBody
public HttpResult companyIntegrality(String startTime, String endTime, String gist, HttpServletRequest request) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "companyIntegrality");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<SimpleValue> values;
try {
values = deviceService.getCompanyIntegrality(datePojo.getStartTime(), datePojo.getEndTime(), gist);
result = PubUtils.assignmentResult(values, 200, "获取数据完整性数据成功");
} catch (Exception e) {
logger.error("获取终端运行数据失败,方法名companyIntegrality");
result = PubUtils.assignmentResult(null, 500, "获取数据完整性数据失败");
}
return result;
}
/**
* 概览---》稳态合格率
*
* @param startTime 起始时间
* @param endTime 截止时间
*/
@PostMapping("frequencyDeviation")
@ResponseBody
public HttpResult frequencyDeviation(String startTime, String endTime, String overview, HttpServletRequest request) {
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "frequencyDeviation");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
SteadyTypeData steadyTypeData;
try {
steadyTypeData = lineService.getFrequencyDeviation(datePojo.getStartTime(), datePojo.getEndTime(), overview);
if (null == steadyTypeData) {
result = PubUtils.assignmentResultLog(null, 500, "获取全部数据为空", "查询稳态指标合格率", "成功", result);
} else {
result = PubUtils.assignmentResultLog(steadyTypeData, 200, "获取全部数据成功", "查询稳态指标合格率", "成功", result);
}
userLog.getLog("查询稳态合格率", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取终端运行数据异常,异常为:" + e.toString());
userLog.getLog("查询稳态合格率", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResultLog(null, 500, "查询稳态指标合格率失败", "查询稳态指标合格率", "失败", result);
}
return result;
}
@PostMapping("getRole")
@ResponseBody
public int getRole(String url) {
return lineService.getRole(url);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,112 @@
package com.pqs9000.controller.point;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.pointInfo.LineLedger;
import com.njcn.pojo.pointInfo.PointInfo;
import com.njcn.pojo.terminal.DeviceUnitPO;
import com.njcn.pojo.terminal.DeviceUnitVO;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.service.point.PointBaseInfoService;
import com.njcn.utils.PubUtils;
import com.njcn.pojo.pointInfo.LineLedgerVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* @Author: Sunwei 【sunW2016@163.com】
* @Description:
* @Date: Create in 13:22 2018/5/28
* @Modified By:
*/
@RestController
public class PointBaseInfoController {
@Autowired
private PointBaseInfoService pointBaseInfoService;
@Autowired
UserLogDetailService userLog;
@PostMapping(value = "/getPointInfo")
public HttpResult getPointInfo(Integer pointIndex, HttpServletRequest request) {
HttpResult httpResult = new HttpResult();
PointInfo pointInfo;
try {
pointInfo = pointBaseInfoService.getPointInfo(pointIndex);
userLog.getLog("查询监测点详情", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("监测点详情获取失败.");
userLog.getLog("查询监测点详情", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
return httpResult;
}
if (pointInfo != null) {
httpResult.setCode(200);
httpResult.setBody(pointInfo);
httpResult.setMessage("监测点详情获取成功.");
} else {
httpResult.setCode(500);
httpResult.setMessage("监测点详情获取失败.");
}
return httpResult;
}
/**
* 通过监测点获取监测点国标限值
* @author cdf
* @date 2021/5/26
*/
@GetMapping("getOverLimit")
public HttpResult getOverLimit(Integer pointIndex){
Map<String, Object> map = pointBaseInfoService.getOverLimit(pointIndex);
if(map!=null){
return PubUtils.assignmentResult(map,200,"获取限值成功");
}else {
return PubUtils.assignmentResult(null,500,"获取限值失败");
}
}
/**
* 监测点台账信息查询
* @author cdf
* @date 2021/9/14
*/
@PostMapping("getLineLedger")
public HttpResult getLineLedger(@RequestBody LineLedgerVO lineLedgerVO){
List<LineLedger> list = pointBaseInfoService.getLineLedger(lineLedgerVO);
return PubUtils.assignmentResult(list,200,"监测点台账信息查询成功");
}
/**
* 根据监测点获取监测点的单位信息
* @author cdf
* @date 2023/8/17
*/
@GetMapping("lineUnitDetail")
public HttpResult lineUnitDetail(@RequestParam("lineId")Integer lineId){
DeviceUnitVO deviceUnitVO = pointBaseInfoService.lineUnitDetail(lineId);
return PubUtils.assignmentResult(deviceUnitVO,200,"获取单位成功");
}
/**
* 根据监测点获取监测点的单位信息
* @author cdf
* @date 2023/8/17
*/
@GetMapping("devUnitDetail")
public HttpResult devUnitDetail(@RequestParam("devId")Integer devId){
DeviceUnitPO deviceUnitPO = pointBaseInfoService.devUnitDetail(devId);
return PubUtils.assignmentResult(deviceUnitPO,200,"获取单位成功");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,952 @@
package com.pqs9000.controller.report;
import com.njcn.enums.LogTypeEnum;
import com.njcn.mapper.configuration.OverLimitMapper;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.RedisDB;
import com.njcn.pojo.configuration.RptPloy;
import com.njcn.pojo.terminal.DeviceUnitVO;
import com.njcn.service.configuration.LineService;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.service.point.PointBaseInfoService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.AppConfig;
import com.njcn.utils.COverlimit;
import com.njcn.utils.InstantiateUtil;
import com.njcn.utils.PubUtils;
import com.njcn.utils.redis.JedisManager;
import com.pqs9000.pojo.report.*;
import com.pqs9000.pojo.report.enumReport.EnumPass;
import com.pqs9000.service.report.*;
import com.pqs9000.util.ExcelUtil;
import com.pqs9000.util.TransformTime;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
* @Author: Sunwei 【sunW2016@163.com】
* @Description:
* @Date: Create in 10:42 2018/6/7
* @Modified By:
*/
@RestController
public class ExcelReportController {
private static final Logger logger = LoggerFactory.getLogger(ExcelReportController.class);
@Autowired
private GetVirtualDataService getVirtualDataService;
@Autowired
private GetPowerDataService getPowerDataService;
@Autowired
private GetOverLimitDataService getOverLimitDataService;
@Autowired
private GetFlickerDataService getFlickerDataService;
@Autowired
private GetDistortionDataService getDistortionDataService;
@Autowired
private GetVdeviationDataService getVdeviationDataService;
@Autowired
private GetFrequencyDataService getFrequencyDataService;
@Autowired
private GetThreephaseDataService getThreephaseDataService;
@Autowired
private GetICurrentService getICurrentService;
@Autowired
private GetVoltageRateService getVoltageRateService;
@Autowired
private ExcelReportService excelReportService;
@Autowired
private GetFpyService getFpyService;
@Autowired
private AppConfig appConfig;
@Autowired
private UserLogDetailService userLog;
@Autowired
private COverlimit cOverlimit;
@Autowired
private LineService lineService;
@Autowired
OverLimitMapper overLimitMapper;
@Autowired
private JedisManager jedisManager;
@Autowired
private PointBaseInfoService pointBaseInfoService;
private InstantiateUtil<String> instantiateUtil;
private InstantiateUtil<List<ReportTarget>> listInstantiateUtil;
private InstantiateUtil<List<PloySetting>> listPloysetting;
private InstantiateUtil<List<FpyDataByType>> listFpydata;
private InstantiateUtil<OverLimitInfo> listOverlimit;
//选中的模板信息
private byte[] ployGuid;//##为默认模板(展示所有指标)
//模板设置
private byte[] ploy;
//限值
private byte[] overlimit;
//缓存查询条件
private byte[] condi;
//Excel实例对象
Map<String, ExcelUtil> excelUtilMap;
//非谐波数据
private byte[] virtual;
private byte[] power;
private byte[] flicker;
private byte[] distortion;
private byte[] vdeviation;
private byte[] frequency;
private byte[] threephase;
//谐波电压数据
private byte[] voltageRate;
//谐波电流数据
private byte[] iCurrent;
//合格率数据
private byte[] fpy;
public ExcelReportController() {
instantiateUtil = new InstantiateUtil<>();
listInstantiateUtil = new InstantiateUtil<>();
listPloysetting = new InstantiateUtil<>();
listFpydata = new InstantiateUtil<>();
listOverlimit = new InstantiateUtil<>();
ployGuid = instantiateUtil.instantiate("ployGuid");
ploy = instantiateUtil.instantiate("ploy");
overlimit = instantiateUtil.instantiate("overlimit");
condi = instantiateUtil.instantiate("condi");
virtual = instantiateUtil.instantiate("virtual");
power = instantiateUtil.instantiate("power");
flicker = instantiateUtil.instantiate("flicker");
distortion = instantiateUtil.instantiate("distortion");
vdeviation = instantiateUtil.instantiate("vdeviation");
frequency = instantiateUtil.instantiate("frequency");
threephase = instantiateUtil.instantiate("threephase");
voltageRate = instantiateUtil.instantiate("voltageRate");
iCurrent = instantiateUtil.instantiate("iCurrent");
fpy = instantiateUtil.instantiate("fpy");
excelUtilMap = new HashMap<>();
}
//获取模板配置信息
@PostMapping("getPloyData")
public HttpResult getPloyData() {
HttpResult httpResult = new HttpResult();
List<RptPloy> list;
try {
list = excelReportService.getPloyData();
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("模板获取失败.");
return httpResult;
}
httpResult.setCode(200);
httpResult.setMessage("模板获取成功.");
httpResult.setBody(list);
return httpResult;
}
//设置选中的模板
@PostMapping("setPloy")
@ResponseBody
public HttpResult setPloy(String guid) {
HttpResult httpResult = new HttpResult();
String userIndex = TokenManager.getUserId();
byte[] value = instantiateUtil.instantiate(guid);
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, ployGuid, value, RedisDB.SHORT_TIME);
if (guid.equals("##")) {
httpResult.setCode(200);
httpResult.setBody(null);
return httpResult;
}
try {
List<PloySetting> list = excelReportService.setPloy(guid);
httpResult.setBody(list);
byte[] valueset = listPloysetting.instantiate(list);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, ploy, valueset, RedisDB.SHORT_TIME);
} catch (Exception e) {
httpResult.setCode(500);
return httpResult;
}
httpResult.setCode(200);
return httpResult;
}
@PostMapping(value = "/createExcel")
public HttpResult createExcel(String pointInfo) {
HttpResult httpResult = new HttpResult();
JSONObject jsonObject = JSONObject.fromObject(pointInfo);
JSONObject json = (JSONObject) jsonObject.get("body");
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
ExcelUtil excelUtil = new ExcelUtil();
excelUtil.createWorkBook();
excelUtil.createSheet("非谐波");
excelUtil.createSheet("谐波电压");
excelUtil.createSheet("谐波电流");
excelUtil.createSheet("合格率");
excelUtil.setTableName(jsonObject.get("Name").toString());
OverLimitInfo overLimitIn = listOverlimit.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, overlimit));
excelUtil.setOverLimitInfo(overLimitIn);
for (XSSFSheet sheet : excelUtil.getListSheet()) {
excelUtil.createHeader(jsonObject, json, sheet);
}
//根据监测点id获取单位
DeviceUnitVO deviceUnitVO = pointBaseInfoService.lineUnitDetail(jsonObject.getInt("lineId"));
String strPloyGuid = (instantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, ployGuid)) == null ? "##" : instantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, ployGuid)));
List<PloySetting> listPloy = instantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, ploy));
List<ReportTarget> listVirtual = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, virtual));
List<ReportTarget> listPower = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, power));
List<ReportTarget> listFlicker = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, flicker));
List<ReportTarget> listDistortion = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, distortion));
List<ReportTarget> listVdeviation = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, vdeviation));
List<ReportTarget> listFrequency = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, frequency));
List<ReportTarget> listThreephase = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, threephase));
List<ReportTarget> listVoltageRate = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, voltageRate));
List<ReportTarget> listICurrent = listInstantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, iCurrent));
List<FpyDataByType> listFpy = listFpydata.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, fpy));
//非谐波电流
excelUtil.writeNonHarmonics(excelUtil.getListSheet().get(0),deviceUnitVO, listPloy, strPloyGuid, listVirtual, listPower, listFlicker, listDistortion, listVdeviation, listFrequency, listThreephase);
//谐波电压
excelUtil.writeHarmonics(excelUtil.getListSheet().get(1), listPloy, strPloyGuid, listVoltageRate, true);
//谐波电流
excelUtil.writeHarmonics(excelUtil.getListSheet().get(2), listPloy, strPloyGuid, listICurrent, false);
//合格率
excelUtil.writeFpyData(excelUtil.getListSheet().get(3), listPloy, strPloyGuid, listFpy);
excelUtilMap.put(userIndex, excelUtil);
httpResult.setCode(200);
return httpResult;
}
@GetMapping(value = "/exportExcel")
public void exportExcel(HttpServletResponse response) {
String userIndex = TokenManager.getUserId();
ExcelUtil excelUtil = excelUtilMap.get(userIndex);
excelUtil.exportFile(excelUtil.getWorkbook(), response);
}
private void splitTime(String strTime, List<TransformTime> list) throws Exception {
if (strTime.indexOf("") == -1) {
return;
}
String strArray[] = strTime.split("");
TransformTime TransformTime = new TransformTime(strArray[0], strArray[1]);
TransformTime.string2Date();
list.add(TransformTime);
}
private void transCondition(Condition condition, JSONObject jsonObject) throws Exception { //异常抛给上层处理
String startTime = jsonObject.get("startTime").toString();
String endTime = jsonObject.get("endTime").toString();
String first = jsonObject.get("first").toString();
String second = jsonObject.get("second").toString();
String thrid = jsonObject.get("thrid").toString();
String state = jsonObject.get("state").toString();
String dayOrDate = jsonObject.get("dayOrDate").toString();
Integer pointIndex = Integer.valueOf(jsonObject.get("pointIndex").toString());
String mode = jsonObject.get("mode").toString();
TransformTime TransformTime = new TransformTime(startTime, endTime);
TransformTime.string2Date();
condition.setStart(TransformTime.getStart());
condition.setEnd(TransformTime.getEnd());
condition.setPointIndex(pointIndex);
condition.setMode(mode);
if (state.equals("true")) {
splitTime(first, condition.getExceptTime());
splitTime(second, condition.getExceptTime());
splitTime(thrid, condition.getExceptTime());
}
if(dayOrDate.equals("0")){
condition.setB(false);
}else {
condition.setB(true);
}
}
@PostMapping(value = "/getOverLimitData")
public HttpResult getOverLimitData(String timeObj, HttpServletRequest request) {
HttpResult httpResult = new HttpResult();
JSONObject jsonObject = JSONObject.fromObject(timeObj);
Condition tempCondition = new Condition(appConfig);
try {
transCondition(tempCondition, jsonObject);
} catch (Exception e) {
logger.error("getLimitData()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
userLog.getLog("查询excel报表", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
return httpResult;
}
//saveConditionData(tempCondition);
//Condition condition=getConditionData();
/* try {
OverLimit over = overLimitMapper.selectByPrimaryKey(condition.getPointIndex().longValue());
MachineAccount machineAccount = lineService.getLineName(condition.getPointIndex());
if (over == null) {
cOverlimit.addOverLimit(condition.getPointIndex(), machineAccount.getScale());
}
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("监测点限值无数据.");
userLog.getLog("查询excel报表", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
return httpResult;
}*/
OverLimitInfo overLimitInfo = getOverLimitDataService.getOverLimitData(tempCondition);
overLimitInfo.setMode(tempCondition.getMode());
List<String> list;
switch (tempCondition.getMode()) {
case "0":
list = new ArrayList<>();
list.add("A");
list.add("B");
list.add("C");
overLimitInfo.setList(list);
break;
case "1":
list = new ArrayList<>();
list.add("AB");
list.add("BC");
list.add("CA");
overLimitInfo.setList(list);
break;
case "2":
list = new ArrayList<>();
list.add("AB");
list.add("BC");
list.add("-");
overLimitInfo.setList(list);
break;
}
tempCondition.setCount(overLimitInfo.getCount());
tempCondition.setPltCount(overLimitInfo.getPltCount());
tempCondition.setPstCount(overLimitInfo.getPstCount());
saveConditionData(tempCondition);
if (0 == overLimitInfo.getOverLimitRate().size()) {
httpResult.setCode(500);
httpResult.setMessage("监测点限值无数据.");
userLog.getLog("查询excel报表", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
return httpResult;
}
httpResult.setCode(200);
httpResult.setBody(overLimitInfo);
userLog.getLog("查询excel报表", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, overlimit, listOverlimit.instantiate(overLimitInfo), RedisDB.SHORT_TIME);
return httpResult;
}
private void transformData(List<ReportTarget> list, List<ReportValue> listValue, List<Pass> listOverlimit, boolean... b) {
int offset = b[0] ? 3 : 1;
offset = (b.length == 2 && !b[1]) ? 4 : offset;
int i = 0;
for (int index = 0; index < listValue.size(); index += offset) {
ReportTarget reportTarget = new ReportTarget();
List<ReportValue> list1 = new ArrayList<>();
list1.addAll(listValue.subList(index, index + offset));
reportTarget.setList(list1);
Float overLimit = listOverlimit.get(i).getOverLimit();
reportTarget.setOverLimit(overLimit);
switch (listOverlimit.get(i).getCode()) {
case 1:
for (int k = 0; k < reportTarget.getList().size(); k++) {
if (null == reportTarget.getList().get(k).getFmaxValue()) {
break;
} else if (reportTarget.getList().get(k).getFmaxValue().floatValue() > overLimit.floatValue()) {
reportTarget.setPass(EnumPass.NOPASS.getCode());
break;
} else {
reportTarget.setPass(EnumPass.PASS.getCode());
}
}
break;
case 2:
for (int k = 0; k < reportTarget.getList().size(); k++) {
if (null == reportTarget.getList().get(k).getMinValue()) {
break;
} else if (reportTarget.getList().get(k).getMinValue().floatValue() > overLimit.floatValue()) {
reportTarget.setPass(EnumPass.NOPASS.getCode());
break;
} else {
reportTarget.setPass(EnumPass.PASS.getCode());
}
}
break;
case 3:
for (int k = 0; k < reportTarget.getList().size(); k++) {
if (null == reportTarget.getList().get(k).getMeanValue()) {
break;
} else if (reportTarget.getList().get(k).getMeanValue().floatValue() > overLimit.floatValue()) {
reportTarget.setPass(EnumPass.NOPASS.getCode());
break;
} else {
reportTarget.setPass(EnumPass.PASS.getCode());
}
}
break;
case 4:
for (int k = 0; k < reportTarget.getList().size(); k++) {
if (null == reportTarget.getList().get(k).getCp95Value()) {
break;
} else if (reportTarget.getList().get(k).getCp95Value().floatValue() > overLimit.floatValue()) {
reportTarget.setPass(EnumPass.NOPASS.getCode());
break;
} else {
reportTarget.setPass(EnumPass.PASS.getCode());
}
}
break;
default:
break;
}
i++;
list.add(reportTarget);
}
}
@PostMapping(value = "/getVirtualData")
public HttpResult getVirtualData() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
if (condition == null) {
logger.error("getVirtualData()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listVirtual;
try {
listVirtual = getVirtualDataService.getVirtualData(condition);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("有效值获取失败");
return httpResult;
}
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 3; i++) {
Pass pass = new Pass(null);
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listVirtual, list, true);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, virtual, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("有效值获取成功.");
return httpResult;
}
@PostMapping(value = "/getPowerData")
public HttpResult getPowerData() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
if (condition == null) {
logger.error("getPowerData()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listPower;
try {
Long a = System.currentTimeMillis();
listPower = getPowerDataService.getPowerData(condition);
Long b = System.currentTimeMillis();
System.out.println(b-a);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("功率获取失败");
return httpResult;
}
Long aa = System.currentTimeMillis();
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 4; i++) { //3-->4
Pass pass = new Pass(null);
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listPower, list, true, false);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, power, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("功率获取成功.");
return httpResult;
}
@PostMapping(value = "/getflickerData")
public HttpResult getFlickerData() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
OverLimitInfo overLimitInfo = getOverlimitInfo();
if (condition == null) {
logger.error("getflickerData()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listFlicker;
try {
listFlicker = getFlickerDataService.getFlickerData(condition);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("电压闪变获取失败");
return httpResult;
}
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 2; i++) {
Pass pass;
if (i == 1) {
pass = new Pass(overLimitInfo.getOverLimitRate().get(0).getFlicker(), EnumPass.MAX.getCode());
} else {
pass = new Pass(null);
}
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listFlicker, list, true);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, flicker, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("电压闪变获取成功.");
return httpResult;
}
@PostMapping(value = "/getdistortionData")
public HttpResult getDistortionData() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
OverLimitInfo overLimitInfo = getOverlimitInfo();
if (condition == null) {
logger.error("getDistortionData()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listDistortion;
try {
listDistortion = getDistortionDataService.getDistortionData(condition);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("畸变率获取失败");
return httpResult;
}
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 2; i++) {
Pass pass;
if (i == 0) {
pass = new Pass(overLimitInfo.getOverLimitRate().get(0).getUaberrance(), EnumPass.CP95.getCode());
} else {
pass = new Pass(null);
}
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listDistortion, list, true);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, distortion, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("畸变率获取成功.");
return httpResult;
}
@PostMapping(value = "/getVdeviationData")
public HttpResult getVdeviationData() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
OverLimitInfo overLimitInfo = getOverlimitInfo();
if (condition == null) {
logger.error("getVdeviationData()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listVdeviation;
try {
listVdeviation = getVdeviationDataService.getVdeviation(condition);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("电压偏差获取失败");
return httpResult;
}
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 2; i++) {
Pass pass;
pass = new Pass(overLimitInfo.getOverLimitRate().get(0).getVoltageDev(), EnumPass.MAX.getCode());
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listVdeviation, list, true);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, vdeviation, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("电压偏差获取成功.");
return httpResult;
}
@PostMapping(value = "/getFrequencyData")
public HttpResult getFrequencyData() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
OverLimitInfo overLimitInfo = getOverlimitInfo();
if (condition == null) {
logger.error("getFrequencyData()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listFrequency;
try {
listFrequency = getFrequencyDataService.getFrequencyData(condition);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("频率获取失败");
return httpResult;
}
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 2; i++) {
Pass pass;
if (i == 1) {
pass = new Pass(overLimitInfo.getOverLimitRate().get(0).getFreqDev(), EnumPass.MAX.getCode());
} else {
pass = new Pass(null);
}
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listFrequency, list, false);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, frequency, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("频率获取成功.");
return httpResult;
}
@PostMapping(value = "/getThreephaseData")
public HttpResult getThreephaseData() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
OverLimitInfo overLimitInfo = getOverlimitInfo();
if (condition == null) {
logger.error("getThreephaseData()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listThreephase;
try {
listThreephase = getThreephaseDataService.getThreephase(condition);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("三相电压不平衡度获取失败");
return httpResult;
}
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 8; i++) {
Pass pass;
if (i == 0) {
pass = new Pass(overLimitInfo.getOverLimitRate().get(0).getUbalance(), EnumPass.CP95.getCode());
} else {
pass = new Pass(null);
}
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listThreephase, list, false);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, threephase, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("三相电压不平衡度获取成功.");
return httpResult;
}
@PostMapping(value = "/getICurrent")
public HttpResult getICurrent() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
OverLimitInfo overLimitInfo = getOverlimitInfo();
if (condition == null) {
logger.error("getICurrent()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listICurrent;
try {
listICurrent = getICurrentService.getICurrent(condition);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("谐波电流数据获取失败");
return httpResult;
}
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 50; i++) {
Pass pass;
if (i < overLimitInfo.getOverLimitRate().get(0).getIHarmList().size() + 1 && i > 0) {
pass = new Pass(overLimitInfo.getOverLimitRate().get(0).getIHarmList().get(i - 1), EnumPass.CP95.getCode());
} else {
pass = new Pass(null);
}
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listICurrent, list, true);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, iCurrent, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("谐波电流数据获取成功.");
return httpResult;
}
@PostMapping(value = "/getVoltageRate")
public HttpResult getVoltageRate() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
OverLimitInfo overLimitInfo = getOverlimitInfo();
if (condition == null) {
logger.error("getVoltageRate()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<ReportValue> listVoltageRate;
try {
listVoltageRate = getVoltageRateService.getVoltageRate(condition);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("谐波电压数据获取失败");
return httpResult;
}
List<Pass> list = new ArrayList<>();
for (int i = 0; i < 51; i++) {
Pass pass;
if (i == 0) {
pass = new Pass(null);
} else if (i == 50) {
pass = new Pass(overLimitInfo.getOverLimitRate().get(0).getUaberrance(), EnumPass.CP95.getCode());
} else if (i < overLimitInfo.getOverLimitRate().get(0).getVHarmList().size() + 1) {
pass = new Pass(overLimitInfo.getOverLimitRate().get(0).getVHarmList().get(i - 1), EnumPass.CP95.getCode());
} else {
pass = new Pass(null);
}
list.add(pass);
}
List<ReportTarget> list1 = new ArrayList<>();
transformData(list1, listVoltageRate, list, true);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, voltageRate, listInstantiateUtil.instantiate(list1), RedisDB.SHORT_TIME);
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("谐波电压数据获取成功.");
return httpResult;
}
@PostMapping(value = "/getFpy")
public HttpResult getFpy() {
HttpResult httpResult = new HttpResult();
Condition condition = getConditionData();
if (condition == null) {
logger.error("getFpy()方法时间转换失败.");
httpResult.setCode(500);
httpResult.setMessage("解析前台传递的时间有误");
return httpResult;
}
List<FpyDataByType> list1 = new ArrayList<>();
try {
list1 = getFpyService.getFpy(condition);
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, fpy, listFpydata.instantiate(list1), RedisDB.SHORT_TIME);
} catch (Exception e) {
httpResult.setCode(500);
httpResult.setMessage("合格率获取失败");
return httpResult;
}
httpResult.setCode(200);
httpResult.setBody(list1);
httpResult.setMessage("合格率获取成功.");
return httpResult;
}
/**
* 保存condition数据
* @param condition 数据
*/
private void saveConditionData(Condition condition) {
String userId = TokenManager.getUserId();
String key = userId+"ExcelReportController";
cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject(condition);
jedisManager.saveValueByKey(RedisDB.LONG_TIME_QUERY,key,jsonObject.toString(),-1);
}
/**
* 获取condition数据
*/
private Condition getConditionData() {
String userId = TokenManager.getUserId();
String key = userId+"ExcelReportController";
String valueJson = jedisManager.getValueByKey(RedisDB.LONG_TIME_QUERY, key);
cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject(valueJson);
Condition condition = (Condition) jsonObject.toBean(Condition.class);
return condition;
}
private OverLimitInfo getOverlimitInfo() {
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
OverLimitInfo overLimitInfo = listOverlimit.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, overlimit));
return overLimitInfo;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
package com.pqs9000.controller.report;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.TimeInterval;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.utils.PubUtils;
import com.njcn.utils.UserUtil;
import com.pqs9000.controller.area.IntegralityController;
import com.pqs9000.pojo.report.FpyReportData;
import com.pqs9000.service.report.FpyReportService;
/**
* 合格率报告
*/
@Controller
@RequestMapping(value = "fpyreport")
public class FpyReportController {
private static final Logger logger = LoggerFactory.getLogger(IntegralityController.class);
@Autowired
private UserUtil userUtil;
@Autowired
private FpyReportService fpyReportService;
@Autowired
UserLogDetailService userLog;
@RequestMapping(value = "fpyData", method = RequestMethod.POST)
@ResponseBody
public HttpResult fpyData(HttpServletRequest request, HttpSession session, String startTime, String endTime, String area) {
HttpResult result = new HttpResult();
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "fpyData");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<Integer> lineIndexs = userUtil.getAllLineIndexs(area);
List<FpyReportData> list = new ArrayList<>();
try {
TimeInterval timeInterval = new TimeInterval();
list = fpyReportService.fpyExcel(lineIndexs,datePojo.getStartTime(), datePojo.getEndTime());
logger.info("方法耗时+++++++++++++++++++++++"+timeInterval.interval());
if (null == list) {
result = PubUtils.assignmentResult(null, 500, "获取合格率报表数据失败");
} else {
result = PubUtils.assignmentResult(list, 200, "获取合格率报表数据成功");
}
} catch (Exception e) {
logger.error("获取合格率报表数据异常,异常为:" + e.toString());
result = PubUtils.assignmentResult(null, 500, "获取合格率报表数据异常");
}
return result;
}
@RequestMapping(value = "qualifiedRate", method = RequestMethod.GET)
@ResponseBody
public HttpResult qualifiedRate(String startTime, String endTime, String area) {
TimeInterval timeInterval = new TimeInterval();
HttpResult result = new HttpResult();
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "qualifiedRate");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<Integer> lineIndexs = userUtil.getAllLineIndexs(area);
List<FpyReportData> fpyReportDataList = fpyReportService.qualifiedRate(lineIndexs,datePojo.getStartTime(), datePojo.getEndTime());
if (CollectionUtil.isEmpty(fpyReportDataList)) {
result = PubUtils.assignmentResult(null, 500, "获取合格率报表数据失败");
} else {
result = PubUtils.assignmentResult(fpyReportDataList, 200, "获取合格率报表数据成功");
}
logger.info("方法耗时+++++++++++++++++++++++"+timeInterval.interval());
return result;
}
}

View File

@@ -0,0 +1,104 @@
package com.pqs9000.controller.report;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.RedisDB;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.InstantiateUtil;
import com.njcn.utils.PubUtils;
import com.njcn.utils.redis.JedisManager;
import com.pqs9000.service.report.PercentService;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("percent")
public class PercentController {
@Autowired
private PercentService percentService;
@Autowired
private JedisManager jedisManager;
@Autowired
UserLogDetailService userLog;
private InstantiateUtil<String> instantiateUtil;
private byte[] fact;
private Map<String, XWPFDocument> map;
public PercentController() {
instantiateUtil = new InstantiateUtil<>();
fact = instantiateUtil.instantiate("fact");
map = new HashMap<>();
}
@PostMapping("createPercent")
@ResponseBody
public HttpResult createTable(String startTime, String endTime, int timeType, String list, String factory, String listPointName, String lineName) {
HttpResult httpResult;
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
byte[] value = instantiateUtil.instantiate(factory);
jedisManager.hset(RedisDB.SHORT_TIME_QUERY, userIndexs, fact, value, RedisDB.SHORT_TIME);
DatePojo datePojo = PubUtils.validateDate(startTime, endTime, "createTable");
if (!datePojo.getValidity()) {
httpResult = PubUtils.assignmentResult(null, 500, "解析前台传递的时间有误");
return httpResult;
}
List<Integer> list1 = new ArrayList<>();
String[] array = list.split(",");
for (int i = 0; i < array.length; i++)
list1.add(Integer.parseInt(array[i]));
try {
XWPFDocument xwpfDocument = percentService.createTable(datePojo.getStartTime(), datePojo.getEndTime(), list1, timeType, factory, listPointName, lineName);
map.put(userIndex, xwpfDocument);
if (xwpfDocument == null) {
return PubUtils.assignmentResult(null, 500, "合格率报表生成失败");
}
} catch (Exception e) {
return PubUtils.assignmentResult(null, 500, "合格率报表生成失败");
}
httpResult = PubUtils.assignmentResult(null, 200, "合格率报表生成成功");
return httpResult;
}
@GetMapping(value = "/exportPercent")
public void exportPercent(HttpServletResponse response,HttpServletRequest request) {
try {
String userIndex = TokenManager.getUserId();
byte[] userIndexs = instantiateUtil.instantiate(userIndex);
String factory = instantiateUtil.deInstantiate(jedisManager.hget(RedisDB.SHORT_TIME_QUERY, userIndexs, fact));
XWPFDocument xwpfDocument = map.get(userIndex);
response.setContentType("application/force-download");
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(factory.getBytes("GB2312"), "iso8859-1") + "_" + PubUtils.getNow() + ".docx");// 设置文件名
OutputStream outputStream = response.getOutputStream();
xwpfDocument.write(outputStream);
outputStream.close();
userLog.getLog("导出合格率报表", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (IOException e) {
userLog.getLog("导出合格率报表", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
}
}
}

View File

@@ -0,0 +1,86 @@
package com.pqs9000.controller.responsibility;
import cn.hutool.json.JSONArray;
import com.alibaba.fastjson.JSON;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.RedisDB;
import com.njcn.utils.PubUtils;
import com.njcn.utils.redis.JedisManager;
import com.pqs9000.pojo.responsibility.AreaOverNoraml;
import com.pqs9000.pojo.responsibility.OverLimitMonitor;
import com.pqs9000.service.responsibility.AreaOverNoramlService;
import com.pqs9000.util.ComplexHeadExcel;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* @author xuyang
* @date 2020/9/18 13:55
* 区域稳态指标超标分类
*/
@Controller
@RequestMapping("responsibility")
public class ResponsibilityAreaOverNormalController {
private static final Logger logger = LoggerFactory.getLogger(ResponsibilityAreaOverNormalController.class);
@Autowired
private AreaOverNoramlService areaOverNoramlService;
@Autowired
private JedisManager jedisManager;
/**
* 区域稳态指标超标分类统计展示界面
*/
@GetMapping("areaovernoraml")
public String responsibilityList() {
return "business/responsibility/areaOverLimit";
}
@PostMapping("/overLimitData")
@ResponseBody
public HttpResult overLimit(String startTime, String endTime, String type, int statistic, boolean statFlag){
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "overLimitData");
if (!datePojo.getValidity()) {
result = PubUtils.assignmentResult(null, 500, "校验前台传递时间参数报错");
return result;
}
List<AreaOverNoraml> list;
try {
list = areaOverNoramlService.getOverLimitData(startTime,endTime,type,statistic,statFlag);
result = PubUtils.assignmentResult(list, 200, "获取区域稳态指标超标成功");
} catch (Exception e) {
result = PubUtils.assignmentResult(null, 500, "获取区域稳态指标超标异常");
}
return result;
}
@PostMapping("/exportAreaExcel")
@ResponseBody
public void export(HttpServletResponse response, HttpServletRequest request,String statistic,String startTime,String endTime){
startTime = startTime.replaceAll("-","");
endTime = endTime.replaceAll("-","");
String re = jedisManager.getValueByKey(RedisDB.REPORTID,RedisDB.AREAREPORTNAME);
List<AreaOverNoraml> list = JSON.parseArray(re,AreaOverNoraml.class);
ComplexHeadExcel complexHeadExcel = new ComplexHeadExcel();
complexHeadExcel.exportAreaReport(response,request,list,startTime,endTime,statistic);
}
}

View File

@@ -0,0 +1,309 @@
package com.pqs9000.controller.responsibility;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.utils.PubUtils;
import com.pqs9000.exception.UserDataException;
import com.pqs9000.pojo.responsibility.*;
import com.pqs9000.service.responsibility.IUserExcelDataService;
import com.pqs9000.service.responsibility.ResponsibilityService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.regex.Pattern;
/**
* @author hongawen
* @Date: 2019/3/26 09:57
*/
@Controller
@RequestMapping("responsibility")
public class ResponsibilityCalculateController {
private static final Logger logger = LoggerFactory.getLogger(ResponsibilityCalculateController.class);
@Autowired
private ResponsibilityService responsibilityService;
@Autowired
private IUserExcelDataService userExcelDataService;
@Autowired
UserLogDetailService userLog;
/**
* 责任划分列表--》贡献度计算页面
*/
@GetMapping("calculate")
public String responsibilityList() {
return "business/responsibility/calculate";
}
/**
* 根据用户参数查询出条件下的历史谐波数据
*
* @param lineIndex 监测点索引
* @param startTime 起始时间
* @param endTime 截止时间
* @param type 谐波类型
* @param time 谐波次数
*/
@PostMapping("historyData")
@ResponseBody
public HttpResult getHistoryData(Integer lineIndex, String startTime, String endTime, String type, Integer time, HttpServletRequest request) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "getHistoryData");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
//首先校验前台传的参数正确性
if (lineIndex == null || time == null) {
//xuyang_add time增加正则判断只能读取非0的正整数
String pattern = "^\\+?[1-9][0-9]*$";
if (!Pattern.matches(pattern,String.valueOf(time))){
result = PubUtils.assignmentResult(null, 500, "前台参数异常");
return result;
}
}
List<Responsibility> historyData;
try {
historyData = responsibilityService.getHistoryData(lineIndex, datePojo.getStartTime(), datePojo.getEndTime(), type, time);
if (CollectionUtils.isEmpty(historyData)) {
historyData = new ArrayList<>();
}
Float overLimt=responsibilityService.getLimitByTimeAndType(lineIndex,time,type);
HarmHistoryDataResult historyResult=new HarmHistoryDataResult();
if(null==overLimt){
historyResult.setOverlimit(0.0f);
}else{
historyResult.setOverlimit(overLimt);
}
historyResult.setHistoryData(historyData);
result = PubUtils.assignmentResult(historyResult, 200, "获取谐波历史数据成功");
userLog.getLog("查询责任量化历史谐波数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (UserDataException u) {
result = PubUtils.assignmentResult(new ArrayList<>(), 501, u.getMessage());
userLog.getLog("查询责任量化历史谐波数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取历史谐波数据异常,异常为" + e.toString());
userLog.getLog("查询责任量化历史谐波数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResult(null, 500, "获取历史谐波数据异常");
}
return result;
}
/**
* 上传用采数据,并对用采数据进行数据分析并缓存
* 借用hutool中excel工具操作表格数据
*
* @param file 上传的表格
*/
@PostMapping("uploadExcelData")
@ResponseBody
public HttpResult uploadExcelData(@RequestParam(value = "file", required = false) MultipartFile file,HttpServletRequest request) {
HttpResult result;
//获取文件名
String fileName = file.getOriginalFilename();
/**
* ---------------------------------------------------------------------------------------------------
* xuyang 2020.08.27
* 修改:对上传文件做判断
* 1.文件类型 2.文件大小
*/
//文件大小(此大小为kb)
Long fileSize = file.getSize()/1024;
//判断文件大小
if (fileSize > 3072){
result = PubUtils.assignmentResult(null, 500, "上传失败,上传文件超过3M文件过大!");
userLog.getLog("上传用采数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
return result;
}
/**
* over
* ---------------------------------------------------------------------------------------------------
*/
if (!fileName.matches("^.+\\.(?i)(xlsx)$") && !fileName.matches("^.+\\.(?i)(xls)$")) {
result = PubUtils.assignmentResult(null, 500, "上传文件类型错误!");
return result;
}
String dealInfo;
try {
dealInfo = responsibilityService.dealExcelData(file);
if (dealInfo.equalsIgnoreCase("用采数据上传成功")) {
result = PubUtils.assignmentResult(null, 200, "用采数据上传成功");
} else {
result = PubUtils.assignmentResult(null, 200, dealInfo.substring(1));
}
userLog.getLog("上传用采数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("上传用采数据异常,异常信息为:" + e.toString());
userLog.getLog("上传用采数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResult(null, 500, e.getMessage());
}
return result;
}
/**
* 根据谐波数据和功率数据获取动态数据以及责任量化值
*
* @param startTime 起始时间
* @param endTime 截止时间
* @param type 干扰源类型终
* @param lineIndex 监测点号
* @param time 次数
* @param userDataIndex 用采数据索引
*/
@PostMapping("getDynamicData")
@ResponseBody
public HttpResult getDynamicData(String startTime, String endTime, String type, Integer lineIndex, Integer time, String userDataIndex, int calFlag,HttpServletRequest request) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "getHistoryData");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
//首先校验前台传的参数正确性
if (lineIndex == null || time == null) {
result = PubUtils.assignmentResult(null, 500, "前台参数异常");
return result;
}
ResponsibilityResult datas;
try {
//以谐波数据和功率数据获取最终值
datas = responsibilityService.getDynamicDataAndResponsibiltyByPData(datePojo.getStartTime(), datePojo.getEndTime(), type, lineIndex, time, userDataIndex, calFlag);
result = PubUtils.assignmentResult(datas, 200, "获取动态谐波责任数据和谐波责任成功");
userLog.getLog("查询动态谐波责任数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (UserDataException u) {
//捕获到该异常表示,可识别的某种理想异常
logger.error("获取动态谐波责任数据和责任量化数据异常,异常为:" + u.getMessage());
result = PubUtils.assignmentResult(null, 501, u.getMessage());
userLog.getLog("查询动态谐波责任数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取动态谐波责任数据和谐波责任异常,异常为:" + e.toString());
e.printStackTrace();
userLog.getLog("查询动态谐波责任数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResult(null, 500, e.getMessage());
}
return result;
}
/**
* 根据谐波数据和功率数据获取动态数据以及责任量化值
*
* @param startTime 起始时间
* @param endTime 截止时间
* @param time 次数
*/
@PostMapping("getResponsibilityData")
@ResponseBody
public HttpResult getResponsibilityData(String startTime, String endTime, Integer time,float limitValue,String limitStartTime,String limitEndTime,String responsibilityIndex) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "getHistoryData");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
//首先校验前台传的参数正确性
if (StringUtils.isEmpty(responsibilityIndex) || time == null) {
result = PubUtils.assignmentResult(null, 500, "前台参数异常");
return result;
}
Date limitS;
Date limitE;
//如果两个是时间点是用户自己选择的,那么起始时间可能存在大于截止时间
try {
Date start=datePojo.getStartTime();
Date end=datePojo.getEndTime();
if(StringUtils.isEmpty(limitStartTime)){
limitS=start;
}else{
limitS=PubUtils.string2Date(limitStartTime,"yyyy-MM-dd HH:mm:ss");
}
if(StringUtils.isEmpty(limitEndTime)) {
limitE=end;
}else{
limitE=PubUtils.string2Date(limitEndTime,"yyyy-MM-dd HH:mm:ss");
}
Date temp;
if(limitS.compareTo(limitE)>0){
//调换两个时间位置
temp=limitS;
limitS=limitE;
limitE=temp;
}
//判断限值起始时间是否小于起始时间以及限值截止时间是否大于截止时间
if(start.compareTo(limitS)>0){
limitS=start;
}
if(end.compareTo(limitE)<0){
limitE=end;
}
} catch (Exception e) {
//解释两个时间点异常,直接返回前台提示
result = PubUtils.assignmentResult(null, 500, "解析时间点异常");
logger.error("解析限值时间点为Date出异常异常为"+e.toString());
return result;
}
ResponsibilityResult datas;
try {
//以谐波数据和功率数据获取最终值
datas = responsibilityService.getDynamicDataAndResponsibiltyByFkData(datePojo.getStartTime(), datePojo.getEndTime(), time,limitValue,limitS,limitE,responsibilityIndex);
result = PubUtils.assignmentResult(datas, 200, "获取责任量化值成功");
} catch (UserDataException u) {
//捕获到该异常表示,可识别的某种理想异常
logger.error("获取责任量化值异常,异常为:" + u.getMessage());
result = PubUtils.assignmentResult(null, 501, u.getMessage());
} catch (Exception e) {
logger.error("获取动责任量化值异常,异常为:" + e.toString());
result = PubUtils.assignmentResult(null, 500, e.getMessage());
}
return result;
}
/**
* 库中查询用采数据列表,让用户选择某数据,进行责任划分分析
*/
@PostMapping("getUserDataList")
@ResponseBody
public HttpResult getUserDataList() {
HttpResult result;
List<UserExcelData> userExcelDataList;
try {
userExcelDataList = userExcelDataService.getUserExcelDataList();
if (CollectionUtils.isEmpty(userExcelDataList)) {
result = PubUtils.assignmentResult(null, 500, "暂无用采数据");
} else {
result = PubUtils.assignmentResult(userExcelDataList, 200, "获取用采数据列表成功");
}
} catch (Exception e) {
logger.error("获取用采数据列表异常,异常为:" + e.toString());
result = PubUtils.assignmentResult(null, 500, "获取用采数据列表异常");
}
return result;
}
}

View File

@@ -0,0 +1,164 @@
package com.pqs9000.controller.responsibility;
import com.njcn.enums.LogTypeEnum;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.responsibility.ResponsibilityData;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.utils.PubUtils;
import com.pqs9000.pojo.responsibility.ResponsibilityResult;
import com.pqs9000.service.responsibility.ResponsibilityService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author hongawen
* @Date: 2019/3/21 15:34
*/
@Controller
@RequestMapping("responsibility")
public class ResponsibilityListController {
private static final Logger logger = LoggerFactory.getLogger(ResponsibilityListController.class);
@Autowired
private ResponsibilityService responsibilityService;
@Autowired
UserLogDetailService userLog;
/**
* 高级分析--》责任划分列表
*/
@GetMapping("responsibilitylist")
public String responsibilityList() {
return "business/responsibility/responsibilityList";
}
/**
* 责任划分列表的数据获取
*/
@PostMapping("responsibilityDataList")
@ResponseBody
public HttpResult responsibilityDataList(String startTime, String endTime, HttpServletRequest request) {
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "responsibilityDataList");
if (!StringUtils.isEmpty(datePojo.getMsg())) {
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
return result;
}
List<ResponsibilityData> responsibilityDataList;
try {
responsibilityDataList = responsibilityService.responsibilityDataList(datePojo.getStartTime(), datePojo.getEndTime());
if (CollectionUtils.isEmpty(responsibilityDataList)) {
result = PubUtils.assignmentResult(null, 500, "时间范围内责任数据为空");
} else {
result = PubUtils.assignmentResult(responsibilityDataList, 200, "获取时间范围内责任数据成功");
}
userLog.getLog("查询责任划分列表的数据", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("获取时间范围内责任数据异常,异常为:" + e.toString());
userLog.getLog("查询责任划分列表的数据", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result = PubUtils.assignmentResult(null, 500, "获取事件范围内责任数据异常");
}
return result;
}
/**
* 谐波责任列表中,点击详情,根据索引返回具体信息
*
* @param resIndex 责任计算索引
*/
@GetMapping("viewDetail")
public ModelAndView viewDetail(String resIndex) {
ModelAndView mv = new ModelAndView();
mv.setViewName("business/responsibility/viewDetail");
mv.addObject("resIndex", resIndex);
return mv;
}
/**
* 根据索引返回具体信息
*
* @param resIndex 责任计算索引
*/
@PostMapping("getResponsbilityData")
@ResponseBody
public HttpResult getResponsbilityData(String resIndex) {
HttpResult result;
ResponsibilityData responsibilityData;
try {
responsibilityData = responsibilityService.selectByIndex(resIndex);
if (null == responsibilityData) {
result = PubUtils.assignmentResult(null, 500, "根据索引获取责任计算详细数据为空");
} else {
result = PubUtils.assignmentResult(responsibilityData, 200, "根据索引获取责任计算详细数据成功");
}
} catch (Exception e) {
logger.error("根据索引获取责任计算详细数据异常,异常为:" + e.toString());
result = PubUtils.assignmentResult(null, 500, "根据索引获取责任计算详细数据异常");
}
return result;
}
/**
* 根据页面条件显示动态波形和责任表格
* @param resIndex 责任计算索引
*/
@PostMapping("displayHistoryData")
@ResponseBody
public HttpResult displayHistoryData(Integer time, String resIndex) {
HttpResult result;
List<ResponsibilityResult> responsibilityResults;
try {
responsibilityResults = responsibilityService.displayHistoryData(time,resIndex);
if(CollectionUtils.isEmpty(responsibilityResults)){
result=PubUtils.assignmentResult(null,500,"历史谐波责任计算数据为空");
}else{
result=PubUtils.assignmentResult(responsibilityResults,200,"获取历史谐波责任计算数据成功");
}
} catch (Exception e) {
logger.error("获取历史谐波责任计算数据异常,异常为:" + e.toString());
result=PubUtils.assignmentResult(null,500,"获取历史谐波责任计算数据异常");
}
return result;
}
/**
* 根据索引删除责任记录和文件数据
* @param resIndex 责任计算索引
*/
@PostMapping("deleteResponsibility")
@ResponseBody
public HttpResult deleteResponsibility(String resIndex,HttpServletRequest request) {
HttpResult result;
try {
responsibilityService.deleteResponsibilityByResIndex(resIndex);
result=PubUtils.assignmentResult(null,200,"删除记录成功");
userLog.getLog("删除责任记录", "成功", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
} catch (Exception e) {
logger.error("根据索引删除责任记录和文件数据异常,异常为:" + e.toString());
userLog.getLog("删除责任记录", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
result=PubUtils.assignmentResult(null,500,"删除记录失败");
}
return result;
}
}

View File

@@ -0,0 +1,118 @@
package com.pqs9000.controller.responsibility;
import com.alibaba.fastjson.JSON;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.RedisDB;
import com.njcn.utils.PubUtils;
import com.njcn.utils.redis.JedisManager;
import com.pqs9000.controller.area.MonitorScopeController;
import com.pqs9000.pojo.responsibility.OverLimitMonitor;
import com.pqs9000.service.responsibility.OverLimitMonitorService;
import com.pqs9000.util.ComplexHeadExcel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* @author xuyang
* @date 2020/10/30 10:57
*/
@Controller
@RequestMapping("responsibility")
public class ResponsibilityOverLimitMonitorController {
// 日志记录
private static final Logger logger = LoggerFactory.getLogger(ResponsibilityOverLimitMonitorController.class);
@Autowired
private OverLimitMonitorService overLimitMonitorService;
@Autowired
private JedisManager jedisManager;
/**
* 监测点明细展示界面
*/
@GetMapping("overlimitmonitor")
public String overlimitmonitor() {
return "business/responsibility/overLimitMonitor";
}
/**
* 监测点稳态超标数据
* ps获取到的监测点数据会有重复的因为有的监测点几个地区都有使用统计的时候有区域的条件所以没有去重
*/
@PostMapping("/overLimitMonitorData")
@ResponseBody
public HttpResult overlimitmonitorData(String startTime, String endTime, String tigName, String area, String vollevel,boolean statFlag){
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "overLimitMonitorData");
if (!datePojo.getValidity()) {
result = PubUtils.assignmentResult(null, 500, "校验前台传递时间参数报错");
return result;
}
List<OverLimitMonitor> monitorList;
try {
monitorList = overLimitMonitorService.getOverLimitMonitorData(startTime,endTime,tigName,area,vollevel,statFlag);
result = PubUtils.assignmentResult(monitorList, 200, "获取监测点稳态超标数据成功");
} catch (Exception e) {
e.printStackTrace();
logger.error("获取监测点信息数据为异常,异常为:" + e.getMessage());
result = PubUtils.assignmentResult(null, 500, "获取监测点稳态超标数据异常");
}
return result;
}
/**
* 导出功能
* @param response
* @param request
*/
@PostMapping("/exportMonitorExcel")
@ResponseBody
public void export(HttpServletResponse response, HttpServletRequest request,String startTime,String endTime){
startTime = startTime.replaceAll("-","");
endTime = endTime.replaceAll("-","");
String re = jedisManager.getValueByKey(RedisDB.REPORTID,RedisDB.MONITORREPORTNAME);
List<OverLimitMonitor> list = JSON.parseArray(re,OverLimitMonitor.class);
ComplexHeadExcel complexHeadExcel = new ComplexHeadExcel();
complexHeadExcel.exportMonitorReport(response,request,list,startTime,endTime);
}
/**
* 手动计算功能
*/
@PostMapping("/manualCalculation")
@ResponseBody
public HttpResult manualCalculation(String startTime, String endTime){
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "manualCalculation");
if (!datePojo.getValidity()) {
result = PubUtils.assignmentResult(null, 500, "校验前台传递时间参数报错");
return result;
}
try {
overLimitMonitorService.manualCalculation(startTime,endTime);
result = PubUtils.assignmentResult(null, 200, "计算每日稳态超标详情数据成功");
} catch (Exception e) {
e.printStackTrace();
logger.error("计算每日稳态超标详情数据异常,异常为:" + e.getMessage());
result = PubUtils.assignmentResult(null, 500, "计算每日稳态超标详情数据异常");
}
return result;
}
}

View File

@@ -0,0 +1,108 @@
package com.pqs9000.controller.responsibility;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.utils.PubUtils;
import com.pqs9000.pojo.responsibility.UserExcelData;
import com.pqs9000.pojo.responsibility.UserExcelDataNoIntegrity;
import com.pqs9000.service.responsibility.IUserExcelDataNoIntegrityService;
import com.pqs9000.service.responsibility.IUserExcelDataService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
/**
* @author hongawen
* @Date: 2019/4/24 10:11
*/
@Controller
@RequestMapping("responsibility")
public class ResponsibilityUserDataController {
private static final Logger logger=LoggerFactory.getLogger(ResponsibilityUserDataController.class);
@Autowired
private IUserExcelDataService userExcelDataService;
@Autowired
private IUserExcelDataNoIntegrityService userExcelDataNoIntegrityService;
/**
* 责任划分列表--》用采数据列表
*/
@GetMapping("userDataList")
public String userDataList(){
return "business/responsibility/userDataList";
}
/**
* 用采数据列表--》完整性不足详情列表
*/
@GetMapping("noIntergrity")
public ModelAndView noIntergrity(String excelIndex){
ModelAndView mv=new ModelAndView();
mv.addObject("excelIndex",excelIndex);
mv.setViewName("business/responsibility/lackIntergrity");
return mv;
}
/**
* 根据用采数据索引获取其完整性不足的数据展示
* @param excelIndex 索引
*/
@PostMapping("getLackIntergrityList")
@ResponseBody
public HttpResult getLackIntergrityList(String excelIndex){
HttpResult result;
if(StringUtils.isEmpty(excelIndex)){
result=PubUtils.assignmentResult(null,500,"参数不合法");
return result;
}
List<UserExcelDataNoIntegrity> userExcelDataNoIntegrities;
try{
userExcelDataNoIntegrities=userExcelDataNoIntegrityService.getUserExcelDataNoIntergritys(excelIndex);
if(CollectionUtils.isEmpty(userExcelDataNoIntegrities)){
result=PubUtils.assignmentResult(null,200,"完整性详情数据不存在!");
}else{
result=PubUtils.assignmentResult(userExcelDataNoIntegrities,200,"获取完整性详情数据成功!");
}
}catch (Exception e){
logger.error("获取完整性详情数据成功异常,异常为:"+e.toString());
result=PubUtils.assignmentResult(null,500,"获取完整性详情数据异常!");
}
return result;
}
/**
* 根据索引删除责任记录和文件数据
* @param userDataIndex 用采数据索引
*/
@PostMapping("deleteUserData")
@ResponseBody
public HttpResult deleteUserData(String userDataIndex) {
HttpResult result;
try {
userExcelDataService.deleteExcelDataByIndex(userDataIndex);
result=PubUtils.assignmentResult(null,200,"删除记录成功");
} catch (Exception e) {
logger.error("根据索引删除责任记录和文件数据异常,异常为:" + e.toString());
result=PubUtils.assignmentResult(null,500,"删除记录失败");
}
return result;
}
}

View File

@@ -0,0 +1,93 @@
package com.pqs9000.controller.responsibility;
import com.alibaba.fastjson.JSON;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.RedisDB;
import com.njcn.utils.PubUtils;
import com.njcn.utils.redis.JedisManager;
import com.pqs9000.pojo.common.PowerQualityData;
import com.pqs9000.pojo.responsibility.OverLimitMonitor;
import com.pqs9000.pojo.responsibility.WarningSubstation;
import com.pqs9000.service.responsibility.WarningSubstationService;
import com.pqs9000.util.ComplexHeadExcel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* @author xuyang
* @date 2020/10/9 19:03
*/
@Controller
@RequestMapping("responsibility")
public class ResponsibilityWarningSubstationController {
private static final Logger logger = LoggerFactory.getLogger(ResponsibilityWarningSubstationController.class);
@Autowired
private WarningSubstationService warningSubstationService;
@Autowired
private JedisManager jedisManager;
/**
* 告警变电站明细展示界面
*/
@GetMapping("warningsubstation")
public String warningSubstationList() {
return "business/responsibility/substationWarning";
}
/**
* 请求变电站信息
*/
@PostMapping("/warningSubstationData")
@ResponseBody
public HttpResult substationData(String startTime, String endTime, String tigName, String area, String vollevel,boolean statFlag){
HttpResult result;
DatePojo datePojo;
datePojo = PubUtils.validateDate(startTime, endTime, "warningSubstationData");
if (!datePojo.getValidity()) {
result = PubUtils.assignmentResult(null, 500, "校验前台传递时间参数报错");
return result;
}
List<WarningSubstation> subList = new ArrayList<WarningSubstation>();
try {
subList = warningSubstationService.getWarningSubstationData(startTime,endTime,tigName,area,vollevel,statFlag);
result = PubUtils.assignmentResult(subList, 200, "获取告警变电站明细成功");
} catch (Exception e) {
result = PubUtils.assignmentResult(null, 500, "获取告警变电站明细异常");
}
return result;
}
/**
* 导出功能
* @param response
* @param request
*/
@PostMapping("/exportSubExcel")
@ResponseBody
public void export(HttpServletResponse response, HttpServletRequest request,String startTime,String endTime){
startTime = startTime.replaceAll("-","");
endTime = endTime.replaceAll("-","");
String re = jedisManager.getValueByKey(RedisDB.REPORTID,RedisDB.SUBREPORTNAME);
List<WarningSubstation> list = JSON.parseArray(re,WarningSubstation.class);
ComplexHeadExcel complexHeadExcel = new ComplexHeadExcel();
complexHeadExcel.exportSubReport(response,request,list,startTime,endTime);
}
}

View File

@@ -0,0 +1,98 @@
package com.pqs9000.controller.user;
import com.njcn.mapper.user.ManageListMapper;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.service.user.ManageListService;
import com.njcn.utils.AppConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Controller
@RequestMapping(value ="/manage")
public class ManageListController {
@Autowired
ManageListService mService;
@Autowired
ManageListMapper mlm;
@Autowired
private AppConfig appConfig;
// 日志记录
private static final Logger logger = LoggerFactory.getLogger(ManageListController.class);
@RequestMapping(value = "getManage", method = RequestMethod.POST)
@ResponseBody
public HttpResult getManage(HttpServletRequest request) {
HttpResult result = new HttpResult();
List<List> users = mService.getManage();
if (users.isEmpty()) {
result.setCode(500);
result.setMessage("没有获取到资源信息列表");
logger.error("获取资源信息失败");
} else {
result.setCode(200);
result.setBody(users);
result.setMessage("获取资源信息列表成功");
logger.info("获取资源信息成功");
}
return result;
}
@RequestMapping(value = "getBasemang", method = RequestMethod.POST)
@ResponseBody
public HttpResult getBasemang(HttpServletRequest request) {
HttpResult result = new HttpResult();
List<List> users = mService.getBasemang(appConfig.getSysTypeWt());
if (users.isEmpty()) {
result.setCode(500);
result.setMessage("没有获取到资源信息列表");
logger.error("获取资源信息失败");
} else {
result.setCode(200);
result.setBody(users);
result.setMessage("获取资源信息列表成功");
logger.info("获取资源信息成功");
}
return result;
}
@RequestMapping(value = "getReport", method = RequestMethod.POST)
@ResponseBody
public HttpResult getReport(HttpServletRequest request) {
HttpResult result = new HttpResult();
List<List> users = mService.getReport(appConfig.getSysTypeWt());
if (users.isEmpty()) {
result.setCode(500);
result.setMessage("没有获取到资源信息列表");
logger.error("获取资源信息失败");
} else {
result.setCode(200);
result.setBody(users);
result.setMessage("获取资源信息列表成功");
logger.info("获取资源信息成功");
}
return result;
}
@RequestMapping(value = "getSub", method = RequestMethod.POST)
@ResponseBody
public HttpResult getSub(HttpServletRequest request) {
HttpResult result = new HttpResult();
List<List> users = mService.getSub(appConfig.getSysTypeWt());
if (users.isEmpty()) {
result.setCode(500);
result.setMessage("没有获取到资源信息列表");
logger.error("获取资源信息失败");
} else {
result.setCode(200);
result.setBody(users);
result.setMessage("获取资源信息列表成功");
logger.info("获取资源信息成功");
}
return result;
}
}

View File

@@ -0,0 +1,453 @@
package com.pqs9000.controller.user;
import com.njcn.enums.CookieKeyEnum;
import com.njcn.enums.LogTypeEnum;
import com.njcn.enums.ProjectEnum;
import com.njcn.mapper.user.ManageListMapper;
import com.njcn.mapper.user.UserMapper;
import com.njcn.mapper.user.UserSetMapper;
import com.njcn.pojo.commons.AreaInfo;
import com.njcn.pojo.commons.HttpResult;
import com.njcn.pojo.commons.RedisDB;
import com.njcn.pojo.user.ManageList;
import com.njcn.service.log.UserLogDetailService;
import com.njcn.shiro.filter.KickoutSessionFilter;
import com.njcn.sso.pojo.user.User;
import com.njcn.service.log.UserLoginService;
import com.njcn.service.user.UserService;
import com.njcn.shiro.session.UserShiroSessionRepository;
import com.njcn.shiro.session.impl.JedisShiroSessionRepository;
import com.njcn.shiro.token.TokenManager;
import com.njcn.utils.*;
import com.njcn.utils.redis.JedisManager;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.SimplePrincipalCollection;
import org.apache.shiro.subject.support.DefaultSubjectContext;
import org.apache.shiro.web.util.WebUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.MalformedURLException;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.util.*;
/**
* 管理用户的登录、增删改查、验证码获取等。
*/
@Controller
@RequestMapping("user")
public class UserController {
@Autowired
private UserService us;
@Autowired
UserUtil userUtil;
@Autowired
UserSetMapper usm;
@Autowired
UserMapper um;
@Autowired
UserLoginService userLoginService;
@Autowired
UserLogDetailService userLogservice;
@Autowired
JedisManager jedisManager;
@Autowired
private AppConfig appConfig;
@Autowired
ManageListMapper alm;
@Autowired
private UserShiroSessionRepository userShiroSessionRepository;
// 日志记录
private static final Logger logger = LoggerFactory.getLogger(UserController.class);
/**
* 根据当前用户获取区域选择tree
*/
@PostMapping("getAreasInfo")
@ResponseBody
public List<AreaInfo> getAreasInfo(){
List<AreaInfo> areaInfos;
try{
areaInfos=us.getAreasByUser();
if(CollectionUtils.isEmpty(areaInfos)){
areaInfos=null;
}
}catch (Exception e){
areaInfos=null;
}
return areaInfos;
}
@PostMapping("clear")
@ResponseBody
public String clear(){
TokenManager.clearNowUserAuth();
return "";
}
/**
* 用户注销统一重定向到sso中心在sso中心查询该用户所有对应的sessionID进行缓存清理以达到子系统全部注销
*/
@GetMapping("loginout")
public void loginOut(HttpServletRequest request, HttpServletResponse response) throws IOException {
boolean flag = appConfig.isOneContainer();
String url;
if (flag) {
String baseUrl = request.getRequestURL().toString();
url = baseUrl.substring(0, baseUrl.indexOf(ProjectEnum.PQS9000.getItem())) + ProjectEnum.PQS9000.getLoginOut();
} else {
url = appConfig.getSsoUrl() + "/loginout?item=pqs9000";
}
WebUtils.issueRedirect(request, response, url);
}
/**
* sso认证完成后访问子系统任然需要注册子系统包括当前用户在子系统下的权限
*/
@GetMapping("ssoRegister")
public void ssoRegister(HttpServletRequest request, HttpServletResponse response,String token) throws IOException {
//获取父容器的sessionID即token值
if (StringUtils.isBlank(token)) {
redirectSso(request, response);
} else {
//首先根据token去redis中查询有没有对应的session
Session session = userShiroSessionRepository.getSession(token);
//没有需要的共享会话,则重定向回登录中心
if (null == session) {
redirectSso(request, response);
} else {
//判断认证中心的会话是否被T被T子系统是不允许注册的返回认证中心登录页面
Boolean marker = (Boolean) session.getAttribute(KickoutSessionFilter.KICKOUT_STATUS);
if (null != marker && marker) {
redirectSso(request, response);
}
//获取session登录信息。
Object obj = session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
if (null == obj) {
//没有用户信息,则重定向回登录中心
redirectSso(request, response);
} else {
SimplePrincipalCollection spc = (SimplePrincipalCollection) obj;
obj = spc.getPrimaryPrincipal();
if (null == obj) {
//没有用户信息,则重定向回登录中心
redirectSso(request, response);
} else {
User ssoUser = (User) obj;
try {
TokenManager.login(ssoUser.getLoginName(),"",ssoUser.getPassword(),PubUtils.getIpAddr(request),ProjectEnum.PQS9000.getItem());
try {
userLoginService.insertLogin(ssoUser.getLoginName(), ProjectEnum.PQS9000.getItem());
} catch (Exception e) {
logger.error("用户登录成功后,保存记录出错。原因:" + e.toString());
}
saveSessionByUser(session,token, TokenManager.getUserId(), TokenManager.getSession().getId().toString());
userShiroSessionRepository.activeSession(session);
TokenManager.getSession().setAttribute(CookieKeyEnum.SSOLOGIN.getCookieKey(), token);
userUtil.saveRandomToken();
//认证成功重定向到业务主界面
WebUtils.issueRedirect(request, response, "/business/doBusiness");
} catch (Exception u) {
logger.error("子系统pqs9000注册时异常异常为" + response.toString());
}
}
}
}
}
}
/**
* 重定向到sso认证中心重新登录
*/
private void redirectSso(HttpServletRequest request, HttpServletResponse response) throws IOException {
boolean flag = appConfig.isOneContainer();
String url;
if (flag) {
String baseUrl = request.getRequestURL().toString();
url = baseUrl.substring(0, baseUrl.indexOf(ProjectEnum.PQS9000.getItem())) +ProjectEnum.SSO.getLoginUrl()+ProjectEnum.PQS9000.getItem() ;
} else {
url = appConfig.getSsoJudge();
}
WebUtils.issueRedirect(request, response, url);
}
/**
* 根据用户索引保存当前系统的sessionID以便注销系统时删除会话信息
*
* @param token 认证中心会话索引
* @param userId 用户索引
* @param sessionId 会话ID
*/
private void saveSessionByUser(Session session,String token, String userId, String sessionId) {
String key=token+userId;
List<String> infoMap= (List<String>) session.getAttribute(key);
//如果不存在,创建一个新的
infoMap = null == infoMap ? new ArrayList<>() : infoMap;
infoMap.add(JedisShiroSessionRepository.REDIS_SHIRO_SESSION + sessionId);
session.setAttribute(key,infoMap);
}
/**
* foundChrome
* 判断浏览器在本地是否存在
*
* @throws FileNotFoundException
*/
@RequestMapping(value = "foundChrome", method = RequestMethod.POST)
@ResponseBody
public HttpResult foundChrome(HttpServletResponse response, @Param(value = "res_Index") String res_Index) {
ManageList list = new ManageList();
list.setRes_Index(res_Index);
list.setState(1);
list.setSysType(appConfig.getSysType());
List<ManageList> manageLists = alm.select(list);
return PubUtils.foundChrome(manageLists);
}
/**
* downloadChrome
* 用户下载谷歌浏览器安装版
* 存在D盘配置文件配置源路径
*
* @throws FileNotFoundException
* @throws MalformedURLException
*/
@RequestMapping(value = "downloadChrome", method = RequestMethod.GET)
public void downloadChrome(HttpServletResponse response, @Param(value = "res_Index") String res_Index, HttpServletRequest request){
ManageList list = new ManageList();
list.setRes_Index(res_Index);
list.setState(1);
list.setSysType(appConfig.getSysType());
List<ManageList> manageLists = alm.select(list);
PubUtils.downloadChrome(response,manageLists);
}
/**
* 用户没有权限提示的页面
*/
@GetMapping(value = "unauthorized")
public String unauthorized() {
return "auth/unauthorized";
}
/************************
* RSA
* 根据用户名生成秘钥对
* @param username 用户名
*************************/
@PostMapping("generateRSAKey")
@ResponseBody
public HttpResult generateRSAKey(String username, HttpServletRequest request) {
HttpResult result;
try {
username = DesUtils.aesDecrypt(username);
// 获取公钥和私钥
HashMap<String, Object> keys = RSAUtils.getKeys();
RSAPublicKey publicKey = (RSAPublicKey) keys.get("public");
RSAPrivateKey privateKey = (RSAPrivateKey) keys.get("private");
String ip = StringUtils.isBlank(PubUtils.getIpAddr(request)) ? "127.0.0.1" : PubUtils.getIpAddr(request);
//秘钥先删除再添加
jedisManager.deleteByKey(RedisDB.SHORT_TIME_QUERY, SerializeUtil.serialize(username + ip));
// 保存私钥到 redis也可以保存到数据库
jedisManager.saveValueByKey(RedisDB.SHORT_TIME_QUERY, SerializeUtil.serialize(username + ip), SerializeUtil.serialize(privateKey), -1);
// 将公钥传到前端
Map<String, String> map = new HashMap<String, String>();
// 注意返回modulus和exponent以16为基数的BigInteger的字符串表示形式
map.put("modulus", publicKey.getModulus().toString(16));
map.put("exponent", publicKey.getPublicExponent().toString(16));
result = PubUtils.assignmentResult(map, 200, "生成秘钥对成功!");
} catch (Exception u) {
result = PubUtils.assignmentResult(null, 500, u.getMessage());
}
return result;
}
/************************
* SM2
* 根据用户名生成秘钥对
* @param username 用户名
*************************/
@PostMapping("generateSM2Key")
@ResponseBody
public HttpResult generateSM2Key(String username, HttpServletRequest request) {
HttpResult result;
try {
if (PubUtils.isBlank(username)) {
result = PubUtils.assignmentResult(null, 500, "用户名非法!");
return result;
}
username = DesUtils.aesDecrypt(username);
// 获取公钥和私钥
Map<String, String> keyMap =PubUtils.getSM2CipHer();
String publicKey = keyMap.get("publicKey"); //加密密钥
String privateKey = keyMap.get("privateKey"); //解密密钥
String ip = PubUtils.isBlank(PubUtils.getIpAddr(request)) ? "127.0.0.1" : PubUtils.getIpAddr(request);
//秘钥先删除再添加
jedisManager.deleteByKey(RedisDB.SHORT_TIME_QUERY, SerializeUtil.serialize(username + ip));
// 保存私钥到 redis也可以保存到数据库
jedisManager.saveValueByKey(RedisDB.SHORT_TIME_QUERY, SerializeUtil.serialize(username + ip), SerializeUtil.serialize(privateKey), -1);
// 将公钥传到前端
result = PubUtils.assignmentResult(publicKey, 200, "生成秘钥对成功!");
} catch (Exception u) {
result = PubUtils.assignmentResult(null, 500, u.getMessage());
}
return result;
}
/**
* 确认密码
*/
@PostMapping(value = "confirmPwd")
@ResponseBody
public HttpResult confirmPwd(String password, HttpServletRequest request,HttpServletResponse response) {
String ip = PubUtils.getIpAddr(request);
String username = TokenManager.getToken().getLoginName();
password = XssFilterUtil.dealString(password);
HttpResult result=PubUtils.initResult(TokenManager.getToken().getLoginName(),request, LogTypeEnum.SYSTEM.toString(),2);
try {
//密码处理
String privateKey = jedisManager.getValueByKey(RedisDB.SHORT_TIME_QUERY, username + ip);
//秘钥用完即删
jedisManager.deleteByKey(RedisDB.SHORT_TIME_QUERY, username + ip);
//对SM2解密面进行验证
password = PubUtils.getPasswordSM2Verify(privateKey, password);
if (password == null && password.length() == 0) {
return PubUtils.assignmentResultLog(null, 500, "密码传输完整性被破坏","密码确认","失败",result);
}
us.judgeUsernameAndPwd(username, password);
response.setStatus(203);
result = PubUtils.assignmentResultLog(null, 200, "密码正确","密码确认","成功",result);
//缓存验证结果
jedisManager.saveValueByKey(RedisDB.SHORT_TIME_QUERY, SerializeUtil.serialize(username + ip), SerializeUtil.serialize("success"), -1);
} catch (Exception e) {
if(e.getMessage().length()>12){
result = PubUtils.assignmentResultLog(null, 500, "密码确认异常","密码确认","失败",result);
}else{
result = PubUtils.assignmentResultLog(null, 500, e.getMessage(),"密码确认","失败",result);
}
//缓存验证结果
jedisManager.saveValueByKey(RedisDB.SHORT_TIME_QUERY, SerializeUtil.serialize(username + ip), SerializeUtil.serialize("fail"), -1);
}
return result;
}
/**
* 根据用户索引获取用户信息回显,以便修改
*
* @param userIndex 用户索引
*/
@ResponseBody
@PostMapping(value = "selectId")
public User selectId(String userIndex, int flag) {
return us.selectId(userIndex, flag);
}
//修改密码
@ResponseBody
@RequestMapping(value = "updatePassword", method = RequestMethod.POST)
public HttpResult updatePassword(HttpServletRequest request, @Param(value = "username") String username,
@Param(value = "passwordX") String passwordX,
String token) {
HttpResult result = new HttpResult();
// String sessionToken = (String) TokenManager.getSession().getAttribute("token");
// if (!token.equalsIgnoreCase(sessionToken)) {
// result = PubUtils.assignmentResult(null, 500, "非法访问");
// return result;
// }
//username = XssFilterUtil.dealString(username);
username = DesUtils.aesDecrypt(username);
passwordX = XssFilterUtil.dealString(passwordX);
String ip = StringUtils.isBlank(PubUtils.getIpAddr(request)) ? "127.0.0.1" : PubUtils.getIpAddr(request);
try {
//密码处理
String privateKey = jedisManager.getValueByKey(RedisDB.SHORT_TIME_QUERY, username + ip);
//秘钥用完即删
jedisManager.deleteByKey(RedisDB.SHORT_TIME_QUERY, username + ip);
//对SM2解密面进行验证
passwordX = PubUtils.getPasswordSM2Verify(privateKey, passwordX);
if (passwordX == null && passwordX.length() == 0) {
result = PubUtils.assignmentResult(null, 500, "密码传输完整性被破坏");
userLogservice.getLog("修改用户密码", "失败", PubUtils.getIpAddr(request), LogTypeEnum.SYSTEM.toString(), 1);
return result;
}
//增加判断密码是否包含用户名
if (passwordX.indexOf(username) > -1) {
userLogservice.getLog("修改用户密码", "失败", PubUtils.getIpAddr(request), LogTypeEnum.SYSTEM.toString(), 1);
return PubUtils.assignmentResult(null, 500, "用户密码包含登录名");
}
if (!(PubUtils.patternPassword(passwordX) || PubUtils.patternUsername(username))) {
userLogservice.getLog("修改用户密码", "失败", PubUtils.getIpAddr(request), LogTypeEnum.SYSTEM.toString(), 1);
result = PubUtils.assignmentResult(null, 500, "用户名、密码格式不正确");
return result;
}
try {
us.modifyPassword(username, passwordX);
userLogservice.getLog("修改用户密码", "成功", PubUtils.getIpAddr(request), LogTypeEnum.SYSTEM.toString(), 1);
result = PubUtils.assignmentResult(null, 200, "修改密码成功");
User user = new User();
user.setLoginName(username);
user = um.selectOne(user);
if (null != user) {
user.setState(1);
um.updateByPrimaryKeyBySql(user);
}
} catch (Exception e) {
userLogservice.getLog("修改用户密码", "失败", PubUtils.getIpAddr(request), LogTypeEnum.SYSTEM.toString(), 1);
result = PubUtils.assignmentResult(null, 500, e.getMessage());
logger.error("用户修改密码成功后,保存记录出错。原因:" + e.toString());
}
} catch (Exception e) {
logger.error("更新密码出错,异常为:" + e.toString());
String eMessage = e.getMessage();
if (eMessage.length() > 20) {
eMessage = "内部出错";
}
result = PubUtils.assignmentResult(null, 500, eMessage);
try {
userLogservice.getLog("修改用户密码", "失败", PubUtils.getIpAddr(request), LogTypeEnum.SYSTEM.toString(), 1);
} catch (Exception u) {
logger.error("用户修改密码失败后,保存记录出错。原因:" + u.toString());
}
}
return result;
}
}

View File

@@ -0,0 +1,16 @@
package com.pqs9000.exception;
/**
* @author hongawen
* @Date: 2019/4/11 14:40
* 自定义一个异常类,提供给用采数据解析过程中的异常信息收集
*/
public class UserDataException extends Exception {
public UserDataException() {
super();
}
public UserDataException(String msg) {
super(msg);
}
}

View File

@@ -0,0 +1,60 @@
package com.pqs9000.listener;
import java.io.InputStream;
import java.util.Properties;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import com.njcn.utils.Kafka.ZookeeperServerStatus;
import com.njcn.utils.PubUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.pqs9000.controller.area.AreaController;
import com.pqs9000.util.Kafka.JavaKafkaConsumer;
public class ContextListener implements ServletContextListener {
private JavaKafkaConsumer javaKafkaConsumer = null;
// 日志记录
private static final Logger logger = LoggerFactory.getLogger(AreaController.class);
@Override
public void contextInitialized(ServletContextEvent sce) {
/*try {
//读取配置文件
Properties pros = PubUtils.readProperties(getClass().getClassLoader(),"java.properties");
String zookeeper = pros.get("ZOOKEEPER").toString();
String groupId = pros.get("GROUPID").toString();
String topic = pros.get("TOPIC").toString();
String kafka_log = pros.get("KAFKA_LOG").toString();
//192.168.1.12:2181
String[] strArray=zookeeper.split(":");
if(strArray.length == 2){
String host =strArray[0];
int port =Integer.parseInt(strArray[1]);
ZookeeperServerStatus zookeeperServerStatus=new ZookeeperServerStatus();
String strModel = zookeeperServerStatus.serverStatus(host,port);
//不为空表示能获取到相对应的模式则启动Kafka监听
if(!strModel.equals("")){
int threads = 1;
javaKafkaConsumer = new JavaKafkaConsumer(topic, threads, zookeeper, groupId,kafka_log);
new Thread(javaKafkaConsumer).start();
}
}
} catch (Exception e) {
logger.error("Kafka启动失败,具体原因如下:" + e.getMessage());
}*/
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
if(javaKafkaConsumer !=null){
// 关闭
javaKafkaConsumer.shutdown();
}
}
}

View File

@@ -0,0 +1,23 @@
package com.pqs9000.mapper.common;
import com.pqs9000.pojo.common.HarmI;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
/**
* @Author denghuajun
* @Description //TODO 谐波电流幅值Mapper
* @Date 2018/11/28 15:19
**/
public interface HarmIMapper extends Mapper<HarmI> {
List<HarmI> getHarmI(@Param("lineId") long lineId, @Param("startTime") Date startTime, @Param("endTime") Date
endTime);
Float getoffHarmI(@Param("condition") Condition condition,@Param("number") int number);
}

View File

@@ -0,0 +1,17 @@
package com.pqs9000.mapper.common;
import com.pqs9000.pojo.common.Harmonic;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
public interface HarmonicMapper extends Mapper<Harmonic> {
List<Harmonic> getHarmonic(@Param("lineId") long lineId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
Float getoffHarmonic(@Param("condition") Condition condition,@Param("number") int number);
}

View File

@@ -0,0 +1,18 @@
package com.pqs9000.mapper.data;
import com.pqs9000.pojo.data.DataI;
import com.pqs9000.pojo.responsibility.Responsibility;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
/**
* @author hongawen
* @Date: 2019/3/28 16:04
*/
public interface DataIMapper extends Mapper<DataI> {
//根据监测点、时间、谐波次数查询数据
List<Responsibility> getHistoryData(@Param("lineIndex")Integer lineIndex, @Param("startTime")Date startTime, @Param("endTime")Date endTime, @Param("time")Integer time);
}

View File

@@ -0,0 +1,20 @@
package com.pqs9000.mapper.data;
import com.pqs9000.pojo.data.DataV;
import com.pqs9000.pojo.responsibility.Responsibility;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
/**
* @author hongawen
* @Date: 2019/3/28 16:01
*/
public interface DataVMapper extends Mapper<DataV> {
//根据监测点、时间、谐波次数查询数据
List<Responsibility> getHistoryData(@Param("lineIndex")Integer lineIndex, @Param("startTime")Date startTime, @Param("endTime")Date endTime, @Param("time")Integer time);
List<DataV> queryData(@Param("lineIndex")Integer lineIndex, @Param("startTime")String startTime, @Param("endTime")String endTime);
}

View File

@@ -0,0 +1,29 @@
package com.pqs9000.mapper.monitorMap;
import com.pqs9000.pojo.monitorMap.AreaMonitorBaseInfo;
import com.pqs9000.pojo.monitorMap.AreaSubLineVO;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* system
*
* @author cdf
* @date 2023/7/11
*/
public interface MonitorScopeMapper {
/**
* 获取部门下的监测点信息经纬度
*/
List<AreaSubLineVO> getMonitorScope(@Param("lineIds")List<Integer> lineIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
int getAreaLineEventCount(@Param("lineIds")List<Integer> lineIds);
int getEventCount(@Param("lineIds")List<Integer> lineIds,@Param("startTime")Date startTime, @Param("endTime")Date endTime);
}

View File

@@ -0,0 +1,68 @@
package com.pqs9000.mapper.report;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.njcn.pojo.commons.device.ExportDev;
import com.pqs9000.pojo.report.LimitRateCalDTO;
import com.pqs9000.pojo.report.LineBaseData;
import org.apache.ibatis.annotations.Param;
import com.njcn.pojo.configuration.RptData;
import com.pqs9000.pojo.report.FpyReportData;
public interface ExcelReportMapper {
List<RptData> getDatasByPloy(@Param("guid") String guid);
List<RptData> getDatas(@Param("sets") Set<String> sets);
FpyReportData integrityDataByIndex(@Param("lineIndex") Integer lineIndex,@Param("startTime")Date startTime,@Param("endTime") Date endTime);
/**
* 获取当前用户的所有台账信息
* @author cdf
* @date 2021/3/5
*/
List<ExportDev> getExportDev(@Param("list") List<Integer> list,@Param("sysType")String sysType);
/**
* 执行存储过程
* @author cdf
* @date 2021/5/18
*/
List<Map<String, String>> runProc(@Param("LineNo") Integer LineNo, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
/**
* 根据数据完整性表查询监测点的数据完整性
* @author cdf
* @date 2023/5/26
*/
List<LineBaseData> getIntegrityList(@Param("lineIds")List<Integer> lineIds, @Param("startTime")Date startTime, @Param("endTime")Date endTime);
/**
* 获取合格率详情limit_rate
* @author cdf
* @date 2023/5/26
*/
List<Map<String, BigDecimal>> getLimitRateData(@Param("lineIds")List<Integer> lineIds, @Param("startTime")Date startTime, @Param("endTime")Date endTime);
/**
* 获取合格率详情limit_rate针对谐波电流
* @author cdf
* @date 2023/5/26
*/
List<Map<String, BigDecimal>> getLimitRateDataIHarm(@Param("lineIds")List<Integer> lineIds, @Param("startTime")Date startTime, @Param("endTime")Date endTime);
/**
* 通过监测点id集合获取监测点信息以及上层基本信息
* @author cdf
* @date 2023/5/29
*/
List<FpyReportData> getLineBaseInfo(@Param("lineIds")List<Integer> lineIds);
}

View File

@@ -0,0 +1,15 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import com.pqs9000.pojo.report.ReportValue;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface GetDistortionDataMapper {
List<ReportValue> getDistortionDataV(@Param("condition") Condition condition);
List<ReportValue> getDistortionDataI(@Param("condition") Condition condition);
List<ReportValue> getHDistortionData(@Param("condition") Condition condition, @Param("str") String str);
}

View File

@@ -0,0 +1,17 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetFlickerDataMapper {
List<Map<String, Object>> getFlickerData(@Param("condition") Condition condition);
List<Map<String, Object>> getLFlickerData(@Param("condition") Condition condition);
List<Map<String, Object>> getLLFlickerData(@Param("condition") Condition condition);
List<Map<String, Object>> getPFlickerData(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,12 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetFpyMapper {
//flag标识查询方式
List<Map<String, Object>> getFpy(@Param("condition") Condition condition, @Param("list") List<Integer> list, @Param("flag") int flag);
}

View File

@@ -0,0 +1,13 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetFrequencyDataMapper {
List<Map<String, Object>> getFrequencyData(@Param("condition") Condition condition);
List<Map<String, Object>> getHFrequencyData(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,25 @@
package com.pqs9000.mapper.report;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.pqs9000.pojo.report.Condition;
import com.pqs9000.pojo.report.ReportValue;
public interface GetICurrentMapper {
List<Map<String, Object>> getICurrent(@Param("condition") Condition condition, @Param("listValue") List<Integer> list);
List<Map<String, Object>> getHICurrent(@Param("condition") Condition condition);
ReportValue VsideValue(@Param("condition") Condition condition);
ReportValue InsideValue(@Param("condition") Condition condition);
ReportValue PsideValue(@Param("condition") Condition condition);
ReportValue QsideValue(@Param("condition") Condition condition);
List<Map<String, Object>> getIMaxLimit(@Param("condition") Condition condition, @Param("number")List<String> number);
}

View File

@@ -0,0 +1,11 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetInHarmMapper {
List<Map<String, Object>> getHInharm(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,11 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetInICurrentMapper {
List<Map<String, Object>> getICurrent(@Param("condition") Condition condition, @Param("listValue") List<Integer> list);
}

View File

@@ -0,0 +1,14 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import com.pqs9000.pojo.report.ReportValue;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetInVoltageRateMapper {
List<Map<String, Object>> getInVoltageRate(@Param("condition") Condition condition, @Param("listValue") List<Integer> list);
List<ReportValue> getInFirstHarmonic(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,18 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import com.pqs9000.pojo.report.IntegrityDetailVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetInegDataMapper {
List<Map<String, Object>> getInegData(@Param("condition") Condition condition);
/**
* 按月份统计数据完整性
*/
IntegrityDetailVo getDataByMonth(@Param("month") String month, @Param("lineId") String lineId, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

View File

@@ -0,0 +1,14 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import com.pqs9000.pojo.report.ReportValue;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface GetPowerDataMapper {
List<ReportValue> getPowerP(@Param("condition") Condition condition);
List<ReportValue> getPowerQ(@Param("condition") Condition condition);
List<ReportValue> getPowerS(@Param("condition") Condition condition);
List<ReportValue> getPF(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,15 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetThreephaseDataMapper {
List<Map<String, Object>> getThreephaseV(@Param("condition") Condition condition);
List<Map<String, Object>> getThreephaseI(@Param("condition") Condition condition);
List<Map<String, Object>> getHThreephase(@Param("condition") Condition condition, @Param("str") String str);
}

View File

@@ -0,0 +1,13 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetVdeviationDataMapper {
List<Map<String, Object>> getVdeviationData(@Param("condition") Condition condition);
List<Map<String, Object>> getHVdeviationData(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,34 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import com.pqs9000.pojo.report.ReportValue;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @Author: Sunwei 【sunW2016@163.com】
* @Description:
* @Date: Create in 10:46 2018/6/7
* @Modified By:
*/
public interface GetVirtualDataMapper {
Integer getTotalCP95Data(@Param("condition") Condition condition);
Integer getTotalCP95Day(@Param("condition") Condition condition);
Integer getTotalPltCP95Data(@Param("condition") Condition condition);
Integer getTotalPltCP95Day(@Param("condition") Condition condition);
Integer getTotalPstCP95Data(@Param("condition") Condition condition);
Integer getTotalPstCP95Day(@Param("condition") Condition condition);
List<ReportValue> getVirtualDataV(@Param("condition") Condition condition);
List<ReportValue> getVirtualDataI(@Param("condition") Condition condition);
Map<String, Object> getVVirtualData(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,11 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import com.pqs9000.pojo.report.ReportValue;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface GetVoltageMapper {
List<ReportValue> getVoltageData(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,16 @@
package com.pqs9000.mapper.report;
import com.pqs9000.pojo.report.Condition;
import com.pqs9000.pojo.report.ReportValue;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface GetVoltageRateMapper {
List<Map<String, Object>> getVoltageRate(@Param("condition") Condition condition, @Param("listValue") List<Integer> list);
List<ReportValue> getFirstHarmonic(@Param("condition") Condition condition);
List<Map<String, Object>> getHVoltageRate(@Param("condition") Condition condition);
}

View File

@@ -0,0 +1,61 @@
package com.pqs9000.mapper.responsibility;
import com.pqs9000.pojo.responsibility.AreaOverNoraml;
import com.pqs9000.pojo.responsibility.OverLimitByDays;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface AreaOverNormalMapper {
List<Integer> getCountryMonitor(@Param("list") List<Integer> list);
AreaOverNoraml getInfo(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 每天获取当前在线监测点数、超标监测点数、超标次数
*/
//频率偏差超标
List<OverLimitByDays> getFrequency(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
//电压偏差超标
List<OverLimitByDays> getVoltage(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
//谐波电压偏差超标
List<OverLimitByDays> getHarmonicVoltage(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
//谐波电流超标
List<OverLimitByDays> getHarmonicCurrent(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
//三相电压不平衡度超标
List<OverLimitByDays> getThreePhaseVoltage(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
//闪变超标
List<OverLimitByDays> getFlicker(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
//负序电流
List<OverLimitByDays> getNegative(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
//间谐波电压
List<OverLimitByDays> getInterharmonic(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
//获取所有监测点的干扰源类型终
List<Map<String,String>> getTypeList(@Param("list") List<Integer> list);
//根据干扰源类型终区分监测点
List<Integer> getMonitorByType(@Param("list") List<Integer> list,@Param("type")String type);
//获取所有监测点的电压等级
List<Map<String,String>> getVolList(@Param("list") List<Integer> list);
//根据电压等级区分监测点
List<Integer> getMonitorByVol(@Param("list") List<Integer> list,@Param("type")String vol);
/**
* 获取区域下**指标日均超标占比
*/
AreaOverNoraml getAvg(@Param("list") List<Integer> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
}

View File

@@ -0,0 +1,17 @@
package com.pqs9000.mapper.responsibility;
import com.pqs9000.pojo.data.DataHarmonicDetail;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface DataHarmonicDetailMapper extends Mapper<DataHarmonicDetail> {
int deleteData(@Param("startTime")String startTime,@Param("endTime")String endTime);
int insertData(@Param("list")List<DataHarmonicDetail> list);
List<DataHarmonicDetail> selectMaxData(@Param("startTime")String startTime, @Param("endTime")String endTime, @Param("list")List<Integer> list);
}

View File

@@ -0,0 +1,74 @@
package com.pqs9000.mapper.responsibility;
import com.pqs9000.pojo.responsibility.OverLimitMonitor;
import com.pqs9000.pojo.responsibility.TargetDetailDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface OverLimitMonitorMapper {
List<OverLimitMonitor> getOverLimitMonitorList(@Param("list") List<Integer> list,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("vollevel") String vollevel);
/**
* 获取需要计算的监测点集合
*/
List<String> getLineList(@Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 电压偏差、电压总谐波畸变率、三相电压不平衡度、频率偏差 幅值&&限值&&差值
*/
List<TargetDetailDto> getData1(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("list") List<String> lineList);
/**
* 负序电流 幅值&&限值&&差值
*/
List<TargetDetailDto> getData2(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("list") List<String> lineList);
/**
* 负序电流 幅值&&限值&&差值
*/
List<TargetDetailDto> getData3(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("list") List<String> lineList);
/**
* 谐波电流各个数据占比
*/
List<TargetDetailDto> getData4(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("list") List<String> lineList);
/**
* 谐波电压各个数据占比
*/
List<TargetDetailDto> getData5(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("list") List<String> lineList);
/**
* 谐波电压含有率各个数据占比
*/
List<TargetDetailDto> getData6(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("list") List<String> lineList);
/**
* 间谐波电压各个数据占比
*/
List<TargetDetailDto> getData7(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("list") List<String> lineList);
/**
* 谐波电流
*/
TargetDetailDto getHarmonicData1(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("lineId") Integer lineId, @Param("time") Integer time);
/**
* 谐波电压 - 电压总谐波畸变率
*/
TargetDetailDto getHarmonicData2(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("lineId") Integer lineId, @Param("time") Integer time);
/**
* 谐波电压 - 电压含有率
*/
TargetDetailDto getHarmonicData3(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("lineId") Integer lineId, @Param("time") Integer time);
/**
* 间谐波电压 - 电压含有率
*/
TargetDetailDto getHarmonicData4(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("lineId") Integer lineId, @Param("time") Integer time);
}

View File

@@ -0,0 +1,29 @@
package com.pqs9000.mapper.responsibility;
import com.njcn.pojo.responsibility.ResponsibilityData;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
/**
* @author hongawen
* @Date: 2019/5/5 14:14
*/
public interface ResponsibilityDataMapper extends Mapper<ResponsibilityData> {
//获取计算时间范围内的谐波责任数据
List<ResponsibilityData> responsibilityDataList(@Param("startTime")Date startTime, @Param("endTime")Date endTime);
//根据监测点名称、用采表名、时间窗口查询责任列表
List<ResponsibilityData> selectData(@Param("lineName")String lineName, @Param("excelName")String excelName, @Param("timeWin")String timeWin,@Param("type")String type);
//根据索引删除记录
void deleteByResIndex(String resIndex);
//获取电压限值
Float getLimitU(@Param("lineIndex")Integer lineIndex, @Param("time")Integer time);
//获取电流限值
Float getLimitI(@Param("lineIndex")Integer lineIndex, @Param("time")Integer time);
}

View File

@@ -0,0 +1,20 @@
package com.pqs9000.mapper.responsibility;
import com.pqs9000.pojo.responsibility.UserExcelData;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
/**
* @author hongawen
* @Date: 2019/4/19 13:37
*/
public interface UserExcelDataMapper extends Mapper<UserExcelData> {
//根据条件查询是否已经加载过用采数据
UserExcelData selectUserExcelData(@Param("excelName")String excelName, @Param("startTime")Date startTime, @Param("endTime")Date endTime);
//根据索引删除之前的数据库记录
void deleteByIndex(String userDataIndex);
}

View File

@@ -0,0 +1,21 @@
package com.pqs9000.mapper.responsibility;
import com.pqs9000.pojo.responsibility.UserExcelDataNoIntegrity;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* @author hongawen
* @Date: 2019/4/24 10:30
*/
public interface UserExcelDataNoIntegrityMapper extends Mapper<UserExcelDataNoIntegrity> {
//批量插入所有的数据
void insertAll(List<UserExcelDataNoIntegrity> list);
//根据用采数据列表索引删除所有完整性不足记录
void deleteByExcelIndex(String excelIndex);
//根据用采索引,获取其所有的完整性不足的信息
List<UserExcelDataNoIntegrity> getUserExcelDataNoIntergritys(String excelIndex);
}

View File

@@ -0,0 +1,14 @@
package com.pqs9000.mapper.responsibility;
import com.pqs9000.pojo.responsibility.WarningSubstation;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface WarningSubstationMapper {
//获取具体告警参数
List<WarningSubstation> getEachIndex(@Param("list") List<Integer> monitorList, @Param("startTime")String startTime, @Param("endTime")String endTime,@Param("level") String level);
}

View File

@@ -0,0 +1,61 @@
package com.pqs9000.pojo.common;
import java.io.Serializable;
/**
* @author hongawen
* @version 1.0
* @Date 2018/6/12 15:56
*/
public class AreaPowerQualityData implements Serializable {
private String name;
private float data;
private String level;
private Integer monitor;
public Integer getMonitor() {
return monitor;
}
public void setMonitor(Integer monitor) {
this.monitor = monitor;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public float getData() {
return data;
}
public void setData(float data) {
this.data = data;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
@Override
public String toString() {
return "AreaPowerQualityData{" +
"name='" + name + '\'' +
", data=" + data +
", level='" + level + '\'' +
", monitor=" + monitor +
'}';
}
}

View File

@@ -0,0 +1,452 @@
package com.pqs9000.pojo.common;
import java.io.Serializable;
/** @Author denghuajun
* @Description //TODO 谐波电流幅值
* @Date 2018/11/28 15:12
**/
public class HarmI implements Serializable {
private float i2;//2次谐波电流幅值
private float i3;//3次谐波电流幅值
private float i4;//4次谐波电流幅值
private float i5;//5次谐波电流幅值
private float i6;//6次谐波电流幅值
private float i7;//7次谐波电流幅值
private float i8;//8次谐波电流幅值
private float i9;//9次谐波电流幅值
private float i10;//10次谐波电流幅值
private float i11;//11次谐波电流幅值
private float i12;//12次谐波电流幅值
private float i13;//13次谐波电流幅值
private float i14;//14次谐波电流幅值
private float i15;//15次谐波电流幅值
private float i16;//16次谐波电流幅值
private float i17;//17次谐波电流幅值
private float i18;//18次谐波电流幅值
private float i19;//19次谐波电流幅值
private float i20;//20次谐波电流幅值
private float i21;//21次谐波电流幅值
private float i22;//22次谐波电流幅值
private float i23;//23次谐波电流幅值
private float i24;//24次谐波电流幅值
private float i25;//25次谐波电流幅值
private float i26;//26次谐波电流幅值
private float i27;//27次谐波电流幅值
private float i28;//28次谐波电流幅值
private float i29;//29次谐波电流幅值
private float i30;//30次谐波电流幅值
private float i31;//31次谐波电流幅值
private float i32;//32次谐波电流幅值
private float i33;//33次谐波电流幅值
private float i34;//34次谐波电流幅值
public float getI2() {
return i2;
}
public void setI2(float i2) {
this.i2 = i2;
}
public float getI3() {
return i3;
}
public void setI3(float i3) {
this.i3 = i3;
}
public float getI4() {
return i4;
}
public void setI4(float i4) {
this.i4 = i4;
}
public float getI5() {
return i5;
}
public void setI5(float i5) {
this.i5 = i5;
}
public float getI6() {
return i6;
}
public void setI6(float i6) {
this.i6 = i6;
}
public float getI7() {
return i7;
}
public void setI7(float i7) {
this.i7 = i7;
}
public float getI8() {
return i8;
}
public void setI8(float i8) {
this.i8 = i8;
}
public float getI9() {
return i9;
}
public void setI9(float i9) {
this.i9 = i9;
}
public float getI10() {
return i10;
}
public void setI10(float i10) {
this.i10 = i10;
}
public float getI11() {
return i11;
}
public void setI11(float i11) {
this.i11 = i11;
}
public float getI12() {
return i12;
}
public void setI12(float i12) {
this.i12 = i12;
}
public float getI13() {
return i13;
}
public void setI13(float i13) {
this.i13 = i13;
}
public float getI14() {
return i14;
}
public void setI14(float i14) {
this.i14 = i14;
}
public float getI15() {
return i15;
}
public void setI15(float i15) {
this.i15 = i15;
}
public float getI16() {
return i16;
}
public void setI16(float i16) {
this.i16 = i16;
}
public float getI17() {
return i17;
}
public void setI17(float i17) {
this.i17 = i17;
}
public float getI18() {
return i18;
}
public void setI18(float i18) {
this.i18 = i18;
}
public float getI19() {
return i19;
}
public void setI19(float i19) {
this.i19 = i19;
}
public float getI20() {
return i20;
}
public void setI20(float i20) {
this.i20 = i20;
}
public float getI21() {
return i21;
}
public void setI21(float i21) {
this.i21 = i21;
}
public float getI22() {
return i22;
}
public void setI22(float i22) {
this.i22 = i22;
}
public float getI23() {
return i23;
}
public void setI23(float i23) {
this.i23 = i23;
}
public float getI24() {
return i24;
}
public void setI24(float i24) {
this.i24 = i24;
}
public float getI25() {
return i25;
}
public void setI25(float i25) {
this.i25 = i25;
}
public float getI26() {
return i26;
}
public void setI26(float i26) {
this.i26 = i26;
}
public float getI27() {
return i27;
}
public void setI27(float i27) {
this.i27 = i27;
}
public float getI28() {
return i28;
}
public void setI28(float i28) {
this.i28 = i28;
}
public float getI29() {
return i29;
}
public void setI29(float i29) {
this.i29 = i29;
}
public float getI30() {
return i30;
}
public void setI30(float i30) {
this.i30 = i30;
}
public float getI31() {
return i31;
}
public void setI31(float i31) {
this.i31 = i31;
}
public float getI32() {
return i32;
}
public void setI32(float i32) {
this.i32 = i32;
}
public float getI33() {
return i33;
}
public void setI33(float i33) {
this.i33 = i33;
}
public float getI34() {
return i34;
}
public void setI34(float i34) {
this.i34 = i34;
}
public float getI35() {
return i35;
}
public void setI35(float i35) {
this.i35 = i35;
}
public float getI36() {
return i36;
}
public void setI36(float i36) {
this.i36 = i36;
}
public float getI37() {
return i37;
}
public void setI37(float i37) {
this.i37 = i37;
}
public float getI38() {
return i38;
}
public void setI38(float i38) {
this.i38 = i38;
}
public float getI39() {
return i39;
}
public void setI39(float i39) {
this.i39 = i39;
}
public float getI40() {
return i40;
}
public void setI40(float i40) {
this.i40 = i40;
}
public float getI41() {
return i41;
}
public void setI41(float i41) {
this.i41 = i41;
}
public float getI42() {
return i42;
}
public void setI42(float i42) {
this.i42 = i42;
}
public float getI43() {
return i43;
}
public void setI43(float i43) {
this.i43 = i43;
}
public float getI44() {
return i44;
}
public void setI44(float i44) {
this.i44 = i44;
}
public float getI45() {
return i45;
}
public void setI45(float i45) {
this.i45 = i45;
}
public float getI46() {
return i46;
}
public void setI46(float i46) {
this.i46 = i46;
}
public float getI47() {
return i47;
}
public void setI47(float i47) {
this.i47 = i47;
}
public float getI48() {
return i48;
}
public void setI48(float i48) {
this.i48 = i48;
}
public float getI49() {
return i49;
}
public void setI49(float i49) {
this.i49 = i49;
}
public float getI50() {
return i50;
}
public void setI50(float i50) {
this.i50 = i50;
}
private float i35;//35次谐波电流幅值
private float i36;//36次谐波电流幅值
private float i37;//37次谐波电流幅值
private float i38;//38次谐波电流幅值
private float i39;//39次谐波电流幅值
private float i40;//40次谐波电流幅值
private float i41;//41次谐波电流幅值
private float i42;//42次谐波电流幅值
private float i43;//43次谐波电流幅值
private float i44;//44次谐波电流幅值
private float i45;//45次谐波电流幅值
private float i46;//46次谐波电流幅值
private float i47;//47次谐波电流幅值
private float i48;//48次谐波电流幅值
private float i49;//49次谐波电流幅值
private float i50;//49次谐波电流幅值
}

View File

@@ -0,0 +1,452 @@
package com.pqs9000.pojo.common;
import java.io.Serializable;
/**
* @author denghuajun
* @version 1.0
* @Date 2018/6/25 15:35
*/
public class Harmonic implements Serializable {
private float v2;//2次谐波含有率
private float v3;//3次谐波含有率
private float v4;//4次谐波含有率
private float v5;//5次谐波含有率
private float v6;//6次谐波含有率
private float v7;//7次谐波含有率
private float v8;//8次谐波含有率
private float v9;//9次谐波含有率
private float v10;//10次谐波含有率
private float v11;//11次谐波含有率
private float v12;//12次谐波含有率
private float v13;//13次谐波含有率
private float v14;//14次谐波含有率
private float v15;//15次谐波含有率
private float v16;//16次谐波含有率
private float v17;//17次谐波含有率
private float v18;//18次谐波含有率
private float v19;//19次谐波含有率
private float v20;//20次谐波含有率
private float v21;//21次谐波含有率
private float v22;//22次谐波含有率
private float v23;//23次谐波含有率
private float v24;//24次谐波含有率
private float v25;//25次谐波含有率
private float v26;//26次谐波含有率
private float v27;//27次谐波含有率
private float v28;//28次谐波含有率
private float v29;//29次谐波含有率
private float v30;//30次谐波含有率
private float v31;//31次谐波含有率
private float v32;//32次谐波含有率
private float v33;//33次谐波含有率
private float v34;//34次谐波含有率
private float v35;//35次谐波含有率
private float v36;//36次谐波含有率
private float v37;//37次谐波含有率
private float v38;//38次谐波含有率
private float v39;//39次谐波含有率
private float v40;//40次谐波含有率
private float v41;//41次谐波含有率
private float v42;//42次谐波含有率
private float v43;//43次谐波含有率
private float v44;//44次谐波含有率
private float v45;//45次谐波含有率
private float v46;//46次谐波含有率
private float v47;//47次谐波含有率
private float v48;//48次谐波含有率
private float v49;//49次谐波含有率
private float v50;//49次谐波含有率
public float getV2() {
return v2;
}
public void setV2(float v2) {
this.v2 = v2;
}
public float getV3() {
return v3;
}
public void setV3(float v3) {
this.v3 = v3;
}
public float getV4() {
return v4;
}
public void setV4(float v4) {
this.v4 = v4;
}
public float getV5() {
return v5;
}
public void setV5(float v5) {
this.v5 = v5;
}
public float getV6() {
return v6;
}
public void setV6(float v6) {
this.v6 = v6;
}
public float getV7() {
return v7;
}
public void setV7(float v7) {
this.v7 = v7;
}
public float getV8() {
return v8;
}
public void setV8(float v8) {
this.v8 = v8;
}
public float getV9() {
return v9;
}
public void setV9(float v9) {
this.v9 = v9;
}
public float getV10() {
return v10;
}
public void setV10(float v10) {
this.v10 = v10;
}
public float getV11() {
return v11;
}
public void setV11(float v11) {
this.v11 = v11;
}
public float getV12() {
return v12;
}
public void setV12(float v12) {
this.v12 = v12;
}
public float getV13() {
return v13;
}
public void setV13(float v13) {
this.v13 = v13;
}
public float getV14() {
return v14;
}
public void setV14(float v14) {
this.v14 = v14;
}
public float getV15() {
return v15;
}
public void setV15(float v15) {
this.v15 = v15;
}
public float getV16() {
return v16;
}
public void setV16(float v16) {
this.v16 = v16;
}
public float getV17() {
return v17;
}
public void setV17(float v17) {
this.v17 = v17;
}
public float getV18() {
return v18;
}
public void setV18(float v18) {
this.v18 = v18;
}
public float getV19() {
return v19;
}
public void setV19(float v19) {
this.v19 = v19;
}
public float getV20() {
return v20;
}
public void setV20(float v20) {
this.v20 = v20;
}
public float getV21() {
return v21;
}
public void setV21(float v21) {
this.v21 = v21;
}
public float getV22() {
return v22;
}
public void setV22(float v22) {
this.v22 = v22;
}
public float getV23() {
return v23;
}
public void setV23(float v23) {
this.v23 = v23;
}
public float getV24() {
return v24;
}
public void setV24(float v24) {
this.v24 = v24;
}
public float getV25() {
return v25;
}
public void setV25(float v25) {
this.v25 = v25;
}
public float getV26() {
return v26;
}
public void setV26(float v26) {
this.v26 = v26;
}
public float getV27() {
return v27;
}
public void setV27(float v27) {
this.v27 = v27;
}
public float getV28() {
return v28;
}
public void setV28(float v28) {
this.v28 = v28;
}
public float getV29() {
return v29;
}
public void setV29(float v29) {
this.v29 = v29;
}
public float getV30() {
return v30;
}
public void setV30(float v30) {
this.v30 = v30;
}
public float getV31() {
return v31;
}
public void setV31(float v31) {
this.v31 = v31;
}
public float getV32() {
return v32;
}
public void setV32(float v32) {
this.v32 = v32;
}
public float getV33() {
return v33;
}
public void setV33(float v33) {
this.v33 = v33;
}
public float getV34() {
return v34;
}
public void setV34(float v34) {
this.v34 = v34;
}
public float getV35() {
return v35;
}
public void setV35(float v35) {
this.v35 = v35;
}
public float getV36() {
return v36;
}
public void setV36(float v36) {
this.v36 = v36;
}
public float getV37() {
return v37;
}
public void setV37(float v37) {
this.v37 = v37;
}
public float getV38() {
return v38;
}
public void setV38(float v38) {
this.v38 = v38;
}
public float getV39() {
return v39;
}
public void setV39(float v39) {
this.v39 = v39;
}
public float getV40() {
return v40;
}
public void setV40(float v40) {
this.v40 = v40;
}
public float getV41() {
return v41;
}
public void setV41(float v41) {
this.v41 = v41;
}
public float getV42() {
return v42;
}
public void setV42(float v42) {
this.v42 = v42;
}
public float getV43() {
return v43;
}
public void setV43(float v43) {
this.v43 = v43;
}
public float getV44() {
return v44;
}
public void setV44(float v44) {
this.v44 = v44;
}
public float getV45() {
return v45;
}
public void setV45(float v45) {
this.v45 = v45;
}
public float getV46() {
return v46;
}
public void setV46(float v46) {
this.v46 = v46;
}
public float getV47() {
return v47;
}
public void setV47(float v47) {
this.v47 = v47;
}
public float getV48() {
return v48;
}
public void setV48(float v48) {
this.v48 = v48;
}
public float getV49() {
return v49;
}
public void setV49(float v49) {
this.v49 = v49;
}
public float getV50() {
return v50;
}
public void setV50(float v50) {
this.v50 = v50;
}
}

View File

@@ -0,0 +1,58 @@
package com.pqs9000.pojo.common;
import java.io.File;
import java.io.Serializable;
public class ModelData implements Serializable{
private String startTime;
private String endTime;
private String lineIndex;
private File file;
private String name;
private String reportNumber;
private String crmName;
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getLineIndex() {
return lineIndex;
}
public void setLineIndex(String lineIndex) {
this.lineIndex = lineIndex;
}
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getReportNumber() {
return reportNumber;
}
public void setReportNumber(String reportNumber) {
this.reportNumber = reportNumber;
}
public String getCrmName() {
return crmName;
}
public void setCrmName(String crmName) {
this.crmName = crmName;
}
}

View File

@@ -0,0 +1,60 @@
package com.pqs9000.pojo.common;
import com.njcn.pojo.commons.acceptability.AcceptabilityData;
import com.njcn.pojo.commons.device.DeviceGeneral;
import java.io.Serializable;
/**
* @author hongawen
* @version 1.0
* @Date 2018/6/11 15:33
*/
public class OverviewData implements Serializable{
DeviceGeneral deviceData ;
DeviceGeneral onlineData ;
DeviceGeneral integralityData ;
AcceptabilityData acceptabilityData;
public DeviceGeneral getDeviceData() {
return deviceData;
}
public void setDeviceData(DeviceGeneral deviceData) {
this.deviceData = deviceData;
}
public DeviceGeneral getOnlineData() {
return onlineData;
}
public void setOnlineData(DeviceGeneral onlineData) {
this.onlineData = onlineData;
}
public DeviceGeneral getIntegralityData() {
return integralityData;
}
public void setIntegralityData(DeviceGeneral integralityData) {
this.integralityData = integralityData;
}
public AcceptabilityData getAcceptabilityData() {
return acceptabilityData;
}
public void setAcceptabilityData(AcceptabilityData acceptabilityData) {
this.acceptabilityData = acceptabilityData;
}
@Override
public String toString() {
return "OverviewData{" +
"deviceData=" + deviceData +
", onlineData=" + onlineData +
", integralityData=" + integralityData +
", acceptabilityData=" + acceptabilityData +
'}';
}
}

View File

@@ -0,0 +1,88 @@
package com.pqs9000.pojo.common;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @author hongawen
* @version 1.0
* @Date 2018/6/13 14:49
*/
public class PowerQualityData implements Serializable{
List<AreaPowerQualityData> syn=new ArrayList<>();
List<AreaPowerQualityData> synData=new ArrayList<>();
List<AreaPowerQualityData> vuDevs=new ArrayList<>();
List<AreaPowerQualityData> freqDev=new ArrayList<>();
List<AreaPowerQualityData> dataPlt=new ArrayList<>();
List<AreaPowerQualityData> vunbalanceCp95=new ArrayList<>();
List<AreaPowerQualityData> vThdCp95=new ArrayList<>();
public List<AreaPowerQualityData> getSyn() {
return syn;
}
public void setSyn(List<AreaPowerQualityData> syn) {
this.syn = syn;
}
public List<AreaPowerQualityData> getSynData() {
return synData;
}
public void setSynData(List<AreaPowerQualityData> synData) {
this.synData = synData;
}
public List<AreaPowerQualityData> getVuDevs() {
return vuDevs;
}
public void setVuDevs(List<AreaPowerQualityData> vuDevs) {
this.vuDevs = vuDevs;
}
public List<AreaPowerQualityData> getFreqDev() {
return freqDev;
}
public void setFreqDev(List<AreaPowerQualityData> freqDev) {
this.freqDev = freqDev;
}
public List<AreaPowerQualityData> getDataPlt() {
return dataPlt;
}
public void setDataPlt(List<AreaPowerQualityData> dataPlt) {
this.dataPlt = dataPlt;
}
public List<AreaPowerQualityData> getVunbalanceCp95() {
return vunbalanceCp95;
}
public void setVunbalanceCp95(List<AreaPowerQualityData> vunbalanceCp95) {
this.vunbalanceCp95 = vunbalanceCp95;
}
public List<AreaPowerQualityData> getvThdCp95() {
return vThdCp95;
}
public void setvThdCp95(List<AreaPowerQualityData> vThdCp95) {
this.vThdCp95 = vThdCp95;
}
@Override
public String toString() {
return "PowerQualityData{" +
"synData=" + synData +
", vuDevs=" + vuDevs +
", freqDev=" + freqDev +
", dataPlt=" + dataPlt +
", vunbalanceCp95=" + vunbalanceCp95 +
", vThdCp95=" + vThdCp95 +
'}';
}
}

View File

@@ -0,0 +1,48 @@
package com.pqs9000.pojo.common;
/**
* @author xuyang
* @date 2020/11/10 9:43
*/
public class Sub {
private int subIndex;
private String subName;
private String scale;
public int getSubIndex() {
return subIndex;
}
public void setSubIndex(int subIndex) {
this.subIndex = subIndex;
}
public String getSubName() {
return subName;
}
public void setSubName(String subName) {
this.subName = subName;
}
public String getScale() {
return scale;
}
public void setScale(String scale) {
this.scale = scale;
}
@Override
public String toString() {
return "Substation{" +
"subIndex=" + subIndex +
", subName='" + subName + '\'' +
", scale='" + scale + '\'' +
'}';
}
}

View File

@@ -0,0 +1,52 @@
package com.pqs9000.pojo.common;
/*********************************************************
* 存放数据规律0-49 Max; 50-99 Min; 100-149 Average 150-199 CP95
********************************************************/
public class ValueOfCurrent {
private String[] name = new String[3];
private String[] currentA = new String[200];
private String[] currentB = new String[200];
private String[] currentC = new String[200];
private String[] limit = new String[25];
public String[] getName() {
return name;
}
public void setName(String[] name) {
this.name = name;
}
public String[] getCurrentA() {
return currentA;
}
public String[] getLimit() {
return limit;
}
public void setLimit(String[] limit) {
this.limit = limit;
}
public void setCurrentA(String[] currentA) {
this.currentA = currentA;
}
public String[] getCurrentB() {
return currentB;
}
public void setCurrentB(String[] currentB) {
this.currentB = currentB;
}
public String[] getCurrentC() {
return currentC;
}
public void setCurrentC(String[] currentC) {
this.currentC = currentC;
}
}

View File

@@ -0,0 +1,137 @@
package com.pqs9000.pojo.data;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 当根据动态责任数据获取用户责任量化结果时,将需要的一些参数进行缓存
* 比如 harmNum,pNode,HKData,FKData,HarmData,监测点的测量间隔,win窗口最小公倍数
* 以及FKData每个时间点的p对应的用户List<name>
*
* @author hongawen
* @Date: 2019/4/29 16:06
*/
public class CacheQvvrData implements Serializable {
private int pNode;
private int harmNum;
private float[] harmData;
private PDataStruct[] FKdata; //不包含背景动态谐波责任数据序列,可作为输入或者输出
private HKDataStruct[] HKdata;
private List<String> names;
private int lineInterval;
private int win;
//最小公倍数
private int minMultiple;
//横轴时间
private List<Long> times;
public int getpNode() {
return pNode;
}
public void setpNode(int pNode) {
this.pNode = pNode;
}
public int getHarmNum() {
return harmNum;
}
public void setHarmNum(int harmNum) {
this.harmNum = harmNum;
}
public float[] getHarmData() {
return harmData;
}
public void setHarmData(float[] harmData) {
this.harmData = harmData;
}
public PDataStruct[] getFKdata() {
return FKdata;
}
public void setFKdata(PDataStruct[] FKdata) {
this.FKdata = FKdata;
}
public HKDataStruct[] getHKdata() {
return HKdata;
}
public void setHKdata(HKDataStruct[] HKdata) {
this.HKdata = HKdata;
}
public List<String> getNames() {
return names;
}
public void setNames(List<String> names) {
this.names = names;
}
public int getLineInterval() {
return lineInterval;
}
public void setLineInterval(int lineInterval) {
this.lineInterval = lineInterval;
}
public List<Long> getTimes() {
return times;
}
public void setTimes(List<Long> times) {
this.times = times;
}
public int getWin() {
return win;
}
public void setWin(int win) {
this.win = win;
}
public int getMinMultiple() {
return minMultiple;
}
public void setMinMultiple(int minMultiple) {
this.minMultiple = minMultiple;
}
@Override
public String toString() {
return "CacheQvvrData{" +
"pNode=" + pNode +
", harmNum=" + harmNum +
", harmData=" + Arrays.toString(harmData) +
", FKdata=" + Arrays.toString(FKdata) +
", HKdata=" + Arrays.toString(HKdata) +
", names=" + names +
", lineInterval=" + lineInterval +
", win=" + win +
", minMultiple=" + minMultiple +
", times=" + times +
'}';
}
}

View File

@@ -0,0 +1,87 @@
package com.pqs9000.pojo.data;
import javax.persistence.Table;
import java.util.Date;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2024/3/21 16:47
*/
@Table(name = "DATA_HARMONIC_DETAIL")
public class DataHarmonicDetail {
private Date timeId;
private int lineId;
private Integer targetType;
private Double maxData;
private Double limitData;
private Double diffData;
public Date getTimeId() {
return timeId;
}
public void setTimeId(Date timeId) {
this.timeId = timeId;
}
public int getLineId() {
return lineId;
}
public void setLineId(int lineId) {
this.lineId = lineId;
}
public Integer getTargetType() {
return targetType;
}
public void setTargetType(Integer targetType) {
this.targetType = targetType;
}
public Double getMaxData() {
return maxData;
}
public void setMaxData(Double maxData) {
this.maxData = maxData;
}
public Double getLimitData() {
return limitData;
}
public void setLimitData(Double limitData) {
this.limitData = limitData;
}
public Double getDiffData() {
return diffData;
}
public void setDiffData(Double diffData) {
this.diffData = diffData;
}
@Override
public String toString() {
return "DataHarmonicDetail{" +
"timeId=" + timeId +
", lineId=" + lineId +
", targetType=" + targetType +
", maxData=" + maxData +
", limitData=" + limitData +
", diffData=" + diffData +
'}';
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,36 @@
package com.pqs9000.pojo.data;
import com.sun.jna.Structure;
import java.io.Serializable;
import java.util.List;
public class HKDataStruct extends Structure implements Serializable {
public float hk[] = new float[QvvrStruct.MAX_P_NODE + 1];
public HKDataStruct() {
}
@Override
protected List getFieldOrder() {
return null;
}
public HKDataStruct(double[] hk) {
for (int i = 0; i < hk.length; i++) {
this.hk[i] = (float) hk[i];
}
}
public static class ByReference extends HKDataStruct implements Structure.ByReference {
public ByReference(double[] p) {
super(p);
}
}
public static class ByValue extends HKDataStruct implements Structure.ByValue {
public ByValue(double[] p) {
super(p);
}
}
}

View File

@@ -0,0 +1,23 @@
package com.pqs9000.pojo.data;
import com.njcn.utils.JnaCallDll;
import com.sun.jna.Library;
import com.sun.jna.Native;
public class JnaCallQvvrFun extends JnaCallDll {
public static String strpath;
public JnaCallQvvrFun(String name) {
super(name);
}
@Override
public void setPath() {
JnaCallQvvrFun.strpath = super.getStrpath();
}
public interface Qvvrlibrary extends Library {
Qvvrlibrary INSTANTCE = (Qvvrlibrary) Native.loadLibrary(JnaCallQvvrFun.strpath, Qvvrlibrary.class);// 加载Lib库
void qvvr_fun_cause(QvvrStruct data);// 定义方法--->与C方法相对应
}
}

View File

@@ -0,0 +1,53 @@
package com.pqs9000.pojo.data;
import com.sun.jna.Structure;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
public class PDataStruct extends Structure implements Serializable {
public float p[] = new float[QvvrStruct.MAX_P_NODE];
public PDataStruct() {
}
@Override
protected List getFieldOrder() {
return null;
}
public PDataStruct(double[] p) {
for (int i = 0; i < p.length; i++) {
this.p[i] = (float) p[i];
}
}
public static class ByReference extends PDataStruct implements Structure.ByReference {
public ByReference(double[] p) {
super(p);
}
}
public static class ByValue extends PDataStruct implements Structure.ByValue {
public ByValue(double[] p) {
super(p);
}
}
public float[] getP() {
return p;
}
public void setP(float[] p) {
this.p = p;
}
@Override
public String toString() {
return "PDataStruct{" +
"p=" + Arrays.toString(p) +
'}';
}
}

View File

@@ -0,0 +1,200 @@
package com.pqs9000.pojo.data;
import com.sun.jna.Structure;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
public class QvvrStruct extends Structure implements Serializable {
public static final int MAX_P_NODE= 200; //功率节点个数限制按200个限制
public static final int MAX_P_NUM= 96 * 100; //功率数据按15分钟间隔100天处理
public static final int MAX_HARM_NUM= 1440 * 100; //谐波数据按一分钟间隔100天处理
public static final int MAX_WIN_LEN=96 * 10; //按15分钟算10天
public static final int MIN_WIN_LEN = 4; //按15分钟算1小时
//输入参数
public int cal_flag; //计算标志0默认用电压和功率数据计算相关系数和责任1用代入的动态相关系数计算责任
public int harm_num; //谐波数据个数
public int p_num; //功率数据个数
public int p_node; //功率负荷节点数
public int win; //数据窗大小
public int res_num; //代入的责任数据个数
public float harm_mk; //谐波电压门槛
public float harm_data[]; //谐波数据序列
public PDataStruct p_data[]; //功率数据序列
public PDataStruct sim_data[]; //动态相关系数数据序列,可作为输入或者输出
public PDataStruct FKdata[]; //不包含背景动态谐波责任数据序列,可作为输入或者输出
public HKDataStruct HKdata[]; //包含背景动态谐波责任数据序列,可作为输入或者输出
public float Core[]; //典则相关系数
public float BjCore[]; //包含背景典则相关系数
//输出结果
public int cal_ok; //是否计算正确标志置位0表示未计算置位1表示计算完成
public float sumFKdata[];//不包含背景谐波责任
public float sumHKdata[];//包含背景谐波责任
public QvvrStruct() {
cal_flag = 0;
harm_data = new float[MAX_HARM_NUM];
p_data = new PDataStruct[MAX_P_NUM];
sim_data = new PDataStruct[MAX_P_NUM];
FKdata = new PDataStruct[MAX_P_NUM];
HKdata = new HKDataStruct[MAX_P_NUM];
Core = new float[MAX_P_NUM];
BjCore = new float[MAX_P_NUM];
sumFKdata = new float[MAX_P_NODE];
sumHKdata = new float[MAX_P_NODE + 1];
}
public static class ByReference extends QvvrStruct implements Structure.ByReference {
}
public static class ByValue extends QvvrStruct implements Structure.ByValue {
}
public PDataStruct[] getFKdata() {
return FKdata;
}
public void setFKdata(PDataStruct[] FKdata) {
this.FKdata = FKdata;
}
public HKDataStruct[] getHKdata() {
return HKdata;
}
public void setHKdata(HKDataStruct[] HKdata) {
this.HKdata = HKdata;
}
public float[] getSumFKdata() {
return sumFKdata;
}
public void setSumFKdata(float[] sumFKdata) {
this.sumFKdata = sumFKdata;
}
public float[] getSumHKdata() {
return sumHKdata;
}
public void setSumHKdata(float[] sumHKdata) {
this.sumHKdata = sumHKdata;
}
public int getCal_flag() {
return cal_flag;
}
public void setCal_flag(int cal_flag) {
this.cal_flag = cal_flag;
}
public int getHarm_num() {
return harm_num;
}
public void setHarm_num(int harm_num) {
this.harm_num = harm_num;
}
public float getHarm_mk() {
return harm_mk;
}
public void setHarm_mk(float harm_mk) {
this.harm_mk = harm_mk;
}
public float[] getHarm_data() {
return harm_data;
}
public void setHarm_data(float[] harm_data) {
this.harm_data = harm_data;
}
public float[] getCore() {
return Core;
}
public void setCore(float[] core) {
Core = core;
}
public float[] getBjCore() {
return BjCore;
}
public void setBjCore(float[] bjCore) {
BjCore = bjCore;
}
public int getCal_ok() {
return cal_ok;
}
public void setCal_ok(int cal_ok) {
this.cal_ok = cal_ok;
}
public int getP_num() {
return p_num;
}
public void setP_num(int p_num) {
this.p_num = p_num;
}
public int getP_node() {
return p_node;
}
public void setP_node(int p_node) {
this.p_node = p_node;
}
public int getWin() {
return win;
}
public void setWin(int win) {
this.win = win;
}
public int getRes_num() {
return res_num;
}
public void setRes_num(int res_num) {
this.res_num = res_num;
}
public PDataStruct[] getP_data() {
return p_data;
}
public void setP_data(PDataStruct[] p_data) {
this.p_data = p_data;
}
public PDataStruct[] getSim_data() {
return sim_data;
}
public void setSim_data(PDataStruct[] sim_data) {
this.sim_data = sim_data;
}
@Override
protected List getFieldOrder() {
return Arrays.asList(new String[]{"sumFKdata", "sumHKdata"});
}
}

View File

@@ -0,0 +1,24 @@
package com.pqs9000.pojo.data;
import com.njcn.pojo.terminal.ContValueVO;
public class VdlistWaveRVO {
private String len;
private VdlistWaveVO data;
public String getLen() {
return len;
}
public void setLen(String len) {
this.len = len;
}
public VdlistWaveVO getData() {
return data;
}
public void setData(VdlistWaveVO data) {
this.data = data;
}
}

View File

@@ -0,0 +1,31 @@
package com.pqs9000.pojo.data;
public class VdlistWaveVO {
private String type;
private Long LineId;
private Long ComtradeName;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Long getLineId() {
return LineId;
}
public void setLineId(Long lineId) {
LineId = lineId;
}
public Long getComtradeName() {
return ComtradeName;
}
public void setComtradeName(Long comtradeName) {
ComtradeName = comtradeName;
}
}

View File

@@ -0,0 +1,50 @@
package com.pqs9000.pojo.monitorMap;
/**
* system
*
* @author cdf
* @date 2023/7/13
*/
public class AreaMonitorBaseInfo {
private Integer monitorAllCount;
private Integer onlineMonitorCount;
private Integer eventCount;
private String deptName;
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public Integer getMonitorAllCount() {
return monitorAllCount;
}
public void setMonitorAllCount(Integer monitorAllCount) {
this.monitorAllCount = monitorAllCount;
}
public Integer getOnlineMonitorCount() {
return onlineMonitorCount;
}
public void setOnlineMonitorCount(Integer onlineMonitorCount) {
this.onlineMonitorCount = onlineMonitorCount;
}
public Integer getEventCount() {
return eventCount;
}
public void setEventCount(Integer eventCount) {
this.eventCount = eventCount;
}
}

View File

@@ -0,0 +1,215 @@
package com.pqs9000.pojo.monitorMap;
import java.math.BigDecimal;
import java.util.List;
/**
* system
*
* @author cdf
* @date 2023/7/11
*/
public class AreaSubLineVO {
private String subName;
private Integer subId;
private Integer lineId;
private String lineName;
private String voltageLevel;
private String wiringDiagram;
private String hangLine;
private String busBarName;
private Integer busBarId;
private BigDecimal lng;
private BigDecimal lat;
private Float pt1;
private Float pt2;
private Float ct1;
private Float ct2;
private Integer runFlag;
private Integer comFlag;
private String ip;
private Integer eventCount;
private String manufacturer;
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public String getSubName() {
return subName;
}
public void setSubName(String subName) {
this.subName = subName;
}
public Integer getSubId() {
return subId;
}
public void setSubId(Integer subId) {
this.subId = subId;
}
public Integer getLineId() {
return lineId;
}
public void setLineId(Integer lineId) {
this.lineId = lineId;
}
public String getLineName() {
return lineName;
}
public void setLineName(String lineName) {
this.lineName = lineName;
}
public String getVoltageLevel() {
return voltageLevel;
}
public void setVoltageLevel(String voltageLevel) {
this.voltageLevel = voltageLevel;
}
public String getWiringDiagram() {
return wiringDiagram;
}
public void setWiringDiagram(String wiringDiagram) {
this.wiringDiagram = wiringDiagram;
}
public String getHangLine() {
return hangLine;
}
public void setHangLine(String hangLine) {
this.hangLine = hangLine;
}
public String getBusBarName() {
return busBarName;
}
public void setBusBarName(String busBarName) {
this.busBarName = busBarName;
}
public Integer getBusBarId() {
return busBarId;
}
public void setBusBarId(Integer busBarId) {
this.busBarId = busBarId;
}
public BigDecimal getLng() {
return lng;
}
public void setLng(BigDecimal lng) {
this.lng = lng;
}
public BigDecimal getLat() {
return lat;
}
public void setLat(BigDecimal lat) {
this.lat = lat;
}
public Float getPt1() {
return pt1;
}
public void setPt1(Float pt1) {
this.pt1 = pt1;
}
public Float getPt2() {
return pt2;
}
public void setPt2(Float pt2) {
this.pt2 = pt2;
}
public Float getCt1() {
return ct1;
}
public void setCt1(Float ct1) {
this.ct1 = ct1;
}
public Float getCt2() {
return ct2;
}
public void setCt2(Float ct2) {
this.ct2 = ct2;
}
public Integer getRunFlag() {
return runFlag;
}
public void setRunFlag(Integer runFlag) {
this.runFlag = runFlag;
}
public Integer getComFlag() {
return comFlag;
}
public void setComFlag(Integer comFlag) {
this.comFlag = comFlag;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Integer getEventCount() {
return eventCount;
}
public void setEventCount(Integer eventCount) {
this.eventCount = eventCount;
}
}

View File

@@ -0,0 +1,131 @@
package com.pqs9000.pojo.report;
import com.njcn.utils.AppConfig;
import com.pqs9000.util.TransformTime;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class Condition implements Serializable {
private static final long serialVersionUID = 1L;
private Date start; //查询开始时间
private Date end; //查询结束时间
private List<TransformTime> exceptTime; //查询排除时间
private Integer pointIndex; //监测点ID
private Double count; //CP95使用
private Double pltCount; //pltCP95使用
private Double pstCount; //pstCP95使用
private Boolean b; //判断时间是否超过7天 >7返回false 大于7天查day表小于7天查总表
private AppConfig appConfig;
private String mode; //接线方式
private Integer times;//谐波次数
public AppConfig getAppConfig() {
return appConfig;
}
public void setAppConfig(AppConfig appConfig) {
this.appConfig = appConfig;
}
public Integer getTimes() {
return times;
}
public void setTimes(Integer times) {
this.times = times;
}
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
public Condition(AppConfig appConfig) {
super();
exceptTime = new ArrayList<>();
this.appConfig = appConfig;
}
public Condition() {
super();
exceptTime = new ArrayList<>();
}
public Double getCount() {
return count;
}
public void setCount(Double count) {
this.count = count;
}
public Integer getPointIndex() {
return pointIndex;
}
public void setPointIndex(Integer pointIndex) {
this.pointIndex = pointIndex;
}
public Date getStart() {
return start;
}
public void setStart(Date start) {
this.start = start;
}
public Date getEnd() {
return end;
}
public void setEnd(Date end) {
this.end = end;
}
public List<TransformTime> getExceptTime() {
return exceptTime;
}
public void setExceptTime(List<TransformTime> exceptTime) {
this.exceptTime = exceptTime;
}
public Boolean getB() {
return b;
}
public Double getPltCount() {
return pltCount;
}
public void setPltCount(Double pltCount) {
this.pltCount = pltCount;
}
public void setB(Boolean b) {
this.b = b;
}
public Double getPstCount() {
return pstCount;
}
public void setPstCount(Double pstCount) {
this.pstCount = pstCount;
}
public void setB() {
this.b = false;
/* int day = appConfig.getReportday();
int days = (int) ((this.end.getTime() - this.start.getTime()) / (1000 * 3600 * 24))+1;
this.b = (days > day) ? new Boolean(false) : new Boolean(true);*/
}
}

View File

@@ -0,0 +1,83 @@
package com.pqs9000.pojo.report;
import com.pqs9000.pojo.report.enumReport.EnumPass;
import java.io.Serializable;
import java.util.List;
public class FpyDataByType implements Serializable {
private static final long serialVersionUID = -1071056270808019733L;
private EnumPass enumPass;
private List<FpyRate> listA; //A相
private List<FpyRate> listB; //B相
private List<FpyRate> listC; //C相
private List<FpyRate> listS; //总的合格率
private List<FpyRate> listT; //没有三相的合格率
private Integer fpy; //限值
public FpyDataByType(EnumPass enumPass) {//初始化
this.enumPass = enumPass;
this.listA = null;
this.listB = null;
this.listC = null;
this.listS = null;
this.listT = null;
this.fpy = EnumPass.FPYVALUE.getCode();
}
public Integer getFpy() {
return fpy;
}
public void setFpy(Integer fpy) {
this.fpy = fpy;
}
public EnumPass getEnumPass() {
return enumPass;
}
public void setEnumPass(EnumPass enumPass) {
this.enumPass = enumPass;
}
public List<FpyRate> getListA() {
return listA;
}
public void setListA(List<FpyRate> listA) {
this.listA = listA;
}
public List<FpyRate> getListB() {
return listB;
}
public void setListB(List<FpyRate> listB) {
this.listB = listB;
}
public List<FpyRate> getListC() {
return listC;
}
public void setListC(List<FpyRate> listC) {
this.listC = listC;
}
public List<FpyRate> getListS() {
return listS;
}
public void setListS(List<FpyRate> listS) {
this.listS = listS;
}
public List<FpyRate> getListT() {
return listT;
}
public void setListT(List<FpyRate> listT) {
this.listT = listT;
}
}

View File

@@ -0,0 +1,31 @@
package com.pqs9000.pojo.report;
import java.io.Serializable;
public class FpyRate implements Serializable {
private static final long serialVersionUID = -9195132863875548829L;
private Float rate; //合格率
private Long count; //采样点数
public Float getRate() {
return rate;
}
public void setRate(Float rate) {
if (rate == null) {
this.rate = rate;
}
float f1 = (float) (Math.round(rate.floatValue() * 100)) / 100;
this.rate = new Float(f1);
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
}

View File

@@ -0,0 +1,151 @@
package com.pqs9000.pojo.report;
import java.io.Serializable;
import javax.persistence.Transient;
public class FpyReportData implements Serializable {
private Integer lineIndex;
private String bdName;
private String lineName;
private String scale;
private String pt;
private String ct;
private String dlcmp;
private String devcmp;
private String xycmp;
private String integrity;
private String harmDes;
private String powerDes;
private String businessType;
private String calssificationGrade;
private String superiorsSubstation;
private String hangLine;
public Integer getLineIndex() {
return lineIndex;
}
public void setLineIndex(Integer lineIndex) {
this.lineIndex = lineIndex;
}
public String getBdName() {
return bdName;
}
public void setBdName(String bdName) {
this.bdName = bdName;
}
public String getLineName() {
return lineName;
}
public void setLineName(String lineName) {
this.lineName = lineName;
}
public String getScale() {
return scale;
}
public void setScale(String scale) {
this.scale = scale;
}
public String getPt() {
return pt;
}
public void setPt(String pt) {
this.pt = pt;
}
public String getCt() {
return ct;
}
public void setCt(String ct) {
this.ct = ct;
}
public String getDlcmp() {
return dlcmp;
}
public void setDlcmp(String dlcmp) {
this.dlcmp = dlcmp;
}
public String getDevcmp() {
return devcmp;
}
public void setDevcmp(String devcmp) {
this.devcmp = devcmp;
}
public String getXycmp() {
return xycmp;
}
public void setXycmp(String xycmp) {
this.xycmp = xycmp;
}
public String getIntegrity() {
return integrity;
}
public void setIntegrity(String integrity) {
this.integrity = integrity;
}
public String getHarmDes() {
return harmDes;
}
public void setHarmDes(String harmDes) {
this.harmDes = harmDes;
}
public String getPowerDes() {
return powerDes;
}
public void setPowerDes(String powerDes) {
this.powerDes = powerDes;
}
public String getBusinessType() {
return businessType;
}
public void setBusinessType(String businessType) {
this.businessType = businessType;
}
public String getCalssificationGrade() {
return calssificationGrade;
}
public void setCalssificationGrade(String calssificationGrade) {
this.calssificationGrade = calssificationGrade;
}
public String getSuperiorsSubstation() {
return superiorsSubstation;
}
public void setSuperiorsSubstation(String superiorsSubstation) {
this.superiorsSubstation = superiorsSubstation;
}
public String getHangLine() {
return hangLine;
}
public void setHangLine(String hangLine) {
this.hangLine = hangLine;
}
@Override
public String toString() {
return "FpyReportData{" +
"bdName='" + bdName + '\'' +
", lineName='" + lineName + '\'' +
", scale='" + scale + '\'' +
", pt='" + pt + '\'' +
", ct='" + ct + '\'' +
", dlcmp='" + dlcmp + '\'' +
", devcmp='" + devcmp + '\'' +
", xycmp='" + xycmp + '\'' +
", integrity='" + integrity + '\'' +
", harmDes='" + harmDes + '\'' +
", powerDes='" + powerDes + '\'' +
'}';
}
}

View File

@@ -0,0 +1,30 @@
package com.pqs9000.pojo.report;
/**
* system
*
* @author cdf
* @date 2023/5/29
*/
public class FpyTagContent {
private String passFlag;
private String content;
public String getPassFlag() {
return passFlag;
}
public void setPassFlag(String passFlag) {
this.passFlag = passFlag;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}

View File

@@ -0,0 +1,119 @@
package com.pqs9000.pojo.report;
import java.util.ArrayList;
import java.util.List;
public class HistoryTableData {
private String name; //监测点名称
private String bdName; //变电站名称
private String voltage; //电压等级
private int lineId; //线路ID
private int pttype; //监测点接线方式
private List<data> list;
public int getPttype() {
return pttype;
}
public void setPttype(int pttype) {
this.pttype = pttype;
}
public int getLineId() {
return lineId;
}
public void setLineId(int lineId) {
this.lineId = lineId;
}
public String getBdName() {
return bdName;
}
public void setBdName(String bdName) {
this.bdName = bdName;
}
public String getVoltage() {
return voltage;
}
public void setVoltage(String voltage) {
this.voltage = voltage;
}
public class data {
private String targetName; //指标名称
private String unit; //单位
private int typeId; //类型id
private int timeId = 0; //谐波的下标
private List<ReportTarget> list;
public int getTimeId() {
return timeId;
}
public void setTimeId(int timeId) {
this.timeId = timeId;
}
public int getTypeId() {
return typeId;
}
public void setTypeId(int typeId) {
this.typeId = typeId;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getTargetName() {
return targetName;
}
public void setTargetName(String targetName) {
this.targetName = targetName;
}
public List<ReportTarget> getList() {
return list;
}
public void setList(List<ReportTarget> list) {
this.list = list;
}
}
public List<data> getList() {
return list;
}
public void setList(List<data> list) {
this.list = list;
}
public void setData(data data) {
if (this.list == null) {
this.list = new ArrayList<>();
}
this.list.add(data);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,101 @@
package com.pqs9000.pojo.report;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2024/3/20 22:19
*/
public class IntegrityDetailVo {
private String lineId;
//起始时间
private String startTime;
//结束时间
private String endTime;
//应收数据
private String due;
//实收数据
private String real;
//数据完整性
private Double rate;
//说明
private String explain;
public String getLineId() {
return lineId;
}
public void setLineId(String lineId) {
this.lineId = lineId;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getDue() {
return due;
}
public void setDue(String due) {
this.due = due;
}
public String getReal() {
return real;
}
public void setReal(String real) {
this.real = real;
}
public Double getRate() {
return rate;
}
public void setRate(Double rate) {
this.rate = rate;
}
public String getExplain() {
return explain;
}
public void setExplain(String explain) {
this.explain = explain;
}
@Override
public String toString() {
return "IntegrityDetailVo{" +
"lineId='" + lineId + '\'' +
", startTime='" + startTime + '\'' +
", endTime='" + endTime + '\'' +
", due='" + due + '\'' +
", real='" + real + '\'' +
", rate=" + rate +
", explain='" + explain + '\'' +
'}';
}
}

View File

@@ -0,0 +1,650 @@
package com.pqs9000.pojo.report;
import javax.persistence.Column;
import java.util.Date;
/**
* system
*
* @author cdf
* @date 2023/5/26
*/
public class LimitRateCalDTO {
private Date timeID;
private String phasicType;
private Float myIndex;
@Column(name="AllTime")
private Float allTime;
@Column(name="Flicket_AllTime")
private Float flicketAllTime;
@Column(name="Freq_Dev_OverTime")
private Float freqDevOverTime;
@Column(name="Voltage_Dev_OverTime")
private Float voltageDevOvertime;
@Column(name="UBalance_OverTime")
private Float UBalanceOverTime;
@Column(name="Flicker_OverTime")
private Float flickerOverTime;
@Column(name="UAberrance_OverTime")
private Float UAberranceOverTime;
@Column(name="UHarm_2_OverTime")
private Float UHarm2OverTime;
@Column(name="UHarm_3_OverTime")
private Float UHarm3OverTime;
@Column(name="UHarm_4_OverTime")
private Float UHarm4OverTime;
@Column(name="UHarm_5_OverTime")
private Float UHarm5OverTime;
@Column(name="UHarm_6_OverTime")
private Float UHarm6OverTime;
@Column(name="UHarm_7_OverTime")
private Float UHarm7OverTime;
@Column(name="UHarm_8_OverTime")
private Float UHarm8OverTime;
@Column(name="UHarm_9_OverTime")
private Float UHarm9OverTime;
@Column(name="UHarm_10_OverTime")
private Float UHarm10OverTime;
@Column(name="UHarm_11_OverTime")
private Float UHarm11OverTime;
@Column(name="UHarm_12_OverTime")
private Float UHarm12OverTime;
@Column(name="UHarm_13_OverTime")
private Float UHarm13OverTime;
@Column(name="UHarm_14_OverTime")
private Float UHarm14OverTime;
@Column(name="UHarm_15_OverTime")
private Float UHarm15OverTime;
@Column(name="UHarm_16_OverTime")
private Float UHarm16OverTime;
@Column(name="UHarm_17_OverTime")
private Float UHarm17OverTime;
@Column(name="UHarm_18_OverTime")
private Float UHarm18OverTime;
@Column(name="UHarm_19_OverTime")
private Float UHarm19OverTime;
@Column(name="UHarm_20_OverTime")
private Float UHarm20OverTime;
@Column(name="UHarm_21_OverTime")
private Float UHarm21OverTime;
@Column(name="UHarm_22_OverTime")
private Float UHarm22OverTime;
@Column(name="UHarm_23_OverTime")
private Float UHarm23OverTime;
@Column(name="UHarm_24_OverTime")
private Float UHarm24OverTime;
@Column(name="UHarm_25_OverTime")
private Float UHarm25OverTime;
@Column(name="IHarm_2_OverTime")
private Float IHarm2OverTime;
@Column(name="IHarm_3_OverTime")
private Float IHarm3OverTime;
@Column(name="IHarm_4_OverTime")
private Float IHarm4OverTime;
@Column(name="IHarm_5_OverTime")
private Float IHarm5OverTime;
@Column(name="IHarm_6_OverTime")
private Float IHarm6OverTime;
@Column(name="IHarm_7_OverTime")
private Float IHarm7OverTime;
@Column(name="IHarm_8_OverTime")
private Float IHarm8OverTime;
@Column(name="IHarm_9_OverTime")
private Float IHarm9OverTime;
@Column(name="IHarm_10_OverTime")
private Float IHarm10OverTime;
@Column(name="IHarm_11_OverTime")
private Float IHarm11OverTime;
@Column(name="IHarm_12_OverTime")
private Float IHarm12OverTime;
@Column(name="IHarm_13_OverTime")
private Float IHarm13OverTime;
@Column(name="IHarm_14_OverTime")
private Float IHarm14OverTime;
@Column(name="IHarm_15_OverTime")
private Float IHarm15OverTime;
@Column(name="IHarm_16_OverTime")
private Float IHarm16OverTime;
@Column(name="IHarm_17_OverTime")
private Float IHarm17OverTime;
@Column(name="IHarm_18_OverTime")
private Float IHarm18OverTime;
@Column(name="IHarm_19_OverTime")
private Float IHarm19OverTime;
@Column(name="IHarm_20_OverTime")
private Float IHarm20OverTime;
@Column(name="IHarm_21_OverTime")
private Float IHarm21OverTime;
@Column(name="IHarm_22_OverTime")
private Float IHarm22OverTime;
@Column(name="IHarm_23_OverTime")
private Float IHarm23OverTime;
@Column(name="IHarm_24_OverTime")
private Float IHarm24OverTime;
@Column(name="IHarm_25_OverTime")
private Float IHarm25OverTime;
public Date getTimeID() {
return timeID;
}
public void setTimeID(Date timeID) {
this.timeID = timeID;
}
public String getPhasicType() {
return phasicType;
}
public void setPhasicType(String phasicType) {
this.phasicType = phasicType;
}
public Float getMyIndex() {
return myIndex;
}
public void setMyIndex(Float myIndex) {
this.myIndex = myIndex;
}
public Float getAllTime() {
return allTime;
}
public void setAllTime(Float allTime) {
this.allTime = allTime;
}
public Float getFlicketAllTime() {
return flicketAllTime;
}
public void setFlicketAllTime(Float flicketAllTime) {
this.flicketAllTime = flicketAllTime;
}
public Float getFreqDevOverTime() {
return freqDevOverTime;
}
public void setFreqDevOverTime(Float freqDevOverTime) {
this.freqDevOverTime = freqDevOverTime;
}
public Float getVoltageDevOvertime() {
return voltageDevOvertime;
}
public void setVoltageDevOvertime(Float voltageDevOvertime) {
this.voltageDevOvertime = voltageDevOvertime;
}
public Float getUBalanceOverTime() {
return UBalanceOverTime;
}
public void setUBalanceOverTime(Float UBalanceOverTime) {
this.UBalanceOverTime = UBalanceOverTime;
}
public Float getFlickerOverTime() {
return flickerOverTime;
}
public void setFlickerOverTime(Float flickerOverTime) {
this.flickerOverTime = flickerOverTime;
}
public Float getUAberranceOverTime() {
return UAberranceOverTime;
}
public void setUAberranceOverTime(Float UAberranceOverTime) {
this.UAberranceOverTime = UAberranceOverTime;
}
public Float getUHarm2OverTime() {
return UHarm2OverTime;
}
public void setUHarm2OverTime(Float UHarm2OverTime) {
this.UHarm2OverTime = UHarm2OverTime;
}
public Float getUHarm3OverTime() {
return UHarm3OverTime;
}
public void setUHarm3OverTime(Float UHarm3OverTime) {
this.UHarm3OverTime = UHarm3OverTime;
}
public Float getUHarm4OverTime() {
return UHarm4OverTime;
}
public void setUHarm4OverTime(Float UHarm4OverTime) {
this.UHarm4OverTime = UHarm4OverTime;
}
public Float getUHarm5OverTime() {
return UHarm5OverTime;
}
public void setUHarm5OverTime(Float UHarm5OverTime) {
this.UHarm5OverTime = UHarm5OverTime;
}
public Float getUHarm6OverTime() {
return UHarm6OverTime;
}
public void setUHarm6OverTime(Float UHarm6OverTime) {
this.UHarm6OverTime = UHarm6OverTime;
}
public Float getUHarm7OverTime() {
return UHarm7OverTime;
}
public void setUHarm7OverTime(Float UHarm7OverTime) {
this.UHarm7OverTime = UHarm7OverTime;
}
public Float getUHarm8OverTime() {
return UHarm8OverTime;
}
public void setUHarm8OverTime(Float UHarm8OverTime) {
this.UHarm8OverTime = UHarm8OverTime;
}
public Float getUHarm9OverTime() {
return UHarm9OverTime;
}
public void setUHarm9OverTime(Float UHarm9OverTime) {
this.UHarm9OverTime = UHarm9OverTime;
}
public Float getUHarm10OverTime() {
return UHarm10OverTime;
}
public void setUHarm10OverTime(Float UHarm10OverTime) {
this.UHarm10OverTime = UHarm10OverTime;
}
public Float getUHarm11OverTime() {
return UHarm11OverTime;
}
public void setUHarm11OverTime(Float UHarm11OverTime) {
this.UHarm11OverTime = UHarm11OverTime;
}
public Float getUHarm12OverTime() {
return UHarm12OverTime;
}
public void setUHarm12OverTime(Float UHarm12OverTime) {
this.UHarm12OverTime = UHarm12OverTime;
}
public Float getUHarm13OverTime() {
return UHarm13OverTime;
}
public void setUHarm13OverTime(Float UHarm13OverTime) {
this.UHarm13OverTime = UHarm13OverTime;
}
public Float getUHarm14OverTime() {
return UHarm14OverTime;
}
public void setUHarm14OverTime(Float UHarm14OverTime) {
this.UHarm14OverTime = UHarm14OverTime;
}
public Float getUHarm15OverTime() {
return UHarm15OverTime;
}
public void setUHarm15OverTime(Float UHarm15OverTime) {
this.UHarm15OverTime = UHarm15OverTime;
}
public Float getUHarm16OverTime() {
return UHarm16OverTime;
}
public void setUHarm16OverTime(Float UHarm16OverTime) {
this.UHarm16OverTime = UHarm16OverTime;
}
public Float getUHarm17OverTime() {
return UHarm17OverTime;
}
public void setUHarm17OverTime(Float UHarm17OverTime) {
this.UHarm17OverTime = UHarm17OverTime;
}
public Float getUHarm18OverTime() {
return UHarm18OverTime;
}
public void setUHarm18OverTime(Float UHarm18OverTime) {
this.UHarm18OverTime = UHarm18OverTime;
}
public Float getUHarm19OverTime() {
return UHarm19OverTime;
}
public void setUHarm19OverTime(Float UHarm19OverTime) {
this.UHarm19OverTime = UHarm19OverTime;
}
public Float getUHarm20OverTime() {
return UHarm20OverTime;
}
public void setUHarm20OverTime(Float UHarm20OverTime) {
this.UHarm20OverTime = UHarm20OverTime;
}
public Float getUHarm21OverTime() {
return UHarm21OverTime;
}
public void setUHarm21OverTime(Float UHarm21OverTime) {
this.UHarm21OverTime = UHarm21OverTime;
}
public Float getUHarm22OverTime() {
return UHarm22OverTime;
}
public void setUHarm22OverTime(Float UHarm22OverTime) {
this.UHarm22OverTime = UHarm22OverTime;
}
public Float getUHarm23OverTime() {
return UHarm23OverTime;
}
public void setUHarm23OverTime(Float UHarm23OverTime) {
this.UHarm23OverTime = UHarm23OverTime;
}
public Float getUHarm24OverTime() {
return UHarm24OverTime;
}
public void setUHarm24OverTime(Float UHarm24OverTime) {
this.UHarm24OverTime = UHarm24OverTime;
}
public Float getUHarm25OverTime() {
return UHarm25OverTime;
}
public void setUHarm25OverTime(Float UHarm25OverTime) {
this.UHarm25OverTime = UHarm25OverTime;
}
public Float getIHarm2OverTime() {
return IHarm2OverTime;
}
public void setIHarm2OverTime(Float IHarm2OverTime) {
this.IHarm2OverTime = IHarm2OverTime;
}
public Float getIHarm3OverTime() {
return IHarm3OverTime;
}
public void setIHarm3OverTime(Float IHarm3OverTime) {
this.IHarm3OverTime = IHarm3OverTime;
}
public Float getIHarm4OverTime() {
return IHarm4OverTime;
}
public void setIHarm4OverTime(Float IHarm4OverTime) {
this.IHarm4OverTime = IHarm4OverTime;
}
public Float getIHarm5OverTime() {
return IHarm5OverTime;
}
public void setIHarm5OverTime(Float IHarm5OverTime) {
this.IHarm5OverTime = IHarm5OverTime;
}
public Float getIHarm6OverTime() {
return IHarm6OverTime;
}
public void setIHarm6OverTime(Float IHarm6OverTime) {
this.IHarm6OverTime = IHarm6OverTime;
}
public Float getIHarm7OverTime() {
return IHarm7OverTime;
}
public void setIHarm7OverTime(Float IHarm7OverTime) {
this.IHarm7OverTime = IHarm7OverTime;
}
public Float getIHarm8OverTime() {
return IHarm8OverTime;
}
public void setIHarm8OverTime(Float IHarm8OverTime) {
this.IHarm8OverTime = IHarm8OverTime;
}
public Float getIHarm9OverTime() {
return IHarm9OverTime;
}
public void setIHarm9OverTime(Float IHarm9OverTime) {
this.IHarm9OverTime = IHarm9OverTime;
}
public Float getIHarm10OverTime() {
return IHarm10OverTime;
}
public void setIHarm10OverTime(Float IHarm10OverTime) {
this.IHarm10OverTime = IHarm10OverTime;
}
public Float getIHarm11OverTime() {
return IHarm11OverTime;
}
public void setIHarm11OverTime(Float IHarm11OverTime) {
this.IHarm11OverTime = IHarm11OverTime;
}
public Float getIHarm12OverTime() {
return IHarm12OverTime;
}
public void setIHarm12OverTime(Float IHarm12OverTime) {
this.IHarm12OverTime = IHarm12OverTime;
}
public Float getIHarm13OverTime() {
return IHarm13OverTime;
}
public void setIHarm13OverTime(Float IHarm13OverTime) {
this.IHarm13OverTime = IHarm13OverTime;
}
public Float getIHarm14OverTime() {
return IHarm14OverTime;
}
public void setIHarm14OverTime(Float IHarm14OverTime) {
this.IHarm14OverTime = IHarm14OverTime;
}
public Float getIHarm15OverTime() {
return IHarm15OverTime;
}
public void setIHarm15OverTime(Float IHarm15OverTime) {
this.IHarm15OverTime = IHarm15OverTime;
}
public Float getIHarm16OverTime() {
return IHarm16OverTime;
}
public void setIHarm16OverTime(Float IHarm16OverTime) {
this.IHarm16OverTime = IHarm16OverTime;
}
public Float getIHarm17OverTime() {
return IHarm17OverTime;
}
public void setIHarm17OverTime(Float IHarm17OverTime) {
this.IHarm17OverTime = IHarm17OverTime;
}
public Float getIHarm18OverTime() {
return IHarm18OverTime;
}
public void setIHarm18OverTime(Float IHarm18OverTime) {
this.IHarm18OverTime = IHarm18OverTime;
}
public Float getIHarm19OverTime() {
return IHarm19OverTime;
}
public void setIHarm19OverTime(Float IHarm19OverTime) {
this.IHarm19OverTime = IHarm19OverTime;
}
public Float getIHarm20OverTime() {
return IHarm20OverTime;
}
public void setIHarm20OverTime(Float IHarm20OverTime) {
this.IHarm20OverTime = IHarm20OverTime;
}
public Float getIHarm21OverTime() {
return IHarm21OverTime;
}
public void setIHarm21OverTime(Float IHarm21OverTime) {
this.IHarm21OverTime = IHarm21OverTime;
}
public Float getIHarm22OverTime() {
return IHarm22OverTime;
}
public void setIHarm22OverTime(Float IHarm22OverTime) {
this.IHarm22OverTime = IHarm22OverTime;
}
public Float getIHarm23OverTime() {
return IHarm23OverTime;
}
public void setIHarm23OverTime(Float IHarm23OverTime) {
this.IHarm23OverTime = IHarm23OverTime;
}
public Float getIHarm24OverTime() {
return IHarm24OverTime;
}
public void setIHarm24OverTime(Float IHarm24OverTime) {
this.IHarm24OverTime = IHarm24OverTime;
}
public Float getIHarm25OverTime() {
return IHarm25OverTime;
}
public void setIHarm25OverTime(Float IHarm25OverTime) {
this.IHarm25OverTime = IHarm25OverTime;
}
}

View File

@@ -0,0 +1,30 @@
package com.pqs9000.pojo.report;
/**
* system
*
* @author cdf
* @date 2023/5/26
*/
public class LineBaseData {
private Integer lineId;
private Float value;
public Integer getLineId() {
return lineId;
}
public void setLineId(Integer lineId) {
this.lineId = lineId;
}
public Float getValue() {
return value;
}
public void setValue(Float value) {
this.value = value;
}
}

View File

@@ -0,0 +1,74 @@
package com.pqs9000.pojo.report;
import com.njcn.pojo.configuration.OverLimit;
import java.io.Serializable;
import java.util.List;
public class OverLimitInfo implements Serializable {
private static final long serialVersionUID = 7466469972886414616L;
private List<OverLimit> overLimitRate;
private Double count;
private Double pltCount;
private Double pstCount;
private List<String> list;
private String mode;
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
public List<String> getList() {
return list;
}
public void setList(List<String> list) {
this.list = list;
}
public List<OverLimit> getOverLimitRate() {
return overLimitRate;
}
public void setOverLimitRate(List<OverLimit> overLimitRate) {
this.overLimitRate = overLimitRate;
}
public Double getCount() {
return count;
}
public void setCount(Double count) {
this.count = count;
}
public Double getPltCount() {
return pltCount;
}
public void setPltCount(Double pltCount) {
this.pltCount = pltCount;
}
@Override
public String toString() {
return "OverLimitInfo{" +
"overLimitRate=" + overLimitRate +
", count=" + count +
", pltCount=" + pltCount +
", pstCount=" + pstCount +
'}';
}
public Double getPstCount() {
return pstCount;
}
public void setPstCount(Double pstCount) {
this.pstCount = pstCount;
}
}

View File

@@ -0,0 +1,26 @@
package com.pqs9000.pojo.report;
import com.pqs9000.pojo.report.enumReport.EnumPass;
public class Pass {
private Float overLimit;
private Integer code;
public Pass(Float overLimit) {
this.code = EnumPass.DEFAULT.getCode();
this.overLimit = overLimit;
}
public Pass(Float overLimit, Integer code) {
this.overLimit = overLimit;
this.code = code;
}
public Float getOverLimit() {
return overLimit;
}
public Integer getCode() {
return code;
}
}

View File

@@ -0,0 +1,26 @@
package com.pqs9000.pojo.report;
import java.io.Serializable;
import java.util.List;
public class PloySetting implements Serializable {
private static final long serialVersionUID = -2915250019147778282L;
private String name; //名称 谐波电压、谐波电流....
List<Integer> listTarget; //{1,2,3,4...} 最大值、最小值、平均值、CP95值...
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Integer> getListTarget() {
return listTarget;
}
public void setListTarget(List<Integer> listTarget) {
this.listTarget = listTarget;
}
}

View File

@@ -0,0 +1,48 @@
package com.pqs9000.pojo.report;
import java.io.Serializable;
import java.util.List;
public class ReportTarget implements Serializable {
private static final long serialVersionUID = -6931764660060228127L;
private List<ReportValue> list;
private Float overLimit; //指标的国标限值
private Integer pass;
public ReportTarget() {
this.pass = null;
}
public List<ReportValue> getList() {
return list;
}
public void setList(List<ReportValue> list) {
this.list = list;
}
public Float getOverLimit() {
return overLimit;
}
public void setOverLimit(Float overLimit) {
this.overLimit = overLimit;
}
public Integer getPass() {
return pass;
}
public void setPass(Integer pass) {
this.pass = pass;
}
@Override
public String toString() {
return "ReportTarget{" +
"list=" + list +
", overLimit=" + overLimit +
", pass=" + pass +
'}';
}
}

View File

@@ -0,0 +1,122 @@
package com.pqs9000.pojo.report;
import com.njcn.utils.PubUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Serializable;
import java.util.Date;
/**
* @Author: Sunwei 【sunW2016@163.com】
* @Description:
* @Date: Create in 10:54 2018/6/7
* @Modified By:
*/
public class ReportValue implements Serializable {
private static final Logger logger = LoggerFactory.getLogger(ReportValue.class);
private static final long serialVersionUID = 1120649990440477224L;
private String phaseType; //A(AB)相B(BC)相C(CA)相T总功
private Float fmaxValue; //最大值
private Float minValue; //最小值
private Float meanValue; //平均值
private Float cp95Value; //CP95值
transient private Date timeid;//发生的时间
transient private String strTime; //一天一条数据
public String getStrTime() {
return strTime;
}
public void setStrTime(String strTime) {
this.strTime = strTime;
}
public Date getTimeid() {
return timeid;
}
public void setTimeid(Date timeid) {
try {
this.strTime = PubUtils.date2String(timeid, "yyyy-MM-dd");
} catch (Exception e) {
logger.error(e.getMessage());
}
}
public ReportValue() {
super();
}
public ReportValue(String phaseType, Float maxValue, Float minValue, Float meanValue, Float cp95Value) {
this.phaseType = phaseType;
this.fmaxValue = transData(maxValue);
this.minValue = transData(minValue);
this.meanValue = transData(meanValue);
this.cp95Value = transData(cp95Value);
}
@Override
public String toString() {
return "ReportValue{" +
"phaseType='" + phaseType + '\'' +
", fmaxValue=" + fmaxValue +
", minValue=" + minValue +
", meanValue=" + meanValue +
", cp95Value=" + cp95Value +
", timeid=" + timeid +
", strTime='" + strTime + '\'' +
'}';
}
public String getPhaseType() {
return phaseType;
}
public void setPhaseType(String phaseType) {
this.phaseType = phaseType;
}
public Float getFmaxValue() {
return fmaxValue;
}
public void setFmaxValue(Float maxValue) {
this.fmaxValue = transData(maxValue);
}
public Float getMinValue() {
return minValue;
}
public void setMinValue(Float minValue) {
this.minValue = transData(minValue);
}
public Float getMeanValue() {
return meanValue;
}
public void setMeanValue(Float meanValue) {
this.meanValue = transData(meanValue);
}
public Float getCp95Value() {
return cp95Value;
}
public void setCp95Value(Float cp95Value) {
this.cp95Value = transData(cp95Value);
}
private Float transData(Float f) {
if (f == null) {
return f;
}
float f1 = (float) (Math.round(f.floatValue() * 100)) / 100;
return new Float(f1);
}
}

View File

@@ -0,0 +1,94 @@
package com.pqs9000.pojo.report;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 提取用采数据或者将用采数据写进excel的实体类
* @author hongawen
* @Date: 2019/4/11 10:43
*/
public class UserDataExcelBody extends BaseRowModel implements Serializable,Comparable<UserDataExcelBody> {
@ExcelProperty(index = 0)
private Date time;
@ExcelProperty(value = "瞬时有功" ,index = 1)
private BigDecimal work;
@ExcelProperty(value = "户号" ,index = 2)
private String userId;
@ExcelProperty(value = "测量点局号" ,index = 3)
private String line;
//事件发生时间的毫秒计时
@ExcelProperty(value = "户名" ,index = 4)
private String userName;
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public BigDecimal getWork() {
return work;
}
public void setWork(BigDecimal work) {
this.work = new BigDecimal(Math.abs(work.floatValue()));
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getLine() {
return line;
}
public void setLine(String line) {
this.line = line;
}
@Override
public String toString() {
return "UserDataExcelBody{" +
"time=" + time +
", work=" + work +
", userId='" + userId + '\'' +
", line='" + line + '\'' +
", userName='" + userName + '\'' +
'}';
}
@Override
public int compareTo(UserDataExcelBody o) {
if(this.time.getTime()>o.getTime().getTime()){
return 1;
}else if(this.time.getTime()==o.getTime().getTime()){
}
return -1;
}
}

View File

@@ -0,0 +1,39 @@
package com.pqs9000.pojo.report.enumReport;
public enum EnumPass {
MAX(1, "使用最大值与国标限值比较,判断指标是否合格"),
MIN(2, "使用最小值与国标限值比较,判断指标是否合格"),
MEAN(3, "使用平均值与国标限值比较,判断指标是否合格"),
CP95(4, "使用CP95值与国标限值比较判断指标是否合格"),
DEFAULT(5, "不作比较"),
PASS(0, "合格"),
FPYVALUE(98, "合格率限值"),
FPYV(1, "UHARM_0_OVERTIME"),
FPYI(2, "IHARM_0_OVERTIME"),
FPYVOLTAGE(3, "VOLTAGE_DEV_OVERTIME"),
FPYTHREE(4, "UBALANCE_OVERTIME"),
FPYTHDV(5, "UABERRANCE_OVERTIME"),
FPYRATE(6, "FREQ_DEV_OVERTIME"),
FPYFLICKER(7, "FLICKER_OVERTIME"),
NOPASS(-1, "不合格")
;
private Integer code;
private String describe;
EnumPass(Integer code, String describe) {
this.code = code;
this.describe = describe;
}
public Integer getCode() {
return code;
}
public String getDescribe() {
return describe;
}
}

View File

@@ -0,0 +1,437 @@
package com.pqs9000.pojo.responsibility;
/**
* @author xuyang
* @date 2020/9/21 14:25
*/
public class AreaOverNoraml {
//名称
private String name;
//在线监测点个数
private Integer onlineMonitorNumber;
//超标监测点个数
private Integer overLimitMonitorNumber;
//超标监测点数占比
private Double overBiLi;
/**
*频率偏差超标情况
*/
//个数
private Integer frequencyMonitorNumber;
//占比
private Double frequencyBiLi;
//日均占比(每日超标监测点数/每日在线监测点数,时间是个范围时则将每日的数据取平均)
private Double frequencyAvg;
//平均超标天数
private Double frequencyOverDayBiLi;
/**
*电压偏差超标情况
*/
//个数
private Integer voltageMonitorNumber;
//占比
private Double voltageBiLi;
//日均占比
private Double voltageAvg;
//平均超标天数
private Double voltageOverDayBiLi;
/**
*谐波电压超标情况
*/
//个数
private Integer harmonicVoltageMonitorNumber;
//占比
private Double harmonicVoltageBiLi;
//日均占比
private Double harmonicVoltageAvg;
//平均超标天数
private Double harmonicVoltageOverDayBiLi;
/**
*谐波电流超标情况
*/
//个数
private Integer harmonicCurrentMonitorNumber;
//占比
private Double harmonicCurrentBiLi;
//日均占比
private Double harmonicCurrentAvg;
//平均超标天数
private Double harmonicCurrentOverDayBiLi;
/**
*三相电压不平衡度超标情况
*/
//个数
private Integer threePhaseVoltageMonitorNumber;
//占比
private Double threePhaseVoltageBiLi;
//日均占比
private Double threePhaseVoltageAvg;
//平均超标天数
private Double threePhaseVoltageOverDayBiLi;
/**
*闪变超标情况
*/
//个数
private Integer flickerMonitorNumber;
//占比
private Double flickerBiLi;
//日均占比
private Double flickerAvg;
//平均超标天数
private Double flickerOverDayBiLi;
/**
*负序电流限值超标情况
*/
//个数
private Integer negativeMonitorNumber;
//占比
private Double negativeBiLi;
//日均占比
private Double negativeAvg;
//平均超标天数
private Double negativeOverDayBiLi;
/**
*间谐波电压超标情况
*/
//个数
private Integer interharmonicMonitorNumber;
//占比
private Double interharmonicBiLi;
//日均占比
private Double interharmonicAvg;
//平均超标天数
private Double interharmonicOverDayBiLi;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getOnlineMonitorNumber() {
return onlineMonitorNumber;
}
public void setOnlineMonitorNumber(Integer onlineMonitorNumber) {
this.onlineMonitorNumber = onlineMonitorNumber;
}
public Integer getOverLimitMonitorNumber() {
return overLimitMonitorNumber;
}
public void setOverLimitMonitorNumber(Integer overLimitMonitorNumber) {
this.overLimitMonitorNumber = overLimitMonitorNumber;
}
public Double getOverBiLi() {
return overBiLi;
}
public void setOverBiLi(Double overBiLi) {
this.overBiLi = overBiLi;
}
public Integer getFrequencyMonitorNumber() {
return frequencyMonitorNumber;
}
public void setFrequencyMonitorNumber(Integer frequencyMonitorNumber) {
this.frequencyMonitorNumber = frequencyMonitorNumber;
}
public Double getFrequencyBiLi() {
return frequencyBiLi;
}
public void setFrequencyBiLi(Double frequencyBiLi) {
this.frequencyBiLi = frequencyBiLi;
}
public Double getFrequencyOverDayBiLi() {
return frequencyOverDayBiLi;
}
public void setFrequencyOverDayBiLi(Double frequencyOverDayBiLi) {
this.frequencyOverDayBiLi = frequencyOverDayBiLi;
}
public Integer getVoltageMonitorNumber() {
return voltageMonitorNumber;
}
public void setVoltageMonitorNumber(Integer voltageMonitorNumber) {
this.voltageMonitorNumber = voltageMonitorNumber;
}
public Double getVoltageBiLi() {
return voltageBiLi;
}
public void setVoltageBiLi(Double voltageBiLi) {
this.voltageBiLi = voltageBiLi;
}
public Double getVoltageOverDayBiLi() {
return voltageOverDayBiLi;
}
public void setVoltageOverDayBiLi(Double voltageOverDayBiLi) {
this.voltageOverDayBiLi = voltageOverDayBiLi;
}
public Integer getHarmonicVoltageMonitorNumber() {
return harmonicVoltageMonitorNumber;
}
public void setHarmonicVoltageMonitorNumber(Integer harmonicVoltageMonitorNumber) {
this.harmonicVoltageMonitorNumber = harmonicVoltageMonitorNumber;
}
public Double getHarmonicVoltageBiLi() {
return harmonicVoltageBiLi;
}
public void setHarmonicVoltageBiLi(Double harmonicVoltageBiLi) {
this.harmonicVoltageBiLi = harmonicVoltageBiLi;
}
public Double getHarmonicVoltageOverDayBiLi() {
return harmonicVoltageOverDayBiLi;
}
public void setHarmonicVoltageOverDayBiLi(Double harmonicVoltageOverDayBiLi) {
this.harmonicVoltageOverDayBiLi = harmonicVoltageOverDayBiLi;
}
public Integer getHarmonicCurrentMonitorNumber() {
return harmonicCurrentMonitorNumber;
}
public void setHarmonicCurrentMonitorNumber(Integer harmonicCurrentMonitorNumber) {
this.harmonicCurrentMonitorNumber = harmonicCurrentMonitorNumber;
}
public Double getHarmonicCurrentBiLi() {
return harmonicCurrentBiLi;
}
public void setHarmonicCurrentBiLi(Double harmonicCurrentBiLi) {
this.harmonicCurrentBiLi = harmonicCurrentBiLi;
}
public Double getHarmonicCurrentOverDayBiLi() {
return harmonicCurrentOverDayBiLi;
}
public void setHarmonicCurrentOverDayBiLi(Double harmonicCurrentOverDayBiLi) {
this.harmonicCurrentOverDayBiLi = harmonicCurrentOverDayBiLi;
}
public Integer getThreePhaseVoltageMonitorNumber() {
return threePhaseVoltageMonitorNumber;
}
public void setThreePhaseVoltageMonitorNumber(Integer threePhaseVoltageMonitorNumber) {
this.threePhaseVoltageMonitorNumber = threePhaseVoltageMonitorNumber;
}
public Double getThreePhaseVoltageBiLi() {
return threePhaseVoltageBiLi;
}
public void setThreePhaseVoltageBiLi(Double threePhaseVoltageBiLi) {
this.threePhaseVoltageBiLi = threePhaseVoltageBiLi;
}
public Double getThreePhaseVoltageOverDayBiLi() {
return threePhaseVoltageOverDayBiLi;
}
public void setThreePhaseVoltageOverDayBiLi(Double threePhaseVoltageOverDayBiLi) {
this.threePhaseVoltageOverDayBiLi = threePhaseVoltageOverDayBiLi;
}
public Integer getFlickerMonitorNumber() {
return flickerMonitorNumber;
}
public void setFlickerMonitorNumber(Integer flickerMonitorNumber) {
this.flickerMonitorNumber = flickerMonitorNumber;
}
public Double getFlickerBiLi() {
return flickerBiLi;
}
public void setFlickerBiLi(Double flickerBiLi) {
this.flickerBiLi = flickerBiLi;
}
public Double getFlickerOverDayBiLi() {
return flickerOverDayBiLi;
}
public void setFlickerOverDayBiLi(Double flickerOverDayBiLi) {
this.flickerOverDayBiLi = flickerOverDayBiLi;
}
public Integer getNegativeMonitorNumber() {
return negativeMonitorNumber;
}
public void setNegativeMonitorNumber(Integer negativeMonitorNumber) {
this.negativeMonitorNumber = negativeMonitorNumber;
}
public Double getNegativeBiLi() {
return negativeBiLi;
}
public void setNegativeBiLi(Double negativeBiLi) {
this.negativeBiLi = negativeBiLi;
}
public Double getNegativeOverDayBiLi() {
return negativeOverDayBiLi;
}
public void setNegativeOverDayBiLi(Double negativeOverDayBiLi) {
this.negativeOverDayBiLi = negativeOverDayBiLi;
}
public Integer getInterharmonicMonitorNumber() {
return interharmonicMonitorNumber;
}
public void setInterharmonicMonitorNumber(Integer interharmonicMonitorNumber) {
this.interharmonicMonitorNumber = interharmonicMonitorNumber;
}
public Double getInterharmonicBiLi() {
return interharmonicBiLi;
}
public void setInterharmonicBiLi(Double interharmonicBiLi) {
this.interharmonicBiLi = interharmonicBiLi;
}
public Double getInterharmonicOverDayBiLi() {
return interharmonicOverDayBiLi;
}
public void setInterharmonicOverDayBiLi(Double interharmonicOverDayBiLi) {
this.interharmonicOverDayBiLi = interharmonicOverDayBiLi;
}
public Double getFrequencyAvg() {
return frequencyAvg;
}
public void setFrequencyAvg(Double frequencyAvg) {
this.frequencyAvg = frequencyAvg;
}
public Double getVoltageAvg() {
return voltageAvg;
}
public void setVoltageAvg(Double voltageAvg) {
this.voltageAvg = voltageAvg;
}
public Double getHarmonicVoltageAvg() {
return harmonicVoltageAvg;
}
public void setHarmonicVoltageAvg(Double harmonicVoltageAvg) {
this.harmonicVoltageAvg = harmonicVoltageAvg;
}
public Double getHarmonicCurrentAvg() {
return harmonicCurrentAvg;
}
public void setHarmonicCurrentAvg(Double harmonicCurrentAvg) {
this.harmonicCurrentAvg = harmonicCurrentAvg;
}
public Double getThreePhaseVoltageAvg() {
return threePhaseVoltageAvg;
}
public void setThreePhaseVoltageAvg(Double threePhaseVoltageAvg) {
this.threePhaseVoltageAvg = threePhaseVoltageAvg;
}
public Double getFlickerAvg() {
return flickerAvg;
}
public void setFlickerAvg(Double flickerAvg) {
this.flickerAvg = flickerAvg;
}
public Double getNegativeAvg() {
return negativeAvg;
}
public void setNegativeAvg(Double negativeAvg) {
this.negativeAvg = negativeAvg;
}
public Double getInterharmonicAvg() {
return interharmonicAvg;
}
public void setInterharmonicAvg(Double interharmonicAvg) {
this.interharmonicAvg = interharmonicAvg;
}
@Override
public String toString() {
return "AreaOverNoraml{" +
"name='" + name + '\'' +
", onlineMonitorNumber=" + onlineMonitorNumber +
", overLimitMonitorNumber=" + overLimitMonitorNumber +
", overBiLi=" + overBiLi +
", frequencyMonitorNumber=" + frequencyMonitorNumber +
", frequencyBiLi=" + frequencyBiLi +
", frequencyAvg=" + frequencyAvg +
", frequencyOverDayBiLi=" + frequencyOverDayBiLi +
", voltageMonitorNumber=" + voltageMonitorNumber +
", voltageBiLi=" + voltageBiLi +
", voltageAvg=" + voltageAvg +
", voltageOverDayBiLi=" + voltageOverDayBiLi +
", harmonicVoltageMonitorNumber=" + harmonicVoltageMonitorNumber +
", harmonicVoltageBiLi=" + harmonicVoltageBiLi +
", harmonicVoltageAvg=" + harmonicVoltageAvg +
", harmonicVoltageOverDayBiLi=" + harmonicVoltageOverDayBiLi +
", harmonicCurrentMonitorNumber=" + harmonicCurrentMonitorNumber +
", harmonicCurrentBiLi=" + harmonicCurrentBiLi +
", harmonicCurrentAvg=" + harmonicCurrentAvg +
", harmonicCurrentOverDayBiLi=" + harmonicCurrentOverDayBiLi +
", threePhaseVoltageMonitorNumber=" + threePhaseVoltageMonitorNumber +
", threePhaseVoltageBiLi=" + threePhaseVoltageBiLi +
", threePhaseVoltageAvg=" + threePhaseVoltageAvg +
", threePhaseVoltageOverDayBiLi=" + threePhaseVoltageOverDayBiLi +
", flickerMonitorNumber=" + flickerMonitorNumber +
", flickerBiLi=" + flickerBiLi +
", flickerAvg=" + flickerAvg +
", flickerOverDayBiLi=" + flickerOverDayBiLi +
", negativeMonitorNumber=" + negativeMonitorNumber +
", negativeBiLi=" + negativeBiLi +
", negativeAvg=" + negativeAvg +
", negativeOverDayBiLi=" + negativeOverDayBiLi +
", interharmonicMonitorNumber=" + interharmonicMonitorNumber +
", interharmonicBiLi=" + interharmonicBiLi +
", interharmonicAvg=" + interharmonicAvg +
", interharmonicOverDayBiLi=" + interharmonicOverDayBiLi +
'}';
}
}

View File

@@ -0,0 +1,50 @@
package com.pqs9000.pojo.responsibility;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @author hongawen
* @Date: 2019/4/3 13:34
*/
public class CustomerData implements Serializable {
private String customerName;
private List<Long> timeDatas=new ArrayList<>();
private List<Float> valueDatas=new ArrayList<>();
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public List<Long> getTimeDatas() {
return timeDatas;
}
public void setTimeDatas(List<Long> timeDatas) {
this.timeDatas = timeDatas;
}
public List<Float> getValueDatas() {
return valueDatas;
}
public void setValueDatas(List<Float> valueDatas) {
this.valueDatas = valueDatas;
}
@Override
public String toString() {
return "CustomerData{" +
"timeDatas=" + timeDatas +
", valueDatas=" + valueDatas +
'}';
}
}

View File

@@ -0,0 +1,48 @@
package com.pqs9000.pojo.responsibility;
import java.io.Serializable;
/**
* @author hongawen
* @Date: 2019/4/3 13:35
*/
public class CustomerResponsibility implements Serializable,Comparable<CustomerResponsibility> {
private String customerName;
private float responsibilityData;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public float getResponsibilityData() {
return responsibilityData;
}
public void setResponsibilityData(float responsibilityData) {
this.responsibilityData = responsibilityData;
}
@Override
public String toString() {
return "CustomerResponsibility{" +
"customerName='" + customerName + '\'' +
", responsibilityData=" + responsibilityData +
'}';
}
@Override
public int compareTo(CustomerResponsibility o) {
if(this.responsibilityData>o.getResponsibilityData()){
return -1;
}else if(this.responsibilityData==o.getResponsibilityData()){
}
return 1;
}
}

View File

@@ -0,0 +1,37 @@
package com.pqs9000.pojo.responsibility;
import java.io.Serializable;
/**
* @author hongawen
* @Date: 2019/5/5 20:20
*/
public class CustomerResponsibilitySeri implements Serializable {
private String customerName;
private float responsibilityData;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public float getResponsibilityData() {
return responsibilityData;
}
public void setResponsibilityData(float responsibilityData) {
this.responsibilityData = responsibilityData;
}
@Override
public String toString() {
return "CustomerResponsibilitySeri{" +
"customerName='" + customerName + '\'' +
", responsibilityData=" + responsibilityData +
'}';
}
}

Some files were not shown because too many files have changed in this diff Show More