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
32b4d8cc
Commit
32b4d8cc
authored
Oct 24, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加权重接口
parent
14bbcbe3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
155 additions
and
9 deletions
+155
-9
IdxBizFanWeightController.java
...odule/jxiop/biz/controller/IdxBizFanWeightController.java
+61
-4
IdxBizPvWeightController.java
...module/jxiop/biz/controller/IdxBizPvWeightController.java
+50
-4
MonitoringMapController.java
.../module/jxiop/biz/controller/MonitoringMapController.java
+43
-0
overviewGF.json
...iop-bigscreen-biz/src/main/resources/json/overviewGF.json
+1
-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/IdxBizFanWeightController.java
View file @
32b4d8cc
...
...
@@ -5,21 +5,22 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBiz3yudDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWeightMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
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.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
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.text.DecimalFormat
;
import
java.util.List
;
/**
...
...
@@ -112,4 +113,60 @@ public class IdxBizFanWeightController extends BaseController {
List
<
IdxBizFanWeight
>
list
=
idxBizFanWeightMapper
.
selectList
(
qu
);
return
ResponseHelper
.
buildResponse
(
list
);
}
@Transactional
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
IdxBizFanWeight
>
update
(
@RequestBody
List
<
IdxBizFanWeight
>
list
)
{
//获取所属,同类指标
if
(
list
!=
null
&&
list
.
size
()>
0
){
IdxBizFanWeight
reviewDto
=
list
.
get
(
0
);
LambdaQueryWrapper
<
IdxBizFanWeight
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getType
()),
IdxBizFanWeight:
:
getType
,
reviewDto
.
getType
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getArae
()),
IdxBizFanWeight:
:
getArae
,
reviewDto
.
getArae
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getStation
()),
IdxBizFanWeight:
:
getStation
,
reviewDto
.
getStation
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getSubarray
()),
IdxBizFanWeight:
:
getSubarray
,
reviewDto
.
getSubarray
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getEquipmentName
()),
IdxBizFanWeight:
:
getEquipmentName
,
reviewDto
.
getEquipmentName
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getPointName
()),
IdxBizFanWeight:
:
getPointName
,
reviewDto
.
getPointName
());
List
<
IdxBizFanWeight
>
listdata
=
idxBizFanWeightMapper
.
selectList
(
qu
);
Float
value
=
list
.
stream
().
map
(
e
->
e
.
getValue
()).
reduce
(
Float:
:
sum
).
get
();
//设置权重值,
int
num
=
listdata
.
size
()-
list
.
size
();
//剩余权重值
float
formattedNum
=
Float
.
parseFloat
(
new
DecimalFormat
(
"0.0000"
).
format
((
1
-
value
)/
num
));
for
(
IdxBizFanWeight
listdatum
:
listdata
)
{
for
(
IdxBizFanWeight
idxBizPvWeight
:
list
)
{
if
(
idxBizPvWeight
.
getSequenceNbr
().
equals
(
listdatum
.
getSequenceNbr
())){
listdatum
.
setValue
(
idxBizPvWeight
.
getValue
());
break
;
}
else
{
listdatum
.
setValue
(
formattedNum
);
break
;
}
}
idxBizFanWeightMapper
.
updateById
(
listdatum
);
}
}
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/list"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
List
<
IdxBizFanWeight
>>
list
(
@RequestBody
List
<
String
>
list
)
{
LambdaQueryWrapper
<
IdxBizFanWeight
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
in
(!
list
.
isEmpty
(),
IdxBizFanWeight:
:
getSequenceNbr
,
list
);
List
<
IdxBizFanWeight
>
listdata
=
idxBizFanWeightMapper
.
selectList
(
qu
);
return
ResponseHelper
.
buildResponse
(
listdata
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/IdxBizPvWeightController.java
View file @
32b4d8cc
...
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBiz3yudDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvWeightMapper
;
...
...
@@ -14,15 +15,14 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
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.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
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.text.DecimalFormat
;
import
java.util.List
;
/**
...
...
@@ -128,7 +128,53 @@ public class IdxBizPvWeightController extends BaseController {
return
ResponseHelper
.
buildResponse
(
list
);
}
@Transactional
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
IdxBizPvWeight
>
update
(
@RequestBody
List
<
IdxBizPvWeight
>
list
)
{
//获取所属,同类指标
if
(
list
!=
null
&&
list
.
size
()>
0
){
IdxBizPvWeight
reviewDto
=
list
.
get
(
0
);
LambdaQueryWrapper
<
IdxBizPvWeight
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getType
()),
IdxBizPvWeight:
:
getType
,
reviewDto
.
getType
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getArae
()),
IdxBizPvWeight:
:
getArae
,
reviewDto
.
getArae
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getStation
()),
IdxBizPvWeight:
:
getStation
,
reviewDto
.
getStation
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getSubarray
()),
IdxBizPvWeight:
:
getSubarray
,
reviewDto
.
getSubarray
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getEquipmentName
()),
IdxBizPvWeight:
:
getEquipmentName
,
reviewDto
.
getEquipmentName
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getPointName
()),
IdxBizPvWeight:
:
getPointName
,
reviewDto
.
getPointName
());
List
<
IdxBizPvWeight
>
listdata
=
idxBizPvWeightMapper
.
selectList
(
qu
);
Float
value
=
list
.
stream
().
map
(
e
->
e
.
getValue
()).
reduce
(
Float:
:
sum
).
get
();
//设置权重值,
int
num
=
listdata
.
size
()-
list
.
size
();
//剩余权重值
float
formattedNum
=
Float
.
parseFloat
(
new
DecimalFormat
(
"0.0000"
).
format
((
1
-
value
)/
num
));
for
(
IdxBizPvWeight
listdatum
:
listdata
)
{
for
(
IdxBizPvWeight
idxBizPvWeight
:
list
)
{
if
(
idxBizPvWeight
.
getSequenceNbr
().
equals
(
listdatum
.
getSequenceNbr
())){
listdatum
.
setValue
(
idxBizPvWeight
.
getValue
());
break
;
}
else
{
listdatum
.
setValue
(
formattedNum
);
break
;
}
}
idxBizPvWeightMapper
.
updateById
(
listdatum
);
}
}
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/list"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
List
<
IdxBizPvWeight
>>
list
(
@RequestBody
List
<
String
>
list
)
{
LambdaQueryWrapper
<
IdxBizPvWeight
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
in
(!
list
.
isEmpty
(),
IdxBizPvWeight:
:
getSequenceNbr
,
list
);
List
<
IdxBizPvWeight
>
listdata
=
idxBizPvWeightMapper
.
selectList
(
qu
);
return
ResponseHelper
.
buildResponse
(
listdata
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitoringMapController.java
View file @
32b4d8cc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
...
...
@@ -293,4 +294,46 @@ public class MonitoringMapController extends BaseController {
}
return
stationBasicListAll
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"大屏首页- 全国发电量趋势完成率"
)
@GetMapping
(
"/getSeriesDataqg"
)
public
ResponseModel
<
SeriesData
>
getSeriesDataqg
()
{
SeriesData
map
=
largeScreenImpl
.
getSeriesDataqg
();
return
ResponseHelper
.
buildResponse
(
map
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"大屏首页- 区域发电量趋势完成率"
)
@GetMapping
(
"/getSeriesDataqy"
)
public
ResponseModel
<
SeriesData
>
getSeriesDataqy
(
String
areaCode
)
{
LambdaQueryWrapper
<
StationBasic
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
areaCode
!=
null
,
StationBasic:
:
getAreaCode
,
areaCode
);
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
wrapper
);
List
<
String
>
ids
=
stationBasics
.
stream
().
map
(
StationBasic:
:
getFanGatewayId
).
collect
(
Collectors
.
toList
());
SeriesData
map
=
largeScreenImpl
.
getSeriesDataqy
(
new
Date
(),
ids
,
areaCode
);
return
ResponseHelper
.
buildResponse
(
map
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/resources/json/overviewGF.json
View file @
32b4d8cc
...
...
@@ -27,7 +27,7 @@
},
{
"url"
:
"upload/jxiop/amos_studio/22639FDFF29B20B681DF55F1252876B3.png"
,
"title1"
:
"总辐射日累计(M
b
/㎡)"
,
"title1"
:
"总辐射日累计(M
J
/㎡)"
,
"title"
:
"总辐射累计"
},
{
...
...
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