mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-18 00:38:33 +08:00
update 分账方法
This commit is contained in:
@@ -58,6 +58,9 @@ public class TempController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISettleOrderReportService settleOrderReportService;
|
private ISettleOrderReportService settleOrderReportService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileMerchantInfoService pileMerchantInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 临时刷数据接口
|
* 临时刷数据接口
|
||||||
* http://localhost:8080/temp/tempUpdateVirtualAmount
|
* http://localhost:8080/temp/tempUpdateVirtualAmount
|
||||||
@@ -197,7 +200,8 @@ public class TempController extends BaseController {
|
|||||||
if (orderBasicInfo == null || adapayMemberAccount == null) {
|
if (orderBasicInfo == null || adapayMemberAccount == null) {
|
||||||
throw new BusinessException("", "查询信息为空");
|
throw new BusinessException("", "查询信息为空");
|
||||||
}
|
}
|
||||||
orderBasicInfoService.doPaymentConfirm(orderBasicInfo, adapayMemberAccount);
|
String appId = pileMerchantInfoService.queryAppIdByMerchantId(orderBasicInfo.getMerchantId());
|
||||||
|
orderBasicInfoService.doPaymentConfirm(orderBasicInfo, adapayMemberAccount, appId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("临时接口交易确认接口 error,", e);
|
logger.error("临时接口交易确认接口 error,", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WEIXIN_REFUND_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WEIXIN_REFUND_ERROR);
|
||||||
|
|||||||
@@ -162,9 +162,9 @@ public interface IOrderBasicInfoService {
|
|||||||
* @return
|
* @return
|
||||||
* @throws BaseAdaPayException
|
* @throws BaseAdaPayException
|
||||||
*/
|
*/
|
||||||
OrderSettleResult doPaymentConfirm(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount) throws BaseAdaPayException;
|
OrderSettleResult doPaymentConfirm(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量查询订单
|
* 批量查询订单
|
||||||
* @param orderCodeList
|
* @param orderCodeList
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -998,6 +998,8 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
clearingBillInfo.setMerchantId(orderReport.getMerchantId());
|
clearingBillInfo.setMerchantId(orderReport.getMerchantId());
|
||||||
clearingBillInfo.setOrderSource("1");
|
clearingBillInfo.setOrderSource("1");
|
||||||
|
|
||||||
|
String appId = pileMerchantInfoService.queryAppIdByMerchantId(orderReport.getMerchantId());
|
||||||
|
|
||||||
// 应收金额
|
// 应收金额
|
||||||
BigDecimal receivableAmount = BigDecimal.ZERO;
|
BigDecimal receivableAmount = BigDecimal.ZERO;
|
||||||
// 应清分金额
|
// 应清分金额
|
||||||
@@ -1020,7 +1022,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
orderSettleResult = doBalancePayment(orderBasicInfo, adapayMemberAccount);
|
orderSettleResult = doBalancePayment(orderBasicInfo, adapayMemberAccount);
|
||||||
} else {
|
} else {
|
||||||
// 在线支付,进行支付确认分账
|
// 在线支付,进行支付确认分账
|
||||||
orderSettleResult = doPaymentConfirm(orderBasicInfo, adapayMemberAccount);
|
orderSettleResult = doPaymentConfirm(orderBasicInfo, adapayMemberAccount, appId);
|
||||||
}
|
}
|
||||||
if (orderSettleResult != null && AdapayStatusEnum.SUCCEEDED.getValue().equals(orderSettleResult.getStatus())) {
|
if (orderSettleResult != null && AdapayStatusEnum.SUCCEEDED.getValue().equals(orderSettleResult.getStatus())) {
|
||||||
// 应收金额 = 订单结算金额汇总
|
// 应收金额 = 订单结算金额汇总
|
||||||
@@ -1098,6 +1100,8 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String appId = pileMerchantInfoService.queryAppIdByMerchantId(merchantId);
|
||||||
|
|
||||||
// 根据交易日期查询运营商下面所有站点的交易日报
|
// 根据交易日期查询运营商下面所有站点的交易日报
|
||||||
List<SettleOrderReport> stationReportList = settleOrderReportService.selectByMerchantIdAndDate(merchantId, tradeDate);
|
List<SettleOrderReport> stationReportList = settleOrderReportService.selectByMerchantIdAndDate(merchantId, tradeDate);
|
||||||
for (SettleOrderReport orderReport : stationReportList) {
|
for (SettleOrderReport orderReport : stationReportList) {
|
||||||
@@ -1124,7 +1128,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
// orderSettleResult = doBalancePayment(orderBasicInfo, adapayMemberAccount);
|
// orderSettleResult = doBalancePayment(orderBasicInfo, adapayMemberAccount);
|
||||||
} else {
|
} else {
|
||||||
// 在线支付,进行支付确认分账
|
// 在线支付,进行支付确认分账
|
||||||
orderSettleResult = doPaymentConfirm(orderBasicInfo, adapayMemberAccount);
|
orderSettleResult = doPaymentConfirm(orderBasicInfo, adapayMemberAccount, appId);
|
||||||
}
|
}
|
||||||
// if (orderSettleResult != null && AdapayStatusEnum.SUCCEEDED.getValue().equals(orderSettleResult.getStatus())) {
|
// if (orderSettleResult != null && AdapayStatusEnum.SUCCEEDED.getValue().equals(orderSettleResult.getStatus())) {
|
||||||
// JSONObject jsonObject = JSON.parseObject(orderSettleResult.getDescription());
|
// JSONObject jsonObject = JSON.parseObject(orderSettleResult.getDescription());
|
||||||
@@ -1239,7 +1243,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
* @throws BaseAdaPayException
|
* @throws BaseAdaPayException
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public OrderSettleResult doPaymentConfirm(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount) throws BaseAdaPayException {
|
public OrderSettleResult doPaymentConfirm(OrderBasicInfo orderBasicInfo, AdapayMemberAccount adapayMemberAccount, String wechatAppId) throws BaseAdaPayException {
|
||||||
// 查询订单的交易id
|
// 查询订单的交易id
|
||||||
AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderBasicInfo.getOrderCode());
|
AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderBasicInfo.getOrderCode());
|
||||||
if (adapayCallbackRecord == null) {
|
if (adapayCallbackRecord == null) {
|
||||||
@@ -1269,7 +1273,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
divMember.setAmount(settleAmount);
|
divMember.setAmount(settleAmount);
|
||||||
divMember.setFee_flag(Constants.Y);
|
divMember.setFee_flag(Constants.Y);
|
||||||
confirmParams.put("div_members", Lists.newArrayList(divMember));
|
confirmParams.put("div_members", Lists.newArrayList(divMember));
|
||||||
Map<String, Object> paymentConfirm = PaymentConfirm.create(confirmParams);
|
Map<String, Object> paymentConfirm = PaymentConfirm.create(confirmParams, wechatAppId);
|
||||||
logger.info("调分账接口param:{}, result:{}", JSON.toJSONString(confirmParams), JSON.toJSONString(paymentConfirm));
|
logger.info("调分账接口param:{}, result:{}", JSON.toJSONString(confirmParams), JSON.toJSONString(paymentConfirm));
|
||||||
|
|
||||||
// 分账接口返回的信息
|
// 分账接口返回的信息
|
||||||
|
|||||||
Reference in New Issue
Block a user