mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-03 17:40:13 +08:00
update 未分账支付单分到默认账户
This commit is contained in:
@@ -833,6 +833,9 @@ public class AdapayService {
|
||||
}
|
||||
String jsonString = JSON.toJSONString(paymentConfirm);
|
||||
log.info("调分账接口param:{}, result:{}", JSON.toJSONString(confirmParams), jsonString);
|
||||
|
||||
// 删除支付确认信息缓存
|
||||
redisCache.deleteObject(CacheConstants.PAYMENT_CONFIRM_LIST + paymentId);
|
||||
return JSONObject.parseObject(jsonString, PaymentConfirmResponse.class);
|
||||
}
|
||||
|
||||
@@ -1000,6 +1003,15 @@ public class AdapayService {
|
||||
* 查询支付确认对象列表
|
||||
*/
|
||||
public QueryPaymentConfirmDetailResponse queryPaymentConfirmList(QueryPaymentConfirmDTO dto) {
|
||||
QueryPaymentConfirmDetailResponse response = null;
|
||||
// 查缓存
|
||||
String redisKey = CacheConstants.PAYMENT_CONFIRM_LIST + dto.getPaymentId();
|
||||
String redisResult = redisCache.getCacheObject(redisKey);
|
||||
if (StringUtils.isNotBlank(redisResult)) {
|
||||
response = JSONObject.parseObject(redisResult, QueryPaymentConfirmDetailResponse.class);
|
||||
return response;
|
||||
}
|
||||
|
||||
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId());
|
||||
if (config == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
|
||||
@@ -1008,15 +1020,15 @@ public class AdapayService {
|
||||
param.put("payment_id", dto.getPaymentId());
|
||||
param.put("app_id", config.getAdapayAppId());
|
||||
|
||||
QueryPaymentConfirmDetailResponse queryPaymentConfirmDetailResponse = null;
|
||||
try {
|
||||
Map<String, Object> map = PaymentConfirm.queryList(param, config.getWechatAppId());
|
||||
queryPaymentConfirmDetailResponse = JSON.parseObject(JSON.toJSONString(map), QueryPaymentConfirmDetailResponse.class);
|
||||
response = JSON.parseObject(JSON.toJSONString(map), QueryPaymentConfirmDetailResponse.class);
|
||||
// log.info("queryPaymentConfirmDetailResponse:{}", JSON.toJSONString(queryPaymentConfirmDetailResponse));
|
||||
redisCache.setCacheObject(redisKey, JSON.toJSONString(response), CacheConstants.cache_expire_time_10d);
|
||||
} catch (BaseAdaPayException e) {
|
||||
log.error("查询支付确认对象列表error", e);
|
||||
}
|
||||
return queryPaymentConfirmDetailResponse;
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,46 +51,6 @@ public class AdapayMemberAccount extends BaseEntity {
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setMerchantId(String merchantId) {
|
||||
this.merchantId = merchantId;
|
||||
}
|
||||
|
||||
public String getMerchantId() {
|
||||
return merchantId;
|
||||
}
|
||||
|
||||
public void setAdapayMemberId(String adapayMemberId) {
|
||||
this.adapayMemberId = adapayMemberId;
|
||||
}
|
||||
|
||||
public String getAdapayMemberId() {
|
||||
return adapayMemberId;
|
||||
}
|
||||
|
||||
public void setSettleAccountId(String settleAccountId) {
|
||||
this.settleAccountId = settleAccountId;
|
||||
}
|
||||
|
||||
public String getSettleAccountId() {
|
||||
return settleAccountId;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
|
||||
|
||||
@@ -25,4 +25,6 @@ public interface AdapayCallbackRecordMapper {
|
||||
AdapayCallbackRecord selectByPaymentId(String paymentId);
|
||||
|
||||
List<AdapayCallbackRecord> queryRecordList(@Param("orderCodeList") List<String> orderCodeList);
|
||||
|
||||
List<AdapayCallbackRecord> selectByDateTime(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.nanrui.NROrderInfo;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
||||
@@ -13,6 +12,7 @@ import com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.SendMessageVO;
|
||||
import com.jsowell.pile.vo.web.IndexOrderInfoVO;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
import com.jsowell.pile.vo.web.OrderPayDetailVO;
|
||||
import com.jsowell.pile.vo.web.RefundOrder;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -256,4 +256,6 @@ public interface OrderBasicInfoMapper {
|
||||
* @return
|
||||
*/
|
||||
List<NROrderInfoVO> getNROrderInfoByOrderCode(@Param("dto") NRQueryOrderDTO dto);
|
||||
|
||||
List<OrderPayDetailVO> queryOrderPayDetail(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,14 @@ package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.AdapayCallbackRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AdapayCallbackRecordService {
|
||||
void saveAdapayCallbackRecord(AdapayCallbackRecord callbackRecord);
|
||||
|
||||
AdapayCallbackRecord selectByOrderCode(String orderCode);
|
||||
|
||||
AdapayCallbackRecord selectByPaymentId(String paymentId);
|
||||
|
||||
List<AdapayCallbackRecord> selectByDateTime(String startTime, String endTime);
|
||||
}
|
||||
|
||||
@@ -70,4 +70,6 @@ public interface IAdapayMemberAccountService {
|
||||
void deleteByMemberId(String memberId);
|
||||
|
||||
void updateAdapayMemberAccountByMemberId(AdapayMemberAccount adapayMemberAccount);
|
||||
|
||||
AdapayMemberAccount getDefault();
|
||||
}
|
||||
|
||||
@@ -5,8 +5,10 @@ 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.*;
|
||||
import com.jsowell.pile.domain.nanrui.NROrderInfo;
|
||||
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.service.orderlogic.AbstractOrderLogic;
|
||||
@@ -18,10 +20,7 @@ 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.BalanceDeductionAmountVO;
|
||||
import com.jsowell.pile.vo.web.IndexOrderInfoVO;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
import com.jsowell.pile.vo.web.OrderTotalDataVO;
|
||||
import com.jsowell.pile.vo.web.*;
|
||||
import com.jsowell.wxpay.response.WechatPayRefundResponse;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -370,4 +369,6 @@ public interface IOrderBasicInfoService {
|
||||
* @return
|
||||
*/
|
||||
List<NROrderInfoVO> getNROrderInfos(NRQueryOrderDTO dto);
|
||||
|
||||
List<OrderPayDetailVO> queryOrderPayDetail(String startTime, String endTime);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AdapayCallbackRecordServiceImpl implements AdapayCallbackRecordService {
|
||||
@@ -75,4 +77,9 @@ public class AdapayCallbackRecordServiceImpl implements AdapayCallbackRecordServ
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdapayCallbackRecord> selectByDateTime(String startTime, String endTime) {
|
||||
return adapayCallbackRecordMapper.selectByDateTime(startTime, endTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
@@ -161,4 +162,11 @@ public class AdapayMemberAccountServiceImpl implements IAdapayMemberAccountServi
|
||||
public void updateAdapayMemberAccountByMemberId(AdapayMemberAccount adapayMemberAccount) {
|
||||
adapayMemberAccountMapper.updateAdapayMemberAccountByMemberId(adapayMemberAccount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdapayMemberAccount getDefault() {
|
||||
AdapayMemberAccount account = new AdapayMemberAccount();
|
||||
account.setAdapayMemberId(Constants.ZERO);
|
||||
return account;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3378,4 +3378,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
||||
return orderBasicInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间端范围查询订单支付单id
|
||||
*/
|
||||
@Override
|
||||
public List<OrderPayDetailVO> queryOrderPayDetail(String startTime, String endTime) {
|
||||
return orderBasicInfoMapper.queryOrderPayDetail(startTime, endTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.jsowell.pile.vo.web;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class OrderPayDetailVO {
|
||||
// 订单编号
|
||||
private String orderCode;
|
||||
|
||||
// 订单创建时间
|
||||
private String createTime;
|
||||
|
||||
// 运营商id
|
||||
private String merchantId;
|
||||
|
||||
// 支付金额
|
||||
private BigDecimal payAmount;
|
||||
|
||||
// 退款金额
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
// 结算金额
|
||||
private BigDecimal settleAmount;
|
||||
|
||||
// 结算时间
|
||||
private String settlementTime;
|
||||
|
||||
// 支付id
|
||||
private String paymentId;
|
||||
}
|
||||
@@ -305,4 +305,12 @@
|
||||
#{orderCode,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectByDateTime" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from adapay_callback_record
|
||||
where del_flag = '0'
|
||||
and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1196,4 +1196,23 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryOrderPayDetail" resultType="com.jsowell.pile.vo.web.OrderPayDetailVO">
|
||||
select
|
||||
t1.order_code as orderCode,
|
||||
t1.create_time as createTime,
|
||||
t1.settlement_time as settlementTime,
|
||||
t1.`pay_amount` as payAmount,
|
||||
t1.refund_amount as refundAmount,
|
||||
t1.settle_amount as settleAmount,
|
||||
t1.refund_amount as refundAmount,
|
||||
t1.merchant_id as merchantId,
|
||||
t2.payment_id as paymentId
|
||||
from order_basic_info t1
|
||||
join adapay_callback_record t2 on t1.order_code = t2.order_code
|
||||
where t1.`del_flag` = '0'
|
||||
and t1.settlement_time BETWEEN #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
||||
and t1.settle_amount > 0.00
|
||||
and t1.pay_mode = '4'
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user