Browse Source

组织加网格树

master
sunyuchao 5 years ago
parent
commit
2ebfb4b312
  1. 131
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java
  2. 97
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java
  3. 126
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java
  4. 27
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerIdDTO.java
  5. 111
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerPartyBranchDTO.java
  6. 87
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffAgencyDTO.java
  7. 87
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffDepartmentDTO.java
  8. 87
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffGridDTO.java
  9. 21
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/GridStaffCountDTO.java
  10. 13
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/OrgTreeNode.java
  11. 41
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffGridListDTO.java
  12. 102
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffTransferRecordDTO.java
  13. 47
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdAndPidDTO.java
  14. 21
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdDTO.java
  15. 0
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/.gitkeep
  16. 40
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridListResultDTO.java
  17. 60
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridResultDTO.java
  18. 41
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridInfoResultDTO.java
  19. 26
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  20. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  21. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java
  22. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java
  23. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  24. 73
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  25. 34
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
  26. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  27. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

131
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java

@ -0,0 +1,131 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 机关单位信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
public class CustomerAgencyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 上级组织机构ID
*/
private String pid;
/**
* 所有上级组织机构ID(以英文:隔开)
*/
private String pids;
/**
* 所有上级名称,-连接
*/
private String allParentName;
/**
* 组织名称
*/
private String organizationName;
/**
* 机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
private String level;
/**
* 地区编码
*/
private String areaCode;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 总人数
*/
private Integer totalUser;
/**
* 省份
*/
private String province;
/**
* 城市
*/
private String city;
/**
* 区县
*/
private String district;
}

97
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java

@ -0,0 +1,97 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 客户部门表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
public class CustomerDepartmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 所属组织机构IDcustomer_organization.idAGENCY_ID
*/
private String agencyId;
/**
* 部门名称
*/
private String departmentName;
/**
* 部门职责
*/
private String departmentDuty;
/**
* 总人数
*/
private Integer totalUser;
/**
* 删除标识:0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

126
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java

@ -0,0 +1,126 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 客户网格表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-16
*/
@Data
public class CustomerGridDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 网格名称
*/
private String gridName;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
/**
* 所属地区码所属组织地区码
*/
private String areaCode;
/**
* 删除标识:0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 管辖区域
*/
private String manageDistrict;
/**
* 当前网格总人数
*/
private Integer totalUser;
/**
* 所属组织机构IDcustomer_organization.id
*/
private String pid;
/**
* 所有上级组织ID
*/
private String pids;
/**
* 所属组织机构名
*/
private String agencyName;
/**
* 所有上级组织名
*/
private String allParentName;
}

27
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerIdDTO.java

@ -0,0 +1,27 @@
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
/**
* 根据userId查询customerId 的DTO
* @Auther zxc
* @Create 2020-04-24 15:57
*/
@Data
public class CustomerIdDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* userId 用户id
*/
private String userId;
/**
* customerId 客户id
*/
private String customerId;
}

111
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerPartyBranchDTO.java

@ -0,0 +1,111 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 党支部信息
*
* @author yinzuomei yinzuomei@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class CustomerPartyBranchDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 支部名称
*/
private String partyBranchName;
/**
* 概要
*/
private String profile;
/**
* 党支部所属网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 党员总数
*/
private Integer totalPartyMember;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 网格名称
*/
private String gridName;
/**
* 网格所属机关id
*/
private String agencyId;
/**
* 网格所属机关名字
*/
private String agencyName;
}

87
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffAgencyDTO.java

@ -0,0 +1,87 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 人员-机关单位关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
public class CustomerStaffAgencyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 用户ID
*/
private String userId;
/**
* 组织机构ID customer_agency.id
*/
private String agencyId;
/**
* 删除标识
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

87
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffDepartmentDTO.java

@ -0,0 +1,87 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 部门人员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
public class CustomerStaffDepartmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 用户ID
*/
private String userId;
/**
* 部门ID customer_department.id
*/
private String departmentId;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

87
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffGridDTO.java

@ -0,0 +1,87 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 网格人员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
public class CustomerStaffGridDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 用户id, user.id
*/
private String userId;
/**
* 网格ID customer_grid.id
*/
private String gridId;
/**
* 客户ID
*/
private String customerId;
/**
* 删除标识
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

21
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/GridStaffCountDTO.java

@ -0,0 +1,21 @@
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
/**
* @Auther zxc
* @Create 2020-04-24 9:13
*/
@Data
public class GridStaffCountDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网格下未被禁用的工作人员数量
*/
private Integer enableCount;
}

13
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/OrgTreeNode.java

