Search in sources :

Example 36 with Merchant

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

the class ShareController method add.

/**
 * 新增分享规则
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Share share) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    share.setMerchantId(merchant.getId());
    shareService.saveShare(share);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 37 with Merchant

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

the class SignController method add.

/**
 * 新增签到规则
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Sign sign) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    sign.setMerchantId(merchant.getId());
    signService.insert(sign);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 38 with Merchant

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

the class StoreController method add.

/**
 * 新增门店
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Store store, String pics) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    store.setMerchantId(merchant.getId());
    // storeService.insert(store);
    storeService.saveStore(store, pics);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 39 with Merchant

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

the class StoreController method list.

/**
 * 获取门店列表
 */
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String condition) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<Store> page = new PageFactory<Store>().defaultPage();
    List<Map<String, Object>> result = storeService.getStoreList(page, condition, page.getOrderByField(), page.isAsc(), merchant.getId());
    page.setRecords((List<Store>) new StoreWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) StoreWarpper(com.ikoori.vip.server.modular.biz.warpper.StoreWarpper) Store(com.ikoori.vip.common.persistence.model.Store) 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 40 with Merchant

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

the class MemberServiceImpl method saveMember.

@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public void saveMember(Member member, Long cardId) {
    // 当前登录账号
    Long createUserId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(createUserId);
    /*member.setIsActive(false);*/
    this.insert(member);
    // 获得会员卡
    Card card = cardMapper.selectById(cardId);
    // 会员卡
    MemberCard mc = new MemberCard();
    mc.setMemberId(member.getId());
    mc.setMerchantId(merchant.getId());
    mc.setCardId(cardId);
    mc.setCardNumber(RandomUtil.generateCardNum(card.getCardNumberPrefix()));
    memberCardMapper.insert(mc);
}
Also used : MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Merchant(com.ikoori.vip.common.persistence.model.Merchant) Card(com.ikoori.vip.common.persistence.model.Card) MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Transactional(org.springframework.transaction.annotation.Transactional)

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