瀏覽代碼

Merge remote-tracking branch 'origin/main'

classic_blue 1 月之前
父節點
當前提交
8f1f595e8d
共有 23 個文件被更改,包括 955 次插入123 次删除
  1. 1 2
      fuintBackend/fuint-application/src/main/java/com/fuint/common/config/CustomObjectMapper.java
  2. 3 2
      fuintBackend/fuint-application/src/main/java/com/fuint/common/param/CartSaveParam.java
  3. 2 2
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/CartService.java
  4. 1 1
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/StaffService.java
  5. 63 1
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/TableCategoryService.java
  6. 64 7
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/TableInfoService.java
  7. 7 7
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/CartServiceImpl.java
  8. 2 2
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java
  9. 3 3
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/StaffServiceImpl.java
  10. 151 2
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/TableCategoryServiceImpl.java
  11. 160 36
      fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/TableInfoServiceImpl.java
  12. 5 5
      fuintBackend/fuint-application/src/main/java/com/fuint/common/util/CommonUtil.java
  13. 5 6
      fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendAccountController.java
  14. 2 2
      fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendCashierController.java
  15. 192 0
      fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendTableCategoryController.java
  16. 187 0
      fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendTableInfoController.java
  17. 1 1
      fuintBackend/fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientCartController.java
  18. 9 3
      fuintBackend/fuint-repository/src/main/java/com/fuint/repository/mapper/MtTableCategoryMapper.java
  19. 9 3
      fuintBackend/fuint-repository/src/main/java/com/fuint/repository/mapper/MtTableInfoMapper.java
  20. 38 19
      fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtTableCategory.java
  21. 40 19
      fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtTableInfo.java
  22. 5 0
      fuintBackend/fuint-repository/src/main/resources/mapper/MtTableCategoryMapper.xml
  23. 5 0
      fuintBackend/fuint-repository/src/main/resources/mapper/MtTableInfoMapper.xml

+ 1 - 2
fuintBackend/fuint-application/src/main/java/com/fuint/common/config/CustomObjectMapper.java

