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
6ee2b1bf
Commit
6ee2b1bf
authored
Mar 04, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台规则详情接口添加
parent
2d4b4310
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
ConfigRuleApiServiceImpl.java
...terprise/service/outer/impl/ConfigRuleApiServiceImpl.java
+18
-18
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/ConfigRuleApiServiceImpl.java
View file @
6ee2b1bf
...
...
@@ -27,7 +27,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
@Override
public
ServiceResponse
<
Integer
>
saveRule
(
RuleDTO
dto
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getName
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
get
Rule
Name
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则名称不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getAppName
()))
{
...
...
@@ -37,7 +37,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"应用code不能为空"
);
}
//名称唯一性校验
if
(
configRuleService
.
isRepeatName
(
null
,
1
,
dto
.
getName
(),
null
))
{
if
(
configRuleService
.
isRepeatName
(
null
,
1
,
dto
.
get
Rule
Name
(),
null
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则名称重复"
);
}
//填充
...
...
@@ -59,7 +59,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
record
.
getRuleLevel
()
!=
1
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则ID错误,不是规则类型"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getName
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
get
Rule
Name
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则名称不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getAppName
()))
{
...
...
@@ -69,10 +69,10 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"应用code不能为空"
);
}
//名称唯一性校验
if
(
configRuleService
.
isRepeatName
(
dto
.
getRuleId
(),
1
,
dto
.
getName
(),
null
))
{
if
(
configRuleService
.
isRepeatName
(
dto
.
getRuleId
(),
1
,
dto
.
get
Rule
Name
(),
null
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则名称重复"
);
}
record
.
set
Name
(
dto
.
get
Name
());
record
.
set
RuleName
(
dto
.
getRule
Name
());
record
.
setAppCode
(
dto
.
getAppCode
());
record
.
setAppName
(
dto
.
getAppName
());
configRuleService
.
update
(
record
);
...
...
@@ -137,12 +137,12 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(!
valid
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
valid
.
getCode
(),
valid
.
getMessage
());
}
record
.
set
Name
(
dto
.
get
Name
());
record
.
set
RuleName
(
dto
.
getRule
Name
());
record
.
setClassifyIcon
(
dto
.
getClassifyIcon
());
record
.
set
Desc
(
dto
.
get
Desc
());
record
.
set
RuleDesc
(
dto
.
getRule
Desc
());
record
.
setRemark
(
dto
.
getRemark
());
configRuleService
.
update
(
record
);
return
ServiceResponse
.
success
(
record
.
getName
());
return
ServiceResponse
.
success
(
record
.
get
Rule
Name
());
}
@Override
...
...
@@ -181,11 +181,11 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
return
ServiceResponse
.
failure
(
valid
.
getCode
(),
valid
.
getMessage
());
}
record
.
setRemark
(
dto
.
getRemark
());
record
.
set
Desc
(
dto
.
get
Desc
());
record
.
set
RuleDesc
(
dto
.
getRule
Desc
());
record
.
setMarketObject
(
dto
.
getMarketObject
());
record
.
setMarketScene
(
dto
.
getMarketScene
());
configRuleService
.
update
(
record
);
return
ServiceResponse
.
success
(
record
.
getName
());
return
ServiceResponse
.
success
(
record
.
get
Rule
Name
());
}
@Override
...
...
@@ -219,7 +219,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
tabConfigRule
.
getRuleId
()).
setStatus
(
0
));
}
}
return
ServiceResponse
.
success
(
record
.
getName
());
return
ServiceResponse
.
success
(
record
.
get
Rule
Name
());
}
@Override
...
...
@@ -232,7 +232,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,不是场景类型"
);
}
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
ruleId
).
setStatus
(
0
));
return
ServiceResponse
.
success
(
record
.
getName
());
return
ServiceResponse
.
success
(
record
.
get
Rule
Name
());
}
@Override
...
...
@@ -252,17 +252,17 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
record
.
getRuleLevel
()
!=
1
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则ID错误,不是规则类型"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getName
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
get
Rule
Name
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类名称不能为空"
);
}
//名称唯一性校验
if
(
configRuleService
.
isRepeatName
(
dto
.
getRuleId
(),
2
,
dto
.
getName
(),
dto
.
getParentRuleId
()))
{
if
(
configRuleService
.
isRepeatName
(
dto
.
getRuleId
(),
2
,
dto
.
get
Rule
Name
(),
dto
.
getParentRuleId
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类名称重复"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getClassifyIcon
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类icon不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getDesc
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
get
Rule
Desc
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类描述不能为空"
);
}
return
ServiceResponse
.
success
();
...
...
@@ -279,14 +279,14 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
StringUtils
.
isBlank
(
dto
.
getMarketScene
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景code不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getName
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
get
Rule
Name
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景名称不能为空"
);
}
//名称唯一性校验
if
(
configRuleService
.
isRepeatName
(
dto
.
getRuleId
(),
3
,
dto
.
getName
(),
dto
.
getParentRuleId
()))
{
if
(
configRuleService
.
isRepeatName
(
dto
.
getRuleId
(),
3
,
dto
.
get
Rule
Name
(),
dto
.
getParentRuleId
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则名称重复"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getDesc
()))
{
if
(
StringUtils
.
isBlank
(
dto
.
get
Rule
Desc
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景描述不能为空"
);
}
Integer
marketObject
=
dto
.
getMarketObject
();
...
...
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