1.修复添加员工导出主播功能
This commit is contained in:
@@ -112,6 +112,21 @@ public class EmployeeHostsController {
|
|||||||
BeanUtils.toBean(list, EmployeeHostsRespVO.class));
|
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")
|
@PostMapping("/allocation")
|
||||||
@Operation(summary = "批量分配主播给员工")
|
@Operation(summary = "批量分配主播给员工")
|
||||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:allocation')")
|
@PreAuthorize("@ss.hasPermission('server:employee-hosts:allocation')")
|
||||||
|
|||||||
@@ -110,15 +110,10 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<EmployeeHostsDO> getEmployeeHostsPage(EmployeeHostsPageReqVO pageReqVO) {
|
public PageResult<EmployeeHostsDO> getEmployeeHostsPage(EmployeeHostsPageReqVO pageReqVO) {
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
|
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
|
||||||
if (loginUser != null) {
|
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
|
||||||
pageReqVO.setUserId(loginUser.getId());
|
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXML(iPage, pageReqVO);
|
||||||
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
return new PageResult<>(newHostsDOIPage.getRecords(),newHostsDOIPage.getTotal());
|
||||||
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXMLWithSelf(iPage, pageReqVO);
|
|
||||||
return new PageResult<>(newHostsDOIPage.getRecords(), newHostsDOIPage.getTotal());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class PageParam implements Serializable {
|
|||||||
|
|
||||||
@Schema(description = "每页条数,最大值为 1000", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
@Schema(description = "每页条数,最大值为 1000", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||||
@NotNull(message = "每页条数不能为空")
|
@NotNull(message = "每页条数不能为空")
|
||||||
@Min(value = 1, message = "每页条数最小值为 1")
|
// @Min(value = 1, message = "每页条数最小值为 1")
|
||||||
@Max(value = 1000, message = "每页条数最大值为 1000")
|
@Max(value = 1000, message = "每页条数最大值为 1000")
|
||||||
private Integer pageSize = PAGE_SIZE;
|
private Integer pageSize = PAGE_SIZE;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user