|
|
|
|
|
|
|
|
package com.tuoheng.admin.service.dept.add; |
|
|
package com.tuoheng.admin.service.dept.add; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.tuoheng.admin.constant.SystemConstant; |
|
|
import com.tuoheng.admin.constant.SystemConstant; |
|
|
import com.tuoheng.admin.dto.RoadSectionDto; |
|
|
import com.tuoheng.admin.dto.RoadSectionDto; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 新增部门,公路和路段信息不能为空 |
|
|
|
|
|
if (CollectionUtils.isEmpty(addDeptRequest.getRoadSectionDtoList())) { |
|
|
|
|
|
return JsonResult.error(AddDeptCodeEnum.ROAD_IS_NULL.getCode(), AddDeptCodeEnum.ROAD_IS_NULL.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<Section> sectionList; |
|
|
|
|
|
List<RoadSectionDto> roadSectionDtoList = addDeptRequest.getRoadSectionDtoList(); |
|
|
|
|
|
for (RoadSectionDto roadSectionDto : roadSectionDtoList) { |
|
|
|
|
|
sectionList = roadSectionDto.getSectionList(); |
|
|
|
|
|
if (CollectionUtils.isEmpty(sectionList)) { |
|
|
|
|
|
return JsonResult.error(AddDeptCodeEnum.SECTION_IS_NULL.getCode(), AddDeptCodeEnum.SECTION_IS_NULL.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(addDeptRequest.getRoadSectionDtoList())) { |
|
|
|
|
|
List<Section> sectionList; |
|
|
|
|
|
List<RoadSectionDto> roadSectionDtoList = addDeptRequest.getRoadSectionDtoList(); |
|
|
|
|
|
for (RoadSectionDto roadSectionDto : roadSectionDtoList) { |
|
|
|
|
|
sectionList = roadSectionDto.getSectionList(); |
|
|
|
|
|
if (CollectionUtils.isEmpty(sectionList)) { |
|
|
|
|
|
return JsonResult.error(AddDeptCodeEnum.SECTION_IS_NULL.getCode(), AddDeptCodeEnum.SECTION_IS_NULL.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
return JsonResult.success(); |
|
|
return JsonResult.success(); |
|
|
} |
|
|
} |
|
|
|
|
|
|