|
@@ -12,6 +12,7 @@ import shop.alien.entity.store.StoreStaffConfig;
|
|
|
import shop.alien.entity.store.dto.StoreStaffConfigListQueryDto;
|
|
import shop.alien.entity.store.dto.StoreStaffConfigListQueryDto;
|
|
|
import shop.alien.entity.store.vo.StoreStaffDetailVo;
|
|
import shop.alien.entity.store.vo.StoreStaffDetailVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffFitnessDetailVo;
|
|
import shop.alien.entity.store.vo.StoreStaffFitnessDetailVo;
|
|
|
|
|
+import shop.alien.entity.store.vo.StoreStaffPositionCountVo;
|
|
|
import shop.alien.mapper.StoreDictionaryMapper;
|
|
import shop.alien.mapper.StoreDictionaryMapper;
|
|
|
import shop.alien.store.service.StoreStaffConfigService;
|
|
import shop.alien.store.service.StoreStaffConfigService;
|
|
|
|
|
|
|
@@ -150,15 +151,17 @@ public class StoreStaffConfigController {
|
|
|
@ApiImplicitParam(name = "page", value = "分页页数", dataType = "Integer", paramType = "query", required = false),
|
|
@ApiImplicitParam(name = "page", value = "分页页数", dataType = "Integer", paramType = "query", required = false),
|
|
|
@ApiImplicitParam(name = "size", 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 = "storeId", value = "店铺ID", dataType = "Integer", paramType = "query", required = true),
|
|
|
- @ApiImplicitParam(name = "status", value = "员工状态(0-待审核 1-审核通过 2-审核拒绝)", dataType = "String", paramType = "query", required = false)
|
|
|
|
|
|
|
+ @ApiImplicitParam(name = "status", value = "员工状态(0-待审核 1-审核通过 2-审核拒绝)", dataType = "String", paramType = "query", required = false),
|
|
|
|
|
+ @ApiImplicitParam(name = "staffPosition", value = "员工职位", dataType = "String", paramType = "query", required = false)
|
|
|
})
|
|
})
|
|
|
@GetMapping("/queryStaffList")
|
|
@GetMapping("/queryStaffList")
|
|
|
public R<IPage<StoreStaffConfig>> queryStaffList(
|
|
public R<IPage<StoreStaffConfig>> queryStaffList(
|
|
|
@RequestParam(value = "page", defaultValue = "1") Integer page,
|
|
@RequestParam(value = "page", defaultValue = "1") Integer page,
|
|
|
@RequestParam(value = "size", defaultValue = "10") Integer size,
|
|
@RequestParam(value = "size", defaultValue = "10") Integer size,
|
|
|
@RequestParam(value = "storeId") Integer storeId,
|
|
@RequestParam(value = "storeId") Integer storeId,
|
|
|
- @RequestParam(value = "status", required = false) String status) {
|
|
|
|
|
- log.info("查询员工列表,参数:page={}, size={}, storeId={}, status={}", page, size, storeId, status);
|
|
|
|
|
|
|
+ @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);
|
|
|
|
|
|
|
|
// 参数校验
|
|
// 参数校验
|
|
|
if (storeId == null || storeId <= 0) {
|
|
if (storeId == null || storeId <= 0) {
|
|
@@ -176,7 +179,7 @@ public class StoreStaffConfigController {
|
|
|
size = 100;
|
|
size = 100;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- IPage<StoreStaffConfig> result = storeStaffConfigService.queryStaffList(page, size, storeId, status);
|
|
|
|
|
|
|
+ IPage<StoreStaffConfig> result = storeStaffConfigService.queryStaffList(page, size, storeId, status, staffPosition);
|
|
|
log.info("查询员工列表成功,共{}条记录", result.getTotal());
|
|
log.info("查询员工列表成功,共{}条记录", result.getTotal());
|
|
|
return R.data(result);
|
|
return R.data(result);
|
|
|
}
|
|
}
|
|
@@ -373,4 +376,39 @@ public class StoreStaffConfigController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询指定店铺的员工职位统计信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param storeId 店铺ID,必填
|
|
|
|
|
+ * @return 员工职位统计列表,每个元素包含职位名称和对应员工数量
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation("查询员工职位统计(用户端)")
|
|
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "storeId", value = "店铺ID", dataType = "Integer", paramType = "query", required = true)
|
|
|
|
|
+ })
|
|
|
|
|
+ @GetMapping("/getStaffPositionCount")
|
|
|
|
|
+ public R<List<StoreStaffPositionCountVo>> getStaffPositionCount(
|
|
|
|
|
+ @RequestParam(value = "storeId") Integer storeId) {
|
|
|
|
|
+ log.info("查询员工职位统计,参数:storeId={}", storeId);
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 参数校验
|
|
|
|
|
+ if (storeId == null || storeId <= 0) {
|
|
|
|
|
+ log.warn("查询员工职位统计失败,店铺ID无效:storeId={}", storeId);
|
|
|
|
|
+ return R.fail("店铺ID不能为空且必须大于0");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ List<StoreStaffPositionCountVo> result = storeStaffConfigService.getStaffPositionCount(storeId);
|
|
|
|
|
+ log.info("查询员工职位统计成功,storeId={},职位数量:{}", storeId, result.size());
|
|
|
|
|
+ return R.data(result);
|
|
|
|
|
+ } catch (IllegalArgumentException e) {
|
|
|
|
|
+ log.warn("查询员工职位统计失败,参数错误:{}", e.getMessage());
|
|
|
|
|
+ return R.fail(e.getMessage());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("查询员工职位统计异常,storeId={},异常信息:{}", storeId, e.getMessage(), e);
|
|
|
|
|
+ return R.fail("查询失败:" + e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|