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
b3ee5f65
Commit
b3ee5f65
authored
Oct 24, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改权重接口
parent
2258991a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
25 deletions
+23
-25
IdxBizFanWeightController.java
...odule/jxiop/biz/controller/IdxBizFanWeightController.java
+11
-12
IdxBizPvWeightController.java
...module/jxiop/biz/controller/IdxBizPvWeightController.java
+12
-13
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 @
b3ee5f65
...
...
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
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
;
...
...
@@ -171,23 +172,23 @@ public class IdxBizFanWeightController extends BaseController {
break
;
case
"2"
:
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()))
{
throw
new
Ba
seException
(
"配置权重必须是同一个层级的数据"
,
"403"
,
"配置权重必须是同一个层级的数据"
);
throw
new
Ba
dRequest
(
"配置权重必须是同一个层级的数据"
);
}
break
;
case
"3"
:
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()))
{
throw
new
Ba
seException
(
"配置权重必须是同一个层级的数据"
,
"403"
,
"配置权重必须是同一个层级的数据"
);
throw
new
Ba
dRequest
(
"配置权重必须是同一个层级的数据"
);
}
break
;
case
"4"
:
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()
+
idxBizFanWeight
.
getEquipmentName
()))
{
throw
new
Ba
seException
(
"配置权重必须是同一个层级的数据"
,
"403"
,
"配置权重必须是同一个层级的数据"
);
throw
new
Ba
dRequest
(
"配置权重必须是同一个层级的数据"
);
}
break
;
case
"5"
:
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()
+
idxBizFanWeight
.
getEquipmentName
()
+
idxBizFanWeight
.
getSubarray
()))
{
throw
new
Ba
seException
(
"配置权重必须是同一个层级的数据"
,
"403"
,
"配置权重必须是同一个层级的数据"
);
throw
new
Ba
dRequest
(
"配置权重必须是同一个层级的数据"
);
}
break
;
...
...
@@ -218,7 +219,7 @@ public class IdxBizFanWeightController extends BaseController {
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
.
get
Subarray
()),
IdxBizFanWeight:
:
getSubarray
,
reviewDto
.
getSubarray
());
qu
.
eq
(!
StringUtils
.
isEmpty
(
reviewDto
.
get
EquipmentName
()),
IdxBizFanWeight:
:
getEquipmentName
,
reviewDto
.
getEquipmentName
());
break
;
case
"5"
:
...
...
@@ -242,7 +243,7 @@ public class IdxBizFanWeightController extends BaseController {
int
num
=
listdata
.
size
()
-
list
.
size
();
if
(
num
==
0
)
{
if
(
valued
!=
1
)
{
throw
new
Ba
seException
(
"超出权重最大值限制,层级下权重等级总和为1"
,
"403"
,
"超出权重最大值限制,层级下权重等级总和为1"
);
throw
new
Ba
dRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
}
...
...
@@ -250,11 +251,11 @@ public class IdxBizFanWeightController extends BaseController {
//值不能大于1
if
(
valued
>
1
)
{
throw
new
Ba
seException
(
"超出权重最大值限制,层级下权重等级总和为1"
,
"403"
,
"超出权重最大值限制,层级下权重等级总和为1"
);
throw
new
Ba
dRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
if
(
valued
!=
1
&&
num
=
=
0
)
{
throw
new
Ba
seException
(
"超出权重最大值限制,层级下权重等级总和为1"
,
"403"
,
"超出权重最大值限制,层级下权重等级总和为1"
);
if
(
valued
==
1
&&
num
!
=
0
)
{
throw
new
Ba
dRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
...
...
@@ -263,12 +264,10 @@ public class IdxBizFanWeightController extends BaseController {
for
(
IdxBizFanWeight
listdatum
:
listdata
)
{
for
(
IdxBizFanWeight
idxBizPvWeight
:
list
)
{
listdatum
.
setValue
(
formattedNum
);
if
(
idxBizPvWeight
.
getSequenceNbr
().
equals
(
listdatum
.
getSequenceNbr
()))
{
listdatum
.
setValue
(
Float
.
valueOf
(
value
.
get
(
"data"
).
toString
()));
break
;
}
else
{
listdatum
.
setValue
(
formattedNum
);
break
;
}
}
idxBizFanWeightMapper
.
updateById
(
listdatum
);
...
...
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 @
b3ee5f65
...
...
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
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
;
...
...
@@ -167,11 +168,11 @@ public class IdxBizPvWeightController extends BaseController {
break
;
case
"3"
:
flagtype
=
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
();
flagtype
=
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()
+
idxBizFanWeight
.
getSubarray
()
;
break
;
case
"4"
:
flagtype
=
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()
+
idxBizFanWeight
.
getEquipmentName
()
;
flagtype
=
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()
;
break
;
case
"5"
:
...
...
@@ -187,22 +188,22 @@ public class IdxBizPvWeightController extends BaseController {
break
;
case
"2"
:
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()))
{
throw
new
Ba
seException
(
"配置权重必须是同一个层级的数据"
,
"403"
,
"配置权重必须是同一个层级的数据"
);
throw
new
Ba
dRequest
(
"配置权重必须是同一个层级的数据"
);
}
break
;
case
"3"
:
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()+
idxBizFanWeight
.
getSubarray
()))
{
throw
new
Ba
seException
(
"配置权重必须是同一个层级的数据"
,
"403"
,
"配置权重必须是同一个层级的数据"
);
throw
new
Ba
dRequest
(
"配置权重必须是同一个层级的数据"
);
}
break
;
case
"4"
:
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()
))
{
throw
new
Ba
seException
(
"配置权重必须是同一个层级的数据"
,
"403"
,
"配置权重必须是同一个层级的数据"
);
throw
new
Ba
dRequest
(
"配置权重必须是同一个层级的数据"
);
}
break
;
case
"5"
:
if
(!
flagtype
.
equals
(
idxBizFanWeight
.
getArae
()
+
idxBizFanWeight
.
getStation
()
+
idxBizFanWeight
.
getEquipmentName
()
+
idxBizFanWeight
.
getSubarray
()))
{
throw
new
Ba
seException
(
"配置权重必须是同一个层级的数据"
,
"403"
,
"配置权重必须是同一个层级的数据"
);
throw
new
Ba
dRequest
(
"配置权重必须是同一个层级的数据"
);
}
break
;
}
...
...
@@ -256,18 +257,18 @@ public class IdxBizPvWeightController extends BaseController {
int
num
=
listdata
.
size
()
-
list
.
size
();
if
(
num
==
0
)
{
if
(
valued
!=
1
)
{
throw
new
Ba
seException
(
"超出权重最大值限制,层级下权重等级总和为1"
,
"403"
,
"超出权重最大值限制,层级下权重等级总和为1"
);
throw
new
Ba
dRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
}
//值不能大于1
if
(
valued
>
1
)
{
throw
new
Ba
seException
(
"超出权重最大值限制,层级下权重等级总和为1"
,
"403"
,
"超出权重最大值限制,层级下权重等级总和为1"
);
throw
new
Ba
dRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
if
(
valued
!=
1
&&
num
=
=
0
)
{
throw
new
Ba
seException
(
"超出权重最大值限制,层级下权重等级总和为1"
,
"403"
,
"超出权重最大值限制,层级下权重等级总和为1"
);
if
(
valued
==
1
&&
num
!
=
0
)
{
throw
new
Ba
dRequest
(
"超出权重最大值限制,层级下权重等级总和为1"
);
}
...
...
@@ -276,12 +277,10 @@ public class IdxBizPvWeightController extends BaseController {
for
(
IdxBizPvWeight
listdatum
:
listdata
)
{
for
(
IdxBizPvWeight
idxBizPvWeight
:
list
)
{
listdatum
.
setValue
(
formattedNum
);
if
(
idxBizPvWeight
.
getSequenceNbr
().
equals
(
listdatum
.
getSequenceNbr
()))
{
listdatum
.
setValue
(
Float
.
valueOf
(
value
.
get
(
"data"
).
toString
()));
break
;
}
else
{
listdatum
.
setValue
(
formattedNum
);
break
;
}
}
idxBizPvWeightMapper
.
updateById
(
listdatum
);
...
...
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