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
7a5869e6
Commit
7a5869e6
authored
Mar 11, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
装修配置挑战:添加可用积分已经会员卡列表数据调整
parent
59ab22aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
20 deletions
+15
-20
AppletCardDTO.java
...i/src/main/java/com/gic/enterprise/dto/AppletCardDTO.java
+0
-4
AppletDecorationConfigApiServiceImpl.java
...vice/outer/impl/AppletDecorationConfigApiServiceImpl.java
+15
-16
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/AppletCardDTO.java
View file @
7a5869e6
...
...
@@ -20,10 +20,6 @@ public class AppletCardDTO implements Serializable{
private
Long
cardConfigId
;
private
String
cardName
;
/**
* 是否是子卡
*/
private
Boolean
isSub
;
/**
* 子卡列表
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/AppletDecorationConfigApiServiceImpl.java
View file @
7a5869e6
...
...
@@ -147,13 +147,9 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
return
ServiceResponse
.
failure
(
appletCardResult
.
getCode
(),
appletCardResult
.
getMessage
());
}
List
<
AppletCardDTO
>
appletCardList
=
appletCardResult
.
getResult
();
Map
<
String
,
Boolean
>
appletCardMap
=
new
HashMap
<>(
16
);
Map
<
String
,
List
<
AppletCardDTO
>>
appletMainCardMap
=
new
HashMap
<>(
16
);
Map
<
String
,
List
<
AppletCardDTO
>>
appletCardMap
=
new
HashMap
<>(
16
);
for
(
AppletCardDTO
cardDTO
:
appletCardList
)
{
appletCardMap
.
put
(
cardDTO
.
getCardConfigId
().
toString
(),
cardDTO
.
getIsSub
());
if
(!
cardDTO
.
getIsSub
())
{
appletMainCardMap
.
put
(
cardDTO
.
getCardConfigId
().
toString
(),
cardDTO
.
getSubList
());
}
appletCardMap
.
put
(
cardDTO
.
getCardConfigId
().
toString
(),
cardDTO
.
getSubList
());
}
//需要校验的数值集合
...
...
@@ -189,7 +185,10 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
//会员任务
appletDataAssetArea
.
setMemberTask
(
totalIntegral
);
}
else
{
Boolean
isSub
=
appletCardMap
.
get
(
totalIntegral
);
//总积分会员卡下面的子卡列表
List
<
AppletCardDTO
>
totalIntegralSubList
=
appletCardMap
.
get
(
totalIntegral
);
//是否没有子卡列表
boolean
isSub
=
CollectionUtils
.
isEmpty
(
totalIntegralSubList
);
if
(
isSub
)
{
//如果总积分选择的是子卡,则下面的只能是子卡
appletDataAssetArea
.
setAvailableIntegral
(
totalIntegral
);
...
...
@@ -201,14 +200,16 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
appletDataAssetArea
.
setMemberTask
(
totalIntegral
);
}
else
{
//如果总积分是主卡,则可用积分可以是主卡,也可以下面子卡
Boolean
isSubOfAvailableIntegral
=
appletCardMap
.
get
(
availableIntegral
);
List
<
AppletCardDTO
>
subListTemp
=
applet
Main
CardMap
.
get
(
totalIntegral
);
List
<
AppletCardDTO
>
availabelIntegralSubList
=
appletCardMap
.
get
(
availableIntegral
);
List
<
AppletCardDTO
>
subListTemp
=
appletCardMap
.
get
(
totalIntegral
);
Set
<
String
>
subSet
=
new
HashSet
<>();
if
(
CollectionUtils
.
isNotEmpty
(
subListTemp
))
{
for
(
AppletCardDTO
subSetTemp
:
subListTemp
)
{
subSet
.
add
(
subSetTemp
.
getCardConfigId
().
toString
());
}
}
//可用积分会员卡下面是否没有子卡列表
boolean
isSubOfAvailableIntegral
=
CollectionUtils
.
isEmpty
(
availabelIntegralSubList
);
if
(
isSubOfAvailableIntegral
)
{
if
(!
subSet
.
contains
(
availableIntegral
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"数据资产-可用积分不在总积分会员卡及其子卡"
);
...
...
@@ -259,7 +260,7 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
}
private
ServiceResponse
validParamValue
(
String
key
,
String
value
,
Map
<
String
,
Boolean
>
appletCardMap
)
{
private
ServiceResponse
validParamValue
(
String
key
,
String
value
,
Map
<
String
,
List
<
AppletCardDTO
>
>
appletCardMap
)
{
if
(
StringUtils
.
isBlank
(
value
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
key
+
"不能为空"
);
}
...
...
@@ -292,23 +293,21 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
if
(
appletCardResult
.
isSuccess
())
{
List
<
MemberCardRelDTO
>
cardList
=
appletCardResult
.
getResult
();
List
<
AppletCardDTO
>
resultList
=
new
ArrayList
<>();
List
<
AppletCardDTO
>
subList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
cardList
))
{
for
(
MemberCardRelDTO
card
:
cardList
)
{
List
<
MemberCardRelDTO
>
sub
=
card
.
getRelCards
();
List
<
AppletCardDTO
>
subList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
sub
))
{
for
(
MemberCardRelDTO
subTemp
:
sub
)
{
subList
.
add
(
new
AppletCardDTO
().
setCardConfigId
(
subTemp
.
getId
())
.
setCardName
(
subTemp
.
getName
()).
setIsSub
(
true
));
resultList
.
add
(
new
AppletCardDTO
().
setCardConfigId
(
subTemp
.
getId
())
.
setCardName
(
subTemp
.
getName
()).
setIsSub
(
false
));
.
setCardName
(
subTemp
.
getName
()));
}
}
resultList
.
add
(
new
AppletCardDTO
().
setCardName
(
card
.
getName
())
.
setCardConfigId
(
card
.
getId
()).
setSubList
(
subList
)
.
setIsSub
(
false
)
);
.
setCardConfigId
(
card
.
getId
()).
setSubList
(
subList
));
}
}
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
resultList
);
}
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
appletCardResult
.
getMessage
());
}
...
...
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