Quellcode durchsuchen

部门及子部门为空,添加判断

tags/v1.0.0^2
chengwang vor 1 Jahr
Ursprung
Commit
b259b381ee
2 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/SectionEnum.java
  2. +3
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/SectionServiceImpl.java

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/SectionEnum.java Datei anzeigen

@@ -11,7 +11,8 @@ public enum SectionEnum {
DEPT_IS_NOT_EXIST(1220302, "部门不存在"),
SECTION_ID_IS_NULL(1220303, "路段id为空"),
SECTION_LIST_IS_NULL(1220304, "路段列表为空"),
DEPT_SECTION_IS_NOT_EXIST(1220305, "部门关联的路段为空");
DEPT_SECTION_IS_NOT_EXIST(1220305, "部门关联的路段为空"),
DEPT_ID_IS_NULL(1220306, "部门及子部门的id为空");

/**
* 错误码

+ 3
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/SectionServiceImpl.java Datei anzeigen

@@ -117,6 +117,9 @@ public class SectionServiceImpl extends BaseServiceImpl<SectionMapper, Section>
return JsonResult.error(SectionEnum.DEPT_IS_NOT_EXIST.getCode(), SectionEnum.DEPT_IS_NOT_EXIST.getMsg());
}
List<String> deptList = deptMapper.selectAllChildListById(deptId);
if(StringUtils.isEmpty(deptList) && deptList.size()<=0){
return JsonResult.error(SectionEnum.DEPT_ID_IS_NULL.getCode(),SectionEnum.DEPT_ID_IS_NULL.getMsg());
}
//根据部门列表查对应的部门路段数据列表
List<SectionDept> sectionDeptList = sectionDeptMapper.selectList(Wrappers.<SectionDept>lambdaQuery()
.eq(SectionDept::getTenantId, tenantId)

Laden…
Abbrechen
Speichern