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
76c8fee4
Commit
76c8fee4
authored
Sep 19, 2023
by
邹磊浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
e3b8987c
73a408c6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
8 deletions
+29
-8
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
+29
-8
No files found.
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
View file @
76c8fee4
...
...
@@ -558,13 +558,19 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
}
// 待办买药已接单 代发货下取消订单调用退款接口
if
(
totalOrder
.
getBusinessId
()
==
5
&&
totalOrder
.
getStatus
()
==
1
)
{
if
(
totalOrder
.
getBusinessId
()
==
5
&&
totalOrder
.
getStatus
()
==
1
&&
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
==
1
)
{
totalOrderBo
.
setIsRefund
(
0
);
return
this
.
refundOrder
(
totalOrderBo
);
}
// 已接单、待收货状态下等待药品到达后确认
if
(
totalOrder
.
getBusinessId
()
==
5
&&
totalOrder
.
getStatus
()
==
2
)
{
if
(
totalOrder
.
getBusinessId
()
==
5
&&
totalOrder
.
getStatus
()
==
2
&&
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
==
2
&&
totalOrder
.
getRefundAmount
()
==
0
)
{
totalOrderBo
.
setIsRefund
(
1
);
return
this
.
refundOrder
(
totalOrderBo
);
}
...
...
@@ -581,7 +587,8 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
return
this
.
refundOrder
(
totalOrderBo
);
}
if
(
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
==
0
&&
totalOrder
.
getEmId
()
==
0
&&
totalOrder
.
getStatus
()
==
0
)
{
// 预约陪诊
//用户未付款 陪诊员为接单 和 用户未付款陪诊员已接单直接取消
if
((
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
==
0
&&
totalOrder
.
getStatus
()
==
0
)
||
(
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
==
1
&&
totalOrder
.
getStatus
()
==
0
))
{
// yypzOrderMapper.selectOne(new LambdaQueryWrapper<YypzOrder>().eq(YypzOrder::getOrderId,totalOrder));
totalOrder
.
setStatus
(
TotalOrderStatus
.
CANCEL
.
getCode
());
if
(
totalOrder
.
getBusinessId
()
==
0
){
...
...
@@ -722,7 +729,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
boolean
sonOrderFlag
=
orderService
.
switchSonOrderStatus
(
totalOrder
.
getId
(),
CommonOrderStatus
.
REFUND
.
getCode
());
//除了商城订单和诊前挂号不需要给陪诊员和商户分成
if
(
totalOrder
.
getBusinessId
()
!=
0
&&
totalOrder
.
getBusinessId
()
!=
6
)
{
if
(
totalOrder
.
getBusinessId
()
!=
0
&&
totalOrder
.
getBusinessId
()
!=
6
&&
totalOrder
.
getStatus
()
==
2
)
{
Services
services
=
servicesMapper
.
selectById
(
totalOrder
.
getServiceId
());
if
(
services
.
getFenmo
()
!=
0
){
double
money
=
0
;
...
...
@@ -759,6 +766,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
if
(!
sonOrderFlag
)
{
throw
new
ServiceException
(
"子订单状态修改出错,接单失败"
);
}
totalOrder
.
setSuborderStatus
(
CommonOrderStatus
.
REFUND
.
getCode
());
if
(
baseMapper
.
updateById
(
totalOrder
)
>
0
)
{
// 添加退款记录
PaymentRecord
paymentRecord
=
new
PaymentRecord
();
...
...
@@ -785,11 +793,11 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
if
(
null
==
sonOrderSimpleDataByTotalId
)
{
throw
new
ServiceException
(
"子订单状态出错!"
);
}
int
IsRefund
=
getIsRefund
(
totalOrder
.
getBusinessId
(),
totalOrder
.
getStatus
(),
sonOrderSimpleDataByTotalId
.
getSonOrderId
());
// 订单退款金额
double
money
=
0
;
if
(
bo
.
getIsRefund
()
==
0
)
{
// 陪诊员订单未完成用户主动退款
if
(
IsRefund
==
0
)
{
// 陪诊员订单未完成用户主动退款直接退到账户
// 主订单必须为付款并且子订单为已接单
if
(
totalOrder
.
getStatus
()
!=
1
&&
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
!=
1
)
{
if
(
totalOrder
.
getStatus
()
==
1
&&
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
==
0
){
...
...
@@ -846,7 +854,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
}
totalOrder
.
setRefundAmount
(
money
);
}
else
if
(
bo
.
getIsRefund
()
==
1
)
{
// 陪诊员订单完成走审批流程
}
else
if
(
IsRefund
==
1
)
{
// 陪诊员订单完成走审批流程
if
(
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
!=
2
)
{
throw
new
ServiceException
(
"订单状态错误"
);
}
...
...
@@ -866,7 +874,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
// 修改子订单状态
boolean
sonOrderFlag
=
orderService
.
switchSonOrderStatus
(
totalOrder
.
getId
(),
CommonOrderStatus
.
REFUND
.
getCode
());
boolean
sonOrderFlag
=
orderService
.
switchSonOrderStatus
(
totalOrder
.
getId
(),
CommonOrderStatus
.
BEING_
REFUND
.
getCode
());
if
(!
sonOrderFlag
)
{
throw
new
ServiceException
(
"子订单状态修改出错"
);
...
...
@@ -878,6 +886,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
.set(StoreOrder::getStatus, ShopOrderStatus.BEING_REFUND.getCode()));
}*/
totalOrder
.
setSuborderStatus
(
CommonOrderStatus
.
BEING_REFUND
.
getCode
());
baseMapper
.
updateById
(
totalOrder
);
return
true
;
}
...
...
@@ -1178,4 +1187,16 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
}
return
money
;
}
public
int
getIsRefund
(
int
businessId
,
int
businessStatus
,
int
ServiceStatus
){
int
IsRefund
=
0
;
if
((
businessStatus
==
1
&&
ServiceStatus
==
0
)
||
(
businessStatus
==
1
&&
ServiceStatus
==
1
)){
IsRefund
=
0
;
}
else
if
(
businessStatus
==
2
&&
ServiceStatus
==
2
){
IsRefund
=
1
;
}
else
if
(
businessId
==
3
&&
businessStatus
==
1
&&
ServiceStatus
==
2
){
IsRefund
=
1
;
}
return
IsRefund
;
}
}
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