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
4657014e
Commit
4657014e
authored
Apr 10, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序也没装修
parent
1be03af1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
16 deletions
+31
-16
AppletDecorationConfigApiServiceImpl.java
...vice/outer/impl/AppletDecorationConfigApiServiceImpl.java
+31
-16
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/AppletDecorationConfigApiServiceImpl.java
View file @
4657014e
package
com
.
gic
.
enterprise
.
service
.
outer
.
impl
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.EntityUtil
;
...
...
@@ -108,8 +110,14 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
result
.
setGpsDecisionCard
(
0
);
result
.
setEnterpriseId
(
enterpriseId
);
result
.
setAppId
(
appId
);
//开卡认证关联
result
.
setOpenCardAuth
(
mainCardId
.
toString
());
//开卡认证关联,全部的卡列表
//校验参数数值是否非法
ServiceResponse
<
List
<
AppletCardDTO
>>
appletCardResult
=
getMemberCardByAppId
(
appId
,
enterpriseId
);
if
(!
appletCardResult
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
appletCardResult
.
getCode
(),
appletCardResult
.
getMessage
());
}
List
<
AppletCardDTO
>
appletCardList
=
appletCardResult
.
getResult
();
result
.
setOpenCardAuth
(
appletCardList
.
stream
().
map
(
e
->
e
.
getCardConfigId
().
toString
()).
collect
(
Collectors
.
joining
(
","
)));
return
ServiceResponse
.
success
(
result
);
}
AppletDecorationConfigDTO
dto
=
EntityUtil
.
changeEntityNew
(
AppletDecorationConfigDTO
.
class
,
record
);
...
...
@@ -214,20 +222,20 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
return
ServiceResponse
.
failure
(
appletCardResult
.
getCode
(),
appletCardResult
.
getMessage
());
}
List
<
AppletCardDTO
>
appletCardList
=
appletCardResult
.
getResult
();
Map
<
String
,
List
<
AppletCardDTO
>>
appletCardMap
=
new
HashMap
<>(
16
);
Map
<
String
,
List
<
AppletCardDTO
>>
appletCardMap
=
appletCardList
.
stream
()
.
collect
(
Collectors
.
toMap
(
e
->
e
.
getCardConfigId
().
toString
(),
e
->
e
.
getSubList
()
));
//子卡
List
<
String
>
appletSubCardList
=
new
ArrayList
<>();
for
(
AppletCardDTO
cardDTO
:
appletCardList
)
{
appletCardMap
.
put
(
cardDTO
.
getCardConfigId
().
toString
(),
cardDTO
.
getSubList
());
List
<
AppletCardDTO
>
subList
=
cardDTO
.
getSubList
();
if
(
CollectionUtils
.
isNotEmpty
(
subList
))
{
for
(
AppletCardDTO
cardDTO1
:
subList
)
{
if
(
cardDTO1
.
getCardConfigId
().
toString
().
equals
(
mainCardId
.
toString
()))
{
appletSubCardList
.
add
(
cardDTO
.
getCardConfigId
().
toString
());
}
}
}
}
List
<
String
>
appletSubCardList
=
appletCardList
.
stream
()
.
filter
(
e
->
CollectionUtils
.
isNotEmpty
(
e
.
getSubList
()))
.
filter
(
e
->
{
List
<
AppletCardDTO
>
subList
=
e
.
getSubList
();
return
subList
.
stream
()
.
anyMatch
(
son
->
son
.
getCardConfigId
().
toString
().
equals
(
mainCardId
.
toString
()));
})
.
map
(
e
->
e
.
getCardConfigId
().
toString
())
.
collect
(
Collectors
.
toList
());
//需要校验的数值集合
Map
<
String
,
String
>
needValidMap
=
new
HashMap
<>(
16
);
...
...
@@ -236,6 +244,7 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
//数据资产
//总积分
String
totalIntegral
=
appletDataAssetArea
.
getIntegral
();
//线下订单
String
order
=
appletDataAssetArea
.
getOrder
();
needValidMap
.
put
(
"数据资产-总积分"
,
totalIntegral
);
needValidMap
.
put
(
"数据资产-卡券包"
,
appletDataAssetArea
.
getCoupon
());
...
...
@@ -270,10 +279,14 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
subListSet
.
add
(
temp
.
getCardConfigId
().
toString
());
}
}
if
(!
totalIntegral
.
toString
().
equals
(
order
)
&&
!
subListSet
.
contains
(
order
))
{
if
(!
totalIntegral
.
toString
().
equals
(
order
))
{
boolean
validOrder
=
Stream
.
of
(
order
.
split
(
","
))
.
anyMatch
(
e
->
!
subListSet
.
contains
(
e
));
if
(
validOrder
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"数据资产-线下订单只能选择总积分小程序主卡关联的平衡组卡及其子卡"
);
}
}
}
//默认主卡
//签到
...
...
@@ -282,6 +295,8 @@ public class AppletDecorationConfigApiServiceImpl implements AppletDecorationCon
appletDataAssetArea
.
setMemberAchievement
(
mainCardId
.
toString
());
//会员任务
appletDataAssetArea
.
setMemberTask
(
mainCardId
.
toString
());
//关联卡组,全部的卡
dto
.
setOpenCardAuth
(
appletCardList
.
stream
().
map
(
e
->
e
.
getCardConfigId
().
toString
()).
collect
(
Collectors
.
joining
(
","
)));
Integer
gpsDecisionCard
=
dto
.
getGpsDecisionCard
();
if
(
gpsDecisionCard
==
null
)
{
...
...
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