Search in sources :

Example 21 with Merchant

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

the class MemberController method memberUpdate.

/**
 * 跳转到修改会员
 */
@Permission
@RequestMapping("/member_update/{memberId}")
public String memberUpdate(@PathVariable Long memberId, Model model) {
    Member member = memberService.selectById(memberId);
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    MemberCard memberCard = new MemberCard();
    memberCard.setMemberId(member.getId());
    memberCard.setIsDefault(true);
    memberCard = memberCardMapper.selectOne(memberCard);
    model.addAttribute("memberCard", memberCard);
    // 会员卡
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> condition = new HashMap<String, Object>();
    condition.put("merchantId", merchant.getId());
    condition.put("inGrantType", new Object[] { CardGrantType.NO_RULE.getCode(), CardGrantType.SUB_WX.getCode() });
    List<Card> cards = cardService.selectByCondition(condition);
    model.addAttribute("cards", cards);
    model.addAttribute("member", member);
    return PREFIX + "member_edit.html";
}
Also used : MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Member(com.ikoori.vip.common.persistence.model.Member) Card(com.ikoori.vip.common.persistence.model.Card) MemberCard(com.ikoori.vip.common.persistence.model.MemberCard) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 22 with Merchant

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

the class OrderController method list.

/**
 * 获取订单列表
 */
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String memName, Long storeId, String mobile, Long orderSource, String orderNo) {
    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 = orderService.getOrderList(page, memName, page.getOrderByField(), page.isAsc(), merchant.getId(), storeId, mobile, orderSource, orderNo);
    page.setRecords((List<Map<String, Object>>) new OrderWarpper(result).warp());
    return super.packForBT(page);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) OrderWarpper(com.ikoori.vip.server.modular.biz.warpper.OrderWarpper) 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 23 with Merchant

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

the class CouponCodeController method index.

/**
 * 跳转到券码管理首页
 */
@Permission
@RequestMapping("")
public String index(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("invalid", true);
    List<Coupon> coupons = couponService.selectByCondition(couponCon);
    // 查询优惠群
    model.addAttribute("coupons", coupons);
    model.addAttribute("codeStatus", CouponCodeStatus.values());
    return PREFIX + "couponCode.html";
}
Also used : Coupon(com.ikoori.vip.common.persistence.model.Coupon) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 24 with Merchant

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

the class CouponCodeController method export.

/**
 * 导出
 *
 * @Title: queryExcel
 * @param request
 * @param response
 * @param batchNo
 * @param verifyCode
 * @param verifyNo
 * @param couponId
 * @param useStatus
 * @return
 * @throws IOException
 * @date: 2017年10月15日 下午4:03:52
 * @author: chengxg
 */
@Permission
@RequestMapping(value = "/export", method = RequestMethod.GET)
public void export(HttpServletRequest request, HttpServletResponse response, String batchNo, String verifyCode, String verifyNo, Long couponId, Integer useStatus) throws IOException {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().bigPage();
    List<Map<String, Object>> result = couponCodeService.getCouponCodeList(page, batchNo, verifyCode, verifyNo, useStatus, couponId, merchant.getId(), page.getOrderByField(), page.isAsc());
    List<Map<String, Object>> couponCodeList = (List<Map<String, Object>>) (new CouponCodeWarpper(result).warp());
    // 定义导出excel的名字
    String excelName = "券号批量导出表";
    if (StringUtils.isNotBlank(batchNo)) {
        excelName = excelName + "-" + batchNo;
    }
    // 获取需要转出的excle表头的map字段
    LinkedHashMap<String, String> fieldMap = new LinkedHashMap<String, String>();
    fieldMap.put("batchNo", "批次号");
    if (couponId != null) {
        fieldMap.put("couponName", "现金券名称");
    }
    fieldMap.put("verifyNo", "卡号");
    fieldMap.put("verifyCode", "券码");
    // 导出
    PoiExcelUtil.export(excelName, couponCodeList, fieldMap, response);
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) List(java.util.List) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) CouponCodeWarpper(com.ikoori.vip.server.modular.biz.warpper.CouponCodeWarpper) LinkedHashMap(java.util.LinkedHashMap) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 25 with Merchant

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

the class CouponCodeController method update.

/**
 * 根据批次号修改券号状态为“已制卡”
 */
@RequestMapping(value = "/update")
@Permission
@ResponseBody
public Object update(@RequestParam String ids) {
    if (ToolUtil.isEmpty(ids)) {
        throw new BussinessException(500, "请选择数据");
    }
    String[] as = ids.split(",");
    Long[] codeIds = new Long[as.length];
    for (int i = 0; i < as.length; i++) {
        codeIds[i] = Long.valueOf(as[i]);
    }
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("ids", codeIds);
    params.put("merchantId", merchant.getId());
    params.put("useStatus", CouponCodeStatus.madecard.getCode());
    couponCodeService.updateUseStatus(params);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) BussinessException(com.ikoori.vip.common.exception.BussinessException) 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