Search in sources :

Example 56 with Merchant

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

the class MemberCardController method list.

/**
 * 获取领取记录列表
 */
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String cardNumber, String cardName, Long cardId, String mobile, String nickname, Integer state, Integer grantType) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<MemberCard> page = new PageFactory<MemberCard>().defaultPage();
    List<Map<String, Object>> result = memberCardService.getMemberCardList(cardId, grantType, state, mobile, page, nickname, page.getOrderByField(), page.isAsc(), merchant.getId(), cardNumber);
    page.setRecords((List<MemberCard>) new MemberCardWarpper(result).warp());
    return super.packForBT(page);
}
Also used : MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Merchant(com.ikoori.vip.common.persistence.model.Merchant) MemberCardWarpper(com.ikoori.vip.server.modular.biz.warpper.MemberCardWarpper) HashMap(java.util.HashMap) 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 57 with Merchant

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

the class PictureController method list.

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

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

the class PointController method list.

/**
 * 获取积分管理列表
 */
@RequestMapping(value = "/list")
@Permission
@ResponseBody
public Object list(String condition) {
    Page<Point> page = new PageFactory<Point>().defaultPage();
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    List<Map<String, Object>> result = pointService.getPointList(page, condition, page.getOrderByField(), page.isAsc(), merchant.getId());
    page.setRecords((List<Point>) new PointWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) Point(com.ikoori.vip.common.persistence.model.Point) Map(java.util.Map) PointWarpper(com.ikoori.vip.server.modular.biz.warpper.PointWarpper) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 59 with Merchant

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

the class PointController method initParam.

private void initParam(Point point, String pointsLimitTemp) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    point.setCreateUserId(userId);
    point.setMerchantId(merchant.getId());
    if (point.getRuleType().intValue() == PointType.PAY_ORDER.getCode()) {
        point.setPointsLimit(Integer.valueOf(pointsLimitTemp));
        point.setName(PointType.PAY_ORDER.getMessage() + pointsLimitTemp + "笔,奖励分值:" + point.getPoints());
    } else if (point.getRuleType().intValue() == PointType.PAY_MONEY.getCode()) {
        // 转换成Double
        Double cny = Double.parseDouble(pointsLimitTemp) * 100;
        point.setPointsLimit(cny.intValue());
        point.setName(PointType.PAY_MONEY.getMessage() + pointsLimitTemp + "元,奖励分值:" + point.getPoints());
    } else {
        point.setPointsLimit(0);
        point.setName(PointType.SUBSCRIBE_WX.getMessage() + ",奖励分值:" + point.getPoints());
    }
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant)

Example 60 with Merchant

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

the class RedpackController method add.

/**
 * 新增红包
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Redpack redpack) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    redpack.setMerchantId(merchant.getId());
    redpackService.saveRedPack(redpack);
    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)

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