Search in sources :

Example 31 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.

the class PointTradeController method index.

/**
 * 跳转到积分明细首页
 */
@RequestMapping("")
public String index(Model model) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    model.addAttribute("points", pointService.getAllPoint(merchant.getId()));
    model.addAttribute("tradeTypes", PointTradeType.values());
    return PREFIX + "pointTrade.html";
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 32 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.

the class RedpackLogController method list.

/**
 * 获取红包记录列表
 */
@RequestMapping(value = "/list")
@ResponseBody
@Permission
public Object list(String billno, String unionid, Integer sendStatus, String sendS, String sendE, Integer redpackId) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
    List<Map<String, Object>> result = redpackLogService.getRedpackLogList(page, merchant.getId(), billno, unionid, sendStatus, sendS, sendE, redpackId, page.getOrderByField(), page.isAsc());
    page.setRecords((List<Map<String, Object>>) new RedpackLogWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) Map(java.util.Map) RedpackLogWarpper(com.ikoori.vip.server.modular.biz.warpper.RedpackLogWarpper) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 33 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.

the class ShareController method shareUpdate.

/**
 * 跳转到修改分享规则
 */
@Permission
@RequestMapping("/share_update/{shareId}")
public String shareUpdate(@PathVariable Long shareId, Model model) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> couponCon = new HashMap<String, Object>();
    couponCon.put("merchantId", merchant.getId());
    couponCon.put("type", CouponType.YHQ.getCode());
    couponCon.put("invalid", true);
    List<Coupon> coupons = couponService.selectByCondition(couponCon);
    Share share = shareService.selectById(shareId);
    model.addAttribute(share);
    // 查询优惠群
    model.addAttribute("coupons", coupons);
    return PREFIX + "share_edit.html";
}
Also used : Coupon(com.ikoori.vip.common.persistence.model.Coupon) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Share(com.ikoori.vip.common.persistence.model.Share) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 34 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.

the class ShareController method shareAdd.

/**
 * 跳转到添加分享规则
 */
@Permission
@RequestMapping("/share_add")
public String shareAdd(Model model) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> couponCon = new HashMap<String, Object>();
    couponCon.put("merchantId", merchant.getId());
    couponCon.put("type", CouponType.YHQ.getCode());
    couponCon.put("invalid", true);
    List<Coupon> coupons = couponService.selectByCondition(couponCon);
    // 查询优惠群
    model.addAttribute("coupons", coupons);
    return PREFIX + "share_add.html";
}
Also used : Coupon(com.ikoori.vip.common.persistence.model.Coupon) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 35 with Merchant

use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.

the class ShareController method update.

/**
 * 修改分享规则
 */
@RequestMapping(value = "/update")
@Permission
@ResponseBody
public Object update(Share share) {
    if (ToolUtil.isEmpty(share) || share.getId() == null) {
        throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
    }
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    share.setMerchantId(merchant.getId());
    shareService.saveShare(share);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) BussinessException(com.ikoori.vip.common.exception.BussinessException) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

Merchant (com.ikoori.vip.common.persistence.model.Merchant)66 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)59 Permission (com.ikoori.vip.common.annotion.Permission)55 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)35 HashMap (java.util.HashMap)29 Map (java.util.Map)20 Store (com.ikoori.vip.common.persistence.model.Store)12 Card (com.ikoori.vip.common.persistence.model.Card)11 BussinessException (com.ikoori.vip.common.exception.BussinessException)8 Coupon (com.ikoori.vip.common.persistence.model.Coupon)7 MemberCard (com.ikoori.vip.common.persistence.model.MemberCard)7 LinkedHashMap (java.util.LinkedHashMap)4 JSONObject (com.alibaba.fastjson.JSONObject)3 Ticket (com.ikoori.vip.common.persistence.model.Ticket)3 User (com.ikoori.vip.common.persistence.model.User)3 Transactional (org.springframework.transaction.annotation.Transactional)3 Member (com.ikoori.vip.common.persistence.model.Member)2 Picture (com.ikoori.vip.common.persistence.model.Picture)2 StoreCoupon (com.ikoori.vip.common.persistence.model.StoreCoupon)2 CouponCodeWarpper (com.ikoori.vip.server.modular.biz.warpper.CouponCodeWarpper)2