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
3f2e545d
Commit
3f2e545d
authored
Mar 06, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增商户规则,规则树ID,过滤重复ID
parent
1ca1fec0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
ConfigRuleEnterpriseApiServiceImpl.java
...ervice/outer/impl/ConfigRuleEnterpriseApiServiceImpl.java
+14
-2
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/ConfigRuleEnterpriseApiServiceImpl.java
View file @
3f2e545d
...
...
@@ -176,6 +176,8 @@ public class ConfigRuleEnterpriseApiServiceImpl implements ConfigRuleEnterpriseA
enterpriseIdList
.
add
(
enterpriseDTO
.
getEnterpriseId
());
}
}
//用于过滤重复ID
Set
<
String
>
enterpriseTempSet
=
new
HashSet
<>();
if
(
enterpriseType
.
intValue
()
==
1
)
{
String
[]
arr
=
dto
.
getEnterpriseIds
().
split
(
","
);
enterpriseIdList
.
clear
();
...
...
@@ -190,7 +192,11 @@ public class ConfigRuleEnterpriseApiServiceImpl implements ConfigRuleEnterpriseA
if
(!
enterpriseSet
.
contains
(
id
.
toString
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"部分商户数据错误,不存在的商户"
);
}
enterpriseIdList
.
add
(
id
);
enterpriseTempSet
.
add
(
str
);
}
//循环装载
for
(
String
str
:
enterpriseTempSet
)
{
enterpriseIdList
.
add
(
Integer
.
parseInt
(
str
));
}
}
return
ServiceResponse
.
success
(
enterpriseIdList
);
...
...
@@ -205,6 +211,8 @@ public class ConfigRuleEnterpriseApiServiceImpl implements ConfigRuleEnterpriseA
ruleIdSet
.
add
(
rule
.
getRuleId
().
toString
());
}
}
//用于过滤重复ID
Set
<
String
>
ruleIdTempSet
=
new
HashSet
<>();
String
[]
arr
=
dto
.
getRuleIds
().
split
(
","
);
for
(
String
str
:
arr
)
{
if
(
StringUtils
.
isBlank
(
str
))
{
...
...
@@ -217,7 +225,11 @@ public class ConfigRuleEnterpriseApiServiceImpl implements ConfigRuleEnterpriseA
if
(!
ruleIdSet
.
contains
(
id
.
toString
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则树数据错误,不存在的规则"
);
}
ruleIdList
.
add
(
id
);
ruleIdTempSet
.
add
(
str
);
}
//循环装载
for
(
String
str
:
ruleIdTempSet
)
{
ruleIdList
.
add
(
Integer
.
parseInt
(
str
));
}
return
ServiceResponse
.
success
(
ruleIdList
);
}
...
...
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