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
8f767caa
Commit
8f767caa
authored
Nov 18, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动添加保洁订单判断续单
parent
287d7118
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+20
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+2
-2
No files found.
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
8f767caa
...
@@ -5,9 +5,11 @@ import com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse;
...
@@ -5,9 +5,11 @@ import com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
share.common.core.redis.RedisUtil
;
import
share.common.core.redis.RedisUtil
;
import
share.common.enums.OrderStatusEnum
;
import
share.common.enums.OrderStatusEnum
;
import
share.common.enums.OrderTypeEnum
;
import
share.common.enums.ReceiptRdeisEnum
;
import
share.common.enums.ReceiptRdeisEnum
;
import
share.system.domain.SOrder
;
import
share.system.domain.SOrder
;
import
share.system.service.ISCleanRecordsService
;
import
share.system.service.ISCleanRecordsService
;
...
@@ -16,6 +18,7 @@ import share.system.service.ISOrderService;
...
@@ -16,6 +18,7 @@ import share.system.service.ISOrderService;
import
share.system.service.QPService
;
import
share.system.service.QPService
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -90,6 +93,23 @@ public class RedisTask {
...
@@ -90,6 +93,23 @@ public class RedisTask {
if
(
ObjectUtils
.
isEmpty
(
sOrder
))
{
if
(
ObjectUtils
.
isEmpty
(
sOrder
))
{
return
;
return
;
}
}
//查询当前门店房间下是否有续单
SOrder
order
=
new
SOrder
();
order
.
setStoreId
(
sOrder
.
getStoreId
());
order
.
setRoomId
(
sOrder
.
getRoomId
());
order
.
setConsumerId
(
sOrder
.
getConsumerId
());
order
.
setOrderType
(
OrderTypeEnum
.
RENEW
.
getCode
());
order
.
setStatus
(
OrderStatusEnum
.
UNUSED
.
getCode
());
//查询当前订单下是否存在未使用的续费订单
List
<
SOrder
>
sOrders
=
isOrderService
.
selectSOrderList
(
order
);
if
(!
CollectionUtils
.
isEmpty
(
sOrders
))
{
//删除当前的订单
redisUtil
.
delete
(
o
);
//更改订单状态
sOrder
.
setStatus
(
OrderStatusEnum
.
USED
.
getCode
());
isOrderService
.
updateById
(
sOrder
);
return
;
}
//更改订单状态
//更改订单状态
sOrder
.
setStatus
(
OrderStatusEnum
.
USED
.
getCode
());
sOrder
.
setStatus
(
OrderStatusEnum
.
USED
.
getCode
());
isOrderService
.
updateById
(
sOrder
);
isOrderService
.
updateById
(
sOrder
);
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
8f767caa
...
@@ -242,6 +242,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -242,6 +242,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// 加入自动未支付自动取消队列
// 加入自动未支付自动取消队列
redisUtil
.
lPush
(
Constants
.
ORDER_AUTO_CANCEL_KEY
,
sOrder
.
getOrderNo
());
redisUtil
.
lPush
(
Constants
.
ORDER_AUTO_CANCEL_KEY
,
sOrder
.
getOrderNo
());
}
}
save
(
sOrder
);
if
(
response
.
getStatus
().
equals
(
YesNoEnum
.
yes
.
getFlag
()))
{
if
(
response
.
getStatus
().
equals
(
YesNoEnum
.
yes
.
getFlag
()))
{
if
(
Objects
.
nonNull
(
request
.
getCouponId
())
&&
request
.
getCouponId
()
!=
0
)
{
if
(
Objects
.
nonNull
(
request
.
getCouponId
())
&&
request
.
getCouponId
()
!=
0
)
{
SConsumerCoupon
byId
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
SConsumerCoupon
byId
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
...
@@ -255,11 +256,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -255,11 +256,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
sConsumptionRecords
.
setOrderId
(
sOrder
.
getId
());
sConsumptionRecords
.
setOrderId
(
sOrder
.
getId
());
sConsumptionRecords
.
setName
(
sOrder
.
getPa
ckName
());
sConsumptionRecords
.
setName
(
user
.
getNi
ckName
());
sConsumptionRecords
.
setPrice
(
sOrder
.
getPayPrice
());
sConsumptionRecords
.
setPrice
(
sOrder
.
getPayPrice
());
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sConsumptionRecords
);
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sConsumptionRecords
);
}
}
save
(
sOrder
);
return
response
;
return
response
;
}
}
...
...
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