Browse Source

修改根据公路id和部门id获取该公路下路段信息列表

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
cb08c4c739
1 changed files with 22 additions and 1 deletions
  1. +22
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/query/QuerySectionListByRoadIdAndDeptIdService.java

+ 22
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/query/QuerySectionListByRoadIdAndDeptIdService.java View File

@@ -3,6 +3,7 @@ package com.tuoheng.admin.service.section.query;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.entity.RoadInformation;
import com.tuoheng.admin.entity.Section;
@@ -55,7 +56,12 @@ public class QuerySectionListByRoadIdAndDeptIdService {
return result;
}
// 获取该部门公路下路段列表
List<Section> sectionList = this.getSectionList(tenantId, roadId, deptId);
List<Section> sectionList;
if (SystemConstant.ROOT_DEPT_PID.equals(deptId)) {
sectionList = this.getSectionList(tenantId, roadId);
} else {
sectionList = this.getSectionList(tenantId, roadId, deptId);
}
if (CollectionUtil.isEmpty(sectionList)) {
log.info("根据公路id获取该公路下路段信息列表业务:路段信息为空");
return JsonResult.error(QuerySectionListByRoadIdCodeEnum.SECTION_LIST_IS_NULL.getCode(), QuerySectionListByRoadIdCodeEnum.SECTION_LIST_IS_NULL.getMsg());
@@ -101,6 +107,21 @@ public class QuerySectionListByRoadIdAndDeptIdService {
*
* @param tenantId
* @param roadId
* @return
*/
private List<Section> getSectionList(String tenantId, String roadId) {
List<Section> sectionList = sectionMapper.selectList(new LambdaQueryWrapper<Section>()
.eq(Section::getTenantId, tenantId)
.eq(Section::getRoadId, roadId)
.eq(Section::getMark, 1));
return sectionList;
}

/**
* 查询该部门公路下路段信息列表
*
* @param tenantId
* @param roadId
* @param deptId
* @return
*/

Loading…
Cancel
Save