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
e7764675
Commit
e7764675
authored
Sep 21, 2020
by
zhiheng.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除多余的方法
parent
66376df5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
82 deletions
+0
-82
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+0
-82
No files found.
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
e7764675
...
...
@@ -91,12 +91,6 @@ import static cn.freemud.constant.OrderRefundConstant.ALLOW_REFUND;
@Component
public
class
OrderAdapter
{
public
final
static
String
TAKECODEKEY
=
"takecode"
;
public
static
final
String
REDIS_KEY_SEP
=
":"
;
public
static
final
String
numberChar
=
"0123456789"
;
public
static
final
String
numberCharWithoutZero
=
"12345"
;
private
static
FastDateFormat
yyyyMMddHHmmss
=
FastDateFormat
.
getInstance
(
"yyyy-MM-dd HH:mm:ss"
,
Locale
.
CHINA
);
private
static
String
SPMCHID
=
"1237482502"
;
...
...
@@ -134,9 +128,6 @@ public class OrderAdapter {
private
static
Gson
gson
=
new
Gson
();
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
RedisCache
redisCache
;
/**
...
...
@@ -3168,79 +3159,6 @@ public class OrderAdapter {
return
StringUtils
.
isNotBlank
(
payChannel
)
&&
OrderAdapter
.
PAY_CODE_10102
.
equalsIgnoreCase
(
payChannel
);
}
/**
* 生成取餐码
* @param partnerId 商户ID
* @param storeId 门店ID
* @return
*/
public
String
generateTackCode
(
String
partnerId
,
String
storeId
){
String
pickUpGoodsNo
=
generateNumber
(
6
);
String
key
=
this
.
getOrderTackCodeKey
(
partnerId
,
storeId
);
if
(!
redisTemplate
.
opsForHash
().
hasKey
(
key
,
storeId
+
pickUpGoodsNo
))
{
redisTemplate
.
opsForHash
().
put
(
key
,
storeId
+
pickUpGoodsNo
,
pickUpGoodsNo
);
redisTemplate
.
expire
(
key
,
getSecondsNextEarlyMorning
(),
TimeUnit
.
SECONDS
);
}
else
{
generateTackCode
(
partnerId
,
storeId
);
}
return
pickUpGoodsNo
;
}
/**
* 获取取餐码key
* @param partnerId
* @return
*/
public
String
getOrderTackCodeKey
(
String
partnerId
,
String
storeId
){
Date
currentDay
=
new
Date
();
String
todayStr
=
formatDate
(
currentDay
);
StringBuilder
key
=
new
StringBuilder
(
TAKECODEKEY
).
append
(
REDIS_KEY_SEP
)
.
append
(
partnerId
)
.
append
(
REDIS_KEY_SEP
)
.
append
(
storeId
)
.
append
(
REDIS_KEY_SEP
)
.
append
(
todayStr
);
return
key
.
toString
();
}
public
static
SimpleDateFormat
defaultDateFormater
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
private
String
formatDate
(
Date
date
){
return
defaultDateFormater
.
format
(
date
);
}
/**
* 返回一个定长的随机字符串(只包含大小写字母、数字)
*
* @param length
* 随机字符串长度
* @return 随机字符串
*/
public
static
String
generateNumber
(
int
length
)
{
StringBuffer
sb
=
new
StringBuffer
();
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
if
(
i
==
0
){
sb
.
append
(
numberCharWithoutZero
.
charAt
(
random
.
nextInt
(
numberCharWithoutZero
.
length
())));
}
else
{
sb
.
append
(
numberChar
.
charAt
(
random
.
nextInt
(
numberChar
.
length
())));
}
}
return
sb
.
toString
();
}
private
Long
getSecondsNextEarlyMorning
(){
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
add
(
Calendar
.
DAY_OF_YEAR
,
1
);
cal
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
cal
.
set
(
Calendar
.
SECOND
,
0
);
cal
.
set
(
Calendar
.
MINUTE
,
0
);
cal
.
set
(
Calendar
.
MILLISECOND
,
0
);
return
(
cal
.
getTimeInMillis
()
-
System
.
currentTimeMillis
())
/
1000
;
}
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
;
...
...
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