use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class StoreEmployeeController method storeEmployeeUpdate.
/**
* 跳转到修改员工管理
*/
@Permission
@RequestMapping("/storeEmployee_update/{storeEmployeeId}")
public String storeEmployeeUpdate(@PathVariable Long storeEmployeeId, Model model) {
StoreEmployee storeEmployee = storeEmployeeService.selectById(storeEmployeeId);
// 当前登录账号
Long createUserId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(createUserId);
Role role = roleService.selectById(storeEmployee.getRoleId());
User user = userMapper.selectById(storeEmployee.getUserId());
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());
model.addAttribute(user);
model.addAttribute(role);
model.addAttribute(storeEmployee);
model.addAttribute(merchant);
return PREFIX + "storeEmployee_edit.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class StoreEmployeeController method add.
/**
* 新增员工管理
*/
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(StoreEmployee storeEmployee, String password, String sex) {
// 当前登录账号
Long createUserId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(createUserId);
// 添加用户, 判断账号是否重复
User theUser = managerDao.getByAccount(storeEmployee.getMobile());
if (theUser != null) {
throw new BussinessException(BizExceptionEnum.USER_ALREADY_REG);
}
storeEmployee.setMerchantId(merchant.getId());
storeEmployee.setCreateUserId(createUserId);
storeEmployeeService.saveEmployee(storeEmployee, password, sex);
return super.SUCCESS_TIP;
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class TicketController method list.
/**
* 获取小票列表
*/
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String ticketName, Long storeId, Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Page<Ticket> page = new PageFactory<Ticket>().defaultPage();
List<Map<String, Object>> result = ticketService.getTicketList(page, ticketName, storeId, merchant.getId(), page.getOrderByField(), page.isAsc());
page.setRecords((List<Ticket>) new TicketWarpper(result).warp());
return super.packForBT(page);
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class TicketController method ticketUpdate.
/**
* 跳转到修改小票
*/
@Permission
@RequestMapping("/ticket_update/{ticketId}")
public String ticketUpdate(@PathVariable Long ticketId, 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);
Ticket ticket = ticketService.selectById(ticketId);
model.addAttribute(ticket);
model.addAttribute("specType", SpecType.values());
return PREFIX + "ticket_edit.html";
}
use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.
the class CardController method add.
/**
* 新增会员卡
*/
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Card card, String rights) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
card.setMerchantId(merchant.getId());
cardService.saveCard(card, rights);
return super.SUCCESS_TIP;
}
Aggregations