From 2543fa1b2851d57f2a0637bd722a248b1177ae58 Mon Sep 17 00:00:00 2001
From: yinzuomei <57602893@qq.com>
Date: Tue, 31 Mar 2020 12:21:24 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=BE=A4=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../constant/EnterGroupTypeConstant.java | 9 +-
.../dto/group/ResiGroupOperationDTO.java | 4 +
.../dto/group/ResiGroupStatisticalDTO.java | 106 ++++++++++++++++++
.../group/form/ApplyCreateGroupFormDTO.java | 9 +-
.../group/dto/group/form/CreatedFormDTO.java | 4 +-
.../group/dto/group/form/MyGroupFormDTO.java | 4 +-
.../dto/member/GroupMemeberOperationDTO.java | 4 +
.../group/controller/ResiGroupController.java | 2 +
.../group/dao/ResiGroupStatisticalDao.java | 33 ++++++
.../entity/ResiGroupOperationEntity.java | 4 +
.../entity/ResiGroupStatisticalEntity.java | 76 +++++++++++++
.../service/ResiGroupStatisticalService.java | 95 ++++++++++++++++
.../service/impl/ResiGroupServiceImpl.java | 82 +++++++++++---
.../impl/ResiGroupStatisticalServiceImpl.java | 99 ++++++++++++++++
.../entity/GroupMemeberOperationEntity.java | 4 +
.../resources/mapper/group/ResiGroupDao.xml | 8 +-
16 files changed, 519 insertions(+), 24 deletions(-)
create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupStatisticalDTO.java
create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupStatisticalDao.java
create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupStatisticalEntity.java
create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupStatisticalService.java
create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupStatisticalServiceImpl.java
diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/EnterGroupTypeConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/EnterGroupTypeConstant.java
index 835cce231d..eb01594f71 100644
--- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/EnterGroupTypeConstant.java
+++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/EnterGroupTypeConstant.java
@@ -8,12 +8,17 @@ package com.epmet.resi.group.constant;
public interface EnterGroupTypeConstant {
/**
- * 入群方式:(受邀请入群 - invited 、 主动加入 - join)
+ * 入群方式:(受邀请入群 - invited 、 主动加入 - join、created群主创建群自动进入群)
*/
String INVITED = "invited";
/**
- * 入群方式:(受邀请入群 - invited 、 主动加入 - join)
+ * 入群方式:(受邀请入群 - invited 、 主动加入 - joincreated群主创建群自动进入群)
*/
String JOIN = "join";
+
+ /**
+ * 入群方式:(受邀请入群 - invited 、 主动加入 - joincreated群主创建群自动进入群)
+ */
+ String CREATED = "created";
}
diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java
index d13821df67..fd59a8a46b 100644
--- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java
+++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java
@@ -83,4 +83,8 @@ public class ResiGroupOperationDTO implements Serializable {
*/
private Date updatedTime;
+ /**
+ * OPERATE_USER_ID操作人id
+ */
+ private String operateUserId;
}
diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupStatisticalDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupStatisticalDTO.java
new file mode 100644
index 0000000000..c5fb79590d
--- /dev/null
+++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupStatisticalDTO.java
@@ -0,0 +1,106 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.resi.group.dto.group;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 群组统计信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-31
+ */
+@Data
+public class ResiGroupStatisticalDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 小组id: 来源于resi_group表id
+ */
+ private String resiGroupId;
+
+ /**
+ * 成员总数
+ */
+ private Integer totalMembers;
+
+ /**
+ * 话题总数
+ */
+ private Integer totalTopics;
+
+ /**
+ * 已转议题总数
+ */
+ private Integer totalIssues;
+
+ /**
+ * 党员总数
+ */
+ private Integer totalPartyMembers;
+
+ /**
+ * 热心居民总数
+ */
+ private Integer totalEarnestMemebers;
+
+ /**
+ * 普通居民总数=群人数
+ */
+ private Integer totalNormalMemebers;
+
+ /**
+ * 删除标记 0:未删除,1:已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人(用户id,来源于customer_user.id)
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间(入群时间)
+ */
+ private Date createdTime;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+}
diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java
index a34a7d4108..85c76cc827 100644
--- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java
+++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java
@@ -17,7 +17,7 @@ public class ApplyCreateGroupFormDTO implements Serializable {
/**
* 当前登录用户id由TokenDto赋值
*/
- @NotBlank(message="当前用户id为空")
+ @NotBlank(message="当前用户id不能为空")
private String userId;
/**
@@ -49,4 +49,11 @@ public class ApplyCreateGroupFormDTO implements Serializable {
*/
@NotBlank(message = "当前网格id不能为空")
private String gridId;
+
+ /**
+ * 当前登录用户来源从token中获取
+ */
+ @NotBlank(message="app不能为空")
+ private String app;
+
}
diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CreatedFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CreatedFormDTO.java
index ad81b8e74f..a0a96613ae 100644
--- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CreatedFormDTO.java
+++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CreatedFormDTO.java
@@ -30,7 +30,7 @@ public class CreatedFormDTO implements Serializable {
* 用户当前所在网格所属客户id
*/
@NotBlank(message = "客户id不能为空")
- private String cusomerId;
+ private String customerId;
/**
* 用户当前所在网格id
@@ -41,6 +41,6 @@ public class CreatedFormDTO implements Serializable {
/**
* 当前登录用户id由TokenDto赋值
*/
- @NotBlank(message="当前用户id为空")
+ @NotBlank(message="当前用户id不能为空")
private String userId;
}
diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/MyGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/MyGroupFormDTO.java
index c701b3bbac..2a60e09ca0 100644
--- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/MyGroupFormDTO.java
+++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/MyGroupFormDTO.java
@@ -30,7 +30,7 @@ public class MyGroupFormDTO implements Serializable {
* 用户当前所在网格所属客户id
*/
@NotBlank(message = "客户id不能为空")
- private String cusomerId;
+ private String customerId;
/**
* 用户当前所在网格id
@@ -41,6 +41,6 @@ public class MyGroupFormDTO implements Serializable {
/**
* 当前登录用户id由TokenDto赋值
*/
- @NotBlank(message="当前用户id为空")
+ @NotBlank(message="当前用户id不能为空")
private String userId;
}
diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupMemeberOperationDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupMemeberOperationDTO.java
index 8fd78f1da2..96d38f34a7 100644
--- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupMemeberOperationDTO.java
+++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupMemeberOperationDTO.java
@@ -106,4 +106,8 @@ public class GroupMemeberOperationDTO implements Serializable {
*/
private Date updatedTime;
+ /**
+ * OPERATE_USER_ID操作人id
+ */
+ private String operateUserId;
}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
index 06406fde04..570d9b9cb7 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
@@ -138,6 +138,7 @@ public class ResiGroupController {
public Result applyCreateGroup(@LoginUser TokenDto tokenDto,
@RequestBody ApplyCreateGroupFormDTO applyCreateGroupFormDTO) {
applyCreateGroupFormDTO.setUserId(tokenDto.getUserId());
+ applyCreateGroupFormDTO.setApp(tokenDto.getApp());
ValidatorUtils.validateEntity(applyCreateGroupFormDTO);
return resiGroupService.applyCreateGroup(applyCreateGroupFormDTO);
}
@@ -173,4 +174,5 @@ public class ResiGroupController {
public Result initApplyCreatedGroup(@LoginUser TokenDto tokenDto, @RequestParam("customerId") String customerId) {
return resiGroupService.initApplyCreatedGroup(tokenDto,customerId);
}
+
}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupStatisticalDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupStatisticalDao.java
new file mode 100644
index 0000000000..5c0cec19a2
--- /dev/null
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupStatisticalDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.modules.group.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.modules.group.entity.ResiGroupStatisticalEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 群组统计信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-31
+ */
+@Mapper
+public interface ResiGroupStatisticalDao extends BaseDao {
+
+}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java
index 6a8bbd3e1d..90e74625bc 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java
@@ -53,4 +53,8 @@ public class ResiGroupOperationEntity extends BaseEpmetEntity {
*/
private String operateReason;
+ /**
+ * OPERATE_USER_ID操作人id
+ */
+ private String operateUserId;
}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupStatisticalEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupStatisticalEntity.java
new file mode 100644
index 0000000000..9396bda454
--- /dev/null
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupStatisticalEntity.java
@@ -0,0 +1,76 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.modules.group.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 群组统计信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-31
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("resi_group_statistical")
+public class ResiGroupStatisticalEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 小组id: 来源于resi_group表id
+ */
+ private String resiGroupId;
+
+ /**
+ * 成员总数
+ */
+ private Integer totalMembers;
+
+ /**
+ * 话题总数
+ */
+ private Integer totalTopics;
+
+ /**
+ * 已转议题总数
+ */
+ private Integer totalIssues;
+
+ /**
+ * 党员总数
+ */
+ private Integer totalPartyMembers;
+
+ /**
+ * 热心居民总数
+ */
+ private Integer totalEarnestMemebers;
+
+ /**
+ * 普通居民总数=群人数
+ */
+ private Integer totalNormalMemebers;
+
+}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupStatisticalService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupStatisticalService.java
new file mode 100644
index 0000000000..3cba82c496
--- /dev/null
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupStatisticalService.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.modules.group.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.modules.group.entity.ResiGroupStatisticalEntity;
+import com.epmet.resi.group.dto.group.ResiGroupStatisticalDTO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 群组统计信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-31
+ */
+public interface ResiGroupStatisticalService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2020-03-31
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2020-03-31
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return ResiGroupStatisticalDTO
+ * @author generator
+ * @date 2020-03-31
+ */
+ ResiGroupStatisticalDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-03-31
+ */
+ void save(ResiGroupStatisticalDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-03-31
+ */
+ void update(ResiGroupStatisticalDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2020-03-31
+ */
+ void delete(String[] ids);
+}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
index bbdb28a20d..a376718d1a 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
@@ -24,6 +24,7 @@ import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
@@ -37,17 +38,25 @@ import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.group.service.ResiGroupOperationService;
import com.epmet.modules.group.service.ResiGroupService;
+import com.epmet.modules.group.service.ResiGroupStatisticalService;
+import com.epmet.modules.member.service.GroupMemeberOperationService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.redis.ResiGroupRedis;
+import com.epmet.resi.group.constant.EnterGroupTypeConstant;
import com.epmet.resi.group.constant.GroupStateConstant;
+import com.epmet.resi.group.constant.LeaderFlagConstant;
+import com.epmet.resi.group.constant.MemberStateConstant;
+import com.epmet.resi.group.dto.UserRoleDTO;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.ResiGroupOperationDTO;
+import com.epmet.resi.group.dto.group.ResiGroupStatisticalDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.CreatedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.MyGroupResultDTO;
import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO;
+import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -81,6 +90,12 @@ public class ResiGroupServiceImpl extends BaseServiceImpl page(Map params) {
IPage page = baseDao.selectPage(
@@ -215,7 +230,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl getGroupSummarize(GroupSummarizeFormDTO groupSummarizeFormDTO) {
GroupSummarizeResultDTO groupSummarizeResultDTO = baseDao.selectGroupSummarize(groupSummarizeFormDTO);
- if (null != groupSummarizeResultDTO) {
+ if (null == groupSummarizeResultDTO) {
return new Result().error(ModuleConstant.GETGROUPSUMMARIZE_FAILED);
}
//获取组长信息
@@ -275,8 +290,45 @@ public class ResiGroupServiceImpl extends BaseServiceImpl> userRoleListResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO);
if (!userRoleListResult.success()) {
logger.info("获取用户角色feign调用失败" + userRoleListResult.getMsg());
- return flag;
+ return userRoleDTO;
}
List userRoleList = userRoleListResult.getData();
if (null == userRoleList || userRoleList.size() == 0) {
- return flag;
+ return userRoleDTO;
}
for (UserRoleResultDTO userRoleResultDTO : userRoleList) {
- if (EpmetRoleKeyConstant.PARTYMEMBER.equals(userRoleResultDTO.getRoleKey())
- || EpmetRoleKeyConstant.WARMHEARTED.equals(userRoleResultDTO.getRoleKey())) {
- flag = true;
- break;
+ if (EpmetRoleKeyConstant.PARTYMEMBER.equals(userRoleResultDTO.getRoleKey())) {
+ userRoleDTO.setPartymemberFlag(NumConstant.ONE_STR);
+ }
+ if (EpmetRoleKeyConstant.WARMHEARTED.equals(userRoleResultDTO.getRoleKey())) {
+ userRoleDTO.setWarmHeartedFlag(NumConstant.ONE_STR);
+ }
+ if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(userRoleResultDTO.getRoleKey())) {
+ userRoleDTO.setRegisteredResiFlag(NumConstant.ONE_STR);
}
}
- return flag;
+ return userRoleDTO;
}
}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupStatisticalServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupStatisticalServiceImpl.java
new file mode 100644
index 0000000000..33cd903da9
--- /dev/null
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupStatisticalServiceImpl.java
@@ -0,0 +1,99 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.modules.group.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.modules.group.dao.ResiGroupStatisticalDao;
+import com.epmet.modules.group.entity.ResiGroupStatisticalEntity;
+import com.epmet.modules.group.service.ResiGroupStatisticalService;
+import com.epmet.resi.group.dto.group.ResiGroupStatisticalDTO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 群组统计信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-31
+ */
+@Service
+public class ResiGroupStatisticalServiceImpl extends BaseServiceImpl implements ResiGroupStatisticalService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, ResiGroupStatisticalDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, ResiGroupStatisticalDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public ResiGroupStatisticalDTO get(String id) {
+ ResiGroupStatisticalEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, ResiGroupStatisticalDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(ResiGroupStatisticalDTO dto) {
+ ResiGroupStatisticalEntity entity = ConvertUtils.sourceToTarget(dto, ResiGroupStatisticalEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(ResiGroupStatisticalDTO dto) {
+ ResiGroupStatisticalEntity entity = ConvertUtils.sourceToTarget(dto, ResiGroupStatisticalEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupMemeberOperationEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupMemeberOperationEntity.java
index 47d7442f3e..9ffc9f66d8 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupMemeberOperationEntity.java
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupMemeberOperationEntity.java
@@ -76,4 +76,8 @@ Ps: 1) 入群被拒绝之后,如果再申请是插入一条新的审核中的
*/
private String operateDes;
+ /**
+ * OPERATE_USER_ID操作人id
+ */
+ private String operateUserId;
}
diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
index 4dd74b4d06..93fd8a0f3a 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
+++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
@@ -33,8 +33,8 @@
rg.DEL_FLAG = '0'
AND rgm.DEL_FLAG = '0'
AND rgs.DEL_FLAG = '0'
- AND rg.CUSTOMER_ID = #{cusomerId}
- AND rg.GRID_ID ={gridId}
+ AND rg.CUSTOMER_ID = #{customerId}
+ AND rg.GRID_ID =#{gridId}
AND rgm.CUSTOMER_USER_ID = #{userId}
AND rgm.STATUS IN ( 'approved', 'silent' )
order by rg.LATEST_TOPIC_PUBLISH_DATE desc
@@ -105,8 +105,8 @@
rg.DEL_FLAG = '0'
AND rgm.DEL_FLAG = '0'
AND rgs.DEL_FLAG = '0'
- AND rg.CUSTOMER_ID = #{cusomerId}
- AND rg.GRID_ID ={gridId}
+ AND rg.CUSTOMER_ID = #{customerId}
+ AND rg.GRID_ID =#{gridId}
AND rgm.CUSTOMER_USER_ID = #{userId}
AND rgm.GROUP_LEADER_FLAG = 'leader'
ORDER BY