From c3bd49786360f2b2cf91d477372b3def6a654269 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 2 Nov 2020 17:04:17 +0800 Subject: [PATCH 01/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/group/form/EditGroupFormDTO.java | 24 +++++ .../group/controller/ResiGroupController.java | 9 ++ .../group/dao/GroupEditSubmitRecordDao.java | 33 +++++++ .../entity/GroupEditSubmitRecordEntity.java | 91 +++++++++++++++++++ .../redis/GroupEditSubmitRecordRedis.java | 47 ++++++++++ .../group/service/ResiGroupService.java | 2 + .../service/impl/ResiGroupServiceImpl.java | 10 ++ .../mapper/group/GroupEditSubmitRecordDao.xml | 27 ++++++ 8 files changed, 243 insertions(+) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/GroupEditSubmitRecordRedis.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java new file mode 100644 index 0000000000..370c479070 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.resi.group.dto.group.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class EditGroupFormDTO { + + // 分组详情校验 + public interface GroupDetailVG {} + + + /** + * 组id + */ + @NotBlank(message = "组ID不能为空", groups = { GroupDetailVG.class }) + private String groupId; + +} 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 afdce31da0..e1ea6dbeed 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 @@ -359,4 +359,13 @@ public class ResiGroupController { resiGroupStatisticalService.updateWhenAuditedResiRole(resiIdentityFormDTO); return new Result(); } + + + @PostMapping("get-detail") + public Result getGroupDetail(@RequestBody EditGroupFormDTO form){ + ValidatorUtils.validateEntity(form, EditGroupFormDTO.GroupDetailVG.class); + resiGroupService.getGroupDetail(form.getGroupId()); + return new Result(); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java new file mode 100644 index 0000000000..db30254f23 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.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.GroupEditSubmitRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 组编辑提交记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-02 + */ +@Mapper +public interface GroupEditSubmitRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java new file mode 100644 index 0000000000..19b2d50a2e --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java @@ -0,0 +1,91 @@ +/** + * 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-11-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("group_edit_submit_record") +public class GroupEditSubmitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 小组ID + */ + private String groupId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private Integer gridId; + + /** + * 头像 + */ + private String groupHeadPhoto; + + /** + * 小组名称 + */ + private String groupName; + + /** + * 小组介绍 + */ + private String groupIntroduction; + + /** + * 审核状态。under_auditting:审核中,approved:通过,rejected:驳回 + */ + private String auditStatus; + + /** + * 审核人ID + */ + private String staffId; + + /** + * 回复 + */ + private String remark; + + /** + * 审核时间 + */ + private Date auditTime; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/GroupEditSubmitRecordRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/GroupEditSubmitRecordRedis.java new file mode 100644 index 0000000000..346ebd5924 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/GroupEditSubmitRecordRedis.java @@ -0,0 +1,47 @@ +/** + * 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.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 组编辑提交记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-02 + */ +@Component +public class GroupEditSubmitRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index d410b4f391..930e7bd529 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -293,4 +293,6 @@ public interface ResiGroupService extends BaseService { * @return java.util.List */ List recommendedList(RecommendedListFormDTO formDTO); + + void getGroupDetail(String groupId); } 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 dacfd6dbb8..cadf8b8b44 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 @@ -122,6 +122,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -970,4 +973,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 02338382fe13f3bdca42fa9e5ad27e659b85165c Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 2 Nov 2020 23:09:26 +0800 Subject: [PATCH 02/36] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=9A=E5=B1=85=E6=B0=91=E7=AB=AF=E6=9F=A5=E8=AF=A2=E5=B0=8F?= =?UTF-8?q?=E7=BB=84=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 20 ++++++ .../constant/GroupAuditStatusConstant.java | 14 +++++ .../group/constant/GroupLimitConstant.java | 10 +++ .../group/result/GroupDetailResultDTO.java | 21 +++++++ .../group/dao/GroupEditSubmitRecordDao.java | 21 ++++++- .../group/service/ResiGroupService.java | 2 +- .../service/impl/ResiGroupServiceImpl.java | 61 +++++++++++++++++-- .../mapper/group/GroupEditSubmitRecordDao.xml | 41 ++++++++++++- 8 files changed, 181 insertions(+), 9 deletions(-) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupAuditStatusConstant.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupLimitConstant.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index a7a768b095..d739bb8069 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -681,4 +681,24 @@ public class DateUtils { } }else return null; } + + /** + * 指定月份的开始时间 + * @param date + * @return + */ + public static Date getMonthStart(Date date) { + LocalDate ldn = new LocalDate(date); + return ldn.dayOfMonth().withMinimumValue().toDate(); + } + + /** + * 指定月份的结束时间 + * @param date + * @return + */ + public static Date getMonthEnd(Date date) { + LocalDate ldn = new LocalDate(date); + return ldn.dayOfMonth().withMaximumValue().toDate(); + } } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupAuditStatusConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupAuditStatusConstant.java new file mode 100644 index 0000000000..8544c6fe12 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupAuditStatusConstant.java @@ -0,0 +1,14 @@ +package com.epmet.resi.group.constant; + +public interface GroupAuditStatusConstant { + + // 审核中 + String UNDER_AUDITING = "under_auditing"; + + // 驳回 + String REJECTED = "rejected"; + + // 支持 + String APPROVED = "approved"; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupLimitConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupLimitConstant.java new file mode 100644 index 0000000000..0e158a8804 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupLimitConstant.java @@ -0,0 +1,10 @@ +package com.epmet.resi.group.constant; + +public interface GroupLimitConstant { + + /** + * 每月可以编辑2次 + */ + Integer EDIT_NUM_LIMIT_MONTH = 2; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java new file mode 100644 index 0000000000..c7767054d4 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class GroupDetailResultDTO { + + private String groupHeadPhoto; + private String groupName; + private String groupIntroduction; + private Integer editNumLimit; + private Integer avaliableEditNum; + private String auditStatus; + private Boolean editable; + private String remark; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java index db30254f23..37eb9f366e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java @@ -20,6 +20,9 @@ package com.epmet.modules.group.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.group.entity.GroupEditSubmitRecordEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; /** * 组编辑提交记录表 @@ -29,5 +32,21 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface GroupEditSubmitRecordDao extends BaseDao { - + + /** + * 查询指定组,指定时间段内的编辑次数 + * @param groupId + * @param monthStart + * @param monthEnd + * @return + */ + int countEditNum(@Param("groupId") String groupId, + @Param("monthStart") Date monthStart, + @Param("monthEnd") Date monthEnd); + + /** + * 查询最后一次编辑提交记录 + * @param groupId + */ + GroupEditSubmitRecordEntity getLatestEditSubmitRecord(@Param("groupId") String groupId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index 930e7bd529..70011a5c89 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -294,5 +294,5 @@ public interface ResiGroupService extends BaseService { */ List recommendedList(RecommendedListFormDTO formDTO); - void getGroupDetail(String groupId); + GroupDetailResultDTO getGroupDetail(String groupId); } 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 cadf8b8b44..dba8c69a1c 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 @@ -38,8 +38,10 @@ import com.epmet.modules.constant.UserMessageConstant; import com.epmet.modules.feign.EpmetMessageFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; +import com.epmet.modules.group.dao.GroupEditSubmitRecordDao; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.dao.ResiGroupOperationDao; +import com.epmet.modules.group.entity.GroupEditSubmitRecordEntity; import com.epmet.modules.group.entity.ResiGroupEntity; import com.epmet.modules.group.entity.ResiGroupOperationEntity; import com.epmet.modules.group.redis.ResiGroupRedis; @@ -52,10 +54,7 @@ import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.GroupMemeberOperationService; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.utils.ModuleConstant; -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.constant.*; import com.epmet.resi.group.dto.UserRoleDTO; import com.epmet.resi.group.dto.group.*; import com.epmet.resi.group.dto.group.form.*; @@ -125,6 +124,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -975,9 +977,56 @@ public class ResiGroupServiceImpl extends BaseServiceImpl - + + + + id, + group_id, + customer_id, + grid_id, + group_head_photo, + group_name, + group_introduction, + audit_status, + staff_id, + remark, + audit_time, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + @@ -23,5 +43,24 @@ + + + + \ No newline at end of file From 4e1e7ef569586826a4f2b7c229dd5817c85f6604 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 3 Nov 2020 10:07:36 +0800 Subject: [PATCH 03/36] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E8=A1=A8Entity=E5=B1=9E=E6=80=A7=E7=9B=B8=E5=85=B3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=B7=A5=E4=BD=9C=E7=AB=AF=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=8F=82=E5=85=A5?= =?UTF-8?q?=E5=8F=82DTO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/form/CommonGridAndPageFormDTO.java | 37 +++++++++++++++ .../group/form/GroupEditionAuditFormDTO.java | 43 +++++++++++++++++ .../result/GroupEditionApplyResultDTO.java | 46 +++++++++++++++++++ .../result/GroupEditionDetailResultDTO.java | 42 +++++++++++++++++ .../entity/GroupEditSubmitRecordEntity.java | 12 ++++- .../mapper/group/GroupEditSubmitRecordDao.xml | 4 ++ 6 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupEditionAuditFormDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionApplyResultDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java new file mode 100644 index 0000000000..87ed69166f --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.resi.group.dto.group.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 通用网格分页传参DTO + * @ClassName CommonGridAndPageFormDTO + * @Auth wangc + * @Date 2020-11-02 17:22 + */ +@Data +public class CommonGridAndPageFormDTO implements Serializable { + private static final long serialVersionUID = -7916909736115741017L; + + public interface GridPageGroup extends CustomerClientShowGroup{} + + /** + * 网格Id + */ + @NotBlank(message = "网格Id不能为空" , groups = GridPageGroup.class) + private String gridId; + + /** + * 页码 + */ + private Integer pageNo; + + /** + * 每页多少条数 + */ + private Integer pageSize; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupEditionAuditFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupEditionAuditFormDTO.java new file mode 100644 index 0000000000..fccd849619 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupEditionAuditFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.resi.group.dto.group.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 组信息修改审核入参DTO + * @ClassName GroupEditionAuditFormDTO + * @Auth wangc + * @Date 2020-11-02 17:30 + */ +@Data +public class GroupEditionAuditFormDTO implements Serializable { + private static final long serialVersionUID = 3851649860177395296L; + + public interface GroupEditionAuditGroup extends CustomerClientShowGroup{} + + /** + * 组Id + */ + @NotBlank(message = "组Id不能为空",groups = GroupEditionAuditGroup.class) + private String groupId; + + /** + * 审核结果 审核结果。approved:支持;rejected:拒绝 + */ + @NotBlank(message = "审核结果不能为空",groups = GroupEditionAuditGroup.class) + private String auditResult; + + /** + * 拒绝时的备注 + */ + private String remark; + + /** + * 工作人员Id + */ + @NotBlank(message = "工作人员Id不能为空",groups = GroupEditionAuditGroup.class) + private String staffId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionApplyResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionApplyResultDTO.java new file mode 100644 index 0000000000..e8811f98c9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionApplyResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 工作端 - 群组审核列表返参DTO + * @ClassName GroupEditionApplyResultDTO + * @Auth wangc + * @Date 2020-11-03 09:06 + */ +@Data +public class GroupEditionApplyResultDTO implements Serializable { + private static final long serialVersionUID = 437035656436226205L; + + /** + * 组Id + */ + private String groupId; + + /** + * 原始组姓名 + */ + private String groupName; + + /** + * 原始组头像 + */ + private String groupHeadPhoto; + + /** + * 已读 未读 + */ + private String readFlag; + + /** + * 审核人员查看待审核列表时的文案 如:党员李华申请变更小组【原小组名】,请审核。 + */ + private String messageText; + + /** + * yyyy-MM-dd HH:mm:ss + */ + private String submitTime; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java new file mode 100644 index 0000000000..0cf88d6802 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * @Description 工作端 群信息修改申请详情 + * @ClassName GroupEditionDetailResultDTO + * @Auth wangc + * @Date 2020-11-02 17:54 + */ +@Data +public class GroupEditionDetailResultDTO implements Serializable { + private static final long serialVersionUID = -784043668974222480L; + + /** + * 待审核的小组Id + */ + private String groupId; + + /** + * 待审核小组名称 是提交的名称,如果没有更改群名称则还是原来的 + */ + private String groupName; + + /** + * 待审核小组图片 是提交的群头像,如果没有更改群头像则还是原来的 + */ + private String groupHeadPhoto; + + /** + * 待审核小组的介绍 是提交的群介绍,如果没有更改群介绍则还是原来的 + */ + private String groupIntroduction; + + /** + * 群主的昵称 xx路-xx先生/女士 + */ + private String groupLeaderName; +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java index 19b2d50a2e..9f8b5c8816 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java @@ -51,7 +51,7 @@ public class GroupEditSubmitRecordEntity extends BaseEpmetEntity { /** * 网格ID */ - private Integer gridId; + private String gridId; /** * 头像 @@ -88,4 +88,14 @@ public class GroupEditSubmitRecordEntity extends BaseEpmetEntity { */ private Date auditTime; + /** + * 审核人员查看待审核列表时的文案 如:党员李华申请变更小组【原小组名】,请审核。 + */ + private String messageText; + + /** + * 已读read 未读unread + */ + private String readFlag; + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml index c785d9bb1a..1b689eb363 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml @@ -15,6 +15,8 @@ staff_id, remark, audit_time, + read_flag, + message_text, del_flag, revision, created_by, @@ -35,6 +37,8 @@ + + From 4b78da437d3e02fcef8698afc28ffbecbb317971 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 3 Nov 2020 10:47:06 +0800 Subject: [PATCH 04/36] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AF=20=20?= =?UTF-8?q?=E7=BB=84=E5=8F=98=E6=9B=B4=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/group/service/ResiGroupService.java | 9 +++++++++ .../group/service/impl/ResiGroupServiceImpl.java | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index 70011a5c89..3fa639ae7c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -295,4 +295,13 @@ public interface ResiGroupService extends BaseService { List recommendedList(RecommendedListFormDTO formDTO); GroupDetailResultDTO getGroupDetail(String groupId); + + /** + * @Description 工作端 查询组变更待审核列表 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.03 10:19 + */ + List getEditAuditingList(CommonGridAndPageFormDTO param); } 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 dba8c69a1c..9ced852869 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 @@ -1029,4 +1029,17 @@ public class ResiGroupServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2020.11.03 10:19 + */ + @Override + public List getEditAuditingList(CommonGridAndPageFormDTO param) { + + return null; + } } From 595c9ca11d852d4665ca8f3cb4e2423bf19aa0c4 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 3 Nov 2020 10:52:15 +0800 Subject: [PATCH 05/36] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=9A=E7=BB=84=E4=BF=A1=E6=81=AF=E7=BC=96=E8=BE=91=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 1 + .../dto/group/form/EditGroupFormDTO.java | 14 ++- .../group/controller/ResiGroupController.java | 20 +++- .../entity/GroupEditSubmitRecordEntity.java | 2 +- .../group/service/ResiGroupService.java | 2 + .../service/impl/ResiGroupServiceImpl.java | 96 ++++++++++++++++++- 6 files changed, 127 insertions(+), 8 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index e4832a1c8b..1976ca3337 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -41,6 +41,7 @@ public enum EpmetErrorCode { MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), NOT_DEL_GRID(8106,"该网格存在工作人员,不允许删除"), + GROUP_EDIT_ERROR(8107,"组信息编辑失败"), ORG_IS_NOT_NULL(8107,"党组织关系不能为空"), CANNOT_DELETE_PARTY_BRANCH(8108,"当前支部存在党员,不允许删除"), diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java index 370c479070..bb1251bf6a 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java @@ -14,11 +14,23 @@ public class EditGroupFormDTO { // 分组详情校验 public interface GroupDetailVG {} + // 提交组编辑校验组 + public interface SubmitGroupEditVG {} + /** * 组id */ - @NotBlank(message = "组ID不能为空", groups = { GroupDetailVG.class }) + @NotBlank(message = "组ID不能为空", groups = { GroupDetailVG.class, SubmitGroupEditVG.class }) private String groupId; + @NotBlank(message = "组头像不能为空", groups = { SubmitGroupEditVG.class }) + private String groupHeadPhoto; + + @NotBlank(message = "组名称不能为空", groups = { SubmitGroupEditVG.class }) + private String groupName; + + @NotBlank(message = "组介绍不能为空", groups = { SubmitGroupEditVG.class }) + private String groupIntroduction; + } 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 e1ea6dbeed..98c572ad08 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 @@ -360,11 +360,27 @@ public class ResiGroupController { return new Result(); } - + /** + * 查询组详情 + * @param form + * @return + */ @PostMapping("get-detail") public Result getGroupDetail(@RequestBody EditGroupFormDTO form){ ValidatorUtils.validateEntity(form, EditGroupFormDTO.GroupDetailVG.class); - resiGroupService.getGroupDetail(form.getGroupId()); + GroupDetailResultDTO groupDetail = resiGroupService.getGroupDetail(form.getGroupId()); + return new Result().ok(groupDetail); + } + + /** + * 提交小组信息编辑 + * @param form + * @return + */ + @PostMapping("submit-edit") + public Result submitGroupEdit(@RequestBody EditGroupFormDTO form){ + ValidatorUtils.validateEntity(form, EditGroupFormDTO.SubmitGroupEditVG.class); + resiGroupService.submitGroupEdit(form.getGroupId(), form.getGroupName(), form.getGroupHeadPhoto(), form.getGroupIntroduction()); return new Result(); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java index 19b2d50a2e..c0f0f3fe2c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java @@ -51,7 +51,7 @@ public class GroupEditSubmitRecordEntity extends BaseEpmetEntity { /** * 网格ID */ - private Integer gridId; + private String gridId; /** * 头像 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index 70011a5c89..d3c6a6b2ad 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -295,4 +295,6 @@ public interface ResiGroupService extends BaseService { List recommendedList(RecommendedListFormDTO formDTO); GroupDetailResultDTO getGroupDetail(String groupId); + + void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction); } 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 dba8c69a1c..979462d3f3 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 @@ -27,9 +27,15 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; import com.epmet.dto.form.*; import com.epmet.dto.result.UserResiInfoResultDTO; @@ -68,6 +74,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -127,6 +134,15 @@ public class ResiGroupServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -980,7 +996,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("调用内容审核服务审核文本发生错误:{}", textSyncScanResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + } + } + + // 图片内容审核 + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + ImgTaskDTO task = new ImgTaskDTO(); + task.setUrl(groupHeadPhoto); + imgScanParamDTO.getTasks().add(task); + + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + logger.error("调用内容审核服务审核图片发生错误:{}", textSyncScanResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + } + } + } } From 14c662ccc17eeed53743c6bef53e02e597873fb5 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 3 Nov 2020 14:17:19 +0800 Subject: [PATCH 06/36] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BB=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=BC=96=E8=BE=91=E6=8F=90=E4=BA=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/constant/UserMessageConstant.java | 5 + .../service/impl/ResiGroupServiceImpl.java | 92 ++++++++++++++++++- 2 files changed, 94 insertions(+), 3 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java index f9b97bfb9f..5ae3c98d8f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java @@ -59,6 +59,11 @@ public interface UserMessageConstant { */ String CREATION_OF_GROUP_MESSAGE_TEMPLATE = "%s%s申请创建小组【%s】,请审核。"; + /** + * 变更组信息时的消息模板 + */ + String EDIT_OF_GROUP_MESSAGE_TEMPLATE = "%s%s申请变更小组【%s】,请审核。"; + /** * 组长审核入组申请时的微信订阅behavior */ 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 979462d3f3..b3bb7d4a5e 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 @@ -32,6 +32,7 @@ import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; @@ -77,6 +78,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.text.SimpleDateFormat; import java.util.*; @@ -134,6 +136,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl resiRoles = getResiRoles(app, customerId, userId, gridId); + boolean isPartymember = false; + boolean isWarmhearted = false; + for (UserRoleResultDTO role : resiRoles) { + if (EpmetRoleKeyConstant.WARMHEARTED.equals(role.getRoleKey())) { + isWarmhearted = true; + } + if (EpmetRoleKeyConstant.PARTYMEMBER.equals(role.getRoleKey())) { + isPartymember = true; + } + } + if (!isWarmhearted && isPartymember) { + throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode(), "只有党员和热心居民才能创建和编辑小组"); + } + String roleName = ""; + if (isPartymember) { + roleName = ModuleConstant.PARTYMEMBER; + } else if (isWarmhearted) { + roleName = ModuleConstant.WAREMHEARTED_RESI; + } + + //3.获取居民注册信息 + UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); + resiParam.setCustomerId(customerId); + resiParam.setUserId(userId); + Result resiResult = + epmetUserFeignClient.getUserResiInfoDTO(resiParam); + String userName = ""; + if (resiResult.success() && null != resiResult.getData()) { + userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) + + (StringUtils.isBlank(resiResult.getData().getName()) ? "" : resiResult.getData().getName()); + } + userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; + return String.format(UserMessageConstant.EDIT_OF_GROUP_MESSAGE_TEMPLATE, roleName, userName, groupName); + } + + /** + * 查询居民的角色列表 + * @param app + * @param customerId + * @param userId + * @param gridId + * @return + */ + private List getResiRoles(String app, String customerId, String userId, String gridId) { + UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); + userRoleFormDTO.setApp(app); + userRoleFormDTO.setCustomerId(customerId); + userRoleFormDTO.setUserId(userId); + userRoleFormDTO.setGridId(gridId); + Result> rolesResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); + + if (! rolesResult.success()) { + logger.error("修改组信息:查询居民角色失败,详情:{}", rolesResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), "查询居民角色失败"); + } else { + List roles = rolesResult.getData(); + if (CollectionUtils.isEmpty(roles)) { + roles = new ArrayList<>(); + } + return roles; + } + } + /** * 内容检查 * @param groupName @@ -1084,12 +1169,12 @@ public class ResiGroupServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); if (!textSyncScanResult.success()) { @@ -1104,6 +1189,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Tue, 3 Nov 2020 15:28:49 +0800 Subject: [PATCH 07/36] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E7=BB=84?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=BC=96=E8=BE=91=E6=8F=90=E4=BA=A4=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=BD=91=E6=A0=BC=E5=86=85?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=AD=98=E5=9C=A8=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/group/dao/ResiGroupDao.java | 13 ++++++++++++ .../service/impl/ResiGroupServiceImpl.java | 7 ++++++- .../resources/mapper/group/ResiGroupDao.xml | 21 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index 867a3d11ba..57fd94d9ab 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -188,4 +188,17 @@ public interface ResiGroupDao extends BaseDao { * @date 2020.05.22 09:54 **/ List selectGroupListByGridIds(@Param("gridIds") List gridIds); + + /** + * 编辑提交的时候,检查组名是否存在。网格内检查, + * 检查resi_group中已审核通过的和待审核的 + * 检查submit_record中待审核的。已审核的不用检查,因为已经更新到resi_group中了 + * @param groupId + * @param gridId + * @param groupName + * @return + */ + int countExistsGroupNameBeforeEdit(@Param("groupId") String groupId, + @Param("gridId") String gridId, + @Param("groupName") String groupName); } 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 b3bb7d4a5e..624f0f73ef 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 @@ -1064,8 +1064,13 @@ public class ResiGroupServiceImpl extends BaseServiceImpl 0) { + // 已存在组名,拒绝提交 + throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), "组名已存在"); + } + // 2.内容检查 - scanGroupEditContent(groupName, groupIntroduction, groupHeadPhoto); + //scanGroupEditContent(groupName, groupIntroduction, groupHeadPhoto); String app = loginUserUtil.getLoginUserApp(); String userId = loginUserUtil.getLoginUserId(); 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 119db46b30..94c2422159 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 @@ -397,4 +397,25 @@ GRID_ID = #{gridId} + + From f7044af28bac95c6c1313bac5b28f8cf4e94d604 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 3 Nov 2020 16:07:02 +0800 Subject: [PATCH 08/36] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=98=BF=E9=87=8C?= =?UTF-8?q?=E4=BA=91=E5=86=85=E5=AE=B9=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiGroupServiceImpl.java | 67 ++++++++++--------- 1 file changed, 37 insertions(+), 30 deletions(-) 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 624f0f73ef..a36df9e93c 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 @@ -359,38 +359,45 @@ public class ResiGroupServiceImpl extends BaseServiceImpl resiResult = - epmetUserFeignClient.getUserResiInfoDTO(resiParam); - String userName = ""; - if(resiResult.success() && null != resiResult.getData()){ - userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) - + (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); - } + //4.获取居民注册信息 + UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); + resiParam.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); + resiParam.setUserId(applyCreateGroupFormDTO.getUserId()); + Result resiResult = + epmetUserFeignClient.getUserResiInfoDTO(resiParam); + String userName = ""; + if(resiResult.success() && null != resiResult.getData()){ + userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) + + (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); + } userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; - String msg = String.format(UserMessageConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO.getGroupName()); - //3.2、插入一条待审核的操作记录 + String msg = String.format(UserMessageConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO.getGroupName()); + //4.2、插入一条待审核的操作记录 ResiGroupOperationDTO resiGroupOperation = new ResiGroupOperationDTO(); resiGroupOperation.setResiGroupId(resiGroupEntity.getId()); resiGroupOperation.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); @@ -398,7 +405,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Tue, 3 Nov 2020 16:39:40 +0800 Subject: [PATCH 09/36] =?UTF-8?q?1.=E5=B0=8F=E7=BB=84=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=A2=9E=E5=8A=A0flyway=E8=84=9A=E6=9C=AC=20?= =?UTF-8?q?2.=E5=A2=9E=E5=8A=A0=E5=B0=8F=E7=BB=84=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=88=97=E8=A1=A8=E6=9D=83=E9=99=90=E5=AD=97?= =?UTF-8?q?=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/enums/RequirePermissionEnum.java | 1 + .../V0.0.4__createGroupSubmitRecord.sql | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.4__createGroupSubmitRecord.sql diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 284ef67e74..288526433e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -10,6 +10,7 @@ public enum RequirePermissionEnum { * 工作-基层治理-群组管理 */ WORK_GRASSROOTS_GROUP_AUDITINGLIST("work_grassroots_group_auditinglist", "基层治理:群组管理:待审核列表", "基层治理:群组管理:待审核列表查询"), + WORK_GRASSROOTS_GROUP_EDIT_AUDITINGLIST("work_grassroots_group_edit_auditinglist", "基层治理:群组管理:小组变更待审核列表", "基层治理:群组管理:小组变更待审核列表"), WORK_GRASSROOTS_GROUP_GROUPSINTHEGRID("work_grassroots_group_groupsinthegrid", "基层治理:群组管理:本网格小组列表", "基层治理:群组管理:本网格小组列表查询"), WORK_GRASSROOTS_GROUP_AUDIT("work_grassroots_group_audit", "基层治理:群组管理:审核建组", "基层治理:群组管理:审核建组(通过或驳回)"), WORK_GRASSROOTS_GROUP_AUDITED("work_grassroots_group_audited", "基层治理:群组管理:审核历史", "基层治理:群组管理:审核历史列表查询"), diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.4__createGroupSubmitRecord.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.4__createGroupSubmitRecord.sql new file mode 100644 index 0000000000..1e53a7d6f1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.4__createGroupSubmitRecord.sql @@ -0,0 +1,24 @@ +CREATE TABLE `group_edit_submit_record` +( + `ID` varchar(64) NOT NULL, + `GROUP_ID` varchar(64) NOT NULL COMMENT '小组ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) DEFAULT NULL COMMENT '网格ID', + `GROUP_HEAD_PHOTO` varchar(255) NOT NULL COMMENT '头像', + `GROUP_NAME` varchar(10) NOT NULL COMMENT '小组名称', + `GROUP_INTRODUCTION` varchar(500) NOT NULL COMMENT '小组介绍', + `AUDIT_STATUS` varchar(30) NOT NULL COMMENT '审核状态。under_auditting:审核中,approved:通过,rejected:驳回', + `STAFF_ID` varchar(64) DEFAULT NULL COMMENT '审核人ID', + `REMARK` varchar(255) DEFAULT NULL COMMENT '回复', + `AUDIT_TIME` datetime DEFAULT NULL COMMENT '审核时间', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(8) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人 提交人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '修改人ID', + `UPDATED_TIME` datetime NOT NULL COMMENT '修改时间', + `READ_FLAG` varchar(8) NOT NULL COMMENT '已读read 未读unread', + `MESSAGE_TEXT` varchar(255) NOT NULL COMMENT '审核人员查看待审核列表时的文案,如:党员李华申请变更小组【原小组名】,请审核。', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='组编辑提交记录表' \ No newline at end of file From 21cacb49a88b41273fb867fb23cb778acbffdd2a Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 4 Nov 2020 11:00:39 +0800 Subject: [PATCH 10/36] =?UTF-8?q?1.=E6=8F=90=E4=BA=A4=E7=BB=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=90=8D=E5=AD=97=E5=92=8C=E4=BB=8B=E7=BB=8D=E7=9A=84?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java | 3 +++ .../resi-group-server/src/main/resources/logback-spring.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java index bb1251bf6a..a86f1bb9ae 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.resi.group.dto.group.form; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; @@ -28,9 +29,11 @@ public class EditGroupFormDTO { private String groupHeadPhoto; @NotBlank(message = "组名称不能为空", groups = { SubmitGroupEditVG.class }) + @Length(max = 10, message = "组名称长度不能超过10个字", groups = { SubmitGroupEditVG.class }) private String groupName; @NotBlank(message = "组介绍不能为空", groups = { SubmitGroupEditVG.class }) + @Length(max = 500, message = "组介绍长度不能超过500个字", groups = { SubmitGroupEditVG.class }) private String groupIntroduction; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml index 40fb0f8615..4232677864 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml @@ -134,7 +134,7 @@ - + From 61dfe891614e365753bdb4aa823eb376612315aa Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 4 Nov 2020 11:12:06 +0800 Subject: [PATCH 11/36] =?UTF-8?q?1.=E7=BB=84=E4=BF=A1=E6=81=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8F=90=E4=BA=A4=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=AC=A1=E6=95=B0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/service/impl/ResiGroupServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 a36df9e93c..b5c505adbb 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 @@ -1065,6 +1065,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Wed, 4 Nov 2020 14:27:27 +0800 Subject: [PATCH 12/36] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AF=20=20?= =?UTF-8?q?=E7=BB=84=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/enums/RequirePermissionEnum.java | 2 + .../epmet/commons/tools/redis/RedisKeys.java | 7 ++ .../form/WorkPointVerificationFormDTO.java | 5 +- .../epmet/controller/ExchangeController.java | 3 +- .../epmet/controller/ResiGroupController.java | 48 ++++++++++++ .../group/form/CommonGridAndPageFormDTO.java | 3 + .../group/form/GovGroupSummarizeFromDTO.java | 6 ++ .../result/GroupEditionApplyResultDTO.java | 46 ------------ .../group/feign/ResiGroupOpenFeignClient.java | 35 +++++++++ .../ResiGroupOpenFeignClientFallback.java | 24 ++++++ .../group/controller/ResiGroupController.java | 38 ++++++++++ .../group/dao/GroupEditSubmitRecordDao.java | 32 ++++++++ .../epmet/modules/group/dao/ResiGroupDao.java | 1 + .../modules/group/redis/ResiGroupRedis.java | 26 +++++++ .../group/service/ResiGroupService.java | 22 +++++- .../service/impl/ResiGroupServiceImpl.java | 73 +++++++++++++++++-- .../epmet/modules/utils/ModuleConstant.java | 10 +++ .../mapper/group/GroupEditSubmitRecordDao.xml | 67 +++++++++++++++++ .../dto/result/UserBaseInfoResultDTO.java | 2 +- 19 files changed, 391 insertions(+), 59 deletions(-) delete mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionApplyResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 288526433e..9ddd2f9c8e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -11,6 +11,8 @@ public enum RequirePermissionEnum { */ WORK_GRASSROOTS_GROUP_AUDITINGLIST("work_grassroots_group_auditinglist", "基层治理:群组管理:待审核列表", "基层治理:群组管理:待审核列表查询"), WORK_GRASSROOTS_GROUP_EDIT_AUDITINGLIST("work_grassroots_group_edit_auditinglist", "基层治理:群组管理:小组变更待审核列表", "基层治理:群组管理:小组变更待审核列表"), + WORK_GRASSROOTS_GROUP_EDIT_DETAIL("work_grassroots_group_edit_detail","基层治理:群组管理:变更申请","基层治理:群组管理:小组信息变更申请详情"), + WORK_GRASSROOTS_GROUP_EDIT_AUDIT("work_grassroots_group_edit_audit","基层治理:群组管理:变更审核","基层治理:群组管理:小组信息变更审核(通过或驳回)"), WORK_GRASSROOTS_GROUP_GROUPSINTHEGRID("work_grassroots_group_groupsinthegrid", "基层治理:群组管理:本网格小组列表", "基层治理:群组管理:本网格小组列表查询"), WORK_GRASSROOTS_GROUP_AUDIT("work_grassroots_group_audit", "基层治理:群组管理:审核建组", "基层治理:群组管理:审核建组(通过或驳回)"), WORK_GRASSROOTS_GROUP_AUDITED("work_grassroots_group_audited", "基层治理:群组管理:审核历史", "基层治理:群组管理:审核历史列表查询"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 463ec06427..444077098f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -353,4 +353,11 @@ public class RedisKeys { public static String getScreenIndexDataLockKey() { return rootPrefix.concat("stats:indexcal:lock"); } + + /** + * @Description 用户缓存Key + **/ + public static String getResiUserKey(String userId){ + return rootPrefix.concat("resi:user:").concat(userId); + } } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java index c9cbe06642..fdb09a68f3 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.Max; @@ -17,7 +18,9 @@ import java.io.Serializable; public class WorkPointVerificationFormDTO implements Serializable { private static final long serialVersionUID = -590822390667788693L; - @NotBlank(message = "获取不到用户Id",groups = ResiCommonUserIdFormDTO.UserIdGroup.class) + public interface WorkPointVerifyGroup extends CustomerClientShowGroup{} + + @NotBlank(message = "获取不到用户Id",groups = WorkPointVerifyGroup.class) private String staffId; /** diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java index 8bb1d31cc5..4624abcaff 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java @@ -6,7 +6,6 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.PointVerificationFormDTO; -import com.epmet.dto.form.ResiCommonUserIdFormDTO; import com.epmet.dto.form.WorkPointVerificationFormDTO; import com.epmet.dto.result.PointVerificationResultDTO; import com.epmet.dto.result.WorkPointVerficationListResultDTO; @@ -54,7 +53,7 @@ public class ExchangeController { @PostMapping("recordmonthly") public Result getStaffVerificationRecordMonthly(@LoginUser TokenDto token,@RequestBody WorkPointVerificationFormDTO verificationParam){ verificationParam.setStaffId(token.getUserId()); - ValidatorUtils.validateEntity(verificationParam, ResiCommonUserIdFormDTO.UserIdGroup.class); + ValidatorUtils.validateEntity(verificationParam, WorkPointVerificationFormDTO.WorkPointVerifyGroup.class); return new Result().ok(pointVerificationLogService.getStaffVerificationRecordMonthly(verificationParam)); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java index 207ce24099..79fe109f52 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java @@ -11,6 +11,7 @@ import com.epmet.resi.group.dto.group.result.*; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.ResiGroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -31,6 +32,8 @@ import java.util.List; public class ResiGroupController { @Autowired ResiGroupService resiGroupService; + @Autowired + ResiGroupOpenFeignClient groupOpenFeignClient; /** * 小组审核历史列表 * @@ -127,4 +130,49 @@ public class ResiGroupController { ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); return resiGroupService.disagreeApplying(disAgreeApplyGroupFormDTO); } + + /** + * @Description 工作端 查询组变更待审核列表 + * @param param + * @return + * @author wangc + * @date 2020.11.03 10:19 + */ + @PostMapping("edit-auditing-list") + //@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDITINGLIST) + public Result> getEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){ + ValidatorUtils.validateEntity(param, CommonGridAndPageFormDTO.GridPageGroup.class); + return groupOpenFeignClient.govEditAuditingList(param); + } + + /** + * @Description 工作端-查询小组修改信息的详情内容 + * @param param + * @returncom.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @PostMapping("edit-auditing-detail") + //@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_DETAIL) + public Result getEditAuditingDetail(@RequestBody GovGroupSummarizeFromDTO param){ + ValidatorUtils.validateEntity(param, GovGroupSummarizeFromDTO.GroupIdG.class); + return groupOpenFeignClient.govEditAuditingDetail(param); + } + + /** + * @Description 工作端-工作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @PostMapping("audit-edit") + //@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDIT) + public Result auditEdit(@LoginUser TokenDto tokenDto,@RequestBody GroupEditionAuditFormDTO param){ + param.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(param, GroupEditionAuditFormDTO.GroupEditionAuditGroup.class); + return groupOpenFeignClient.govAuditEdit(param); + } + + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java index 87ed69166f..169073eb68 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.resi.group.dto.group.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -27,11 +28,13 @@ public class CommonGridAndPageFormDTO implements Serializable { /** * 页码 */ + @Min(1) private Integer pageNo; /** * 每页多少条数 */ + @Min(1) private Integer pageSize; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java index 7757d54e37..00163136a2 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java @@ -1,7 +1,9 @@ package com.epmet.resi.group.dto.group.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -12,8 +14,12 @@ import java.io.Serializable; @Data public class GovGroupSummarizeFromDTO implements Serializable { private static final long serialVersionUID = 1L; + + public interface GroupIdG extends CustomerClientShowGroup{} + /** * 小组id */ + @NotBlank(message = "群组Id不能为空",groups = GroupIdG.class) private String groupId; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionApplyResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionApplyResultDTO.java deleted file mode 100644 index e8811f98c9..0000000000 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionApplyResultDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.epmet.resi.group.dto.group.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description 工作端 - 群组审核列表返参DTO - * @ClassName GroupEditionApplyResultDTO - * @Auth wangc - * @Date 2020-11-03 09:06 - */ -@Data -public class GroupEditionApplyResultDTO implements Serializable { - private static final long serialVersionUID = 437035656436226205L; - - /** - * 组Id - */ - private String groupId; - - /** - * 原始组姓名 - */ - private String groupName; - - /** - * 原始组头像 - */ - private String groupHeadPhoto; - - /** - * 已读 未读 - */ - private String readFlag; - - /** - * 审核人员查看待审核列表时的文案 如:党员李华申请变更小组【原小组名】,请审核。 - */ - private String messageText; - - /** - * yyyy-MM-dd HH:mm:ss - */ - private String submitTime; -} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 58ff87be1e..42288e61ea 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -1,9 +1,19 @@ package com.epmet.resi.group.feign; +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.group.form.CommonGridAndPageFormDTO; +import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; +import com.epmet.resi.group.dto.group.form.GroupEditionAuditFormDTO; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; +import com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -11,6 +21,31 @@ import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:16 */ +//@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class,url = "localhost:8095") @FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class) public interface ResiGroupOpenFeignClient { + + @PostMapping("/resi/group/group/gov-edit-auditing-list") + Result> govEditAuditingList(@RequestBody CommonGridAndPageFormDTO param); + + /** + * @Description 查询小组修改信息的详情内容 + * @param param + * @returncom.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @PostMapping("/resi/group/group/gov-edit-auditing-detail") + Result govEditAuditingDetail(@RequestBody GovGroupSummarizeFromDTO param); + + /** + * @Description 工作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @PostMapping("/resi/group/group/gov-audit-edit") + Result govAuditEdit(@RequestBody GroupEditionAuditFormDTO param); + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index df1c7bebf2..de1cb39021 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -1,8 +1,18 @@ package com.epmet.resi.group.feign.fallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.group.form.CommonGridAndPageFormDTO; +import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; +import com.epmet.resi.group.dto.group.form.GroupEditionAuditFormDTO; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; +import com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -11,4 +21,18 @@ import org.springframework.stereotype.Component; */ @Component public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClient { + @Override + public Result> govEditAuditingList(CommonGridAndPageFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "govEditAuditingList", param); + } + + @Override + public Result govEditAuditingDetail(GovGroupSummarizeFromDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "govEditAuditingDetail", param); + } + + @Override + public Result govAuditEdit(GroupEditionAuditFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "govAuditEdit", param); + } } 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 98c572ad08..900fa91908 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 @@ -384,4 +384,42 @@ public class ResiGroupController { return new Result(); } + + /** + * @Description 工作端 查询组变更待审核列表 + * @param param + * @return + * @author wangc + * @date 2020.11.03 10:19 + */ + @PostMapping("gov-edit-auditing-list") + public Result> govEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){ + return new Result>().ok(resiGroupService.getEditAuditingList(param)); + } + + /** + * @Description 工作端-查询小组修改信息的详情内容 + * @param param + * @returncom.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @PostMapping("gov-edit-auditing-detail") + public Result govEditAuditingDetail(@RequestBody GovGroupSummarizeFromDTO param){ + return new Result().ok(resiGroupService.getEditAuditingDetail(param)); + } + + /** + * @Description 工作端-作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @PostMapping("gov-audit-edit") + public Result govAuditEdit(@RequestBody GroupEditionAuditFormDTO param){ + resiGroupService.auditEdit(param); + return new Result(); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java index 37eb9f366e..71ba9175a3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java @@ -19,10 +19,12 @@ package com.epmet.modules.group.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.group.entity.GroupEditSubmitRecordEntity; +import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Date; +import java.util.List; /** * 组编辑提交记录表 @@ -49,4 +51,34 @@ public interface GroupEditSubmitRecordDao extends BaseDao selectGroupEditApplyList(@Param("gridId")String gridId); + + /** + * @Description 查询小组修改信息详情 + * @param + * @return com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:32 + */ + GroupEditSubmitRecordEntity selectEditDetail(@Param("groupId")String groupId,@Param("auditResult") String auditResult); + + /** + * @Description 审核群信息更改 + * @param groupId + * @param staffId + * @param auditStatus + * @param remark + * @return int + * @author wangc + * @date 2020.11.03 17:33 + */ + int updateAuditResult(@Param("groupId")String groupId,@Param("staffId") String staffId,@Param("auditStatus") String auditStatus,@Param("remark")String remark); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index 57fd94d9ab..2cbc78cae1 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -26,6 +26,7 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + import java.util.List; /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java index 7f2442a8e7..6401780dfc 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java @@ -19,8 +19,12 @@ package com.epmet.modules.group.redis; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.group.service.ResiGroupService; import com.epmet.modules.group.service.ResiGroupStatisticalService; @@ -36,6 +40,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import java.util.*; @@ -57,6 +62,9 @@ public class ResiGroupRedis { @Autowired private ResiGroupStatisticalService statisticalService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + public void delete(Object[] ids) { @@ -215,4 +223,22 @@ public class ResiGroupRedis { } }); } + + /** + * @Description 从缓存中获取用户的真实姓名 + * @param userId + * @return java.lang.String + * @author wangc + * @date 2020.11.03 15:27 + */ + public String getFullName(String userId){ + String fieldValue = (String)redisUtils.hGet(RedisKeys.getResiUserKey(userId),"realName"); + if(StringUtils.isNotBlank(fieldValue)) return fieldValue; + List userParam = new LinkedList<>(); userParam.add(userId); + Result> userCacheResult = epmetUserOpenFeignClient.queryUserBaseInfo(userParam); + if(userCacheResult.success() && !CollectionUtils.isEmpty(userCacheResult.getData())){ + return userCacheResult.getData().iterator().next().getRealName(); + } + return null; + } } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index b5227cdc3a..43bbca9b1b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -301,9 +301,27 @@ public interface ResiGroupService extends BaseService { /** * @Description 工作端 查询组变更待审核列表 * @param param - * @return java.util.List + * @return * @author wangc * @date 2020.11.03 10:19 */ - List getEditAuditingList(CommonGridAndPageFormDTO param); + List getEditAuditingList(CommonGridAndPageFormDTO param); + + /** + * @Description 查询小组修改信息的详情内容 + * @param param + * @returncom.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + GroupEditionDetailResultDTO getEditAuditingDetail(GovGroupSummarizeFromDTO param); + + /** + * @Description 工作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + void auditEdit(GroupEditionAuditFormDTO param); } 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 ed535453db..def31ee6ba 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 @@ -32,11 +32,9 @@ import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.ReadFlagConstant; import com.epmet.dto.form.*; import com.epmet.dto.result.UserResiInfoResultDTO; @@ -71,6 +69,7 @@ import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; +import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -139,6 +138,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl + * @return * @author wangc * @date 2020.11.03 10:19 */ @Override - public List getEditAuditingList(CommonGridAndPageFormDTO param) { + public List getEditAuditingList(CommonGridAndPageFormDTO param) { + return Optional.ofNullable(PageHelper.startPage(null == param.getPageNo() ? NumConstant.ONE : param.getPageNo() , null == param.getPageSize() ? NumConstant.TWELVE : param.getPageSize()) + .doSelectPage(() -> { + groupEditSubmitRecordDao.selectGroupEditApplyList(param.getGridId());}).getResult()).orElse(new LinkedList<>()) + .stream().map(o -> { return (ApplyingGroupResultDTO)o; }).collect(Collectors.toList()); + } - return null; + /** + * @Description 查询小组修改信息的详情内容 不加事务! + * @param param + * @return com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @Override + public GroupEditionDetailResultDTO getEditAuditingDetail(GovGroupSummarizeFromDTO param) { + GroupEditSubmitRecordEntity edit = groupEditSubmitRecordDao.selectEditDetail(param.getGroupId(),null); + if(null == edit) { + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.getEditAuditingDetail,未找到小组变更信息记录,传参:{}",JSON.toJSONString(param)); + return null;} + //取消未读状态 + GroupEditSubmitRecordEntity _update = new GroupEditSubmitRecordEntity(); + _update.setId(edit.getId());_update.setReadFlag(ModuleConstant.READ); + groupEditSubmitRecordDao.updateById(_update); + GroupEditionDetailResultDTO result = ConvertUtils.sourceToTarget(edit, GroupEditionDetailResultDTO.class); + result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy())); + return result; } + + /** + * @Description 工作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void auditEdit(GroupEditionAuditFormDTO param) { + if(StringUtils.equals(param.getAuditResult(),ModuleConstant.AUDITING_OPERATION_REJECT) && StringUtils.isBlank(param.getRemark())){ + throw new RenException("拒绝理由不能为空"); + } + int affectedRows = groupEditSubmitRecordDao.updateAuditResult(param.getGroupId(),param.getStaffId(),param.getAuditResult(),param.getRemark()); + if(affectedRows <= NumConstant.ZERO){ + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.auditEdit,更新组编辑记录时受影响行数小于1,传参:{}",JSON.toJSONString(param)); + throw new RenException("更新组编辑记录时受影响行数小于1"); + } + if(!StringUtils.equals(param.getAuditResult(),ModuleConstant.AUDITING_OPERATION_REJECT)){ + //同意 + GroupEditSubmitRecordEntity edit = groupEditSubmitRecordDao.selectEditDetail(param.getGroupId(),param.getAuditResult()); + if(null == edit){ + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.auditEdit,找不到待审核的组更新记录,传参:{}",JSON.toJSONString(param)); + throw new RenException("找不到待审核的组更新记录"); + } + ResiGroupEntity _update = ConvertUtils.sourceToTarget(edit,ResiGroupEntity.class); + _update.setId(param.getGroupId()); + baseDao.updateById(_update); + } + + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java index 094c58bda7..6f6a94d7ed 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java @@ -328,4 +328,14 @@ public interface ModuleConstant extends Constant { String FIELD_OPERATION_TYPE = "OPERATION_TYPE"; String CLOSED_TOPIC_REASON_PREFIX="话题已关闭:"; + + /** + * 审核操作 同意 + */ + String AUDITING_OPERATION_APPROVAL = "approved"; + + /** + * 审核操作 拒绝 + */ + String AUDITING_OPERATION_REJECT = "rejected"; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml index 1b689eb363..5485a96af6 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml @@ -66,5 +66,72 @@ limit 1 + + + + + + + + UPDATE + group_edit_submit_record + SET + AUDIT_STATUS = #{auditStatus}, + STAFF_ID = #{staffId}, + + REMARK = #{remark}, + + AUDIT_TIME = NOW(),UPDATED_TIME = NOW(),UPDATED_BY = #{staffId} + WHERE + DEL_FLAG = '0' + AND + GROUP_ID = #{groupId} + AND + AUDIT_STATUS = 'under_auditIng' + AND + STAFF_ID IS NULL + LIMIT 1 + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java index c674685ee5..2c23abe08b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java @@ -1,6 +1,6 @@ package com.epmet.dto.result; -import com.fasterxml.jackson.annotation.JsonIgnore; + import lombok.Data; import java.io.Serializable; From 361edcb801b4988fb89db181d7f3cc928a452a07 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 4 Nov 2020 15:02:12 +0800 Subject: [PATCH 13/36] =?UTF-8?q?1.=E8=B0=83=E6=95=B4=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=BC=96=E8=BE=91=E5=BC=82=E5=B8=B8=E6=8A=9B?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/exception/EpmetErrorCode.java | 8 ++++++-- .../modules/group/service/impl/ResiGroupServiceImpl.java | 9 ++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 1976ca3337..5a261b93bf 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -41,7 +41,6 @@ public enum EpmetErrorCode { MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), NOT_DEL_GRID(8106,"该网格存在工作人员,不允许删除"), - GROUP_EDIT_ERROR(8107,"组信息编辑失败"), ORG_IS_NOT_NULL(8107,"党组织关系不能为空"), CANNOT_DELETE_PARTY_BRANCH(8108,"当前支部存在党员,不允许删除"), @@ -123,7 +122,12 @@ public enum EpmetErrorCode { SELECT_CUSTOMER_ERROR(8652,"未查询到注册客户信息"), SELECT_AGENCY_ERROR(8653,"根据客户信息未查询到注册客户组织信息"), SELECT_USER_ERROR(8654,"根据客户信息未查询到注册客户管理员信息"), - UPDATE_CUSTOMER_ERROR(8655,"更新注册客户信息为已完成初始化失败"); + UPDATE_CUSTOMER_ERROR(8655,"更新注册客户信息为已完成初始化失败"), + + GROUP_EDIT_ERROR(9000,"组信息编辑失败"), + GROUP_NOT_EXISTS(9001,"该组不存在"), + GROUP_IN_AUDITING(9002,"该组已提交编辑,处于待审核状态,完成审核前不可再次提交"), + GROUP_EDIT_NUM_LIMITED(9003,"已达编辑次数上限"); private int code; 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 b5c505adbb..03a5f0cd6f 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 @@ -1062,27 +1062,26 @@ public class ResiGroupServiceImpl extends BaseServiceImpl 0) { // 已存在组名,拒绝提交 - throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), "组名已存在"); + throw new RenException(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode(), EpmetErrorCode.GROUP_ALREADY_EXISTED.getMsg()); } Date now = new Date(); int usedEditNum = groupEditSubmitRecordDao.countEditNum(groupId, DateUtils.getMonthStart(now), DateUtils.getMonthEnd(now)); if (GroupLimitConstant.EDIT_NUM_LIMIT_MONTH <= usedEditNum) { // 达到最大编辑次数了 - throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), - String.format("本月可用修改次数为%s次,您已使用%s次", GroupLimitConstant.EDIT_NUM_LIMIT_MONTH, usedEditNum)); + throw new RenException(EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getCode(), EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getMsg()); } // 3.内容检查 From dba6589ffa794577b12af879d72ff699d6065fb1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 4 Nov 2020 15:24:24 +0800 Subject: [PATCH 14/36] =?UTF-8?q?=E7=BB=84=E5=8F=98=E6=9B=B4=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=EF=BC=8C=E4=B8=BB=E9=A1=B5=E7=BA=A2=E7=82=B9=E7=9A=84?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/ResiGroupController.java | 6 +++--- .../group/service/impl/ResiGroupServiceImpl.java | 16 ++++++++++------ .../mapper/group/GroupEditSubmitRecordDao.xml | 5 +++-- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java index 79fe109f52..193e5bac1e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java @@ -139,7 +139,7 @@ public class ResiGroupController { * @date 2020.11.03 10:19 */ @PostMapping("edit-auditing-list") - //@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDITINGLIST) + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDITINGLIST) public Result> getEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){ ValidatorUtils.validateEntity(param, CommonGridAndPageFormDTO.GridPageGroup.class); return groupOpenFeignClient.govEditAuditingList(param); @@ -153,7 +153,7 @@ public class ResiGroupController { * @date 2020.11.03 14:10 */ @PostMapping("edit-auditing-detail") - //@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_DETAIL) + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_DETAIL) public Result getEditAuditingDetail(@RequestBody GovGroupSummarizeFromDTO param){ ValidatorUtils.validateEntity(param, GovGroupSummarizeFromDTO.GroupIdG.class); return groupOpenFeignClient.govEditAuditingDetail(param); @@ -167,7 +167,7 @@ public class ResiGroupController { * @date 2020.11.03 16:02 */ @PostMapping("audit-edit") - //@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDIT) + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDIT) public Result auditEdit(@LoginUser TokenDto tokenDto,@RequestBody GroupEditionAuditFormDTO param){ param.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(param, GroupEditionAuditFormDTO.GroupEditionAuditGroup.class); 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 00b85fcda6..3dad3f4555 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 @@ -1108,6 +1108,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Wed, 4 Nov 2020 17:06:22 +0800 Subject: [PATCH 15/36] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/group/service/impl/ResiGroupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3dad3f4555..a7067e7f6d 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 @@ -1279,7 +1279,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Thu, 5 Nov 2020 10:54:00 +0800 Subject: [PATCH 16/36] =?UTF-8?q?=E6=89=93=E5=BC=80=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=B0=8F=E7=BB=84=E4=BF=A1=E6=81=AF=E7=9A=84=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/group/service/impl/ResiGroupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a7067e7f6d..b4930b337a 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 @@ -1087,7 +1087,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Wed, 11 Nov 2020 14:56:32 +0800 Subject: [PATCH 17/36] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9Agateway?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=86=85=E9=83=A8=E6=8E=A5=E5=8F=A3url?= =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/auth/InternalAuthProcessor.java | 6 ++++++ .../src/main/java/com/epmet/filter/CpProperty.java | 5 +++++ epmet-gateway/src/main/resources/bootstrap.yml | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java index 98583c8f3c..2ee22426f6 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -131,6 +131,12 @@ public class InternalAuthProcessor extends AuthProcessor { * @return */ private boolean needAuth(String requestUri) { + for (String url : cpProperty.getInternalAuthUrlsWhiteList()) { + if (antPathMatcher.match(url, requestUri)) { + return false; + } + } + for (String url : cpProperty.getInternalAuthUrls()) { if (antPathMatcher.match(url, requestUri)) { return true; diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java b/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java index 4b801182fa..3442dea612 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java @@ -22,6 +22,11 @@ public class CpProperty { */ private List internalAuthUrls; + /** + * 内部认证url白名单 + */ + private List internalAuthUrlsWhiteList; + /** * 对外部应用开放的url列表 */ diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index ad698b4d8a..53ec286911 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -439,6 +439,10 @@ epmet: - /resi/home/** - /data/report/** + # 内部认证url白名单(在白名单中的,就不会再校验登录了) + internalAuthUrlsWhiteList: + - /epmetuser/customerstaff/customerlist + # 外部应用认证,使用AccessToken等头进行认证 externalOpenUrls: - /data/report/** From fc67e51096700cd4b51c359ba38a4277b1a8fb69 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 12 Nov 2020 14:12:09 +0800 Subject: [PATCH 18/36] =?UTF-8?q?=E7=BB=84=E4=BF=AE=E6=94=B9=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=80=9A=E8=BF=87=E5=90=8E=E5=88=A0=E9=99=A4=E8=AF=A5?= =?UTF-8?q?=E7=BB=84=E4=BF=A1=E6=81=AF=E7=9A=84=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/modules/group/redis/ResiGroupRedis.java | 10 ++++++++++ .../group/service/impl/ResiGroupServiceImpl.java | 1 + 2 files changed, 11 insertions(+) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java index 6401780dfc..03dcc4ecba 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java @@ -132,6 +132,16 @@ public class ResiGroupRedis { return null; } + /** + * @Description 删除组缓存 + * @param groupId + * @return void + * @author wangc + * @date 2020.11.12 14:07 + */ + public void delGroup(String groupId){ + redisUtils.delete(ResiGroupRedisKeys.getResiGroupInfoKey(groupId)); + } /** * @param gridId 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 b4930b337a..f9ce49ff21 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 @@ -1297,6 +1297,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Fri, 13 Nov 2020 10:19:29 +0800 Subject: [PATCH 19/36] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BE=A4=E7=BB=84=E7=AE=A1=E7=90=86=E7=BA=A2=E7=82=B9=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=EF=BC=88+=E5=8F=98=E6=9B=B4=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/feign/ResiGroupFeignClient.java | 2 +- .../com/epmet/service/impl/RemindServiceImpl.java | 3 +-- .../group/controller/ResiGroupController.java | 2 +- .../modules/group/dao/GroupEditSubmitRecordDao.java | 8 ++++++++ .../group/service/impl/ResiGroupServiceImpl.java | 7 ++++--- .../mapper/group/GroupEditSubmitRecordDao.xml | 12 ++++++++++++ 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java index 18815b635a..2fc38efdf0 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java @@ -143,7 +143,7 @@ public interface ResiGroupFeignClient { * @param gridIdList * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei - * @Description 查询网格下待审核的小组总数 + * @Description 查询网格下待审核的小组总数+变更小组信息申请数 * @Date 2020/5/13 15:49 **/ @PostMapping(value = "/resi/group/group/groupprocessingcount",consumes = MediaType.APPLICATION_JSON_VALUE) diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java index e7cfdcbd6c..d9a22f75cd 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java @@ -104,8 +104,7 @@ public class RemindServiceImpl implements RemindService { } } }else{ - logger.error(String.format("调用%s服务,查询网格%s待审核小组数失败code%s,msg:", ServiceConstant.RESI_GROUP_SERVER, gridIdList.get(0), groupProcessingCountResult.getCode(), - groupProcessingCountResult.getMsg())); + logger.error(String.format("查询群组管理待办事项数失败,%s",groupProcessingCountResult.getMsg())); } return false; } 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 900fa91908..a32e44626b 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 @@ -297,7 +297,7 @@ public class ResiGroupController { * @param gridIdList * @return com.epmet.commons.tools.utils.Result> * @Author yinzuomei - * @Description 传入网格id列表,返回每个网格的待审核小组总数 + * @Description 传入网格id列表,返回每个网格的待审核小组总数+变更小组信息申请数 * @Date 2020/5/13 21:33 **/ @PostMapping("groupprocessingcount") diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java index 71ba9175a3..829beba4f7 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java @@ -81,4 +81,12 @@ public interface GroupEditSubmitRecordDao extends BaseDao + + + \ No newline at end of file From cd6f50a9dede851c708f8284a9ff871b7550007d Mon Sep 17 00:00:00 2001 From: wxz Date: Sat, 14 Nov 2020 13:55:58 +0800 Subject: [PATCH 20/36] =?UTF-8?q?=E4=BF=AE=E6=94=B9:=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E7=BB=84=E4=BF=A1=E6=81=AF=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E5=88=A4=E6=96=AD=E5=BD=93=E5=89=8D=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=BA=BA=E6=98=AF=E5=90=A6=E6=98=AF=E7=BB=84=E9=95=BF?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E6=9C=89=E7=BB=84=E9=95=BF=E6=89=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/group/controller/ResiGroupController.java | 4 ++-- .../epmet/modules/group/service/ResiGroupService.java | 2 +- .../modules/group/service/impl/ResiGroupServiceImpl.java | 9 ++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) 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 a32e44626b..8f6620be9d 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 @@ -378,9 +378,9 @@ public class ResiGroupController { * @return */ @PostMapping("submit-edit") - public Result submitGroupEdit(@RequestBody EditGroupFormDTO form){ + public Result submitGroupEdit(@RequestBody EditGroupFormDTO form, @LoginUser TokenDto tokenDto){ ValidatorUtils.validateEntity(form, EditGroupFormDTO.SubmitGroupEditVG.class); - resiGroupService.submitGroupEdit(form.getGroupId(), form.getGroupName(), form.getGroupHeadPhoto(), form.getGroupIntroduction()); + resiGroupService.submitGroupEdit(form.getGroupId(), form.getGroupName(), form.getGroupHeadPhoto(), form.getGroupIntroduction(), tokenDto.getUserId()); return new Result(); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index 43bbca9b1b..b17f2c7cf1 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -296,7 +296,7 @@ public interface ResiGroupService extends BaseService { GroupDetailResultDTO getGroupDetail(String groupId); - void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction); + void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId); /** * @Description 工作端 查询组变更待审核列表 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 2e8ee1216b..39acacad26 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 @@ -1061,13 +1061,20 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Tue, 17 Nov 2020 09:52:42 +0800 Subject: [PATCH 21/36] =?UTF-8?q?httpclientManger=20=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E5=B8=B8=E9=87=8F=EF=BC=9B=E8=B0=83=E6=95=B4=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=B8=BA3-=E3=80=8B4=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/utils/HttpClientManager.java | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index d69f319d7b..6064c69986 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -43,7 +43,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; @@ -60,8 +59,12 @@ import java.util.Set; */ @Slf4j public class HttpClientManager { - private static int connectionTimeout = 3000;// 连接超时时间,毫秒 + private static int connectionTimeout = 4000;// 连接超时时间,毫秒 private static int soTimeout = 10000;// 读取数据超时时间,毫秒 + private static String HEADER_CONTENT_TYPE = "Content-Type"; + private static String HEADER_APPLICATION_JSON = "application/json;charset=utf-8"; + private static String UTF8 = "utf-8"; + private static String HEADER_APPLICATION_FORM_URL_ENCODED = "application/x-www-form-urlencoded;charset=utf-8"; /** * HttpClient对象 */ @@ -116,13 +119,14 @@ public class HttpClientManager { try { HttpPost httppost = new HttpPost(url); httppost.setConfig(requestConfig); - httppost.addHeader("Content-Type", "application/x-www-form-urlencoded charset=utf-8"); + + httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_FORM_URL_ENCODED); List list = new ArrayList(); for (String key : paramsMap.keySet()) { list.add(new BasicNameValuePair(key, String.valueOf(paramsMap.get(key)))); } - UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, "utf-8"); + UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, UTF8); httppost.setEntity(urlEncodedFormEntity); return execute(httppost, false); @@ -146,9 +150,9 @@ public class HttpClientManager { try { HttpPost httppost = new HttpPost(url); httppost.setConfig(requestConfig); - httppost.addHeader("Content-Type", "application/json; charset=utf-8"); + httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); if (StringUtils.isNotEmpty(jsonStrParam)) { - StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + StringEntity se = new StringEntity(jsonStrParam, UTF8); httppost.setEntity(se); } return execute(httppost, false); @@ -164,14 +168,14 @@ public class HttpClientManager { try { HttpPost httppost = new HttpPost(url); httppost.setConfig(requestConfig); - httppost.addHeader("Content-Type", "application/json; charset=utf-8"); + httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); if (null != headerMap){ headerMap.forEach((k,v) -> { httppost.addHeader(k,v); }); } if (StringUtils.isNotEmpty(jsonStrParam)) { - StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + StringEntity se = new StringEntity(jsonStrParam, UTF8); httppost.setEntity(se); } return execute(httppost, false); @@ -221,9 +225,9 @@ public class HttpClientManager { try { HttpPost httppost = new HttpPost(url); httppost.setConfig(requestConfig); - httppost.addHeader("Content-Type", "application/json"); + httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); if (StringUtils.isNotEmpty(jsonStrParam)) { - StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + StringEntity se = new StringEntity(jsonStrParam, UTF8); httppost.setEntity(se); } return execute(httppost, true); @@ -249,9 +253,9 @@ public class HttpClientManager { try { String stringToSign = timestamp + "\n" + secret; Mac mac = Mac.getInstance("HmacSHA256"); - mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); - byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); - String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8"); + mac.init(new SecretKeySpec(secret.getBytes(UTF8), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes(UTF8)); + String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), UTF8); DingTalkTextMsg msg = new DingTalkTextMsg(); msg.setContent(content); url = url.concat("×tamp=" + timestamp + "&sign=" + sign); @@ -275,9 +279,9 @@ public class HttpClientManager { try { String stringToSign = timestamp + "\n" + secret; Mac mac = Mac.getInstance("HmacSHA256"); - mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); - byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); - String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8"); + mac.init(new SecretKeySpec(secret.getBytes(UTF8), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes(UTF8)); + String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), UTF8); log.info("sign为:"+sign); url = url.concat("×tamp=" + timestamp + "&sign=" + sign); log.info("发送url:"+url); @@ -383,9 +387,9 @@ public class HttpClientManager { try { HttpPost httppost = new HttpPost(url); httppost.setConfig(requestConfig); - httppost.addHeader("Content-Type", "application/json"); + httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); if (StringUtils.isNotEmpty(json)) { - StringEntity se = new StringEntity(json, "utf-8"); + StringEntity se = new StringEntity(json, UTF8); httppost.setEntity(se); } return executeToByte(httppost); From 203cfd864a5c213b5311646d105b412e77a43d76 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 17 Nov 2020 10:36:47 +0800 Subject: [PATCH 22/36] =?UTF-8?q?=E6=8A=BD=E5=8F=96=E5=88=B0=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F-=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9=E3=80=81?= =?UTF-8?q?=E7=83=AD=E5=BF=83=E5=B8=82=E6=B0=91=EF=BC=8C=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E5=8E=9F=E5=A7=8B=E6=95=B0=E6=8D=AE=EF=BC=8C=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=88=A0=E9=99=A4=E7=BD=91=E6=A0=BC=E8=80=8C?= =?UTF-8?q?=E9=80=A0=E6=88=90=E5=9E=83=E5=9C=BE=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginGroupMainDailyDao.java | 9 ++++ .../screen/ScreenDifficultyDataDao.java | 9 ++++ .../todata/impl/GroupExtractServiceImpl.java | 21 ++++++--- ...srootsGovernDataAbsorptionServiceImpl.java | 47 ++++++++----------- .../screen/ScreenDifficultyDataService.java | 8 ++++ .../ScreenPartyUserRankDataService.java | 1 - .../impl/ScreenDifficultyDataServiceImpl.java | 12 +++++ .../extract/FactOriginGroupMainDailyDao.xml | 12 +++++ .../screen/ScreenDifficultyDataDao.xml | 10 ++++ 9 files changed, 95 insertions(+), 34 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 5bd0c89103..12e6151f3f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -61,6 +61,15 @@ public interface FactOriginGroupMainDailyDao extends BaseDao + * @author wangc + * @date 2020.11.17 09:56 + */ + List selectAllGroupByCustomerId(@Param("customerId") String customerId); + /** * @param customerId * @return diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 2b66e785bb..3d90291cba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -91,4 +91,13 @@ public interface ScreenDifficultyDataDao extends BaseDao list); int insertBatchImg(@Param("list") List list); + + /** + * @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id,因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据 + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.11.17 09:33 + */ + List selectAllDifficultyByCustomerId(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index cd04bc123e..dedb5bc3a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -66,7 +66,7 @@ public class GroupExtractServiceImpl implements GroupExtractService { /** * @param param * @return - * @Description 业务抽取 - 小组祥光 + * @Description 业务抽取 - 小组 * @author wangc * @date 2020.09.18 21:07 **/ @@ -88,22 +88,31 @@ public class GroupExtractServiceImpl implements GroupExtractService { List memberList = new LinkedList<>(); if (!CollectionUtils.isEmpty(originGroupData)) { List gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList())); - List missingGroups = new LinkedList<>(); + if (!CollectionUtils.isEmpty(gridList)) { Map gridMap = gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2)); - + //剔除本次要更新数据中的垃圾数据 for(Iterator iter = originGroupData.iterator(); + iter.hasNext();){ + FactOriginGroupMainDailyDTO pointer = iter.next(); + if(null == gridMap.get(pointer.getGridId()))iter.remove(); + + } + //记录全量中的垃圾数 + List missingGroups = new LinkedList<>(); + List population = factOriginGroupMainDailyDao.selectAllGroupByCustomerId(param.getCustomerId()); + if(!CollectionUtils.isEmpty(population)){ + for(Iterator iter = population.iterator(); iter.hasNext();){ FactOriginGroupMainDailyDTO pointer = iter.next(); if(null == gridMap.get(pointer.getGridId())){ missingGroups.add(pointer.getId()); - iter.remove(); } } - - originGroupData.forEach(group -> { + } + originGroupData.forEach(group -> { GridAttributesResultDTO attr = gridMap.get(group.getGridId()); if (null != attr) { group.setAgencyId(attr.getAgencyId()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index 8a60c6076b..f81c2e7259 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -126,22 +126,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr }); } - - //6.存入数据库 - //不按照时间删除,每次插入之前将该客户下的所有历史数据清空 - //过滤 统计维度中没有的数据 - Set gridIdSet = new HashSet<>(); - List newInsertList = registeredUsers.stream() - .filter(o -> { - if (StringUtils.isBlank(o.getGridName())) { - gridIdSet.add(o.getGridId()); - return false; - } else { - return true; - } - }).collect(Collectors.toList()); - log.warn("userScoreDataHub grids:{} not in DimGrid", JSON.toJSONString(gridIdSet)); - screenPartyUserRankDataService.dataClean(newInsertList, param.getCustomerId()); + screenPartyUserRankDataService.dataClean(registeredUsers, param.getCustomerId()); } /** @@ -160,43 +145,51 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr //查询数据 List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed)); if(CollectionUtils.isEmpty(difficulties)) return; - //剔除垃圾数据 + //2.查询出客户下网格的相关信息 List gridList = customerGridService.queryGridInfoList(param.getCustomerId()); Map gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); - List missing = new LinkedList<>(); + + //剔除垃圾数据(本次需要更新的数据集) for(Iterator iter = difficulties.iterator(); iter.hasNext();){ ScreenDifficultyDataEntity pointer = iter.next(); if(null == gridMap.get(pointer.getOrgId())){ - missing.add(pointer.getEventId()); iter.remove(); } } + //记录垃圾数(全量) + List missing = new LinkedList<>(); + List population = screenDifficultyDataService.getAllDifficultyByCustomerId(param.getCustomerId()); + if(!CollectionUtils.isEmpty(population)){ + for(Iterator iter = population.iterator(); iter.hasNext();){ + ScreenDifficultyDataEntity pointer = iter.next(); + if(null == gridMap.get(pointer.getOrgId())){ + missing.add(pointer.getEventId()); + } + } + } List projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); //最近一次操作 Map latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId()); - - boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false; - //图片 List projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); Map> imgMap = topicService.getTopicImgs(projectSourceMap); - boolean isImgNull = CollectionUtils.isEmpty(imgMap) ? true : false; + Map contentMap = topicService.getTopicContent(projectSourceMap); - boolean isContentNull = CollectionUtils.isEmpty(contentMap) ? true : false; + difficulties.forEach( diff -> { - if(!isImgNull) { + if(!CollectionUtils.isEmpty(imgMap)) { List figureList = imgMap.get(diff.getEventId()); diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl()); } - if(!isContentNull) { + if(!CollectionUtils.isEmpty(contentMap)) { diff.setEventContent(contentMap.get(diff.getEventId())); } - if(!isOperationNull){ + if(! CollectionUtils.isEmpty(latestOperationMap)){ ProjectLatestOperationResultDTO oper = latestOperationMap.get(diff.getEventId()); if(null != oper){ diff.setLatestOperateDesc(oper.getOperationName()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java index c133c88c84..5fc1af8dcd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java @@ -51,4 +51,12 @@ public interface ScreenDifficultyDataService extends BaseService difficulties, List imgs,List missing); + /** + * @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id,因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据 + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.11.17 09:31 + */ + List getAllDifficultyByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java index 99ce30dc0c..ea844971a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java @@ -40,5 +40,4 @@ public interface ScreenPartyUserRankDataService extends BaseService dataList,String customerId); - } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index a371230024..89673d1e26 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -68,4 +68,16 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2020.11.17 09:31 + */ + @Override + public List getAllDifficultyByCustomerId(String customerId) { + return baseDao.selectAllDifficultyByCustomerId(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index c2c75be60f..2717a8cb5e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -38,6 +38,18 @@ CUSTOMER_ID = #{customerId} + + + DELETE FROM fact_origin_group_main_daily diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml index c56a4e85ab..100a2c29dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -219,4 +219,14 @@ + From 252e4f76b2b86bf92531019f3f7ec6fd761c65bd Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 17 Nov 2020 14:07:26 +0800 Subject: [PATCH 23/36] =?UTF-8?q?httpclientManger=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/utils/HttpClientManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 6064c69986..8b5a691891 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -59,8 +59,10 @@ import java.util.Set; */ @Slf4j public class HttpClientManager { - private static int connectionTimeout = 4000;// 连接超时时间,毫秒 - private static int soTimeout = 10000;// 读取数据超时时间,毫秒 + // 连接超时时间,毫秒 + private static int connectionTimeout = 5000; + // 读取数据超时时间,毫秒 + private static int soTimeout = 20000; private static String HEADER_CONTENT_TYPE = "Content-Type"; private static String HEADER_APPLICATION_JSON = "application/json;charset=utf-8"; private static String UTF8 = "utf-8"; From 97f4d4637293562732d578f7ce7334ca65521090 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 17 Nov 2020 14:31:08 +0800 Subject: [PATCH 24/36] =?UTF-8?q?=E8=B0=83=E7=94=A8feign=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=20=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF?= =?UTF-8?q?=EF=BC=8C=E5=88=9B=E5=BB=BA=E8=AE=AE=E9=A2=98=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiTopicServiceImpl.java | 68 +++++++++---------- .../epmet/modules/utils/ModuleConstant.java | 4 +- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 1a5d8964a3..6e34af14da 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -18,7 +18,6 @@ package com.epmet.modules.topic.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; @@ -75,9 +74,9 @@ import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO; import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.TopicInfoDTO; -import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; +import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -1156,48 +1155,49 @@ public class ResiTopicServiceImpl extends BaseServiceImpl issueResult = govIssueFeignClient.issueShiftedToTopic(issueInfo); + if (issueResult == null || !issueResult.success() || StringUtils.isBlank(issueResult.getData())) { + throw new RenException(ModuleConstant.CREATE_ISSUE_ERROR); + } //5.修改话题shiftIssue字段 - if(issueResult.success() && StringUtils.isNotBlank(issueResult.getData())){ - ResiTopicEntity topic2Upd = new ResiTopicEntity(); - topic2Upd.setId(topicTurnIssueFromDTO.getTopicId()); - topic2Upd.setUpdatedBy(topicTurnIssueFromDTO.getUserId()); - topic2Upd.setShiftIssue(Boolean.TRUE); - topic2Upd.setIssueId(issueResult.getData()); - topic2Upd.setUpdatedTime(now); - int topicResult = baseDao.updateOne(topic2Upd); - //6.新增话题操作记录 - if(topicResult == NumConstant.ONE) { - ResiTopicOperationEntity operation = new ResiTopicOperationEntity(); - operation.setCreatedTime(now); - operation.setCreatedBy(topicTurnIssueFromDTO.getUserId()); - operation.setTopicId(topicTurnIssueFromDTO.getTopicId()); - operation.setOperationType(ModuleConstant.TOPIC_OPERATION_TYPE_SHIFT_ISSUE); - int operationResult = resiTopicOperationDao.insertOneByParams(operation); - if(operationResult != NumConstant.ONE){ - logger.warn(ModuleConstant.FAILURE_TO_ADD_TOPIC_OPERATION); - } - } - //7.更新组统计信息 议题数量+1 - resiGroupStatisticalDao.incryTotalIssues(group.getGroupId()); - if(null != groupCache && null != groupCache.getGroupStatisticalInfo()){ - groupCache.getGroupStatisticalInfo().setTotalIssues( - null == groupCache.getGroupStatisticalInfo().getTotalIssues() ? NumConstant.ONE - : groupCache.getGroupStatisticalInfo().getTotalIssues() + NumConstant.ONE - ); - resiGroupRedis.set(groupCache); - } - logger.warn(ModuleConstant.FAILURE_TO_UPDATE_TOPIC); + ResiTopicEntity topic2Upd = new ResiTopicEntity(); + topic2Upd.setId(topicTurnIssueFromDTO.getTopicId()); + topic2Upd.setUpdatedBy(topicTurnIssueFromDTO.getUserId()); + topic2Upd.setShiftIssue(Boolean.TRUE); + topic2Upd.setIssueId(issueResult.getData()); + topic2Upd.setUpdatedTime(now); + int topicResult = baseDao.updateOne(topic2Upd); + //6.新增话题操作记录 + if (topicResult == NumConstant.ONE) { + ResiTopicOperationEntity operation = new ResiTopicOperationEntity(); + operation.setCreatedTime(now); + operation.setCreatedBy(topicTurnIssueFromDTO.getUserId()); + operation.setTopicId(topicTurnIssueFromDTO.getTopicId()); + operation.setOperationType(ModuleConstant.TOPIC_OPERATION_TYPE_SHIFT_ISSUE); + int operationResult = resiTopicOperationDao.insertOneByParams(operation); + if (operationResult != NumConstant.ONE) { + logger.warn(ModuleConstant.FAILURE_TO_ADD_TOPIC_OPERATION); + } + } + //7.更新组统计信息 议题数量+1 + resiGroupStatisticalDao.incryTotalIssues(group.getGroupId()); + if (null != groupCache && null != groupCache.getGroupStatisticalInfo()) { + groupCache.getGroupStatisticalInfo().setTotalIssues( + null == groupCache.getGroupStatisticalInfo().getTotalIssues() ? NumConstant.ONE + : groupCache.getGroupStatisticalInfo().getTotalIssues() + NumConstant.ONE + ); + resiGroupRedis.set(groupCache); } + logger.warn(ModuleConstant.FAILURE_TO_UPDATE_TOPIC); } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java index 094c58bda7..9fa1359bdf 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java @@ -327,5 +327,7 @@ public interface ModuleConstant extends Constant { String FIELD_OPERATION_TYPE = "OPERATION_TYPE"; - String CLOSED_TOPIC_REASON_PREFIX="话题已关闭:"; + String CLOSED_TOPIC_REASON_PREFIX = "话题已关闭:"; + + String CREATE_ISSUE_ERROR = "创建议题失败"; } From 52b0eaea1b270a80a81ba5c752dae58f47b398c1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 17 Nov 2020 15:16:20 +0800 Subject: [PATCH 25/36] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E9=94=99=E8=AF=AF=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 24 +++++++++++++++ epmet-auth/src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../common-service-server/pom.xml | 28 ++++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../epmet-ext/epmet-ext-server/pom.xml | 28 ++++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../epmet-message-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../epmet-oss/epmet-oss-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../epmet-third/epmet-third-server/pom.xml | 26 +++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- epmet-module/gov-grid/gov-grid-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../gov-issue/gov-issue-server/pom.xml | 11 +++++-- .../src/main/resources/bootstrap.yml | 8 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- epmet-module/gov-mine/gov-mine-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ .../src/main/resources/logback-spring.xml | 9 ++++-- epmet-module/gov-org/gov-org-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../gov-project/gov-project-server/pom.xml | 26 +++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../gov-voice/gov-voice-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../oper-access/oper-access-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- epmet-module/oper-crm/oper-crm-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../resources/{ => mapper}/CustomerAppDao.xml | 0 .../oper-customize-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../resi-group/resi-group-server/pom.xml | 28 ++++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../resi-guide/resi-guide-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../resi-hall/resi-hall-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ .../src/main/resources/logback-spring.xml | 9 ++++-- .../resi-home/resi-home-server/pom.xml | 24 +++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ .../src/main/resources/logback-spring.xml | 9 ++++-- .../resi-mine/resi-mine-server/pom.xml | 24 +++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ .../src/main/resources/logback-spring.xml | 9 ++++-- .../resi-partymember-server/pom.xml | 29 +++++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- .../resi-voice/resi-voice-server/pom.xml | 29 +++++++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ .../src/main/resources/logback-spring.xml | 9 ++++-- epmet-openapi/epmet-openapi-scan/pom.xml | 26 +++++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ .../src/main/resources/logback-spring.xml | 9 ++++-- epmet-user/epmet-user-server/pom.xml | 25 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 7 ++++- .../src/main/resources/logback-spring.xml | 9 ++++-- 73 files changed, 908 insertions(+), 68 deletions(-) rename epmet-module/oper-crm/oper-crm-server/src/main/resources/{ => mapper}/CustomerAppDao.xml (100%) diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 3f434e01da..69713f1908 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -187,6 +187,12 @@ 651f02d71ed3f123dfb584b8bf0f4d8b + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -225,6 +231,12 @@ 651f02d71ed3f123dfb584b8bf0f4d8b + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -258,6 +270,12 @@ wx3d1372029eb816a3 651f02d71ed3f123dfb584b8bf0f4d8b + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -295,6 +313,12 @@ wx3d1372029eb816a3 651f02d71ed3f123dfb584b8bf0f4d8b + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 2306d2da5b..d8526d89e6 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -113,7 +113,7 @@ wx: # secret: @oper.wx.ma.secret@ # token: #微信小程序消息服务器配置的token # aesKey: #微信小程序消息服务器配置的EncodingAESKey -# msgDataFormat: JSON + # msgDataFormat: JSON appId: # 党群e事通-居民端小程序配置appId resi: @resi.wx.ma.appId@ @@ -121,3 +121,8 @@ wx: gov: @gov.wx.ma.appId@ # 党群e事通-运营端小程序配置的appId #oper: @oper.wx.ma.appId@ + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-auth/src/main/resources/logback-spring.xml b/epmet-auth/src/main/resources/logback-spring.xml index af12b174e0..734c4114a1 100644 --- a/epmet-auth/src/main/resources/logback-spring.xml +++ b/epmet-auth/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index c5f2f8bdab..46e103344a 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -130,6 +130,13 @@ producerService/producer/sendMsg 202007161443499985fa2d397436d10356542134c8f008c48 52d9d9b0e7d0eb5b8b81c205b579e07c + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -169,6 +176,13 @@ producerService/producer/sendMsg 202007161443499985fa2d397436d10356542134c8f008c48 52d9d9b0e7d0eb5b8b81c205b579e07c + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -206,6 +220,13 @@ producerService/producer/sendMsg 20200804181646184507453a2e9aab76edc550405f80920af 96d788191a10ff57a125157183413004 + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -240,6 +261,13 @@ producerService/producer/sendMsg 202008141820598348026098a1b5dd0bc63a1e2418e275d1b 7ce17f65826539ff3e8616dccd4b70fc + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index e521fd36ff..83b7ee086a 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -125,4 +125,9 @@ elink: appId: @elink.mq.appId@ #项目接入亿联云的应用Id token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret host: @elink.mq.host@ #亿联云消息网关服务地址 - sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 \ No newline at end of file + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/logback-spring.xml index e7ed94b8fc..fa8dd97a46 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 6f2c432d23..f8ff8b712c 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -197,6 +197,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -229,6 +236,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -261,6 +275,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -294,6 +315,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml index a1948620e3..55f2ba49f8 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -97,4 +97,9 @@ ribbon: pagehelper: helper-dialect: mysql - reasonable: false \ No newline at end of file + reasonable: false + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml index ec4a9fc8e0..6f14b27477 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 594f25e502..89291741a5 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -171,6 +171,13 @@ 8 10 30 + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -209,6 +216,12 @@ 8 10 30 + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -247,6 +260,12 @@ 8 10 30 + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -282,6 +301,12 @@ 8 10 30 + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml index 0ccb3c1213..dcdcaab913 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml @@ -126,4 +126,9 @@ thread: corePoolSize: @thread.pool.core-pool-size@ maxPoolSize: @thread.pool.max-pool-size@ queueCapacity: @thread.pool.queue-capacity@ - keepAlive: @thread.pool.keep-alive@ \ No newline at end of file + keepAlive: @thread.pool.keep-alive@ + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml index 7ead25dd02..ee1f62a8ef 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index ffb777fe7c..3934ecd31a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -149,6 +149,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -181,6 +188,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -213,6 +226,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -242,6 +261,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index 115f991f57..a6d32431be 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -128,4 +128,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/logback-spring.xml index a5edb3b691..22c774cac7 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index c6918855a7..f9cd95ca91 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -208,6 +208,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -240,6 +247,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -272,6 +285,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -305,6 +324,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml index fb128323d5..400d4810ed 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml @@ -133,4 +133,9 @@ third: - https://epmet-ext7.elinkservice.cn - https://epmet-ext8.elinkservice.cn - https://epmet-ext9.elinkservice.cn - - https://epmet-ext10.elinkservice.cn \ No newline at end of file + - https://epmet-ext10.elinkservice.cn + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml index fc91993807..610146dec5 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index 494a417395..c822e7e308 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -112,6 +112,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -138,6 +144,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -164,6 +176,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -190,6 +208,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml index 6b8729cd4e..003760840c 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml @@ -74,4 +74,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml index 780a8cd3a6..dbf5cf299c 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 93d9f0334c..0b00f44d12 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -146,7 +146,7 @@ false https://epmet-dev.elinkservice.cn/api/epmetscan/api - + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -183,7 +183,7 @@ false https://epmet-dev.elinkservice.cn/api/epmetscan/api - + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -253,6 +253,13 @@ true https://epmet-open.elinkservice.cn/api/epmetscan/api + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml index e523016b91..39f6c8b80c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml @@ -114,4 +114,10 @@ openapi: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml index a8dbb17134..7ef4d70dbc 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 54f3b8e225..00baee29cf 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -136,6 +136,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -160,6 +166,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -184,6 +196,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -205,6 +223,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml index f19d228c96..c49ee432c1 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml @@ -94,3 +94,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml index a03a6843bd..80e1ea56e2 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 5c6f53c739..ecfdb329f1 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -150,6 +150,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -182,6 +188,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -215,6 +227,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -244,6 +262,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index 4657c30354..8651e49ce2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -130,4 +130,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml index e05ed7a188..24d44d88f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 06ec668460..0dc357dada 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -157,6 +157,13 @@ false https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -190,6 +197,12 @@ false https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -223,6 +236,12 @@ true https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -253,6 +272,13 @@ true https://epmet-open.elinkservice.cn/api/epmetscan/api + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index 31d7d1ef6d..58ec92257b 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -114,4 +114,9 @@ openapi: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml index c4e23d9fe9..8a9462ce2b 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 1c80814b41..f6b5b7d0a3 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -132,6 +132,12 @@ false https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -165,6 +171,12 @@ false https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -198,6 +210,12 @@ true https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -228,6 +246,13 @@ true https://epmet-open.elinkservice.cn/api/epmetscan/api + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml index 8e85f694ed..6bf735a325 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml @@ -114,4 +114,9 @@ openapi: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml index e9ef5d3b60..da83651e0c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index f78794d104..4a9152e2d0 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-server/pom.xml @@ -119,6 +119,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -151,6 +157,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -183,6 +195,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -212,6 +230,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml index b7cbcbe1af..34a3d56ae9 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml @@ -117,4 +117,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/logback-spring.xml b/epmet-module/oper-access/oper-access-server/src/main/resources/logback-spring.xml index f12b007132..d0829fae23 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 8535f16485..a721c86f4f 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -140,6 +140,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -172,6 +178,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -204,6 +216,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -236,6 +254,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml index 422a4459a9..7b14f2cad1 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml @@ -123,4 +123,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml index 68c16e906e..0c531843f6 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/CustomerAppDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerAppDao.xml similarity index 100% rename from epmet-module/oper-crm/oper-crm-server/src/main/resources/CustomerAppDao.xml rename to epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerAppDao.xml diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 20f7861056..a36f6d46d1 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -123,6 +123,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -155,6 +161,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -187,6 +199,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -216,6 +234,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml index 14755776eb..b6cb0ffbb8 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml @@ -117,4 +117,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml index de2aa4d947..d02b4bffb3 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 43552aa943..86ccf538e0 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -148,6 +148,13 @@ false https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -181,6 +188,13 @@ false https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -213,6 +227,13 @@ true https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -242,6 +263,13 @@ true https://epmet-open.elinkservice.cn/api/epmetscan/api + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index 6f73407d1a..d836a237c2 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -125,4 +125,9 @@ openapi: url: @openapi.scan.server.url@ method: imgSyncScan: /imgSyncScan - textSyncScan: /textSyncScan \ No newline at end of file + textSyncScan: /textSyncScan + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml index 40fb0f8615..6c992be86b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index 098b7a0ba5..1282b2f3e8 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -140,6 +140,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -172,6 +178,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -204,6 +216,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -233,6 +251,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml index ed94f661c3..836ea9f4ca 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml @@ -118,4 +118,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml index 936ac0df8c..174beb8e91 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/resi-hall/resi-hall-server/pom.xml b/epmet-module/resi-hall/resi-hall-server/pom.xml index a44a834c35..61c2a76ffe 100644 --- a/epmet-module/resi-hall/resi-hall-server/pom.xml +++ b/epmet-module/resi-hall/resi-hall-server/pom.xml @@ -98,6 +98,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -124,6 +130,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -150,6 +162,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -173,6 +191,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml index 58e251be5b..479945892d 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml @@ -70,3 +70,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/logback-spring.xml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/logback-spring.xml index 39a130d7e1..be2d2c27e7 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index d43f84aaa6..dac75fd41b 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -116,6 +116,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -140,6 +146,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -164,6 +176,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -185,6 +203,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml index afb7ab3e38..3c5dee1515 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml @@ -69,3 +69,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/resi-home/resi-home-server/src/main/resources/logback-spring.xml b/epmet-module/resi-home/resi-home-server/src/main/resources/logback-spring.xml index a53039bc12..81dec45754 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-home/resi-home-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 96597e773c..f68f226c46 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -140,6 +140,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -163,6 +169,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -186,6 +198,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -206,6 +224,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml index 6e5eb54cc2..eff0b2bbb3 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml @@ -97,3 +97,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/logback-spring.xml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/logback-spring.xml index ffa4fdd447..2893426200 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 74088b3ac0..63d0d5e4bf 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -146,6 +146,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -178,6 +185,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -210,6 +224,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -239,6 +260,14 @@ true + + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml index a2118ff3a3..62322c11c8 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml @@ -117,4 +117,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml index 02b45f2efc..ce07d2963b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/resi-voice/resi-voice-server/pom.xml b/epmet-module/resi-voice/resi-voice-server/pom.xml index 9985f3c6a5..4a1a3a18dc 100644 --- a/epmet-module/resi-voice/resi-voice-server/pom.xml +++ b/epmet-module/resi-voice/resi-voice-server/pom.xml @@ -102,6 +102,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -126,6 +133,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -150,6 +164,13 @@ false + + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -174,6 +195,14 @@ false + + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml index 03891ed01a..589e4fb19e 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml @@ -65,3 +65,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/resources/logback-spring.xml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/logback-spring.xml index 98bc0a986b..c6e86ca128 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml index c77bafe339..b80b8a843e 100644 --- a/epmet-openapi/epmet-openapi-scan/pom.xml +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -104,6 +104,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -129,6 +135,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -150,6 +162,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -175,6 +193,14 @@ false + + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml index 84000daee9..2c2a29d61a 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -77,3 +77,8 @@ aliyun: regionId: cn-shanghai bizType: epmet_img_text +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ + diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml b/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml index d244b6fa2a..9d2ad51e14 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 61c5b17203..385f86164d 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -155,6 +155,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -187,6 +193,12 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -219,6 +231,12 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + @@ -248,6 +266,13 @@ true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 4f732d5ac9..509d1fbac9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -131,4 +131,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml b/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml index 5f22e82478..0c11843dfd 100644 --- a/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml +++ b/epmet-user/epmet-user-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} From bffe8dc539a13bec95e22f2143932711d51b6a6e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 17 Nov 2020 15:32:28 +0800 Subject: [PATCH 26/36] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=BA=9F=E5=BC=83=20?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=A4=9AappId=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/redis/CustomerAppWxServiceUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java index ddd5d69769..c7ef8cf380 100644 --- a/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java +++ b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java @@ -26,7 +26,6 @@ import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.SetOperations; -import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import java.util.List; @@ -39,7 +38,8 @@ import java.util.Set; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ -@Component +//@Component 2020-11-17目前小程序升级都是从 公众号升级 所有这种方式 暂时用不到了 +@Deprecated public class CustomerAppWxServiceUtil implements ApplicationRunner { private static Logger logger = LogManager.getLogger(CustomerAppWxServiceUtil.class); From f709bedaf5d3d21d2c06772759c158c09325f6a0 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 17 Nov 2020 16:14:33 +0800 Subject: [PATCH 27/36] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9=20?= =?UTF-8?q?=E5=85=A8=E5=88=A0=E5=85=A8=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactOriginProjectMainDailyDao.java | 4 +- .../com/epmet/dao/project/ProjectDao.java | 11 +---- .../FactOriginProjectMainDailyService.java | 4 +- ...FactOriginProjectMainDailyServiceImpl.java | 8 ++-- ...srootsGovernDataAbsorptionServiceImpl.java | 40 +++++------------- .../screen/ScreenDifficultyDataService.java | 2 +- .../impl/ScreenDifficultyDataServiceImpl.java | 12 +++--- .../epmet/service/project/ProjectService.java | 3 +- .../project/impl/ProjectServiceImpl.java | 5 +-- .../extract/FactOriginProjectMainDailyDao.xml | 19 ++++++--- .../resources/mapper/project/ProjectDao.xml | 41 ------------------- 11 files changed, 43 insertions(+), 106 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 062c651aaf..ebbbe5e84b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -180,12 +180,12 @@ public interface FactOriginProjectMainDailyDao extends BaseDao * @author wangc * @date 2020.09.28 10:19 */ - List selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List list); + List selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("thresholdValue") Integer thresholdValue); /** * @Description 查询评价周期内新立的项目,是为了增量新增难点赌点的图片库 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 2e15e2aea1..3d4526a0fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -103,14 +103,5 @@ public interface ProjectDao extends BaseDao { */ String selectParameterValueByKey(@Param("customerId") String customerId); - /** - * @Description 得到超过阈值滞留的项目Id集合 - * 规定只要项目的任何一个负责人(被流转到的,自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点 - * @param customerId - * @param exclude - * @return java.util.List - * @author wangc - * @date 2020.11.06 14:14 - */ - List selectOvertimeProjectIds(@Param("customerId") String customerId,@Param("exclude") List exclude,@Param("value") Integer value); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 8f1c0631f7..8b7e1ae06c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -248,12 +248,12 @@ public interface FactOriginProjectMainDailyService extends BaseService * @author wangc * @date 2020.09.28 10:23 */ - List getDifficultyBaseInfo(String customerId , List list); + List getDifficultyBaseInfo(String customerId ,Integer thresholdValue); /** * @Description 得到评价周期内新立项的id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 21caf5f319..bdc82b519d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -237,15 +237,15 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl * @author wangc * @date 2020.09.28 10:23 */ @Override - public List getDifficultyBaseInfo(String customerId, List list) { - if(CollectionUtils.isEmpty(list)) return null; - return baseDao.selectDifficultyBaseInfo(customerId,list); + public List getDifficultyBaseInfo(String customerId, Integer thresholdValue) { + + return baseDao.selectDifficultyBaseInfo(customerId,thresholdValue); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index f81c2e7259..2f6f0b6a44 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -100,10 +100,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr Map scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId); //剔除垃圾数据 - for(Iterator iter = registeredUsers.iterator(); - iter.hasNext();){ - if(null == gridMap.get(iter.next().getGridId())) iter.remove(); - } + registeredUsers.removeIf(user -> null == gridMap.get(user.getGridId())); //5.整合数据 if(!CollectionUtils.isEmpty(registeredUsers)){ @@ -124,7 +121,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr user.setDataEndTime(finalDateId); }); - } screenPartyUserRankDataService.dataClean(registeredUsers, param.getCustomerId()); } @@ -138,12 +134,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr **/ @Override public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { - - //查询难点赌点中有无已结案的项目,若有则保留 - List existed = screenDifficultyDataService.selectExistedInfo(param.getCustomerId()); - //查询数据 - List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed)); + List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId())); if(CollectionUtils.isEmpty(difficulties)) return; //2.查询出客户下网格的相关信息 @@ -151,24 +143,13 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr Map gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); //剔除垃圾数据(本次需要更新的数据集) - for(Iterator iter = difficulties.iterator(); iter.hasNext();){ - ScreenDifficultyDataEntity pointer = iter.next(); - if(null == gridMap.get(pointer.getOrgId())){ - iter.remove(); - } - } - //记录垃圾数(全量) - List missing = new LinkedList<>(); - List population = screenDifficultyDataService.getAllDifficultyByCustomerId(param.getCustomerId()); - if(!CollectionUtils.isEmpty(population)){ - for(Iterator iter = population.iterator(); iter.hasNext();){ - ScreenDifficultyDataEntity pointer = iter.next(); - if(null == gridMap.get(pointer.getOrgId())){ - missing.add(pointer.getEventId()); - } - } - } - + //for(Iterator iter = difficulties.iterator(); iter.hasNext();){ + // ScreenDifficultyDataEntity pointer = iter.next(); + // if(null == gridMap.get(pointer.getOrgId())){ + // iter.remove(); + // } + //} + difficulties.removeIf( diff -> null == gridMap.get(diff.getOrgId())); List projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); //最近一次操作 @@ -196,7 +177,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr diff.setEventTitle(oper.getTitle()); diff.setEventCostTime(oper.getCostTime()); } - } diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE)); @@ -204,6 +184,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr List imgList = new LinkedList<>(); imgMap.values().forEach(list -> {imgList.addAll(list);}); - screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList,missing); + screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java index 5fc1af8dcd..235dfe856a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java @@ -49,7 +49,7 @@ public interface ScreenDifficultyDataService extends BaseService difficulties, List imgs,List missing); + void dataClean(String customerId,List difficulties, List imgs); /** * @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id,因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index 89673d1e26..66873e1b6d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -53,17 +53,17 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl difficulties, List imgs,List missing) { - if(!CollectionUtils.isEmpty(missing)){ - baseDao.deleteBatchDifficulty(customerId, missing); - baseDao.deleteBatchDifficultyImg(missing); + public void dataClean(String customerId, List difficulties, List imgs) { + List orient = baseDao.selectAllDifficultyByCustomerId(customerId); + if(!CollectionUtils.isEmpty(orient)){ + baseDao.deleteBatchDifficultyImg(orient.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList())); } + baseDao.deleteBatchDifficulty(customerId,null); + if (!CollectionUtils.isEmpty(difficulties)) { - baseDao.deleteBatchDifficulty(customerId, difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList())); baseDao.insertBatch(difficulties); } if (!CollectionUtils.isEmpty(imgs)) { - baseDao.deleteBatchDifficultyImg(imgs.stream().map(ScreenDifficultyImgDataEntity::getEventId).distinct().collect(Collectors.toList())); baseDao.insertBatchImg(imgs); } baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE)); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index e707c0a64c..2dc0e88aa6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -104,10 +104,9 @@ public interface ProjectService extends BaseService { * @Description 得到超过阈值滞留的项目Id集合 * 规定只要项目的任何一个负责人(被流转到的,自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点 * @param customerId - * @param exclude * @return java.util.List * @author wangc * @date 2020.11.06 14:14 */ - List getOvertimeProjectByParameter(String customerId,List exclude); + Integer getOvertimeProjectByParameter(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 23461db970..5ba8ea04d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -86,16 +86,15 @@ public class ProjectServiceImpl extends BaseServiceImpl * @author wangc * @date 2020.11.06 14:14 */ @Override - public List getOvertimeProjectByParameter(String customerId, List exclude) { + public Integer getOvertimeProjectByParameter(String customerId) { String parameter = baseDao.selectParameterValueByKey(customerId); if(StringUtils.isBlank(parameter)) parameter = baseDao.selectParameterValueByKey("default"); - return baseDao.selectOvertimeProjectIds(customerId, exclude, StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter)); + return StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index f5c56529be..9a21641767 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -385,11 +385,20 @@ WHERE project.DEL_FLAG = '0' AND project.CUSTOMER_ID = #{customerId} - - - project.ID = #{projectId} - - + AND project.ID IN ( + + + SELECT DISTINCT + project_id + FROM + fact_origin_project_org_period_daily + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND TIMESTAMPDIFF( MINUTE, informed_date, IFNULL( handled_date, NOW( ) ) ) > #{thresholdValue} + + ) + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index de792f46db..08c8d78d5b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -106,45 +106,4 @@ and PARAMETER_KEY ='detention_days' - - \ No newline at end of file From 122c8cebccb7795647d10668862c7b3ec604caa4 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 17 Nov 2020 16:41:30 +0800 Subject: [PATCH 28/36] =?UTF-8?q?job=20feign=E6=8E=A5=E5=8F=A3=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-job-server/src/main/resources/bootstrap.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index 72cbbdaaf8..4488897fcf 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -98,10 +98,14 @@ feign: client: config: default: - loggerLevel: BASIC + loggerLevel: FULL httpclient: enabled: true +logging: + level: + com.epmet: debug + hystrix: command: default: From af4c0091eda6dc7124f415bda3b3f980438562e7 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 17 Nov 2020 17:32:50 +0800 Subject: [PATCH 29/36] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectMainDailyDao.xml | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 9a21641767..1ea4b350fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -389,15 +389,28 @@ SELECT DISTINCT - project_id + period.project_id FROM - fact_origin_project_org_period_daily - WHERE - del_flag = '0' - AND customer_id = #{customerId} - AND TIMESTAMPDIFF( MINUTE, informed_date, IFNULL( handled_date, NOW( ) ) ) > #{thresholdValue} + fact_origin_project_org_period_daily period + LEFT JOIN + ( + + SELECT + + project.ID AS projectId, + IF(project.project_status = 'closed',period.handled_date,NOW()) AS finishDate - ) + FROM fact_origin_project_main_daily project LEFT JOIN fact_origin_project_org_period_daily period + ON project.ID = period.project_id AND period.del_flag = '0' AND period.customer_id = #{customerId} + AND period.operation = 'close' + WHERE project.customer_id = #{customerId} AND project.del_flag = '0' + ) projectFinishDate ON projectFinishDate.projectId = period.project_id + + WHERE + period.del_flag = '0' + AND period.customer_id = #{customerId} + AND TIMESTAMPDIFF( DAY, period.informed_date, projectFinishDate.finishDate) > #{thresholdValue} + ) From 6dab1ffef0f1a307aa5bbad22bd62b9e66b075af Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 17 Nov 2020 17:53:02 +0800 Subject: [PATCH 30/36] =?UTF-8?q?=E4=BF=AE=E6=94=B9user=E6=9C=8D=E5=8A=A1/?= =?UTF-8?q?userresiinfo/getuserresiinfo=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/UserWechatDao.java | 2 + .../service/impl/UserBaseInfoServiceImpl.java | 12 +++--- .../main/resources/mapper/UserResiInfoDao.xml | 38 ++++++++----------- .../main/resources/mapper/UserWechatDao.xml | 20 ++++++++++ 4 files changed, 44 insertions(+), 28 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java index ef513d0ac7..d0f6b2def7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java @@ -75,4 +75,6 @@ public interface UserWechatDao extends BaseDao{ **/ List selectResiAndStrangerInfo(@Param("userIds") List userIds, @Param("realName")String realName); + //临时用下in + List selectNotInUserBaseInfoTemp(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 7143b7d171..326e74912d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -166,7 +166,7 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl userWechatDTOList=userWechatDao.selectAll(); + List userWechatDTOList=userWechatDao.selectNotInUserBaseInfoTemp(); List userIdList=new ArrayList<>(); for(UserWechatDTO userWechatDTO:userWechatDTOList){ userIdList.add(userWechatDTO.getUserId()); @@ -202,12 +202,12 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl SELECT - uri.id, - uc.USER_ID, + ubi.USER_ID, uri.REG_MOBILE, - uri.SURNAME, - uri.`NAME`, - uri.STREET, - uri.DISTRICT, + ubi.SURNAME, + ubi.`NAME`, + ubi.STREET, + ubi.DISTRICT, uri.RESI_VISIT_ID, - uri.BUILDING_ADDRESS, - CONCAT( - uri.STREET, - '-', - uri.SURNAME, - ( CASE WHEN uw.SEX = '1' THEN '先生' WHEN uw.SEX = '2' THEN '女士' ELSE '先生/女士' END ) + ubi.BUILDING_ADDRESS, + CONCAT( + ubi.STREET, + '-', + ubi.SURNAME, + ( CASE WHEN ubi.GENDER = '1' THEN '先生' WHEN ubi.GENDER = '2' THEN '女士' ELSE '先生/女士' END ) ) AS show_name, uw.HEAD_IMG_URL AS head_photo - FROM - user_customer uc - LEFT JOIN user_resi_info uri ON ( uc.USER_ID = uri.USER_ID ) - LEFT JOIN user_wechat uw ON (uc.USER_ID = uw.USER_ID) + user_base_info ubi + LEFT JOIN user_resi_info uri ON ( ubi.USER_ID = uri.USER_ID AND uri.DEL_FLAG = '0' ) + LEFT JOIN user_wechat uw ON ( uri.USER_ID = uw.USER_ID AND uw.DEL_FLAG = '0' ) WHERE - uc.DEL_FLAG = '0' - AND uri.DEL_FLAG = '0' - AND uc.CUSTOMER_ID = #{customerId} - AND uc.USER_ID = #{userId} - AND uw.DEL_FLAG = '0' - AND uw.USER_ID = #{userId} + ubi.USER_ID =#{userId} + AND ubi.DEL_FLAG = '0' diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index 98a5c58075..5797e95eef 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -115,4 +115,24 @@ ORDER BY base.REAL_NAME , wechat.NICKNAME + + + From 99ea55660c35e7fbe38fc58419ba2a46ee87de5f Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 18 Nov 2020 11:07:16 +0800 Subject: [PATCH 31/36] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=B0=86?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=9D=83=E9=99=90=E5=90=8C=E6=AD=A5=E5=88=B0?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=AE=A2=E6=88=B7=E7=9A=84=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 1 + .../form/AccessConfigAsyncDefaultFormDTO.java | 17 ++++++ .../controller/AccessConfigController.java | 19 +++++++ .../epmet/service/AccessConfigService.java | 2 + .../service/impl/AccessConfigServiceImpl.java | 57 +++++++++++++++++++ .../src/main/resources/bootstrap.yml | 4 ++ .../epmet/feign/EpmetUserOpenFeignClient.java | 9 +++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/GovStaffRoleController.java | 12 ++++ .../java/com/epmet/dao/GovStaffRoleDao.java | 2 + .../epmet/service/GovStaffRoleService.java | 2 + .../service/impl/GovStaffRoleServiceImpl.java | 11 ++++ .../main/resources/mapper/GovStaffRoleDao.xml | 8 +++ 13 files changed, 149 insertions(+) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAsyncDefaultFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index e4832a1c8b..bce453d0af 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -110,6 +110,7 @@ public enum EpmetErrorCode { OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"), OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"), OPER_EXT_APP_SECRET_RESET_FAIL(8714, "秘钥更新失败"), + USER_LIST_ROLES_BY_KEY_FAIL(8715, "根据角色key查询角色列表失败"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAsyncDefaultFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAsyncDefaultFormDTO.java new file mode 100644 index 0000000000..cf458aa878 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAsyncDefaultFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +@Data +public class AccessConfigAsyncDefaultFormDTO { + @NotBlank(message = "角色Key不能为空") + private String roleKey; + + @NotBlank(message = "操作Key不能为空") + private String operationKey; + + private List scopeKeys; +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java index ec11eaa26f..39d1305138 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java @@ -12,6 +12,7 @@ import oracle.jdbc.proxy.annotation.Post; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Set; @@ -116,4 +117,22 @@ public class AccessConfigController { return new Result(); } + /** + * @Description 将默认的角色操作和范围同步给具体的角色 + * @return + * @author wxz + * @date 2020.11.17 17:41 + */ + @PostMapping("role-ope-and-scopes/async-from-default") + public Result asyncRoleOpeAndScopesFromDefault(@RequestBody AccessConfigAsyncDefaultFormDTO form ) { + ValidatorUtils.validateEntity(form); + String roleKey = form.getRoleKey(); + String operationKey = form.getOperationKey(); + List scopeKeys = form.getScopeKeys(); + + accessConfigService.asyncRoleOpeAndScopesFromDefault(roleKey, operationKey, scopeKeys); + return new Result(); + } + + } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java index 3fc28b675f..2c2c1518d3 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java @@ -25,4 +25,6 @@ public interface AccessConfigService { List listOpeDefaultScopes4Role(String roleKey, String operationKey); void saveOpeDefaultScopes(String roleKey, String operationKey, List scopeKeys); + + void asyncRoleOpeAndScopesFromDefault(String roleKey, String operationKey, List scopeKeys); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java index 7b635cedf0..bc53201ce0 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java @@ -2,12 +2,14 @@ package com.epmet.service.impl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; import com.epmet.dto.result.*; import com.epmet.entity.OperationScopeDefaultEntity; import com.epmet.entity.RoleOperationDefaultEntity; import com.epmet.entity.RoleOperationEntity; import com.epmet.entity.RoleScopeEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.RoleOpeScopeRedis; import com.epmet.service.AccessConfigService; import org.slf4j.Logger; @@ -41,6 +43,9 @@ public class AccessConfigServiceImpl implements AccessConfigService { @Autowired private OperationScopeDefaultDao operationScopeDefaultDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Override public List listOpesByRole(String roleId) { return roleOperationDao.listOpesForAccessConfig(roleId); @@ -196,4 +201,56 @@ public class AccessConfigServiceImpl implements AccessConfigService { operationScopeDefaultDao.insert(entity); } } + + /** + * @Description 将默认的角色操作和范围同步给具体的角色 + * @return + * @author wxz + * @date 2020.11.17 17:41 + */ + @Override + public void asyncRoleOpeAndScopesFromDefault(String roleKey, String operationKey, List scopeKeys) { + Result> rolesResult = epmetUserOpenFeignClient.listRolesByRoleKey(roleKey); + if (!rolesResult.success()) { + String msg = "调用user服务,根据key查询角色列表失败"; + throw new RenException(EpmetErrorCode.USER_LIST_ROLES_BY_KEY_FAIL.getCode(), msg, msg, + RenException.MessageMode.CODE_INTERNAL_EXTERNAL.CODE_INTERNAL_EXTERNAL); + } + + List roles = rolesResult.getData(); + List roleIds2Add = roles.stream().map(GovStaffRoleResultDTO::getRoleId).collect(Collectors.toList()); + asyncRoleOpeAndScopesFromDefault(roleIds2Add, operationKey, scopeKeys); + } + + /** + * @Description 将默认的角色操作和范围同步给具体的角色 + * @return + * @author wxz + * @date 2020.11.17 17:38 + */ + @Transactional(rollbackFor = Exception.class) + public void asyncRoleOpeAndScopesFromDefault(List roleIds, String operationKey, List scopeKeys) { + for (String roleId : roleIds) { + // 只给没有添加该权限的用户赋予该权限,已经添加了和添加了又取消的不操作 + RoleOperationEntity roleOpe = roleOperationDao.getRoleOpe(roleId, operationKey); + if (roleOpe == null) { + // 没有该操作,则添加 + RoleOperationEntity roleOperation = new RoleOperationEntity(); + roleOperation.setOperationKey(operationKey); + roleOperation.setRoleId(roleId); + roleOperationDao.insert(roleOperation); + } + for (String scopeKey : scopeKeys) { + // 没有的话则添加 + RoleScopeEntity roleScopeInDb = roleScopeDao.getByRoleIdAndOpeKey(roleId, operationKey, scopeKey); + if (roleScopeInDb == null) { + RoleScopeEntity roleScopeEntity = new RoleScopeEntity(); + roleScopeEntity.setOperationKey(operationKey); + roleScopeEntity.setRoleId(roleId); + roleScopeEntity.setScopeKey(scopeKey); + roleScopeDao.insert(roleScopeEntity); + } + } + } + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml index e8a2685e37..6fcc5979f5 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml @@ -119,3 +119,7 @@ pagehelper: helper-dialect: mysql reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 +#feign 日志需要该配置 +logging: + level: + com.epmet: debug \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index e7fda8ad3e..7eeef44d42 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -334,4 +334,13 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/customerstaff/getstaffbasicinfo") Result getStaffBasicInfo(@RequestBody StaffBasicInfoFromDTO fromDTO); + + /** + * @Description 根据角色key查询具有该key的所有角色列表 + * @return + * @author wxz + * @date 2020.11.17 16:20 + */ + @PostMapping("/epmetuser/govstaffrole/list-roles-by-rolekey/{role-key}") + Result> listRolesByRoleKey(@PathVariable("role-key") String roleKey); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 9e0c973463..a76e847ff4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -225,4 +225,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffBasicInfo", fromDTO); } + + @Override + public Result> listRolesByRoleKey(String roleKey) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "listRolesByRoleKey", roleKey); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java index 81a79972c0..40cab6cb5a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java @@ -100,4 +100,16 @@ public class GovStaffRoleController { return new Result(); } + /** + * @Description 根据角色key查询具有该key的所有角色列表 + * @return + * @author wxz + * @date 2020.11.17 16:20 + */ + @PostMapping("list-roles-by-rolekey/{role-key}") + public Result> listRolesByRoleKey(@PathVariable("role-key") String roleKey) { + List roles = govStaffRoleService.listRolesByRoleKey(roleKey); + return new Result>().ok(roles); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index aab3c4ae30..f7875d63d5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -75,4 +75,6 @@ public interface GovStaffRoleDao extends BaseDao { int updateColumnsById(@Param("roleId") String roleId, @Param("roleName") String roleName); int updateSortById(@Param("roleId") String roleId, @Param("sort") int sort); + + List listRolesByRoleKey(@Param("roleKey") String roleKey); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index eef3e6f0b0..346fad61b2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -138,4 +138,6 @@ public interface GovStaffRoleService extends BaseService { int updateRole(String roleId, String roleName); void saveSortOrder(List roleIdList); + + List listRolesByRoleKey(String roleKey); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index 6a22460731..726be2370d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -222,4 +222,15 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl listRolesByRoleKey(String roleKey) { + return govStaffRoleDao.listRolesByRoleKey(roleKey); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 1a8c27b7d0..40539c565f 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -103,4 +103,12 @@ ) + + + \ No newline at end of file From 858e1b58c9e1e329ebd61aa07d0f4b63e9f5255d Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 18 Nov 2020 13:50:07 +0800 Subject: [PATCH 32/36] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=9D=83=E9=99=90=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=EF=BC=8Capi=E5=92=8C=E6=96=B9=E6=B3=95=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...aultFormDTO.java => AccessConfigAdd4RoletFormDTO.java} | 2 +- .../java/com/epmet/controller/AccessConfigController.java | 8 ++++---- .../main/java/com/epmet/service/AccessConfigService.java | 2 +- .../com/epmet/service/impl/AccessConfigServiceImpl.java | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) rename epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/{AccessConfigAsyncDefaultFormDTO.java => AccessConfigAdd4RoletFormDTO.java} (87%) diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAsyncDefaultFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAdd4RoletFormDTO.java similarity index 87% rename from epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAsyncDefaultFormDTO.java rename to epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAdd4RoletFormDTO.java index cf458aa878..85b9e9d68d 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAsyncDefaultFormDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigAdd4RoletFormDTO.java @@ -6,7 +6,7 @@ import javax.validation.constraints.NotBlank; import java.util.List; @Data -public class AccessConfigAsyncDefaultFormDTO { +public class AccessConfigAdd4RoletFormDTO { @NotBlank(message = "角色Key不能为空") private String roleKey; diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java index 39d1305138..76a7886947 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java @@ -118,19 +118,19 @@ public class AccessConfigController { } /** - * @Description 将默认的角色操作和范围同步给具体的角色 + * @Description 给角色添加操作权限和操作范围 * @return * @author wxz * @date 2020.11.17 17:41 */ - @PostMapping("role-ope-and-scopes/async-from-default") - public Result asyncRoleOpeAndScopesFromDefault(@RequestBody AccessConfigAsyncDefaultFormDTO form ) { + @PostMapping("add-ope-and-scopes-4role") + public Result addOpeAndScopes4Role(@RequestBody AccessConfigAdd4RoletFormDTO form) { ValidatorUtils.validateEntity(form); String roleKey = form.getRoleKey(); String operationKey = form.getOperationKey(); List scopeKeys = form.getScopeKeys(); - accessConfigService.asyncRoleOpeAndScopesFromDefault(roleKey, operationKey, scopeKeys); + accessConfigService.addOpeAndScopes4Role(roleKey, operationKey, scopeKeys); return new Result(); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java index 2c2c1518d3..508f3ad45f 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java @@ -26,5 +26,5 @@ public interface AccessConfigService { void saveOpeDefaultScopes(String roleKey, String operationKey, List scopeKeys); - void asyncRoleOpeAndScopesFromDefault(String roleKey, String operationKey, List scopeKeys); + void addOpeAndScopes4Role(String roleKey, String operationKey, List scopeKeys); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java index bc53201ce0..79d35436a8 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java @@ -203,13 +203,13 @@ public class AccessConfigServiceImpl implements AccessConfigService { } /** - * @Description 将默认的角色操作和范围同步给具体的角色 + * @Description 给角色添加操作权限和操作范围 * @return * @author wxz * @date 2020.11.17 17:41 */ @Override - public void asyncRoleOpeAndScopesFromDefault(String roleKey, String operationKey, List scopeKeys) { + public void addOpeAndScopes4Role(String roleKey, String operationKey, List scopeKeys) { Result> rolesResult = epmetUserOpenFeignClient.listRolesByRoleKey(roleKey); if (!rolesResult.success()) { String msg = "调用user服务,根据key查询角色列表失败"; @@ -219,7 +219,7 @@ public class AccessConfigServiceImpl implements AccessConfigService { List roles = rolesResult.getData(); List roleIds2Add = roles.stream().map(GovStaffRoleResultDTO::getRoleId).collect(Collectors.toList()); - asyncRoleOpeAndScopesFromDefault(roleIds2Add, operationKey, scopeKeys); + addOpeAndScopes4Role(roleIds2Add, operationKey, scopeKeys); } /** @@ -229,7 +229,7 @@ public class AccessConfigServiceImpl implements AccessConfigService { * @date 2020.11.17 17:38 */ @Transactional(rollbackFor = Exception.class) - public void asyncRoleOpeAndScopesFromDefault(List roleIds, String operationKey, List scopeKeys) { + public void addOpeAndScopes4Role(List roleIds, String operationKey, List scopeKeys) { for (String roleId : roleIds) { // 只给没有添加该权限的用户赋予该权限,已经添加了和添加了又取消的不操作 RoleOperationEntity roleOpe = roleOperationDao.getRoleOpe(roleId, operationKey); From 873faa606f97a42ad6d8b98e1157973975fdc56d Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 20 Nov 2020 10:17:35 +0800 Subject: [PATCH 33/36] =?UTF-8?q?=E4=B8=8B=E8=B0=83=E5=8F=91=E9=80=81?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E7=9A=84=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/WxmpMessageServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java index d8e6a43485..0d390bfc31 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java @@ -278,12 +278,12 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { decrease = wxmpWorkUserSubscribeDao.decreaseWorkSubscribeCount(openId, templateId, customerId, 1,userId); } if (decrease == 0) { - logger.error("消息{}发送成功但订阅条数-1失败", JSON.toJSONString(msg)); + logger.warn("消息{}发送成功但订阅条数-1失败", JSON.toJSONString(msg)); } //存表 int saveRes = wxmpMsgSendRecordService.saveRecord(initRecord(msg, templateId, openId, WxmpMessageConstant.SUCCESS)); if (saveRes == 0) { - logger.error("消息{}发送成功但存入记录表失败", JSON.toJSONString(msg)); + logger.warn("消息{}发送成功但存入记录表失败", JSON.toJSONString(msg)); } } else { //发送失败 @@ -296,7 +296,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { clear = wxmpWorkUserSubscribeDao.clearWorkSubscribeCount(openId, templateId, customerId,userId); } if (clear == 0) { - logger.error("消息{}发送失败且清空订阅条数失败", JSON.toJSONString(msg)); + logger.warn("消息{}发送失败且清空订阅条数失败", JSON.toJSONString(msg)); } } @@ -316,11 +316,11 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { wxmpMsgSendRecordEntity.setReason(errMsg); int saveRes = wxmpMsgSendRecordService.saveRecord(wxmpMsgSendRecordEntity); if (saveRes == 0) { - logger.error("消息{}发送失败且存入记录表失败", JSON.toJSONString(msg)); + logger.warn("消息{}发送失败且存入记录表失败", JSON.toJSONString(msg)); } } - logger.error("消息:{}发送失败,原因是:{}", JSON.toJSONString(msg), errMsg); + logger.warn("消息:{}发送失败,原因是:{}", JSON.toJSONString(msg), errMsg); continue; } } From 2c7e78572d55d1e990c03c840067c166be1eedc4 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 20 Nov 2020 14:46:09 +0800 Subject: [PATCH 34/36] =?UTF-8?q?=E5=8A=A0=E4=B8=AA=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/group/service/impl/ResiGroupServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 04718f2add..e5507ab766 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 @@ -526,6 +526,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Fri, 20 Nov 2020 14:48:57 +0800 Subject: [PATCH 35/36] =?UTF-8?q?=E5=88=A0=E9=99=A4x=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiGroupServiceImpl.java | 1358 ----------------- 1 file changed, 1358 deletions(-) delete mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java 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 deleted file mode 100644 index e5507ab766..0000000000 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ /dev/null @@ -1,1358 +0,0 @@ -/** - * 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.alibaba.fastjson.JSON; -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.AppClientConstant; -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.RenException; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.scan.param.ImgScanParamDTO; -import com.epmet.commons.tools.scan.param.ImgTaskDTO; -import com.epmet.commons.tools.scan.param.TextScanParamDTO; -import com.epmet.commons.tools.scan.param.TextTaskDTO; -import com.epmet.commons.tools.scan.result.SyncScanResult; -import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.*; -import com.epmet.constant.ReadFlagConstant; -import com.epmet.dto.form.*; -import com.epmet.dto.result.UserResiInfoResultDTO; -import com.epmet.dto.result.UserRoleResultDTO; -import com.epmet.feign.EpmetMessageOpenFeignClient; -import com.epmet.modules.constant.UserMessageConstant; -import com.epmet.modules.feign.EpmetMessageFeignClient; -import com.epmet.modules.feign.EpmetUserFeignClient; -import com.epmet.modules.feign.GovOrgFeignClient; -import com.epmet.modules.group.dao.GroupEditSubmitRecordDao; -import com.epmet.modules.group.dao.ResiGroupDao; -import com.epmet.modules.group.dao.ResiGroupOperationDao; -import com.epmet.modules.group.entity.GroupEditSubmitRecordEntity; -import com.epmet.modules.group.entity.ResiGroupEntity; -import com.epmet.modules.group.entity.ResiGroupOperationEntity; -import com.epmet.modules.group.redis.ResiGroupRedis; -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.dao.GroupMemeberOperationDao; -import com.epmet.modules.member.dao.ResiGroupMemberDao; -import com.epmet.modules.member.redis.ResiGroupMemberRedis; -import com.epmet.modules.member.service.GroupMemeberOperationService; -import com.epmet.modules.member.service.ResiGroupMemberService; -import com.epmet.modules.utils.ModuleConstant; -import com.epmet.resi.group.constant.*; -import com.epmet.resi.group.dto.UserRoleDTO; -import com.epmet.resi.group.dto.group.*; -import com.epmet.resi.group.dto.group.form.GridIdFormDTO; -import com.epmet.resi.group.dto.group.form.ShouldVoteCountFormDTO; -import com.epmet.resi.group.dto.group.form.*; -import com.epmet.resi.group.dto.group.result.*; -import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; -import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; -import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; -import com.github.pagehelper.PageHelper; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 群组信息表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-28 - */ -@Service -public class ResiGroupServiceImpl extends BaseServiceImpl implements ResiGroupService { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - private ResiGroupMemberService resiGroupMemberService; - - @Autowired - private ResiGroupOperationService resiGroupOperationService; - - @Autowired - private EpmetUserFeignClient epmetUserFeignClient; - - @Autowired - private GroupMemeberOperationService groupMemeberOperationService; - - @Autowired - private ResiGroupStatisticalService resiGroupStatisticalService; - - @Autowired - private ResiGroupOperationDao resiGroupOperationDao; - - @Autowired - private ResiGroupMemberDao resiGroupMemberDao; - - @Autowired - private GroupMemeberOperationDao groupMemeberOperationDao; - - @Autowired - private ResiGroupRedis resiGroupRedis; - - @Autowired - private ResiGroupMemberRedis resiGroupMemberRedis; - - @Autowired - private GovOrgFeignClient govOrgFeignClient; - - @Autowired - private EpmetMessageFeignClient epmetMessageFeignClient; - - @Autowired - private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; - - @Autowired - private ResiGroupDao resiGroupDao; - - @Autowired - private GroupEditSubmitRecordDao groupEditSubmitRecordDao; - - @Autowired - private LoginUserUtil loginUserUtil; - - @Autowired - private CpUserDetailRedis sysUserInfoRedis; - - @Value("${openapi.scan.server.url}") - private String scanApiUrl; - - @Value("${openapi.scan.method.textSyncScan}") - private String textSyncScanMethod; - - @Value("${openapi.scan.method.imgSyncScan}") - private String imgSyncScanMethod; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ResiGroupDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, ResiGroupDTO.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 ResiGroupDTO get(String id) { - ResiGroupEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ResiGroupDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(ResiGroupDTO dto) { - ResiGroupEntity entity = ConvertUtils.sourceToTarget(dto, ResiGroupEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ResiGroupDTO dto) { - ResiGroupEntity entity = ConvertUtils.sourceToTarget(dto, ResiGroupEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - /** - * @param myGroupFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 我的小组查询(包含我创建的小组+我加入的小组),以各组的最新话题时间有近到远排序) - * @Date 2020/3/28 20:37 - **/ - @Override - public List getMyGroup(MyGroupFormDTO myGroupFormDTO) { - int pageIndex = (myGroupFormDTO.getPageNo() - NumConstant.ONE) * myGroupFormDTO.getPageSize(); - myGroupFormDTO.setPageNo(pageIndex); - List myGroupList = baseDao.selectListMyGroup(myGroupFormDTO); - if (null == myGroupList || myGroupList.size() < 1) { - logger.info(String.format("我的小组查询为空,selectListMyGroup入参%s", JSON.toJSONString(myGroupFormDTO))); - return new ArrayList<>(); - } - return myGroupList; - } - - /** - * @param recommendGroupFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 推荐组列表查询 - * @Date 2020/3/28 19:53 - **/ - @Override - public List getRecommendGroup(RecommendGroupFormDTO recommendGroupFormDTO) { - int pageIndex = (recommendGroupFormDTO.getPageNo() - NumConstant.ONE) * recommendGroupFormDTO.getPageSize(); - recommendGroupFormDTO.setPageNo(pageIndex); - //显示当前网格内所有当前用户还未加入的组,以组的人数由高到低排序;如果人数相同,以最新话题的时间有近到远排序 - List recommendGroupList = baseDao.selectListRecommendGroup(recommendGroupFormDTO); - if (null == recommendGroupList || recommendGroupList.size() == 0) { - logger.info(String.format("推荐小组查询为空,selectListRecommendGroup入参%s", JSON.toJSONString(recommendGroupFormDTO))); - return new ArrayList<>(); - } - for (RecommendGroupResultDTO recommendGroupResultDTO : recommendGroupList) { - GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationService.selectLatestRecord(recommendGroupResultDTO.getGroupId(), - recommendGroupFormDTO.getUserId()); - if (null != groupMemeberOperationDTO) { - recommendGroupResultDTO.setStatus(groupMemeberOperationDTO.getOperateStatus()); - } - } - return recommendGroupList; - } - - /** - * @param createdFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 我创建的小组 - * @Date 2020/3/28 22:01 - **/ - @Override - public List getCreated(CreatedFormDTO createdFormDTO) { - int pageIndex = (createdFormDTO.getPageNo() - NumConstant.ONE) * createdFormDTO.getPageSize(); - createdFormDTO.setPageNo(pageIndex); - List createdResultDTOList = baseDao.selectListMyCreated(createdFormDTO); - if (null == createdResultDTOList || createdResultDTOList.size() == 0) { - logger.info(String.format("我创建的小组查询为空,selectListMyCreated入参%s", JSON.toJSONString(createdFormDTO))); - return new ArrayList<>(); - } - return createdResultDTOList; - } - - /** - * @param modifyGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 修改组信息 - * @Date 2020/3/28 22:27 - **/ - @Transactional(rollbackFor = Exception.class) - @Override - public void modifyGroup(ModifyGroupFormDTO modifyGroupFormDTO) { - //校验是否是群主 - ResiGroupMemberDTO groupMemberDTO = resiGroupMemberService.getResiGroupMember(modifyGroupFormDTO.getGroupId(), modifyGroupFormDTO.getUserId()); - if (null == groupMemberDTO || ModuleConstant.GROUP_MEMBER.equals(groupMemberDTO.getGroupLeaderFlag())) { - logger.info(String.format("修改小组信息异常:%s",EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getMsg())); - throw new RenException(EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getCode()); - } - if (StringUtils.isBlank(modifyGroupFormDTO.getGroupHeadPhoto()) - && StringUtils.isBlank(modifyGroupFormDTO.getGroupName()) - && StringUtils.isBlank(modifyGroupFormDTO.getGroupIntroduction())) { - logger.info("小组信息未发生变更,无需更改"); - return; - } - int updatedRows = baseDao.modifyGroupInfo(modifyGroupFormDTO); - if (1 == updatedRows) { - logger.info("修改小组信息成功"); - }else{ - logger.error(String.format("修改小组信息失败,updatedRows=%s",updatedRows)); - } - } - - /** - * @param groupSummarizeFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 查看小组管理界面信息 - * @Date 2020/3/29 17:52 - **/ - @Override - public GroupSummarizeResultDTO getGroupSummarize(GroupSummarizeFormDTO groupSummarizeFormDTO) { - GroupSummarizeResultDTO groupSummarizeResultDTO = baseDao.selectGroupSummarize(groupSummarizeFormDTO); - if (null == groupSummarizeResultDTO) { - logger.warn(String.format("查看小组管理界面信息异常,userId=%s,groupId=%s",groupSummarizeFormDTO.getUserId(),groupSummarizeFormDTO.getGroupId())); - return new GroupSummarizeResultDTO(); - } - //获取组长信息 - Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(groupSummarizeFormDTO.getGroupId()); - if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { - groupSummarizeResultDTO.setLeaderName(groupLeaderUserInfo.getData().getShowName()); - } else { - logger.warn(String.format("查看小组管理界面信息错误,获取组长注册信息失败,接口返参%s",JSON.toJSONString(groupLeaderUserInfo))); - groupSummarizeResultDTO.setLeaderName(""); - } - return groupSummarizeResultDTO; - } - - /** - * @param groupId - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据组id查询组长信息 - * @Date 2020/3/30 15:07 - **/ - private Result getGroupLeaderUserInfo(String groupId) { - //群主名称需要调用feign查询 - ResiGroupEntity resiGroupEntity = baseDao.selectById(groupId); - if (null == resiGroupEntity) { - return new Result<>(); - } - ResiGroupMemberDTO groupMemberDTO = baseDao.selectGroupLeader(groupId); - if (null == groupMemberDTO) { - return new Result<>(); - } - UserResiInfoFormDTO resiUserInfoFormDTO = new UserResiInfoFormDTO(); - resiUserInfoFormDTO.setCustomerId(resiGroupEntity.getCustomerId()); - resiUserInfoFormDTO.setUserId(groupMemberDTO.getCustomerUserId()); - return epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); - } - - /** - * @param applyCreateGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 创建小组 - * @Date 2020/3/29 19:26 - **/ - @Transactional(rollbackFor = Exception.class) - @Override - public void applyCreateGroup(ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { - //1、校验是否同名 - List resiGroupEntityList = this.getResiGroupEntityList(applyCreateGroupFormDTO); - if (null != resiGroupEntityList && resiGroupEntityList.size() > 0) { - logger.info(String.format("创建小组异常:%s",EpmetErrorCode.GROUP_ALREADY_EXISTED.getMsg())); - throw new RenException(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode()); - } - - //2.内容检查 - scanGroupEditContent(applyCreateGroupFormDTO.getGroupName(), - applyCreateGroupFormDTO.getGroupIntroduction(), - applyCreateGroupFormDTO.getGroupHeadPhoto()); - - //3.1、查询当前申请人的身份,生成对应格式的消息内容 - UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), - applyCreateGroupFormDTO.getUserId(), - applyCreateGroupFormDTO.getCustomerId(), - applyCreateGroupFormDTO.getGridId()); - if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { - logger.info(String.format("创建小组异常:%s",EpmetErrorCode.CANNOT_CREATE_GROUP.getMsg())); - throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); - } - String roleName = ""; - if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ - roleName = ModuleConstant.PARTYMEMBER; - }else if(NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())){ - roleName = ModuleConstant.WAREMHEARTED_RESI; - } - - //3.2、插入一条待审核的组信息 - ResiGroupEntity resiGroupEntity = this.structureResiGroupEntity(applyCreateGroupFormDTO); - insert(resiGroupEntity); - //4.获取居民注册信息 - UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); - resiParam.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); - resiParam.setUserId(applyCreateGroupFormDTO.getUserId()); - Result resiResult = - epmetUserFeignClient.getUserResiInfoDTO(resiParam); - String userName = ""; - if(resiResult.success() && null != resiResult.getData()){ - userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) - + (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); - } - userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; - String msg = String.format(UserMessageConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO.getGroupName()); - //4.2、插入一条待审核的操作记录 - ResiGroupOperationDTO resiGroupOperation = new ResiGroupOperationDTO(); - resiGroupOperation.setResiGroupId(resiGroupEntity.getId()); - resiGroupOperation.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); - resiGroupOperation.setOperateUserId(applyCreateGroupFormDTO.getUserId()); - resiGroupOperation.setMessageText(msg); - resiGroupOperation.setReadFlag(ModuleConstant.UNREAD); - resiGroupOperationService.save(resiGroupOperation); - //5、插入一群成员信息(群主) - ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO(); - resiGroupMemberDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); - resiGroupMemberDTO.setResiGroupId(resiGroupEntity.getId()); - resiGroupMemberDTO.setGroupLeaderFlag(LeaderFlagConstant.GROUP_LEADER); - resiGroupMemberDTO.setStatus(MemberStateConstant.UNDER_AUDITTING); - resiGroupMemberDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); - resiGroupMemberService.save(resiGroupMemberDTO); - //6、插入一条入群记录(群主的) - GroupMemeberOperationDTO groupMemeberOperationDTO = new GroupMemeberOperationDTO(); - groupMemeberOperationDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); - groupMemeberOperationDTO.setGroupId(resiGroupEntity.getId()); - groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.UNDER_AUDITTING); - groupMemeberOperationDTO.setOperateUserId(applyCreateGroupFormDTO.getUserId()); - groupMemeberOperationDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); - groupMemeberOperationService.save(groupMemeberOperationDTO); - //7、群初始统计记录 - /*UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), - applyCreateGroupFormDTO.getUserId(), - applyCreateGroupFormDTO.getCustomerId(), - applyCreateGroupFormDTO.getGridId());*/ - ResiGroupStatisticalDTO resiGroupStatisticalDTO = new ResiGroupStatisticalDTO(); - resiGroupStatisticalDTO.setResiGroupId(resiGroupEntity.getId()); - resiGroupStatisticalDTO.setTotalMembers(NumConstant.ONE); - resiGroupStatisticalDTO.setTotalNormalMemebers(NumConstant.ONE); - resiGroupStatisticalDTO.setTotalTopics(NumConstant.ZERO); - resiGroupStatisticalDTO.setTotalIssues(NumConstant.ZERO); - if (NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())) { - resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ONE); - } else { - resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ZERO); - } - if (NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { - resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ONE); - } else { - resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ZERO); - } - resiGroupStatisticalService.save(resiGroupStatisticalDTO); - //发送消息:创建小组 - sendMsgResi2Gov(UserMessageConstant.CREATE_GROUP_APPLYING_MSG_TITLE,msg,applyCreateGroupFormDTO.getGridId(),applyCreateGroupFormDTO.getUserId(),applyCreateGroupFormDTO.getCustomerId()); - //更新政府端:工作-基层治理-群组管理reddot - resiGroupRedis.addWorkGrassrootsGroupRedDotValue(applyCreateGroupFormDTO.getGridId()); - } - - - private void setWorkGrassrootsGroupRedDot(String gridId) { - try{ - - }catch(Exception e){ - e.printStackTrace(); - } - } - - /** - * @param applyCreateGroupFormDTO - * @return java.util.List - * @Author yinzuomei - * @Description 查询是否存在相同名字的群 - * @Date 2020/3/30 16:01 - **/ - private List getResiGroupEntityList(ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { - List list = baseDao.checkResiGroupName(applyCreateGroupFormDTO); - return list; - } - - /** - * @param initApplyGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 加入小组界面初始化 - * @Date 2020/3/30 10:17 - **/ - @Override - public void initApplyGroup(InitApplyGroupFormDTO initApplyGroupFormDTO) { - UserResiInfoFormDTO resiUserInfoFormDTO = new UserResiInfoFormDTO(); - resiUserInfoFormDTO.setUserId(initApplyGroupFormDTO.getUserId()); - resiUserInfoFormDTO.setCustomerId(initApplyGroupFormDTO.getCustomerId()); - Result result = epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); - if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getRegMobile())) { - logger.info(String.format("加入小组界面初始化查询成功,当前用户非注册居民,epmet-user-server接口入参%s,返回%s",JSON.toJSONString(resiUserInfoFormDTO),JSON.toJSONString(result))); - throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); - } - } - - private ResiGroupEntity structureResiGroupEntity(ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { - ResiGroupEntity resiGroupEntity = new ResiGroupEntity(); - resiGroupEntity.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); - resiGroupEntity.setGridId(applyCreateGroupFormDTO.getGridId()); - resiGroupEntity.setGroupHeadPhoto(applyCreateGroupFormDTO.getGroupHeadPhoto()); - resiGroupEntity.setGroupName(applyCreateGroupFormDTO.getGroupName()); - resiGroupEntity.setGroupIntroduction(applyCreateGroupFormDTO.getGroupIntroduction()); - resiGroupEntity.setCreatedBy(applyCreateGroupFormDTO.getUserId()); - resiGroupEntity.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); - return resiGroupEntity; - } - - /** - * @param initApplyCreatedGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 校验用户是否是热心居民或者党员 - * @Date 2020/3/30 15:50 - **/ - @Override - public void initApplyCreatedGroup(InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO) { - UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(initApplyCreatedGroupFormDTO.getApp(), - initApplyCreatedGroupFormDTO.getUserId(), - initApplyCreatedGroupFormDTO.getCustomerId(), - initApplyCreatedGroupFormDTO.getGridId()); - if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { - logger.info(String.format("创建小组界面初始化查询成功,用户角色列表%s",JSON.toJSONString(userRoleDTO))); - throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); - } - } - - - /** - * @param agreeApplyGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 审核群申请-测试用后面会放到政府端 - * @Date 2020/3/31 12:44 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public Result agreeApplyGroup(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { - //1、更新组的状态 - ResiGroupDTO resiGroupDTO = this.get(agreeApplyGroupFormDTO.getGroupId()); - resiGroupDTO.setState(GroupStateConstant.GROUP_APPROVED); - this.update(resiGroupDTO); - //2、更新组的申请记录改为已通过 - ResiGroupOperationDTO resiGroupOperation = resiGroupOperationDao.selectGroupApplyRecord(agreeApplyGroupFormDTO.getGroupId()); - resiGroupOperation.setState(GroupStateConstant.GROUP_APPROVED); - resiGroupOperation.setOperateUserId(agreeApplyGroupFormDTO.getUserId()); - resiGroupOperationService.update(resiGroupOperation); - //3、将群主在群成员的状态改为已通过 - ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberDao.selectLeaderMember(agreeApplyGroupFormDTO.getGroupId()); - resiGroupMemberDTO.setStatus(MemberStateConstant.APPROVED); - resiGroupMemberService.update(resiGroupMemberDTO); - //4、更新群主的出入群记录改为已通过 - GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationDao.selectLeaderRecord(agreeApplyGroupFormDTO.getGroupId()); - groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.APPROVED); - groupMemeberOperationDTO.setOperateUserId(agreeApplyGroupFormDTO.getUserId()); - groupMemeberOperationService.update(groupMemeberOperationDTO); - //5、给用户发送消息???待定 - //6、新增小组缓存信息、组员缓存信息 - Map param = new HashMap<>(); - param.put(ModuleConstant.RESI_GROUP_ID, resiGroupDTO.getId()); - param.put(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); - List statisticalList = resiGroupStatisticalService.list(param); - if (null != statisticalList && statisticalList.size() > 0) { - ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO, statisticalList.get(0)); - resiGroupRedis.set(groupRedis); - - ResiGroupMemberInfoRedisDTO memberRedis = new ResiGroupMemberInfoRedisDTO(); - memberRedis.setUserId(resiGroupMemberDTO.getCustomerUserId()); - memberRedis.setGroupLeaderFlag(ModuleConstant.GROUP_LEADER); - memberRedis.setEnterGroupType(resiGroupMemberDTO.getEnterGroupType()); - memberRedis.setMemberStatus(resiGroupMemberDTO.getStatus()); - memberRedis.setGroupId(resiGroupMemberDTO.getResiGroupId()); - - UserResiInfoFormDTO userParam = new UserResiInfoFormDTO(); - userParam.setUserId(resiGroupMemberDTO.getCustomerUserId()); - userParam.setCustomerId(resiGroupDTO.getCustomerId()); - Result userInfo = - epmetUserFeignClient.getUserResiInfoDTO(userParam); - if(userInfo.success() && null != userInfo.getData()){ - memberRedis.setUserShowName(userInfo.getData().getShowName()); - memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto()); - memberRedis.setMemberMobile(userInfo.getData().getRegMobile()); - }else{ - logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); - } - resiGroupMemberRedis.set(memberRedis); - } else { - /* - 当没有查询到组统计信息时,需要自己封装统计信息 - @param UserRoleFormDTO::getApp - @param UserRoleFormDTO::getCustomerId - @param UserRoleFormDTO::getUserId - @param UserRoleFormDTO::getGridId - 查询用户身份信息[热心居民/党员] - epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); - */ - logger.warn(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO); - } - //发送消息 - UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); - userMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy()); - userMessageFormDTO.setTitle(UserMessageConstant.AUDITED_GROUP_APPLYING_TITLE); - userMessageFormDTO.setReadFlag(ModuleConstant.UNREAD); - userMessageFormDTO.setApp(ModuleConstant.APP_RESI); - userMessageFormDTO.setGridId(resiGroupDTO.getGridId()); - userMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); - userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName())); - if(!epmetMessageFeignClient.saveUserMessage(userMessageFormDTO).success()){ - logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName()))); - } - //发送微信订阅消息 - WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO = new WxSubscribeMessageFormDTO(); - wxSubscribeMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); - wxSubscribeMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy()); - wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI); - wxSubscribeMessageFormDTO.setGridId(resiGroupDTO.getGridId()); - wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_CREATE_GROUP_BEHAVIOR); - wxSubscribeMessageFormDTO.setMessageContent(String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName())); - wxSubscribeMessageFormDTO.setMessageTime(new Date()); - List msgList = new ArrayList<>(); - msgList.add(wxSubscribeMessageFormDTO); - epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); - //更新政府端:工作-基层治理-党员认证reddot - resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(resiGroupDTO.getGridId()); - return new Result(); - } - - /** - * @param disAgreeApplyGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 审核(拒绝)群申请-测试用后面会放到政府端 - * @Date 2020/3/31 13:22 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public Result disagreeApplyGroup(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { - //1、更新组的状态 - ResiGroupDTO resiGroupDTO = this.get(disAgreeApplyGroupFormDTO.getGroupId()); - resiGroupDTO.setState(GroupStateConstant.GROUP_REJECTED); - this.update(resiGroupDTO); - //2、更新组的申请记录改为已通过 - ResiGroupOperationDTO resiGroupOperation = resiGroupOperationDao.selectGroupApplyRecord(disAgreeApplyGroupFormDTO.getGroupId()); - resiGroupOperation.setState(GroupStateConstant.GROUP_REJECTED); - resiGroupOperation.setOperateUserId(disAgreeApplyGroupFormDTO.getUserId()); - resiGroupOperation.setOperateReason(disAgreeApplyGroupFormDTO.getRejectReason()); - resiGroupOperationService.update(resiGroupOperation); - //3、将群主在群成员的状态改为已通过 - ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberDao.selectLeaderMember(disAgreeApplyGroupFormDTO.getGroupId()); - resiGroupMemberDTO.setStatus(MemberStateConstant.REJECTED); - resiGroupMemberService.update(resiGroupMemberDTO); - //4、更新群主的出入群记录改为已通过 - GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationDao.selectLeaderRecord(disAgreeApplyGroupFormDTO.getGroupId()); - groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.REJECTED); - groupMemeberOperationDTO.setOperateUserId(disAgreeApplyGroupFormDTO.getUserId()); - groupMemeberOperationService.update(groupMemeberOperationDTO); - //5、给用户发送消息???待定 - UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); - userMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy()); - userMessageFormDTO.setTitle(UserMessageConstant.AUDITED_GROUP_APPLYING_TITLE); - userMessageFormDTO.setReadFlag(ModuleConstant.UNREAD); - userMessageFormDTO.setApp(ModuleConstant.APP_RESI); - userMessageFormDTO.setGridId(resiGroupDTO.getGridId()); - userMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); - userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.DISAGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName(),disAgreeApplyGroupFormDTO.getRejectReason())); - if(!epmetMessageFeignClient.saveUserMessage(userMessageFormDTO).success()){ - logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,String.format(UserMessageConstant.DISAGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName(),disAgreeApplyGroupFormDTO.getRejectReason()))); - } - - //发送微信订阅消息 - WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO = new WxSubscribeMessageFormDTO(); - wxSubscribeMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); - wxSubscribeMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy()); - wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI); - wxSubscribeMessageFormDTO.setGridId(resiGroupDTO.getGridId()); - wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_CREATE_GROUP_BEHAVIOR); - wxSubscribeMessageFormDTO.setMessageContent(String.format(UserMessageConstant.DISAGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName(),disAgreeApplyGroupFormDTO.getRejectReason())); - wxSubscribeMessageFormDTO.setMessageTime(new Date()); - List msgList = new ArrayList<>(); - msgList.add(wxSubscribeMessageFormDTO); - epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); - - //更新政府端:工作-基层治理-党员认证reddot - resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(resiGroupDTO.getGridId()); - return new Result(); - } - - /** - * @param app - * @param userId - * @param customerId - * @param gridId - * @return boolean - * @Author yinzuomei - * @Description 用户拥有党员或者热心居民标签返回true, 没有权限返回false - * @Date 2020/3/30 16:33 - **/ - @Override - public UserRoleDTO checkPartyMemberOrWarmHeated(String app, String userId, String customerId, String gridId) { - UserRoleDTO userRoleDTO = new UserRoleDTO(); - UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); - userRoleFormDTO.setApp(app); - userRoleFormDTO.setCustomerId(customerId); - userRoleFormDTO.setUserId(userId); - userRoleFormDTO.setGridId(gridId); - logger.info(String.format("用户同意邀请进组,获取当前用户所有角色入参:%s", JSON.toJSONString(userRoleFormDTO))); - Result> userRoleListResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); - if (!userRoleListResult.success()) { - logger.error("获取用户角色feign调用失败" + userRoleListResult.getMsg()); - return userRoleDTO; - } - List userRoleList = userRoleListResult.getData(); - if (null == userRoleList || userRoleList.size() == 0) { - return userRoleDTO; - } - for (UserRoleResultDTO userRoleResultDTO : userRoleList) { - 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); - } - } - logger.info(String.format("用户同意邀请进组,获取当前用户所有角色返参:%s",JSON.toJSONString(userRoleDTO))); - return userRoleDTO; - } - - @Override - public Result> audited(GroupAuditedFromDTO formDTO) { - Result> result = new Result<>(); - //查询条件 - int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); - formDTO.setPageNo(pageIndex); - //获取审核列表 - List resultList = baseDao.selectAuditedGroupList(formDTO); - - return result.ok(resultList); - } - - @Override - public Result> getGroupsInGrid(GroupAuditedFromDTO formDTO) { - List resultList = new ArrayList<>(); - //查询条件 - int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); - formDTO.setPageNo(pageIndex); - List list = baseDao.selectGroupsByGridId(formDTO); - list.forEach(group -> { - GroupsInGridResultDTO groupsInGridResultDTO = new GroupsInGridResultDTO(); - if (MemberStateConstant.REJECTED.equals(group.getState())) { - groupsInGridResultDTO.setGroupId(group.getId()); - groupsInGridResultDTO.setGroupName(group.getGroupName()); - groupsInGridResultDTO.setGroupHeadPhoto(group.getGroupHeadPhoto()); - groupsInGridResultDTO.setStatus(group.getState()); - groupsInGridResultDTO.setTotalMember(NumConstant.ZERO); - groupsInGridResultDTO.setTotalPartyMember(NumConstant.ZERO); - resultList.add(groupsInGridResultDTO); - } else if(MemberStateConstant.APPROVED.equals(group.getState())) { - //缓存中获取组信息 - ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(group.getId()); - groupsInGridResultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId()); - groupsInGridResultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName()); - groupsInGridResultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto()); - groupsInGridResultDTO.setStatus(resiGroupInfoRedisDTO.getGroupState()); - groupsInGridResultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers()); - groupsInGridResultDTO.setTotalPartyMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalPartyMembers()); - resultList.add(groupsInGridResultDTO); - } - - - }); - - return new Result>().ok(resultList); - } - - @Override - public Result getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) { - GovGroupSummarizeResultDTO resultDTO = new GovGroupSummarizeResultDTO(); - //从缓存中获取组相关信息 - ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(formDTO.getGroupId()); - resultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId()); - resultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto()); - resultDTO.setGroupIntroduction(resiGroupInfoRedisDTO.getGroupIntroduction()); - resultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName()); - resultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers()); - resultDTO.setTotalTopics(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalTopics()); - - //获取组长信息 - Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(formDTO.getGroupId()); - if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { - resultDTO.setLeaderName(groupLeaderUserInfo.getData().getShowName()); - } else { - logger.info("组长注册信息查询失败" + groupLeaderUserInfo.getMsg()); - } - - return new Result().ok(resultDTO); - } - - /** - * @return ResiGroupInfoRedisDTO - * @Description 将ResiGroupDTO与ResiGroupStatisticalDTO转换成ResiGroupInfoRedisDTO - * @Param ResiGroupDTO - * @Param ResiGroupStatisticalDTO - * @Author wangc - * @Date 2020.04.13 16:36 - **/ - private ResiGroupInfoRedisDTO transferToGroupInfoRedis(ResiGroupDTO groupDTO, ResiGroupStatisticalDTO statisticalDTO) { - - ResiGroupStatisticalInfoRedisDTO statisticalObjct = - ConvertUtils.sourceToTarget(statisticalDTO, ResiGroupStatisticalInfoRedisDTO.class); - statisticalObjct.setTotalEarnestMembers(statisticalDTO.getTotalEarnestMemebers()); - statisticalObjct.setTotalNormalMembers(statisticalDTO.getTotalNormalMemebers()); - ResiGroupInfoRedisDTO targetObject = - ConvertUtils.sourceToTarget(groupDTO, ResiGroupInfoRedisDTO.class); - targetObject.setGroupId(groupDTO.getId()); - targetObject.setGroupState(groupDTO.getState()); - SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); - if (null != groupDTO.getLatestTopicPublishDate()) { - targetObject.setLatestTopicPublishDate(format.format(groupDTO.getLatestTopicPublishDate())); - } - targetObject.setGroupStatisticalInfo(statisticalObjct); - return targetObject; - } - - /** - * @Description 查询待审核的小组 (不从缓存中取,这时还没有成功建组,缓存中没有组数据) - * @Param ApplyingGroupsFormDTO - * @return Result> - * @Author wangc - * @Date 2020.04.18 10:18 - **/ - @Override - public Result> getApplyingGroups(ApplyingGroupsFormDTO params){ - if(null == params.getPageNo()){ - throw new RenException(ModuleConstant.PAGE_INDEX_NOT_NULL); - } - params.setPageNo((params.getPageNo() - NumConstant.ONE) * params.getPageSize()); - return new Result>().ok(baseDao.getApplyingGroupsByCustIdAndGridId(params)); - } - - /** - * @Description 建组申请详情 已审核(更新已读未读标识)/未审核 - * @Param AgreeApplyGroupFormDTO - * @return Result - * @Author wangc - * @Date 2020.04.19 23:32 - **/ - @Override - public Result getApplyingGroupDetail(CommonGroupIdFromDTO groupId){ - //1.查询小组信息 - //注意,这里查询出的组申请详情中,无论是已审核还是未审核,都是将该组信息关联到初始化组时状态为[待审核、审核通过、拒绝]其中之一的组操作记录上,并读取审核的已读未读信息,上述三种状态在一个组的所有操作记录当中只可能存在一种,与之后的屏蔽、取消屏蔽、关闭无关,如果查出多条说明建组的逻辑有问题 - ApplyingGroupDetailResultDTO detail = baseDao.getApplyingGroupDetailByGroupId(groupId.getGroupId()); - //2.查询用户信息(TODO 先走数据库,之后改成走缓存) - List userId = new ArrayList<>(); - userId.add(detail.getLeaderId()); - Result> userInfoResult = - epmetUserFeignClient.getUserResiInfoList(new UserResiInfoListFormDTO(userId)); - if(userInfoResult.success() && null != userInfoResult.getData() && userInfoResult.getData().size() >= 1){ - //姓氏+先生/女士 注:在数据库中拼接成[街道+显示名称]默认格式,故要进行截取 - //detail.setGroupLeaderName(userInfoResult.getData().get(0).getShowName().split("-")[NumConstant.ONE]); - //姓氏+名称 - detail.setGroupLeaderName(userInfoResult.getData().get(0).getSurname() + userInfoResult.getData().get(0).getName()); - detail.setStreet(userInfoResult.getData().get(0).getStreet()); - StringBuffer buffer = new StringBuffer(detail.getStreet()); - buffer.append(StringUtils.isBlank(buffer) ? "" : "-"); - detail.setGroupLeaderName(buffer.append(detail.getGroupLeaderName()).toString()); - }else{ - logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); - } - //3.未读改成已读 - if(StringUtils.equals(detail.getReadFlag(),ModuleConstant.UNREAD)){ - ResiGroupOperationEntity operationEntity = new ResiGroupOperationEntity(); - operationEntity.setId(detail.getOperationId()); - operationEntity.setReadFlag(ModuleConstant.READ); - operationEntity.setUpdatedBy(groupId.getUserId()); - resiGroupOperationDao.updateById(operationEntity); - } - //4.将组长用户Id隐藏 - detail.setLeaderId(null); - detail.setOperationId(null); - - return new Result().ok(ConvertUtils.sourceToTarget(detail, ApplyingGroupDetailResult2DTO.class)); - } - - @Override - public List queryGroupProcessingCount(List gridIdList) { - List list=new ArrayList<>(); - for(String gridId:gridIdList){ - GroupProcessingCountResultDTO resultDTO=new GroupProcessingCountResultDTO(); - resultDTO.setGridId(gridId); - Integer auditingCreateGroupCount=resiGroupRedis.getWorkGrassrootsGroupRedDotValue(gridId); - Integer auditingGroupEditRecordCount=groupEditSubmitRecordDao.selectCountAuditingRec(gridId); - Integer auditingCount=auditingCreateGroupCount+auditingGroupEditRecordCount; - if (null == auditingCount) { - resultDTO.setCount(0); - } else { - resultDTO.setCount(auditingCount); - } - list.add(resultDTO); - } - return list; - } - - - /** - * @Description 查询一个网格下面所有组Id - * @param gridId - * @return List - * @author wangc - * @date 2020.05.14 10:54 - **/ - @Override - public List getGroupIdByGridId(String gridId) { - if(StringUtils.isBlank(gridId)) return null; - return baseDao.getGroupIdByGridId(gridId); - } - - /** - * @Description 返回 Map> - * @param gridIdList - * @return Map> - * @author wangc - * @date 2020.05.22 09:27 - **/ - @Override - public Map> getGroupIdsByGridIdList(List gridIdList) { - if(null == gridIdList || gridIdList.size() < NumConstant.ONE) - return null; - Map> result = new HashMap<>(); - List groups = new ArrayList<>(); - Map> groupMap - = groups.stream().collect(Collectors.groupingBy(ResiGroupDTO::getGridId)); - groupMap.forEach((k,v)->{ - Set groupIds = - v.stream().map(ResiGroupDTO::getId).collect(Collectors.toSet()); - result.put(k,groupIds); - }); - - return result; - } - - /** - * @Description 校验用户是否加入小组 - * @param gridId - * @author zxc - */ - @Override - public CheckJoinTeamResultDTO checkjointeam(GridIdFormDTO gridId) { - CheckJoinTeamResultDTO checkJoinTeamResultDTO = new CheckJoinTeamResultDTO(); - Integer joinTeamCounts = baseDao.checkjointeam(gridId); - if (joinTeamCounts==NumConstant.ZERO){//未加入任何小组(当前网格下) - checkJoinTeamResultDTO.setVoteAuthorization(false); - }else { - checkJoinTeamResultDTO.setVoteAuthorization(true); - } - return checkJoinTeamResultDTO; - } - - /** - * @Description 获取应表决数 - * @param formDTO - * @author zxc - */ - @Override - public ShouldVoteCountResultDTO shouldVoteCount(ShouldVoteCountFormDTO formDTO) { - //网格下所有加过组的人数 - Integer shouldVoteCount = baseDao.shouldVoteCount(formDTO).getShouldVoteCount(); - Integer outGroupCount = baseDao.getOutGroupCount(formDTO); - ShouldVoteCountResultDTO result = new ShouldVoteCountResultDTO(); - result.setShouldVoteCount(shouldVoteCount-outGroupCount); - return result; - } - - @Override - public List recommendedList(RecommendedListFormDTO formDTO) { - - //显示当前网格内所有当前用户还未加入的组,以组的人数由高到低排序;如果人数相同,以话题数由多到少排序 - List recommendGroupList = baseDao.selectListRecommendList(formDTO); - recommendGroupList.forEach(dto -> { - Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(dto.getGroupId()); - if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { - dto.setLeaderName(groupLeaderUserInfo.getData().getShowName()); - } else { - logger.warn("组长注册信息查询失败" + groupLeaderUserInfo.getMsg()); - } - }); - return recommendGroupList; - } - - /** - * @Description 给加入此网格的网格长发送消息 - * @param msg - * @param gridId - * @param userId - * @author wangc - * @date 2020.04.29 22:49 - **/ - private void sendMsgResi2Gov(String title,String msg,String gridId,String userId,String customerId){ - //1.查询加入当前网格下的人员 customer_staff_grid - CommonGridIdFormDTO commonGridIdFormDTO = new CommonGridIdFormDTO(); - commonGridIdFormDTO.setGridId(gridId); - commonGridIdFormDTO.setUserId(userId); - Result> gridstaffs = - govOrgFeignClient.getGridStaffs(commonGridIdFormDTO); - //2.查询这些人是否有管理员身份且未被禁用 staff_role customer_staff - if(gridstaffs.success() && null != gridstaffs.getData() && gridstaffs.getData().size() > 0){ - RolesUsersListFormDTO rolesUsersListFormDTO = new RolesUsersListFormDTO(); - rolesUsersListFormDTO.setCustomerId(customerId); - List roleKeys = new ArrayList(); - roleKeys.add(ModuleConstant.STAFF_ROLE_GRID_MANAGER); - rolesUsersListFormDTO.setRoleKeys(roleKeys); - rolesUsersListFormDTO.setUserIds(gridstaffs.getData()); - Result> staffRoles = - epmetUserFeignClient.specificRolesStaffs(rolesUsersListFormDTO); - //3.发送消息 - if(staffRoles.success() && null != staffRoles.getData() && staffRoles.getData().size() > 0){ - List msgList = new ArrayList<>(); - List subscribeList = new ArrayList<>(); - for(String to : staffRoles.getData()){ - //站内信 - UserMessageFormDTO msgObj = new UserMessageFormDTO(); - msgObj.setApp(ModuleConstant.APP_GOV); - msgObj.setCustomerId(customerId); - msgObj.setGridId(gridId); - msgObj.setMessageContent(msg); - msgObj.setReadFlag(ReadFlagConstant.UN_READ); - msgObj.setTitle(title); - msgObj.setUserId(to); - msgList.add(msgObj); - //微信订阅 - WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO(); - subscribeDTO.setClientType(ModuleConstant.APP_GOV); - subscribeDTO.setGridId(gridId); - subscribeDTO.setCustomerId(customerId); - subscribeDTO.setUserId(to); - subscribeDTO.setBehaviorType(UserMessageConstant.WX_CREATE_GROUP_BEHAVIOR); - subscribeDTO.setMessageContent(msg); - subscribeDTO.setMessageTime(new Date()); - subscribeList.add(subscribeDTO); - } - if (subscribeList.size() > NumConstant.ZERO){ - epmetMessageOpenFeignClient.sendWxSubscribeMessage(subscribeList); - } - Result result = epmetMessageFeignClient.saveUserMessageList(msgList); - if(result.success()){ - return; - } - } - } - logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,msg)); - - } - - @Override - public GroupDetailResultDTO getGroupDetail(String groupId) { - GroupDetailResultDTO groupDetail = new GroupDetailResultDTO(); - - // 1.拼装组基本信息 - GroupEditSubmitRecordEntity ler = groupEditSubmitRecordDao.getLatestEditSubmitRecord(groupId); - - if (ler != null) { - groupDetail.setAuditStatus(ler.getAuditStatus()); - groupDetail.setRemark(ler.getRemark()); - } - - if (ler != null && GroupAuditStatusConstant.UNDER_AUDITING.equals(ler.getAuditStatus())) { - // 审核中,显示待审核内容 - groupDetail.setGroupHeadPhoto(ler.getGroupHeadPhoto()); - groupDetail.setGroupName(ler.getGroupName()); - groupDetail.setGroupIntroduction(ler.getGroupIntroduction()); - } else { - // 不在审核中,直接显示组信息 - ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(groupId); - if (resiGroupEntity == null) { - return null; - } - - groupDetail.setGroupHeadPhoto(resiGroupEntity.getGroupHeadPhoto()); - groupDetail.setGroupName(resiGroupEntity.getGroupName()); - groupDetail.setGroupIntroduction(resiGroupEntity.getGroupIntroduction()); - } - - // 2.编辑次数及其限制 - groupDetail.setEditNumLimit(GroupLimitConstant.EDIT_NUM_LIMIT_MONTH); - Date now = new Date(); - int usedEditNum = groupEditSubmitRecordDao.countEditNum(groupId, DateUtils.getMonthStart(now), DateUtils.getMonthEnd(now)); - groupDetail.setAvaliableEditNum(GroupLimitConstant.EDIT_NUM_LIMIT_MONTH - usedEditNum); - - // 审核状态 - // 是否可编辑 - boolean editable = true; - - if (GroupLimitConstant.EDIT_NUM_LIMIT_MONTH <= usedEditNum) { - // 达到最大编辑次数了 - editable = false; - } - - if (ler != null && GroupAuditStatusConstant.UNDER_AUDITING.equals(ler.getAuditStatus())) { - // 提交了,还没审核完 - editable = false; - } - - groupDetail.setEditable(editable); - return groupDetail; - } - - @Override - public void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId) { - // 1.判断小组是否存在,判断是否已经在"待审核"状态 - ResiGroupEntity group = resiGroupDao.selectById(groupId); - if (group == null) { - throw new RenException(EpmetErrorCode.GROUP_NOT_EXISTS.getCode(), EpmetErrorCode.GROUP_NOT_EXISTS.getMsg()); - } - - // 判断是否是组长 - ResiGroupMemberDTO groupLeader = resiGroupMemberDao.selectLeaderMember(groupId); - if (groupLeader == null || !groupLeader.getCustomerUserId().equals(editUserId)) { - String msg = "只有该组的组长才可以编辑组信息"; - throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), msg, msg, RenException.MessageMode.CODE_INTERNAL_EXTERNAL); - } - - // 2.判断是否可以提交编辑 - GroupEditSubmitRecordEntity lre = groupEditSubmitRecordDao.getLatestEditSubmitRecord(groupId); - if (lre != null && GroupAuditStatusConstant.UNDER_AUDITING.equals(lre.getAuditStatus())) { - // 在待审核状态,不允许再次提交编辑 - throw new RenException(EpmetErrorCode.GROUP_IN_AUDITING.getCode(), EpmetErrorCode.GROUP_IN_AUDITING.getMsg()); - } - - if (resiGroupDao.countExistsGroupNameBeforeEdit(groupId, group.getGridId(), groupName) > 0) { - // 已存在组名,拒绝提交 - throw new RenException(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode(), EpmetErrorCode.GROUP_ALREADY_EXISTED.getMsg()); - } - - Date now = new Date(); - int usedEditNum = groupEditSubmitRecordDao.countEditNum(groupId, DateUtils.getMonthStart(now), DateUtils.getMonthEnd(now)); - if (GroupLimitConstant.EDIT_NUM_LIMIT_MONTH <= usedEditNum) { - // 达到最大编辑次数了 - throw new RenException(EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getCode(), EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getMsg()); - } - - // 3.内容检查 - scanGroupEditContent(groupName, groupIntroduction, groupHeadPhoto); - - String app = loginUserUtil.getLoginUserApp(); - String userId = loginUserUtil.getLoginUserId(); - String messageText = generateGroupEditMessageText(app, userId, group.getCustomerId(), group.getGridId(), groupName); - - // 4.创建编辑提交记录 - GroupEditSubmitRecordEntity editRecord = new GroupEditSubmitRecordEntity(); - editRecord.setAuditStatus(GroupAuditStatusConstant.UNDER_AUDITING); - editRecord.setCustomerId(group.getCustomerId()); - editRecord.setGridId(group.getGridId()); - editRecord.setGroupHeadPhoto(groupHeadPhoto); - editRecord.setGroupIntroduction(groupIntroduction); - editRecord.setGroupId(groupId); - editRecord.setGroupName(groupName); - editRecord.setReadFlag(ReadFlagConstant.UN_READ); - editRecord.setMessageText(messageText); - - if (groupEditSubmitRecordDao.insert(editRecord) == 0) { - throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), EpmetErrorCode.GROUP_EDIT_ERROR.getMsg()); - } - - resiGroupRedis.addWorkGrassrootsGroupRedDotValue(group.getGridId()); - - } - - /** - * 生成组信息编辑简介文本:xxx申请编辑组信息,请审核 - * @param app - * @param userId - * @param customerId - * @param gridId - * @param groupName - * @return - */ - private String generateGroupEditMessageText(String app, String userId, String customerId, String gridId, String groupName) { - List resiRoles = getResiRoles(app, customerId, userId, gridId); - boolean isPartymember = false; - boolean isWarmhearted = false; - for (UserRoleResultDTO role : resiRoles) { - if (EpmetRoleKeyConstant.WARMHEARTED.equals(role.getRoleKey())) { - isWarmhearted = true; - } - if (EpmetRoleKeyConstant.PARTYMEMBER.equals(role.getRoleKey())) { - isPartymember = true; - } - } - if (!isWarmhearted && isPartymember) { - throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode(), "只有党员和热心居民才能创建和编辑小组"); - } - String roleName = ""; - if (isPartymember) { - roleName = ModuleConstant.PARTYMEMBER; - } else if (isWarmhearted) { - roleName = ModuleConstant.WAREMHEARTED_RESI; - } - - //3.获取居民注册信息 - UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); - resiParam.setCustomerId(customerId); - resiParam.setUserId(userId); - Result resiResult = - epmetUserFeignClient.getUserResiInfoDTO(resiParam); - String userName = ""; - if (resiResult.success() && null != resiResult.getData()) { - userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) - + (StringUtils.isBlank(resiResult.getData().getName()) ? "" : resiResult.getData().getName()); - } - userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; - return String.format(UserMessageConstant.EDIT_OF_GROUP_MESSAGE_TEMPLATE, roleName, userName, groupName); - } - - /** - * 查询居民的角色列表 - * @param app - * @param customerId - * @param userId - * @param gridId - * @return - */ - private List getResiRoles(String app, String customerId, String userId, String gridId) { - UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); - userRoleFormDTO.setApp(app); - userRoleFormDTO.setCustomerId(customerId); - userRoleFormDTO.setUserId(userId); - userRoleFormDTO.setGridId(gridId); - Result> rolesResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); - - if (! rolesResult.success()) { - logger.error("修改组信息:查询居民角色失败,详情:{}", rolesResult.getInternalMsg()); - throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), "查询居民角色失败"); - } else { - List roles = rolesResult.getData(); - if (CollectionUtils.isEmpty(roles)) { - roles = new ArrayList<>(); - } - return roles; - } - } - - /** - * 内容检查 - * @param groupName - * @param groupIntroduction - * @param groupHeadPhoto - */ - private void scanGroupEditContent(String groupName, String groupIntroduction, String groupHeadPhoto) { - // 文本内容审核 - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - TextTaskDTO taskDTO = new TextTaskDTO(); - String content = groupName.concat("-").concat(groupIntroduction); - taskDTO.setContent(content); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - textScanParamDTO.getTasks().add(taskDTO); - Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()) { - logger.error("调用内容审核服务审核文本发生错误:{}", textSyncScanResult.getInternalMsg()); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); - } - } - - // 图片内容审核 - ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); - ImgTaskDTO task = new ImgTaskDTO(); - task.setDataId(UUID.randomUUID().toString().replace("-", "")); - task.setUrl(groupHeadPhoto); - imgScanParamDTO.getTasks().add(task); - - Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); - if (!imgScanResult.success()){ - logger.error("调用内容审核服务审核图片发生错误:{}", textSyncScanResult.getInternalMsg()); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); - } - } - } - - /** - * @Description 工作端 查询组变更待审核列表 - * @param param - * @return - * @author wangc - * @date 2020.11.03 10:19 - */ - @Override - public List getEditAuditingList(CommonGridAndPageFormDTO param) { - return Optional.ofNullable(PageHelper.startPage(null == param.getPageNo() ? NumConstant.ONE : param.getPageNo() , null == param.getPageSize() ? NumConstant.TWELVE : param.getPageSize()) - .doSelectPage(() -> { - groupEditSubmitRecordDao.selectGroupEditApplyList(param.getGridId());}).getResult()).orElse(new LinkedList<>()) - .stream().map(o -> { return (ApplyingGroupResultDTO)o; }).collect(Collectors.toList()); - } - - /** - * @Description 查询小组修改信息的详情内容 不加事务! - * @param param - * @return com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO - * @author wangc - * @date 2020.11.03 14:10 - */ - @Override - public GroupEditionDetailResultDTO getEditAuditingDetail(GovGroupSummarizeFromDTO param) { - GroupEditSubmitRecordEntity edit = groupEditSubmitRecordDao.selectEditDetail(param.getGroupId(),null); - if(null == edit) { - logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.getEditAuditingDetail,未找到小组变更信息记录,传参:{}",JSON.toJSONString(param)); - return null;} - //取消未读状态 - GroupEditSubmitRecordEntity _update = new GroupEditSubmitRecordEntity(); - _update.setId(edit.getId());_update.setReadFlag(ModuleConstant.READ); - groupEditSubmitRecordDao.updateById(_update); - GroupEditionDetailResultDTO result = ConvertUtils.sourceToTarget(edit, GroupEditionDetailResultDTO.class); - result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy())); - return result; - } - - /** - * @Description 工作人员提交审核 - * @param param - * @return void - * @author wangc - * @date 2020.11.03 16:02 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void auditEdit(GroupEditionAuditFormDTO param) { - if(StringUtils.equals(param.getAuditResult(),ModuleConstant.AUDITING_OPERATION_REJECT) && StringUtils.isBlank(param.getRemark())){ - throw new RenException("拒绝理由不能为空"); - } - GroupEditSubmitRecordEntity edit = groupEditSubmitRecordDao.selectEditDetail(param.getGroupId(),null); - if(null == edit){ - logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.auditEdit,找不到待审核的组更新记录,传参:{}",JSON.toJSONString(param)); - throw new RenException("找不到待审核的组更新记录"); - } - - int affectedRows = groupEditSubmitRecordDao.updateAuditResult(param.getGroupId(),param.getStaffId(),param.getAuditResult(),param.getRemark()); - if(affectedRows <= NumConstant.ZERO){ - logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.auditEdit,更新组编辑记录时受影响行数小于1,传参:{}",JSON.toJSONString(param)); - throw new RenException("更新组编辑记录时受影响行数小于1"); - } - if(!StringUtils.equals(param.getAuditResult(),ModuleConstant.AUDITING_OPERATION_REJECT)){ - //同意 - ResiGroupEntity _update = ConvertUtils.sourceToTarget(edit,ResiGroupEntity.class); - _update.setId(param.getGroupId()); - baseDao.updateById(_update); - } - resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(edit.getGridId()); - resiGroupRedis.delGroup(param.getGroupId()); - } - -} From d95d31f073e3cde9f6d4cc5e6203d43a7cf37748 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 20 Nov 2020 14:51:06 +0800 Subject: [PATCH 36/36] =?UTF-8?q?=E6=81=A2=E5=A4=8Dx=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiGroupServiceImpl.java | 1358 +++++++++++++++++ 1 file changed, 1358 insertions(+) create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java 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 new file mode 100644 index 0000000000..e5507ab766 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -0,0 +1,1358 @@ +/** + * 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.alibaba.fastjson.JSON; +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.AppClientConstant; +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.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.*; +import com.epmet.constant.ReadFlagConstant; +import com.epmet.dto.form.*; +import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.dto.result.UserRoleResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.modules.constant.UserMessageConstant; +import com.epmet.modules.feign.EpmetMessageFeignClient; +import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.feign.GovOrgFeignClient; +import com.epmet.modules.group.dao.GroupEditSubmitRecordDao; +import com.epmet.modules.group.dao.ResiGroupDao; +import com.epmet.modules.group.dao.ResiGroupOperationDao; +import com.epmet.modules.group.entity.GroupEditSubmitRecordEntity; +import com.epmet.modules.group.entity.ResiGroupEntity; +import com.epmet.modules.group.entity.ResiGroupOperationEntity; +import com.epmet.modules.group.redis.ResiGroupRedis; +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.dao.GroupMemeberOperationDao; +import com.epmet.modules.member.dao.ResiGroupMemberDao; +import com.epmet.modules.member.redis.ResiGroupMemberRedis; +import com.epmet.modules.member.service.GroupMemeberOperationService; +import com.epmet.modules.member.service.ResiGroupMemberService; +import com.epmet.modules.utils.ModuleConstant; +import com.epmet.resi.group.constant.*; +import com.epmet.resi.group.dto.UserRoleDTO; +import com.epmet.resi.group.dto.group.*; +import com.epmet.resi.group.dto.group.form.GridIdFormDTO; +import com.epmet.resi.group.dto.group.form.ShouldVoteCountFormDTO; +import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.result.*; +import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; +import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; +import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; +import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 群组信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-28 + */ +@Service +public class ResiGroupServiceImpl extends BaseServiceImpl implements ResiGroupService { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private ResiGroupMemberService resiGroupMemberService; + + @Autowired + private ResiGroupOperationService resiGroupOperationService; + + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + @Autowired + private GroupMemeberOperationService groupMemeberOperationService; + + @Autowired + private ResiGroupStatisticalService resiGroupStatisticalService; + + @Autowired + private ResiGroupOperationDao resiGroupOperationDao; + + @Autowired + private ResiGroupMemberDao resiGroupMemberDao; + + @Autowired + private GroupMemeberOperationDao groupMemeberOperationDao; + + @Autowired + private ResiGroupRedis resiGroupRedis; + + @Autowired + private ResiGroupMemberRedis resiGroupMemberRedis; + + @Autowired + private GovOrgFeignClient govOrgFeignClient; + + @Autowired + private EpmetMessageFeignClient epmetMessageFeignClient; + + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + @Autowired + private ResiGroupDao resiGroupDao; + + @Autowired + private GroupEditSubmitRecordDao groupEditSubmitRecordDao; + + @Autowired + private LoginUserUtil loginUserUtil; + + @Autowired + private CpUserDetailRedis sysUserInfoRedis; + + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ResiGroupDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ResiGroupDTO.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 ResiGroupDTO get(String id) { + ResiGroupEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ResiGroupDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ResiGroupDTO dto) { + ResiGroupEntity entity = ConvertUtils.sourceToTarget(dto, ResiGroupEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ResiGroupDTO dto) { + ResiGroupEntity entity = ConvertUtils.sourceToTarget(dto, ResiGroupEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param myGroupFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 我的小组查询(包含我创建的小组+我加入的小组),以各组的最新话题时间有近到远排序) + * @Date 2020/3/28 20:37 + **/ + @Override + public List getMyGroup(MyGroupFormDTO myGroupFormDTO) { + int pageIndex = (myGroupFormDTO.getPageNo() - NumConstant.ONE) * myGroupFormDTO.getPageSize(); + myGroupFormDTO.setPageNo(pageIndex); + List myGroupList = baseDao.selectListMyGroup(myGroupFormDTO); + if (null == myGroupList || myGroupList.size() < 1) { + logger.info(String.format("我的小组查询为空,selectListMyGroup入参%s", JSON.toJSONString(myGroupFormDTO))); + return new ArrayList<>(); + } + return myGroupList; + } + + /** + * @param recommendGroupFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 推荐组列表查询 + * @Date 2020/3/28 19:53 + **/ + @Override + public List getRecommendGroup(RecommendGroupFormDTO recommendGroupFormDTO) { + int pageIndex = (recommendGroupFormDTO.getPageNo() - NumConstant.ONE) * recommendGroupFormDTO.getPageSize(); + recommendGroupFormDTO.setPageNo(pageIndex); + //显示当前网格内所有当前用户还未加入的组,以组的人数由高到低排序;如果人数相同,以最新话题的时间有近到远排序 + List recommendGroupList = baseDao.selectListRecommendGroup(recommendGroupFormDTO); + if (null == recommendGroupList || recommendGroupList.size() == 0) { + logger.info(String.format("推荐小组查询为空,selectListRecommendGroup入参%s", JSON.toJSONString(recommendGroupFormDTO))); + return new ArrayList<>(); + } + for (RecommendGroupResultDTO recommendGroupResultDTO : recommendGroupList) { + GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationService.selectLatestRecord(recommendGroupResultDTO.getGroupId(), + recommendGroupFormDTO.getUserId()); + if (null != groupMemeberOperationDTO) { + recommendGroupResultDTO.setStatus(groupMemeberOperationDTO.getOperateStatus()); + } + } + return recommendGroupList; + } + + /** + * @param createdFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 我创建的小组 + * @Date 2020/3/28 22:01 + **/ + @Override + public List getCreated(CreatedFormDTO createdFormDTO) { + int pageIndex = (createdFormDTO.getPageNo() - NumConstant.ONE) * createdFormDTO.getPageSize(); + createdFormDTO.setPageNo(pageIndex); + List createdResultDTOList = baseDao.selectListMyCreated(createdFormDTO); + if (null == createdResultDTOList || createdResultDTOList.size() == 0) { + logger.info(String.format("我创建的小组查询为空,selectListMyCreated入参%s", JSON.toJSONString(createdFormDTO))); + return new ArrayList<>(); + } + return createdResultDTOList; + } + + /** + * @param modifyGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 修改组信息 + * @Date 2020/3/28 22:27 + **/ + @Transactional(rollbackFor = Exception.class) + @Override + public void modifyGroup(ModifyGroupFormDTO modifyGroupFormDTO) { + //校验是否是群主 + ResiGroupMemberDTO groupMemberDTO = resiGroupMemberService.getResiGroupMember(modifyGroupFormDTO.getGroupId(), modifyGroupFormDTO.getUserId()); + if (null == groupMemberDTO || ModuleConstant.GROUP_MEMBER.equals(groupMemberDTO.getGroupLeaderFlag())) { + logger.info(String.format("修改小组信息异常:%s",EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getMsg())); + throw new RenException(EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getCode()); + } + if (StringUtils.isBlank(modifyGroupFormDTO.getGroupHeadPhoto()) + && StringUtils.isBlank(modifyGroupFormDTO.getGroupName()) + && StringUtils.isBlank(modifyGroupFormDTO.getGroupIntroduction())) { + logger.info("小组信息未发生变更,无需更改"); + return; + } + int updatedRows = baseDao.modifyGroupInfo(modifyGroupFormDTO); + if (1 == updatedRows) { + logger.info("修改小组信息成功"); + }else{ + logger.error(String.format("修改小组信息失败,updatedRows=%s",updatedRows)); + } + } + + /** + * @param groupSummarizeFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查看小组管理界面信息 + * @Date 2020/3/29 17:52 + **/ + @Override + public GroupSummarizeResultDTO getGroupSummarize(GroupSummarizeFormDTO groupSummarizeFormDTO) { + GroupSummarizeResultDTO groupSummarizeResultDTO = baseDao.selectGroupSummarize(groupSummarizeFormDTO); + if (null == groupSummarizeResultDTO) { + logger.warn(String.format("查看小组管理界面信息异常,userId=%s,groupId=%s",groupSummarizeFormDTO.getUserId(),groupSummarizeFormDTO.getGroupId())); + return new GroupSummarizeResultDTO(); + } + //获取组长信息 + Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(groupSummarizeFormDTO.getGroupId()); + if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { + groupSummarizeResultDTO.setLeaderName(groupLeaderUserInfo.getData().getShowName()); + } else { + logger.warn(String.format("查看小组管理界面信息错误,获取组长注册信息失败,接口返参%s",JSON.toJSONString(groupLeaderUserInfo))); + groupSummarizeResultDTO.setLeaderName(""); + } + return groupSummarizeResultDTO; + } + + /** + * @param groupId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据组id查询组长信息 + * @Date 2020/3/30 15:07 + **/ + private Result getGroupLeaderUserInfo(String groupId) { + //群主名称需要调用feign查询 + ResiGroupEntity resiGroupEntity = baseDao.selectById(groupId); + if (null == resiGroupEntity) { + return new Result<>(); + } + ResiGroupMemberDTO groupMemberDTO = baseDao.selectGroupLeader(groupId); + if (null == groupMemberDTO) { + return new Result<>(); + } + UserResiInfoFormDTO resiUserInfoFormDTO = new UserResiInfoFormDTO(); + resiUserInfoFormDTO.setCustomerId(resiGroupEntity.getCustomerId()); + resiUserInfoFormDTO.setUserId(groupMemberDTO.getCustomerUserId()); + return epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); + } + + /** + * @param applyCreateGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 创建小组 + * @Date 2020/3/29 19:26 + **/ + @Transactional(rollbackFor = Exception.class) + @Override + public void applyCreateGroup(ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { + //1、校验是否同名 + List resiGroupEntityList = this.getResiGroupEntityList(applyCreateGroupFormDTO); + if (null != resiGroupEntityList && resiGroupEntityList.size() > 0) { + logger.info(String.format("创建小组异常:%s",EpmetErrorCode.GROUP_ALREADY_EXISTED.getMsg())); + throw new RenException(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode()); + } + + //2.内容检查 + scanGroupEditContent(applyCreateGroupFormDTO.getGroupName(), + applyCreateGroupFormDTO.getGroupIntroduction(), + applyCreateGroupFormDTO.getGroupHeadPhoto()); + + //3.1、查询当前申请人的身份,生成对应格式的消息内容 + UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), + applyCreateGroupFormDTO.getUserId(), + applyCreateGroupFormDTO.getCustomerId(), + applyCreateGroupFormDTO.getGridId()); + if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { + logger.info(String.format("创建小组异常:%s",EpmetErrorCode.CANNOT_CREATE_GROUP.getMsg())); + throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); + } + String roleName = ""; + if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ + roleName = ModuleConstant.PARTYMEMBER; + }else if(NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())){ + roleName = ModuleConstant.WAREMHEARTED_RESI; + } + + //3.2、插入一条待审核的组信息 + ResiGroupEntity resiGroupEntity = this.structureResiGroupEntity(applyCreateGroupFormDTO); + insert(resiGroupEntity); + //4.获取居民注册信息 + UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); + resiParam.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); + resiParam.setUserId(applyCreateGroupFormDTO.getUserId()); + Result resiResult = + epmetUserFeignClient.getUserResiInfoDTO(resiParam); + String userName = ""; + if(resiResult.success() && null != resiResult.getData()){ + userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) + + (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); + } + userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; + String msg = String.format(UserMessageConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO.getGroupName()); + //4.2、插入一条待审核的操作记录 + ResiGroupOperationDTO resiGroupOperation = new ResiGroupOperationDTO(); + resiGroupOperation.setResiGroupId(resiGroupEntity.getId()); + resiGroupOperation.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); + resiGroupOperation.setOperateUserId(applyCreateGroupFormDTO.getUserId()); + resiGroupOperation.setMessageText(msg); + resiGroupOperation.setReadFlag(ModuleConstant.UNREAD); + resiGroupOperationService.save(resiGroupOperation); + //5、插入一群成员信息(群主) + ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO(); + resiGroupMemberDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); + resiGroupMemberDTO.setResiGroupId(resiGroupEntity.getId()); + resiGroupMemberDTO.setGroupLeaderFlag(LeaderFlagConstant.GROUP_LEADER); + resiGroupMemberDTO.setStatus(MemberStateConstant.UNDER_AUDITTING); + resiGroupMemberDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); + resiGroupMemberService.save(resiGroupMemberDTO); + //6、插入一条入群记录(群主的) + GroupMemeberOperationDTO groupMemeberOperationDTO = new GroupMemeberOperationDTO(); + groupMemeberOperationDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); + groupMemeberOperationDTO.setGroupId(resiGroupEntity.getId()); + groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.UNDER_AUDITTING); + groupMemeberOperationDTO.setOperateUserId(applyCreateGroupFormDTO.getUserId()); + groupMemeberOperationDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); + groupMemeberOperationService.save(groupMemeberOperationDTO); + //7、群初始统计记录 + /*UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), + applyCreateGroupFormDTO.getUserId(), + applyCreateGroupFormDTO.getCustomerId(), + applyCreateGroupFormDTO.getGridId());*/ + ResiGroupStatisticalDTO resiGroupStatisticalDTO = new ResiGroupStatisticalDTO(); + resiGroupStatisticalDTO.setResiGroupId(resiGroupEntity.getId()); + resiGroupStatisticalDTO.setTotalMembers(NumConstant.ONE); + resiGroupStatisticalDTO.setTotalNormalMemebers(NumConstant.ONE); + resiGroupStatisticalDTO.setTotalTopics(NumConstant.ZERO); + resiGroupStatisticalDTO.setTotalIssues(NumConstant.ZERO); + if (NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())) { + resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ONE); + } else { + resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ZERO); + } + if (NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { + resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ONE); + } else { + resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ZERO); + } + resiGroupStatisticalService.save(resiGroupStatisticalDTO); + //发送消息:创建小组 + sendMsgResi2Gov(UserMessageConstant.CREATE_GROUP_APPLYING_MSG_TITLE,msg,applyCreateGroupFormDTO.getGridId(),applyCreateGroupFormDTO.getUserId(),applyCreateGroupFormDTO.getCustomerId()); + //更新政府端:工作-基层治理-群组管理reddot + resiGroupRedis.addWorkGrassrootsGroupRedDotValue(applyCreateGroupFormDTO.getGridId()); + } + + + private void setWorkGrassrootsGroupRedDot(String gridId) { + try{ + + }catch(Exception e){ + e.printStackTrace(); + } + } + + /** + * @param applyCreateGroupFormDTO + * @return java.util.List + * @Author yinzuomei + * @Description 查询是否存在相同名字的群 + * @Date 2020/3/30 16:01 + **/ + private List getResiGroupEntityList(ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { + List list = baseDao.checkResiGroupName(applyCreateGroupFormDTO); + return list; + } + + /** + * @param initApplyGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 加入小组界面初始化 + * @Date 2020/3/30 10:17 + **/ + @Override + public void initApplyGroup(InitApplyGroupFormDTO initApplyGroupFormDTO) { + UserResiInfoFormDTO resiUserInfoFormDTO = new UserResiInfoFormDTO(); + resiUserInfoFormDTO.setUserId(initApplyGroupFormDTO.getUserId()); + resiUserInfoFormDTO.setCustomerId(initApplyGroupFormDTO.getCustomerId()); + Result result = epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); + if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getRegMobile())) { + logger.info(String.format("加入小组界面初始化查询成功,当前用户非注册居民,epmet-user-server接口入参%s,返回%s",JSON.toJSONString(resiUserInfoFormDTO),JSON.toJSONString(result))); + throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + } + } + + private ResiGroupEntity structureResiGroupEntity(ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { + ResiGroupEntity resiGroupEntity = new ResiGroupEntity(); + resiGroupEntity.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); + resiGroupEntity.setGridId(applyCreateGroupFormDTO.getGridId()); + resiGroupEntity.setGroupHeadPhoto(applyCreateGroupFormDTO.getGroupHeadPhoto()); + resiGroupEntity.setGroupName(applyCreateGroupFormDTO.getGroupName()); + resiGroupEntity.setGroupIntroduction(applyCreateGroupFormDTO.getGroupIntroduction()); + resiGroupEntity.setCreatedBy(applyCreateGroupFormDTO.getUserId()); + resiGroupEntity.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); + return resiGroupEntity; + } + + /** + * @param initApplyCreatedGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 校验用户是否是热心居民或者党员 + * @Date 2020/3/30 15:50 + **/ + @Override + public void initApplyCreatedGroup(InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO) { + UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(initApplyCreatedGroupFormDTO.getApp(), + initApplyCreatedGroupFormDTO.getUserId(), + initApplyCreatedGroupFormDTO.getCustomerId(), + initApplyCreatedGroupFormDTO.getGridId()); + if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { + logger.info(String.format("创建小组界面初始化查询成功,用户角色列表%s",JSON.toJSONString(userRoleDTO))); + throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); + } + } + + + /** + * @param agreeApplyGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 审核群申请-测试用后面会放到政府端 + * @Date 2020/3/31 12:44 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result agreeApplyGroup(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { + //1、更新组的状态 + ResiGroupDTO resiGroupDTO = this.get(agreeApplyGroupFormDTO.getGroupId()); + resiGroupDTO.setState(GroupStateConstant.GROUP_APPROVED); + this.update(resiGroupDTO); + //2、更新组的申请记录改为已通过 + ResiGroupOperationDTO resiGroupOperation = resiGroupOperationDao.selectGroupApplyRecord(agreeApplyGroupFormDTO.getGroupId()); + resiGroupOperation.setState(GroupStateConstant.GROUP_APPROVED); + resiGroupOperation.setOperateUserId(agreeApplyGroupFormDTO.getUserId()); + resiGroupOperationService.update(resiGroupOperation); + //3、将群主在群成员的状态改为已通过 + ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberDao.selectLeaderMember(agreeApplyGroupFormDTO.getGroupId()); + resiGroupMemberDTO.setStatus(MemberStateConstant.APPROVED); + resiGroupMemberService.update(resiGroupMemberDTO); + //4、更新群主的出入群记录改为已通过 + GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationDao.selectLeaderRecord(agreeApplyGroupFormDTO.getGroupId()); + groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.APPROVED); + groupMemeberOperationDTO.setOperateUserId(agreeApplyGroupFormDTO.getUserId()); + groupMemeberOperationService.update(groupMemeberOperationDTO); + //5、给用户发送消息???待定 + //6、新增小组缓存信息、组员缓存信息 + Map param = new HashMap<>(); + param.put(ModuleConstant.RESI_GROUP_ID, resiGroupDTO.getId()); + param.put(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); + List statisticalList = resiGroupStatisticalService.list(param); + if (null != statisticalList && statisticalList.size() > 0) { + ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO, statisticalList.get(0)); + resiGroupRedis.set(groupRedis); + + ResiGroupMemberInfoRedisDTO memberRedis = new ResiGroupMemberInfoRedisDTO(); + memberRedis.setUserId(resiGroupMemberDTO.getCustomerUserId()); + memberRedis.setGroupLeaderFlag(ModuleConstant.GROUP_LEADER); + memberRedis.setEnterGroupType(resiGroupMemberDTO.getEnterGroupType()); + memberRedis.setMemberStatus(resiGroupMemberDTO.getStatus()); + memberRedis.setGroupId(resiGroupMemberDTO.getResiGroupId()); + + UserResiInfoFormDTO userParam = new UserResiInfoFormDTO(); + userParam.setUserId(resiGroupMemberDTO.getCustomerUserId()); + userParam.setCustomerId(resiGroupDTO.getCustomerId()); + Result userInfo = + epmetUserFeignClient.getUserResiInfoDTO(userParam); + if(userInfo.success() && null != userInfo.getData()){ + memberRedis.setUserShowName(userInfo.getData().getShowName()); + memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto()); + memberRedis.setMemberMobile(userInfo.getData().getRegMobile()); + }else{ + logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); + } + resiGroupMemberRedis.set(memberRedis); + } else { + /* + 当没有查询到组统计信息时,需要自己封装统计信息 + @param UserRoleFormDTO::getApp + @param UserRoleFormDTO::getCustomerId + @param UserRoleFormDTO::getUserId + @param UserRoleFormDTO::getGridId + 查询用户身份信息[热心居民/党员] + epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); + */ + logger.warn(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO); + } + //发送消息 + UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy()); + userMessageFormDTO.setTitle(UserMessageConstant.AUDITED_GROUP_APPLYING_TITLE); + userMessageFormDTO.setReadFlag(ModuleConstant.UNREAD); + userMessageFormDTO.setApp(ModuleConstant.APP_RESI); + userMessageFormDTO.setGridId(resiGroupDTO.getGridId()); + userMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); + userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName())); + if(!epmetMessageFeignClient.saveUserMessage(userMessageFormDTO).success()){ + logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName()))); + } + //发送微信订阅消息 + WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO = new WxSubscribeMessageFormDTO(); + wxSubscribeMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); + wxSubscribeMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy()); + wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI); + wxSubscribeMessageFormDTO.setGridId(resiGroupDTO.getGridId()); + wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_CREATE_GROUP_BEHAVIOR); + wxSubscribeMessageFormDTO.setMessageContent(String.format(UserMessageConstant.AGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName())); + wxSubscribeMessageFormDTO.setMessageTime(new Date()); + List msgList = new ArrayList<>(); + msgList.add(wxSubscribeMessageFormDTO); + epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); + //更新政府端:工作-基层治理-党员认证reddot + resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(resiGroupDTO.getGridId()); + return new Result(); + } + + /** + * @param disAgreeApplyGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 审核(拒绝)群申请-测试用后面会放到政府端 + * @Date 2020/3/31 13:22 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result disagreeApplyGroup(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { + //1、更新组的状态 + ResiGroupDTO resiGroupDTO = this.get(disAgreeApplyGroupFormDTO.getGroupId()); + resiGroupDTO.setState(GroupStateConstant.GROUP_REJECTED); + this.update(resiGroupDTO); + //2、更新组的申请记录改为已通过 + ResiGroupOperationDTO resiGroupOperation = resiGroupOperationDao.selectGroupApplyRecord(disAgreeApplyGroupFormDTO.getGroupId()); + resiGroupOperation.setState(GroupStateConstant.GROUP_REJECTED); + resiGroupOperation.setOperateUserId(disAgreeApplyGroupFormDTO.getUserId()); + resiGroupOperation.setOperateReason(disAgreeApplyGroupFormDTO.getRejectReason()); + resiGroupOperationService.update(resiGroupOperation); + //3、将群主在群成员的状态改为已通过 + ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberDao.selectLeaderMember(disAgreeApplyGroupFormDTO.getGroupId()); + resiGroupMemberDTO.setStatus(MemberStateConstant.REJECTED); + resiGroupMemberService.update(resiGroupMemberDTO); + //4、更新群主的出入群记录改为已通过 + GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationDao.selectLeaderRecord(disAgreeApplyGroupFormDTO.getGroupId()); + groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.REJECTED); + groupMemeberOperationDTO.setOperateUserId(disAgreeApplyGroupFormDTO.getUserId()); + groupMemeberOperationService.update(groupMemeberOperationDTO); + //5、给用户发送消息???待定 + UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy()); + userMessageFormDTO.setTitle(UserMessageConstant.AUDITED_GROUP_APPLYING_TITLE); + userMessageFormDTO.setReadFlag(ModuleConstant.UNREAD); + userMessageFormDTO.setApp(ModuleConstant.APP_RESI); + userMessageFormDTO.setGridId(resiGroupDTO.getGridId()); + userMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); + userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.DISAGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName(),disAgreeApplyGroupFormDTO.getRejectReason())); + if(!epmetMessageFeignClient.saveUserMessage(userMessageFormDTO).success()){ + logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,String.format(UserMessageConstant.DISAGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName(),disAgreeApplyGroupFormDTO.getRejectReason()))); + } + + //发送微信订阅消息 + WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO = new WxSubscribeMessageFormDTO(); + wxSubscribeMessageFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); + wxSubscribeMessageFormDTO.setUserId(resiGroupDTO.getCreatedBy()); + wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI); + wxSubscribeMessageFormDTO.setGridId(resiGroupDTO.getGridId()); + wxSubscribeMessageFormDTO.setBehaviorType(UserMessageConstant.WX_APPLY_CREATE_GROUP_BEHAVIOR); + wxSubscribeMessageFormDTO.setMessageContent(String.format(UserMessageConstant.DISAGREE_CREATING_GROUP_MSG_TEMPLATE,resiGroupDTO.getGroupName(),disAgreeApplyGroupFormDTO.getRejectReason())); + wxSubscribeMessageFormDTO.setMessageTime(new Date()); + List msgList = new ArrayList<>(); + msgList.add(wxSubscribeMessageFormDTO); + epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); + + //更新政府端:工作-基层治理-党员认证reddot + resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(resiGroupDTO.getGridId()); + return new Result(); + } + + /** + * @param app + * @param userId + * @param customerId + * @param gridId + * @return boolean + * @Author yinzuomei + * @Description 用户拥有党员或者热心居民标签返回true, 没有权限返回false + * @Date 2020/3/30 16:33 + **/ + @Override + public UserRoleDTO checkPartyMemberOrWarmHeated(String app, String userId, String customerId, String gridId) { + UserRoleDTO userRoleDTO = new UserRoleDTO(); + UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); + userRoleFormDTO.setApp(app); + userRoleFormDTO.setCustomerId(customerId); + userRoleFormDTO.setUserId(userId); + userRoleFormDTO.setGridId(gridId); + logger.info(String.format("用户同意邀请进组,获取当前用户所有角色入参:%s", JSON.toJSONString(userRoleFormDTO))); + Result> userRoleListResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); + if (!userRoleListResult.success()) { + logger.error("获取用户角色feign调用失败" + userRoleListResult.getMsg()); + return userRoleDTO; + } + List userRoleList = userRoleListResult.getData(); + if (null == userRoleList || userRoleList.size() == 0) { + return userRoleDTO; + } + for (UserRoleResultDTO userRoleResultDTO : userRoleList) { + 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); + } + } + logger.info(String.format("用户同意邀请进组,获取当前用户所有角色返参:%s",JSON.toJSONString(userRoleDTO))); + return userRoleDTO; + } + + @Override + public Result> audited(GroupAuditedFromDTO formDTO) { + Result> result = new Result<>(); + //查询条件 + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //获取审核列表 + List resultList = baseDao.selectAuditedGroupList(formDTO); + + return result.ok(resultList); + } + + @Override + public Result> getGroupsInGrid(GroupAuditedFromDTO formDTO) { + List resultList = new ArrayList<>(); + //查询条件 + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + List list = baseDao.selectGroupsByGridId(formDTO); + list.forEach(group -> { + GroupsInGridResultDTO groupsInGridResultDTO = new GroupsInGridResultDTO(); + if (MemberStateConstant.REJECTED.equals(group.getState())) { + groupsInGridResultDTO.setGroupId(group.getId()); + groupsInGridResultDTO.setGroupName(group.getGroupName()); + groupsInGridResultDTO.setGroupHeadPhoto(group.getGroupHeadPhoto()); + groupsInGridResultDTO.setStatus(group.getState()); + groupsInGridResultDTO.setTotalMember(NumConstant.ZERO); + groupsInGridResultDTO.setTotalPartyMember(NumConstant.ZERO); + resultList.add(groupsInGridResultDTO); + } else if(MemberStateConstant.APPROVED.equals(group.getState())) { + //缓存中获取组信息 + ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(group.getId()); + groupsInGridResultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId()); + groupsInGridResultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName()); + groupsInGridResultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto()); + groupsInGridResultDTO.setStatus(resiGroupInfoRedisDTO.getGroupState()); + groupsInGridResultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers()); + groupsInGridResultDTO.setTotalPartyMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalPartyMembers()); + resultList.add(groupsInGridResultDTO); + } + + + }); + + return new Result>().ok(resultList); + } + + @Override + public Result getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) { + GovGroupSummarizeResultDTO resultDTO = new GovGroupSummarizeResultDTO(); + //从缓存中获取组相关信息 + ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(formDTO.getGroupId()); + resultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId()); + resultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto()); + resultDTO.setGroupIntroduction(resiGroupInfoRedisDTO.getGroupIntroduction()); + resultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName()); + resultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers()); + resultDTO.setTotalTopics(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalTopics()); + + //获取组长信息 + Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(formDTO.getGroupId()); + if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { + resultDTO.setLeaderName(groupLeaderUserInfo.getData().getShowName()); + } else { + logger.info("组长注册信息查询失败" + groupLeaderUserInfo.getMsg()); + } + + return new Result().ok(resultDTO); + } + + /** + * @return ResiGroupInfoRedisDTO + * @Description 将ResiGroupDTO与ResiGroupStatisticalDTO转换成ResiGroupInfoRedisDTO + * @Param ResiGroupDTO + * @Param ResiGroupStatisticalDTO + * @Author wangc + * @Date 2020.04.13 16:36 + **/ + private ResiGroupInfoRedisDTO transferToGroupInfoRedis(ResiGroupDTO groupDTO, ResiGroupStatisticalDTO statisticalDTO) { + + ResiGroupStatisticalInfoRedisDTO statisticalObjct = + ConvertUtils.sourceToTarget(statisticalDTO, ResiGroupStatisticalInfoRedisDTO.class); + statisticalObjct.setTotalEarnestMembers(statisticalDTO.getTotalEarnestMemebers()); + statisticalObjct.setTotalNormalMembers(statisticalDTO.getTotalNormalMemebers()); + ResiGroupInfoRedisDTO targetObject = + ConvertUtils.sourceToTarget(groupDTO, ResiGroupInfoRedisDTO.class); + targetObject.setGroupId(groupDTO.getId()); + targetObject.setGroupState(groupDTO.getState()); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); + if (null != groupDTO.getLatestTopicPublishDate()) { + targetObject.setLatestTopicPublishDate(format.format(groupDTO.getLatestTopicPublishDate())); + } + targetObject.setGroupStatisticalInfo(statisticalObjct); + return targetObject; + } + + /** + * @Description 查询待审核的小组 (不从缓存中取,这时还没有成功建组,缓存中没有组数据) + * @Param ApplyingGroupsFormDTO + * @return Result> + * @Author wangc + * @Date 2020.04.18 10:18 + **/ + @Override + public Result> getApplyingGroups(ApplyingGroupsFormDTO params){ + if(null == params.getPageNo()){ + throw new RenException(ModuleConstant.PAGE_INDEX_NOT_NULL); + } + params.setPageNo((params.getPageNo() - NumConstant.ONE) * params.getPageSize()); + return new Result>().ok(baseDao.getApplyingGroupsByCustIdAndGridId(params)); + } + + /** + * @Description 建组申请详情 已审核(更新已读未读标识)/未审核 + * @Param AgreeApplyGroupFormDTO + * @return Result + * @Author wangc + * @Date 2020.04.19 23:32 + **/ + @Override + public Result getApplyingGroupDetail(CommonGroupIdFromDTO groupId){ + //1.查询小组信息 + //注意,这里查询出的组申请详情中,无论是已审核还是未审核,都是将该组信息关联到初始化组时状态为[待审核、审核通过、拒绝]其中之一的组操作记录上,并读取审核的已读未读信息,上述三种状态在一个组的所有操作记录当中只可能存在一种,与之后的屏蔽、取消屏蔽、关闭无关,如果查出多条说明建组的逻辑有问题 + ApplyingGroupDetailResultDTO detail = baseDao.getApplyingGroupDetailByGroupId(groupId.getGroupId()); + //2.查询用户信息(TODO 先走数据库,之后改成走缓存) + List userId = new ArrayList<>(); + userId.add(detail.getLeaderId()); + Result> userInfoResult = + epmetUserFeignClient.getUserResiInfoList(new UserResiInfoListFormDTO(userId)); + if(userInfoResult.success() && null != userInfoResult.getData() && userInfoResult.getData().size() >= 1){ + //姓氏+先生/女士 注:在数据库中拼接成[街道+显示名称]默认格式,故要进行截取 + //detail.setGroupLeaderName(userInfoResult.getData().get(0).getShowName().split("-")[NumConstant.ONE]); + //姓氏+名称 + detail.setGroupLeaderName(userInfoResult.getData().get(0).getSurname() + userInfoResult.getData().get(0).getName()); + detail.setStreet(userInfoResult.getData().get(0).getStreet()); + StringBuffer buffer = new StringBuffer(detail.getStreet()); + buffer.append(StringUtils.isBlank(buffer) ? "" : "-"); + detail.setGroupLeaderName(buffer.append(detail.getGroupLeaderName()).toString()); + }else{ + logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND); + } + //3.未读改成已读 + if(StringUtils.equals(detail.getReadFlag(),ModuleConstant.UNREAD)){ + ResiGroupOperationEntity operationEntity = new ResiGroupOperationEntity(); + operationEntity.setId(detail.getOperationId()); + operationEntity.setReadFlag(ModuleConstant.READ); + operationEntity.setUpdatedBy(groupId.getUserId()); + resiGroupOperationDao.updateById(operationEntity); + } + //4.将组长用户Id隐藏 + detail.setLeaderId(null); + detail.setOperationId(null); + + return new Result().ok(ConvertUtils.sourceToTarget(detail, ApplyingGroupDetailResult2DTO.class)); + } + + @Override + public List queryGroupProcessingCount(List gridIdList) { + List list=new ArrayList<>(); + for(String gridId:gridIdList){ + GroupProcessingCountResultDTO resultDTO=new GroupProcessingCountResultDTO(); + resultDTO.setGridId(gridId); + Integer auditingCreateGroupCount=resiGroupRedis.getWorkGrassrootsGroupRedDotValue(gridId); + Integer auditingGroupEditRecordCount=groupEditSubmitRecordDao.selectCountAuditingRec(gridId); + Integer auditingCount=auditingCreateGroupCount+auditingGroupEditRecordCount; + if (null == auditingCount) { + resultDTO.setCount(0); + } else { + resultDTO.setCount(auditingCount); + } + list.add(resultDTO); + } + return list; + } + + + /** + * @Description 查询一个网格下面所有组Id + * @param gridId + * @return List + * @author wangc + * @date 2020.05.14 10:54 + **/ + @Override + public List getGroupIdByGridId(String gridId) { + if(StringUtils.isBlank(gridId)) return null; + return baseDao.getGroupIdByGridId(gridId); + } + + /** + * @Description 返回 Map> + * @param gridIdList + * @return Map> + * @author wangc + * @date 2020.05.22 09:27 + **/ + @Override + public Map> getGroupIdsByGridIdList(List gridIdList) { + if(null == gridIdList || gridIdList.size() < NumConstant.ONE) + return null; + Map> result = new HashMap<>(); + List groups = new ArrayList<>(); + Map> groupMap + = groups.stream().collect(Collectors.groupingBy(ResiGroupDTO::getGridId)); + groupMap.forEach((k,v)->{ + Set groupIds = + v.stream().map(ResiGroupDTO::getId).collect(Collectors.toSet()); + result.put(k,groupIds); + }); + + return result; + } + + /** + * @Description 校验用户是否加入小组 + * @param gridId + * @author zxc + */ + @Override + public CheckJoinTeamResultDTO checkjointeam(GridIdFormDTO gridId) { + CheckJoinTeamResultDTO checkJoinTeamResultDTO = new CheckJoinTeamResultDTO(); + Integer joinTeamCounts = baseDao.checkjointeam(gridId); + if (joinTeamCounts==NumConstant.ZERO){//未加入任何小组(当前网格下) + checkJoinTeamResultDTO.setVoteAuthorization(false); + }else { + checkJoinTeamResultDTO.setVoteAuthorization(true); + } + return checkJoinTeamResultDTO; + } + + /** + * @Description 获取应表决数 + * @param formDTO + * @author zxc + */ + @Override + public ShouldVoteCountResultDTO shouldVoteCount(ShouldVoteCountFormDTO formDTO) { + //网格下所有加过组的人数 + Integer shouldVoteCount = baseDao.shouldVoteCount(formDTO).getShouldVoteCount(); + Integer outGroupCount = baseDao.getOutGroupCount(formDTO); + ShouldVoteCountResultDTO result = new ShouldVoteCountResultDTO(); + result.setShouldVoteCount(shouldVoteCount-outGroupCount); + return result; + } + + @Override + public List recommendedList(RecommendedListFormDTO formDTO) { + + //显示当前网格内所有当前用户还未加入的组,以组的人数由高到低排序;如果人数相同,以话题数由多到少排序 + List recommendGroupList = baseDao.selectListRecommendList(formDTO); + recommendGroupList.forEach(dto -> { + Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(dto.getGroupId()); + if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { + dto.setLeaderName(groupLeaderUserInfo.getData().getShowName()); + } else { + logger.warn("组长注册信息查询失败" + groupLeaderUserInfo.getMsg()); + } + }); + return recommendGroupList; + } + + /** + * @Description 给加入此网格的网格长发送消息 + * @param msg + * @param gridId + * @param userId + * @author wangc + * @date 2020.04.29 22:49 + **/ + private void sendMsgResi2Gov(String title,String msg,String gridId,String userId,String customerId){ + //1.查询加入当前网格下的人员 customer_staff_grid + CommonGridIdFormDTO commonGridIdFormDTO = new CommonGridIdFormDTO(); + commonGridIdFormDTO.setGridId(gridId); + commonGridIdFormDTO.setUserId(userId); + Result> gridstaffs = + govOrgFeignClient.getGridStaffs(commonGridIdFormDTO); + //2.查询这些人是否有管理员身份且未被禁用 staff_role customer_staff + if(gridstaffs.success() && null != gridstaffs.getData() && gridstaffs.getData().size() > 0){ + RolesUsersListFormDTO rolesUsersListFormDTO = new RolesUsersListFormDTO(); + rolesUsersListFormDTO.setCustomerId(customerId); + List roleKeys = new ArrayList(); + roleKeys.add(ModuleConstant.STAFF_ROLE_GRID_MANAGER); + rolesUsersListFormDTO.setRoleKeys(roleKeys); + rolesUsersListFormDTO.setUserIds(gridstaffs.getData()); + Result> staffRoles = + epmetUserFeignClient.specificRolesStaffs(rolesUsersListFormDTO); + //3.发送消息 + if(staffRoles.success() && null != staffRoles.getData() && staffRoles.getData().size() > 0){ + List msgList = new ArrayList<>(); + List subscribeList = new ArrayList<>(); + for(String to : staffRoles.getData()){ + //站内信 + UserMessageFormDTO msgObj = new UserMessageFormDTO(); + msgObj.setApp(ModuleConstant.APP_GOV); + msgObj.setCustomerId(customerId); + msgObj.setGridId(gridId); + msgObj.setMessageContent(msg); + msgObj.setReadFlag(ReadFlagConstant.UN_READ); + msgObj.setTitle(title); + msgObj.setUserId(to); + msgList.add(msgObj); + //微信订阅 + WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO(); + subscribeDTO.setClientType(ModuleConstant.APP_GOV); + subscribeDTO.setGridId(gridId); + subscribeDTO.setCustomerId(customerId); + subscribeDTO.setUserId(to); + subscribeDTO.setBehaviorType(UserMessageConstant.WX_CREATE_GROUP_BEHAVIOR); + subscribeDTO.setMessageContent(msg); + subscribeDTO.setMessageTime(new Date()); + subscribeList.add(subscribeDTO); + } + if (subscribeList.size() > NumConstant.ZERO){ + epmetMessageOpenFeignClient.sendWxSubscribeMessage(subscribeList); + } + Result result = epmetMessageFeignClient.saveUserMessageList(msgList); + if(result.success()){ + return; + } + } + } + logger.warn(String.format(ModuleConstant.FAILED_SEND_MESSAGE,msg)); + + } + + @Override + public GroupDetailResultDTO getGroupDetail(String groupId) { + GroupDetailResultDTO groupDetail = new GroupDetailResultDTO(); + + // 1.拼装组基本信息 + GroupEditSubmitRecordEntity ler = groupEditSubmitRecordDao.getLatestEditSubmitRecord(groupId); + + if (ler != null) { + groupDetail.setAuditStatus(ler.getAuditStatus()); + groupDetail.setRemark(ler.getRemark()); + } + + if (ler != null && GroupAuditStatusConstant.UNDER_AUDITING.equals(ler.getAuditStatus())) { + // 审核中,显示待审核内容 + groupDetail.setGroupHeadPhoto(ler.getGroupHeadPhoto()); + groupDetail.setGroupName(ler.getGroupName()); + groupDetail.setGroupIntroduction(ler.getGroupIntroduction()); + } else { + // 不在审核中,直接显示组信息 + ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(groupId); + if (resiGroupEntity == null) { + return null; + } + + groupDetail.setGroupHeadPhoto(resiGroupEntity.getGroupHeadPhoto()); + groupDetail.setGroupName(resiGroupEntity.getGroupName()); + groupDetail.setGroupIntroduction(resiGroupEntity.getGroupIntroduction()); + } + + // 2.编辑次数及其限制 + groupDetail.setEditNumLimit(GroupLimitConstant.EDIT_NUM_LIMIT_MONTH); + Date now = new Date(); + int usedEditNum = groupEditSubmitRecordDao.countEditNum(groupId, DateUtils.getMonthStart(now), DateUtils.getMonthEnd(now)); + groupDetail.setAvaliableEditNum(GroupLimitConstant.EDIT_NUM_LIMIT_MONTH - usedEditNum); + + // 审核状态 + // 是否可编辑 + boolean editable = true; + + if (GroupLimitConstant.EDIT_NUM_LIMIT_MONTH <= usedEditNum) { + // 达到最大编辑次数了 + editable = false; + } + + if (ler != null && GroupAuditStatusConstant.UNDER_AUDITING.equals(ler.getAuditStatus())) { + // 提交了,还没审核完 + editable = false; + } + + groupDetail.setEditable(editable); + return groupDetail; + } + + @Override + public void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId) { + // 1.判断小组是否存在,判断是否已经在"待审核"状态 + ResiGroupEntity group = resiGroupDao.selectById(groupId); + if (group == null) { + throw new RenException(EpmetErrorCode.GROUP_NOT_EXISTS.getCode(), EpmetErrorCode.GROUP_NOT_EXISTS.getMsg()); + } + + // 判断是否是组长 + ResiGroupMemberDTO groupLeader = resiGroupMemberDao.selectLeaderMember(groupId); + if (groupLeader == null || !groupLeader.getCustomerUserId().equals(editUserId)) { + String msg = "只有该组的组长才可以编辑组信息"; + throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), msg, msg, RenException.MessageMode.CODE_INTERNAL_EXTERNAL); + } + + // 2.判断是否可以提交编辑 + GroupEditSubmitRecordEntity lre = groupEditSubmitRecordDao.getLatestEditSubmitRecord(groupId); + if (lre != null && GroupAuditStatusConstant.UNDER_AUDITING.equals(lre.getAuditStatus())) { + // 在待审核状态,不允许再次提交编辑 + throw new RenException(EpmetErrorCode.GROUP_IN_AUDITING.getCode(), EpmetErrorCode.GROUP_IN_AUDITING.getMsg()); + } + + if (resiGroupDao.countExistsGroupNameBeforeEdit(groupId, group.getGridId(), groupName) > 0) { + // 已存在组名,拒绝提交 + throw new RenException(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode(), EpmetErrorCode.GROUP_ALREADY_EXISTED.getMsg()); + } + + Date now = new Date(); + int usedEditNum = groupEditSubmitRecordDao.countEditNum(groupId, DateUtils.getMonthStart(now), DateUtils.getMonthEnd(now)); + if (GroupLimitConstant.EDIT_NUM_LIMIT_MONTH <= usedEditNum) { + // 达到最大编辑次数了 + throw new RenException(EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getCode(), EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getMsg()); + } + + // 3.内容检查 + scanGroupEditContent(groupName, groupIntroduction, groupHeadPhoto); + + String app = loginUserUtil.getLoginUserApp(); + String userId = loginUserUtil.getLoginUserId(); + String messageText = generateGroupEditMessageText(app, userId, group.getCustomerId(), group.getGridId(), groupName); + + // 4.创建编辑提交记录 + GroupEditSubmitRecordEntity editRecord = new GroupEditSubmitRecordEntity(); + editRecord.setAuditStatus(GroupAuditStatusConstant.UNDER_AUDITING); + editRecord.setCustomerId(group.getCustomerId()); + editRecord.setGridId(group.getGridId()); + editRecord.setGroupHeadPhoto(groupHeadPhoto); + editRecord.setGroupIntroduction(groupIntroduction); + editRecord.setGroupId(groupId); + editRecord.setGroupName(groupName); + editRecord.setReadFlag(ReadFlagConstant.UN_READ); + editRecord.setMessageText(messageText); + + if (groupEditSubmitRecordDao.insert(editRecord) == 0) { + throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), EpmetErrorCode.GROUP_EDIT_ERROR.getMsg()); + } + + resiGroupRedis.addWorkGrassrootsGroupRedDotValue(group.getGridId()); + + } + + /** + * 生成组信息编辑简介文本:xxx申请编辑组信息,请审核 + * @param app + * @param userId + * @param customerId + * @param gridId + * @param groupName + * @return + */ + private String generateGroupEditMessageText(String app, String userId, String customerId, String gridId, String groupName) { + List resiRoles = getResiRoles(app, customerId, userId, gridId); + boolean isPartymember = false; + boolean isWarmhearted = false; + for (UserRoleResultDTO role : resiRoles) { + if (EpmetRoleKeyConstant.WARMHEARTED.equals(role.getRoleKey())) { + isWarmhearted = true; + } + if (EpmetRoleKeyConstant.PARTYMEMBER.equals(role.getRoleKey())) { + isPartymember = true; + } + } + if (!isWarmhearted && isPartymember) { + throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode(), "只有党员和热心居民才能创建和编辑小组"); + } + String roleName = ""; + if (isPartymember) { + roleName = ModuleConstant.PARTYMEMBER; + } else if (isWarmhearted) { + roleName = ModuleConstant.WAREMHEARTED_RESI; + } + + //3.获取居民注册信息 + UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); + resiParam.setCustomerId(customerId); + resiParam.setUserId(userId); + Result resiResult = + epmetUserFeignClient.getUserResiInfoDTO(resiParam); + String userName = ""; + if (resiResult.success() && null != resiResult.getData()) { + userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) + + (StringUtils.isBlank(resiResult.getData().getName()) ? "" : resiResult.getData().getName()); + } + userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; + return String.format(UserMessageConstant.EDIT_OF_GROUP_MESSAGE_TEMPLATE, roleName, userName, groupName); + } + + /** + * 查询居民的角色列表 + * @param app + * @param customerId + * @param userId + * @param gridId + * @return + */ + private List getResiRoles(String app, String customerId, String userId, String gridId) { + UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); + userRoleFormDTO.setApp(app); + userRoleFormDTO.setCustomerId(customerId); + userRoleFormDTO.setUserId(userId); + userRoleFormDTO.setGridId(gridId); + Result> rolesResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); + + if (! rolesResult.success()) { + logger.error("修改组信息:查询居民角色失败,详情:{}", rolesResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), "查询居民角色失败"); + } else { + List roles = rolesResult.getData(); + if (CollectionUtils.isEmpty(roles)) { + roles = new ArrayList<>(); + } + return roles; + } + } + + /** + * 内容检查 + * @param groupName + * @param groupIntroduction + * @param groupHeadPhoto + */ + private void scanGroupEditContent(String groupName, String groupIntroduction, String groupHeadPhoto) { + // 文本内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + String content = groupName.concat("-").concat(groupIntroduction); + taskDTO.setContent(content); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("调用内容审核服务审核文本发生错误:{}", textSyncScanResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + } + } + + // 图片内容审核 + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(groupHeadPhoto); + imgScanParamDTO.getTasks().add(task); + + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + logger.error("调用内容审核服务审核图片发生错误:{}", textSyncScanResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + } + } + } + + /** + * @Description 工作端 查询组变更待审核列表 + * @param param + * @return + * @author wangc + * @date 2020.11.03 10:19 + */ + @Override + public List getEditAuditingList(CommonGridAndPageFormDTO param) { + return Optional.ofNullable(PageHelper.startPage(null == param.getPageNo() ? NumConstant.ONE : param.getPageNo() , null == param.getPageSize() ? NumConstant.TWELVE : param.getPageSize()) + .doSelectPage(() -> { + groupEditSubmitRecordDao.selectGroupEditApplyList(param.getGridId());}).getResult()).orElse(new LinkedList<>()) + .stream().map(o -> { return (ApplyingGroupResultDTO)o; }).collect(Collectors.toList()); + } + + /** + * @Description 查询小组修改信息的详情内容 不加事务! + * @param param + * @return com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @Override + public GroupEditionDetailResultDTO getEditAuditingDetail(GovGroupSummarizeFromDTO param) { + GroupEditSubmitRecordEntity edit = groupEditSubmitRecordDao.selectEditDetail(param.getGroupId(),null); + if(null == edit) { + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.getEditAuditingDetail,未找到小组变更信息记录,传参:{}",JSON.toJSONString(param)); + return null;} + //取消未读状态 + GroupEditSubmitRecordEntity _update = new GroupEditSubmitRecordEntity(); + _update.setId(edit.getId());_update.setReadFlag(ModuleConstant.READ); + groupEditSubmitRecordDao.updateById(_update); + GroupEditionDetailResultDTO result = ConvertUtils.sourceToTarget(edit, GroupEditionDetailResultDTO.class); + result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy())); + return result; + } + + /** + * @Description 工作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void auditEdit(GroupEditionAuditFormDTO param) { + if(StringUtils.equals(param.getAuditResult(),ModuleConstant.AUDITING_OPERATION_REJECT) && StringUtils.isBlank(param.getRemark())){ + throw new RenException("拒绝理由不能为空"); + } + GroupEditSubmitRecordEntity edit = groupEditSubmitRecordDao.selectEditDetail(param.getGroupId(),null); + if(null == edit){ + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.auditEdit,找不到待审核的组更新记录,传参:{}",JSON.toJSONString(param)); + throw new RenException("找不到待审核的组更新记录"); + } + + int affectedRows = groupEditSubmitRecordDao.updateAuditResult(param.getGroupId(),param.getStaffId(),param.getAuditResult(),param.getRemark()); + if(affectedRows <= NumConstant.ZERO){ + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.auditEdit,更新组编辑记录时受影响行数小于1,传参:{}",JSON.toJSONString(param)); + throw new RenException("更新组编辑记录时受影响行数小于1"); + } + if(!StringUtils.equals(param.getAuditResult(),ModuleConstant.AUDITING_OPERATION_REJECT)){ + //同意 + ResiGroupEntity _update = ConvertUtils.sourceToTarget(edit,ResiGroupEntity.class); + _update.setId(param.getGroupId()); + baseDao.updateById(_update); + } + resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(edit.getGridId()); + resiGroupRedis.delGroup(param.getGroupId()); + } + +}