@ -0,0 +1,13 @@
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.util.List;
@Data
public class OrgTreeNode {
private String orgId;
private String orgName;
private String orgType;
private List<OrgTreeNode> subOrgs;
}

41
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffGridListDTO.java

@ -0,0 +1,41 @@
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
/**
* @Auther zxc
* @Create 2020-04-23 10:38
*/
@Data
public class StaffGridListDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户id
*/
private String staffId;
/**
* 用户姓名
*/
private String staffName;
/**
* 用户头像
*/
private String staffHeadPhoto;
/**
* 角色名称
*/
private String roleName;
/**
* 性别
*/
private String gender;
}

102
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffTransferRecordDTO.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
@Data
public class StaffTransferRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 调动人员Id(操作人)
*/
private String operateStaffId;
/**
* 被调动人员Id
*/
private String operatedStaffId;
/**
* 调动前组织Id
*/
private String oldAgencyId;
/**
* 调动后组织Id
*/
private String agencyId;
/**
* 备注说明
*/
private String remarks;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

47
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdAndPidDTO.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
/**
* 网格人员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
public class UserIdAndPidDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户id, user.id
*/
private String userId;
/**
* pid 所属机关id
*/
private String pid;
}

21
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdDTO.java

@ -0,0 +1,21 @@
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
/**
* @Auther zxc
* @Create 2020-04-24 9:06
*/
@Data
public class UserIdDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* userId
*/
private String userId;
}

0
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/.gitkeep

40
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridListResultDTO.java

@ -0,0 +1,40 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
/**
* 组织网格树结构
*
* @author sun
*/
@Data
public class AgencyGridListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 树结构对象
*/
private AgencyGridResultDTO agencyGridList;
}

60
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridResultDTO.java

@ -0,0 +1,60 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 获取工作人员所属组织及下级组织和网格树结构-接口返参
*
* @author sun
*/
@Data
public class AgencyGridResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 机关组织Id
*/
private String agencyId = "";
/**
* 机关组织名称
*/
private String agencyName = "";
/**
* 当前机关的下属网格列表
*/
private List<GridInfoResultDTO> gridList = new ArrayList<>();
/**
* 当前组织的所有下级组织信息(递归)
*/
private List<AgencyGridResultDTO> subAgencyGridList = new ArrayList<>();
/**
* 所有上级组织机构ID(以英文:隔开)
*/
@JsonIgnore
private String pids = "";
}

41
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridInfoResultDTO.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
/**
* 获取工作人员所属组织及下级组织和网格树结构-接口返参
*
* @author sun
*/
@Data
public class GridInfoResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 机关组织Id
*/
private String gridId = "";
private String gridName = "";
}

26
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -1,5 +1,12 @@
package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.dto.govorg.result.AgencyGridListResultDTO;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -8,6 +15,23 @@ import org.springframework.web.bind.annotation.RestController;
* @DateTime 2020/12/25 上午9:45
*/
@RestController
@RequestMapping("govorg")
@RequestMapping("org")
public class GovOrgController {
@Autowired
private GovOrgService govOrgService;
/**
* @param tokenDTO
* @Author sun
* @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围
**/
@PostMapping("agencygridlist")
public Result<AgencyGridListResultDTO> agencyGridList(@LoginUser TokenDto tokenDTO) {
AgencyGridListResultDTO agencyGridList = new AgencyGridListResultDTO();
agencyGridList.setAgencyGridList(govOrgService.agencyGridList(tokenDTO.getUserId()));
return new Result<AgencyGridListResultDTO>().ok(agencyGridList);
}
}

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

@ -18,8 +18,12 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 机关单位信息表
@ -29,4 +33,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
/**
* @Author sun
* @Description 递归查询当前机关的下一级机关列表
**/
List<AgencyGridResultDTO> selectAllSubAgency(@Param("subPids") String subPids);
}

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

@ -18,8 +18,12 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 客户网格表
@ -30,4 +34,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
/**
* @Author sun
* @Description 查询组织下直属网格列表
**/
List<GridInfoResultDTO> selectAgencyGridList(@Param("agencyId") String agencyId);
}

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

@ -18,8 +18,10 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
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;
/**
* 人员-机关单位关系表
@ -30,4 +32,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntity> {
/**
* @Author sun
* @Description 根据staffId查询客户组织信息
**/
CustomerStaffAgencyDTO selectByStaffId(@Param("userId") String userId);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -1,8 +1,18 @@
package com.epmet.dataaggre.service.govorg;
import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO;
/**
* @Author zxc
* @DateTime 2020/12/25 上午9:15
*/
public interface GovOrgService {
/**
* @param staffId
* @Author sun
* @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围
**/
AgencyGridResultDTO agencyGridList(String staffId);
}

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

