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
cfab5a89
Commit
cfab5a89
authored
Oct 24, 2023
by
wujiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
64bcd455
2590bfae
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
19 deletions
+92
-19
IdxBizFanWeightController.java
...odule/jxiop/biz/controller/IdxBizFanWeightController.java
+32
-6
IdxBizPvWeightController.java
...module/jxiop/biz/controller/IdxBizPvWeightController.java
+37
-10
IdxBizFanWarningRecord.java
.../boot/module/jxiop/biz/entity/IdxBizFanWarningRecord.java
+7
-0
IdxBizFanWeight.java
...in/amos/boot/module/jxiop/biz/entity/IdxBizFanWeight.java
+2
-1
IdxBizPvWarningRecord.java
...s/boot/module/jxiop/biz/entity/IdxBizPvWarningRecord.java
+6
-0
IdxBizPvWeight.java
...oin/amos/boot/module/jxiop/biz/entity/IdxBizPvWeight.java
+2
-2
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+6
-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/IdxBizFanWeightController.java
View file @
cfab5a89
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -17,6 +18,7 @@ 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.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -121,10 +123,24 @@ public class IdxBizFanWeightController extends BaseController {
@Transactional
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"P
U
T"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
IdxBizFanWeight
>
update
(
@RequestBody
List
<
IdxBizFanWeight
>
list
)
{
@ApiOperation
(
httpMethod
=
"P
OS
T"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
IdxBizFanWeight
>
update
(
@RequestBody
Map
<
String
,
List
<
IdxBizFanWeight
>>
map
)
{
//获取所属,同类指标
if
(
list
!=
null
&&
list
.
size
()>
0
){
if
(
map
!=
null
){
List
<
IdxBizFanWeight
>
list
=
map
.
get
(
"data"
);
//判断是否同一层级
String
flagtype
=
null
;
for
(
IdxBizFanWeight
idxBizFanWeight
:
list
)
{
if
(
flagtype
==
null
){
flagtype
=
idxBizFanWeight
.
getArae
()+
idxBizFanWeight
.
getStation
()+
idxBizFanWeight
.
getEquipmentName
()+
idxBizFanWeight
.
getSubarray
()+
idxBizFanWeight
.
getPointName
()+
idxBizFanWeight
.
getType
();
}
else
{
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()+
idxBizFanWeight
.
getStation
()+
idxBizFanWeight
.
getEquipmentName
()+
idxBizFanWeight
.
getSubarray
()+
idxBizFanWeight
.
getPointName
()+
idxBizFanWeight
.
getType
())){
throw
new
BadRequest
(
"配置权重必须是同一个层级的数据"
);
}
}
}
Float
value
=
list
.
stream
().
map
(
e
->
e
.
getValue
()).
reduce
(
Float:
:
sum
).
get
();
IdxBizFanWeight
reviewDto
=
list
.
get
(
0
);
LambdaQueryWrapper
<
IdxBizFanWeight
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
getType
()),
IdxBizFanWeight:
:
getType
,
reviewDto
.
getType
());
...
...
@@ -135,12 +151,22 @@ public class IdxBizFanWeightController extends BaseController {
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
();
//值不能大于1
if
(
value
>
1
){
throw
new
BadRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
if
(
value
!=
1
&&
num
!=
0
){
throw
new
BadRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
//剩余权重值
float
formattedNum
=
Float
.
parseFloat
(
new
DecimalFormat
(
"0.0000"
).
format
((
1
-
value
)/
num
))
;
float
formattedNum
=
num
!=
0
?
Float
.
parseFloat
(
new
DecimalFormat
(
"0.0000"
).
format
((
1
-
value
)/
num
)):
0
;
for
(
IdxBizFanWeight
listdatum
:
listdata
)
{
for
(
IdxBizFanWeight
idxBizPvWeight
:
list
)
{
...
...
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 @
cfab5a89
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -19,6 +20,7 @@ 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.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -132,28 +134,50 @@ public class IdxBizPvWeightController extends BaseController {
}
@Transactional
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"P
U
T"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
IdxBizPvWeight
>
update
(
@RequestBody
List
<
IdxBizPvWeight
>
list
)
{
@ApiOperation
(
httpMethod
=
"P
OS
T"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
IdxBizPvWeight
>
update
(
@RequestBody
Map
<
String
,
List
<
IdxBizPvWeight
>>
map
)
{
//获取所属,同类指标
if
(
list
!=
null
&&
list
.
size
()>
0
){
if
(
map
!=
null
){
List
<
IdxBizPvWeight
>
list
=
map
.
get
(
"data"
);
//判断是否同一层级
String
flagtype
=
null
;
for
(
IdxBizPvWeight
idxBizPvWeight
:
list
)
{
if
(
flagtype
==
null
){
flagtype
=
idxBizPvWeight
.
getArae
()+
idxBizPvWeight
.
getStation
()+
idxBizPvWeight
.
getEquipmentName
()+
idxBizPvWeight
.
getSubarray
()+
idxBizPvWeight
.
getPointName
()+
idxBizPvWeight
.
getType
();
}
else
{
if
(!
flagtype
.
equals
(
idxBizPvWeight
.
getArae
()+
idxBizPvWeight
.
getStation
()+
idxBizPvWeight
.
getEquipmentName
()+
idxBizPvWeight
.
getSubarray
()+
idxBizPvWeight
.
getPointName
()+
idxBizPvWeight
.
getType
())){
throw
new
BadRequest
(
"配置权重必须是同一个层级的数据"
);
}
}
}
Float
value
=
list
.
stream
().
map
(
e
->
e
.
getValue
()).
reduce
(
Float:
:
sum
).
get
();
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
.
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
));
int
num
=
listdata
.
size
()-
list
.
size
();
//值不能大于1
if
(
value
>
1
){
throw
new
BadRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
if
(
value
!=
1
&&
num
!=
0
){
throw
new
BadRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
//剩余权重值
float
formattedNum
=
num
!=
0
?
Float
.
parseFloat
(
new
DecimalFormat
(
"0.0000"
).
format
((
1
-
value
)/
num
)):
0
;
for
(
IdxBizPvWeight
listdatum
:
listdata
)
{
for
(
IdxBizPvWeight
idxBizPvWeight
:
list
)
{
...
...
@@ -167,7 +191,10 @@ public class IdxBizPvWeightController extends BaseController {
}
idxBizPvWeightMapper
.
updateById
(
listdatum
);
}
}
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizFanWarningRecord.java
View file @
cfab5a89
...
...
@@ -151,4 +151,11 @@ public class IdxBizFanWarningRecord{
*/
@TableField
(
"KKS"
)
private
String
kks
;
/**
* 预警周期
*/
@TableField
(
"WARNING_PERIOD"
)
private
String
warningPeriod
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizFanWeight.java
View file @
cfab5a89
...
...
@@ -64,5 +64,6 @@ public class IdxBizFanWeight {
*/
@TableField
(
"VALUE"
)
private
Float
value
;
@TableField
(
exist
=
false
)
private
String
Symbol_key
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizPvWarningRecord.java
View file @
cfab5a89
...
...
@@ -152,4 +152,10 @@ public class IdxBizPvWarningRecord{
*/
@TableField
(
"KKS"
)
private
String
kks
;
/**
* 预警周期
*/
@TableField
(
"WARNING_PERIOD"
)
private
String
warningPeriod
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizPvWeight.java
View file @
cfab5a89
...
...
@@ -65,6 +65,6 @@ public class IdxBizPvWeight {
*/
@TableField
(
"VALUE"
)
private
Float
value
;
@TableField
(
exist
=
false
)
private
String
Symbol_key
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
cfab5a89
...
...
@@ -230,6 +230,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizPvWarningRecord
.
setRecDate
(
time
);
idxBizPvWarningRecord
.
setWarningPeriod
(
"按时刻"
);
idxBizPvWarningRecord
.
setManufacturer
(
idxBizPvHealthIndices
.
get
(
0
).
getManufacturer
());
idxBizPvWarningRecord
.
setPointName
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
());
idxBizPvWarningRecord
.
setHealthIndexSeq
(
idxBizPvHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
...
...
@@ -374,6 +375,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizPvWarningRecord
.
setRecDate
(
time
);
idxBizPvWarningRecord
.
setWarningPeriod
(
"按小时"
);
idxBizPvWarningRecord
.
setManufacturer
(
idxBizPvHealthIndices
.
get
(
0
).
getManufacturer
());
idxBizPvWarningRecord
.
setPointName
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
());
idxBizPvWarningRecord
.
setHealthIndexSeq
(
idxBizPvHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
...
...
@@ -512,6 +514,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizPvWarningRecord
.
setRecDate
(
time
);
idxBizPvWarningRecord
.
setWarningPeriod
(
"按天"
);
idxBizPvWarningRecord
.
setManufacturer
(
idxBizPvHealthIndices
.
get
(
0
).
getManufacturer
());
idxBizPvWarningRecord
.
setPointName
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
());
idxBizPvWarningRecord
.
setHealthIndexSeq
(
idxBizPvHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
...
...
@@ -652,6 +655,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizFanWarningRecord
.
setRecDate
(
time
);
idxBizFanWarningRecord
.
setWarningPeriod
(
"按时刻"
);
idxBizFanWarningRecord
.
setNumber
(
idxBizFanHealthIndices
.
get
(
0
).
getNumber
());
idxBizFanWarningRecord
.
setPointName
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
());
idxBizFanWarningRecord
.
setHealthIndexSeq
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
...
...
@@ -791,6 +795,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizFanWarningRecord
.
setRecDate
(
time
);
idxBizFanWarningRecord
.
setWarningPeriod
(
"按小时"
);
idxBizFanWarningRecord
.
setNumber
(
idxBizFanHealthIndices
.
get
(
0
).
getNumber
());
idxBizFanWarningRecord
.
setHealthIndexSeq
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
idxBizFanWarningRecord
.
setHealthLevel
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthLevel
());
...
...
@@ -932,6 +937,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizFanWarningRecord
.
setRecDate
(
time
);
idxBizFanWarningRecord
.
setWarningPeriod
(
"按天"
);
idxBizFanWarningRecord
.
setNumber
(
idxBizFanHealthIndices
.
get
(
0
).
getNumber
());
idxBizFanWarningRecord
.
setHealthIndexSeq
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
idxBizFanWarningRecord
.
setHealthLevel
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthLevel
());
...
...
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