Răsfoiți Sursa

美食人员接口

ldz 2 zile în urmă
părinte
comite
d13126b1d6

+ 21 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreStaffConfigController.java

@@ -146,4 +146,25 @@ public class StoreStaffConfigController {
         }
         return R.data(result);
     }
+
+
+    @ApiOperation("获取美食员工列表")
+    @ApiOperationSupport(order = 7)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "分页页数", dataType = "Integer", paramType = "query", required = false),
+            @ApiImplicitParam(name = "size", value = "分页条数", dataType = "Integer", paramType = "query", required = false),
+            @ApiImplicitParam(name = "storeId", value = "店铺ID", dataType = "Integer", paramType = "query", required = true),
+            @ApiImplicitParam(name = "staffPosition", value = "员工职位", dataType = "String", paramType = "query", required = false),
+            @ApiImplicitParam(name = "status", value = "员工状态", dataType = "String", paramType = "query", required = false)
+    })
+    @GetMapping("/getFoodStaffConfigList")
+    public R<IPage<StoreStaffConfig>> getFoodStaffConfigList(@RequestParam(value = "page", defaultValue = "1") int page,
+                                                         @RequestParam(value = "size", defaultValue = "10") int size,
+                                                         @RequestParam(value = "storeId", required = true) Integer storeId,
+                                                         @RequestParam(value = "staffPosition", required = false) String staffPosition,
+                                                         @RequestParam(value = "status", required = false) String status) {
+        log.info("StoreStaffConfigController.getFoodStaffConfigList?page={}&size={}&storeId={}&staffPosition={}&status={}", page, size, storeId, staffPosition, status);
+        return R.data(storeStaffConfigService.getFoodStaffConfigList(page, size, storeId, staffPosition, status));
+    }
+
 }

+ 12 - 0
alien-store/src/main/java/shop/alien/store/service/StoreStaffConfigService.java

@@ -54,4 +54,16 @@ public interface StoreStaffConfigService {
      * @return 员工详情
      */
     StoreStaffConfig queryStaffDetail(Integer id);
+
+    /**
+     * 获取美食员工列表
+     *
+     * @param page          分页页数
+     * @param size          分页条数
+     * @param storeId       店铺ID
+     * @param staffPosition 员工职位
+     * @param status        员工状态
+     * @return 员工列表
+     */
+    IPage<StoreStaffConfig> getFoodStaffConfigList(int page, int size, Integer storeId, String staffPosition, String status);
 }

+ 23 - 1
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffConfigServiceImpl.java

@@ -10,7 +10,6 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.StoreStaffConfig;
-import shop.alien.entity.store.excelVo.StoreInfoExpiredRecordsExcelVo;
 import shop.alien.entity.store.excelVo.StoreStaffConfigExcelVo;
 import shop.alien.entity.store.excelVo.util.ExcelGenerator;
 import shop.alien.mapper.StoreStaffConfigMapper;
@@ -200,4 +199,27 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
 
 
     }
+
+    @Override
+    public IPage<StoreStaffConfig> getFoodStaffConfigList(int page, int size, Integer storeId, String staffPosition, String status) {
+        IPage<StoreStaffConfig> storePage = new Page<>(page, size);
+        QueryWrapper<StoreStaffConfig> queryWrapper = new QueryWrapper<>();
+        // 按照店铺ID查询
+        if (storeId != null && storeId > 0) {
+            queryWrapper.eq("store_id", storeId);
+        }
+        // 按照职位查询
+        if (StringUtils.isNotEmpty(staffPosition)) {
+            queryWrapper.eq("staff_position", staffPosition);
+        }
+        // 按照状态查询
+        if (StringUtils.isNotEmpty(status)) {
+            queryWrapper.eq("status", status);
+        }
+        // 只查询未删除的记录
+        queryWrapper.eq("delete_flag", 0);
+        // 排序规则:先按置顶状态降序(置顶的在前),再按置顶时间降序,最后按创建时间降序
+        queryWrapper.orderByDesc("top_status", "top_time", "created_time");
+        return storeStaffConfigMapper.selectPage(storePage, queryWrapper);
+    }
 }