Files
jsowell-charger-web/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java

560 lines
16 KiB
Java
Raw Normal View History

2024-01-06 15:13:50 +08:00
package com.jsowell.pile.service;
import com.huifu.adapay.core.exception.BaseAdaPayException;
2024-12-31 16:17:37 +08:00
import com.jsowell.adapay.dto.SplitData;
2024-01-06 15:13:50 +08:00
import com.jsowell.adapay.response.PaymentReverseResponse;
2024-09-24 16:39:42 +08:00
import com.jsowell.adapay.vo.OrderSplitResult;
2024-01-06 15:13:50 +08:00
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
2024-11-29 17:45:34 +08:00
import com.jsowell.pile.domain.*;
2024-01-06 15:13:50 +08:00
import com.jsowell.pile.dto.*;
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
2025-01-15 09:52:23 +08:00
import com.jsowell.pile.vo.OrderInfoDetailVO;
import com.jsowell.pile.vo.SupStationStatsVO;
2024-01-06 15:13:50 +08:00
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;
2024-12-31 09:47:45 +08:00
import com.jsowell.pile.vo.uniapp.business.BusinessOrderBillingInfoVO;
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
2024-07-16 14:07:06 +08:00
import com.jsowell.pile.vo.uniapp.customer.OrderVO;
import com.jsowell.pile.vo.uniapp.customer.PersonPileConnectorSumInfoVO;
import com.jsowell.pile.vo.uniapp.customer.SendMessageVO;
2024-01-06 15:13:50 +08:00
import com.jsowell.pile.vo.web.*;
import com.jsowell.wxpay.response.WechatPayRefundResponse;
import java.math.BigDecimal;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
public interface OrderBasicInfoService{
int deleteByPrimaryKey(Integer id);
int insert(OrderBasicInfo record);
int insertOrUpdate(OrderBasicInfo record);
int insertOrUpdateSelective(OrderBasicInfo record);
int insertSelective(OrderBasicInfo record);
OrderBasicInfo selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(OrderBasicInfo record);
int updateByPrimaryKey(OrderBasicInfo record);
int updateBatch(List<OrderBasicInfo> list);
int updateBatchSelective(List<OrderBasicInfo> list);
int batchInsert(List<OrderBasicInfo> list);
/**
* 条件查询订单基础信息
* @param info
* @return
*/
OrderBasicInfo getOrderBasicInfo(OrderBasicInfo info);
List<OrderListVO> selectOrderBasicInfoListWithAuth(QueryOrderDTO dto);
/**
* 查询订单列表
*
* @param dto 订单
* @return 订单集合
*/
List<OrderListVO> selectOrderBasicInfoList(QueryOrderDTO dto);
/**
* 查询充电中的订单没有数据权限校验后管不要用
* @param pileSn
* @return
*/
List<OrderListVO> selectChargingOrder(String pileSn);
2024-03-11 14:00:57 +08:00
/**
* 处理前端传的参数
* 公共方法
* @param dto
*/
void analysisPileParameter(BasicPileDTO dto);
/**
* 校验充电桩相关的信息
* 公共方法
* @param dto
*/
2024-09-05 11:19:15 +08:00
void checkPileInfoForEV(GenerateOrderDTO dto);
void checkPileInfoForEBike(GenerateOrderDTO dto);
2024-03-11 14:00:57 +08:00
/**
* 保存订单到数据库 saveOrder2Database
* 公共方法
* @param dto
* @return
* @throws ParseException
*/
2024-09-05 11:19:15 +08:00
OrderBasicInfo saveOrderForEV(GenerateOrderDTO dto) throws ParseException;
OrderBasicInfo saveOrderForEBike(GenerateOrderDTO dto) throws ParseException;
2024-01-06 15:13:50 +08:00
/**
* 修改订单
*
* @param orderBasicInfo 订单
* @return 结果
*/
int updateOrderBasicInfo(OrderBasicInfo orderBasicInfo);
/**
* 修改订单详情
* @param orderDetail
* @return
*/
int updateOrderDetail(OrderDetail orderDetail);
// 清订单缓存
void cleanCacheByOrderCode(String orderCode, String transactionCode);
/**
* 批量删除订单
*
* @param ids 需要删除的订单主键集合
* @return 结果
*/
int deleteOrderBasicInfoByIds(Long[] ids);
/**
* 通过订单号查询订单信息
*
* @param orderCode 订单号
* @return
*/
OrderBasicInfo getOrderInfoByOrderCode(String orderCode);
OrderBasicInfo getOrderInfoByTransactionCode(String transactionCode);
/**
* 通过桩号和枪口号查询充电中的状态
* @param pileSn 桩编号
* @param connectorCode 枪口号
* @return
*/
OrderBasicInfo queryChargingByPileSnAndConnectorCode(String pileSn, String connectorCode);
OrderBasicInfo queryChargingByPileConnectorCode(String pileConnectorCode);
/**
* 关闭15分钟未支付订单
* @return
*/
int close15MinutesOfUnpaidOrders();
2024-12-31 09:47:45 +08:00
int closeUnpaidOrders(List<OrderBasicInfo> orderList);
2024-01-06 15:13:50 +08:00
WechatPayRefundResponse refundOrderWithWechatPay(ApplyRefundDTO dto);
WechatPayRefundResponse refundBalanceWithWechatPay(ApplyRefundDTO dto);
/**
* 通过订单号查询订单详情
*
* @param orderCode 订单号
* @return 订单详情
*/
OrderDetail getOrderDetailByOrderCode(String orderCode);
List<OrderDetail> getOrderDetailList(List<String> orderCodes);
/**
* 通过会员Id和订单状态查询订单信息
*
* @param memberId 会员id
* @param orderStatusList 订单状态集合
* @return
*/
List<OrderVO> getListByMemberIdAndOrderStatus(String memberId, List<String> orderStatusList);
List<OrderVO> getListByMemberIdAndOrderStatus(String memberId, List<String> orderStatusList, LocalDateTime dateTime);
List<OrderVO> getListByMemberIdAndOrderStatus(String memberId, List<String> orderStatusList, LocalDateTime dateTime, String stationId);
void orderSplittingOperations(String merchantId, AdapayMemberAccount adapayMemberAccount, List<SettleOrderReport> stationReportList);
void orderSplittingOperations(String merchantId, String tradeDate);
List<BalanceDeductionAmountVO> calculateTheBalanceDeductionAmount(String memberId, BigDecimal amount);
/**
* 执行订单分账
* @param orderBasicInfo
* @param adapayMemberAccount
* @return
* @throws BaseAdaPayException
*/
2024-09-24 16:39:42 +08:00
OrderSplitResult doPaymentConfirmWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
2024-01-06 15:13:50 +08:00
2025-02-20 14:25:36 +08:00
/**
* 生成运营商日账单
* 适用于实时分账后,第二天凌晨生成前一天的账单
*/
void generateMerchantBill(String merchantId, String tradeDate);
2024-09-24 16:39:42 +08:00
OrderSplitResult doBalancePaymentWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
2024-01-06 15:13:50 +08:00
2024-11-06 15:18:37 +08:00
OrderSplitResult realTimeOrderSplit(AfterSettleOrderDTO afterSettleOrderDTO) throws BaseAdaPayException;
2024-12-31 16:38:08 +08:00
/**
* 计算分账数据
* @param stationSplitConfigList
* @param afterSettleOrderDTO
* @return
*/
2024-12-31 16:17:37 +08:00
List<SplitData> calculationSplitDataList(List<StationSplitConfig> stationSplitConfigList, AfterSettleOrderDTO afterSettleOrderDTO);
2024-12-31 16:38:08 +08:00
// List<DivMember> calculationOfSplitAmount(List<StationSplitConfig> stationSplitConfigList, AfterSettleOrderDTO afterSettleOrderDTO);
2024-12-02 10:32:11 +08:00
2024-12-31 16:38:08 +08:00
// List<DivMember> calculationOfSplitAmount(List<StationSplitConfig> stationSplitConfigList, AfterSettleOrderDTO afterSettleOrderDTO, List<PaymentInfo> paymentInfos);
2024-11-29 17:45:34 +08:00
2024-12-19 16:47:40 +08:00
OrderSplitResult verifyOrderConfirmAmount(List<String> paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException;
2024-01-06 15:13:50 +08:00
/**
* 批量查询订单
* @param orderCodeList
* @return
*/
List<OrderBasicInfo> queryOrderList(List<String> orderCodeList);
void realTimeMonitorDataRedis2DB(String transactionCode, String orderCode);
/**
* 结算订单退款和用户余额退款调这个方法
*/
void weChatRefund(ApplyRefundDTO dto);
/**
* 保存非法订单记录
*/
void saveAbnormalOrder(TransactionRecordsData data);
/**
* 获取充电实时数据
* @param transactionCode 交易流水号
* @return
*/
List<RealTimeMonitorData> getChargingRealTimeData(String transactionCode);
/**
* 首页订单数据展示
* @param dto 首页信息查询dto
* @return
*/
List<IndexOrderInfoVO> getIndexOrderInfo(IndexQueryDTO dto);
List<OrderBasicInfo> getUnpaidOrderList(String startTime, String endTime);
2024-01-06 15:13:50 +08:00
/**
* 获取超过15分钟的待支付状态订单
* @return
*/
List<OrderBasicInfo> getUnpaidOrderListOver15Min();
/**
* 根据orderId批量修改订单状态
* @param orderIds
* @param orderStatus
*/
void updateOrderStatusById(List<String> orderIds, String orderStatus);
/**
* 通过订单状态和支付状态 转换订单状态描述
* @param orderStatus 订单状态
* @param payStatus 支付状态
* @return 订单状态描述
*/
String transformOrderStatusDescribe(String orderStatus, String payStatus);
/**
* 查询时间段内订单总金额和总用电量
*/
OrderTotalDataVO getOrderTotalData(QueryOrderDTO orderBasicInfo);
2025-01-15 09:52:23 +08:00
OrderInfoDetailVO getOrderInfoDetailVO(String orderCode);
OrderInfoDetailVO getOrderInfoDetailVO(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail);
2024-01-06 15:13:50 +08:00
List<OrderTotalDataVO> getOrderTotalDataV2(QueryOrderDTO dto);
/**
* 通过订单号查询订单信息小程序发送消息用
* @param orderCode
* @return
*/
SendMessageVO selectOrderInfoByOrderCode(String orderCode);
/**
* 充电桩启动失败
* @param orderCode
* @param failedReasonMsg
*/
void chargingPileFailedToStart(String orderCode, String failedReasonMsg);
/**
* 充电桩启动成功
* @param orderCode
*/
void chargingPileStartedSuccessfully(String orderCode);
/**
* 关闭启动失败的订单
*/
void closeStartFailedOrder(String startTime, String endTime);
List<OrderVO> getListByOrderCodes(List<String> orderCodes);
/**
* 个人桩查询充电数据
* @param dto
* @return
*/
List<PersonPileConnectorSumInfoVO> getAccumulativeInfo(QueryPersonPileDTO dto);
/**
* 修改订单状态为异常桩离线时调用
*
* @param pileSn
*/
void updateOrderStatusAsAbnormal(String pileSn);
2024-05-21 18:11:01 +08:00
List<OrderBasicInfo> getReservedOrder(LocalDateTime dateTime);
2024-01-06 15:13:50 +08:00
Map<String, Object> generateOrderByCard(GenerateOrderDTO dto) throws Exception;
/**
* 联联平台 获取累计数据用
* @param dto
* @return
*/
List<AccumulativeInfoVO> getAccumulativeInfoForLianLian(QueryStationInfoDTO dto);
/**
* 联联平台生成订单
* @param dto
* @return
*/
Map<String, Object> generateOrderForThirdParty(QueryStartChargeDTO dto);
2024-01-06 15:13:50 +08:00
List<OrderAmountDetailVO> queryOrderAmountDetail(List<String> orderCodes);
List<OrderPeriodAmountVO> transformPeriodAmountByOrderDetail(OrderDetail orderDetail);
/**
* 汇付支付 订单退款
* @param dto
*/
void refundOrderWithAdapay(ApplyRefundDTO dto);
/**
* 汇付支付 余额退款
* @param dto
*/
void refundBalanceWithAdapay(ApplyRefundDTO dto);
/**
* 生成订单日报
*/
// void generateDailyOrderReports(String stationId, String tradeDate);
/**
* 获取运营商订单列表
* @return
*/
List<MerchantOrderInfoVO> getMerchantOrderInfoList(QueryMerchantOrderDTO dto);
/**
* 生成订单逻辑
* @param dto
* @return
*/
OrderBasicInfo generateOrder(GenerateOrderDTO dto) throws ParseException;
2024-01-22 12:32:22 +08:00
// Map<String, Object> payOrder(PayOrderDTO dto) throws Exception;
2024-01-06 15:13:50 +08:00
/**
* 订单支付成功 支付回调
* 支付成功后掉用这个方法
* 1. 修改订单支付状态
* 2. 发送启动充电指令
*/
void payOrderSuccessCallback(PayOrderSuccessCallbackDTO dto);
List<PaymentReverseResponse> queryOrderAdapayRefund(OrderBasicInfo orderBasicInfo);
/**
* 重试订单退款
* @param orderCode 订单编号
*/
void retryRefundOrder(String orderCode) throws BaseAdaPayException;
void retryRefundOrder(OrderBasicInfo orderBasicInfo) throws BaseAdaPayException;
2024-09-24 16:39:42 +08:00
OrderSplitResult orderPaymentSettlementAndRefund(OrderBasicInfo orderBasicInfo);
2024-01-06 15:13:50 +08:00
void returnUpdateOrderBasicInfo(OrderBasicInfo orderBasicInfo, TransactionRecordsData data);
OrderDetail returnUpdateOrderDetail(OrderBasicInfo orderBasicInfo, TransactionRecordsData data);
/**
* 通过站点id修改运营商id
* @param stationId
* @return
*/
int updateMerchantByStationId(Long stationId, String newMerchantId);
/**
* 通过订单编号获取南瑞平台所需要的订单数据信息
* @param orderCode
* @return
*/
JiangSuOrderInfoVO getNROrderInfoByOrderCode(String orderCode);
2024-01-06 15:13:50 +08:00
/**
* 通过充电结束时间批量查询
* @param dto
* @return
*/
List<JiangSuOrderInfoVO> getNROrderInfos(NRQueryOrderDTO dto);
2024-01-06 15:13:50 +08:00
2024-03-11 14:03:24 +08:00
/**
* 根据时间端范围查询订单支付单id
* @param startTime
* @param endTime
* @return
*/
2024-08-06 15:46:43 +08:00
List<OrderPaymentDetailVO> queryOrderPayDetail(String startTime, String endTime);
2024-01-06 15:13:50 +08:00
/**
* 根据车牌号查询订单信息宁夏交投
* @param dto
* @return
*/
List<OrderVO> getOrderInfoByNXJT(NXJTQueryOrdersInfoDTO dto);
2024-03-11 14:03:24 +08:00
/**
* 查询待补缴订单列表
* @param memberId
* @return
*/
2024-01-17 17:41:57 +08:00
List<OrderBasicInfo> queryRepayOrder(String memberId);
/**
* 通过orderCode获取退款明细列表
* @param orderCode
* @return
*/
List<OrderDetailInfoVO.OrderRefundInfo> getOrderRefundInfoList(String orderCode);
/**
* 获取退款明细列表
* @param orderBasicInfo
* @return
*/
List<OrderDetailInfoVO.OrderRefundInfo> getOrderRefundInfoList(OrderBasicInfo orderBasicInfo);
2024-02-26 13:43:02 +08:00
2024-03-11 14:03:24 +08:00
/**
* 根据groupCode查询订单列表
* @param groupCode
* @return
*/
2024-02-26 13:43:02 +08:00
List<OrderBasicInfo> queryOrderListByGroupCode(String groupCode);
/**
* 根据订单编号查询订单详细信息包括充电计费明细
* @param orderCode
* @return
*/
OrderVO getChargeOrderInfoByOrderCode(String orderCode);
/**
* 通过站点id查询订单信息
* @param stationId
* @return
*/
List<SupStationStatsVO> queryOrderListByStationId(String stationId);
2024-07-16 15:33:44 +08:00
/**
* 按占用时间查询订单
* @param dto
* @return
*/
List<OrderListVO> queryOrderByOccupyTime(QueryOrderDTO dto);
/**
* 创建预约启动充电订单
* @param chargingStartupResult
*/
void createReservationOrder(ReservationChargingStartupResult chargingStartupResult);
2024-12-25 14:40:57 +08:00
/**
* 查询第三方平台订单列表
* @param dto
*/
List<OrderVO> selectThirdPartyOrderList(QueryStartChargeDTO dto);
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 后管小程序 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
/**
* 通过站点idList创建时间查询订单数据详情
* @param stationIds
* @param startTime
* @param endTime
*/
List<BusinessOrderDetailInfoVO> getOrderDetailByStationIds(List<String> stationIds, String startTime, String endTime);
2024-07-30 15:26:11 +08:00
2024-08-13 09:59:43 +08:00
BusinessOrderDetailInfoVO getBusinessOrderDetail(String orderCode);
2024-09-23 11:41:19 +08:00
/**
* 根据枪口编号和状态查询订单
* @param pileConnectorCode
* @return
*/
List<OrderBasicInfo> queryOrdersByPileConnectorCodeAndStatus(String pileConnectorCode, String orderStatus, String payStatus);
/**
* 查询订单计费详情
* @param orderCode
*/
List<BusinessOrderBillingInfoVO> getOrderBillingDetail(String orderCode);
/**
* 临时接口根据站点id订单创建时间区间查询订单编号
* @param dto
* @return
*/
List<String> tempGetOrderCodes(QueryOrderDTO dto);
void retryRefundOrderList(List<String> orderCoderList);
2025-03-19 11:53:33 +08:00
2025-03-25 15:16:51 +08:00
/**
* 通过订单编号列表查询订单信息
* @param orderCodeList
* @return
*/
List<AfterSettleOrderDTO> queryAfterSettleOrderDTOList(List<String> orderCodeList);
/**
* 设置订单补缴金额
* @param dto
*/
void setOrderSupplementAmount(OrderSupplementAmountDTO dto);
2024-01-06 15:13:50 +08:00
}