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