|
@@ -70,34 +70,35 @@ public class OrderCommonServiceImpl implements OrderCommonService {
|
|
|
if (relation != null) {
|
|
if (relation != null) {
|
|
|
Boolean isFlag = true;
|
|
Boolean isFlag = true;
|
|
|
Date expiryTime = relation.getExpiryTime();
|
|
Date expiryTime = relation.getExpiryTime();
|
|
|
|
|
+ OrderDon otherOrder = null;
|
|
|
if (orderDon.getOrderType() == 2 || relationIds.size() > 1) {
|
|
if (orderDon.getOrderType() == 2 || relationIds.size() > 1) {
|
|
|
//是否有其他付款订单是否过期
|
|
//是否有其他付款订单是否过期
|
|
|
- OrderDon otherOrder = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
|
|
|
|
+ otherOrder = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.in(OrderDon::getRelationId, relationIds)
|
|
.in(OrderDon::getRelationId, relationIds)
|
|
|
.eq(OrderDon::getUserId, orderDon.getUserId())
|
|
.eq(OrderDon::getUserId, orderDon.getUserId())
|
|
|
.ne(OrderDon::getId, orderDon.getId())
|
|
.ne(OrderDon::getId, orderDon.getId())
|
|
|
.notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
.notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
|
.orderByDesc(OrderDon::getId)
|
|
.orderByDesc(OrderDon::getId)
|
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
|
- if (otherOrder != null) {
|
|
|
|
|
- Long otherSkuId = otherOrder.getSkuId();
|
|
|
|
|
- GoodsDonSku otherGoodsSku = goodsDonSkuMapper.selectById(otherSkuId);
|
|
|
|
|
- DateTime endTime = DateUtil.offsetMonth(otherOrder.getCreatedTime(), otherGoodsSku.getMonths() * num);
|
|
|
|
|
- if (now.isBefore(endTime)) {
|
|
|
|
|
- isFlag = false;
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (otherOrder != null) {
|
|
|
|
|
+ Long otherSkuId = otherOrder.getSkuId();
|
|
|
|
|
+ GoodsDonSku otherGoodsSku = goodsDonSkuMapper.selectById(otherSkuId);
|
|
|
|
|
+ DateTime endTime = DateUtil.offsetMonth(otherOrder.getCreatedTime(), otherGoodsSku.getMonths() * num);
|
|
|
|
|
+ if (now.isBefore(endTime)) {
|
|
|
|
|
+ isFlag = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //座位 过期时间
|
|
|
|
|
+ if (expiryTime != null) {
|
|
|
|
|
+ DateTime refundExpiryTime;
|
|
|
|
|
+ if (sku.getDays() != null && sku.getDays() > 0) {
|
|
|
|
|
+ refundExpiryTime = DateUtil.offsetDay(expiryTime, -sku.getDays() * num);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ refundExpiryTime = DateUtil.offsetMonth(expiryTime, -sku.getMonths() * num);
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- //续费更换后的座位 过期时间
|
|
|
|
|
- if (expiryTime != null) {
|
|
|
|
|
- DateTime refundExpiryTime;
|
|
|
|
|
- if (sku.getDays() != null && sku.getDays() > 0) {
|
|
|
|
|
- refundExpiryTime = DateUtil.offsetDay(expiryTime, -sku.getDays() * num);
|
|
|
|
|
- } else {
|
|
|
|
|
- refundExpiryTime = DateUtil.offsetMonth(expiryTime, -sku.getMonths() * num);
|
|
|
|
|
- }
|
|
|
|
|
- if (now.isBefore(refundExpiryTime)) {
|
|
|
|
|
- isFlag = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (now.isBefore(refundExpiryTime)) {
|
|
|
|
|
+ isFlag = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|