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
a96298d0
Commit
a96298d0
authored
Jan 02, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序装修配置校验优化
parent
0da443d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
17 deletions
+12
-17
AppletDecorationConfigApiServiceImpl.java
...vice/outer/impl/AppletDecorationConfigApiServiceImpl.java
+12
-17
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/AppletDecorationConfigApiServiceImpl.java
View file @
a96298d0
...
...
@@ -169,22 +169,17 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
}
Map
<
String
,
Object
>
appletCardMap
=
appletCardMapResult
.
getResult
();
//需要校验的数值集合
List
<
String
>
needValidList
=
new
ArrayList
<>();
//会员中心页面卡范围
needValidList
.
add
(
dto
.
getMemberCardArea
());
//开卡认证关联
needValidList
.
add
(
dto
.
getOpenCardAuth
());
Map
<
String
,
String
>
needValidMap
=
new
HashMap
<>(
16
);
needValidMap
.
put
(
"会员中心页面卡范围"
,
dto
.
getMemberCardArea
());
needValidMap
.
put
(
"开卡认证关联"
,
dto
.
getOpenCardAuth
());
//数据资产
//积分
needValidList
.
add
(
appletDataAssetArea
.
getIntegral
());
//
needValidList
.
add
(
appletDataAssetArea
.
getCoupon
());
//
needValidList
.
add
(
appletDataAssetArea
.
getOrder
());
needValidMap
.
put
(
"数据资产-积分"
,
appletDataAssetArea
.
getIntegral
());
needValidMap
.
put
(
"数据资产-卡券包"
,
appletDataAssetArea
.
getCoupon
());
needValidMap
.
put
(
"数据资产-零售订"
,
appletDataAssetArea
.
getOrder
());
ServiceResponse
valueValid
;
for
(
String
value
:
needValidList
)
{
valueValid
=
validParamValue
(
value
,
appletCardMap
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
needValidMap
.
entrySet
()
)
{
valueValid
=
validParamValue
(
entry
.
getKey
(),
entry
.
getValue
()
,
appletCardMap
);
if
(!
valueValid
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
valueValid
.
getCode
(),
valueValid
.
getMessage
());
}
...
...
@@ -215,17 +210,17 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
return
ServiceResponse
.
success
(
result
);
}
private
ServiceResponse
validParamValue
(
String
value
,
Map
<
String
,
Object
>
appletCardMap
)
{
private
ServiceResponse
validParamValue
(
String
key
,
String
value
,
Map
<
String
,
Object
>
appletCardMap
)
{
if
(
StringUtils
.
isBlank
(
value
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"数值
不能为空"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
key
+
"
不能为空"
);
}
if
(!
value
.
contains
(
","
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
value
+
":
数值非法"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
key
+
"
数值非法"
);
}
String
[]
arr
=
value
.
split
(
","
);
for
(
String
str
:
arr
)
{
if
(!
appletCardMap
.
containsKey
(
str
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
value
+
":
数值非法"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
key
+
"
数值非法"
);
}
}
return
ServiceResponse
.
success
();
...
...
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