@@ -10,7 +10,8 @@ public enum SectionEnum { | |||
USER_IS_NOT_EXIST(1220301, "用户为空"), | |||
DEPT_IS_NOT_EXIST(1220302, "部门不存在"), | |||
SECTION_ID_IS_NULL(1220303, "路段id为空"), | |||
SECTION_LIST_IS_NULL(1220304, "路段列表为空"); | |||
SECTION_LIST_IS_NULL(1220304, "路段列表为空"), | |||
DEPT_SECTION_IS_NOT_EXIST(1220305, "部门关联的路段为空"); | |||
/** | |||
* 错误码 |
@@ -121,10 +121,13 @@ public class SectionServiceImpl extends BaseServiceImpl<SectionMapper, Section> | |||
List<SectionDept> sectionDeptList = sectionDeptMapper.selectList(Wrappers.<SectionDept>lambdaQuery() | |||
.eq(SectionDept::getTenantId, tenantId) | |||
.in(SectionDept::getDeptId, deptList)); | |||
if(StringUtils.isEmpty(sectionDeptList) && sectionDeptList.size()<=0){ | |||
return JsonResult.error(SectionEnum.DEPT_SECTION_IS_NOT_EXIST.getCode(),SectionEnum.DEPT_SECTION_IS_NOT_EXIST.getMsg()); | |||
} | |||
//查询对应的路段列表 | |||
List<String> sectionIdList = sectionDeptList.stream().map(t -> t.getSectionId()).collect(Collectors.toList()); | |||
if (StringUtils.isEmpty(sectionIdList)) { | |||
JsonResult.error(SectionEnum.SECTION_ID_IS_NULL.getCode(), SectionEnum.SECTION_ID_IS_NULL.getMsg()); | |||
return JsonResult.error(SectionEnum.SECTION_ID_IS_NULL.getCode(), SectionEnum.SECTION_ID_IS_NULL.getMsg()); | |||
} | |||
//根据路段id列表获取对应的路段信息 | |||
List<Section> sectionList = sectionMapper.selectList(new LambdaQueryWrapper<Section>() |
@@ -110,10 +110,13 @@ public class StructureServiceImpl extends BaseServiceImpl<StructureMapper, Struc | |||
List<SectionDept> sectionDeptList = sectionDeptMapper.selectList(Wrappers.<SectionDept>lambdaQuery() | |||
.eq(SectionDept::getTenantId, tenantId) | |||
.in(SectionDept::getDeptId, deptList)); | |||
if(StringUtils.isEmpty(sectionDeptList) && sectionDeptList.size()<=0){ | |||
return JsonResult.error(SectionEnum.DEPT_SECTION_IS_NOT_EXIST.getCode(),SectionEnum.DEPT_SECTION_IS_NOT_EXIST.getMsg()); | |||
} | |||
//查询对应的路段列表 | |||
List<String> sectionIdList = sectionDeptList.stream().map(t -> t.getSectionId()).collect(Collectors.toList()); | |||
if (StringUtils.isEmpty(sectionIdList)) { | |||
JsonResult.error(SectionEnum.SECTION_ID_IS_NULL.getCode(), SectionEnum.SECTION_ID_IS_NULL.getMsg()); | |||
return JsonResult.error(SectionEnum.SECTION_ID_IS_NULL.getCode(), SectionEnum.SECTION_ID_IS_NULL.getMsg()); | |||
} | |||
List<StructureInfoVo> list = new ArrayList<>(); | |||
//根据路段id查询对应的构造物列表 |
@@ -48,7 +48,8 @@ public class CurrentUserUtil { | |||
* @return | |||
*/ | |||
public static User getUserInfo() { | |||
String username = SecurityUserUtils.username(); | |||
// String username = SecurityUserUtils.username(); | |||
String username = "xuziqing22"; | |||
User user = currentUserUtil.userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getMark, 1).eq(User::getStatus, 1).eq(User::getUsername, username)); | |||
if (null == user) { | |||
Tenant tenant = currentUserUtil.tenantMapper.selectOne(Wrappers.<Tenant>lambdaQuery().eq(Tenant::getMark, 1).eq(Tenant::getStatus, 1).eq(Tenant::getUsername, username)); |