Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
1e3311ac
Commit
1e3311ac
authored
Apr 19, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改美团绑定门店查询
parent
033e1b72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
30 deletions
+22
-30
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+14
-19
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+8
-11
No files found.
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
1e3311ac
...
...
@@ -392,34 +392,29 @@ public class QPServiceImpl implements QPService {
*/
@Override
public
List
<
CustomerKeyShopScopeResponseEntity
>
scope
()
{
Boolean
b
=
redisUtil
.
exists
(
ReceiptRdeisEnum
.
MT_SESSION_KEY
.
getValue
());
if
(
Boolean
.
FALSE
.
equals
(
b
))
{
Boolean
exists
=
redisUtil
.
exists
(
ReceiptRdeisEnum
.
MT_SESSION_KEY
.
getValue
());
if
(
Boolean
.
FALSE
.
equals
(
exists
))
{
throw
new
RuntimeException
(
"请联系管理员"
);
}
DefaultOpenAPIClient
openAPIClient
=
new
DefaultOpenAPIClient
();
String
o
=
redisUtil
.
get
(
ReceiptRdeisEnum
.
MT_SESSION_KEY
.
getValue
());
JSONObject
sessionKey
=
new
JSONObject
(
o
);
String
session
=
(
String
)
sessionKey
.
get
(
"access_token"
);
String
bid
=
(
String
)
sessionKey
.
get
(
"bid"
);
String
sessionKeyJson
=
redisUtil
.
get
(
ReceiptRdeisEnum
.
MT_SESSION_KEY
.
getValue
());
JSONObject
sessionKeyObject
=
new
JSONObject
(
sessionKeyJson
);
String
session
=
(
String
)
sessionKeyObject
.
get
(
"access_token"
);
String
bid
=
(
String
)
sessionKeyObject
.
get
(
"bid"
);
CustomerKeyShopScopeRequest
request
=
new
CustomerKeyShopScopeRequest
(
APP_KEY
,
APP_SECRET
,
session
,
bid
);
CustomerKeyShopScopeQuery
shopScopeQuery
=
new
CustomerKeyShopScopeQuery
(
request
);
DefaultOpenAPIClient
openAPIClient
=
new
DefaultOpenAPIClient
();
CustomerKeyShopScopeResponse
response
=
openAPIClient
.
invoke
(
shopScopeQuery
);
if
(
response
.
getCode
()
!=
200
)
{
logger
.
error
(
"适用店铺查询接口
:{}"
,
response
.
getMsg
());
logger
.
error
(
"适用店铺查询接口
失败: code={}, msg={}"
,
response
.
getCode
()
,
response
.
getMsg
());
throw
new
RuntimeException
(
response
.
getMsg
());
}
//查询所有门店
List
<
SStore
>
list
=
storeService
.
list
();
//过滤以增加的门店 根据open_shop_uuid
List
<
SStore
>
stores
=
storeService
.
list
();
Map
<
String
,
SStore
>
storeMap
=
stores
.
stream
()
.
collect
(
Collectors
.
toMap
(
SStore:
:
getOpenShopUuid
,
s
->
s
));
List
<
CustomerKeyShopScopeResponseEntity
>
data
=
response
.
getData
();
List
<
CustomerKeyShopScopeResponseEntity
>
collect
=
data
.
stream
().
filter
(
o1
->
{
Optional
<
SStore
>
first
=
list
.
stream
().
filter
(
o2
->
o2
.
getOpenShopUuid
().
equals
(
o1
.
getOpen_shop_uuid
())).
findFirst
();
if
(
first
.
isPresent
())
{
return
false
;
}
return
true
;
}).
collect
(
java
.
util
.
stream
.
Collectors
.
toList
());
return
collect
;
return
data
.
stream
()
.
filter
(
entity
->
!
storeMap
.
containsKey
(
entity
.
getOpen_shop_uuid
()))
.
collect
(
Collectors
.
toList
());
}
@Override
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
1e3311ac
...
...
@@ -104,14 +104,11 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
SConsumerCouponVo
vo
=
new
SConsumerCouponVo
();
BeanUtils
.
copyProperties
(
item
,
vo
);
if
(!
ObjectUtils
.
isEmpty
(
item
.
getStoreId
()))
{
Optional
<
SStore
>
matchingObj
=
list
.
stream
()
.
filter
(
obj
->
obj
.
getId
().
equals
(
item
.
getStoreId
()))
.
findAny
();
if
(
matchingObj
.
isPresent
())
{
vo
.
setStoreName
(
matchingObj
.
get
().
getName
());
}
else
{
vo
.
setStoreName
(
""
);
}
vo
.
setStoreName
(
list
.
stream
()
.
filter
(
store
->
store
.
getId
().
equals
(
item
.
getStoreId
()))
.
map
(
SStore:
:
getName
)
.
findFirst
()
.
orElse
(
""
));
}
if
(
item
.
getCouponType
().
equals
(
CouponTypeEnum
.
CASH
.
getCode
())
&&
StringUtils
.
isEmpty
(
item
.
getStoreIds
()))
{
item
.
setStoreIds
(
list
.
stream
().
map
(
SStore:
:
getId
).
collect
(
Collectors
.
toList
()).
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
...
...
@@ -435,9 +432,9 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
newSConsumerCoupon
.
setMinPrice
(
new
BigDecimal
(
0.00
));
newSConsumerCoupon
.
setSubPrice
(
sCoupon
.
getSubPrice
());
newSConsumerCoupon
.
setWeeks
(
sCoupon
.
getWeeks
());
//
newSConsumerCoupon.setStoreIds(sCoupon.getStoreIds());
//
newSConsumerCoupon.setSubPrice(sCoupon.getSubPrice());
//
newSConsumerCoupon.setCouponPayPrice(sCoupon.getCouponPayPrice());
newSConsumerCoupon
.
setStoreIds
(
sCoupon
.
getStoreIds
());
newSConsumerCoupon
.
setSubPrice
(
sCoupon
.
getSubPrice
());
newSConsumerCoupon
.
setCouponPayPrice
(
sCoupon
.
getCouponPayPrice
());
newSConsumerCoupon
.
setMinDuration
(
sCoupon
.
getMinDuration
());
newSConsumerCoupon
.
setMaxDuration
(
sCoupon
.
getMaxDuration
());
newSConsumerCoupon
.
setDuration
(
sCoupon
.
getDuration
());
...
...
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