Commit 057f8f2a by 吕明尚

修改小程序是退款的判断

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