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
3de7e35e
Commit
3de7e35e
authored
Sep 20, 2023
by
sdif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户端代码提交
parent
6fd35e64
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
13 deletions
+108
-13
pz-admin/src/main/java/com/pz/web/controller/system/UserRefundController.java
+11
-0
pz-system/src/main/java/com/pz/merchant/service/impl/EmployeesServiceImpl.java
+6
-4
pz-system/src/main/java/com/pz/system/domain/bo/TotalOrderBo.java
+10
-0
pz-system/src/main/java/com/pz/system/service/IUserRefundService.java
+5
-0
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
+48
-8
pz-system/src/main/java/com/pz/system/service/impl/UserRefundServiceImpl.java
+27
-0
pz-system/src/main/resources/mapper/system/ZyphOrderMapper.xml
+1
-1
No files found.
pz-admin/src/main/java/com/pz/web/controller/system/UserRefundController.java
View file @
3de7e35e
...
...
@@ -103,4 +103,15 @@ public class UserRefundController extends BaseController {
@PathVariable
Integer
[]
ids
)
{
return
toAjax
(
iUserRefundService
.
deleteWithValidByIds
(
Arrays
.
asList
(
ids
),
true
));
}
/**
* pc审核退款
*/
@SaCheckPermission
(
"system:userRefund:refund"
)
@Log
(
title
=
"用户退款"
,
businessType
=
BusinessType
.
UPDATE
)
@RepeatSubmit
()
@PutMapping
(
"/refund"
)
public
R
<
Void
>
refund
(
@Validated
(
EditGroup
.
class
)
@RequestBody
UserRefundBo
bo
)
{
return
toAjax
(
iUserRefundService
.
refund
(
bo
));
}
}
pz-system/src/main/java/com/pz/merchant/service/impl/EmployeesServiceImpl.java
View file @
3de7e35e
...
...
@@ -242,10 +242,12 @@ public class EmployeesServiceImpl implements IEmployeesService {
.
eq
(
TotalOrder:
:
getEmId
,
employeesVo
.
getId
())
.
eq
(
TotalOrder:
:
getIsSatisfaction
,
1
)
.
orderByDesc
(
TotalOrder:
:
getId
));
for
(
TotalOrderVo
order
:
totalOrder
)
{
BusinessVo
businessVo
=
businessMapper
.
selectVoOne
(
new
LambdaQueryWrapper
<
Business
>().
eq
(
Business:
:
getId
,
order
.
getBusinessId
()));
if
(
null
!=
businessVo
)
{
order
.
setProject
(
businessVo
.
getName
());
if
(
null
!=
totalOrder
&&
totalOrder
.
size
()
!=
0
){
for
(
TotalOrderVo
order
:
totalOrder
)
{
BusinessVo
businessVo
=
businessMapper
.
selectVoOne
(
new
LambdaQueryWrapper
<
Business
>().
eq
(
Business:
:
getId
,
order
.
getBusinessId
()));
if
(
null
!=
businessVo
)
{
order
.
setProject
(
businessVo
.
getName
());
}
}
}
employeesVo
.
setTotalOrderVo
(
totalOrder
);
...
...
pz-system/src/main/java/com/pz/system/domain/bo/TotalOrderBo.java
View file @
3de7e35e
...
...
@@ -107,4 +107,14 @@ public class TotalOrderBo extends BaseEntity {
* 凭证
*/
private
String
voucher
;
/**
* 是否后台退款
*/
private
Integer
isPcRefund
;
/**
* pc是否同意退款1-完成退款,2-取消退款
*/
private
Integer
isPcRefundStatus
;
}
pz-system/src/main/java/com/pz/system/service/IUserRefundService.java
View file @
3de7e35e
...
...
@@ -46,4 +46,9 @@ public interface IUserRefundService {
* 校验并批量删除用户退款信息
*/
Boolean
deleteWithValidByIds
(
Collection
<
Integer
>
ids
,
Boolean
isValid
);
/**
* 后台审核退款
*/
Boolean
refund
(
UserRefundBo
bo
);
}
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
View file @
3de7e35e
...
...
@@ -371,7 +371,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
List
<
StoreGoodsTag
>
storeGoodsTags
=
storeGoodsTagMapper
.
selectList
(
new
LambdaQueryWrapper
<
StoreGoodsTag
>().
in
(
StoreGoodsTag:
:
getId
,
ids
).
select
(
StoreGoodsTag:
:
getTitle
));
totalOrderVo
.
setTags
(
storeGoodsTags
);
totalOrderVo
.
setPrice
(
storeGoods
.
getPrice
());
totalOrderVo
.
setCover
(
storeGoods
.
getSmallCover
());
totalOrderVo
.
setName
(
storeGoods
.
getTitle
());
}
});
...
...
@@ -513,7 +513,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
storeOrder
.
setStoreId
(
storeGoods1
.
getStoreId
());
// 扣除库存
storeGoods1
.
setId
(
storeOrder
.
getId
());
storeGoods1
.
setId
(
storeOrder
.
get
Goods
Id
());
storeGoods1
.
setInventory
(
storeGoods1
.
getInventory
()
-
storeOrder
.
getNum
());
storeGoods1
.
setSaleNum
(
storeGoods1
.
getSaleNum
()
+
1
);
storeGoodsMapper
.
updateById
(
storeGoods1
);
...
...
@@ -631,9 +631,11 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
double
fenmo
=
(
double
)
services
.
getFenmo
()
/
100
;
double
v
=
totalOrder1
.
getPayMoney
()
*
fenmo
;
employeesDivide
.
setProportion
(
services
.
getFenmo
());
employeesDivide
.
setEmId
(
employees
.
getId
());
money
=
v
;
money
=
totalOrder1
.
getPayMoney
()
-
v
;;
if
(
employees
.
getCompanyId
()
!=
0
)
{
...
...
@@ -651,11 +653,19 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
employeesMapper
.
updateById
(
employees
);
employeesDivide
.
setDividePrice
(
money
+
""
);
}
employeesDivideMapper
.
insert
(
employeesDivide
);
}
if
(
totalOrder1
.
getBusinessId
()
==
0
){
ISonOrderService
orderService
=
serviceBuilder
.
getSonOrderService
(
totalOrder1
.
getBusinessId
());
// 修改子订单状态
orderService
.
switchSonOrderStatus
(
totalOrder1
.
getId
(),
CommonOrderStatus
.
DONE
.
getCode
());
}
}
return
baseMapper
.
updateById
(
totalOrder
)
>
0
;
...
...
@@ -742,7 +752,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
double
v
=
totalOrder
.
getPayMoney
()
*
fenmo
;
money
=
v
;
money
=
totalOrder
.
getPayMoney
()
-
v
;
if
(
employees
.
getCompanyId
()
!=
0
)
{
...
...
@@ -793,10 +803,40 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
if
(
null
==
sonOrderSimpleDataByTotalId
)
{
throw
new
ServiceException
(
"子订单状态出错!"
);
}
int
IsRefund
=
getIsRefund
(
totalOrder
.
getBusinessId
(),
totalOrder
.
getStatus
(),
sonOrderSimpleDataByTotalId
.
get
SonOrderId
());
int
IsRefund
=
getIsRefund
(
totalOrder
.
getBusinessId
(),
totalOrder
.
getStatus
(),
sonOrderSimpleDataByTotalId
.
get
OrderStatus
());
// 订单退款金额
double
money
=
0
;
if
(
null
!=
bo
.
getIsPcRefund
()
&&
bo
.
getIsPcRefund
()
==
1
){
money
=
totalOrder
.
getRefundAmount
();
//pc是否同意退款1-完成退款,2-取消退款
if
(
bo
.
getIsPcRefundStatus
()
==
1
){
WxPayRefundRequest
request
=
new
WxPayRefundRequest
();
request
.
setOutTradeNo
(
totalOrder
.
getOrderSn
());
request
.
setOutRefundNo
(
UUID
.
randomUUID
().
toString
());
request
.
setTotalFee
((
int
)
(
totalOrder
.
getPayMoney
()
*
100
));
request
.
setRefundFee
((
int
)
(
money
*
100
));
request
.
setNotifyUrl
(
"https://peizheng.shanpeikj.com/api/applet/totalOrder/orderRefundCallBack"
);
try
{
iPayService
.
refund
(
request
);
return
true
;
}
catch
(
WxPayException
e
)
{
e
.
printStackTrace
();
return
false
;
}
}
else
if
(
bo
.
getIsPcRefundStatus
()
==
2
){
//后台取消直接将订单完成
totalOrder
.
setStatus
(
TotalOrderStatus
.
DONE
.
getCode
());
baseMapper
.
updateById
(
totalOrder
);
return
orderService
.
switchSonOrderStatus
(
totalOrder
.
getId
(),
CommonOrderStatus
.
DONE
.
getCode
());
}
}
if
(
IsRefund
==
0
)
{
// 陪诊员订单未完成用户主动退款直接退到账户
// 主订单必须为付款并且子订单为已接单
if
(
totalOrder
.
getStatus
()
!=
1
&&
sonOrderSimpleDataByTotalId
.
getOrderStatus
()
!=
1
)
{
...
...
@@ -1169,14 +1209,14 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
long
hour
=
getHour
(
serveTime
);
if
(
hour
>
=
12
||
(
hour
<=
12
&&
hour
>
6
)
)
{
if
(
hour
>
6
)
{
money
=
payMoney
;
}
else
if
(
(
hour
<=
6
)
&&
(
hour
>=
3
)
)
{
}
else
if
(
hour
>=
3
)
{
// 计算扣除30%后的金额
deduction
=
payMoney
*
0.3
;
remainingAmount
=
payMoney
-
deduction
;
money
=
remainingAmount
;
}
else
if
(
(
hour
<=
3
)
&&
(
hour
>=
0
)
)
{
}
else
if
(
hour
>=
0
)
{
// 计算扣除50%后的金额
deduction
=
payMoney
*
0.5
;
remainingAmount
=
payMoney
-
deduction
;
...
...
pz-system/src/main/java/com/pz/system/service/impl/UserRefundServiceImpl.java
View file @
3de7e35e
...
...
@@ -7,8 +7,11 @@ import com.pz.common.core.domain.PageQuery;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.pz.common.exception.ServiceException
;
import
com.pz.system.domain.bo.TotalOrderBo
;
import
com.pz.system.mapper.BusinessMapper
;
import
com.pz.system.mapper.TotalOrderMapper
;
import
com.pz.system.service.ITotalOrderService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
com.pz.system.domain.bo.UserRefundBo
;
...
...
@@ -39,6 +42,8 @@ public class UserRefundServiceImpl implements IUserRefundService {
private
final
BusinessMapper
businessMapper
;
private
final
ITotalOrderService
iTotalOrderServicer
;
/**
* 查询用户退款
*/
...
...
@@ -136,4 +141,26 @@ public class UserRefundServiceImpl implements IUserRefundService {
}
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Override
public
Boolean
refund
(
UserRefundBo
bo
)
{
UserRefundVo
userRefundVo
=
baseMapper
.
selectVoById
(
bo
);
if
(
userRefundVo
.
getStatus
()
!=
0
){
throw
new
ServiceException
(
"已处理!"
);
}
TotalOrderBo
totalOrderBo
=
new
TotalOrderBo
();
totalOrderBo
.
setId
(
userRefundVo
.
getOrderId
().
longValue
());
totalOrderBo
.
setIsPcRefund
(
1
);
totalOrderBo
.
setIsPcRefundStatus
(
bo
.
getStatus
());
Boolean
aBoolean
=
iTotalOrderServicer
.
refundOrder
(
totalOrderBo
);
if
(
aBoolean
){
UserRefund
refund
=
new
UserRefund
();
refund
.
setId
(
bo
.
getId
());
refund
.
setStatus
(
bo
.
getStatus
());
int
i
=
baseMapper
.
updateById
(
refund
);
return
i
>
0
;
}
return
false
;
}
}
pz-system/src/main/resources/mapper/system/ZyphOrderMapper.xml
View file @
3de7e35e
...
...
@@ -105,7 +105,7 @@
</select>
<select
id=
"selectFinishTime"
resultType=
"java.lang.String"
>
select
start_day
select
concat(zyph_order.start_day, '-', zyph_order.start_time)
from total_order t left join zyph_order d on d.order_id = t.id
where t.id = #{id}
</select>
...
...
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