Search in sources :

Example 36 with Permission

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

the class MemberController method add.

/**
 * 新增会员
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Member member, Long cardId) {
    // 添加会员, 判断账号是否重复
    Member memberRe = memberService.selectByMobile(member.getMobile());
    if (memberRe != null) {
        throw new BussinessException(BizExceptionEnum.USER_ALREADY_REG);
    }
    memberService.saveMember(member, cardId);
    return super.SUCCESS_TIP;
}
Also used : Member(com.ikoori.vip.common.persistence.model.Member) 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 37 with Permission

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

the class MemberController method memberUpdate.

/**
 * 跳转到修改会员
 */
@Permission
@RequestMapping("/member_update/{memberId}")
public String memberUpdate(@PathVariable Long memberId, Model model) {
    Member member = memberService.selectById(memberId);
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    MemberCard memberCard = new MemberCard();
    memberCard.setMemberId(member.getId());
    memberCard.setIsDefault(true);
    memberCard = memberCardMapper.selectOne(memberCard);
    model.addAttribute("memberCard", memberCard);
    // 会员卡
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> condition = new HashMap<String, Object>();
    condition.put("merchantId", merchant.getId());
    condition.put("inGrantType", new Object[] { CardGrantType.NO_RULE.getCode(), CardGrantType.SUB_WX.getCode() });
    List<Card> cards = cardService.selectByCondition(condition);
    model.addAttribute("cards", cards);
    model.addAttribute("member", member);
    return PREFIX + "member_edit.html";
}
Also used : MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Member(com.ikoori.vip.common.persistence.model.Member) 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 38 with Permission

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

the class OrderController method list.

/**
 * 获取订单列表
 */
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String memName, Long storeId, String mobile, Long orderSource, String orderNo) {
    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 = orderService.getOrderList(page, memName, page.getOrderByField(), page.isAsc(), merchant.getId(), storeId, mobile, orderSource, orderNo);
    page.setRecords((List<Map<String, Object>>) new OrderWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) OrderWarpper(com.ikoori.vip.server.modular.biz.warpper.OrderWarpper) HashMap(java.util.HashMap) 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 39 with Permission

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

the class CouponCodeController method index.

/**
 * 跳转到券码管理首页
 */
@Permission
@RequestMapping("")
public String index(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("invalid", true);
    List<Coupon> coupons = couponService.selectByCondition(couponCon);
    // 查询优惠群
    model.addAttribute("coupons", coupons);
    model.addAttribute("codeStatus", CouponCodeStatus.values());
    return PREFIX + "couponCode.html";
}
Also used : Coupon(com.ikoori.vip.common.persistence.model.Coupon) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 40 with Permission

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

the class CouponCodeController method export.

/**
 * 导出
 *
 * @Title: queryExcel
 * @param request
 * @param response
 * @param batchNo
 * @param verifyCode
 * @param verifyNo
 * @param couponId
 * @param useStatus
 * @return
 * @throws IOException
 * @date: 2017年10月15日 下午4:03:52
 * @author: chengxg
 */
@Permission
@RequestMapping(value = "/export", method = RequestMethod.GET)
public void export(HttpServletRequest request, HttpServletResponse response, String batchNo, String verifyCode, String verifyNo, Long couponId, Integer useStatus) throws IOException {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().bigPage();
    List<Map<String, Object>> result = couponCodeService.getCouponCodeList(page, batchNo, verifyCode, verifyNo, useStatus, couponId, merchant.getId(), page.getOrderByField(), page.isAsc());
    List<Map<String, Object>> couponCodeList = (List<Map<String, Object>>) (new CouponCodeWarpper(result).warp());
    // 定义导出excel的名字
    String excelName = "券号批量导出表";
    if (StringUtils.isNotBlank(batchNo)) {
        excelName = excelName + "-" + batchNo;
    }
    // 获取需要转出的excle表头的map字段
    LinkedHashMap<String, String> fieldMap = new LinkedHashMap<String, String>();
    fieldMap.put("batchNo", "批次号");
    if (couponId != null) {
        fieldMap.put("couponName", "现金券名称");
    }
    fieldMap.put("verifyNo", "卡号");
    fieldMap.put("verifyCode", "券码");
    // 导出
    PoiExcelUtil.export(excelName, couponCodeList, fieldMap, response);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) List(java.util.List) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) CouponCodeWarpper(com.ikoori.vip.server.modular.biz.warpper.CouponCodeWarpper) LinkedHashMap(java.util.LinkedHashMap) 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