Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/V1.3.3
wanjing 1 year ago
parent
commit
1e052a0810
2 changed files with 20 additions and 24 deletions
  1. +11
    -13
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/add/AddDeptService.java
  2. +9
    -11
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/update/UpdateDeptService.java

+ 11
- 13
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/add/AddDeptService.java View File

@@ -1,5 +1,6 @@
package com.tuoheng.admin.service.dept.add;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.dto.RoadSectionDto;
@@ -133,19 +134,16 @@ public class AddDeptService {
}
}

// 新增部门,公路和路段信息不能为空
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();
}


+ 9
- 11
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/update/UpdateDeptService.java View File

@@ -138,19 +138,17 @@ public class UpdateDeptService {
}
}

// 修改部门,公路和路段信息不能为空
if (CollectionUtil.isEmpty(newEditDeptRequest.getRoadSectionDtoList())) {
return JsonResult.error(EditDeptCodeEnum.ROAD_IS_NULL.getCode(), EditDeptCodeEnum.ROAD_IS_NULL.getMsg());
}

List<Section> sectionList;
List<RoadSectionDto> roadSectionDtoList = newEditDeptRequest.getRoadSectionDtoList();
for (RoadSectionDto roadSectionDto : roadSectionDtoList) {
sectionList = roadSectionDto.getSectionList();
if (CollectionUtil.isEmpty(sectionList)) {
return JsonResult.error(EditDeptCodeEnum.SECTION_IS_NULL.getCode(), EditDeptCodeEnum.SECTION_IS_NULL.getMsg());
if (CollectionUtil.isNotEmpty(newEditDeptRequest.getRoadSectionDtoList())) {
List<Section> sectionList;
List<RoadSectionDto> roadSectionDtoList = newEditDeptRequest.getRoadSectionDtoList();
for (RoadSectionDto roadSectionDto : roadSectionDtoList) {
sectionList = roadSectionDto.getSectionList();
if (CollectionUtil.isEmpty(sectionList)) {
return JsonResult.error(EditDeptCodeEnum.SECTION_IS_NULL.getCode(), EditDeptCodeEnum.SECTION_IS_NULL.getMsg());
}
}
}

return JsonResult.success();
}


Loading…
Cancel
Save