Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.1.0^2
chengwang 1 year ago
parent
commit
2b2276f593
1 changed files with 15 additions and 2 deletions
  1. +15
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/SectionServiceImpl.java

+ 15
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/SectionServiceImpl.java View File

@@ -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());

Loading…
Cancel
Save