diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IdAndNameDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IdAndNameDTO.java new file mode 100644 index 0000000000..306f47bbc5 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IdAndNameDTO.java @@ -0,0 +1,21 @@ +package com.epmet.commons.tools.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:通用Id and Name 不要轻易修改 + * + * @author: LiuJanJun + * @date: 2021/8/19 4:12 下午 + * @version: 1.0 + */ +@Data +public class IdAndNameDTO implements Serializable { + + private static final long serialVersionUID = 4481647404402681862L; + private String id; + private String name; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java similarity index 80% rename from epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java index 70b2a1abc5..d9ceb0f3a0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java @@ -1,7 +1,7 @@ package com.epmet.commons.tools.feign; import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.feign.fallback.CommonUserFeignClientFallBackFactory; +import com.epmet.commons.tools.feign.fallback.CommonAggFeignClientFallBackFactory; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; @@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.PostMapping; * @Description * @Author sun */ -@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonUserFeignClientFallBackFactory.class) -public interface CommonUserFeignClient { +@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class) +public interface CommonAggFeignClient { /** * desc:根据工作人员Id 获取工作人员信息 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallBackFactory.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallBackFactory.java similarity index 57% rename from epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallBackFactory.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallBackFactory.java index af8bd61954..cd396ed402 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallBackFactory.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallBackFactory.java @@ -1,18 +1,18 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.feign.CommonUserFeignClient; +import com.epmet.commons.tools.feign.CommonAggFeignClient; import feign.hystrix.FallbackFactory; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @Component @Slf4j -public class CommonUserFeignClientFallBackFactory implements FallbackFactory { - private CommonUserFeignClientFallback fallback = new CommonUserFeignClientFallback(); +public class CommonAggFeignClientFallBackFactory implements FallbackFactory { + private CommonAggFeignClientFallback fallback = new CommonAggFeignClientFallback(); @Override - public CommonUserFeignClient create(Throwable cause) { + public CommonAggFeignClient create(Throwable cause) { log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); return fallback; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java similarity index 82% rename from epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java index 7dca0b3552..2495d6b588 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java @@ -1,7 +1,7 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.feign.CommonUserFeignClient; +import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; @@ -14,7 +14,7 @@ import org.springframework.stereotype.Component; * @Date 2020/4/24 11:17 **/ @Component -public class CommonUserFeignClientFallback implements CommonUserFeignClient { +public class CommonAggFeignClientFallback implements CommonAggFeignClient { @Override public Result getStaffInfo(String staffId) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java index f45e1b46f8..5984a70d09 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java @@ -20,12 +20,13 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.feign.CommonUserFeignClient; +import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -44,7 +45,9 @@ public class CustomerStaffRedis { @Autowired private RedisUtils redisUtils; @Autowired - private CommonUserFeignClient commonUserFeignClient; + private RedissonClient redissonClient; + @Autowired + private CommonAggFeignClient commonAggFeignClient; //@PostConstruct public void init(){ @@ -65,10 +68,10 @@ public class CustomerStaffRedis { boolean empty = roleMap.isEmpty(); if (!empty){ CustomerStaffInfoCache result = ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoCache.class); - return result; + //return result; } try { - Result staffResult = commonUserFeignClient.getStaffInfo(staffId); + Result staffResult = commonAggFeignClient.getStaffInfo(staffId); if (staffResult == null || !staffResult.success()){ throw new RenException("获取工作人员信息失败"); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java index 63eaa7ccf0..76755387cc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java @@ -1,8 +1,10 @@ package com.epmet.commons.tools.redis.common.bean; +import com.epmet.commons.tools.dto.form.IdAndNameDTO; import lombok.Data; import java.io.Serializable; +import java.util.List; import java.util.Map; /** @@ -55,8 +57,18 @@ public class CustomerStaffInfoCache implements Serializable { private Map roleMap; /** - * 工作人员所在网格及部门列表 + * 所属组织的上级组织 */ - private StaffOrgsCache orgInfo; + private IdAndNameDTO parentAgency; + + /** + * 所属网格列表 + */ + private List gridList; + + /** + * 所属部门 + */ + private List deptList; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/StaffOrgsCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/StaffOrgsCache.java deleted file mode 100644 index db790af859..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/StaffOrgsCache.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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.commons.tools.redis.common.bean; - -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * desc: 工作人员所属的组织关系 - * @date 2021/8/19 10:07 上午 - */ -@Data -public class StaffOrgsCache implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 所属组织的上级组织 - */ - private IdAndName parentAgency; - - /** - * 所属网格列表 - */ - private List gridList; - - /** - * 所属部门 - */ - private List deptList; - - @Data - class IdAndName { - private String id; - private String name; - } -} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java index 03f7f669be..17ca080240 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java @@ -1,9 +1,10 @@ package com.epmet.dataaggre.dto.epmetuser.result; -import com.epmet.commons.tools.redis.common.bean.StaffOrgsCache; +import com.epmet.commons.tools.dto.form.IdAndNameDTO; import lombok.Data; import java.io.Serializable; +import java.util.List; import java.util.Map; /** @@ -56,8 +57,18 @@ public class CustomerStaffResultDTO implements Serializable { private Map roleMap; /** - * 工作人员所在网格及部门列表 + * 所属组织的上级组织 */ - private StaffOrgsCache orgInfo; + private IdAndNameDTO parentAgency; + + /** + * 所属网格列表 + */ + private List gridList; + + /** + * 所属部门 + */ + private List deptList; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffAgencyDTO.java new file mode 100644 index 0000000000..7a1a144f31 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffAgencyDTO.java @@ -0,0 +1,82 @@ +/** + * 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.dataaggre.dto.govorg.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class StaffAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String agencyId; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 上级组织机构ID + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + private String parentAgencyName; + + /** + * 机关级别(社区级:community, + 乡(镇、街道)级:street, + 区县级: district, + 市级: city + 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 地区编码 + */ + private String areaCode; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java index 445e796c61..87895b78bd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java @@ -19,11 +19,14 @@ package com.epmet.dataaggre.dao.govorg; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.entity.govorg.CustomerStaffAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 人员-机关单位关系表 * @@ -44,4 +47,12 @@ public interface CustomerStaffAgencyDao extends BaseDao getStaffGridList(@Param("staffId") String staffId); + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java index bde0fbaf92..f033ddede2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java @@ -18,11 +18,15 @@ package com.epmet.dataaggre.dao.govorg; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.entity.govorg.CustomerStaffDepartmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** - * 部门人员关系表 + * 部门人员关系表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 @@ -30,4 +34,11 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface CustomerStaffDepartmentDao extends BaseDao { -} \ No newline at end of file + /** + * desc:获取工作人员所在的部门列表 + * + * @param staffId + * @return + */ + List getStaffDeptList(@Param("staffId") String staffId); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 260d18a594..037201b2c7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -3,17 +3,20 @@ package com.epmet.dataaggre.service.epmetuser.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.IdAndNameDTO; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.BadgeConstant; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetuser.*; +import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao; import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO; import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO; import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO; import com.epmet.dataaggre.dto.epmetuser.form.*; import com.epmet.dataaggre.dto.epmetuser.result.*; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; +import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; @@ -66,6 +69,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private GovProjectService govProjectService; @Resource private GovStaffRoleDao govStaffRoleDao; + @Autowired + private CustomerAgencyDao customerAgencyDao; /** * @Description 根据UserIds查询 @@ -521,11 +526,36 @@ public class EpmetUserServiceImpl implements EpmetUserService { CustomerStaffEntity staffEntity = customerStaffDao.selectOne(queryWrapper); CustomerStaffResultDTO result = ConvertUtils.sourceToTarget(staffEntity, CustomerStaffResultDTO.class); - //1.查询当前人员所属组织及下级所有网格列表数据,供后续封装数据使用 - /*List list = govOrgService.getGridList(staffId); - if (list.size() < NumConstant.ONE) { - return resultList; - }*/ + //2.查询工作人员所属组织信息 + CustomerAgencyDTO agencyDTO = govOrgService.gridByAgencyId(null,staffId); + if (agencyDTO == null){ + log.error("getStaffInfo have any agency staffId:{}",staffId); + return null; + } + result.setAgencyName(agencyDTO.getOrganizationName()); + + //1.查询当前人员所在的网格列表 + List list = govOrgService.getStaffGridList(staffId); + List idAndNameList = new ArrayList<>(); + for (CustomerGridDTO customerGridDTO : list) { + IdAndNameDTO grid = new IdAndNameDTO(); + grid.setId(customerGridDTO.getId()); + grid.setName(customerGridDTO.getGridName()); + idAndNameList.add(grid); + } + result.setGridList(idAndNameList); + + List deptList = govOrgService.getStaffDeptList(staffId); + idAndNameList = new ArrayList<>(); + for (CustomerDepartmentDTO org : deptList) { + IdAndNameDTO grid = new IdAndNameDTO(); + grid.setId(org.getId()); + grid.setName(org.getDepartmentName()); + idAndNameList.add(grid); + } + result.setDeptList(idAndNameList); + + return result; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 69acad6539..24c0d7bd56 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -2,8 +2,12 @@ package com.epmet.dataaggre.service.govorg; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; +import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; -import com.epmet.dataaggre.dto.govorg.form.*; +import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO; +import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO; +import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; +import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO; import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; @@ -110,4 +114,19 @@ public interface GovOrgService { */ List getStaffOrgName(List staffIdList); + + /** + * desc:工作人员所在网格 + * @param staffId + * @return + */ + List getStaffGridList(String staffId); + + /** + * desc:工作人员所在部门 + * @param staffId + * @return + */ + List getStaffDeptList(String staffId); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index e993673734..ba8ab9847d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -7,12 +7,10 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dataaggre.constant.DataSourceConstant; -import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao; -import com.epmet.dataaggre.dao.govorg.CustomerGridDao; -import com.epmet.dataaggre.dao.govorg.CustomerStaffAgencyDao; -import com.epmet.dataaggre.dao.govorg.CustomerStaffGridDao; +import com.epmet.dataaggre.dao.govorg.*; import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; +import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.dto.govorg.form.*; @@ -48,6 +46,8 @@ public class GovOrgServiceImpl implements GovOrgService { @Autowired private CustomerStaffAgencyDao customerStaffAgencyDao; @Autowired + private CustomerStaffDepartmentDao customerStaffDepartmentDao; + @Autowired private CustomerGridDao customerGridDao; @Autowired private AreaCodeService areaCodeService; @@ -415,4 +415,14 @@ public class GovOrgServiceImpl implements GovOrgService { return resultList; } + @Override + public List getStaffGridList(String staffId) { + return customerStaffAgencyDao.getStaffGridList(staffId); + } + + @Override + public List getStaffDeptList(String staffId) { + return customerStaffDepartmentDao.getStaffDeptList(staffId); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml index 4ed6d3a2d1..bf47a3cfe0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml @@ -33,8 +33,23 @@ WHERE csa.del_flag = '0' AND ca.del_flag = '0' - AND csa.customer_id = #{customerId} + + AND csa.customer_id = #{customerId} + AND csa.user_id = #{staffId} + + - \ No newline at end of file + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml index b7ae78179e..1d54253076 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml @@ -2,4 +2,16 @@ - \ No newline at end of file + +