@RequireHardLogIn
@RequestMapping(value = "/coupon/notification/{code}", method = RequestMethod.GET)
@ResponseBody
public String setNotification(@RequestParam("notificationStatus") final boolean notificationStatus,
@PathVariable("code") final String code, final Model model, final RedirectAttributes redirectModel)
throws CMSItemNotFoundException
{
if (notificationStatus)
{
customerCouponFacade.removeCouponNotificationByCode(code);
}
else
{
customerCouponFacade.saveCouponNotification(code);
}
return "success";
}
@RequireHardLogIn
@RequestMapping(value = "/coupon/notification/{code}", method = RequestMethod.GET)
@ResponseBody
public String setNotification(@RequestParam("isNotificationOn") final boolean isNotificationOn,
@PathVariable("code") final String code, final Model model, final RedirectAttributes redirectModel)
throws CMSItemNotFoundException
{
if (isNotificationOn)
{
customerCouponFacade.removeCouponNotificationByCode(code);
}
else
{
customerCouponFacade.saveCouponNotification(code);
}
return "success";
}
@Override
public List<PromotionSourceRuleModel> findExPromotionSourceRuleByProduct(final String productCode)
{
validateParameterNotNull(productCode, "Product code must not be null");
final FlexibleSearchQuery query = new FlexibleSearchQuery(FIND_EXCLUDED_PROMOTION_RULE_FOR_PRODUCT);
query.addQueryParameter("productCode", productCode);
return getFlexibleSearchService().<PromotionSourceRuleModel> search(query).getResult();
}
@Override
public List<PromotionSourceRuleModel> findExcluPromotionSourceRuleByProduct(final String productCode)
{
validateParameterNotNull(productCode, "Product code must not be null");
final FlexibleSearchQuery query = new FlexibleSearchQuery(FIND_EXCLUDED_PROMOTION_RULE_FOR_PRODUCT);
query.addQueryParameter("productCode", productCode);
return getFlexibleSearchService().<PromotionSourceRuleModel> search(query).getResult();
}
protected List<PromotionSourceRuleModel> getBindedPromotionSourceRuleByProduct(final ProductModel product)
{
final List<PromotionSourceRuleModel> promotionSourceRuleList = new ArrayList<>();
promotionSourceRuleList.addAll(getCustomerCouponService().getPromotionSourceRulesForProduct(product.getCode()));
getCategoryDao().findCategoriesByCatalogVersionAndProduct(product.getCatalogVersion(), product).stream()
.forEach(category -> {
final Collection<CategoryModel> superCategorys = categoryService.getAllSupercategoriesForCategory(category)
.isEmpty() ? new ArrayList<>() : categoryService.getAllSupercategoriesForCategory(category);
superCategorys.add(category);
protected List<PromotionSourceRuleModel> getBindingPromotionSourceRuleByProduct(final ProductModel product)
{
final List<PromotionSourceRuleModel> promotionSourceRuleList = new ArrayList<>();
promotionSourceRuleList.addAll(getCustomerCouponService().getPromotionSourceRulesForProduct(product.getCode()));
getCategoryDao().findCategoriesByCatalogVersionAndProduct(product.getCatalogVersion(), product).stream()
.forEach(category -> {
final Collection<CategoryModel> superCategorys = categoryService.getAllSupercategoriesForCategory(category)
.isEmpty() ? new ArrayList<>() : categoryService.getAllSupercategoriesForCategory(category);
superCategorys.add(category);
couponNotifications.stream().forEach(couponNotification -> {
if (couponNotification.getStatus().equals(CouponNotificationStatus.EXPIRESENT))
final boolean isCustomerCouponAssigned = getCustomerCouponDao().checkCustomerCouponAsignedForCustomer(
couponNotification.getCustomerCoupon().getCouponId(), couponNotification.getCustomer());
couponNotifications.stream().forEach(couponNotification -> {
if (couponNotification.getStatus().equals(CouponNotificationStatus.EXPIRESENT))
final boolean isUnassignedCoupon = getCustomerCouponDao().checkCustomerCouponAsignedForCustomer(
couponNotification.getCustomerCoupon().getCouponId(), couponNotification.getCustomer());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |