From 7fa4e46888cbbbbf33849aa373a7c995db93d9c7 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Thu, 31 Dec 2020 14:17:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=9A=E7=BB=84=E5=BB=BA?= =?UTF-8?q?=E8=AE=BE=E5=86=85=E5=AE=B9=E8=80=83=E6=A0=B8=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ThreeMeetLessonResourcesController.java | 13 +++ .../threemeetlesson/IThreeMeetLessonDao.java | 6 ++ .../CountThreeMeetLesson.java | 45 +++++++++ .../StreetThreeMeetLesson.java | 51 +++++++++++ .../IThreeMeetLessonService.java | 8 ++ .../impl/ThreeMeetLessonServiceImpl.java | 91 +++++++++++++++++++ .../threemeetlesson-mapper.xml | 11 +++ 7 files changed, 225 insertions(+) create mode 100644 src/main/java/com/cm/partybuilding/pojo/dtos/resourcesexamine/CountThreeMeetLesson.java create mode 100644 src/main/java/com/cm/partybuilding/pojo/dtos/resourcesexamine/StreetThreeMeetLesson.java diff --git a/src/main/java/com/cm/partybuilding/controller/resources/threemeetlesson/ThreeMeetLessonResourcesController.java b/src/main/java/com/cm/partybuilding/controller/resources/threemeetlesson/ThreeMeetLessonResourcesController.java index 9fa3116..b850d69 100644 --- a/src/main/java/com/cm/partybuilding/controller/resources/threemeetlesson/ThreeMeetLessonResourcesController.java +++ b/src/main/java/com/cm/partybuilding/controller/resources/threemeetlesson/ThreeMeetLessonResourcesController.java @@ -5,6 +5,7 @@ import com.cm.common.constants.ISystemConstant; import com.cm.common.exception.SearchException; import com.cm.common.result.ErrorResult; import com.cm.common.result.SuccessResultData; +import com.cm.partybuilding.pojo.dtos.resourcesexamine.StreetThreeMeetLesson; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO; import com.cm.partybuilding.service.threemeetlesson.IThreeMeetLessonService; import io.swagger.annotations.*; @@ -56,4 +57,16 @@ public class ThreeMeetLessonResourcesController extends AbstractController { return threeMeetLessonService.getThreeMeetLessonWeekCount(params); } + @ApiOperation(value = "查询街镇村下党组织内组织生活数量", notes = "查询街镇村下党组织内组织生活数量") + @ApiImplicitParams({ + @ApiImplicitParam(name = "startDate", value = "发布时间始", paramType = "query"), + @ApiImplicitParam(name = "endDate", value = "发布时间止", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getexaminestreetcounts") + public List getExamineStreetCounts(){ + Map params = requestParams(); + return threeMeetLessonService.getExamineStreetCounts(params); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/dao/threemeetlesson/IThreeMeetLessonDao.java b/src/main/java/com/cm/partybuilding/dao/threemeetlesson/IThreeMeetLessonDao.java index c1d5b11..11254a1 100644 --- a/src/main/java/com/cm/partybuilding/dao/threemeetlesson/IThreeMeetLessonDao.java +++ b/src/main/java/com/cm/partybuilding/dao/threemeetlesson/IThreeMeetLessonDao.java @@ -101,4 +101,10 @@ public interface IThreeMeetLessonDao { * @return */ Integer getOrgThreeMeetLessonCount(Map params); + + /** + * 查询街道下所有党组织 + * @return + */ + List listOrgBelongStreet(Map params); } \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/pojo/dtos/resourcesexamine/CountThreeMeetLesson.java b/src/main/java/com/cm/partybuilding/pojo/dtos/resourcesexamine/CountThreeMeetLesson.java new file mode 100644 index 0000000..518f930 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/pojo/dtos/resourcesexamine/CountThreeMeetLesson.java @@ -0,0 +1,45 @@ +package com.cm.partybuilding.pojo.dtos.resourcesexamine; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 组织生活resources接口实体类 + * @author xwangs + * @create 2020-12-30 18:10 + * @description + */ +@ApiModel +public class CountThreeMeetLesson { + + @ApiModelProperty(name = "categoryName", value = "分类名称") + private String categoryName; + @ApiModelProperty(name = "category", value = "分类编码") + private String category; + @ApiModelProperty(name = "counts", value = "发布数量") + private String counts; + + public String getCategoryName() { + return categoryName == null ? "" : categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + public String getCategory() { + return category == null ? "" : category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getCounts() { + return counts == null ? "" : counts; + } + + public void setCounts(String counts) { + this.counts = counts; + } +} diff --git a/src/main/java/com/cm/partybuilding/pojo/dtos/resourcesexamine/StreetThreeMeetLesson.java b/src/main/java/com/cm/partybuilding/pojo/dtos/resourcesexamine/StreetThreeMeetLesson.java new file mode 100644 index 0000000..ed522e8 --- /dev/null +++ b/src/main/java/com/cm/partybuilding/pojo/dtos/resourcesexamine/StreetThreeMeetLesson.java @@ -0,0 +1,51 @@ +package com.cm.partybuilding.pojo.dtos.resourcesexamine; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.ArrayList; +import java.util.List; + +/** + * 街镇组织生活集合 + * @author xwangs + * @create 2020-12-30 18:19 + * @description + */ +@ApiModel +public class StreetThreeMeetLesson { + + @ApiModelProperty(name = "areaId", value = "镇街ID") + private String areaId; + @ApiModelProperty(name = "areaName", value = "镇街名称") + private String areaName; + @ApiModelProperty(name = "countThreeMeetLesson", value = "各类组织生活发布数量") + private List countThreeMeetLesson; + + public String getAreaId() { + return areaId == null ? "" : areaId; + } + + public void setAreaId(String areaId) { + this.areaId = areaId; + } + + public String getAreaName() { + return areaName == null ? "" : areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public List getCountThreeMeetLesson() { + if (countThreeMeetLesson == null) { + return new ArrayList<>(); + } + return countThreeMeetLesson; + } + + public void setCountThreeMeetLesson(List countThreeMeetLesson) { + this.countThreeMeetLesson = countThreeMeetLesson; + } +} diff --git a/src/main/java/com/cm/partybuilding/service/threemeetlesson/IThreeMeetLessonService.java b/src/main/java/com/cm/partybuilding/service/threemeetlesson/IThreeMeetLessonService.java index 61c2dd7..4797903 100644 --- a/src/main/java/com/cm/partybuilding/service/threemeetlesson/IThreeMeetLessonService.java +++ b/src/main/java/com/cm/partybuilding/service/threemeetlesson/IThreeMeetLessonService.java @@ -7,6 +7,7 @@ import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; +import com.cm.partybuilding.pojo.dtos.resourcesexamine.StreetThreeMeetLesson; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonEChartsDTO; import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO; @@ -174,4 +175,11 @@ public interface IThreeMeetLessonService { * @return */ List> getThreeMeetLessonWeekCount(Map params); + + /** + * 查询街镇村下党组织内组织生活数量 + * @param params + * @return + */ + List getExamineStreetCounts(Map params); } \ No newline at end of file diff --git a/src/main/java/com/cm/partybuilding/service/threemeetlesson/impl/ThreeMeetLessonServiceImpl.java b/src/main/java/com/cm/partybuilding/service/threemeetlesson/impl/ThreeMeetLessonServiceImpl.java index 614fc9e..5f9af5f 100644 --- a/src/main/java/com/cm/partybuilding/service/threemeetlesson/impl/ThreeMeetLessonServiceImpl.java +++ b/src/main/java/com/cm/partybuilding/service/threemeetlesson/impl/ThreeMeetLessonServiceImpl.java @@ -11,6 +11,8 @@ import com.cm.common.utils.DateUtil; import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.UUIDUtil; import com.cm.partybuilding.dao.threemeetlesson.IThreeMeetLessonDao; +import com.cm.partybuilding.pojo.dtos.resourcesexamine.CountThreeMeetLesson; +import com.cm.partybuilding.pojo.dtos.resourcesexamine.StreetThreeMeetLesson; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonEChartsDTO; import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO; @@ -287,4 +289,93 @@ public class ThreeMeetLessonServiceImpl extends AbstractService implements IThre result.add(weekCount); return result; } + + @Override + public List getExamineStreetCounts(Map params) { + String[] categoryName = {"支部委员会会议","全体党员大会","党小组会议","民主评议党员", + "组织生活会","谈心谈话","党员教育培训","党课"}; + List orgList = new ArrayList<>(); + List userIdsList = new ArrayList<>(); + //根据街道查询所有党组织 + //民馨路 + StreetThreeMeetLesson minXin = new StreetThreeMeetLesson(); + minXin.setAreaId("6e922367-f21f-4daf-b38c-c55a67d9a35b"); + minXin.setAreaName("民馨路街道办事处"); + params.put("areaId",minXin.getAreaId()); + orgList = threeMeetLessonDao.listOrgBelongStreet(params); + userIdsList.clear(); + for(String partyOrganizeId : orgList){ + params.put("partyOrganizeId",partyOrganizeId); + List tempUserIds = threeMeetLessonDao.listOrgUserId(params); + userIdsList.addAll(tempUserIds); + } + String minXinUserIds = userIdsList.size() == 0 ? "" : Joiner.on(",").join(userIdsList); + List minXinCounts = new ArrayList<>(); + for(int i = 0; i < categoryName.length; i++){ + CountThreeMeetLesson item = new CountThreeMeetLesson(); + item.setCategoryName(categoryName[i]); + item.setCategory((i + 1) + ""); + params.put("category",i + 1); + params.put("userIds",minXinUserIds); + Integer counts = threeMeetLessonDao.getOrgThreeMeetLessonCount(params); + item.setCounts(counts + ""); + minXinCounts.add(item); + } + minXin.setCountThreeMeetLesson(minXinCounts); + //万水泉 + StreetThreeMeetLesson wanShui = new StreetThreeMeetLesson(); + wanShui.setAreaId("8d62a0cc-2c15-4355-906c-6720f8f3617e"); + wanShui.setAreaName("万水泉镇"); + params.put("areaId",wanShui.getAreaId()); + orgList = threeMeetLessonDao.listOrgBelongStreet(params); + userIdsList.clear(); + for(String partyOrganizeId : orgList){ + params.put("partyOrganizeId",partyOrganizeId); + List tempUserIds = threeMeetLessonDao.listOrgUserId(params); + userIdsList.addAll(tempUserIds); + } + String wanShuiUserIds = userIdsList.size() == 0 ? "" : Joiner.on(",").join(userIdsList); + List wanShuiCounts = new ArrayList<>(); + for(int i = 0; i < categoryName.length; i++){ + CountThreeMeetLesson item = new CountThreeMeetLesson(); + item.setCategoryName(categoryName[i]); + item.setCategory((i + 1) + ""); + params.put("category",i + 1); + params.put("userIds",wanShuiUserIds); + Integer counts = threeMeetLessonDao.getOrgThreeMeetLessonCount(params); + item.setCounts(counts + ""); + wanShuiCounts.add(item); + } + wanShui.setCountThreeMeetLesson(wanShuiCounts); + //稀土 + StreetThreeMeetLesson xiTu = new StreetThreeMeetLesson(); + xiTu.setAreaId("7ed23f06-566d-43b7-acd9-4f0b5db08974"); + xiTu.setAreaName("稀土路街道办事处"); + params.put("areaId",xiTu.getAreaId()); + orgList = threeMeetLessonDao.listOrgBelongStreet(params); + userIdsList.clear(); + for(String partyOrganizeId : orgList){ + params.put("partyOrganizeId",partyOrganizeId); + List tempUserIds = threeMeetLessonDao.listOrgUserId(params); + userIdsList.addAll(tempUserIds); + } + String xiTuUserIds = userIdsList.size() == 0 ? "" : Joiner.on(",").join(userIdsList); + List xiTuCounts = new ArrayList<>(); + for(int i = 0; i < categoryName.length; i++){ + CountThreeMeetLesson item = new CountThreeMeetLesson(); + item.setCategoryName(categoryName[i]); + item.setCategory((i + 1) + ""); + params.put("category",i + 1); + params.put("userIds",xiTuUserIds); + Integer counts = threeMeetLessonDao.getOrgThreeMeetLessonCount(params); + item.setCounts(counts + ""); + xiTuCounts.add(item); + } + xiTu.setCountThreeMeetLesson(xiTuCounts); + List result = new ArrayList<>(); + result.add(minXin); + result.add(wanShui); + result.add(xiTu); + return result; + } } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/threemeetlesson/threemeetlesson-mapper.xml b/src/main/resources/mybatis/mapper/threemeetlesson/threemeetlesson-mapper.xml index 60244f6..94af384 100644 --- a/src/main/resources/mybatis/mapper/threemeetlesson/threemeetlesson-mapper.xml +++ b/src/main/resources/mybatis/mapper/threemeetlesson/threemeetlesson-mapper.xml @@ -232,6 +232,7 @@ AND gmt_create #{endDate} + + + \ No newline at end of file