Search in sources :

Example 16 with Store

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

the class WebTicketController method info.

@ApiOperation("获得小票规格")
@RequestMapping(value = "info", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> info(@ApiParam(value = "店铺编号", required = true) @RequestParam(required = true) String storeNo, @ApiParam(value = "签名", required = true) @RequestParam(required = true) String sign) {
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("code", "200");
    result.put("msg", "请求成功");
    try {
        boolean isSign = true;
        if (gunsProperties.isCheckSign()) {
            Map<String, String> data = new HashMap<String, String>();
            data.put("storeNo", storeNo);
            data.put("sign", sign);
            isSign = WXPayUtil.isSignatureValid(data, gunsProperties.getSignKey());
            if (!isSign) {
                result.put("code", "500");
                result.put("msg", "签名失败");
            }
        }
        if (isSign) {
            JSONObject obj = new JSONObject();
            Store store = storeService.selectByStoreNo(storeNo);
            Merchant merchant = memchantService.getMerchantById(store.getMerchantId());
            Ticket ticket = ticketService.selectByStoreNum(storeNo);
            if (ticket != null) {
                JSONObject logo = new JSONObject();
                logo.put("name", "店铺logo");
                logo.put("value", merchant.getHeadImg());
                obj.put("logo", logo);
                JSONObject qrcode = new JSONObject();
                qrcode.put("name", "公众号二维码");
                qrcode.put("value", merchant.getQrcode());
                obj.put("qrcode", qrcode);
                JSONObject joinTel = new JSONObject();
                joinTel.put("name", "加盟热线");
                joinTel.put("value", store.getJointel());
                obj.put("joinTel", joinTel);
                JSONObject title = new JSONObject();
                title.put("name", "标题");
                title.put("value", ticket.getTitle());
                obj.put("title", title);
                JSONObject remark = new JSONObject();
                remark.put("name", "备注");
                remark.put("value", ticket.getRemark());
                obj.put("remark", remark);
                JSONObject specType = new JSONObject();
                specType.put("name", "规格");
                specType.put("value", SpecType.valueOf(ticket.getSpecType()));
                obj.put("specType", specType);
                JSONObject storeName = new JSONObject();
                storeName.put("name", "店铺名称");
                storeName.put("value", store.getName());
                obj.put("storeName", storeName);
                JSONObject address = new JSONObject();
                address.put("name", "地址");
                address.put("value", store.getAddress());
                obj.put("address", address);
                JSONObject servicePhone = new JSONObject();
                servicePhone.put("name", "服务电话");
                servicePhone.put("value", store.getServicePhone());
                obj.put("servicePhone", servicePhone);
                JSONObject website = new JSONObject();
                website.put("name", "网址");
                website.put("value", store.getWebsite());
                obj.put("website", website);
            }
            result.put("content", obj);
        }
    } catch (Exception e) {
        e.printStackTrace();
        result.put("code", "500");
        result.put("msg", "请求失败");
    }
    return result;
}
Also used : Ticket(com.ikoori.vip.common.persistence.model.Ticket) JSONObject(com.alibaba.fastjson.JSONObject) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Store(com.ikoori.vip.common.persistence.model.Store) JSONObject(com.alibaba.fastjson.JSONObject) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

Store (com.ikoori.vip.common.persistence.model.Store)16 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)14 Permission (com.ikoori.vip.common.annotion.Permission)12 Merchant (com.ikoori.vip.common.persistence.model.Merchant)12 HashMap (java.util.HashMap)12 JSONObject (com.alibaba.fastjson.JSONObject)3 Card (com.ikoori.vip.common.persistence.model.Card)3 Ticket (com.ikoori.vip.common.persistence.model.Ticket)3 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)3 Coupon (com.ikoori.vip.common.persistence.model.Coupon)2 ApiOperation (io.swagger.annotations.ApiOperation)2 CouponPayDo (com.ikoori.vip.common.dto.CouponPayDo)1 OrderItemPayDo (com.ikoori.vip.common.dto.OrderItemPayDo)1 BussinessException (com.ikoori.vip.common.exception.BussinessException)1 CouponFetch (com.ikoori.vip.common.persistence.model.CouponFetch)1 CouponTrade (com.ikoori.vip.common.persistence.model.CouponTrade)1 Member (com.ikoori.vip.common.persistence.model.Member)1 Order (com.ikoori.vip.common.persistence.model.Order)1 OrderItem (com.ikoori.vip.common.persistence.model.OrderItem)1 Picture (com.ikoori.vip.common.persistence.model.Picture)1