use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class TicketController method ticketAdd.
/**
* 跳转到添加小票
*/
@Permission
@RequestMapping("/ticket_add")
public String ticketAdd(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());
List<Store> stores = storeService.selectByCondition(condition);
// 查询店铺
model.addAttribute("stores", stores);
model.addAttribute("specType", SpecType.values());
return PREFIX + "ticket_add.html";
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class TicketController method checkStore.
/**
* 验证店铺是否已经添加小票
* @return Object
*/
@RequestMapping("/checkStore")
@Permission(Const.MERCHANT_NAME)
@ResponseBody
public Object checkStore(Long storeId, Long ticketId) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
/*List<Store> stores = storeService.selectStore(merchant.getId());
if(stores!=null && !stores.isEmpty()){
return "true";
}else{
return "flase";
}*/
return ticketService.checkTicket(ticketId, storeId, merchant.getId());
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class CardController method checkName.
/**
* 验证会员卡名称是否存在
* @return
*/
@RequestMapping("/checkName")
@Permission(Const.MERCHANT_NAME)
@ResponseBody
public Object checkName(Long id, String cardName) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
return cardService.checkCardName(id, cardName, merchant.getId());
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class CardController method checkLevel.
/**
* 验证会员卡级别是否存在
* @return
*/
@RequestMapping("/checkLevel")
@Permission(Const.MERCHANT_NAME)
@ResponseBody
public Object checkLevel(Long id, Integer cardLevel) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
return cardService.checkCardLevel(id, cardLevel, merchant.getId());
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class CouponController method add.
/**
* 新增优惠券
*/
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Coupon coupon, String storeIds) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
coupon.setMerchantId(merchant.getId());
coupon.setCreateUserId(userId);
coupon.setStock(coupon.getTotal());
couponService.saveCoupon(coupon, storeIds);
return super.SUCCESS_TIP;
}
Aggregations