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;
}
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";
}
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);
}
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";
}
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);
}
Aggregations