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
6eebab07
Commit
6eebab07
authored
Nov 24, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预警列表bug处理
parent
ff2de0da
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
7 deletions
+42
-7
TdInfoQueryController.java
...ot/module/jxiop/biz/controller/TdInfoQueryController.java
+34
-5
FanWaringRecordMapper.java
...oot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
+1
-1
FanWarningRecord.xml
.../src/main/resources/mapper/tdengine2/FanWarningRecord.xml
+4
-1
PvWarningRecord.xml
...z/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
+3
-0
No files found.
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 @
6eebab07
...
...
@@ -181,7 +181,7 @@ public class TdInfoQueryController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/getFanWarningRecordInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 风电"
,
notes
=
"分页查询健康指数信息 - 风电"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>
>>
getFanWarningRecordInfo
(
@RequestBody
FanHealthIndexDto
dto
)
throws
ParseException
{
public
ResponseModel
<
Page
<
FanWarningRecord
>>
getFanWarningRecordInfo
(
@RequestBody
FanHealthIndexDto
dto
)
throws
ParseException
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
String
startDate
=
dto
.
getStartDate
();
Date
date
=
DateUtils
.
dateParse
(
startDate
,
DATE_TIME_PATTERN
);
...
...
@@ -194,7 +194,16 @@ public class TdInfoQueryController {
String
endDateString
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
8
),
DATE_TIME_PATTERN
);
dto
.
setEndDate
(
endDateString
);
}
Page
<
Map
<
String
,
Object
>>
resultPage
=
new
Page
<>(
dto
.
getCurrent
(),
dto
.
getSize
());
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getSortsString
()))
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
try
{
List
<
Map
<
String
,
String
>>
list
=
objectMapper
.
readValue
(
dto
.
getSortsString
(),
new
TypeReference
<
List
<
Map
<
String
,
String
>>>(){});
dto
.
setSorts
(
list
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
Page
<
FanWarningRecord
>
resultPage
=
new
Page
<>(
dto
.
getCurrent
(),
dto
.
getSize
());
dto
.
setCurrent
((
dto
.
getCurrent
()
-
1
)
*
dto
.
getSize
());
List
<
Map
<
String
,
String
>>
orderWeight
=
dto
.
getSorts
().
stream
().
sorted
(
Comparator
.
comparing
(
t
->
Integer
.
parseInt
(
t
.
get
(
"orderWeight"
)))).
collect
(
Collectors
.
toList
());
List
<
String
>
orderByList
=
new
ArrayList
<>();
...
...
@@ -203,9 +212,15 @@ public class TdInfoQueryController {
String
columnOrder
=
map
.
get
(
"columnKey"
)
+
" "
+
replace
;
orderByList
.
add
(
columnOrder
);
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getSortOne
()))
{
String
[]
split
=
dto
.
getSortOne
().
split
(
","
);
String
replace
=
split
[
1
].
replace
(
"end"
,
""
);
String
orderColumn
=
convert
(
split
[
0
])
+
" "
+
replace
;
dto
.
setSortOne
(
orderColumn
);
}
String
join
=
String
.
join
(
","
,
orderByList
);
dto
.
setOrderColumns
(
join
);
List
<
Map
<
String
,
Object
>
>
fanWarningRecordsIPage
=
fanWaringRecordMapper
.
getInfoByPage
(
dto
);
List
<
FanWarningRecord
>
fanWarningRecordsIPage
=
fanWaringRecordMapper
.
getInfoByPage
(
dto
);
Integer
infoByPageTotal
=
fanWaringRecordMapper
.
getInfoByPageTotal
(
dto
);
resultPage
.
setRecords
(
fanWarningRecordsIPage
);
resultPage
.
setTotal
(
infoByPageTotal
);
...
...
@@ -228,16 +243,30 @@ public class TdInfoQueryController {
String
endDateString
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
8
),
DATE_TIME_PATTERN
);
dto
.
setEndDate
(
endDateString
);
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getSortsString
()))
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
try
{
List
<
Map
<
String
,
String
>>
list
=
objectMapper
.
readValue
(
dto
.
getSortsString
(),
new
TypeReference
<
List
<
Map
<
String
,
String
>>>(){});
dto
.
setSorts
(
list
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
Page
<
PvWarningRecord
>
resultPage
=
new
Page
<>(
dto
.
getCurrent
(),
dto
.
getSize
());
dto
.
setCurrent
((
dto
.
getCurrent
()
-
1
)
*
dto
.
getSize
());
List
<
Map
<
String
,
String
>>
orderWeight
=
dto
.
getSorts
().
stream
().
sorted
(
Comparator
.
comparing
(
t
->
Integer
.
parseInt
(
t
.
get
(
"orderWeight"
)))).
collect
(
Collectors
.
toList
());
List
<
String
>
orderByList
=
new
ArrayList
<>();
for
(
Map
<
String
,
String
>
map
:
orderWeight
)
{
String
replace
=
map
.
get
(
"order"
).
replace
(
"end"
,
""
);
String
columnOrder
=
map
.
get
(
"columnKey"
)
+
" "
+
replace
;
String
columnOrder
=
convert
(
map
.
get
(
"columnKey"
)
)
+
" "
+
replace
;
orderByList
.
add
(
columnOrder
);
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getSortOne
()))
{
String
[]
split
=
dto
.
getSortOne
().
split
(
","
);
String
replace
=
split
[
1
].
replace
(
"end"
,
""
);
String
orderColumn
=
convert
(
split
[
0
])
+
" "
+
replace
;
dto
.
setSortOne
(
orderColumn
);
}
String
join
=
String
.
join
(
","
,
orderByList
);
dto
.
setOrderColumns
(
join
);
List
<
PvWarningRecord
>
pvWarningRecords
=
pvWaringRecordMapper
.
getInfoByPage
(
dto
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
View file @
6eebab07
...
...
@@ -28,7 +28,7 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfo
();
List
<
Map
<
String
,
Object
>
>
getInfoByPage
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
List
<
FanWarningRecord
>
getInfoByPage
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanWarningRecord.xml
View file @
6eebab07
...
...
@@ -208,7 +208,7 @@
`b`.`EQUIPMENT_NAME`
</select>
<select
id=
"getInfoByPage"
resultType=
"
map
"
>
<select
id=
"getInfoByPage"
resultType=
"
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
"
>
SELECT * FROM fan_warning_record
<where>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND arae = #{dto.area}
</if>
...
...
@@ -224,6 +224,9 @@
<if
test=
"dto.orderColumns != null and dto.orderColumns != ''"
>
order by ${dto.orderColumns}
</if>
<if
test=
"(dto.orderColumns == null or dto.orderColumns == '') and dto.sortOne != null and dto.sortOne != ''"
>
order by ${dto.sortOne}
</if>
limit #{dto.current}, #{dto.size}
</select>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
View file @
6eebab07
...
...
@@ -243,6 +243,9 @@
<if
test=
"dto.orderColumns != null and dto.orderColumns != ''"
>
order by ${dto.orderColumns}
</if>
<if
test=
"(dto.orderColumns == null or dto.orderColumns == '') and dto.sortOne != null and dto.sortOne != ''"
>
order by ${dto.sortOne}
</if>
limit #{dto.current}, #{dto.size}
</select>
...
...
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