Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
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
base_platform_enterprise
gic-platform-enterprise
Commits
59489d02
Commit
59489d02
authored
Oct 26, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商户规则rule_level校验修复
parent
2df022b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
ConfigRuleApiServiceImpl.java
...terprise/service/outer/impl/ConfigRuleApiServiceImpl.java
+9
-5
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/ConfigRuleApiServiceImpl.java
View file @
59489d02
...
@@ -165,7 +165,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
...
@@ -165,7 +165,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
record
==
null
)
{
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,分类不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,分类不存在"
);
}
}
if
(
TWO
.
equals
(
record
.
getRuleLevel
()
))
{
if
(
isNotRightRuleLevel
(
record
.
getRuleLevel
(),
TWO
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,不是分类类型"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,不是分类类型"
);
}
}
dto
.
setParentRuleId
(
record
.
getParentRuleId
());
dto
.
setParentRuleId
(
record
.
getParentRuleId
());
...
@@ -208,7 +208,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
...
@@ -208,7 +208,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
record
==
null
)
{
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,场景不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,场景不存在"
);
}
}
if
(
THREE
.
equals
(
record
.
getRuleLevel
()
))
{
if
(
isNotRightRuleLevel
(
record
.
getRuleLevel
(),
THREE
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,不是场景类型"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,不是场景类型"
);
}
}
dto
.
setParentRuleId
(
record
.
getParentRuleId
());
dto
.
setParentRuleId
(
record
.
getParentRuleId
());
...
@@ -237,7 +237,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
...
@@ -237,7 +237,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
record
==
null
)
{
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,分类不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,分类不存在"
);
}
}
if
(
TWO
.
equals
(
record
.
getRuleLevel
()
))
{
if
(
isNotRightRuleLevel
(
record
.
getRuleLevel
(),
TWO
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,不是分类类型"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,不是分类类型"
);
}
}
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
ruleId
).
setDeleteFlag
(
0
));
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
ruleId
).
setDeleteFlag
(
0
));
...
@@ -257,7 +257,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
...
@@ -257,7 +257,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
record
==
null
)
{
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,场景不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,场景不存在"
);
}
}
if
(
THREE
.
equals
(
record
.
getRuleLevel
()
))
{
if
(
isNotRightRuleLevel
(
record
.
getRuleLevel
(),
THREE
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,不是场景类型"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,不是场景类型"
);
}
}
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
ruleId
).
setDeleteFlag
(
0
));
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
ruleId
).
setDeleteFlag
(
0
));
...
@@ -626,7 +626,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
...
@@ -626,7 +626,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
StringUtils
.
isBlank
(
dto
.
getMarketName
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
getMarketName
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"手动输入名称不能为空"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"手动输入名称不能为空"
);
}
}
if
(
TWO
.
equals
(
record
.
getRuleLevel
()
))
{
if
(
isNotRightRuleLevel
(
record
.
getRuleLevel
(),
TWO
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,不是分类类型"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,不是分类类型"
);
}
}
if
(
StringUtils
.
isBlank
(
dto
.
getMarketScene
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
getMarketScene
()))
{
...
@@ -666,4 +666,8 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
...
@@ -666,4 +666,8 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
return
result
;
return
result
;
}
}
private
static
boolean
isNotRightRuleLevel
(
Integer
ruleLevel
,
Integer
constants
)
{
return
!
constants
.
equals
(
ruleLevel
);
}
}
}
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