소스 검색

fixed 门店预约相关接口改造

fushengqian 8 달 전
부모
커밋
e9a002f67b

+ 73 - 0
fuint-application/src/main/java/com/fuint/common/dto/BookDto.java

@@ -0,0 +1,73 @@
+package com.fuint.common.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import java.util.Date;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 预约实体
+ *
+ * Created by FSQ
+ * CopyRight https://www.fuint.cn
+ */
+@Data
+public class BookDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("自增ID")
+    @TableId(value = "ID", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty("预约名称")
+    private String name;
+
+    @ApiModelProperty("所属商户ID")
+    private Integer merchantId;
+
+    @ApiModelProperty("所属店铺ID")
+    private Integer storeId;
+
+    @ApiModelProperty("预约类型")
+    private String type;
+
+    @ApiModelProperty("图片地址")
+    private String logo;
+
+    @ApiModelProperty("关联商品ID")
+    private Integer goodsId;
+
+    @ApiModelProperty("类别ID")
+    private Integer cateId;
+
+    @ApiModelProperty("可预约日期")
+    private String serviceDates;
+
+    @ApiModelProperty("可预约时间段")
+    private String serviceTimes;
+
+    @ApiModelProperty("可预约员工ID")
+    private String serviceStaffIds;
+
+    @ApiModelProperty("描述")
+    private String description;
+
+    @ApiModelProperty("创建时间")
+    private Date createTime;
+
+    @ApiModelProperty("更新时间")
+    private Date updateTime;
+
+    @ApiModelProperty("最后操作人")
+    private String operator;
+
+    @ApiModelProperty("排序")
+    private Integer sort;
+
+    @ApiModelProperty("A:正常;D:删除")
+    private String status;
+
+}

+ 18 - 0
fuint-application/src/main/java/com/fuint/common/param/BookDetailParam.java

@@ -0,0 +1,18 @@
+package com.fuint.common.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * 预约详情请求参数
+ * Created by FSQ
+ * CopyRight https://www.fuint.cn
+ */
+@Data
+public class BookDetailParam implements Serializable {
+
+    @ApiModelProperty(value="预约ID", name="bookId")
+    private Integer bookId;
+
+}

+ 24 - 0
fuint-application/src/main/java/com/fuint/common/param/BookListParam.java

@@ -0,0 +1,24 @@
+package com.fuint.common.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * 预约列表请求参数
+ * Created by FSQ
+ * CopyRight https://www.fuint.cn
+ */
+@Data
+public class BookListParam extends PageParam implements Serializable {
+
+    @ApiModelProperty(value="名称", name="name")
+    private String name;
+
+    @ApiModelProperty(value="分类ID", name="cateId")
+    private Integer cateId;
+
+    @ApiModelProperty(value="商户号", name="merchantNo")
+    private String merchantNo;
+
+}

+ 7 - 6
fuint-application/src/main/java/com/fuint/common/service/BookService.java

@@ -1,6 +1,7 @@
 package com.fuint.common.service;
 package com.fuint.common.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fuint.common.dto.BookDto;
 import com.fuint.framework.pagination.PaginationRequest;
 import com.fuint.framework.pagination.PaginationRequest;
 import com.fuint.framework.pagination.PaginationResponse;
 import com.fuint.framework.pagination.PaginationResponse;
 import com.fuint.framework.exception.BusinessCheckException;
 import com.fuint.framework.exception.BusinessCheckException;