@ -1,11 +1,25 @@
package com.epmet.dataaggre.service.govorg.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
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.dto.govorg.CustomerStaffAgencyDTO;
import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/12/25 上午9:15
@ -14,4 +28,63 @@ import org.springframework.stereotype.Service;
@DataSource(DataSourceConstant.GOV_ORG)
@Slf4j
public class GovOrgServiceImpl implements GovOrgService {
private static final Logger logger = LoggerFactory.getLogger(GovOrgServiceImpl.class);
@Autowired
private CustomerAgencyDao customerAgencyDao;
@Autowired
private CustomerStaffAgencyDao customerStaffAgencyDao;
@Autowired
private CustomerGridDao customerGridDao;
/**
* @param staffId
* @Author sun
* @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围
**/
@Override
public AgencyGridResultDTO agencyGridList(String staffId) {
AgencyGridResultDTO returnDTO = new AgencyGridResultDTO();
//1:根据staffId查询该工作人员对应的机关Id、客户Id
CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyDao.selectByStaffId(staffId);
if (null == staffAgencyDTO || null == staffAgencyDTO.getId()) {
throw new RenException(String.format("获取工作人员组织信息失败,staffId->%s", staffId));
}
//2:查询当前组织机关信息
CustomerAgencyEntity agencyEntity = customerAgencyDao.selectById(staffAgencyDTO.getAgencyId());
returnDTO.setAgencyId(agencyEntity.getId());
returnDTO.setAgencyName(agencyEntity.getOrganizationName());
//3:查询当前机关下的网格列表
List<GridInfoResultDTO> gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId());
returnDTO.setGridList(gridList);
//4:递归查询当前组织的下级组织以及每个下级组织对应的网格列表
//根组织pids为空
List<AgencyGridResultDTO> subAgencyGridList = getGridList(("".equals(agencyEntity.getPids()) ? "" : agencyEntity.getPids() + ":") + agencyEntity.getId());
returnDTO.setSubAgencyGridList(subAgencyGridList);
return returnDTO;
}
/**
* @Author sun
* @Description 递归查询当前机关的下一级机关列表
**/
private List<AgencyGridResultDTO> getGridList(String subPids) {
List<AgencyGridResultDTO> subAgencyList = customerAgencyDao.selectAllSubAgency(subPids);
if (subAgencyList.size() > NumConstant.ZERO) {
for (AgencyGridResultDTO sub : subAgencyList) {
List<GridInfoResultDTO> gridList = customerGridDao.selectAgencyGridList(sub.getAgencyId());
sub.setGridList(gridList);
List<AgencyGridResultDTO> subAgency = getGridList(sub.getPids() + ":" + sub.getAgencyId());
sub.setSubAgencyGridList(subAgency);
}
}
return subAgencyList;
}
}

34
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

@ -3,24 +3,18 @@
<mapper namespace="com.epmet.dataaggre.dao.govorg.CustomerAgencyDao">
<sql id="sql">
ca.id AS "id",
ca.customer_id AS "customerId",
ca.pid AS "pid",
ca.pids AS "pids",
ca.all_parent_name AS "allParentName",
ca.organization_name AS "organizationName",
ca.level AS "level",
ca.area_code AS "areaCode",
ca.total_user AS "totalUser",
ca.province AS "province",
ca.city AS "city",
ca.district AS "district",
ca.del_flag AS "delflag",
ca.revision AS "revision",
ca.created_by AS "createdby",
ca.created_time AS "createdtime",
ca.updated_by AS "updatedby",
ca.updated_time AS "updatedtime"
</sql>
<select id="selectAllSubAgency" resultType="com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO">
SELECT
id AS "agencyId",
organization_name AS "agencyName",
pids AS "pids"
FROM
customer_agency
WHERE
del_flag = '0'
AND pids = #{subPids}
ORDER BY
created_time DESC
</select>
</mapper>

12
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

@ -2,4 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.govorg.CustomerGridDao">
<select id="selectAgencyGridList" resultType="com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO">
SELECT
id AS "gridId",
grid_name AS "gridName"
FROM
customer_grid
WHERE
del_flag = '0'
AND pid = #{agencyId}
</select>
</mapper>

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

@ -2,4 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.govorg.CustomerStaffAgencyDao">
<select id="selectByStaffId" resultType="com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO">
SELECT
id,
customer_id,
user_id,
agency_id
FROM
customer_staff_agency
WHERE
del_flag = '0'
AND user_id = #{userId}
</select>
</mapper>
Loading…
Cancel
Save