Browse Source

通讯录消息相关接口

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
7caf76f37e
  1. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java
  2. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java
  3. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java
  4. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  5. 26
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  6. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml
  7. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerStaffAgencyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -61,4 +62,13 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
*/ */
List<String> selectStaffList(String orgId, String orgType); List<String> selectStaffList(String orgId, String orgType);
/**
* @Description 获取下级组织列表
* @Param agencyId
* @Return {@link List<OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:08
*/
List<OrgDTO> selectSubAgency(@Param("agencyId") String agencyId);
} }

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java

@ -19,6 +19,7 @@ package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffDepartmentEntity; import com.epmet.dataaggre.entity.govorg.CustomerStaffDepartmentEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -41,4 +42,13 @@ public interface CustomerStaffDepartmentDao extends BaseDao<CustomerStaffDepartm
* @return * @return
*/ */
List<CustomerDepartmentDTO> getStaffDeptList(@Param("staffId") String staffId); List<CustomerDepartmentDTO> getStaffDeptList(@Param("staffId") String staffId);
/**
* @Description
* @Param agencyId
* @Return {@link List< OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:29
*/
List<OrgDTO> selectDepartmentList(@Param("agencyId") String agencyId);
} }

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.govorg; package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity; import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity;
@ -46,4 +47,13 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @author sun * @author sun
*/ */
List<StaffAgencyGridListResultDTO.GridResultDTO> getStaffGridList(@Param("agencyId") String agencyId, @Param("staffId") String staffId); List<StaffAgencyGridListResultDTO.GridResultDTO> getStaffGridList(@Param("agencyId") String agencyId, @Param("staffId") String staffId);
/**
* @Description 获取组织下的网格级网格人数
* @Param agencyId
* @Return {@link List< OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:37
*/
List<OrgDTO> selectGridList(@Param("agencyId") String agencyId);
} }

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.govorg.impl; package com.epmet.dataaggre.service.govorg.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -10,6 +11,8 @@ import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.*; import com.epmet.dataaggre.dao.govorg.*;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.*;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
@ -420,7 +423,17 @@ public class GovOrgServiceImpl implements GovOrgService {
*/ */
@Override @Override
public SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO) { public SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO) {
return null; //下级组织列表
List<OrgDTO> subAgencyList = customerStaffAgencyDao.selectSubAgency(formDTO.getAgencyId());
//下级部门列表
List<OrgDTO> departmentList = customerStaffDepartmentDao.selectDepartmentList(formDTO.getAgencyId());
//下级网格列表
List<OrgDTO> gridList = customerStaffGridDao.selectGridList(formDTO.getAgencyId());
SubOrgResultDTO result = new SubOrgResultDTO();
result.setSubAgencyList(subAgencyList);
result.setDepartmentList(departmentList);
result.setGridList(gridList);
return result;
} }
/** /**

26
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -90,4 +90,30 @@
</select> </select>
<select id="selectSubAgency" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
ca.ID AS orgId,
ca.ORGANIZATION_NAME AS orgName,
"agency" AS orgType,
count( csa.USER_ID ) AS staffNum
FROM
customer_agency ca
LEFT JOIN (
SELECT
a.PIDS,
b.USER_ID
FROM
customer_agency a
INNER JOIN customer_staff_agency b ON b.AGENCY_ID = a.ID
AND b.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
) csa ON csa.PIDS LIKE CONCAT( '%', ca.ID, '%' )
WHERE
ca.DEL_FLAG = '0'
AND ca.PID = #{agencyId}
GROUP BY
ca.ID
ORDER BY ca.CREATED_TIME ASC
</select>
</mapper> </mapper>

19
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml

@ -14,4 +14,23 @@
AND g.DEL_FLAG = '0' AND g.DEL_FLAG = '0'
AND sg.USER_ID = #{staffId} AND sg.USER_ID = #{staffId}
</select> </select>
<select id="selectDepartmentList" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
cd.ID AS orgId,
cd.DEPARTMENT_NAME AS orgName,
"dept" AS orgType,
count( csd.USER_ID ) AS staffNum
FROM
customer_department cd
LEFT JOIN customer_staff_department csd ON cd.ID = csd.DEPARTMENT_ID
AND csd.DEL_FLAG = '0'
WHERE
cd.DEL_FLAG = '0'
AND cd.AGENCY_ID = #{agencyId}
GROUP BY
cd.ID
ORDER BY
cd.CREATED_TIME ASC
</select>
</mapper> </mapper>

17
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml

@ -35,4 +35,21 @@
AND ca.id = #{agencyId} AND ca.id = #{agencyId}
</select> </select>
<select id="selectGridList" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
cg.ID AS orgId,
cg.GRID_NAME AS orgName,
"grid" AS orgType,
count( csg.USER_ID ) AS staffNum
FROM
customer_grid cg
LEFT JOIN customer_staff_grid csg ON cg.ID = csg.GRID_ID
AND csg.DEL_FLAG = '0'
WHERE
cg.DEL_FLAG = 0
AND cg.PID = #{agencyId}
GROUP BY
cg.ID
ORDER BY cg.CREATED_TIME ASC
</select>
</mapper> </mapper>
Loading…
Cancel
Save