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
65f757b3
Commit
65f757b3
authored
Oct 26, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
a43cbbaf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
18 deletions
+139
-18
AnalyseController.java
...s/boot/module/jxiop/biz/controller/AnalyseController.java
+34
-1
BigScreenAnalyseController.java
...dule/jxiop/biz/controller/BigScreenAnalyseController.java
+38
-15
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+11
-1
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+56
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/AnalyseController.java
View file @
65f757b3
...
...
@@ -20,6 +20,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -139,6 +140,23 @@ public class AnalyseController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取influxdb数据"
,
notes
=
"获取influxdb数据"
)
@GetMapping
(
value
=
"/getInfluxdbDataByConditon"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getInfluxdbDataByConditon
(
@RequestParam
String
stationType
,
@RequestParam
String
pointId
,
@RequestParam
(
required
=
false
)
String
startTime
,
@RequestParam
(
required
=
false
)
String
endTime
)
{
if
(!
StringUtils
.
isEmpty
(
startTime
))
{
try
{
Date
date
=
DateUtils
.
dateAddHours
(
DateUtils
.
dateParse
(
startTime
,
DateUtils
.
DATE_TIME_PATTERN
),
-
8
);
startTime
=
DateUtils
.
convertDateToString
(
date
,
DateUtils
.
DATE_TIME_PATTERN
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
if
(!
StringUtils
.
isEmpty
(
endTime
))
{
try
{
Date
date
=
DateUtils
.
dateAddHours
(
DateUtils
.
dateParse
(
endTime
,
DateUtils
.
DATE_TIME_PATTERN
),
-
8
);
endTime
=
DateUtils
.
convertDateToString
(
date
,
DateUtils
.
DATE_TIME_PATTERN
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
if
(
StringUtils
.
isEmpty
(
startTime
))
{
Date
sevenAgoDayStartTime
=
null
;
try
{
...
...
@@ -181,7 +199,22 @@ public class AnalyseController extends BaseController {
}
}
if
(!
StringUtils
.
isEmpty
(
startTime
))
{
try
{
Date
date
=
DateUtils
.
dateAddHours
(
DateUtils
.
dateParse
(
startTime
,
DateUtils
.
DATE_TIME_PATTERN
),
-
8
);
startTime
=
DateUtils
.
convertDateToString
(
date
,
DateUtils
.
DATE_TIME_PATTERN
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
if
(!
StringUtils
.
isEmpty
(
endTime
))
{
try
{
Date
date
=
DateUtils
.
dateAddHours
(
DateUtils
.
dateParse
(
endTime
,
DateUtils
.
DATE_TIME_PATTERN
),
-
8
);
endTime
=
DateUtils
.
convertDateToString
(
date
,
DateUtils
.
DATE_TIME_PATTERN
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
if
(
StringUtils
.
isEmpty
(
startTime
))
{
Date
sevenAgoDayStartTime
=
null
;
try
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/BigScreenAnalyseController.java
View file @
65f757b3
...
...
@@ -38,6 +38,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
java.io.UnsupportedEncodingException
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -632,23 +633,28 @@ public class BigScreenAnalyseController extends BaseController {
@ApiOperation
(
value
=
"风站/光伏 右下实时趋势"
)
@GetMapping
(
"/getTrendInfoByAddress"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getTrendInfoByAddress
(
@RequestParam
(
value
=
"indexAddress"
,
required
=
false
)
String
indexAddress
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"tableName"
,
required
=
false
)
String
tableName
,
@RequestParam
(
value
=
"tableName2"
,
required
=
false
)
String
tableName2
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
Date
currentDayStartTime
=
DateUtils
.
getCurrentDayStartTime
(
new
Date
()
);
Date
currentDayEndTime
=
DateUtils
.
getCurrentDayEndTime
(
new
Date
()
);
String
startTime
=
DateUtils
.
convertDateToString
(
currentDayStartTime
,
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
currentDayEndTime
,
DateUtils
.
DATE_TIME_PATTERN
);
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectDataByAddressAndtime
(
indexAddress
,
startTime
,
endTime
,
stationBasic
.
getFanGatewayId
());
List
<
Map
<
String
,
Object
>>
resultListData
=
new
ArrayList
<>(
);
String
recDate
=
idxBizFanHealthIndexMapper
.
getRecDateByIndexAddress
(
stationBasic
.
getFanGatewayId
(),
indexAddress
,
tableName
);
if
(
CharSequenceUtil
.
isNotEmpty
(
recDate
))
{
resultListData
=
idxBizFanHealthIndexMapper
.
getInfoListByTableName
(
stationBasic
.
getFanGatewayId
(),
indexAddress
,
tableName2
,
recDate
);
}
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
Object
>
valueList
=
new
ArrayList
<>();
indicatorData
.
forEach
(
item
->
{
String
date
=
DateUtils
.
convertDateToString
(
item
.
getCreatedTime
(),
"HH:mm:ss"
);
resultListData
.
forEach
(
item
->
{
String
date
=
""
;
try
{
date
=
DateUtils
.
convertDateToString
(
DateUtils
.
dateParse
(
item
.
get
(
"REC_DATE"
).
toString
(),
DateUtils
.
DATE_TIME_PATTERN
),
"MM-dd HH:mm:ss"
);
}
catch
(
ParseException
e
)
{
}
time
.
add
(
date
);
String
value
=
StrUtil
.
isEmpty
(
item
.
getValue
())
?
"0.0"
:
item
.
getValue
();
double
v
=
Double
.
parseDouble
(
value
);
valueList
.
add
(
v
);
String
value
=
CharSequenceUtil
.
isEmpty
(
item
.
get
(
"healthIndex"
).
toString
().
replace
(
".0"
,
""
))
?
"100"
:
item
.
get
(
"healthIndex"
).
toString
().
replace
(
".0"
,
""
);
valueList
.
add
(
value
);
});
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
HashMap
<
String
,
Object
>
stringStringHashMap
=
new
HashMap
<>();
...
...
@@ -656,19 +662,36 @@ public class BigScreenAnalyseController extends BaseController {
arrayList
.
add
(
stringStringHashMap
);
resultMap
.
put
(
"axisData"
,
time
);
resultMap
.
put
(
"seriesData"
,
arrayList
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据测点ID查询测点名称"
)
@GetMapping
(
"/getMapStringByString"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getMapStringByString
(
@RequestParam
(
value
=
"indexAddress"
,
required
=
false
)
String
indexAddress
,
@RequestParam
(
value
=
"tableName"
,
required
=
true
)
String
tableName
,
@RequestParam
(
value
=
"stationId"
,
required
=
true
)
String
stationId
,
@RequestParam
(
value
=
"tableName2"
,
required
=
false
)
String
tableName2
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
nameByIndexAddress
=
idxBizFanHealthIndexMapper
.
getPointNameByIndexAddress
(
indexAddress
,
tableName
,
stationBasic
.
getFanGatewayId
());
int
num
=
idxBizFanHealthIndexMapper
.
getIsWarningByPointId
(
indexAddress
,
stationBasic
.
getFanGatewayId
(),
tableName2
);
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"text"
,
nameByIndexAddress
);
resultMap
.
put
(
"warningNum"
,
num
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"风站/光伏 右下诊断分析"
)
@GetMapping
(
"/getRiskHandleByVarDesc"
)
public
ResponseModel
<
Map
<
String
,
String
>>
getRiskHandleByVarDesc
(
@RequestParam
(
value
=
"varDesc"
,
required
=
false
)
String
varDesc
,
@RequestParam
(
value
=
"tableName"
,
required
=
true
)
String
tableName
)
{
@RequestParam
(
value
=
"tableName"
,
required
=
true
)
String
tableName
,
@RequestParam
(
value
=
"stationId"
)
String
stationId
)
{
varDesc
=
idxBizFanHealthIndexMapper
.
getPointNameByIndexAddress
(
varDesc
,
tableName
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
varDesc
=
idxBizFanHealthIndexMapper
.
getPointNameByIndexAddress
(
varDesc
,
tableName
,
stationBasic
.
getFanGatewayId
());
FeignClientResult
<
List
<
String
>>
sevenEntityMcb
=
null
;
try
{
sevenEntityMcb
=
riskWarningFeign
.
getRiskHandleByVarDesc
(
varDesc
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
View file @
65f757b3
...
...
@@ -85,7 +85,8 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
String
getPointNameByIndexAddress
(
@Param
(
"varDesc"
)
String
varDesc
,
@Param
(
"tableName"
)
String
tableName
);
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
FullViewRecallDataDTO
>
getFullViewRecall
();
...
...
@@ -122,4 +123,13 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
Integer
pointNum
(
String
STATION
,
String
SUBARRAY
,
String
EQUIPMENTNAME
);
Map
<
String
,
Object
>
getPvEquipStatusByStation
(
String
station
);
String
getRecDateByIndexAddress
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"tableName"
)
String
tableName
);
List
<
Map
<
String
,
Object
>>
getInfoListByTableName
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
);
int
getIsWarningByPointId
(
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"tableName"
)
String
tableName
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
65f757b3
...
...
@@ -584,6 +584,8 @@
FROM
idx_biz_pv_point_process_variable_classification
<where>
EQUIPMENT_NAME IS NOT NULL
AND EQUIPMENT_NAME != ''
<if
test=
"subarray != null and subarray != ''"
>
AND SUBARRAY = concat('#', #{subarray})
</if>
...
...
@@ -664,7 +666,10 @@
<select
id=
"getPointNameByIndexAddress"
resultType=
"java.lang.String"
>
select POINT_NAME
from ${tableName}
where INDEX_ADDRESS = #{varDesc} limit 1
where INDEX_ADDRESS = #{varDesc}
and GATEWAY_ID = #{gatewayId}
limit 1
</select>
...
...
@@ -1227,4 +1232,54 @@
) a
</select>
<select
id=
"getRecDateByIndexAddress"
resultType=
"java.lang.String"
>
SELECT
a.REC_DATE
FROM
(
SELECT
*,(
CASE
WHEN WARNING_NAME = '注意' THEN
1
WHEN WARNING_NAME = '警告' THEN
2
WHEN WARNING_NAME = '危险' THEN
3 ELSE 0
END
) AS sort
FROM
${tableName}
WHERE
INDEX_ADDRESS = #{indexAddress}
AND DISPOSOTION_STATE = '未处置'
and GATEWAY_ID = #{fanGatewayId}
ORDER BY
sort DESC
LIMIT 1
) a
</select>
<select
id=
"getInfoListByTableName"
resultType=
"java.util.Map"
>
SELECT
*,
CEILING(HEALTH_INDEX) as healthIndex
FROM
${tableName}
WHERE
#{recDate} >= REC_DATE
AND REC_DATE >= DATE_ADD( #{recDate}, INTERVAL - 12 hour )
AND ANALYSIS_TYPE = '按时刻'
AND INDEX_ADDRESS = #{indexAddress}
AND GATEWAY_ID = #{fanGatewayId}
</select>
<select
id=
"getIsWarningByPointId"
resultType=
"int"
>
select count(1) from ${tableName}
where INDEX_ADDRESS = #{indexAddress}
AND GATEWAY_ID = #{fanGatewayId}
and DISPOSOTION_STATE = '未处置'
</select>
</mapper>
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