Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
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
PeiZhen-Java
peizhen-java
Commits
92a4eb60
Commit
92a4eb60
authored
Sep 15, 2023
by
sdif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户端代码提交
parent
d24f12b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
pz-applet/src/main/java/com/pz/applet/AppletTotalOrderController.java
+0
-2
pz-system/src/main/java/com/pz/system/datastructure/OrderDelayQueue.java
+4
-3
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
+10
-4
No files found.
pz-applet/src/main/java/com/pz/applet/AppletTotalOrderController.java
View file @
92a4eb60
...
@@ -55,8 +55,6 @@ public class AppletTotalOrderController extends BaseController {
...
@@ -55,8 +55,6 @@ public class AppletTotalOrderController extends BaseController {
private
final
ITotalOrderService
iTotalOrderService
;
private
final
ITotalOrderService
iTotalOrderService
;
private
final
IPaymentRecordService
iPaymentRecordService
;
private
final
IPayService
iPayService
;
private
final
IPayService
iPayService
;
/**
/**
...
...
pz-system/src/main/java/com/pz/system/datastructure/OrderDelayQueue.java
View file @
92a4eb60
...
@@ -2,6 +2,7 @@ package com.pz.system.datastructure;
...
@@ -2,6 +2,7 @@ package com.pz.system.datastructure;
import
com.pz.system.domain.TotalOrder
;
import
com.pz.system.domain.TotalOrder
;
import
com.pz.system.domain.bo.TotalOrderBo
;
import
com.pz.system.domain.bo.TotalOrderBo
;
import
com.pz.system.mapper.TotalOrderMapper
;
import
com.pz.system.service.ITotalOrderService
;
import
com.pz.system.service.ITotalOrderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -13,8 +14,8 @@ import java.util.concurrent.DelayQueue;
...
@@ -13,8 +14,8 @@ import java.util.concurrent.DelayQueue;
public
class
OrderDelayQueue
{
public
class
OrderDelayQueue
{
private
DelayQueue
<
TotalOrder
>
delayQueue
=
new
DelayQueue
<>();
private
DelayQueue
<
TotalOrder
>
delayQueue
=
new
DelayQueue
<>();
@Autowired
/*
@Autowired
private
ITotalOrderService
iTotalOrderService
;
private
TotalOrderMapper iTotalOrderService;*/
// 添加订单到延时队列
// 添加订单到延时队列
public
void
addOrder
(
TotalOrder
order
)
{
public
void
addOrder
(
TotalOrder
order
)
{
...
@@ -43,6 +44,6 @@ public class OrderDelayQueue {
...
@@ -43,6 +44,6 @@ public class OrderDelayQueue {
totalOrderBo
.
setId
(
order
.
getId
());
totalOrderBo
.
setId
(
order
.
getId
());
// 执行取消订单的相关操作
// 执行取消订单的相关操作
iTotalOrderService
.
cancelOrder
(
totalOrderBo
);
//
iTotalOrderService.cancelOrder(totalOrderBo);
}
}
}
}
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
View file @
92a4eb60
...
@@ -92,8 +92,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
...
@@ -92,8 +92,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
private
final
PaymentRecordMapper
paymentRecordMapper
;
private
final
PaymentRecordMapper
paymentRecordMapper
;
@Autowired
private
final
OrderDelayQueue
delayQueue
;
private
OrderDelayQueue
delayQueue
;
@Override
@Override
public
TotalOrderVo
queryById
(
Long
id
)
{
public
TotalOrderVo
queryById
(
Long
id
)
{
...
@@ -420,7 +419,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
...
@@ -420,7 +419,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
public
Boolean
finishOrder
(
TotalOrderBo
bo
)
{
public
Boolean
finishOrder
(
TotalOrderBo
bo
)
{
TotalOrder
totalOrder
=
BeanUtil
.
toBean
(
bo
,
TotalOrder
.
class
);
TotalOrder
totalOrder
=
BeanUtil
.
toBean
(
bo
,
TotalOrder
.
class
);
totalOrder
.
setStatus
(
2
);
totalOrder
.
setStatus
(
TotalOrderStatus
.
DONE
.
getCode
()
);
return
baseMapper
.
updateById
(
totalOrder
)
>
1
;
return
baseMapper
.
updateById
(
totalOrder
)
>
1
;
}
}
...
@@ -460,7 +459,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
...
@@ -460,7 +459,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
baseMapper
.
updateById
(
totalOrder
);
baseMapper
.
updateById
(
totalOrder
);
//添加支付记录
//添加支付记录
PaymentRecord
paymentRecord
=
new
PaymentRecord
();
PaymentRecord
paymentRecord
=
new
PaymentRecord
();
paymentRecord
.
setPayType
(
1
);
paymentRecord
.
setPayType
(
0
);
paymentRecord
.
setOrderId
(
totalOrder
.
getId
().
intValue
());
paymentRecord
.
setOrderId
(
totalOrder
.
getId
().
intValue
());
paymentRecord
.
setMoney
(
totalOrder
.
getPayMoney
());
paymentRecord
.
setMoney
(
totalOrder
.
getPayMoney
());
paymentRecord
.
setUid
(
totalOrder
.
getUid
());
paymentRecord
.
setUid
(
totalOrder
.
getUid
());
...
@@ -480,6 +479,13 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
...
@@ -480,6 +479,13 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrder
.
setStatus
(
TotalOrderStatus
.
REFUND
.
getCode
());
totalOrder
.
setStatus
(
TotalOrderStatus
.
REFUND
.
getCode
());
if
(
baseMapper
.
updateById
(
totalOrder
)
>
0
){
if
(
baseMapper
.
updateById
(
totalOrder
)
>
0
){
//添加退款记录
PaymentRecord
paymentRecord
=
new
PaymentRecord
();
paymentRecord
.
setPayType
(
1
);
paymentRecord
.
setOrderId
(
totalOrder
.
getId
().
intValue
());
paymentRecord
.
setMoney
(
totalOrder
.
getRefundAmount
());
paymentRecord
.
setUid
(
totalOrder
.
getUid
());
paymentRecordMapper
.
insert
(
paymentRecord
);
return
true
;
return
true
;
}
}
...
...
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