use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class MerchantServiceImpl method getMerchantUserId.
@Cacheable(value = Cache.MERCHANT, key = "'" + CacheKey.SINGLE_MERCHANT + "'+#userId")
public Merchant getMerchantUserId(Long userId) {
Merchant merchant = new Merchant();
merchant.setUserId(userId);
return merchantMapper.selectOne(merchant);
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class MemberCardApiImpl method getMemberCardByUnionid.
@Override
public JSONObject getMemberCardByUnionid(String unionid) {
log.info("进入getMemberCardByUnionid>>unionid=" + unionid);
Member member = memberDao.getMemberByUnionid(unionid);
if (member == null) {
log.info("member == null");
return null;
}
MemberCard memberCard = memberCardDao.getMemberCard(member.getId());
if (memberCard == null) {
log.info("memberCard == null");
return null;
}
Merchant merchant = memberCard.getMerchant();
Card card = memberCard.getCard();
if (merchant == null || card == null) {
log.info("merchant == null || card == null");
return null;
}
JSONObject obj = new JSONObject();
obj.put("coverType", card.getCoverType());
obj.put("coverPic", card.getCoverPic());
obj.put("colorCode", ColorType.valOf(card.getColorCode()));
obj.put("merchantName", merchant.getName());
obj.put("merchantLogo", merchant.getHeadImg());
obj.put("cardName", card.getName());
obj.put("cardNum", memberCard.getCardNumber());
log.info("结束getMemberCardByUnionid");
return obj;
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class StoreEmployeeController method index.
/**
* 跳转到员工管理首页
*/
@Permission
@RequestMapping("")
public String index(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("roles", RoleType.values());
return PREFIX + "storeEmployee.html";
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class TicketController method index.
/**
* 跳转到小票首页
*/
@Permission
@RequestMapping("")
public String index(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);
/*
* Long userId = Long.valueOf(ShiroKit.getUser().getId()); Ticket
* ticket=ticketMapper.selectById(1); model.addAttribute("ticket",
* ticket);
*/
return PREFIX + "ticket.html";
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class TicketController method add.
/**
* 新增小票
*/
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Ticket ticket) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
ticket.setMerchantId(merchant.getId());
ticketService.insert(ticket);
return super.SUCCESS_TIP;
}
Aggregations