use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class PointTradeController method index.
/**
* 跳转到积分明细首页
*/
@RequestMapping("")
public String index(Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
model.addAttribute("points", pointService.getAllPoint(merchant.getId()));
model.addAttribute("tradeTypes", PointTradeType.values());
return PREFIX + "pointTrade.html";
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class RedpackLogController method list.
/**
* 获取红包记录列表
*/
@RequestMapping(value = "/list")
@ResponseBody
@Permission
public Object list(String billno, String unionid, Integer sendStatus, String sendS, String sendE, Integer redpackId) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
List<Map<String, Object>> result = redpackLogService.getRedpackLogList(page, merchant.getId(), billno, unionid, sendStatus, sendS, sendE, redpackId, page.getOrderByField(), page.isAsc());
page.setRecords((List<Map<String, Object>>) new RedpackLogWarpper(result).warp());
return super.packForBT(page);
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class ShareController method shareUpdate.
/**
* 跳转到修改分享规则
*/
@Permission
@RequestMapping("/share_update/{shareId}")
public String shareUpdate(@PathVariable Long shareId, Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Map<String, Object> couponCon = new HashMap<String, Object>();
couponCon.put("merchantId", merchant.getId());
couponCon.put("type", CouponType.YHQ.getCode());
couponCon.put("invalid", true);
List<Coupon> coupons = couponService.selectByCondition(couponCon);
Share share = shareService.selectById(shareId);
model.addAttribute(share);
// 查询优惠群
model.addAttribute("coupons", coupons);
return PREFIX + "share_edit.html";
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class ShareController method shareAdd.
/**
* 跳转到添加分享规则
*/
@Permission
@RequestMapping("/share_add")
public String shareAdd(Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Map<String, Object> couponCon = new HashMap<String, Object>();
couponCon.put("merchantId", merchant.getId());
couponCon.put("type", CouponType.YHQ.getCode());
couponCon.put("invalid", true);
List<Coupon> coupons = couponService.selectByCondition(couponCon);
// 查询优惠群
model.addAttribute("coupons", coupons);
return PREFIX + "share_add.html";
}
use of com.ikoori.vip.common.persistence.model.Merchant in project vip by guangdada.
the class ShareController method update.
/**
* 修改分享规则
*/
@RequestMapping(value = "/update")
@Permission
@ResponseBody
public Object update(Share share) {
if (ToolUtil.isEmpty(share) || share.getId() == null) {
throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
}
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
share.setMerchantId(merchant.getId());
shareService.saveShare(share);
return super.SUCCESS_TIP;
}
Aggregations