Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
c158ee73
Commit
c158ee73
authored
Aug 29, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改监盘客户现场对接问题
parent
94ee5511
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
75 additions
and
53 deletions
+75
-53
pom.xml
...t-system-jxiop/amos-boot-module-jxiop-monitor-biz/pom.xml
+5
-0
CommonConstans.java
.../amos/boot/module/jxiop/biz/constants/CommonConstans.java
+34
-0
DemoController.java
...amos/boot/module/jxiop/biz/controller/DemoController.java
+0
-1
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+8
-4
MonitoringMapController.java
.../module/jxiop/biz/controller/MonitoringMapController.java
+8
-1
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+15
-42
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+0
-0
MonitoringServiceIMQTTmpl.java
...ule/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
+0
-0
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+0
-0
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+1
-1
pom.xml
pom.xml
+4
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/pom.xml
View file @
c158ee73
...
...
@@ -32,6 +32,11 @@
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
5.7.22
</version>
</dependency>
<dependency>
<groupId>
org.influxdb
</groupId>
<artifactId>
influxdb-java
</artifactId>
</dependency>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/constants/CommonConstans.java
0 → 100644
View file @
c158ee73
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
constants
;
import
org.checkerframework.checker.units.qual.C
;
public
class
CommonConstans
{
//光伏发电量系数
public
static
final
Double
pvGenPoweActor
=
0.0001
;
// 风电站:
// (日/月/年)发电量=场站所有风机(日/月/年)发电量总和
// 装机容量=场站所有风机装机容量总和
//
// 光伏站:
// (日/月/年)发电量=场站所有逆变器(日/月/年)发电量总和
// 装机容量=场站所有逆变器装机容量总和
//
// 通用:
// 发电量完成率=(月/年)发电量/(月/年)发电量指标
// 小时数完成率=(月/年)可利用小时/(月/年)可利用小时数指标
// 可利用小时(h)=(日/月/年)发电量(万kW·h)/装机容量(万kW)
// 二氧化碳减排量(万t)=发电量(万kW·h)*0.79
public
static
final
Double
carbonDioxide
=
0.79
;
// 节约标准煤(万t)=发电量(万kW·h)*0.29
public
static
final
Double
standardCoal
=
0.29
;
// 炭粉尘减排量(t)=发电量(万kW·h)*0.30
public
static
final
Double
toner
=
0.30
;
// 二氧化硫减排量(t)=发电量(万kW·h)*1.51
public
static
final
Double
sulfurDioxide
=
1.51
;
// 氮氧化物减排量(t)=发电量(万kW·h)*1.69
public
static
final
Double
oxynitride
=
1.69
;
//吨转万吨
public
static
final
Double
tToWT
=
0.0001
;
//万Kwh转MV
public
static
final
Integer
wkwhToMv
=
10
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/DemoController.java
View file @
c158ee73
...
...
@@ -376,7 +376,6 @@ public class DemoController extends BaseController {
public
ResponseModel
<
Object
>
demoTest9
()
{
QueryBuilder
queryBuilder
=
QueryBuilders
.
matchQuery
(
"equipmentIndexName"
,
"有功功率"
);
AvgAggregationBuilder
buyCountAvg
=
AggregationBuilders
.
avg
(
"buyCountAvg"
).
field
(
"valueDouble"
);
Query
query
=
new
NativeSearchQueryBuilder
()
.
withQuery
(
queryBuilder
)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
c158ee73
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
cn.hutool.extra.pinyin.PinyinUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -12,6 +13,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl
;
...
...
@@ -108,18 +110,20 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风机布置图 - 风机状态图片"
)
@GetMapping
(
"/getFanStatusListImage"
)
public
ResponseModel
<
IPage
<
HashMap
<
String
,
String
>>>
getFanStatusListImages
(
)
{
List
<
IndexDto
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
"1660231556607774721"
);
public
ResponseModel
<
IPage
<
HashMap
<
String
,
String
>>>
getFanStatusListImages
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
List
<
IndexDto
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
stationId
);
List
<
IndexDto
>
collect
=
fanStatusList
.
stream
()
.
limit
(
999
)
.
collect
(
Collectors
.
toList
());
IPage
<
HashMap
<
String
,
String
>>
page
=
new
Page
<>();
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
List
<
IndexDto
>
indexDtoList
=
collect
.
stream
().
sorted
(
Comparator
.
comparing
(
IndexDto:
:
getEquipmentNumber
)).
collect
(
Collectors
.
toList
());
//获取拼音首字母
String
prefix
=
commonService
.
getFanDevicePrefix
(
stationId
);
for
(
int
i
=
1
;
i
<=
indexDtoList
.
size
();
i
++)
{
IndexDto
indexDto
=
indexDtoList
.
get
(
i
-
1
);
hashMap
.
put
(
"url"
+
i
,
fanStatusImagePathPrefix
+
"/"
+
"风机-"
+
indexDto
.
getState
()+
".gif"
);
hashMap
.
put
(
"name"
+
i
,
indexDto
.
getEquipmentNumber
());
hashMap
.
put
(
"name"
+
i
,
prefix
+
indexDto
.
getEquipmentNumber
());
}
page
.
setTotal
(
10
);
page
.
setSize
(
10
);
...
...
@@ -589,7 +593,7 @@ public class MonitorFanIdxController extends BaseController {
//日-月-年-发电量需要保留四位小数问题修改
for
(
String
column
:
columnList
)
{
Double
result
=
commonService
.
getTotalByIndicatior
(
mapList
,
column
);
columnMap
.
put
(
column
,
String
.
format
(
"%.4f"
,
result
/
10000
));
columnMap
.
put
(
column
,
String
.
format
(
"%.4f"
,
result
*
CommonConstans
.
pvGenPoweActor
));
}
for
(
String
column
:
syLists
)
{
Double
result
=
commonService
.
getNumByIndicatior
(
boosterGatewayId
,
column
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitoringMapController.java
View file @
c158ee73
...
...
@@ -40,10 +40,17 @@ import java.util.logging.Handler;
@Api
(
tags
=
"监盘地图接口"
)
@RequestMapping
(
value
=
"/monitormap"
)
public
class
MonitoringMapController
extends
BaseController
{
@Value
(
"${sec.startdate:2017-06-30}"
)
String
secStartDate
;
@Autowired
MonitoringServiceImpl
monitoringServiceImpl
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取监盘全国-安全生产天数"
)
@GetMapping
(
"/getSecDays"
)
public
ResponseModel
<
String
>
getSecDays
(
@RequestParam
(
value
=
"provinceName"
,
required
=
false
)
String
provinceName
,
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getSecDays
(
secStartDate
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取监盘全国地图数据"
)
@GetMapping
(
"/nationwide"
)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
c158ee73
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.hutool.extra.pinyin.PinyinUtil
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationPlanMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.
dto.IndicatorsDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.
constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.QueryDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.initdata.StationCacheDataInit
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.repository.ESEquipmentsRepository
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
import
com.yeejoin.amos.component.influxdb.InfluxdbUtil
;
import
net.bytebuddy.asm.Advice
;
import
org.apache.poi.ss.formula.functions.Count
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.aggregations.Aggregation
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.Aggregations
;
import
org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms
;
import
org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.aggregations.metrics.*
;
...
...
@@ -37,17 +32,10 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.*
;
@Service
public
class
CommonServiceImpl
{
@Autowired
InfluxDButils
influxDButils
;
@Autowired
InfluxdbUtil
influxdbUtil
;
...
...
@@ -63,7 +51,8 @@ public class CommonServiceImpl {
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
StationBasicMapper
stationBasicMapper
;
/**
* 带参数 求平均值
*
...
...
@@ -92,7 +81,6 @@ public class CommonServiceImpl {
return
value
;
}
/*
*分组平均值
...
...
@@ -127,7 +115,6 @@ public class CommonServiceImpl {
return
listdata
;
}
/*
*分组求和
...
...
@@ -161,9 +148,6 @@ public class CommonServiceImpl {
return
listdata
;
}
/**
* 带参数 求和
*
...
...
@@ -207,20 +191,6 @@ public class CommonServiceImpl {
return
search
.
getSearchHits
().
size
();
}
/**
* @deprecated 获取指标值总和
* @param gatewayId 网关id 用于拼接sql语句
...
...
@@ -275,7 +245,6 @@ public class CommonServiceImpl {
}
/**
* @deprecated 获取指标值平均值
* @param gatewayId 网关id 用于拼接sql语句
* @param indicator 指标名称 查询条件-根据指标名称获取风速
* @return 指标值总和
*/
...
...
@@ -312,16 +281,16 @@ public class CommonServiceImpl {
氮氧化物减排量(t)=发电量(万kW·h)*1.69
*/
co2
.
setUnit
(
"二氧化碳减排量(万t)"
);
co2
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
*
0.79
));
co2
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
*
CommonConstans
.
carbonDioxide
));
socialContributionDtoList
.
add
(
co2
);
coal
.
setUnit
(
"节约标准煤(万t)"
);
coal
.
setTitle
(
String
.
format
(
"%.2f"
,(
totalSocialContribution
*
0.29
)/
10000
));
coal
.
setTitle
(
String
.
format
(
"%.2f"
,(
totalSocialContribution
*
CommonConstans
.
standardCoal
)
));
socialContributionDtoList
.
add
(
coal
);
toner
.
setUnit
(
"碳粉尘减排量(万t)"
);
toner
.
setTitle
(
String
.
format
(
"%.2f"
,(
totalSocialContribution
*
0.30
)/
10000
));
toner
.
setTitle
(
String
.
format
(
"%.2f"
,(
totalSocialContribution
*
CommonConstans
.
toner
*
CommonConstans
.
tToWT
)
));
socialContributionDtoList
.
add
(
toner
);
so2
.
setUnit
(
"二氧化硫减排量(万t)"
);
so2
.
setTitle
(
String
.
format
(
"%.2f"
,(
totalSocialContribution
*
1.51
)/
10000
));
so2
.
setTitle
(
String
.
format
(
"%.2f"
,(
totalSocialContribution
*
CommonConstans
.
sulfurDioxide
*
CommonConstans
.
tToWT
)
));
socialContributionDtoList
.
add
(
so2
);
socialContributionDtoPage
.
setRecords
(
socialContributionDtoList
);
socialContributionDtoPage
.
setTotal
(
100
);
...
...
@@ -342,4 +311,8 @@ public class CommonServiceImpl {
return
stationCacheInfoDtoList
;
}
public
String
getFanDevicePrefix
(
String
stationid
){
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationid
);
return
PinyinUtil
.
getFirstLetter
(
stationBasic
.
getStationName
().
split
(
"风"
)[
0
],
""
).
toUpperCase
(
Locale
.
ROOT
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
c158ee73
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
View file @
c158ee73
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
c158ee73
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
c158ee73
...
...
@@ -757,7 +757,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
Long
sequenceNbr
=
companyModelFeignClientResult
.
getResult
().
getSequenceNbr
();
// 查询企业对应角色下的用户
logger
.
info
(
"向privilege发送参数roleId,companyId,{},{}"
,
roleId
,
sequenceNbr
);
FeignClientResult
<
List
<
AgencyUserModel
>>
listFeignClientResult
=
Privilege
.
agencyUserClient
.
queryByCompany
Roles
(
sequenceNbr
,
roleId
,
null
,
null
);
FeignClientResult
<
List
<
AgencyUserModel
>>
listFeignClientResult
=
Privilege
.
agencyUserClient
.
queryByCompany
Id
(
sequenceNbr
,
roleId
,
null
,
null
);
logger
.
info
(
"privilege返回用户信息,{}"
,
JSONObject
.
toJSONString
(
listFeignClientResult
));
if
(!
ObjectUtils
.
isEmpty
(
listFeignClientResult
)
&&
!
ObjectUtils
.
isEmpty
(
listFeignClientResult
.
getResult
())){
listFeignClientResult
.
getResult
().
forEach
(
item
->{
...
...
pom.xml
View file @
c158ee73
...
...
@@ -294,24 +294,24 @@
<repository>
<id>
Releases
</id>
<name>
Releases
</name>
<url>
http://
113.142.68.105
:8081/nexus/content/repositories/releases/
</url>
<url>
http://
36.46.149.14
:8081/nexus/content/repositories/releases/
</url>
</repository>
<repository>
<id>
com.e-iceblue
</id>
<name>
e-iceblue
</name>
<url>
http://
113.142.68.105
:8081/nexus/content/groups/public/
</url>
<url>
http://
36.46.149.14
:8081/nexus/content/groups/public/
</url>
</repository>
<repository>
<id>
Snapshots
</id>
<name>
Snapshots
</name>
<url>
http://
113.142.68.105
:8081/nexus/content/repositories/snapshots/
</url>
<url>
http://
36.46.149.14
:8081/nexus/content/repositories/snapshots/
</url>
</repository>
<repository>
<id>
thirdparty
</id>
<name>
thirdparty
</name>
<url>
http://
113.142.68.105
:8081/nexus/content/repositories/thirdparty/
</url>
<url>
http://
36.46.149.14
:8081/nexus/content/repositories/thirdparty/
</url>
</repository>
</repositories>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment