Browse Source

Merge branch 'dev_hotfix' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev

dev_shibei_match
jianjun 4 years ago
parent
commit
00eb56079b
  1. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  2. 59
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  3. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  4. 34
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -365,8 +365,8 @@ public class CustomerAgencyController {
* @Date 2021/9/8 15:20 * @Date 2021/9/8 15:20
*/ */
@PostMapping("agencygridtree") @PostMapping("agencygridtree")
public Result<AgencyTreeResultDTO> getOrgTreeData(@LoginUser TokenDto tokenDTO) { public Result<AgencyTreeResultDTO> getOrgTreeData(/*@LoginUser*/ TokenDto tokenDTO) {
//tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955");
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId()));
} }

59
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -58,6 +58,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @Description 组织首页-下级机关列表 * @Description 组织首页-下级机关列表
**/ **/
List<SubListResultDTO> selectSubAgencyById(@Param("pId") String pId, @Param("agencyNum") Integer agencyNum); List<SubListResultDTO> selectSubAgencyById(@Param("pId") String pId, @Param("agencyNum") Integer agencyNum);
List<SubListResultDTO> selectSubAgencyByAgencyId(@Param("pId") String pId); List<SubListResultDTO> selectSubAgencyByAgencyId(@Param("pId") String pId);
/** /**
@ -79,8 +80,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
CustomerAgencyEntity getAgencyByStaffId(@Param("staffId") String staffId); CustomerAgencyEntity getAgencyByStaffId(@Param("staffId") String staffId);
/** /**
* @Description 根据agencyId查询地区编码
* @param agencyId 所属机关id * @param agencyId 所属机关id
* @Description 根据agencyId查询地区编码
* @author zxc * @author zxc
* @date 2020/4/28 15:50 * @date 2020/4/28 15:50
*/ */
@ -104,6 +105,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
/** /**
* 查询客户根级组织 * 查询客户根级组织
*
* @param customerId * @param customerId
* @return * @return
*/ */
@ -111,10 +113,11 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
/** /**
* 获取所属机关单位名称上级-所属 * 获取所属机关单位名称上级-所属
* @author zhaoqifeng *
* @date 2020/5/22 17:53
* @param agencyId * @param agencyId
* @return java.lang.String * @return java.lang.String
* @author zhaoqifeng
* @date 2020/5/22 17:53
*/ */
String selectAgencyName(@Param("agencyId") String agencyId); String selectAgencyName(@Param("agencyId") String agencyId);
@ -127,46 +130,48 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<ArticleGridResultDTO> selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids); List<ArticleGridResultDTO> selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids);
/** /**
* @Description 查询一个工作人员最近登录的网格以及机关信息
* @param gridId * @param gridId
* @return * @return
* @Description 查询一个工作人员最近登录的网格以及机关信息
* @author wangc * @author wangc
* @date 2020.08.17 09:50 * @date 2020.08.17 09:50
**/ **/
ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId);
/** /**
* @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息
* @param staffId * @param staffId
* @return * @return
* @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息
* @author wangc * @author wangc
* @date 2020.08.17 09:50 * @date 2020.08.17 09:50
**/ **/
ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId")String staffId); ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId") String staffId);
/** /**
* @Description 根据agencyId查找指定机构的信息直属网格部门
* @param agencyId * @param agencyId
* @return * @return
* @Description 根据agencyId查找指定机构的信息直属网格部门
* @author wangc * @author wangc
* @date 2020.08.18 13:41 * @date 2020.08.18 13:41
**/ **/
ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId")String agencyId); ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId") String agencyId);
/** /**
* @Description 根绝agencyId查找其下属机构的信息
* @param pid * @param pid
* @return * @return
* @Description 根绝agencyId查找其下属机构的信息
* @author wangc * @author wangc
* @date 2020.08.18 13:42 * @date 2020.08.18 13:42
**/ **/
List<ExtStaffPermissionResultDTO> selectSubAgencyByPid(@Param("pid") String pid); List<ExtStaffPermissionResultDTO> selectSubAgencyByPid(@Param("pid") String pid);
/** /**
* @Description 根据agencyId查找指定机构直属的部门将grid与dept分开是因为grid与dept的数量可能不等造成重复数据无法去重
* @param agencyId * @param agencyId
* @return * @return
* @Description 根据agencyId查找指定机构直属的部门将grid与dept分开是因为grid与dept的数量可能不等造成重复数据无法去重
* @author wangc * @author wangc
* @date 2020.08.18 13:42 * @date 2020.08.18 13:42
**/ **/
List<ExtDeptResultDTO> selectDeptList(@Param("agencyId") String agencyId); List<ExtDeptResultDTO> selectDeptList(@Param("agencyId") String agencyId);
/** /**
@ -186,30 +191,33 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId); AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId);
/** /**
* @Description 返回elementTree结构的agency树
* @param customerId * @param customerId
* @param pid * @param pid
* @return java.util.List<com.epmet.dto.result.AgencyElementTreeResultDTO.Agency> * @return java.util.List<com.epmet.dto.result.AgencyElementTreeResultDTO.Agency>
* @Description 返回elementTree结构的agency树
* @Author liushaowen * @Author liushaowen
* @Date 2020/11/6 14:57 * @Date 2020/11/6 14:57
*/ */
List<AgencyElementTreeResultDTO.Agency> getAgencyElementTree(@Param("customerId") String customerId,@Param("pid") String pid); List<AgencyElementTreeResultDTO.Agency> getAgencyElementTree(@Param("customerId") String customerId, @Param("pid") String pid);
/** /**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据 * @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun * @author sun
**/ **/
OrganizeTreeResultDTO selectorganizeTree(@Param("agencyId") String agencyId); OrganizeTreeResultDTO selectorganizeTree(@Param("agencyId") String agencyId);
/** /**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据 * @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun * @author sun
**/ **/
List<OrganizeTreeGridResultDTO> selectAgencyGridList(@Param("agencyId") String agencyId); List<OrganizeTreeGridResultDTO> selectAgencyGridList(@Param("agencyId") String agencyId);
/** /**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据 * @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun * @author sun
**/ **/
List<OrganizeTreeDeptResultDTO> selectAgencyDeptList(@Param("agencyId") String agencyId); List<OrganizeTreeDeptResultDTO> selectAgencyDeptList(@Param("agencyId") String agencyId);
/** /**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据 * @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun * @author sun
@ -236,6 +244,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
/** /**
* 根据新增人员类型判断查询机关信息 * 根据新增人员类型判断查询机关信息
*
* @author sun * @author sun
*/ */
OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType); OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType);
@ -247,40 +256,46 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<StaffOrgsResultDTO> getStaffOrgListByStaffId(@Param("staffId") String staffId); List<StaffOrgsResultDTO> getStaffOrgListByStaffId(@Param("staffId") String staffId);
/** /**
* @Description 地图配置删除
* @param orgId * @param orgId
* @param level * @param level
* @Description 地图配置删除
* @author zxc * @author zxc
* @date 2021/10/25 9:39 上午 * @date 2021/10/25 9:39 上午
*/ */
void delMapArea(@Param("orgId") String orgId, @Param("level") String level); void delMapArea(@Param("orgId") String orgId, @Param("level") String level);
/** /**
* @Description 地图配置新增
* @param orgId * @param orgId
* @param level * @param level
* @param coordinates * @param coordinates
* @Description 地图配置新增
* @author zxc * @author zxc
* @date 2021/10/25 9:59 上午 * @date 2021/10/25 9:59 上午
*/ */
void addMapArea(@Param("orgId") String orgId, @Param("level") String level,@Param("coordinates")String coordinates); void addMapArea(@Param("orgId") String orgId, @Param("level") String level, @Param("coordinates") String coordinates);
/** /**
* @Description 地图查询下级组织
* @param pid * @param pid
* @param type * @param type
* @Description 地图查询下级组织
* @author zxc * @author zxc
* @date 2021/10/25 2:30 下午 * @date 2021/10/25 2:30 下午
*/ */
List<MapSonOrgResultDTO> selectSonOrg(@Param("pid")String pid,@Param("type")String type); List<MapSonOrgResultDTO> selectSonOrg(@Param("pid") String pid, @Param("type") String type);
/** /**
* @Description 查询下级agencyId
* @param orgId * @param orgId
* @Description 查询下级agencyId
* @author zxc * @author zxc
* @date 2021/12/9 4:42 下午 * @date 2021/12/9 4:42 下午
*/ */
List<String> getSonAgencyId(@Param("orgId") String orgId); List<String> getSonAgencyId(@Param("orgId") String orgId);
/**
* desc:获取组织和网格的数据 树形sql
* @param agencyId
* @return
*/
ExtStaffPermissionResultDTO selectAgencyAndGridById(@Param("agencyId") String agencyId);
} }

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -1131,9 +1131,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(rootAgency.getAgencyId()); String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(rootAgency.getAgencyId());
Object o = redisUtils.get(orgTreeCacheKey); Object o = redisUtils.get(orgTreeCacheKey);
if (o == null){ if (o == null){
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(rootAgency.getAgencyId()); ExtStaffPermissionResultDTO res = baseDao.selectAgencyAndGridById(rootAgency.getAgencyId());
convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList()); convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList());
redisUtils.set(orgTreeCacheKey,result, RedisUtils.MINUTE_THIRTY_EXPIRE); redisUtils.set(orgTreeCacheKey,result, 60 * 60 * 24L);
}else { }else {
result = (AgencyTreeResultDTO) o; result = (AgencyTreeResultDTO) o;
} }

34
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -308,6 +308,26 @@
</collection> </collection>
</resultMap> </resultMap>
<resultMap id="agencyAndGridMap" type="com.epmet.dto.result.ExtStaffPermissionResultDTO">
<id column="agencyId" property="agencyId" />
<result column="agencyName" property="agencyName"/>
<result column="level" property="level" />
<result column="longitude" property="longitude" />
<result column="latitude" property="latitude" />
<result column="customerId" property="customerId"/>
<collection property="gridList" column="agencyId" ofType="com.epmet.dto.result.ExtGridResultDTO" select="selectGridList">
<id column="gridId" property="gridId" />
<result column="gridName" property="gridName" />
<result column="customerId" property="customerId"/>
<result column="longitude" property="longitude" />
<result column="latitude" property="latitude" />
</collection>
<collection property="subAgencyList" column="agencyId"
ofType="com.epmet.dto.result.ExtStaffPermissionResultDTO" select="selectSubAgencyByPid">
</collection>
</resultMap>
<select id="selectAgencyById" resultMap="treeMap"> <select id="selectAgencyById" resultMap="treeMap">
SELECT SELECT
@ -677,5 +697,19 @@
DEL_FLAG = '0' DEL_FLAG = '0'
AND PID = #{orgId} AND PID = #{orgId}
</select> </select>
<select id="selectAgencyAndGridById" resultMap="agencyAndGridMap">
SELECT
agency.ID AS agencyId,
agency.ORGANIZATION_NAME AS agencyName,
agency.LEVEL AS level,
agency.CUSTOMER_ID as customerId,
agency.longitude,
agency.latitude
FROM
CUSTOMER_AGENCY agency
WHERE
agency.DEL_FLAG = '0'
AND agency.ID = #{agencyId}
</select>
</mapper> </mapper>

Loading…
Cancel
Save