소스 검색

优化queryStaffList接口

zhangchen 3 달 전
부모
커밋
86ba1b9d69

+ 55 - 24
alien-store/src/main/java/shop/alien/store/controller/StoreStaffConfigController.java

@@ -15,6 +15,7 @@ import shop.alien.entity.store.vo.StoreStaffFitnessDetailVo;
 import shop.alien.entity.store.vo.StoreStaffPositionCountVo;
 import shop.alien.mapper.StoreDictionaryMapper;
 import shop.alien.store.service.StoreStaffConfigService;
+import shop.alien.store.util.CommonConstant;
 
 import java.io.IOException;
 import java.util.HashMap;
@@ -138,12 +139,16 @@ public class StoreStaffConfigController {
 
     /**
      * 员工列表查询接口(用户端)
+     * <p>
+     * 根据店铺ID查询员工列表,支持按状态和职位筛选,返回结果包含员工基本信息和今日是否有演出标识
+     * </p>
      *
-     * @param page    分页页数,默认1
-     * @param size    分页条数,默认10
-     * @param storeId 店铺ID,必填
-     * @param status  员工状态,可选(0-待审核 1-审核通过 2-审核拒绝)
-     * @return 员工列表
+     * @param page          分页页数,默认1,必须大于0
+     * @param size          分页条数,默认10,必须大于0且不超过100
+     * @param storeId       店铺ID,必填,必须大于0
+     * @param status        员工状态,可选(0-待审核 1-审核通过 2-审核拒绝)
+     * @param staffPosition 员工职位,可选,支持精确匹配
+     * @return 员工列表分页结果,包含员工基本信息和今日是否有演出标识
      */
     @ApiOperation("员工列表查询(用户端)")
     @ApiOperationSupport(order = 5)
@@ -161,27 +166,53 @@ public class StoreStaffConfigController {
             @RequestParam(value = "storeId") Integer storeId,
             @RequestParam(value = "status", required = false) String status,
             @RequestParam(value = "staffPosition", required = false) String staffPosition) {
-        log.info("查询员工列表,参数:page={}, size={}, storeId={}, status={}, staffPosition={}", page, size, storeId, status, staffPosition);
+        log.info("查询员工列表,参数:page={}, size={}, storeId={}, status={}, staffPosition={}", 
+                page, size, storeId, status, staffPosition);
 
-        // 参数校验
-        if (storeId == null || storeId <= 0) {
-            log.warn("查询员工列表失败,店铺ID无效:storeId={}", storeId);
-            return R.fail("店铺ID不能为空且必须大于0");
-        }
-        if (page == null || page < 1) {
-            page = 1;
-        }
-        if (size == null || size < 1) {
-            size = 10;
-        }
-        // 限制分页大小,防止查询过多数据
-        if (size > 100) {
-            size = 100;
-        }
+        try {
+            // 参数校验
+            if (storeId == null || storeId <= 0) {
+                log.warn("查询员工列表参数校验失败,店铺ID无效:storeId={}", storeId);
+                return R.fail("店铺ID不能为空且必须大于0");
+            }
+            if (page != null && page < 1) {
+                log.warn("查询员工列表参数校验失败,分页页数无效:page={}", page);
+                return R.fail("分页页数必须大于0");
+            }
+            if (size != null && size < 1) {
+                log.warn("查询员工列表参数校验失败,分页条数无效:size={}", size);
+                return R.fail("分页条数必须大于0");
+            }
+            if (size != null && size > CommonConstant.MAX_PAGE_SIZE) {
+                log.warn("查询员工列表参数校验失败,分页条数超过最大值:size={}", size);
+                return R.fail("分页条数不能超过" + CommonConstant.MAX_PAGE_SIZE);
+            }
 
-        IPage<StoreStaffConfig> result = storeStaffConfigService.queryStaffList(page, size, storeId, status, staffPosition);
-        log.info("查询员工列表成功,共{}条记录", result.getTotal());
-        return R.data(result);
+            // 规范化分页参数
+            Integer normalizedPage = (page == null || page < 1) ? CommonConstant.DEFAULT_PAGE_NUM : page;
+            Integer normalizedSize;
+            if (size == null || size < 1) {
+                normalizedSize = CommonConstant.DEFAULT_PAGE_SIZE;
+            } else if (size > CommonConstant.MAX_PAGE_SIZE) {
+                normalizedSize = CommonConstant.MAX_PAGE_SIZE;
+            } else {
+                normalizedSize = size;
+            }
+
+            // 调用服务层查询
+            IPage<StoreStaffConfig> result = storeStaffConfigService.queryStaffList(
+                    normalizedPage, normalizedSize, storeId, status, staffPosition);
+            
+            log.info("查询员工列表成功,店铺ID={},共{}条记录,当前页{}条", 
+                    storeId, result.getTotal(), result.getRecords() != null ? result.getRecords().size() : 0);
+            return R.data(result);
+        } catch (IllegalArgumentException e) {
+            log.warn("查询员工列表参数错误,storeId={},错误信息:{}", storeId, e.getMessage());
+            return R.fail(e.getMessage());
+        } catch (Exception e) {
+            log.error("查询员工列表异常,storeId={},异常信息:{}", storeId, e.getMessage(), e);
+            return R.fail("查询员工列表失败,请稍后重试");
+        }
     }
 
     /**

+ 317 - 103
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffConfigServiceImpl.java

@@ -784,23 +784,71 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
         return storeStaffConfigMapper.update(null, lambdaUpdateWrapper);
     }
 
+    /**
+     * 员工列表查询(用户端)
+     * <p>
+     * 查询指定店铺的员工列表,支持按状态和职位筛选
+     * 排序规则:先按置顶状态降序,再按置顶时间降序,最后按创建时间降序
+     * 返回结果中包含员工基本信息和今日是否有演出标识
+     * </p>
+     *
+     * @param page          分页页数,必须大于0
+     * @param size          分页条数,必须大于0
+     * @param storeId       店铺ID,必须大于0
+     * @param status        员工状态,可选(0-待审核 1-审核通过 2-审核拒绝),为空时查询所有状态
+     * @param staffPosition 员工职位,可选,为空时查询所有职位
+     * @return 员工列表分页结果,包含员工基本信息和今日是否有演出标识
+     * @throws IllegalArgumentException 当参数无效时抛出
+     */
     @Override
     public IPage<StoreStaffConfig> queryStaffList(Integer page, Integer size, Integer storeId, String status, String staffPosition) {
         // 参数校验
+        validateQueryParams(page, size, storeId);
+
+        // 构建分页对象
+        IPage<StoreStaffConfig> staffPage = new Page<>(page, size);
+
+        // 构建查询条件
+        LambdaQueryWrapper<StoreStaffConfig> queryWrapper = buildStaffListQueryWrapper(storeId, status, staffPosition);
+
+        // 执行查询
+        IPage<StoreStaffConfig> result = storeStaffConfigMapper.selectPage(staffPage, queryWrapper);
+        
+        // 批量填充今日是否有演出字段(性能优化:批量查询)
+        fillHasPerformanceTodayBatch(result);
+        
+        return result;
+    }
+
+    /**
+     * 校验查询参数
+     *
+     * @param page    分页页数
+     * @param size    分页条数
+     * @param storeId 店铺ID
+     * @throws IllegalArgumentException 当参数无效时抛出
+     */
+    private void validateQueryParams(Integer page, Integer size, Integer storeId) {
         if (page == null || page < 1) {
-            page = 1;
+            throw new IllegalArgumentException("分页页数不能为空且必须大于0");
         }
         if (size == null || size < 1) {
-            size = 10;
+            throw new IllegalArgumentException("分页条数不能为空且必须大于0");
         }
         if (storeId == null || storeId <= 0) {
             throw new IllegalArgumentException("店铺ID不能为空且必须大于0");
         }
+    }
 
-        // 构建分页对象
-        IPage<StoreStaffConfig> staffPage = new Page<>(page, size);
-
-        // 使用 LambdaQueryWrapper 构建查询条件,类型安全
+    /**
+     * 构建员工列表查询条件
+     *
+     * @param storeId       店铺ID
+     * @param status        员工状态,可选
+     * @param staffPosition 员工职位,可选
+     * @return 查询条件包装器
+     */
+    private LambdaQueryWrapper<StoreStaffConfig> buildStaffListQueryWrapper(Integer storeId, String status, String staffPosition) {
         LambdaQueryWrapper<StoreStaffConfig> queryWrapper = new LambdaQueryWrapper<>();
 
         // 必须条件:店铺ID和未删除
@@ -822,131 +870,297 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
                 .orderByDesc(StoreStaffConfig::getTopTime)
                 .orderByDesc(StoreStaffConfig::getCreatedTime);
 
-        IPage<StoreStaffConfig> result = storeStaffConfigMapper.selectPage(staffPage, queryWrapper);
-        
-        // 填充今日是否有演出字段
-        if (result != null && result.getRecords() != null) {
+        return queryWrapper;
+    }
+
+    /**
+     * 批量填充员工今日是否有演出字段
+     * <p>
+     * 性能优化:批量查询所有员工的演出信息,避免N+1查询问题
+     * </p>
+     *
+     * @param result 员工列表分页结果
+     */
+    private void fillHasPerformanceTodayBatch(IPage<StoreStaffConfig> result) {
+        if (result == null || result.getRecords() == null || result.getRecords().isEmpty()) {
+            return;
+        }
+
+        try {
+            // 获取所有员工ID
+            List<Integer> staffIds = result.getRecords().stream()
+                    .map(StoreStaffConfig::getId)
+                    .filter(id -> id != null && id > 0)
+                    .distinct()
+                    .collect(Collectors.toList());
+
+            if (staffIds.isEmpty()) {
+                return;
+            }
+
+            // 批量查询今日有演出的员工ID集合
+            java.util.Set<Integer> staffIdsWithPerformanceToday = queryStaffIdsWithPerformanceToday(staffIds);
+
+            // 填充字段
             for (StoreStaffConfig staff : result.getRecords()) {
-                Boolean hasPerformanceToday = checkHasPerformanceToday(staff.getId());
-                staff.setHasPerformanceToday(hasPerformanceToday);
+                if (staff.getId() != null) {
+                    Boolean hasPerformanceToday = staffIdsWithPerformanceToday.contains(staff.getId());
+                    staff.setHasPerformanceToday(hasPerformanceToday);
+                } else {
+                    staff.setHasPerformanceToday(false);
+                }
+            }
+        } catch (Exception e) {
+            log.error("批量填充员工今日是否有演出字段异常,异常信息:{}", e.getMessage(), e);
+            // 异常时设置为false,不影响主流程
+            for (StoreStaffConfig staff : result.getRecords()) {
+                staff.setHasPerformanceToday(false);
             }
         }
-        
-        return result;
     }
 
     /**
-     * 判断员工今日是否有演出
-     * <p>
-     * 根据演出表(bar_performance)查询该员工是否有今日的演出安排
-     * 判断条件:
-     * 1. 演出审核状态为通过(review_status = 1)
-     * 2. 演出未删除(delete_flag = 0)
-     * 3. 演出已上线(online_status = 1)
-     * 4. 演出时间包含今天:
-     *    - 单次演出:开始时间 <= 今天结束 AND 结束时间 >= 今天开始
-     *    - 每天定时:开始日期 <= 今天 <= 结束日期
-     *    - 每周定时:开始日期 <= 今天 <= 结束日期 且 演出日期包含今天对应的星期几
-     * </p>
+     * 批量查询今日有演出的员工ID集合
      *
-     * @param staffId 员工ID
-     * @return true-今日有演出,false-今日无演出
+     * @param staffIds 员工ID列表
+     * @return 今日有演出的员工ID集合
      */
-    private Boolean checkHasPerformanceToday(Integer staffId) {
-        if (staffId == null || staffId <= 0) {
-            return false;
+    private java.util.Set<Integer> queryStaffIdsWithPerformanceToday(List<Integer> staffIds) {
+        if (staffIds == null || staffIds.isEmpty()) {
+            return new java.util.HashSet<>();
         }
 
         try {
-            // 获取今天的开始时间(00:00:00)和结束时间(23:59:59)
-            Date now = new Date();
-            java.util.Calendar cal = java.util.Calendar.getInstance();
-            cal.setTime(now);
-            cal.set(java.util.Calendar.HOUR_OF_DAY, 0);
-            cal.set(java.util.Calendar.MINUTE, 0);
-            cal.set(java.util.Calendar.SECOND, 0);
-            cal.set(java.util.Calendar.MILLISECOND, 0);
-            Date todayStart = cal.getTime();
-            
-            // 获取今天是星期几(0-周一,1-周二,...,6-周日)
-            int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
-            
-            // 重新设置Calendar获取今天的结束时间
-            cal.set(java.util.Calendar.HOUR_OF_DAY, 23);
-            cal.set(java.util.Calendar.MINUTE, 59);
-            cal.set(java.util.Calendar.SECOND, 59);
-            cal.set(java.util.Calendar.MILLISECOND, 999);
-            Date todayEnd = cal.getTime();
-            // Calendar中:1=周日,2=周一,...,7=周六
-            // 转换为:0=周一,1=周二,...,6=周日
-            int todayWeekDay = (dayOfWeek == 1) ? 6 : (dayOfWeek - 2);
-            String todayWeekDayStr = String.valueOf(todayWeekDay);
-
-            // 查询包含该员工的演出
+            // 获取今天的开始和结束时间
+            TodayTimeRange todayTimeRange = getTodayTimeRange();
+
+            // 查询所有包含这些员工的演出
             LambdaQueryWrapper<BarPerformance> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(BarPerformance::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE)
-                    .eq(BarPerformance::getReviewStatus, 1)
-                    .eq(BarPerformance::getOnlineStatus, 1)
-                    .like(BarPerformance::getStaffConfigIds, staffId.toString());
+                    .eq(BarPerformance::getReviewStatus, CommonConstant.PERFORMANCE_REVIEW_STATUS_APPROVED)
+                    .eq(BarPerformance::getOnlineStatus, CommonConstant.PERFORMANCE_ONLINE_STATUS_ONLINE);
+
+            // 构建staffConfigIds的查询条件(使用OR连接多个LIKE条件)
+            queryWrapper.and(wrapper -> {
+                for (Integer staffId : staffIds) {
+                    wrapper.or(w -> w.like(BarPerformance::getStaffConfigIds, staffId.toString()));
+                }
+            });
 
             List<BarPerformance> performances = barPerformanceMapper.selectList(queryWrapper);
 
             if (performances == null || performances.isEmpty()) {
-                return false;
+                return new java.util.HashSet<>();
             }
 
-            // 遍历演出,判断是否有今日的演出
+            // 筛选出今日有演出的员工ID
+            java.util.Set<Integer> staffIdsWithPerformance = new java.util.HashSet<>();
             for (BarPerformance performance : performances) {
-                String frequency = performance.getPerformanceFrequency();
-                
-                if (StringUtils.isEmpty(frequency)) {
-                    continue;
+                if (isPerformanceToday(performance, todayTimeRange)) {
+                    // 解析staffConfigIds,提取员工ID
+                    List<Integer> performanceStaffIds = parseStaffConfigIds(performance.getStaffConfigIds());
+                    for (Integer staffId : performanceStaffIds) {
+                        if (staffIds.contains(staffId)) {
+                            staffIdsWithPerformance.add(staffId);
+                        }
+                    }
                 }
+            }
 
-                boolean isToday = false;
+            return staffIdsWithPerformance;
+        } catch (Exception e) {
+            log.error("批量查询今日有演出的员工ID异常,异常信息:{}", e.getMessage(), e);
+            return new java.util.HashSet<>();
+        }
+    }
 
-                switch (frequency) {
-                    case "0": // 单次演出
-                        Date singleStart = performance.getSingleStartDatetime();
-                        Date singleEnd = performance.getSingleEndDatetime();
-                        if (singleStart != null && singleEnd != null) {
-                            // 判断:开始时间 <= 今天结束 AND 结束时间 >= 今天开始
-                            isToday = !singleStart.after(todayEnd) && !singleEnd.before(todayStart);
-                        }
-                        break;
-                    case "1": // 每天定时
-                        Date dailyStart = performance.getDailyStartDate();
-                        Date dailyEnd = performance.getDailyEndDate();
-                        if (dailyStart != null && dailyEnd != null) {
-                            // 判断:开始日期 <= 今天 <= 结束日期
-                            isToday = !dailyStart.after(todayEnd) && !dailyEnd.before(todayStart);
-                        }
-                        break;
-                    case "2": // 每周定时
-                        Date weeklyStart = performance.getDailyStartDate();
-                        Date weeklyEnd = performance.getDailyEndDate();
-                        String performanceWeek = performance.getPerformanceWeek();
-                        if (weeklyStart != null && weeklyEnd != null && StringUtils.isNotEmpty(performanceWeek)) {
-                            // 判断:开始日期 <= 今天 <= 结束日期 且 演出日期包含今天对应的星期几
-                            boolean dateInRange = !weeklyStart.after(todayEnd) && !weeklyEnd.before(todayStart);
-                            boolean weekDayMatch = performanceWeek.contains(todayWeekDayStr);
-                            isToday = dateInRange && weekDayMatch;
-                        }
-                        break;
-                    default:
-                        break;
-                }
+    /**
+     * 判断演出是否在今天
+     *
+     * @param performance    演出信息
+     * @param todayTimeRange 今天的时间范围
+     * @return true-今日有演出,false-今日无演出
+     */
+    private boolean isPerformanceToday(BarPerformance performance, TodayTimeRange todayTimeRange) {
+        if (performance == null || todayTimeRange == null) {
+            return false;
+        }
 
-                if (isToday) {
-                    return true;
-                }
-            }
+        String frequency = performance.getPerformanceFrequency();
+        if (StringUtils.isEmpty(frequency)) {
+            return false;
+        }
+
+        switch (frequency) {
+            case CommonConstant.PERFORMANCE_FREQUENCY_SINGLE:
+                return isSinglePerformanceToday(performance, todayTimeRange);
+            case CommonConstant.PERFORMANCE_FREQUENCY_DAILY:
+                return isDailyPerformanceToday(performance, todayTimeRange);
+            case CommonConstant.PERFORMANCE_FREQUENCY_WEEKLY:
+                return isWeeklyPerformanceToday(performance, todayTimeRange);
+            default:
+                return false;
+        }
+    }
 
+    /**
+     * 判断单次演出是否在今天
+     *
+     * @param performance    演出信息
+     * @param todayTimeRange 今天的时间范围
+     * @return true-今日有演出,false-今日无演出
+     */
+    private boolean isSinglePerformanceToday(BarPerformance performance, TodayTimeRange todayTimeRange) {
+        Date singleStart = performance.getSingleStartDatetime();
+        Date singleEnd = performance.getSingleEndDatetime();
+        if (singleStart == null || singleEnd == null) {
             return false;
-        } catch (Exception e) {
-            log.error("判断员工今日是否有演出异常,staffId={},异常信息:{}", staffId, e.getMessage(), e);
+        }
+        // 判断:开始时间 <= 今天结束 AND 结束时间 >= 今天开始
+        return !singleStart.after(todayTimeRange.getEnd()) && !singleEnd.before(todayTimeRange.getStart());
+    }
+
+    /**
+     * 判断每天定时演出是否在今天
+     *
+     * @param performance    演出信息
+     * @param todayTimeRange 今天的时间范围
+     * @return true-今日有演出,false-今日无演出
+     */
+    private boolean isDailyPerformanceToday(BarPerformance performance, TodayTimeRange todayTimeRange) {
+        Date dailyStart = performance.getDailyStartDate();
+        Date dailyEnd = performance.getDailyEndDate();
+        if (dailyStart == null || dailyEnd == null) {
+            return false;
+        }
+        // 判断:开始日期 <= 今天 <= 结束日期
+        return !dailyStart.after(todayTimeRange.getEnd()) && !dailyEnd.before(todayTimeRange.getStart());
+    }
+
+    /**
+     * 判断每周定时演出是否在今天
+     *
+     * @param performance    演出信息
+     * @param todayTimeRange 今天的时间范围
+     * @return true-今日有演出,false-今日无演出
+     */
+    private boolean isWeeklyPerformanceToday(BarPerformance performance, TodayTimeRange todayTimeRange) {
+        Date weeklyStart = performance.getDailyStartDate();
+        Date weeklyEnd = performance.getDailyEndDate();
+        String performanceWeek = performance.getPerformanceWeek();
+        if (weeklyStart == null || weeklyEnd == null || StringUtils.isEmpty(performanceWeek)) {
             return false;
         }
+        // 判断:开始日期 <= 今天 <= 结束日期 且 演出日期包含今天对应的星期几
+        boolean dateInRange = !weeklyStart.after(todayTimeRange.getEnd()) && !weeklyEnd.before(todayTimeRange.getStart());
+        boolean weekDayMatch = performanceWeek.contains(todayTimeRange.getTodayWeekDayStr());
+        return dateInRange && weekDayMatch;
+    }
+
+    /**
+     * 解析员工配置ID字符串(逗号分隔)
+     *
+     * @param staffConfigIds 员工配置ID字符串,格式:1,2,3
+     * @return 员工ID列表
+     */
+    private List<Integer> parseStaffConfigIds(String staffConfigIds) {
+        List<Integer> staffIds = new ArrayList<>();
+        if (StringUtils.isEmpty(staffConfigIds)) {
+            return staffIds;
+        }
+
+        try {
+            String[] ids = staffConfigIds.split(",");
+            for (String idStr : ids) {
+                if (StringUtils.isNotEmpty(idStr)) {
+                    idStr = idStr.trim();
+                    try {
+                        Integer staffId = Integer.parseInt(idStr);
+                        if (staffId > 0) {
+                            staffIds.add(staffId);
+                        }
+                    } catch (NumberFormatException e) {
+                        log.warn("解析员工配置ID失败,无效的ID:{}", idStr);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            log.error("解析员工配置ID字符串异常,staffConfigIds={},异常信息:{}", staffConfigIds, e.getMessage(), e);
+        }
+
+        return staffIds;
+    }
+
+    /**
+     * 获取今天的时间范围
+     *
+     * @return 今天的时间范围对象
+     */
+    private TodayTimeRange getTodayTimeRange() {
+        Date now = new Date();
+        java.util.Calendar cal = java.util.Calendar.getInstance();
+        cal.setTime(now);
+
+        // 获取今天的开始时间(00:00:00)
+        cal.set(java.util.Calendar.HOUR_OF_DAY, 0);
+        cal.set(java.util.Calendar.MINUTE, 0);
+        cal.set(java.util.Calendar.SECOND, 0);
+        cal.set(java.util.Calendar.MILLISECOND, 0);
+        Date todayStart = cal.getTime();
+
+        // 获取今天是星期几(0-周一,1-周二,...,6-周日)
+        int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
+        // Calendar中:1=周日,2=周一,...,7=周六
+        // 转换为:0=周一,1=周二,...,6=周日
+        int todayWeekDay = (dayOfWeek == 1) ? 6 : (dayOfWeek - 2);
+        String todayWeekDayStr = String.valueOf(todayWeekDay);
+
+        // 获取今天的结束时间(23:59:59.999)
+        cal.set(java.util.Calendar.HOUR_OF_DAY, 23);
+        cal.set(java.util.Calendar.MINUTE, 59);
+        cal.set(java.util.Calendar.SECOND, 59);
+        cal.set(java.util.Calendar.MILLISECOND, 999);
+        Date todayEnd = cal.getTime();
+
+        return new TodayTimeRange(todayStart, todayEnd, todayWeekDayStr);
+    }
+
+    /**
+     * 今天的时间范围内部类
+     */
+    private static class TodayTimeRange {
+        /**
+         * 今天开始时间(00:00:00)
+         */
+        private final Date start;
+
+        /**
+         * 今天结束时间(23:59:59.999)
+         */
+        private final Date end;
+
+        /**
+         * 今天是星期几的字符串表示(0-周一,1-周二,...,6-周日)
+         */
+        private final String todayWeekDayStr;
+
+        public TodayTimeRange(Date start, Date end, String todayWeekDayStr) {
+            this.start = start;
+            this.end = end;
+            this.todayWeekDayStr = todayWeekDayStr;
+        }
+
+        public Date getStart() {
+            return start;
+        }
+
+        public Date getEnd() {
+            return end;
+        }
+
+        public String getTodayWeekDayStr() {
+            return todayWeekDayStr;
+        }
     }
 
     @Override

+ 22 - 0
alien-store/src/main/java/shop/alien/store/util/CommonConstant.java

@@ -76,6 +76,28 @@ public class CommonConstant {
     public static final Integer DEFAULT_PAGE_NUM = 1;
 
     /**
+     * 最大分页大小(防止查询过多数据)
+     */
+    public static final Integer MAX_PAGE_SIZE = 100;
+
+    /**
+     * 演出审核状态:1-审核通过
+     */
+    public static final Integer PERFORMANCE_REVIEW_STATUS_APPROVED = 1;
+
+    /**
+     * 演出上线状态:1-上线
+     */
+    public static final Integer PERFORMANCE_ONLINE_STATUS_ONLINE = 1;
+
+    /**
+     * 演出频次:0-单次 1-每天定时 2-每周定时
+     */
+    public static final String PERFORMANCE_FREQUENCY_SINGLE = "0";
+    public static final String PERFORMANCE_FREQUENCY_DAILY = "1";
+    public static final String PERFORMANCE_FREQUENCY_WEEKLY = "2";
+
+    /**
      * 点赞类型:1-评论 2-社区动态 3-活动 4-推荐菜 5-店铺打卡 6-二手商品 7-律师评分 8-点赞员工
      */
     public static final String LIKE_TYPE_COMMENT = "1";