USER_IS_NOT_EXIST(1220301, "用户为空"), | USER_IS_NOT_EXIST(1220301, "用户为空"), | ||||
DEPT_IS_NOT_EXIST(1220302, "部门不存在"), | DEPT_IS_NOT_EXIST(1220302, "部门不存在"), | ||||
SECTION_ID_IS_NULL(1220303, "路段id为空"), | SECTION_ID_IS_NULL(1220303, "路段id为空"), | ||||
SECTION_LIST_IS_NULL(1220304, "路段列表为空"); | |||||
SECTION_LIST_IS_NULL(1220304, "路段列表为空"), | |||||
DEPT_SECTION_IS_NOT_EXIST(1220305, "部门关联的路段为空"); | |||||
/** | /** | ||||
* 错误码 | * 错误码 |
List<SectionDept> sectionDeptList = sectionDeptMapper.selectList(Wrappers.<SectionDept>lambdaQuery() | List<SectionDept> sectionDeptList = sectionDeptMapper.selectList(Wrappers.<SectionDept>lambdaQuery() | ||||
.eq(SectionDept::getTenantId, tenantId) | .eq(SectionDept::getTenantId, tenantId) | ||||
.in(SectionDept::getDeptId, deptList)); | .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()); | List<String> sectionIdList = sectionDeptList.stream().map(t -> t.getSectionId()).collect(Collectors.toList()); | ||||
if (StringUtils.isEmpty(sectionIdList)) { | 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列表获取对应的路段信息 | //根据路段id列表获取对应的路段信息 | ||||
List<Section> sectionList = sectionMapper.selectList(new LambdaQueryWrapper<Section>() | List<Section> sectionList = sectionMapper.selectList(new LambdaQueryWrapper<Section>() |
List<SectionDept> sectionDeptList = sectionDeptMapper.selectList(Wrappers.<SectionDept>lambdaQuery() | List<SectionDept> sectionDeptList = sectionDeptMapper.selectList(Wrappers.<SectionDept>lambdaQuery() | ||||
.eq(SectionDept::getTenantId, tenantId) | .eq(SectionDept::getTenantId, tenantId) | ||||
.in(SectionDept::getDeptId, deptList)); | .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()); | List<String> sectionIdList = sectionDeptList.stream().map(t -> t.getSectionId()).collect(Collectors.toList()); | ||||
if (StringUtils.isEmpty(sectionIdList)) { | 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<>(); | List<StructureInfoVo> list = new ArrayList<>(); | ||||
//根据路段id查询对应的构造物列表 | //根据路段id查询对应的构造物列表 |
* @return | * @return | ||||
*/ | */ | ||||
public static User getUserInfo() { | 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)); | User user = currentUserUtil.userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getMark, 1).eq(User::getStatus, 1).eq(User::getUsername, username)); | ||||
if (null == user) { | if (null == user) { | ||||
Tenant tenant = currentUserUtil.tenantMapper.selectOne(Wrappers.<Tenant>lambdaQuery().eq(Tenant::getMark, 1).eq(Tenant::getStatus, 1).eq(Tenant::getUsername, username)); | Tenant tenant = currentUserUtil.tenantMapper.selectOne(Wrappers.<Tenant>lambdaQuery().eq(Tenant::getMark, 1).eq(Tenant::getStatus, 1).eq(Tenant::getUsername, username)); |