课程复读订单退款(relearn)

This commit is contained in:
wyn
2026-06-22 17:23:25 +08:00
parent 54069c6810
commit 60e507b750
4 changed files with 13 additions and 8 deletions

View File

@@ -487,6 +487,8 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
refundableStatus = true;
}
}
}else if("relearn".equals(b.getOrderType()) && paymentDateTime > timestamp-7*24*60*60*1000){
refundableStatus = true;
}
if(b.getOrderStatus().equals(Constants.ORDER_STATUS_REFUND)){
BuyOrderRefund refundInfo = buyOrderRefundService.getRefundInfoByOrderId(b.getOrderId());

View File

@@ -183,6 +183,7 @@ public class CourseRelearnController {
String timeId = IdWorker.getTimeId().substring(0, 32);
buyOrder.setOrderSn(timeId);
buyOrder.setUserId(uid);
buyOrder.setPaymentDate(new Date());
buyOrderService.save(buyOrder);
BigDecimal totalPrice = buyOrder.getRealMoney();
//虚拟币支付

View File

@@ -56,8 +56,8 @@ public class JfTransactionDetailsController {
@Transactional
public R activityDonateJF(){
StringBuffer sb = new StringBuffer();
String startTime = "2025-11-08 00:00:00";
String endTime = "2025-11-13 09:22:00";
String startTime = "2026-06-18 00:00:00";
String endTime = "2026-06-22 10:06:59";
//查询时间段内所有充值的人
List<TransactionDetailsEntity> list = transactionDetailsService.list(new LambdaQueryWrapper<TransactionDetailsEntity>()
.between(TransactionDetailsEntity::getCreateTime,startTime,endTime)
@@ -76,7 +76,7 @@ public class JfTransactionDetailsController {
//时间段内获得的积分
Map<String,Object> jftd = jfService.getMap(new MPJLambdaWrapper<JfTransactionDetails>()
.eq(JfTransactionDetails::getUserId,transactionDetail.getUserId())
.like(JfTransactionDetails::getRemark,"双11")
.like(JfTransactionDetails::getRemark,"618活动充值")
.between(JfTransactionDetails::getCreateTime,startTime,endTime)
.gt(TransactionDetailsEntity::getChangeAmount,0)
.selectSum(TransactionDetailsEntity::getChangeAmount));
@@ -114,19 +114,19 @@ public class JfTransactionDetailsController {
new BigDecimal(changeAmount.toString()).compareTo(new BigDecimal(1000))>=0||
new BigDecimal(changeAmount.toString()).compareTo(new BigDecimal(500))>=0){
if (new BigDecimal(changeAmount.toString()).compareTo(new BigDecimal(5000))>=0){
shouldJf = shouldJf.add(new BigDecimal(2500));
shouldJf = shouldJf.add(new BigDecimal(2000));
changeAmount = changeAmount.subtract(new BigDecimal(5000));
}else if (new BigDecimal(changeAmount.toString()).compareTo(new BigDecimal(3000))>=0){
shouldJf = shouldJf.add(new BigDecimal(1300));
shouldJf = shouldJf.add(new BigDecimal(1000));
changeAmount = changeAmount.subtract(new BigDecimal(3000));
}else if (new BigDecimal(changeAmount.toString()).compareTo(new BigDecimal(2000))>=0){
shouldJf = shouldJf.add(new BigDecimal(800));
shouldJf = shouldJf.add(new BigDecimal(600));
changeAmount = changeAmount.subtract(new BigDecimal(2000));
}else if (new BigDecimal(changeAmount.toString()).compareTo(new BigDecimal(1000))>=0){
shouldJf = shouldJf.add(new BigDecimal(300));
shouldJf = shouldJf.add(new BigDecimal(240));
changeAmount = changeAmount.subtract(new BigDecimal(1000));
}else if (new BigDecimal(changeAmount.toString()).compareTo(new BigDecimal(500))>=0){
shouldJf = shouldJf.add(new BigDecimal(120));
shouldJf = shouldJf.add(new BigDecimal(100));
changeAmount = changeAmount.subtract(new BigDecimal(500));
}
return chgf(changeJf,shouldJf,changeAmount,jf);

View File

@@ -148,6 +148,8 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
List<ExpressOrder> expressOrders = expressOrderDao.selectList(new LambdaQueryWrapper<ExpressOrder>().in(ExpressOrder::getId, collect));
b.setExpressList(expressOrders);
}
}else if("relearn".equals(b.getOrderType()) && paymentDateTime > timestamp-7*24*60*60*1000){
refundableStatus = true;
}
b.setRefundableStatus(b.getOrderStatus().equals("6") || b.getOrderStatus().equals("7")?false:refundableStatus);
}