Search in sources :

Example 41 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class CouponCodeController method update.

/**
 * 根据批次号修改券号状态为“已制卡”
 */
@RequestMapping(value = "/update")
@Permission
@ResponseBody
public Object update(@RequestParam String ids) {
    if (ToolUtil.isEmpty(ids)) {
        throw new BussinessException(500, "请选择数据");
    }
    String[] as = ids.split(",");
    Long[] codeIds = new Long[as.length];
    for (int i = 0; i < as.length; i++) {
        codeIds[i] = Long.valueOf(as[i]);
    }
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("ids", codeIds);
    params.put("merchantId", merchant.getId());
    params.put("useStatus", CouponCodeStatus.madecard.getCode());
    couponCodeService.updateUseStatus(params);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) 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)

Example 42 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class CouponCodeController method couponCodeUpdate.

/**
 * 跳转到修改券码管理
 */
@Permission
@RequestMapping("/couponCode_update/{couponCodeId}")
public String couponCodeUpdate(@PathVariable Long couponCodeId, Model model) {
    CouponCode couponCode = couponCodeService.selectById(couponCodeId);
    model.addAttribute(couponCode);
    return PREFIX + "couponCode_edit.html";
}
Also used : CouponCode(com.ikoori.vip.common.persistence.model.CouponCode) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 43 with Permission

use of com.ikoori.vip.common.annotion.Permission 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 44 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class MemberCardController method memberCardUpdate.

/**
 * 跳转到修改领取记录
 */
@Permission
@RequestMapping("/memberCard_update/{memberCardId}")
public String memberCardUpdate(@PathVariable Long memberCardId, Model model) {
    MemberCard memberCard = memberCardService.selectById(memberCardId);
    model.addAttribute(memberCard);
    return PREFIX + "memberCard_edit.html";
}
Also used : MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 45 with Permission

use of com.ikoori.vip.common.annotion.Permission 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)

Aggregations

Permission (com.ikoori.vip.common.annotion.Permission)93 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)92 Merchant (com.ikoori.vip.common.persistence.model.Merchant)55 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)47 HashMap (java.util.HashMap)31 Map (java.util.Map)23 BussinessException (com.ikoori.vip.common.exception.BussinessException)18 Store (com.ikoori.vip.common.persistence.model.Store)12 Coupon (com.ikoori.vip.common.persistence.model.Coupon)11 Card (com.ikoori.vip.common.persistence.model.Card)9 MemberCard (com.ikoori.vip.common.persistence.model.MemberCard)6 StoreCoupon (com.ikoori.vip.common.persistence.model.StoreCoupon)6 User (com.ikoori.vip.common.persistence.model.User)6 ShiroUser (com.ikoori.vip.server.core.shiro.ShiroUser)4 LinkedHashMap (java.util.LinkedHashMap)4 BussinessLog (com.ikoori.vip.common.annotion.log.BussinessLog)3 OperationLog (com.ikoori.vip.common.persistence.model.OperationLog)3 WxConfig (com.ikoori.vip.common.persistence.model.WxConfig)3 LogWarpper (com.ikoori.vip.server.modular.system.warpper.LogWarpper)3 EntityWrapper (com.baomidou.mybatisplus.mapper.EntityWrapper)2