|
|
|
@ -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); |
|
|
|
|