记录方法 新增收单机构字段

This commit is contained in:
2023-07-13 16:53:14 +08:00
parent f267ac9f34
commit 18f47009a5
7 changed files with 50 additions and 255 deletions

View File

@@ -1,13 +1,10 @@
package com.jsowell.pile.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.jsowell.pile.domain.AdapayCallbackRecord;
public interface AdapayCallbackRecordService {
void saveAdapayCallbackRecord(AdapayCallbackRecord callbackRecord);
void saveAdapayCallbackRecord(String data) throws JsonProcessingException;
AdapayCallbackRecord selectByOrderCode(String orderCode);
AdapayCallbackRecord selectByPaymentId(String paymentId);

View File

@@ -6,18 +6,8 @@ import java.util.List;
public interface IOrderPayRecordService {
// int deleteByPrimaryKey(Integer id);
// int insert(OrderPayRecord record);
// int insertSelective(OrderPayRecord record);
// OrderPayRecord selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(OrderPayRecord record);
// int updateByPrimaryKey(OrderPayRecord record);
/**
* 批量保存订单支付记录
* @param payRecordList

View File

@@ -1,10 +1,5 @@
package com.jsowell.pile.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.StringUtils;
@@ -15,8 +10,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@Slf4j
@Service
public class AdapayCallbackRecordServiceImpl implements AdapayCallbackRecordService {
@@ -32,29 +25,7 @@ public class AdapayCallbackRecordServiceImpl implements AdapayCallbackRecordServ
adapayCallbackRecordMapper.insert(callbackRecord);
}
@Override
public void saveAdapayCallbackRecord(String data) throws JsonProcessingException {
JSONObject jsonObject = JSON.parseObject(data);
ObjectMapper mapper = new ObjectMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
AdapayCallbackRecord adapayCallbackRecord = mapper.readValue(jsonObject.toJSONString(), AdapayCallbackRecord.class);
adapayCallbackRecord.setExpend(jsonObject.getString("expend"));
adapayCallbackRecord.setPaymentId(jsonObject.getString("id"));
JSONObject descJson = JSON.parseObject(adapayCallbackRecord.getDescription());
String type = descJson.getString("type");
adapayCallbackRecord.setPayScenario(type);
String memberId = descJson.getString("memberId");
adapayCallbackRecord.setMemberId(memberId);
String orderCode = descJson.getString("orderCode");
adapayCallbackRecord.setOrderCode(orderCode);
BigDecimal amount = adapayCallbackRecord.getPayAmt();
// 保存到数据库
this.saveAdapayCallbackRecord(adapayCallbackRecord);
}
/**
/**
* 根据订单号查询支付回调信息
* @param orderCode
* @return

View File

@@ -21,6 +21,7 @@ import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.AcquirerEnum;
import com.jsowell.common.enums.MemberWalletEnum;
import com.jsowell.common.enums.ykc.*;
import com.jsowell.common.exception.BusinessException;
@@ -2203,22 +2204,8 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
// 微信支付
dto.setOrderBasicInfo(orderInfo);
// 2023-07-11 全部改为汇付支付
Map<String, Object> weixinMap = adapayPayOrder(dto);
// 从字典中获取使用汇付支付的站点
// List<SysDictData> adapay_station = DictUtils.getDictCache("adapay_station");
// List<String> stationIdList = Lists.newArrayList();
// if (CollectionUtils.isNotEmpty(adapay_station)) {
// for (SysDictData sysDictData : adapay_station) {
// stationIdList.add(sysDictData.getDictValue());
// }
// }
// if (stationIdList.contains(orderInfo.getStationId())) {
// logger.info("该站点:{}在字典中配置了使用汇付支付", orderInfo.getStationId());
// weixinMap = adapayPayOrder(dto);
// } else {
// logger.info("该站点:{}使用微信支付", orderInfo.getStationId());
// weixinMap = wechatPayOrder(dto);
// }
// 返回微信支付参数
resultMap.put("weixinMap", weixinMap);
@@ -2496,6 +2483,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
.orderCode(orderCode)
.payMode(OrderPayRecordEnum.PRINCIPAL_BALANCE_PAYMENT.getValue())
.payAmount(principalPay)
.acquirer(AcquirerEnum.LOCAL.getValue())
.createBy(dto.getMemberId())
.build());
}
@@ -2504,6 +2492,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
.orderCode(orderCode)
.payMode(OrderPayRecordEnum.GIFT_BALANCE_PAYMENT.getValue())
.payAmount(giftPay)
.acquirer(AcquirerEnum.LOCAL.getValue())
.createBy(dto.getMemberId())
.build());
}

View File

@@ -15,35 +15,11 @@ public class OrderPayRecordServiceImpl implements IOrderPayRecordService {
private OrderPayRecordMapper orderPayRecordMapper;
// @Override
// public int deleteByPrimaryKey(Integer id) {
// return orderPayRecordMapper.deleteByPrimaryKey(id);
// }
// @Override
// public int insert(OrderPayRecord record) {
// return orderPayRecordMapper.insert(record);
// }
//
// @Override
// public int insertSelective(OrderPayRecord record) {
// return orderPayRecordMapper.insertSelective(record);
// }
// @Override
// public OrderPayRecord selectByPrimaryKey(Integer id) {
// return orderPayRecordMapper.selectByPrimaryKey(id);
// }
@Override
public int updateByPrimaryKeySelective(OrderPayRecord record) {
return orderPayRecordMapper.updateByPrimaryKeySelective(record);
}
// @Override
// public int updateByPrimaryKey(OrderPayRecord record) {
// return orderPayRecordMapper.updateByPrimaryKey(record);
// }
@Override
public int batchInsert(List<OrderPayRecord> payRecordList) {