|
|
@@ -306,14 +306,27 @@ public class SectionServiceImpl extends BaseServiceImpl<SectionMapper, Section> |
|
|
|
//对应部门下的路段列表 |
|
|
|
List<SectionDept> sectionDeptList = sectionDeptMapper.selectList(new LambdaQueryWrapper<SectionDept>() |
|
|
|
.eq(SectionDept::getDeptId, deptId).eq(SectionDept::getTenantId, tenantId)); |
|
|
|
//获取对应的公路列表 |
|
|
|
//获取对应的路段列表 |
|
|
|
List<String> sectionList = sectionDeptList.stream().map(t -> t.getSectionId()).collect(Collectors.toList()); |
|
|
|
//获取当前租户当前部门下的路段列表 |
|
|
|
list = sectionMapper.selectList(Wrappers.<Section>lambdaQuery() |
|
|
|
.eq(Section::getTenantId, tenantId) |
|
|
|
.eq(Section::getMark, MarkEnum.VALID.getCode()) |
|
|
|
.in(Section::getId, sectionList)); |
|
|
|
return JsonResult.success(list); |
|
|
|
List<Section> sections = new ArrayList<>(); |
|
|
|
for (Section section : list) { |
|
|
|
String roadId = section.getRoadId(); |
|
|
|
//每条路段对应的公路代号 |
|
|
|
RoadInformation roadInformation = roadInformationMapper.selectOne(Wrappers.<RoadInformation>lambdaQuery() |
|
|
|
.eq(RoadInformation::getTenantId, tenantId) |
|
|
|
.eq(RoadInformation::getId, roadId) |
|
|
|
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if(roadInformation !=null){ |
|
|
|
section.setCode(roadInformation.getCode()); |
|
|
|
} |
|
|
|
sections.add(section); |
|
|
|
} |
|
|
|
return JsonResult.success(sections); |
|
|
|
} |
|
|
|
|
|
|
|
return JsonResult.error(SectionEnum.QUERY_IS_FAILED.getCode()); |