mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-29 07:25:05 +08:00
update
This commit is contained in:
@@ -1,382 +0,0 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||||
import com.jsowell.adapay.vo.OrderSettleResult;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.SettleOrderReport;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
|
||||
import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
|
||||
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.NROrderInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderVO;
|
||||
import com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.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;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2022-09-30
|
||||
*/
|
||||
public interface IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 条件查询订单基础信息
|
||||
* @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);
|
||||
|
||||
public OrderBasicInfo saveOrder2Database(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);
|
||||
|
||||
/**
|
||||
* 根据交易记录结算订单
|
||||
* @param data 交易记录数据
|
||||
* @param orderBasicInfo
|
||||
* @deprecated 该方法废弃 {@link AbstractProgramLogic#settleOrder(TransactionRecordsData, OrderBasicInfo)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
void settleOrder(TransactionRecordsData data, OrderBasicInfo orderBasicInfo);
|
||||
|
||||
/**
|
||||
* 关闭15分钟未支付订单
|
||||
* @return
|
||||
*/
|
||||
int close15MinutesOfUnpaidOrders();
|
||||
|
||||
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
|
||||
*/
|
||||
OrderSettleResult doPaymentConfirmWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
|
||||
|
||||
OrderSettleResult doBalancePaymentWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, 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);
|
||||
|
||||
/**
|
||||
* 获取超过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);
|
||||
|
||||
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> getAppointmentOrder(LocalDateTime dateTime);
|
||||
|
||||
Map<String, Object> generateOrderByCard(GenerateOrderDTO dto) throws Exception;
|
||||
|
||||
/**
|
||||
* 联联平台 获取累计数据用
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<AccumulativeInfoVO> getAccumulativeInfoForLianLian(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 联联平台生成订单
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> generateOrderForLianLian(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;
|
||||
|
||||
void analysisPileParameter(BasicPileDTO dto);
|
||||
|
||||
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;
|
||||
|
||||
OrderSettleResult 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
|
||||
*/
|
||||
NROrderInfoVO getNROrderInfoByOrderCode(String orderCode);
|
||||
|
||||
/**
|
||||
* 通过充电结束时间批量查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<NROrderInfoVO> getNROrderInfos(NRQueryOrderDTO dto);
|
||||
|
||||
List<OrderPayDetailVO> queryOrderPayDetail(String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 根据车牌号查询订单信息(宁夏交投 用)
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<OrderVO> getOrderInfoByNXJT(NXJTQueryOrdersInfoDTO dto);
|
||||
}
|
||||
@@ -0,0 +1,399 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||||
import com.jsowell.adapay.vo.OrderSettleResult;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.SettleOrderReport;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
|
||||
import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
|
||||
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.NROrderInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderVO;
|
||||
import com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.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);
|
||||
|
||||
public OrderBasicInfo saveOrder2Database(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);
|
||||
|
||||
/**
|
||||
* 根据交易记录结算订单
|
||||
* @param data 交易记录数据
|
||||
* @param orderBasicInfo
|
||||
* @deprecated 该方法废弃 {@link AbstractProgramLogic#settleOrder(TransactionRecordsData, OrderBasicInfo)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
void settleOrder(TransactionRecordsData data, OrderBasicInfo orderBasicInfo);
|
||||
|
||||
/**
|
||||
* 关闭15分钟未支付订单
|
||||
* @return
|
||||
*/
|
||||
int close15MinutesOfUnpaidOrders();
|
||||
|
||||
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
|
||||
*/
|
||||
OrderSettleResult doPaymentConfirmWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
|
||||
|
||||
OrderSettleResult doBalancePaymentWithDelay(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, 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);
|
||||
|
||||
/**
|
||||
* 获取超过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);
|
||||
|
||||
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> getAppointmentOrder(LocalDateTime dateTime);
|
||||
|
||||
Map<String, Object> generateOrderByCard(GenerateOrderDTO dto) throws Exception;
|
||||
|
||||
/**
|
||||
* 联联平台 获取累计数据用
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<AccumulativeInfoVO> getAccumulativeInfoForLianLian(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 联联平台生成订单
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> generateOrderForLianLian(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;
|
||||
|
||||
void analysisPileParameter(BasicPileDTO dto);
|
||||
|
||||
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;
|
||||
|
||||
OrderSettleResult 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
|
||||
*/
|
||||
NROrderInfoVO getNROrderInfoByOrderCode(String orderCode);
|
||||
|
||||
/**
|
||||
* 通过充电结束时间批量查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<NROrderInfoVO> getNROrderInfos(NRQueryOrderDTO dto);
|
||||
|
||||
List<OrderPayDetailVO> queryOrderPayDetail(String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 根据车牌号查询订单信息(宁夏交投 用)
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<OrderVO> getOrderInfoByNXJT(NXJTQueryOrdersInfoDTO dto);
|
||||
|
||||
}
|
||||
@@ -80,7 +80,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2022-09-30
|
||||
*/
|
||||
@Service
|
||||
public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@@ -615,7 +615,8 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 清除订单缓存 订单编号或交易流水号 任意传一个
|
||||
* @param orderCode 订单编号
|
||||
*
|
||||
* @param orderCode 订单编号
|
||||
* @param transactionCode 交易流水号
|
||||
*/
|
||||
@Override
|
||||
@@ -837,6 +838,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
* 延迟商家订单退款处理逻辑
|
||||
* 例如:举视以及下面的二级运营商
|
||||
* 因为在结算时还没有到分账的时间,先解冻需要退款的金额,并退款
|
||||
*
|
||||
* @param orderBasicInfo 订单信息
|
||||
* @param adapayMemberAccount 汇付用户信息
|
||||
* @param wechatAppId 小程序appId
|
||||
@@ -1025,6 +1027,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 通过站点id修改运营商id
|
||||
*
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
@@ -1035,6 +1038,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 通过订单编号获取南瑞平台所需要的订单数据信息
|
||||
*
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@@ -1053,6 +1057,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 通过充电结束时间批量查询
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -1433,6 +1438,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算余额扣除金额
|
||||
*
|
||||
@@ -1517,8 +1523,9 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 校验订单分账金额
|
||||
* @param paymentIds 支付id集合
|
||||
* @param orderCode 订单编号
|
||||
*
|
||||
* @param paymentIds 支付id集合
|
||||
* @param orderCode 订单编号
|
||||
* @param settleAmount 结算金额
|
||||
*/
|
||||
private OrderSettleResult verifyOrderConfirmAmount(List<String> paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException {
|
||||
@@ -1683,8 +1690,8 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
* 余额支付 计算需要退回的金额
|
||||
*
|
||||
* @param principalPay 本金支付金额
|
||||
* @param giftPay 赠送金额支付的金额
|
||||
* @param orderAmount 订单消费金额
|
||||
* @param giftPay 赠送金额支付的金额
|
||||
* @param orderAmount 订单消费金额
|
||||
* @return
|
||||
*/
|
||||
private Map<String, BigDecimal> calculateReturnAmount(BigDecimal principalPay, BigDecimal giftPay, BigDecimal orderAmount) {
|
||||
@@ -1805,10 +1812,10 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
String transactionIdentifier = data.getTransactionIdentifier();
|
||||
String startMode = null;
|
||||
if (StringUtils.equals(transactionIdentifier, "01")) {
|
||||
startMode = StartModeEnum.APP.getValue();
|
||||
startMode = StartModeEnum.APP.getValue();
|
||||
} else if (StringUtils.equals(transactionIdentifier, "02")) {
|
||||
// 鉴权卡启动
|
||||
startMode = StartModeEnum.AUTH_CARD.getValue();
|
||||
// 鉴权卡启动
|
||||
startMode = StartModeEnum.AUTH_CARD.getValue();
|
||||
orderBasicInfo.setLogicCard(data.getLogicCard());
|
||||
} else if (StringUtils.equals(transactionIdentifier, "04")) {
|
||||
// 离线卡启动
|
||||
@@ -2090,6 +2097,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
/**
|
||||
* 校验未支付订单
|
||||
* 如果存在因为未收到支付回调导致超时关闭的订单,在修改订单状态后,检查一下是否支付过,把支付的金额退款
|
||||
*
|
||||
* @param orderBasicInfo
|
||||
*/
|
||||
private void checkUnpaidOrder(OrderBasicInfo orderBasicInfo) {
|
||||
@@ -3216,6 +3224,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
/**
|
||||
* 余额支付订单逻辑
|
||||
* 去除赠送金额相关的代码
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
// private void balancePayOrder(PayOrderDTO dto) {
|
||||
@@ -3309,7 +3318,6 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
// orderPayRecordService.batchInsert(payRecordList);
|
||||
// }
|
||||
// }
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void balancePayOrderV2(PayOrderDTO dto) {
|
||||
String orderCode = dto.getOrderCode(); // 订单编号
|
||||
@@ -3549,6 +3557,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 根据车牌号查询订单信息(宁夏交投 用)
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -3556,4 +3565,60 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
public List<OrderVO> getOrderInfoByNXJT(NXJTQueryOrdersInfoDTO dto) {
|
||||
return orderBasicInfoMapper.getOrderInfoByNXJT(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return orderBasicInfoMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(OrderBasicInfo record) {
|
||||
return orderBasicInfoMapper.insert(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdate(OrderBasicInfo record) {
|
||||
return orderBasicInfoMapper.insertOrUpdate(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOrUpdateSelective(OrderBasicInfo record) {
|
||||
return orderBasicInfoMapper.insertOrUpdateSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(OrderBasicInfo record) {
|
||||
return orderBasicInfoMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderBasicInfo selectByPrimaryKey(Integer id) {
|
||||
return orderBasicInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKeySelective(OrderBasicInfo record) {
|
||||
return orderBasicInfoMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKey(OrderBasicInfo record) {
|
||||
return orderBasicInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatch(List<OrderBasicInfo> list) {
|
||||
return orderBasicInfoMapper.updateBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatchSelective(List<OrderBasicInfo> list) {
|
||||
return orderBasicInfoMapper.updateBatchSelective(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsert(List<OrderBasicInfo> list) {
|
||||
return orderBasicInfoMapper.batchInsert(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import com.jsowell.pile.dto.GetInvoiceInfoDTO;
|
||||
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
|
||||
import com.jsowell.pile.mapper.OrderInvoiceRecordMapper;
|
||||
import com.jsowell.pile.service.IMemberInvoiceTitleService;
|
||||
import com.jsowell.pile.service.IOrderBasicInfoService;
|
||||
import com.jsowell.pile.service.IOrderInvoiceRecordService;
|
||||
import com.jsowell.pile.service.OrderBasicInfoService;
|
||||
import com.jsowell.pile.util.UserUtils;
|
||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||
import com.jsowell.pile.vo.uniapp.InvoiceTitleVO;
|
||||
@@ -37,7 +37,7 @@ public class OrderInvoiceRecordServiceImpl implements IOrderInvoiceRecordService
|
||||
private IMemberInvoiceTitleService memberInvoiceTitleService;
|
||||
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
/**
|
||||
* 查询申请开票
|
||||
|
||||
@@ -36,7 +36,7 @@ public class OrderPayRecordServiceImpl implements OrderPayRecordService {
|
||||
private IMemberTransactionRecordService memberTransactionRecordService;
|
||||
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
|
||||
private IPileBasicInfoService pileBasicInfoService;
|
||||
|
||||
@Resource
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Resource
|
||||
private IPileBillingTemplateService pileBillingTemplateService;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
||||
private IPileModelInfoService pileModelInfoService;
|
||||
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private IPileStationInfoService pileStationInfoService;
|
||||
|
||||
@@ -86,7 +86,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
||||
private IThirdPartyParkingConfigService parkingConfigService;
|
||||
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class AbstractProgramLogic implements InitializingBean {
|
||||
protected String ADAPAY_CALLBACK_URL;
|
||||
|
||||
@Resource
|
||||
protected IOrderBasicInfoService orderBasicInfoService;
|
||||
protected OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
protected IPileBasicInfoService pileBasicInfoService;
|
||||
|
||||
Reference in New Issue
Block a user