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