1.修复添加员工导出主播功能

This commit is contained in:
2025-09-04 20:51:59 +08:00
parent ac29f38ae7
commit e3c820271d
3 changed files with 19 additions and 9 deletions

View File

@@ -112,6 +112,21 @@ public class EmployeeHostsController {
BeanUtils.toBean(list, EmployeeHostsRespVO.class));
}
@GetMapping("/export-employee-excel")
@Operation(summary = "导出员工分配主播Excel")
@PreAuthorize("@ss.hasPermission('server:employee-self-hosts:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportEmployeeSelfHostsExcel(@Valid EmployeeHostsPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
PageResult<EmployeeHostsDO> employeeHostsPageWithSelf = employeeHostsService.getEmployeeHostsPageWithSelf(pageReqVO);
List<EmployeeHostsDO> list = employeeHostsPageWithSelf.getList();
// 导出 Excel
ExcelUtils.write(response, "员工分配主播.xls", "数据", EmployeeHostsRespVO.class,
BeanUtils.toBean(list, EmployeeHostsRespVO.class));
}
@PostMapping("/allocation")
@Operation(summary = "批量分配主播给员工")
@PreAuthorize("@ss.hasPermission('server:employee-hosts:allocation')")

View File

@@ -110,15 +110,10 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
@Override
public PageResult<EmployeeHostsDO> getEmployeeHostsPage(EmployeeHostsPageReqVO pageReqVO) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
if (loginUser != null) {
pageReqVO.setUserId(loginUser.getId());
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXMLWithSelf(iPage, pageReqVO);
return new PageResult<>(newHostsDOIPage.getRecords(), newHostsDOIPage.getTotal());
}
return null;
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXML(iPage, pageReqVO);
return new PageResult<>(newHostsDOIPage.getRecords(),newHostsDOIPage.getTotal());
}
@Override

View File

@@ -29,7 +29,7 @@ public class PageParam implements Serializable {
@Schema(description = "每页条数,最大值为 1000", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
@NotNull(message = "每页条数不能为空")
@Min(value = 1, message = "每页条数最小值为 1")
// @Min(value = 1, message = "每页条数最小值为 1")
@Max(value = 1000, message = "每页条数最大值为 1000")
private Integer pageSize = PAGE_SIZE;