Browse Source

重构查询问题分布列表,去掉分页查询

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
9e9d2819da
4 changed files with 8 additions and 18 deletions
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/InspectionFileMapper.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspectionfile/QueryInspectionFileDistributionListRequest.java
  3. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/InspectionFileServiceImpl.java
  4. +5
    -15
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFileDistributionListService.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/InspectionFileMapper.java View File

@@ -69,5 +69,5 @@ public interface InspectionFileMapper extends BaseMapper<InspectionFile> {
* @param request 巡检任务查询实体
* @return 巡检任务集合
*/
Page<InspectionFileDistribution> selectDistributionList(@Param("page") IPage page, @Param("request") QueryInspectionFileDistributionListRequest request);
List<InspectionFileDistribution> selectDistributionList(@Param("request") QueryInspectionFileDistributionListRequest request);
}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspectionfile/QueryInspectionFileDistributionListRequest.java View File

@@ -13,7 +13,7 @@ import java.util.List;
* @date 2022-12-08
*/
@Data
public class QueryInspectionFileDistributionListRequest extends BaseQuery {
public class QueryInspectionFileDistributionListRequest {

/**
* 任务名称

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/InspectionFileServiceImpl.java View File

@@ -337,6 +337,6 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
*/
@Override
public JsonResult getDistributionList(QueryInspectionFileDistributionListRequest request) {
return queryInspectionFileDistributionListService.getPageList(request);
return queryInspectionFileDistributionListService.getList(request);
}
}

+ 5
- 15
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFileDistributionListService.java View File

@@ -53,7 +53,7 @@ public class QueryInspectionFileDistributionListService {
@Autowired
private RoadInformationMapper roadInformationMapper;

public JsonResult getPageList(QueryInspectionFileDistributionListRequest request) {
public JsonResult getList(QueryInspectionFileDistributionListRequest request) {
log.info("进入查询任务问题分布列表业务, request:{}", request.toString());

String userId = ShiroUtils.getUserId();
@@ -68,27 +68,17 @@ public class QueryInspectionFileDistributionListService {
List<String> deptIdList = this.getDeptIdList(userId);
request.setDeptIdList(deptIdList);

// 设置分页参数
IPage<InspectionFile> page = new Page<>(request.getPage(), request.getLimit());
// 查询结果
IPage<InspectionFileDistribution> pageData = inspectionFileMapper.selectDistributionList(page, request);
if (null == pageData || pageData.getTotal() == 0) {
List<InspectionFileDistribution> inspectionFileDistributionList = inspectionFileMapper.selectDistributionList(request);
if (null == inspectionFileDistributionList || inspectionFileDistributionList.size() == 0) {
log.info("获取任务问题分布列表为空");
return JsonResult.success(null, QueryInspectionPageListCodeEnum.DATA_IS_FAILED.getMsg());
}

// 构造返回结果对象
List<InspectionFileDistributionListVo> inspectionFileDistributionListVoList = this.buildInspectionFileDistributionListVo(pageData.getRecords());
List<InspectionFileDistributionListVo> inspectionFileDistributionListVoList = this.buildInspectionFileDistributionListVo(inspectionFileDistributionList);

// 重写返回结果对象
IPage<InspectionFileDistributionListVo> inspectionFileDistributionListVoData = new Page<>();
inspectionFileDistributionListVoData.setPages(pageData.getPages());
inspectionFileDistributionListVoData.setCurrent(pageData.getCurrent());
inspectionFileDistributionListVoData.setSize(pageData.getSize());
inspectionFileDistributionListVoData.setTotal(pageData.getTotal());
inspectionFileDistributionListVoData.setRecords(inspectionFileDistributionListVoList);

return JsonResult.success(inspectionFileDistributionListVoData);
return JsonResult.success(inspectionFileDistributionListVoList);
}

/**

Loading…
Cancel
Save