@@ -25,7 +25,6 @@ import java.util.TimeZone;
 public class CustomObjectMapper extends ObjectMapper {
 
 
-
 	public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
 	public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
 	public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
@@ -44,7 +43,7 @@ public class CustomObjectMapper extends ObjectMapper {
 		// 空值不序列化
 		this.setSerializationInclusion(JsonInclude.Include.NON_NULL);
 		// 反序列化时,属性不存在的兼容处理
-		this.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+		this.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
 		// 序列化枚举是以toString()来输出,默认false,即默认以name()来输出
 		this.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true);
 

+ 3 - 2
fuintBackend/fuint-application/src/main/java/com/fuint/common/param/CartSaveParam.java

@@ -1,5 +1,6 @@
 package com.fuint.common.param;
 
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import java.io.Serializable;
@@ -13,13 +14,13 @@ import java.io.Serializable;
 public class CartSaveParam implements Serializable {
 
     @ApiModelProperty(value="购物车ID", name="cartId")
-    private Integer cartId;
+    private Long cartId;
 
     @ApiModelProperty(value="商品ID", name="goodsId")
     private Long goodsId;
 
     @ApiModelProperty(value="商品SkuID", name="skuId")
-    private Integer skuId;
+    private Long skuId;
 
     @ApiModelProperty(value="商品编码", name="skuNo")
     private String skuNo;

+ 2 - 2
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/CartService.java

@@ -31,7 +31,7 @@ public interface CartService extends IService<MtCart> {
      * @throws BusinessCheckException
      * @return
      */
-    Integer saveCart(MtCart reqDto, String action) throws BusinessCheckException;
+    Long saveCart(MtCart reqDto, String action) throws BusinessCheckException;
 
     /**
      * 删除购物车
@@ -76,5 +76,5 @@ public interface CartService extends IService<MtCart> {
      * @param  isVisitor 是否游客
      * @return
      */
-    MtCart setHangNo(Integer cartId, String hangNo, String isVisitor) throws BusinessCheckException;
+    MtCart setHangNo(Long cartId, String hangNo, String isVisitor) throws BusinessCheckException;
 }

+ 1 - 1
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/StaffService.java

@@ -50,7 +50,7 @@ public interface StaffService extends IService<MtStaff> {
      * @throws BusinessCheckException
      * @return
      */
-    Integer updateAuditedStatus(Long id, String statusEnum) throws BusinessCheckException;
+    Long updateAuditedStatus(Long id, String statusEnum) throws BusinessCheckException;
 
     /**
      * 根据条件搜索员工

+ 63 - 1
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/TableCategoryService.java

@@ -1,9 +1,71 @@
 package com.fuint.common.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fuint.framework.pagination.PaginationRequest;
+import com.fuint.framework.pagination.PaginationResponse;
 import com.fuint.repository.model.MtTableCategory;
+import com.fuint.framework.exception.BusinessCheckException;
+import java.util.List;
+import java.util.Map;
 
-
+/**
+ * 餐桌分类表业务接口
+ *
+ * Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
 public interface TableCategoryService extends IService<MtTableCategory> {
 
+    /**
+     * 分页查询列表
+     *
+     * @param paginationRequest
+     * @return
+     */
+    PaginationResponse<MtTableCategory> queryTableCategoryListByPagination(PaginationRequest paginationRequest) throws BusinessCheckException;
+
+    /**
+     * 添加餐桌分类表
+     *
+     * @param  mtTableCategory
+     * @throws BusinessCheckException
+     * @return
+     */
+    MtTableCategory addTableCategory(MtTableCategory mtTableCategory) throws BusinessCheckException;
+
+    /**
+     * 根据ID获取餐桌分类表信息
+     *
+     * @param id ID
+     * @throws BusinessCheckException
+     * @return
+     */
+    MtTableCategory queryTableCategoryById(Long id) throws BusinessCheckException;
+
+    /**
+     * 根据ID删除餐桌分类表
+     *
+     * @param id ID
+     * @param operator 操作人
+     * @throws BusinessCheckException
+     * @return
+     */
+    void deleteTableCategory(Long id, String operator) throws BusinessCheckException;
+
+    /**
+     * 更新餐桌分类表
+     * @param  mtTableCategory
+     * @throws BusinessCheckException
+     * @return
+     * */
+    MtTableCategory updateTableCategory(MtTableCategory mtTableCategory) throws BusinessCheckException;
+
+    /**
+     * 根据条件搜索餐桌分类表
+     *
+     * @param params 查询参数
+     * @throws BusinessCheckException
+     * @return
+     * */
+    List<MtTableCategory> queryTableCategoryListByParams(Map<String, Object> params) throws BusinessCheckException;
 }

+ 64 - 7
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/TableInfoService.java

@@ -1,16 +1,73 @@
 package com.fuint.common.service;
+
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fuint.framework.pagination.PaginationRequest;
+import com.fuint.framework.pagination.PaginationResponse;
 import com.fuint.repository.model.MtTableInfo;
-
+import com.fuint.framework.exception.BusinessCheckException;
 import java.util.List;
+import java.util.Map;
 
+/**
+ * 餐桌信息业务接口
+ *
+ * Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
 public interface TableInfoService extends IService<MtTableInfo> {
 
+    /**
+     * 分页查询列表
+     *
+     * @param paginationRequest
+     * @return
+     */
+    PaginationResponse<MtTableInfo> queryTableInfoListByPagination(PaginationRequest paginationRequest) throws BusinessCheckException;
+
+    /**
+     * 添加餐桌信息
+     *
+     * @param  mtTableInfo
+     * @throws BusinessCheckException
+     * @return
+     */
+    MtTableInfo addTableInfo(MtTableInfo mtTableInfo) throws BusinessCheckException;
+
+    /**
+     * 根据ID获取餐桌信息信息
+     *
+     * @param id ID
+     * @throws BusinessCheckException
+     * @return
+     */
+    MtTableInfo queryTableInfoById(Long id) throws BusinessCheckException;
+
+    /**
+     * 根据ID删除餐桌信息
+     *
+     * @param id ID
+     * @param operator 操作人
+     * @throws BusinessCheckException
+     * @return
+     */
+    void deleteTableInfo(Long id, String operator) throws BusinessCheckException;
+
+    /**
+     * 更新餐桌信息
+     * @param  mtTableInfo
+     * @throws BusinessCheckException
+     * @return
+     * */
+    MtTableInfo updateTableInfo(MtTableInfo mtTableInfo) throws BusinessCheckException;
+
+    /**
+     * 根据条件搜索餐桌信息
+     *
+     * @param params 查询参数
+     * @throws BusinessCheckException
+     * @return
+     * */
+    List<MtTableInfo> queryTableInfoListByParams(Map<String, Object> params) throws BusinessCheckException;
 
-	/**
-	 * 获取餐桌列表
-	 * @param storeId 店铺id
-	 * @return 结果
-	 */
-	List<MtTableInfo> selectTableListByStoreId(Long storeId,Long categoryId);
+	List<MtTableInfo> selectTableListByStoreId(Long storeId, Long categoryId);
 }

+ 7 - 7
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/CartServiceImpl.java

@@ -75,7 +75,7 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Integer saveCart(MtCart reqDto, String action) throws BusinessCheckException {
+    public Long saveCart(MtCart reqDto, String action) throws BusinessCheckException {
         if (reqDto.getId() == null && (reqDto.getMerchantId() == null || reqDto.getMerchantId() < 1)) {
             throw new BusinessCheckException("商户不能为空");
         }
@@ -84,7 +84,7 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
         }
 
         MtCart mtCart = new MtCart();
-        Integer cartId = 1;
+        Long cartId = 1L;
 
         // 检查库存是否充足
         if (action.equals("+") || action.equals("=") && reqDto.getNum() > 0) {
@@ -166,11 +166,11 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
         params.put("hangNo", reqDto.getHangNo() == null ? "" : reqDto.getHangNo());
 
         List<MtCart> cartList = queryCartListByParams(params);
-        if (action.equals("-") && cartList.size() == 0) {
+        if (action.equals("-") && cartList.isEmpty()) {
             return cartId;
         }
         // 已存在,仅操作数量增加或减少
-        if (cartList.size() > 0 && (mtCart.getId() == null || mtCart.getId() < 1)) {
+        if (!cartList.isEmpty() && (mtCart.getId() == null || mtCart.getId() < 1)) {
             mtCart = cartList.get(0);
             mtCart.setMerchantId(reqDto.getMerchantId());
             if (action.equals("+")) {
@@ -181,7 +181,7 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
                 Integer num = mtCart.getNum() - 1;
                 if (num <= 0) {
                     this.removeCart(mtCart.getId()+"");
-                    return Math.toIntExact(mtCart.getId());
+                    return mtCart.getId();
                 } else {
                     mtCart.setNum(mtCart.getNum() - 1);
                 }
@@ -192,7 +192,7 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
             this.save(mtCart);
         }
 
-        return Math.toIntExact(mtCart.getId());
+        return mtCart.getId();
     }
 
     /**
@@ -309,7 +309,7 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
     @Override
     @OperationServiceLog(description = "执行挂单")
     @Transactional(rollbackFor = Exception.class)
-    public MtCart setHangNo(Integer cartId, String hangNo, String isVisitor) throws BusinessCheckException {
+    public MtCart setHangNo(Long cartId, String hangNo, String isVisitor) throws BusinessCheckException {
         MtCart mtCart = mtCartMapper.selectById(cartId);
         if (mtCart != null) {
             mtCart.setHangNo(hangNo);

+ 2 - 2
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java

@@ -345,11 +345,11 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
         }
         // 会员名称已存在
         List<MtUser> userList = mtUserMapper.queryMemberByName(mtUser.getMerchantId(), mtUser.getName());
-        if (userList.size() > 0) {
+        if (!userList.isEmpty()) {
             mtUser.setName(userNo);
         }
         // 默认会员等级
-        if (StringUtil.isEmpty(mtUser.getGradeId().toString())) {
+        if (Objects.isNull(mtUser.getGradeId())) {
             MtUserGrade grade = userGradeService.getInitUserGrade(mtUser.getMerchantId());
             if (grade != null) {
                 mtUser.setGradeId(grade.getId());

+ 3 - 3
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/StaffServiceImpl.java

@@ -205,7 +205,7 @@ public class StaffServiceImpl extends ServiceImpl<MtStaffMapper, MtStaff> implem
      */
     @Override
     @OperationServiceLog(description = "修改店铺员工状态")
-    public Integer updateAuditedStatus(Long staffId, String status) throws BusinessCheckException {
+    public Long updateAuditedStatus(Long staffId, String status) throws BusinessCheckException {
         MtStaff mtStaff = mtStaffMapper.selectById(staffId);
         if (mtStaff != null) {
             mtStaff.setAuditedStatus(status);
@@ -231,10 +231,10 @@ public class StaffServiceImpl extends ServiceImpl<MtStaffMapper, MtStaff> implem
                 logger.error("修改店铺员工状态发送短信出错:", e.getMessage());
             }
         } else {
-            return 0;
+            return 0L;
         }
 
-        return Math.toIntExact(staffId);
+        return staffId;
     }
 
     /**

+ 151 - 2
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/TableCategoryServiceImpl.java

@@ -1,12 +1,161 @@
 package com.fuint.common.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fuint.framework.annoation.OperationServiceLog;
+import com.fuint.framework.exception.BusinessCheckException;
+import com.fuint.framework.pagination.PaginationRequest;
+import com.fuint.framework.pagination.PaginationResponse;
+import com.fuint.repository.model.MtTableCategory;
 import com.fuint.common.service.TableCategoryService;
+import com.fuint.common.enums.StatusEnum;
 import com.fuint.repository.mapper.MtTableCategoryMapper;
-import com.fuint.repository.model.MtTableCategory;
+import com.github.pagehelper.PageHelper;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.github.pagehelper.Page;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.PageRequest;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.*;
 
+/**
+ * 餐桌分类表服务接口
+ *
+ * Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
 @Service
-public class TableCategoryServiceImpl extends ServiceImpl<MtTableCategoryMapper,MtTableCategory> implements TableCategoryService {
+@AllArgsConstructor
+public class TableCategoryServiceImpl extends ServiceImpl<MtTableCategoryMapper, MtTableCategory> implements TableCategoryService {
+
+    private static final Logger logger = LoggerFactory.getLogger(TableCategoryServiceImpl.class);
+
+    private MtTableCategoryMapper mtTableCategoryMapper;
+
+    /**
+     * 分页查询数据列表
+     *
+     * @param paginationRequest
+     * @return
+     */
+    @Override
+    public PaginationResponse<MtTableCategory> queryTableCategoryListByPagination(PaginationRequest paginationRequest) {
+        Page<MtTableCategory> pageHelper = PageHelper.startPage(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
+        LambdaQueryWrapper<MtTableCategory> lambdaQueryWrapper = Wrappers.lambdaQuery();
+        lambdaQueryWrapper.ne(MtTableCategory::getDeleteFlag, 1);
+
+        lambdaQueryWrapper.orderByAsc(MtTableCategory::getId);
+        List<MtTableCategory> dataList = mtTableCategoryMapper.selectList(lambdaQueryWrapper);
+
+        PageRequest pageRequest = PageRequest.of(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
+        PageImpl pageImpl = new PageImpl(dataList, pageRequest, pageHelper.getTotal());
+        PaginationResponse<MtTableCategory> paginationResponse = new PaginationResponse(pageImpl, MtTableCategory.class);
+        paginationResponse.setTotalPages(pageHelper.getPages());
+        paginationResponse.setTotalElements(pageHelper.getTotal());
+        paginationResponse.setContent(dataList);
+
+        return paginationResponse;
+    }
+
+    /**
+     * 添加餐桌分类表
+     *
+     * @param mtTableCategory 餐桌分类表信息
+     * @return
+     */
+    @Override
+    @OperationServiceLog(description = "新增餐桌分类表")
+    public MtTableCategory addTableCategory(MtTableCategory mtTableCategory) throws BusinessCheckException {
+        mtTableCategory.setDeleteFlag(0);
+        mtTableCategory.setUpdateTime(new Date());
+        mtTableCategory.setCreateTime(new Date());
+        int id = mtTableCategoryMapper.insert(mtTableCategory);
+        if (id > 0) {
+            return mtTableCategory;
+        } else {
+            throw new BusinessCheckException("新增餐桌分类表数据失败");
+        }
+    }
+
+    /**
+     * 根据ID获餐桌分类表取息
+     *
+     * @param id 餐桌分类表ID
+     * @return
+     */
+    @Override
+    public MtTableCategory queryTableCategoryById(Long id) {
+        return mtTableCategoryMapper.selectById(id);
+    }
+
+    /**
+     * 根据ID删除餐桌分类表
+     *
+     * @param id 餐桌分类表ID
+     * @param operator 操作人
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @OperationServiceLog(description = "删除餐桌分类表")
+    public void deleteTableCategory(Long id, String operator) {
+        MtTableCategory mtTableCategory = queryTableCategoryById(id);
+        if (null == mtTableCategory) {
+            return;
+        }
+        mtTableCategory.setDeleteFlag(1);
+        mtTableCategory.setUpdateTime(new Date());
+        mtTableCategoryMapper.updateById(mtTableCategory);
+    }
+
+    /**
+     * 修改餐桌分类表数据
+     *
+     * @param mtTableCategory
+     * @throws BusinessCheckException
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @OperationServiceLog(description = "更新餐桌分类表")
+    public MtTableCategory updateTableCategory(MtTableCategory mtTableCategory) throws BusinessCheckException {
+        mtTableCategory = queryTableCategoryById(mtTableCategory.getId());
+        if (mtTableCategory == null) {
+            throw new BusinessCheckException("该餐桌分类表状态异常");
+        }
+        mtTableCategory.setUpdateTime(new Date());
+        mtTableCategoryMapper.updateById(mtTableCategory);
+        return mtTableCategory;
+    }
+
+   /**
+    * 根据条件搜索餐桌分类表
+    *
+    * @param  params 查询参数
+    * @throws BusinessCheckException
+    * @return
+    * */
+    @Override
+    public List<MtTableCategory> queryTableCategoryListByParams(Map<String, Object> params) {
+        String status =  params.get("status") == null ? StatusEnum.ENABLED.getKey(): params.get("status").toString();
+        String storeId =  params.get("storeId") == null ? "" : params.get("storeId").toString();
+        String merchantId =  params.get("merchantId") == null ? "" : params.get("merchantId").toString();
+
+        LambdaQueryWrapper<MtTableCategory> lambdaQueryWrapper = Wrappers.lambdaQuery();
+        if (StringUtils.isNotBlank(storeId)) {
+            lambdaQueryWrapper.and(wq -> wq
+                    .eq(MtTableCategory::getStoreId, 0)
+                    .or()
+                    .eq(MtTableCategory::getStoreId, storeId));
+        }
 
+        lambdaQueryWrapper.orderByAsc(MtTableCategory::getId);
+        List<MtTableCategory> dataList = mtTableCategoryMapper.selectList(lambdaQueryWrapper);
+        return dataList;
+    }
 }

+ 160 - 36
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/TableInfoServiceImpl.java

@@ -1,52 +1,176 @@
 package com.fuint.common.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fuint.common.service.TableCategoryService;
-import com.fuint.common.service.TableInfoService;
+import com.fuint.framework.annoation.OperationServiceLog;
+import com.fuint.framework.exception.BusinessCheckException;
+import com.fuint.framework.pagination.PaginationRequest;
+import com.fuint.framework.pagination.PaginationResponse;
 import com.fuint.repository.mapper.MtTableCategoryMapper;
-import com.fuint.repository.mapper.MtTableInfoMapper;
 import com.fuint.repository.model.MtTableCategory;
 import com.fuint.repository.model.MtTableInfo;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.fuint.common.service.TableInfoService;
+import com.fuint.common.enums.StatusEnum;
+import com.fuint.repository.mapper.MtTableInfoMapper;
+import com.github.pagehelper.PageHelper;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.github.pagehelper.Page;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.PageRequest;
 import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
-import java.util.stream.Collectors;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.*;
 
 /**
- * 《餐桌》服务层
+ * 餐桌信息服务接口
+ *
+ * Created by pzg
+ * CopyRight https://www.fuint.cn
  */
 @Service
+@AllArgsConstructor
 public class TableInfoServiceImpl extends ServiceImpl<MtTableInfoMapper, MtTableInfo> implements TableInfoService {
 
-	@Autowired
-	private MtTableCategoryMapper tableCategoryMapper;
-
-	/**
-	 * 获取餐桌列表
-	 *
-	 * @param storeId 店铺id
-	 * @return 结果
-	 */
-	@Override
-	public List<MtTableInfo> selectTableListByStoreId(Long storeId, Long categoryId) {
-		//通过店铺id获取店铺下的餐桌分类
-		MtTableCategory mtTableCategory = tableCategoryMapper.selectOne(new LambdaQueryWrapper<MtTableCategory>()
-				.select(MtTableCategory::getId,MtTableCategory::getStoreId)
-				.eq(MtTableCategory::getId, categoryId));
-		if (Objects.isNull(mtTableCategory) || !storeId.equals(mtTableCategory.getStoreId())) {
-			return new ArrayList<>();
-		}
-		//返回结果
-		return this.list(new LambdaQueryWrapper<MtTableInfo>()
-				.select(MtTableInfo::getId, MtTableInfo::getTableNumber)
-				.eq(MtTableInfo::getCategoryId, categoryId)
-				.eq(MtTableInfo::getTableStatus, "A"));
-	}
+    private static final Logger logger = LoggerFactory.getLogger(TableInfoServiceImpl.class);
+
+    private MtTableInfoMapper mtTableInfoMapper;
+
+    private MtTableCategoryMapper tableCategoryMapper;
+
+    /**
+     * 分页查询数据列表
+     *
+     * @param paginationRequest
+     * @return
+     */
+    @Override
+    public PaginationResponse<MtTableInfo> queryTableInfoListByPagination(PaginationRequest paginationRequest) {
+        Page<MtTableInfo> pageHelper = PageHelper.startPage(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
+        LambdaQueryWrapper<MtTableInfo> lambdaQueryWrapper = Wrappers.lambdaQuery();
+        lambdaQueryWrapper.ne(MtTableInfo::getDeleteFlag, 1);
+
+        lambdaQueryWrapper.orderByAsc(MtTableInfo::getId);
+        List<MtTableInfo> dataList = mtTableInfoMapper.selectList(lambdaQueryWrapper);
+
+        PageRequest pageRequest = PageRequest.of(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
+        PageImpl pageImpl = new PageImpl(dataList, pageRequest, pageHelper.getTotal());
+        PaginationResponse<MtTableInfo> paginationResponse = new PaginationResponse(pageImpl, MtTableInfo.class);
+        paginationResponse.setTotalPages(pageHelper.getPages());
+        paginationResponse.setTotalElements(pageHelper.getTotal());
+        paginationResponse.setContent(dataList);
+
+        return paginationResponse;
+    }
+
+    /**
+     * 添加餐桌信息
+     *
+     * @param mtTableInfo 餐桌信息信息
+     * @return
+     */
+    @Override
+    @OperationServiceLog(description = "新增餐桌信息")
+    public MtTableInfo addTableInfo(MtTableInfo mtTableInfo) throws BusinessCheckException {
+        mtTableInfo.setDeleteFlag(0);
+        mtTableInfo.setUpdateTime(new Date());
+        mtTableInfo.setCreateTime(new Date());
+        Integer id = mtTableInfoMapper.insert(mtTableInfo);
+        if (id > 0) {
+            return mtTableInfo;
+        } else {
+            throw new BusinessCheckException("新增餐桌信息数据失败");
+        }
+    }
+
+    /**
+     * 根据ID获餐桌信息取息
+     *
+     * @param id 餐桌信息ID
+     * @return
+     */
+    @Override
+    public MtTableInfo queryTableInfoById(Long id) {
+        return mtTableInfoMapper.selectById(id);
+    }
+
+    /**
+     * 根据ID删除餐桌信息
+     *
+     * @param id 餐桌信息ID
+     * @param operator 操作人
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @OperationServiceLog(description = "删除餐桌信息")
+    public void deleteTableInfo(Long id, String operator) {
+        MtTableInfo mtTableInfo = queryTableInfoById(id);
+        if (null == mtTableInfo) {
+            return;
+        }
+        mtTableInfo.setDeleteFlag(1);
+        mtTableInfo.setUpdateTime(new Date());
+        mtTableInfoMapper.updateById(mtTableInfo);
+    }
+
+    /**
+     * 修改餐桌信息数据
+     *
+     * @param mtTableInfo
+     * @throws BusinessCheckException
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @OperationServiceLog(description = "更新餐桌信息")
+    public MtTableInfo updateTableInfo(MtTableInfo mtTableInfo) throws BusinessCheckException {
+        mtTableInfo = queryTableInfoById(mtTableInfo.getId());
+        if (mtTableInfo == null) {
+            throw new BusinessCheckException("该餐桌信息状态异常");
+        }
+        mtTableInfo.setUpdateTime(new Date());
+        mtTableInfoMapper.updateById(mtTableInfo);
+        return mtTableInfo;
+    }
+
+   /**
+    * 根据条件搜索餐桌信息
+    *
+    * @param  params 查询参数
+    * @throws BusinessCheckException
+    * @return
+    * */
+    @Override
+    public List<MtTableInfo> queryTableInfoListByParams(Map<String, Object> params) {
+        String status =  params.get("status") == null ? StatusEnum.ENABLED.getKey(): params.get("status").toString();
+        String storeId =  params.get("storeId") == null ? "" : params.get("storeId").toString();
+        String merchantId =  params.get("merchantId") == null ? "" : params.get("merchantId").toString();
+
+        LambdaQueryWrapper<MtTableInfo> lambdaQueryWrapper = Wrappers.lambdaQuery();
+
+        lambdaQueryWrapper.orderByAsc(MtTableInfo::getId);
+        List<MtTableInfo> dataList = mtTableInfoMapper.selectList(lambdaQueryWrapper);
+        return dataList;
+    }
+
+    @Override
+    public List<MtTableInfo> selectTableListByStoreId(Long storeId, Long categoryId) {
+        //通过店铺id获取店铺下的餐桌分类
+        MtTableCategory mtTableCategory = tableCategoryMapper.selectOne(new LambdaQueryWrapper<MtTableCategory>()
+                .select(MtTableCategory::getId,MtTableCategory::getStoreId)
+                .eq(MtTableCategory::getId, categoryId));
+        if (Objects.isNull(mtTableCategory) || !storeId.equals(mtTableCategory.getStoreId())) {
+            return new ArrayList<>();
+        }
+        //返回结果
+        return this.list(new LambdaQueryWrapper<MtTableInfo>()
+                .select(MtTableInfo::getId, MtTableInfo::getTableNumber)
+                .eq(MtTableInfo::getCategoryId, categoryId)
+                .eq(MtTableInfo::getDeleteFlag, 0));
+    }
 }

+ 5 - 5
fuintBackend/fuint-application/src/main/java/com/fuint/common/util/CommonUtil.java

@@ -174,20 +174,20 @@ public class CommonUtil {
         sb.append(date);
 
         // 目前的会员id为9位,不确定后面会不会变更
-        if (userId.length() > 9) {
-            sb.append(userId.substring(userId.length() - 9, 9));
+       /* if (userId.length() > 19) {
+            sb.append(userId.substring(userId.length() - 19, 9));
         }
 
-        if (userId.length() == 9) {
+        if (userId.length() == 19) {
             sb.append(userId);
         }
 
         // 如果小于9位补位
-        if (userId.length() < 9) {
+        if (userId.length() < 19) {
             for (int i = 0; i < userId.length() - 9; i++) {
                 sb.append("0");
             }
-        }
+        }*/
 
         // 加上4位随机数
         sb.append(SeqUtil.getRandomNumber(4));

+ 5 - 6
fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendAccountController.java

@@ -274,7 +274,7 @@ public class BackendAccountController extends BaseController {
     public ResponseObject update(HttpServletRequest request, @RequestBody Map<String, Object> param) throws BusinessCheckException {
         String token = request.getHeader("Access-Token");
 
-        List<Integer> roleIds = (List) param.get("roleIds");
+        List<String> roleIds = (List<String>) param.get("roleIds");
         String realName = param.get("realName").toString();
         String accountName = param.get("accountName").toString();
         String accountStatus = param.get("accountStatus").toString();
@@ -314,11 +314,10 @@ public class BackendAccountController extends BaseController {
         }
 
         List<TDuty> duties = null;
-        if (roleIds.size() > 0) {
-            Integer[] roles = roleIds.toArray(new Integer[roleIds.size()]);
-            String[] ids = new String[roles.length];
-            for (int i = 0; i < roles.length; i++) {
-                ids[i] = roles[i].toString();
+        if (!roleIds.isEmpty()) {
+            String[] ids = new String[roleIds.size()];
+            for (int i = 0; i < roleIds.size(); i++) {
+                ids[i] = roleIds.get(i).toString();
             }
             duties = tDutyService.findDatasByIds(ids);
             if (duties.size() < roleIds.size()) {

+ 2 - 2
fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendCashierController.java

@@ -379,7 +379,7 @@ public class BackendCashierController extends BaseController {
             String[] ids = cartIds.split(",");
             if (ids.length > 0) {
                 for (int i = 0; i < ids.length; i++) {
-                     cartService.setHangNo(Integer.parseInt(ids[i]), hangNo, isVisitor);
+                     cartService.setHangNo(Long.valueOf(ids[i]), hangNo, isVisitor);
                 }
             }
         }
@@ -403,7 +403,7 @@ public class BackendCashierController extends BaseController {
         }
         Long storeId = accountInfo.getStoreId();
         //获取餐桌列表
-        List<MtTableInfo> tableInfoList = tableInfoService.selectTableListByStoreId(Long.valueOf(storeId),categoryId);
+        List<MtTableInfo> tableInfoList = tableInfoService.selectTableListByStoreId(storeId,categoryId);
 
         List<HangUpDto> dataList = new ArrayList<>();
 

+ 192 - 0
fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendTableCategoryController.java

@@ -0,0 +1,192 @@
+package com.fuint.module.backendApi.controller;
+
+import com.fuint.common.dto.AccountInfo;
+import com.fuint.common.util.TokenUtil;
+import com.fuint.framework.web.BaseController;
+import com.fuint.framework.web.ResponseObject;
+import com.fuint.common.Constants;
+import com.fuint.common.enums.StatusEnum;
+import com.fuint.common.service.TableCategoryService;
+import com.fuint.framework.pagination.PaginationRequest;
+import com.fuint.framework.pagination.PaginationResponse;
+import com.fuint.framework.exception.BusinessCheckException;
+import com.fuint.repository.model.MtTableCategory;
+import com.fuint.utils.StringUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 餐桌分类表管理类controller
+ *
+ * Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
+@Api(tags="管理端-餐桌分类表相关接口")
+@RestController
+@AllArgsConstructor
+@RequestMapping(value = "/backendApi/table_category")
+public class BackendTableCategoryController extends BaseController {
+
+    /**
+     * 餐桌分类表服务接口
+     */
+    private TableCategoryService tableCategoryService;
+
+    /**
+     * 餐桌分类表列表查询
+     *
+     * @param  request HttpServletRequest对象
+     * @return 餐桌分类表列表
+     */
+    @ApiOperation(value = "餐桌分类表列表查询")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @CrossOrigin
+    @PreAuthorize("@pms.hasPermission('table_category:list')")
+    public ResponseObject list(HttpServletRequest request) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
+        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"));
+        String title = request.getParameter("title");
+        String status = request.getParameter("status");
+        String searchStoreId = request.getParameter("storeId");
+
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        Long storeId;
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        } else {
+            storeId = accountInfo.getStoreId();
+        }
+
+        PaginationRequest paginationRequest = new PaginationRequest();
+        paginationRequest.setCurrentPage(page);
+        paginationRequest.setPageSize(pageSize);
+
+        Map<String, Object> params = new HashMap<>();
+        if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
+            params.put("merchantId", accountInfo.getMerchantId());
+        }
+        if (StringUtil.isNotEmpty(title)) {
+            params.put("title", title);
+        }
+        if (StringUtil.isNotEmpty(status)) {
+            params.put("status", status);
+        }
+        if (StringUtil.isNotEmpty(searchStoreId)) {
+            params.put("storeId", searchStoreId);
+        }
+        if (storeId != null && storeId > 0) {
+            params.put("storeId", storeId);
+        }
+        paginationRequest.setSearchParams(params);
+        PaginationResponse<MtTableCategory> paginationResponse = tableCategoryService.queryTableCategoryListByPagination(paginationRequest);
+
+        Map<String, Object> paramsStore = new HashMap<>();
+        paramsStore.put("status", StatusEnum.ENABLED.getKey());
+        if (accountInfo.getStoreId() != null && accountInfo.getStoreId() > 0) {
+            paramsStore.put("storeId", accountInfo.getStoreId().toString());
+        }
+        if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
+            paramsStore.put("merchantId", accountInfo.getMerchantId());
+        }
+
+        Map<String, Object> result = new HashMap<>();
+        result.put("paginationResponse", paginationResponse);
+
+        return getSuccessResult(result);
+    }
+
+    /**
+     * 更新餐桌分类表状态
+     *
+     * @return
+     */
+    @ApiOperation(value = "更新餐桌分类表状态")
+    @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
+    @CrossOrigin
+    @PreAuthorize("@pms.hasPermission('table_category:edit')")
+    public ResponseObject updateStatus(HttpServletRequest request, @RequestBody Map<String, Object> params) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
+        String status = params.get("status") != null ? params.get("status").toString() : StatusEnum.ENABLED.getKey();
+        Long id = params.get("id") == null ? 0 : Long.parseLong(params.get("id").toString());
+
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        }
+
+        MtTableCategory mtTableCategory = tableCategoryService.queryTableCategoryById(id);
+        if (mtTableCategory == null) {
+            return getFailureResult(201);
+        }
+
+        String operator = accountInfo.getAccountName();
+        tableCategoryService.updateTableCategory(mtTableCategory);
+
+        return getSuccessResult(true);
+    }
+
+    /**
+     * 保存餐桌分类表
+     *
+     * @param request HttpServletRequest对象
+     * @return
+     */
+    @ApiOperation(value = "保存餐桌分类表")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @CrossOrigin
+    @PreAuthorize("@pms.hasPermission('table_category:add')")
+    public ResponseObject saveHandler(HttpServletRequest request, @RequestBody Map<String, Object> params) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
+        String id = params.get("id") == null ? "" : params.get("id").toString();
+        String status = params.get("status") == null ? "" : params.get("status").toString();
+        String storeId = params.get("storeId") == null ? "0" : params.get("storeId").toString();
+
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        }
+
+        MtTableCategory info = new MtTableCategory();
+
+        if (StringUtil.isNotEmpty(id)) {
+            info.setId(Long.valueOf(id));
+            tableCategoryService.updateTableCategory(info);
+        } else {
+            tableCategoryService.addTableCategory(info);
+        }
+
+        return getSuccessResult(true);
+    }
+
+    /**
+     * 获取餐桌分类表详情
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "获取餐桌分类表详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    @CrossOrigin
+    @PreAuthorize("@pms.hasPermission('table_category:list')")
+    public ResponseObject info(HttpServletRequest request, @PathVariable("id") Integer id) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        }
+
+        MtTableCategory table_categoryInfo = tableCategoryService.queryTableCategoryById(Long.valueOf(id));
+
+        Map<String, Object> result = new HashMap<>();
+        result.put("table_categoryInfo", table_categoryInfo);
+
+        return getSuccessResult(result);
+    }
+}

+ 187 - 0
fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendTableInfoController.java

@@ -0,0 +1,187 @@
+package com.fuint.module.backendApi.controller;
+
+import com.fuint.common.dto.AccountInfo;
+import com.fuint.common.util.TokenUtil;
+import com.fuint.framework.web.BaseController;
+import com.fuint.framework.web.ResponseObject;
+import com.fuint.common.Constants;
+import com.fuint.common.enums.StatusEnum;
+import com.fuint.common.service.TableInfoService;
+import com.fuint.framework.pagination.PaginationRequest;
+import com.fuint.framework.pagination.PaginationResponse;
+import com.fuint.framework.exception.BusinessCheckException;
+import com.fuint.repository.model.MtTableInfo;
+import com.fuint.utils.StringUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 餐桌信息管理类controller
+ *
+ * Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
+@Api(tags="管理端-餐桌信息相关接口")
+@RestController
+@AllArgsConstructor
+@RequestMapping(value = "/backendApi/table_info")
+public class BackendTableInfoController extends BaseController {
+
+    /**
+     * 餐桌信息服务接口
+     */
+    private TableInfoService tableInfoService;
+
+    /**
+     * 餐桌信息列表查询
+     *
+     * @param  request HttpServletRequest对象
+     * @return 餐桌信息列表
+     */
+    @ApiOperation(value = "餐桌信息列表查询")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @CrossOrigin
+    @PreAuthorize("@pms.hasPermission('table_info:list')")
+    public ResponseObject list(HttpServletRequest request) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
+        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"));
+        String title = request.getParameter("title");
+        String status = request.getParameter("status");
+        String searchStoreId = request.getParameter("storeId");
+
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        Long storeId;
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        } else {
+            storeId = accountInfo.getStoreId();
+        }
+
+        PaginationRequest paginationRequest = new PaginationRequest();
+        paginationRequest.setCurrentPage(page);
+        paginationRequest.setPageSize(pageSize);
+
+        Map<String, Object> params = new HashMap<>();
+        if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
+            params.put("merchantId", accountInfo.getMerchantId());
+        }
+        if (StringUtil.isNotEmpty(title)) {
+            params.put("title", title);
+        }
+        if (StringUtil.isNotEmpty(status)) {
+            params.put("status", status);
+        }
+        if (StringUtil.isNotEmpty(searchStoreId)) {
+            params.put("storeId", searchStoreId);
+        }
+        if (storeId != null && storeId > 0) {
+            params.put("storeId", storeId);
+        }
+        paginationRequest.setSearchParams(params);
+        PaginationResponse<MtTableInfo> paginationResponse = tableInfoService.queryTableInfoListByPagination(paginationRequest);
+
+        Map<String, Object> paramsStore = new HashMap<>();
+        paramsStore.put("status", StatusEnum.ENABLED.getKey());
+        if (accountInfo.getStoreId() != null && accountInfo.getStoreId() > 0) {
+            paramsStore.put("storeId", accountInfo.getStoreId().toString());
+        }
+        if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
+            paramsStore.put("merchantId", accountInfo.getMerchantId());
+        }
+
+        Map<String, Object> result = new HashMap<>();
+        result.put("paginationResponse", paginationResponse);
+
+        return getSuccessResult(result);
+    }
+
+    /**
+     * 更新餐桌信息状态
+     *
+     * @return
+     */
+    @ApiOperation(value = "更新餐桌信息状态")
+    @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
+    @CrossOrigin
+    @PreAuthorize("@pms.hasPermission('table_info:edit')")
+    public ResponseObject updateStatus(HttpServletRequest request, @RequestBody Map<String, Object> params) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
+        String status = params.get("status") != null ? params.get("status").toString() : StatusEnum.ENABLED.getKey();
+        Long id = params.get("id") == null ? 0 : Long.parseLong(params.get("id").toString());
+
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        }
+
+        MtTableInfo mtTableInfo = tableInfoService.queryTableInfoById(id);
+        if (mtTableInfo == null) {
+            return getFailureResult(201);
+        }
+
+        String operator = accountInfo.getAccountName();
+        tableInfoService.updateTableInfo(mtTableInfo);
+
+        return getSuccessResult(true);
+    }
+
+    /**
+     * 保存餐桌信息
+     *
+     * @param request HttpServletRequest对象
+     * @return
+     */
+    @ApiOperation(value = "保存餐桌信息")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @CrossOrigin
+    @PreAuthorize("@pms.hasPermission('table_info:add')")
+    public ResponseObject saveHandler(HttpServletRequest request, @RequestBody Map<String, Object> params) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
+        String id = params.get("id") == null ? "" : params.get("id").toString();
+        String status = params.get("status") == null ? "" : params.get("status").toString();
+        String storeId = params.get("storeId") == null ? "0" : params.get("storeId").toString();
+
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        }
+
+        MtTableInfo info = new MtTableInfo();
+        if (StringUtil.isNotEmpty(id)) {
+            tableInfoService.updateTableInfo(info);
+        } else {
+            tableInfoService.addTableInfo(info);
+        }
+
+        return getSuccessResult(true);
+    }
+
+    /**
+     * 获取餐桌信息详情
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "获取餐桌信息详情")
+    @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
+    @CrossOrigin
+    @PreAuthorize("@pms.hasPermission('table_info:list')")
+    public ResponseObject info(HttpServletRequest request, @PathVariable("id") Integer id) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        }
+
+        Map<String, Object> result = new HashMap<>();
+
+        return getSuccessResult(result);
+    }
+}

+ 1 - 1
fuintBackend/fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientCartController.java

@@ -164,7 +164,7 @@ public class ClientCartController extends BaseController {
         mtCart.setMerchantId(merchantId);
         mtCart.setTableId(tableId);
 
-        Integer id = cartService.saveCart(mtCart, action);
+        Long id = cartService.saveCart(mtCart, action);
         Map<String, Object> data = new HashMap();
         data.put("cartId", id);
 

+ 9 - 3
fuintBackend/fuint-repository/src/main/java/com/fuint/repository/mapper/MtTableCategoryMapper.java

@@ -1,8 +1,14 @@
 package com.fuint.repository.mapper;
 
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fuint.repository.model.MtTableCategory;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+/**
+ * 餐桌分类表 Mapper 接口
+ *
+ * Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
 public interface MtTableCategoryMapper extends BaseMapper<MtTableCategory> {
-}
+
+}

+ 9 - 3
fuintBackend/fuint-repository/src/main/java/com/fuint/repository/mapper/MtTableInfoMapper.java

@@ -1,8 +1,14 @@
 package com.fuint.repository.mapper;
 
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fuint.repository.model.MtTableInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
-
+/**
+ * 餐桌信息 Mapper 接口
+ *
+ * Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
 public interface MtTableInfoMapper extends BaseMapper<MtTableInfo> {
-}
+
+}

+ 38 - 19
fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtTableCategory.java

@@ -3,38 +3,57 @@ package com.fuint.repository.model;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.util.Date;
-
+/**
+ * 餐桌分类表实体
+ *
+ * @Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
 @Getter
 @Setter
 @TableName("mt_table_category")
-@ApiModel(value = "mt_table_category表对象", description = "mt_table_category表对象")
-public class MtTableCategory {
+@ApiModel(value = "table_category表对象", description = "table_category表对象")
+public class MtTableCategory implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("桌号分类名称,如一楼、二楼等")
+    private String categoryName;
+
+    @ApiModelProperty("记录创建时间")
+    private Date createTime;
+
+    @ApiModelProperty("创建用户id")
+    private String createUserId;
+
+    @ApiModelProperty("是否删除 0否 1是")
+    private Integer deleteFlag;
+
+    @ApiModelProperty("桌号分类描述,可选")
+    private String description;
 
-	@ApiModelProperty("餐桌分类Id")
-	@TableId(value = "ID", type = IdType.ID_WORKER)
-	private Long id;
+    @ApiModelProperty("桌号分类ID,主键,自增")
+    @TableId(value = "ID", type = IdType.AUTO)
+    private Long id;
 
-	@ApiModelProperty("店铺id")
-	private Long storeId;
+    @ApiModelProperty("项目标识")
+    private String project;
 
-	@ApiModelProperty("分类名")
-	private String categoryName;
 
-	@ApiModelProperty("描述")
-	private String description;
+    @ApiModelProperty("门店ID,外键,关联到store表")
+    private Long storeId;
 
-	@ApiModelProperty("创建时间")
-	private Date createTime;
+    @ApiModelProperty("记录更新时间")
+    private Date updateTime;
 
-	@ApiModelProperty("更新时间")
-	private Date updateTime;
+    @ApiModelProperty("修改用户id")
+    private String updateUserId;
 
-	@ApiModelProperty("A:正常;D:删除")
-	private String status;
 }

+ 40 - 19
fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtTableInfo.java

@@ -3,38 +3,59 @@ package com.fuint.repository.model;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.util.Date;
-
+/**
+ * 餐桌信息实体
+ *
+ * @Created by pzg
+ * CopyRight https://www.fuint.cn
+ */
 @Getter
 @Setter
 @TableName("mt_table_info")
-@ApiModel(value = "mt_table_category表对象", description = "mt_table_category表对象")
-public class MtTableInfo {
+@ApiModel(value = "table_info表对象", description = "table_info表对象")
+public class MtTableInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("餐桌容纳人数")
+    private Integer capacity;
+
+    @ApiModelProperty("桌号分类ID,外键,关联到table_category表")
+    private Long categoryId;
+
+    @ApiModelProperty("记录创建时间")
+    private Date createTime;
+
+    @ApiModelProperty("创建用户id")
+    private String createUserId;
+
+    @ApiModelProperty("是否删除 0否 1是")
+    private Integer deleteFlag;
 
-	@ApiModelProperty("自增ID")
-	@TableId(value = "ID", type = IdType.ID_WORKER)
-	private Long id;
+    @ApiModelProperty("餐桌ID,主键,自增")
+    @TableId(value = "ID", type = IdType.AUTO)
+    private Long id;
 
-	@ApiModelProperty("餐桌分类id")
-	private Long categoryId;
+    @ApiModelProperty("项目标识")
+    private String project;
 
-	@ApiModelProperty("餐桌编号")
-	private String tableNumber;
+    @ApiModelProperty("餐桌编号,如T001、T002等")
+    private String tableNumber;
 
-	@ApiModelProperty("餐桌状态,0空闲、1占用或2预订")
-	private Integer tableStatus;
+    @ApiModelProperty("餐桌状态,0空闲、1占用或2预订")
+    private Integer tableStatus;
 
-	@ApiModelProperty("餐桌容纳人数")
-	private Integer capacity;
+    @ApiModelProperty("记录更新时间")
+    private Date updateTime;
 
-	@ApiModelProperty("创建时间")
-	private Date createTime;
+    @ApiModelProperty("修改用户id")
+    private String updateUserId;
 
-	@ApiModelProperty("更新时间")
-	private Date updateTime;
 }

+ 5 - 0
fuintBackend/fuint-repository/src/main/resources/mapper/MtTableCategoryMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fuint.repository.mapper.MtTableCategoryMapper}">
+
+</mapper>

+ 5 - 0
fuintBackend/fuint-repository/src/main/resources/mapper/MtTableInfoMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fuint.repository.mapper.MtTableInfoMapper}">
+
+</mapper>