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
711382f0
Commit
711382f0
authored
Jul 24, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动退款后面支付成功的订单
parent
702bf887
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
29 deletions
+31
-29
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+31
-29
No files found.
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
711382f0
...
...
@@ -1617,35 +1617,37 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
unLockOrder
(
sOrder
.
getRoomId
());
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
sOrder
.
getConsumerId
()));
ConsumerMember
consumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
sOrder
.
getConsumerId
()));
// LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.ne(SOrder::getOrderNo,sOrder.getOrderNo());
// queryWrapper.eq(SOrder::getOrderType,OrderTypeEnum.RESERVER.getCode());
// queryWrapper.notIn(SOrder::getRefundStatus, RefundStatusEnum.getRefundedStatus());
// queryWrapper.in(SOrder::getStatus, OrderStatusEnum.getUnfinishOrderStatus());
// queryWrapper.eq(SOrder::getIsDelete, YesNoEnum.no.getIndex());
// queryWrapper.eq(SOrder::getStoreId, sOrder.getStoreId());
// queryWrapper.eq(SOrder::getRoomId, sOrder.getRoomId());
// queryWrapper.apply("(IFNULL(start_date,pre_start_date) BETWEEN '"
// + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, sOrder.getPreStartDate())
// + "' AND '" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinutes(sOrder.getPreEndDate(), Constants.ROOM_LOCK_DELAY_MINUTE)) + "' " +
// "OR IFNULL(end_date,pre_end_date) BETWEEN '"
// + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinutes(sOrder.getPreStartDate(), -Constants.ROOM_LOCK_DELAY_MINUTE))
// + "' AND '" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, sOrder.getPreEndDate()) + "' )");
// SOrder order = getOne(queryWrapper);
// if(ObjectUtil.isNotEmpty(order)){
// //退款
// AdminRefundRequest refundRequest = new AdminRefundRequest();
// refundRequest.setOrderNo(sOrder.getOrderNo());
// refundRequest.setAmount(sOrder.getPayPrice());
// refundRequest.setIsClean(YesNoEnum.no.getIndex());
// refundRequest.setRefundCoupon(YesNoEnum.yes.getIndex());
// refundRequest.setRefundReason("当前订单:"+sOrder.getOrderNo()+"和订单:"+order.getOrderNo()+"预约时间有干涉");
// int i = sOrderService.refundOp(refundRequest);
// if(i==1){
// sOrderService.removeById(sOrder);
// }
// return;
// }
logger
.
debug
(
"订单查询预约时间是否干涉"
);
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
ne
(
SOrder:
:
getOrderNo
,
sOrder
.
getOrderNo
());
queryWrapper
.
eq
(
SOrder:
:
getOrderType
,
OrderTypeEnum
.
RESERVER
.
getCode
());
queryWrapper
.
notIn
(
SOrder:
:
getRefundStatus
,
RefundStatusEnum
.
getRefundedStatus
());
queryWrapper
.
in
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
getUnfinishOrderStatus
());
queryWrapper
.
eq
(
SOrder:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
queryWrapper
.
eq
(
SOrder:
:
getStoreId
,
sOrder
.
getStoreId
());
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
sOrder
.
getRoomId
());
queryWrapper
.
apply
(
"(IFNULL(start_date,pre_start_date) BETWEEN '"
+
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM_SS
,
sOrder
.
getPreStartDate
())
+
"' AND '"
+
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM_SS
,
DateUtils
.
addMinutes
(
sOrder
.
getPreEndDate
(),
Constants
.
ROOM_LOCK_DELAY_MINUTE
))
+
"' "
+
"OR IFNULL(end_date,pre_end_date) BETWEEN '"
+
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM_SS
,
DateUtils
.
addMinutes
(
sOrder
.
getPreStartDate
(),
-
Constants
.
ROOM_LOCK_DELAY_MINUTE
))
+
"' AND '"
+
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM_SS
,
sOrder
.
getPreEndDate
())
+
"' )"
);
SOrder
order
=
getOne
(
queryWrapper
);
if
(
ObjectUtil
.
isNotEmpty
(
order
))
{
logger
.
debug
(
"订单:"
+
sOrder
.
getOrderNo
()
+
"和订单:"
+
order
.
getOrderNo
()
+
"预约时间有干涉"
);
//退款
AdminRefundRequest
refundRequest
=
new
AdminRefundRequest
();
refundRequest
.
setOrderNo
(
sOrder
.
getOrderNo
());
refundRequest
.
setAmount
(
sOrder
.
getPayPrice
());
refundRequest
.
setIsClean
(
YesNoEnum
.
no
.
getIndex
());
refundRequest
.
setRefundCoupon
(
YesNoEnum
.
yes
.
getIndex
());
refundRequest
.
setRefundReason
(
"当前订单:"
+
sOrder
.
getOrderNo
()
+
"和订单:"
+
order
.
getOrderNo
()
+
"预约时间有干涉"
);
int
i
=
sOrderService
.
refundOp
(
refundRequest
);
if
(
i
==
1
)
{
sOrderService
.
removeById
(
sOrder
);
}
return
;
}
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
SRoom
room
=
roomService
.
getById
(
sOrder
.
getRoomId
());
...
...
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