Commit 02fe9d61 by 林永健

fix(merchant-staff): 修复空列表返回的分页对象构造

- 修正空数据时返回的新分页对象实例化方式
- 更新测试用例以覆盖更多查询条件和排序逻辑
- 添加部门ID、职位ID、排序字段及排序方式到测试请求参数
- 替换测试中的用户ID以匹配新的测试需求
1 parent d640a890
......@@ -1516,7 +1516,7 @@ public class MerchantStaffService {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
List<BeiSenEmployeeListResonseDTO> responseList = beisenEmployeeInfoMapper.selectByConditions(condition);
if (CollectionUtils.isEmpty(responseList)) {
return RpcPagination.copyPage(Collections.emptyList());
return new RpcPagination<>();
}
return RpcPagination.copyPage(responseList);
}
......
......@@ -308,7 +308,11 @@ public class StaffServiceTest {
request.setPageNum(1);
request.setPageSize(10);
BeiSenEmployeeListRequestDTO cond = new BeiSenEmployeeListRequestDTO();
cond.setUserIds(Lists.newArrayList(407576053));
cond.setUserIds(Lists.newArrayList(407652281));
cond.setOIdDepartmentIds(Lists.newArrayList(0));
cond.setOIdJobPostIds(Lists.newArrayList("787142"));
cond.setSortField("entryDate");
cond.setSortOrder("desc");
request.setCondition(cond);
RpcPagination<BeiSenEmployeeListResonseDTO> response = merchantStaffService.getBeisenUserWithConditions(request);
System.out.println(response);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!