springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/partybuilding/PageComDataStatisticsMemberDto.java
@@ -21,6 +21,6 @@ @ApiModelProperty(value = "关键词") private String keyWord; @ApiModelProperty(value = "1.本年 2.") private Integer type; @ApiModelProperty(value = "年份") private Integer month; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/ComDataStatisticsMemberVo.java
New file @@ -0,0 +1,32 @@ package com.panzhihua.common.model.vos.partybuilding; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author lyq * 分页查询党建数据统计返回参数 */ @Data @ApiModel("分页查询党建数据统计返回参数") public class ComDataStatisticsMemberVo { @ApiModelProperty(value = "党员id") private Long id; @ApiModelProperty(value = "党员姓名") private String name; @ApiModelProperty(value = "党员头像url") private String photoPath; @ApiModelProperty(value = "是否是党委(1.是 2.否)") private Integer isRole; @ApiModelProperty(value = "党员类型(1.预备党员 2.正式党员)") private Integer type; @ApiModelProperty(value = "性别(1.是 2.否)") private Integer sex; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyOrganizationVO.java
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 党组织 @@ -27,4 +29,43 @@ private Long pageNum = 1L; @ApiModelProperty(value = "分页-每页记录数", example = "10") private Long pageSize = 10L; @ApiModelProperty(value = "关键词") private String keyWord; @ApiModelProperty(value = "上级id") private Long parentId; @ApiModelProperty(value = "组织类别(1.基层党委 2.二级基层党委 3.党总支 4.党支部 5.党小组)") private Integer type; @ApiModelProperty(value = "组织隶属(1.乡镇 2.机关 3.域市街道 3.域市社区(居委会) 4.农村社区居委会 5.建制村 6.国有经济控制 7.集体经济控制 8.非公有经济控制 9.事业单位 10.社会组织 11.其他)") private Integer subjection; @ApiModelProperty(value = "小区id") private Long areaId; @ApiModelProperty(value = "楼栋id") private Long buildId; @ApiModelProperty(value = "所属小区名字") private Long areaName; @ApiModelProperty(value = "组织地址") private String address; @ApiModelProperty(value = "经度") private String longitude; @ApiModelProperty(value = "纬度") private String latitude; @ApiModelProperty(value = "一级id") private Long oneId; @ApiModelProperty(value = "二级id") private Long twoId; @ApiModelProperty(value = "三级id") private Long thirdId; @ApiModelProperty(value = "四级id") private Long fourId; @ApiModelProperty(value = "五级id") private Long fiveId; @ApiModelProperty(value = "党组织负责人名称") private String userName; @ApiModelProperty(value = "党组织负责人联系电话") private String phone; @ApiModelProperty(value = "党组织下子组织") private List<PartyOrganizationVO> childList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/partybuilding/PartyBuildingService.java
@@ -22,7 +22,7 @@ public interface PartyBuildingService { /** * 新增党员 * * * @param partyBuildingMemberVO * 党员基本信息 * @return 新增结果 @@ -32,23 +32,31 @@ /** * 社区所有启用的党组织列表 * * * @return 党组织集合 */ @PostMapping("/partybuildIng/listpartyorganization") R listPartyOrganization(@RequestParam("communityId") Long communityId); /** * 社区所有的党组织列表 * * 分页查询所有的党组织列表 * * @return 党组织集合 */ @PostMapping("/partybuildIng/listpartyorganizationAll") R listPartyOrganizationAll(@RequestBody PartyOrganizationVO partyOrganizationVO); /** * 查询所有党组织列表 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ @PostMapping("/partybuildIng/getPbOrgAllList") R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO); /** * 新增党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 新增结果 @@ -58,7 +66,7 @@ /** * 编辑党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -68,7 +76,7 @@ /** * 启用,禁用党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -78,7 +86,7 @@ /** * 删除党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 删除结果 @@ -88,7 +96,7 @@ /** * 批量新增党员 * * * @param list * 党员集合 */ @@ -97,7 +105,7 @@ /** * 分页查询党员信息 * * * @param pagePartyOrganizationVO * 查询信息 * @return 分页数据 @@ -107,7 +115,7 @@ /** * 党员活动 * * * @param partyBuildingActivityVO * 党员活动查询参数 * @return 参加的所有活动 @@ -117,7 +125,7 @@ /** * 活动报名名单分页查询 * * * @param pageActivityMembersVO * 查询参数 手机号 名字 * @return 分页数据 @@ -127,7 +135,7 @@ /** * 编辑党员信息 新增字段均可编辑 * * * @param partyBuildingMemberVO * 编辑字段 * @return 编辑结果 @@ -137,7 +145,7 @@ /** * 党员活动详情 * * * @param id * 活动id * @return 活动详情内容 @@ -147,7 +155,7 @@ /** * 查询指定社区的所有党员 * * * @param communityId * 社区id * @return 党员列表 @@ -157,7 +165,7 @@ /** * 社区下拉选择身份 * * * @return 身份集合 */ @PostMapping("/partybuildIng/listidentity") @@ -165,7 +173,7 @@ /** * 新增党委 * * * @param partyCommitteeVO * 新增信息 * @return 新增结果 @@ -175,7 +183,7 @@ /** * 编辑党委 * * * @param partyCommitteeVO * 编辑信息 * @return 编辑结果 @@ -185,7 +193,7 @@ /** * 删除党委 * * * @param partyCommitteeVO * 删除id * @return 删除结果 @@ -195,7 +203,7 @@ /** * 分页社区党委查询 * * * @param partyCommitteeVO * 查询参数 * @return 分页集合 @@ -205,7 +213,7 @@ /** * 新建党建动态 * * * @param partyCommitteeVO * 动态内容 * @return 新增结果 @@ -215,7 +223,7 @@ /** * 编辑动态 * * * @param partyCommitteeVO * 编辑内容 * @return 编辑结果 @@ -225,7 +233,7 @@ /** * 动态详情 * * * @param id * 动态主键 * @return 详情 @@ -235,7 +243,7 @@ /** * 分页查询党员动态/政策文件 * * * @param partyBuildingComPbDynVO * 查询参数 * @return 分页数据 @@ -245,7 +253,7 @@ /** * 删除动态 * * * @param id * 动态主键 * @return 删除结果 @@ -255,7 +263,7 @@ /** * 新增党员活动 * * * @param partyBuildingActivityVO * 参数 * @return 新增结果 @@ -265,7 +273,7 @@ /** * 编辑党员活动 * * * @param partyBuildingActivityVO * 编辑内容 * @return 编辑结果 @@ -275,7 +283,7 @@ /** * 发布党员活动 * * * @param id * 主键id * @return 发布结果 @@ -285,7 +293,7 @@ /** * 删除党员活动 * * * @param id * 主键id * @return 删除结果 @@ -295,7 +303,7 @@ /** * 分页查询党员活动 * * * @param partyBuildingActivityVO * 查询条件 * @return 查询结果 @@ -305,7 +313,7 @@ /** * 增加阅读记录 * * * @param comPbDynUserVO * 记录内容 * @return 增加结果 @@ -315,7 +323,7 @@ /** * 删除党员 * * * @param id * 党员主键 * @return 删除结果 @@ -325,7 +333,7 @@ /** * 取消活动 * * * @param partyBuildingActivityVO * 取消原因 * @return 操作结果 @@ -335,7 +343,7 @@ /** * 用户的所有党建活动 * * * @param userId * 用户id * @param communityId @@ -349,7 +357,7 @@ /** * 党员活动人员参入列表 * * * @param id * 活动id * @return 党员集合 @@ -359,7 +367,7 @@ /** * 报名、取消报名党员活动 * * * @param activitySignUpDTO * 操作参数 * @return 操作结果 @@ -369,7 +377,7 @@ /** * 获取党建活动所有参入人员的id集合 * * * @param id * 党建活动id * @return 人员id集合 @@ -379,7 +387,7 @@ /** * 定时任务刷新党建动态发布状态 * * * @return 刷新数据数量 */ @PostMapping("/partybuildIng/timedtaskpartybuildingstatus") @@ -387,7 +395,7 @@ /** * 定时任务取消党建活动 * * * @return 需要取消的所有党建活动 */ @PostMapping("/partybuildIng/timedtaskpartybuildingactivity") @@ -395,7 +403,7 @@ /** * 定时任务刷新党建活动的各个状态 除取消外 * * * @return 修改结果 */ @PostMapping("/partybuildIng/timedtaskpartybuildingactivityall") @@ -403,7 +411,7 @@ /** * 新增服务团队人员 * * * @param comPbServiceTeamDTO * 新增内容 * @return 新增结果 @@ -413,7 +421,7 @@ /** * 编辑团队人员 * * * @param comPbServiceTeamDTO * 编辑内容 * @return 编辑结果 @@ -423,7 +431,7 @@ /** * 删除服务团队人员 * * * @param comPbServiceTeamDTO * 删除主键 * @return 删除结果 @@ -433,7 +441,7 @@ /** * 分页查询服务团队成员 * * * @param pageComPbServiceTeamDTO * 查询参数 * @return 查询结果 @@ -443,7 +451,7 @@ /** * 创建党员活动 小程序创建党员活动 * * * @param comPbActivityDTO * 创建内容 * @return 创建结果 @@ -453,7 +461,7 @@ /** * 查询用户党员认证信息 * * * @param id * 用户ID * @return 查询结果 @@ -463,7 +471,7 @@ /** * 查询待认证党员信息 * * * @param pagePartyBuildingMemberVO * 查询参数 * @return 查询结果 @@ -473,7 +481,7 @@ /** * 根据身份证号码查询党员信息 * * * @param idCard * 身份证号码 * @return 党员信息 @@ -483,7 +491,7 @@ /** * 社区所有启用的党组织列表 * * * @return 党组织集合 */ @PostMapping("/partybuildIng/listpartyorganizationByApp") @@ -491,7 +499,7 @@ /** * 根据id删除党员认证 * * * @param id * 党员认证id * @return 党员认证id @@ -501,7 +509,7 @@ /** * 导出党员信息 * * * @param organizationVO * 请求参数 * @return 党员信息列表 @@ -511,7 +519,7 @@ /** * 选择人员 * * * @param param * 查询条件 * @param communityId @@ -524,7 +532,7 @@ /** * 根据党员活动id查询活动下报名人员 * * * @param activityId * 党员活动id * @return 活动下报名人员 springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; import com.panzhihua.common.service.partybuilding.ComDataStatisticsFeign; import com.panzhihua.community_backstage.config.MinioUtil; @@ -107,13 +108,22 @@ return partyBuildingService.listPartyOrganization(communityId); } @ApiOperation(value = "社区所有党组织列表", response = PartyOrganizationVO.class) @ApiOperation(value = "分页查询社区所有党组织列表", response = PartyOrganizationVO.class) @PostMapping("listpartyorganizationAll") public R listPartyOrganizationAll(@RequestBody PartyOrganizationVO partyOrganizationVO) { Long communityId = this.getCommunityId(); partyOrganizationVO.setCommunityId(communityId); log.info("社区所有党组织社区id【{}】", communityId); return partyBuildingService.listPartyOrganizationAll(partyOrganizationVO); } @ApiOperation(value = "查询社区所有党组织列表", response = PartyOrganizationVO.class) @PostMapping("getPbOrgAllList") public R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO) { Long communityId = this.getCommunityId(); partyOrganizationVO.setCommunityId(communityId); log.info("社区所有党组织社区id【{}】", communityId); return partyBuildingService.getPbOrgAllList(partyOrganizationVO); } @OperLog(operModul = "党支部管理", operType = 1) @@ -778,7 +788,7 @@ @ApiOperation(value = "党员数据统计-分页查询党员数据") @PostMapping("/dataStatistics/member/page") public R pageDataStatisticsMember(@RequestParam("id") Long id) { public R pageDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto) { return null; } } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/api/PartyBuildIngApi.java
@@ -47,7 +47,7 @@ /** * 社区所有启用的党组织列表 * * * @return 党组织集合 */ @PostMapping("listpartyorganization") @@ -57,8 +57,8 @@ } /** * 社区所有党组织列表 * * 分页查询社区所有党组织列表 * * @return 党组织集合 */ @PostMapping("listpartyorganizationAll") @@ -67,8 +67,18 @@ } /** * 查询所有党组织列表 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ @PostMapping("getPbOrgAllList") public R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO) { return partyOrganizationService.getPbOrgAllList(partyOrganizationVO); } /** * 新增党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 新增结果 @@ -81,7 +91,7 @@ /** * 编辑党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -94,7 +104,7 @@ /** * 启用,禁用党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -107,7 +117,7 @@ /** * 删除党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -120,7 +130,7 @@ /** * 新增党员 * * * @param partyBuildingMemberVO * 党员基本信息 * @return 新增结果 @@ -133,7 +143,7 @@ /** * 批量新增党员 * * * @param list * 党员集合 */ @@ -158,7 +168,7 @@ /** * 分页查询党员信息 * * * @param pagePartyOrganizationVO * 查询信息 * @return 分页数据 @@ -171,7 +181,7 @@ /** * 党员活动查询 * * * @param partyBuildingActivityVO * 查询参数 * @return 参加的所有活动 @@ -188,7 +198,7 @@ /** * 活动报名名单分页查询 * * * @param pageActivityMembersVO * 查询参数 手机号 名字 * @return 分页数据 @@ -201,7 +211,7 @@ /** * 编辑党员信息 新增字段均可编辑 * * * @param partyBuildingMemberVO * 编辑字段 * @return 编辑结果 @@ -213,7 +223,7 @@ /** * 党员活动详情 * * * @param id * 活动id * @return 活动详情内容 @@ -226,7 +236,7 @@ /** * 查询指定社区的所有党员 * * * @param communityId * 社区id * @return 党员列表 @@ -239,7 +249,7 @@ /** * 新增党委 * * * @param partyCommitteeVO * 新增信息 * @return 新增结果 @@ -252,7 +262,7 @@ /** * 编辑党委 * * * @param partyCommitteeVO * 编辑信息 * @return 编辑结果 @@ -265,7 +275,7 @@ /** * 删除党委 * * * @param partyCommitteeVO * 删除id * @return 删除结果 @@ -278,7 +288,7 @@ /** * 分页社区党委查询 * * * @param partyCommitteeVO * 查询参数 * @return 分页集合 @@ -291,7 +301,7 @@ /** * 新建党建动态 * * * @param partyCommitteeVO * 动态内容 * @return 新增结果 @@ -304,7 +314,7 @@ /** * 编辑动态 * * * @param partyCommitteeVO * 编辑内容 * @return 编辑结果 @@ -317,7 +327,7 @@ /** * 动态详情 * * * @param id * 动态主键 * @return 详情 @@ -330,7 +340,7 @@ /** * 分页查询党员动态/政策文件 * * * @param partyBuildingComPbDynVO * 查询参数 * @return 分页数据 @@ -343,7 +353,7 @@ /** * 删除动态 * * * @param id * 动态主键 * @return 删除结果 @@ -356,7 +366,7 @@ /** * 新增党员活动 * * * @param partyBuildingActivityVO * 参数 * @return 新增结果 @@ -369,7 +379,7 @@ /** * 编辑党员活动 * * * @param partyBuildingActivityVO * 编辑内容 * @return 编辑结果 @@ -382,7 +392,7 @@ /** * 发布党员活动 * * * @param id * 主键id * @return 发布结果 @@ -395,7 +405,7 @@ /** * 删除党员活动 * * * @param id * 主键id * @return 删除结果 @@ -408,7 +418,7 @@ /** * 分页查询党员活动 * * * @param partyBuildingActivityVO * 查询条件 * @return 查询结果 @@ -421,7 +431,7 @@ /** * 增加阅读记录 * * * @param comPbDynUserVO * 记录内容 * @return 增加结果 @@ -434,7 +444,7 @@ /** * 删除党员 * * * @param id * 党员主键 * @return 删除结果 @@ -447,7 +457,7 @@ /** * 取消活动 * * * @param partyBuildingActivityVO * 取消原因 * @return 操作结果 @@ -460,7 +470,7 @@ /** * 用户的所有党建活动 * * * @param userId * 用户id * @param communityId @@ -477,7 +487,7 @@ /** * 党员活动人员参入列表 * * * @param id * 活动id * @return 党员集合 @@ -489,7 +499,7 @@ /** * 报名、取消报名党员活动 * * * @param activitySignUpDTO * 操作参数 * @return 操作结果 @@ -501,7 +511,7 @@ /** * 获取党建活动所有参入人员的id集合 * * * @param id * 党建活动id * @return 人员id集合 @@ -513,7 +523,7 @@ /** * 定时任务刷新党建动态发布状态 * * * @return 刷新数据数量 */ @PostMapping("timedtaskpartybuildingstatus") @@ -523,7 +533,7 @@ /** * 定时任务取消党建活动 * * * @return 党建活动集合 */ @PostMapping("timedtaskpartybuildingactivity") @@ -533,7 +543,7 @@ /** * 定时任务刷新党建活动的各个状态 除取消外 * * * @return 修改结果 */ @PostMapping("timedtaskpartybuildingactivityall") @@ -543,7 +553,7 @@ /** * 新增服务团队人员 * * * @param comPbServiceTeamDTO * 新增内容 * @return 新增结果 @@ -555,7 +565,7 @@ /** * 编辑团队人员 * * * @param comPbServiceTeamDTO * 编辑内容 * @return 编辑结果 @@ -567,7 +577,7 @@ /** * 分页查询服务团队成员 * * * @param pageComPbServiceTeamDTO * 查询参数 * @return 查询结果 @@ -579,7 +589,7 @@ /** * 删除服务团队人员 * * * @param comPbServiceTeamDTO * 删除主键 * @return 删除结果 @@ -591,7 +601,7 @@ /** * 创建党员活动 小程序创建党员活动 * * * @param comPbActivityDTO * 创建内容 * @return 创建结果 @@ -603,7 +613,7 @@ /** * 查询用户认证信息 * * * @param id * 用户id * @return 查询结果 @@ -625,7 +635,7 @@ /** * 查询用户认证信息 * * * @param pagePartyBuildingMemberVO * 查询参数 * @return 查询结果 @@ -637,7 +647,7 @@ /** * 社区所有启用的党组织列表 * * * @return 党组织集合 */ @PostMapping("listpartyorganizationByApp") @@ -649,7 +659,7 @@ /** * 根据党员认证id删除 * * * @param id * 党员认证id * @return 删除结果 @@ -661,7 +671,7 @@ /** * 导出党员信息 * * * @param organizationVO * 请求参数 * @return 党员信息列表 @@ -673,7 +683,7 @@ /** * 选择人员 * * * @param param * 查询条件 * @return 查询结果 @@ -686,7 +696,7 @@ /** * 根据党员活动id查询活动下报名人员 * * * @param activityId * 党员活动id * @return 活动下报名人员 springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbOrgDAO.java
@@ -10,6 +10,8 @@ import com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO; import com.panzhihua.service_dangjian.model.dos.ComPbOrgDO; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 党组织 @@ -19,8 +21,27 @@ @Mapper public interface ComPbOrgDAO extends BaseMapper<ComPbOrgDO> { @Select("select id,`name`,`status` from com_pb_org where community_id = ${partyOrganizationVO.communityId}") /** * 分页查询党组织列表 * @param page 分页参数 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ IPage<PartyOrganizationVO> listPartyOrganizationAll(Page page, @Param("partyOrganizationVO") PartyOrganizationVO partyOrganizationVO); /** * 查询党组织下子组织列表 * @param partyOrganizationVO 请求参数 * @return 党组织下子组织列表 */ List<PartyOrganizationVO> getChildOrgList(@Param("partyOrganizationVO") PartyOrganizationVO partyOrganizationVO); /** * 查询1级党组织列表 * @param partyOrganizationVO 请求参数 * @return 1级党组织列表 */ List<PartyOrganizationVO> getPbOrgAllList(@Param("partyOrganizationVO") PartyOrganizationVO partyOrganizationVO); } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/model/dos/ComPbOrgDO.java
@@ -47,4 +47,83 @@ * 状态 1 启用 2 禁用 */ private Integer status; /** * 组织类别(1.基层党委 2.二级基层党委 3.党总支 4.党支部 5.党小组) */ private Integer type; /** * 组织隶属(1.乡镇 2.机关 3.域市街道 3.域市社区(居委会) 4.农村社区居委会 5.建制村 6.国有经济控制 7.集体经济控制 8.非公有经济控制 9.事业单位 10.社会组织 11.其他) */ private Integer subjection; /** * 小区id */ private Long areaId; /** * 楼栋id */ private Long buildId; /** * 组织地址 */ private String address; /** * 经度 */ private String longitude; /** * 纬度 */ private String latitude; /** * 一级id */ private Long oneId; /** * 二级id */ private Long twoId; /** * 三级id */ private Long thirdId; /** * 四级id */ private Long fourId; /** * 五级id */ private Long fiveId; /** * 组织类别(1.基层党委 2.二级基层党委 3.党总支 4.党支部 5.党小组) */ public interface Type{ int JCDW = 1; int EJJCDW = 2; int DZZ = 3; int DZB = 4; int DXZ = 5; } /** * 组织隶属(1.乡镇 2.机关 3.域市街道 4.域市社区(居委会) 5.农村社区居委会 6.建制村 7.国有经济控制 8.集体经济控制 * 9.非公有经济控制 10.事业单位 11.社会组织 12.其他) */ public interface Subjection{ int XZ = 1; int JG = 2; int YSJD = 3; int YSSQ = 4; int NCSQJWH = 5; int JZC = 6; int GYJJKZ = 7; int JTJJKZ = 8; int FGYJJKZ = 9; int SYDW = 10; int SHZZ = 11; int QT = 12; } } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/PartyOrganizationService.java
@@ -15,21 +15,21 @@ public interface PartyOrganizationService { /** * 平台所有启用的党组织 * * * @return 党组织集合 */ List<PartyOrganizationVO> listPartyOrganization(Long communityId); /** * 平台所有的党组织 * * * @return 党组织集合 */ R listPartyOrganizationAll(PartyOrganizationVO partyOrganizationVO); /** * 新增党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 新增结果 @@ -38,7 +38,7 @@ /** * 编辑党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -47,7 +47,7 @@ /** * 启用,禁用党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -56,7 +56,7 @@ /** * 删除党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -65,8 +65,15 @@ /** * 平台所有启用的党组织 * * * @return 党组织集合 */ List<PartyOrganizationVO> listPartyOrganizationByApp(ComListPartyDTO comListPartyDTO); /** * 查询所有党组织 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ R getPbOrgAllList(PartyOrganizationVO partyOrganizationVO); } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/PartyOrganizationServiceImpl.java
@@ -2,9 +2,11 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import javax.annotation.Resource; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -49,9 +51,7 @@ if (!ObjectUtils.isEmpty(comPbOrgDOS)) { comPbOrgDOS.forEach(comPbOrgDO -> { PartyOrganizationVO partyOrganizationVO = new PartyOrganizationVO(); partyOrganizationVO.setId(comPbOrgDO.getId()); partyOrganizationVO.setName(comPbOrgDO.getName()); partyOrganizationVO.setStatus(comPbOrgDO.getStatus()); BeanUtils.copyProperties(comPbOrgDO,partyOrganizationVO); partyOrganizationVOS.add(partyOrganizationVO); }); } @@ -65,21 +65,49 @@ */ @Override public R listPartyOrganizationAll(PartyOrganizationVO partyOrganizationVO) { IPage<PartyOrganizationVO> orgPgaeList = this.comPbOrgDAO.listPartyOrganizationAll( IPage<PartyOrganizationVO> orgPage = this.comPbOrgDAO.listPartyOrganizationAll( new Page(partyOrganizationVO.getPageNum(), partyOrganizationVO.getPageSize()), partyOrganizationVO); if (!ObjectUtils.isEmpty(orgPgaeList.getRecords())) { orgPgaeList.getRecords().forEach(comPbOrgDO -> { List<ComPbMemberDO> comPbMemberDOs = comPbMemberDAO.selectList( new QueryWrapper<ComPbMemberDO>().lambda().eq(ComPbMemberDO::getOrgId, comPbOrgDO.getId())); comPbOrgDO.setCountPerson(comPbMemberDOs.size()); if (!ObjectUtils.isEmpty(orgPage.getRecords()) && StringUtils.isEmpty(partyOrganizationVO.getKeyWord())) { //遍历第一级党组织列表 orgPage.getRecords().forEach(org -> { partyOrganizationVO.setParentId(org.getId()); List<PartyOrganizationVO> twoChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(twoChildList)){ //遍历第二级党组织列表 twoChildList.forEach(twoChild -> { partyOrganizationVO.setParentId(twoChild.getId()); List<PartyOrganizationVO> thirdChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(thirdChildList)){ //遍历第三级党组织列表 thirdChildList.forEach(thirdChild -> { partyOrganizationVO.setParentId(thirdChild.getId()); List<PartyOrganizationVO> fourChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(fourChildList)){ fourChildList.forEach(fourChild -> { partyOrganizationVO.setParentId(fourChild.getId()); List<PartyOrganizationVO> fiveChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); fourChild.setCountPerson(fourChild.getCountPerson() + fiveChildList.stream().mapToInt(five -> five.getCountPerson()).sum()); fourChild.setChildList(fiveChildList); }); } thirdChild.setCountPerson(thirdChild.getCountPerson() + fourChildList.stream().mapToInt(four -> four.getCountPerson()).sum()); thirdChild.setChildList(fourChildList); }); } twoChild.setCountPerson(twoChild.getCountPerson() + thirdChildList.stream().mapToInt(third -> third.getCountPerson()).sum()); twoChild.setChildList(thirdChildList); }); } org.setCountPerson(org.getCountPerson() + twoChildList.stream().mapToInt(two -> two.getCountPerson()).sum()); org.setChildList(twoChildList); }); } return R.ok(orgPgaeList); return R.ok(orgPage); } /** * 新增党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 新增结果 @@ -88,10 +116,50 @@ public R addPartyOrganization(PartyOrganizationVO partyOrganizationVO) { ComPbOrgDO comPbOrgDO = new ComPbOrgDO(); BeanUtils.copyProperties(partyOrganizationVO, comPbOrgDO); comPbOrgDO.setLevel(1); comPbOrgDO.setParentId(0L); comPbOrgDO.setLevel(partyOrganizationVO.getType()); ComPbOrgDO oldComPbOrgDO = null; int insert = comPbOrgDAO.insert(comPbOrgDO); if (insert > 0) { switch (partyOrganizationVO.getType()){ case ComPbOrgDO.Type.JCDW: comPbOrgDO.setParentId(0L); comPbOrgDO.setOneId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.EJJCDW: comPbOrgDO.setOneId(partyOrganizationVO.getParentId()); comPbOrgDO.setTwoId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DZZ: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); } comPbOrgDO.setThirdId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DZB: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); comPbOrgDO.setThirdId(oldComPbOrgDO.getThirdId()); } comPbOrgDO.setFourId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DXZ: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); comPbOrgDO.setThirdId(oldComPbOrgDO.getThirdId()); comPbOrgDO.setFourId(oldComPbOrgDO.getFourId()); } comPbOrgDO.setFiveId(comPbOrgDO.getId()); break; default: break; } this.comPbOrgDAO.updateById(comPbOrgDO); return R.ok(); } return R.fail(); @@ -99,7 +167,7 @@ /** * 编辑党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -108,10 +176,49 @@ public R updatePartyOrganization(PartyOrganizationVO partyOrganizationVO) { ComPbOrgDO comPbOrgDO = new ComPbOrgDO(); BeanUtils.copyProperties(partyOrganizationVO, comPbOrgDO); comPbOrgDO.setLevel(1); comPbOrgDO.setParentId(0L); comPbOrgDO.setLevel(partyOrganizationVO.getType()); ComPbOrgDO oldComPbOrgDO = null; int insert = comPbOrgDAO.updateById(comPbOrgDO); if (insert > 0) { switch (partyOrganizationVO.getType()){ case ComPbOrgDO.Type.JCDW: comPbOrgDO.setParentId(0L); comPbOrgDO.setOneId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.EJJCDW: comPbOrgDO.setOneId(partyOrganizationVO.getParentId()); comPbOrgDO.setTwoId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DZZ: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); } comPbOrgDO.setThirdId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DZB: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); comPbOrgDO.setThirdId(oldComPbOrgDO.getThirdId()); } comPbOrgDO.setFourId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DXZ: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); comPbOrgDO.setThirdId(oldComPbOrgDO.getThirdId()); comPbOrgDO.setFourId(oldComPbOrgDO.getFourId()); } comPbOrgDO.setFiveId(comPbOrgDO.getId()); break; default: break; } return R.ok(); } return R.fail(); @@ -119,7 +226,7 @@ /** * 启用,禁用党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 @@ -140,16 +247,20 @@ /** * 删除党支部 * * * @param partyOrganizationVO * 党支部基本信息 * @return 编辑结果 */ @Override public R deletePartyOrganization(PartyOrganizationVO partyOrganizationVO) { List<ComPbMemberDO> comPbMemberDOs = comPbMemberDAO.selectList( Integer count = comPbOrgDAO.selectCount(new QueryWrapper<ComPbOrgDO>().lambda().eq(ComPbOrgDO::getParentId,partyOrganizationVO.getId())); if(count > 0){ return R.fail("该组织下已有子组织,不能删除!"); } List<ComPbMemberDO> comPbMemberList = comPbMemberDAO.selectList( new QueryWrapper<ComPbMemberDO>().lambda().eq(ComPbMemberDO::getOrgId, partyOrganizationVO.getId())); if (!CollectionUtils.isEmpty(comPbMemberDOs) && comPbMemberDOs.size() > 0) { if (!CollectionUtils.isEmpty(comPbMemberList) && comPbMemberList.size() > 0) { return R.fail("该党组织下已有党员,不能删除!"); } int insert = comPbOrgDAO.deleteById(partyOrganizationVO.getId()); @@ -159,6 +270,7 @@ return R.fail(); } @Override public List<PartyOrganizationVO> listPartyOrganizationByApp(ComListPartyDTO comListPartyDTO) { List<PartyOrganizationVO> partyOrganizationVOS = new ArrayList<>(); QueryWrapper<ComPbOrgDO> queryWrapper = new QueryWrapper<>(); @@ -181,4 +293,50 @@ } return partyOrganizationVOS; } /** * 查询所有党组织列表 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ @Override public R getPbOrgAllList(PartyOrganizationVO partyOrganizationVO){ List<PartyOrganizationVO> orgList = this.comPbOrgDAO.getPbOrgAllList(partyOrganizationVO); if (!ObjectUtils.isEmpty(orgList) && StringUtils.isEmpty(partyOrganizationVO.getKeyWord())) { //遍历第一级党组织列表 orgList.forEach(org -> { partyOrganizationVO.setParentId(org.getId()); List<PartyOrganizationVO> twoChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(twoChildList)){ //遍历第二级党组织列表 twoChildList.forEach(twoChild -> { partyOrganizationVO.setParentId(twoChild.getId()); List<PartyOrganizationVO> thirdChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(thirdChildList)){ //遍历第三级党组织列表 thirdChildList.forEach(thirdChild -> { partyOrganizationVO.setParentId(thirdChild.getId()); List<PartyOrganizationVO> fourChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(fourChildList)){ fourChildList.forEach(fourChild -> { partyOrganizationVO.setParentId(fourChild.getId()); List<PartyOrganizationVO> fiveChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); fourChild.setCountPerson(fourChild.getCountPerson() + fiveChildList.stream().mapToInt(five -> five.getCountPerson()).sum()); fourChild.setChildList(fiveChildList); }); } thirdChild.setCountPerson(thirdChild.getCountPerson() + fourChildList.stream().mapToInt(four -> four.getCountPerson()).sum()); thirdChild.setChildList(fourChildList); }); } twoChild.setCountPerson(twoChild.getCountPerson() + thirdChildList.stream().mapToInt(third -> third.getCountPerson()).sum()); twoChild.setChildList(thirdChildList); }); } org.setCountPerson(org.getCountPerson() + twoChildList.stream().mapToInt(two -> two.getCountPerson()).sum()); org.setChildList(twoChildList); }); } return R.ok(orgList); } } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbOrgMapper.xml
New file @@ -0,0 +1,157 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.service_dangjian.dao.ComPbOrgDAO"> <resultMap type="com.panzhihua.service_dangjian.model.dos.ComPbOrgDO" id="ComPbOrgMap"> <result property="id" column="id" jdbcType="INTEGER"/> <result property="level" column="level" jdbcType="INTEGER"/> <result property="parentId" column="parent_id" jdbcType="INTEGER"/> <result property="name" column="name" jdbcType="VARCHAR"/> <result property="communityId" column="community_id" jdbcType="INTEGER"/> <result property="status" column="status" jdbcType="INTEGER"/> <result property="type" column="type" jdbcType="INTEGER"/> <result property="subjection" column="subjection" jdbcType="INTEGER"/> <result property="areaId" column="area_id" jdbcType="INTEGER"/> <result property="address" column="address" jdbcType="VARCHAR"/> <result property="longitude" column="longitude" jdbcType="VARCHAR"/> <result property="latitude" column="latitude" jdbcType="VARCHAR"/> <result property="oneId" column="one_id" jdbcType="INTEGER"/> <result property="twoId" column="two_id" jdbcType="INTEGER"/> <result property="thirdId" column="third_id" jdbcType="INTEGER"/> <result property="fourId" column="four_id" jdbcType="INTEGER"/> <result property="fiveId" column="five_id" jdbcType="INTEGER"/> <result property="buildId" column="build_id" jdbcType="INTEGER"/> </resultMap> <select id="listPartyOrganizationAll" resultType="com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO"> SELECT cpo.id, cpo.`name`, cpo.`status`, cpo.parent_id, cpo.subjection, cpo.area_id, cpo.build_id, cpo.address, cpo.longitude, cpo.latitude, cmr.`name` AS areaName, cmb.`name` AS buildName, cpmr.`name` AS userName, cpmr.phone AS phone FROM com_pb_org AS cpo LEFT JOIN com_mng_residential AS cmr ON cmr.id = cpo.area_id LEFT JOIN com_pb_member_role AS cpmr ON cpmr.org_id = cpo.id left join com_mng_building as cmb on cmb.id = cpo.build_id <where> <if test="partyOrganizationVO.communityId != null"> and cpo.community_id = ${partyOrganizationVO.communityId} </if> <if test="partyOrganizationVO.keyWord == null or partyOrganizationVO.keyWord == ''"> AND cpo.parent_id = 0 </if> <if test="partyOrganizationVO.keyWord != null and partyOrganizationVO.keyWord != ''"> and cpo.`name` like CONCAT(#{partyOrganizationVO.keyword}, '%') </if> <if test="partyOrganizationVO.subjection != null"> and cpo.subjection = #{partyOrganizationVO.subjection} </if> <if test="partyOrganizationVO.areaId != null"> and cpo.area_id = #{partyOrganizationVO.areaId} </if> <if test="partyOrganizationVO.buildId != null"> and cpo.build_id = #{partyOrganizationVO.buildId} </if> </where> ORDER BY cpo.id desc </select> <select id="getChildOrgList" resultType="com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO"> SELECT cpo.id, cpo.`name`, cpo.`status`, cpo.parent_id, cpo.subjection, cpo.area_id, cpo.build_id, cpo.address, cpo.longitude, cpo.latitude, cmr.`name` AS areaName, cmb.`name` AS buildName, cpmr.`name` AS userName, cpmr.phone AS phone, (select count(id) from com_pb_member where org_id = cpo.id and audit_result = 1) as countPerson FROM com_pb_org AS cpo LEFT JOIN com_mng_residential AS cmr ON cmr.id = cpo.area_id LEFT JOIN com_pb_member_role AS cpmr ON cpmr.org_id = cpo.id left join com_mng_building as cmb on cmb.id = cpo.build_id <where> <if test="partyOrganizationVO.parentId != null"> AND cpo.parent_id = ${partyOrganizationVO.parentId} </if> <if test="partyOrganizationVO.communityId != null"> and cpo.community_id = ${partyOrganizationVO.communityId} </if> <if test="partyOrganizationVO.subjection != null"> and cpo.subjection = #{partyOrganizationVO.subjection} </if> <if test="partyOrganizationVO.areaId != null"> and cpo.area_id = #{partyOrganizationVO.areaId} </if> <if test="partyOrganizationVO.buildId != null"> and cpo.build_id = #{partyOrganizationVO.buildId} </if> </where> ORDER BY cpo.id desc </select> <select id="getPbOrgAllList" resultType="com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO"> SELECT cpo.id, cpo.`name`, cpo.`status`, cpo.parent_id, cpo.subjection, cpo.area_id, cpo.build_id, cpo.address, cpo.longitude, cpo.latitude, cmr.`name` AS areaName, cmb.`name` AS buildName, cpmr.`name` AS userName, cpmr.phone AS phone FROM com_pb_org AS cpo LEFT JOIN com_mng_residential AS cmr ON cmr.id = cpo.area_id LEFT JOIN com_pb_member_role AS cpmr ON cpmr.org_id = cpo.id left join com_mng_building as cmb on cmb.id = cpo.build_id <where> <if test="partyOrganizationVO.communityId != null"> and cpo.community_id = ${partyOrganizationVO.communityId} </if> <if test="partyOrganizationVO.keyWord == null or partyOrganizationVO.keyWord == ''"> AND cpo.parent_id = 0 </if> <if test="partyOrganizationVO.keyWord != null and partyOrganizationVO.keyWord != ''"> and cpo.`name` like CONCAT(#{partyOrganizationVO.keyword}, '%') </if> <if test="partyOrganizationVO.subjection != null"> and cpo.subjection = #{partyOrganizationVO.subjection} </if> <if test="partyOrganizationVO.areaId != null"> and cpo.area_id = #{partyOrganizationVO.areaId} </if> <if test="partyOrganizationVO.buildId != null"> and cpo.build_id = #{partyOrganizationVO.buildId} </if> </where> ORDER BY cpo.id desc </select> </mapper>