diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
new file mode 100644
index 0000000000..501e6c05bd
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
@@ -0,0 +1,100 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.controller;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.*;
+import com.epmet.dto.result.AddAgencyResultDTO;
+import com.epmet.dto.result.AgencydetailResultDTO;
+import com.epmet.dto.result.SubAgencyResultDTO;
+import com.epmet.service.AgencyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 组织机构
+ *
+ * @author generator generator@elink-cn.com
+ */
+@RestController
+@RequestMapping("agency")
+public class AgencyController {
+
+ @Autowired
+ private AgencyService agencyService;
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 添加组织
+ */
+ @PostMapping("addagency")
+ public Result addAgency(@RequestBody AddAgencyFormDTO formDTO) {
+ return agencyService.addAgency(formDTO);
+ }
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织名称编辑
+ */
+ @PostMapping("editagency")
+ public Result editAgency(@RequestBody EditAgencyFormDTO formDTO) {
+ return agencyService.editAgency(formDTO);
+ }
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 删除组织机关
+ */
+ @PostMapping("removeagency")
+ public Result removeAgency(@RequestBody RemoveAgencyFormDTO formDTO) {
+ return agencyService.removeAgency(formDTO);
+ }
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织首页-获取组织机构信息
+ */
+ @PostMapping("agencydetail")
+ public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) {
+ return agencyService.agencyDetail(formDTO);
+ }
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织首页-下级机关列表
+ */
+ @PostMapping("subagencylist")
+ public Result subAgencyList(@RequestBody SubAgencyFormDTO formDTO) {
+ return agencyService.subAgencyList(formDTO);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
index 9caad715cc..9de0e27f8e 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
@@ -26,11 +26,8 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerAgencyDTO;
-import com.epmet.dto.form.*;
-import com.epmet.dto.result.AddAgencyResultDTO;
-import com.epmet.dto.result.AgencydetailResultDTO;
+import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
-import com.epmet.dto.result.SubAgencyResultDTO;
import com.epmet.excel.CustomerAgencyExcel;
import com.epmet.service.CustomerAgencyService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -107,60 +104,4 @@ public class CustomerAgencyController {
public Result> getStaffOrgList(@RequestBody StaffOrgFormDTO staffOrgsFormDTO) {
return customerAgencyService.getStaffOrgList(staffOrgsFormDTO);
}
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 添加组织
- */
- @PostMapping("addagency")
- public Result addAgency(@RequestBody AddAgencyFormDTO formDTO) {
- return customerAgencyService.addAgency(formDTO);
- }
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织名称编辑
- */
- @PostMapping("editagency")
- public Result editAgency(@RequestBody EditAgencyFormDTO formDTO) {
- return customerAgencyService.editAgency(formDTO);
- }
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 删除组织机关
- */
- @PostMapping("removeagency")
- public Result removeAgency(@RequestBody RemoveAgencyFormDTO formDTO) {
- return customerAgencyService.removeAgency(formDTO);
- }
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织首页-获取组织机构信息
- */
- @PostMapping("agencydetail")
- public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) {
- return customerAgencyService.agencyDetail(formDTO);
- }
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织首页-下级机关列表
- */
- @PostMapping("subagencylist")
- public Result subAgencyList(@RequestBody SubAgencyFormDTO formDTO) {
- return customerAgencyService.subAgencyList(formDTO);
- }
-
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/.gitkeep b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
new file mode 100644
index 0000000000..3df8e719d4
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.CustomerAgencyDTO;
+import com.epmet.dto.form.*;
+import com.epmet.dto.result.AddAgencyResultDTO;
+import com.epmet.dto.result.AgencydetailResultDTO;
+import com.epmet.dto.result.StaffOrgsResultDTO;
+import com.epmet.dto.result.SubAgencyResultDTO;
+import com.epmet.entity.CustomerAgencyEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 机关单位信息
+ *
+ * @author generator generator@elink-cn.com
+ */
+public interface AgencyService {
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 添加组织
+ */
+ Result addAgency(AddAgencyFormDTO formDTO);
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织名称编辑
+ */
+ Result editAgency(EditAgencyFormDTO formDTO);
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 删除组织机关
+ */
+ Result removeAgency(RemoveAgencyFormDTO formDTO);
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织首页-获取组织机构信息
+ */
+ Result agencyDetail(AgencydetailFormDTO formDTO);
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织首页-下级机关列表
+ */
+ Result subAgencyList(SubAgencyFormDTO formDTO);
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
index 7076fe6d2d..24a4e17b35 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
@@ -107,44 +107,4 @@ public interface CustomerAgencyService extends BaseService
* @Date 2020/4/20 21:45
**/
Result> getStaffOrgList(StaffOrgFormDTO staffOrgsFormDTO);
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 添加组织
- */
- Result addAgency(AddAgencyFormDTO formDTO);
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织名称编辑
- */
- Result editAgency(EditAgencyFormDTO formDTO);
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 删除组织机关
- */
- Result removeAgency(RemoveAgencyFormDTO formDTO);
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织首页-获取组织机构信息
- */
- Result agencyDetail(AgencydetailFormDTO formDTO);
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织首页-下级机关列表
- */
- Result subAgencyList(SubAgencyFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
new file mode 100644
index 0000000000..c03526f6cd
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
@@ -0,0 +1,185 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.constant.CustomerAgencyConstant;
+import com.epmet.dao.CustomerAgencyDao;
+import com.epmet.dto.CustomerAgencyDTO;
+import com.epmet.dto.form.*;
+import com.epmet.dto.result.*;
+import com.epmet.entity.CustomerAgencyEntity;
+import com.epmet.redis.CustomerAgencyRedis;
+import com.epmet.service.AgencyService;
+import com.epmet.service.CustomerAgencyService;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 机关单位信息
+ *
+ * @author generator generator@elink-cn.com
+ */
+@Service
+public class AgencyServiceImpl implements AgencyService {
+
+ private static final Logger log = LoggerFactory.getLogger(AgencyServiceImpl.class);
+ @Autowired
+ private CustomerAgencyDao customerAgencyDao;
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 添加组织
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result addAgency(AddAgencyFormDTO formDTO) {
+ Result result = new Result();
+ AddAgencyResultDTO addAgencyResultDTO = new AddAgencyResultDTO();
+ //0:属性映射赋值
+ CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class);
+ entity.setOrganizationName(formDTO.getAgencyName());
+ entity.setTotalUser(NumConstant.ZERO);
+ //1:查询上级机关信息
+ CustomerAgencyEntity parentEntity = customerAgencyDao.selectById(formDTO.getPid());
+ entity.setCustomerId(parentEntity.getCustomerId());
+ if (null == parentEntity.getPid()) {
+ entity.setPids(parentEntity.getId());
+ entity.setAllParentName(parentEntity.getOrganizationName());
+ } else {
+ entity.setPids(":" + parentEntity.getId());
+ entity.setAllParentName("-" + parentEntity.getOrganizationName());
+ }
+ //2:保存组织信息
+ if (customerAgencyDao.insert(entity) < NumConstant.ONE) {
+ log.error(CustomerAgencyConstant.SAVE_EXCEPTION);
+ throw new RenException(CustomerAgencyConstant.SAVE_EXCEPTION);
+ }
+ //3:返回新组织Id
+ addAgencyResultDTO.setAgencyId(entity.getId());
+ return result.ok(addAgencyResultDTO);
+ }
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织名称编辑
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result editAgency(EditAgencyFormDTO formDTO) {
+ Result result = new Result();
+ CustomerAgencyEntity entity = new CustomerAgencyEntity();
+ entity.setId(formDTO.getAgencyId());
+ entity.setOrganizationName(formDTO.getAgencyName());
+ if (customerAgencyDao.updateById(entity) < NumConstant.ONE) {
+ log.error(CustomerAgencyConstant.UPDATE_EXCEPTION);
+ throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION);
+ }
+ return result;
+ }
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 删除组织机关
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result removeAgency(RemoveAgencyFormDTO formDTO) {
+ Result result = new Result();
+ //1:查询当前机关是否存在所属下级机关,存在下级的不能删除
+ List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId());
+ if (null != agencyList && agencyList.size() > NumConstant.ZERO) {
+ result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode());
+ result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg());
+ return result;
+ }
+ //2:删除当前机关组织(逻辑删)
+ if (customerAgencyDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) {
+ log.error(CustomerAgencyConstant.DEL_EXCEPTION);
+ throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION);
+ }
+ return result;
+ }
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织首页-获取组织机构信息
+ */
+ @Override
+ public Result agencyDetail(AgencydetailFormDTO formDTO) {
+ AgencydetailResultDTO agencydetailResultDTO = new AgencydetailResultDTO();
+ //1:查询本机关详细信息
+ CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getAgencyId());
+ if (null == entity) {
+ return new Result().ok(agencydetailResultDTO);
+ }
+ agencydetailResultDTO = ConvertUtils.sourceToTarget(entity, AgencydetailResultDTO.class);
+ agencydetailResultDTO.setAgencyId(entity.getId());
+ agencydetailResultDTO.setAgencyName(entity.getOrganizationName());
+ //2:查询本机关的所有上级机关,按自上而下层级顺序
+ if (null == entity.getPids()) {
+ return new Result().ok(agencydetailResultDTO);
+ }
+ List listStr = Arrays.asList(entity.getPids().split(":"));
+ List parentList = customerAgencyDao.selectPAgencyById(listStr);
+ agencydetailResultDTO.setParentList(parentList);
+ return new Result().ok(agencydetailResultDTO);
+ }
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织首页-下级机关列表
+ */
+ @Override
+ public Result subAgencyList(SubAgencyFormDTO formDTO) {
+ SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO();
+ //1:根据当前机关Id查询直属下一级机关列表
+ List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId());
+ subAgencyResultDTO.setAgencyList(agencyList);
+ //2:统计下一级机关数
+ subAgencyResultDTO.setSubAgencyCount(agencyList.size());
+ return new Result().ok(subAgencyResultDTO);
+ }
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
index 3bbd8631c0..c9b963b20d 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
@@ -55,7 +55,6 @@ import java.util.Map;
@Service
public class CustomerAgencyServiceImpl extends BaseServiceImpl implements CustomerAgencyService {
- private static final Logger log = LoggerFactory.getLogger(CustomerAgencyServiceImpl.class);
@Autowired
private CustomerAgencyRedis customerAgencyRedis;
@@ -119,128 +118,4 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl list = baseDao.selectStaffOrgList(staffOrgsFormDTO.getCustomerIdList());
return new Result>().ok(list);
}
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 添加组织
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Result addAgency(AddAgencyFormDTO formDTO) {
- Result result = new Result();
- AddAgencyResultDTO addAgencyResultDTO = new AddAgencyResultDTO();
- //0:属性映射赋值
- CustomerAgencyEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class);
- entity.setOrganizationName(formDTO.getAgencyName());
- entity.setTotalUser(NumConstant.ZERO);
- //1:查询上级机关信息
- CustomerAgencyEntity parentEntity = baseDao.selectById(formDTO.getPid());
- entity.setCustomerId(parentEntity.getCustomerId());
- if (null == parentEntity.getPid()) {
- entity.setPids(parentEntity.getId());
- entity.setAllParentName(parentEntity.getOrganizationName());
- } else {
- entity.setPids(":" + parentEntity.getId());
- entity.setAllParentName("-" + parentEntity.getOrganizationName());
- }
- //2:保存组织信息
- if (baseDao.insert(entity) < NumConstant.ONE) {
- log.error(CustomerAgencyConstant.SAVE_EXCEPTION);
- throw new RenException(CustomerAgencyConstant.SAVE_EXCEPTION);
- }
- //3:返回新组织Id
- addAgencyResultDTO.setAgencyId(entity.getId());
- return result.ok(addAgencyResultDTO);
- }
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织名称编辑
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Result editAgency(EditAgencyFormDTO formDTO) {
- Result result = new Result();
- CustomerAgencyEntity entity = new CustomerAgencyEntity();
- entity.setId(formDTO.getAgencyId());
- entity.setOrganizationName(formDTO.getAgencyName());
- if (baseDao.updateById(entity) < NumConstant.ONE) {
- log.error(CustomerAgencyConstant.UPDATE_EXCEPTION);
- throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION);
- }
- return result;
- }
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 删除组织机关
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Result removeAgency(RemoveAgencyFormDTO formDTO) {
- Result result = new Result();
- //1:查询当前机关是否存在所属下级机关,存在下级的不能删除
- List agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId());
- if (null != agencyList && agencyList.size() > NumConstant.ZERO) {
- result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode());
- result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg());
- return result;
- }
- //2:删除当前机关组织(逻辑删)
- if (baseDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) {
- log.error(CustomerAgencyConstant.DEL_EXCEPTION);
- throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION);
- }
- return result;
- }
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织首页-获取组织机构信息
- */
- @Override
- public Result agencyDetail(AgencydetailFormDTO formDTO) {
- AgencydetailResultDTO agencydetailResultDTO = new AgencydetailResultDTO();
- //1:查询本机关详细信息
- CustomerAgencyEntity entity = baseDao.selectById(formDTO.getAgencyId());
- if (null == entity) {
- return new Result().ok(agencydetailResultDTO);
- }
- agencydetailResultDTO = ConvertUtils.sourceToTarget(entity, AgencydetailResultDTO.class);
- agencydetailResultDTO.setAgencyId(entity.getId());
- agencydetailResultDTO.setAgencyName(entity.getOrganizationName());
- //2:查询本机关的所有上级机关,按自上而下层级顺序
- if (null == entity.getPids()) {
- return new Result().ok(agencydetailResultDTO);
- }
- List listStr = Arrays.asList(entity.getPids().split(":"));
- List parentList = baseDao.selectPAgencyById(listStr);
- agencydetailResultDTO.setParentList(parentList);
- return new Result().ok(agencydetailResultDTO);
- }
-
- /**
- * @param formDTO
- * @return
- * @Author sun
- * @Description 组织首页-下级机关列表
- */
- @Override
- public Result subAgencyList(SubAgencyFormDTO formDTO) {
- SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO();
- //1:根据当前机关Id查询直属下一级机关列表
- List agencyList = baseDao.selectSubAgencyById(formDTO.getAgencyId());
- subAgencyResultDTO.setAgencyList(agencyList);
- //2:统计下一级机关数
- subAgencyResultDTO.setSubAgencyCount(agencyList.size());
- return new Result().ok(subAgencyResultDTO);
- }
}
\ No newline at end of file