Search in sources :

Example 26 with Merchant

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

the class MemberCardController method index.

/**
 * 跳转到领取记录首页
 */
@Permission
@RequestMapping("")
public String index(Model model) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> condition = new HashMap<String, Object>();
    condition.put("merchantId", merchant.getId());
    model.addAttribute("grantType", CardGrantType.values());
    model.addAttribute("state", MemCardState.values());
    // 查询会员卡
    List<Card> cards = cardService.selectByCondition(condition);
    model.addAttribute("cards", cards);
    return PREFIX + "memberCard.html";
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Card(com.ikoori.vip.common.persistence.model.Card) MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 27 with Merchant

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

the class MerchantController method merchantUpdate.

/**
 * 跳转到修改商户
 */
@Permission
@RequestMapping("/merchant_update/{merchantId}")
public String merchantUpdate(@PathVariable Long merchantId, Model model) {
    log.info("--merchantId---", merchantId);
    try {
        Merchant merchant = merchantMapper.selectById(merchantId);
        model.addAttribute(merchant);
    } catch (Exception e) {
        e.printStackTrace();
        log.info("", e);
    }
    return PREFIX + "merchant_edit.html";
}
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)

Example 28 with Merchant

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

the class MerchantController method list.

/**
 * 获取商户列表
 */
@Permission
@RequestMapping(value = "/list", method = RequestMethod.POST)
@ResponseBody
public Object list(@RequestParam(name = "merName", required = false) String merName) {
    Page<Merchant> page = new PageFactory<Merchant>().defaultPage();
    List<Map<String, Object>> result = merchantDao.getMerchantList(page, merName, page.getOrderByField(), page.isAsc());
    page.setRecords((List<Merchant>) new MerchantWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) MerchantWarpper(com.ikoori.vip.server.modular.biz.warpper.MerchantWarpper) Map(java.util.Map) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 29 with Merchant

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

the class MerchantController method detail.

/**
 * 商户详情
 */
@Permission
@RequestMapping(value = "/merchant_detail/{merchantId}")
public Object detail(@PathVariable Long merchantId, Model model) {
    Merchant merchant = merchantMapper.selectById(merchantId);
    model.addAttribute(merchant);
    return PREFIX + "merchant_detail.html";
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 30 with Merchant

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

the class PointTradeController method list.

/**
 * 获取积分明细列表
 */
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String nickname, String mobile, Integer inOut, Long pointId, Integer tradeType) {
    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 = pointTradeService.getPointTradeList(page, nickname, mobile, inOut, pointId, merchant.getId(), tradeType, page.getOrderByField(), page.isAsc());
    page.setRecords((List<Map<String, Object>>) new PointTradeWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) PointTradeWarpper(com.ikoori.vip.server.modular.biz.warpper.PointTradeWarpper) Map(java.util.Map) 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