瀏覽代碼

给code属性赋值

tags/v1.1.0^2
chengwang 1 年之前
父節點
當前提交
e1ba61689e
共有 1 個文件被更改,包括 15 次插入2 次删除
  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 查看文件

@@ -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…
取消
儲存