记得上下班打卡 | git大法好,push需谨慎

Commit 63ec6c64 authored by jiangxiulong's avatar jiangxiulong

批量退款 查询订单状态 3 6的也处理 double处理

parent 8d8a8495
...@@ -68,26 +68,24 @@ public class KylinRefundPerformancesAdminServiceImpl { ...@@ -68,26 +68,24 @@ public class KylinRefundPerformancesAdminServiceImpl {
HashMap<String, Object> orderStatisAlipay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeAlipay); HashMap<String, Object> orderStatisAlipay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeAlipay);
String[] paymentTypeWepay = {"APPWEPAY", "APPLETWEPAY", "WAPWEPAY", "JSWEPAY", "wepay"}; String[] paymentTypeWepay = {"APPWEPAY", "APPLETWEPAY", "WAPWEPAY", "JSWEPAY", "wepay"};
HashMap<String, Object> orderStatisWepay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeWepay); HashMap<String, Object> orderStatisWepay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeWepay);
Double totalPriceRefundAlipay = 0.0; BigDecimal totalPriceRefundAlipay = new BigDecimal(0);
Integer totalRefundNumberAlipay = 0; Integer totalRefundNumberAlipay = 0;
Double totalPriceRefundWepay = 0.0; BigDecimal totalPriceRefundWepay = new BigDecimal(0);
Integer totalRefundNumberWepay = 0; Integer totalRefundNumberWepay = 0;
if (null != orderStatisAlipay || null != orderStatisWepay) { if (null != orderStatisAlipay || null != orderStatisWepay) {
if (null != orderStatisAlipay) { if (null != orderStatisAlipay) {
BigDecimal totalPriceRefundAlipayBigDecimal = (BigDecimal) orderStatisAlipay.get("total_price_refund"); totalPriceRefundAlipay = (BigDecimal) orderStatisAlipay.get("total_price_refund");
totalPriceRefundAlipay = totalPriceRefundAlipayBigDecimal.doubleValue();
BigDecimal totalRefundNumberAlipayBigDecimal = (BigDecimal) orderStatisAlipay.get("total_refund_number"); BigDecimal totalRefundNumberAlipayBigDecimal = (BigDecimal) orderStatisAlipay.get("total_refund_number");
totalRefundNumberAlipay = totalRefundNumberAlipayBigDecimal.intValue(); totalRefundNumberAlipay = totalRefundNumberAlipayBigDecimal.intValue();
} }
if (null != orderStatisWepay) { if (null != orderStatisWepay) {
BigDecimal totalPriceRefundWepayBigDecimal = (BigDecimal) orderStatisWepay.get("total_price_refund"); totalPriceRefundWepay = (BigDecimal) orderStatisWepay.get("total_price_refund");
totalPriceRefundWepay = totalPriceRefundWepayBigDecimal.doubleValue();
BigDecimal totalRefundNumberWepayBigDecimal = (BigDecimal) orderStatisWepay.get("total_refund_number"); BigDecimal totalRefundNumberWepayBigDecimal = (BigDecimal) orderStatisWepay.get("total_refund_number");
totalRefundNumberWepay = totalRefundNumberWepayBigDecimal.intValue(); totalRefundNumberWepay = totalRefundNumberWepayBigDecimal.intValue();
} }
if (totalPriceRefundAlipay <= 0 && totalPriceRefundWepay <= 0) { if (totalPriceRefundAlipay.compareTo(BigDecimal.ZERO) <= 0 && totalPriceRefundWepay.compareTo(BigDecimal.ZERO) <= 0) {
return ResponseDto.failure("演出退款金额为0,无需退款"); return ResponseDto.failure("演出退款金额为0,无需退款");
} }
} else { } else {
...@@ -106,8 +104,8 @@ public class KylinRefundPerformancesAdminServiceImpl { ...@@ -106,8 +104,8 @@ public class KylinRefundPerformancesAdminServiceImpl {
createData.setTargetId(targetId); createData.setTargetId(targetId);
createData.setStatus(KylinTableStatusConst.STATUS_APPLY11); createData.setStatus(KylinTableStatusConst.STATUS_APPLY11);
createData.setTotalNum(totalRefundNumberAlipay + totalRefundNumberWepay); createData.setTotalNum(totalRefundNumberAlipay + totalRefundNumberWepay);
createData.setTotalAlipay(BigDecimal.valueOf(totalPriceRefundAlipay)); createData.setTotalAlipay(totalPriceRefundAlipay);
createData.setTotalWepay(BigDecimal.valueOf(totalPriceRefundWepay)); createData.setTotalWepay(totalPriceRefundWepay);
createData.setCreatedAt(LocalDateTime.now()); createData.setCreatedAt(LocalDateTime.now());
int resNum = kylinOrderRefundBatchesMapper.insert(createData); int resNum = kylinOrderRefundBatchesMapper.insert(createData);
if (resNum > 0) { if (resNum > 0) {
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
JOIN kylin_order_ticket_status AS s ON s.order_id = o.order_tickets_id JOIN kylin_order_ticket_status AS s ON s.order_id = o.order_tickets_id
<where> <where>
r.performance_id=#{targetId} r.performance_id=#{targetId}
AND s.status=1 AND s.status IN (1, 3, 6)
AND s.pay_status=1 AND s.pay_status=1
AND o.coupon_type='no' AND o.coupon_type='no'
AND o.payment_type IN AND o.payment_type IN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment