查询各平台交易记录
This commit is contained in:
@@ -1256,7 +1256,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
private static final String QUERY_CUSTOMER_EMAIL = "SELECT username, email, country FROM pmr_wc_customer_lookup " +
|
||||
"WHERE customer_id = ? ";
|
||||
private static final String UPDATE_ORDER_STATUS = "UPDATE pmr_wc_order_stats " +
|
||||
"SET status = 'wc-complete' , date_completed = ? " +
|
||||
"SET status = 'wc-completed' , date_completed = ? " +
|
||||
"WHERE order_id = ?";
|
||||
|
||||
private static final DataSource dataSource;
|
||||
|
||||
@@ -211,7 +211,7 @@ public class AliPayServiceImpl implements AliPayService {
|
||||
//更新订单状态
|
||||
orderInfoService.updateStatusByOrderNo(orderNo, OrderStatusEnum.SUCCESS);
|
||||
//记录支付日志
|
||||
paymentInfoService.createPaymentInfoForAliPay(params);
|
||||
paymentInfoService.createPaymentInfoForAliPay(params,"credits");
|
||||
float quantity = Float.parseFloat(totalAmount) / Float.parseFloat(CreditsEventsEnum.PRICE.getValue());
|
||||
// 更新积分
|
||||
creditsService.buyCredits(orderByOrderNo.getAccountId(), quantity);
|
||||
@@ -315,7 +315,7 @@ public class AliPayServiceImpl implements AliPayService {
|
||||
//如果订单已支付,则更新商户端订单状态
|
||||
orderInfoService.updateStatusByOrderNo(orderNo, OrderStatusEnum.SUCCESS);
|
||||
//并记录支付日志
|
||||
paymentInfoService.createPaymentInfoForAliPay(alipayTradeQueryResponse);
|
||||
paymentInfoService.createPaymentInfoForAliPay(alipayTradeQueryResponse, "credits");
|
||||
float quantity = orderByOrderNo.getTotalFee() / Float.parseFloat(CreditsEventsEnum.PRICE.getValue());
|
||||
// 更新积分
|
||||
creditsService.buyCredits(orderByOrderNo.getAccountId(), quantity);
|
||||
|
||||
@@ -245,7 +245,7 @@ public class AlipayHKServiceImpl implements AlipayHKService {
|
||||
orderInfoService.updateStatusByOrderNo(orderNo, OrderStatusEnum.SUCCESS);
|
||||
log.info("Alipay-HK 订单:{} 状态更新成功",orderNo);
|
||||
//记录支付日志
|
||||
paymentInfoService.createPaymentInfoForAliPayHK(alipayHKCallbackDTO);
|
||||
paymentInfoService.createPaymentInfoForAliPayHK(alipayHKCallbackDTO, "credits");
|
||||
log.info("Alipay-HK 订单:{} 支付信息状态更新成功",orderNo);
|
||||
float quantity = Float.parseFloat(totalAmount) / Float.parseFloat(CreditsEventsEnum.PRICE.getValue());
|
||||
// 更新积分
|
||||
|
||||
@@ -4,19 +4,16 @@ import com.ai.da.common.config.exception.BusinessException;
|
||||
import com.ai.da.common.constant.CommonConstant;
|
||||
import com.ai.da.common.context.UserContext;
|
||||
import com.ai.da.common.enums.CreditsEventsEnum;
|
||||
import com.ai.da.common.response.PageBaseResponse;
|
||||
import com.ai.da.common.utils.CopyUtil;
|
||||
import com.ai.da.mapper.primary.AccountMapper;
|
||||
import com.ai.da.mapper.primary.QuestionnaireMapper;
|
||||
import com.ai.da.mapper.primary.ToProductImageResultMapper;
|
||||
import com.ai.da.mapper.primary.TrialOrderMapper;
|
||||
import com.ai.da.mapper.primary.*;
|
||||
import com.ai.da.mapper.primary.entity.Account;
|
||||
import com.ai.da.mapper.primary.entity.Questionnaire;
|
||||
import com.ai.da.mapper.primary.entity.TrialOrder;
|
||||
import com.ai.da.model.dto.AccountAddDTO;
|
||||
import com.ai.da.model.dto.QueryPaymentInfoDTO;
|
||||
import com.ai.da.model.enums.Language;
|
||||
import com.ai.da.model.vo.QuestionnaireFeedbackVO;
|
||||
import com.ai.da.model.vo.QuestionnaireVO;
|
||||
import com.ai.da.model.vo.QueryUserConditionsVO;
|
||||
import com.ai.da.model.vo.*;
|
||||
import com.ai.da.service.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -43,9 +40,22 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
|
||||
@Resource
|
||||
private AccountService accountService;
|
||||
|
||||
@Resource
|
||||
private AccountLoginLogService accountLoginLogService;
|
||||
@Resource
|
||||
private GenerateService generateService;
|
||||
@Resource
|
||||
private ToProductImageResultMapper toProductImageResultMapper;
|
||||
@Resource
|
||||
private DesignService designService;
|
||||
@Resource
|
||||
private DesignItemService designItemService;
|
||||
@Resource
|
||||
private ChatRobotService chatRobotService;
|
||||
@Resource
|
||||
private TrialOrderMapper trialOrderMapper;
|
||||
@Resource
|
||||
private PaymentInfoMapper paymentInfoMapper;
|
||||
|
||||
public IPage<TrialOrder> getTrial(QueryUserConditionsVO queryUserConditionsVO) {
|
||||
log.info("getTrial parameter : {},page:{}, size:{}", queryUserConditionsVO, queryUserConditionsVO.getPage(), queryUserConditionsVO.getSize());
|
||||
@@ -323,17 +333,6 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
return accountIds.size();
|
||||
}
|
||||
|
||||
@Resource
|
||||
private GenerateService generateService;
|
||||
@Resource
|
||||
private ToProductImageResultMapper toProductImageResultMapper;
|
||||
@Resource
|
||||
private DesignService designService;
|
||||
@Resource
|
||||
private DesignItemService designItemService;
|
||||
@Resource
|
||||
private ChatRobotService chatRobotService;
|
||||
|
||||
public Map<String, List<Object>> getActiveUserFunc(String startTime, String endTime, List<Long> ids) {
|
||||
|
||||
log.info("getActiveUserFunc ==> startTime:{}, endTime:{}, accountList:{}", startTime, endTime, ids);
|
||||
@@ -388,9 +387,6 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Resource
|
||||
private TrialOrderMapper trialOrderMapper;
|
||||
|
||||
// 试用用户到正式用户的转化率
|
||||
public Map<String, Object> conversionRate(String startTime, String endTime) {
|
||||
|
||||
@@ -457,7 +453,6 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
return resp;
|
||||
}
|
||||
|
||||
|
||||
// 新增用户
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean addUser(AccountAddDTO accountAddDTO) {
|
||||
@@ -618,5 +613,35 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
// return maps.stream().map(map -> (Long)map.get("id")).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询交易记录
|
||||
* 允许按日期,支付方式,支付金额,商品种类,交易状态,付款人的国家或城市查询,需要分页查询
|
||||
*/
|
||||
public PageBaseResponse<PaymentInfoVO> queryTransactionRecords(QueryPaymentInfoDTO queryPaymentInfoDTO) {
|
||||
Integer size = queryPaymentInfoDTO.getSize();
|
||||
int offset = (queryPaymentInfoDTO.getPage() - 1) * size;
|
||||
List<PaymentInfoVO> paymentInfoVOS = paymentInfoMapper.queryPaymentInfo(queryPaymentInfoDTO.getPlatform(), queryPaymentInfoDTO.getPayerTotal(),
|
||||
queryPaymentInfoDTO.getType(), queryPaymentInfoDTO.getStatus(),
|
||||
queryPaymentInfoDTO.getCountry(), queryPaymentInfoDTO.getCity(),
|
||||
queryPaymentInfoDTO.getStartTime(), queryPaymentInfoDTO.getEndTime(),
|
||||
size, offset);
|
||||
// 查询数据总量
|
||||
Long total = paymentInfoMapper.queryPaymentInfoCount(queryPaymentInfoDTO.getPlatform(), queryPaymentInfoDTO.getPayerTotal(),
|
||||
queryPaymentInfoDTO.getType(), queryPaymentInfoDTO.getStatus(),
|
||||
queryPaymentInfoDTO.getCountry(), queryPaymentInfoDTO.getCity(),
|
||||
queryPaymentInfoDTO.getStartTime(), queryPaymentInfoDTO.getEndTime());
|
||||
|
||||
// 总页数
|
||||
double totalPage = Math.ceil((double) total / size);
|
||||
// 组装返回参数
|
||||
PageBaseResponse<PaymentInfoVO> response = new PageBaseResponse<>();
|
||||
response.setContent(paymentInfoVOS);
|
||||
response.setPage(queryPaymentInfoDTO.getPage());
|
||||
response.setSize(size);
|
||||
response.setTotal(total);
|
||||
response.setPages((long) totalPage);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -586,7 +586,7 @@ public class PayPalCheckoutServiceImpl implements PayPalCheckoutService {
|
||||
//更新订单状态
|
||||
orderInfoService.updateStatusByOrderNo(orderNo, OrderStatusEnum.SUCCESS);
|
||||
//记录支付日志
|
||||
paymentInfoService.createPaymentInfoForPayPal(capturedOrder);
|
||||
paymentInfoService.createPaymentInfoForPayPal(capturedOrder, "credits");
|
||||
float quantity = orderInfo.getTotalFee() / Float.parseFloat(CreditsEventsEnum.PRICE.getValue());
|
||||
// 更新积分
|
||||
creditsService.buyCredits(orderInfo.getAccountId(), quantity);
|
||||
@@ -629,7 +629,7 @@ public class PayPalCheckoutServiceImpl implements PayPalCheckoutService {
|
||||
//如果订单已支付,则更新商户端订单状态
|
||||
orderInfoService.updateStatusByOrderNo(orderNo, OrderStatusEnum.SUCCESS);
|
||||
//并记录支付日志
|
||||
paymentInfoService.createPaymentInfoForPayPal(result);
|
||||
paymentInfoService.createPaymentInfoForPayPal(result, "credits");
|
||||
float quantity = orderByOrderNo.getTotalFee() / Float.parseFloat(CreditsEventsEnum.PRICE.getValue());
|
||||
// 更新积分
|
||||
// creditsService.buyCredits(orderByOrderNo.getAccountId(),orderByOrderNo.getTotalFee() / Integer.parseInt(CreditsEventsEnum.PRICE.getValue()));
|
||||
|
||||
@@ -89,7 +89,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
* @param params
|
||||
*/
|
||||
@Override
|
||||
public void createPaymentInfoForAliPay(Map<String, String> params) {
|
||||
public void createPaymentInfoForAliPay(Map<String, String> params, String type) {
|
||||
|
||||
log.info("记录支付日志");
|
||||
|
||||
@@ -111,6 +111,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
paymentInfo.setTradeState(tradeStatus);
|
||||
// 原来的单位是分 Int 现改为元 Long
|
||||
paymentInfo.setPayerTotal(totalAmountInt / 100.0F);
|
||||
paymentInfo.setType(type);
|
||||
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(params, HashMap.class);
|
||||
@@ -126,7 +127,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPaymentInfoForPayPal(Order order) {
|
||||
public void createPaymentInfoForPayPal(Order order, String type) {
|
||||
|
||||
log.info("记录支付日志");
|
||||
|
||||
@@ -140,6 +141,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
paymentInfo.setTradeState(order.status());
|
||||
// 确认这里的数据单位是不是元
|
||||
paymentInfo.setPayerTotal(totalAmountFloat);
|
||||
paymentInfo.setType(type);
|
||||
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(order, Order.class);
|
||||
@@ -155,7 +157,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPaymentInfoForAliPayHK(AlipayHKCallbackDTO alipayHKCallbackDTO) {
|
||||
public void createPaymentInfoForAliPayHK(AlipayHKCallbackDTO alipayHKCallbackDTO, String type) {
|
||||
|
||||
log.info("记录支付日志");
|
||||
|
||||
@@ -176,6 +178,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
paymentInfo.setTransactionId(transactionId);
|
||||
paymentInfo.setTradeState(tradeStatus);
|
||||
paymentInfo.setPayerTotal(totalAmountFloat);
|
||||
paymentInfo.setType(type);
|
||||
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(alipayHKCallbackDTO);
|
||||
|
||||
Reference in New Issue
Block a user