记得上下班打卡 | git大法好,push需谨慎

Commit 4219ca8c authored by jiangxiulong's avatar jiangxiulong

临时退款手续费

parent 03752d30
......@@ -40,6 +40,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
......@@ -404,6 +405,34 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
if (refundSinglePrice.compareTo(BigDecimal.ZERO) <= 0) {
return "申请金额不得小于0";
}
// 临时手续费
if (orderTicketVo.getPerformanceId().equals("245383231370444809122956")) {
// 手续费比例
float chargesNum = 0.0f;
// 票种演出开始时间
String useStart = orderTicketEntitiesVo.getUseStart();
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime useStartD = LocalDateTime.parse(useStart, df);
// 3、15天之前的时间
LocalDateTime useStartD15Before = useStartD.minusDays(15);
LocalDateTime useStartD3Before = useStartD.minusDays(3);
// 当前时间
LocalDateTime nowTime = LocalDateTime.now();
if (useStartD15Before.isBefore(nowTime)) { // 15天以前的时间大于当前时间 距离演出开始日期>15天
chargesNum = 0.1f;
} else if (useStartD3Before.isBefore(nowTime)) { // 3天以前的时间大于当前时间 距离演出开始日期>3天-15天 含15天
chargesNum = 0.5f;
} else { // 三天以内 <=3
return "票种距离演出开始日期不大于3天,不支持退票";
}
refundSinglePrice = refundSinglePrice.subtract(refundSinglePrice.multiply(BigDecimal.valueOf(chargesNum)));
if (refundSinglePrice.compareTo(BigDecimal.ZERO) <= 0) {
return "去除手续费申请金额不得小于0";
}
}
// 临时手续费 end
Map token = CurrentUtil.getTokenClaims();
String username = StringUtils.defaultString(((String) token.get("nickname")), "");
String result = refundsStatusService.userOrderTicketRefunding(orderTicketVo, refundSinglePrice.doubleValue(), orderTicketEntitiesId, reason, picList, uid, username, kylinOrderRefundsVoBaseList.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment