Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
6a0cabba
Commit
6a0cabba
authored
Sep 16, 2020
by
zhiheng.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取餐码从换从中获取
parent
3f59dab0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
+18
-2
No files found.
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
View file @
6a0cabba
...
...
@@ -137,6 +137,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.util.StringUtil
;
...
...
@@ -256,6 +257,8 @@ public class OrderServiceImpl implements Orderservice {
private
OfflineCouponSdkService
offlineCouponSdkService
;
@Autowired
private
DeliveryFeiginClient
deliveryFeiginClient
;
@Autowired
private
RedisTemplate
redisTemplate
;
@Override
public
BaseResponse
checkBeforeCreateOrder
(
CheckBeforeCreateOrderRequestVo
requestVo
)
{
...
...
@@ -439,8 +442,11 @@ public class OrderServiceImpl implements Orderservice {
//orderRefund(orderBean, "订单异常退款", openid, oid);
return
gson
.
toJson
(
message
);
}
//获取生态缓存中的配置项,如果mealCodeRule的值不为空并且值等于2,则随机生成取参数,当日不重复
String
mealCodeRule
=
redisCache
.
getValue
(
"mealCodeRule"
);
List
<
AssortmentOpenPlatformPartnerWxappConfig
>
partnerWxappConfigs
=
this
.
cacheSelectDefaultPage
(
wxappid
,
"2"
);
Map
<
String
,
AssortmentOpenPlatformPartnerWxappConfig
>
configMap
=
partnerWxappConfigs
.
stream
().
collect
(
Collectors
.
toMap
(
AssortmentOpenPlatformPartnerWxappConfig:
:
getAppKey
,
Function
.
identity
()));
AssortmentOpenPlatformPartnerWxappConfig
refundDeliveryFeeConfig
=
configMap
.
get
(
"mealCodeRule"
);
log
.
info
(
"partnerWxappConfigs:configMap:refundDeliveryFeeConfig{},{},{}"
,
partnerWxappConfigs
,
configMap
,
refundDeliveryFeeConfig
);
String
mealCodeRule
=
refundDeliveryFeeConfig
.
getAppValue
();
if
(!
StringUtils
.
isEmpty
(
mealCodeRule
)
&&
"2"
.
equalsIgnoreCase
(
mealCodeRule
)){
//更新db中的取餐码,生成取餐码
OrderModifyRelatingCodeReq
relatingCodeReq
=
new
OrderModifyRelatingCodeReq
();
...
...
@@ -2958,4 +2964,14 @@ public class OrderServiceImpl implements Orderservice {
return
ResponseUtil
.
success
(
responses
.
getData
());
}
public
List
<
AssortmentOpenPlatformPartnerWxappConfig
>
cacheSelectDefaultPage
(
String
wxAppId
,
String
type
)
{
if
(!
StringUtils
.
isEmpty
(
wxAppId
)
&&
!
StringUtils
.
isEmpty
(
type
))
{
String
hashKey
=
"ecology:kgd:wxappconfig:open_platform_partner_wxapp_config:appkey_"
+
wxAppId
;
Object
value
=
this
.
redisCache
.
hashGet
(
hashKey
,
type
);
return
(
List
)(
value
!=
null
?
JSONArray
.
parseArray
(
value
.
toString
(),
AssortmentOpenPlatformPartnerWxappConfig
.
class
)
:
new
ArrayList
());
}
else
{
return
new
ArrayList
();
}
}
}
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