记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
8d4960ba
Commit
8d4960ba
authored
Jun 19, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量退款
parent
7f4b1097
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
68 deletions
+60
-68
KylinOrderRefundBatchAdminController.java
.../zhengzai/kylin/KylinOrderRefundBatchAdminController.java
+3
-4
applyView.html
...urces/templates/zhengzai/kylin/refundBatch/applyView.html
+24
-14
KylinRefundExecuteServiceImpl.java
...zai/kylin/service/impl/KylinRefundExecuteServiceImpl.java
+1
-1
KylinRefundPerformancesAdminServiceImpl.java
...service/impl/KylinRefundPerformancesAdminServiceImpl.java
+27
-29
KylinOrderTicketsMapper.java
...quidnet/service/kylin/mapper/KylinOrderTicketsMapper.java
+1
-4
KylinOrderTicketsMapper.xml
...iquidnet.service.kylin.mapper/KylinOrderTicketsMapper.xml
+4
-16
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/KylinOrderRefundBatchAdminController.java
View file @
8d4960ba
...
...
@@ -91,14 +91,13 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
@ResponseBody
public
AjaxResult
refundBatchApply
(
RefundBatchApplyParam
refundBatchApplyParam
)
{
try
{
Boolean
res
=
kylinRefundPerformancesAdminServiceImpl
.
refundBatchApply
(
refundBatchApplyParam
);
if
(
res
)
{
ResponseDto
res
=
kylinRefundPerformancesAdminServiceImpl
.
refundBatchApply
(
refundBatchApplyParam
);
if
(
res
.
isSuccess
()
)
{
return
success
();
}
else
{
return
error
(
"申请退款失败"
);
return
error
(
res
.
getMessage
()
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
error
(
e
.
getMessage
());
}
}
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/refundBatch/applyView.html
View file @
8d4960ba
...
...
@@ -60,25 +60,35 @@
var
options
=
{
data
:
result
.
performanceOrderStatisticalDao
,
pagination
:
false
,
columns
:
[{
checkbox
:
true
},
columns
:
[
{
field
:
'title'
,
title
:
'票种名'
},
{
field
:
'price'
,
title
:
'单价'
},
{
field
:
'type'
,
title
:
'类型'
title
:
'类型'
,
formatter
:
function
(
value
,
row
,
index
)
{
var
typeName
=
""
;
switch
(
value
)
{
case
1
:
typeName
=
"单日票"
;
break
;
case
2
:
typeName
=
"通票"
;
break
;
}
return
typeName
;
}
},
{
field
:
'useStart'
,
title
:
'适用时间'
},
{
field
:
'price'
,
title
:
'单价'
},
{
field
:
'saleGeneral'
,
title
:
'销售总数量'
...
...
@@ -87,10 +97,6 @@
field
:
'totalMemberNumber'
,
title
:
'会员销售数量'
},
{
field
:
'surplusGeneral'
,
title
:
'库存数量'
},
{
field
:
'totalPayingNumber'
,
title
:
'正在支付数量'
...
...
@@ -103,6 +109,10 @@
field
:
'totalSalePrice'
,
title
:
'销售额(元)'
},
{
field
:
'surplusGeneral'
,
title
:
'库存数量'
},
{
field
:
'totalExchange'
,
title
:
'兑换数量'
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinRefundExecuteServiceImpl.java
View file @
8d4960ba
...
...
@@ -45,7 +45,7 @@ public class KylinRefundExecuteServiceImpl {
@Autowired
private
KylinOrderRefundsServiceImpl
kylinOrderRefundsServiceImpl
;
public
void
refundBatchApply
(
String
targetId
,
String
refundBatchId
,
String
reason
)
throws
Exception
{
public
void
refundBatchApply
(
String
targetId
,
String
refundBatchId
,
String
reason
)
{
RefundApplyParam
refundApplyParam
=
new
RefundApplyParam
();
int
count
;
int
limitNum
=
100
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinRefundPerformancesAdminServiceImpl.java
View file @
8d4960ba
...
...
@@ -55,31 +55,29 @@ public class KylinRefundPerformancesAdminServiceImpl {
@Autowired
RedisUtil
redisUtil
;
public
Boolean
refundBatchApply
(
RefundBatchApplyParam
refundBatchApplyParam
)
throws
Exception
{
public
ResponseDto
refundBatchApply
(
RefundBatchApplyParam
refundBatchApplyParam
)
{
String
targetId
=
refundBatchApplyParam
.
getTargetId
();
HashMap
<
String
,
Object
>
priceNum
=
kylinOrderTicketsMapper
.
getPriceNum
(
targetId
);
Integer
totalNum
=
0
;
if
(
null
!=
priceNum
)
{
double
totalPrice
=
Double
.
parseDouble
(
priceNum
.
get
(
"total_price"
).
toString
());
totalNum
=
Integer
.
parseInt
(
priceNum
.
get
(
"total_num"
).
toString
());
if
(
totalPrice
<=
0
||
totalNum
<=
0
)
throw
new
Exception
(
"当前演出暂无需要退款的订单,请确认后重试!"
);
// 查询需要退的金额和数量
String
[]
paymentTypeAlipay
=
{
"APPALIPAY"
,
"WAPALIPAY"
,
"alipay"
};
HashMap
<
String
,
Object
>
orderStatisAlipay
=
kylinOrderTicketsMapper
.
getPerformanceRefundOrderStatis
(
targetId
,
paymentTypeAlipay
);
String
[]
paymentTypeWepay
=
{
"APPWEPAY"
,
"APPLETWEPAY"
,
"WAPWEPAY"
,
"JSWEPAY"
,
"wepay"
};
HashMap
<
String
,
Object
>
orderStatisWepay
=
kylinOrderTicketsMapper
.
getPerformanceRefundOrderStatis
(
targetId
,
paymentTypeWepay
);
Double
totalPriceRefundAlipay
=
0.0
;
Integer
totalRefundNumberAlipay
=
0
;
Double
totalPriceRefundWepay
=
0.0
;
Integer
totalRefundNumberWepay
=
0
;
if
(
null
!=
orderStatisAlipay
||
null
!=
orderStatisWepay
)
{
totalPriceRefundAlipay
=
(
Double
)
orderStatisAlipay
.
get
(
"total_price_refund"
);
totalRefundNumberAlipay
=
(
Integer
)
orderStatisAlipay
.
get
(
"total_refund_number"
);
totalPriceRefundWepay
=
(
Double
)
orderStatisWepay
.
get
(
"total_price_refund"
);
totalRefundNumberWepay
=
(
Integer
)
orderStatisWepay
.
get
(
"total_refund_number"
);
if
(
totalPriceRefundAlipay
<=
0
||
totalPriceRefundWepay
<=
0
)
{
return
ResponseDto
.
failure
(
"演出退款金额为0,无需退款"
);
}
}
else
{
throw
new
Exception
(
"当前演出暂无需要退款的订单,请确认后重试!
"
);
return
ResponseDto
.
failure
(
"演出暂无需要退款的订单
"
);
}
// 汇总退款
/*String[] paymentTypeAlipayArray = {"APPALIPAY", "WAPALIPAY", "alipay"};
double totalRefundAlipay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_actual", paymentTypeAlipayArray);
String[] paymentTypeWepayArray = {"APPWEPAY", "APPLETWEPAY", "WAPWEPAY", "JSWEPAY", "wepay"};
double totalRefundWepay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_actual", paymentTypeWepayArray);
double totalPriceExpressAlipay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_express", paymentTypeAlipayArray);
double totalPriceExpressWepay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_express", paymentTypeWepayArray);*/
String
[]
paymentTypeAlipayArray
=
{
"APPALIPAY"
,
"WAPALIPAY"
,
"alipay"
};
Double
totalAlipay
=
kylinOrderTicketsMapper
.
getTotalPrice
(
targetId
,
"price_actual"
,
paymentTypeAlipayArray
);
String
[]
paymentTypeWepayArray
=
{
"APPWEPAY"
,
"APPLETWEPAY"
,
"WAPWEPAY"
,
"JSWEPAY"
,
"wepay"
};
Double
totalWepay
=
kylinOrderTicketsMapper
.
getTotalPrice
(
targetId
,
"price_actual"
,
paymentTypeWepayArray
);
KylinOrderRefundBatches
refundBatchesInfo
=
kylinOrderRefundBatchesMapper
.
selectOne
(
new
QueryWrapper
<
KylinOrderRefundBatches
>().
eq
(
"target_id"
,
targetId
).
orderByDesc
(
"refund_batch_id"
)
);
...
...
@@ -94,12 +92,12 @@ public class KylinRefundPerformancesAdminServiceImpl {
createData
.
setRefundBatchId
(
refundBatchId
);
createData
.
setTargetId
(
targetId
);
createData
.
setStatus
(
KylinTableStatusConst
.
STATUS_APPLY
);
createData
.
setTotalNum
(
total
Num
);
if
(
null
!=
totalAlipay
)
{
createData
.
setTotalAlipay
(
BigDecimal
.
valueOf
(
totalAlipay
));
createData
.
setTotalNum
(
total
RefundNumberAlipay
+
totalRefundNumberWepay
);
if
(
null
!=
total
PriceRefund
Alipay
)
{
createData
.
setTotalAlipay
(
BigDecimal
.
valueOf
(
total
PriceRefund
Alipay
));
}
if
(
null
!=
totalWepay
)
{
createData
.
setTotalWepay
(
BigDecimal
.
valueOf
(
totalWepay
));
if
(
null
!=
total
PriceRefund
Wepay
)
{
createData
.
setTotalWepay
(
BigDecimal
.
valueOf
(
total
PriceRefund
Wepay
));
}
createData
.
setCreatedAt
(
LocalDateTime
.
now
());
...
...
@@ -107,12 +105,12 @@ public class KylinRefundPerformancesAdminServiceImpl {
if
(
resNum
>
0
)
{
// 开始执行批量提交审核 分批处理退款申请
kylinRefundExecuteServiceImpl
.
refundBatchApply
(
targetId
,
refundBatchId
,
refundBatchApplyParam
.
getReason
());
return
true
;
return
ResponseDto
.
success
()
;
}
else
{
return
false
;
return
ResponseDto
.
failure
(
"操作失败"
)
;
}
}
else
{
throw
new
Exception
(
"该演出已经提交过申请,请刷新申请列表查看"
);
return
ResponseDto
.
failure
(
"该演出已经提交过申请,请刷新申请列表查看"
);
}
}
...
...
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/mapper/KylinOrderTicketsMapper.java
View file @
8d4960ba
...
...
@@ -22,10 +22,7 @@ import java.util.Map;
public
interface
KylinOrderTicketsMapper
extends
BaseMapper
<
KylinOrderTickets
>
{
// 查询演出订单能退款的总金额和总订单数量
HashMap
<
String
,
Object
>
getPriceNum
(
String
targetId
);
// 查询微信、支付宝对应的订单金额、快递费金额
Double
getTotalPrice
(
@Param
(
"targetId"
)
String
targetId
,
@Param
(
"selectFields"
)
String
selectFields
,
@Param
(
"paymentType"
)
String
[]
paymentType
);
HashMap
<
String
,
Object
>
getPerformanceRefundOrderStatis
(
@Param
(
"targetId"
)
String
targetId
,
@Param
(
"paymentType"
)
String
[]
paymentType
);
// 获取订单和购票信息
List
<
KylinOrderTickets
>
getOrderList
(
@Param
(
"targetId"
)
String
targetId
,
@Param
(
"mid"
)
int
mid
,
@Param
(
"limitNum"
)
int
limitNum
);
...
...
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/resources/com.liquidnet.service.kylin.mapper/KylinOrderTicketsMapper.xml
View file @
8d4960ba
...
...
@@ -51,9 +51,9 @@
<result
column=
"user_id"
property=
"userId"
/>
</resultMap>
<select
id=
"getPriceNum"
resultType=
"java.util.HashMap"
>
SELECT SUM(o.price_actual) as total_price, SUM(o.number) as total_num
<select
id=
"getPerformanceRefundOrderStatis"
resultType=
"java.util.HashMap"
>
SELECT
SUM(o.price_actual - o.price_refund) as total_price_refund, SUM(o.number - o.refund_number) as total_refund_number
FROM kylin_order_tickets AS o
JOIN kylin_order_ticket_relations AS r ON r.order_id = o.order_tickets_id
JOIN kylin_order_ticket_status AS s ON s.order_id = o.order_tickets_id
...
...
@@ -62,24 +62,12 @@
AND s.status=1
AND s.pay_status=1
AND o.coupon_type='no'
</where>
LIMIT 1
</select>
<select
id=
"getTotalPrice"
parameterType=
"java.lang.String"
resultType=
"java.lang.Double"
>
SELECT SUM(${selectFields})
FROM kylin_order_tickets AS o
JOIN kylin_order_ticket_relations AS r ON r.order_id = o.order_tickets_id
JOIN kylin_order_ticket_status AS s ON s.order_id = o.order_tickets_id
<where>
r.performance_id=${targetId}
AND s.status=1
AND s.pay_status=1
AND o.coupon_type='no'
AND o.payment_type IN
<foreach
collection=
"paymentType"
item=
"payment_type"
index=
"index"
open=
"("
close=
")"
separator=
","
>
'${payment_type}'
</foreach>
</where>
LIMIT 1
</select>
<select
id=
"getOrderList"
parameterType=
"java.lang.String"
resultType=
"com.liquidnet.service.kylin.entity.KylinOrderTickets"
>
...
...
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