Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
fd0adc5c
Commit
fd0adc5c
authored
Aug 08, 2024
by
lilongyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://36.40.66.175:5000/moa/jxdj_zx/amos-boot-zx-biz
into developer
parents
b28773c5
30ff765f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
15 deletions
+33
-15
KafkaAnalyseController.java
...t/module/jxiop/biz/controller/KafkaAnalyseController.java
+7
-1
TdInfoQueryController.java
...ot/module/jxiop/biz/controller/TdInfoQueryController.java
+0
-0
KafkaConsumerService.java
...mos/boot/module/jxiop/biz/kafka/KafkaConsumerService.java
+16
-4
IndicatorDataMapper.java
...s/boot/module/jxiop/biz/tdmapper/IndicatorDataMapper.java
+2
-2
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+4
-4
PvHealthIndex.xml
...biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
+4
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/KafkaAnalyseController.java
View file @
fd0adc5c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.Enum.SmartAnalyseEnum
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO
;
...
...
@@ -172,7 +174,11 @@ public class KafkaAnalyseController {
List
<
String
>
addressInfo
=
idxBizFanHealthIndexMapper
.
getAddressInfo
();
String
join
=
String
.
join
(
","
,
addressInfo
);
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectByAddresses
(
join
,
"1668801435891929089"
);
String
startTime
=
DateUtils
.
convertDateToString
(
DateUtil
.
offsetDay
(
new
Date
(),
-
1
),
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
getCurrentDayEndTime
(
new
Date
()),
DateUtils
.
DATE_TIME_PATTERN
);
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectByAddresses
(
join
,
"1668801435891929089"
,
startTime
,
endTime
);
return
ResponseHelper
.
buildResponse
(
indicatorData
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TdInfoQueryController.java
View file @
fd0adc5c
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/kafka/KafkaConsumerService.java
View file @
fd0adc5c
...
...
@@ -43,7 +43,7 @@ import static com.yeejoin.amos.boot.module.jxiop.biz.kafka.Constant.*;
* @create 2022/11/1 10:06
**/
@Slf4j
//
@Service
@Service
public
class
KafkaConsumerService
{
@Autowired
...
...
@@ -478,9 +478,13 @@ public class KafkaConsumerService {
private
void
buildZXZExecData
(
List
<
ConsumerRecord
<
String
,
String
>>
consumerRecords
,
Map
<
String
,
Set
<
String
>>
gatewayPoints
,
Map
<
String
,
List
<
IdxBizFanPointProcessVariableClassification
>>
zxzIds
,
String
xgxPvConsumer
)
{
String
startTime
=
DateUtils
.
convertDateToString
(
DateUtil
.
offsetDay
(
new
Date
(),
-
1
),
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
getCurrentDayEndTime
(
new
Date
()),
DateUtils
.
DATE_TIME_PATTERN
);
for
(
String
gatewayId
:
gatewayPoints
.
keySet
())
{
String
join
=
String
.
join
(
","
,
gatewayPoints
.
get
(
gatewayId
));
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectByAddresses
(
join
,
gatewayId
);
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectByAddresses
(
join
,
gatewayId
,
startTime
,
endTime
);
JsonReadOptions
options
=
JsonReadOptions
.
builderFromString
(
JSON
.
toJSONString
(
indicatorData
))
.
columnTypes
(
new
Function
<
String
,
ColumnType
>()
{
...
...
@@ -499,9 +503,13 @@ public class KafkaConsumerService {
private
void
buildExecData
(
List
<
ConsumerRecord
<
String
,
String
>>
consumerRecords
,
Map
<
String
,
Set
<
String
>>
gatewayPoints
,
String
xgxPvConsumer
)
{
String
startTime
=
DateUtils
.
convertDateToString
(
DateUtil
.
offsetDay
(
new
Date
(),
-
1
),
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
getCurrentDayEndTime
(
new
Date
()),
DateUtils
.
DATE_TIME_PATTERN
);
for
(
String
gatewayId
:
gatewayPoints
.
keySet
())
{
String
join
=
String
.
join
(
","
,
gatewayPoints
.
get
(
gatewayId
));
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectByAddresses
(
join
,
gatewayId
);
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectByAddresses
(
join
,
gatewayId
,
startTime
,
endTime
);
JsonReadOptions
options
=
JsonReadOptions
.
builderFromString
(
JSON
.
toJSONString
(
indicatorData
))
.
columnTypes
(
new
Function
<
String
,
ColumnType
>()
{
...
...
@@ -816,9 +824,13 @@ public class KafkaConsumerService {
private
void
buildZXZPvExecData
(
List
<
ConsumerRecord
<
String
,
String
>>
consumerRecords
,
Map
<
String
,
Set
<
String
>>
gatewayPoints
,
Map
<
String
,
List
<
IdxBizPvPointProcessVariableClassification
>>
zxzIds
,
String
xgxPvConsumer
)
{
String
startTime
=
DateUtils
.
convertDateToString
(
DateUtil
.
offsetDay
(
new
Date
(),
-
1
),
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
getCurrentDayEndTime
(
new
Date
()),
DateUtils
.
DATE_TIME_PATTERN
);
for
(
String
gatewayId
:
gatewayPoints
.
keySet
())
{
String
join
=
String
.
join
(
","
,
gatewayPoints
.
get
(
gatewayId
));
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectByAddresses
(
join
,
gatewayId
);
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectByAddresses
(
join
,
gatewayId
,
startTime
,
endTime
);
JsonReadOptions
options
=
JsonReadOptions
.
builderFromString
(
JSON
.
toJSONString
(
indicatorData
))
.
columnTypes
(
new
Function
<
String
,
ColumnType
>()
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdmapper/IndicatorDataMapper.java
View file @
fd0adc5c
...
...
@@ -34,8 +34,8 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
List
<
IndicatorData
>
selectDataById
(
@Param
(
"id"
)
String
id
);
@Select
(
"select `id`, `value` from iot_data.indicator_data where `address` in (${addresses}) and gateway_id = #{gatewayId}"
)
List
<
IndicatorData
>
selectByAddresses
(
@Param
(
"addresses"
)
String
addresses
,
@Param
(
"gatewayId"
)
String
gatewayId
);
@Select
(
"select `id`, `value` from iot_data.indicator_data where `address` in (${addresses}) and gateway_id = #{gatewayId}
and ts >= #{startTime} and ts <= #{endTime}
"
)
List
<
IndicatorData
>
selectByAddresses
(
@Param
(
"addresses"
)
String
addresses
,
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
/**
* 根据测点名称查询测点值信息
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
fd0adc5c
...
...
@@ -171,8 +171,8 @@
<where>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= '' "
>
and
rec_date
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and
rec_date
>
= #{dto.startDate}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= '' "
>
and
ts
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and
ts
>
= #{dto.startDate}
</if>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND area = #{dto.area}
</if>
<if
test=
"dto.number!= null and dto.number!= ''"
>
AND `number` = #{dto.number}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
...
...
@@ -200,8 +200,8 @@
<where>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= '' "
>
and
rec_date
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and
rec_date
>
= #{dto.startDate}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= '' "
>
and
ts
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and
ts
>
= #{dto.startDate}
</if>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND area = #{dto.area}
</if>
<if
test=
"dto.number!= null and dto.number!= ''"
>
AND `number` = #{dto.number}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
View file @
fd0adc5c
...
...
@@ -203,8 +203,8 @@
<where>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= ''"
>
and
rec_date
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and
rec_date
>
= #{dto.startDate}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= ''"
>
and
ts
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and
ts
>
= #{dto.startDate}
</if>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND area = #{dto.area}
</if>
<if
test=
"dto.subarray!= null and dto.subarray!= ''"
>
AND subarray = #{dto.subarray}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
...
...
@@ -231,8 +231,8 @@
<where>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= ''"
>
and
rec_date
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and
rec_date
>
= #{dto.startDate}
</if>
<if
test=
"dto.endDate!= null and dto.endDate!= ''"
>
and
ts
<
= #{dto.endDate}
</if>
<if
test=
"dto.startDate!= null and dto.startDate!= ''"
>
and
ts
>
= #{dto.startDate}
</if>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND area = #{dto.area}
</if>
<if
test=
"dto.subarray!= null and dto.subarray!= ''"
>
AND subarray = #{dto.subarray}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
...
...
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