Merge branch 'dev/dev_xp' into dev/dev

This commit is contained in:
2024-12-19 14:04:28 +08:00
8 changed files with 27 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import java.util.List;
public interface PaymentInfoMapper extends BaseMapper<PaymentInfo> {
List<OrderListVO> selectPageOrderList(Long accountId, String startTime, String endTime, int offset, int pageSize);
List<OrderListVO> selectPageOrderList(Long accountId, String startTime, String endTime, int offset, int pageSize, Long id);
int queryOrderListTotalCount(Long accountId, String startTime, String endTime);
int queryOrderListTotalCount(Long accountId, String startTime, String endTime, Long id);
}

View File

@@ -16,4 +16,7 @@ public class QueryPageByTimeDTO extends PageQueryBaseVo {
@ApiModelProperty("结束时间 yyyy-mm-dd hh:mm:ss 可以不要时分秒")
private String endTime;
@ApiModelProperty("指定id")
private Long id;
}

View File

@@ -10,6 +10,9 @@ public class SubscriptionEmailParamsDTO {
// t_payment_info id每次支付对于用户来说是一笔新订单
private String orderId;
// 链接到订单列表的某个订单
private String orderRef;
// 订单支付创建日期
private String createDate;
@@ -48,7 +51,5 @@ public class SubscriptionEmailParamsDTO {
// 付款失败原因
private String failMessage;
private String accountPageRef;
}

View File

@@ -355,12 +355,13 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
}
int offset = (queryPageByTimeDTO.getPage() - 1) * queryPageByTimeDTO.getSize();
List<OrderListVO> orderListVOS = baseMapper.selectPageOrderList(accountId, startTime, endTime, offset, queryPageByTimeDTO.getSize());
List<OrderListVO> orderListVOS = baseMapper.selectPageOrderList(accountId, startTime, endTime, offset,
queryPageByTimeDTO.getSize(), queryPageByTimeDTO.getId());
if (CollectionUtils.isEmpty(orderListVOS)) {
return PageBaseResponse.success(new Page<>());
}else {
int totalCount = baseMapper.queryOrderListTotalCount(accountId, startTime, endTime);
int totalCount = baseMapper.queryOrderListTotalCount(accountId, startTime, endTime, queryPageByTimeDTO.getId());
IPage<OrderListVO> orderListVOIPage = new Page<>();
Integer size = queryPageByTimeDTO.getSize();
orderListVOIPage.setSize(size);

View File

@@ -72,6 +72,9 @@ public class StripeServiceImpl implements StripeService {
@Value("${stripe.webhook-sign-secret}")
private String signSecret;
@Value("${orderList.link}")
private String orderListLink;
@Override
@Transactional(rollbackFor = Exception.class)
public String pay(ProductPurchaseDTO productPurchaseDTO) {
@@ -834,6 +837,7 @@ public class StripeServiceImpl implements StripeService {
emailParamsDTO.setUsername(userName);
emailParamsDTO.setOrderId(paymentInfo.getId().toString());
emailParamsDTO.setOrderRef("\"" + orderListLink + paymentInfo.getId().toString() + "\"");
emailParamsDTO.setCreateDate(String.valueOf(paymentInfo.getCreateTime()).replace("T", " "));
emailParamsDTO.setQuantity(String.valueOf(1));
emailParamsDTO.setTotalFee(paymentInfo.getPayerTotal().toString());
@@ -936,8 +940,6 @@ public class StripeServiceImpl implements StripeService {
emailParamsDTO.setQuantity(String.valueOf(1));
emailParamsDTO.setTotalFee(paymentInfo.getPayerTotal().toString());
setSubscriptionParams(paymentInfo, subscriptionInfo, orderByOrderNo, emailParamsDTO);
// todo
emailParamsDTO.setAccountPageRef("\"https://www.aida.com.hk/home/homePage\"");
// 4、发邮件
SendEmailUtil.subscriptionEmailReminder("fail_renewal", emailParamsDTO, language, account.getUserEmail());