diff --git a/hai-service/src/main/java/com/hai/entity/HighOrder.java b/hai-service/src/main/java/com/hai/entity/HighOrder.java index 87eba376..89f50ac9 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -125,6 +125,16 @@ public class HighOrder implements Serializable { private List highChildOrderList; + private HighDiscount highDiscount; + + public HighDiscount getHighDiscount() { + return highDiscount; + } + + public void setHighDiscount(HighDiscount highDiscount) { + this.highDiscount = highDiscount; + } + public List getHighChildOrderList() { return highChildOrderList; } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java index ebfa787e..b1f5490a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java @@ -11,6 +11,7 @@ import com.hai.dao.HighCouponCodeMapperExt; import com.hai.entity.*; import com.hai.model.UserInfoModel; import com.hai.service.HighCouponCodeService; +import com.hai.service.HighCouponService; import com.hai.service.HighOrderService; import com.hai.service.HighUserCouponService; import org.apache.commons.collections4.MapUtils; @@ -42,6 +43,9 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { @Resource private HighOrderService highOrderService; + @Resource + private HighCouponService highCouponService; + @Resource private HighUserCouponService highUserCouponService; @@ -87,6 +91,15 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_CODE_OVERDUE, ""); } + // 卡券信息 + HighCoupon coupon = highCouponService.getCouponById(salesCode.getCouponId()); + if (coupon == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_DISCOUNT, ""); + } + // 卡券来源:1.中石化 + if (coupon.getCouponSource() == 1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "此卡券无法消核"); + } salesCode.setStoreId(userInfoModel.getMerchantStore().getId()); salesCode.setConsumeTime(new Date()); salesCode.setStatus(3); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 1ed1cdb4..f698fa71 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -349,6 +349,12 @@ public class HighCouponServiceImpl implements HighCouponService { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); } + if (MapUtils.getInteger(map, "couponSource") != null) { + criteria.andCouponSourceEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andCouponSourceNotEqualTo(2); + } + example.setOrderByClause("create_time desc"); List coupons = highCouponMapper.selectByExample(example); if (coupons != null && coupons.size() > 0) { diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 0d441ee8..fab67a21 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -264,6 +264,9 @@ public class HighOrderServiceImpl implements HighOrderService { return null; } order.setHighChildOrderList(getChildOrderByOrder(order.getId())); + if (order.getMemDiscountId() != null) { + order.setHighDiscount(highDiscountUserRelService.getRelById(order.getMemDiscountId()).getHighDiscount()); + } return order; } @@ -383,8 +386,6 @@ public class HighOrderServiceImpl implements HighOrderService { criteria.andMemIdEqualTo(memId); criteria.andOrderStatusEqualTo(status); - - return highOrderMapper.selectByExample(example).size(); }