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
73439c0b
Commit
73439c0b
authored
Nov 27, 2020
by
张洪旺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coco
parent
9ce8b24a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
1 deletions
+122
-1
order-application-service/src/main/java/cn/freemud/constant/RedisKeyConstant.java
+23
-1
order-application-service/src/main/java/cn/freemud/controller/CallerController.java
+36
-0
order-application-service/src/main/java/cn/freemud/entities/vo/TakeMealNoticesVO.java
+29
-0
order-application-service/src/main/java/cn/freemud/service/CallerService.java
+34
-0
No files found.
order-application-service/src/main/java/cn/freemud/constant/RedisKeyConstant.java
View file @
73439c0b
...
...
@@ -13,6 +13,8 @@
package
cn
.
freemud
.
constant
;
import
cn.freemud.utils.DateTimeUtil
;
public
class
RedisKeyConstant
{
/**
* userInfoMap的redisKey前缀
...
...
@@ -51,7 +53,7 @@ public class RedisKeyConstant {
* 支付回掉标记在redis的key前缀
*/
public
final
static
String
KGD_PAYMENT_CALLBACK_FMID
=
"kgd:payment:callback:fmid:"
;
/**
* 点餐门店绑定的商城门店redis的key前缀
*/
...
...
@@ -67,4 +69,24 @@ public class RedisKeyConstant {
*/
public
final
static
String
KGD_SENDPOINT_ORDERID
=
"kgd:sendpoint:orderid:"
;
private
final
static
String
REDIS_KEY_SEP
=
":"
;
/**
* cocoNotMadeGoods:商户号:门店号:yyyy-MM-dd
*
* @param partnerId
* @param storeId
* @return
*/
public
static
String
notMadeGoodsNumber
(
String
partnerId
,
String
storeId
)
{
StringBuilder
sb
=
new
StringBuilder
(
"cocoNotMadeGoods"
);
sb
.
append
(
REDIS_KEY_SEP
);
sb
.
append
(
partnerId
).
append
(
REDIS_KEY_SEP
);
sb
.
append
(
storeId
).
append
(
REDIS_KEY_SEP
);
sb
.
append
(
DateTimeUtil
.
getCurrentDateStr
());
return
sb
.
toString
();
}
}
order-application-service/src/main/java/cn/freemud/controller/CallerController.java
0 → 100644
View file @
73439c0b
package
cn
.
freemud
.
controller
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.entities.vo.TakeMealNoticesVO
;
import
cn.freemud.service.CallerService
;
import
cn.freemud.utils.ResponseUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 叫号器
*/
@Slf4j
@RequestMapping
(
"/caller"
)
@RestController
@Validated
public
class
CallerController
{
private
CallerService
callerService
;
public
CallerController
(
CallerService
callerService
)
{
this
.
callerService
=
callerService
;
}
/**
* 取餐通知
* @return
*/
public
BaseResponse
takeMealNotices
(
TakeMealNoticesVO
vo
){
return
callerService
.
takeMealNotices
(
vo
);
}
}
order-application-service/src/main/java/cn/freemud/entities/vo/TakeMealNoticesVO.java
0 → 100644
View file @
73439c0b
package
cn
.
freemud
.
entities
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* @author freemud
*/
@Getter
@Setter
public
class
TakeMealNoticesVO
{
@ApiModelProperty
(
value
=
"商户Id"
)
private
String
partnerId
;
@ApiModelProperty
(
value
=
"门店id"
)
private
String
storeCode
;
@ApiModelProperty
(
value
=
"订单数量"
)
private
Integer
orderTotalNum
;
@ApiModelProperty
(
value
=
"待制作杯数"
)
private
Integer
cupTotalNum
;
@ApiModelProperty
(
value
=
"订单"
)
private
String
[]
orders
;
}
order-application-service/src/main/java/cn/freemud/service/CallerService.java
0 → 100644
View file @
73439c0b
package
cn
.
freemud
.
service
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.constant.RedisKeyConstant
;
import
cn.freemud.entities.vo.TakeMealNoticesVO
;
import
cn.freemud.utils.ResponseUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
java.util.concurrent.TimeUnit
;
@Service
public
class
CallerService
{
@Autowired
private
RedisTemplate
redisTemplate
;
/**
* 缓存 待制作杯数量
* @param vo
*/
private
void
cacheTakeMealNotices
(
TakeMealNoticesVO
vo
){
String
redisKey
=
RedisKeyConstant
.
notMadeGoodsNumber
(
vo
.
getPartnerId
(),
vo
.
getStoreCode
());
redisTemplate
.
boundValueOps
(
redisKey
).
set
(
vo
.
getCupTotalNum
(),
1
,
TimeUnit
.
DAYS
);
}
public
BaseResponse
takeMealNotices
(
TakeMealNoticesVO
vo
){
cacheTakeMealNotices
(
vo
);
//发送取餐通知消息 cc 生态
return
ResponseUtil
.
success
();
}
}
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