Compare commits
142 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ed10b12e79 | |||
| fbd15ca353 | |||
| 2c79cc72c9 | |||
| 69157a138b | |||
|
|
3377bcf488 | ||
|
|
e93f8b4da8 | ||
|
|
e13b1f156e | ||
|
|
ee1f36617d | ||
|
|
9534882845 | ||
| 5d28504f20 | |||
| 7559b94959 | |||
| 14b072b5e7 | |||
| 0a121a3cf5 | |||
| 476993db15 | |||
|
|
cccc7953ed | ||
|
|
aa0982fb81 | ||
| 07e481bc11 | |||
|
|
b766e77c42 | ||
| cbf310a5a1 | |||
| 49dd915e27 | |||
| ed145dd7ff | |||
| 00fd701122 | |||
| 6236243284 | |||
| 6dc1b415dc | |||
|
|
f4fd509d12 | ||
|
|
6e8a188172 | ||
|
|
ceb95be340 | ||
|
|
21f4466580 | ||
| e50f587bb8 | |||
| 7727e9e2bf | |||
|
|
043b8f9a71 | ||
|
|
af058896dc | ||
|
|
957af09daa | ||
| d28a8f8fb1 | |||
|
|
f27a107bba | ||
|
|
bddd1efef3 | ||
|
|
003880619e | ||
|
|
053183cdd0 | ||
| c2af7e708c | |||
|
|
f36b3f9ee9 | ||
|
|
25ee513246 | ||
| 9e23373878 | |||
|
|
971ae03dcf | ||
|
|
68c0b72710 | ||
|
|
8bc94ea9a8 | ||
|
|
b30ad02ac1 | ||
| f22748ef8f | |||
|
|
813af67b9b | ||
|
|
758964d9a8 | ||
| 360a73c04e | |||
|
|
dbf43633ff | ||
| 1ed56bbac1 | |||
| 7c943244b3 | |||
| a492609b36 | |||
| 1f18c71eb7 | |||
| 2319895ff4 | |||
| a6f9e30d54 | |||
|
|
4cff5e90a2 | ||
| 88f7efbc86 | |||
| 1d41b1af12 | |||
|
|
3b5442ecf5 | ||
| 3ec984752f | |||
|
|
99021d3c9c | ||
| b608aab3bd | |||
| f54ce5ae3c | |||
|
|
3a589962a5 | ||
|
|
e54df08dca | ||
| 055c762415 | |||
|
|
cdbb4fe428 | ||
|
|
d972bbef80 | ||
| 1d664fee19 | |||
| eb10a16799 | |||
| 6e85a72b7d | |||
| 59b56a39dc | |||
| da387cc39d | |||
|
|
9d4215afb5 | ||
| 35e3d098a9 | |||
| 61bbbed153 | |||
| 0fe103d01e | |||
| d64b15a8e6 | |||
| 3ed732affd | |||
| 128925a5d6 | |||
| 311b2844ba | |||
| 7dc2cde6ed | |||
|
|
8b1074c172 | ||
|
|
67ad03ddbe | ||
| 24e937e331 | |||
| 89ece63f2e | |||
| 1e79bbdcb0 | |||
| ec051827ac | |||
| 6fa63a7f3e | |||
| a9aa0785da | |||
| 23e7288609 | |||
|
|
a573c17886 | ||
| be8edfd4cf | |||
| 30b4f03f6b | |||
|
|
ee41b0a554 | ||
| 458b2347ed | |||
|
|
c1bfc2347f | ||
| eba02ffcf3 | |||
| 2921145336 | |||
|
|
9de6981cd5 | ||
| fb58b13c91 | |||
|
|
e12e5d90c8 | ||
|
|
075205d4b9 | ||
| 1af8fcc72f | |||
|
|
6ec0ef54e9 | ||
| fd23719a41 | |||
| 306200791a | |||
| e6a1874abf | |||
|
|
8502421b91 | ||
|
|
50cd5d3895 | ||
| 5ca027513f | |||
|
|
87c60206f0 | ||
| dbee4ca31d | |||
|
|
f26ec7003e | ||
| 467906b686 | |||
|
|
b146da4867 | ||
|
|
80dceeb0be | ||
| 8d6ba4afe3 | |||
| ae2207bd97 | |||
| 16e90de9eb | |||
| 5c36e2e4f4 | |||
| df72e7c338 | |||
|
|
234f0be465 | ||
| 0677320a06 | |||
|
|
0e548887a4 | ||
| e1c5a07f14 | |||
| 7a745fea9e | |||
|
|
8db6ddaeb5 | ||
|
|
e140ba4fe3 | ||
| ec9f32d0ad | |||
|
|
0e1a10a860 | ||
|
|
4ad60cbe96 | ||
|
|
731f6f2d12 | ||
|
|
7abce7651d | ||
|
|
d3af5bd9e4 | ||
|
|
dd6c3db9b2 | ||
| 6316389a68 | |||
| c994ada5e7 | |||
|
|
197d3df0fb | ||
| b501b91bc4 |
10
pom.xml
10
pom.xml
@@ -20,7 +20,6 @@
|
|||||||
<module>pqs-advance</module>
|
<module>pqs-advance</module>
|
||||||
<module>pqs-prepare</module>
|
<module>pqs-prepare</module>
|
||||||
<module>pqs-process</module>
|
<module>pqs-process</module>
|
||||||
<module>pqs-influx</module>
|
|
||||||
<module>pqs-bpm</module>
|
<module>pqs-bpm</module>
|
||||||
<module>pqs-supervision</module>
|
<module>pqs-supervision</module>
|
||||||
|
|
||||||
@@ -44,15 +43,20 @@
|
|||||||
<!-- <middle.server.url>10.95.53.49</middle.server.url>-->
|
<!-- <middle.server.url>10.95.53.49</middle.server.url>-->
|
||||||
<middle.server.url>192.168.1.22</middle.server.url>
|
<middle.server.url>192.168.1.22</middle.server.url>
|
||||||
<!--微服务模块发布地址-->
|
<!--微服务模块发布地址-->
|
||||||
<service.server.url>127.0.0.1</service.server.url>
|
<service.server.url>192.168.1.127</service.server.url>
|
||||||
<!--docker仓库地址-->
|
<!--docker仓库地址-->
|
||||||
<docker.server.url>192.168.1.22</docker.server.url>
|
<docker.server.url>192.168.1.22</docker.server.url>
|
||||||
<!--nacos的ip:port-->
|
<!--nacos的ip:port-->
|
||||||
<nacos.url>${middle.server.url}:18848</nacos.url>
|
<nacos.url>${middle.server.url}:18848</nacos.url>
|
||||||
|
<!--nacos开启鉴权后的用户名-->
|
||||||
|
<nacos.username>nacos</nacos.username>
|
||||||
|
<!--nacos的ip:port-->
|
||||||
|
<nacos.password>nacos</nacos.password>
|
||||||
<!--服务器发布内容为空-->
|
<!--服务器发布内容为空-->
|
||||||
<!-- <nacos.namespace></nacos.namespace>-->
|
<!-- <nacos.namespace></nacos.namespace>-->
|
||||||
<!-- <nacos.namespace>1dd11af6-e668-41fd-a663-02a05705304d</nacos.namespace>-->
|
<!-- <nacos.namespace>1dd11af6-e668-41fd-a663-02a05705304d</nacos.namespace>-->
|
||||||
<nacos.namespace>6d75b5c3-cff9-4c4a-8e8b-ca2363753ecb</nacos.namespace>
|
<!-- <nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>-->
|
||||||
|
<nacos.namespace>ddcae5af-ac35-4fc4-9804-962de94dfc61</nacos.namespace>
|
||||||
<!-- sentinel:port-->
|
<!-- sentinel:port-->
|
||||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||||
<!--网关地址,主要用于配置swagger中认证token-->
|
<!--网关地址,主要用于配置swagger中认证token-->
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class ResponsibilityController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/responsibilityList")
|
@PostMapping("/responsibilityList")
|
||||||
@ApiOperation("列表分页")
|
@ApiOperation("查询责任划分列表分页")
|
||||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||||
public HttpResult<Page<RespDataDTO>> responsibilityList(@RequestBody @Validated BaseParam queryParam) {
|
public HttpResult<Page<RespDataDTO>> responsibilityList(@RequestBody @Validated BaseParam queryParam) {
|
||||||
String methodDescribe = getMethodDescribe("responsibilityList");
|
String methodDescribe = getMethodDescribe("responsibilityList");
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class UserDataController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/userDataList")
|
@PostMapping("/userDataList")
|
||||||
@ApiOperation("列表分页")
|
@ApiOperation("查询用户列表分页")
|
||||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||||
public HttpResult<Page<RespUserData>> userDataList(@RequestBody @Validated BaseParam queryParam) {
|
public HttpResult<Page<RespUserData>> userDataList(@RequestBody @Validated BaseParam queryParam) {
|
||||||
String methodDescribe = getMethodDescribe("userDataList");
|
String methodDescribe = getMethodDescribe("userDataList");
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ 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.common.pojo.constant.LogInfo;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
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;
|
||||||
@@ -77,7 +78,7 @@ public class CarryCapacityUserPOServiceImpl extends ServiceImpl<CarryCapacityUse
|
|||||||
page.getRecords().stream().forEach(temp->{
|
page.getRecords().stream().forEach(temp->{
|
||||||
UserVO user = userFeignClient.getUserById(temp.getCreateBy()).getData();
|
UserVO user = userFeignClient.getUserById(temp.getCreateBy()).getData();
|
||||||
|
|
||||||
temp.setCreateBy(user.getName());
|
temp.setCreateBy(Objects.isNull(user)? LogInfo.UNKNOWN_USER:user.getName());
|
||||||
});
|
});
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import com.njcn.influx.deprecated.InfluxDBPublicParam;
|
|||||||
import com.njcn.influx.imapper.DataHarmPowerPMapper;
|
import com.njcn.influx.imapper.DataHarmPowerPMapper;
|
||||||
import com.njcn.influx.imapper.DataHarmPowerQMapper;
|
import com.njcn.influx.imapper.DataHarmPowerQMapper;
|
||||||
import com.njcn.influx.imapper.DataVMapper;
|
import com.njcn.influx.imapper.DataVMapper;
|
||||||
import com.njcn.influx.imapper.IDataIMapper;
|
import com.njcn.influx.imapper.DataIMapper;
|
||||||
import com.njcn.influx.pojo.bo.CarryCapcityData;
|
import com.njcn.influx.pojo.bo.CarryCapcityData;
|
||||||
import com.njcn.influx.pojo.po.DataI;
|
import com.njcn.influx.pojo.po.DataI;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
@@ -74,14 +74,14 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
private final DataHarmPowerQMapper dataHarmPowerQMapper;
|
private final DataHarmPowerQMapper dataHarmPowerQMapper;
|
||||||
private final DataHarmPowerPMapper dataHarmPowerPMapper;
|
private final DataHarmPowerPMapper dataHarmPowerPMapper;
|
||||||
private final DataVMapper dataVMapper;
|
private final DataVMapper dataVMapper;
|
||||||
private final IDataIMapper dataIMapper;
|
private final DataIMapper dataIMapper;
|
||||||
|
|
||||||
private final CarryCapacityStrategyPOService carryCapacityStrategyPOService;
|
private final CarryCapacityStrategyPOService carryCapacityStrategyPOService;
|
||||||
private final CarryCapacityDataPOService carryCapacityDataPOService;
|
private final CarryCapacityDataPOService carryCapacityDataPOService;
|
||||||
private final RedisUtil redisUtil;
|
private final RedisUtil redisUtil;
|
||||||
private final CarryCapacityResultPOService carryCapacityResultPOService;
|
private final CarryCapacityResultPOService carryCapacityResultPOService;
|
||||||
private final CarryCapacityUserPOService carryCapacityUserPOService;
|
private final CarryCapacityUserPOService carryCapacityUserPOService;
|
||||||
private static final double DEFAULTVALUE=3141.5926;
|
private static final double DEFAULTVALUE=3.1415926;
|
||||||
|
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
缺失布置3.1415926,后边更具3.1415926个数来判断数据完整性,及进行数据补充*/
|
缺失布置3.1415926,后边更具3.1415926个数来判断数据完整性,及进行数据补充*/
|
||||||
//有功功率
|
//有功功率
|
||||||
String SqlP1 = "select mean(p)*1000 as value from data_harmpower_p where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlP1 = "select mean(p)*1000 as value from data_harmpower_p where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + startTime + "'and time <= '" +endTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + startTime + "'and time <= '" +endTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerPList = dataHarmPowerPMapper.getSqlResult(SqlP1);
|
dataHarmPowerPList = dataHarmPowerPMapper.getSqlResult(SqlP1);
|
||||||
|
|
||||||
//数据校验
|
//数据校验
|
||||||
@@ -172,7 +172,7 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
|
|
||||||
//无功功率
|
//无功功率
|
||||||
String SqlQ1 = "select mean(q)*1000 as value from data_harmpower_q where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlQ1 = "select mean(q)*1000 as value from data_harmpower_q where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + startTime + "'and time <= '" +endTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + startTime + "'and time <= '" +endTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerQList = dataHarmPowerQMapper.getSqlResult(SqlQ1);
|
dataHarmPowerQList = dataHarmPowerQMapper.getSqlResult(SqlQ1);
|
||||||
//数据缺失填补
|
//数据缺失填补
|
||||||
//数据校验
|
//数据校验
|
||||||
@@ -201,7 +201,7 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
, formatter) + " 23:59:00";
|
, formatter) + " 23:59:00";
|
||||||
|
|
||||||
String SqlP2 = "select mean(p)*1000 as value from data_harmpower_p where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlP2 = "select mean(p)*1000 as value from data_harmpower_p where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerP2List = dataHarmPowerPMapper.getSqlResult(SqlP2);
|
dataHarmPowerP2List = dataHarmPowerPMapper.getSqlResult(SqlP2);
|
||||||
//数据校验
|
//数据校验
|
||||||
if(CollectionUtil.isEmpty(dataHarmPowerP2List)){
|
if(CollectionUtil.isEmpty(dataHarmPowerP2List)){
|
||||||
@@ -220,7 +220,7 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
|
|
||||||
//无功功率
|
//无功功率
|
||||||
String SqlQ2 = "select mean(q)*1000 as value from data_harmpower_q where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlQ2 = "select mean(q)*1000 as value from data_harmpower_q where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerQ2List = dataHarmPowerQMapper.getSqlResult(SqlQ2);
|
dataHarmPowerQ2List = dataHarmPowerQMapper.getSqlResult(SqlQ2);
|
||||||
//数据校验
|
//数据校验
|
||||||
//数据校验
|
//数据校验
|
||||||
@@ -240,7 +240,7 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
|
|
||||||
//电压
|
//电压
|
||||||
String SqlU2 = "select mean(rms)*1000 as value from data_v where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlU2 = "select mean(rms)*1000 as value from data_v where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerU2List = dataVMapper.getSqlResult(SqlU2);
|
dataHarmPowerU2List = dataVMapper.getSqlResult(SqlU2);
|
||||||
//数据校验
|
//数据校验
|
||||||
//数据校验
|
//数据校验
|
||||||
@@ -325,7 +325,7 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
if(CollectionUtil.isEmpty(dataHarmPowerQList)){
|
if(CollectionUtil.isEmpty(dataHarmPowerQList)){
|
||||||
//无功功率
|
//无功功率
|
||||||
String SqlQ1 = "select mean(q)*1000 as value from data_harmpower_q where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlQ1 = "select mean(q)*1000 as value from data_harmpower_q where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + startTime + "'and time <= '" +endTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + startTime + "'and time <= '" +endTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerQList = dataHarmPowerQMapper.getSqlResult(SqlQ1);
|
dataHarmPowerQList = dataHarmPowerQMapper.getSqlResult(SqlQ1);
|
||||||
if(CollectionUtil.isEmpty(dataHarmPowerQList)){
|
if(CollectionUtil.isEmpty(dataHarmPowerQList)){
|
||||||
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
|
||||||
@@ -796,7 +796,7 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
, formatter) + " 23:59:00";
|
, formatter) + " 23:59:00";
|
||||||
|
|
||||||
String SqlP2 = "select mean(p)*1000 as value from data_harmpower_p where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlP2 = "select mean(p)*1000 as value from data_harmpower_p where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerP2List = dataHarmPowerPMapper.getSqlResult(SqlP2);
|
dataHarmPowerP2List = dataHarmPowerPMapper.getSqlResult(SqlP2);
|
||||||
//数据校验
|
//数据校验
|
||||||
if(CollectionUtil.isEmpty(dataHarmPowerP2List)){
|
if(CollectionUtil.isEmpty(dataHarmPowerP2List)){
|
||||||
@@ -818,14 +818,14 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
|
|
||||||
//无功功率
|
//无功功率
|
||||||
String SqlQ2 = "select mean(q)*1000 as value from data_harmpower_q where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlQ2 = "select mean(q)*1000 as value from data_harmpower_q where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerQ2List = dataHarmPowerQMapper.getSqlResult(SqlQ2);
|
dataHarmPowerQ2List = dataHarmPowerQMapper.getSqlResult(SqlQ2);
|
||||||
//数据校验
|
//数据校验
|
||||||
//数据缺失填补
|
//数据缺失填补
|
||||||
linearInterpolation(dataHarmPowerQ2List);
|
linearInterpolation(dataHarmPowerQ2List);
|
||||||
//电压
|
//电压
|
||||||
String SqlU2 = "select mean(rms)*1000 as value from data_v where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
String SqlU2 = "select mean(rms)*1000 as value from data_v where value_type='CP95' and phasic_type!='T' and line_id='"+lineId+
|
||||||
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(3.1415926)"+InfluxDBPublicParam.TIME_ZONE;
|
"' and time >= '" + forwardStartTime + "'and time <= '" +forwardEndTime + "'"+"group by time("+timeInterval+"m) ,* fill(0.0031415926)"+InfluxDBPublicParam.TIME_ZONE;
|
||||||
dataHarmPowerU2List = dataVMapper.getSqlResult(SqlU2);
|
dataHarmPowerU2List = dataVMapper.getSqlResult(SqlU2);
|
||||||
//数据校验
|
//数据校验
|
||||||
|
|
||||||
@@ -1163,24 +1163,31 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
*/
|
*/
|
||||||
public static void linearInterpolation(List<CarryCapcityData> data) {
|
public static void linearInterpolation(List<CarryCapcityData> data) {
|
||||||
|
|
||||||
for (int i = 0; i < data.size(); i++) {
|
|
||||||
if (data.get(i).getValue() == DEFAULTVALUE ||Objects.isNull(data.get(i).getValue())) {
|
|
||||||
|
data.stream().collect(Collectors.groupingBy(CarryCapcityData::getPhaseType)).forEach((k,v)->{
|
||||||
|
|
||||||
|
for (int i = 0; i < v.size(); i++) {
|
||||||
|
if (v.get(i).getValue() == DEFAULTVALUE ||Objects.isNull(v.get(i).getValue())) {
|
||||||
int prevIndex = i - 1;
|
int prevIndex = i - 1;
|
||||||
int nextIndex = i + 1;
|
int nextIndex = i + 1;
|
||||||
while (prevIndex >= 0 && (data.get(prevIndex).getValue() == DEFAULTVALUE|| Objects.isNull(data.get(prevIndex).getValue()))) {
|
while (prevIndex >= 0 && (v.get(prevIndex).getValue() == DEFAULTVALUE|| Objects.isNull(v.get(prevIndex).getValue()))) {
|
||||||
prevIndex--;
|
prevIndex--;
|
||||||
}
|
}
|
||||||
while (nextIndex < data.size() && (data.get(nextIndex).getValue() == DEFAULTVALUE|| Objects.isNull(data.get(nextIndex).getValue()))) {
|
while (nextIndex < v.size() && (v.get(nextIndex).getValue() == DEFAULTVALUE|| Objects.isNull(v.get(nextIndex).getValue()))) {
|
||||||
nextIndex++;
|
nextIndex++;
|
||||||
}
|
}
|
||||||
if (prevIndex >= 0 && nextIndex < data.size()) {
|
if (prevIndex >= 0 && nextIndex < v.size()) {
|
||||||
double slope = (data.get(nextIndex).getValue() - data.get(prevIndex).getValue()) / (nextIndex - prevIndex);
|
double slope = (v.get(nextIndex).getValue() - v.get(prevIndex).getValue()) / (nextIndex - prevIndex);
|
||||||
data.get(i).setValue(data.get(prevIndex).getValue() + slope * (i - prevIndex));
|
v.get(i).setValue(v.get(prevIndex).getValue() + slope * (i - prevIndex));
|
||||||
} else {
|
} else {
|
||||||
data.get(i).setValue(DEFAULTVALUE);
|
v.get(i).setValue(DEFAULTVALUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -1192,72 +1199,76 @@ public class CarryCapcityServiceImpl implements CarryCapcityService {
|
|||||||
*/
|
*/
|
||||||
public static void linearInterpolationI(List<DataI> data) {
|
public static void linearInterpolationI(List<DataI> data) {
|
||||||
|
|
||||||
for (int i = 0; i < data.size(); i++) {
|
data.stream().collect(Collectors.groupingBy(DataI::getPhaseType)).forEach((k,v)->{
|
||||||
if (data.get(i).getI2() == DEFAULTVALUE||Objects.isNull(data.get(i).getI2())) {
|
for (int i = 0; i < v.size(); i++) {
|
||||||
|
if (v.get(i).getI2() == DEFAULTVALUE||Objects.isNull(v.get(i).getI2())) {
|
||||||
int prevIndex = i - 1;
|
int prevIndex = i - 1;
|
||||||
int nextIndex = i + 1;
|
int nextIndex = i + 1;
|
||||||
while (prevIndex >= 0 && (data.get(prevIndex).getI2() == DEFAULTVALUE||Objects.isNull(data.get(prevIndex).getI2()))) {
|
while (prevIndex >= 0 && (v.get(prevIndex).getI2() == DEFAULTVALUE||Objects.isNull(v.get(prevIndex).getI2()))) {
|
||||||
prevIndex--;
|
prevIndex--;
|
||||||
}
|
}
|
||||||
while (nextIndex < data.size() && (data.get(nextIndex).getI2() == DEFAULTVALUE||Objects.isNull(data.get(nextIndex).getI2()))) {
|
while (nextIndex < v.size() && (v.get(nextIndex).getI2() == DEFAULTVALUE||Objects.isNull(v.get(nextIndex).getI2()))) {
|
||||||
nextIndex++;
|
nextIndex++;
|
||||||
}
|
}
|
||||||
if (prevIndex >= 0 && nextIndex < data.size()) {
|
if (prevIndex >= 0 && nextIndex < v.size()) {
|
||||||
double slope = (data.get(nextIndex).getI2() - data.get(prevIndex).getI2()) / (nextIndex - prevIndex);
|
double slope = (v.get(nextIndex).getI2() - v.get(prevIndex).getI2()) / (nextIndex - prevIndex);
|
||||||
data.get(i).setI2(data.get(prevIndex).getI2() + slope * (i - prevIndex));
|
v.get(i).setI2(v.get(prevIndex).getI2() + slope * (i - prevIndex));
|
||||||
data.get(i).setI3(data.get(prevIndex).getI3() + slope * (i - prevIndex));
|
v.get(i).setI3(v.get(prevIndex).getI3() + slope * (i - prevIndex));
|
||||||
data.get(i).setI4(data.get(prevIndex).getI4() + slope * (i - prevIndex));
|
v.get(i).setI4(v.get(prevIndex).getI4() + slope * (i - prevIndex));
|
||||||
data.get(i).setI5(data.get(prevIndex).getI5() + slope * (i - prevIndex));
|
v.get(i).setI5(v.get(prevIndex).getI5() + slope * (i - prevIndex));
|
||||||
data.get(i).setI6(data.get(prevIndex).getI6() + slope * (i - prevIndex));
|
v.get(i).setI6(v.get(prevIndex).getI6() + slope * (i - prevIndex));
|
||||||
data.get(i).setI7(data.get(prevIndex).getI7() + slope * (i - prevIndex));
|
v.get(i).setI7(v.get(prevIndex).getI7() + slope * (i - prevIndex));
|
||||||
data.get(i).setI8(data.get(prevIndex).getI8() + slope * (i - prevIndex));
|
v.get(i).setI8(v.get(prevIndex).getI8() + slope * (i - prevIndex));
|
||||||
data.get(i).setI9(data.get(prevIndex).getI9() + slope * (i - prevIndex));
|
v.get(i).setI9(v.get(prevIndex).getI9() + slope * (i - prevIndex));
|
||||||
data.get(i).setI10(data.get(prevIndex).getI10() + slope * (i - prevIndex));
|
v.get(i).setI10(v.get(prevIndex).getI10() + slope * (i - prevIndex));
|
||||||
data.get(i).setI11(data.get(prevIndex).getI11() + slope * (i - prevIndex));
|
v.get(i).setI11(v.get(prevIndex).getI11() + slope * (i - prevIndex));
|
||||||
data.get(i).setI12(data.get(prevIndex).getI12() + slope * (i - prevIndex));
|
v.get(i).setI12(v.get(prevIndex).getI12() + slope * (i - prevIndex));
|
||||||
data.get(i).setI13(data.get(prevIndex).getI13() + slope * (i - prevIndex));
|
v.get(i).setI13(v.get(prevIndex).getI13() + slope * (i - prevIndex));
|
||||||
data.get(i).setI14(data.get(prevIndex).getI14() + slope * (i - prevIndex));
|
v.get(i).setI14(v.get(prevIndex).getI14() + slope * (i - prevIndex));
|
||||||
data.get(i).setI15(data.get(prevIndex).getI15() + slope * (i - prevIndex));
|
v.get(i).setI15(v.get(prevIndex).getI15() + slope * (i - prevIndex));
|
||||||
data.get(i).setI16(data.get(prevIndex).getI16() + slope * (i - prevIndex));
|
v.get(i).setI16(v.get(prevIndex).getI16() + slope * (i - prevIndex));
|
||||||
data.get(i).setI17(data.get(prevIndex).getI17() + slope * (i - prevIndex));
|
v.get(i).setI17(v.get(prevIndex).getI17() + slope * (i - prevIndex));
|
||||||
data.get(i).setI18(data.get(prevIndex).getI18() + slope * (i - prevIndex));
|
v.get(i).setI18(v.get(prevIndex).getI18() + slope * (i - prevIndex));
|
||||||
data.get(i).setI19(data.get(prevIndex).getI19() + slope * (i - prevIndex));
|
v.get(i).setI19(v.get(prevIndex).getI19() + slope * (i - prevIndex));
|
||||||
data.get(i).setI20(data.get(prevIndex).getI20() + slope * (i - prevIndex));
|
v.get(i).setI20(v.get(prevIndex).getI20() + slope * (i - prevIndex));
|
||||||
data.get(i).setI21(data.get(prevIndex).getI21() + slope * (i - prevIndex));
|
v.get(i).setI21(v.get(prevIndex).getI21() + slope * (i - prevIndex));
|
||||||
data.get(i).setI22(data.get(prevIndex).getI22() + slope * (i - prevIndex));
|
v.get(i).setI22(v.get(prevIndex).getI22() + slope * (i - prevIndex));
|
||||||
data.get(i).setI23(data.get(prevIndex).getI23() + slope * (i - prevIndex));
|
v.get(i).setI23(v.get(prevIndex).getI23() + slope * (i - prevIndex));
|
||||||
data.get(i).setI24(data.get(prevIndex).getI24() + slope * (i - prevIndex));
|
v.get(i).setI24(v.get(prevIndex).getI24() + slope * (i - prevIndex));
|
||||||
data.get(i).setI25(data.get(prevIndex).getI25() + slope * (i - prevIndex));
|
v.get(i).setI25(v.get(prevIndex).getI25() + slope * (i - prevIndex));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
data.get(i).setI2(DEFAULTVALUE);
|
v.get(i).setI2(DEFAULTVALUE);
|
||||||
data.get(i).setI3(DEFAULTVALUE);
|
v.get(i).setI3(DEFAULTVALUE);
|
||||||
data.get(i).setI4(DEFAULTVALUE);
|
v.get(i).setI4(DEFAULTVALUE);
|
||||||
data.get(i).setI5(DEFAULTVALUE);
|
v.get(i).setI5(DEFAULTVALUE);
|
||||||
data.get(i).setI6(DEFAULTVALUE);
|
v.get(i).setI6(DEFAULTVALUE);
|
||||||
data.get(i).setI7(DEFAULTVALUE);
|
v.get(i).setI7(DEFAULTVALUE);
|
||||||
data.get(i).setI8(DEFAULTVALUE);
|
v.get(i).setI8(DEFAULTVALUE);
|
||||||
data.get(i).setI9(DEFAULTVALUE);
|
v.get(i).setI9(DEFAULTVALUE);
|
||||||
data.get(i).setI10(DEFAULTVALUE);
|
v.get(i).setI10(DEFAULTVALUE);
|
||||||
data.get(i).setI11(DEFAULTVALUE);
|
v.get(i).setI11(DEFAULTVALUE);
|
||||||
data.get(i).setI12(DEFAULTVALUE);
|
v.get(i).setI12(DEFAULTVALUE);
|
||||||
data.get(i).setI13(DEFAULTVALUE);
|
v.get(i).setI13(DEFAULTVALUE);
|
||||||
data.get(i).setI14(DEFAULTVALUE);
|
v.get(i).setI14(DEFAULTVALUE);
|
||||||
data.get(i).setI15(DEFAULTVALUE);
|
v.get(i).setI15(DEFAULTVALUE);
|
||||||
data.get(i).setI16(DEFAULTVALUE);
|
v.get(i).setI16(DEFAULTVALUE);
|
||||||
data.get(i).setI17(DEFAULTVALUE);
|
v.get(i).setI17(DEFAULTVALUE);
|
||||||
data.get(i).setI18(DEFAULTVALUE);
|
v.get(i).setI18(DEFAULTVALUE);
|
||||||
data.get(i).setI19(DEFAULTVALUE);
|
v.get(i).setI19(DEFAULTVALUE);
|
||||||
data.get(i).setI20(DEFAULTVALUE);
|
v.get(i).setI20(DEFAULTVALUE);
|
||||||
data.get(i).setI21(DEFAULTVALUE);
|
v.get(i).setI21(DEFAULTVALUE);
|
||||||
data.get(i).setI22(DEFAULTVALUE);
|
v.get(i).setI22(DEFAULTVALUE);
|
||||||
data.get(i).setI23(DEFAULTVALUE);
|
v.get(i).setI23(DEFAULTVALUE);
|
||||||
data.get(i).setI24(DEFAULTVALUE);
|
v.get(i).setI24(DEFAULTVALUE);
|
||||||
data.get(i).setI25(DEFAULTVALUE);
|
v.get(i).setI25(DEFAULTVALUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ public class ResponsibilityAlgorithm {
|
|||||||
//EK计算,用于后续计算FK(不含背景的用户责任指标)、HK(包含背景的用户责任指标)
|
//EK计算,用于后续计算FK(不含背景的用户责任指标)、HK(包含背景的用户责任指标)
|
||||||
//float **EKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
|
//float **EKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
|
||||||
//for (int i = 0; i < TL; i++)
|
//for (int i = 0; i < TL; i++)
|
||||||
//EKarr[i] = (float *)malloc(TL * sizeof(float));
|
//EKarr[i] = (float *)malloc(TL * Float.SIZE / Byte.SIZE);
|
||||||
|
|
||||||
float[][] EKarr;
|
float[][] EKarr;
|
||||||
EKarr = dyEKCom(simCor, Pdata, width, P, TL);
|
EKarr = dyEKCom(simCor, Pdata, width, P, TL);
|
||||||
@@ -303,7 +303,7 @@ public class ResponsibilityAlgorithm {
|
|||||||
//不含背景的用户谐波责任指标
|
//不含背景的用户谐波责任指标
|
||||||
//float **FKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
|
//float **FKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
|
||||||
//for (int i = 0; i < TL; i++)
|
//for (int i = 0; i < TL; i++)
|
||||||
//FKarr[i] = (float *)malloc(TL * sizeof(float));
|
//FKarr[i] = (float *)malloc(TL * Float.SIZE / Byte.SIZE);
|
||||||
float[][] FKarr;
|
float[][] FKarr;
|
||||||
FKarr = DyFKCom(EKdata, width, P, TL);
|
FKarr = DyFKCom(EKdata, width, P, TL);
|
||||||
RealMatrix FKdata = MatrixUtils.createRealMatrix(slcorlength, P);
|
RealMatrix FKdata = MatrixUtils.createRealMatrix(slcorlength, P);
|
||||||
@@ -316,7 +316,7 @@ public class ResponsibilityAlgorithm {
|
|||||||
//包含背景的谐波责任指标
|
//包含背景的谐波责任指标
|
||||||
//float **HKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
|
//float **HKarr = (float **)malloc(TL * sizeof(float *));//先申请P个指针型字节的空间
|
||||||
//for (int i = 0; i < TL; i++)
|
//for (int i = 0; i < TL; i++)
|
||||||
//HKarr[i] = (float *)malloc(TL * sizeof(float));
|
//HKarr[i] = (float *)malloc(TL * Float.SIZE / Byte.SIZE);
|
||||||
float[][] HKarr;
|
float[][] HKarr;
|
||||||
HKarr = DyHKCom(bjCore, EKdata, width, P, TL);
|
HKarr = DyHKCom(bjCore, EKdata, width, P, TL);
|
||||||
RealMatrix HKdata = MatrixUtils.createRealMatrix(slcorlength, (P + 1));
|
RealMatrix HKdata = MatrixUtils.createRealMatrix(slcorlength, (P + 1));
|
||||||
|
|||||||
@@ -1,20 +1,27 @@
|
|||||||
package com.njcn.auth.controller;
|
package com.njcn.auth.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
import com.nimbusds.jose.jwk.JWKSet;
|
import com.nimbusds.jose.jwk.JWKSet;
|
||||||
import com.nimbusds.jose.jwk.RSAKey;
|
import com.nimbusds.jose.jwk.RSAKey;
|
||||||
import com.njcn.auth.service.UserTokenService;
|
import com.njcn.auth.service.UserTokenService;
|
||||||
|
import com.njcn.auth.utils.AuthPubUtil;
|
||||||
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.SecurityConstants;
|
import com.njcn.common.pojo.constant.SecurityConstants;
|
||||||
import com.njcn.common.pojo.dto.UserTokenInfo;
|
import com.njcn.common.pojo.dto.UserTokenInfo;
|
||||||
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.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.common.utils.LogUtil;
|
import com.njcn.common.utils.LogUtil;
|
||||||
import com.njcn.common.utils.sm.DesUtils;
|
import com.njcn.common.utils.sm.DesUtils;
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.user.api.PassWordRuleFeugnClient;
|
||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
|
import com.njcn.user.enums.UserResponseEnum;
|
||||||
|
import com.njcn.user.pojo.po.UserStrategy;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import com.njcn.web.utils.RestTemplateUtil;
|
import com.njcn.web.utils.RestTemplateUtil;
|
||||||
@@ -39,6 +46,7 @@ import java.security.interfaces.RSAPublicKey;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -59,11 +67,13 @@ public class AuthController extends BaseController {
|
|||||||
|
|
||||||
private final UserFeignClient userFeignClient;
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
|
private final PassWordRuleFeugnClient passWordRuleFeugnClient;
|
||||||
|
|
||||||
private final UserTokenService userTokenService;
|
private final UserTokenService userTokenService;
|
||||||
|
|
||||||
|
|
||||||
@ApiIgnore
|
@ApiIgnore
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.AUTHENTICATE)
|
@OperateInfo(info = LogEnum.SYSTEM_SERIOUS, operateType = OperateType.AUTHENTICATE)
|
||||||
@ApiOperation("登录认证")
|
@ApiOperation("登录认证")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = SecurityConstants.GRANT_TYPE, defaultValue = "password", value = "授权模式", required = true),
|
@ApiImplicitParam(name = SecurityConstants.GRANT_TYPE, defaultValue = "password", value = "授权模式", required = true),
|
||||||
@@ -80,6 +90,8 @@ public class AuthController extends BaseController {
|
|||||||
public Object postAccessToken(@ApiIgnore Principal principal, @RequestParam @ApiIgnore Map<String, String> parameters) throws HttpRequestMethodNotSupportedException {
|
public Object postAccessToken(@ApiIgnore Principal principal, @RequestParam @ApiIgnore Map<String, String> parameters) throws HttpRequestMethodNotSupportedException {
|
||||||
String methodDescribe = getMethodDescribe("postAccessToken");
|
String methodDescribe = getMethodDescribe("postAccessToken");
|
||||||
String username = parameters.get(SecurityConstants.USERNAME);
|
String username = parameters.get(SecurityConstants.USERNAME);
|
||||||
|
|
||||||
|
|
||||||
String grantType = parameters.get(SecurityConstants.GRANT_TYPE);
|
String grantType = parameters.get(SecurityConstants.GRANT_TYPE);
|
||||||
if (grantType.equalsIgnoreCase(SecurityConstants.GRANT_CAPTCHA) || grantType.equalsIgnoreCase(SecurityConstants.REFRESH_TOKEN_KEY)) {
|
if (grantType.equalsIgnoreCase(SecurityConstants.GRANT_CAPTCHA) || grantType.equalsIgnoreCase(SecurityConstants.REFRESH_TOKEN_KEY)) {
|
||||||
username = DesUtils.aesDecrypt(username);
|
username = DesUtils.aesDecrypt(username);
|
||||||
@@ -87,6 +99,28 @@ public class AuthController extends BaseController {
|
|||||||
//短信方式登录,将手机号赋值为用户名
|
//短信方式登录,将手机号赋值为用户名
|
||||||
username = parameters.get(SecurityConstants.PHONE);
|
username = parameters.get(SecurityConstants.PHONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断当前登录是否超过最大并发数
|
||||||
|
UserStrategy data = passWordRuleFeugnClient.getUserStrategy().getData();
|
||||||
|
String onlineUserKey = SecurityConstants.TOKEN_ONLINE_PREFIX;
|
||||||
|
List<UserTokenInfo> onLineUser = (List<UserTokenInfo>) redisUtil.getLikeListAllValues(onlineUserKey);
|
||||||
|
if(CollectionUtil.isNotEmpty(onLineUser)){
|
||||||
|
String finalUsername = username;
|
||||||
|
onLineUser = onLineUser.stream().filter(item->{
|
||||||
|
JSONObject jsonObject = AuthPubUtil.getLoginByToken(item.getRefreshToken());
|
||||||
|
String login = jsonObject.getStr(SecurityConstants.USER_NAME_KEY);
|
||||||
|
long exp = Long.parseLong(jsonObject.getStr(SecurityConstants.JWT_EXP));
|
||||||
|
long now = Calendar.getInstance().getTimeInMillis()/1000;
|
||||||
|
return (exp > now) && !login.equals(finalUsername);
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer maxNum = data.getMaxNum();
|
||||||
|
if((CollectionUtil.isNotEmpty(onLineUser)?onLineUser.size():0)>=maxNum){
|
||||||
|
throw new BusinessException(UserResponseEnum.LOGIN_USER_OVERLIMIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (grantType.equalsIgnoreCase(SecurityConstants.REFRESH_TOKEN_KEY)) {
|
if (grantType.equalsIgnoreCase(SecurityConstants.REFRESH_TOKEN_KEY)) {
|
||||||
//如果是刷新token,需要去黑名单校验
|
//如果是刷新token,需要去黑名单校验
|
||||||
userTokenService.judgeRefreshToken(parameters.get(SecurityConstants.REFRESH_TOKEN_KEY));
|
userTokenService.judgeRefreshToken(parameters.get(SecurityConstants.REFRESH_TOKEN_KEY));
|
||||||
@@ -106,6 +140,7 @@ public class AuthController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_SERIOUS, operateType = OperateType.LOGOUT)
|
||||||
@ApiOperation("用户登出系统")
|
@ApiOperation("用户登出系统")
|
||||||
@DeleteMapping("/logout")
|
@DeleteMapping("/logout")
|
||||||
public HttpResult<Object> logout() {
|
public HttpResult<Object> logout() {
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ public class UserTokenService {
|
|||||||
redisUtil.saveByKeyWithExpire(onlineUserKey, userTokenInfo, refreshLifeTime.plusMinutes(5L).toEpochSecond(ZoneOffset.of("+8")) - LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));
|
redisUtil.saveByKeyWithExpire(onlineUserKey, userTokenInfo, refreshLifeTime.plusMinutes(5L).toEpochSecond(ZoneOffset.of("+8")) - LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));
|
||||||
|
|
||||||
//记录成功登录后的信息
|
//记录成功登录后的信息
|
||||||
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, nickName, ip, "登录认证", OperateType.AUTHENTICATE, 1, "", 0, 1, generalInfo.getMicroServiceName(), userIndex,LocalDateTime.now());
|
//LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, nickName, ip, "登录认证", OperateType.AUTHENTICATE, 1, "", 0, 1, generalInfo.getMicroServiceName(), userIndex,LocalDateTime.now());
|
||||||
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
//publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
package com.njcn.auth.utils;
|
package com.njcn.auth.utils;
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import okhttp3.*;
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.nimbusds.jose.JWSObject;
|
||||||
|
import com.njcn.common.pojo.constant.SecurityConstants;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -28,4 +31,13 @@ public class AuthPubUtil {
|
|||||||
return String.join("", textList);
|
return String.join("", textList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
public static JSONObject getLoginByToken(String token){
|
||||||
|
JWSObject jwsObject = JWSObject.parse(token);
|
||||||
|
String payload = jwsObject.getPayload().toString();
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(payload);
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotEmpty;
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 不通过流程任务的 Request VO")
|
@Schema(description = "管理后台 - 不通过流程任务的 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@@ -21,4 +22,9 @@ public class BpmTaskRejectParam {
|
|||||||
@NotBlank(message = "审批意见不能为空")
|
@NotBlank(message = "审批意见不能为空")
|
||||||
private String reason;
|
private String reason;
|
||||||
|
|
||||||
|
@ApiModelProperty("抄送的用户编号数组")
|
||||||
|
private Collection<String> copyUserIds;
|
||||||
|
|
||||||
|
@ApiModelProperty("变量实例(动态表单)")
|
||||||
|
private Map<String, Object> variables;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.bpm.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统筹流程实例的公共方案
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2024年06月12日 18:14
|
||||||
|
*/
|
||||||
|
public interface IBpmReasonService<T> extends IService<T> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据业务id实时更新当前业务流程状态
|
||||||
|
* @param businessId 实际业务id
|
||||||
|
* @param status 流程实例当前状态,具体参考BpmTaskStatusEnum枚举
|
||||||
|
*/
|
||||||
|
void updateProcessStatus(String businessId,String reason, Integer status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据业务id获取历史审批id以及该任务的重要信息
|
||||||
|
* @param businessId 业务流程id
|
||||||
|
*/
|
||||||
|
BpmInstanceInfo getInstanceInfo(String businessId);
|
||||||
|
}
|
||||||
@@ -109,7 +109,7 @@ public class BpmModelController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新建模型")
|
@ApiOperation("新建模型")
|
||||||
@ApiImplicitParam(name = "createRetVO", value = "模型数据", required = true)
|
@ApiImplicitParam(name = "bpmModelParam", value = "模型数据", required = true)
|
||||||
public HttpResult<String> createModel(@Validated @RequestBody BpmModelParam bpmModelParam) {
|
public HttpResult<String> createModel(@Validated @RequestBody BpmModelParam bpmModelParam) {
|
||||||
String methodDescribe = getMethodDescribe("createModel");
|
String methodDescribe = getMethodDescribe("createModel");
|
||||||
String modelId = modelService.createModel(bpmModelParam, null);
|
String modelId = modelService.createModel(bpmModelParam, null);
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ public class BpmProcessInstanceStatusEvent extends ApplicationEvent {
|
|||||||
*/
|
*/
|
||||||
private String businessKey;
|
private String businessKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核消息
|
||||||
|
* 例如说,请假
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
|
||||||
public BpmProcessInstanceStatusEvent(Object source) {
|
public BpmProcessInstanceStatusEvent(Object source) {
|
||||||
super(source);
|
super(source);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class BpmSupervisionStatusListener implements ApplicationListener<BpmPro
|
|||||||
* @param event 事件
|
* @param event 事件
|
||||||
*/
|
*/
|
||||||
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||||
businessCommonFeignClient.updateProcessStatus(event.getProcessDefinitionKey(),event.getBusinessKey(), event.getStatus());
|
businessCommonFeignClient.updateProcessStatus(event.getProcessDefinitionKey(),event.getBusinessKey(),event.getReason(), event.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
|||||||
import com.njcn.bpm.pojo.dto.PageResult;
|
import com.njcn.bpm.pojo.dto.PageResult;
|
||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstancePageParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstancePageParam;
|
||||||
|
import com.njcn.bpm.pojo.param.task.BpmTaskRejectParam;
|
||||||
|
import org.flowable.engine.TaskService;
|
||||||
import org.flowable.engine.delegate.event.FlowableCancelledEvent;
|
import org.flowable.engine.delegate.event.FlowableCancelledEvent;
|
||||||
import org.flowable.engine.history.HistoricProcessInstance;
|
import org.flowable.engine.history.HistoricProcessInstance;
|
||||||
import org.flowable.engine.runtime.ProcessInstance;
|
import org.flowable.engine.runtime.ProcessInstance;
|
||||||
@@ -146,6 +148,13 @@ public interface IBpmProcessInstanceService {
|
|||||||
*/
|
*/
|
||||||
void updateProcessInstanceReject(String id, String reason);
|
void updateProcessInstanceReject(String id, String reason);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新 ProcessInstance 拓展记录为不通过
|
||||||
|
*
|
||||||
|
* @param id 流程编号
|
||||||
|
* @param reason 理由。例如说,审批不通过时,需要传递该值
|
||||||
|
*/
|
||||||
|
void updateProcessInstanceFromReject(String id, String reason, TaskService taskService, BpmTaskRejectParam bpmTaskRejectParam);
|
||||||
/**
|
/**
|
||||||
* 用于测试过程删除流程,正式环境慎用
|
* 用于测试过程删除流程,正式环境慎用
|
||||||
* @author cdf
|
* @author cdf
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.bpm.service.task.impl;
|
package com.njcn.bpm.service.task.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -13,6 +14,7 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
|||||||
import com.njcn.bpm.pojo.dto.PageResult;
|
import com.njcn.bpm.pojo.dto.PageResult;
|
||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstancePageParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstancePageParam;
|
||||||
|
import com.njcn.bpm.pojo.param.task.BpmTaskRejectParam;
|
||||||
import com.njcn.bpm.service.IBpmProcessDefinitionService;
|
import com.njcn.bpm.service.IBpmProcessDefinitionService;
|
||||||
import com.njcn.bpm.service.task.IBpmProcessInstanceService;
|
import com.njcn.bpm.service.task.IBpmProcessInstanceService;
|
||||||
import com.njcn.bpm.strategy.BpmTaskCandidateStartUserSelectStrategy;
|
import com.njcn.bpm.strategy.BpmTaskCandidateStartUserSelectStrategy;
|
||||||
@@ -30,6 +32,7 @@ import org.flowable.bpmn.model.UserTask;
|
|||||||
import org.flowable.common.engine.impl.identity.Authentication;
|
import org.flowable.common.engine.impl.identity.Authentication;
|
||||||
import org.flowable.engine.HistoryService;
|
import org.flowable.engine.HistoryService;
|
||||||
import org.flowable.engine.RuntimeService;
|
import org.flowable.engine.RuntimeService;
|
||||||
|
import org.flowable.engine.TaskService;
|
||||||
import org.flowable.engine.delegate.event.FlowableCancelledEvent;
|
import org.flowable.engine.delegate.event.FlowableCancelledEvent;
|
||||||
import org.flowable.engine.history.HistoricProcessInstance;
|
import org.flowable.engine.history.HistoricProcessInstance;
|
||||||
import org.flowable.engine.repository.ProcessDefinition;
|
import org.flowable.engine.repository.ProcessDefinition;
|
||||||
@@ -90,7 +93,6 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ProcessInstance> getProcessInstances(Set<String> ids) {
|
public List<ProcessInstance> getProcessInstances(Set<String> ids) {
|
||||||
return runtimeService.createProcessInstanceQuery().processInstanceIds(ids).list();
|
return runtimeService.createProcessInstanceQuery().processInstanceIds(ids).list();
|
||||||
@@ -285,18 +287,30 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateProcessInstanceWhenApprove(ProcessInstance instance) {
|
public void updateProcessInstanceWhenApprove(ProcessInstance instance) {
|
||||||
|
//判断传入参数是否是,不通过信息不通过则需要更新流程信息为不通过
|
||||||
|
Integer processInstanceStatus = BpmProcessInstanceStatusEnum.APPROVE.getStatus();
|
||||||
|
Map<String, Object> processVariables = instance.getProcessVariables();
|
||||||
|
if (processVariables.containsKey(BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS)) {
|
||||||
|
Integer stata =Integer.valueOf(processVariables.get(BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS).toString());
|
||||||
|
if (BpmProcessInstanceStatusEnum.REJECT.getStatus()==stata) {
|
||||||
|
processInstanceStatus = BpmProcessInstanceStatusEnum.REJECT.getStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
// 1. 更新流程实例 status
|
// 1. 更新流程实例 status
|
||||||
runtimeService.setVariable(instance.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS,
|
runtimeService.setVariable(instance.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS,
|
||||||
BpmProcessInstanceStatusEnum.APPROVE.getStatus());
|
processInstanceStatus);
|
||||||
|
|
||||||
// 2. 发送流程被【通过】的消息
|
// 2. 发送流程被【通过】的消息
|
||||||
// messageService.sendMessageWhenProcessInstanceApprove(BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceApproveMessage(instance));
|
// messageService.sendMessageWhenProcessInstanceApprove(BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceApproveMessage(instance));
|
||||||
|
|
||||||
// 3. 发送流程实例的状态事件
|
// 3. 发送流程实例的状态事件
|
||||||
// 注意:此时如果去查询 ProcessInstance 的话,字段是不全的,所以去查询了 HistoricProcessInstance
|
// 注意:此时如果去查询 ProcessInstance 的话,字段是不全的,所以去查询了 HistoricProcessInstance
|
||||||
|
// 在审核不通过时,会触该信息,设置在审核通过时,才发送
|
||||||
|
if(BpmProcessInstanceStatusEnum.APPROVE.getStatus()==processInstanceStatus){
|
||||||
HistoricProcessInstance processInstance = getHistoricProcessInstance(instance.getId());
|
HistoricProcessInstance processInstance = getHistoricProcessInstance(instance.getId());
|
||||||
processInstanceEventPublisher.sendProcessInstanceResultEvent(
|
processInstanceEventPublisher.sendProcessInstanceResultEvent(
|
||||||
BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceStatusEvent(this, processInstance, BpmProcessInstanceStatusEnum.APPROVE.getStatus()));
|
BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceStatusEvent(this, processInstance, processInstanceStatus));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -314,7 +328,31 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
|||||||
|
|
||||||
// 4. 发送流程实例的状态事件
|
// 4. 发送流程实例的状态事件
|
||||||
processInstanceEventPublisher.sendProcessInstanceResultEvent(
|
processInstanceEventPublisher.sendProcessInstanceResultEvent(
|
||||||
BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceStatusEvent(this, processInstance, BpmProcessInstanceStatusEnum.REJECT.getStatus()));
|
BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceStatusEvent(this, processInstance, reason, BpmProcessInstanceStatusEnum.REJECT.getStatus()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateProcessInstanceFromReject(String id, String reason, TaskService taskService, BpmTaskRejectParam bpmTaskRejectParam) {
|
||||||
|
// 1. 更新流程实例 status
|
||||||
|
runtimeService.setVariable(id, BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, BpmProcessInstanceStatusEnum.REJECT.getStatus());
|
||||||
|
|
||||||
|
// 2. 删除流程实例,以实现驳回任务时,取消整个审批流程
|
||||||
|
ProcessInstance processInstance = getProcessInstance(id);
|
||||||
|
// 3.3 调用 BPM complete 去完成任务
|
||||||
|
// 其中,variables 是存储动态表单到 local 任务级别。过滤一下,避免 ProcessInstance 系统级的变量被占用
|
||||||
|
if (CollectionUtil.isNotEmpty(bpmTaskRejectParam.getVariables())) {
|
||||||
|
Map<String, Object> variables = FlowableUtils.filterTaskFormVariable(bpmTaskRejectParam.getVariables());
|
||||||
|
taskService.complete(bpmTaskRejectParam.getId(), variables, true);
|
||||||
|
} else {
|
||||||
|
taskService.complete(bpmTaskRejectParam.getId());
|
||||||
|
}
|
||||||
|
//这是删除所有信息,
|
||||||
|
// deleteProcessInstance(id, StrUtil.format(BpmDeleteReasonEnum.REJECT_TASK.format(reason)));
|
||||||
|
// 4. 发送流程实例的状态事件
|
||||||
|
processInstanceEventPublisher.sendProcessInstanceResultEvent(
|
||||||
|
BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceStatusEvent(this, processInstance, reason, BpmProcessInstanceStatusEnum.REJECT.getStatus()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteProcessInstance(String id, String reason) {
|
public void deleteProcessInstance(String id, String reason) {
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
|||||||
BpmCommentTypeEnum.REJECT.formatComment(bpmTaskRejectParam.getReason()));
|
BpmCommentTypeEnum.REJECT.formatComment(bpmTaskRejectParam.getReason()));
|
||||||
|
|
||||||
// 3. 更新流程实例,审批不通过!
|
// 3. 更新流程实例,审批不通过!
|
||||||
processInstanceService.updateProcessInstanceReject(instance.getProcessInstanceId(), bpmTaskRejectParam.getReason());
|
processInstanceService.updateProcessInstanceFromReject(instance.getProcessInstanceId(), bpmTaskRejectParam.getReason(), taskService, bpmTaskRejectParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -105,12 +105,13 @@ public interface BpmProcessInstanceConvert {
|
|||||||
return bpmProcessInstanceStatusEvent;
|
return bpmProcessInstanceStatusEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
default BpmProcessInstanceStatusEvent buildProcessInstanceStatusEvent(Object source, ProcessInstance instance, Integer status) {
|
default BpmProcessInstanceStatusEvent buildProcessInstanceStatusEvent(Object source, ProcessInstance instance,String reason, Integer status) {
|
||||||
BpmProcessInstanceStatusEvent bpmProcessInstanceStatusEvent = new BpmProcessInstanceStatusEvent(source);
|
BpmProcessInstanceStatusEvent bpmProcessInstanceStatusEvent = new BpmProcessInstanceStatusEvent(source);
|
||||||
bpmProcessInstanceStatusEvent.setId(instance.getId());
|
bpmProcessInstanceStatusEvent.setId(instance.getId());
|
||||||
bpmProcessInstanceStatusEvent.setStatus(status);
|
bpmProcessInstanceStatusEvent.setStatus(status);
|
||||||
bpmProcessInstanceStatusEvent.setProcessDefinitionKey(instance.getProcessDefinitionKey());
|
bpmProcessInstanceStatusEvent.setProcessDefinitionKey(instance.getProcessDefinitionKey());
|
||||||
bpmProcessInstanceStatusEvent.setBusinessKey(instance.getBusinessKey());
|
bpmProcessInstanceStatusEvent.setBusinessKey(instance.getBusinessKey());
|
||||||
|
bpmProcessInstanceStatusEvent.setReason(reason);
|
||||||
return bpmProcessInstanceStatusEvent;
|
return bpmProcessInstanceStatusEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,18 +21,17 @@ 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://192.168.1.24:13306/pqsinfo_jb";
|
private static final String DB_URL = "jdbc:mysql://127.0.0.1:3306/pqsinfo";
|
||||||
// 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 = "njcnpqs";
|
private static final String PASSWORD = "123456";
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
List<Module> modules = Stream.of(
|
List<Module> modules = Stream.of(
|
||||||
new Module("hongawen", "com.njcn.supervision", "survey", Stream.of(
|
new Module("xy", "com.njcn.supervision", "survey", Stream.of(
|
||||||
"supervision_survey_plan",
|
"supervision_line_warning"
|
||||||
"supervision_survey_test"
|
|
||||||
).collect(Collectors.toList()), "supervision_")
|
).collect(Collectors.toList()), "supervision_")
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
generateJavaFile(modules);
|
generateJavaFile(modules);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public interface PatternRegex {
|
|||||||
/**
|
/**
|
||||||
* 登录名只能输入3-16位的英文字母或数字
|
* 登录名只能输入3-16位的英文字母或数字
|
||||||
*/
|
*/
|
||||||
String LOGIN_NAME_REGEX = "[a-zA-Z0-9_]{3,16}";
|
String LOGIN_NAME_REGEX = "^[a-zA-Z_.]{1}[a-zA-Z0-9_.]{2,15}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号必须有11位,并且为数字,是正常的手机·号码开头
|
* 手机号必须有11位,并且为数字,是正常的手机·号码开头
|
||||||
|
|||||||
@@ -75,4 +75,6 @@ public class LogInfoDTO implements Serializable {
|
|||||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ public enum CommonResponseEnum {
|
|||||||
|
|
||||||
FILE_EXIST("A0096", "文件已存在"),
|
FILE_EXIST("A0096", "文件已存在"),
|
||||||
|
|
||||||
|
FILE_NAME_ERROR("A0096", "文件格式有误"),
|
||||||
|
|
||||||
FILE_SIZE_ERROR("A0096", "文件过大"),
|
FILE_SIZE_ERROR("A0096", "文件过大"),
|
||||||
|
|
||||||
FILE_XLSX_ERROR("A0096", "请上传excel文件"),
|
FILE_XLSX_ERROR("A0096", "请上传excel文件"),
|
||||||
@@ -103,12 +105,18 @@ public enum CommonResponseEnum {
|
|||||||
|
|
||||||
ADVANCE_RESPONSE_ENUM("A00105", "终端响应枚举类型"),
|
ADVANCE_RESPONSE_ENUM("A00105", "终端响应枚举类型"),
|
||||||
|
|
||||||
|
DYNAMIC_RESPONSE_ENUM("A00002", "动态枚举内容"),
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|
||||||
private final String message;
|
private String message;
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
CommonResponseEnum(String code, String message) {
|
CommonResponseEnum(String code, String message) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.common.utils;
|
package com.njcn.common.utils;
|
||||||
|
|
||||||
import cn.hutool.core.text.StrPool;
|
import cn.hutool.core.text.StrPool;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@@ -56,5 +57,115 @@ public class FileUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文件是否为word格式
|
||||||
|
*
|
||||||
|
* @param fileName 文件名
|
||||||
|
*/
|
||||||
|
public static boolean judgeFileIsWord(String fileName) {
|
||||||
|
// 检查文件名是否为空
|
||||||
|
if (StrUtil.isBlank(fileName)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 获取文件扩展名
|
||||||
|
String fileExtension = getFileExtension(fileName);
|
||||||
|
// 定义支持的文件类型
|
||||||
|
String[] allowedExtensions = {"doc", "docx"};
|
||||||
|
|
||||||
|
// 检查扩展名是否在允许的列表中
|
||||||
|
for (String ext : allowedExtensions) {
|
||||||
|
if (ext.equalsIgnoreCase(fileExtension)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文件是否为pdf格式
|
||||||
|
*
|
||||||
|
* @param fileName 文件名
|
||||||
|
*/
|
||||||
|
public static boolean judgeFileIsPdf(String fileName) {
|
||||||
|
// 检查文件名是否为空
|
||||||
|
if (StrUtil.isBlank(fileName)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 获取文件扩展名
|
||||||
|
String fileExtension = getFileExtension(fileName);
|
||||||
|
// 定义支持的文件类型
|
||||||
|
String[] allowedExtensions = {"pdf"};
|
||||||
|
|
||||||
|
// 检查扩展名是否在允许的列表中
|
||||||
|
for (String ext : allowedExtensions) {
|
||||||
|
if (ext.equalsIgnoreCase(fileExtension)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文件是否为excel格式
|
||||||
|
*
|
||||||
|
* @param fileName 文件名
|
||||||
|
*/
|
||||||
|
public static boolean judgeFileIsExcel(String fileName) {
|
||||||
|
// 检查文件名是否为空
|
||||||
|
if (StrUtil.isBlank(fileName)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 获取文件扩展名
|
||||||
|
String fileExtension = getFileExtension(fileName);
|
||||||
|
// 定义支持的文件类型
|
||||||
|
String[] allowedExtensions = {"xls", "xlsx"};
|
||||||
|
|
||||||
|
// 检查扩展名是否在允许的列表中
|
||||||
|
for (String ext : allowedExtensions) {
|
||||||
|
if (ext.equalsIgnoreCase(fileExtension)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文件是否为excel格式
|
||||||
|
*
|
||||||
|
* @param fileName 文件名
|
||||||
|
*/
|
||||||
|
public static boolean judgeFileIsZip(String fileName) {
|
||||||
|
// 检查文件名是否为空
|
||||||
|
if (StrUtil.isBlank(fileName)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 获取文件扩展名
|
||||||
|
String fileExtension = getFileExtension(fileName);
|
||||||
|
// 定义支持的文件类型
|
||||||
|
String[] allowedExtensions = {"zip", "rar"};
|
||||||
|
|
||||||
|
// 检查扩展名是否在允许的列表中
|
||||||
|
for (String ext : allowedExtensions) {
|
||||||
|
if (ext.equalsIgnoreCase(fileExtension)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从文件名中提取扩展名
|
||||||
|
*
|
||||||
|
* @param fileName 文件名
|
||||||
|
* @return 扩展名
|
||||||
|
*/
|
||||||
|
private static String getFileExtension(String fileName) {
|
||||||
|
int dotIndex = fileName.lastIndexOf('.');
|
||||||
|
if (dotIndex == -1) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return fileName.substring(dotIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,6 +323,24 @@ public class PubUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//监测点运行状态(0:投运;1:检修;2:停运;3:调试;4:退运)
|
||||||
|
public static String lineRunFlag(Integer runFlag) {
|
||||||
|
switch (runFlag) {
|
||||||
|
case 0:
|
||||||
|
return "投运";
|
||||||
|
case 1:
|
||||||
|
return "检修";
|
||||||
|
case 2:
|
||||||
|
return "停运";
|
||||||
|
case 3:
|
||||||
|
return "调试";
|
||||||
|
case 4:
|
||||||
|
return "退运";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Integer getRunFlag(String runFlag) {
|
public static Integer getRunFlag(String runFlag) {
|
||||||
switch (runFlag) {
|
switch (runFlag) {
|
||||||
case "投运":
|
case "投运":
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class DataTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
InfluxDbUtils influxDBUtil = new InfluxDbUtils("admin", "123456", "http://192.168.1.18:8086", "pqsbase_sjzx", "");
|
InfluxDbUtils influxDBUtil = new InfluxDbUtils("root", "123456", "http://127.0.0.1:8086", "pqsadmin_jb", "");
|
||||||
|
|
||||||
insert(influxDBUtil);
|
insert(influxDBUtil);
|
||||||
}
|
}
|
||||||
@@ -72,16 +72,88 @@ public class DataTest {
|
|||||||
|
|
||||||
//单条数据插入
|
//单条数据插入
|
||||||
public static void insert(InfluxDbUtils influxDBUtil) {
|
public static void insert(InfluxDbUtils influxDBUtil) {
|
||||||
|
|
||||||
|
// Map<String, String> tags = new HashMap<>();
|
||||||
|
// long time = Long.parseLong("1719921600000");
|
||||||
|
// tags.put("line_id", "82a9bad93e784c37135db4589794e6b0");
|
||||||
|
// tags.put("phasic_type", "A");
|
||||||
|
// tags.put("value_type","CP95");
|
||||||
|
// tags.put("quality_flag","0");
|
||||||
|
//
|
||||||
|
// Map<String, Object> fields = new HashMap<>();
|
||||||
|
// fields.put("i_2",0);
|
||||||
|
// fields.put("i_3",0);
|
||||||
|
// fields.put("i_4",0);
|
||||||
|
// fields.put("i_5",6.02);
|
||||||
|
// fields.put("i_6",0);
|
||||||
|
// fields.put("i_7",0);
|
||||||
|
// fields.put("i_8",0);
|
||||||
|
// fields.put("i_9",0);
|
||||||
|
// fields.put("i_10",0);
|
||||||
|
// fields.put("i_11",0);
|
||||||
|
// fields.put("i_12",0);
|
||||||
|
// fields.put("i_13",0);
|
||||||
|
// fields.put("i_14",0);
|
||||||
|
// fields.put("i_15",3.25);
|
||||||
|
// fields.put("i_16",0);
|
||||||
|
// fields.put("i_17",0);
|
||||||
|
// fields.put("i_18",0);
|
||||||
|
// fields.put("i_19",0);
|
||||||
|
// fields.put("i_20",0);
|
||||||
|
// fields.put("i_21",0);
|
||||||
|
// fields.put("i_22",0);
|
||||||
|
// fields.put("i_23",0);
|
||||||
|
// fields.put("i_24",3.52);
|
||||||
|
// fields.put("i_25",0);
|
||||||
|
// influxDBUtil.insert("data_i", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
Map<String, String> tags = new HashMap<>();
|
Map<String, String> tags = new HashMap<>();
|
||||||
long time = Long.parseLong("1675958400000");
|
long time = Long.parseLong("1719842400000");
|
||||||
tags.put("dev_id", "57d121d45a26f3cc1d7b6ba541f895c0");
|
tags.put("line_id", "ebdf6cbc275c5d7ed8104fcb3792fb0a");
|
||||||
|
tags.put("phasic_type", "A");
|
||||||
|
tags.put("value_type","CP95");
|
||||||
|
tags.put("quality_flag","0");
|
||||||
|
|
||||||
Map<String, Object> fields = new HashMap<>();
|
Map<String, Object> fields = new HashMap<>();
|
||||||
|
fields.put("v_1",10.0);
|
||||||
|
fields.put("v_2",0);
|
||||||
|
fields.put("v_3",0);
|
||||||
|
fields.put("v_4",0);
|
||||||
|
fields.put("v_5",6.02);
|
||||||
|
fields.put("v_6",0);
|
||||||
|
fields.put("v_7",0);
|
||||||
|
fields.put("v_8",0);
|
||||||
|
fields.put("v_9",0);
|
||||||
|
fields.put("v_10",0);
|
||||||
|
fields.put("v_11",0);
|
||||||
|
fields.put("v_12",0);
|
||||||
|
fields.put("v_13",0);
|
||||||
|
fields.put("v_14",0);
|
||||||
|
fields.put("v_15",3.25);
|
||||||
|
fields.put("v_16",0);
|
||||||
|
fields.put("v_17",0);
|
||||||
|
fields.put("v_18",0);
|
||||||
|
fields.put("v_19",0);
|
||||||
|
fields.put("v_20",0);
|
||||||
|
fields.put("v_21",0);
|
||||||
|
fields.put("v_22",0);
|
||||||
|
fields.put("v_23",0);
|
||||||
|
fields.put("v_24",3.52);
|
||||||
|
fields.put("v_25",0);
|
||||||
|
influxDBUtil.insert("data_inharm_v", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Map<String, String> tags = new HashMap<>();
|
||||||
|
// long time = Long.parseLong("1675958400000");
|
||||||
|
// tags.put("dev_id", "57d121d45a26f3cc1d7b6ba541f895c0");
|
||||||
|
// Map<String, Object> fields = new HashMap<>();
|
||||||
// fields.put("due",1440);
|
// fields.put("due",1440);
|
||||||
// fields.put("real",1200);
|
// fields.put("real",1200);
|
||||||
fields.put("online_min", 0);
|
// fields.put("online_min", 0);
|
||||||
fields.put("offline_min", 1440);
|
// fields.put("offline_min", 1440);
|
||||||
fields.put("online_rate", 0.0000);
|
// fields.put("online_rate", 0.0000);
|
||||||
influxDBUtil.insert("pqs_onlinerate", tags, fields, time, TimeUnit.MILLISECONDS);
|
// influxDBUtil.insert("pqs_onlinerate", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||||
// long time = Long.parseLong("1655135328135");
|
// long time = Long.parseLong("1655135328135");
|
||||||
// Map<String, String> tags = new HashMap<>();
|
// Map<String, String> tags = new HashMap<>();
|
||||||
// // tags.put("line_id", "127fad1dcb0077ac2979141b8473a5e4");
|
// // tags.put("line_id", "127fad1dcb0077ac2979141b8473a5e4");
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ public interface OssPath {
|
|||||||
*/
|
*/
|
||||||
String WAVE_DIR="comtrade/";
|
String WAVE_DIR="comtrade/";
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 下载文件
|
||||||
|
*/
|
||||||
|
String DOWNLOAD_DIR="download/";
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 稳态报表
|
* 稳态报表
|
||||||
*/
|
*/
|
||||||
@@ -131,4 +136,14 @@ public interface OssPath {
|
|||||||
*/
|
*/
|
||||||
String THEME="theme/";
|
String THEME="theme/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线监测预告警单
|
||||||
|
*/
|
||||||
|
String ONLINE_REPORT="onlineReport/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统上传文件至装置内,文件存储路径
|
||||||
|
*/
|
||||||
|
String SYSTEM_TO_DEV="systemToDev/";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,15 @@ package com.njcn.poi.excel;
|
|||||||
|
|
||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.CharsetUtil;
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.njcn.web.utils.HttpServletUtil;
|
import com.njcn.web.utils.HttpServletUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.hssf.usermodel.DVConstraint;
|
|
||||||
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
|
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
|
import org.apache.poi.ss.util.CellReference;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFDataValidationConstraint;
|
import org.apache.poi.xssf.usermodel.*;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
|
|
||||||
|
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -21,10 +18,7 @@ import java.io.File;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Collection;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -116,11 +110,31 @@ public class ExcelUtil {
|
|||||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, dataSet);
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, dataSet);
|
||||||
|
setTopLevel(workbook, pullDowns);
|
||||||
if (CollUtil.isNotEmpty(pullDowns)) {
|
if (CollUtil.isNotEmpty(pullDowns)) {
|
||||||
|
int num = 1;
|
||||||
|
CellStyle cellStyle = workbook.createCellStyle();
|
||||||
|
DataFormat format = workbook.createDataFormat();
|
||||||
|
cellStyle.setDataFormat(format.getFormat("@"));
|
||||||
for (PullDown pullDown : pullDowns) {
|
for (PullDown pullDown : pullDowns) {
|
||||||
|
if (pullDown.getIsText()) {
|
||||||
|
ExcelUtil.selectListText(workbook, pullDown.getFirstCol(),cellStyle);
|
||||||
|
} else {
|
||||||
|
String colName = numberToExcelColumn(num);
|
||||||
|
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
||||||
|
if (sum == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (sum > 255) {
|
||||||
|
ExcelUtil.selectListMaxLength(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().size(), colName);
|
||||||
|
num++;
|
||||||
|
} else {
|
||||||
ExcelUtil.selectList(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().toArray(new String[]{}));
|
ExcelUtil.selectList(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().toArray(new String[]{}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Sheet sheetAt = workbook.getSheetAt(0);
|
Sheet sheetAt = workbook.getSheetAt(0);
|
||||||
//获取列数
|
//获取列数
|
||||||
int physicalNumberOfCells = sheetAt.getRow(0).getPhysicalNumberOfCells();
|
int physicalNumberOfCells = sheetAt.getRow(0).getPhysicalNumberOfCells();
|
||||||
@@ -239,6 +253,45 @@ public class ExcelUtil {
|
|||||||
sheet.addValidationData(validation);
|
sheet.addValidationData(validation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param workbook
|
||||||
|
* @param firstCol
|
||||||
|
* @param lastCol
|
||||||
|
* @param colName 列A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
|
||||||
|
* @Description: 当下拉框超过最大字符255,设置隐藏表单来进行展示
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2024/8/13 15:07
|
||||||
|
*/
|
||||||
|
public static void selectListMaxLength(Workbook workbook, int firstCol, int lastCol, int row, String colName) {
|
||||||
|
Sheet sheet = workbook.getSheetAt(0);
|
||||||
|
// 生成下拉列表
|
||||||
|
// 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列
|
||||||
|
CellRangeAddressList regions = new CellRangeAddressList(2, 65535, firstCol, lastCol);
|
||||||
|
String strFormula = workbook.getSheetName(1) + "!$" + colName + "$1:$" + colName + "$" + row;
|
||||||
|
XSSFDataValidationConstraint hiddentConstraint = new XSSFDataValidationConstraint(DataValidationConstraint.ValidationType.LIST, strFormula);
|
||||||
|
// 数据有效性对象
|
||||||
|
DataValidationHelper help = new XSSFDataValidationHelper((XSSFSheet) sheet);
|
||||||
|
DataValidation validation = help.createValidation(hiddentConstraint, regions);
|
||||||
|
sheet.addValidationData(validation);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @param workbook
|
||||||
|
* @param firstCol
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2024/8/20 10:44
|
||||||
|
*/
|
||||||
|
public static void selectListText(Workbook workbook, int firstCol,CellStyle cellStyle) {
|
||||||
|
Sheet sheet = workbook.getSheetAt(0);
|
||||||
|
for (int i = 2; i < 65535; i++) {
|
||||||
|
Row row = sheet.getRow(i);
|
||||||
|
if(ObjectUtil.isNull(row)){
|
||||||
|
row = sheet.createRow(i);
|
||||||
|
}
|
||||||
|
Cell cell = row.createCell(firstCol);
|
||||||
|
cell.setCellStyle(cellStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指定名称、数据下载报表(带指定标题将*显示比必填信息),带有下拉信息
|
* 指定名称、数据下载报表(带指定标题将*显示比必填信息),带有下拉信息
|
||||||
@@ -340,5 +393,66 @@ public class ExcelUtil {
|
|||||||
sheet.addValidationData(validation);
|
sheet.addValidationData(validation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置隐藏表单来进行下拉框
|
||||||
|
*
|
||||||
|
* @param workbook
|
||||||
|
* @param pullDowns
|
||||||
|
*/
|
||||||
|
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
||||||
|
int num = 0;
|
||||||
|
for (PullDown pullDown : pullDowns) {
|
||||||
|
if (!pullDown.getIsText()) {
|
||||||
|
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
||||||
|
if (sum == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (sum > 255) {
|
||||||
|
// 创建隐藏sheet
|
||||||
|
String hiddenSheetName = "hiddenSheetA";
|
||||||
|
if (num == 0) {
|
||||||
|
workbook.createSheet(hiddenSheetName);
|
||||||
|
}
|
||||||
|
//false展示隐藏sheet ,true不展示隐藏sheet
|
||||||
|
workbook.setSheetHidden(workbook.getSheetIndex(workbook.getSheet(hiddenSheetName)), true);
|
||||||
|
Sheet sheet = workbook.getSheet(hiddenSheetName);
|
||||||
|
if (num == 0) {
|
||||||
|
//sheet.getLastRowNum无法区分 有一行和没有 所以这里先建一行
|
||||||
|
sheet.createRow(0);
|
||||||
|
}
|
||||||
|
Row row; //创建数据行
|
||||||
|
sheet.setColumnWidth(num, 4000); //设置每列的列宽
|
||||||
|
for (int j = 0; j < pullDown.getStrings().size(); j++) {
|
||||||
|
if (sheet.getLastRowNum() < j) {
|
||||||
|
row = sheet.createRow(j); //创建数据行
|
||||||
|
} else {
|
||||||
|
row = sheet.getRow(j);
|
||||||
|
}
|
||||||
|
//设置对应单元格的值
|
||||||
|
row.createCell(num).setCellValue(pullDown.getStrings().get(j));
|
||||||
|
}
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取根据数值获取列字母(1=A,2=B,3=C,.......,27=AA)
|
||||||
|
*
|
||||||
|
* @param n
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String numberToExcelColumn(int n) {
|
||||||
|
CellReference cellRef = new CellReference(0, n - 1, false, false); // Row and column are 0-based
|
||||||
|
int colIndex = cellRef.getCol();
|
||||||
|
StringBuilder columnName = new StringBuilder();
|
||||||
|
while (colIndex >= 0) {
|
||||||
|
columnName.insert(0, (char) ('A' + (colIndex % 26)));
|
||||||
|
colIndex /= 26;
|
||||||
|
colIndex--;
|
||||||
|
}
|
||||||
|
return columnName.toString();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,13 @@ public class PullDown {
|
|||||||
|
|
||||||
//起始列
|
//起始列
|
||||||
private Integer firstCol;
|
private Integer firstCol;
|
||||||
|
|
||||||
//结束列
|
//结束列
|
||||||
private Integer lastCol;
|
private Integer lastCol;
|
||||||
|
|
||||||
|
//是否设置单元格(文本)
|
||||||
|
private Boolean isText = false;
|
||||||
|
|
||||||
//属性值
|
//属性值
|
||||||
private List<String> strings;
|
private List<String> strings;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,4 +74,18 @@ public interface AppRedisKey {
|
|||||||
*/
|
*/
|
||||||
String FILE_WAITING="fileWaitingKey:";
|
String FILE_WAITING="fileWaitingKey:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程信息
|
||||||
|
*/
|
||||||
|
String PROJECT_INFO="projectInfoKey:";
|
||||||
|
|
||||||
|
String FILE_INFO="fileInfoKey:";
|
||||||
|
|
||||||
|
String DEVICE_ROOT_PATH="deviceRootPathKey:";
|
||||||
|
|
||||||
|
String DEVICE_MID="deviceMidKey:";
|
||||||
|
|
||||||
|
String UPLOAD = "uploadKey:";
|
||||||
|
|
||||||
|
String DOWNLOAD = "downloadKey:";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,13 @@ public enum RedisKeyEnum {
|
|||||||
/***
|
/***
|
||||||
* MQ消息key缓存时间,默认72小时 * 60 * 60
|
* MQ消息key缓存时间,默认72小时 * 60 * 60
|
||||||
*/
|
*/
|
||||||
ROCKET_MQ_KEY("ROCKET_MQ", 259200L);
|
ROCKET_MQ_KEY("ROCKET_MQ", 259200L),
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 存放用户的角色关系
|
||||||
|
*/
|
||||||
|
USER_ROLE_TYPE_KEY("USER_ROLE_TYPE_KEY", -1L);
|
||||||
|
|
||||||
|
|
||||||
private final String key;
|
private final String key;
|
||||||
|
|||||||
@@ -51,7 +51,13 @@ public class FeignConfig {
|
|||||||
//对结果进行转换
|
//对结果进行转换
|
||||||
HttpResult<Object> result = PubUtils.json2obj(bodyStr, type);
|
HttpResult<Object> result = PubUtils.json2obj(bodyStr, type);
|
||||||
//如果返回错误,且为内部错误,则直接抛出异常
|
//如果返回错误,且为内部错误,则直接抛出异常
|
||||||
CommonResponseEnum commonResponseEnum = EnumUtils.getCommonResponseEnumByCode(result.getCode());
|
CommonResponseEnum commonResponseEnum;
|
||||||
|
if(result.getCode().equals(CommonResponseEnum.DYNAMIC_RESPONSE_ENUM.getCode())){
|
||||||
|
commonResponseEnum = CommonResponseEnum.DYNAMIC_RESPONSE_ENUM;
|
||||||
|
commonResponseEnum.setMessage(result.getMessage());
|
||||||
|
}else{
|
||||||
|
commonResponseEnum = EnumUtils.getCommonResponseEnumByCode(result.getCode());
|
||||||
|
}
|
||||||
switch (commonResponseEnum) {
|
switch (commonResponseEnum) {
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -40,6 +40,13 @@ public enum GWSendEnum {
|
|||||||
|
|
||||||
//调用总部下发工单的反馈单接口
|
//调用总部下发工单的反馈单接口
|
||||||
WORK_ORDER_FEEDBACK("workOrderFeedBack", "/pms-ghq-powerquality-start/powerQuality/workOrder/receiveFeedbackInfo"),
|
WORK_ORDER_FEEDBACK("workOrderFeedBack", "/pms-ghq-powerquality-start/powerQuality/workOrder/receiveFeedbackInfo"),
|
||||||
|
|
||||||
|
PARK_AND_STATION("parkAndStation", "/pms-ghq-powerquality-start/powerQuality/park/create"),
|
||||||
|
|
||||||
|
REPORT_CREATE("reportCreate", "/pms-ghq-powerquality-start/powerQuality/report/create"),
|
||||||
|
|
||||||
|
COMM_POINT("commPoint","/pms-ghq-powerquality-start/powerQuality/publicConnection/pqBusMonitorDataStatisticalCreate")
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ public class SendParam {
|
|||||||
@ApiModelProperty(value = "统计日期")
|
@ApiModelProperty(value = "统计日期")
|
||||||
private String statisticalDate;
|
private String statisticalDate;
|
||||||
|
|
||||||
|
private String statisticalType;
|
||||||
|
|
||||||
|
private String isAppend;
|
||||||
|
|
||||||
@ApiModelProperty(value = "上报参数")
|
@ApiModelProperty(value = "上报参数")
|
||||||
private List stats;
|
private List stats;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public class LogServiceImpl implements ILogService {
|
|||||||
|
|
||||||
private final MqttPublisher publisher;
|
private final MqttPublisher publisher;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步记录controller中返回的信息内容
|
* 异步记录controller中返回的信息内容
|
||||||
*
|
*
|
||||||
@@ -84,10 +85,12 @@ public class LogServiceImpl implements ILogService {
|
|||||||
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
//推送审计消息功能
|
//推送审计消息功能
|
||||||
if(severity!=0){
|
if(severity!=0){
|
||||||
|
if(!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)){
|
||||||
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
//发送邮箱功能
|
//发送邮箱功能
|
||||||
if(severity==2&&logInfoDTO.getResult()==0){
|
if(severity==2&&logInfoDTO.getResult()==0){
|
||||||
publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//如果存在设备日志注解,则记录设备日志
|
//如果存在设备日志注解,则记录设备日志
|
||||||
@@ -167,10 +170,12 @@ public class LogServiceImpl implements ILogService {
|
|||||||
private void auditPush(Integer severity, LogInfoDTO logInfoDTO) {
|
private void auditPush(Integer severity, LogInfoDTO logInfoDTO) {
|
||||||
//推送审计消息功能
|
//推送审计消息功能
|
||||||
if(severity !=0){
|
if(severity !=0){
|
||||||
|
if(!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) {
|
||||||
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
//发送邮箱功能
|
//发送邮箱功能
|
||||||
if (severity == 2 && logInfoDTO.getResult() == 0) {
|
if (severity == 2 && logInfoDTO.getResult() == 0) {
|
||||||
publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,6 +343,20 @@ public class RequestUtil {
|
|||||||
return StrUtil.isBlank(loginName) ? LogInfo.UNKNOWN_USER : loginName;
|
return StrUtil.isBlank(loginName) ? LogInfo.UNKNOWN_USER : loginName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ServerHttpRequest获取在网关中存储的用户昵称
|
||||||
|
*/
|
||||||
|
public static String getLoginNameByPayload(HttpServletRequest request) {
|
||||||
|
String loginName = LogInfo.UNKNOWN_USER;
|
||||||
|
JSONObject jwtPayload = getJwtPayload(request);
|
||||||
|
if (Objects.nonNull(jwtPayload)) {
|
||||||
|
String loginNameTemp = jwtPayload.getString(SecurityConstants.USER_NAME_KEY);
|
||||||
|
loginName = StrUtil.isBlank(loginNameTemp) ? LogInfo.UNKNOWN_USER : loginNameTemp;
|
||||||
|
}
|
||||||
|
return loginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ServerHttpRequest获取在网关中存储的用户昵称
|
* ServerHttpRequest获取在网关中存储的用户昵称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -96,8 +96,8 @@ public enum DeviceResponseEnum {
|
|||||||
SAME_ALARM_STRATEGY("A0361","当前等级策略已存在"),
|
SAME_ALARM_STRATEGY("A0361","当前等级策略已存在"),
|
||||||
LINE_GRADE_INDEX_ERR("A0362","异常等级索引"),
|
LINE_GRADE_INDEX_ERR("A0362","异常等级索引"),
|
||||||
LINE_GRADE_LESS("A0363","监测点等级策略缺失"),
|
LINE_GRADE_LESS("A0363","监测点等级策略缺失"),
|
||||||
FLOW_UPDATE("A0364","默认类型必须存在一个")
|
FLOW_UPDATE("A0364","默认类型必须存在一个"),
|
||||||
|
NEWSTATION_IS_BIND_LINE("A0365","已绑定监测点")
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -34,4 +34,7 @@ public class LineDTO {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "objType",value = "对象类型")
|
@ApiModelProperty(name = "objType",value = "对象类型")
|
||||||
private String objType;
|
private String objType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "新能源场站信息ID")
|
||||||
|
private String newStationId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.njcn.device.biz.pojo.dto;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +31,16 @@ public class SubGetBase implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String voltageLevel;
|
private String voltageLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private BigDecimal lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门
|
* 部门
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import java.math.RoundingMode;
|
|||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@Deprecated
|
||||||
public class COverlimit {
|
public class COverlimit {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ public class COverlimitUtil {
|
|||||||
* 获取额定线电压
|
* 获取额定线电压
|
||||||
*/
|
*/
|
||||||
private static float getUl(Float voltageLevel){
|
private static float getUl(Float voltageLevel){
|
||||||
float value = 3.14159f;
|
float value;
|
||||||
if(voltageLevel<DicDataEnum.KV6.getValue()){
|
if(voltageLevel<DicDataEnum.KV6.getValue()){
|
||||||
value = 0.4f;
|
value = 0.4f;
|
||||||
}else if(voltageLevel<DicDataEnum.KV10.getValue()){
|
}else if(voltageLevel<DicDataEnum.KV10.getValue()){
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
<artifactId>pq-device-boot</artifactId>
|
<artifactId>pq-device-boot</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.njcn</groupId>
|
<!-- <groupId>com.njcn</groupId>-->
|
||||||
<artifactId>pms-device-boot</artifactId>
|
<!-- <artifactId>pms-device-boot</artifactId>-->
|
||||||
<version>${project.version}</version>
|
<!-- <version>${project.version}</version>-->
|
||||||
</dependency>-->
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
|
|||||||
@@ -6,10 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
|
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||||
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
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.TerminalQueryParam;
|
|
||||||
import com.njcn.device.pms.pojo.param.gw.TypicalSourceParam;
|
import com.njcn.device.pms.pojo.param.gw.TypicalSourceParam;
|
||||||
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;
|
||||||
@@ -92,4 +89,7 @@ public interface MonitorClient {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/monitorTypicalList")
|
@PostMapping("/monitorTypicalList")
|
||||||
HttpResult<Page<TypicalSourceOnLine>> monitorTypicalList(@RequestBody TypicalSourceParam param);
|
HttpResult<Page<TypicalSourceOnLine>> monitorTypicalList(@RequestBody TypicalSourceParam param);
|
||||||
|
|
||||||
|
@PostMapping("/getMonitorListByParam")
|
||||||
|
HttpResult<List<Monitor>> getMonitorListByParam(@RequestBody MonitorParam monitorParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.device.pms.api.MonitorClient;
|
import com.njcn.device.pms.api.MonitorClient;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
||||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||||
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
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.TerminalQueryParam;
|
|
||||||
import com.njcn.device.pms.pojo.param.gw.TypicalSourceParam;
|
import com.njcn.device.pms.pojo.param.gw.TypicalSourceParam;
|
||||||
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;
|
||||||
@@ -83,6 +80,12 @@ public class MonitorClientFallbackFactory implements FallbackFactory<MonitorClie
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "典型源荷下穿监测点信息接口 ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "典型源荷下穿监测点信息接口 ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<Monitor>> getMonitorListByParam(MonitorParam monitorParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "根据条件查询监测点 ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.device.pms.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/6/21
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum PmsEnum {
|
||||||
|
|
||||||
|
|
||||||
|
NO_UPLOAD("未上送","0"),
|
||||||
|
HAS_UPLOAD("以上送","1"),
|
||||||
|
WAIT_RETURN_UPLOAD("待重新上送","2"),
|
||||||
|
DELETE_UPLOAD("已删除","3"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
private final String code;
|
||||||
|
|
||||||
|
PmsEnum(String name, String code) {
|
||||||
|
this.name = name;
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.device.pms.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/6/24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MajorMonitorDTO {
|
||||||
|
|
||||||
|
private String objId;
|
||||||
|
private String provinceOrg;
|
||||||
|
private String provinceOrgName;
|
||||||
|
private String cityOrg;
|
||||||
|
private String cityOrgName;
|
||||||
|
private String maintOrg;
|
||||||
|
private String maintOrgName;
|
||||||
|
private String monitorName;
|
||||||
|
private String monitorVoltageLevel;
|
||||||
|
private String monitorId;
|
||||||
|
private String monitorStatus;
|
||||||
|
private Date monitorOperateDate;
|
||||||
|
private Date monitorStopDate;
|
||||||
|
private String substationId;
|
||||||
|
private String substationName;
|
||||||
|
private String busId;
|
||||||
|
private String busName;
|
||||||
|
private String outLineIntervalId;
|
||||||
|
private String outLineIntervalName;
|
||||||
|
private String monitorObjTypeBig;
|
||||||
|
private String monitorObjTypeSmall;
|
||||||
|
private String monitorTag;
|
||||||
|
private String monitorObjName;
|
||||||
|
private String monitorObjId;
|
||||||
|
private String isLine;
|
||||||
|
private BigDecimal minShortCapacity;
|
||||||
|
private BigDecimal supplyEquipCapacity;
|
||||||
|
private BigDecimal userProtocolCapacity;
|
||||||
|
private String terminalCode;
|
||||||
|
private String terminalManufacturer;
|
||||||
|
private String terminalModel;
|
||||||
|
private String terminalManufactureNum;
|
||||||
|
private String terminalConnect;
|
||||||
|
private String neutralGround;
|
||||||
|
private String evtType;
|
||||||
|
private String statisticalType;
|
||||||
|
private String statisticalDate;
|
||||||
|
private String isMonitorOnline;
|
||||||
|
private String isTerminalOnline;
|
||||||
|
private Integer onlineMonitorNum;
|
||||||
|
private Integer runMonitorNum;
|
||||||
|
private BigDecimal onlineMonitorRate;
|
||||||
|
private Long expectCollectNum;
|
||||||
|
private Long actualCollectNum;
|
||||||
|
private BigDecimal dataFullRate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.njcn.device.pms.pojo.dto;
|
||||||
|
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkPO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/6/24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ParkDto {
|
||||||
|
|
||||||
|
private List<PmsParkPO> parkVoListt;
|
||||||
|
|
||||||
|
|
||||||
|
private List<ParkSubstationRelVo> parkSubstationRelVoList;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class ParkSubstationRelVo{
|
||||||
|
private String objId;
|
||||||
|
private String parkId;
|
||||||
|
private String substationId;
|
||||||
|
private String substationProvinceOrg;
|
||||||
|
private String substationProvinceOrgName;
|
||||||
|
private String substationCityOrg;
|
||||||
|
private String substationCityOrgName;
|
||||||
|
private String substationMaintOrg;
|
||||||
|
private String substationMaintOrgName;
|
||||||
|
private String substationName;
|
||||||
|
private String substationVoltageLevel;
|
||||||
|
private String substationRunStatus;
|
||||||
|
private String substationOperateDate;
|
||||||
|
private String createTime;
|
||||||
|
private String updateTime;
|
||||||
|
private String isDelete;
|
||||||
|
private String deleteTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.njcn.device.pms.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RunMonitorStatisticalDTO {
|
||||||
|
|
||||||
|
private String objId;
|
||||||
|
private String provinceOrg;
|
||||||
|
private String provinceOrgName;
|
||||||
|
private String cityOrg;
|
||||||
|
private String cityOrgName;
|
||||||
|
private String maintOrg;
|
||||||
|
private String maintOrgName;
|
||||||
|
private String monitorName;
|
||||||
|
private String monitorVoltageLevel;
|
||||||
|
private String monitorId;
|
||||||
|
private String monitorStatus;
|
||||||
|
private Date monitorOperateDate;
|
||||||
|
private Date monitorStopDate;
|
||||||
|
private String substationId;
|
||||||
|
private String substationName;
|
||||||
|
private String busId;
|
||||||
|
private String busName;
|
||||||
|
private String outLineIntervalId;
|
||||||
|
private String outLineIntervalName;
|
||||||
|
private String monitorObjTypeBig;
|
||||||
|
private String monitorObjTypeSmall;
|
||||||
|
private String monitorTag;
|
||||||
|
private String monitorObjName;
|
||||||
|
private String monitorObjId;
|
||||||
|
private String isLine;
|
||||||
|
private BigDecimal minShortCapacity;
|
||||||
|
private BigDecimal supplyEquipCapacity;
|
||||||
|
private BigDecimal userProtocolCapacity;
|
||||||
|
private String terminalCode;
|
||||||
|
private String terminalManufacturer;
|
||||||
|
private String terminalModel;
|
||||||
|
private String terminalManufactureNum;
|
||||||
|
private String terminalConnect;
|
||||||
|
private String neutralGround;
|
||||||
|
private String evtType;
|
||||||
|
private String statisticalType;
|
||||||
|
private String statisticalDate;
|
||||||
|
private String isMonitorOnline;
|
||||||
|
private String isTerminalOnline;
|
||||||
|
private Integer onlineMonitorNum;
|
||||||
|
private Integer runMonitorNum;
|
||||||
|
private BigDecimal onlineMonitorRate;
|
||||||
|
private Long expectCollectNum;
|
||||||
|
private Long actualCollectNum;
|
||||||
|
private BigDecimal dataFullRate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.njcn.device.pms.pojo.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 园区表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class PmsParkParam {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省单位
|
||||||
|
*/
|
||||||
|
private String provinceOrg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省单位名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市单位
|
||||||
|
*/
|
||||||
|
private String cityOrg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市单位名称
|
||||||
|
*/
|
||||||
|
private String cityOrgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维单位
|
||||||
|
*/
|
||||||
|
private String maintOrg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维单位名称
|
||||||
|
*/
|
||||||
|
private String maintOrgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区名称
|
||||||
|
*/
|
||||||
|
private String parkName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区性质
|
||||||
|
*/
|
||||||
|
private String parkNature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区级别
|
||||||
|
*/
|
||||||
|
private String parkLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区状态
|
||||||
|
*/
|
||||||
|
private String parkStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.删除 1.正常
|
||||||
|
*/
|
||||||
|
private LocalDateTime deleteTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePmsParkParam extends PmsParkParam{
|
||||||
|
|
||||||
|
private String objId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class PmsParkQuery extends BaseParam {
|
||||||
|
|
||||||
|
private String objId;
|
||||||
|
|
||||||
|
private String maintOrg;
|
||||||
|
|
||||||
|
private String cityOrg;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -65,7 +65,6 @@ public class PowerDistributionareaParam {
|
|||||||
private String regionalism;
|
private String regionalism;
|
||||||
|
|
||||||
@ApiModelProperty(name = "regionalism", value = "设备地区特征")
|
@ApiModelProperty(name = "regionalism", value = "设备地区特征")
|
||||||
@NotBlank(message = "设备地区特征不可为空")
|
|
||||||
private String devRegionalism;
|
private String devRegionalism;
|
||||||
|
|
||||||
@ApiModelProperty(name = "ifRuralPowerGrid", value = "是否农网:0-否;1:是")
|
@ApiModelProperty(name = "ifRuralPowerGrid", value = "是否农网:0-否;1:是")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.device.pms.pojo.po;
|
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.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
@@ -28,6 +29,7 @@ public class PmsMidLedger extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* Id
|
* Id
|
||||||
*/
|
*/
|
||||||
|
@TableId
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class PmsNewEnergy extends BaseEntity {
|
|||||||
private String voltageLevel;
|
private String voltageLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压等级
|
* 电站名称
|
||||||
*/
|
*/
|
||||||
@TableField("Powerr_Name")
|
@TableField("Powerr_Name")
|
||||||
private String powerrName;
|
private String powerrName;
|
||||||
@@ -66,11 +66,16 @@ public class PmsNewEnergy extends BaseEntity {
|
|||||||
private String objType;
|
private String objType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压等级
|
* 场站状态 01.在运站 02.新(改,扩)站
|
||||||
*/
|
*/
|
||||||
@TableField("station_status")
|
@TableField("station_status")
|
||||||
private String stationStatus;
|
private String stationStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场站状态
|
||||||
|
*/
|
||||||
|
private Double ratedCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态:0-删除 1-正常
|
* 状态:0-删除 1-正常
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.njcn.device.pms.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 园区表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pms_park")
|
||||||
|
public class PmsParkPO extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uuid
|
||||||
|
*/
|
||||||
|
@TableId(value = "obj_id",type = IdType.ASSIGN_UUID)
|
||||||
|
private String objId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省单位
|
||||||
|
*/
|
||||||
|
private String provinceOrg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省单位名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市单位
|
||||||
|
*/
|
||||||
|
private String cityOrg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市单位名称
|
||||||
|
*/
|
||||||
|
private String cityOrgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维单位
|
||||||
|
*/
|
||||||
|
private String maintOrg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维单位名称
|
||||||
|
*/
|
||||||
|
private String maintOrgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区名称
|
||||||
|
*/
|
||||||
|
private String parkName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区性质
|
||||||
|
*/
|
||||||
|
private String parkNature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区级别
|
||||||
|
*/
|
||||||
|
private String parkLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区状态
|
||||||
|
*/
|
||||||
|
private String parkStatus;
|
||||||
|
|
||||||
|
|
||||||
|
private String isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.删除 1.正常
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime deleteTime;
|
||||||
|
|
||||||
|
private String uploadStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.device.pms.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pms_park_station_ass")
|
||||||
|
public class PmsParkStationAss {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private String objId;
|
||||||
|
|
||||||
|
@NotBlank(message = "园区id不可为空")
|
||||||
|
private String parkId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 园区所有电站id关联pms_mid_ledger
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "电站不可为空")
|
||||||
|
private String midStationId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.njcn.device.pms.pojo.vo;
|
||||||
|
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2023/8/21 10:16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DeviceUnitVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "编号")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "频率")
|
||||||
|
private String unitFrequency;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "频率偏差")
|
||||||
|
private String unitFrequencyDev;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "相电压有效值")
|
||||||
|
private String phaseVoltage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "线电压有效值")
|
||||||
|
private String lineVoltage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电压上偏差")
|
||||||
|
private String voltageDev;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电压下偏差")
|
||||||
|
private String uvoltageDev;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电流有效值")
|
||||||
|
private String ieffective;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单相有功功率")
|
||||||
|
private String singleP;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单相视在功率")
|
||||||
|
private String singleViewP;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单相无功功率")
|
||||||
|
private String singleNoP;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "总有功功率")
|
||||||
|
private String totalActiveP;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "总视在功率")
|
||||||
|
private String totalViewP;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "总无功功率")
|
||||||
|
private String totalNoP;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "相(线)电压基波有效值")
|
||||||
|
private String vfundEffective;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "基波电流")
|
||||||
|
private String ifund;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "基波有功功率")
|
||||||
|
private String fundActiveP;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "基波无功功率")
|
||||||
|
private String fundNoP;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电压总谐波畸变率")
|
||||||
|
private String vdistortion;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "2~50次谐波电压含有率")
|
||||||
|
private String vharmonicRate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "2~50次谐波电流有效值")
|
||||||
|
private String iharmonic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "2~50次谐波有功功率")
|
||||||
|
private String pharmonic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0.5~49.5次间谐波电流有效值")
|
||||||
|
private String iiharmonic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "正序电压")
|
||||||
|
private String positiveV;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "运行状态")
|
||||||
|
private String devFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "零序负序电压")
|
||||||
|
private String noPositiveV;
|
||||||
|
@ApiModelProperty(value = "子集数据")
|
||||||
|
List<?> children;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DeviceUnit extends PqsDeviceUnit {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "编号")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父节点")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "运行状态")
|
||||||
|
private String devFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "子集数据")
|
||||||
|
List<?> children;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.device.pms.controller.ledgerManger;
|
package com.njcn.device.pms.controller.ledgerManger;
|
||||||
|
|
||||||
import cn.hutool.core.date.TimeInterval;
|
import cn.hutool.core.date.TimeInterval;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
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;
|
||||||
@@ -14,12 +15,15 @@ import com.njcn.device.biz.pojo.param.MonitorGetParam;
|
|||||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import com.njcn.device.pms.mapper.majornetwork.PqsDeviceUnitMapper;
|
||||||
|
import com.njcn.device.pms.pojo.po.DistributionMonitor;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||||
import com.njcn.device.pms.service.ledgerManger.CommTerminalService;
|
import com.njcn.device.pms.service.ledgerManger.CommTerminalService;
|
||||||
import com.njcn.device.pms.service.majornetwork.IDistributionMonitorService;
|
import com.njcn.device.pms.service.majornetwork.IDistributionMonitorService;
|
||||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||||
import com.njcn.device.pms.service.majornetwork.ITerminalService;
|
import com.njcn.device.pms.service.majornetwork.ITerminalService;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
|
||||||
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.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -56,6 +60,8 @@ public class CommTerminalController extends BaseController {
|
|||||||
|
|
||||||
private final ITerminalService terminalService;
|
private final ITerminalService terminalService;
|
||||||
|
|
||||||
|
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过部门获取所有子集部门所拥有的监测点
|
* 通过部门获取所有子集部门所拥有的监测点
|
||||||
@@ -269,6 +275,9 @@ public class CommTerminalController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取实际,投运,谐波系统 的监测点
|
||||||
|
*/
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@GetMapping("/getRunMonitorIds")
|
@GetMapping("/getRunMonitorIds")
|
||||||
@ApiOperation("获取投运谐波系统所有监测点")
|
@ApiOperation("获取投运谐波系统所有监测点")
|
||||||
@@ -279,20 +288,6 @@ public class CommTerminalController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取实际,投运,谐波系统 的监测点
|
|
||||||
* @author cdf
|
|
||||||
* @date 2023/9/18
|
|
||||||
*/
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
|
||||||
@GetMapping("/getRunMonitorList")
|
|
||||||
@ApiOperation("获取实际,投运,谐波系统 的监测点")
|
|
||||||
public HttpResult<List<String>> getRunMonitorList() {
|
|
||||||
String methodDescribe = getMethodDescribe("getRunMonitorList");
|
|
||||||
List<String> result = commTerminalService.getOneMonitorIds();
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据监测点集合获取监测点详情
|
* 根据监测点集合获取监测点详情
|
||||||
* @author cdf
|
* @author cdf
|
||||||
@@ -334,7 +329,25 @@ public class CommTerminalController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
||||||
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId) {
|
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId) {
|
||||||
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
||||||
PqsDeviceUnit pqsDeviceUnit = new PqsDeviceUnit();
|
String devId;
|
||||||
|
if(lineId.contains("pmswifi_")){
|
||||||
|
|
||||||
|
DistributionMonitor distributionMonitor = iDistributionMonitorService.getOne(new LambdaQueryWrapper<DistributionMonitor>().eq(DistributionMonitor::getMonitorId,lineId));
|
||||||
|
if(Objects.isNull(distributionMonitor)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new PqsDeviceUnit(), methodDescribe);
|
||||||
|
}
|
||||||
|
devId = distributionMonitor.getTerminalId();
|
||||||
|
}else {
|
||||||
|
Monitor monitor = monitorService.getById(lineId);
|
||||||
|
if(Objects.isNull(monitor)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new PqsDeviceUnit(), methodDescribe);
|
||||||
|
}
|
||||||
|
devId = monitor.getTerminalId();
|
||||||
|
}
|
||||||
|
PqsDeviceUnit pqsDeviceUnit = pqsDeviceUnitMapper.selectById(devId);
|
||||||
|
if(Objects.isNull(pqsDeviceUnit)){
|
||||||
|
pqsDeviceUnit = new PqsDeviceUnit();
|
||||||
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package com.njcn.device.pms.controller.ledgerManger;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.pms.pojo.param.PmsParkParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkPO;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkStationAss;
|
||||||
|
import com.njcn.device.pms.service.ledgerManger.IPmsParkService;
|
||||||
|
import com.njcn.device.pms.service.ledgerManger.IPmsParkStationAssService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 园区表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pmsPark")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PmsParkController extends BaseController {
|
||||||
|
|
||||||
|
private final IPmsParkService iPmsParkService;
|
||||||
|
|
||||||
|
private final IPmsParkStationAssService iPmsParkStationAssService;
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/addPark")
|
||||||
|
@ApiOperation("新增园区")
|
||||||
|
public HttpResult<Object> addPark(@RequestBody PmsParkParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("addPark");
|
||||||
|
Boolean result = iPmsParkService.addPark(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/updatePark")
|
||||||
|
@ApiOperation("修改园区台账")
|
||||||
|
public HttpResult<Object> updatePark(@RequestBody PmsParkParam.UpdatePmsParkParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("updatePark");
|
||||||
|
Boolean result = iPmsParkService.updatePark(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||||
|
@PostMapping("/delPark")
|
||||||
|
@ApiOperation("修改园区台账")
|
||||||
|
public HttpResult<Object> delPark(@RequestBody List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("delPark");
|
||||||
|
Boolean result = iPmsParkService.removeByIds(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/pageList")
|
||||||
|
@ApiOperation("分页查询园区台账")
|
||||||
|
public HttpResult<Page<PmsParkPO>> pageList(@RequestBody PmsParkParam.PmsParkQuery param) {
|
||||||
|
String methodDescribe = getMethodDescribe("pageList");
|
||||||
|
Page<PmsParkPO> result = iPmsParkService.pageList(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/uploadParkGw")
|
||||||
|
@ApiOperation("上送园区到国网")
|
||||||
|
public HttpResult<Boolean> uploadParkGw(@RequestBody List<String> objIds) {
|
||||||
|
String methodDescribe = getMethodDescribe("uploadParkGw");
|
||||||
|
Boolean result = iPmsParkService.uploadParkGw(objIds);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/pageStationList")
|
||||||
|
@ApiOperation("分页查询园区下面的电站")
|
||||||
|
public HttpResult<Page<PmsMidLedger>> pageStationList(@RequestBody PmsParkParam.PmsParkQuery param) {
|
||||||
|
String methodDescribe = getMethodDescribe("pageStationList");
|
||||||
|
Page<PmsMidLedger> result = iPmsParkService.pageStationList(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/stationList")
|
||||||
|
@ApiOperation("根据运行单位获取下面的电站")
|
||||||
|
public HttpResult<List<PmsMidLedger>> stationList(@RequestBody PmsParkParam.PmsParkQuery param) {
|
||||||
|
String methodDescribe = getMethodDescribe("stationList");
|
||||||
|
List<PmsMidLedger> result = iPmsParkService.stationList(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/addParkStationAss")
|
||||||
|
@ApiOperation("新增园区电站")
|
||||||
|
public HttpResult<Object> addParkStationAss(@RequestBody PmsParkStationAss param) {
|
||||||
|
String methodDescribe = getMethodDescribe("addParkStationAss");
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PmsParkStationAss> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PmsParkStationAss::getParkId,param.getParkId()).eq(PmsParkStationAss::getMidStationId,param.getMidStationId());
|
||||||
|
long count = iPmsParkStationAssService.count(lambdaQueryWrapper);
|
||||||
|
if(count>0){
|
||||||
|
throw new BusinessException(CommonResponseEnum.FAIL,"园区已经存在该电站");
|
||||||
|
}
|
||||||
|
PmsParkStationAss pmsParkStationAss = new PmsParkStationAss();
|
||||||
|
BeanUtil.copyProperties(param,pmsParkStationAss);
|
||||||
|
Boolean result = iPmsParkStationAssService.save(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||||
|
@PostMapping("/delParkStationAss")
|
||||||
|
@ApiOperation("删除园区电站")
|
||||||
|
public HttpResult<Object> delParkStationAss(@RequestBody @Validated PmsParkStationAss param) {
|
||||||
|
String methodDescribe = getMethodDescribe("delParkStationAss");
|
||||||
|
LambdaQueryWrapper<PmsParkStationAss> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(PmsParkStationAss::getParkId,param.getParkId()).eq(PmsParkStationAss::getMidStationId,param.getMidStationId());
|
||||||
|
Boolean result = iPmsParkStationAssService.remove(lambdaQueryWrapper);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.njcn.device.pms.controller.majornetwork;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import com.njcn.device.pms.pojo.vo.DeviceUnitVo;
|
||||||
|
import com.njcn.device.pms.service.majornetwork.IPqsDeviceUnitService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据单位管理
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-08-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "数据单位管理")
|
||||||
|
@RequestMapping("/pq/pqsDeviceUnit")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PqsDeviceUnitController extends BaseController {
|
||||||
|
|
||||||
|
private final IPqsDeviceUnitService iPqsDeviceUnitService;
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/nodeTree")
|
||||||
|
@ApiOperation("数据单位查询树")
|
||||||
|
@ApiImplicitParam(name = "devFlag", value = "实体", required = true)
|
||||||
|
public HttpResult<List<DeviceUnitVo>> nodeTree(String devFlag) {
|
||||||
|
String methodDescribe = getMethodDescribe("nodeTree");
|
||||||
|
List<DeviceUnitVo> pqsDeviceUnitVos = iPqsDeviceUnitService.nodeList(devFlag);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnitVos, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/saveDeviceUnit")
|
||||||
|
@ApiOperation("数据单位修改")
|
||||||
|
@ApiImplicitParam(name = "unit", value = "实体", required = true)
|
||||||
|
public HttpResult<Boolean> saveDeviceUnit(@RequestBody PqsDeviceUnit unit) {
|
||||||
|
String methodDescribe = getMethodDescribe("saveDeviceUnit");
|
||||||
|
Boolean aBoolean = iPqsDeviceUnitService.saveDeviceUnit(unit);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, aBoolean, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/lineUnitDetail")
|
||||||
|
@ApiOperation("根据监测点id获取数据单位")
|
||||||
|
@ApiImplicitParam(name = "lineID", value = "实体", required = true)
|
||||||
|
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineID") String lineID) {
|
||||||
|
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
||||||
|
PqsDeviceUnit pqsDeviceUnit = iPqsDeviceUnitService.lineUnitDetail(lineID);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/devUnitDetail")
|
||||||
|
@ApiOperation("根据终端id获取数据单位")
|
||||||
|
@ApiImplicitParam(name = "devID", value = "实体", required = true)
|
||||||
|
public HttpResult<PqsDeviceUnit> devUnitDetail(@RequestParam("devID") String devID) {
|
||||||
|
String methodDescribe = getMethodDescribe("devUnitDetail");
|
||||||
|
PqsDeviceUnit pqsDeviceUnit = iPqsDeviceUnitService.devUnitDetail(devID);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.device.pms.mapper.majornetwork;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pms.pojo.dto.ParkDto;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkPO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 园区表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
public interface PmsParkMapper extends BaseMapper<PmsParkPO> {
|
||||||
|
|
||||||
|
|
||||||
|
List<ParkDto.ParkSubstationRelVo> getParkStationAss(@Param("parkIds")List<String> parkIds);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.device.pms.mapper.majornetwork;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkStationAss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
public interface PmsParkStationAssMapper extends BaseMapper<PmsParkStationAss> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.njcn.device.pms.mapper.majornetwork;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/8/21
|
||||||
|
*/
|
||||||
|
public interface PqsDeviceUnitMapper extends BaseMapper<PqsDeviceUnit> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.device.pms.mapper.majornetwork.PmsParkMapper">
|
||||||
|
|
||||||
|
<select id="getParkStationAss" resultType="com.njcn.device.pms.pojo.dto.ParkDto$ParkSubstationRelVo">
|
||||||
|
select
|
||||||
|
ass.obj_Id,
|
||||||
|
park.obj_id parkId,
|
||||||
|
mid.id substationId,
|
||||||
|
park.province_Org substationProvinceOrg,
|
||||||
|
park.province_Name substationProvinceOrgName,
|
||||||
|
mid.cityOrg substationCityOrg,
|
||||||
|
mid.cityOrgName substationCityOrgName,
|
||||||
|
mid.Operation_Id substationMaintOrg,
|
||||||
|
mid.Operation_Name substationMaintOrgName,
|
||||||
|
mid.name substationName,
|
||||||
|
LPAD(dic.Algo_Describe,2,0) substationVoltageLevel,
|
||||||
|
dicRun.value substationRunStatus,
|
||||||
|
mid.Operation_Date substationOperateDate
|
||||||
|
|
||||||
|
from pms_park park
|
||||||
|
inner join pms_park_station_ass ass on park.obj_id = ass.park_id
|
||||||
|
inner join pms_mid_ledger mid on ass.mid_station_id = mid.id
|
||||||
|
left join sys_dict_data dic on mid.voltage_Level = dic.id
|
||||||
|
left join sys_dict_data dicRun on mid.Run_Status = dicRun.id
|
||||||
|
where park.obj_id in
|
||||||
|
<foreach collection="parkIds" open="(" separator="," close=")" item="item">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.device.pq.mapper.PqsDeviceUnitMapper">
|
||||||
|
|
||||||
|
<select id="deviceUnitList" resultType="com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo$DeviceUnit">
|
||||||
|
SELECT
|
||||||
|
dev.id as id,
|
||||||
|
dev.pid as pid,
|
||||||
|
dev.NAME as `name`,
|
||||||
|
pd.Run_Flag as devFlag,
|
||||||
|
b.*
|
||||||
|
FROM
|
||||||
|
pq_line dev
|
||||||
|
INNER JOIN pq_device pd ON dev.id = pd.id and dev.State = 1
|
||||||
|
LEFT JOIN pqs_device_unit b ON dev.id = b.dev_index
|
||||||
|
<where>
|
||||||
|
<if test="devFlag!=null and devFlag!='' ">
|
||||||
|
pd.Run_Flag = #{devFlag}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="deviceUnitByID" resultType="com.njcn.device.biz.pojo.po.PqsDeviceUnit">
|
||||||
|
SELECT
|
||||||
|
unit.*
|
||||||
|
FROM
|
||||||
|
pq_line line
|
||||||
|
INNER JOIN pq_line vo ON vo.id = line.pid
|
||||||
|
INNER JOIN pq_line dev ON dev.id = vo.pid
|
||||||
|
INNER JOIN pq_device pd ON pd.id = dev.id
|
||||||
|
LEFT JOIN pqs_device_unit unit ON unit.DEV_INDEX = dev.id
|
||||||
|
<where>
|
||||||
|
line.State = 1
|
||||||
|
<if test="ids!=null and ids!='' ">
|
||||||
|
and line.id = #{ids}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.njcn.device.pms.service.ledgerManger;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.pms.pojo.param.PmsParkParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkPO;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 园区表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
public interface IPmsParkService extends IService<PmsParkPO> {
|
||||||
|
|
||||||
|
|
||||||
|
Boolean addPark(PmsParkParam param);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Boolean updatePark(PmsParkParam.UpdatePmsParkParam updatePmsParkParam);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Page<PmsParkPO> pageList(PmsParkParam.PmsParkQuery parkQuery);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Boolean uploadParkGw(@RequestBody List<String> objIds);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Page<PmsMidLedger> pageStationList(PmsParkParam.PmsParkQuery param);
|
||||||
|
|
||||||
|
List<PmsMidLedger> stationList(PmsParkParam.PmsParkQuery param);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.device.pms.service.ledgerManger;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkStationAss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
public interface IPmsParkStationAssService extends IService<PmsParkStationAss> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
package com.njcn.device.pms.service.ledgerManger.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.pms.enums.PmsEnum;
|
||||||
|
import com.njcn.device.pms.mapper.majornetwork.PmsMidLedgerMapper;
|
||||||
|
import com.njcn.device.pms.mapper.majornetwork.PmsParkMapper;
|
||||||
|
import com.njcn.device.pms.pojo.dto.ParkDto;
|
||||||
|
import com.njcn.device.pms.pojo.param.PmsParkParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkPO;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkStationAss;
|
||||||
|
import com.njcn.device.pms.service.ledgerManger.IPmsParkService;
|
||||||
|
import com.njcn.device.pms.service.ledgerManger.IPmsParkStationAssService;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
|
import com.njcn.web.enums.GWSendEnum;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import com.njcn.web.pojo.param.SendParam;
|
||||||
|
import com.njcn.web.utils.GwSendUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 园区表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PmsParkServiceImpl extends ServiceImpl<PmsParkMapper, PmsParkPO> implements IPmsParkService {
|
||||||
|
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
|
private final IPmsParkStationAssService iPmsParkStationAssService;
|
||||||
|
|
||||||
|
private final PmsMidLedgerMapper pmsMidLedgerMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addPark(PmsParkParam param) {
|
||||||
|
PmsParkPO pmsParkPO = new PmsParkPO();
|
||||||
|
BeanUtil.copyProperties(param, pmsParkPO);
|
||||||
|
pmsParkPO.setIsDelete(DataStateEnum.ENABLE.getCode().toString());
|
||||||
|
pmsParkPO.setUploadStatus(PmsEnum.NO_UPLOAD.getCode());
|
||||||
|
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||||
|
getOrgCode(dept,pmsParkPO);
|
||||||
|
return this.save(pmsParkPO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updatePark(PmsParkParam.UpdatePmsParkParam updatePmsParkParam) {
|
||||||
|
PmsParkPO result = this.getById(updatePmsParkParam.getObjId());
|
||||||
|
PmsParkPO pmsParkPO = new PmsParkPO();
|
||||||
|
BeanUtil.copyProperties(updatePmsParkParam, pmsParkPO);
|
||||||
|
if(result.getUploadStatus().equals(PmsEnum.HAS_UPLOAD.getCode())){
|
||||||
|
pmsParkPO.setUploadStatus(PmsEnum.WAIT_RETURN_UPLOAD.getCode());
|
||||||
|
}
|
||||||
|
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||||
|
getOrgCode(dept,pmsParkPO);
|
||||||
|
return this.updateById(pmsParkPO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PmsParkPO> pageList(PmsParkParam.PmsParkQuery parkQuery) {
|
||||||
|
List<String> deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(parkQuery.getMaintOrg()).getData();
|
||||||
|
LambdaQueryWrapper<PmsParkPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(PmsParkPO::getMaintOrg, deptCodes).orderByDesc(PmsParkPO::getCreateTime,PmsParkPO::getCityOrgName);
|
||||||
|
return this.page(new Page<>(PageFactory.getPageNum(parkQuery), PageFactory.getPageSize(parkQuery)), lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean uploadParkGw(List<String> objIds) {
|
||||||
|
List<PmsParkPO> pmsParkPOList;
|
||||||
|
if(CollUtil.isEmpty(objIds)){
|
||||||
|
LambdaQueryWrapper<PmsParkPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(PmsParkPO::getUploadStatus, Stream.of(PmsEnum.NO_UPLOAD.getCode(),PmsEnum.WAIT_RETURN_UPLOAD.getCode()).collect(Collectors.toList()));
|
||||||
|
pmsParkPOList = this.list(lambdaQueryWrapper);
|
||||||
|
}else {
|
||||||
|
pmsParkPOList = this.listByIds(objIds);
|
||||||
|
}
|
||||||
|
List<String> ids = pmsParkPOList.stream().map(PmsParkPO::getObjId).collect(Collectors.toList());
|
||||||
|
List<ParkDto.ParkSubstationRelVo> stationList = this.baseMapper.getParkStationAss(ids);
|
||||||
|
|
||||||
|
List<ParkDto> dtoList = new ArrayList<>();
|
||||||
|
ParkDto parkDto = new ParkDto();
|
||||||
|
parkDto.setParkVoListt(pmsParkPOList);
|
||||||
|
if(CollUtil.isNotEmpty(stationList)){
|
||||||
|
parkDto.setParkSubstationRelVoList(stationList);
|
||||||
|
}
|
||||||
|
dtoList.add(parkDto);
|
||||||
|
|
||||||
|
SendParam sendParam = new SendParam();
|
||||||
|
sendParam.setStats(dtoList);
|
||||||
|
Map<String,String> map = GwSendUtil.send(sendParam, GWSendEnum.PARK_AND_STATION);
|
||||||
|
GwSendUtil.returnInfoMsg(objIds,map);
|
||||||
|
|
||||||
|
LambdaUpdateWrapper<PmsParkPO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.set(PmsParkPO::getUploadStatus,PmsEnum.HAS_UPLOAD).eq(PmsParkPO::getObjId,objIds);
|
||||||
|
this.update(updateWrapper);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PmsMidLedger> pageStationList(PmsParkParam.PmsParkQuery param) {
|
||||||
|
Page<PmsMidLedger> result = new Page<>(param.getPageNum(),param.getPageSize());
|
||||||
|
List<PmsParkStationAss> pmsParkStationAssList = iPmsParkStationAssService.list(new LambdaQueryWrapper<PmsParkStationAss>().eq(PmsParkStationAss::getParkId,param.getObjId()));
|
||||||
|
List<String> ids = pmsParkStationAssList.stream().map(PmsParkStationAss::getMidStationId).collect(Collectors.toList());
|
||||||
|
if(CollUtil.isEmpty(ids)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<PmsMidLedger> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(PmsMidLedger::getId,ids);
|
||||||
|
result = pmsMidLedgerMapper.selectPage(new Page<>(PageFactory.getPageNum(param),PageFactory.getPageSize(param)),lambdaQueryWrapper);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PmsMidLedger> stationList(PmsParkParam.PmsParkQuery param) {
|
||||||
|
List<String> ids = deptFeignClient.getDepSonSelfCodetByCode(param.getCityOrg()).getData();
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PmsMidLedger> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.select(PmsMidLedger::getName,PmsMidLedger::getOperationName,PmsMidLedger::getId).in(PmsMidLedger::getSectionId,ids).eq(PmsMidLedger::getLevel,0);
|
||||||
|
List<PmsMidLedger> pmsMidLedgerList = pmsMidLedgerMapper.selectList(lambdaQueryWrapper);
|
||||||
|
return pmsMidLedgerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void getOrgCode(List<PvTerminalTreeVO> dept,PmsParkPO pmsParkPO){
|
||||||
|
PvTerminalTreeVO pvTerminalTreeVO = dept.stream().filter(it->it.getCode().equals(pmsParkPO.getMaintOrg())).findFirst().orElse(null);
|
||||||
|
if(Objects.nonNull(pvTerminalTreeVO)){
|
||||||
|
if(pvTerminalTreeVO.getLevel() == 1 || pvTerminalTreeVO.getLevel() == 2){
|
||||||
|
throw new BusinessException("请选择省级以下单位");
|
||||||
|
}else if(pvTerminalTreeVO.getLevel() == 3){
|
||||||
|
PvTerminalTreeVO province = dept.stream().filter(it->it.getId().equals(pvTerminalTreeVO.getPid())).findFirst().orElse(null);
|
||||||
|
pmsParkPO.setCityOrg(pvTerminalTreeVO.getCode());
|
||||||
|
pmsParkPO.setCityOrgName(pvTerminalTreeVO.getName());
|
||||||
|
|
||||||
|
if(Objects.nonNull(province)){
|
||||||
|
pmsParkPO.setProvinceOrg(province.getCode());
|
||||||
|
pmsParkPO.setProvinceName(province.getName());
|
||||||
|
}
|
||||||
|
} else if(pvTerminalTreeVO.getLevel() == 4){
|
||||||
|
PvTerminalTreeVO city = dept.stream().filter(it->it.getId().equals(pvTerminalTreeVO.getPid())).findFirst().orElse(null);
|
||||||
|
if(Objects.nonNull(city)){
|
||||||
|
pmsParkPO.setCityOrg(city.getCode());
|
||||||
|
pmsParkPO.setCityOrgName(city.getName());
|
||||||
|
|
||||||
|
PvTerminalTreeVO province = dept.stream().filter(it->it.getId().equals(city.getPid())).findFirst().orElse(null);
|
||||||
|
if(Objects.nonNull(province)){
|
||||||
|
pmsParkPO.setProvinceOrg(province.getCode());
|
||||||
|
pmsParkPO.setProvinceName(province.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.device.pms.service.ledgerManger.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.device.pms.mapper.majornetwork.PmsParkStationAssMapper;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsParkStationAss;
|
||||||
|
import com.njcn.device.pms.service.ledgerManger.IPmsParkStationAssService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-06-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PmsParkStationAssServiceImpl extends ServiceImpl<PmsParkStationAssMapper, PmsParkStationAss> implements IPmsParkStationAssService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.njcn.device.pms.service.majornetwork;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import com.njcn.device.pms.pojo.vo.DeviceUnitVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-08-21
|
||||||
|
*/
|
||||||
|
public interface IPqsDeviceUnitService extends IService<PqsDeviceUnit> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param devFlag
|
||||||
|
* @Description: 查询数据单位树
|
||||||
|
* @return: java.util.List<com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo>
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/8/21 13:58
|
||||||
|
*/
|
||||||
|
List<DeviceUnitVo> nodeList(String devFlag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param unit
|
||||||
|
* @Description: 添加数据终端
|
||||||
|
* @return: java.lang.Boolean
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/8/21 14:01
|
||||||
|
*/
|
||||||
|
Boolean saveDeviceUnit(PqsDeviceUnit unit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param lineID
|
||||||
|
* @Description: 根据监测点id查询数据单位
|
||||||
|
* @return: com.njcn.device.biz.pojo.po.PqsDeviceUnit
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/8/21 14:02
|
||||||
|
*/
|
||||||
|
PqsDeviceUnit lineUnitDetail(String lineID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param devID
|
||||||
|
* @Description: 根据终端id查询数据单位
|
||||||
|
* @return: com.njcn.device.biz.pojo.po.PqsDeviceUnit
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/8/21 14:02
|
||||||
|
*/
|
||||||
|
PqsDeviceUnit devUnitDetail(String devID);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -312,6 +312,14 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(monitorParam.getOrgId()).getData();
|
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(monitorParam.getOrgId()).getData();
|
||||||
lambdaQueryWrapper.in(Monitor::getOrgId, deptIds).eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode());
|
lambdaQueryWrapper.in(Monitor::getOrgId, deptIds).eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
}
|
}
|
||||||
|
//是否上送国网测点
|
||||||
|
if(Objects.nonNull(monitorParam.getIsUpToGrid())){
|
||||||
|
lambdaQueryWrapper.eq(Monitor::getIsUpToGrid, DataStateEnum.ENABLE.getCode());
|
||||||
|
}
|
||||||
|
//运行状态
|
||||||
|
if(StrUtil.isNotBlank(monitorParam.getMonitorState())){
|
||||||
|
lambdaQueryWrapper.eq(Monitor::getMonitorState,monitorParam.getMonitorState());
|
||||||
|
}
|
||||||
return this.list(lambdaQueryWrapper);
|
return this.list(lambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1242,7 +1250,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
List<DictData> wireList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
List<DictData> wireList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||||
Map<String, DictData> wireListMap = wireList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
Map<String, DictData> wireListMap = wireList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||||
|
|
||||||
DictData potentialDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getName(), DicDataEnum.Cap_V.getName()).getData();
|
DictData potentialDic = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.Cap_V.getCode(),DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||||
|
|
||||||
DictData neutralDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.Neutral_Point.getName(), DicDataEnum.Ground_Res.getName()).getData();
|
DictData neutralDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.Neutral_Point.getName(), DicDataEnum.Ground_Res.getName()).getData();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,128 @@
|
|||||||
|
package com.njcn.device.pms.service.majornetwork.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import com.njcn.device.pms.mapper.majornetwork.PqsDeviceUnitMapper;
|
||||||
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||||
|
import com.njcn.device.pms.pojo.vo.DeviceUnitVo;
|
||||||
|
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||||
|
import com.njcn.device.pms.service.majornetwork.IPqsDeviceUnitService;
|
||||||
|
import com.njcn.device.pms.service.majornetwork.ITerminalService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-08-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PqsDeviceUnitServiceImpl extends ServiceImpl<PqsDeviceUnitMapper, PqsDeviceUnit> implements IPqsDeviceUnitService {
|
||||||
|
|
||||||
|
private final ITerminalService terminalService;
|
||||||
|
private final IMonitorService monitorService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceUnitVo> nodeList(String devFlag) {
|
||||||
|
List<DeviceUnitVo> pqsDeviceUnitVos = new ArrayList<>();
|
||||||
|
List<PmsTerminal> list = terminalService.list(new LambdaQueryWrapper<PmsTerminal>()
|
||||||
|
.eq(PmsTerminal::getStatus, DataStateEnum.ENABLE.getCode())
|
||||||
|
.eq(StrUtil.isNotBlank(devFlag), PmsTerminal::getTerminalState, devFlag)
|
||||||
|
);
|
||||||
|
if(CollUtil.isEmpty(list)){
|
||||||
|
return pqsDeviceUnitVos;
|
||||||
|
}
|
||||||
|
List<String> terminal = list.stream().map(PmsTerminal::getId).collect(Collectors.toList());
|
||||||
|
//获取所有终端信息
|
||||||
|
List<PqsDeviceUnit> pqsDeviceUnits = this.listByIds(terminal);
|
||||||
|
Map<String, PqsDeviceUnit> unitMap = pqsDeviceUnits.stream().collect(Collectors.toMap(PqsDeviceUnit::getDevIndex, Function.identity()));
|
||||||
|
Map<String, List<PmsTerminal>> orgMap = list.stream().collect(Collectors.groupingBy(PmsTerminal::getOrgId));
|
||||||
|
orgMap.forEach((key, value) -> {
|
||||||
|
DeviceUnitVo unitVo = new DeviceUnitVo();
|
||||||
|
unitVo.setId(key);
|
||||||
|
unitVo.setName(value.get(0).getOrgName());
|
||||||
|
Map<String, List<PmsTerminal>> subMap = value.stream().collect(Collectors.groupingBy(PmsTerminal::getPowerStationId));
|
||||||
|
|
||||||
|
List<DeviceUnitVo> subUnitVos = new ArrayList<>();
|
||||||
|
subMap.forEach((subKey, subValue) -> {
|
||||||
|
DeviceUnitVo subUnitVo = new DeviceUnitVo();
|
||||||
|
subUnitVo.setId(subKey);
|
||||||
|
subUnitVo.setName(subValue.get(0).getPowerrName());
|
||||||
|
Map<String, List<PmsTerminal>> terMap = subValue.stream().collect(Collectors.groupingBy(PmsTerminal::getId));
|
||||||
|
List<DeviceUnitVo.DeviceUnit> terUnitVos = new ArrayList<>();
|
||||||
|
terMap.forEach((terKey, terValue) -> {
|
||||||
|
for (PmsTerminal pmsTerminal : terValue) {
|
||||||
|
DeviceUnitVo.DeviceUnit terUnitVo = new DeviceUnitVo.DeviceUnit();
|
||||||
|
terUnitVo.setId(pmsTerminal.getId());
|
||||||
|
terUnitVo.setName(pmsTerminal.getName());
|
||||||
|
terUnitVo.setDevFlag(pmsTerminal.getTerminalState());
|
||||||
|
PqsDeviceUnit pqsDeviceUnit;
|
||||||
|
if (unitMap.containsKey(terKey)) {
|
||||||
|
pqsDeviceUnit = unitMap.get(terKey);
|
||||||
|
} else {
|
||||||
|
pqsDeviceUnit = new PqsDeviceUnit();
|
||||||
|
}
|
||||||
|
BeanUtil.copyProperties(pqsDeviceUnit,terUnitVo);
|
||||||
|
terUnitVos.add(terUnitVo);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
subUnitVo.setChildren(terUnitVos);
|
||||||
|
subUnitVos.add(subUnitVo);
|
||||||
|
});
|
||||||
|
unitVo.setChildren(subUnitVos);
|
||||||
|
pqsDeviceUnitVos.add(unitVo);
|
||||||
|
});
|
||||||
|
return pqsDeviceUnitVos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean saveDeviceUnit(PqsDeviceUnit unit) {
|
||||||
|
PqsDeviceUnit byId = this.getById(unit.getDevIndex());
|
||||||
|
if (ObjectUtil.isNotNull(byId)) {
|
||||||
|
return this.updateById(unit);
|
||||||
|
}
|
||||||
|
return this.save(unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PqsDeviceUnit lineUnitDetail(String lineID) {
|
||||||
|
Monitor byId = monitorService.getById(lineID);
|
||||||
|
if (ObjectUtil.isNotNull(byId)) {
|
||||||
|
PqsDeviceUnit unit = this.getById(byId.getTerminalId());
|
||||||
|
if (ObjectUtil.isNotNull(unit)) {
|
||||||
|
return unit;
|
||||||
|
}
|
||||||
|
return new PqsDeviceUnit();
|
||||||
|
}
|
||||||
|
return new PqsDeviceUnit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PqsDeviceUnit devUnitDetail(String devID) {
|
||||||
|
PqsDeviceUnit byId = this.getById(devID);
|
||||||
|
if (ObjectUtil.isNotNull(byId)) {
|
||||||
|
return byId;
|
||||||
|
}
|
||||||
|
return new PqsDeviceUnit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,6 +22,11 @@
|
|||||||
<artifactId>common-device-biz</artifactId>
|
<artifactId>common-device-biz</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>pqs-influx</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import com.njcn.device.pq.pojo.po.DeptLine;
|
|||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -19,7 +18,10 @@ import java.util.Map;
|
|||||||
@FeignClient(value = ServerInfo.DEVICE,path = "/deptLine",fallbackFactory = DeptLineFeignClientFallbackFactory.class,contextId = "deptLine")
|
@FeignClient(value = ServerInfo.DEVICE,path = "/deptLine",fallbackFactory = DeptLineFeignClientFallbackFactory.class,contextId = "deptLine")
|
||||||
public interface DeptLineFeignClient {
|
public interface DeptLineFeignClient {
|
||||||
@PostMapping("/getLineByDeptId")
|
@PostMapping("/getLineByDeptId")
|
||||||
HttpResult<List<String>> getLineByDeptId(String id);
|
HttpResult<List<String>> getLineByDeptId(@RequestParam("id")String id);
|
||||||
|
|
||||||
|
@PostMapping("/getLineByDeptIdAndNewStation")
|
||||||
|
HttpResult<List<String>> getLineByDeptIdAndNewStation(@RequestParam("id")String id);
|
||||||
|
|
||||||
@PostMapping("/selectDeptBindLines")
|
@PostMapping("/selectDeptBindLines")
|
||||||
HttpResult<Boolean> selectDeptBindLines(@RequestParam("ids") List<String> ids);
|
HttpResult<Boolean> selectDeptBindLines(@RequestParam("ids") List<String> ids);
|
||||||
@@ -47,4 +49,7 @@ public interface DeptLineFeignClient {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/getLineNodeByDeptId")
|
@PostMapping("/getLineNodeByDeptId")
|
||||||
HttpResult<List<String>> getLineNodeByDeptId(@RequestParam("id") String id);
|
HttpResult<List<String>> getLineNodeByDeptId(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
@PostMapping("/getAllData")
|
||||||
|
HttpResult<List<DeptLine>> getAllData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.device.pq.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.pq.api.fallback.DeviceFeignClientFallbackFactory;
|
||||||
|
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.DEVICE,
|
||||||
|
path = "/dev",
|
||||||
|
fallbackFactory = DeviceFeignClientFallbackFactory.class,
|
||||||
|
contextId = "dev")
|
||||||
|
public interface DeviceFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 技术监督修改装置定检时间
|
||||||
|
*
|
||||||
|
* @param devId 监测点id
|
||||||
|
* @param thisTimeCheck 起始时间
|
||||||
|
* @param nextTimeCheck 结束时间
|
||||||
|
* @return 终端状态信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateDevCheckTime")
|
||||||
|
@ApiOperation("技术监督修改装置定检时间")
|
||||||
|
HttpResult<String> updateDevCheckTime(@RequestParam("devId") String devId,
|
||||||
|
@RequestParam("thisTimeCheck") String thisTimeCheck,
|
||||||
|
@RequestParam("nextTimeCheck") String nextTimeCheck);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.njcn.device.pq.api;
|
package com.njcn.device.pq.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
||||||
import com.njcn.device.pq.pojo.dto.*;
|
import com.njcn.device.pq.pojo.dto.*;
|
||||||
import com.njcn.device.pq.pojo.param.DataParam;
|
import com.njcn.device.pq.pojo.param.DataParam;
|
||||||
@@ -343,4 +347,18 @@ public interface LineFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/getDeptDeviceDetailData")
|
@PostMapping("/getDeptDeviceDetailData")
|
||||||
HttpResult<List<LineDetailVO.Detail>> getDeptDeviceDetailData(@RequestBody DataParam param);
|
HttpResult<List<LineDetailVO.Detail>> getDeptDeviceDetailData(@RequestBody DataParam param);
|
||||||
|
|
||||||
|
@PostMapping("/getNoDataLine")
|
||||||
|
HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine();
|
||||||
|
|
||||||
|
@PostMapping("/getReportLineInfo")
|
||||||
|
HttpResult<List<ReportLineInfoVo>> getReportLineInfo(@RequestBody List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据监测点名称和电网侧变电站名称模糊搜索
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/getByName")
|
||||||
|
HttpResult<List<LineDetail>> getByName(@RequestBody LineBaseQueryParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.device.pq.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.pq.api.fallback.NewStationClientFallbackFactory;
|
||||||
|
import com.njcn.device.pq.pojo.po.NewStation;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新能源场站高低电压穿越Feign客户端
|
||||||
|
* @author guofeihu
|
||||||
|
* @date 2024-08-14
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.DEVICE, path = "/newStation", fallbackFactory = NewStationClientFallbackFactory.class, contextId = "newStation")
|
||||||
|
public interface NewStationClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID获取新能源场站高低电压穿越表信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/selectById")
|
||||||
|
HttpResult<NewStation> selectById(@RequestParam(name = "id") String id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.device.pq.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.pq.api.fallback.PqsTerminalLogsClientFallbackFactory;
|
||||||
|
import com.njcn.device.pq.pojo.po.Node;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2024/8/13 10:14
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.DEVICE, path = "/node", fallbackFactory = PqsTerminalLogsClientFallbackFactory.class, contextId = "node")
|
||||||
|
public interface NodeClient {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("获取全部前置机")
|
||||||
|
@GetMapping("/nodeAllList")
|
||||||
|
HttpResult<List<Node>> nodeAllList();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,8 +7,10 @@ import com.njcn.device.pq.pojo.param.SyncTerminalParam;
|
|||||||
import com.njcn.device.pq.pojo.po.Line;
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
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.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -31,11 +33,23 @@ public interface TerminalBaseClient {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/getSubstationById")
|
@PostMapping("/getSubstationById")
|
||||||
HttpResult<List<Line>> getSubstationById(@RequestBody List<String> list);
|
HttpResult<List<Line>> getSubstationById(@RequestBody List<String> list);
|
||||||
/*
|
|
||||||
冀北技术监督台账同步
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 冀北技术监督台账同步
|
||||||
|
*/
|
||||||
@ApiOperation("终端/母线/监测点同步操作")
|
@ApiOperation("终端/母线/监测点同步操作")
|
||||||
@PostMapping("terminalSync")
|
@PostMapping("terminalSync")
|
||||||
HttpResult<String> terminalSync( @RequestBody SyncTerminalParam syncTerminalParam);
|
HttpResult<String> terminalSync( @RequestBody SyncTerminalParam syncTerminalParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点和装置同步成运行状态
|
||||||
|
*/
|
||||||
|
@GetMapping("/terminalSyncRunFly")
|
||||||
|
HttpResult<Boolean> terminalSyncRunFly(@RequestParam("lineId") String lineId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点信息删除
|
||||||
|
*/
|
||||||
|
@GetMapping("/terminalSyncDeleteFly")
|
||||||
|
HttpResult<Boolean> terminalSyncDeleteFly(@RequestParam("lineId") String lineId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ public class DeptLineFeignClientFallbackFactory implements FallbackFactory<DeptL
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<String>> getLineByDeptIdAndNewStation(String id) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "根据部门id获取绑定的监测点且再根据NewStation进行过滤", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<Boolean> selectDeptBindLines(List<String> ids) {
|
public HttpResult<Boolean> selectDeptBindLines(List<String> ids) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "部门Ids集合查询是否绑定", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "部门Ids集合查询是否绑定", throwable.toString());
|
||||||
@@ -68,6 +74,12 @@ public class DeptLineFeignClientFallbackFactory implements FallbackFactory<DeptL
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "根据部门信息id查询监测点id集合", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "根据部门信息id查询监测点id集合", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<DeptLine>> getAllData() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取部门监测点表所有数据", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.device.pq.api.fallback;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||||
|
import com.njcn.device.pq.api.DeviceFeignClient;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class DeviceFeignClientFallbackFactory implements FallbackFactory<DeviceFeignClient> {
|
||||||
|
@Override
|
||||||
|
public DeviceFeignClient create(Throwable throwable) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (throwable.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||||
|
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new DeviceFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "技术监督修改装置定检时间", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -269,6 +269,24 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "更新监测点运行状态: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "更新监测点运行状态: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取当日无数据的监测点: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<ReportLineInfoVo>> getReportLineInfo(List<String> ids) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "根据监测点id获取预告警单基础信息: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<LineDetail>> getByName(LineBaseQueryParam param) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "根据监测点名称和电网侧变电站名称模糊搜索: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.njcn.device.pq.api.fallback;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||||
|
import com.njcn.device.pq.api.NewStationClient;
|
||||||
|
import com.njcn.device.pq.pojo.po.NewStation;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新能源场站高低电压穿越管理熔断降级
|
||||||
|
* @author guofeihu
|
||||||
|
* @date 2024-08-14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class NewStationClientFallbackFactory implements FallbackFactory<NewStationClient> {
|
||||||
|
@Override
|
||||||
|
public NewStationClient create(Throwable throwable) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (throwable.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||||
|
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new NewStationClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<NewStation> selectById(String id) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "根据ID获取新能源场站高低电压穿越表信息", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.njcn.device.pq.api.fallback;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||||
|
import com.njcn.device.pq.api.NodeClient;
|
||||||
|
import com.njcn.device.pq.api.PqsTerminalLogsClient;
|
||||||
|
import com.njcn.device.pq.pojo.po.Node;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqsTerminalLogs;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zbj
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年04月13日 13:34
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class NodeClientFallbackFactory implements FallbackFactory<NodeClient> {
|
||||||
|
@Override
|
||||||
|
public NodeClient create(Throwable throwable) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (throwable.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||||
|
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new NodeClient()
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<Node>> nodeAllList() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取全部前置机", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,6 +44,18 @@ public class TerminalBaseClientFallbackFactory implements FallbackFactory<Termin
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> terminalSyncRunFly(String lineId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "监测点和装置同步成运行状态", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> terminalSyncDeleteFly(String lineId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "监测点信息删除", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
package com.njcn.device.pq.constant;
|
package com.njcn.device.pq.constant;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author qijian
|
* @author qijian
|
||||||
*/
|
*/
|
||||||
@@ -21,4 +26,44 @@ public interface Param {
|
|||||||
Integer WEEK = 4;
|
Integer WEEK = 4;
|
||||||
Integer DAY = 5;
|
Integer DAY = 5;
|
||||||
|
|
||||||
|
//以下四个固定ID用于某些业务判断
|
||||||
|
//字典(sys_dict_data):电压暂升的ID
|
||||||
|
String UPPEREVENT = "c5ce588cb76fba90c4519ab250c962d0";
|
||||||
|
//字典(sys_dict_data):电压暂降的ID
|
||||||
|
String LOWEREVENT = "c37861896dafab0883321e1d508caa51";
|
||||||
|
//字典(sys_dict_data):光伏电站的ID
|
||||||
|
String PHOTOVOLTAICPOWER = "45615057cb88650ffc4779b0629bac7e";
|
||||||
|
//字典(sys_dict_data):风电场的ID
|
||||||
|
String WINDFARM = "f9145acb79cbf136b9ee89fd38d72583";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以下的四个Map为有功功率页面查看指标详情的四个指标分组下的具体指标(指标对应的可能不对 到时候直接改map里的key即可)
|
||||||
|
* 页面展示的指标名称 对应 的表ele_epd_pqd中的名称
|
||||||
|
* map的key为的表ele_epd_pqd中的名称value为页面上展示的名称
|
||||||
|
*/
|
||||||
|
Map<String,String> DATABSEMAP = new HashMap(){{
|
||||||
|
put("频率偏差","频率偏差");
|
||||||
|
put("线电压偏差","电压偏差");
|
||||||
|
put("相电压长时闪变","长时闪变");
|
||||||
|
put("线电压总有效值","谐波电压");
|
||||||
|
put("电流总有效值","谐波电流");
|
||||||
|
put("相电压总有效值","间谐波电压");
|
||||||
|
put("电压负序不平衡度","负序电压不平衡度");
|
||||||
|
put("电流负序不平衡度","负序电流");
|
||||||
|
put("总稳态指标","三相总有功功率");
|
||||||
|
put("相电压谐波总畸变率","电压总谐波畸变率");
|
||||||
|
}};
|
||||||
|
|
||||||
|
Map<String,String> UHARMMAP = new HashMap(){{
|
||||||
|
put("相电压谐波含有率序列","电压");
|
||||||
|
}};
|
||||||
|
|
||||||
|
Map<String,String> IHARMMAP = new HashMap(){{
|
||||||
|
put("谐波电流有效值","电流");
|
||||||
|
}};
|
||||||
|
|
||||||
|
Map<String,String> INTERHARMONICMAP = new HashMap(){{
|
||||||
|
put("间谐波电压有效值序列","间谐波电压含有率");
|
||||||
|
}};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,15 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class LineDataQualityDTO {
|
public class LineDataQualityDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点id
|
||||||
|
*/
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点名称
|
||||||
|
*/
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线率
|
* 在线率
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ public class LineParam {
|
|||||||
@ApiModelProperty(name = "updateFlag",value = "修改标识")
|
@ApiModelProperty(name = "updateFlag",value = "修改标识")
|
||||||
private Integer updateFlag;
|
private Integer updateFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "newStationId",value = "新能源场站信息ID")
|
||||||
|
private String newStationId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.njcn.device.pq.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新能源场站高低电压穿越表查询类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author guofeihu
|
||||||
|
* @since 2024-08-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class NewStationQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty("新能源场站名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("新能源场站类型")
|
||||||
|
private String stationType;
|
||||||
|
|
||||||
|
@ApiModelProperty("电压等级Guid")
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
@ApiModelProperty("额定有功功率")
|
||||||
|
private String ratedPower;
|
||||||
|
|
||||||
|
@ApiModelProperty("经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@ApiModelProperty("维度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class NewStationEdit{
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@NotBlank(message = "新能源场站名称不能为空")
|
||||||
|
@ApiModelProperty("新能源场站名称(*)")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@NotBlank(message = "新能源场站类型不能为空")
|
||||||
|
@ApiModelProperty("新能源场站类型(*)")
|
||||||
|
private String stationType;
|
||||||
|
|
||||||
|
@ApiModelProperty("电压等级Guid")
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
@NotBlank(message = "额定有功功率不能为空")
|
||||||
|
@ApiModelProperty("额定有功功率(*)")
|
||||||
|
private String ratedPower;
|
||||||
|
|
||||||
|
@NotBlank(message = "经度不能为空")
|
||||||
|
@ApiModelProperty("经度(*)")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@NotBlank(message = "维度不能为空")
|
||||||
|
@ApiModelProperty("维度(*)")
|
||||||
|
private String latitude;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -180,6 +180,11 @@ public class LineDetail{
|
|||||||
*/
|
*/
|
||||||
private Integer runFlag;
|
private Integer runFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新能源场站信息ID
|
||||||
|
*/
|
||||||
|
private String newStationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通讯状态
|
* 通讯状态
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新能源场站高低电压穿越表实体类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author guofeihu
|
||||||
|
* @since 2024-08-14
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pq_new_station")
|
||||||
|
public class NewStation extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新能源场站名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (关联new_station_type字典表)新能源场站类型(风电场、光伏电站)
|
||||||
|
*/
|
||||||
|
private String stationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (关联Dev_Voltage_Stand字典表)电压等级Guid
|
||||||
|
*/
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额定有功功率
|
||||||
|
*/
|
||||||
|
private String ratedPower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维度
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0-删除 1-正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2024/8/15 14:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DevAndLine {
|
||||||
|
|
||||||
|
@ApiModelProperty("终端id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
@ApiModelProperty("终端名称")
|
||||||
|
private String devName;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点集合")
|
||||||
|
private List<Line> lineList;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Line {
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点名称")
|
||||||
|
private String lineName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -41,6 +41,7 @@ public class DevDetail {
|
|||||||
private Integer comFlag;
|
private Integer comFlag;
|
||||||
|
|
||||||
@ApiModelProperty("定检时间")
|
@ApiModelProperty("定检时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate nextTimeCheck;
|
private LocalDate nextTimeCheck;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,4 +121,7 @@ public class LineDetailDataVO {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "新能源场站信息ID")
|
||||||
|
private String newStationId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,4 +93,17 @@ public class LineDetailVO implements Serializable {
|
|||||||
@ApiModelProperty("已用流量占比")
|
@ApiModelProperty("已用流量占比")
|
||||||
private Float flowProportion;
|
private Float flowProportion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class noDataLineInfo extends LineDetailVO implements Serializable{
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点Id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("终端id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
@ApiModelProperty("最新数据时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ public class LineVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "sort",value = "排序",required = true)
|
@ApiModelProperty(name = "sort",value = "排序",required = true)
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "newStationId",value = "新能源场站信息ID")
|
||||||
|
private String newStationId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportLineInfoVo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("供电公司名称")
|
||||||
|
private String gdName;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点电压等级")
|
||||||
|
private String lineVoltage;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点名称")
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属电站")
|
||||||
|
private String subName;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测对象名称")
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
@ApiModelProperty("电网侧变电站")
|
||||||
|
private String subVName;
|
||||||
|
|
||||||
|
@ApiModelProperty("最新数据时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测装置网络参数")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@ApiModelProperty("最小短路容量")
|
||||||
|
private Double shortCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty("供电设备容量")
|
||||||
|
private Double devCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty("协议容量")
|
||||||
|
private Double dealCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty("超标天数")
|
||||||
|
private Integer overDays;
|
||||||
|
|
||||||
|
@ApiModelProperty("电网标志(0-电网侧;1-非电网侧)")
|
||||||
|
private Integer powerFlag;
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.common.utils.LogUtil;
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||||
import com.njcn.device.pq.service.DeptLineService;
|
import com.njcn.device.pq.service.DeptLineService;
|
||||||
@@ -37,6 +38,7 @@ import java.util.Map;
|
|||||||
public class DeptLineController extends BaseController {
|
public class DeptLineController extends BaseController {
|
||||||
|
|
||||||
private final DeptLineService deptLineService;
|
private final DeptLineService deptLineService;
|
||||||
|
private final DeptLineMapper deptLineMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门绑定监测点
|
* 部门绑定监测点
|
||||||
@@ -110,6 +112,15 @@ public class DeptLineController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@PostMapping("/getLineByDeptIdAndNewStation")
|
||||||
|
@ApiOperation("根据部门id获取绑定的监测点且再根据NewStation进行过滤")
|
||||||
|
public HttpResult<List<String>> getLineByDeptIdAndNewStation(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("getLineByDeptIdAndNewStation");
|
||||||
|
List<String> list = deptLineService.getLineByDeptIdAndNewStation(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@PostMapping("/getLineDetailByDeptId")
|
@PostMapping("/getLineDetailByDeptId")
|
||||||
@ApiOperation("部门Id获取绑定监测点详情")
|
@ApiOperation("部门Id获取绑定监测点详情")
|
||||||
@@ -146,4 +157,13 @@ public class DeptLineController extends BaseController {
|
|||||||
List<String> list = deptLineService.getLineNodeByDeptId(id);
|
List<String> list = deptLineService.getLineNodeByDeptId(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@PostMapping("/getAllData")
|
||||||
|
@ApiOperation("获取部门监测点表所有数据")
|
||||||
|
public HttpResult<List<DeptLine>> getAllData() {
|
||||||
|
String methodDescribe = getMethodDescribe("getAllData");
|
||||||
|
List<DeptLine> list = deptLineMapper.selectList(null);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,4 +167,13 @@ public class DeviceController extends BaseController {
|
|||||||
Console.log("string payload : {}", payload);
|
Console.log("string payload : {}", payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@PostMapping("/updateDevCheckTime")
|
||||||
|
@ApiOperation("技术监督修改装置定检时间")
|
||||||
|
public HttpResult<String> updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateDevCheckTime");
|
||||||
|
iDeviceService.updateDevCheckTime(devId,thisTimeCheck,nextTimeCheck);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -418,12 +418,8 @@ public class LineController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "deviceInfoParam", value = "监测点查询条件", required = true)
|
@ApiImplicitParam(name = "deviceInfoParam", value = "监测点查询条件", required = true)
|
||||||
})
|
})
|
||||||
public HttpResult<List<DeptLineCountVO>> getDeptLineCount(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
public HttpResult<List<DeptLineCountVO>> getDeptLineCount(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||||
|
|
||||||
|
|
||||||
String methodDescribe = getMethodDescribe("getDeptLineCount");
|
String methodDescribe = getMethodDescribe("getDeptLineCount");
|
||||||
List<DeptLineCountVO> deptLineCountVOS = new ArrayList<> ();
|
List<DeptLineCountVO> deptLineCountVOS = lineService.getDeptLineCount(deviceInfoParam);
|
||||||
deptLineCountVOS = lineService.getDeptLineCount(deviceInfoParam);
|
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptLineCountVOS, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptLineCountVOS, methodDescribe);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -509,11 +505,45 @@ public class LineController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiOperation("根据装置部门和模糊搜索获取装置详情")
|
@ApiOperation("根据装置部门和模糊搜索获取装置详情")
|
||||||
@ApiImplicitParam(name = "id", value = "装置id", required = true)
|
|
||||||
@PostMapping("/getDeptDeviceDetailData")
|
@PostMapping("/getDeptDeviceDetailData")
|
||||||
HttpResult<List<LineDetailVO.Detail>> getDeptDeviceDetailData(@RequestBody DataParam param){
|
HttpResult<List<LineDetailVO.Detail>> getDeptDeviceDetailData(@RequestBody DataParam param){
|
||||||
String methodDescribe = getMethodDescribe("getDeptDeviceDetailData");
|
String methodDescribe = getMethodDescribe("getDeptDeviceDetailData");
|
||||||
List<LineDetailVO.Detail> deptDeviceDetailData = lineService.getDeptDeviceDetailData(param);
|
List<LineDetailVO.Detail> deptDeviceDetailData = lineService.getDeptDeviceDetailData(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptDeviceDetailData, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptDeviceDetailData, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("获取当日无数据的监测点")
|
||||||
|
@PostMapping("/getNoDataLine")
|
||||||
|
HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine(){
|
||||||
|
String methodDescribe = getMethodDescribe("getNoDataLine");
|
||||||
|
List<LineDetailVO.noDataLineInfo> result = lineService.getNoDataLine();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("根据监测点id获取预告警单基础信息")
|
||||||
|
@PostMapping("/getReportLineInfo")
|
||||||
|
HttpResult<List<ReportLineInfoVo>> getReportLineInfo(@RequestBody List<String> ids){
|
||||||
|
String methodDescribe = getMethodDescribe("getReportLineInfo");
|
||||||
|
List<ReportLineInfoVo> result = lineService.getReportLineInfo(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("根据监测点名称和电网侧变电站名称模糊搜索")
|
||||||
|
@PostMapping("/getByName")
|
||||||
|
HttpResult<List<LineDetail>> getByName(@RequestBody LineBaseQueryParam param){
|
||||||
|
String methodDescribe = getMethodDescribe("getByName");
|
||||||
|
List<LineDetail> list = lineService.getByName(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("获取部门下终端信息和终端下监测点信息")
|
||||||
|
@GetMapping("/getByDeptDevLine")
|
||||||
|
HttpResult<List<DevAndLine>> getByDeptDevLine(String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getByDeptDevLine");
|
||||||
|
List<DevAndLine> list = lineService.getByDeptDevLine(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.njcn.device.pq.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.device.pq.pojo.param.NewStationQueryParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.NewStation;
|
||||||
|
import com.njcn.device.pq.service.INewStationService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新能源场站高低电压穿越表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author guofeihu
|
||||||
|
* @since 2024-08-14
|
||||||
|
*/
|
||||||
|
@Api(tags = "新能源场站高低电压穿越表管理")
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/newStation")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class NewStationController extends BaseController {
|
||||||
|
|
||||||
|
private final INewStationService iNewStationService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@PostMapping("/queryPage")
|
||||||
|
@ApiOperation("新能源场站高低电压穿越表分页查询")
|
||||||
|
public HttpResult<Page<NewStation>> queryPage(@RequestBody @Validated NewStationQueryParam newStationQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("queryPage");
|
||||||
|
Page<NewStation> page = iNewStationService.queryPage(newStationQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/editNewStation")
|
||||||
|
@ApiOperation("新能源场站高低电压穿越信息更新")
|
||||||
|
public HttpResult<Boolean> editNewStation(@RequestBody @Validated NewStationQueryParam.NewStationEdit newStationEdit) {
|
||||||
|
String methodDescribe = getMethodDescribe("editNewStation");
|
||||||
|
LogUtil.njcnDebug(log, "{},更新对象为:{}", methodDescribe, newStationEdit);
|
||||||
|
iNewStationService.editNewStation(newStationEdit);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||||
|
@DeleteMapping("/delNewStation")
|
||||||
|
@ApiOperation("新能源场站高低电压穿越信息删除")
|
||||||
|
public HttpResult<Boolean> delNewStation(@RequestParam(name = "ids") String ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("delNewStation");
|
||||||
|
LogUtil.njcnDebug(log, "{},删除的Id的集合为:{}", methodDescribe, ids);
|
||||||
|
iNewStationService.delNewStation(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@GetMapping("/selectDown")
|
||||||
|
@ApiOperation("获取新能源场站高低电压穿越信息下拉框(用于监测点维护界面)")
|
||||||
|
public HttpResult<List<Map>> selectDown(@RequestParam(name = "name",required = false) String name) {
|
||||||
|
String methodDescribe = getMethodDescribe("selectDown");
|
||||||
|
LogUtil.njcnDebug(log, "{},远程搜索值为:{}", methodDescribe, name);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, iNewStationService.selectDown(name), methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@GetMapping("/selectById")
|
||||||
|
@ApiOperation("根据ID获取新能源场站高低电压穿越表信息")
|
||||||
|
public HttpResult<NewStation> selectById(@RequestParam(name = "id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("selectById");
|
||||||
|
LogUtil.njcnDebug(log, "{},id值为:{}", methodDescribe, id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, iNewStationService.selectById(id), methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -12,10 +12,6 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.common.utils.LogUtil;
|
import com.njcn.common.utils.LogUtil;
|
||||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
|
||||||
import com.njcn.device.pq.mapper.LineMapper;
|
|
||||||
import com.njcn.device.pq.mapper.OverlimitMapper;
|
|
||||||
import com.njcn.device.pq.mapper.VoltageMapper;
|
|
||||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||||
@@ -27,7 +23,6 @@ import com.njcn.device.pq.pojo.vo.TerminalVO;
|
|||||||
import com.njcn.device.pq.service.TerminalBaseService;
|
import com.njcn.device.pq.service.TerminalBaseService;
|
||||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||||
import com.njcn.poi.util.PoiUtil;
|
import com.njcn.poi.util.PoiUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -60,23 +55,6 @@ import java.util.stream.Stream;
|
|||||||
public class TerminalBaseController extends BaseController {
|
public class TerminalBaseController extends BaseController {
|
||||||
|
|
||||||
private final TerminalBaseService terminalBaseService;
|
private final TerminalBaseService terminalBaseService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final LineDetailMapper lineDetailMapper;
|
|
||||||
|
|
||||||
|
|
||||||
private final OverlimitMapper overlimitMapper;
|
|
||||||
|
|
||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
|
||||||
|
|
||||||
|
|
||||||
private final LineMapper lineMapper;
|
|
||||||
|
|
||||||
|
|
||||||
private final VoltageMapper voltageMapper;
|
|
||||||
|
|
||||||
private final GeneralDeviceService generalDeviceService;
|
private final GeneralDeviceService generalDeviceService;
|
||||||
|
|
||||||
|
|
||||||
@@ -143,17 +121,34 @@ public class TerminalBaseController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("终端/母线/监测点同步操作")
|
@ApiOperation("变电站/终端/母线/监测点同步操作")
|
||||||
@OperateInfo(operateType = OperateType.ADD, info = LogEnum.BUSINESS_MEDIUM)
|
@OperateInfo(operateType = OperateType.ADD, info = LogEnum.BUSINESS_MEDIUM)
|
||||||
@PostMapping("terminalSync")
|
@PostMapping("terminalSync")
|
||||||
public HttpResult<String> terminalSync(@Valid @RequestBody SyncTerminalParam syncTerminalParam) {
|
public HttpResult<String> terminalSync(@Valid @RequestBody SyncTerminalParam syncTerminalParam) {
|
||||||
String methodDescribe = getMethodDescribe("terminalSync");
|
String methodDescribe = getMethodDescribe("terminalSync");
|
||||||
|
String substation = terminalBaseService.terminalSync(syncTerminalParam);
|
||||||
String subtation = terminalBaseService.terminalSync(syncTerminalParam);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, substation, methodDescribe);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, subtation, methodDescribe);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("监测点和装置同步成运行状态")
|
||||||
|
@OperateInfo(operateType = OperateType.ADD, info = LogEnum.BUSINESS_MEDIUM)
|
||||||
|
@GetMapping("/terminalSyncRunFly")
|
||||||
|
public HttpResult<Boolean> terminalSyncRunFly(@RequestParam("lineId") String lineId) {
|
||||||
|
String methodDescribe = getMethodDescribe("terminalSyncRunFly");
|
||||||
|
Boolean b = terminalBaseService.terminalSyncRunFly(lineId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("监测点信息删除")
|
||||||
|
@OperateInfo(operateType = OperateType.ADD, info = LogEnum.BUSINESS_MEDIUM)
|
||||||
|
@GetMapping("/terminalSyncDeleteFly")
|
||||||
|
public HttpResult<Boolean> terminalSyncDeleteFly(@RequestParam("lineId") String lineId) {
|
||||||
|
String methodDescribe = getMethodDescribe("terminalSyncDeleteFly");
|
||||||
|
Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终端修改操作
|
* 终端修改操作
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -82,4 +82,6 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
|||||||
|
|
||||||
|
|
||||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||||
|
|
||||||
|
List<String> getLineByDeptIdAndNewStation(@Param("id") String id);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user