Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d83f0746ac | |||
| f8e88b87d0 | |||
| 6df4074c59 | |||
| 2c3f04fc82 | |||
| cc52561395 | |||
|
|
a797381a7d | ||
| 99eff7d3d2 | |||
|
|
37c6e52281 | ||
|
|
533cf97495 | ||
|
|
1f96e18d65 | ||
| 295fddb935 | |||
|
|
7f6aa6f683 | ||
|
|
21035dc71b | ||
|
|
e2bbfb5e08 | ||
|
|
dddce82829 | ||
|
|
fa90fd7aaa | ||
|
|
5f2bb475cb | ||
|
|
64cf03d01c | ||
|
|
9a8742b02c | ||
|
|
f2e50dd100 | ||
| 228a8558ac | |||
|
|
14707fe3e9 | ||
|
|
b5ee0a5182 | ||
|
|
a5a1f58d30 | ||
|
|
400b8cde31 | ||
|
|
7220c526ce | ||
| d14e83c935 | |||
|
|
0b930f1adf | ||
|
|
848bb5f6b0 | ||
|
|
601ae475e0 | ||
|
|
dd2f738c00 | ||
|
|
bc3702b1f1 | ||
|
|
014afd0a2a | ||
|
|
f7c0045cf4 | ||
| 9a65c1b133 | |||
|
|
9da41273e5 | ||
|
|
e2ecf7bb04 | ||
| 4d0490994a | |||
| e94beddcff | |||
|
|
6a1bd88ab8 | ||
|
|
169b701fa9 | ||
| 6a97015cd6 | |||
|
|
b2ab4ee825 | ||
|
|
cc85660043 | ||
|
|
4f7b444737 | ||
| e729485d25 | |||
| f701507fae | |||
| 149d017c49 | |||
| 11116929cc | |||
| e4049de260 | |||
| b4be12e30e | |||
| 1b169830f9 | |||
| 417b36c884 | |||
| d5c18198b9 | |||
| 4a38148d7a | |||
| ab68a98999 | |||
| d435398c64 | |||
| 1acba83ff2 | |||
| 43af977942 | |||
| f0ffb63cff | |||
| ac24724ee8 | |||
| 8f4949af80 | |||
| f1d0e7df42 | |||
| 265eeb7bdd | |||
|
|
78524de495 | ||
|
|
5125ef738a | ||
|
|
721aa81c36 | ||
|
|
eb54a13226 | ||
| 9bc072ec8b | |||
|
|
f380c51a89 | ||
|
|
386e4cb647 | ||
| 46f54685b1 | |||
|
|
55f04541bd | ||
|
|
840c48e136 | ||
| a122df4763 | |||
| f656c15dc5 | |||
| e47584a118 | |||
| 63617c92c0 | |||
| efc075b4a9 | |||
| 3e3165bed8 | |||
| ea70f0fc2c | |||
| 7e130e9eb0 | |||
| da3e897fc2 | |||
|
|
932ab2d6f5 | ||
|
|
f3223bd680 | ||
|
|
9bee2386bf | ||
|
|
3f56fa0de9 | ||
|
|
62db637bdd | ||
|
|
39c9d1f54e | ||
|
|
0c9a93f600 | ||
| fad2279980 | |||
| 99d8e89bec | |||
|
|
8a5fec58d1 | ||
| f603794110 | |||
| 7d727088c2 | |||
|
|
2a703a8c30 | ||
| 1ff860bda9 | |||
| fe756e0f87 | |||
| 373cd71b02 | |||
| 49a3afb505 |
@@ -3,6 +3,7 @@ package com.njcn.advance.pojo.carrycapacity.excel;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.converters.localdatetime.LocalDateTimeStringConverter;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -19,7 +20,8 @@ import java.util.List;
|
||||
@Data
|
||||
public class CarryCapcityDataEexcel {
|
||||
|
||||
@ExcelProperty(index = 0,value = "时间",converter = LocalDateTimeStringConverter.class)
|
||||
@ExcelProperty(index = 0,value = "时间(格式为yyyy-MM-dd hh:mm:ss)",converter = LocalDateTimeStringConverter.class)
|
||||
@JSONField(format = "yyyy-MM-dd hh:mm:ss")
|
||||
private LocalDateTime time;
|
||||
|
||||
@ExcelProperty(index =1,value = {"电压","A"})
|
||||
|
||||
@@ -331,7 +331,7 @@ public class CarryCapcityDataIEexcel {
|
||||
DataI dataI = new DataI();
|
||||
BeanUtils.copyProperties(carryCapcityDataIEexcel,dataI);
|
||||
dataI.setPhaseType(phase);
|
||||
dataI.setTime(carryCapcityDataIEexcel.getTime().plusSeconds(8*60*60));
|
||||
dataI.setTime(carryCapcityDataIEexcel.getTime());
|
||||
|
||||
if (phase.equals("A")) {
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CarryCapcityDataPEexcel {
|
||||
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
||||
BeanUtils.copyProperties(carryCapcityDataPEexcel,carryCapcityData);
|
||||
carryCapcityData.setPhaseType(phase);
|
||||
carryCapcityData.setTime(carryCapcityDataPEexcel.getTime().plusSeconds(8*60*60));
|
||||
carryCapcityData.setTime(carryCapcityDataPEexcel.getTime());
|
||||
|
||||
if (phase.equals("A")) {
|
||||
carryCapcityData.setValue(carryCapcityDataPEexcel.getValue_a());
|
||||
|
||||
@@ -49,7 +49,7 @@ public class CarryCapcityDataQEexcel {
|
||||
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
||||
BeanUtils.copyProperties(carryCapcityDataQEexcel,carryCapcityData);
|
||||
carryCapcityData.setPhaseType(phase);
|
||||
carryCapcityData.setTime(carryCapcityDataQEexcel.getTime().plusSeconds(8*60*60));
|
||||
carryCapcityData.setTime(carryCapcityDataQEexcel.getTime());
|
||||
|
||||
if (phase.equals("A")) {
|
||||
carryCapcityData.setValue(carryCapcityDataQEexcel.getValue_a());
|
||||
|
||||
@@ -48,7 +48,7 @@ public class CarryCapcityDataVEexcel {
|
||||
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
||||
BeanUtils.copyProperties(carryCapcityDataVEexcel,carryCapcityData);
|
||||
carryCapcityData.setPhaseType(phase);
|
||||
carryCapcityData.setTime(carryCapcityDataVEexcel.getTime().plusSeconds(8*60*60));
|
||||
carryCapcityData.setTime(carryCapcityDataVEexcel.getTime());
|
||||
|
||||
if (phase.equals("A")) {
|
||||
carryCapcityData.setValue(carryCapcityDataVEexcel.getValue_a());
|
||||
|
||||
@@ -23,7 +23,6 @@ public class CarryCapacityDeviceParam {
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
|
||||
private String devName;
|
||||
|
||||
private String devScale;
|
||||
|
||||
@@ -31,7 +31,6 @@ public class CarryCapacityUserParam {
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,35 +1,16 @@
|
||||
package com.njcn.advance.pojo.dto.relevent;
|
||||
|
||||
import com.njcn.advance.pojo.dto.SagEvent;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
public class EntityGroupEvtData implements Cloneable,Comparable<EntityGroupEvtData> {
|
||||
|
||||
//逻辑节点序号
|
||||
private int node;
|
||||
//事件开始时间时标
|
||||
private int start_time;
|
||||
//类别
|
||||
private int cata;
|
||||
//标注类别
|
||||
private int cata2;
|
||||
//物理节点
|
||||
private String nodePhysics;
|
||||
|
||||
private int node;//逻辑节点序号
|
||||
private int start_time;//事件开始时间时标
|
||||
private int cata;//类别
|
||||
private int cata2;//标注类别
|
||||
private String nodePhysics; //物理节点
|
||||
private SagEvent sagEvent;
|
||||
|
||||
private String sagReason;
|
||||
|
||||
|
||||
public Object objClone() {
|
||||
try {
|
||||
return clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
return new EntityGroupEvtData(null, -1, -1, -1,null,null);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityGroupEvtData(String nodePhysics, int start_time, int cata, int cata2,SagEvent sagEvent,String sagReason) {
|
||||
this.nodePhysics = nodePhysics;
|
||||
this.start_time = start_time;
|
||||
@@ -39,6 +20,144 @@ public class EntityGroupEvtData implements Cloneable,Comparable<EntityGroupEvtDa
|
||||
this.sagReason = sagReason;
|
||||
}
|
||||
|
||||
public SagEvent getSagEvent() {
|
||||
return sagEvent;
|
||||
}
|
||||
|
||||
public void setSagEvent(SagEvent sagEvent) {
|
||||
this.sagEvent = sagEvent;
|
||||
}
|
||||
|
||||
public String getNodePhysics() {
|
||||
return nodePhysics;
|
||||
}
|
||||
|
||||
public void setNodePhysics(String nodePhysics) {
|
||||
this.nodePhysics = nodePhysics;
|
||||
}
|
||||
|
||||
public int getNode() {
|
||||
return node;
|
||||
}
|
||||
|
||||
public void setNode(int node) {
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
public int getStart_time() {
|
||||
return start_time;
|
||||
}
|
||||
|
||||
public void setStart_time(int start_time) {
|
||||
this.start_time = start_time;
|
||||
}
|
||||
|
||||
public int getCata() {
|
||||
return cata;
|
||||
}
|
||||
|
||||
public void setCata(int cata) {
|
||||
this.cata = cata;
|
||||
}
|
||||
|
||||
public int getCata2() {
|
||||
return cata2;
|
||||
}
|
||||
|
||||
public void setCata2(int cata2) {
|
||||
this.cata2 = cata2;
|
||||
}
|
||||
|
||||
public String getSagReason() {
|
||||
return sagReason;
|
||||
}
|
||||
|
||||
public void setSagReason(String sagReason) {
|
||||
this.sagReason = sagReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a copy of this object. The precise meaning
|
||||
* of "copy" may depend on the class of the object. The general
|
||||
* intent is that, for any object {@code x}, the expression:
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* x.clone() != x</pre></blockquote>
|
||||
* will be true, and that the expression:
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* x.clone().getClass() == x.getClass()</pre></blockquote>
|
||||
* will be {@code true}, but these are not absolute requirements.
|
||||
* While it is typically the case that:
|
||||
* <blockquote>
|
||||
* <pre>
|
||||
* x.clone().equals(x)</pre></blockquote>
|
||||
* will be {@code true}, this is not an absolute requirement.
|
||||
*
|
||||
* By convention, the returned object should be obtained by calling
|
||||
* {@code super.clone}. If a class and all of its superclasses (except
|
||||
* {@code Object}) obey this convention, it will be the case that
|
||||
* {@code x.clone().getClass() == x.getClass()}.
|
||||
*
|
||||
* By convention, the object returned by this method should be independent
|
||||
* of this object (which is being cloned). To achieve this independence,
|
||||
* it may be necessary to modify one or more fields of the object returned
|
||||
* by {@code super.clone} before returning it. Typically, this means
|
||||
* copying any mutable objects that comprise the internal "deep structure"
|
||||
* of the object being cloned and replacing the references to these
|
||||
* objects with references to the copies. If a class contains only
|
||||
* primitive fields or references to immutable objects, then it is usually
|
||||
* the case that no fields in the object returned by {@code super.clone}
|
||||
* need to be modified.
|
||||
*
|
||||
* The method {@code clone} for class {@code Object} performs a
|
||||
* specific cloning operation. First, if the class of this object does
|
||||
* not implement the interface {@code Cloneable}, then a
|
||||
* {@code CloneNotSupportedException} is thrown. Note that all arrays
|
||||
* are considered to implement the interface {@code Cloneable} and that
|
||||
* the return type of the {@code clone} method of an array type {@code T[]}
|
||||
* is {@code T[]} where T is any reference or primitive type.
|
||||
* Otherwise, this method creates a new instance of the class of this
|
||||
* object and initializes all its fields with exactly the contents of
|
||||
* the corresponding fields of this object, as if by assignment; the
|
||||
* contents of the fields are not themselves cloned. Thus, this method
|
||||
* performs a "shallow copy" of this object, not a "deep copy" operation.
|
||||
*
|
||||
* The class {@code Object} does not itself implement the interface
|
||||
* {@code Cloneable}, so calling the {@code clone} method on an object
|
||||
* whose class is {@code Object} will result in throwing an
|
||||
* exception at run time.
|
||||
*
|
||||
* @return a clone of this instance.
|
||||
* @throws CloneNotSupportedException if the object's class does not
|
||||
* support the {@code Cloneable} interface. Subclasses
|
||||
* that override the {@code clone} method can also
|
||||
* throw this exception to indicate that an instance cannot
|
||||
* be cloned.
|
||||
* @see Cloneable
|
||||
*/
|
||||
@Override
|
||||
protected Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
public Object objClone() {
|
||||
try {
|
||||
return clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
return new EntityGroupEvtData("-1", -1, -1, -1,null,null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EntityGroupEvtData{" +
|
||||
"node=" + node +
|
||||
", start_time=" + start_time +
|
||||
", cata=" + cata +
|
||||
", cata2=" + cata2 +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(EntityGroupEvtData obj) {
|
||||
|
||||
@@ -8,9 +8,9 @@ public class EntityLogic {
|
||||
//物理隔绝变压器策略GUID
|
||||
private String tPIndex;
|
||||
//变压器逻辑上节点
|
||||
private String node_h;
|
||||
private Integer node_h;
|
||||
//变压器逻辑下节点
|
||||
private String node_l;
|
||||
private Integer node_l;
|
||||
// 变压器连接方式
|
||||
private Integer type;
|
||||
//变压器物理上节点
|
||||
|
||||
@@ -69,3 +69,4 @@ public class EntityMtrans implements Serializable {
|
||||
+ Arrays.toString(possiable_path) + ", path_num=" + path_num + "]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.njcn.advance.pojo.dto.relevent;
|
||||
|
||||
import com.njcn.advance.pojo.dto.SagEvent;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.advance.pojo.dto;
|
||||
package com.njcn.advance.pojo.dto.relevent;
|
||||
|
||||
import com.njcn.advance.pojo.dto.relevent.PlantInfo;
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.advance.utils;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/12/10 14:51【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public class CheckStringUtil {
|
||||
public static void checkName(String name) {
|
||||
Pattern pattern = Pattern.compile(PatternRegex.SPECIALCHARACTER);
|
||||
if(pattern.matcher(name).find()){
|
||||
throw new BusinessException(ValidMessage.NAME_SPECIAL_REGEX);
|
||||
}
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// checkName("100迈岭站2djvjva13ad");
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.advance.utils;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
@Component
|
||||
public class InstantiateUtil<E> {
|
||||
private static final Logger logger= LoggerFactory.getLogger(InstantiateUtil.class);
|
||||
|
||||
|
||||
public byte[] instantiate(E e) {
|
||||
if (e == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
try {
|
||||
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
|
||||
objectOutputStream.writeObject(e);
|
||||
objectOutputStream.close();
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
|
||||
} catch (IOException e1) {
|
||||
logger.error("发生异常,"+e1.getMessage());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public <E> E deInstantiate(byte[] bytes) {
|
||||
if (bytes == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
|
||||
try {
|
||||
ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
|
||||
try {
|
||||
return (E) objectInputStream.readObject();
|
||||
} catch (ClassNotFoundException e) {
|
||||
logger.error("发生异常,"+e.getMessage());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("发生异常,"+e.getMessage());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String stringInstantiate(E e) { //序列化对象的byte[]数组转为字符串(包装类可不调用)
|
||||
byte[] bytes = instantiate(e);
|
||||
|
||||
if (bytes != null && bytes.length>0 ) {
|
||||
return Base64.encode(bytes);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public byte[] stringDeInstantiate(String str) { //stringInstantiate方法还原为byte[]数组
|
||||
if (!StringUtils.isEmpty(str)) {
|
||||
return Base64.decode(str);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.njcn.advance.pojo.po.PqsRelevanceLog;
|
||||
import com.njcn.advance.service.EventRelevantAnalysisService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -14,17 +15,20 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -33,11 +37,11 @@ import java.util.Map;
|
||||
* @author cdf
|
||||
* @date 2023/6/30
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("process")
|
||||
@Api(tags = "暂降事件关联分析")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class EventRelevantAnalysisController extends BaseController {
|
||||
|
||||
private final EventRelevantAnalysisService eventRelevantAnalysisService;
|
||||
@@ -78,6 +82,11 @@ public class EventRelevantAnalysisController extends BaseController {
|
||||
@ApiOperation("事件波形分析主列表")
|
||||
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("queryEventsAssPage");
|
||||
String searchValue = baseParam.getSearchValue();
|
||||
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
||||
if(pattern.matcher(searchValue).find()){
|
||||
throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
||||
}
|
||||
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
@@ -188,4 +197,12 @@ public class EventRelevantAnalysisController extends BaseController {
|
||||
boolean flag = eventRelevantAnalysisService.delRelevantLog(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.advance.controller.eventGui;
|
||||
|
||||
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.DataInputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("process")
|
||||
@Api(tags = "暂降事件关联分析")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class EventGuiController {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.njcn.advance.mapper;
|
||||
|
||||
public interface RelevanceMapper {
|
||||
|
||||
|
||||
// 查询监测点的线路ID
|
||||
String queryLineIdbyPointId(String pointId);
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.njcn.advance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.advance.pojo.dto.SagEvent;
|
||||
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.njcn.advance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.advance.pojo.dto.SagEvent;
|
||||
|
||||
import com.njcn.advance.pojo.dto.relevent.EventAssObj;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.advance.mapper.RelevanceMapper">
|
||||
|
||||
<select id="queryLineIdbyPointId" resultType="string" parameterType="string">
|
||||
select pid from pq_line where id = #{pointId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryCodebyGuid" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||
select triphase from sys_dict_data where id = #{guid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -2,14 +2,11 @@ package com.njcn.advance.service.carrycapacity.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||
import com.njcn.advance.mapper.carrycapacity.CarryCapacityDevicePOMapper;
|
||||
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityDeviceParam;
|
||||
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityUserParam;
|
||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityDevicePO;
|
||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityUserPO;
|
||||
import com.njcn.advance.service.carrycapacity.CarryCapacityDevicePOService;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.advance.utils.CheckStringUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -36,6 +33,7 @@ public class CarryCapacityDevicePOServiceImpl extends ServiceImpl<CarryCapacityD
|
||||
checkName(deviceParam,true);
|
||||
return this.lambdaUpdate().eq(CarryCapacityDevicePO::getDevId, deviceParam.getDevId())
|
||||
.set(CarryCapacityDevicePO::getDevName, deviceParam.getDevName())
|
||||
.set(CarryCapacityDevicePO::getDevScale, deviceParam.getDevScale())
|
||||
.set(CarryCapacityDevicePO::getProtocolCapacity, deviceParam.getProtocolCapacity())
|
||||
.update();
|
||||
}
|
||||
@@ -59,6 +57,12 @@ public class CarryCapacityDevicePOServiceImpl extends ServiceImpl<CarryCapacityD
|
||||
* @return 结果
|
||||
*/
|
||||
private void checkName(CarryCapacityDeviceParam carryCapacityDeviceParam, boolean isUpdate) {
|
||||
if(carryCapacityDeviceParam.getDevName().length()>32){
|
||||
throw new BusinessException("超过最大长度");
|
||||
|
||||
}
|
||||
CheckStringUtil.checkName(carryCapacityDeviceParam.getDevName());
|
||||
|
||||
LambdaQueryWrapper<CarryCapacityDevicePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//条件组合:where state = 1 and name = ?
|
||||
lambdaQueryWrapper.eq(CarryCapacityDevicePO::getUserId,carryCapacityDeviceParam.getUserId()).eq(CarryCapacityDevicePO::getDevName, carryCapacityDeviceParam.getDevName());
|
||||
|
||||
@@ -48,12 +48,14 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -131,8 +133,8 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
|
||||
CollectionUtil.isEmpty(dataHarmPowerQ2List) ||
|
||||
CollectionUtil.isEmpty(dataHarmPowerU2List)) {
|
||||
CarryCapacityDataPO one = carryCapacityDataPOService.lambdaQuery().eq(CarryCapacityDataPO::getLineId, lineId)
|
||||
.eq(CarryCapacityDataPO::getStartTime, startTime)
|
||||
.eq(CarryCapacityDataPO::getEndTime, endTime).one();
|
||||
.eq(CarryCapacityDataPO::getStartTime, queryParam.getStartTime())
|
||||
.eq(CarryCapacityDataPO::getEndTime, queryParam.getEndTime()).one();
|
||||
if (Objects.nonNull(one)) {
|
||||
//todo 调用查询文件
|
||||
InputStream fileStream = fileStorageUtil.getFileStream(one.getDateList());
|
||||
@@ -264,6 +266,10 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
|
||||
|
||||
|
||||
}
|
||||
// dataHarmPowerpList = dataHarmPowerpList.stream().map(temp -> {
|
||||
// temp.setTime(temp.getTime().plusMillis(TimeUnit.HOURS.toMillis(8)));
|
||||
// return temp;
|
||||
// }).collect(Collectors.toList());
|
||||
carryCapacityDataVO.setData(dataHarmPowerpList);
|
||||
|
||||
|
||||
@@ -330,6 +336,11 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
|
||||
redisUtil.saveByKey(lineId + "#" + LocalDateTimeUtil.format(startDate, formatter) + "#" + LocalDateTimeUtil.format(endDate, formatter) + "#" + "Q",
|
||||
dataHarmPowerqList);
|
||||
}
|
||||
// dataHarmPowerqList = dataHarmPowerqList.stream().map(temp -> {
|
||||
// temp.setTime(temp.getTime().plusMillis(TimeUnit.HOURS.toMillis(8)));
|
||||
// return temp;
|
||||
// }).collect(Collectors.toList());
|
||||
|
||||
carryCapacityDataqVO.setData(dataHarmPowerqList);
|
||||
|
||||
|
||||
@@ -383,6 +394,11 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
|
||||
stringBuilder2.append("line_id='").append(lineId).append("' and ").append(InfluxDbSqlConstant.TIME + " >= '").append(startTime).append("' and ").append(InfluxDbSqlConstant.TIME).append(" <= '").append(endTime).append("' group by time(").append(timeInterval).append("m),* fill(3.1415926) ").append(InfluxDbSqlConstant.TZ);
|
||||
String sqlI1 = "select " + stringBuilder1 + " from " + InfluxDBTableConstant.DATA_I + " where value_type='CP95' and phasic_type!='T' and " + stringBuilder2;
|
||||
dataI = dataiMapper.getSqlResult(sqlI1);
|
||||
//此处查询influxdb少8个小时
|
||||
dataI = dataI.stream().map(temp -> {
|
||||
temp.setTime(temp.getTime().plusMillis(TimeUnit.HOURS.toMillis(8)));
|
||||
return temp;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(dataI)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
} else {
|
||||
@@ -613,66 +629,66 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
|
||||
|
||||
//数据校验
|
||||
if (CollectionUtil.isEmpty(dataHarmPowerpList)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据及其上周是否充足");
|
||||
} else {
|
||||
|
||||
if (checkData(dataHarmPowerpList, startDate, endDate, timeInterval)) {
|
||||
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据是否充足");
|
||||
}
|
||||
}
|
||||
linearInterpolation(dataHarmPowerpList);
|
||||
|
||||
//数据校验
|
||||
if (CollectionUtil.isEmpty(dataHarmPowerp2List)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据及其上周是否充足");
|
||||
} else {
|
||||
|
||||
if (checkData(dataHarmPowerp2List, startDate2, endDate2, timeInterval)) {
|
||||
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的前一周数据量是否充足");
|
||||
}
|
||||
}
|
||||
linearInterpolation(dataHarmPowerp2List);
|
||||
|
||||
//数据校验
|
||||
if (CollectionUtil.isEmpty(dataHarmPowerqList)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据及其上周是否充足");
|
||||
} else {
|
||||
|
||||
if (checkData(dataHarmPowerqList, startDate, endDate, timeInterval)) {
|
||||
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据是否充足");
|
||||
}
|
||||
}
|
||||
linearInterpolation(dataHarmPowerqList);
|
||||
|
||||
//数据校验
|
||||
if (CollectionUtil.isEmpty(dataHarmPowerq2List)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据及其上周是否充足");
|
||||
} else {
|
||||
|
||||
if (checkData(dataHarmPowerq2List, startDate2, endDate2, timeInterval)) {
|
||||
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的前一周数据量是否充足");
|
||||
}
|
||||
}
|
||||
linearInterpolation(dataHarmPowerq2List);
|
||||
|
||||
//数据校验
|
||||
if (CollectionUtil.isEmpty(dataHarmPoweruList)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据及其上周是否充足");
|
||||
} else {
|
||||
|
||||
if (checkData(dataHarmPoweruList, startDate2, endDate2, timeInterval)) {
|
||||
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的前一周数据量是否充足");
|
||||
}
|
||||
}
|
||||
linearInterpolation(dataHarmPoweruList);
|
||||
|
||||
if (CollectionUtil.isEmpty(dataiList)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据及其上周是否充足");
|
||||
} else {
|
||||
List<CarryCapcityData> iList = dataiList.stream().map(temp -> {
|
||||
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
||||
@@ -682,7 +698,7 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
|
||||
}).collect(Collectors.toList());
|
||||
if (checkData(iList, startDate, endDate, timeInterval)) {
|
||||
|
||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||
throw new BusinessException("数据量过少,请查看上传数据集的数据集时间与页面选择时间"+startDate+"-"+endDate+"的本周数据量是否充足");
|
||||
}
|
||||
}
|
||||
linearInterpolationI(dataiList);
|
||||
@@ -711,7 +727,6 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public CarryCapacityDResultVO carryCapacityEvaluate(CarryCapacityEvaluateParam calParam) {
|
||||
CarryCapacityDResultVO vo = new CarryCapacityDResultVO();
|
||||
@@ -933,6 +948,7 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
|
||||
|
||||
try {
|
||||
List<CarryCapcityDataEexcel> objects = EasyExcelUtil.syncReadModel(is, CarryCapcityDataEexcel.class, 0, 3);
|
||||
objects = objects.stream().filter(temp -> Objects.nonNull(temp.getTime())).collect(Collectors.toList());
|
||||
List<CarryCapcityDataIEexcel> iEexcelList = new ArrayList<>();
|
||||
List<CarryCapcityDataVEexcel> vEexcelList = new ArrayList<>();
|
||||
List<CarryCapcityDataPEexcel> pEexcelList = new ArrayList<>();
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.advance.mapper.carrycapacity.CarryCapacityStrategyDhlPOMapper;
|
||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityStrategyDhlPO;
|
||||
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityStrategyDhlVO;
|
||||
import com.njcn.advance.service.carrycapacity.CarryCapacityStrategyDhlPOService;
|
||||
import com.njcn.advance.utils.CheckStringUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityStrategyDhlPO;
|
||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityStrategyPO;
|
||||
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityStrategyVO;
|
||||
import com.njcn.advance.service.carrycapacity.CarryCapacityStrategyPOService;
|
||||
import com.njcn.advance.utils.CheckStringUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -38,6 +39,7 @@ public class CarryCapacityStrategyPOServiceImpl extends ServiceImpl<CarryCapacit
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean add(CarryCapacityStrategyParam carryCapacityStrategyParam) {
|
||||
|
||||
CarryCapacityStrategyPO carryCapacityStrategy = new CarryCapacityStrategyPO();
|
||||
BeanUtils.copyProperties(carryCapacityStrategyParam, carryCapacityStrategy);
|
||||
//将原始策略处理为不启用
|
||||
|
||||
@@ -11,7 +11,9 @@ import com.njcn.advance.mapper.carrycapacity.CarryCapacityUserPOMapper;
|
||||
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityUserParam;
|
||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityUserPO;
|
||||
import com.njcn.advance.service.carrycapacity.CarryCapacityUserPOService;
|
||||
import com.njcn.advance.utils.CheckStringUtil;
|
||||
import com.njcn.common.pojo.constant.LogInfo;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||
@@ -19,6 +21,7 @@ import com.njcn.harmonic.pojo.param.ReportTemplateParam;
|
||||
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -26,6 +29,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -57,6 +61,11 @@ public class CarryCapacityUserPOServiceImpl extends ServiceImpl<CarryCapacityUse
|
||||
* @return 结果
|
||||
*/
|
||||
private void checkName(CarryCapacityUserParam carryCapacityUserParam, boolean isUpdate) {
|
||||
if(carryCapacityUserParam.getUserName().length()>32){
|
||||
throw new BusinessException("超过最大长度");
|
||||
|
||||
}
|
||||
CheckStringUtil.checkName(carryCapacityUserParam.getUserName());
|
||||
LambdaQueryWrapper<CarryCapacityUserPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//条件组合:where state = 1 and name = ?
|
||||
lambdaQueryWrapper.eq(CarryCapacityUserPO::getStatus, DataStateEnum.ENABLE.getCode()).eq(CarryCapacityUserPO::getUserName, carryCapacityUserParam.getUserName());
|
||||
@@ -82,7 +91,7 @@ public class CarryCapacityUserPOServiceImpl extends ServiceImpl<CarryCapacityUse
|
||||
if(StringUtils.isBlank(userUpdateParam.getUserName())){
|
||||
throw new BusinessException("用户称不能为空");
|
||||
}
|
||||
checkName(userUpdateParam,false);
|
||||
checkName(userUpdateParam,true);
|
||||
CarryCapacityUserPO carryCapacityUser = new CarryCapacityUserPO();
|
||||
BeanUtils.copyProperties(userUpdateParam, carryCapacityUser);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ public class SgEventServiceImpl extends ServiceImpl<SgEventMapper, SgEvent> impl
|
||||
|
||||
@Override
|
||||
public void downloadTemplate() {
|
||||
ExcelUtil.exportExcel("暂降事件模板.xls", "暂降数据", SgEventExcel.class, new ArrayList<>());
|
||||
ExcelUtil.exportExcel("暂降事件模板.csv", "暂降数据", SgEventExcel.class, new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,9 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.SerializeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -15,7 +17,7 @@ import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||
import com.njcn.advance.mapper.RelevantLogMapper;
|
||||
import com.njcn.advance.mapper.RmpEventAdvanceMapper;
|
||||
import com.njcn.advance.mapper.RmpEventDetailAssMapper;
|
||||
import com.njcn.advance.pojo.dto.SagEvent;
|
||||
|
||||
import com.njcn.advance.pojo.dto.relevent.*;
|
||||
import com.njcn.advance.pojo.po.PqsRelevanceLog;
|
||||
import com.njcn.advance.service.EventRelevantAnalysisService;
|
||||
@@ -26,10 +28,12 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.PqsTflgployass;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
@@ -40,8 +44,10 @@ import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -63,6 +69,8 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanceMapper, RmpEventDetailPO> implements EventRelevantAnalysisService {
|
||||
|
||||
private final String redisSortKey = "NODESORT";
|
||||
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
@@ -78,6 +86,8 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -85,11 +95,6 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
|
||||
TimeInterval timeInterval = new TimeInterval();
|
||||
|
||||
DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.EVENT_REASON.getName(), DicDataEnum.SHORT_TROUBLE.getName()).getData();
|
||||
if (Objects.isNull(dictData)) {
|
||||
throw new BusinessException(SystemResponseEnum.ADVANCE_REASON);
|
||||
}
|
||||
|
||||
|
||||
LocalDateTime date = LocalDateTime.now();
|
||||
HandleEvent handleEvent = new HandleEvent();
|
||||
@@ -98,62 +103,58 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
if (CollectionUtil.isEmpty(baseList)) {
|
||||
throw new BusinessException("当前时间段暂无可分析事件");
|
||||
}
|
||||
List<EntityGroupEvtData> list3 = new ArrayList<>(baseList);
|
||||
|
||||
// 传入的处理事件根据物理隔绝进行分组
|
||||
|
||||
List<EntityLogic> strategyList = relevantLogMapper.getLogic();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(strategyList)) {
|
||||
Map<String, EntityMtrans> entityMtransMap = getNodeInfo();
|
||||
Set<Map.Entry<String, EntityMtrans>> setMtrans = entityMtransMap.entrySet();
|
||||
|
||||
List<SagEvent> listSagEvent = new ArrayList<>();
|
||||
List<EventAssObj> listEventAssObj = new ArrayList<>();
|
||||
|
||||
Map<String, List<String>> strategyToBusBarMap = new HashMap<>(32);
|
||||
Map<String, Map<String, Integer>> nodeMap = (Map<String, Map<String, Integer>>)redisUtil.getObjectByKey(redisSortKey);
|
||||
Set<Map.Entry<String, Map<String, Integer>>> nodeSort = nodeMap.entrySet();
|
||||
|
||||
Map<String, EntityMtrans> mapRedis = new HashMap<>(32);
|
||||
|
||||
Map<String, List<EntityLogic>> strategyMap = strategyList.stream().collect(Collectors.groupingBy(EntityLogic::getTPIndex));
|
||||
strategyMap.forEach((key, list) -> {
|
||||
List<String> before = list.stream().map(EntityLogic::getNodeBefore).distinct().collect(Collectors.toList());
|
||||
List<String> after = list.stream().map(EntityLogic::getNodeNext).distinct().collect(Collectors.toList());
|
||||
before.addAll(after);
|
||||
before = before.stream().distinct().collect(Collectors.toList());
|
||||
strategyToBusBarMap.put(key, before);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.EVENT_REASON.getName(), DicDataEnum.SHORT_TROUBLE.getName()).getData();
|
||||
if (Objects.isNull(dictData)) {
|
||||
throw new BusinessException(SystemResponseEnum.ADVANCE_REASON);
|
||||
}
|
||||
|
||||
FinalData.NODE_NUM = before.size();
|
||||
EntityMtrans entityMtrans = new EntityMtrans();
|
||||
handleEvent.create_matrixcata(list, entityMtrans);
|
||||
for (Map.Entry<String, Map<String, Integer>> m : nodeSort) {
|
||||
List<EntityGroupEvtData> list = new ArrayList<EntityGroupEvtData>();
|
||||
Set<Map.Entry<String, Integer>> mapValue = m.getValue().entrySet();
|
||||
FinalData.NODE_NUM = m.getValue().size();
|
||||
|
||||
mapRedis.put(key, entityMtrans);
|
||||
});
|
||||
|
||||
strategyToBusBarMap.forEach((lastKey, lastVal) -> {
|
||||
int index = 1;
|
||||
List<EntityGroupEvtData> list = new ArrayList<>();
|
||||
for (EntityGroupEvtData entityGroupEvtData : baseList) {
|
||||
if (lastVal.contains(entityGroupEvtData.getNodePhysics()) && dictData.getId().equals(entityGroupEvtData.getSagReason())) {
|
||||
entityGroupEvtData.setNode(index++);
|
||||
list.add(entityGroupEvtData);
|
||||
for (Map.Entry<String, Integer> mm : mapValue) {
|
||||
for (EntityGroupEvtData groupEvtData : baseList) {
|
||||
if (groupEvtData.getNodePhysics().equals(mm.getKey()) && dictData.getId().equals(groupEvtData.getSagReason())) {
|
||||
groupEvtData.setNode(mm.getValue());
|
||||
list.add(groupEvtData);
|
||||
}
|
||||
}
|
||||
|
||||
baseList.removeIf(entityGroupEvtData -> lastVal.contains(entityGroupEvtData.getNodePhysics()) && dictData.getId().equals(entityGroupEvtData.getSagReason()));
|
||||
|
||||
// 筛选不在矩阵中的事件id
|
||||
list3.removeIf(entityGroupEvtData -> entityGroupEvtData.getNodePhysics().equals(mm.getKey()) && dictData.getId().equals(entityGroupEvtData.getSagReason()));
|
||||
}
|
||||
|
||||
EntityGroupEvtData[] entityGroupEvtData = new EntityGroupEvtData[list.size()];
|
||||
Collections.sort(list);
|
||||
list.toArray(entityGroupEvtData);
|
||||
|
||||
mapRedis.forEach((mKey, mVal) -> {
|
||||
if (mKey.equals(lastKey)) {
|
||||
/********************************************************************
|
||||
* 算法最多处理1000条数据,超过限制需分批处理 先将数据根据某种方式进行升序/降序排序,然后分段处理 加入循环处理
|
||||
*********************************************************************/
|
||||
for (Map.Entry<String, EntityMtrans> mEntry : setMtrans) {
|
||||
if (mEntry.getKey().equals(m.getKey())) {
|
||||
|
||||
//算法最多处理1000条数据,超过限制需分批处理 先将数据根据某种方式进行升序/降序排序,然后分段处理 加入循环处理
|
||||
|
||||
int circulation = entityGroupEvtData.length % FinalData.MAX_EVT_NUM == 0
|
||||
? entityGroupEvtData.length / FinalData.MAX_EVT_NUM
|
||||
: entityGroupEvtData.length / FinalData.MAX_EVT_NUM + 1;
|
||||
|
||||
for (int i = 0; i < circulation; i++) {
|
||||
int to;
|
||||
int to = 0;
|
||||
|
||||
if (i == circulation - 1) {
|
||||
to = entityGroupEvtData.length % FinalData.MAX_EVT_NUM > 0
|
||||
? entityGroupEvtData.length
|
||||
@@ -164,19 +165,22 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
|
||||
EntityGroupEvtData[] arrayObj = Arrays.copyOfRange(entityGroupEvtData,
|
||||
i * FinalData.MAX_EVT_NUM, to);
|
||||
EntityGroupData entityGroupData = handleEvent.translate(arrayObj, mVal);
|
||||
EntityMtrans entityMtrans = mEntry.getValue();
|
||||
EntityGroupData entityGroupData = handleEvent.translate(arrayObj,entityMtrans);
|
||||
// 处理分析结果
|
||||
handleEvent.show_group_info(entityGroupData, listSagEvent, listEventAssObj, date);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* 事件ID不在矩阵中,结果集为基础以时标为标准进行归集处理 注意:三相与(单相/两相)互斥
|
||||
*****************************************************************************/
|
||||
disposeNonStandardData(handleEvent, baseList, listEventAssObj, listSagEvent, date);
|
||||
|
||||
|
||||
@@ -216,13 +220,232 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
entityPqsRelevance.setTimeId(date);
|
||||
relevantLogMapper.insert(entityPqsRelevance);
|
||||
|
||||
} else {
|
||||
throw new BusinessException("当前无变压器策略,请先配置策略");
|
||||
}
|
||||
|
||||
|
||||
log.info("事件关联分析用时:" + timeInterval.interval() / 1000 + "秒");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void processEvents(LocalDateTime startTime, LocalDateTime endTime) {
|
||||
//
|
||||
// TimeInterval timeInterval = new TimeInterval();
|
||||
//
|
||||
//
|
||||
// Map<String, Map<String, Integer>> nodeSort = new HashMap<>();
|
||||
// Map<String, EntityMtrans> entityMtransMap = getNodeInfo();
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// for (Map.Entry<String, Map<String, Integer>> m : nodeSort) {
|
||||
// List<EntityGroupEvtData> list = new ArrayList<EntityGroupEvtData>();
|
||||
// Set<Map.Entry<String, Integer>> mapValue = m.getValue().entrySet();
|
||||
// FinalData.NODE_NUM = m.getValue().size();
|
||||
//
|
||||
// for (Map.Entry<String, Integer> mm : mapValue) {
|
||||
// for (int i = 0; i < entityGroupEvtDatas.length; i++) {
|
||||
// if (entityGroupEvtDatas[i].getNodePhysics() == mm.getKey().intValue() && "短路故障".equals(entityGroupEvtDatas[i].getSagReason())) {
|
||||
// entityGroupEvtDatas[i].setNode(mm.getValue());
|
||||
// list.add(entityGroupEvtDatas[i]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 筛选不在矩阵中的事件id
|
||||
// Iterator<EntityGroupEvtData> iterator = list3.iterator();
|
||||
// while (iterator.hasNext()) {
|
||||
// EntityGroupEvtData entityGroupEvtData = iterator.next();
|
||||
//
|
||||
// if (entityGroupEvtData.getNodePhysics() == mm.getKey().intValue() && "短路故障".equals(entityGroupEvtData.getSagReason())) {
|
||||
// iterator.remove();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// EntityGroupEvtData[] entityGroupEvtData = new EntityGroupEvtData[list.size()];
|
||||
// Collections.sort(list);
|
||||
// list.toArray(entityGroupEvtData);
|
||||
//
|
||||
// for (Map.Entry<String, JSONObject> mEntry : setMtrans) {
|
||||
// if (mEntry.getKey().equals(m.getKey())) {
|
||||
// *//**//********************************************************************
|
||||
// * 算法最多处理1000条数据,超过限制需分批处理 先将数据根据某种方式进行升序/降序排序,然后分段处理 加入循环处理
|
||||
// *********************************************************************//**//*
|
||||
// int circulation = entityGroupEvtData.length % FinalData.MAX_EVT_NUM == 0
|
||||
// ? entityGroupEvtData.length / FinalData.MAX_EVT_NUM
|
||||
// : entityGroupEvtData.length / FinalData.MAX_EVT_NUM + 1;
|
||||
//
|
||||
// for (int i = 0; i < circulation; i++) {
|
||||
// int to = 0;
|
||||
//
|
||||
// if (i == circulation - 1) {
|
||||
// to = entityGroupEvtData.length % FinalData.MAX_EVT_NUM > 0
|
||||
// ? entityGroupEvtData.length
|
||||
// : (i + 1) * FinalData.MAX_EVT_NUM - 1;
|
||||
// } else {
|
||||
// to = (i + 1) * FinalData.MAX_EVT_NUM - 1;
|
||||
// }
|
||||
//
|
||||
// EntityGroupEvtData[] arrayObj = Arrays.copyOfRange(entityGroupEvtData,
|
||||
// i * FinalData.MAX_EVT_NUM, to);
|
||||
// JSONObject entityMtrans = mEntry.getValue();
|
||||
// EntityGroupData entityGroupData = handleEvent.translate(arrayObj, (EntityMtrans) JSONObject.toBean(entityMtrans, EntityMtrans.class));
|
||||
// // 处理分析结果
|
||||
// handleEvent.show_group_info(entityGroupData, listSagEvent, listEventAssObj, date);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.EVENT_REASON.getName(), DicDataEnum.SHORT_TROUBLE.getName()).getData();
|
||||
// if (Objects.isNull(dictData)) {
|
||||
// throw new BusinessException(SystemResponseEnum.ADVANCE_REASON);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// LocalDateTime date = LocalDateTime.now();
|
||||
// HandleEvent handleEvent = new HandleEvent();
|
||||
// // 分析的事件进行处理
|
||||
// List<EntityGroupEvtData> baseList = handleEvent.getData(startTime, endTime);
|
||||
// if (CollectionUtil.isEmpty(baseList)) {
|
||||
// throw new BusinessException("当前时间段暂无可分析事件");
|
||||
// }
|
||||
//
|
||||
// // 传入的处理事件根据物理隔绝进行分组
|
||||
//
|
||||
// List<EntityLogic> strategyList = relevantLogMapper.getLogic();
|
||||
//
|
||||
// if (CollectionUtil.isNotEmpty(strategyList)) {
|
||||
// List<SagEvent> listSagEvent = new ArrayList<>();
|
||||
// List<EventAssObj> listEventAssObj = new ArrayList<>();
|
||||
//
|
||||
// Map<String, List<String>> strategyToBusBarMap = new HashMap<>(32);
|
||||
//
|
||||
// Map<String, EntityMtrans> mapRedis = new HashMap<>(32);
|
||||
//
|
||||
// Map<String, List<EntityLogic>> strategyMap = strategyList.stream().collect(Collectors.groupingBy(EntityLogic::getTPIndex));
|
||||
// strategyMap.forEach((key, list) -> {
|
||||
// List<String> before = list.stream().map(EntityLogic::getNodeBefore).distinct().collect(Collectors.toList());
|
||||
// List<String> after = list.stream().map(EntityLogic::getNodeNext).distinct().collect(Collectors.toList());
|
||||
// before.addAll(after);
|
||||
// before = before.stream().distinct().collect(Collectors.toList());
|
||||
// strategyToBusBarMap.put(key, before);
|
||||
//
|
||||
// FinalData.NODE_NUM = before.size();
|
||||
// EntityMtrans entityMtrans = new EntityMtrans();
|
||||
// handleEvent.create_matrixcata(list, entityMtrans);
|
||||
//
|
||||
// mapRedis.put(key, entityMtrans);
|
||||
// });
|
||||
//
|
||||
// strategyToBusBarMap.forEach((lastKey, lastVal) -> {
|
||||
// int index = 1;
|
||||
// List<EntityGroupEvtData> list = new ArrayList<>();
|
||||
// for (EntityGroupEvtData entityGroupEvtData : baseList) {
|
||||
// if (lastVal.contains(entityGroupEvtData.getNodePhysics()) && dictData.getId().equals(entityGroupEvtData.getSagReason())) {
|
||||
// entityGroupEvtData.setNode(index++);
|
||||
// list.add(entityGroupEvtData);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// baseList.removeIf(entityGroupEvtData -> lastVal.contains(entityGroupEvtData.getNodePhysics()) && dictData.getId().equals(entityGroupEvtData.getSagReason()));
|
||||
//
|
||||
//
|
||||
// EntityGroupEvtData[] entityGroupEvtData = new EntityGroupEvtData[list.size()];
|
||||
// Collections.sort(list);
|
||||
// list.toArray(entityGroupEvtData);
|
||||
//
|
||||
// mapRedis.forEach((mKey, mVal) -> {
|
||||
// if (mKey.equals(lastKey)) {
|
||||
// //算法最多处理1000条数据,超过限制需分批处理 先将数据根据某种方式进行升序/降序排序,然后分段处理 加入循环处理
|
||||
// int circulation = entityGroupEvtData.length % FinalData.MAX_EVT_NUM == 0
|
||||
// ? entityGroupEvtData.length / FinalData.MAX_EVT_NUM
|
||||
// : entityGroupEvtData.length / FinalData.MAX_EVT_NUM + 1;
|
||||
//
|
||||
// for (int i = 0; i < circulation; i++) {
|
||||
// int to;
|
||||
// if (i == circulation - 1) {
|
||||
// to = entityGroupEvtData.length % FinalData.MAX_EVT_NUM > 0
|
||||
// ? entityGroupEvtData.length
|
||||
// : (i + 1) * FinalData.MAX_EVT_NUM - 1;
|
||||
// } else {
|
||||
// to = (i + 1) * FinalData.MAX_EVT_NUM - 1;
|
||||
// }
|
||||
//
|
||||
// EntityGroupEvtData[] arrayObj = Arrays.copyOfRange(entityGroupEvtData,
|
||||
// i * FinalData.MAX_EVT_NUM, to);
|
||||
// EntityGroupData entityGroupData = handleEvent.translate(arrayObj, mVal);
|
||||
// // 处理分析结果
|
||||
// handleEvent.show_group_info(entityGroupData, listSagEvent, listEventAssObj, date);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// });
|
||||
//
|
||||
//
|
||||
//
|
||||
// //事件ID不在矩阵中,结果集为基础以时标为标准进行归集处理 注意:三相与(单相/两相)互斥
|
||||
//
|
||||
// disposeNonStandardData(handleEvent, baseList, listEventAssObj, listSagEvent, date);
|
||||
//
|
||||
//
|
||||
// int listSize = listEventAssObj.size();
|
||||
// int toIndex = 1000;
|
||||
// for (int i = 0; i < listSize; i += 1000) {
|
||||
// //作用为toIndex最后没有toIndex条数据则剩余几条newList中就装几条
|
||||
// if (i + 1000 > listSize) {
|
||||
// toIndex = listSize - i;
|
||||
// }
|
||||
// //分割lst
|
||||
// List<EventAssObj> newList = listEventAssObj.subList(i, i + toIndex);
|
||||
// //写入添加方法,需要写你的新增方法,把newList分切后的数据新增进入数据库。
|
||||
// rmpEventDetailAssMapper.insertEventAssData(newList);
|
||||
// }
|
||||
//
|
||||
// List<RmpEventDetailPO> eventUpdateList = new ArrayList<>();
|
||||
// for (int i = 0; i < listSagEvent.size(); i++) {
|
||||
// RmpEventDetailPO rmp = new RmpEventDetailPO();
|
||||
// rmp.setEventId(listSagEvent.get(i).getIndexEventDetail());
|
||||
// rmp.setEventassIndex(listSagEvent.get(i).getIndexEventAss());
|
||||
// rmp.setDealTime(listSagEvent.get(i).getDealTime());
|
||||
// eventUpdateList.add(rmp);
|
||||
// if ((i + 1) % 1000 == 0) {
|
||||
// this.updateBatchById(eventUpdateList);
|
||||
// eventUpdateList.clear();
|
||||
// } else if (i == listSagEvent.size() - 1) {
|
||||
// this.updateBatchById(eventUpdateList);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 增加策略记录
|
||||
// String describe = "用户" + RequestUtil.getUserNickname() + "进行了关联分析";
|
||||
// PqsRelevanceLog entityPqsRelevance = new PqsRelevanceLog();
|
||||
// entityPqsRelevance.setContentDes(describe);
|
||||
// entityPqsRelevance.setState(DataStateEnum.ENABLE.getCode());
|
||||
// entityPqsRelevance.setTimeId(date);
|
||||
// relevantLogMapper.insert(entityPqsRelevance);
|
||||
//
|
||||
// } else {
|
||||
// throw new BusinessException("当前无变压器策略,请先配置策略");
|
||||
// }
|
||||
//
|
||||
// log.info("事件关联分析用时:" + timeInterval.interval() / 1000 + "秒");
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Page<AdvanceEventDetailVO> querySagEventsPage(BaseParam baseParam) {
|
||||
List<String> lineIds = generalDeviceInfoClient.deptGetRunLineEvent(RequestUtil.getDeptIndex()).getData();
|
||||
@@ -635,31 +858,116 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
/*************************************************************************************
|
||||
* 获取变压器信息并生成矩阵
|
||||
*************************************************************************************/
|
||||
@Deprecated
|
||||
public void getNodeInfo(HandleEvent handleEvent) {
|
||||
public Map<String, EntityMtrans> getNodeInfo( ) {
|
||||
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
||||
|
||||
HandleEvent handleEvent = new HandleEvent();
|
||||
List<EntityLogic> list = relevantLogMapper.getLogic();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
Map<String, List<EntityLogic>> tfMap = list.stream().collect(Collectors.groupingBy(EntityLogic::getTPIndex));
|
||||
Map<String, List<String>> tfBusBarMap = new HashMap<>(32);
|
||||
|
||||
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
||||
Map<String, List<String>> map = getLogicInfo(list);
|
||||
Map<String, Map<String, Integer>> setNodeSort = nodeSort(map);
|
||||
redisUtil.saveByKeyWithExpire(redisSortKey,setNodeSort,-1L);
|
||||
|
||||
tfMap.forEach((key, val) -> {
|
||||
List<String> tem = new ArrayList<>();
|
||||
val.forEach(it -> {
|
||||
tem.add(it.getNodeBefore());
|
||||
tem.add(it.getNodeNext());
|
||||
});
|
||||
tfBusBarMap.put(key, tem);
|
||||
setNodeSort.forEach((key, val) -> {
|
||||
FinalData.NODE_NUM = val.size();
|
||||
List<EntityLogic> listNew = new ArrayList<>();
|
||||
|
||||
for (EntityLogic entityLogic : list) {
|
||||
if (entityLogic.getTPIndex().equals(key)) {
|
||||
entityLogic.setNode_h(val.get(entityLogic.getNodeBefore()));
|
||||
entityLogic.setNode_l(val.get(entityLogic.getNodeNext()));
|
||||
listNew.add(entityLogic);
|
||||
}
|
||||
}
|
||||
|
||||
EntityMtrans entityMtrans = new EntityMtrans();
|
||||
handleEvent.create_matrixcata(val, entityMtrans);
|
||||
handleEvent.create_matrixcata(listNew, entityMtrans);
|
||||
entityMtranMap.put(key, entityMtrans);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
return entityMtranMap;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************
|
||||
* 增加排序功能并缓存进redis
|
||||
*******************************************/
|
||||
public Map<String, Map<String, Integer>> nodeSort(Map<String, List<String>> mapList) {
|
||||
Set<Map.Entry<String, List<String>>> sets = mapList.entrySet();
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
|
||||
for (Map.Entry<String, List<String>> m : sets) {
|
||||
int index = 1;
|
||||
Map<String, Integer> map2 = new HashMap<>();
|
||||
|
||||
for (String item : m.getValue()) {
|
||||
map2.put(item, index++);
|
||||
}
|
||||
|
||||
map.put(m.getKey(), map2);
|
||||
}
|
||||
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 抽取物理隔绝信息与母线的关系并放入map集合中
|
||||
* 与getTflgPloyInfo()方法功能类似
|
||||
*/
|
||||
public Map<String, List<String>> getLogicInfo(List<EntityLogic> list) {
|
||||
if (list.size() > 0) {
|
||||
Iterator<String> iterator = getAreaInfo(list).iterator();
|
||||
Map<String, List<String>> map = new HashMap<>();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
List<String> listLogic = new ArrayList<>();
|
||||
String areaString = iterator.next();
|
||||
|
||||
for (EntityLogic entityLogic : list) {
|
||||
if (entityLogic.getTPIndex().equals(areaString)) {
|
||||
listLogic.add(entityLogic.getNodeBefore());
|
||||
listLogic.add(entityLogic.getNodeNext());
|
||||
}
|
||||
}
|
||||
|
||||
//去除list中重复数据
|
||||
Set<String> set = new TreeSet<>(listLogic);
|
||||
map.put(areaString, new ArrayList<>(set));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取物理隔绝编码信息
|
||||
* 供getInfo()、getLogicInfo()方法使用
|
||||
* 先从list数组中去重,然后获取物理隔绝编码
|
||||
*/
|
||||
public <T> Set<String> getAreaInfo(List<T> list) {
|
||||
Set<T> set = new HashSet<T>(list);
|
||||
Iterator<T> iterator = set.iterator();
|
||||
Set<String> setReturn = new HashSet<String>();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Object object = iterator.next();
|
||||
|
||||
if (object instanceof PqsTflgployass) {
|
||||
setReturn.add(((PqsTflgployass) object).getTpIndex());
|
||||
continue;
|
||||
}
|
||||
|
||||
setReturn.add(((EntityLogic) object).getTPIndex());
|
||||
}
|
||||
|
||||
return setReturn;
|
||||
}
|
||||
|
||||
|
||||
@@ -697,3 +1005,4 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.njcn.advance.utils;
|
||||
|
||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import org.apache.commons.math3.linear.DecompositionSolver;
|
||||
import org.apache.commons.math3.linear.LUDecomposition;
|
||||
import org.apache.commons.math3.linear.MatrixUtils;
|
||||
@@ -102,10 +104,16 @@ public class CZNLPG {
|
||||
//矩阵求逆
|
||||
|
||||
public static RealMatrix inverseMatrix(RealMatrix matrix) {
|
||||
try {
|
||||
LUDecomposition LUDe = new LUDecomposition(matrix);
|
||||
DecompositionSolver solver = LUDe.getSolver();
|
||||
RealMatrix result = solver.getInverse();
|
||||
return result;
|
||||
}catch (Exception e){
|
||||
throw new BusinessException("数据存在问题无法进行矩阵求逆");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,90 +5,87 @@ import com.njcn.advance.pojo.dto.relevent.*;
|
||||
|
||||
public class UtilNormalization {
|
||||
public static void matrixcata_pro(EntityLogic[] transformer,EntityMtrans entityMtrans, int len) {
|
||||
int i, j, k, con;
|
||||
String node1, node2;
|
||||
int i, j, k;
|
||||
int node1, node2, con;
|
||||
int src_node[] = new int[] { 0 };
|
||||
|
||||
// 连接方式转化为矩阵形式,行、列表示所有节点
|
||||
// inf表示两个节点不相连,0表示与自身相连,其他数值表示变压器连接类型
|
||||
// 将初始矩阵的元素设为inf,对角线元素设为0
|
||||
for (i = 0; i < FinalData.NODE_NUM; i++) {
|
||||
for (j = 0; j < FinalData.NODE_NUM; j++) {
|
||||
for (j = 0; j < FinalData.NODE_NUM; j++)
|
||||
entityMtrans.getMtrans()[i][j] = FinalData.DATA_INF;
|
||||
}
|
||||
entityMtrans.getMtrans()[i][i] = 0;
|
||||
}
|
||||
|
||||
// 根据transformer设置元素
|
||||
for (i = 0; i < len; i++) {
|
||||
node1 = transformer[i].getNode_h();
|
||||
node2 = transformer[i].getNode_l();
|
||||
con = transformer[i].getType();
|
||||
entityMtrans.getMtrans()[node1 - 1][node2 - 1] = con;
|
||||
entityMtrans.getMtrans()[node2 - 1][node1 - 1] = con;
|
||||
}
|
||||
StringBuilder str = new StringBuilder();
|
||||
for (i = 0; i < FinalData.NODE_NUM; i++) {
|
||||
for (j = 0; j < FinalData.NODE_NUM; j++) {
|
||||
str.append(entityMtrans.getMtrans()[i][j]).append(" ");
|
||||
if (j == (FinalData.NODE_NUM - 1)) {
|
||||
if (j == (FinalData.NODE_NUM - 1))
|
||||
str.append("\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 类型匹配矩阵Matrixcata
|
||||
// Matrixcata模式匹配矩阵,列为节点数,行为总类别数,元素为第一个节点分别是1-6类别情况下其他节点类别情况。
|
||||
// 元素1,2,3,4,5,6 分别对应 Dc,Cb,Da,Cc,Db,Ca
|
||||
// 设置矩阵第一行元素
|
||||
for (i = 0; i < FinalData.NODE_NUM; i++) {
|
||||
for (i = 0; i < FinalData.NODE_NUM; i++)
|
||||
entityMtrans.getMatrixcata0()[0][i] = 0;
|
||||
}
|
||||
for (i = 1; i < FinalData.NODE_NUM; i++) {
|
||||
// 路径缓存清空
|
||||
for (j = 0; j < FinalData.MAX_PATH_NUM; j++) {
|
||||
for (k = 0; k < (FinalData.NODE_NUM + 1); k++) {
|
||||
for (k = 0; k < (FinalData.NODE_NUM + 1); k++)
|
||||
entityMtrans.getPossiable_path()[j][k] = 0;
|
||||
}
|
||||
}
|
||||
entityMtrans.setPath_num(0);
|
||||
// 寻找路径
|
||||
src_node[0] = 0;
|
||||
findPath(entityMtrans, src_node, i, 0, 1, FinalData.NODE_NUM);
|
||||
if (entityMtrans.getPath_num() != 0) {
|
||||
if (entityMtrans.getPath_num() != 0)
|
||||
entityMtrans.getMatrixcata0()[0][i] = entityMtrans.getPossiable_path()[0][FinalData.NODE_NUM]; // 采用第一条路径
|
||||
} else {
|
||||
else
|
||||
entityMtrans.getMatrixcata0()[0][i] = FinalData.DATA_INF; // 找不到路径填大值表示不通
|
||||
}
|
||||
}
|
||||
// 构造矩阵其他行元素
|
||||
for (i = 1; i < FinalData.EVT_TYPE_NUM; i++) {
|
||||
for (j = 0; j < FinalData.NODE_NUM; j++)
|
||||
// EntityGroupData.Matrixcata0[i][j] =
|
||||
// EntityGroupData.Matrixcata0[0][j] + i;
|
||||
{
|
||||
if (entityMtrans.getMatrixcata0()[0][j] == FinalData.DATA_INF) {
|
||||
entityMtrans.getMatrixcata0()[i][j] = FinalData.DATA_INF;
|
||||
} else {
|
||||
entityMtrans.getMatrixcata0()[i][j] = entityMtrans.getMatrixcata0()[0][j] + i;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 将数据归类到0-5
|
||||
for (i = 0; i < FinalData.EVT_TYPE_NUM; i++) {
|
||||
for (j = 0; j < FinalData.NODE_NUM; j++) {
|
||||
for (j = 0; j < FinalData.NODE_NUM; j++)
|
||||
entityMtrans.getMatrixcata1()[i][j] = entityMtrans.getMatrixcata0()[i][j] % 6;
|
||||
}
|
||||
}
|
||||
// 0换成6,将数据归类到1-6
|
||||
for (i = 0; i < FinalData.EVT_TYPE_NUM; i++) {
|
||||
for (j = 0; j < FinalData.NODE_NUM; j++) {
|
||||
if (entityMtrans.getMatrixcata1()[i][j] == 0) {
|
||||
if (entityMtrans.getMatrixcata1()[i][j] == 0)
|
||||
entityMtrans.getMatrixcata1()[i][j] = 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
str.delete(0, str.length());
|
||||
for (i = 0; i < FinalData.EVT_TYPE_NUM; i++) {
|
||||
for (j = 0; j < FinalData.NODE_NUM; j++) {
|
||||
str.append(entityMtrans.getMatrixcata1()[i][j]).append(" ");
|
||||
if (j == (FinalData.NODE_NUM - 1)) {
|
||||
if (j == (FinalData.NODE_NUM - 1))
|
||||
str.append("\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.time.*;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/*****************************************************************
|
||||
* 字符串转基础类型,可能转换不成功,封装该方法
|
||||
@@ -113,16 +114,16 @@ public class Utils {
|
||||
public static boolean isTimeInRange(Instant instant, LocalDate startTime, LocalDate endTime) {
|
||||
// 将Instant对象转换为LocalDateTime对象
|
||||
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
||||
|
||||
Instant instant1 = startTime.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant().plusMillis(TimeUnit.HOURS.toMillis(8));
|
||||
Instant instant2 = endTime.plusDays(1).atStartOfDay(ZoneId.systemDefault()).toInstant().plusMillis(TimeUnit.HOURS.toMillis(8));
|
||||
// 检查LocalDateTime对象是否在startTime和endTime之间
|
||||
boolean isInRange = !localDateTime.toLocalDate().isBefore(startTime) && !localDateTime.toLocalDate().isAfter(endTime.plus(1, ChronoUnit.DAYS));
|
||||
boolean isInRange = instant1.isBefore(instant) && instant2.isAfter(instant);
|
||||
|
||||
// 返回结果
|
||||
return isInRange;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static <T> List<Double> getAttributeValueByPropertyName(List<T> list, String propertyName) {
|
||||
List<Double> resultList = new ArrayList<>();
|
||||
for (T item : list) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class RMpMonitorEvaluateDServiceImpl extends MppServiceImpl<RMpMonitorEva
|
||||
// Integer statisticalInterval = lineDTO.getTimeInterval();
|
||||
// /*电压等级*/
|
||||
// Double voltage = Double.parseDouble(lineDTO.getVoltageLevel());
|
||||
// List<DataVFiveItemDTO> fiveItems = dataVInfluxdbService.getFiveItems(lineDTO.getLineId(), beginDay, endDay, statisticalInterval);
|
||||
// List<DataVFiveItemDTO> fiveItems = dataVInfluxdbService.getFiveItems(lineDTO.getL@ineId(), beginDay, endDay, statisticalInterval);
|
||||
// RMpMonitorEvaluateD rMpMonitorEvaluateD = new RMpMonitorEvaluateD();
|
||||
// rMpMonitorEvaluateD = calculateRMpMonitorEvaluateDPO(rMpMonitorEvaluateD, fiveItems, pmsAbnormalRules, voltage, lineDTO);
|
||||
// Date date = DateUtil.parse(beginDay);
|
||||
|
||||
@@ -143,13 +143,15 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
||||
//流程状态排除不通过的,不通过会放在待办中,一直到该流程通过
|
||||
processInstanceQuery.variableValueNotEquals(BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, BpmTaskStatusEnum.REJECT.getStatus());
|
||||
|
||||
|
||||
if (Objects.nonNull(bpmProcessInstancePageParam.getSearchBeginTime()) && Objects.nonNull(bpmProcessInstancePageParam.getSearchEndTime())) {
|
||||
String beginTimeStr = bpmProcessInstancePageParam.getSearchBeginTime();
|
||||
String endTimeStr = bpmProcessInstancePageParam.getSearchEndTime();
|
||||
LocalDateTime beginTime = LocalDateTimeUtil.parse(beginTimeStr, DatePattern.NORM_DATE_PATTERN);
|
||||
LocalDateTime endTime = PubUtils.endTimeToLocalDateTime(endTimeStr);
|
||||
processInstanceQuery.startedBefore(DateUtils.of(endTime));
|
||||
processInstanceQuery.startedAfter(DateUtils.of(beginTime));
|
||||
}
|
||||
|
||||
// 查询数量
|
||||
long processInstanceCount = processInstanceQuery.count();
|
||||
if (processInstanceCount == 0) {
|
||||
|
||||
@@ -142,12 +142,14 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
||||
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue())) {
|
||||
taskQuery.processDefinitionNameLike("%" + bpmTaskQueryParam.getSearchValue() + "%");
|
||||
}
|
||||
if (Objects.nonNull(bpmTaskQueryParam.getSearchBeginTime()) && Objects.nonNull(bpmTaskQueryParam.getSearchEndTime())) {
|
||||
String beginTimeStr = bpmTaskQueryParam.getSearchBeginTime();
|
||||
String endTimeStr = bpmTaskQueryParam.getSearchEndTime();
|
||||
LocalDateTime beginTime = LocalDateTimeUtil.parse(beginTimeStr, DatePattern.NORM_DATE_PATTERN);
|
||||
LocalDateTime endTime = PubUtils.endTimeToLocalDateTime(endTimeStr);
|
||||
taskQuery.taskCreatedBefore(DateUtils.of(endTime));
|
||||
taskQuery.taskCreatedAfter(DateUtils.of(beginTime));
|
||||
}
|
||||
// 执行查询
|
||||
long count = taskQuery.count();
|
||||
if (count == 0) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class GenerateCode {
|
||||
|
||||
private static final String TARGET_DIR = "D://code";
|
||||
|
||||
private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/pqsinfo_zl";
|
||||
private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/pqs9100";
|
||||
// private static final String DB_URL = "jdbc:oracle:thin:@192.168.1.170:1521:pqsbase";
|
||||
|
||||
private static final String USERNAME = "root";
|
||||
@@ -30,9 +30,9 @@ public class GenerateCode {
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<Module> modules = Stream.of(
|
||||
new Module("xy", "com.njcn.supervision", "survey", Stream.of(
|
||||
"app_version"
|
||||
).collect(Collectors.toList()), "supervision_")
|
||||
new Module("hongawen", "com.njcn.gather", "", Stream.of(
|
||||
"pq_dev_type"
|
||||
).collect(Collectors.toList()), "pq_")
|
||||
).collect(Collectors.toList());
|
||||
generateJavaFile(modules);
|
||||
}
|
||||
|
||||
@@ -169,6 +169,11 @@ public interface PatternRegex {
|
||||
*/
|
||||
String TF_NAME_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,16}$";
|
||||
|
||||
/**
|
||||
* 特殊字符正则
|
||||
*/
|
||||
String SPECIAL_REGEX = "[<>%'%;()&+/-\\\\_|@*?#$!,.]|html";
|
||||
|
||||
/**
|
||||
* 字典类型名称
|
||||
*/
|
||||
@@ -229,6 +234,11 @@ public interface PatternRegex {
|
||||
*/
|
||||
String POSITIVE = "^[0-9].*$";
|
||||
|
||||
/**
|
||||
* 大于0的数字(整数以及小数)
|
||||
*/
|
||||
String POSITIVEALL_NUM = "^(?:[1-9]\\d*(\\.\\d+)?)$";
|
||||
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
@@ -250,6 +260,8 @@ public interface PatternRegex {
|
||||
*/
|
||||
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,20}$";
|
||||
|
||||
String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";
|
||||
|
||||
/**
|
||||
* uuid 32位正则,数字 、 字母
|
||||
*/
|
||||
|
||||
@@ -51,5 +51,16 @@ public interface ServerInfo {
|
||||
|
||||
String DATA_PLATFORM = "data-platform-boot";
|
||||
|
||||
String PLATFORM_STAT_BOOT = "stat-boot";
|
||||
|
||||
String PLATFORM_RT_BOOT = "rt-boot";
|
||||
String PLATFORM_EVENT_BOOT = "event-boot";
|
||||
|
||||
String PLATFORM_DATA_PROCESSING_BOOT = "data-processing-boot";
|
||||
|
||||
String PLATFORM_MESSAGE_BOOT = "message-boot";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package com.njcn.common.utils;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -10,8 +10,7 @@ import java.util.regex.Pattern;
|
||||
/**
|
||||
* @author yexibao
|
||||
*/
|
||||
public class Sm4Utils
|
||||
{
|
||||
public class Sm4Utils {
|
||||
//全局秘钥
|
||||
public final static String globalSecretKey = "11HDESaAhiHHug2z";
|
||||
|
||||
@@ -37,26 +36,20 @@ public class Sm4Utils
|
||||
this.iv = iv;
|
||||
}
|
||||
|
||||
public Sm4Utils(String secretKey)
|
||||
{
|
||||
public Sm4Utils(String secretKey) {
|
||||
this.secretKey = secretKey;
|
||||
}
|
||||
|
||||
public String encryptData_ECB(String plainText)
|
||||
{
|
||||
try
|
||||
{
|
||||
public String encryptData_ECB(String plainText) {
|
||||
try {
|
||||
Sm4Context ctx = new Sm4Context();
|
||||
ctx.isPadding = true;
|
||||
ctx.mode = Sm4.SM4_ENCRYPT;
|
||||
|
||||
byte[] keyBytes;
|
||||
if (HEX_STRING)
|
||||
{
|
||||
if (HEX_STRING) {
|
||||
keyBytes = util.hexStringToBytes(secretKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
keyBytes = secretKey.getBytes();
|
||||
}
|
||||
|
||||
@@ -64,66 +57,59 @@ public class Sm4Utils
|
||||
sm4.sm4_setkey_enc(ctx, keyBytes);
|
||||
byte[] encrypted = sm4.sm4_crypt_ecb(ctx, plainText.getBytes("GBK"));
|
||||
String cipherText = new BASE64Encoder().encode(encrypted);
|
||||
if (cipherText != null && cipherText.trim().length() > 0)
|
||||
{
|
||||
if (cipherText != null && cipherText.trim().length() > 0) {
|
||||
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
|
||||
Matcher m = p.matcher(cipherText);
|
||||
cipherText = m.replaceAll("");
|
||||
}
|
||||
return cipherText;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String decryptData_ECB(String cipherText)
|
||||
{
|
||||
try
|
||||
{
|
||||
public String decryptData_ECB(String cipherText) {
|
||||
try {
|
||||
Sm4Context ctx = new Sm4Context();
|
||||
ctx.isPadding = true;
|
||||
ctx.mode = Sm4.SM4_DECRYPT;
|
||||
|
||||
byte[] keyBytes;
|
||||
if (HEX_STRING)
|
||||
{
|
||||
if (HEX_STRING) {
|
||||
keyBytes = util.hexStringToBytes(secretKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
keyBytes = secretKey.getBytes();
|
||||
}
|
||||
|
||||
Sm4 sm4 = new Sm4();
|
||||
sm4.sm4_setkey_dec(ctx, keyBytes);
|
||||
byte[] decrypted = sm4.sm4_crypt_ecb(ctx, new BASE64Decoder().decodeBuffer(cipherText));
|
||||
return new String(decrypted, "GBK");
|
||||
String tempText = new String(decrypted, "GBK");
|
||||
String finalText = "";
|
||||
for (int i = 0; i < tempText.length(); i++) {
|
||||
char c = tempText.charAt(i);
|
||||
if ((int) c != 0) {
|
||||
finalText += c;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
return finalText;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String encryptData_CBC(String plainText)
|
||||
{
|
||||
try
|
||||
{
|
||||
public String encryptData_CBC(String plainText) {
|
||||
try {
|
||||
Sm4Context ctx = new Sm4Context();
|
||||
ctx.isPadding = true;
|
||||
ctx.mode = Sm4.SM4_ENCRYPT;
|
||||
|
||||
byte[] keyBytes;
|
||||
byte[] ivBytes;
|
||||
if (HEX_STRING)
|
||||
{
|
||||
if (HEX_STRING) {
|
||||
keyBytes = util.hexStringToBytes(secretKey);
|
||||
ivBytes = util.hexStringToBytes(iv);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
keyBytes = secretKey.getBytes();
|
||||
ivBytes = iv.getBytes();
|
||||
}
|
||||
@@ -132,37 +118,29 @@ public class Sm4Utils
|
||||
sm4.sm4_setkey_enc(ctx, keyBytes);
|
||||
byte[] encrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, plainText.getBytes("GBK"));
|
||||
String cipherText = new BASE64Encoder().encode(encrypted);
|
||||
if (cipherText != null && cipherText.trim().length() > 0)
|
||||
{
|
||||
if (cipherText != null && cipherText.trim().length() > 0) {
|
||||
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
|
||||
Matcher m = p.matcher(cipherText);
|
||||
cipherText = m.replaceAll("");
|
||||
}
|
||||
return cipherText;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String decryptData_CBC(String cipherText)
|
||||
{
|
||||
try
|
||||
{
|
||||
public String decryptData_CBC(String cipherText) {
|
||||
try {
|
||||
Sm4Context ctx = new Sm4Context();
|
||||
ctx.isPadding = true;
|
||||
ctx.mode = Sm4.SM4_DECRYPT;
|
||||
|
||||
byte[] keyBytes;
|
||||
byte[] ivBytes;
|
||||
if (HEX_STRING)
|
||||
{
|
||||
if (HEX_STRING) {
|
||||
keyBytes = util.hexStringToBytes(secretKey);
|
||||
ivBytes = util.hexStringToBytes(iv);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
keyBytes = secretKey.getBytes();
|
||||
ivBytes = iv.getBytes();
|
||||
}
|
||||
@@ -171,22 +149,22 @@ public class Sm4Utils
|
||||
sm4.sm4_setkey_dec(ctx, keyBytes);
|
||||
byte[] decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, new BASE64Decoder().decodeBuffer(cipherText));
|
||||
return new String(decrypted, "GBK");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException
|
||||
{
|
||||
public static void main(String[] args) throws IOException {
|
||||
String plainText = "@#001njcnpqs";
|
||||
//11HDESaAhiHHugDz
|
||||
String secretKey = "11HDESaAhiHHug2z";
|
||||
Sm4Utils sm4 = new Sm4Utils(secretKey);
|
||||
|
||||
String cipherText = sm4.encryptData_ECB(plainText);
|
||||
System.out.println("加密后:" + cipherText);
|
||||
String cipherText1 = sm4.decryptData_ECB(cipherText);
|
||||
System.out.println("解密后:" + cipherText1);
|
||||
|
||||
cipherText = cipherText + "11HDESaAhiHHug2z";
|
||||
sm4.setSecretKey("11HDESaAhiHHug2z");
|
||||
cipherText = sm4.encryptData_ECB(cipherText);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.echarts.json.LineGenerator;
|
||||
import com.njcn.echarts.json.PieGenerator;
|
||||
import com.njcn.web.utils.RestTemplateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
@@ -23,7 +24,8 @@ import java.util.*;
|
||||
public class DrawPicUtil {
|
||||
|
||||
//目前写死,后续作为配置
|
||||
private final String URL = "http://192.168.1.24:5174/picture";
|
||||
@Value("${DrawPicUtil.URL:http://192.168.1.24:5174/picture}")
|
||||
private String URL;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
30
pqs-common/common-echarts/src/main/resources/bootstrap.yml
Normal file
30
pqs-common/common-echarts/src/main/resources/bootstrap.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
spring:
|
||||
#nacos注册中心以及配置中心的指定
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
ip: @service.server.url@
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
config:
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
file-extension: yaml
|
||||
shared-configs:
|
||||
- data-id: share-config.yaml
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -68,6 +68,9 @@ public interface ValidMessage {
|
||||
String DEVICE_VERSION_NOT_BLANK = "装置版本json文件不能为空,请检查deviceVersionFile参数";
|
||||
|
||||
String SEARCH_DATA_ERROR = "搜索值过长,请检查搜索参数";
|
||||
String SPECIAL_REGEX = "搜索值包含特殊字符";
|
||||
|
||||
String NAME_SPECIAL_REGEX = "包含特殊字符";
|
||||
|
||||
String DATA_TOO_LONG = "参数过长,请检查参数";
|
||||
|
||||
|
||||
@@ -632,5 +632,42 @@ public class RestTemplateUtil {
|
||||
return restTemplate;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
String s1 = "runoob";
|
||||
String s2 = "runoob";
|
||||
System.out.println(s1 == s2);
|
||||
|
||||
String body ="[\n" +
|
||||
" {\n" +
|
||||
" \"monitorId\": [\n" +
|
||||
" \"id1\",\n" +
|
||||
" \"id2\",\n" +
|
||||
" \"id3\"\n" +
|
||||
" ],\n" +
|
||||
" \"dataType\": \"1\",\n" +
|
||||
" \"timeInterval\": [\n" +
|
||||
" \"2024-01-01 12:52:51~2024-01-01 13:53:00\",\n" +
|
||||
" \"2024-01-02 12:52:51~2024-01-02 13:53:00\",\n" +
|
||||
" \"2024-01-03 12:52:51~2024-01-03 13:53:00\",\n" +
|
||||
" \"2024-01-04 12:52:51~2024-01-04 13:53:00\"\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"monitorId\": [\n" +
|
||||
" \"id4\"\n" +
|
||||
" ],\n" +
|
||||
" \"dataType\": \"0\",\n" +
|
||||
" \"timeInterval\": [\n" +
|
||||
" \"2024-01-01 12:40:00~2024-01-01 23:59:59\"\n" +
|
||||
" ]\n" +
|
||||
" }\n" +
|
||||
"]";
|
||||
ResponseEntity<Object> post = RestTemplateUtil.post("http://192.168.1.105:10004/powerQuality/recall", body, Object.class);
|
||||
System.out.println(post);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.njcn.device.biz.commApi.fallback.CommLineClientFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -36,6 +37,14 @@ public interface CommLineClient {
|
||||
@GetMapping("/getLineDetail")
|
||||
HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 获取污区值监测点相关信息
|
||||
*
|
||||
* @author hongawen
|
||||
*/
|
||||
@GetMapping("/getPollutionLineInfo")
|
||||
HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(@RequestParam("id") List<String> id);
|
||||
|
||||
/***
|
||||
* 批量获取监测点信息
|
||||
* @author hongawen
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.device.biz.commApi.CommLineClient;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -39,6 +40,12 @@ public class CommLineClientFallbackFactory implements FallbackFactory<CommLineCl
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(List<String> id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取污区值监测点相关信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<LineDTO>> getLineDetailBatch(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "批量获取监测点信息", throwable.toString());
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.njcn.device.biz.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PollutionLineInfoDTO {
|
||||
|
||||
/**
|
||||
* 供电公司名称
|
||||
*/
|
||||
private String gdName;
|
||||
|
||||
/**
|
||||
* 所属变电站
|
||||
*/
|
||||
private String subStationName;
|
||||
|
||||
/**
|
||||
* 终端名称
|
||||
*/
|
||||
private String devName;
|
||||
|
||||
/**
|
||||
* 终端厂家
|
||||
*/
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
*/
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 通讯状态
|
||||
*/
|
||||
private Integer comFlag;
|
||||
|
||||
/**
|
||||
* 终端投运时间
|
||||
*/
|
||||
private String loginTime;
|
||||
|
||||
/**
|
||||
* 位置,电网侧&非电网侧
|
||||
*/
|
||||
private String powerFlag;
|
||||
|
||||
/**
|
||||
* 行业类型
|
||||
*/
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 干扰源类型
|
||||
*/
|
||||
private String loadType;
|
||||
|
||||
/**
|
||||
* 监测id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 监测对象
|
||||
*/
|
||||
private String objName;
|
||||
|
||||
/**
|
||||
* 变电站
|
||||
*/
|
||||
private String powerSubstationName;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
private String lineVoltage;
|
||||
|
||||
/**
|
||||
* 装置id
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 上送国网编号
|
||||
*/
|
||||
private String monitorId;
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pms.pojo.dto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -28,7 +29,7 @@ public class PushMonitorDTO {
|
||||
private String customName;
|
||||
private String status;
|
||||
private Date ctime;
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
private String lineId;
|
||||
private String chv;
|
||||
private String chi;
|
||||
|
||||
@@ -32,6 +32,8 @@ public class TerminalQueryParam extends BaseParam {
|
||||
@ApiModelProperty(value = "监测对象类型")
|
||||
private String objType;
|
||||
|
||||
private List<String> objTypeList;
|
||||
|
||||
@ApiModelProperty(value = "是否上送国网监测点")
|
||||
private Integer isUpToGrid;
|
||||
|
||||
|
||||
@@ -3,10 +3,13 @@ package com.njcn.device.pms.pojo.po;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
@@ -72,16 +75,34 @@ public class Monitor extends BaseEntity {
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 监测线路ID
|
||||
* 监测母线
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 监测线路号
|
||||
*/
|
||||
private Integer lineNum;
|
||||
|
||||
/**
|
||||
* 投运日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate putDate;
|
||||
|
||||
/**
|
||||
* 中台母线ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String busId;
|
||||
|
||||
|
||||
/**
|
||||
* 中台母线ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String midStation;
|
||||
|
||||
/**
|
||||
* 电压等级(字典)
|
||||
*/
|
||||
@@ -190,7 +211,6 @@ public class Monitor extends BaseEntity {
|
||||
* 监测终端接线方式(字典)
|
||||
*/
|
||||
private String terminalWiringMethod;
|
||||
|
||||
/**
|
||||
* 是否是上送国网监测点,0-否 1-是
|
||||
*/
|
||||
|
||||
@@ -28,10 +28,19 @@ public class MonitorStatisticsController extends BaseController {
|
||||
|
||||
@PostMapping("/objType")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("国网上送接口")
|
||||
public HttpResult< List<List<String>>> objType(String deptId){
|
||||
@ApiOperation("查询主网用户分类")
|
||||
public HttpResult< List<List<String>>> objType(String deptId,Integer up){
|
||||
String methodDescribe = getMethodDescribe("objType");
|
||||
List<List<String>> gwMonitorStatistics = monitorStatisticsService.getGwMonitorStatistics(deptId);
|
||||
List<List<String>> gwMonitorStatistics = monitorStatisticsService.getGwMonitorStatistics(deptId,up);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gwMonitorStatistics, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/objTypeStatis")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询主网用户分类")
|
||||
public HttpResult< List<List<String>>> objTypeStatis(String deptId){
|
||||
String methodDescribe = getMethodDescribe("objTypeStatis");
|
||||
List<List<String>> gwMonitorStatistics = monitorStatisticsService.objTypeStatistic(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gwMonitorStatistics, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +121,22 @@ public class PmsMonitorController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页获取所有主网用户台账
|
||||
* @author cdf
|
||||
* @date 2022/11/25
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllMainUserPageList")
|
||||
@ApiOperation("分页获取所有主网用户台账")
|
||||
@ApiImplicitParam(name = "baseParam",required = true)
|
||||
public HttpResult<Page<Monitor>> getAllMainUserPageList(@RequestBody TerminalQueryParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("getAllMainUserPageList");
|
||||
Page<Monitor> monitor= monitorService.getAllMainUserPageList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有主网监测点
|
||||
* @author cdf
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerDistributionarea;
|
||||
import com.njcn.device.pms.pojo.vo.PVCapacity;
|
||||
import com.njcn.device.pms.service.majornetwork.IPowerDistributionareaService;
|
||||
@@ -58,7 +59,7 @@ public class PmsPowerDistributionareaController extends BaseController {
|
||||
@PostMapping("getPowerDistributionAreaList")
|
||||
@ApiOperation("分页查询台区所有信息")
|
||||
@ApiImplicitParam(name = "baseParam",value = "查询台区信息",required = true)
|
||||
public HttpResult<Page<PowerDistributionarea>> getList(@RequestBody @Validated BaseParam baseParam){
|
||||
public HttpResult<Page<PowerDistributionarea>> getList(@RequestBody TaiZhangParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("getList");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
|
||||
Page<PowerDistributionarea> res = iPowerDistributionareaService.getList(baseParam);
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
monitor.Org_Name AS orgName,
|
||||
monitor.Powerr_Id AS powerId,
|
||||
monitor.Powerr_Name AS powerName,
|
||||
monitor.`Powerr_Id` AS powerId,
|
||||
monitor.`Powerr_Name` AS powerName,
|
||||
monitor.id AS monitorId,
|
||||
monitor.Name AS monitorName,
|
||||
monitor.`Name` AS monitorName,
|
||||
monitor.Line_Id,
|
||||
monitor.Line_Name,
|
||||
pdm.Monitor_Sort AS monitorSort,
|
||||
@@ -26,11 +26,11 @@
|
||||
pdm.Update_By AS updateBy,
|
||||
pdm.Update_Time AS updateTime
|
||||
FROM
|
||||
((
|
||||
(
|
||||
SELECT
|
||||
pm.id,
|
||||
pm.Name,
|
||||
pm.Status,
|
||||
pm.`Name`,
|
||||
pm.`Status`,
|
||||
pm.Org_Id,
|
||||
pm.Org_Name,
|
||||
pm.Powerr_Id,
|
||||
@@ -48,57 +48,11 @@
|
||||
</if>
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
/* (
|
||||
SELECT
|
||||
ppd.id,
|
||||
ppd.Name,
|
||||
ppd.Status,
|
||||
ppd.Org_Id,
|
||||
ppd.Org_Name,
|
||||
ppd.Power_Station_Id,
|
||||
ppd.Powerr_Name,
|
||||
ppd.Line_Id,
|
||||
ppd.Line_Name
|
||||
FROM
|
||||
pms_power_distributionarea AS ppd
|
||||
) UNION ALL*/
|
||||
(
|
||||
SELECT
|
||||
ppc.id,
|
||||
ppc.Name,
|
||||
ppc.Status,
|
||||
ppc.Org_Id,
|
||||
ppc.Org_Name,
|
||||
ppc.Power_Station_Id,
|
||||
ps.Power_Name,
|
||||
ppc.Line_Id,
|
||||
0
|
||||
FROM
|
||||
pms_power_client AS ppc
|
||||
INNER JOIN pms_statation_stat ps ON ps.Power_Id = ppc.Power_Station_Id
|
||||
AND ppc.Org_Id = ps.Org_Id
|
||||
) UNION ALL
|
||||
(
|
||||
SELECT
|
||||
ppgu.id,
|
||||
ppgu.Name,
|
||||
ppgu.Status,
|
||||
ppgu.Org_Id,
|
||||
ppgu.Org_Name,
|
||||
ppgu.Power_Station_Id,
|
||||
pss.Power_Name,
|
||||
ppgu.Line_Id,
|
||||
0
|
||||
FROM
|
||||
pms_power_generation_user AS ppgu
|
||||
INNER JOIN pms_statation_stat AS pss ON pss.Power_Id = ppgu.Power_Station_Id
|
||||
AND ppgu.Org_Id = pss.Org_Id
|
||||
)) AS monitor
|
||||
) AS monitor
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.Status = 1
|
||||
AND pdm.Status = 1
|
||||
monitor.`Status` = 1
|
||||
AND pdm.`Status` = 1
|
||||
AND monitor.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
@@ -131,9 +85,10 @@
|
||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
@@ -176,27 +131,12 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
) /*UNION ALL
|
||||
(
|
||||
SELECT
|
||||
ppd.id,
|
||||
ppd.Name,
|
||||
ppd.Status,
|
||||
ppd.Org_Id,
|
||||
ppd.Org_Name,
|
||||
ppd.Power_Station_Id,
|
||||
ppd.Powerr_Name,
|
||||
ppd.Line_Id,
|
||||
ppd.Line_Name
|
||||
FROM
|
||||
pms_power_distributionarea AS ppd
|
||||
)
|
||||
) AS monitor*/
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.Status = 1
|
||||
pm.Status = 1
|
||||
AND pdm.Status = 1
|
||||
AND monitor.Org_Id IN
|
||||
AND pm.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
</foreach>
|
||||
@@ -228,7 +168,7 @@
|
||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
AND pm.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.param.*;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -108,4 +106,13 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
||||
|
||||
List<Monitor> selectMonitorAndNewEnergy(@Param("orgIds")List<String> orgIds,
|
||||
@Param("objIds")List<String> objIds);
|
||||
|
||||
|
||||
/**
|
||||
* 分页获取用户对象
|
||||
*/
|
||||
Page<Monitor> getAllObjUser(@Param("page") Page<Monitor> page, @Param("baseParam")TerminalQueryParam baseParam);
|
||||
|
||||
List<Monitor> getAllObjUser(@Param("baseParam")TerminalQueryParam baseParam);
|
||||
|
||||
}
|
||||
|
||||
@@ -259,4 +259,42 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getAllObjUser" resultType="com.njcn.device.pms.pojo.po.Monitor">
|
||||
SELECT
|
||||
monitor.Id,
|
||||
monitor.NAME,
|
||||
monitor.Org_Id,
|
||||
monitor.Org_Name,
|
||||
monitor.Operation_Name,
|
||||
monitor.Powerr_Name,
|
||||
monitor.Line_Name,
|
||||
monitor.Voltage_Level,
|
||||
monitor.Monitor_Tag,
|
||||
monitor.Obj_Type,
|
||||
monitor.Monitor_Object_Name,
|
||||
monitor.trade_Code,
|
||||
monitor.Is_Special_Supply_Electricity
|
||||
|
||||
FROM
|
||||
pms_monitor monitor
|
||||
INNER JOIN
|
||||
(
|
||||
SELECT max( id ) id, Monitor_Object_Name
|
||||
FROM pms_monitor
|
||||
where Monitor_Object_Name is not null
|
||||
and Status = 1
|
||||
<if test="baseParam.monitorTag!=null and baseParam.monitorTag!=''">
|
||||
and monitor.Monitor_Tag = #{baseParam.monitorTag}
|
||||
</if>
|
||||
<if test="baseParam.objTypeList !=null and baseParam.objTypeList.size() != 0">
|
||||
and monitor.Obj_Type in
|
||||
<foreach collection="baseParam.objTypeList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY Monitor_Object_Name
|
||||
) t ON monitor.id = t.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -19,7 +19,15 @@ public interface MonitorStatisticsService {
|
||||
* @Author: wr
|
||||
* @Date: 2024/3/22 9:49
|
||||
*/
|
||||
List<List<String>> getGwMonitorStatistics(String deptId);
|
||||
List<List<String>> getGwMonitorStatistics(String deptId,Integer up);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 国网上送统计类型数量统计
|
||||
* @Author: wr
|
||||
* @Date: 2024/3/22 9:49
|
||||
*/
|
||||
List<List<String>> objTypeStatistic(String deptId);
|
||||
|
||||
/**
|
||||
* @Description: 国网上送新能源场站统计
|
||||
|
||||
@@ -222,12 +222,7 @@ public class GwMonitorPushServiceImpl implements GwMonitorPushService {
|
||||
|
||||
|
||||
|
||||
/* if (tranMap.containsKey(item.getPotentialTransFormerType())) {
|
||||
pushMonitorDTO.setEvtType(tranMap.get(item.getPotentialTransFormerType()).getValue());
|
||||
}
|
||||
if (pointMap.containsKey(item.getNeutralGroundingMode())) {
|
||||
pushMonitorDTO.setNeutralGround(pointMap.get(item.getNeutralGroundingMode()).getValue());
|
||||
}*/
|
||||
pushMonitorDTO.setUpdateTime(item.getUpdateTime());
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(item.getOrgName())) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.njcn.device.pms.mapper.majornetwork.MonitorMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixWireMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.RStatIntegrityDMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper;
|
||||
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
|
||||
import com.njcn.device.pms.pojo.param.gw.GwStatisticalParam;
|
||||
import com.njcn.device.pms.pojo.param.gw.GwTerminalParam;
|
||||
import com.njcn.device.pms.pojo.po.*;
|
||||
@@ -67,7 +68,7 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
private final ITerminalService terminalService;
|
||||
|
||||
@Override
|
||||
public List<List<String>> getGwMonitorStatistics(String deptId) {
|
||||
public List<List<String>> getGwMonitorStatistics(String deptId,Integer up) {
|
||||
List<List<String>> info = new ArrayList<>();
|
||||
//查询所有一级树字典
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
@@ -105,6 +106,7 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(deptId);
|
||||
deptGetLineParam.setMonitorStateRunning(false);
|
||||
deptGetLineParam.setSystemType(0);
|
||||
List<DeptGetChildrenMoreDTO> deptGetChildrenMoreDTOS = commTerminalService.deptGetLine(deptGetLineParam);
|
||||
//部门信息循环
|
||||
List<String> line;
|
||||
@@ -115,8 +117,12 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
if (CollUtil.isEmpty(lineBaseList)) {
|
||||
continue;
|
||||
}
|
||||
List<LineDevGetDTO> upToGridList = lineBaseList.stream().filter(item -> Objects.equals(item.getIsUpToGrid(), DataStateEnum.ENABLE.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
List<LineDevGetDTO> upToGridList;
|
||||
if(Objects.isNull(up) || up == 1){
|
||||
upToGridList = lineBaseList.stream().filter(item -> Objects.equals(item.getIsUpToGrid(), DataStateEnum.ENABLE.getCode())).collect(Collectors.toList());
|
||||
}else {
|
||||
upToGridList = lineBaseList;
|
||||
}
|
||||
addmetWorkList(metWorkMap, upToGridList, line);
|
||||
addSourceLoadList(sourceLoadMap, upToGridList, line);
|
||||
info.add(line);
|
||||
@@ -124,6 +130,54 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<List<String>> objTypeStatistic(String deptId) {
|
||||
List<List<String>> info = new ArrayList<>();
|
||||
//查询所有一级树字典
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
|
||||
//监测点大类
|
||||
List<SysDicTreePO> broadCategory = sysDicTreePOList.stream()
|
||||
.filter(item -> Objects.equals(item.getPid(), "0"))
|
||||
.filter(item -> !Objects.equals(item.getCode(), DicDataTypeEnum.DEVICE_UNIT.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
broadCategory.sort(Comparator.comparing(SysDicTreePO::getSort));
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("单位");
|
||||
List<String> collect = broadCategory.stream().map(SysDicTreePO::getName).collect(Collectors.toList());
|
||||
list.addAll(collect);
|
||||
list.add("合计");
|
||||
//获取主网监测统计
|
||||
Map<String, List<String>> metWorkMap = mapDicIds(broadCategory, sysDicTreePOList);
|
||||
info.add(list);
|
||||
|
||||
TerminalQueryParam baseParam = new TerminalQueryParam();
|
||||
List<Monitor> monitorList = monitorMapper.getAllObjUser(baseParam);
|
||||
//筛选出国网统计信息
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(deptId);
|
||||
deptGetLineParam.setMonitorStateRunning(false);
|
||||
deptGetLineParam.setSystemType(0);
|
||||
List<DeptGetBase> deptGetChildrenMoreDTOS = commTerminalService.getDeptChildrenByParent(deptGetLineParam);
|
||||
//部门信息循环
|
||||
for (DeptGetBase dept : deptGetChildrenMoreDTOS) {
|
||||
List<String> line = new ArrayList<>();
|
||||
line.add(dept.getUnitName());
|
||||
List<String> deptIds = dept.getUnitChildrenList();
|
||||
if (CollUtil.isEmpty(deptIds)) {
|
||||
continue;
|
||||
}
|
||||
List<Monitor> temList = monitorList.stream().filter(it->deptIds.contains(it.getOrgId())).collect(Collectors.toList());
|
||||
metWorkMap.forEach((k,v)->{
|
||||
long count = temList.stream().filter(i->v.contains(i.getObjType())).count();
|
||||
line.add(String.valueOf(count));
|
||||
});
|
||||
info.add(line);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MonitorEnergy> getGwMonitorEnergy(String deptId) {
|
||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
|
||||
@@ -87,6 +87,9 @@ public interface IMonitorService extends IService<Monitor> {
|
||||
|
||||
Page<Monitor> getAllMonitorPageList(TerminalQueryParam baseParam);
|
||||
|
||||
Page<Monitor> getAllMainUserPageList(TerminalQueryParam baseParam);
|
||||
|
||||
|
||||
List<Monitor> getMonitorList(List<String> monitorIds);
|
||||
|
||||
List<Monitor> getMonitorListByMid(List<String> midIds);
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerDistributionarea;
|
||||
import com.njcn.device.pms.pojo.vo.PVCapacity;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
@@ -28,7 +29,7 @@ public interface IPowerDistributionareaService extends IService<PowerDistributio
|
||||
* 分页查询所有
|
||||
* @return
|
||||
*/
|
||||
Page<PowerDistributionarea> getList(BaseParam baseParam);
|
||||
Page<PowerDistributionarea> getList(TaiZhangParam baseParam);
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
|
||||
@@ -263,7 +263,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
List<GeneratrixWire> generatrixWireList = generatrixWireMapper.selectList(new LambdaQueryWrapper<GeneratrixWire>().in(GeneratrixWire::getId, busIds));
|
||||
Map<String, GeneratrixWire> mapBus = generatrixWireList.stream().collect(Collectors.toMap(GeneratrixWire::getId, Function.identity()));
|
||||
|
||||
|
||||
List<String> powerIds = temList.stream().map(Monitor::getPowerrId).distinct().collect(Collectors.toList());
|
||||
List<StatationStat> statationStatList = statationStatMapper.selectList(new LambdaQueryWrapper<StatationStat>().in(StatationStat::getPowerId,powerIds));
|
||||
Map<String,StatationStat> statMap = statationStatList.stream().collect(Collectors.toMap(StatationStat::getPowerId,Function.identity()));
|
||||
|
||||
temList = temList.stream().peek(item -> {
|
||||
if (mapTerminal.containsKey(item.getTerminalId())) {
|
||||
@@ -271,7 +273,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
item.setDevIp(mapTerminal.get(item.getTerminalId()).getIp());
|
||||
}
|
||||
|
||||
|
||||
if (statMap.containsKey(item.getPowerrId())) {
|
||||
item.setMidStation(statMap.get(item.getPowerrId()).getMidStationId());
|
||||
}
|
||||
|
||||
if (mapBus.containsKey(item.getLineId())) {
|
||||
item.setBusId(mapBus.get(item.getLineId()).getMidBusId());
|
||||
@@ -287,6 +291,42 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Page<Monitor> getAllMainUserPageList(TerminalQueryParam baseParam) {
|
||||
|
||||
|
||||
List<String> objTypeIds = new ArrayList<>();
|
||||
if(StrUtil.isNotBlank(baseParam.getObjType())){
|
||||
if(baseParam.getObjType().equals("987654321")){
|
||||
//特殊处理
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
|
||||
List<SysDicTreePO> typicDic =sysDicTreePOList.stream().filter(item->Objects.equals(DicTreeEnum.Power_Station.getCode(),item.getCode())||Objects.equals(DicTreeEnum.Ele_Railways.getCode(),item.getCode())||
|
||||
Objects.equals(DicTreeEnum.Wind_Farms.getCode(),item.getCode())||Objects.equals(DicTreeEnum.Imp_Users.getCode(),item.getCode())).collect(Collectors.toList());
|
||||
|
||||
for(SysDicTreePO sysDicTreePO : typicDic){
|
||||
List<DictTreeVO> temList = dictTreeFeignClient.query(sysDicTreePO.getId()).getData();
|
||||
List<String> ids = temList.stream().map(DictTreeVO::getId).collect(Collectors.toList());
|
||||
objTypeIds.addAll(ids);
|
||||
objTypeIds.add(sysDicTreePO.getId());
|
||||
}
|
||||
}else {
|
||||
SysDicTreePO sysDicTreePO = dictTreeFeignClient.queryById(baseParam.getObjType()).getData();
|
||||
if(sysDicTreePO.getPid().equals("0")){
|
||||
List<DictTreeVO> temList = dictTreeFeignClient.query(sysDicTreePO.getId()).getData();
|
||||
List<String> ids = temList.stream().map(DictTreeVO::getId).collect(Collectors.toList());
|
||||
objTypeIds.addAll(ids);
|
||||
}
|
||||
objTypeIds.add(sysDicTreePO.getId());
|
||||
}
|
||||
baseParam.setObjTypeList(objTypeIds);
|
||||
}
|
||||
Page<Monitor> page = this.baseMapper.getAllObjUser(new Page<>(baseParam.getPageNum(), baseParam.getPageSize()),baseParam);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Monitor> getMonitorList(List<String> monitorIds) {
|
||||
List<Monitor> monitorList = new ArrayList<>();
|
||||
@@ -1273,37 +1313,38 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
}
|
||||
|
||||
|
||||
// 初始化字典数据的通用方法
|
||||
private Map<String, DictData> initDictData(DicDataTypeEnum type) {
|
||||
return dicDataFeignClient.getDicDataByTypeCode(type.getCode()).getData()
|
||||
.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
}
|
||||
|
||||
|
||||
private String dealData(List<OracleTerminalExcel> oracleTerminalExcelList) {
|
||||
List<OracleTerminalExcel.OracleTerminalExcelMsg> oracleTerminalExcelMsg = new ArrayList<>();
|
||||
|
||||
List<DeptDTO> allDept = deptFeignClient.getDeptDescendantIndexes(deptFeignClient.getRootDept().getData().getId(), Stream.of(0, 1, 2).collect(Collectors.toList())).getData();
|
||||
Map<String, DeptDTO> mapDept = allDept.stream().collect(Collectors.toMap(DeptDTO::getName, Function.identity()));
|
||||
|
||||
List<DictData> voltageLevelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
Map<String, DictData> voltageLevelMap = voltageLevelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> voltageLevelMap = initDictData(DicDataTypeEnum.DEV_VOLTAGE);
|
||||
|
||||
//装置型号
|
||||
List<DictData> devTypelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
||||
Map<String, DictData> devTypelDicMap = devTypelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
|
||||
//装置类别
|
||||
DictData devCategoryDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_CATEGORY.getName(), DicDataEnum.Monitor_Terminals.getName()).getData();
|
||||
Map<String, DictData> devTypelDicMap = initDictData(DicDataTypeEnum.DEV_TYPE);
|
||||
|
||||
//装置状态
|
||||
List<DictData> devStatelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_STATUS.getCode()).getData();
|
||||
Map<String, DictData> devStateDicMap = devStatelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> devStateDicMap = initDictData(DicDataTypeEnum.DEV_STATUS);
|
||||
|
||||
//监测点状态
|
||||
List<DictData> monitorStatelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LINE_STATE.getCode()).getData();
|
||||
Map<String, DictData> monitorStateDicMap = monitorStatelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> monitorStateDicMap = initDictData(DicDataTypeEnum.LINE_STATE);
|
||||
|
||||
//监测点标签
|
||||
List<DictData> objTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
|
||||
Map<String, DictData> objTypeDicMap = objTypeList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> objTypeDicMap = initDictData(DicDataTypeEnum.MONITORING_LABELS);
|
||||
|
||||
//装置厂家
|
||||
List<DictData> manList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
Map<String, DictData> manDicMap = manList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> manDicMap = initDictData(DicDataTypeEnum.DEV_MANUFACTURER);
|
||||
|
||||
//接线方式
|
||||
Map<String, DictData> wireListMap = initDictData(DicDataTypeEnum.DEV_CONNECT);
|
||||
|
||||
//装作等级
|
||||
DictData devGrade = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_GRADE.getName(), DicDataEnum.MOST_IMPORMENT.getName()).getData();
|
||||
@@ -1314,25 +1355,22 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
//监测点类型
|
||||
DictData monitorType = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.LINE_TYPE.getName(), DicDataEnum.Power_Supply_Point.getName()).getData();
|
||||
|
||||
//接线方式
|
||||
List<DictData> wireList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||
Map<String, DictData> wireListMap = wireList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
|
||||
DictData potentialDic = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.Cap_V.getCode(),DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||
|
||||
DictData neutralDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.Neutral_Point.getName(), DicDataEnum.Ground_Res.getName()).getData();
|
||||
//装置类别
|
||||
DictData devCategoryDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_CATEGORY.getName(), DicDataEnum.Monitor_Terminals.getName()).getData();
|
||||
|
||||
|
||||
List<DictData> businessType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BUSINESS_TYPE.getCode()).getData();
|
||||
Map<String, DictData> businessDicMap = businessType.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
|
||||
|
||||
//TODO 零时处理
|
||||
//对象类型
|
||||
List<SysDicTreePO> dicTree = dictTreeFeignClient.queryAll().getData();
|
||||
dicTree = dicTree.stream().filter(item->item.getCode()!="Device_Unit" && !item.getCode().contains("@")).collect(Collectors.toList());
|
||||
Map<String,SysDicTreePO> objTypeMap = dicTree.stream().collect(Collectors.toMap(SysDicTreePO::getName,Function.identity()));
|
||||
|
||||
|
||||
|
||||
for (OracleTerminalExcel oracleTerminalExcel : oracleTerminalExcelList) {
|
||||
|
||||
//单位
|
||||
if (oracleTerminalExcel.getGdName().equals("省检修")) {
|
||||
oracleTerminalExcel.setGdName("国网河北超高压公司本部");
|
||||
@@ -1347,7 +1385,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
//判断是否操作过该条记录
|
||||
LineBak lineBak = lineBakMapper.selectOne(new LambdaQueryWrapper<LineBak>().eq(LineBak::getLineId, oracleTerminalExcel.getId()));
|
||||
|
||||
DeviceBak deviceBak = deviceBakMapper.selectOne(new LambdaQueryWrapper<DeviceBak>().eq(DeviceBak::getDevId, oracleTerminalExcel.getDeviceId()));
|
||||
|
||||
|
||||
@@ -1416,14 +1453,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* if (devTypelDicMap.containsKey(oracleTerminalExcel.getDevType())) {
|
||||
pmsTerminalPO.setTerminalState(devTypelDicMap.get(oracleTerminalExcel.getDevType()).getId());
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典终端状态不存在,请确认后重试"));
|
||||
continue;
|
||||
}*/
|
||||
|
||||
//终端状态
|
||||
String devState = null;
|
||||
switch (oracleTerminalExcel.getRunFlag()) {
|
||||
@@ -1473,16 +1502,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
deviceBakMapper.insert(deviceBakPO);
|
||||
terminalMapper.updateById(pmsTerminalPO);
|
||||
devId = pmsTerminal.getId();
|
||||
} else if (Objects.isNull(pmsTerminal)) {
|
||||
terminalMapper.deleteById(deviceBak.getId());
|
||||
pmsTerminalPO.setId(deviceBak.getId());
|
||||
terminalMapper.insert(pmsTerminalPO);
|
||||
devId = pmsTerminalPO.getId();
|
||||
} else {
|
||||
devId = pmsTerminal.getId();
|
||||
devId = deviceBak.getId();
|
||||
pmsTerminalPO.setId(devId);
|
||||
terminalMapper.updateById(pmsTerminalPO);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1494,8 +1517,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
GeneratrixWire generatrixWire = generatrixWireMapper.selectOne(generatrixWireLambdaQueryWrapper);
|
||||
|
||||
String lineId = null, lineName = null, genScale = null;
|
||||
|
||||
|
||||
GeneratrixWire generatrixWirePO = new GeneratrixWire();
|
||||
generatrixWirePO.setGeneratrixName(oracleTerminalExcel.getSubvName());
|
||||
generatrixWirePO.setStatus(DataStateEnum.ENABLE.getCode());
|
||||
@@ -1521,7 +1542,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
} else {
|
||||
generatrixWirePO.setId(generatrixWire.getId());
|
||||
generatrixWireMapper.updateById(generatrixWirePO);
|
||||
lineId = generatrixWire.getId();
|
||||
lineId = generatrixWirePO.getId();
|
||||
lineName = generatrixWirePO.getName();
|
||||
genScale = generatrixWirePO.getScale();
|
||||
}
|
||||
@@ -1530,11 +1551,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
monitorLambdaQueryWrapper.eq(Monitor::getLineId, lineId)
|
||||
.eq(Monitor::getName, oracleTerminalExcel.getLineName());
|
||||
List<Monitor> monitorList = monitorMapper.selectList(monitorLambdaQueryWrapper);
|
||||
Monitor monitor = monitorMapper.selectOne(monitorLambdaQueryWrapper);
|
||||
|
||||
if(CollUtil.isNotEmpty(monitorList)) {
|
||||
|
||||
for (Monitor monitor : monitorList) {
|
||||
|
||||
//当前电站下面没有监测点,可以新增
|
||||
Monitor monitorPO = new Monitor();
|
||||
@@ -1555,6 +1573,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
one = "06";
|
||||
} else if (deptDTO.getName().contains("超高压")) {
|
||||
one = "07";
|
||||
} else if (deptDTO.getName().contains("雄安")) {
|
||||
one = "08";
|
||||
} else {
|
||||
one = "3.14159";
|
||||
}
|
||||
@@ -1563,7 +1583,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
monitorPO.setMonitorId(monitorId + one + last);
|
||||
|
||||
|
||||
monitorPO.setLineNum(oracleTerminalExcel.getLineNum());
|
||||
monitorPO.setName(oracleTerminalExcel.getLineName());
|
||||
monitorPO.setPowerrName(stationName);
|
||||
monitorPO.setPowerrId(stationId);
|
||||
@@ -1600,7 +1620,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测点运行状态不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
monitorPO.setPutDate(oracleTerminalExcel.getLoginTime());
|
||||
monitorPO.setMonitorType(monitorType.getId());
|
||||
monitorPO.setStandShortCapacity(oracleTerminalExcel.getStandardCapacity());
|
||||
monitorPO.setMinShortCircuitCapacity(oracleTerminalExcel.getShortCapacity());
|
||||
@@ -1620,7 +1640,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
monitorPO.setMonitorObjectName(oracleTerminalExcel.getObjName());
|
||||
|
||||
|
||||
if (oracleTerminalExcel.getLoadType().equals("电加热负荷") ||oracleTerminalExcel.getLoadType().equals("轧机") || oracleTerminalExcel.getLoadType().equals("其他非线性负荷")) {
|
||||
if (oracleTerminalExcel.getLoadType().equals("电加热负荷") || oracleTerminalExcel.getLoadType().equals("轧机") || oracleTerminalExcel.getLoadType().equals("其他非线性负荷")|| oracleTerminalExcel.getLoadType().equals("变频调速负荷")) {
|
||||
if (objTypeDicMap.containsKey("冶炼负荷")) {
|
||||
String objTypeId = objTypeDicMap.get("冶炼负荷").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1628,7 +1648,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "冶炼负荷字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("商业/市政/民用/电子通讯负荷")) {
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("商业/市政/民用/电子通讯负荷")|| "电动汽车充电站".equals(oracleTerminalExcel.getLoadType()) ||"轨道交通".equals(oracleTerminalExcel.getLoadType())) {
|
||||
if (objTypeDicMap.containsKey("城市商业")) {
|
||||
String objTypeId = objTypeDicMap.get("城市商业").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1637,7 +1657,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("半导体制造") || oracleTerminalExcel.getLoadType().equals("精密加工")) {
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("半导体制造") || oracleTerminalExcel.getLoadType().equals("精密加工") || oracleTerminalExcel.getLoadType().equals("党政机关")||"敏感/重要/高危用户".equals(oracleTerminalExcel.getLoadType())) {
|
||||
if (objTypeDicMap.containsKey("敏感用户")) {
|
||||
String objTypeId = objTypeDicMap.get("敏感用户").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1651,7 +1671,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
String objTypeId = objTypeDicMap.get("主变高压侧").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "主变高压侧字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("跨省计量关口")) {
|
||||
@@ -1672,42 +1692,55 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
continue;
|
||||
}
|
||||
|
||||
}else if (oracleTerminalExcel.getLoadType().equals("风电场")) {
|
||||
if (objTypeDicMap.containsKey("陆上风电")) {
|
||||
String objTypeId = objTypeDicMap.get("陆上风电").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "风电场字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
}else if (oracleTerminalExcel.getLoadType().equals("其他发电厂")) {
|
||||
if (objTypeDicMap.containsKey("其他电源")) {
|
||||
String objTypeId = objTypeDicMap.get("其他电源").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "其他电源监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeDicMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType()+"字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//监测点对象类型
|
||||
|
||||
if (objTypeMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("电加热负荷")) {
|
||||
String objTypeId = objTypeMap.get("电加热负荷(含电弧炉、中频炉、电热炉、单/多晶硅生产设备)").getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("变频调速负荷")) {
|
||||
String objTypeId = objTypeMap.get("变频调速负荷(变频电机、变频水泵等)").getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("敏感/重要/高危用户")) {
|
||||
String objTypeId = objTypeMap.get("敏感/重要/高危用户").getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType() + "字典监测点对象类型不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
//行业类型
|
||||
/* if (businessDicMap.containsKey(oracleTerminalExcel.getBusinessType())) {
|
||||
String busTypeId = businessDicMap.get(oracleTerminalExcel.getBusinessType()).getId();
|
||||
monitorPO.setTradeCode(busTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getBusinessType()+"字典行业类型不存在,请确认后重试"));
|
||||
continue;
|
||||
}*/
|
||||
|
||||
//TODO 监测点对象名称
|
||||
|
||||
|
||||
String wireMethod = "";
|
||||
switch (oracleTerminalExcel.getPtType()) {
|
||||
case 0:
|
||||
@@ -1748,7 +1781,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
monitorPO.setPowerFlag("102");
|
||||
}
|
||||
|
||||
|
||||
if (Objects.isNull(lineBak) && Objects.isNull(monitor)) {
|
||||
monitorPO.setIsUpToGrid(0);
|
||||
monitorMapper.insert(monitorPO);
|
||||
@@ -1765,23 +1797,23 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
lineBakPO.setId(monitorPO.getId());
|
||||
lineBakPO.setLineId(oracleTerminalExcel.getId());
|
||||
lineBakMapper.insert(lineBakPO);
|
||||
|
||||
} else {
|
||||
if (Objects.isNull(lineBak)) {
|
||||
|
||||
lineBakMapper.delete(new LambdaQueryWrapper<LineBak>().eq(LineBak::getId,monitor.getId()));
|
||||
LineBak lineBakPO = new LineBak();
|
||||
lineBakPO.setId(monitor.getId());
|
||||
lineBakPO.setLineId(oracleTerminalExcel.getId());
|
||||
System.out.println(oracleTerminalExcel.getId());
|
||||
lineBakMapper.insert(lineBakPO);
|
||||
monitorMapper.updateById(monitorPO);
|
||||
} else if (Objects.isNull(monitor)) {
|
||||
monitorPO.setIsUpToGrid(0);
|
||||
monitorMapper.deleteById(lineBak.getId());
|
||||
monitorPO.setId(lineBak.getId());
|
||||
monitorMapper.insert(monitorPO);
|
||||
} else {
|
||||
monitorPO.setId(lineBak.getId());
|
||||
monitorMapper.updateById(monitorPO);
|
||||
}
|
||||
|
||||
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(Float.parseFloat(scale.getValue()), oracleTerminalExcel.getDealCapacity(), oracleTerminalExcel.getDevCapacity(), oracleTerminalExcel.getShortCapacity(), 0, 0);
|
||||
overlimit.setId(monitorPO.getId());
|
||||
Overlimit overlimitRes = overlimitMapper.selectById(monitorPO.getId());
|
||||
@@ -1792,13 +1824,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(oracleTerminalExcelMsg)) {
|
||||
ExcelUtil.exportExcel("失败列表.xlsx", OracleTerminalExcel.OracleTerminalExcelMsg.class, oracleTerminalExcelMsg);
|
||||
return null;
|
||||
@@ -1809,11 +1838,11 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
private String dealVoltageLevel(String voltage) {
|
||||
float scale = Float.parseFloat(voltage.substring(0, voltage.indexOf("kV")));
|
||||
if (scale < 500) {
|
||||
//if (scale < 500) {
|
||||
return "交流" + voltage;
|
||||
} else {
|
||||
return "直流" + voltage;
|
||||
}
|
||||
//} else {
|
||||
// return "直流" + voltage;
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.njcn.device.pms.mapper.majornetwork.PowerDistributionareaMapper;
|
||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||
import com.njcn.device.pms.pojo.excel.PowerGenerationUserExcel;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pms.pojo.po.GeneratrixWire;
|
||||
import com.njcn.device.pms.pojo.po.PowerDistributionarea;
|
||||
import com.njcn.device.pms.pojo.po.PowerGenerationUser;
|
||||
@@ -82,16 +83,18 @@ public class PowerDistributionareaServiceImpl extends ServiceImpl<PowerDistribut
|
||||
|
||||
|
||||
@Override
|
||||
public Page<PowerDistributionarea> getList(BaseParam baseParam) {
|
||||
List<Dept> deptInfo = deptFeignClient.getAllDept().getData();
|
||||
List<String> deptIds = deptInfo.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
public Page<PowerDistributionarea> getList(TaiZhangParam baseParam) {
|
||||
List<String> deptInfo = deptFeignClient.getDepSonSelfCodetByDeptId(baseParam.getOrgId()).getData();
|
||||
LambdaQueryWrapper<PowerDistributionarea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PowerDistributionarea::getStatus,DataStateEnum.ENABLE.getCode())
|
||||
.in(CollUtil.isNotEmpty(deptIds),PowerDistributionarea::getOrgId,deptIds)
|
||||
.in(CollUtil.isNotEmpty(deptInfo),PowerDistributionarea::getOrgId,deptInfo)
|
||||
.and(StrUtil.isNotBlank(baseParam.getSearchValue()),
|
||||
i->i.like(PowerDistributionarea::getName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(PowerDistributionarea::getPowerrName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(PowerDistributionarea::getLineName,baseParam.getSearchValue())
|
||||
|
||||
.or()
|
||||
.like(PowerDistributionarea::getOrgName,baseParam.getSearchValue())).orderByDesc(PowerDistributionarea::getCreateTime);
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.CvtRelationFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警管理Feign客户端
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/9/19
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/cvtBind", fallbackFactory = CvtRelationFeignClientFallbackFactory.class, contextId = "cvtBind")
|
||||
public interface CvtRelationFeignClient {
|
||||
|
||||
@PostMapping("queryByLineId")
|
||||
HttpResult<CvtHarmonicCorrectionFactorsDTO> queryByLineId(@RequestParam("lineId") String lineId);
|
||||
}
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.DeviceFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.DevComFlagDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
@@ -33,4 +37,8 @@ public interface DeviceFeignClient {
|
||||
@RequestParam("thisTimeCheck") String thisTimeCheck,
|
||||
@RequestParam("nextTimeCheck") String nextTimeCheck);
|
||||
|
||||
@PostMapping("/updateDevComFlag")
|
||||
@ApiOperation("修改装置通讯状态")
|
||||
HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.device.pq.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.CvtRelationFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警管理熔断降级
|
||||
* @author yzh
|
||||
* @date 2022/9/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CvtRelationFeignClientFallbackFactory implements FallbackFactory<CvtRelationFeignClient> {
|
||||
@Override
|
||||
public CvtRelationFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CvtRelationFeignClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public HttpResult<CvtHarmonicCorrectionFactorsDTO> queryByLineId(String lineId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "监测点获取Cvt系数", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.DeviceFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.DevComFlagDTO;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -31,6 +32,12 @@ public class DeviceFeignClientFallbackFactory implements FallbackFactory<DeviceF
|
||||
log.error("{}异常,降级处理,异常为:{}", "技术监督修改装置定检时间", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> updateDevComFlag(DevComFlagDTO devComFlagDTO) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "修改设备状态", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ public enum PvDeviceResponseEnum {
|
||||
PROJECT_OR_NOT("A00550","项目名称为空,请检查信息是否存在!"),
|
||||
PROVINCE_OR_NOT("A00550","省级名称为空,请检查信息是否存在!"),
|
||||
GD_OR_NOT("A00550","供电公司名称为空,请检查信息是否存在!"),
|
||||
OVER_LIMIT("A00550","前置机配置设备过多"),
|
||||
NO_DEVICE("A00550","前置机下无设备"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CvtHarmonicCorrectionFactorsDTO {
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* cvt名称
|
||||
*/
|
||||
private String cvtName;
|
||||
|
||||
/**
|
||||
* cvt型号
|
||||
*/
|
||||
private String cvtModel;
|
||||
|
||||
private BigDecimal h2;
|
||||
|
||||
private BigDecimal h3;
|
||||
|
||||
private BigDecimal h4;
|
||||
|
||||
private BigDecimal h5;
|
||||
|
||||
private BigDecimal h6;
|
||||
|
||||
private BigDecimal h7;
|
||||
|
||||
private BigDecimal h8;
|
||||
|
||||
private BigDecimal h9;
|
||||
|
||||
private BigDecimal h10;
|
||||
|
||||
private BigDecimal h11;
|
||||
|
||||
private BigDecimal h12;
|
||||
|
||||
private BigDecimal h13;
|
||||
|
||||
private BigDecimal h14;
|
||||
|
||||
private BigDecimal h15;
|
||||
|
||||
private BigDecimal h16;
|
||||
|
||||
private BigDecimal h17;
|
||||
|
||||
private BigDecimal h18;
|
||||
|
||||
private BigDecimal h19;
|
||||
|
||||
private BigDecimal h20;
|
||||
|
||||
private BigDecimal h21;
|
||||
|
||||
private BigDecimal h22;
|
||||
|
||||
private BigDecimal h23;
|
||||
|
||||
private BigDecimal h24;
|
||||
|
||||
private BigDecimal h25;
|
||||
|
||||
private BigDecimal h26;
|
||||
|
||||
private BigDecimal h27;
|
||||
|
||||
private BigDecimal h28;
|
||||
|
||||
private BigDecimal h29;
|
||||
|
||||
private BigDecimal h30;
|
||||
|
||||
private BigDecimal h31;
|
||||
|
||||
private BigDecimal h32;
|
||||
|
||||
private BigDecimal h33;
|
||||
|
||||
private BigDecimal h34;
|
||||
|
||||
private BigDecimal h35;
|
||||
|
||||
private BigDecimal h36;
|
||||
|
||||
private BigDecimal h37;
|
||||
|
||||
private BigDecimal h38;
|
||||
|
||||
private BigDecimal h39;
|
||||
|
||||
private BigDecimal h40;
|
||||
|
||||
private BigDecimal h41;
|
||||
|
||||
private BigDecimal h42;
|
||||
|
||||
private BigDecimal h43;
|
||||
|
||||
private BigDecimal h44;
|
||||
|
||||
private BigDecimal h45;
|
||||
|
||||
private BigDecimal h46;
|
||||
|
||||
private BigDecimal h47;
|
||||
|
||||
private BigDecimal h48;
|
||||
|
||||
private BigDecimal h49;
|
||||
|
||||
private BigDecimal h50;
|
||||
/**
|
||||
* 创建用户
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -38,6 +38,8 @@ public class DeviceInfo {
|
||||
private String series;
|
||||
//终端识别码
|
||||
private String devKey;
|
||||
|
||||
private Integer processNo;
|
||||
//
|
||||
private List<MonitorInfo> monitorData;
|
||||
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CvtHarmonicCorrectionFactorsParam {
|
||||
|
||||
/**
|
||||
* cvt名称
|
||||
*/
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = "cvt名称过长")
|
||||
private String cvtName;
|
||||
|
||||
/**
|
||||
* cvt型号
|
||||
*/
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = "cvt型号")
|
||||
private String cvtModel;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h2;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h3;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h4;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h5;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h6;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h7;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h8;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h9;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h10;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h11;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h12;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h13;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h14;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h15;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h16;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h17;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h18;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h19;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h20;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h21;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h22;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h23;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h24;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h25;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h26;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h27;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h28;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h29;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h30;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h31;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h32;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h33;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h34;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h35;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h36;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h37;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h38;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h39;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h40;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h41;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h42;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h43;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h44;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h45;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h46;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h47;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h48;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h49;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h50;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CvtHarmonicCorrectionFactorsParamUpdateParam extends CvtHarmonicCorrectionFactorsParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 前置查询
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CvtHarmonicCorrectionFactorsParamQueryParam extends BaseParam {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CvtLineRelationParam {
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* cvt系数表id
|
||||
*/
|
||||
private String cvtId;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CvtLineRelationUpdateParam extends CvtLineRelationParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 线路信息表
|
||||
@@ -68,7 +65,7 @@ public class LineParam {
|
||||
*/
|
||||
@ApiModelProperty(name = "devCapacity",value = "设备容量",required = true)
|
||||
@NotNull(message = "设备容量不可为空")
|
||||
@Min(value = 1,message = "设备容量格式有误")
|
||||
@Min(value=0,message = "设备容量格式有误")
|
||||
private Float devCapacity;
|
||||
|
||||
/**
|
||||
@@ -76,7 +73,7 @@ public class LineParam {
|
||||
*/
|
||||
@ApiModelProperty(name = "shortCapacity",value = "短路容量",required = true)
|
||||
@NotNull(message = "短路容量不可为空")
|
||||
@Min(value = 1,message = "设备容量格式有误")
|
||||
@Min(value=0,message = "设备容量格式有误")
|
||||
private Float shortCapacity;
|
||||
|
||||
/**
|
||||
@@ -84,7 +81,7 @@ public class LineParam {
|
||||
*/
|
||||
@ApiModelProperty(name = "dealCapacity",value = "协议容量",required = true)
|
||||
@NotNull(message = "协议容量不可为空")
|
||||
@Min(value = 1,message = "设备容量格式有误")
|
||||
@Min(value=0,message = "设备容量格式有误")
|
||||
private Float dealCapacity;
|
||||
|
||||
/**
|
||||
@@ -92,7 +89,7 @@ public class LineParam {
|
||||
*/
|
||||
@ApiModelProperty(name = "standardCapacity",value = "基准容量新增时候可为空",required = true)
|
||||
@NotNull(message = "基准容量不可为空")
|
||||
@Min(value = 1,message = "设备容量格式有误")
|
||||
@Min(value=0,message = "设备容量格式有误")
|
||||
private Float standardCapacity;
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.List;
|
||||
@ApiModel
|
||||
public class NodeDeviceParam {
|
||||
|
||||
|
||||
/**
|
||||
* 服务器IP
|
||||
*/
|
||||
@@ -31,4 +30,6 @@ public class NodeDeviceParam {
|
||||
private String ip;
|
||||
|
||||
private List<Integer> runFlag;
|
||||
|
||||
private String devId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@TableName(value = "cvt_harmonic_correction_factors")
|
||||
@Data
|
||||
public class CvtHarmonicCorrectionFactors extends BaseEntity {
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* cvt名称
|
||||
*/
|
||||
@TableField(value = "cvt_name")
|
||||
private String cvtName;
|
||||
|
||||
/**
|
||||
* cvt型号
|
||||
*/
|
||||
@TableField(value = "cvt_model")
|
||||
private String cvtModel;
|
||||
|
||||
@TableField(value = "h2")
|
||||
private BigDecimal h2;
|
||||
|
||||
@TableField(value = "h3")
|
||||
private BigDecimal h3;
|
||||
|
||||
@TableField(value = "h4")
|
||||
private BigDecimal h4;
|
||||
|
||||
@TableField(value = "h5")
|
||||
private BigDecimal h5;
|
||||
|
||||
@TableField(value = "h6")
|
||||
private BigDecimal h6;
|
||||
|
||||
@TableField(value = "h7")
|
||||
private BigDecimal h7;
|
||||
|
||||
@TableField(value = "h8")
|
||||
private BigDecimal h8;
|
||||
|
||||
@TableField(value = "h9")
|
||||
private BigDecimal h9;
|
||||
|
||||
@TableField(value = "h10")
|
||||
private BigDecimal h10;
|
||||
|
||||
@TableField(value = "h11")
|
||||
private BigDecimal h11;
|
||||
|
||||
@TableField(value = "h12")
|
||||
private BigDecimal h12;
|
||||
|
||||
@TableField(value = "h13")
|
||||
private BigDecimal h13;
|
||||
|
||||
@TableField(value = "h14")
|
||||
private BigDecimal h14;
|
||||
|
||||
@TableField(value = "h15")
|
||||
private BigDecimal h15;
|
||||
|
||||
@TableField(value = "h16")
|
||||
private BigDecimal h16;
|
||||
|
||||
@TableField(value = "h17")
|
||||
private BigDecimal h17;
|
||||
|
||||
@TableField(value = "h18")
|
||||
private BigDecimal h18;
|
||||
|
||||
@TableField(value = "h19")
|
||||
private BigDecimal h19;
|
||||
|
||||
@TableField(value = "h20")
|
||||
private BigDecimal h20;
|
||||
|
||||
@TableField(value = "h21")
|
||||
private BigDecimal h21;
|
||||
|
||||
@TableField(value = "h22")
|
||||
private BigDecimal h22;
|
||||
|
||||
@TableField(value = "h23")
|
||||
private BigDecimal h23;
|
||||
|
||||
@TableField(value = "h24")
|
||||
private BigDecimal h24;
|
||||
|
||||
@TableField(value = "h25")
|
||||
private BigDecimal h25;
|
||||
|
||||
@TableField(value = "h26")
|
||||
private BigDecimal h26;
|
||||
|
||||
@TableField(value = "h27")
|
||||
private BigDecimal h27;
|
||||
|
||||
@TableField(value = "h28")
|
||||
private BigDecimal h28;
|
||||
|
||||
@TableField(value = "h29")
|
||||
private BigDecimal h29;
|
||||
|
||||
@TableField(value = "h30")
|
||||
private BigDecimal h30;
|
||||
|
||||
@TableField(value = "h31")
|
||||
private BigDecimal h31;
|
||||
|
||||
@TableField(value = "h32")
|
||||
private BigDecimal h32;
|
||||
|
||||
@TableField(value = "h33")
|
||||
private BigDecimal h33;
|
||||
|
||||
@TableField(value = "h34")
|
||||
private BigDecimal h34;
|
||||
|
||||
@TableField(value = "h35")
|
||||
private BigDecimal h35;
|
||||
|
||||
@TableField(value = "h36")
|
||||
private BigDecimal h36;
|
||||
|
||||
@TableField(value = "h37")
|
||||
private BigDecimal h37;
|
||||
|
||||
@TableField(value = "h38")
|
||||
private BigDecimal h38;
|
||||
|
||||
@TableField(value = "h39")
|
||||
private BigDecimal h39;
|
||||
|
||||
@TableField(value = "h40")
|
||||
private BigDecimal h40;
|
||||
|
||||
@TableField(value = "h41")
|
||||
private BigDecimal h41;
|
||||
|
||||
@TableField(value = "h42")
|
||||
private BigDecimal h42;
|
||||
|
||||
@TableField(value = "h43")
|
||||
private BigDecimal h43;
|
||||
|
||||
@TableField(value = "h44")
|
||||
private BigDecimal h44;
|
||||
|
||||
@TableField(value = "h45")
|
||||
private BigDecimal h45;
|
||||
|
||||
@TableField(value = "h46")
|
||||
private BigDecimal h46;
|
||||
|
||||
@TableField(value = "h47")
|
||||
private BigDecimal h47;
|
||||
|
||||
@TableField(value = "h48")
|
||||
private BigDecimal h48;
|
||||
|
||||
@TableField(value = "h49")
|
||||
private BigDecimal h49;
|
||||
|
||||
@TableField(value = "h50")
|
||||
private BigDecimal h50;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "cvt_line_relation")
|
||||
public class CvtLineRelation {
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
@TableField(value = "line_id")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* cvt系数表id
|
||||
*/
|
||||
@TableField(value = "cvt_id")
|
||||
private String cvtId;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/01/22 下午 1:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("pq_device_process")
|
||||
public class DeviceProcess implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//设备id
|
||||
private String id;
|
||||
//设备设备所在前置机进程号
|
||||
private Integer processNo;
|
||||
|
||||
}
|
||||
@@ -55,6 +55,14 @@ public class Node extends BaseEntity {
|
||||
*/
|
||||
private Integer nodeDevNum;
|
||||
|
||||
|
||||
/**
|
||||
* 前置机支持最大进程数量
|
||||
*/
|
||||
private Integer maxProcessNum;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
|
||||
@@ -31,10 +31,10 @@ public class PqIcdPath {
|
||||
/**
|
||||
* 装置类型名称
|
||||
*/
|
||||
@TableField(value = "`Name`")
|
||||
@TableField(value = "Name")
|
||||
private String name;
|
||||
|
||||
@TableField(value = "`Path`")
|
||||
@TableField(value = "Path")
|
||||
private String path;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CvtHarmonicCorrectionFactorsVO {
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* cvt名称
|
||||
*/
|
||||
private String cvtName;
|
||||
|
||||
/**
|
||||
* cvt型号
|
||||
*/
|
||||
private String cvtModel;
|
||||
|
||||
private BigDecimal h2;
|
||||
|
||||
private BigDecimal h3;
|
||||
|
||||
private BigDecimal h4;
|
||||
|
||||
private BigDecimal h5;
|
||||
|
||||
private BigDecimal h6;
|
||||
|
||||
private BigDecimal h7;
|
||||
|
||||
private BigDecimal h8;
|
||||
|
||||
private BigDecimal h9;
|
||||
|
||||
private BigDecimal h10;
|
||||
|
||||
private BigDecimal h11;
|
||||
|
||||
private BigDecimal h12;
|
||||
|
||||
private BigDecimal h13;
|
||||
|
||||
private BigDecimal h14;
|
||||
|
||||
private BigDecimal h15;
|
||||
|
||||
private BigDecimal h16;
|
||||
|
||||
private BigDecimal h17;
|
||||
|
||||
private BigDecimal h18;
|
||||
|
||||
private BigDecimal h19;
|
||||
|
||||
private BigDecimal h20;
|
||||
|
||||
private BigDecimal h21;
|
||||
|
||||
private BigDecimal h22;
|
||||
|
||||
private BigDecimal h23;
|
||||
|
||||
private BigDecimal h24;
|
||||
|
||||
private BigDecimal h25;
|
||||
|
||||
private BigDecimal h26;
|
||||
|
||||
private BigDecimal h27;
|
||||
|
||||
private BigDecimal h28;
|
||||
|
||||
private BigDecimal h29;
|
||||
|
||||
private BigDecimal h30;
|
||||
|
||||
private BigDecimal h31;
|
||||
|
||||
private BigDecimal h32;
|
||||
|
||||
private BigDecimal h33;
|
||||
|
||||
private BigDecimal h34;
|
||||
|
||||
private BigDecimal h35;
|
||||
|
||||
private BigDecimal h36;
|
||||
|
||||
private BigDecimal h37;
|
||||
|
||||
private BigDecimal h38;
|
||||
|
||||
private BigDecimal h39;
|
||||
|
||||
private BigDecimal h40;
|
||||
|
||||
private BigDecimal h41;
|
||||
|
||||
private BigDecimal h42;
|
||||
|
||||
private BigDecimal h43;
|
||||
|
||||
private BigDecimal h44;
|
||||
|
||||
private BigDecimal h45;
|
||||
|
||||
private BigDecimal h46;
|
||||
|
||||
private BigDecimal h47;
|
||||
|
||||
private BigDecimal h48;
|
||||
|
||||
private BigDecimal h49;
|
||||
|
||||
private BigDecimal h50;
|
||||
/**
|
||||
* 创建用户
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class DeviceUtil {
|
||||
public static String decoderString(Integer cd,String content){
|
||||
String seriesTmp = null;
|
||||
if (cd == 0) {
|
||||
seriesTmp = Base64.decodeBase64(content).toString();
|
||||
seriesTmp = new String(Base64.decodeBase64(content));
|
||||
} else if (cd == 1) {
|
||||
seriesTmp = ThreeDesUtil.decryptThreeDes(content);
|
||||
} else if (cd == 2) {
|
||||
|
||||
@@ -45,6 +45,15 @@
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn.platform</groupId>
|
||||
<artifactId>message-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -41,6 +42,15 @@ public class CommLineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getPollutionLineInfo")
|
||||
@ApiOperation("获取污区值监测点相关信息")
|
||||
public HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(@RequestParam("id") List<String> id) {
|
||||
String methodDescribe = getMethodDescribe("getPollutionLineInfo");
|
||||
List<PollutionLineInfoDTO> result = lineService.getPollutionLineInfo(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getLineAllDetail")
|
||||
@ApiOperation("获取监测点id取超标监测点信息")
|
||||
|
||||
@@ -179,7 +179,7 @@ public class CommTerminalController extends BaseController {
|
||||
public HttpResult<List<DeptGetDeviceDTO>> deptGetDevice(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||
TimeInterval timer = new TimeInterval();
|
||||
String methodDescribe = getMethodDescribe("deptGetDevice");
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam,0);
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam,3);
|
||||
log.info("运行时长" + timer.intervalSecond());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtHarmonicCorrectionFactorsParam;
|
||||
import com.njcn.device.pq.pojo.param.NodeParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
import com.njcn.device.pq.service.CvtHarmonicCorrectionFactorsService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Api(tags = "cvt系数配置")
|
||||
@RestController
|
||||
@RequestMapping("/cvt")
|
||||
@RequiredArgsConstructor
|
||||
public class CvtHarmonicCorrectionFactorsController extends BaseController {
|
||||
|
||||
private final CvtHarmonicCorrectionFactorsService cvtHarmonicCorrectionFactorsService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("新增cvt系数")
|
||||
@ApiImplicitParam(value = "cvt系数信息",name = "cvtHarmonicCorrectionFactorsParam",required = true)
|
||||
@PostMapping("add")
|
||||
public HttpResult<Boolean> add(@Validated @RequestBody CvtHarmonicCorrectionFactorsParam cvtHarmonicCorrectionFactorsParam){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
boolean result = cvtHarmonicCorrectionFactorsService.add(cvtHarmonicCorrectionFactorsParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("修改cvt系数")
|
||||
@ApiImplicitParam(value = "cvt系数信息",name = "updateParam",required = true)
|
||||
@PostMapping("updateCvt")
|
||||
public HttpResult<Boolean> updateCvt(@Validated @RequestBody CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamUpdateParam updateParam){
|
||||
String methodDescribe = getMethodDescribe("updateCvt");
|
||||
boolean result = cvtHarmonicCorrectionFactorsService.updateCvt(updateParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("分页查询")
|
||||
@ApiImplicitParam(value = "cvt系数信息",name = "queryParam",required = true)
|
||||
@PostMapping("queryPage")
|
||||
public HttpResult<Page<CvtHarmonicCorrectionFactorsVO>> queryPage(@Validated @RequestBody CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam){
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
Page<CvtHarmonicCorrectionFactorsVO> result = cvtHarmonicCorrectionFactorsService.queryPage(queryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("列表查询")
|
||||
@PostMapping("queryList")
|
||||
public HttpResult<List<CvtHarmonicCorrectionFactorsDTO>> queryList( @Validated @RequestBody CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam){
|
||||
String methodDescribe = getMethodDescribe("queryList");
|
||||
List<CvtHarmonicCorrectionFactorsDTO> result = cvtHarmonicCorrectionFactorsService.queryList(queryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("根据id查询")
|
||||
@PostMapping("queryById")
|
||||
public HttpResult<CvtHarmonicCorrectionFactorsDTO> queryById( @RequestParam String id){
|
||||
String methodDescribe = getMethodDescribe("queryById");
|
||||
CvtHarmonicCorrectionFactorsDTO result = new CvtHarmonicCorrectionFactorsDTO();
|
||||
CvtHarmonicCorrectionFactors cvt = cvtHarmonicCorrectionFactorsService.getById(id);
|
||||
BeanUtils.copyProperties(result,cvt);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("根据id删除")
|
||||
@PostMapping("deleteById")
|
||||
public HttpResult<Boolean> deleteById( @RequestParam String id){
|
||||
String methodDescribe = getMethodDescribe("deleteById");
|
||||
boolean result = cvtHarmonicCorrectionFactorsService.removeById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtHarmonicCorrectionFactorsParam;
|
||||
import com.njcn.device.pq.pojo.param.CvtLineRelationParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
import com.njcn.device.pq.service.CvtHarmonicCorrectionFactorsService;
|
||||
import com.njcn.device.pq.service.CvtLineRelationService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:29【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Api(tags = "cvt系数绑定")
|
||||
@RestController
|
||||
@RequestMapping("/cvtBind")
|
||||
@RequiredArgsConstructor
|
||||
public class CvtLineRelationController extends BaseController {
|
||||
private final CvtLineRelationService cvtLineRelationService;
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("新增cvt系数绑定")
|
||||
@ApiImplicitParam(value = "cvt系数绑定信息",name = "cvtLineRelationParam",required = true)
|
||||
@PostMapping("add")
|
||||
public HttpResult<Boolean> add(@Validated @RequestBody CvtLineRelationParam cvtLineRelationParam){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
boolean result = cvtLineRelationService.add(cvtLineRelationParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("根据监测点id查询绑定cvt系数")
|
||||
@PostMapping("queryByLineId")
|
||||
public HttpResult<CvtHarmonicCorrectionFactorsDTO> queryByLineId(@RequestParam String lineId){
|
||||
String methodDescribe = getMethodDescribe("queryByLineId");
|
||||
CvtHarmonicCorrectionFactorsDTO result = cvtLineRelationService.queryByLineId(lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,14 @@ public class NodeDeviceController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("一键分配装置所属进程号")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("oneKeyDistribution")
|
||||
public HttpResult<Boolean> oneKeyDistribution(@RequestParam("nodeId") String nodeId){
|
||||
String methodDescribe = getMethodDescribe("oneKeyDistribution");
|
||||
nodeDeviceService.oneKeyDistribution(nodeId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,11 +17,14 @@ import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineWiringDiagramVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalBaseVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalVO;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.message.constant.DeviceRebootType;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
@@ -56,7 +59,7 @@ public class TerminalBaseController extends BaseController {
|
||||
|
||||
private final TerminalBaseService terminalBaseService;
|
||||
private final GeneralDeviceService generalDeviceService;
|
||||
|
||||
private final LineService lineService;
|
||||
|
||||
/**
|
||||
* 终端新增操作
|
||||
@@ -117,6 +120,15 @@ public class TerminalBaseController extends BaseController {
|
||||
}
|
||||
}
|
||||
terminalBaseService.addTerminal(addTerminalParam);
|
||||
//新增终端后发送消息给前置重启设备
|
||||
if (Objects.nonNull(addTerminalParam.getDeviceParam())) {
|
||||
addTerminalParam.getDeviceParam().forEach(temp->{
|
||||
Line line = terminalBaseService.queryTerminalByName(temp.getName());
|
||||
terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -145,7 +157,14 @@ public class TerminalBaseController extends BaseController {
|
||||
@GetMapping("/terminalSyncDeleteFly")
|
||||
public HttpResult<Boolean> terminalSyncDeleteFly(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("terminalSyncDeleteFly");
|
||||
//获取设备id
|
||||
LineDetailDataVO lineDetailData = lineService.getLineDetailData(lineId);
|
||||
String devId =lineDetailData.getDevId();
|
||||
|
||||
Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId);
|
||||
//删除监测点即修改终端通知前置重启
|
||||
terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -192,6 +211,8 @@ public class TerminalBaseController extends BaseController {
|
||||
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("delTerminal");
|
||||
terminalBaseService.delTerminal(id);
|
||||
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -412,4 +433,31 @@ public class TerminalBaseController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("请求前置重启进程")
|
||||
@PostMapping(value = "askRestartProcess")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "processNo", value = "进程号", required = true),
|
||||
@ApiImplicitParam(name = "deviceRebootType", value = "重启类型", required = true)
|
||||
})
|
||||
public HttpResult<Object> askRestartProcess(@RequestParam("processNo")Integer processNo,@RequestParam("processType")String processType,@RequestParam("deviceRebootType")String deviceRebootType) {
|
||||
String methodDescribe = getMethodDescribe("askRestartProcess");
|
||||
terminalBaseService.askRestartProcess(processNo,processType,deviceRebootType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("请求前置设备进程")
|
||||
@PostMapping(value = "askRestartDevice")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "devId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "deviceRebootType", value = "重启类型", required = true)
|
||||
})
|
||||
public HttpResult<Object> askRestartDevice(@RequestParam("devId")String devId,@RequestParam("deviceRebootType")String deviceRebootType) {
|
||||
String methodDescribe = getMethodDescribe("askRestartDevice");
|
||||
terminalBaseService.askRestartDevice(devId,deviceRebootType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CvtHarmonicCorrectionFactorsMapper extends BaseMapper<CvtHarmonicCorrectionFactors> {
|
||||
Page<CvtHarmonicCorrectionFactorsVO> queryPage(Page<Object> objectPage,@Param("ew") QueryWrapper<CvtHarmonicCorrectionFactorsVO> queryWrapper);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.CvtLineRelation;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CvtLineRelationMapper extends BaseMapper<CvtLineRelation> {
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
@@ -85,4 +86,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
||||
List<DevDetail> selectDevByIds(@Param("ids") List<String> ids);
|
||||
|
||||
void updateDeviceRunFlag(@Param("id")String deviceId, @Param("runFlag")Integer status);
|
||||
|
||||
List<PollutionLineInfoDTO> getPollutionDeviceInfo(@Param("id")List<String> devId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunTimeVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface DeviceProcessMapper extends BaseMapper<DeviceProcess> {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.CvtHarmonicCorrectionFactorsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table cvt_harmonic_correction_factors-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="cvt_name" jdbcType="VARCHAR" property="cvtName" />
|
||||
<result column="cvt_model" jdbcType="VARCHAR" property="cvtModel" />
|
||||
<result column="h2" jdbcType="DECIMAL" property="h2" />
|
||||
<result column="h3" jdbcType="DECIMAL" property="h3" />
|
||||
<result column="h4" jdbcType="DECIMAL" property="h4" />
|
||||
<result column="h5" jdbcType="DECIMAL" property="h5" />
|
||||
<result column="h6" jdbcType="DECIMAL" property="h6" />
|
||||
<result column="h7" jdbcType="DECIMAL" property="h7" />
|
||||
<result column="h8" jdbcType="DECIMAL" property="h8" />
|
||||
<result column="h9" jdbcType="DECIMAL" property="h9" />
|
||||
<result column="h10" jdbcType="DECIMAL" property="h10" />
|
||||
<result column="h11" jdbcType="DECIMAL" property="h11" />
|
||||
<result column="h12" jdbcType="DECIMAL" property="h12" />
|
||||
<result column="h13" jdbcType="DECIMAL" property="h13" />
|
||||
<result column="h14" jdbcType="DECIMAL" property="h14" />
|
||||
<result column="h15" jdbcType="DECIMAL" property="h15" />
|
||||
<result column="h16" jdbcType="DECIMAL" property="h16" />
|
||||
<result column="h17" jdbcType="DECIMAL" property="h17" />
|
||||
<result column="h18" jdbcType="DECIMAL" property="h18" />
|
||||
<result column="h19" jdbcType="DECIMAL" property="h19" />
|
||||
<result column="h20" jdbcType="DECIMAL" property="h20" />
|
||||
<result column="h21" jdbcType="DECIMAL" property="h21" />
|
||||
<result column="h22" jdbcType="DECIMAL" property="h22" />
|
||||
<result column="h23" jdbcType="DECIMAL" property="h23" />
|
||||
<result column="h24" jdbcType="DECIMAL" property="h24" />
|
||||
<result column="h25" jdbcType="DECIMAL" property="h25" />
|
||||
<result column="h26" jdbcType="DECIMAL" property="h26" />
|
||||
<result column="h27" jdbcType="DECIMAL" property="h27" />
|
||||
<result column="h28" jdbcType="DECIMAL" property="h28" />
|
||||
<result column="h29" jdbcType="DECIMAL" property="h29" />
|
||||
<result column="h30" jdbcType="DECIMAL" property="h30" />
|
||||
<result column="h31" jdbcType="DECIMAL" property="h31" />
|
||||
<result column="h32" jdbcType="DECIMAL" property="h32" />
|
||||
<result column="h33" jdbcType="DECIMAL" property="h33" />
|
||||
<result column="h34" jdbcType="DECIMAL" property="h34" />
|
||||
<result column="h35" jdbcType="DECIMAL" property="h35" />
|
||||
<result column="h36" jdbcType="DECIMAL" property="h36" />
|
||||
<result column="h37" jdbcType="DECIMAL" property="h37" />
|
||||
<result column="h38" jdbcType="DECIMAL" property="h38" />
|
||||
<result column="h39" jdbcType="DECIMAL" property="h39" />
|
||||
<result column="h40" jdbcType="DECIMAL" property="h40" />
|
||||
<result column="h41" jdbcType="DECIMAL" property="h41" />
|
||||
<result column="h42" jdbcType="DECIMAL" property="h42" />
|
||||
<result column="h43" jdbcType="DECIMAL" property="h43" />
|
||||
<result column="h44" jdbcType="DECIMAL" property="h44" />
|
||||
<result column="h45" jdbcType="DECIMAL" property="h45" />
|
||||
<result column="h46" jdbcType="DECIMAL" property="h46" />
|
||||
<result column="h47" jdbcType="DECIMAL" property="h47" />
|
||||
<result column="h48" jdbcType="DECIMAL" property="h48" />
|
||||
<result column="h49" jdbcType="DECIMAL" property="h49" />
|
||||
<result column="h50" jdbcType="DECIMAL" property="h50" />
|
||||
<result column="Create_By" jdbcType="CHAR" property="createBy" />
|
||||
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
|
||||
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, cvt_name, cvt_model, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11, h12, h13, h14,
|
||||
h15, h16, h17, h18, h19, h20, h21, h22, h23, h24, h25, h26, h27, h28, h29, h30, h31,
|
||||
h32, h33, h34, h35, h36, h37, h38, h39, h40, h41, h42, h43, h44, h45, h46, h47, h48,
|
||||
h49, h50, Create_By, Create_Time, Update_By, Update_Time
|
||||
</sql>
|
||||
|
||||
<select id="queryPage" resultType="com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO">
|
||||
SELECT cvt_harmonic_correction_factors.*
|
||||
FROM cvt_harmonic_correction_factors cvt_harmonic_correction_factors
|
||||
WHERE ${ew.sqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.CvtLineRelationMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.device.pq.pojo.po.CvtLineRelation">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table cvt_line_relation-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="line_id" jdbcType="VARCHAR" property="lineId" />
|
||||
<result column="cvt_id" jdbcType="VARCHAR" property="cvtId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, line_id, cvt_id
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -340,4 +340,45 @@
|
||||
bdName,
|
||||
devName
|
||||
</select>
|
||||
|
||||
<select id="getPollutionDeviceInfo" resultType="com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO">
|
||||
SELECT
|
||||
line.id lineId,
|
||||
gdinfo.NAME AS gdName,
|
||||
substation.NAME AS subStationName,
|
||||
device.NAME AS devName,
|
||||
deviceDetail.Com_Flag AS comFlag,
|
||||
lineDetail.power_Flag AS powerFlag,
|
||||
lineDetail.business_type AS businessType,
|
||||
lineDetail.load_type AS loadtype,
|
||||
lineDetail.obj_name AS objName,
|
||||
lineDetail.power_substation_name AS powerSubstationName,
|
||||
deviceDetail.manufacturer AS manufacturer,
|
||||
deviceDetail.dev_Type AS devType,
|
||||
deviceDetail.login_Time AS loginTime,
|
||||
deviceDetail.id deviceId,
|
||||
pv.scale lineVoltage,
|
||||
lineDetail.monitor_id monitorId
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail lineDetail,
|
||||
pq_line subv,
|
||||
pq_line device,
|
||||
pq_device deviceDetail,
|
||||
pq_line substation,
|
||||
pq_line gdinfo,
|
||||
pq_voltage pv
|
||||
WHERE line.id in
|
||||
<foreach collection="id" close=")" item="item" open="(" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND line.id = lineDetail.id
|
||||
AND line.pid = subv.id
|
||||
AND subv.pid = device.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gdinfo.id
|
||||
AND subv.id = pv.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DeviceProcessMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1799,9 +1799,9 @@
|
||||
<select id="getLineByDeviceId" resultType="com.njcn.device.pq.pojo.dto.MonitorInfo">
|
||||
SELECT
|
||||
pq_line_detail.id id,
|
||||
line.`Name` name,
|
||||
line.Name name,
|
||||
pq_line_detail.Num lineNo,
|
||||
s1.`Name` voltageLevel,
|
||||
s1.Name voltageLevel,
|
||||
pq_line_detail.PT_Phase_Type ptType,
|
||||
pq_line_detail.Run_Flag status
|
||||
FROM
|
||||
|
||||
@@ -7,24 +7,29 @@
|
||||
SELECT
|
||||
pq_device.Id id,
|
||||
pq_device.IP ip,
|
||||
s1.`Name` devType,
|
||||
pq_device.`Port` port,
|
||||
pq_line.`Name` name,
|
||||
s1.Name devType,
|
||||
pq_device.Port port,
|
||||
pq_line.Name name,
|
||||
pq_device.Update_Time updateTime,
|
||||
s2.`Name` manufacturer,
|
||||
s2.Name manufacturer,
|
||||
pq_device.Com_Flag status,
|
||||
pq_device.Series series,
|
||||
pq_device_process.process_no processNo,
|
||||
pq_device.Dev_Key devKey
|
||||
FROM
|
||||
pq_node
|
||||
LEFT JOIN pq_device ON pq_node.Id = pq_device.Node_Id
|
||||
LEFT JOIN pq_line on pq_device.id = pq_line.id
|
||||
LEFT JOIN pq_device_process on pq_device_process.id = pq_device.id
|
||||
LEFT JOIN sys_dict_data s1 ON pq_device.Dev_Type = s1.id
|
||||
LEFT JOIN sys_dict_data s2 ON pq_device.Manufacturer = s2.id
|
||||
<where>
|
||||
<if test="nodeDeviceParam.ip!=null and nodeDeviceParam.ip != ''">
|
||||
pq_node.ip=#{nodeDeviceParam.ip}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.devId!=null and nodeDeviceParam.devId != ''">
|
||||
pq_device.id=#{nodeDeviceParam.devId}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.runFlag!=null and nodeDeviceParam.runFlag.size()!=0">
|
||||
AND pq_device.Run_Flag in
|
||||
<foreach collection="nodeDeviceParam.runFlag" open="(" close=")" item="item" separator=",">
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
ID, `Name`, `Path`, Update_Time
|
||||
ID, Name, Pat`, Update_Time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -158,8 +158,10 @@
|
||||
gd.name electricPowerCompany,
|
||||
b.IP DeviceIP,
|
||||
b.id deviceId,
|
||||
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
ifnull(convert(m.Actual_Value/1024/1024,decimal(7,2)),0) statisValue
|
||||
-- ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
-- ifnull(convert(m.Actual_Value/1024/1024,decimal(7,2)),0) statisValue
|
||||
COALESCE(d.flow, (SELECT flow FROM cld_flow_meal WHERE type = 0 AND flag = 1)) + COALESCE(d1.flow, 0) AS flowMeal,
|
||||
COALESCE(CAST(m.Actual_Value / 1024 / 1024 AS DECIMAL(7, 2)), 0) AS statisValue
|
||||
FROM pq_line a
|
||||
INNER JOIN pq_line sub ON sub.id = a.pid
|
||||
INNER JOIN pq_line gd ON gd.id = sub.pid
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtHarmonicCorrectionFactorsParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CvtHarmonicCorrectionFactorsService extends IService<CvtHarmonicCorrectionFactors>{
|
||||
|
||||
|
||||
boolean add(CvtHarmonicCorrectionFactorsParam cvtHarmonicCorrectionFactorsParam);
|
||||
|
||||
boolean updateCvt(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamUpdateParam updateParam);
|
||||
|
||||
Page<CvtHarmonicCorrectionFactorsVO> queryPage(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam);
|
||||
|
||||
List<CvtHarmonicCorrectionFactorsDTO> queryList(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtLineRelationParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtLineRelation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CvtLineRelationService extends IService<CvtLineRelation>{
|
||||
|
||||
|
||||
boolean add(CvtLineRelationParam cvtLineRelationParam);
|
||||
|
||||
CvtHarmonicCorrectionFactorsDTO queryByLineId(String lineId);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user