mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev-new' into dev-new-rabbitmq
This commit is contained in:
@@ -25,6 +25,8 @@ public class QueryPileDTO extends BasicPileDTO{
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
private String transactionCode;
|
||||
|
||||
/**
|
||||
* 桩编码+枪口号
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.alipay.api.domain.ChargeOrderInfo;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.adapay.common.DivMember;
|
||||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||||
@@ -12,14 +11,14 @@ import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderBillingInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
|
||||
import com.jsowell.pile.vo.SupStationStatsVO;
|
||||
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||
import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
|
||||
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
||||
import com.jsowell.pile.vo.nanrui.JiangSuOrderInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderBillingInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.OrderVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.PersonPileConnectorSumInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.SendMessageVO;
|
||||
@@ -159,6 +158,8 @@ public interface OrderBasicInfoService{
|
||||
*/
|
||||
int close15MinutesOfUnpaidOrders();
|
||||
|
||||
int closeUnpaidOrders(List<OrderBasicInfo> orderList);
|
||||
|
||||
WechatPayRefundResponse refundOrderWithWechatPay(ApplyRefundDTO dto);
|
||||
|
||||
WechatPayRefundResponse refundBalanceWithWechatPay(ApplyRefundDTO dto);
|
||||
@@ -244,6 +245,8 @@ public interface OrderBasicInfoService{
|
||||
*/
|
||||
List<IndexOrderInfoVO> getIndexOrderInfo(IndexQueryDTO dto);
|
||||
|
||||
List<OrderBasicInfo> getUnpaidOrderList(String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 获取超过15分钟的待支付状态订单
|
||||
* @return
|
||||
|
||||
@@ -2425,6 +2425,18 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间范围查询 未支付订单
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OrderBasicInfo> getUnpaidOrderList(String startTime, String endTime) {
|
||||
List<OrderBasicInfo> list = orderBasicInfoMapper.getUnpaidOrderList(startTime, endTime);
|
||||
return CollectionUtils.isNotEmpty(list) ? list : Lists.newArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取超过15分钟的待支付状态订单
|
||||
*
|
||||
@@ -2432,10 +2444,9 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
*/
|
||||
@Override
|
||||
public List<OrderBasicInfo> getUnpaidOrderListOver15Min() {
|
||||
String startString = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
||||
String endString = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinute(new Date(), -15));
|
||||
List<OrderBasicInfo> list = orderBasicInfoMapper.getUnpaidOrderList(startString, endString);
|
||||
return CollectionUtils.isNotEmpty(list) ? list : Lists.newArrayList();
|
||||
String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinute(new Date(), -30));
|
||||
String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinute(new Date(), -15));
|
||||
return getUnpaidOrderList(startTime, endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2451,22 +2462,38 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
|
||||
@Override
|
||||
public int close15MinutesOfUnpaidOrders() {
|
||||
List<OrderBasicInfo> orderList = getUnpaidOrderListOver15Min();
|
||||
if (CollectionUtils.isNotEmpty(orderList)) {
|
||||
for (OrderBasicInfo orderBasicInfo : orderList) {
|
||||
this.cleanCacheByOrderCode(orderBasicInfo.getOrderCode(), orderBasicInfo.getTransactionCode());
|
||||
// 查询超过十五分钟未支付的订单
|
||||
String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinute(new Date(), -30));
|
||||
String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinute(new Date(), -15));
|
||||
List<OrderBasicInfo> orderList = getUnpaidOrderList(startTime, endTime);
|
||||
int i = closeUnpaidOrders(orderList);
|
||||
return i;
|
||||
}
|
||||
|
||||
// 通过订单号查询汇付有没有支付单
|
||||
checkUnpaidOrder(orderBasicInfo);
|
||||
}
|
||||
|
||||
// 订单id集合
|
||||
List<String> orderIdList = orderList.stream()
|
||||
.map(x -> String.valueOf(x.getId()))
|
||||
.collect(Collectors.toList());
|
||||
// 根据orderIdList修改订单状态
|
||||
updateOrderStatusById(orderIdList, OrderStatusEnum.ORDER_CLOSE_TIMEOUT.getValue());
|
||||
/**
|
||||
* 关闭未支付的订单
|
||||
* @param orderList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int closeUnpaidOrders(List<OrderBasicInfo> orderList) {
|
||||
if (CollectionUtils.isEmpty(orderList)) {
|
||||
return 0;
|
||||
}
|
||||
for (OrderBasicInfo orderBasicInfo : orderList) {
|
||||
this.cleanCacheByOrderCode(orderBasicInfo.getOrderCode(), orderBasicInfo.getTransactionCode());
|
||||
|
||||
// 通过订单号查询汇付有没有支付单
|
||||
checkUnpaidOrder(orderBasicInfo);
|
||||
}
|
||||
|
||||
// 订单id集合
|
||||
List<String> orderIdList = orderList.stream()
|
||||
.map(x -> String.valueOf(x.getId()))
|
||||
.collect(Collectors.toList());
|
||||
// 根据orderIdList修改订单状态
|
||||
updateOrderStatusById(orderIdList, OrderStatusEnum.ORDER_CLOSE_TIMEOUT.getValue());
|
||||
logger.info("closeUnpaidOrders, orderIdList:{}", orderIdList);
|
||||
return orderList.size();
|
||||
}
|
||||
|
||||
@@ -2504,7 +2531,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
} catch (BaseAdaPayException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
logger.info("根据订单号:{}, 查询到支付信息:{}, ", orderCode, JSON.toJSONString(paymentInfoSet));
|
||||
logger.info("checkUnpaidOrder根据订单号:{}, 查询到支付信息:{}, ", orderCode, JSON.toJSONString(paymentInfoSet));
|
||||
if (CollectionUtils.isNotEmpty(paymentInfoSet)) {
|
||||
for (PaymentInfo paymentInfo : paymentInfoSet) {
|
||||
String paymentId = paymentInfo.getPaymentId();
|
||||
@@ -3486,7 +3513,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
@Override
|
||||
public void payOrderSuccessCallback(PayOrderSuccessCallbackDTO dto) {
|
||||
OrderBasicInfo orderInfo = this.getOrderInfoByOrderCode(dto.getOrderCode());
|
||||
logger.info("订单:{}支付成功支付回调, OrderBasicInfo:{}", dto.getOrderCode(), JSON.toJSONString(orderInfo));
|
||||
logger.info("订单:{}支付成功支付回调, param:{}, OrderBasicInfo:{}", dto.getOrderCode(), JSON.toJSONString(dto), JSON.toJSONString(orderInfo));
|
||||
BigDecimal payAmount = dto.getPayAmount();
|
||||
|
||||
// 是否发送启动指令
|
||||
|
||||
Reference in New Issue
Block a user