mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
581 lines
17 KiB
Java
581 lines
17 KiB
Java
package com.jsowell.pile.service;
|
||
|
||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||
import com.jsowell.adapay.dto.SplitData;
|
||
import com.jsowell.adapay.response.PaymentConfirmResponse;
|
||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||
import com.jsowell.adapay.vo.OrderSplitResult;
|
||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||
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.OrderInfoDetailVO;
|
||
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;
|
||
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);
|
||
|
||
/**
|
||
* 处理前端传的参数
|
||
* 【公共方法】
|
||
* @param dto
|
||
*/
|
||
void analysisPileParameter(BasicPileDTO dto);
|
||
|
||
/**
|
||
* 校验充电桩相关的信息
|
||
* 【公共方法】
|
||
* @param dto
|
||
*/
|
||
void checkPileInfoForEV(GenerateOrderDTO dto);
|
||
|
||
void checkPileInfoForEBike(GenerateOrderDTO dto);
|
||
|
||
/**
|
||
* 保存订单到数据库 saveOrder2Database
|
||
* 【公共方法】
|
||
* @param dto
|
||
* @return
|
||
* @throws ParseException
|
||
*/
|
||
OrderBasicInfo saveOrderForEV(GenerateOrderDTO dto) throws ParseException;
|
||
|
||
OrderBasicInfo saveOrderForEBike(GenerateOrderDTO dto) throws ParseException;
|
||
|
||
/**
|
||
* 修改订单
|
||
*
|
||
* @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();
|
||
|
||
int closeUnpaidOrders(List<OrderBasicInfo> orderList);
|
||
|
||
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
|
||
*/
|
||
OrderSplitResult doPaymentConfirmWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
|
||
|
||
/**
|
||
* 生成运营商日账单
|
||
* 适用于实时分账后,第二天凌晨生成前一天的账单
|
||
*/
|
||
void generateMerchantBill(String merchantId, String tradeDate);
|
||
|
||
OrderSplitResult doBalancePaymentWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
|
||
|
||
OrderSplitResult realTimeOrderSplit(AfterSettleOrderDTO afterSettleOrderDTO) throws BaseAdaPayException;
|
||
|
||
PaymentConfirmResponse splittingMethod(AfterSettleOrderDTO afterSettleOrderDTO);
|
||
|
||
/**
|
||
* 计算分账数据
|
||
* @param stationSplitConfigList
|
||
* @param afterSettleOrderDTO
|
||
* @return
|
||
*/
|
||
List<SplitData> calculationSplitDataList(List<StationSplitConfig> stationSplitConfigList, AfterSettleOrderDTO afterSettleOrderDTO);
|
||
|
||
// List<DivMember> calculationOfSplitAmount(List<StationSplitConfig> stationSplitConfigList, AfterSettleOrderDTO afterSettleOrderDTO);
|
||
|
||
// List<DivMember> calculationOfSplitAmount(List<StationSplitConfig> stationSplitConfigList, AfterSettleOrderDTO afterSettleOrderDTO, List<PaymentInfo> paymentInfos);
|
||
|
||
void refundMethod(AfterSettleOrderDTO afterSettleOrderDTO);
|
||
|
||
OrderSplitResult verifyOrderConfirmAmount(List<String> paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException;
|
||
|
||
OrderSplitResult verifyOrderConfirmAmountWithCancelSplit(List<String> paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException;
|
||
|
||
/**
|
||
* 批量查询订单
|
||
* @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);
|
||
|
||
/**
|
||
* 获取超过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);
|
||
|
||
OrderInfoDetailVO getOrderInfoDetailVO(String orderCode);
|
||
|
||
OrderInfoDetailVO getOrderInfoDetailVO(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail);
|
||
|
||
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);
|
||
|
||
List<OrderBasicInfo> getReservedOrder(LocalDateTime dateTime);
|
||
|
||
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);
|
||
|
||
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;
|
||
|
||
// Map<String, Object> payOrder(PayOrderDTO dto) throws Exception;
|
||
|
||
/**
|
||
* 订单支付成功 支付回调
|
||
* 支付成功后掉用这个方法
|
||
* 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;
|
||
|
||
OrderSplitResult orderPaymentSettlementAndRefund(OrderBasicInfo orderBasicInfo);
|
||
|
||
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);
|
||
|
||
/**
|
||
* 通过充电结束时间批量查询
|
||
* @param dto
|
||
* @return
|
||
*/
|
||
List<JiangSuOrderInfoVO> getNROrderInfos(NRQueryOrderDTO dto);
|
||
|
||
/**
|
||
* 根据时间端范围查询订单支付单id
|
||
* @param startTime
|
||
* @param endTime
|
||
* @return
|
||
*/
|
||
List<OrderPaymentDetailVO> queryOrderPayDetail(String startTime, String endTime);
|
||
|
||
/**
|
||
* 根据车牌号查询订单信息(宁夏交投 用)
|
||
* @param dto
|
||
* @return
|
||
*/
|
||
List<OrderVO> getOrderInfoByNXJT(NXJTQueryOrdersInfoDTO dto);
|
||
|
||
/**
|
||
* 查询待补缴订单列表
|
||
* @param memberId
|
||
* @return
|
||
*/
|
||
List<OrderBasicInfo> queryRepayOrder(String memberId);
|
||
|
||
/**
|
||
* 获取订单已退款金额
|
||
*/
|
||
BigDecimal getOrderRefundedAmount(String orderCode);
|
||
|
||
/**
|
||
* 通过orderCode获取退款明细列表
|
||
* @param orderCode
|
||
* @return
|
||
*/
|
||
List<OrderDetailInfoVO.OrderRefundInfo> getOrderRefundInfoList(String orderCode);
|
||
|
||
/**
|
||
* 获取退款明细列表
|
||
* @param orderBasicInfo
|
||
* @return
|
||
*/
|
||
List<OrderDetailInfoVO.OrderRefundInfo> getOrderRefundInfoList(OrderBasicInfo orderBasicInfo);
|
||
|
||
/**
|
||
* 根据groupCode查询订单列表
|
||
* @param groupCode
|
||
* @return
|
||
*/
|
||
List<OrderBasicInfo> queryOrderListByGroupCode(String groupCode);
|
||
|
||
/**
|
||
* 根据订单编号查询订单详细信息(包括充电计费明细)
|
||
* @param orderCode
|
||
* @return
|
||
*/
|
||
OrderVO getChargeOrderInfoByOrderCode(String orderCode);
|
||
|
||
/**
|
||
* 通过站点id查询订单信息
|
||
* @param stationId
|
||
* @return
|
||
*/
|
||
List<SupStationStatsVO> queryOrderListByStationId(String stationId);
|
||
|
||
/**
|
||
* 按占用时间查询订单
|
||
* @param dto
|
||
* @return
|
||
*/
|
||
List<OrderListVO> queryOrderByOccupyTime(QueryOrderDTO dto);
|
||
|
||
|
||
/**
|
||
* 创建预约启动充电订单
|
||
* @param chargingStartupResult
|
||
*/
|
||
void createReservationOrder(ReservationChargingStartupResult chargingStartupResult);
|
||
|
||
/**
|
||
* 查询第三方平台订单列表
|
||
* @param dto
|
||
*/
|
||
List<OrderVO> selectThirdPartyOrderList(QueryStartChargeDTO dto);
|
||
|
||
|
||
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 后管小程序 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||
/**
|
||
* 通过站点idList,创建时间查询订单数据详情
|
||
* @param stationIds
|
||
* @param startTime
|
||
* @param endTime
|
||
*/
|
||
List<BusinessOrderDetailInfoVO> getOrderDetailByStationIds(List<String> stationIds, String startTime, String endTime);
|
||
|
||
|
||
BusinessOrderDetailInfoVO getBusinessOrderDetail(String orderCode);
|
||
|
||
/**
|
||
* 根据枪口编号和状态查询订单
|
||
* @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);
|
||
|
||
/**
|
||
* 通过订单编号列表查询订单信息
|
||
* @param orderCodeList
|
||
* @return
|
||
*/
|
||
List<AfterSettleOrderDTO> queryAfterSettleOrderDTOList(List<String> orderCodeList);
|
||
|
||
/**
|
||
* 设置订单补缴金额
|
||
* @param dto
|
||
*/
|
||
void setOrderSupplementAmount(OrderSupplementAmountDTO dto);
|
||
|
||
/**
|
||
* 鉴权并充订单
|
||
* @param dto
|
||
* @return
|
||
*/
|
||
Map<String, Object> verifyMergeChargeOrder(VerifyMergeChargeOrderDTO dto) throws Exception;
|
||
|
||
List<OrderBasicInfo> getOrderBasicInfoByTimeInterval(List<String> stationIds, String startTime, String endTime);
|
||
}
|