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
d7549df8
Commit
d7549df8
authored
Aug 19, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
区域权重修改
parent
fbad3c07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
11 deletions
+45
-11
IdxBizFanWeightController.java
...odule/jxiop/biz/controller/IdxBizFanWeightController.java
+23
-5
IdxBizPvWeightController.java
...module/jxiop/biz/controller/IdxBizPvWeightController.java
+22
-6
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 @
d7549df8
...
...
@@ -14,6 +14,7 @@ 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
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvWeightMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -29,10 +30,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.text.DecimalFormat
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -47,6 +45,8 @@ public class IdxBizFanWeightController extends BaseController {
@Autowired
IdxBizFanWeightMapper
idxBizFanWeightMapper
;
@Autowired
IdxBizPvWeightMapper
idxBizPvWeightMapper
;
@Autowired
UserEmpowerMapper
userEmpowerMapper
;
...
...
@@ -296,8 +296,18 @@ public class IdxBizFanWeightController extends BaseController {
// qu.eq(!StringUtils.isEmpty(reviewDto.getPointName()), IdxBizFanWeight::getPointName, reviewDto.getPointName());
List
<
IdxBizFanWeight
>
listdata
=
idxBizFanWeightMapper
.
selectList
(
qu
);
//场站级别包括风电
int
allDataSize
=
listdata
.
size
();
List
<
IdxBizPvWeight
>
pvData
=
new
ArrayList
<>();
if
(
"2"
.
equals
(
reviewDto
.
getType
())){
LambdaQueryWrapper
<
IdxBizPvWeight
>
pvWrapper
=
new
LambdaQueryWrapper
<>();
pvWrapper
.
eq
(
IdxBizPvWeight:
:
getType
,
reviewDto
.
getType
());
pvWrapper
.
eq
(
IdxBizPvWeight:
:
getArae
,
reviewDto
.
getArae
());
pvData
=
idxBizPvWeightMapper
.
selectList
(
pvWrapper
);
allDataSize
=
allDataSize
+
pvData
.
size
();
}
//设置权重值,
int
num
=
listdata
.
size
()
-
list
.
size
();
int
num
=
allDataSize
-
list
.
size
();
if
(
num
==
0
)
{
if
(
valued
!=
1
)
{
throw
new
BadRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
...
...
@@ -331,6 +341,14 @@ public class IdxBizFanWeightController extends BaseController {
}
idxBizFanWeightMapper
.
updateById
(
listdatum
);
}
if
(
CollectionUtil
.
isNotEmpty
(
pvData
)){
for
(
IdxBizPvWeight
listdatum
:
pvData
)
{
listdatum
.
setValue
(
formattedNum
);
listdatum
.
setFlag
(
null
);
idxBizPvWeightMapper
.
updateById
(
listdatum
);
}
}
}
return
ResponseHelper
.
buildResponse
(
null
);
...
...
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 @
d7549df8
...
...
@@ -19,6 +19,7 @@ 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.entity.IdxBizPvWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWeight
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWeightMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvWeightMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -35,10 +36,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.text.DecimalFormat
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -55,6 +53,8 @@ public class IdxBizPvWeightController extends BaseController {
@Autowired
IdxBizPvWeightMapper
idxBizPvWeightMapper
;
@Autowired
IdxBizFanWeightMapper
idxBizFanWeightMapper
;
@Autowired
UserEmpowerMapper
userEmpowerMapper
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/queryPage"
)
...
...
@@ -305,9 +305,18 @@ public class IdxBizPvWeightController extends BaseController {
// qu.eq(!StringUtils.isEmpty(reviewDto.getEquipmentName()), IdxBizFanWeight::getEquipmentName, reviewDto.getEquipmentName());
// qu.eq(!StringUtils.isEmpty(reviewDto.getPointName()), IdxBizFanWeight::getPointName, reviewDto.getPointName());
List
<
IdxBizPvWeight
>
listdata
=
idxBizPvWeightMapper
.
selectList
(
qu
);
//处理场站级别 包括风电
int
allDataSize
=
listdata
.
size
();
List
<
IdxBizFanWeight
>
fanData
=
new
ArrayList
<>();
if
(
"2"
.
equals
(
reviewDto
.
getType
())){
LambdaQueryWrapper
<
IdxBizFanWeight
>
fanWrapper
=
new
LambdaQueryWrapper
<>();
fanWrapper
.
eq
(
IdxBizFanWeight:
:
getType
,
reviewDto
.
getType
());
fanWrapper
.
eq
(
IdxBizFanWeight:
:
getArae
,
reviewDto
.
getArae
());
fanData
=
idxBizFanWeightMapper
.
selectList
(
fanWrapper
);
allDataSize
=
allDataSize
+
fanData
.
size
();
}
//设置权重值,
int
num
=
listdata
.
size
()
-
list
.
size
();
int
num
=
allDataSize
-
list
.
size
();
if
(
num
==
0
)
{
if
(
valued
!=
1
)
{
throw
new
BadRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
...
...
@@ -340,6 +349,13 @@ public class IdxBizPvWeightController extends BaseController {
}
idxBizPvWeightMapper
.
updateById
(
listdatum
);
}
if
(
CollectionUtil
.
isNotEmpty
(
fanData
)){
for
(
IdxBizFanWeight
listdatum
:
fanData
)
{
listdatum
.
setValue
(
formattedNum
);
listdatum
.
setFlag
(
null
);
idxBizFanWeightMapper
.
updateById
(
listdatum
);
}
}
}
return
ResponseHelper
.
buildResponse
(
null
);
...
...
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