Explorar el Código

解決:分页查询的总条数和总页数值为0

pull/384/head
suqin hace 10 meses
padre
commit
f4c61dbc3b
Se han modificado 1 ficheros con 13 adiciones y 2 borrados
  1. +13
    -2
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionServiceImpl.java

+ 13
- 2
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionServiceImpl.java Ver fichero

@@ -81,9 +81,7 @@ public class InspectionServiceImpl implements IInspectionService {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
String tenantId = user.getTenantId();

query.setTenantId(tenantId);
// query.setType(1);

//初始部门id
String deptIdInt = query.getDeptId();
@@ -132,6 +130,12 @@ public class InspectionServiceImpl implements IInspectionService {
inspectionInfoVoList.add(record);
}

pageDataVo.setPages(IPageData.getPages());
pageDataVo.setCurrent(IPageData.getCurrent());
pageDataVo.setSize(IPageData.getSize());
pageDataVo.setTotal(IPageData.getTotal());


}
//登录用户角色为部门管理员或普通用户
if (DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == type || DataPermissionEnum.DEPT.getCode() == type) {
@@ -144,6 +148,7 @@ public class InspectionServiceImpl implements IInspectionService {
String deptId = deptLists.get(i);
query.setDeptId(deptId);
IPage<InspectionInfoVo> pageData = inspectionMapper.queryPage(page, query);

pageData.getRecords().stream().forEach(x -> {
//修改执行人属性
User user2 = userMapper.selectById(x.getCreateUser());
@@ -169,6 +174,12 @@ public class InspectionServiceImpl implements IInspectionService {
for (InspectionInfoVo record : records) {
inspectionInfoVoList.add(record);
}

pageDataVo.setPages(pageData.getPages());
pageDataVo.setCurrent(pageData.getCurrent());
pageDataVo.setSize(pageData.getSize());
pageDataVo.setTotal(pageData.getTotal());

}
}
Map<Integer, AirportLineVo> airportLineMap = this.getAirportLineMap(inspectionInfoVoList);

Cargando…
Cancelar
Guardar