Commit 057f8f2a by 吕明尚

修改小程序是退款的判断

parent 7c3fefce
...@@ -213,9 +213,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -213,9 +213,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
*/ */
@Override @Override
public boolean isRefund(SOrderVo orderVo, SConsumerCoupon coupon) { public boolean isRefund(SOrderVo orderVo, SConsumerCoupon coupon) {
if (coupon != null && !PlatformTypeEnum.SELF.getCode().equals(coupon.getPlatformType())) { // if (coupon != null && !PlatformTypeEnum.SELF.getCode().equals(coupon.getPlatformType())) {
return Boolean.FALSE; // return Boolean.FALSE;
} else if (orderVo != null && OrderStatusEnum.UNUSED.getCode().equals(orderVo.getStatus()) // } else
if (orderVo != null && OrderStatusEnum.UNUSED.getCode().equals(orderVo.getStatus())
&& OrderTypeEnum.RESERVER.getCode().equals(orderVo.getOrderType())) { && OrderTypeEnum.RESERVER.getCode().equals(orderVo.getOrderType())) {
Date startTime = orderVo.getPreStartDate(); Date startTime = orderVo.getPreStartDate();
Date nowTime = cn.hutool.core.date.DateUtil.date(); Date nowTime = cn.hutool.core.date.DateUtil.date();
...@@ -240,9 +241,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -240,9 +241,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
*/ */
@Override @Override
public boolean isRefund(SOrder order, SConsumerCoupon coupon) { public boolean isRefund(SOrder order, SConsumerCoupon coupon) {
if (coupon != null && !PlatformTypeEnum.SELF.getCode().equals(coupon.getPlatformType())) { // if (coupon != null && !PlatformTypeEnum.SELF.getCode().equals(coupon.getPlatformType())) {
return Boolean.FALSE; // return Boolean.FALSE;
} else if (order != null && OrderStatusEnum.UNUSED.getCode().equals(order.getStatus())) { // } else
if (order != null && OrderStatusEnum.UNUSED.getCode().equals(order.getStatus())) {
Date startTime = order.getPreStartDate(); Date startTime = order.getPreStartDate();
Date nowTime = cn.hutool.core.date.DateUtil.date(); Date nowTime = cn.hutool.core.date.DateUtil.date();
if (startTime.compareTo(nowTime) <= 0) { if (startTime.compareTo(nowTime) <= 0) {
...@@ -1155,6 +1157,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1155,6 +1157,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SConsumerCoupon coupon = consumerCouponService.getById(sOrder.getCouponId()); SConsumerCoupon coupon = consumerCouponService.getById(sOrder.getCouponId());
// 判断是否可以退款 // 判断是否可以退款
isRefunds = isRefund(sOrder, coupon); isRefunds = isRefund(sOrder, coupon);
coupon.setUseStatus(UserStatusEnum.UNUSED.getCode());
consumerCouponService.updateById(coupon);
} else { } else {
// 判断是否可以退款 // 判断是否可以退款
isRefunds = isRefund(sOrder, null); isRefunds = isRefund(sOrder, null);
......
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