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
d2fe22d5
Commit
d2fe22d5
authored
Aug 31, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pom修改
parent
45877eeb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
107 additions
and
6 deletions
+107
-6
AnalysisFanStationController.java
...le/jxiop/biz/controller/AnalysisFanStationController.java
+48
-0
PersonQrCodeController.java
...t/module/jxiop/biz/controller/PersonQrCodeController.java
+1
-6
TemporaryDataMapper.java
...os/boot/module/jxiop/biz/mapper2/TemporaryDataMapper.java
+3
-0
AnalysisFanStationImpl.java
...module/jxiop/biz/service/impl/AnalysisFanStationImpl.java
+34
-0
TemporaryDataMapper.xml
...src/main/resources/mapper/cluster/TemporaryDataMapper.xml
+21
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/AnalysisFanStationController.java
0 → 100644
View file @
d2fe22d5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
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.biz.service.impl.AnalysisFanStationImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
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.util.Map
;
@RestController
@Api
(
tags
=
"分析场站-相关API"
)
@RequestMapping
(
value
=
"/analysisStation"
)
public
class
AnalysisFanStationController
{
@Autowired
private
StationBasicMapper
stationBasicMapper
;
@Autowired
AnalysisFanStationImpl
analysisFanStationImpl
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"分析-风站 - 场站风速"
)
@GetMapping
(
"/getStationWindSpeedStatistics"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getStationWindSpeedStatistics
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
)
{
String
gatewayId
=
""
;
if
(
null
!=
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
gatewayId
=
stationBasic
.
getBoosterGatewayId
();
if
(
null
==
type
){
gatewayId
=
stationBasic
.
getFanGatewayId
();
}
}
Map
<
String
,
Object
>
detailsWindSpeed
=
analysisFanStationImpl
.
getStationWindSpeedStatistics
(
gatewayId
);
return
ResponseHelper
.
buildResponse
(
detailsWindSpeed
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PersonQrCodeController.java
View file @
d2fe22d5
...
...
@@ -67,17 +67,12 @@ public class PersonQrCodeController extends BaseController {
resultList
=
sjglZsjZsbtzMapper
.
getJobYardStatistics
(
parentCode
);
}
Map
<
Object
,
Object
>
collect
=
resultList
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"qrCodeColor"
),
t
->
t
.
get
(
"value"
)));
resultList
.
forEach
(
item
->
{
String
name
=
QrcodeColorEnum
.
getName
(
String
.
valueOf
(
item
.
get
(
"qrCodeColor"
)));
item
.
put
(
"name"
,
name
);
item
.
put
(
"value"
,
Integer
.
parseInt
(
item
.
get
(
"value"
).
toString
()));
});
List
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
Arrays
.
stream
(
QrcodeColorEnum
.
values
()).
forEach
(
item
->
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"qrCodeColor"
,
item
.
getCode
());
map
.
put
(
"name"
,
item
.
getName
());
map
.
put
(
"value"
,
collect
.
getOrDefault
(
"qrCodeColor"
,
0
));
map
.
put
(
"value"
,
collect
.
getOrDefault
(
item
.
getCode
()
,
0
));
maps
.
add
(
map
);
});
return
ResponseHelper
.
buildResponse
(
maps
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/TemporaryDataMapper.java
View file @
d2fe22d5
...
...
@@ -19,4 +19,7 @@ public interface TemporaryDataMapper extends BaseMapper<TemporaryData> {
List
<
ESWindSpeed
>
getAllData
();
List
<
Map
<
String
,
String
>>
getStationWindSpeedStatistics
(
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
,
@RequestParam
(
value
=
"equipmentIndexName"
)
String
equipmentIndexName
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/AnalysisFanStationImpl.java
0 → 100644
View file @
d2fe22d5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
@Service
@EnableScheduling
@Slf4j
public
class
AnalysisFanStationImpl
{
@Autowired
private
TemporaryDataMapper
temporaryDataMapper
;
public
Map
<
String
,
Object
>
getStationWindSpeedStatistics
(
String
gatewayId
){
List
<
Map
<
String
,
String
>>
list
=
temporaryDataMapper
.
getStationWindSpeedStatistics
(
gatewayId
,
"瞬时风速"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
String
>
valueList
=
new
ArrayList
<>();
Set
<
String
>
time
=
new
TreeSet
<>();
for
(
Map
<
String
,
String
>
stringStringMap
:
list
)
{
valueList
.
add
(
stringStringMap
.
get
(
"value"
));
time
.
add
(
stringStringMap
.
get
(
"createdTime"
));
}
map
.
put
(
"seriesData"
,
valueList
);
map
.
put
(
"axisData"
,
time
);
return
map
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/resources/mapper/cluster/TemporaryDataMapper.xml
View file @
d2fe22d5
...
...
@@ -58,4 +58,25 @@
`temporary_data`
</select>
<select
id=
"getStationWindSpeedStatistics"
resultType=
"map"
>
SELECT avg(value) as value ,
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
<where>
<if
test=
"gatewayId != null and gatewayId != ''"
>
and gatewayId = #{gatewayId}
</if>
<if
test=
"gatewayId == null or gatewayId == ''"
>
and equipmentNumber is not null and equipmentIndexName is not null
</if>
<if
test=
"equipmentIndexName != null and equipmentIndexName != ''"
>
and equipmentIndexName = #{equipmentIndexName}
</if>
</where>
GROUP BY batch_no ,equipmentIndexName;
</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