@@ -22,7 +23,7 @@ public interface BookService extends IService<MtBook> {
      * @param paginationRequest
      * @param paginationRequest
      * @return
      * @return
      */
      */
-    PaginationResponse<MtBook> queryBookListByPagination(PaginationRequest paginationRequest) throws BusinessCheckException;
+    PaginationResponse<BookDto> queryBookListByPagination(PaginationRequest paginationRequest) throws BusinessCheckException;
 
 
     /**
     /**
      * 添加预约
      * 添加预约
@@ -34,16 +35,16 @@ public interface BookService extends IService<MtBook> {
     MtBook addBook(MtBook mtBook) throws BusinessCheckException;
     MtBook addBook(MtBook mtBook) throws BusinessCheckException;
 
 
     /**
     /**
-     * 根据ID获取预约信息
+     * 根据ID获取预约项目信息
      *
      *
-     * @param  id 预约ID
+     * @param  id 预约项目ID
      * @throws BusinessCheckException
      * @throws BusinessCheckException
      * @return
      * @return
      */
      */
-    MtBook getBookById(Integer id) throws BusinessCheckException;
+    BookDto getBookById(Integer id) throws BusinessCheckException;
 
 
     /**
     /**
-     * 更新预约
+     * 更新预约项目
      *
      *
      * @param  mtBook
      * @param  mtBook
      * @throws BusinessCheckException
      * @throws BusinessCheckException
@@ -52,7 +53,7 @@ public interface BookService extends IService<MtBook> {
     MtBook updateBook(MtBook mtBook) throws BusinessCheckException;
     MtBook updateBook(MtBook mtBook) throws BusinessCheckException;
 
 
     /**
     /**
-     * 根据条件搜索预约
+     * 根据条件搜索预约项目
      *
      *
      * @param  params 查询参数
      * @param  params 查询参数
      * @throws BusinessCheckException
      * @throws BusinessCheckException

+ 5 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/BookCateServiceImpl.java

@@ -13,6 +13,7 @@ import com.fuint.repository.mapper.MtBookCateMapper;
 import com.fuint.common.service.SettingService;
 import com.fuint.common.service.SettingService;
 import com.fuint.common.enums.StatusEnum;
 import com.fuint.common.enums.StatusEnum;
 import com.fuint.repository.model.MtBookCate;
 import com.fuint.repository.model.MtBookCate;
+import com.fuint.repository.model.MtGoodsCate;
 import com.fuint.repository.model.MtStore;
 import com.fuint.repository.model.MtStore;
 import com.fuint.utils.StringUtil;
 import com.fuint.utils.StringUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
@@ -215,7 +216,10 @@ public class BookCateServiceImpl extends ServiceImpl<MtBookCateMapper, MtBookCat
             lambdaQueryWrapper.eq(MtBookCate::getMerchantId, merchantId);
             lambdaQueryWrapper.eq(MtBookCate::getMerchantId, merchantId);
         }
         }
         if (StringUtils.isNotBlank(storeId)) {
         if (StringUtils.isNotBlank(storeId)) {
-            lambdaQueryWrapper.eq(MtBookCate::getStoreId, storeId);
+            lambdaQueryWrapper.and(wq -> wq
+                    .eq(MtBookCate::getStoreId, 0)
+                    .or()
+                    .eq(MtBookCate::getStoreId, storeId));
         }
         }
 
 
         lambdaQueryWrapper.orderByAsc(MtBookCate::getSort);
         lambdaQueryWrapper.orderByAsc(MtBookCate::getSort);

+ 31 - 9
fuint-application/src/main/java/com/fuint/common/service/impl/BookServiceImpl.java

@@ -3,6 +3,7 @@ package com.fuint.common.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fuint.common.dto.BookDto;
 import com.fuint.common.service.BookService;
 import com.fuint.common.service.BookService;
 import com.fuint.common.service.StoreService;
 import com.fuint.common.service.StoreService;
 import com.fuint.framework.annoation.OperationServiceLog;
 import com.fuint.framework.annoation.OperationServiceLog;
@@ -21,6 +22,7 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import com.github.pagehelper.Page;
 import com.github.pagehelper.Page;
+import org.springframework.beans.BeanUtils;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -58,7 +60,7 @@ public class BookServiceImpl extends ServiceImpl<MtBookMapper, MtBook> implement
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public PaginationResponse<MtBook> queryBookListByPagination(PaginationRequest paginationRequest) {
+    public PaginationResponse<BookDto> queryBookListByPagination(PaginationRequest paginationRequest) {
         Page<MtBanner> pageHelper = PageHelper.startPage(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
         Page<MtBanner> pageHelper = PageHelper.startPage(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
         LambdaQueryWrapper<MtBook> lambdaQueryWrapper = Wrappers.lambdaQuery();
         LambdaQueryWrapper<MtBook> lambdaQueryWrapper = Wrappers.lambdaQuery();
         lambdaQueryWrapper.ne(MtBook::getStatus, StatusEnum.DISABLE.getKey());
         lambdaQueryWrapper.ne(MtBook::getStatus, StatusEnum.DISABLE.getKey());
@@ -67,6 +69,10 @@ public class BookServiceImpl extends ServiceImpl<MtBookMapper, MtBook> implement
         if (StringUtils.isNotBlank(name)) {
         if (StringUtils.isNotBlank(name)) {
             lambdaQueryWrapper.like(MtBook::getName, name);
             lambdaQueryWrapper.like(MtBook::getName, name);
         }
         }
+        String cateId = paginationRequest.getSearchParams().get("cateId") == null ? "" : paginationRequest.getSearchParams().get("cateId").toString();
+        if (StringUtils.isNotBlank(cateId)) {
+            lambdaQueryWrapper.like(MtBook::getCateId, cateId);
+        }
         String status = paginationRequest.getSearchParams().get("status") == null ? "" : paginationRequest.getSearchParams().get("status").toString();
         String status = paginationRequest.getSearchParams().get("status") == null ? "" : paginationRequest.getSearchParams().get("status").toString();
         if (StringUtils.isNotBlank(status)) {
         if (StringUtils.isNotBlank(status)) {
             lambdaQueryWrapper.eq(MtBook::getStatus, status);
             lambdaQueryWrapper.eq(MtBook::getStatus, status);
@@ -81,11 +87,21 @@ public class BookServiceImpl extends ServiceImpl<MtBookMapper, MtBook> implement
         }
         }
 
 
         lambdaQueryWrapper.orderByAsc(MtBook::getSort);
         lambdaQueryWrapper.orderByAsc(MtBook::getSort);
-        List<MtBook> dataList = mtBookMapper.selectList(lambdaQueryWrapper);
+        List<MtBook> bookList = mtBookMapper.selectList(lambdaQueryWrapper);
+        List<BookDto> dataList = new ArrayList<>();
+        String baseImage = settingService.getUploadBasePath();
+        if (bookList != null && bookList.size() > 0) {
+            for (MtBook mtBook : bookList) {
+                 BookDto bookDto = new BookDto();
+                 BeanUtils.copyProperties(mtBook, bookDto);
+                 bookDto.setLogo(baseImage + mtBook.getLogo());
+                 dataList.add(bookDto);
+            }
+        }
 
 
         PageRequest pageRequest = PageRequest.of(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
         PageRequest pageRequest = PageRequest.of(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
         PageImpl pageImpl = new PageImpl(dataList, pageRequest, pageHelper.getTotal());
         PageImpl pageImpl = new PageImpl(dataList, pageRequest, pageHelper.getTotal());
-        PaginationResponse<MtBook> paginationResponse = new PaginationResponse(pageImpl, MtBook.class);
+        PaginationResponse<BookDto> paginationResponse = new PaginationResponse(pageImpl, BookDto.class);
         paginationResponse.setTotalPages(pageHelper.getPages());
         paginationResponse.setTotalPages(pageHelper.getPages());
         paginationResponse.setTotalElements(pageHelper.getTotal());
         paginationResponse.setTotalElements(pageHelper.getTotal());
         paginationResponse.setContent(dataList);
         paginationResponse.setContent(dataList);
@@ -126,14 +142,20 @@ public class BookServiceImpl extends ServiceImpl<MtBookMapper, MtBook> implement
     }
     }
 
 
     /**
     /**
-     * 根据ID获取预约信息
+     * 根据ID获取预约项目信息
      *
      *
-     * @param id 预约ID
+     * @param id 预约项目ID
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public MtBook getBookById(Integer id) {
-       return mtBookMapper.selectById(id);
+    public BookDto getBookById(Integer id) {
+        BookDto bookDto = new BookDto();
+        MtBook mtBook = mtBookMapper.selectById(id);
+        if (mtBook == null) {
+            return null;
+        }
+        BeanUtils.copyProperties(mtBook, bookDto);
+        return bookDto;
     }
     }
 
 
     /**
     /**
@@ -147,7 +169,7 @@ public class BookServiceImpl extends ServiceImpl<MtBookMapper, MtBook> implement
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     @OperationServiceLog(description = "修改预约项目")
     @OperationServiceLog(description = "修改预约项目")
     public MtBook updateBook(MtBook mtBook) throws BusinessCheckException {
     public MtBook updateBook(MtBook mtBook) throws BusinessCheckException {
-        MtBook book = getBookById(mtBook.getId());
+        MtBook book = mtBookMapper.selectById(mtBook.getId());
         if (book == null) {
         if (book == null) {
             throw new BusinessCheckException("该预约项目状态异常");
             throw new BusinessCheckException("该预约项目状态异常");
         }
         }
@@ -194,7 +216,7 @@ public class BookServiceImpl extends ServiceImpl<MtBookMapper, MtBook> implement
     }
     }
 
 
     /**
     /**
-     * 根据条件搜索预约
+     * 根据条件搜索预约项目
      *
      *
      * @param  params 查询参数
      * @param  params 查询参数
      * @throws BusinessCheckException
      * @throws BusinessCheckException

+ 13 - 7
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendBookController.java

@@ -1,6 +1,7 @@
 package com.fuint.module.backendApi.controller;
 package com.fuint.module.backendApi.controller;
 
 
 import com.fuint.common.dto.AccountInfo;
 import com.fuint.common.dto.AccountInfo;
+import com.fuint.common.dto.BookDto;
 import com.fuint.common.service.BookCateService;
 import com.fuint.common.service.BookCateService;
 import com.fuint.common.service.BookService;
 import com.fuint.common.service.BookService;
 import com.fuint.common.service.StoreService;
 import com.fuint.common.service.StoreService;
@@ -20,6 +21,7 @@ import com.fuint.utils.StringUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
+import org.springframework.beans.BeanUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
@@ -73,6 +75,7 @@ public class BackendBookController extends BaseController {
         Integer page = request.getParameter("page") == null ? Constants.PAGE_NUMBER : Integer.parseInt(request.getParameter("page"));
         Integer page = request.getParameter("page") == null ? Constants.PAGE_NUMBER : Integer.parseInt(request.getParameter("page"));
         Integer pageSize = request.getParameter("pageSize") == null ? Constants.PAGE_SIZE : Integer.parseInt(request.getParameter("pageSize"));
         Integer pageSize = request.getParameter("pageSize") == null ? Constants.PAGE_SIZE : Integer.parseInt(request.getParameter("pageSize"));
         String name = request.getParameter("name");
         String name = request.getParameter("name");
+        String cateId = request.getParameter("cateId");
         String status = request.getParameter("status");
         String status = request.getParameter("status");
         String searchStoreId = request.getParameter("storeId");
         String searchStoreId = request.getParameter("storeId");
 
 
@@ -95,6 +98,9 @@ public class BackendBookController extends BaseController {
         if (StringUtil.isNotEmpty(name)) {
         if (StringUtil.isNotEmpty(name)) {
             params.put("name", name);
             params.put("name", name);
         }
         }
+        if (StringUtil.isNotEmpty(cateId)) {
+            params.put("cateId", cateId);
+        }
         if (StringUtil.isNotEmpty(status)) {
         if (StringUtil.isNotEmpty(status)) {
             params.put("status", status);
             params.put("status", status);
         }
         }
@@ -105,7 +111,7 @@ public class BackendBookController extends BaseController {
             params.put("storeId", storeId);
             params.put("storeId", storeId);
         }
         }
         paginationRequest.setSearchParams(params);
         paginationRequest.setSearchParams(params);
-        PaginationResponse<MtBook> paginationResponse = bookService.queryBookListByPagination(paginationRequest);
+        PaginationResponse<BookDto> paginationResponse = bookService.queryBookListByPagination(paginationRequest);
 
 
         Map<String, Object> param = new HashMap<>();
         Map<String, Object> param = new HashMap<>();
         param.put("status", StatusEnum.ENABLED.getKey());
         param.put("status", StatusEnum.ENABLED.getKey());
@@ -148,12 +154,14 @@ public class BackendBookController extends BaseController {
             return getFailureResult(1001, "请先登录");
             return getFailureResult(1001, "请先登录");
         }
         }
 
 
-        MtBook mtBook = bookService.getBookById(id);
-        if (mtBook == null) {
+        BookDto bookDto = bookService.getBookById(id);
+        if (bookDto == null) {
             return getFailureResult(201);
             return getFailureResult(201);
         }
         }
 
 
         String operator = accountInfo.getAccountName();
         String operator = accountInfo.getAccountName();
+        MtBook mtBook = new MtBook();
+        BeanUtils.copyProperties(bookDto, mtBook);
 
 
         mtBook.setOperator(operator);
         mtBook.setOperator(operator);
         mtBook.setStatus(status);
         mtBook.setStatus(status);
@@ -254,12 +262,10 @@ public class BackendBookController extends BaseController {
             return getFailureResult(1001, "请先登录");
             return getFailureResult(1001, "请先登录");
         }
         }
 
 
-        MtBook mtBook = bookService.getBookById(id);
-        String imagePath = settingService.getUploadBasePath();
+        BookDto bookDto = bookService.getBookById(id);
 
 
         Map<String, Object> result = new HashMap<>();
         Map<String, Object> result = new HashMap<>();
-        result.put("bookInfo", mtBook);
-        result.put("imagePath", imagePath);
+        result.put("bookInfo", bookDto);
 
 
         return getSuccessResult(result);
         return getSuccessResult(result);
     }
     }

+ 138 - 0
fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientBookController.java

@@ -0,0 +1,138 @@
+package com.fuint.module.clientApi.controller;
+
+import com.fuint.common.Constants;
+import com.fuint.common.dto.BookDto;
+import com.fuint.common.enums.StatusEnum;
+import com.fuint.common.param.BookDetailParam;
+import com.fuint.common.param.BookListParam;
+import com.fuint.common.service.BookCateService;
+import com.fuint.common.service.BookService;
+import com.fuint.common.service.MerchantService;
+import com.fuint.framework.exception.BusinessCheckException;
+import com.fuint.framework.pagination.PaginationRequest;
+import com.fuint.framework.pagination.PaginationResponse;
+import com.fuint.framework.web.BaseController;
+import com.fuint.framework.web.ResponseObject;
+import com.fuint.repository.model.MtBook;
+import com.fuint.repository.model.MtBookCate;
+import com.fuint.utils.StringUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import java.lang.reflect.InvocationTargetException;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 预约controller
+ *
+ * Created by FSQ
+ * CopyRight https://www.fuint.cn
+ */
+@Api(tags="会员端-预约相关接口")
+@RestController
+@AllArgsConstructor
+@RequestMapping(value = "/clientApi/book")
+public class ClientBookController extends BaseController {
+
+    /**
+     * 预约项目服务接口
+     * */
+    private BookService bookService;
+
+    /**
+     * 预约项目分类服务接口
+     * */
+    private BookCateService bookCateService;
+
+    /**
+     * 商户服务接口
+     */
+    private MerchantService merchantService;
+
+    /**
+     * 获取预约项目列表
+     */
+    @ApiOperation(value="获取预约项目列表", notes="获取预约项目列表")
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    @CrossOrigin
+    public ResponseObject list(HttpServletRequest request,  @RequestBody BookListParam param) throws BusinessCheckException, InvocationTargetException, IllegalAccessException {
+        String name = param.getName();
+        Integer cateId = param.getCateId();
+        Integer page = param.getPage() == null ? Constants.PAGE_NUMBER : param.getPage();
+        Integer pageSize = param.getPageSize() == null ? Constants.PAGE_SIZE : param.getPageSize();
+        String merchantNo = request.getHeader("merchantNo") == null ? "" : request.getHeader("merchantNo");
+
+        PaginationRequest paginationRequest = new PaginationRequest();
+        paginationRequest.setCurrentPage(page);
+        paginationRequest.setPageSize(pageSize);
+
+        Map<String, Object> params = new HashMap<>();
+        params.put("status", StatusEnum.ENABLED.getKey());
+        if (StringUtil.isNotEmpty(name)) {
+            params.put("name", name);
+        }
+        if (StringUtil.isNotEmpty(merchantNo)) {
+            params.put("merchantNo", merchantNo);
+        }
+        if (cateId != null && cateId > 0) {
+            params.put("cateId", cateId);
+        }
+        paginationRequest.setSearchParams(params);
+        PaginationResponse<BookDto> paginationResponse = bookService.queryBookListByPagination(paginationRequest);
+
+        Map<String, Object> result = new HashMap();
+        result.put("content", paginationResponse.getContent());
+        result.put("pageSize", paginationResponse.getPageSize());
+        result.put("pageNumber", paginationResponse.getCurrentPage());
+        result.put("totalRow", paginationResponse.getTotalElements());
+        result.put("totalPage", paginationResponse.getTotalPages());
+
+        return getSuccessResult(result);
+    }
+
+    /**
+     * 获取预约项目详情
+     */
+    @ApiOperation(value="获取预约项目详情", notes="根据ID获取预约项目详情")
+    @RequestMapping(value = "/detail", method = RequestMethod.POST)
+    @CrossOrigin
+    public ResponseObject detail(@RequestBody BookDetailParam param) throws BusinessCheckException, InvocationTargetException, IllegalAccessException {
+        Integer bookId = param.getBookId() == null ? 0 : param.getBookId();
+
+        BookDto bookInfo = bookService.getBookById(bookId);
+        Map<String, Object> result = new HashMap<>();
+        result.put("bookInfo", bookInfo);
+
+        return getSuccessResult(result);
+    }
+
+    /**
+     * 获取预约分类列表
+     */
+    @ApiOperation(value = "获取预约分类列表")
+    @RequestMapping(value = "/cateList", method = RequestMethod.GET)
+    @CrossOrigin
+    public ResponseObject cateList(HttpServletRequest request) throws BusinessCheckException {
+        String merchantNo = request.getHeader("merchantNo") == null ? "" : request.getHeader("merchantNo");
+        Integer storeId = request.getHeader("storeId") == null ? 0 : Integer.parseInt(request.getHeader("storeId"));
+
+        Map<String, Object> param = new HashMap<>();
+        param.put("status", StatusEnum.ENABLED.getKey());
+        Integer merchantId = merchantService.getMerchantId(merchantNo);
+        if (merchantId > 0) {
+            param.put("merchantId", merchantId);
+        }
+        if (storeId > 0) {
+            param.put("storeId", storeId);
+        }
+        List<MtBookCate> cateList = bookCateService.queryBookCateListByParams(param);
+        Map<String, Object> result = new HashMap<>();
+        result.put("cateList", cateList);
+
+        return getSuccessResult(result);
+    }
+}