Compare commits
158 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d738116968 | ||
|
|
e322eb2413 | ||
|
|
0200607c0c | ||
|
|
a6c536cf45 | ||
|
|
e61269e489 | ||
|
|
01e95e71fb | ||
|
|
b4f4037987 | ||
| a5be610a6a | |||
| f8e88b87d0 | |||
|
|
6ee4da4422 | ||
|
|
20e1b8cce7 | ||
|
|
b3b5e64e07 | ||
| 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 | |||
|
|
c6475a862c | ||
| 3bf3c65575 | |||
| 7cfbb8fb53 | |||
|
|
dce85a5f4c | ||
| 9be058b9e9 | |||
| 6a3b848dc0 | |||
|
|
396fe59b94 | ||
| e7b4117167 | |||
| 8f57310625 | |||
|
|
401195fc7b | ||
| 1d5ceca9dc | |||
| f1ad74ea2d | |||
| 0b5a3f0a32 | |||
| 3377da4ae3 | |||
|
|
b3015c2dcb | ||
| 35f1b21474 | |||
| 92ffdb1931 | |||
|
|
5b4b756fc3 | ||
|
|
c6f767b3aa | ||
|
|
ca32a4e3c6 | ||
|
|
92ddbd34a8 | ||
| 2c9d17c0ff | |||
| d681bdedfe | |||
| a904650751 | |||
|
|
04ce3eb97d | ||
| 8fc1645b04 | |||
| 2e37cf5b21 | |||
| 42c1faa5dc | |||
| 2f84ace8f1 | |||
| 5cc21b6289 | |||
| a6acf6d1c9 | |||
| ff205cb335 | |||
| b675369f7d | |||
| 9b92c1df03 | |||
| 64d2fd46e2 | |||
| 3484902147 | |||
| 739b697137 | |||
|
|
c85df36f32 | ||
|
|
a87ac5a246 | ||
|
|
91b3f63b99 | ||
| 6cd45fd7f9 | |||
| a608b3850c | |||
| 7b6099e2dc | |||
| d642ed8e52 | |||
| 568f14da96 | |||
|
|
2c8c94746e | ||
|
|
0837e38c83 | ||
|
|
c343e5765c |
6
pom.xml
6
pom.xml
@@ -22,7 +22,7 @@
|
|||||||
<module>pqs-process</module>
|
<module>pqs-process</module>
|
||||||
<module>pqs-bpm</module>
|
<module>pqs-bpm</module>
|
||||||
<module>pqs-supervision</module>
|
<module>pqs-supervision</module>
|
||||||
|
<module>pqs-algorithm</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>灿能微服务生态系统</name>
|
<name>灿能微服务生态系统</name>
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
<nacos.password>nacos</nacos.password>
|
<nacos.password>nacos</nacos.password>
|
||||||
<!--服务器发布内容为空-->
|
<!--服务器发布内容为空-->
|
||||||
<!-- <nacos.namespace></nacos.namespace>-->
|
<!-- <nacos.namespace></nacos.namespace>-->
|
||||||
<nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>
|
<!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>-->
|
||||||
<!-- <nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>-->
|
<nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>
|
||||||
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
||||||
<!-- sentinel:port-->
|
<!-- sentinel:port-->
|
||||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ public enum AdvanceResponseEnum {
|
|||||||
MACHINE_HAS_UNIT("A0102","当前设备存在元器件"),
|
MACHINE_HAS_UNIT("A0102","当前设备存在元器件"),
|
||||||
|
|
||||||
EVENT_TIME_ERROR("A0102","暂降事件时间格式有误,请检查"),
|
EVENT_TIME_ERROR("A0102","暂降事件时间格式有误,请检查"),
|
||||||
|
|
||||||
|
INVALID_FILE_TYPE("A0102","请选择CSV文件"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.njcn.advance.pojo.carrycapacity.excel;
|
package com.njcn.advance.pojo.carrycapacity.excel;
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.alibaba.excel.converters.localdatetime.LocalDateTimeStringConverter;
|
import com.alibaba.excel.converters.localdatetime.LocalDateTimeStringConverter;
|
||||||
import com.njcn.advance.utils.EasyExcelUtil;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,7 +20,8 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class CarryCapcityDataEexcel {
|
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;
|
private LocalDateTime time;
|
||||||
|
|
||||||
@ExcelProperty(index =1,value = {"电压","A"})
|
@ExcelProperty(index =1,value = {"电压","A"})
|
||||||
@@ -266,17 +269,20 @@ public class CarryCapcityDataEexcel {
|
|||||||
private Double i25_c;
|
private Double i25_c;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
List<CarryCapcityDataEexcel> objects = EasyExcelUtil.syncReadModel("C:\\Users\\无名\\Desktop\\11.xlsx", CarryCapcityDataEexcel.class, 0,3);
|
// List<CarryCapcityDataEexcel> objects = EasyExcelUtil.syncReadModel("C:\\Users\\无名\\Desktop\\11.xlsx", CarryCapcityDataEexcel.class, 0,3);
|
||||||
System.out.println(objects);
|
// System.out.println(objects);
|
||||||
|
|
||||||
// String sheetName = "sheetName";
|
String sheetName = "sheetName";
|
||||||
// List<CarryCapcityDataEexcel> excels = new ArrayList<>();
|
List<CarryCapcityDataEexcel> excels = new ArrayList<>();
|
||||||
// CarryCapcityDataEexcel exportHeadersExcel = new CarryCapcityDataEexcel();
|
CarryCapcityDataEexcel exportHeadersExcel = new CarryCapcityDataEexcel();
|
||||||
// excels.add(exportHeadersExcel);
|
excels.add(exportHeadersExcel);
|
||||||
//
|
|
||||||
// EasyExcel.write("C:\\\\Users\\\\无名\\\\Desktop\\\\22.xlsx", CarryCapcityDataEexcel.class)
|
EasyExcel.write("C:\\\\Users\\\\无名\\\\Desktop\\\\22.xlsx", CarryCapcityDataEexcel.class)
|
||||||
// .sheet(sheetName)
|
.sheet(sheetName)
|
||||||
// .doWrite(excels);
|
.doWrite(excels);
|
||||||
|
EasyExcel.write("C:\\\\Users\\\\无名\\\\Desktop\\\\22.xlsx", CarryCapcityDataEexcel.class)
|
||||||
|
.sheet("sheetName2")
|
||||||
|
.doWrite(excels);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ public class CarryCapcityDataIEexcel {
|
|||||||
DataI dataI = new DataI();
|
DataI dataI = new DataI();
|
||||||
BeanUtils.copyProperties(carryCapcityDataIEexcel,dataI);
|
BeanUtils.copyProperties(carryCapcityDataIEexcel,dataI);
|
||||||
dataI.setPhaseType(phase);
|
dataI.setPhaseType(phase);
|
||||||
dataI.setTime(carryCapcityDataIEexcel.getTime().plusSeconds(8*60*60));
|
dataI.setTime(carryCapcityDataIEexcel.getTime());
|
||||||
|
|
||||||
if (phase.equals("A")) {
|
if (phase.equals("A")) {
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class CarryCapcityDataPEexcel {
|
|||||||
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
||||||
BeanUtils.copyProperties(carryCapcityDataPEexcel,carryCapcityData);
|
BeanUtils.copyProperties(carryCapcityDataPEexcel,carryCapcityData);
|
||||||
carryCapcityData.setPhaseType(phase);
|
carryCapcityData.setPhaseType(phase);
|
||||||
carryCapcityData.setTime(carryCapcityDataPEexcel.getTime().plusSeconds(8*60*60));
|
carryCapcityData.setTime(carryCapcityDataPEexcel.getTime());
|
||||||
|
|
||||||
if (phase.equals("A")) {
|
if (phase.equals("A")) {
|
||||||
carryCapcityData.setValue(carryCapcityDataPEexcel.getValue_a());
|
carryCapcityData.setValue(carryCapcityDataPEexcel.getValue_a());
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class CarryCapcityDataQEexcel {
|
|||||||
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
||||||
BeanUtils.copyProperties(carryCapcityDataQEexcel,carryCapcityData);
|
BeanUtils.copyProperties(carryCapcityDataQEexcel,carryCapcityData);
|
||||||
carryCapcityData.setPhaseType(phase);
|
carryCapcityData.setPhaseType(phase);
|
||||||
carryCapcityData.setTime(carryCapcityDataQEexcel.getTime().plusSeconds(8*60*60));
|
carryCapcityData.setTime(carryCapcityDataQEexcel.getTime());
|
||||||
|
|
||||||
if (phase.equals("A")) {
|
if (phase.equals("A")) {
|
||||||
carryCapcityData.setValue(carryCapcityDataQEexcel.getValue_a());
|
carryCapcityData.setValue(carryCapcityDataQEexcel.getValue_a());
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class CarryCapcityDataVEexcel {
|
|||||||
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
CarryCapcityData carryCapcityData = new CarryCapcityData();
|
||||||
BeanUtils.copyProperties(carryCapcityDataVEexcel,carryCapcityData);
|
BeanUtils.copyProperties(carryCapcityDataVEexcel,carryCapcityData);
|
||||||
carryCapcityData.setPhaseType(phase);
|
carryCapcityData.setPhaseType(phase);
|
||||||
carryCapcityData.setTime(carryCapcityDataVEexcel.getTime().plusSeconds(8*60*60));
|
carryCapcityData.setTime(carryCapcityDataVEexcel.getTime());
|
||||||
|
|
||||||
if (phase.equals("A")) {
|
if (phase.equals("A")) {
|
||||||
carryCapcityData.setValue(carryCapcityDataVEexcel.getValue_a());
|
carryCapcityData.setValue(carryCapcityDataVEexcel.getValue_a());
|
||||||
|
|||||||
@@ -1,36 +1,17 @@
|
|||||||
package com.njcn.advance.pojo.dto.relevent;
|
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> {
|
public class EntityGroupEvtData implements Cloneable,Comparable<EntityGroupEvtData> {
|
||||||
|
private int node;//逻辑节点序号
|
||||||
//逻辑节点序号
|
private int start_time;//事件开始时间时标
|
||||||
private int node;
|
private int cata;//类别
|
||||||
//事件开始时间时标
|
private int cata2;//标注类别
|
||||||
private int start_time;
|
private String nodePhysics; //物理节点
|
||||||
//类别
|
|
||||||
private int cata;
|
|
||||||
//标注类别
|
|
||||||
private int cata2;
|
|
||||||
//物理节点
|
|
||||||
private String nodePhysics;
|
|
||||||
|
|
||||||
private SagEvent sagEvent;
|
private SagEvent sagEvent;
|
||||||
|
|
||||||
private String sagReason;
|
private String sagReason;
|
||||||
|
|
||||||
|
public EntityGroupEvtData(String nodePhysics, int start_time, int cata, int cata2,SagEvent sagEvent,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.nodePhysics = nodePhysics;
|
||||||
this.start_time = start_time;
|
this.start_time = start_time;
|
||||||
this.cata = cata;
|
this.cata = cata;
|
||||||
@@ -39,6 +20,144 @@ public class EntityGroupEvtData implements Cloneable,Comparable<EntityGroupEvtDa
|
|||||||
this.sagReason = sagReason;
|
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
|
@Override
|
||||||
public int compareTo(EntityGroupEvtData obj) {
|
public int compareTo(EntityGroupEvtData obj) {
|
||||||
@@ -50,4 +169,4 @@ public class EntityGroupEvtData implements Cloneable,Comparable<EntityGroupEvtDa
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,9 +8,9 @@ public class EntityLogic {
|
|||||||
//物理隔绝变压器策略GUID
|
//物理隔绝变压器策略GUID
|
||||||
private String tPIndex;
|
private String tPIndex;
|
||||||
//变压器逻辑上节点
|
//变压器逻辑上节点
|
||||||
private String node_h;
|
private Integer node_h;
|
||||||
//变压器逻辑下节点
|
//变压器逻辑下节点
|
||||||
private String node_l;
|
private Integer node_l;
|
||||||
// 变压器连接方式
|
// 变压器连接方式
|
||||||
private Integer type;
|
private Integer type;
|
||||||
//变压器物理上节点
|
//变压器物理上节点
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ public class EntityMtrans implements Serializable {
|
|||||||
public EntityMtrans() {
|
public EntityMtrans() {
|
||||||
super();
|
super();
|
||||||
Mtrans = new int[FinalData.NODE_NUM][FinalData.NODE_NUM];
|
Mtrans = new int[FinalData.NODE_NUM][FinalData.NODE_NUM];
|
||||||
Matrixcata0 = new int[FinalData.EVT_TYPE_NUM][FinalData.NODE_NUM];
|
Matrixcata0 = new int[FinalData.EVT_TYPE_NUM][FinalData.NODE_NUM];
|
||||||
Matrixcata1 = new int[FinalData.EVT_TYPE_NUM][FinalData.NODE_NUM];
|
Matrixcata1 = new int[FinalData.EVT_TYPE_NUM][FinalData.NODE_NUM];
|
||||||
possiable_path = new int[FinalData.MAX_PATH_NUM][FinalData.NODE_NUM + 1];
|
possiable_path = new int[FinalData.MAX_PATH_NUM][FinalData.NODE_NUM + 1];
|
||||||
path_num = 0;
|
path_num = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[][] getMatrixcata0() {
|
public int[][] getMatrixcata0() {
|
||||||
@@ -69,3 +69,4 @@ public class EntityMtrans implements Serializable {
|
|||||||
+ Arrays.toString(possiable_path) + ", path_num=" + path_num + "]";
|
+ Arrays.toString(possiable_path) + ", path_num=" + path_num + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.njcn.advance.pojo.dto.relevent;
|
package com.njcn.advance.pojo.dto.relevent;
|
||||||
|
|
||||||
import com.njcn.advance.pojo.dto.SagEvent;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
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;
|
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");
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -376,4 +376,9 @@ public class EasyExcelUtil {
|
|||||||
|
|
||||||
return new EasyExcelWriteTool(response.getOutputStream());
|
return new EasyExcelWriteTool(response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
List<Map<Integer, String>> maps = EasyExcelUtil.syncRead("C:\\Users\\无名\\Desktop\\11.xlsx");
|
||||||
|
System.out.println(maps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.advance.service.EventRelevantAnalysisService;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
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.common.LogEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
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.common.utils.PubUtils;
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
||||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pqs
|
* pqs
|
||||||
@@ -33,11 +37,11 @@ import java.util.Map;
|
|||||||
* @author cdf
|
* @author cdf
|
||||||
* @date 2023/6/30
|
* @date 2023/6/30
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("process")
|
@RequestMapping("process")
|
||||||
@Api(tags = "暂降事件关联分析")
|
@Api(tags = "暂降事件关联分析")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
|
||||||
public class EventRelevantAnalysisController extends BaseController {
|
public class EventRelevantAnalysisController extends BaseController {
|
||||||
|
|
||||||
private final EventRelevantAnalysisService eventRelevantAnalysisService;
|
private final EventRelevantAnalysisService eventRelevantAnalysisService;
|
||||||
@@ -78,6 +82,11 @@ public class EventRelevantAnalysisController extends BaseController {
|
|||||||
@ApiOperation("事件波形分析主列表")
|
@ApiOperation("事件波形分析主列表")
|
||||||
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
|
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
|
||||||
String methodDescribe = getMethodDescribe("queryEventsAssPage");
|
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);
|
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
@@ -188,4 +197,12 @@ public class EventRelevantAnalysisController extends BaseController {
|
|||||||
boolean flag = eventRelevantAnalysisService.delRelevantLog(id);
|
boolean flag = eventRelevantAnalysisService.delRelevantLog(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,15 +56,7 @@ public class CarryCapacityController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapacityDataVO, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapacityDataVO, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
|
||||||
@PostMapping("/modelTraining")
|
|
||||||
@ApiOperation("承载能力评估模型训练")
|
|
||||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
|
||||||
public HttpResult<CarryCapacityDataVO> modelTraining(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
|
||||||
String methodDescribe = getMethodDescribe("modelTraining");
|
|
||||||
CarryCapacityDataVO carryCapacityDataVO = carryCapcityService.modelTraining(queryParam);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapacityDataVO, methodDescribe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryCarryCapacityQData")
|
@PostMapping("/queryCarryCapacityQData")
|
||||||
@@ -72,7 +64,7 @@ public class CarryCapacityController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||||
public HttpResult<CarryCapacityDataQVO> queryCarryCapacityQData(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
public HttpResult<CarryCapacityDataQVO> queryCarryCapacityQData(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
||||||
String methodDescribe = getMethodDescribe("queryCarryCapacityQData");
|
String methodDescribe = getMethodDescribe("queryCarryCapacityQData");
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityQData(queryParam), methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityqData(queryParam), methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@@ -81,7 +73,7 @@ public class CarryCapacityController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||||
public HttpResult<CarryCapacityDataIVO> queryCarryCapacityIData(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
public HttpResult<CarryCapacityDataIVO> queryCarryCapacityIData(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
||||||
String methodDescribe = getMethodDescribe("queryCarryCapacityIData");
|
String methodDescribe = getMethodDescribe("queryCarryCapacityIData");
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityIData(queryParam), methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityiData(queryParam), methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -106,6 +106,13 @@ public class SgEventController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
public HttpResult<String> importEventData(@RequestParam("file") MultipartFile file, @RequestParam("incomingLineId") String incomingLineId, @RequestParam("productLineId") String productLineId, HttpServletResponse response) {
|
public HttpResult<String> importEventData(@RequestParam("file") MultipartFile file, @RequestParam("incomingLineId") String incomingLineId, @RequestParam("productLineId") String productLineId, HttpServletResponse response) {
|
||||||
String methodDescribe = getMethodDescribe("importEventData");
|
String methodDescribe = getMethodDescribe("importEventData");
|
||||||
|
|
||||||
|
// 检查文件MIME类型是否为csv
|
||||||
|
String contentType = file.getContentType();
|
||||||
|
if (!"text/csv".equals(contentType)) {
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.INVALID_FILE_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
ImportParams params = new ImportParams();
|
ImportParams params = new ImportParams();
|
||||||
params.setHeadRows(1);
|
params.setHeadRows(1);
|
||||||
params.setNeedVerify(true);
|
params.setNeedVerify(true);
|
||||||
|
|||||||
@@ -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;
|
package com.njcn.advance.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.advance.pojo.dto.SagEvent;
|
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.njcn.advance.mapper;
|
package com.njcn.advance.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
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.advance.pojo.dto.relevent.EventAssObj;
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
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>
|
||||||
@@ -21,9 +21,9 @@ public interface CarryCapacityService {
|
|||||||
|
|
||||||
CarryCapacityDataVO queryCarryCapacityData(CarryCapacityQueryDataParam queryParam);
|
CarryCapacityDataVO queryCarryCapacityData(CarryCapacityQueryDataParam queryParam);
|
||||||
|
|
||||||
CarryCapacityDataQVO queryCarryCapacityQData(CarryCapacityQueryDataParam queryParam);
|
CarryCapacityDataQVO queryCarryCapacityqData(CarryCapacityQueryDataParam queryParam);
|
||||||
|
|
||||||
CarryCapacityDataIVO queryCarryCapacityIData(CarryCapacityQueryDataParam queryParam);
|
CarryCapacityDataIVO queryCarryCapacityiData(CarryCapacityQueryDataParam queryParam);
|
||||||
|
|
||||||
CarryCapacityDResultVO carryCapacityCal(CarryCapacityCalParam calParam);
|
CarryCapacityDResultVO carryCapacityCal(CarryCapacityCalParam calParam);
|
||||||
|
|
||||||
@@ -31,7 +31,6 @@ public interface CarryCapacityService {
|
|||||||
|
|
||||||
boolean uploadExcel(ExcelDataParam excelDataParam) throws Exception;
|
boolean uploadExcel(ExcelDataParam excelDataParam) throws Exception;
|
||||||
|
|
||||||
CarryCapacityDataVO modelTraining(CarryCapacityQueryDataParam queryParam);
|
|
||||||
|
|
||||||
CarryCapacityDResultVO carryCapacityEvaluate(CarryCapacityEvaluateParam calParam);
|
CarryCapacityDResultVO carryCapacityEvaluate(CarryCapacityEvaluateParam calParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package com.njcn.advance.service.carrycapacity.impl;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.advance.mapper.carrycapacity.CarryCapacityDevicePOMapper;
|
import com.njcn.advance.mapper.carrycapacity.CarryCapacityDevicePOMapper;
|
||||||
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityDeviceParam;
|
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityDeviceParam;
|
||||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityDevicePO;
|
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityDevicePO;
|
||||||
import com.njcn.advance.service.carrycapacity.CarryCapacityDevicePOService;
|
import com.njcn.advance.service.carrycapacity.CarryCapacityDevicePOService;
|
||||||
|
import com.njcn.advance.utils.CheckStringUtil;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -23,8 +27,13 @@ public class CarryCapacityDevicePOServiceImpl extends ServiceImpl<CarryCapacityD
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateDevice(CarryCapacityDeviceParam.CarryCapacityDeviceUpdateParam deviceParam) {
|
public Boolean updateDevice(CarryCapacityDeviceParam.CarryCapacityDeviceUpdateParam deviceParam) {
|
||||||
|
if(StringUtils.isBlank(deviceParam.getDevName())){
|
||||||
|
throw new BusinessException("干扰源设备名称不能为空");
|
||||||
|
}
|
||||||
|
checkName(deviceParam,true);
|
||||||
return this.lambdaUpdate().eq(CarryCapacityDevicePO::getDevId, deviceParam.getDevId())
|
return this.lambdaUpdate().eq(CarryCapacityDevicePO::getDevId, deviceParam.getDevId())
|
||||||
.set(CarryCapacityDevicePO::getDevName, deviceParam.getDevName())
|
.set(CarryCapacityDevicePO::getDevName, deviceParam.getDevName())
|
||||||
|
.set(CarryCapacityDevicePO::getDevScale, deviceParam.getDevScale())
|
||||||
.set(CarryCapacityDevicePO::getProtocolCapacity, deviceParam.getProtocolCapacity())
|
.set(CarryCapacityDevicePO::getProtocolCapacity, deviceParam.getProtocolCapacity())
|
||||||
.update();
|
.update();
|
||||||
}
|
}
|
||||||
@@ -32,8 +41,44 @@ public class CarryCapacityDevicePOServiceImpl extends ServiceImpl<CarryCapacityD
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean add(CarryCapacityDeviceParam capacityDeviceParam) {
|
public Boolean add(CarryCapacityDeviceParam capacityDeviceParam) {
|
||||||
CarryCapacityDevicePO carryCapacityDevicePO = new CarryCapacityDevicePO();
|
if(StringUtils.isBlank(capacityDeviceParam.getDevName())){
|
||||||
BeanUtils.copyProperties(capacityDeviceParam,carryCapacityDevicePO);
|
throw new BusinessException("干扰源设备名称不能为空");
|
||||||
return this.save(carryCapacityDevicePO);
|
}
|
||||||
|
checkName(capacityDeviceParam,false);
|
||||||
|
|
||||||
|
CarryCapacityDevicePO carryCapacityDevice = new CarryCapacityDevicePO();
|
||||||
|
BeanUtils.copyProperties(capacityDeviceParam,carryCapacityDevice);
|
||||||
|
return this.save(carryCapacityDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查名称是否已存在
|
||||||
|
*
|
||||||
|
* @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());
|
||||||
|
|
||||||
|
//and id <> ?
|
||||||
|
if (isUpdate) {
|
||||||
|
if (carryCapacityDeviceParam instanceof CarryCapacityDeviceParam.CarryCapacityDeviceUpdateParam) {
|
||||||
|
lambdaQueryWrapper.ne(CarryCapacityDevicePO::getDevId, ((CarryCapacityDeviceParam.CarryCapacityDeviceUpdateParam) carryCapacityDeviceParam).getDevId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//若存在条件数据抛出异常
|
||||||
|
int count = this.getBaseMapper().selectCount(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
|
throw new BusinessException("干扰源设备名称已存在");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ public class CarryCapacityResultPOServiceImpl extends ServiceImpl<CarryCapacityR
|
|||||||
BeanUtils.copyProperties(temp, vo);
|
BeanUtils.copyProperties(temp, vo);
|
||||||
String[] split = temp.getUserId().split(",");
|
String[] split = temp.getUserId().split(",");
|
||||||
List<String> collect1 = Arrays.stream(split).sequential().map(userId -> {
|
List<String> collect1 = Arrays.stream(split).sequential().map(userId -> {
|
||||||
CarryCapacityUserPO carryCapacityUserPO = carryCapacityUserPOService.queyDetailUserById(userId);
|
CarryCapacityUserPO carryCapacityUser = carryCapacityUserPOService.queyDetailUserById(userId);
|
||||||
return carryCapacityUserPO.getUserName();
|
return carryCapacityUser.getUserName();
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
vo.setUserName(String.join(",", collect1));
|
vo.setUserName(String.join(",", collect1));
|
||||||
if (ObjectUtils.isNotEmpty(temp.getIResultList()) ){
|
if (ObjectUtils.isNotEmpty(temp.getIResultList()) ){
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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.po.CarryCapacityStrategyDhlPO;
|
||||||
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityStrategyDhlVO;
|
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityStrategyDhlVO;
|
||||||
import com.njcn.advance.service.carrycapacity.CarryCapacityStrategyDhlPOService;
|
import com.njcn.advance.service.carrycapacity.CarryCapacityStrategyDhlPOService;
|
||||||
|
import com.njcn.advance.utils.CheckStringUtil;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -27,7 +28,7 @@ public class CarryCapacityStrategyDhlPOServiceImpl extends ServiceImpl<CarryCapa
|
|||||||
@Override
|
@Override
|
||||||
public List<CarryCapacityStrategyDhlVO> queyDetailDhl() {
|
public List<CarryCapacityStrategyDhlVO> queyDetailDhl() {
|
||||||
List<CarryCapacityStrategyDhlPO> list = this.lambdaQuery().eq(CarryCapacityStrategyDhlPO::getUserFlag, 1).list();
|
List<CarryCapacityStrategyDhlPO> list = this.lambdaQuery().eq(CarryCapacityStrategyDhlPO::getUserFlag, 1).list();
|
||||||
List<CarryCapacityStrategyDhlVO> collect = list.stream().map(t -> {
|
return list.stream().map(t -> {
|
||||||
CarryCapacityStrategyDhlVO vo = new CarryCapacityStrategyDhlVO();
|
CarryCapacityStrategyDhlVO vo = new CarryCapacityStrategyDhlVO();
|
||||||
vo.setCount1(t.getCount1());
|
vo.setCount1(t.getCount1());
|
||||||
vo.setCount2(t.getCount2());
|
vo.setCount2(t.getCount2());
|
||||||
@@ -42,7 +43,6 @@ public class CarryCapacityStrategyDhlPOServiceImpl extends ServiceImpl<CarryCapa
|
|||||||
vo.setType(t.getType());
|
vo.setType(t.getType());
|
||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
return collect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -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.po.CarryCapacityStrategyPO;
|
||||||
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityStrategyVO;
|
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityStrategyVO;
|
||||||
import com.njcn.advance.service.carrycapacity.CarryCapacityStrategyPOService;
|
import com.njcn.advance.service.carrycapacity.CarryCapacityStrategyPOService;
|
||||||
|
import com.njcn.advance.utils.CheckStringUtil;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -38,8 +39,9 @@ public class CarryCapacityStrategyPOServiceImpl extends ServiceImpl<CarryCapacit
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public Boolean add(CarryCapacityStrategyParam carryCapacityStrategyParam) {
|
public Boolean add(CarryCapacityStrategyParam carryCapacityStrategyParam) {
|
||||||
CarryCapacityStrategyPO carryCapacityStrategyPO = new CarryCapacityStrategyPO();
|
|
||||||
BeanUtils.copyProperties(carryCapacityStrategyParam, carryCapacityStrategyPO);
|
CarryCapacityStrategyPO carryCapacityStrategy = new CarryCapacityStrategyPO();
|
||||||
|
BeanUtils.copyProperties(carryCapacityStrategyParam, carryCapacityStrategy);
|
||||||
//将原始策略处理为不启用
|
//将原始策略处理为不启用
|
||||||
this.lambdaUpdate().eq(CarryCapacityStrategyPO::getResult, carryCapacityStrategyParam.getResult())
|
this.lambdaUpdate().eq(CarryCapacityStrategyPO::getResult, carryCapacityStrategyParam.getResult())
|
||||||
.eq(CarryCapacityStrategyPO::getId, carryCapacityStrategyParam.getId())
|
.eq(CarryCapacityStrategyPO::getId, carryCapacityStrategyParam.getId())
|
||||||
@@ -56,9 +58,9 @@ public class CarryCapacityStrategyPOServiceImpl extends ServiceImpl<CarryCapacit
|
|||||||
//将客户对应策略删除
|
//将客户对应策略删除
|
||||||
this.remove(lambdaQuery);
|
this.remove(lambdaQuery);
|
||||||
//新增客户策略;
|
//新增客户策略;
|
||||||
carryCapacityStrategyPO.setProtoFlag(2);
|
carryCapacityStrategy.setProtoFlag(2);
|
||||||
carryCapacityStrategyPO.setUserFlag(1);
|
carryCapacityStrategy.setUserFlag(1);
|
||||||
return this.save(carryCapacityStrategyPO);
|
return this.save(carryCapacityStrategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.advance.service.carrycapacity.impl;
|
package com.njcn.advance.service.carrycapacity.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -10,10 +11,17 @@ import com.njcn.advance.mapper.carrycapacity.CarryCapacityUserPOMapper;
|
|||||||
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityUserParam;
|
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityUserParam;
|
||||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityUserPO;
|
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityUserPO;
|
||||||
import com.njcn.advance.service.carrycapacity.CarryCapacityUserPOService;
|
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.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.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||||
|
import com.njcn.harmonic.pojo.param.ReportTemplateParam;
|
||||||
|
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
import com.njcn.user.pojo.vo.UserVO;
|
import com.njcn.user.pojo.vo.UserVO;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -21,6 +29,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -37,29 +46,57 @@ public class CarryCapacityUserPOServiceImpl extends ServiceImpl<CarryCapacityUse
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean add(CarryCapacityUserParam carryCapacityUserParam) {
|
public Boolean add(CarryCapacityUserParam carryCapacityUserParam) {
|
||||||
CarryCapacityUserPO carryCapacityUserPO = new CarryCapacityUserPO();
|
if(StringUtils.isBlank(carryCapacityUserParam.getUserName())){
|
||||||
BeanUtils.copyProperties(carryCapacityUserParam, carryCapacityUserPO);
|
throw new BusinessException("用户称不能为空");
|
||||||
CarryCapacityUserPO one = this.lambdaQuery().eq(CarryCapacityUserPO::getUserName, carryCapacityUserParam.getUserName()).one();
|
}
|
||||||
if(Objects.nonNull(one)){
|
checkName(carryCapacityUserParam,false);
|
||||||
|
CarryCapacityUserPO carryCapacityUser = new CarryCapacityUserPO();
|
||||||
|
BeanUtils.copyProperties(carryCapacityUserParam, carryCapacityUser);
|
||||||
|
carryCapacityUser.setStatus(1);
|
||||||
|
return this.save(carryCapacityUser);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 检查名称是否已存在
|
||||||
|
*
|
||||||
|
* @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());
|
||||||
|
|
||||||
|
//and id <> ?
|
||||||
|
if (isUpdate) {
|
||||||
|
if (carryCapacityUserParam instanceof CarryCapacityUserParam.CarryCapacityUserUpdateParam) {
|
||||||
|
lambdaQueryWrapper.ne(CarryCapacityUserPO::getUserId, ((CarryCapacityUserParam.CarryCapacityUserUpdateParam) carryCapacityUserParam).getUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//若存在条件数据抛出异常
|
||||||
|
int count = this.getBaseMapper().selectCount(lambdaQueryWrapper);
|
||||||
|
if (count > 0) {
|
||||||
throw new BusinessException(AdvanceResponseEnum.USER_NAME_EXIST);
|
throw new BusinessException(AdvanceResponseEnum.USER_NAME_EXIST);
|
||||||
}
|
}
|
||||||
carryCapacityUserPO.setStatus(1);
|
|
||||||
boolean save = this.save(carryCapacityUserPO);
|
|
||||||
return save;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateUser(CarryCapacityUserParam.CarryCapacityUserUpdateParam userUpdateParam) {
|
public Boolean updateUser(CarryCapacityUserParam.CarryCapacityUserUpdateParam userUpdateParam) {
|
||||||
CarryCapacityUserPO carryCapacityUserPO = new CarryCapacityUserPO();
|
if(StringUtils.isBlank(userUpdateParam.getUserName())){
|
||||||
BeanUtils.copyProperties(userUpdateParam, carryCapacityUserPO);
|
throw new BusinessException("用户称不能为空");
|
||||||
CarryCapacityUserPO one = this.lambdaQuery().eq(CarryCapacityUserPO::getUserName, userUpdateParam.getUserName()).ne(CarryCapacityUserPO::getUserId,userUpdateParam.getUserId()).one();
|
|
||||||
if(Objects.nonNull(one)){
|
|
||||||
throw new BusinessException(AdvanceResponseEnum.USER_NAME_EXIST);
|
|
||||||
}
|
}
|
||||||
|
checkName(userUpdateParam,true);
|
||||||
|
CarryCapacityUserPO carryCapacityUser = new CarryCapacityUserPO();
|
||||||
|
BeanUtils.copyProperties(userUpdateParam, carryCapacityUser);
|
||||||
|
|
||||||
boolean save = this.updateById(carryCapacityUserPO);
|
|
||||||
return save;
|
return this.updateById(carryCapacityUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class SgEventServiceImpl extends ServiceImpl<SgEventMapper, SgEvent> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void downloadTemplate() {
|
public void downloadTemplate() {
|
||||||
ExcelUtil.exportExcel("暂降事件模板.xls", "暂降数据", SgEventExcel.class, new ArrayList<>());
|
ExcelUtil.exportExcel("暂降事件模板.csv", "暂降数据", SgEventExcel.class, new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,10 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.date.TimeInterval;
|
import cn.hutool.core.date.TimeInterval;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
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.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -14,7 +17,7 @@ import com.njcn.advance.enums.AdvanceResponseEnum;
|
|||||||
import com.njcn.advance.mapper.RelevantLogMapper;
|
import com.njcn.advance.mapper.RelevantLogMapper;
|
||||||
import com.njcn.advance.mapper.RmpEventAdvanceMapper;
|
import com.njcn.advance.mapper.RmpEventAdvanceMapper;
|
||||||
import com.njcn.advance.mapper.RmpEventDetailAssMapper;
|
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.dto.relevent.*;
|
||||||
import com.njcn.advance.pojo.po.PqsRelevanceLog;
|
import com.njcn.advance.pojo.po.PqsRelevanceLog;
|
||||||
import com.njcn.advance.service.EventRelevantAnalysisService;
|
import com.njcn.advance.service.EventRelevantAnalysisService;
|
||||||
@@ -25,10 +28,12 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
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.device.pq.pojo.vo.AreaLineInfoVO;
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
@@ -39,8 +44,10 @@ import com.njcn.user.pojo.po.User;
|
|||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -62,6 +69,8 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanceMapper, RmpEventDetailPO> implements EventRelevantAnalysisService {
|
public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanceMapper, RmpEventDetailPO> implements EventRelevantAnalysisService {
|
||||||
|
|
||||||
|
private final String redisSortKey = "NODESORT";
|
||||||
|
|
||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
@@ -77,6 +86,8 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
private final UserFeignClient userFeignClient;
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -84,11 +95,6 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
TimeInterval timeInterval = new TimeInterval();
|
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();
|
LocalDateTime date = LocalDateTime.now();
|
||||||
HandleEvent handleEvent = new HandleEvent();
|
HandleEvent handleEvent = new HandleEvent();
|
||||||
@@ -97,85 +103,84 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
if (CollectionUtil.isEmpty(baseList)) {
|
if (CollectionUtil.isEmpty(baseList)) {
|
||||||
throw new BusinessException("当前时间段暂无可分析事件");
|
throw new BusinessException("当前时间段暂无可分析事件");
|
||||||
}
|
}
|
||||||
|
List<EntityGroupEvtData> list3 = new ArrayList<>(baseList);
|
||||||
|
|
||||||
// 传入的处理事件根据物理隔绝进行分组
|
|
||||||
|
|
||||||
List<EntityLogic> strategyList = relevantLogMapper.getLogic();
|
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(strategyList)) {
|
Map<String, EntityMtrans> entityMtransMap = getNodeInfo();
|
||||||
List<SagEvent> listSagEvent = new ArrayList<>();
|
Set<Map.Entry<String, EntityMtrans>> setMtrans = entityMtransMap.entrySet();
|
||||||
List<EventAssObj> listEventAssObj = new ArrayList<>();
|
|
||||||
|
|
||||||
Map<String, List<String>> strategyToBusBarMap = new HashMap<>(32);
|
List<SagEvent> listSagEvent = new ArrayList<>();
|
||||||
|
List<EventAssObj> listEventAssObj = new ArrayList<>();
|
||||||
|
|
||||||
Map<String, EntityMtrans> mapRedis = 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, 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();
|
DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.EVENT_REASON.getName(), DicDataEnum.SHORT_TROUBLE.getName()).getData();
|
||||||
EntityMtrans entityMtrans = new EntityMtrans();
|
if (Objects.isNull(dictData)) {
|
||||||
handleEvent.create_matrixcata(list, entityMtrans);
|
throw new BusinessException(SystemResponseEnum.ADVANCE_REASON);
|
||||||
|
}
|
||||||
|
|
||||||
mapRedis.put(key, 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();
|
||||||
|
|
||||||
strategyToBusBarMap.forEach((lastKey, lastVal) -> {
|
for (Map.Entry<String, Integer> mm : mapValue) {
|
||||||
int index = 1;
|
for (EntityGroupEvtData groupEvtData : baseList) {
|
||||||
List<EntityGroupEvtData> list = new ArrayList<>();
|
if (groupEvtData.getNodePhysics().equals(mm.getKey()) && dictData.getId().equals(groupEvtData.getSagReason())) {
|
||||||
for (EntityGroupEvtData entityGroupEvtData : baseList) {
|
groupEvtData.setNode(mm.getValue());
|
||||||
if (lastVal.contains(entityGroupEvtData.getNodePhysics()) && dictData.getId().equals(entityGroupEvtData.getSagReason())) {
|
list.add(groupEvtData);
|
||||||
entityGroupEvtData.setNode(index++);
|
|
||||||
list.add(entityGroupEvtData);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
EntityGroupEvtData[] entityGroupEvtData = new EntityGroupEvtData[list.size()];
|
for (Map.Entry<String, EntityMtrans> mEntry : setMtrans) {
|
||||||
Collections.sort(list);
|
if (mEntry.getKey().equals(m.getKey())) {
|
||||||
list.toArray(entityGroupEvtData);
|
|
||||||
|
|
||||||
mapRedis.forEach((mKey, mVal) -> {
|
//算法最多处理1000条数据,超过限制需分批处理 先将数据根据某种方式进行升序/降序排序,然后分段处理 加入循环处理
|
||||||
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 circulation = entityGroupEvtData.length % FinalData.MAX_EVT_NUM == 0
|
||||||
int to;
|
? entityGroupEvtData.length / FinalData.MAX_EVT_NUM
|
||||||
if (i == circulation - 1) {
|
: entityGroupEvtData.length / FinalData.MAX_EVT_NUM + 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,
|
for (int i = 0; i < circulation; i++) {
|
||||||
i * FinalData.MAX_EVT_NUM, to);
|
int to = 0;
|
||||||
EntityGroupData entityGroupData = handleEvent.translate(arrayObj, mVal);
|
|
||||||
// 处理分析结果
|
if (i == circulation - 1) {
|
||||||
handleEvent.show_group_info(entityGroupData, listSagEvent, listEventAssObj, date);
|
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);
|
||||||
|
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);
|
disposeNonStandardData(handleEvent, baseList, listEventAssObj, listSagEvent, date);
|
||||||
|
|
||||||
|
|
||||||
@@ -215,13 +220,232 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
entityPqsRelevance.setTimeId(date);
|
entityPqsRelevance.setTimeId(date);
|
||||||
relevantLogMapper.insert(entityPqsRelevance);
|
relevantLogMapper.insert(entityPqsRelevance);
|
||||||
|
|
||||||
} else {
|
|
||||||
throw new BusinessException("当前无变压器策略,请先配置策略");
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info("事件关联分析用时:" + timeInterval.interval() / 1000 + "秒");
|
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
|
@Override
|
||||||
public Page<AdvanceEventDetailVO> querySagEventsPage(BaseParam baseParam) {
|
public Page<AdvanceEventDetailVO> querySagEventsPage(BaseParam baseParam) {
|
||||||
List<String> lineIds = generalDeviceInfoClient.deptGetRunLineEvent(RequestUtil.getDeptIndex()).getData();
|
List<String> lineIds = generalDeviceInfoClient.deptGetRunLineEvent(RequestUtil.getDeptIndex()).getData();
|
||||||
@@ -274,6 +498,9 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
||||||
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
||||||
LambdaQueryWrapper<RmpEventDetailAssPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<RmpEventDetailAssPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if (StrUtil.isNotBlank(baseParam.getSearchValue())) {
|
||||||
|
lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue());
|
||||||
|
}
|
||||||
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
|
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
|
||||||
.orderByAsc(RmpEventDetailAssPO::getTimeId);
|
.orderByAsc(RmpEventDetailAssPO::getTimeId);
|
||||||
return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
||||||
@@ -631,31 +858,116 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
/*************************************************************************************
|
/*************************************************************************************
|
||||||
* 获取变压器信息并生成矩阵
|
* 获取变压器信息并生成矩阵
|
||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
@Deprecated
|
public Map<String, EntityMtrans> getNodeInfo( ) {
|
||||||
public void getNodeInfo(HandleEvent handleEvent) {
|
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
||||||
|
|
||||||
|
HandleEvent handleEvent = new HandleEvent();
|
||||||
List<EntityLogic> list = relevantLogMapper.getLogic();
|
List<EntityLogic> list = relevantLogMapper.getLogic();
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(list)) {
|
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) -> {
|
setNodeSort.forEach((key, val) -> {
|
||||||
List<String> tem = new ArrayList<>();
|
FinalData.NODE_NUM = val.size();
|
||||||
val.forEach(it -> {
|
List<EntityLogic> listNew = new ArrayList<>();
|
||||||
tem.add(it.getNodeBefore());
|
|
||||||
tem.add(it.getNodeNext());
|
for (EntityLogic entityLogic : list) {
|
||||||
});
|
if (entityLogic.getTPIndex().equals(key)) {
|
||||||
tfBusBarMap.put(key, tem);
|
entityLogic.setNode_h(val.get(entityLogic.getNodeBefore()));
|
||||||
|
entityLogic.setNode_l(val.get(entityLogic.getNodeNext()));
|
||||||
|
listNew.add(entityLogic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EntityMtrans entityMtrans = new EntityMtrans();
|
EntityMtrans entityMtrans = new EntityMtrans();
|
||||||
handleEvent.create_matrixcata(val, entityMtrans);
|
handleEvent.create_matrixcata(listNew, entityMtrans);
|
||||||
entityMtranMap.put(key, 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -693,3 +1005,4 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.njcn.advance.utils;
|
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.DecompositionSolver;
|
||||||
import org.apache.commons.math3.linear.LUDecomposition;
|
import org.apache.commons.math3.linear.LUDecomposition;
|
||||||
import org.apache.commons.math3.linear.MatrixUtils;
|
import org.apache.commons.math3.linear.MatrixUtils;
|
||||||
@@ -102,10 +104,16 @@ public class CZNLPG {
|
|||||||
//矩阵求逆
|
//矩阵求逆
|
||||||
|
|
||||||
public static RealMatrix inverseMatrix(RealMatrix matrix) {
|
public static RealMatrix inverseMatrix(RealMatrix matrix) {
|
||||||
LUDecomposition LUDe = new LUDecomposition(matrix);
|
try {
|
||||||
DecompositionSolver solver = LUDe.getSolver();
|
LUDecomposition LUDe = new LUDecomposition(matrix);
|
||||||
RealMatrix result = solver.getInverse();
|
DecompositionSolver solver = LUDe.getSolver();
|
||||||
return result;
|
RealMatrix result = solver.getInverse();
|
||||||
|
return result;
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new BusinessException("数据存在问题无法进行矩阵求逆");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ public class RadarUtil {
|
|||||||
* @param governYearLoss 治理后损失
|
* @param governYearLoss 治理后损失
|
||||||
*/
|
*/
|
||||||
public static Double getRadarResult(Double yearLoss, Double governYearLoss) {
|
public static Double getRadarResult(Double yearLoss, Double governYearLoss) {
|
||||||
|
// 年治理效果
|
||||||
double loss = yearLoss - governYearLoss;
|
double loss = yearLoss - governYearLoss;
|
||||||
if (loss == 0D || yearLoss == 0) {
|
if (loss == 0D || yearLoss == 0) {
|
||||||
return 0D;
|
return 0D;
|
||||||
|
|||||||
@@ -4,28 +4,33 @@ package com.njcn.advance.utils;
|
|||||||
import com.njcn.advance.pojo.dto.relevent.*;
|
import com.njcn.advance.pojo.dto.relevent.*;
|
||||||
|
|
||||||
public class UtilNormalization {
|
public class UtilNormalization {
|
||||||
public static void matrixcata_pro(EntityLogic[] transformer, EntityMtrans entityMtrans, int len) {
|
public static void matrixcata_pro(EntityLogic[] transformer,EntityMtrans entityMtrans, int len) {
|
||||||
int i, j, k, con;
|
int i, j, k;
|
||||||
String node1, node2;
|
int node1, node2, con;
|
||||||
int src_node[] = new int[] { 0 };
|
int src_node[] = new int[] { 0 };
|
||||||
|
|
||||||
// 连接方式转化为矩阵形式,行、列表示所有节点
|
// 连接方式转化为矩阵形式,行、列表示所有节点
|
||||||
// inf表示两个节点不相连,0表示与自身相连,其他数值表示变压器连接类型
|
// inf表示两个节点不相连,0表示与自身相连,其他数值表示变压器连接类型
|
||||||
// 将初始矩阵的元素设为inf,对角线元素设为0
|
// 将初始矩阵的元素设为inf,对角线元素设为0
|
||||||
for (i = 0; i < FinalData.NODE_NUM; i++) {
|
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][j] = FinalData.DATA_INF;
|
||||||
}
|
|
||||||
entityMtrans.getMtrans()[i][i] = 0;
|
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();
|
StringBuilder str = new StringBuilder();
|
||||||
for (i = 0; i < FinalData.NODE_NUM; i++) {
|
for (i = 0; i < FinalData.NODE_NUM; i++) {
|
||||||
for (j = 0; j < FinalData.NODE_NUM; j++) {
|
for (j = 0; j < FinalData.NODE_NUM; j++) {
|
||||||
str.append(entityMtrans.getMtrans()[i][j]).append(" ");
|
str.append(entityMtrans.getMtrans()[i][j]).append(" ");
|
||||||
if (j == (FinalData.NODE_NUM - 1)) {
|
if (j == (FinalData.NODE_NUM - 1))
|
||||||
str.append("\r\n");
|
str.append("\r\n");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,60 +38,52 @@ public class UtilNormalization {
|
|||||||
// Matrixcata模式匹配矩阵,列为节点数,行为总类别数,元素为第一个节点分别是1-6类别情况下其他节点类别情况。
|
// Matrixcata模式匹配矩阵,列为节点数,行为总类别数,元素为第一个节点分别是1-6类别情况下其他节点类别情况。
|
||||||
// 元素1,2,3,4,5,6 分别对应 Dc,Cb,Da,Cc,Db,Ca
|
// 元素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;
|
entityMtrans.getMatrixcata0()[0][i] = 0;
|
||||||
}
|
|
||||||
for (i = 1; i < FinalData.NODE_NUM; i++) {
|
for (i = 1; i < FinalData.NODE_NUM; i++) {
|
||||||
// 路径缓存清空
|
// 路径缓存清空
|
||||||
for (j = 0; j < FinalData.MAX_PATH_NUM; j++) {
|
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.getPossiable_path()[j][k] = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
entityMtrans.setPath_num(0);
|
entityMtrans.setPath_num(0);
|
||||||
// 寻找路径
|
// 寻找路径
|
||||||
src_node[0] = 0;
|
src_node[0] = 0;
|
||||||
findPath(entityMtrans, src_node, i, 0, 1, FinalData.NODE_NUM);
|
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]; // 采用第一条路径
|
entityMtrans.getMatrixcata0()[0][i] = entityMtrans.getPossiable_path()[0][FinalData.NODE_NUM]; // 采用第一条路径
|
||||||
} else {
|
else
|
||||||
entityMtrans.getMatrixcata0()[0][i] = FinalData.DATA_INF; // 找不到路径填大值表示不通
|
entityMtrans.getMatrixcata0()[0][i] = FinalData.DATA_INF; // 找不到路径填大值表示不通
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 构造矩阵其他行元素
|
// 构造矩阵其他行元素
|
||||||
for (i = 1; i < FinalData.EVT_TYPE_NUM; i++) {
|
for (i = 1; i < FinalData.EVT_TYPE_NUM; i++) {
|
||||||
for (j = 0; j < FinalData.NODE_NUM; j++)
|
for (j = 0; j < FinalData.NODE_NUM; j++)
|
||||||
// EntityGroupData.Matrixcata0[i][j] =
|
// EntityGroupData.Matrixcata0[i][j] =
|
||||||
// EntityGroupData.Matrixcata0[0][j] + i;
|
// EntityGroupData.Matrixcata0[0][j] + i;
|
||||||
{
|
|
||||||
if (entityMtrans.getMatrixcata0()[0][j] == FinalData.DATA_INF) {
|
if (entityMtrans.getMatrixcata0()[0][j] == FinalData.DATA_INF) {
|
||||||
entityMtrans.getMatrixcata0()[i][j] = FinalData.DATA_INF;
|
entityMtrans.getMatrixcata0()[i][j] = FinalData.DATA_INF;
|
||||||
} else {
|
} else {
|
||||||
entityMtrans.getMatrixcata0()[i][j] = entityMtrans.getMatrixcata0()[0][j] + i;
|
entityMtrans.getMatrixcata0()[i][j] = entityMtrans.getMatrixcata0()[0][j] + i;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 将数据归类到0-5
|
// 将数据归类到0-5
|
||||||
for (i = 0; i < FinalData.EVT_TYPE_NUM; i++) {
|
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;
|
entityMtrans.getMatrixcata1()[i][j] = entityMtrans.getMatrixcata0()[i][j] % 6;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 0换成6,将数据归类到1-6
|
// 0换成6,将数据归类到1-6
|
||||||
for (i = 0; i < FinalData.EVT_TYPE_NUM; i++) {
|
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++) {
|
||||||
if (entityMtrans.getMatrixcata1()[i][j] == 0) {
|
if (entityMtrans.getMatrixcata1()[i][j] == 0)
|
||||||
entityMtrans.getMatrixcata1()[i][j] = 6;
|
entityMtrans.getMatrixcata1()[i][j] = 6;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
str.delete(0, str.length());
|
str.delete(0, str.length());
|
||||||
for (i = 0; i < FinalData.EVT_TYPE_NUM; i++) {
|
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++) {
|
||||||
str.append(entityMtrans.getMatrixcata1()[i][j]).append(" ");
|
str.append(entityMtrans.getMatrixcata1()[i][j]).append(" ");
|
||||||
if (j == (FinalData.NODE_NUM - 1)) {
|
if (j == (FinalData.NODE_NUM - 1))
|
||||||
str.append("\r\n");
|
str.append("\r\n");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.time.*;
|
|||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
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) {
|
public static boolean isTimeInRange(Instant instant, LocalDate startTime, LocalDate endTime) {
|
||||||
// 将Instant对象转换为LocalDateTime对象
|
// 将Instant对象转换为LocalDateTime对象
|
||||||
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
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之间
|
// 检查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;
|
return isInRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static <T> List<Double> getAttributeValueByPropertyName(List<T> list, String propertyName) {
|
public static <T> List<Double> getAttributeValueByPropertyName(List<T> list, String propertyName) {
|
||||||
List<Double> resultList = new ArrayList<>();
|
List<Double> resultList = new ArrayList<>();
|
||||||
for (T item : list) {
|
for (T item : list) {
|
||||||
|
|||||||
27
pqs-algorithm/algorithm-api/pom.xml
Normal file
27
pqs-algorithm/algorithm-api/pom.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>pqs-algorithm</artifactId>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>algorithm-api</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-core</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.njcn.algorithm.pojo.param;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 算法编排的计算参数
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年11月03日 09:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CalculatedParam<T> implements Serializable {
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 是否全链路执行算法
|
||||||
|
* 非全链路执行时,tag集合必须非空
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "fullChain",value = "是否全链执行")
|
||||||
|
private boolean fullChain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目前仅监测点日统计存在补招功能 by yxb
|
||||||
|
* 是否补招标识,默认不补招
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "repair",value = "是否补招")
|
||||||
|
private boolean repair;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期_yyyy-MM-dd
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "dataDate",value = "时间日期_yyyy-MM-dd")
|
||||||
|
private String dataDate;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 需要执行的组件
|
||||||
|
* 当不需要全链路执行时,通过tag名称动态指定执行某个算法组件
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "tagNames",value = "待执行链节点的tag集合")
|
||||||
|
private Set<String> tagNames;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待计算的对象索引集合,监测点、设备、母线、变电站、单位下监测点等等
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "idList",value = "索引集合")
|
||||||
|
private List<T> idList;
|
||||||
|
}
|
||||||
131
pqs-algorithm/algorithm-boot/pom.xml
Normal file
131
pqs-algorithm/algorithm-boot/pom.xml
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>pqs-algorithm</artifactId>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>algorithm-boot</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-swagger</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-microservice</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-redis</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>algorithm-api</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yomahub</groupId>
|
||||||
|
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||||
|
<version>2.12.4.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yomahub</groupId>
|
||||||
|
<artifactId>liteflow-rule-nacos</artifactId>
|
||||||
|
<version>2.12.4.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--暂态模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>event-api</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--稳态模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>harmonic-api</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>algorithmboot</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
|
<configuration>
|
||||||
|
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>1.2.2</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>build-image</id>
|
||||||
|
<phase>${docker.operate}</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>build</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<!--<serverId>36dockerHarbor</serverId>-->
|
||||||
|
<registryUrl>http://${docker.repostory}</registryUrl>
|
||||||
|
<!-- 镜像名称 -->
|
||||||
|
<imageName>${docker.repostory}/${docker.registry.name}/${project.artifactId}</imageName>
|
||||||
|
<imageTags>
|
||||||
|
<imageTag>latest</imageTag>
|
||||||
|
</imageTags>
|
||||||
|
<dockerHost>${docker.url}</dockerHost>
|
||||||
|
<dockerDirectory>${basedir}/</dockerDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<targetPath>/ROOT</targetPath>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<include>${project.build.finalName}.jar</include>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.algorithm;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2024/11/4 14:05
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@EnableFeignClients(basePackages = "com.njcn")
|
||||||
|
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||||
|
public class AlgorithmApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(AlgorithmApplication.class,args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.algorithm.event.mapper;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2024/11/6 15:55
|
||||||
|
*/
|
||||||
|
public interface RMpEventDetailDMapper extends MppBaseMapper<RMpEventDetailD> {
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 处理在暂态指标明细——月报表数据获取
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/11/2 10:54
|
||||||
|
* @param lineIds 监测点集合
|
||||||
|
* @param dataDate 统计日期
|
||||||
|
* @param beginMonth 起始时间
|
||||||
|
* @param endMonth 截止时间
|
||||||
|
* @return List<RMpEventDetailDPO>
|
||||||
|
*/
|
||||||
|
List<RMpEventDetailM> handleMonth(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginMonth") DateTime beginMonth, @Param("endMonth") DateTime endMonth);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.algorithm.event.mapper;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2022/12/28 14:58【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RMpEventDetailMMapper extends MppBaseMapper<RMpEventDetailM> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.algorithm.event.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||||
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2024/11/6 15:43
|
||||||
|
*/
|
||||||
|
public interface RMpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 处理在暂态指标明细——日报表数据获取
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/11/2 10:54
|
||||||
|
* @param lineIds 监测点集合
|
||||||
|
* @param dataDate 统计日期
|
||||||
|
* @param beginDay 起始时间
|
||||||
|
* @param endDay 截止时间
|
||||||
|
* @param voltageDip 电压暂降
|
||||||
|
* @param voltageRise 电压暂升
|
||||||
|
* @param shortInterruptions 短时中断
|
||||||
|
* @return List<RMpEventDetailDPO>
|
||||||
|
*/
|
||||||
|
List<RMpEventDetailD> handleDay(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginDay") LocalDateTime beginDay, @Param("endDay") LocalDateTime endDay, @Param("voltageDip") String voltageDip, @Param("voltageRise") String voltageRise, @Param("shortInterruptions") String shortInterruptions);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?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.algorithm.event.mapper.RMpEventDetailDMapper">
|
||||||
|
|
||||||
|
<select id="handleMonth" resultType="com.njcn.event.pojo.po.RMpEventDetailM">
|
||||||
|
SELECT
|
||||||
|
#{dataDate} dataDate,
|
||||||
|
measurement_point_id measurement_point_id,
|
||||||
|
sum(sag_times) AS sagTimes,
|
||||||
|
sum(swell_times) AS swellTimes,
|
||||||
|
sum(interrupt_times) AS interruptTimes
|
||||||
|
FROM
|
||||||
|
r_mp_event_detail_d r_mp_event_detail_d
|
||||||
|
where
|
||||||
|
r_mp_event_detail_d.data_date between #{beginMonth} and #{endMonth}
|
||||||
|
AND
|
||||||
|
r_mp_event_detail_d.measurement_point_id IN
|
||||||
|
<foreach collection="lineIds" item="lineId" separator="," open="(" close=")">
|
||||||
|
#{lineId}
|
||||||
|
</foreach>
|
||||||
|
GROUP BY
|
||||||
|
measurement_point_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.algorithm.event.mapper.RMpEventDetailMMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?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.algorithm.event.mapper.RMpEventDetailMapper">
|
||||||
|
|
||||||
|
<select id="handleDay" resultType="com.njcn.event.pojo.po.RMpEventDetailD">
|
||||||
|
SELECT
|
||||||
|
#{dataDate} dataDate,
|
||||||
|
measurement_point_id measurement_point_id,
|
||||||
|
sum( event_type = #{voltageDip} ) AS sagTimes,
|
||||||
|
sum( event_type = #{voltageRise} ) AS swellTimes,
|
||||||
|
sum( event_type = #{shortInterruptions} ) AS interruptTimes
|
||||||
|
FROM
|
||||||
|
r_mp_event_detail r_mp_event_detail
|
||||||
|
where r_mp_event_detail.start_time between #{beginDay} and #{endDay}
|
||||||
|
AND r_mp_event_detail.measurement_point_id
|
||||||
|
IN
|
||||||
|
<foreach collection="lineIds" item="lineId" separator="," open="(" close=")">
|
||||||
|
#{lineId}
|
||||||
|
</foreach>
|
||||||
|
GROUP BY
|
||||||
|
measurement_point_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.algorithm.event.service;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2024/11/6 15:48
|
||||||
|
*/
|
||||||
|
public interface IRMpEventDetailDService extends IMppService<RMpEventDetailD> {
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 监测点暂态指标明细--月表算法
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/11/2 11:19
|
||||||
|
* @param calculatedParam 查询条件
|
||||||
|
*/
|
||||||
|
void handleMonth(CalculatedParam calculatedParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.njcn.algorithm.event.service;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2024/11/6 16:03
|
||||||
|
*/
|
||||||
|
public interface IRMpEventDetailMService extends IMppService<RMpEventDetailM> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.algorithm.event.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||||
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2024/11/6 15:31
|
||||||
|
*/
|
||||||
|
public interface IRMpEventDetailService extends IService<RmpEventDetailPO> {
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 监测点暂态指标明细--日表算法
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/11/2 11:19
|
||||||
|
* @param calculatedParam 查询条件
|
||||||
|
*/
|
||||||
|
void handleDay(CalculatedParam calculatedParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.njcn.algorithm.event.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.algorithm.event.mapper.RMpEventDetailDMapper;
|
||||||
|
import com.njcn.algorithm.event.service.IRMpEventDetailDService;
|
||||||
|
import com.njcn.algorithm.event.service.IRMpEventDetailMService;
|
||||||
|
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.ListUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2024/11/6 15:49
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RMpEventDetailDServiceImpl extends MppServiceImpl<RMpEventDetailDMapper, RMpEventDetailD> implements IRMpEventDetailDService {
|
||||||
|
|
||||||
|
|
||||||
|
private final IRMpEventDetailMService rMpEventDetailMService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*监测点暂态指标明细--月表算法
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void handleMonth(CalculatedParam calculatedParam) {
|
||||||
|
List<String> lineIds = calculatedParam.getIdList();
|
||||||
|
//以尺寸1000分片
|
||||||
|
List<List<String>> pendingIds = ListUtils.partition(lineIds, 1000);
|
||||||
|
DateTime beginMonth = DateUtil.beginOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
DateTime endMonth = DateUtil.endOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
for (List<String> pendingId : pendingIds) {
|
||||||
|
List<RMpEventDetailM> rMpEventDetailMPOList = this.baseMapper.handleMonth(pendingId, DateUtil.format(beginMonth, DatePattern.NORM_DATE_PATTERN), beginMonth, endMonth);
|
||||||
|
rMpEventDetailMService.saveOrUpdateBatchByMultiId(rMpEventDetailMPOList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.algorithm.event.service.impl;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.algorithm.event.mapper.RMpEventDetailMMapper;
|
||||||
|
import com.njcn.algorithm.event.service.IRMpEventDetailMService;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2022/12/28 14:58【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RMpEventDetailMServiceImpl extends MppServiceImpl<RMpEventDetailMMapper, RMpEventDetailM> implements IRMpEventDetailMService {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.njcn.algorithm.event.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.algorithm.event.mapper.RMpEventDetailMapper;
|
||||||
|
import com.njcn.algorithm.event.service.IRMpEventDetailDService;
|
||||||
|
import com.njcn.algorithm.event.service.IRMpEventDetailService;
|
||||||
|
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||||
|
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||||
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.ListUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/4/23 13:50【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RMpEventDetailServiceImpl extends ServiceImpl<RMpEventDetailMapper, RmpEventDetailPO> implements IRMpEventDetailService {
|
||||||
|
|
||||||
|
private final IRMpEventDetailDService rMpEventDetailDService;
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 监测点暂态指标明细--日表算法
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void handleDay(CalculatedParam calculatedParam) {
|
||||||
|
List<String> lineIds = calculatedParam.getIdList();
|
||||||
|
//以尺寸1000分片
|
||||||
|
List<List<String>> pendingIds = ListUtils.partition(lineIds,1000);
|
||||||
|
LocalDateTime beginDay = LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
LocalDateTime endDay = LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
for (List<String> pendingId : pendingIds) {
|
||||||
|
//查询
|
||||||
|
List<RMpEventDetailD> rMpEventDetailDList = this.baseMapper.handleDay(
|
||||||
|
pendingId
|
||||||
|
,LocalDateTimeUtil.format(beginDay,DatePattern.NORM_DATE_PATTERN)
|
||||||
|
,beginDay
|
||||||
|
,endDay
|
||||||
|
,getEventTypeId(DicDataEnum.VOLTAGE_DIP.getCode())
|
||||||
|
,getEventTypeId(DicDataEnum.VOLTAGE_RISE.getCode())
|
||||||
|
,getEventTypeId(DicDataEnum.SHORT_INTERRUPTIONS.getCode()));
|
||||||
|
//入库
|
||||||
|
rMpEventDetailDService.saveOrUpdateBatchByMultiId(rMpEventDetailDList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getEventTypeId(String code) {
|
||||||
|
String eventType = redisUtil.getStringByKey(code);
|
||||||
|
eventType = Optional.ofNullable(eventType).orElseGet(() -> {
|
||||||
|
DictData data = dicDataFeignClient.getDicDataByCode(code).getData();
|
||||||
|
redisUtil.saveByKey(data.getCode(), data.getId());
|
||||||
|
return data.getId();
|
||||||
|
});
|
||||||
|
|
||||||
|
return eventType;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.njcn.algorithm.harmonic.line.mapper;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface RMpMonitorEvaluateDMapper extends MppBaseMapper<RMpMonitorEvaluateD> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.algorithm.harmonic.line.mapper.RMpMonitorEvaluateDMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.algorithm.harmonic.line.service;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||||
|
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/4/19 15:42【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface IRMpMonitorEvaluateDService extends IMppService<RMpMonitorEvaluateD> {
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 监测点报表--日统计
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/11/3 14:48
|
||||||
|
* @param calculatedParam 查询条件
|
||||||
|
*/
|
||||||
|
void handleDay(CalculatedParam calculatedParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
package com.njcn.algorithm.harmonic.line.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.algorithm.harmonic.line.mapper.RMpMonitorEvaluateDMapper;
|
||||||
|
import com.njcn.algorithm.harmonic.line.service.IRMpMonitorEvaluateDService;
|
||||||
|
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||||
|
import com.njcn.algorithm.support.mapper.PmsAbnormalRulesMapper;
|
||||||
|
import com.njcn.device.biz.commApi.CommLineClient;
|
||||||
|
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||||
|
import com.njcn.device.pq.constant.Param;
|
||||||
|
import com.njcn.device.pq.pojo.po.PmsAbnormalRules;
|
||||||
|
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
||||||
|
import com.njcn.influx.pojo.po.DataFlicker;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.ListUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RMpMonitorEvaluateDServiceImpl extends MppServiceImpl<RMpMonitorEvaluateDMapper, RMpMonitorEvaluateD> implements IRMpMonitorEvaluateDService {
|
||||||
|
|
||||||
|
private final CommLineClient commLineClient;
|
||||||
|
// private final DataVInfluxdbService dataVInfluxdbService;
|
||||||
|
// private final PmsAbnormalRulesMapper pmsAbnormalRulesMapper;
|
||||||
|
// private final DataIntegrityRateInfluxService dataIntegrityRateInfluxService;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 监测点报表--日统计
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/11/3 14:48
|
||||||
|
* @param calculatedParam 查询条件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void handleDay(CalculatedParam calculatedParam) {
|
||||||
|
// //1、取出规则
|
||||||
|
// List<PmsAbnormalRules> pmsAbnormalRules = pmsAbnormalRulesMapper.selectList(null);
|
||||||
|
// String beginDay =LocalDateTimeUtil.format(LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)),DatePattern.NORM_DATETIME_PATTERN);
|
||||||
|
// String endDay = LocalDateTimeUtil.format(LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)),DatePattern.NORM_DATETIME_PATTERN);
|
||||||
|
// //以尺寸1000分片
|
||||||
|
// List<List<String>> pendingIds = ListUtils.partition(calculatedParam.getIdList(), 100);
|
||||||
|
// for (List<String> pendingId : pendingIds) {
|
||||||
|
// List<LineDTO> lineDTOList = commLineClient.getLineDetailBatch(pendingId).getData();
|
||||||
|
// List<RMpMonitorEvaluateD> rMpMonitorEvaluateDS = new ArrayList<>();
|
||||||
|
// for (LineDTO lineDTO : lineDTOList) {
|
||||||
|
// if (ObjectUtil.isNotNull(lineDTO)) {
|
||||||
|
// /*todo 统计间隔,电压等级取值方式后期提供融合版本接口获取不然pms,pqs系统取值方式不一样*/
|
||||||
|
// /*统计间隔*/
|
||||||
|
// Integer statisticalInterval = lineDTO.getTimeInterval();
|
||||||
|
// /*电压等级*/
|
||||||
|
// Double voltage = Double.parseDouble(lineDTO.getVoltageLevel());
|
||||||
|
// 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);
|
||||||
|
// DataFlicker twoFlickerData = dataIntegrityRateInfluxService.getTwoFlickerData(lineDTO.getLineId(), date, 5);
|
||||||
|
// LocalDate localDate = LocalDateTimeUtil.parseDate(beginDay, DatePattern.NORM_DATETIME_PATTERN);
|
||||||
|
//
|
||||||
|
// if (Objects.isNull(twoFlickerData)) {
|
||||||
|
// rMpMonitorEvaluateD.setPltCount(0);
|
||||||
|
// rMpMonitorEvaluateD.setPstCount(0);
|
||||||
|
// } else {
|
||||||
|
// rMpMonitorEvaluateD.setPltCount(twoFlickerData.getPltCount());
|
||||||
|
// rMpMonitorEvaluateD.setPstCount(twoFlickerData.getPstCount());
|
||||||
|
// }
|
||||||
|
// rMpMonitorEvaluateD.setAllMinuteCount(fiveItems.size());
|
||||||
|
// rMpMonitorEvaluateD.setDeviceId(lineDTO.getDevId());
|
||||||
|
// rMpMonitorEvaluateD.setDataDate(localDate);
|
||||||
|
// rMpMonitorEvaluateD.setMeasurementPointId(lineDTO.getLineId());
|
||||||
|
// rMpMonitorEvaluateDS.add(rMpMonitorEvaluateD);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (CollUtil.isNotEmpty(rMpMonitorEvaluateDS)) {
|
||||||
|
// this.saveOrUpdateBatchByMultiId(rMpMonitorEvaluateDS, 500);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 3、频率在【45,55】之间;
|
||||||
|
* 4、相电压有效值在【0.85p.u.,1.2p.u.】之间;p.u=电压等级/1.732
|
||||||
|
* 5、线电压有效值在【0.85p.u.,1.2p.u.】之间;p.u=电压等级
|
||||||
|
* 6、电压总谐波畸变率在【0.1%,20%】之间;
|
||||||
|
* 7、负序电压不平衡度在【0,20%】。满足以上条件则是一条有效数据
|
||||||
|
* @Param: [fiveItems, pmsAbnormalRules, voltage]
|
||||||
|
* @return: java.lang.Integer
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/2/23
|
||||||
|
*/
|
||||||
|
// private RMpMonitorEvaluateD calculateRMpMonitorEvaluateDPO(RMpMonitorEvaluateD rMpMonitorEvaluateD, List<DataVFiveItemDTO> fiveItems, List<PmsAbnormalRules> pmsAbnormalRules, Double voltage, LineDTO data) {
|
||||||
|
//
|
||||||
|
// Integer freqCount = 0;
|
||||||
|
// Integer unbalanceCount = 0;
|
||||||
|
// Integer phaseVoltageCount = 0;
|
||||||
|
// Integer lineVoltageCount = 0;
|
||||||
|
// Integer vThdCount = 0;
|
||||||
|
// Integer effectiveMinuteCount = 0;
|
||||||
|
//
|
||||||
|
// PmsAbnormalRules freqLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_FREQ)).collect(Collectors.toList()).get(0);
|
||||||
|
// PmsAbnormalRules rmsLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_RMS)).collect(Collectors.toList()).get(0);
|
||||||
|
// PmsAbnormalRules rms_lvrLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_RMS_LVR)).collect(Collectors.toList()).get(0);
|
||||||
|
// PmsAbnormalRules v_thdLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_V_THD)).collect(Collectors.toList()).get(0);
|
||||||
|
// PmsAbnormalRules v_unbalanceLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_V_UNBALANCE)).collect(Collectors.toList()).get(0);
|
||||||
|
// if (!CollectionUtils.isEmpty(fiveItems)) {
|
||||||
|
// for (DataVFiveItemDTO fiveItem : fiveItems) {
|
||||||
|
// Double freqMax = fiveItem.getFreqMax();
|
||||||
|
// Double freqMin = fiveItem.getFreqMin();
|
||||||
|
//
|
||||||
|
// Double rmsMax = fiveItem.getRmsMax();
|
||||||
|
// Double rmsMin = fiveItem.getRmsMin();
|
||||||
|
// Double vThdMax = fiveItem.getVThdMax();
|
||||||
|
// Double vThdMin = fiveItem.getVThdMin();
|
||||||
|
//
|
||||||
|
// Double vUnbalanceMax = fiveItem.getVUnbalanceMax();
|
||||||
|
// Double vUnbalanceMin = fiveItem.getVUnbalanceMin();
|
||||||
|
// Double rmsLvrMax = fiveItem.getRmsLvrMax();
|
||||||
|
// Double rmsLvrMin = fiveItem.getRmsLvrMin();
|
||||||
|
//
|
||||||
|
// Boolean rmsflag = false;
|
||||||
|
// Boolean rmsLvrflag = false;
|
||||||
|
// Boolean vUnbalanceflag = false;
|
||||||
|
//
|
||||||
|
// freqCount++;
|
||||||
|
// unbalanceCount++;
|
||||||
|
// phaseVoltageCount++;
|
||||||
|
// lineVoltageCount++;
|
||||||
|
// vThdCount++;
|
||||||
|
// effectiveMinuteCount++;
|
||||||
|
// // 先注释掉 校验跑出监测点
|
||||||
|
//// if (freqLimit.getLowerLimit() <= freqMin && freqMax <= freqLimit.getUpperLimit()) {
|
||||||
|
//// freqCount++;
|
||||||
|
//// }
|
||||||
|
//// /*,监测点的接线方式,如果是星形接线这个指标要判断,角形界面则不判断,默认它是正常的*/
|
||||||
|
//// if (Objects.equals("0", data.getPtType())) {
|
||||||
|
//// if (rmsLimit.getLowerLimit() * (voltage / 1.732) <= rmsMin && rmsMax <= rmsLimit.getUpperLimit() * (voltage / 1.732)) {
|
||||||
|
//// phaseVoltageCount++;
|
||||||
|
//// rmsflag = true;
|
||||||
|
//// }
|
||||||
|
//// } else {
|
||||||
|
//// rmsflag = true;
|
||||||
|
//// phaseVoltageCount++;
|
||||||
|
//// }
|
||||||
|
//// if (Objects.equals("1", data.getPtPhaseType())) {
|
||||||
|
//// if (rms_lvrLimit.getLowerLimit() * voltage <= rmsLvrMin && rmsLvrMax <= rms_lvrLimit.getUpperLimit() * voltage) {
|
||||||
|
//// lineVoltageCount++;
|
||||||
|
//// rmsLvrflag = true;
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// } else {
|
||||||
|
//// rmsLvrflag = true;
|
||||||
|
//// lineVoltageCount++;
|
||||||
|
////
|
||||||
|
//// }
|
||||||
|
//// if (Objects.equals("1", data.getPtPhaseType()) && Objects.equals("0", data.getPtType())) {
|
||||||
|
//// if (v_unbalanceLimit.getLowerLimit() <= vUnbalanceMin && vUnbalanceMax <= v_unbalanceLimit.getUpperLimit()
|
||||||
|
//// ) {
|
||||||
|
//// unbalanceCount++;
|
||||||
|
//// vUnbalanceflag = true;
|
||||||
|
//// }
|
||||||
|
//// } else {
|
||||||
|
//// unbalanceCount++;
|
||||||
|
//// vUnbalanceflag = true;
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
////
|
||||||
|
//// if (v_thdLimit.getLowerLimit() <= vThdMin && vThdMax <= v_thdLimit.getUpperLimit()) {
|
||||||
|
//// vThdCount++;
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
////
|
||||||
|
//// if (freqLimit.getLowerLimit() <= freqMin && freqMax <= freqLimit.getUpperLimit() &&
|
||||||
|
//// rmsflag &&
|
||||||
|
//// rmsLvrflag &&
|
||||||
|
//// v_thdLimit.getLowerLimit() <= vThdMin && vThdMax <= v_thdLimit.getUpperLimit() &&
|
||||||
|
//// vUnbalanceflag
|
||||||
|
////
|
||||||
|
//// ) {
|
||||||
|
//// effectiveMinuteCount++;
|
||||||
|
//// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// rMpMonitorEvaluateD.setEffectiveMinuteCount(effectiveMinuteCount);
|
||||||
|
// rMpMonitorEvaluateD.setFreqCount(freqCount);
|
||||||
|
// rMpMonitorEvaluateD.setPhaseVoltageCount(phaseVoltageCount);
|
||||||
|
// rMpMonitorEvaluateD.setLineVoltageCount(lineVoltageCount);
|
||||||
|
// rMpMonitorEvaluateD.setVThdCount(vThdCount);
|
||||||
|
// rMpMonitorEvaluateD.setUnbalanceCount(unbalanceCount);
|
||||||
|
// return rMpMonitorEvaluateD;
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.njcn.algorithm.support.mapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.PmsAbnormalRules;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PmsAbnormalRulesMapper
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/26
|
||||||
|
*/
|
||||||
|
public interface PmsAbnormalRulesMapper extends BaseMapper<PmsAbnormalRules> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.algorithm.support.mapper.PmsAbnormalRulesMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10223
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
#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
|
||||||
|
|
||||||
|
liteflow:
|
||||||
|
rule-source: config/liteflow.el.xml
|
||||||
|
# rule-source-ext-data-map:
|
||||||
|
# serverAddr: @nacos.url@
|
||||||
|
# dataId: prepare_liteflow
|
||||||
|
# group: DEFAULT_GROUP
|
||||||
|
# namespace: @nacos.namespace@
|
||||||
|
when-max-wait-time: 600000
|
||||||
|
print-banner: false
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: error
|
||||||
|
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
client-id: @artifactId@${random.value}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<flow>
|
||||||
|
<chain name="measurement_point">
|
||||||
|
THEN(
|
||||||
|
rMpSurplusAbnormalD
|
||||||
|
);
|
||||||
|
</chain>
|
||||||
|
<chain name="org_point">
|
||||||
|
THEN(
|
||||||
|
WHEN(rDimBusbarHarmnic.tag("r_dim_busbar_harmnic_d")),
|
||||||
|
rOperatingIndex.tag("r_operating_index_d"),
|
||||||
|
rOperatingIndex.tag("r_operating_index_m"),
|
||||||
|
rOperatingIndex.tag("r_operating_index_q"),
|
||||||
|
rOperatingIndex.tag("r_operating_index_y"),
|
||||||
|
rStatOrg.tag("r_stat_org_d"),
|
||||||
|
rStatOrg.tag("r_stat_org_m"),
|
||||||
|
rStatOrg.tag("r_stat_org_q"),
|
||||||
|
rStatOrg.tag("r_stat_org_y"),
|
||||||
|
rStatPollutionOrg.tag("r_stat_pollution_org_d"),
|
||||||
|
rStatPollutionOrg.tag("r_stat_pollution_org_m"),
|
||||||
|
rStatPollutionOrg.tag("r_stat_pollution_org_q"),
|
||||||
|
rStatPollutionOrg.tag("r_stat_pollution_org_y"),
|
||||||
|
rStatHarmonic.tag("r_stat_harmonic_d"),
|
||||||
|
rStatHarmonic.tag("r_stat_harmonic_m"),
|
||||||
|
rStatHarmonic.tag("r_stat_harmonic_q"),
|
||||||
|
rStatHarmonic.tag("r_stat_harmonic_y"),
|
||||||
|
rStatHarmonicVoltage.tag("r_stat_harmonic_voltage_d"),
|
||||||
|
rStatHarmonicVoltage.tag("r_stat_harmonic_voltage_m"),
|
||||||
|
rStatHarmonicOrg.tag("r_stat_harmonic_org_d"),
|
||||||
|
rStatHarmonicOrg.tag("r_stat_harmonic_org_m"),
|
||||||
|
rStatHarmonicOrg.tag("r_stat_harmonic_org_q"),
|
||||||
|
rStatHarmonicOrg.tag("r_stat_harmonic_org_y"),
|
||||||
|
rStatEvent.tag("r_stat_event_d"),
|
||||||
|
rStatEvent.tag("r_stat_event_m"),
|
||||||
|
rStatEvent.tag("r_stat_event_q"),
|
||||||
|
rStatEvent.tag("r_stat_event_y"),
|
||||||
|
rStatEventVoltage.tag("r_stat_event_voltage_d"),
|
||||||
|
rStatEventVoltage.tag("r_stat_event_voltage_m"),
|
||||||
|
rStatEventOrg.tag("r_stat_event_org_d"),
|
||||||
|
rStatEventOrg.tag("r_stat_event_org_m"),
|
||||||
|
rStatEventOrg.tag("r_stat_event_org_q"),
|
||||||
|
rStatEventOrg.tag("r_stat_event_org_y"),
|
||||||
|
rStatEventLoadType.tag("r_stat_load_type_d"),
|
||||||
|
rStatEventLoadType.tag("r_stat_load_type_m"),
|
||||||
|
rStatEventLoadType.tag("r_stat_load_type_q"),
|
||||||
|
rStatEventLoadType.tag("r_stat_load_type_y"),
|
||||||
|
rStatAlarmCount.tag("r_stat_alarm_count_w"),
|
||||||
|
rStatAlarmCount.tag("r_stat_area_alarm_count_m"),
|
||||||
|
rDimBusTarget.tag("r_dim_bus_target_d"),
|
||||||
|
rDimBusTarget.tag("r_dim_bus_target_m"),
|
||||||
|
rDimBusTarget.tag("r_dim_bus_target_y"),
|
||||||
|
rDimObjTarget.tag("r_dim_obj_target_d"),
|
||||||
|
rDimObjTarget.tag("r_dim_obj_target_m"),
|
||||||
|
rDimObjTarget.tag("r_dim_obj_target_y"),
|
||||||
|
rDimObjGlobal.tag("r_dim_obj_global_d"),
|
||||||
|
rDimObjGlobal.tag("r_dim_obj_global_m"),
|
||||||
|
rDimObjGlobal.tag("r_dim_obj_global_y"),
|
||||||
|
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_d"),
|
||||||
|
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_m"),
|
||||||
|
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_y")
|
||||||
|
);
|
||||||
|
</chain>
|
||||||
|
<chain name="sub_station">
|
||||||
|
THEN(
|
||||||
|
THEN(
|
||||||
|
rUploadSubStatisticalData
|
||||||
|
),
|
||||||
|
THEN(
|
||||||
|
rStatSubstation.tag("r_stat_substation_d"),
|
||||||
|
rStatSubstation.tag("r_stat_substation_m"),
|
||||||
|
rStatSubstation.tag("r_stat_substation_q"),
|
||||||
|
rStatSubstation.tag("r_stat_substation_y")
|
||||||
|
),
|
||||||
|
THEN(
|
||||||
|
rStatPollutionSubstation.tag("r_stat_pollution_substation_d"),
|
||||||
|
rStatPollutionSubstation.tag("r_stat_pollution_substation_m"),
|
||||||
|
rStatPollutionSubstation.tag("r_stat_pollution_substation_q"),
|
||||||
|
rStatPollutionSubstation.tag("r_stat_pollution_substation_y")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
</chain>
|
||||||
|
<chain name="dim_station_busbar">
|
||||||
|
THEN(
|
||||||
|
THEN(
|
||||||
|
rDimObjEvent.tag("r_dim_obj_event_d"),
|
||||||
|
rDimObjEvent.tag("r_dim_obj_event_m"),
|
||||||
|
rDimObjEvent.tag("r_dim_obj_event_y")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
</chain>
|
||||||
|
<chain name="genera_trix">
|
||||||
|
THEN(
|
||||||
|
THEN(
|
||||||
|
rBusbarVoltage.tag("r_dim_voltage_d"),
|
||||||
|
rBusbarVoltage.tag("r_dim_voltage_m"),
|
||||||
|
rBusbarVoltage.tag("r_dim_voltage_y")
|
||||||
|
),
|
||||||
|
THEN(
|
||||||
|
rStatBusbarHarmonicY
|
||||||
|
),
|
||||||
|
THEN(
|
||||||
|
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_d"),
|
||||||
|
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_m"),
|
||||||
|
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_q"),
|
||||||
|
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_y")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
</chain>
|
||||||
|
<chain name="upload_org">
|
||||||
|
THEN(
|
||||||
|
rUploadPointStatisticalData,
|
||||||
|
rUploadEvaluationData,
|
||||||
|
pqTypicalSourceCreatePOService
|
||||||
|
|
||||||
|
);
|
||||||
|
</chain>
|
||||||
|
<chain name="orgSub_station">
|
||||||
|
THEN(
|
||||||
|
THEN(
|
||||||
|
rStatSubstationVoltage.tag("r_stat_substation_voltage_m")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
</chain>
|
||||||
|
</flow>
|
||||||
25
pqs-algorithm/pom.xml
Normal file
25
pqs-algorithm/pom.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>pqs</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>algorithm-api</module>
|
||||||
|
<module>algorithm-boot</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<artifactId>pqs-algorithm</artifactId>
|
||||||
|
<description>算法模块</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -3,6 +3,7 @@ package com.njcn.bpm.controller;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||||
import com.njcn.bpm.pojo.dto.PageResult;
|
import com.njcn.bpm.pojo.dto.PageResult;
|
||||||
import com.njcn.bpm.pojo.param.task.*;
|
import com.njcn.bpm.pojo.param.task.*;
|
||||||
import com.njcn.bpm.pojo.po.BpmCategory;
|
import com.njcn.bpm.pojo.po.BpmCategory;
|
||||||
@@ -217,6 +218,24 @@ public class BpmTaskController extends BaseController {
|
|||||||
page.setTotal(bpmTaskRespVOPageResult.getTotal());
|
page.setTotal(bpmTaskRespVOPageResult.getTotal());
|
||||||
page.setSize(PageFactory.getPageSize(bpmTaskQueryParam));
|
page.setSize(PageFactory.getPageSize(bpmTaskQueryParam));
|
||||||
page.setCurrent(PageFactory.getPageNum(bpmTaskQueryParam));
|
page.setCurrent(PageFactory.getPageNum(bpmTaskQueryParam));
|
||||||
|
|
||||||
|
List<BpmTaskVO> records = page.getRecords();
|
||||||
|
for (BpmTaskVO record : records) {
|
||||||
|
if(record.getStatus().equals(BpmTaskStatusEnum.CANCEL.getStatus()) && record.getReason().equals("系统自动取消")){
|
||||||
|
record.setStatus(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||||
|
record.setReason(BpmTaskStatusEnum.APPROVE.getName());
|
||||||
|
// 找到由谁完成的
|
||||||
|
HttpResult<List<BpmTaskVO>> taskListByProcessInstanceId = this.getTaskListByProcessInstanceId(record.getProcessInstanceId());
|
||||||
|
if(CollectionUtil.isNotEmpty(taskListByProcessInstanceId.getData())){
|
||||||
|
for (BpmTaskVO datum : taskListByProcessInstanceId.getData()) {
|
||||||
|
if(datum.getStatus().equals(BpmTaskStatusEnum.APPROVE.getStatus()) && datum.getTaskDefinitionKey().equals(record.getTaskDefinitionKey())){
|
||||||
|
record.setReason("由".concat(datum.getAssigneeUser().getName()).concat("完成审批"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.njcn.user.api.UserFeignClient;
|
|||||||
import com.njcn.user.pojo.vo.UserVO;
|
import com.njcn.user.pojo.vo.UserVO;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.flowable.bpmn.model.BpmnModel;
|
import org.flowable.bpmn.model.BpmnModel;
|
||||||
import org.flowable.bpmn.model.UserTask;
|
import org.flowable.bpmn.model.UserTask;
|
||||||
import org.flowable.common.engine.impl.identity.Authentication;
|
import org.flowable.common.engine.impl.identity.Authentication;
|
||||||
@@ -108,6 +109,9 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<HistoricProcessInstance> getProcessInstancePage(String userId, BpmProcessInstancePageParam bpmProcessInstancePageParam) {
|
public PageResult<HistoricProcessInstance> getProcessInstancePage(String userId, BpmProcessInstancePageParam bpmProcessInstancePageParam) {
|
||||||
|
if (StrUtil.isNotBlank(bpmProcessInstancePageParam.getSearchValue()) && bpmProcessInstancePageParam.getSearchValue().contains("null")) {
|
||||||
|
throw new BusinessException("搜索值中不能包含null");
|
||||||
|
}
|
||||||
// 通过 BpmProcessInstanceExtDO 表,先查询到对应的分页
|
// 通过 BpmProcessInstanceExtDO 表,先查询到对应的分页
|
||||||
HistoricProcessInstanceQuery processInstanceQuery = historyService.createHistoricProcessInstanceQuery()
|
HistoricProcessInstanceQuery processInstanceQuery = historyService.createHistoricProcessInstanceQuery()
|
||||||
.includeProcessVariables()
|
.includeProcessVariables()
|
||||||
@@ -123,6 +127,9 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
|||||||
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getName())) {
|
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getName())) {
|
||||||
processInstanceQuery.processInstanceNameLike("%" + bpmProcessInstancePageParam.getName() + "%");
|
processInstanceQuery.processInstanceNameLike("%" + bpmProcessInstancePageParam.getName() + "%");
|
||||||
}
|
}
|
||||||
|
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getSearchValue())) {
|
||||||
|
processInstanceQuery.processInstanceNameLike("%" + bpmProcessInstancePageParam.getSearchValue() + "%");
|
||||||
|
}
|
||||||
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getProcessDefinitionId())) {
|
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getProcessDefinitionId())) {
|
||||||
processInstanceQuery.processDefinitionId("%" + bpmProcessInstancePageParam.getProcessDefinitionId() + "%");
|
processInstanceQuery.processDefinitionId("%" + bpmProcessInstancePageParam.getProcessDefinitionId() + "%");
|
||||||
}
|
}
|
||||||
@@ -136,13 +143,15 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
|||||||
//流程状态排除不通过的,不通过会放在待办中,一直到该流程通过
|
//流程状态排除不通过的,不通过会放在待办中,一直到该流程通过
|
||||||
processInstanceQuery.variableValueNotEquals(BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, BpmTaskStatusEnum.REJECT.getStatus());
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
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();
|
long processInstanceCount = processInstanceQuery.count();
|
||||||
if (processInstanceCount == 0) {
|
if (processInstanceCount == 0) {
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<HistoricTaskInstance> getTaskDonePage(String userId, BpmTaskParam.BpmTaskQueryParam bpmTaskQueryParam) {
|
public PageResult<HistoricTaskInstance> getTaskDonePage(String userId, BpmTaskParam.BpmTaskQueryParam bpmTaskQueryParam) {
|
||||||
|
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue()) && bpmTaskQueryParam.getSearchValue().contains("null")) {
|
||||||
|
throw new BusinessException("搜索值中不能包含null");
|
||||||
|
}
|
||||||
HistoricTaskInstanceQuery taskQuery = historyService.createHistoricTaskInstanceQuery()
|
HistoricTaskInstanceQuery taskQuery = historyService.createHistoricTaskInstanceQuery()
|
||||||
// 已完成
|
// 已完成
|
||||||
.finished()
|
.finished()
|
||||||
@@ -137,14 +140,16 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
|||||||
// 审批时间倒序
|
// 审批时间倒序
|
||||||
.orderByHistoricTaskInstanceEndTime().desc();
|
.orderByHistoricTaskInstanceEndTime().desc();
|
||||||
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue())) {
|
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue())) {
|
||||||
taskQuery.taskNameLike("%" + 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));
|
||||||
}
|
}
|
||||||
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();
|
long count = taskQuery.count();
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
|
|||||||
@@ -21,18 +21,18 @@ public class GenerateCode {
|
|||||||
|
|
||||||
private static final String TARGET_DIR = "D://code";
|
private static final String TARGET_DIR = "D://code";
|
||||||
|
|
||||||
private static final String DB_URL = "jdbc:mysql://127.0.0.1:3306/pqsinfo";
|
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 DB_URL = "jdbc:oracle:thin:@192.168.1.170:1521:pqsbase";
|
||||||
|
|
||||||
private static final String USERNAME = "root";
|
private static final String USERNAME = "root";
|
||||||
|
|
||||||
private static final String PASSWORD = "123456";
|
private static final String PASSWORD = "njcnpqs";
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
List<Module> modules = Stream.of(
|
List<Module> modules = Stream.of(
|
||||||
new Module("xy", "com.njcn.supervision", "survey", Stream.of(
|
new Module("hongawen", "com.njcn.gather", "", Stream.of(
|
||||||
"supervision_line_warning"
|
"pq_dev_type"
|
||||||
).collect(Collectors.toList()), "supervision_")
|
).collect(Collectors.toList()), "pq_")
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
generateJavaFile(modules);
|
generateJavaFile(modules);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,21 +169,41 @@ public interface PatternRegex {
|
|||||||
*/
|
*/
|
||||||
String TF_NAME_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,16}$";
|
String TF_NAME_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,16}$";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊字符正则
|
||||||
|
*/
|
||||||
|
String SPECIAL_REGEX = "[<>%'%;()&+/-\\\\_|@*?#$!,.]|html";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典类型名称
|
* 字典类型名称
|
||||||
*/
|
*/
|
||||||
String TYPE_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,100}$";
|
String TYPE_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,100}$";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述32
|
||||||
|
*/
|
||||||
|
String DES32_REGEX = "^.{0,32}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述64
|
* 描述64
|
||||||
*/
|
*/
|
||||||
String DES64_REGEX = "^.{0,64}$";
|
String DES64_REGEX = "^.{0,64}$";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述100
|
||||||
|
*/
|
||||||
|
String DES100_REGEX = "^.{0,100}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述200
|
* 描述200
|
||||||
*/
|
*/
|
||||||
String DES200_REGEX = "^.{0,200}$";
|
String DES200_REGEX = "^.{0,200}$";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述400
|
||||||
|
*/
|
||||||
|
String DES400_REGEX = "^.{0,400}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述500
|
* 描述500
|
||||||
*/
|
*/
|
||||||
@@ -214,6 +234,11 @@ public interface PatternRegex {
|
|||||||
*/
|
*/
|
||||||
String POSITIVE = "^[0-9].*$";
|
String POSITIVE = "^[0-9].*$";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大于0的数字(整数以及小数)
|
||||||
|
*/
|
||||||
|
String POSITIVEALL_NUM = "^(?:[1-9]\\d*(\\.\\d+)?)$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资源名称
|
* 资源名称
|
||||||
*/
|
*/
|
||||||
@@ -235,6 +260,8 @@ public interface PatternRegex {
|
|||||||
*/
|
*/
|
||||||
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,20}$";
|
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,20}$";
|
||||||
|
|
||||||
|
String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uuid 32位正则,数字 、 字母
|
* uuid 32位正则,数字 、 字母
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -49,5 +49,18 @@ public interface ServerInfo {
|
|||||||
|
|
||||||
String ADVANCE_BOOT = "advance-boot";
|
String ADVANCE_BOOT = "advance-boot";
|
||||||
|
|
||||||
|
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;
|
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.Max;
|
||||||
import javax.validation.constraints.Min;
|
import javax.validation.constraints.Min;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ import java.util.regex.Pattern;
|
|||||||
/**
|
/**
|
||||||
* @author yexibao
|
* @author yexibao
|
||||||
*/
|
*/
|
||||||
public class Sm4Utils
|
public class Sm4Utils {
|
||||||
{
|
|
||||||
//全局秘钥
|
//全局秘钥
|
||||||
public final static String globalSecretKey = "11HDESaAhiHHug2z";
|
public final static String globalSecretKey = "11HDESaAhiHHug2z";
|
||||||
|
|
||||||
@@ -37,26 +36,20 @@ public class Sm4Utils
|
|||||||
this.iv = iv;
|
this.iv = iv;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sm4Utils(String secretKey)
|
public Sm4Utils(String secretKey) {
|
||||||
{
|
|
||||||
this.secretKey = secretKey;
|
this.secretKey = secretKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String encryptData_ECB(String plainText)
|
public String encryptData_ECB(String plainText) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Sm4Context ctx = new Sm4Context();
|
Sm4Context ctx = new Sm4Context();
|
||||||
ctx.isPadding = true;
|
ctx.isPadding = true;
|
||||||
ctx.mode = Sm4.SM4_ENCRYPT;
|
ctx.mode = Sm4.SM4_ENCRYPT;
|
||||||
|
|
||||||
byte[] keyBytes;
|
byte[] keyBytes;
|
||||||
if (HEX_STRING)
|
if (HEX_STRING) {
|
||||||
{
|
|
||||||
keyBytes = util.hexStringToBytes(secretKey);
|
keyBytes = util.hexStringToBytes(secretKey);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
keyBytes = secretKey.getBytes();
|
keyBytes = secretKey.getBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,66 +57,59 @@ public class Sm4Utils
|
|||||||
sm4.sm4_setkey_enc(ctx, keyBytes);
|
sm4.sm4_setkey_enc(ctx, keyBytes);
|
||||||
byte[] encrypted = sm4.sm4_crypt_ecb(ctx, plainText.getBytes("GBK"));
|
byte[] encrypted = sm4.sm4_crypt_ecb(ctx, plainText.getBytes("GBK"));
|
||||||
String cipherText = new BASE64Encoder().encode(encrypted);
|
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");
|
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
|
||||||
Matcher m = p.matcher(cipherText);
|
Matcher m = p.matcher(cipherText);
|
||||||
cipherText = m.replaceAll("");
|
cipherText = m.replaceAll("");
|
||||||
}
|
}
|
||||||
return cipherText;
|
return cipherText;
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String decryptData_ECB(String cipherText)
|
public String decryptData_ECB(String cipherText) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Sm4Context ctx = new Sm4Context();
|
Sm4Context ctx = new Sm4Context();
|
||||||
ctx.isPadding = true;
|
ctx.isPadding = true;
|
||||||
ctx.mode = Sm4.SM4_DECRYPT;
|
ctx.mode = Sm4.SM4_DECRYPT;
|
||||||
|
|
||||||
byte[] keyBytes;
|
byte[] keyBytes;
|
||||||
if (HEX_STRING)
|
if (HEX_STRING) {
|
||||||
{
|
|
||||||
keyBytes = util.hexStringToBytes(secretKey);
|
keyBytes = util.hexStringToBytes(secretKey);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
keyBytes = secretKey.getBytes();
|
keyBytes = secretKey.getBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
Sm4 sm4 = new Sm4();
|
Sm4 sm4 = new Sm4();
|
||||||
sm4.sm4_setkey_dec(ctx, keyBytes);
|
sm4.sm4_setkey_dec(ctx, keyBytes);
|
||||||
byte[] decrypted = sm4.sm4_crypt_ecb(ctx, new BASE64Decoder().decodeBuffer(cipherText));
|
byte[] decrypted = sm4.sm4_crypt_ecb(ctx, new BASE64Decoder().decodeBuffer(cipherText));
|
||||||
return new String(decrypted, "GBK");
|
String tempText = new String(decrypted, "GBK");
|
||||||
}
|
String finalText = "";
|
||||||
catch (Exception e)
|
for (int i = 0; i < tempText.length(); i++) {
|
||||||
{
|
char c = tempText.charAt(i);
|
||||||
|
if ((int) c != 0) {
|
||||||
|
finalText += c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return finalText;
|
||||||
|
} catch (Exception e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String encryptData_CBC(String plainText)
|
public String encryptData_CBC(String plainText) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Sm4Context ctx = new Sm4Context();
|
Sm4Context ctx = new Sm4Context();
|
||||||
ctx.isPadding = true;
|
ctx.isPadding = true;
|
||||||
ctx.mode = Sm4.SM4_ENCRYPT;
|
ctx.mode = Sm4.SM4_ENCRYPT;
|
||||||
|
|
||||||
byte[] keyBytes;
|
byte[] keyBytes;
|
||||||
byte[] ivBytes;
|
byte[] ivBytes;
|
||||||
if (HEX_STRING)
|
if (HEX_STRING) {
|
||||||
{
|
|
||||||
keyBytes = util.hexStringToBytes(secretKey);
|
keyBytes = util.hexStringToBytes(secretKey);
|
||||||
ivBytes = util.hexStringToBytes(iv);
|
ivBytes = util.hexStringToBytes(iv);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
keyBytes = secretKey.getBytes();
|
keyBytes = secretKey.getBytes();
|
||||||
ivBytes = iv.getBytes();
|
ivBytes = iv.getBytes();
|
||||||
}
|
}
|
||||||
@@ -132,37 +118,29 @@ public class Sm4Utils
|
|||||||
sm4.sm4_setkey_enc(ctx, keyBytes);
|
sm4.sm4_setkey_enc(ctx, keyBytes);
|
||||||
byte[] encrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, plainText.getBytes("GBK"));
|
byte[] encrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, plainText.getBytes("GBK"));
|
||||||
String cipherText = new BASE64Encoder().encode(encrypted);
|
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");
|
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
|
||||||
Matcher m = p.matcher(cipherText);
|
Matcher m = p.matcher(cipherText);
|
||||||
cipherText = m.replaceAll("");
|
cipherText = m.replaceAll("");
|
||||||
}
|
}
|
||||||
return cipherText;
|
return cipherText;
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String decryptData_CBC(String cipherText)
|
public String decryptData_CBC(String cipherText) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Sm4Context ctx = new Sm4Context();
|
Sm4Context ctx = new Sm4Context();
|
||||||
ctx.isPadding = true;
|
ctx.isPadding = true;
|
||||||
ctx.mode = Sm4.SM4_DECRYPT;
|
ctx.mode = Sm4.SM4_DECRYPT;
|
||||||
|
|
||||||
byte[] keyBytes;
|
byte[] keyBytes;
|
||||||
byte[] ivBytes;
|
byte[] ivBytes;
|
||||||
if (HEX_STRING)
|
if (HEX_STRING) {
|
||||||
{
|
|
||||||
keyBytes = util.hexStringToBytes(secretKey);
|
keyBytes = util.hexStringToBytes(secretKey);
|
||||||
ivBytes = util.hexStringToBytes(iv);
|
ivBytes = util.hexStringToBytes(iv);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
keyBytes = secretKey.getBytes();
|
keyBytes = secretKey.getBytes();
|
||||||
ivBytes = iv.getBytes();
|
ivBytes = iv.getBytes();
|
||||||
}
|
}
|
||||||
@@ -171,23 +149,23 @@ public class Sm4Utils
|
|||||||
sm4.sm4_setkey_dec(ctx, keyBytes);
|
sm4.sm4_setkey_dec(ctx, keyBytes);
|
||||||
byte[] decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, new BASE64Decoder().decodeBuffer(cipherText));
|
byte[] decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, new BASE64Decoder().decodeBuffer(cipherText));
|
||||||
return new String(decrypted, "GBK");
|
return new String(decrypted, "GBK");
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException
|
public static void main(String[] args) throws IOException {
|
||||||
{
|
String plainText = "@#001njcnpqs";
|
||||||
String plainText ="@#001njcnpqs";
|
|
||||||
//11HDESaAhiHHugDz
|
//11HDESaAhiHHugDz
|
||||||
String secretKey = "11HDESaAhiHHug2z";
|
String secretKey = "11HDESaAhiHHug2z";
|
||||||
Sm4Utils sm4 = new Sm4Utils(secretKey);
|
Sm4Utils sm4 = new Sm4Utils(secretKey);
|
||||||
|
|
||||||
String cipherText = sm4.encryptData_ECB(plainText);
|
String cipherText = sm4.encryptData_ECB(plainText);
|
||||||
|
System.out.println("加密后:" + cipherText);
|
||||||
String cipherText1 = sm4.decryptData_ECB(cipherText);
|
String cipherText1 = sm4.decryptData_ECB(cipherText);
|
||||||
cipherText = cipherText + "11HDESaAhiHHug2z";
|
System.out.println("解密后:" + cipherText1);
|
||||||
|
|
||||||
|
cipherText = cipherText + "11HDESaAhiHHug2z";
|
||||||
sm4.setSecretKey("11HDESaAhiHHug2z");
|
sm4.setSecretKey("11HDESaAhiHHug2z");
|
||||||
cipherText = sm4.encryptData_ECB(cipherText);
|
cipherText = sm4.encryptData_ECB(cipherText);
|
||||||
plainText = sm4.decryptData_ECB(cipherText);
|
plainText = sm4.decryptData_ECB(cipherText);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.echarts.json.LineGenerator;
|
|||||||
import com.njcn.echarts.json.PieGenerator;
|
import com.njcn.echarts.json.PieGenerator;
|
||||||
import com.njcn.web.utils.RestTemplateUtil;
|
import com.njcn.web.utils.RestTemplateUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
@@ -23,7 +24,8 @@ import java.util.*;
|
|||||||
public class DrawPicUtil {
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -400,41 +400,44 @@ public class ExcelUtil {
|
|||||||
* @param pullDowns
|
* @param pullDowns
|
||||||
*/
|
*/
|
||||||
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
||||||
int num = 0;
|
if(CollUtil.isNotEmpty(pullDowns)){
|
||||||
for (PullDown pullDown : pullDowns) {
|
int num = 0;
|
||||||
if (!pullDown.getIsText()) {
|
for (PullDown pullDown : pullDowns) {
|
||||||
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
if (!pullDown.getIsText()) {
|
||||||
if (sum == 0) {
|
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
||||||
continue;
|
if (sum == 0) {
|
||||||
}
|
continue;
|
||||||
if (sum > 255) {
|
}
|
||||||
// 创建隐藏sheet
|
if (sum > 255) {
|
||||||
String hiddenSheetName = "hiddenSheetA";
|
// 创建隐藏sheet
|
||||||
if (num == 0) {
|
String hiddenSheetName = "hiddenSheetA";
|
||||||
workbook.createSheet(hiddenSheetName);
|
if (num == 0) {
|
||||||
}
|
workbook.createSheet(hiddenSheetName);
|
||||||
//false展示隐藏sheet ,true不展示隐藏sheet
|
}
|
||||||
workbook.setSheetHidden(workbook.getSheetIndex(workbook.getSheet(hiddenSheetName)), true);
|
//false展示隐藏sheet ,true不展示隐藏sheet
|
||||||
Sheet sheet = workbook.getSheet(hiddenSheetName);
|
workbook.setSheetHidden(workbook.getSheetIndex(workbook.getSheet(hiddenSheetName)), true);
|
||||||
if (num == 0) {
|
Sheet sheet = workbook.getSheet(hiddenSheetName);
|
||||||
//sheet.getLastRowNum无法区分 有一行和没有 所以这里先建一行
|
if (num == 0) {
|
||||||
sheet.createRow(0);
|
//sheet.getLastRowNum无法区分 有一行和没有 所以这里先建一行
|
||||||
}
|
sheet.createRow(0);
|
||||||
Row row; //创建数据行
|
}
|
||||||
sheet.setColumnWidth(num, 4000); //设置每列的列宽
|
Row row; //创建数据行
|
||||||
for (int j = 0; j < pullDown.getStrings().size(); j++) {
|
sheet.setColumnWidth(num, 4000); //设置每列的列宽
|
||||||
if (sheet.getLastRowNum() < j) {
|
for (int j = 0; j < pullDown.getStrings().size(); j++) {
|
||||||
row = sheet.createRow(j); //创建数据行
|
if (sheet.getLastRowNum() < j) {
|
||||||
} else {
|
row = sheet.createRow(j); //创建数据行
|
||||||
row = sheet.getRow(j);
|
} else {
|
||||||
}
|
row = sheet.getRow(j);
|
||||||
//设置对应单元格的值
|
}
|
||||||
row.createCell(num).setCellValue(pullDown.getStrings().get(j));
|
//设置对应单元格的值
|
||||||
}
|
row.createCell(num).setCellValue(pullDown.getStrings().get(j));
|
||||||
num++;
|
}
|
||||||
}
|
num++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -110,4 +110,9 @@ public interface AppRedisKey {
|
|||||||
* 模板
|
* 模板
|
||||||
*/
|
*/
|
||||||
String DEV_MODEL = "devModelKey:";
|
String DEV_MODEL = "devModelKey:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补召文件
|
||||||
|
*/
|
||||||
|
String MAKE_UP_FILES = "makeUpFilesKey:";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,9 @@ public class Knife4jSwaggerConfig {
|
|||||||
"com.njcn.cloud.controller",
|
"com.njcn.cloud.controller",
|
||||||
"com.njcn.zlevent.controller",
|
"com.njcn.zlevent.controller",
|
||||||
"com.njcn.prepare",
|
"com.njcn.prepare",
|
||||||
"com.njcn.supervision.controller"
|
"com.njcn.supervision.controller",
|
||||||
|
"com.njcn.algorithm",
|
||||||
|
"com.njcn.dataProcess"
|
||||||
)
|
)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<GrantType> grantTypes = new ArrayList<>();
|
List<GrantType> grantTypes = new ArrayList<>();
|
||||||
|
|||||||
@@ -7,10 +7,8 @@ package com.njcn.web.constant;
|
|||||||
*/
|
*/
|
||||||
public interface ValidMessage {
|
public interface ValidMessage {
|
||||||
|
|
||||||
|
|
||||||
String MISS_PREFIX="字段不能为空,请检查";
|
String MISS_PREFIX="字段不能为空,请检查";
|
||||||
|
|
||||||
|
|
||||||
String ID_NOT_BLANK = "id不能为空,请检查id参数";
|
String ID_NOT_BLANK = "id不能为空,请检查id参数";
|
||||||
|
|
||||||
String ID_FORMAT_ERROR = "id格式错误,请检查id参数";
|
String ID_FORMAT_ERROR = "id格式错误,请检查id参数";
|
||||||
@@ -69,4 +67,11 @@ public interface ValidMessage {
|
|||||||
|
|
||||||
String DEVICE_VERSION_NOT_BLANK = "装置版本json文件不能为空,请检查deviceVersionFile参数";
|
String DEVICE_VERSION_NOT_BLANK = "装置版本json文件不能为空,请检查deviceVersionFile参数";
|
||||||
|
|
||||||
|
String SEARCH_DATA_ERROR = "搜索值过长,请检查搜索参数";
|
||||||
|
String SPECIAL_REGEX = "搜索值包含特殊字符";
|
||||||
|
|
||||||
|
String NAME_SPECIAL_REGEX = "包含特殊字符";
|
||||||
|
|
||||||
|
String DATA_TOO_LONG = "参数过长,请检查参数";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ public enum GWSendEnum {
|
|||||||
TEMP_USER_CREATE("tempUserCreate","/powerQuality/process/tempUserCreate"),
|
TEMP_USER_CREATE("tempUserCreate","/powerQuality/process/tempUserCreate"),
|
||||||
TEMP_PROCESS_TRACK_CREATE("tempProcessTrackCreate","/powerQuality/process/processFollowCreate"),
|
TEMP_PROCESS_TRACK_CREATE("tempProcessTrackCreate","/powerQuality/process/processFollowCreate"),
|
||||||
MONTH_REPORT_CREATE("monthReportCreate","/powerQuality/process/monthReportCreate"),
|
MONTH_REPORT_CREATE("monthReportCreate","/powerQuality/process/monthReportCreate"),
|
||||||
PROCESS_APPROVAL_CREATE("processApprovalCreate","powerQuality/process/processApprovalCreate")
|
PROCESS_APPROVAL_CREATE("processApprovalCreate","powerQuality/process/processApprovalCreate"),
|
||||||
|
PROCESS_TEST_RUN_CREATE("processTestRunCreate","powerQuality/process/processTestRunCreate")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.njcn.web.pojo.param;
|
package com.njcn.web.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,6 +19,7 @@ public class BaseParam implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty("搜索值")
|
@ApiModelProperty("搜索值")
|
||||||
|
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.SEARCH_DATA_ERROR)
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|
||||||
@ApiModelProperty("开始时间")
|
@ApiModelProperty("开始时间")
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class GwSendUtil {
|
|||||||
cb = new ContentBody("");
|
cb = new ContentBody("");
|
||||||
} else {
|
} else {
|
||||||
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
|
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
|
||||||
log.info(Thread.currentThread().getName() + "1.信息:" + s);
|
log.info(Thread.currentThread().getName() + "1.上送网公司信息:" + s);
|
||||||
cb = new ContentBody(s);
|
cb = new ContentBody(s);
|
||||||
}
|
}
|
||||||
//ContentBody传递,要求使用post方式进行调用
|
//ContentBody传递,要求使用post方式进行调用
|
||||||
@@ -148,6 +148,7 @@ public class GwSendUtil {
|
|||||||
try {
|
try {
|
||||||
HttpReturn ret = HttpCaller.invokeReturn(builder.build());
|
HttpReturn ret = HttpCaller.invokeReturn(builder.build());
|
||||||
String responseStr = ret.getResponseStr();//获取响应的文本串
|
String responseStr = ret.getResponseStr();//获取响应的文本串
|
||||||
|
System.out.println("获取响应的文本串:"+responseStr);
|
||||||
if (responseStr.indexOf("\\\"") != -1) {
|
if (responseStr.indexOf("\\\"") != -1) {
|
||||||
responseStr = responseStr.replace("\\\"", "\"");
|
responseStr = responseStr.replace("\\\"", "\"");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -632,5 +632,42 @@ public class RestTemplateUtil {
|
|||||||
return restTemplate;
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,8 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.device.biz.commApi.fallback.CommLineClientFallbackFactory;
|
import com.njcn.device.biz.commApi.fallback.CommLineClientFallbackFactory;
|
||||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
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.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -35,6 +37,14 @@ public interface CommLineClient {
|
|||||||
@GetMapping("/getLineDetail")
|
@GetMapping("/getLineDetail")
|
||||||
HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id);
|
HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取污区值监测点相关信息
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
*/
|
||||||
|
@GetMapping("/getPollutionLineInfo")
|
||||||
|
HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(@RequestParam("id") List<String> id);
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 批量获取监测点信息
|
* 批量获取监测点信息
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -52,4 +62,8 @@ public interface CommLineClient {
|
|||||||
|
|
||||||
@GetMapping("/getLineAllDetailList")
|
@GetMapping("/getLineAllDetailList")
|
||||||
HttpResult<List<LineALLInfoDTO>> getLineAllDetailList(@RequestParam("ids") List<String> ids);
|
HttpResult<List<LineALLInfoDTO>> getLineAllDetailList(@RequestParam("ids") List<String> ids);
|
||||||
|
|
||||||
|
@PostMapping("/getLineInfo")
|
||||||
|
HttpResult<List<PollutionLineDTO>> getLineInfo(@RequestBody List<String> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.device.biz.commApi.CommLineClient;
|
import com.njcn.device.biz.commApi.CommLineClient;
|
||||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
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 com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -38,6 +40,12 @@ public class CommLineClientFallbackFactory implements FallbackFactory<CommLineCl
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(List<String> id) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取污区值监测点相关信息", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<LineDTO>> getLineDetailBatch(List<String> ids) {
|
public HttpResult<List<LineDTO>> getLineDetailBatch(List<String> ids) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "批量获取监测点信息", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "批量获取监测点信息", throwable.toString());
|
||||||
@@ -56,6 +64,12 @@ public class CommLineClientFallbackFactory implements FallbackFactory<CommLineCl
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<PollutionLineDTO>> getLineInfo(List<String> ids) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取监测点列表信息", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.njcn.device.pq.pojo.dto;
|
package com.njcn.device.biz.pojo.dto;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,12 +1,5 @@
|
|||||||
FROM eclipse-temurin:8-jdk-centos7
|
FROM openjdk:8-jdk-alpine
|
||||||
MAINTAINER hongawen_13914774158@163.com
|
|
||||||
ENV JAVA_OPTS="-Xms1024m -Xmx1024m"
|
|
||||||
# 挂载时区的目录
|
|
||||||
VOLUME /usr/share/zoneinfo
|
|
||||||
# 设置时区为上海
|
|
||||||
ENV TZ=Asia/Shanghai
|
|
||||||
# 设置时区信息
|
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
||||||
ADD target/deviceboot.jar deviceboot.jar
|
ADD target/deviceboot.jar deviceboot.jar
|
||||||
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /deviceboot.jar
|
ENTRYPOINT ["/bin/sh", "-c" , "echo 25.36.214.50 dwzyywzt-pms3-proxy.com >> /etc/hosts && echo 25.36.227.20 pms.pms30.com.cn >> /etc/hosts && echo 25.36.181.69 8d051549520e423ab8dccf8b3d457c74.apigw.he-region-2.sgic.sgcc.com.cn >> /etc/hosts && exec java -jar deviceboot.jar" ]
|
||||||
EXPOSE 10202
|
EXPOSE 10202
|
||||||
|
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||||
@@ -3,6 +3,7 @@ package com.njcn.device.pms.pojo.dto;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,7 +29,7 @@ public class PushMonitorDTO {
|
|||||||
private String customName;
|
private String customName;
|
||||||
private String status;
|
private String status;
|
||||||
private Date ctime;
|
private Date ctime;
|
||||||
private Date updateTime;
|
private LocalDateTime updateTime;
|
||||||
private String lineId;
|
private String lineId;
|
||||||
private String chv;
|
private String chv;
|
||||||
private String chi;
|
private String chi;
|
||||||
|
|||||||
@@ -86,49 +86,49 @@ public class PowerClientParam {
|
|||||||
* 合同容量
|
* 合同容量
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "合同容量",required = true)
|
@ApiModelProperty(value = "合同容量",required = true)
|
||||||
@NotNull(message = "合同容量不可为空")
|
//@NotNull(message = "合同容量不可为空")
|
||||||
private Float contractCapacity;
|
private Float contractCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运行容量
|
* 运行容量
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "运行容量",required = true)
|
@ApiModelProperty(value = "运行容量",required = true)
|
||||||
@NotNull(message = "运行容量不可为空")
|
//@NotNull(message = "运行容量不可为空")
|
||||||
private Float operatingCapacity;
|
private Float operatingCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生产班次(字典)
|
* 生产班次(字典)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "生产班次(字典)",required = true)
|
@ApiModelProperty(value = "生产班次(字典)",required = true)
|
||||||
@NotBlank(message = "生产班次不可为空")
|
//@NotBlank(message = "生产班次不可为空")
|
||||||
private String productionShift;
|
private String productionShift;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 负荷性质(字典)
|
* 负荷性质(字典)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "负荷性质(字典)",required = true)
|
@ApiModelProperty(value = "负荷性质(字典)",required = true)
|
||||||
@NotBlank(message = "负荷性质不可为空")
|
//@NotBlank(message = "负荷性质不可为空")
|
||||||
private String loadNature;
|
private String loadNature;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供电电压(字典)
|
* 供电电压(字典)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "供电电压(字典)",required = true)
|
@ApiModelProperty(value = "供电电压(字典)",required = true)
|
||||||
@NotBlank(message = "供电电压不可为空")
|
//@NotBlank(message = "供电电压不可为空")
|
||||||
private String voltageLevel;
|
private String voltageLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高耗能行业类别(字典)
|
* 高耗能行业类别(字典)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "高耗能行业类别(字典)",required = true)
|
@ApiModelProperty(value = "高耗能行业类别(字典)",required = true)
|
||||||
@NotBlank(message = "高耗能行业类别不可为空")
|
//@NotBlank(message = "高耗能行业类别不可为空")
|
||||||
private String highIndustryType;
|
private String highIndustryType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 送电日期
|
* 送电日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "送电日期",required = true)
|
@ApiModelProperty(value = "送电日期",required = true)
|
||||||
@NotNull(message = "送电日期不可为空")
|
//@NotNull(message = "送电日期不可为空")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDate powerTransmissionDate;
|
private LocalDate powerTransmissionDate;
|
||||||
|
|
||||||
@@ -136,42 +136,42 @@ public class PowerClientParam {
|
|||||||
* 重要性等级(字典)
|
* 重要性等级(字典)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "重要性等级",required = true)
|
@ApiModelProperty(value = "重要性等级",required = true)
|
||||||
@NotBlank(message = "重要性等级不可为空")
|
//@NotBlank(message = "重要性等级不可为空")
|
||||||
private String importanceLevel;
|
private String importanceLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用电客户状态(字典)
|
* 用电客户状态(字典)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "用电客户状态",required = true)
|
@ApiModelProperty(value = "用电客户状态",required = true)
|
||||||
@NotBlank(message = "用电客户状态不可为空")
|
//@NotBlank(message = "用电客户状态不可为空")
|
||||||
private String eccStat;
|
private String eccStat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否敏感用户:0-否;1:是;
|
* 是否敏感用户:0-否;1:是;
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "是否敏感用户",required = true)
|
@ApiModelProperty(value = "是否敏感用户",required = true)
|
||||||
@NotNull(message = "用户编号不可为空")
|
//@NotNull(message = "用户编号不可为空")
|
||||||
private Integer ifSensitiveUser;
|
private Integer ifSensitiveUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否影响电能质量:0-否;1:是;
|
* 是否影响电能质量:0-否;1:是;
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "是否影响电能质量:0-否;1:是;",required = true)
|
@ApiModelProperty(value = "是否影响电能质量:0-否;1:是;",required = true)
|
||||||
@NotNull(message = "是否影响电能质量不可为空")
|
//@NotNull(message = "是否影响电能质量不可为空")
|
||||||
private Integer ifPowerQuality;
|
private Integer ifPowerQuality;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否重要客户:0-否;1:是;
|
* 是否重要客户:0-否;1:是;
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "是否重要客户:0-否;1:是;",required = true)
|
@ApiModelProperty(value = "是否重要客户:0-否;1:是;",required = true)
|
||||||
@NotNull(message = "是否重要客户不可为空")
|
//@NotNull(message = "是否重要客户不可为空")
|
||||||
private Integer ifKeyCustomers;
|
private Integer ifKeyCustomers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 敏感用户类别(字典)
|
* 敏感用户类别(字典)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "敏感用户类别",required = true)
|
@ApiModelProperty(value = "敏感用户类别",required = true)
|
||||||
@NotBlank(message = "敏感用户类别不可为空")
|
//@NotBlank(message = "敏感用户类别不可为空")
|
||||||
private String sensitiveType;
|
private String sensitiveType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ public class TerminalQueryParam extends BaseParam {
|
|||||||
@ApiModelProperty(value = "监测对象类型")
|
@ApiModelProperty(value = "监测对象类型")
|
||||||
private String objType;
|
private String objType;
|
||||||
|
|
||||||
|
private List<String> objTypeList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否上送国网监测点")
|
@ApiModelProperty(value = "是否上送国网监测点")
|
||||||
private Integer isUpToGrid;
|
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.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
@@ -72,16 +75,34 @@ public class Monitor extends BaseEntity {
|
|||||||
private String lineName;
|
private String lineName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测线路ID
|
* 监测母线
|
||||||
*/
|
*/
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测线路号
|
||||||
|
*/
|
||||||
|
private Integer lineNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate putDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中台母线ID
|
* 中台母线ID
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String busId;
|
private String busId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中台母线ID
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String midStation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压等级(字典)
|
* 电压等级(字典)
|
||||||
*/
|
*/
|
||||||
@@ -190,7 +211,6 @@ public class Monitor extends BaseEntity {
|
|||||||
* 监测终端接线方式(字典)
|
* 监测终端接线方式(字典)
|
||||||
*/
|
*/
|
||||||
private String terminalWiringMethod;
|
private String terminalWiringMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是上送国网监测点,0-否 1-是
|
* 是否是上送国网监测点,0-否 1-是
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.njcn.device.pms.pojo.po;
|
package com.njcn.device.pms.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -70,66 +72,79 @@ public class PowerClient extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 合同容量
|
* 合同容量
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private Float contractCapacity;
|
private Float contractCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运行容量
|
* 运行容量
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private Float operatingCapacity;
|
private Float operatingCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生产班次(字典)
|
* 生产班次(字典)
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String productionShift;
|
private String productionShift;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 负荷性质(字典)
|
* 负荷性质(字典)
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String loadNature;
|
private String loadNature;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供电电压(字典)
|
* 供电电压(字典)
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String voltageLevel;
|
private String voltageLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高耗能行业类别(字典)
|
* 高耗能行业类别(字典)
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String highIndustryType;
|
private String highIndustryType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 送电日期
|
* 送电日期
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private LocalDate powerTransmissionDate;
|
private LocalDate powerTransmissionDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重要性等级(字典)
|
* 重要性等级(字典)
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String importanceLevel;
|
private String importanceLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用电客户状态(字典)
|
* 用电客户状态(字典)
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String eccStat;
|
private String eccStat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否敏感用户:0-否;1:是;
|
* 是否敏感用户:0-否;1:是;
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private Integer ifSensitiveUser;
|
private Integer ifSensitiveUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否影响电能质量:0-否;1:是;
|
* 是否影响电能质量:0-否;1:是;
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private Integer ifPowerQuality;
|
private Integer ifPowerQuality;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否重要客户:0-否;1:是;
|
* 是否重要客户:0-否;1:是;
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private Integer ifKeyCustomers;
|
private Integer ifKeyCustomers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 敏感用户类别(字典)
|
* 敏感用户类别(字典)
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String sensitiveType;
|
private String sensitiveType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,6 +165,7 @@ public class PowerClient extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 用户标签
|
* 用户标签
|
||||||
*/
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String userTag;
|
private String userTag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class MonitorSendController extends BaseController {
|
|||||||
@ApiOperation("国网上送接口")
|
@ApiOperation("国网上送接口")
|
||||||
@ApiImplicitParam(name = "param",value = "请求体",required = true)
|
@ApiImplicitParam(name = "param",value = "请求体",required = true)
|
||||||
public HttpResult<String> windSend(@RequestBody @Validated MonitorParam.Info param){
|
public HttpResult<String> windSend(@RequestBody @Validated MonitorParam.Info param){
|
||||||
String methodDescribe = getMethodDescribe("sendType");
|
String methodDescribe = getMethodDescribe("windSend");
|
||||||
String s = monitorSendService.sendType(param);
|
String s = monitorSendService.sendType(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,10 +28,19 @@ public class MonitorStatisticsController extends BaseController {
|
|||||||
|
|
||||||
@PostMapping("/objType")
|
@PostMapping("/objType")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiOperation("国网上送接口")
|
@ApiOperation("查询主网用户分类")
|
||||||
public HttpResult< List<List<String>>> objType(String deptId){
|
public HttpResult< List<List<String>>> objType(String deptId,Integer up){
|
||||||
String methodDescribe = getMethodDescribe("objType");
|
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);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gwMonitorStatistics, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||||
|
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -58,4 +59,15 @@ public class CommLineController extends BaseController {
|
|||||||
List<LineDTO> result = monitorService.getLineDetailBatch(ids);
|
List<LineDTO> result = monitorService.getLineDetailBatch(ids);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getLineInfo")
|
||||||
|
@ApiOperation("获取监测点信息")
|
||||||
|
public HttpResult<List<PollutionLineDTO>> getLineInfo(@RequestBody List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("getLineInfo");
|
||||||
|
List<PollutionLineDTO> result = monitorService.getLineInfo(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,22 @@ public class PmsMonitorController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
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
|
* @author cdf
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.njcn.common.utils.LogUtil;
|
|||||||
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
||||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
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.po.PowerDistributionarea;
|
||||||
import com.njcn.device.pms.pojo.vo.PVCapacity;
|
import com.njcn.device.pms.pojo.vo.PVCapacity;
|
||||||
import com.njcn.device.pms.service.majornetwork.IPowerDistributionareaService;
|
import com.njcn.device.pms.service.majornetwork.IPowerDistributionareaService;
|
||||||
@@ -58,7 +59,7 @@ public class PmsPowerDistributionareaController extends BaseController {
|
|||||||
@PostMapping("getPowerDistributionAreaList")
|
@PostMapping("getPowerDistributionAreaList")
|
||||||
@ApiOperation("分页查询台区所有信息")
|
@ApiOperation("分页查询台区所有信息")
|
||||||
@ApiImplicitParam(name = "baseParam",value = "查询台区信息",required = true)
|
@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");
|
String methodDescribe = getMethodDescribe("getList");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
|
||||||
Page<PowerDistributionarea> res = iPowerDistributionareaService.getList(baseParam);
|
Page<PowerDistributionarea> res = iPowerDistributionareaService.getList(baseParam);
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class PmsStatationStatController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
||||||
})
|
})
|
||||||
public HttpResult<List<StatationStat>> getPowerInfo(@RequestBody PmsStatationStatInfoParam param) {
|
public HttpResult<List<StatationStat>> getPowerInfo(@RequestBody PmsStatationStatInfoParam param) {
|
||||||
String methodDescribe = getMethodDescribe("getStatationStatInfo");
|
String methodDescribe = getMethodDescribe("getPowerInfo");
|
||||||
List<StatationStat> powerInfo = statationStatService.getPowerInfo(param);
|
List<StatationStat> powerInfo = statationStatService.getPowerInfo(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, powerInfo, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, powerInfo, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.device.pms.pojo.po.StatationStat;
|
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||||
import com.njcn.device.pms.pojo.vo.StatationStatVO;
|
import com.njcn.device.pms.pojo.vo.StatationStatVO;
|
||||||
import com.njcn.device.pms.service.majornetwork.IStatationStatService;
|
import com.njcn.device.pms.service.majornetwork.IStatationStatService;
|
||||||
import com.njcn.device.pq.pojo.dto.PollutionLineDTO;
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -19,7 +18,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import retrofit2.http.GET;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
monitor.Org_Id AS orgId,
|
monitor.Org_Id AS orgId,
|
||||||
monitor.Org_Name AS orgName,
|
monitor.Org_Name AS orgName,
|
||||||
monitor.Powerr_Id AS powerId,
|
monitor.`Powerr_Id` AS powerId,
|
||||||
monitor.Powerr_Name AS powerName,
|
monitor.`Powerr_Name` AS powerName,
|
||||||
monitor.id AS monitorId,
|
monitor.id AS monitorId,
|
||||||
monitor.Name AS monitorName,
|
monitor.`Name` AS monitorName,
|
||||||
monitor.Line_Id,
|
monitor.Line_Id,
|
||||||
monitor.Line_Name,
|
monitor.Line_Name,
|
||||||
pdm.Monitor_Sort AS monitorSort,
|
pdm.Monitor_Sort AS monitorSort,
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
pdm.Update_By AS updateBy,
|
pdm.Update_By AS updateBy,
|
||||||
pdm.Update_Time AS updateTime
|
pdm.Update_Time AS updateTime
|
||||||
FROM
|
FROM
|
||||||
((
|
(
|
||||||
SELECT
|
SELECT
|
||||||
pm.id,
|
pm.id,
|
||||||
pm.Name,
|
pm.`Name`,
|
||||||
pm.Status,
|
pm.`Status`,
|
||||||
pm.Org_Id,
|
pm.Org_Id,
|
||||||
pm.Org_Name,
|
pm.Org_Name,
|
||||||
pm.Powerr_Id,
|
pm.Powerr_Id,
|
||||||
@@ -48,57 +48,11 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
) UNION ALL
|
) AS monitor
|
||||||
(
|
|
||||||
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
|
|
||||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||||
WHERE
|
WHERE
|
||||||
monitor.Status = 1
|
monitor.`Status` = 1
|
||||||
AND pdm.Status = 1
|
AND pdm.`Status` = 1
|
||||||
AND monitor.Org_Id IN
|
AND monitor.Org_Id IN
|
||||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||||
#{orgId}
|
#{orgId}
|
||||||
@@ -131,9 +85,10 @@
|
|||||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||||
</if>
|
</if>
|
||||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
monitor.Org_Id AS orgId,
|
monitor.Org_Id AS orgId,
|
||||||
@@ -176,27 +131,12 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</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 pm.id = pdm.Monitor_Id
|
||||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
|
||||||
WHERE
|
WHERE
|
||||||
monitor.Status = 1
|
pm.Status = 1
|
||||||
AND pdm.Status = 1
|
AND pdm.Status = 1
|
||||||
AND monitor.Org_Id IN
|
AND pm.Org_Id IN
|
||||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||||
#{orgId}
|
#{orgId}
|
||||||
</foreach>
|
</foreach>
|
||||||
@@ -228,7 +168,7 @@
|
|||||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||||
</if>
|
</if>
|
||||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
AND pm.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
package com.njcn.device.pms.mapper.majornetwork;
|
package com.njcn.device.pms.mapper.majornetwork;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
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.dto.SimpleDTO;
|
||||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
import com.njcn.device.pms.pojo.param.*;
|
||||||
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.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -108,4 +106,13 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
|||||||
|
|
||||||
List<Monitor> selectMonitorAndNewEnergy(@Param("orgIds")List<String> orgIds,
|
List<Monitor> selectMonitorAndNewEnergy(@Param("orgIds")List<String> orgIds,
|
||||||
@Param("objIds")List<String> objIds);
|
@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>
|
</where>
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@@ -19,7 +19,15 @@ public interface MonitorStatisticsService {
|
|||||||
* @Author: wr
|
* @Author: wr
|
||||||
* @Date: 2024/3/22 9:49
|
* @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: 国网上送新能源场站统计
|
* @Description: 国网上送新能源场站统计
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user