|
@@ -5,6 +5,9 @@ import com.ruoyi.common.core.utils.StringUtils;
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
|
|
import com.ruoyi.system.api.RemoteDeptService;
|
|
|
import com.ruoyi.system.api.domain.SysDept;
|
|
|
+import com.sooka.sponest.data.digitalemergency.controller.CenterdataTEmergencyEnterindesmapController;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -17,17 +20,20 @@ import java.util.Map;
|
|
|
@Component
|
|
|
public class DeptLevelUtil {
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(DeptLevelUtil.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
private RemoteDeptService remoteDeptService;
|
|
|
|
|
|
- public R getDeptLevel(List<Map<String,Object>> list) {
|
|
|
+ public List<Map<String,Object>> getDeptLevel(List<Map<String,Object>> list) {
|
|
|
String deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId().toString();
|
|
|
List<SysDept> sysDeptList = remoteDeptService.selectChildrenCountyOrVillagesDeptListByDeptId(deptId).getData();
|
|
|
- if (StringUtils.isEmpty(list)||list==null){
|
|
|
- return R.ok(sysDeptList);
|
|
|
+ if (StringUtils.isEmpty(list)){
|
|
|
+ return null;
|
|
|
}
|
|
|
if (!list.get(0).containsKey("ancestors")||!list.get(0).containsKey("deptId")){
|
|
|
- return R.fail("入参没有key:'ancestors'或没有key:'deptId'");
|
|
|
+ log.error("入参没有key:'ancestors'或没有key:'deptId'");
|
|
|
+ return new ArrayList<>();
|
|
|
}
|
|
|
List<Map<String,Object>> mapList = new ArrayList<>();
|
|
|
for (SysDept sysDept : sysDeptList){//部门
|
|
@@ -54,6 +60,6 @@ public class DeptLevelUtil {
|
|
|
map.put("deptName",sysDept.getDeptName());
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
- return R.ok(mapList);
|
|
|
+ return mapList;
|
|
|
}
|
|
|
}
|