Browse Source

Merge remote-tracking branch 'remotes/origin/dev_personal_center' into dev_issue_audit

# Conflicts:
#	epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
#	epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java
#	epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml
#	epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
#	epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
#	epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml
#	epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
#	epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
#	epmet-user/epmet-user-server/pom.xml
#	epmet-user/epmet-user-server/src/main/resources/bootstrap.yml
master
jianjun 5 years ago
parent
commit
b2588abaee
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java
  2. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  4. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  5. 56
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java
  6. 10
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java
  7. 5
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java
  8. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java
  9. 48
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java
  10. 2
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java
  11. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java
  12. 22
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java
  13. 16
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml
  14. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java
  15. 11
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  16. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  17. 6
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  18. 14
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupAuditStatusConstant.java
  19. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupLimitConstant.java
  20. 40
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java
  21. 39
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java
  22. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java
  23. 43
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupEditionAuditFormDTO.java
  24. 21
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java
  25. 42
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java
  26. 17
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyPartIssueFormDTO.java
  27. 23
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyPartIssueResultDTO.java
  28. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicClosingMsgResultDTO.java
  29. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java
  30. 35
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicHiddenDetailDTO.java
  31. 48
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  32. 29
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  33. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java
  34. 65
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  35. 92
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java
  36. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  37. 101
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java
  38. 47
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/GroupEditSubmitRecordRedis.java
  39. 36
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java
  40. 31
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  41. 416
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  42. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  43. 13
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java
  44. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
  45. 157
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  46. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java
  47. 24
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.4__createGroupSubmitRecord.sql
  48. 150
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml
  49. 21
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  50. 13
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml
  51. 2
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java
  52. 24
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  53. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java
  54. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeDTO.java
  55. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java
  56. 24
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddUserPartyBadgeFormDTO.java
  57. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java
  58. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java
  59. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberUserIdsResultDTO.java
  60. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java
  61. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java
  62. 17
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserIdAndBadgeIdResultDTO.java
  63. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java
  64. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java
  65. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  66. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  67. 1
      epmet-user/epmet-user-server/pom.xml
  68. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/constant/BadgeMessageConstant.java
  69. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java
  70. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java
  71. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java
  72. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
  73. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java
  74. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java
  75. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeEntity.java
  76. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  77. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  78. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java
  79. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java
  80. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java
  81. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
  82. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
  83. 36
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java
  84. 272
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
  85. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java
  86. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/util/ModuleConstant.java
  87. 1
      epmet-user/epmet-user-server/src/main/resources/bootstrap.yml
  88. 199
      epmet-user/epmet-user-server/src/main/resources/db/migration/2020-11-03_badege.sql
  89. 219
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.10__add_badege.sql
  90. 4
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.8__alter_useradvice_pids.sql
  91. 9
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.9__alter_useradvice_content.sql
  92. 52
      epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml
  93. 56
      epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml
  94. 6
      epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml
  95. 22
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml
  96. 44
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml
  97. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml
  98. 38
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml
  99. 12
      epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml
  100. 4
      epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java

@ -10,6 +10,9 @@ 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", "基层治理:群组管理:审核历史", "基层治理:群组管理:审核历史列表查询"),

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -115,9 +115,9 @@ public enum EpmetErrorCode {
OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"),
OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"),
OPER_EXT_APP_SECRET_RESET_FAIL(8714, "秘钥更新失败"),
OPER_UPLOAD_IMG_TYPE_ERROR(8715, "请上传PNG格式的图片"),
OPER_UPLOAD_IMG_SIZE_ERROR(8716, "请上传200*200的图片"),
USER_LIST_ROLES_BY_KEY_FAIL(8715, "根据角色key查询角色列表失败"),
OPER_UPLOAD_IMG_TYPE_ERROR(8716, "请上传PNG格式的图片"),
OPER_UPLOAD_IMG_SIZE_ERROR(8717, "请上传200*200的图片"),
// 党建声音 前端提示 88段
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),
@ -130,7 +130,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;

7
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);
}
}

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -709,4 +709,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();
}
}

56
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java

@ -8,9 +8,13 @@
package com.epmet.commons.tools.validator;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.tools.dto.form.DingTalkTextMsg;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.ResourceBundleMessageSource;
@ -50,8 +54,8 @@ public class ValidatorUtils {
List<Class<?>> customerShowGroups = new ArrayList<>();
List<Class<?>> internalGroups = new ArrayList<>();
if (groups == null || groups.length ==0){
validate(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR ,object,groups);
if (groups == null || groups.length == 0) {
validate(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR, object, groups);
return;
}
Arrays.asList(groups).forEach(g -> {
@ -65,7 +69,7 @@ public class ValidatorUtils {
// 1.校验客户端显示分组
if (!CollectionUtils.isEmpty(customerShowGroups)) {
validate(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR ,object, customerShowGroups.toArray(new Class<?>[customerShowGroups.size()]));
validate(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR, object, customerShowGroups.toArray(new Class<?>[customerShowGroups.size()]));
}
// 2.内部校验分组
@ -86,6 +90,7 @@ public class ValidatorUtils {
/**
* 真正的校验方法
*
* @param object
* @param errorCode
* @param groups
@ -103,7 +108,50 @@ public class ValidatorUtils {
int lastDouhaoIndex = sb.lastIndexOf(",");
sb.replace(lastDouhaoIndex, lastDouhaoIndex + 1, "");
throw new ValidateException(errorCode.getCode(),sb.toString());
throw new ValidateException(errorCode.getCode(), sb.toString());
}
}
/**
* desc: 校验对象json串必填字段是否有值
*
* @param jsonString
* @param requiredColumns
* @return java.lang.String 返回未必填的字段
* @author LiuJanJun
* @date 2020/11/19 9:47 上午
*/
public static List<String> hasAllRequired(final String jsonString, Set<String> requiredColumns) {
List<String> missColList = new ArrayList<>();
if (!CollectionUtils.isEmpty(requiredColumns)) {
//验证字段非空
requiredColumns.forEach(column -> {
//按照必填字段取前台传过来的参数
Object val = null;
if (StringUtils.isNotBlank(jsonString)) {
JSONObject jsonObject = JSONObject.parseObject(jsonString);
val = jsonObject.get(column.trim());
}
//如果没有查到那个值,就代表着传过来的字段少了
if (val == null || StringUtils.isBlank(val.toString())) {
missColList.add(column);
}
});
}
return missColList;
}
public static void main(String[] args) {
DingTalkTextMsg form = new DingTalkTextMsg();
form.setWebHook("1");
form.setContent("2");
//form.setAtMobiles();
//form.setAtAll();
//form.setSecret();
Set<String> requiredColumns = new HashSet<>();
requiredColumns.add("content");
requiredColumns.add("secret");
List<String> s = ValidatorUtils.hasAllRequired(JSON.toJSONString(form), requiredColumns);
System.out.println(s);
}
}

10
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;
}
}

5
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;
/**

3
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<WorkPointVerficationListResultDTO> 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<WorkPointVerficationListResultDTO>().ok(pointVerificationLogService.getStaffVerificationRecordMonthly(verificationParam));
}

48
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<List<ApplyingGroupResultDTO>> 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<GroupEditionDetailResultDTO> 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);
}
}

2
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)

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java

@ -84,6 +84,8 @@ public interface IssueVoteDetailDao extends BaseDao<IssueVoteDetailEntity> {
*/
List<MyPartIssuesResultDTO> myPartIssues(@Param("userId")String userId);
List<MyPartIssuesResultDTO> myPartIssuesByTopicId(@Param("topicIds")List<String> topicIds);
/**
* @return com.epmet.dto.IssueVoteDetailDTO
* @param userId

22
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java

@ -44,6 +44,9 @@ import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.redis.IssueVoteDetailRedis;
import com.epmet.redis.IssueVoteStatisticalRedis;
import com.epmet.resi.group.dto.topic.form.MyPartIssueFormDTO;
import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.IssueVoteDetailService;
import com.epmet.service.IssueVoteStatisticalService;
import com.epmet.utils.ModuleConstants;
@ -90,6 +93,8 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
private IssueVoteDetailService issueVoteDetailService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Override
public PageData<IssueVoteStatisticalDTO> page(Map<String, Object> params) {
@ -545,16 +550,27 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
@Override
public List<MyPartIssuesResultDTO> myPartIssues(MyPartIssuesFormDTO myPartIssuesFormDTO) {
List<MyPartIssuesResultDTO> myPartIssuesResult = issueVoteDetailDao.myPartIssues(myPartIssuesFormDTO.getUserId());
MyPartIssueFormDTO formDTO = new MyPartIssueFormDTO();
formDTO.setUserId(myPartIssuesFormDTO.getUserId());
Result<MyPartIssueResultDTO> myPartIssueResult = resiGroupOpenFeignClient.selectMyPartTopic(formDTO);
if (!myPartIssueResult.success()){
throw new RenException("查询我评论过的话题失败......");
}
if (!CollectionUtils.isEmpty(myPartIssueResult.getData().getTopicIds())){
List<MyPartIssuesResultDTO> myPartIssuesResultDTOS = issueVoteDetailDao.myPartIssuesByTopicId(myPartIssueResult.getData().getTopicIds());
myPartIssuesResult.addAll(myPartIssuesResultDTOS);
}
if (CollectionUtils.isEmpty(myPartIssuesResult)){
return new ArrayList<>();
}
List<String> orgIds = myPartIssuesResult.stream().map(m -> m.getGridId()).collect(Collectors.toList());
List<MyPartIssuesResultDTO> collect = myPartIssuesResult.stream().sorted(Comparator.comparing(MyPartIssuesResultDTO::getShiftIssueTime).reversed()).distinct().collect(Collectors.toList());
List<String> orgIds = collect.stream().map(m -> m.getGridId()).collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> listResult = govOrgOpenFeignClient.getGridListByGridIds(orgIds);
if (!listResult.success()){
throw new RenException("查询议题来源网格名称失败......");
}
myPartIssuesResult.forEach(m -> listResult.getData().stream().filter(l -> m.getGridId().equals(l.getGridId())).forEach(l -> m.setTopicReleaseGridName(l.getGridName())));
return myPartIssuesResult;
collect.forEach(m -> listResult.getData().stream().filter(l -> m.getGridId().equals(l.getGridId())).forEach(l -> m.setTopicReleaseGridName(l.getGridName())));
return collect;
}
}

16
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml

@ -88,6 +88,22 @@
ORDER BY i.CREATED_TIME DESC
</select>
<select id="myPartIssuesByTopicId" resultType="com.epmet.dto.result.MyPartIssuesResultDTO">
SELECT
i.ID AS issueId,
i.SUGGESTION,
i.ISSUE_TITLE,
i.GRID_ID AS gridId,
UNIX_TIMESTAMP(i.CREATED_TIME) AS shiftIssueTime
FROM issue i
WHERE i.DEL_FLAG = '0'
AND
<foreach collection="topicIds" item="topicId" separator=" OR ">
i.SOURCE_ID = #{topicId}
</foreach>
ORDER BY i.CREATED_TIME DESC
</select>
<!-- 查询用户对某个议题的表决信息 -->
<select id="selectUserIssueDet" parameterType="map" resultType="com.epmet.dto.IssueVoteDetailDTO">
SELECT

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java

@ -113,4 +113,14 @@ public class CustomerGridDTO implements Serializable {
* 所有上级组织ID
*/
private String pids;
}
/**
* 所属组织机构名
*/
private String agencyName;
/**
* 所有上级组织名
*/
private String allParentName;
}

11
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -3,6 +3,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.CustomerPartyBranchDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -294,4 +295,14 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/customergrid/getgridlistbygridids")
Result<List<AllGridsByUserIdResultDTO>> getGridListByGridIds(List<String> gridIdList);
/**
* @Description 根据网格Id查询用户数据
* @param customerGridFormDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerGridDTO>
* @Author liushaowen
* @Date 2020/11/18 15:34
*/
@PostMapping("/gov/org/customergrid/getcustomergridbygridid")
Result<CustomerGridDTO> getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO);
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.CustomerPartyBranchDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -171,4 +172,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<AllGridsByUserIdResultDTO>> getGridListByGridIds(List<String> gridIdList) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridListByGridIds", gridIdList);
}
@Override
public Result<CustomerGridDTO> getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId", customerGridFormDTO);
}
}

6
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -16,7 +16,9 @@
gr.pids,
gr.longitude,
gr.latitude,
gr.area_code
gr.area_code,
ag.all_parent_name AS allParentName,
ag.ORGANIZATION_NAME AS agencyName
FROM customer_grid gr
LEFT JOIN customer_agency ag
ON gr.PID = ag.ID
@ -541,4 +543,4 @@
ID = #{orgId}
</foreach>
</select>
</mapper>
</mapper>

14
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";
}

10
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;
}

40
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java

@ -0,0 +1,40 @@
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;
/**
* @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;
/**
* 页码
*/
@Min(1)
private Integer pageNo;
/**
* 每页多少条数
*/
@Min(1)
private Integer pageSize;
}

39
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java

@ -0,0 +1,39 @@
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;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EditGroupFormDTO {
// 分组详情校验
public interface GroupDetailVG {}
// 提交组编辑校验组
public interface SubmitGroupEditVG {}
/**
* 组id
*/
@NotBlank(message = "组ID不能为空", groups = { GroupDetailVG.class, SubmitGroupEditVG.class })
private String groupId;
@NotBlank(message = "组头像不能为空", groups = { SubmitGroupEditVG.class })
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;
}

6
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;
}

43
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;
}

21
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;
}

42
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;
}

17
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyPartIssueFormDTO.java

@ -0,0 +1,17 @@
package com.epmet.resi.group.dto.topic.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/17 3:29 下午
*/
@Data
public class MyPartIssueFormDTO implements Serializable {
private static final long serialVersionUID = -632199437101523924L;
private String userId;
}

23
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyPartIssueResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.resi.group.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/11/17 3:30 下午
*/
@Data
public class MyPartIssueResultDTO implements Serializable {
private static final long serialVersionUID = -7726879551303168135L;
private List<String> topicIds;
public MyPartIssueResultDTO() {
this.topicIds = new ArrayList<>();
}
}

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicClosingMsgResultDTO.java

@ -29,4 +29,9 @@ public class ResiTopicClosingMsgResultDTO implements Serializable {
* */
private String closeReason;
/**
* 关闭人头像11-19新增
* */
private String closeUserHeadPhoto;
}

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java

@ -76,5 +76,8 @@ public class ResiTopicIncludeIssueDetailResultDTO implements Serializable {
*/
private List<String> badgeList;
/**
* 话题被屏蔽详情
*/
private TopicHiddenDetailDTO hiddenDetail;
}

35
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicHiddenDetailDTO.java

@ -0,0 +1,35 @@
package com.epmet.resi.group.dto.topic.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* 屏蔽详情11-19新增
*
* @author yinzuomei@elink-cn.com
* @date 2020/11/19 16:44
*/
@Data
public class TopicHiddenDetailDTO implements Serializable {
private static final long serialVersionUID = -2038917156628406348L;
@JsonIgnore
private String operateUserId;
/**
* 屏蔽操作人其实就是组长
* */
private String operateUserName;
/**
* 屏蔽操作人的头像
* */
private String operateUserHeadPhoto;
/**
* 屏蔽时间
* */
private Long hiddenDateTime;
/**
* 屏蔽理由
* */
private String hiddenReason;
}

48
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -1,5 +1,13 @@
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.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO;
@ -8,11 +16,17 @@ import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO;
import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO;
import com.epmet.resi.group.dto.topic.form.MyPartIssueFormDTO;
import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO;
import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO;
import com.epmet.resi.group.dto.topic.result.MyCreateTopicsResultDTO;
import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO;
import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO;
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;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@ -30,6 +44,30 @@ import java.util.List;
//@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class,url = "localhost:8095")
public interface ResiGroupOpenFeignClient {
@PostMapping("/resi/group/group/gov-edit-auditing-list")
Result<List<ApplyingGroupResultDTO>> 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<GroupEditionDetailResultDTO> 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);
/**
* @Description 查询用户参与的且不是自己发表的话题对应的议题Id集合
* @author sun
@ -74,6 +112,16 @@ public interface ResiGroupOpenFeignClient {
@PostMapping("resi/group/topic/select-my-create-topic")
Result<List<String>> selectMyCreateTopic(@RequestBody TopicIdListFormDTO topicIdListFormDTO);
/**
* @Description 查询我评论过的话题
* @Param myPartIssueFormDTO
* @author zxc
* @date 2020/11/17 3:34 下午
*/
@PostMapping("resi/group/topic/myparttopic")
Result<MyPartIssueResultDTO> selectMyPartTopic(@RequestBody MyPartIssueFormDTO myPartIssueFormDTO);
}
/**
* @Description 待审核||已驳回 申请详情
* @Param applicationDetailFormDTO

29
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -1,5 +1,13 @@
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.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
@ -9,8 +17,10 @@ import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO;
import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO;
import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO;
import com.epmet.resi.group.dto.topic.form.MyPartIssueFormDTO;
import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO;
import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO;
import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO;
import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
@ -26,6 +36,20 @@ import java.util.List;
*/
@Component
public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClient {
@Override
public Result<List<ApplyingGroupResultDTO>> govEditAuditingList(CommonGridAndPageFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "govEditAuditingList", param);
}
@Override
public Result<GroupEditionDetailResultDTO> 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);
}
@Override
public Result<List<IssueGridResultDTO>> topicToIssueList(MyPartProjectsFormDTO formDTO) {
@ -52,6 +76,11 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectMyCreateTopic", topicIdListFormDTO);
}
@Override
public Result<MyPartIssueResultDTO> selectMyPartTopic(MyPartIssueFormDTO myPartIssueFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectMyPartTopic", myPartIssueFormDTO);
}
@Override
public Result<ApplicationDetailCopyResultDTO> applicationDetail(ApplicationDetailFormDTO applicationDetailFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "applicationDetail", applicationDetailFormDTO);

5
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
*/

65
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<java.util.List < com.epmet.resi.group.dto.group.GroupProcessingCountResultDTO>>
* @Author yinzuomei
* @Description 传入网格id列表返回每个网格的待审核小组总数
* @Description 传入网格id列表返回每个网格的待审核小组总数+变更小组信息申请数
* @Date 2020/5/13 21:33
**/
@PostMapping("groupprocessingcount")
@ -360,6 +360,69 @@ public class ResiGroupController {
return new Result();
}
/**
* 查询组详情
* @param form
* @return
*/
@PostMapping("get-detail")
public Result getGroupDetail(@RequestBody EditGroupFormDTO form){
ValidatorUtils.validateEntity(form, EditGroupFormDTO.GroupDetailVG.class);
GroupDetailResultDTO groupDetail = resiGroupService.getGroupDetail(form.getGroupId());
return new Result().ok(groupDetail);
}
/**
* 提交小组信息编辑
* @param form
* @return
*/
@PostMapping("submit-edit")
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(), tokenDto.getUserId());
return new Result();
}
/**
* @Description 工作端 查询组变更待审核列表
* @param param
* @return
* @author wangc
* @date 2020.11.03 10:19
*/
@PostMapping("gov-edit-auditing-list")
public Result<List<ApplyingGroupResultDTO>> govEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){
return new Result<List<ApplyingGroupResultDTO>>().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<GroupEditionDetailResultDTO> govEditAuditingDetail(@RequestBody GovGroupSummarizeFromDTO param){
return new Result<GroupEditionDetailResultDTO>().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();
}
/**
* @Description 查询话题所属小组名
* @Param groupInfoFormDTO

92
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java

@ -0,0 +1,92 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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;
/**
* 组编辑提交记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-02
*/
@Mapper
public interface GroupEditSubmitRecordDao extends BaseDao<GroupEditSubmitRecordEntity> {
/**
* 查询指定组指定时间段内的编辑次数
* @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);
/**
* @Description 工作端查询群组修改信息申请列表
* @param gridId
* @return
* @author wangc
* @date 2020.11.03 13:39
*/
List<ApplyingGroupResultDTO> 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);
/**
* @param gridId
* @author yinzuomei
* @description 根据网格id查询 待审核的变更小组信息申请 总数
* @Date 2020/11/13 10:05
**/
Integer selectCountAuditingRec(String gridId);
}

14
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;
/**
@ -197,6 +198,19 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
*/
TopicInfoResultDTO selectTopicInfo(@Param("topicId") String topicId);
/**
* 编辑提交的时候检查组名是否存在网格内检查
* 检查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);
/**
* @Description 查询话题所属小组名
* @Param groupInfoFormDTO

101
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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 String 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;
/**
* 审核人员查看待审核列表时的文案 :党员李华申请变更小组原小组名请审核
*/
private String messageText;
/**
* 已读read 未读unread
*/
private String readFlag;
}

47
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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;
}
}

36
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) {
@ -124,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
@ -215,4 +233,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<String> userParam = new LinkedList<>(); userParam.add(userId);
Result<List<UserBaseInfoResultDTO>> userCacheResult = epmetUserOpenFeignClient.queryUserBaseInfo(userParam);
if(userCacheResult.success() && !CollectionUtils.isEmpty(userCacheResult.getData())){
return userCacheResult.getData().iterator().next().getRealName();
}
return null;
}
}

31
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -294,6 +294,37 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
*/
List<RecommendedListResultDTO> recommendedList(RecommendedListFormDTO formDTO);
GroupDetailResultDTO getGroupDetail(String groupId);
void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId);
/**
* @Description 工作端 查询组变更待审核列表
* @param param
* @return
* @author wangc
* @date 2020.11.03 10:19
*/
List<ApplyingGroupResultDTO> 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);
/**
* @Description 查询话题所属小组名
* @Param groupInfoFormDTO

416
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -28,9 +28,13 @@ 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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
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;
@ -40,8 +44,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;
@ -54,25 +60,25 @@ 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.*;
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.*;
@ -127,6 +133,27 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@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<ResiGroupDTO> page(Map<String, Object> params) {
IPage<ResiGroupEntity> page = baseDao.selectPage(
@ -338,38 +365,45 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
logger.info(String.format("创建小组异常:%s",EpmetErrorCode.GROUP_ALREADY_EXISTED.getMsg()));
throw new RenException(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode());
}
//2.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())) {
//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;
}
//2.2、插入一条待审核的组信息
}
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);
//3.获取居民注册信息
UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO();
resiParam.setCustomerId(applyCreateGroupFormDTO.getCustomerId());
resiParam.setUserId(applyCreateGroupFormDTO.getUserId());
Result<UserResiInfoResultDTO> 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<UserResiInfoResultDTO> 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);
@ -377,7 +411,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupOperation.setMessageText(msg);
resiGroupOperation.setReadFlag(ModuleConstant.UNREAD);
resiGroupOperationService.save(resiGroupOperation);
//4、插入一群成员信息(群主)
//5、插入一群成员信息(群主)
ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO();
resiGroupMemberDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId());
resiGroupMemberDTO.setResiGroupId(resiGroupEntity.getId());
@ -385,7 +419,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupMemberDTO.setStatus(MemberStateConstant.UNDER_AUDITTING);
resiGroupMemberDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED);
resiGroupMemberService.save(resiGroupMemberDTO);
//5、插入一条入群记录(群主的)
//6、插入一条入群记录(群主的)
GroupMemeberOperationDTO groupMemeberOperationDTO = new GroupMemeberOperationDTO();
groupMemeberOperationDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId());
groupMemeberOperationDTO.setGroupId(resiGroupEntity.getId());
@ -393,7 +427,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
groupMemeberOperationDTO.setOperateUserId(applyCreateGroupFormDTO.getUserId());
groupMemeberOperationDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED);
groupMemeberOperationService.save(groupMemeberOperationDTO);
//6、群初始统计记录
//7、群初始统计记录
/*UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(),
applyCreateGroupFormDTO.getUserId(),
applyCreateGroupFormDTO.getCustomerId(),
@ -856,7 +890,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
for(String gridId:gridIdList){
GroupProcessingCountResultDTO resultDTO=new GroupProcessingCountResultDTO();
resultDTO.setGridId(gridId);
Integer auditingCount=resiGroupRedis.getWorkGrassrootsGroupRedDotValue(gridId);
Integer auditingCreateGroupCount=resiGroupRedis.getWorkGrassrootsGroupRedDotValue(gridId);
Integer auditingGroupEditRecordCount=groupEditSubmitRecordDao.selectCountAuditingRec(gridId);
Integer auditingCount=auditingCreateGroupCount+auditingGroupEditRecordCount;
if (null == auditingCount) {
resultDTO.setCount(0);
} else {
@ -1027,4 +1063,306 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
public List<GroupInfoResultDTO> selectGroupInfo(GroupInfoFormDTO groupInfoFormDTO) {
return baseDao.selectGroupInfo(groupInfoFormDTO.getTopicIds());
}
@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<UserRoleResultDTO> 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<UserResiInfoResultDTO> 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<UserRoleResultDTO> 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<List<UserRoleResultDTO>> rolesResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO);
if (! rolesResult.success()) {
logger.error("修改组信息:查询居民角色失败,详情:{}", rolesResult.getInternalMsg());
throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), "查询居民角色失败");
} else {
List<UserRoleResultDTO> 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<SyncScanResult> 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<SyncScanResult> 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<ApplyingGroupResultDTO> 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());
}
}

11
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java

@ -326,5 +326,16 @@ public class ResiTopicController {
return new Result<List<String>>().ok(topicService.selectMyCreateTopic(topicIdListFormDTO));
}
/**
* @Description 查询我评论过的话题
* @Param myPartIssueFormDTO
* @author zxc
* @date 2020/11/17 3:34 下午
*/
@PostMapping("myparttopic")
public Result<MyPartIssueResultDTO> selectMyPartTopic(@RequestBody MyPartIssueFormDTO myPartIssueFormDTO){
return new Result<MyPartIssueResultDTO>().ok(topicService.selectMyPartTopic(myPartIssueFormDTO));
}
}

13
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java

@ -22,11 +22,8 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.topic.entity.ResiTopicEntity;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.TopicInfoDTO;
import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO;
import com.epmet.resi.group.dto.topic.form.*;
import com.epmet.resi.group.dto.topic.result.*;
import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -179,6 +176,14 @@ public interface ResiTopicDao extends BaseDao<ResiTopicEntity> {
* @date 2020/11/13 4:32 下午
*/
List<String> selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO);
/**
* @Description 查询我评论过的话题
* @Param myPartIssueFormDTO
* @author zxc
* @date 2020/11/17 3:34 下午
*/
List<String> selectMyPartTopic(MyPartIssueFormDTO myPartIssueFormDTO);
/**
* 获取小组内话题ID
* @author zhaoqifeng

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java

@ -297,6 +297,14 @@ public interface ResiTopicService extends BaseService<ResiTopicEntity> {
* @date 2020/11/13 4:32 下午
*/
List<String> selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO);
/**
* @Description 查询我评论过的话题
* @Param myPartIssueFormDTO
* @author zxc
* @date 2020/11/17 3:34 下午
*/
MyPartIssueResultDTO selectMyPartTopic(MyPartIssueFormDTO myPartIssueFormDTO);
/**
* 获取小组内话题ID
* @author zhaoqifeng

157
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
@ -84,9 +85,9 @@ import com.epmet.resi.group.dto.topic.TopicInfoDTO;
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 com.epmet.resi.group.dto.topic.result.CheckTopicPublisherResultDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -381,31 +382,33 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//3.用户徽章
//3.1首先需要拿到客户Id
ResiGroupEntity group = resiGroupDao.selectById(groupId);
if(null != group && StringUtils.isNotBlank(group.getCustomerId())){
Result<Map<String, List<UserBadgeUnitFormDTO>>> badgeR
= userOpenFeignClient.userShowBadge(
new UserGroupFormDTO(group.getCustomerId(),
latestTenTopics.stream()
.filter(top -> StringUtils.equals("other",top.getReleaseUserFlag()))
.map(ResiTopicIncludeIssueInfoResultDTO::getUserId)
.distinct().collect(Collectors.toList())));
if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){
Map<String, List<UserBadgeUnitFormDTO>> badgeM = badgeR.getData();
latestTenTopics.forEach(top -> {
if(StringUtils.equals("other",top.getReleaseUserFlag())){
top.setBadgeList(
CollectionUtils.isEmpty(badgeM.get(top.getUserId())) ?
Collections.EMPTY_LIST :
badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList())
);
}else top.setBadgeList(Collections.EMPTY_LIST);
});
}else latestTenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST));
List<String> other = latestTenTopics.stream()
.filter(top -> StringUtils.equals("other", top.getReleaseUserFlag()))
.map(ResiTopicIncludeIssueInfoResultDTO::getUserId)
.distinct().collect(Collectors.toList());
if(!CollectionUtils.isEmpty(other)) {
ResiGroupEntity group = resiGroupDao.selectById(groupId);
if (null != group && StringUtils.isNotBlank(group.getCustomerId())) {
Result<Map<String, List<UserBadgeUnitFormDTO>>> badgeR
= userOpenFeignClient.userShowBadge(
new UserGroupFormDTO(group.getCustomerId(),other));
if (null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()) {
Map<String, List<UserBadgeUnitFormDTO>> badgeM = badgeR.getData();
latestTenTopics.forEach(top -> {
if (StringUtils.equals("other", top.getReleaseUserFlag())) {
top.setBadgeList(
CollectionUtils.isEmpty(badgeM.get(top.getUserId())) ?
Collections.EMPTY_LIST :
badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO::getBadgeIcon).collect(Collectors.toList())
);
} else top.setBadgeList(Collections.EMPTY_LIST);
});
}
} else latestTenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST));
}
}
}
return new Result<List<ResiTopicIncludeIssueInfoResultDTO>>().ok(latestTenTopics);
@ -437,15 +440,16 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//3.用户徽章
//3.1首先需要拿到客户Id
List<String> other = pastTopics.stream()
.filter(top -> StringUtils.equals("other",top.getReleaseUserFlag()))
.map(ResiTopicIncludeIssueInfoResultDTO::getUserId)
.distinct().collect(Collectors.toList());
if(!CollectionUtils.isEmpty(other)){
ResiGroupEntity group = resiGroupDao.selectById(topicPageFormDTO.getGroupId());
if(null != group && StringUtils.isNotBlank(group.getCustomerId())){
Result<Map<String, List<UserBadgeUnitFormDTO>>> badgeR
= userOpenFeignClient.userShowBadge(
new UserGroupFormDTO(group.getCustomerId(),
pastTopics.stream()
.filter(top -> StringUtils.equals("other",top.getReleaseUserFlag()))
.map(ResiTopicIncludeIssueInfoResultDTO::getUserId)
.distinct().collect(Collectors.toList())));
new UserGroupFormDTO(group.getCustomerId(),other));
if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){
Map<String, List<UserBadgeUnitFormDTO>> badgeM = badgeR.getData();
pastTopics.forEach(top -> {
@ -462,7 +466,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
}
}
}
@ -672,6 +676,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
closeDetail.setCloseReason(ModuleConstant.EMPTY_STR);
closeDetail.setCloseUserName(ModuleConstant.EMPTY_STR);
closeDetail.setCloseDateTime(NumConstant.MINUS_ONE_L);
closeDetail.setCloseUserHeadPhoto(StrConstant.EPMETY_STR);
if(StringUtils.equals(ModuleConstant.TOPIC_STATUS_CLOSED,topicDetail.getStatus())){
QueryWrapper<ResiTopicOperationEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
@ -691,11 +696,37 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
resiGroupMemberRedis.get(topicDetail.getGroupId(),records.get(0).getCreatedBy());
if(null != closedBy){
closeDetail.setCloseUserName(closedBy.getUserShowName());
closeDetail.setCloseUserHeadPhoto(closedBy.getUserHeadPhoto());
}
}
}
resultDTO.setCloseDetail(closeDetail);
//话题屏蔽详情
if(StringUtils.equals(TopicConstant.HIDDEN,topicDetail.getStatus())){
TopicHiddenDetailDTO hiddenDetailDTO=new TopicHiddenDetailDTO();
hiddenDetailDTO.setHiddenDateTime(NumConstant.MINUS_ONE_L);
hiddenDetailDTO.setHiddenReason(StrConstant.EPMETY_STR);
hiddenDetailDTO.setOperateUserName(StrConstant.EPMETY_STR);
QueryWrapper<ResiTopicOperationEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
queryWrapper.eq(ModuleConstant.FILED_TOPIC_ID,topicDetail.getId());
queryWrapper.eq(ModuleConstant.FIELD_OPERATION_TYPE,TopicConstant.HIDDEN);
queryWrapper.orderByDesc(FieldConstant.CREATED_TIME);
List<ResiTopicOperationEntity> records =
resiTopicOperationDao.selectList(queryWrapper);
if(null != records && records.size() > NumConstant.ZERO){
hiddenDetailDTO.setHiddenReason(String.format("%s%s",ModuleConstant.HIDDEN_TOPIC_REASON_PREFIX,records.get(0).getOperationReason()));
hiddenDetailDTO.setHiddenDateTime(records.get(0).getCreatedTime().getTime()/NumConstant.ONE_THOUSAND);
ResiGroupMemberInfoRedisDTO hiddenBy =
resiGroupMemberRedis.get(topicDetail.getGroupId(),records.get(0).getCreatedBy());
if (null != hiddenBy && StringUtils.isNotBlank(hiddenBy.getUserShowName())) {
hiddenDetailDTO.setOperateUserName(hiddenBy.getUserShowName());
hiddenDetailDTO.setOperateUserHeadPhoto(hiddenBy.getUserHeadPhoto());
}
resultDTO.setHiddenDetail(hiddenDetailDTO);
}
}
//4.获取用户徽章的信息
List<String> userId = new LinkedList<>();userId.add(topicDetail.getCreatedBy());
String customerId;
@ -747,32 +778,33 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//3.用户徽章
//3.1首先需要拿到客户Id
ResiGroupEntity group = resiGroupDao.selectById(topicPageFormDTO.getGroupId());
if(null != group && StringUtils.isNotBlank(group.getCustomerId())){
Result<Map<String, List<UserBadgeUnitFormDTO>>> badgeR
= userOpenFeignClient.userShowBadge(
new UserGroupFormDTO(group.getCustomerId(),
hiddenTopics.stream()
.filter(top -> StringUtils.equals("other",top.getReleaseUserFlag()))
.map(ResiTopicInfoResultDTO::getUserId)
.distinct().collect(Collectors.toList())));
if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){
Map<String, List<UserBadgeUnitFormDTO>> badgeM = badgeR.getData();
hiddenTopics.forEach(top -> {
if(StringUtils.equals("other",top.getReleaseUserFlag())){
top.setBadgeList(
CollectionUtils.isEmpty(badgeM.get(top.getUserId())) ?
Collections.EMPTY_LIST :
badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList())
);
}else top.setBadgeList(Collections.EMPTY_LIST);
});
List<String> other = hiddenTopics.stream()
.filter(top -> StringUtils.equals("other",top.getReleaseUserFlag()))
.map(ResiTopicInfoResultDTO::getUserId)
.distinct().collect(Collectors.toList());
if(!CollectionUtils.isEmpty(other)) {
ResiGroupEntity group = resiGroupDao.selectById(topicPageFormDTO.getGroupId());
if (null != group && StringUtils.isNotBlank(group.getCustomerId())) {
Result<Map<String, List<UserBadgeUnitFormDTO>>> badgeR
= userOpenFeignClient.userShowBadge(
new UserGroupFormDTO(group.getCustomerId(), other));
if (null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()) {
Map<String, List<UserBadgeUnitFormDTO>> badgeM = badgeR.getData();
hiddenTopics.forEach(top -> {
if (StringUtils.equals("other", top.getReleaseUserFlag())) {
top.setBadgeList(
CollectionUtils.isEmpty(badgeM.get(top.getUserId())) ?
Collections.EMPTY_LIST :
badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO::getBadgeIcon).collect(Collectors.toList())
);
} else top.setBadgeList(Collections.EMPTY_LIST);
});
}else hiddenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST));
} else hiddenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST));
}
}
}
return new Result<List<ResiTopicInfoResultDTO>>().ok(hiddenTopics);
@ -911,9 +943,6 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
@Override
public Result<List<ResiTopicInfoResultDTO>> getPastTopicListGov(ResiTopicPageFormDTO topicPageFormDTO) {
//1.查询历史话题列表
topicPageFormDTO.setUserId(topicPageFormDTO.getUserId());
topicPageFormDTO.setPageNo((topicPageFormDTO.getPageNo() - NumConstant.ONE) * topicPageFormDTO.getPageSize());
List<ResiTopicInfoResultDTO> pastTopics =
@ -961,7 +990,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
**/
@Override
public Result<List<ResiTopicInfoResultDTO>> getHiddenTopicsGov(ResiTopicPageFormDTO topicPageFormDTO) {
return getHiddenTopics(null,topicPageFormDTO);
topicPageFormDTO.setStatus("hidden");
return getPastTopicListGov(topicPageFormDTO);
}
@Override
@ -1632,6 +1662,23 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
public List<String> selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO) {
return baseDao.selectMyCreateTopic(topicIdListFormDTO);
}
/**
* @Description 查询我评论过的话题
* @Param myPartIssueFormDTO
* @author zxc
* @date 2020/11/17 3:34 下午
*/
@Override
public MyPartIssueResultDTO selectMyPartTopic(MyPartIssueFormDTO myPartIssueFormDTO) {
List<String> topicIds = baseDao.selectMyPartTopic(myPartIssueFormDTO);
if (CollectionUtils.isEmpty(topicIds)){
return new MyPartIssueResultDTO();
}
MyPartIssueResultDTO myPartIssueResultDTO = new MyPartIssueResultDTO();
myPartIssueResultDTO.setTopicIds(topicIds);
return myPartIssueResultDTO;
}
/**
* 获取小组内话题ID
*

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java

@ -336,5 +336,17 @@ public interface ModuleConstant extends Constant {
String CLOSED_TOPIC_REASON_PREFIX = "话题已关闭:";
String HIDDEN_TOPIC_REASON_PREFIX = "话题已屏蔽:";
String CREATE_ISSUE_ERROR = "创建议题失败";
/**
* 审核操作 同意
*/
String AUDITING_OPERATION_APPROVAL = "approved";
/**
* 审核操作 拒绝
*/
String AUDITING_OPERATION_REJECT = "rejected";
}

24
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 ='组编辑提交记录表'

150
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.modules.group.dao.GroupEditSubmitRecordDao">
<sql id="table_columns">
id,
group_id,
customer_id,
grid_id,
group_head_photo,
group_name,
group_introduction,
audit_status,
staff_id,
remark,
audit_time,
read_flag,
message_text,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
</sql>
<resultMap type="com.epmet.modules.group.entity.GroupEditSubmitRecordEntity" id="groupEditSubmitRecordMap">
<result property="id" column="ID"/>
<result property="groupId" column="GROUP_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="groupHeadPhoto" column="GROUP_HEAD_PHOTO"/>
<result property="groupName" column="GROUP_NAME"/>
<result property="groupIntroduction" column="GROUP_INTRODUCTION"/>
<result property="auditStatus" column="AUDIT_STATUS"/>
<result property="staffId" column="STAFF_ID"/>
<result property="remark" column="REMARK"/>
<result property="auditTime" column="AUDIT_TIME"/>
<result property="messageText" column="MESSAGE_TEXT" />
<result property="readFlag" column="READ_FLAG" />
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="countEditNum" resultType="java.lang.Integer">
select count(1)
from group_edit_submit_record
where GROUP_ID = #{groupId}
and CREATED_TIME between #{monthStart} and #{monthEnd}
and DEL_FLAG=0
</select>
<select id="getLatestEditSubmitRecord" resultType="com.epmet.modules.group.entity.GroupEditSubmitRecordEntity">
select
<include refid="table_columns"/>
from group_edit_submit_record
where
DEL_FLAG=0
and group_id = #{groupId}
order by CREATED_TIME desc
limit 1
</select>
<!-- 作端查询群组修改信息申请列表 -->
<select id="selectGroupEditApplyList" resultType="com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO">
SELECT
edit.GROUP_ID,
groupp.GROUP_NAME,
groupp.GROUP_HEAD_PHOTO,
edit.READ_FLAG,
edit.MESSAGE_TEXT,
DATE_FORMAT( edit.CREATED_TIME, '%Y-%m-%d %H:%i' ) AS createdTime
FROM
group_edit_submit_record edit
LEFT JOIN resi_group groupp ON edit.GROUP_ID = groupp.ID
WHERE
edit.DEL_FLAG = '0'
AND edit.GRID_ID = #{gridId}
AND edit.AUDIT_STATUS = 'under_auditing'
AND edit.STAFF_ID IS NULL
ORDER BY edit.CREATED_TIME DESC
</select>
<!-- 查询小组修改信息详情 -->
<select id="selectEditDetail" resultType="com.epmet.modules.group.entity.GroupEditSubmitRecordEntity">
SELECT
ID,
GROUP_ID,
GROUP_NAME,
GROUP_HEAD_PHOTO,
GROUP_INTRODUCTION,
CREATED_BY,
GRID_ID
FROM
group_edit_submit_record
WHERE
DEL_FLAG = '0'
AND GROUP_ID = #{groupId}
<choose>
<when test='null == auditResult or "" == auditResult'>
AND AUDIT_STATUS = 'under_auditing'
</when>
<otherwise>
AND AUDIT_STATUS = #{auditResult}
</otherwise>
</choose>
ORDER BY CREATED_TIME DESC
LIMIT 1
</select>
<update id="updateAuditResult">
UPDATE
group_edit_submit_record
SET
AUDIT_STATUS = #{auditStatus},
STAFF_ID = #{staffId},
<if test='null != remark and "" != remark'>
REMARK = #{remark},
</if>
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
</update>
<!-- 根据网格id查询 待审核的变更小组信息申请 总数 -->
<select id="selectCountAuditingRec" resultType="java.lang.Integer">
SELECT
count( 1 ) AS total
FROM
group_edit_submit_record m
WHERE
m.DEL_FLAG = '0'
AND m.AUDIT_STATUS = 'under_auditting'
AND m.GRID_ID = #{gridId}
</select>
</mapper>

21
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -398,6 +398,27 @@
</foreach>
</select>
<select id="countExistsGroupNameBeforeEdit" resultType="java.lang.Integer">
select sum(t.c) num
from (
select count(1) c
from resi_group g
where g.GROUP_NAME = #{groupName}
and g.DEL_FLAG = 0
and g.GRID_ID = #{gridId}
and g.ID != #{groupId}
and g.STATE in ('approved', 'under_auditting')
union all
select count(1) c
from group_edit_submit_record esr
where esr.GROUP_ID != #{groupId}
and esr.GRID_ID = #{gridId}
and esr.GROUP_NAME = #{groupName}
and esr.AUDIT_STATUS = 'under_auditting'
and esr.DEL_FLAG = 0
) t
</select>
<!-- 查询话题所属小组名 -->
<select id="selectGroupInfo" resultType="com.epmet.resi.group.dto.group.result.GroupInfoResultDTO">
SELECT

13
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

@ -488,6 +488,7 @@
resi_topic topic LEFT JOIN resi_group groupp ON topic.group_id = groupp.ID AND groupp.del_flag = '0' AND groupp.customer_id = #{customerId}
WHERE
topic.del_flag = '0'
and topic.`STATUS`!='hidden'
AND
topic.id IN (
SELECT DISTINCT topic_id FROM resi_topic_comment WHERE
@ -508,6 +509,18 @@
AND STATUS = 'discussing'
AND created_by = #{userId}
</select>
<!-- 查询我评论过的话题 -->
<select id="selectMyPartTopic" resultType="java.lang.String">
SELECT
DISTINCT(rt.ID) AS topicIds
FROM resi_topic rt
LEFT JOIN resi_topic_comment rtc ON rtc.TOPIC_ID = rt.ID
WHERE rt.DEL_FLAG = '0'
AND rtc.DEL_FLAG = '0'
AND rt.CREATED_BY != #{userId}
AND rtc.CREATED_BY = #{userId}
</select>
<select id="selectTopicIdsByGroup" resultType="java.lang.String">
select ID
FROM resi_topic

2
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java

@ -63,7 +63,7 @@ public class IssueController {
* @author zxc
* @date 2020/11/11 9:24 上午
*/
@PostMapping("my-pub-issues/auditing")
@PostMapping("my-pub-issues/voting")
public Result<List<MyPubIssuesAuditingResultDTO>> myPubIssuesAuditing(@LoginUser TokenDto tokenDto, @RequestBody MyPubIssuesAuditingFormDTO myPubIssuesAuditingFormDTO){
ValidatorUtils.validateEntity(myPubIssuesAuditingFormDTO, MyPubIssuesAuditingFormDTO.MyPubIssuesAuditing.class);
return new Result<List<MyPubIssuesAuditingResultDTO>>().ok(issueService.myPubIssuesAuditing(tokenDto,myPubIssuesAuditingFormDTO));

24
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -23,7 +23,6 @@ import com.epmet.modules.feign.ResiGroupFeignClient;
import com.epmet.modules.partymember.entity.*;
import com.epmet.modules.partymember.redis.PartymemberInfoRedis;
import com.epmet.modules.partymember.service.*;
import com.epmet.modules.warmhearted.constant.ResiWarmUserMessageConstant;
import com.epmet.modules.warmhearted.constant.ResiWarmheartedConstant;
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant;
import com.epmet.redis.ResiPartyMemberRedis;
@ -250,6 +249,8 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
resiGroupFeignClient.updateWhenAuditedResiRole(identityParam);
//addby jianjun 2020-07-31 之前没有成功的返回结果
result = new Result<>().ok("注册成功");
//添加党员徽章信息
this.addUserPartyBadge(partyMemberInfoDTO.getUserId());
}
//将自动认证结果存入党员认证自动审核表
@ -280,6 +281,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
baseInfo.setName(partyMemberInfoDTO.getName());
epmetUserOpenFeignClient.saveUserBaseInfo(baseInfo);
return result;
}
@ -346,11 +348,13 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
identityParam.setPartyFlag(NumConstant.ONE_STR);
resiGroupFeignClient.updateWhenAuditedResiRole(identityParam);
//如果是自动匹配失败的,人工审核他是党员,需要记录党员库-居民的认证关系
PartymemberConfirmAutoDTO partymemberConfirmAutoDTO=partymemberConfirmAutoService.get(fromDTO.getAutoId());
if(partymemberConfirmAutoDTO!=null){
log.info(String.format("自动匹配失败,人工审核是党员,保存partymember_auth_record,userId=%s,党员库id=%s",partyMemberInfoEntity.getUserId(),partymemberConfirmAutoDTO.getPatryMemberBaseInfoId()));
partymemberAuthRecordService.insert(partyMemberInfoEntity,partymemberConfirmAutoDTO.getPatryMemberBaseInfoId());
PartymemberConfirmAutoDTO partymemberConfirmAutoDTO = partymemberConfirmAutoService.get(fromDTO.getAutoId());
if (partymemberConfirmAutoDTO != null) {
log.info(String.format("自动匹配失败,人工审核是党员,保存partymember_auth_record,userId=%s,党员库id=%s", partyMemberInfoEntity.getUserId(), partymemberConfirmAutoDTO.getPatryMemberBaseInfoId()));
partymemberAuthRecordService.insert(partyMemberInfoEntity, partymemberConfirmAutoDTO.getPatryMemberBaseInfoId());
}
//在徽章记录表中添加 徽章记录 表明此时已经认证通过可以点亮徽章了
addUserPartyBadge(partyMemberInfoEntity.getUserId());
} else {
auditMessageToResi(partyMemberInfoEntity, PartyMemberMessageConstant.AUDIT_REJECT_MSG);
}
@ -359,6 +363,16 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
return new Result();
}
private void addUserPartyBadge(String partyUserId) {
if (StringUtils.isBlank(partyUserId)) {
throw new RenException("addUserPartyBadge,用户Id不能为空");
}
Result<Boolean> result = epmetUserOpenFeignClient.initBadge(partyUserId);
if (result == null || !result.success()) {
throw new RenException("初始化党员徽章信息失败");
}
}
@Override
public Result<AuditingDetailResultDTO> auditingDetail(AuditingDetailFromDTO fromDTO) {
AuditingDetailResultDTO resultDTO = new AuditingDetailResultDTO();

2
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java

@ -36,7 +36,7 @@ public interface BadgeConstant {
String GET_BADGE_NAME_FAILURE = "获取徽章名称失败......";
String MESSAGE_CONTENT = "您好,您的%s因认证失败未成功点亮,请查看";
String MESSAGE_CONTENT = "%s申请认证%s,请审核";
String READ_FLAG = "unread";

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeDTO.java

@ -63,6 +63,11 @@ public class BadgeDTO implements Serializable {
*/
private String badgeStatus;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识 1删除0未删除
*/

6
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java

@ -98,4 +98,10 @@ public class ResiUserBadgeDTO implements Serializable {
*/
private Date updatedTime;
public ResiUserBadgeDTO() {
this.delFlag = "0";
this.revision = 0;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

24
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddUserPartyBadgeFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/4 9:47
*/
@NoArgsConstructor
@Data
public class AddUserPartyBadgeFormDTO implements Serializable {
private static final long serialVersionUID = -6890701885153412660L;
/**
* 用户Id
*/
@NotBlank(message = "用户Id不能为空")
private String userId;
}

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java

@ -27,6 +27,7 @@ public class CertificationAddFormDTO implements Serializable {
/**
* 徽章ID
*/
@NotBlank(message = "徽章ID不能为空", groups = {CertificationAdd.class})
private String badgeId;
/**

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java

@ -28,4 +28,8 @@ public class BadgeListResultDTO {
* 徽章状态 上线:online;下线:offline;
*/
private String badgeStatus;
/**
* 固有徽章类型 党员徽章party;none
*/
private String type;
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberUserIdsResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/18 下午1:47
*/
@Data
public class PartyMemberUserIdsResultDTO implements Serializable {
private static final long serialVersionUID = -6932505684417996587L;
private String userId;
private Boolean reStatus;
public PartyMemberUserIdsResultDTO() {
this.reStatus = false;
}
}

6
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
@ -39,11 +40,16 @@ public class UserBadgeListResultDTO implements Serializable {
private String fixationBadgeType;
@JsonIgnore
private Boolean status;
@JsonIgnore
private Integer sort;
@JsonIgnore
private Long updatedTime;
public UserBadgeListResultDTO() {
this.badgeId = "";
this.badgeIcon = "";
this.isOpened = "0";
this.status = false;
this.updatedTime = 0L;
}
}

2
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;

17
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserIdAndBadgeIdResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/20 上午9:54
*/
@Data
public class UserIdAndBadgeIdResultDTO implements Serializable {
private String userId;
private String badgeId;
}

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java

@ -55,6 +55,8 @@ public class UserOperListResultDTO implements Serializable {
private String isOpened;
@JsonIgnore
private String auditStatus;
@JsonIgnore
private Integer sort;
public UserOperListResultDTO() {
this.badgeId = "";

7
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java

@ -12,11 +12,6 @@ import java.io.Serializable;
@Data
public class UserResiInfoResultDTO implements Serializable {
/**
* 唯一标识
*/
private String id;
/**
* 用户Id(主键) user.id
*/
@ -61,4 +56,6 @@ public class UserResiInfoResultDTO implements Serializable {
* 用户头像
*/
private String headPhoto;
private String nickName;
}

22
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -232,7 +232,7 @@ public interface EpmetUserOpenFeignClient {
*
* @param tokenDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.ResiUserBaseInfoResultDTO>
* @Author zhangyong
* @Author zhangyong 直接取的 user_base_info
* @Date 14:10 2020-07-30
**/
@PostMapping("/epmetuser/userbaseinfo/selectuserbaseinfo")
@ -317,7 +317,7 @@ public interface EpmetUserOpenFeignClient {
/**
* @Author sun
* @Description 居民端-查询用户基础信息
* @Description 居民端-查询用户基础信息 返回值只有userId openId
**/
@PostMapping(value = "epmetuser/user/getuserbasicinfo")
Result<UserBasicInfo> getUserBasicInfo(@RequestBody UserBasicInfoFormDTO formDTO);
@ -439,14 +439,26 @@ public interface EpmetUserOpenFeignClient {
* @date 2020.11.10 15:59
*/
@PostMapping("/epmetuser/badge/usershowbadge")
Result<Map<String,List<UserBadgeUnitFormDTO>>> userShowBadge(@RequestBody UserGroupFormDTO param);
Result<Map<String, List<UserBadgeUnitFormDTO>>> userShowBadge(@RequestBody UserGroupFormDTO param);
/**
* @param gridIdList
* @author yinzuomei
* @description 根据网格id,查询每个网格有多少个徽章申请
* @description 根据网格id, 查询每个网格有多少个徽章申请
* @Date 2020/11/12 15:41
**/
@PostMapping(value = "/epmetuser/badge/querygridauditingbadgecount",consumes = MediaType.APPLICATION_JSON_VALUE)
@PostMapping(value = "/epmetuser/badge/querygridauditingbadgecount", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<GridAuditingBadgeCountResultDTO>> queryGridAuditingBadgeCount(@RequestBody List<String> gridIdList);
/**
* @param userId
* @author yinzuomei
* @description 党员认证成功后 添加userBadge记录到数据库
* @Date 2020/11/12 15:41
**/
@PostMapping(value = "/epmetuser/more/badge/initbadge")
Result<Boolean> initBadge(@RequestParam String userId);
@PostMapping(value = "epmetuser/staffrole/specificrolesstaffs", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<String>> specificRolesStaffs(RolesUsersListFormDTO rolesUsersListFormDTO);
}

10
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -316,4 +316,14 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<List<GridAuditingBadgeCountResultDTO>> queryGridAuditingBadgeCount(List<String> gridIdList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryGridAuditingBadgeCount", gridIdList);
}
@Override
public Result<Boolean> initBadge(String partyUserId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "initBadge", partyUserId);
}
@Override
public Result<List<String>> specificRolesStaffs(RolesUsersListFormDTO rolesUsersListFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "specificRolesStaffs", rolesUsersListFormDTO);
}
}

1
epmet-user/epmet-user-server/pom.xml

@ -194,6 +194,7 @@
<nacos.ip/>
<spring.flyway.enabled>false</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c

2
epmet-user/epmet-user-server/src/main/java/com/epmet/constant/BadgeMessageConstant.java

@ -15,7 +15,7 @@ public interface BadgeMessageConstant {
/**
* 审核通过消息模板
*/
String APPROVED_MSG = "您好,您提交的%s申请已通过,请查看。";
String APPROVED_MSG = "您好,您的%s认证通过并点亮,请查看。";
/**
* 审核驳回消息模板
*/

16
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java

@ -167,15 +167,13 @@ public class BadgeController {
}
/**
* @param gridIdList
* @author yinzuomei
* @description 根据网格id, 查询每个网格有多少个徽章申请单
* @Date 2020/11/12 15:51
**/
@PostMapping("querygridauditingbadgecount")
public Result<List<GridAuditingBadgeCountResultDTO>> queryGridAuditingBadgeCount(@RequestBody List<String> gridIdList){
* @param gridIdList
* @author yinzuomei
* @description 根据网格id, 查询每个网格有多少个徽章申请单
* @Date 2020/11/12 15:51
**/
@PostMapping("querygridauditingbadgecount")
public Result<List<GridAuditingBadgeCountResultDTO>> queryGridAuditingBadgeCount(@RequestBody List<String> gridIdList) {
return new Result<List<GridAuditingBadgeCountResultDTO>>().ok(badgeService.queryGridAuditingBadgeCount(gridIdList));
}
}

19
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java

@ -11,10 +11,7 @@ import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.dto.result.UserOperListResultDTO;
import com.epmet.service.UserBadgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -59,6 +56,7 @@ public class UserBadgeController {
*/
@PostMapping("authbadgerecord")
public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){
ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class);
return userBadgeService.authBadgeRecord(certificationAddFormDTO);
}
@ -107,9 +105,20 @@ public class UserBadgeController {
* @date 2020/11/4 5:47 下午
*/
@PostMapping("openedorclosed")
public Result openedOrClosed(@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO){
public Result openedOrClosed(@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO) {
userBadgeService.openedOrClosed(openedOrClosedFormDTO);
return new Result();
}
/**
* @Description 初始化党员徽章 党员认证通过后添加党员 徽章记录
* @Param userId
* @author zxc
* @date 2020/11/18 下午3:03
*/
@PostMapping("initbadge")
public Result initPartyMemberBadge(@RequestParam(required = false) String userId,@LoginUser TokenDto tokenDto) {
userBadgeService.initPartyMemberBadge(userId,tokenDto);
return new Result();
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java

@ -146,7 +146,7 @@ public class UserController {
/**
* @Author sun
* @Description 居民端-查询用户基础信息
* @Description 居民端-查询用户基础信息 返回值只有userId openId
**/
@PostMapping("getuserbasicinfo")
public Result<UserBasicInfo> getUserBasicInfo(@RequestBody UserBasicInfoFormDTO formDTO){

33
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java

@ -153,7 +153,7 @@ public interface BadgeDao extends BaseDao<BadgeEntity> {
/**
* 插入数据
*
* @param entity
* @param dto
* @return void
* @author zhaoqifeng
* @date 2020/11/6 14:46
@ -166,5 +166,34 @@ public interface BadgeDao extends BaseDao<BadgeEntity> {
* @description 根据网格id, 查询每个网格有多少个徽章申请
* @Date 2020/11/12 15:59
**/
List<GridAuditingBadgeCountResultDTO> queryGridAuditingBadgeCount(@Param("gridIdList") List<String> gridIdList);
List<GridAuditingBadgeCountResultDTO> queryGridAuditingBadgeCount(@Param("gridIdList") List<String> gridIdList);
/**
* desc: 获取党员徽章Id
*
* @param customerId
* @return java.lang.String
* @author LiuJanJun
* @date 2020/11/18 10:43 上午
*/
String getPartyBadgeId(@Param("customerId") String customerId);
/**
* @Description 查询徽章名称
* @Param customerId
* @Param badgeId
* @author zxc
* @date 2020/11/19 上午9:49
*/
String selectBadgeName(@Param("customerId") String customerId,@Param("badgeId") String badgeId);
/**
* desc: 获取下一次排序号
*
* @param customerId
* @return int
* @author LiuJanJun
* @date 2020/11/19 10:18 上午
*/
int selectNextSort(@Param("customerId") String customerId);
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java

@ -18,8 +18,13 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ResiUserBadgeDTO;
import com.epmet.dto.result.UserIdAndBadgeIdResultDTO;
import com.epmet.entity.ResiUserBadgeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户徽章关系表
@ -29,5 +34,16 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ResiUserBadgeDao extends BaseDao<ResiUserBadgeEntity> {
/**
* @Description 初始化党员徽章插入
* @Param userIds
* @Param badgeId
* @author zxc
* @date 2020/11/18 上午10:56
*/
void insertResiUserBadge(@Param("badges")List<ResiUserBadgeDTO> badges);
List<UserIdAndBadgeIdResultDTO> selectUserIds();
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.dto.form.UserRoleFormDTO;
import com.epmet.dto.result.PartyMemberUserIdsResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.entity.UserRoleEntity;
import org.apache.ibatis.annotations.Mapper;
@ -72,4 +73,12 @@ public interface UserRoleDao extends BaseDao<UserRoleEntity> {
* @Description 居民端-查询用户角色key列表
**/
List<String> selectUserRoleKeyList(GetRoleKeyListFormDTO formDTO);
/**
* @Description 查询所有党员UserId
* @Param
* @author zxc
* @date 2020/11/18 上午10:50
*/
List<PartyMemberUserIdsResultDTO> selectPartyMemberUserIds();
}

20
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeEntity.java

@ -18,13 +18,10 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 徽章
*
@ -53,14 +50,19 @@ public class BadgeEntity extends BaseEpmetEntity {
*/
private String badgeIcon;
/**
* 固有徽章类型 前端页面跳转标识党员徽章party;none
*/
/**
* 固有徽章类型 前端页面跳转标识党员徽章party;none
*/
private String fixationBadgeType;
/**
* 状态 上线:online;下线:offline;
*/
/**
* 状态 上线:online;下线:offline;
*/
private String badgeStatus;
/**
* 排序
*/
private Integer sort;
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -3,10 +3,14 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @Description 居民端陌生人导览 调用gov-org服务
@ -25,4 +29,14 @@ public interface GovOrgFeignClient {
@PostMapping("/gov/org/customergrid/getcustomergridbygridid")
Result<CustomerGridDTO> getCustomerGridByGridId(CustomerGridFormDTO formDTO);
/**
* @Description 查询一个网格下的所有工作人员[copy wangc]
* @param gridIdFormDTO
* @return Result<List<String>>
* @author zxc
* @date 2020.04.29 22:59
**/
@PostMapping("/gov/org/customerstaffgrid/getgridstaffs")
Result<List<String>> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO);
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -4,10 +4,13 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.feign.GovOrgFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @Description 居民端-陌生人导览 调用gov-org服务
* @Author sun
@ -20,4 +23,9 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
public Result<CustomerGridDTO> getCustomerGridByGridId(CustomerGridFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getcustomergridbygridid", formDTO);
}
@Override
public Result<List<String>> getGridStaffs(CommonGridIdFormDTO gridIdFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO);
}
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java

@ -178,7 +178,7 @@ public class UserBadgeRedis {
* @date 2020.11.05 13:37
*/
public long pushOrRemoveUserBadge4List(String userId, String badgeId, String customerId) {
List<UserBadgeUnitFormDTO> orient = obtainUserBadge2List(userId,customerId);
List<UserBadgeUnitFormDTO> orient = redisUtils.lrange(UserRedisKeys.getResiUserBadgeKey(customerId,userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class);
UserBadgeUnitFormDTO unit = null;
if (!CollectionUtils.isEmpty(orient)) {
@ -206,7 +206,7 @@ public class UserBadgeRedis {
if (poolOpt.isPresent()) unit = ConvertUtils.sourceToTarget(poolOpt.get(), UserBadgeUnitFormDTO.class);
else return NumConstant.ZERO;
}
redisUtils.leftPush(UserRedisKeys.getResiUserBadgeKey(customerId, userId), unit);
redisUtils.leftPush(UserRedisKeys.getResiUserBadgeKey(customerId, userId), unit,-1);
return NumConstant.ONE;
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java

@ -90,12 +90,20 @@ public interface UserBadgeService {
List<UserBadgeUnitFormDTO> getUserSortedBadge(String userId,String customerId);
/**
* @Description 批量获取用户显示徽章
* @param customerId
* @param userIds
* @return java.util.Map<java.lang.String,java.util.List< com.epmet.dto.result.UserBadgeInfoResultDTO>>
* @return java.util.Map<java.lang.String, java.util.List < com.epmet.dto.result.UserBadgeInfoResultDTO>>
* @Description 批量获取用户显示徽章
* @author wangc
* @date 2020.11.10 15:12
*/
Map<String,List<UserBadgeInfoResultDTO>> getBatchUserSortedBadge(String customerId, List<String> userIds);
/**
* @Description 初始化党员徽章 或审核通过后 添加用户党员徽章记录
* @Param userId
* @author zxc
* @date 2020/11/18 下午3:03
*/
void initPartyMemberBadge(String userId,TokenDto tokenDto);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java

@ -101,8 +101,17 @@ public interface UserBaseInfoService extends BaseService<UserBaseInfoEntity> {
void delete(String[] ids);
/**
* @return java.util.List<com.epmet.dto.result.UserBaseInfoResultDTO>
* @param userId
* @return com.epmet.dto.result.UserBaseInfoResultDTO
* @author yinzuomei
* @description 先从缓存获取 缓存没有获取db
* @Date 2020/11/18 19:35
**/
UserBaseInfoResultDTO queryUserBaseInfoFromCache(String userId);
/**
* @param userIdList
* @return java.util.List<com.epmet.dto.result.UserBaseInfoResultDTO>
* @author yinzuomei
* @description 传入用户id集合返回用户的基本信息包含微信基本信息
* @Date 2020/7/22 9:35

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.exception.ValidateException;
@ -78,8 +79,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
@Autowired
private MessageFeignClient messageFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Override
@ -164,9 +164,11 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
if (CollectionUtils.isNotEmpty(list)) {
throw new RenException(EpmetErrorCode.DUPLICATE_BADGE_NAME.getCode());
}
int nextSort = baseDao.selectNextSort(tokenDto.getCustomerId());
BadgeEntity entity = ConvertUtils.sourceToTarget(formDTO, BadgeEntity.class);
entity.setCustomerId(tokenDto.getCustomerId());
entity.setFixationBadgeType(BadgeConstant.NONE);
entity.setSort(nextSort);
insert(entity);
//保存徽章认证配置
List<BadgeCertificationConfigEntity> badgeList = new ArrayList<>();
@ -221,7 +223,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
BadgeEntity badgeEntity = baseDao.selectBadgeInfo(tokenDto.getCustomerId(), formDTO.getBadgeId());
if (null == badgeEntity) {
badgeEntity = baseDao.selectBadgeInfo("default", formDTO.getBadgeId());
badgeEntity = baseDao.selectBadgeInfo(BadgeConstant.DEFAULT_CUSTOMER, formDTO.getBadgeId());
badgeEntity.setCustomerId(tokenDto.getCustomerId());
badgeEntity.setBadgeName(formDTO.getBadgeName());
badgeEntity.setBadgeIcon(formDTO.getBadgeIcon());
@ -267,6 +269,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
BadgeDTO badgeDTO = ConvertUtils.sourceToTarget(badgeEntity, BadgeDTO.class);
badgeDTO.setCustomerId(tokenDto.getCustomerId());
badgeDTO.setDelFlag(NumConstant.ONE_STR);
badgeDTO.setRevision(NumConstant.ZERO);
badgeDTO.setCreatedBy(tokenDto.getUserId());
badgeDTO.setCreatedTime(new Date());
badgeDTO.setUpdatedBy(tokenDto.getUserId());
@ -420,7 +423,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
**/
@Override
public List<GridAuditingBadgeCountResultDTO> queryGridAuditingBadgeCount(List<String> gridIdList) {
if(CollectionUtils.isEmpty(gridIdList)){
if (CollectionUtils.isEmpty(gridIdList)) {
return new ArrayList<>();
}
return baseDao.queryGridAuditingBadgeCount(gridIdList);

28
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

@ -20,15 +20,19 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.UserCustomerConstant;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.RegisterRelationDTO;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
@ -36,10 +40,10 @@ import com.epmet.entity.RegisterRelationEntity;
import com.epmet.entity.UserCustomerEntity;
import com.epmet.entity.UserWechatEntity;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.redis.RegisterRelationRedis;
import com.epmet.service.GridVisitedService;
import com.epmet.service.RegisterRelationService;
import com.epmet.util.ModuleConstant;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -79,6 +83,9 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio
@Autowired
private GridVisitedService gridVisitedService;
@Autowired
private UserBaseInfoDao userBaseInfoDao;
@Override
@ -152,10 +159,11 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio
final String gridId = enterGridFormDTO.getGridId();
//查询用户微信关系表
List<UserWechatEntity> strangerWechatInfo = userWechatDao.selectByUserId(enterGridFormDTO.getUserId());
if(null != strangerWechatInfo && strangerWechatInfo.size() > 0){
resultObj.setNickname(strangerWechatInfo.get(0).getNickname());
resultObj.setUserHeadPhoto(strangerWechatInfo.get(0).getHeadImgUrl());
// List<UserWechatEntity> strangerWechatInfo = userWechatDao.selectByUserId(enterGridFormDTO.getUserId());
UserBaseInfoResultDTO strangerInfo = userBaseInfoDao.selectListByUserIdList(enterGridFormDTO.getUserId());
if(null != strangerInfo){
resultObj.setNickname(strangerInfo.getNickname());
resultObj.setUserHeadPhoto(strangerInfo.getHeadImgUrl());
}
//需要新增的用户关系参数
UserCustomerEntity userCustomer = new UserCustomerEntity();
@ -243,6 +251,12 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio
resultObj.setNickname(userResiInfo.getShowName());
resultObj.setUserHeadPhoto(userResiInfo.getHeadPhoto());
}
// List<UserWechatEntity> userWechatEntityList=userWechatDao.selectByUserId(enterGridFormDTO.getUserId());
UserBaseInfoResultDTO userBaseInfo = userBaseInfoDao.selectListByUserIdList(enterGridFormDTO.getUserId());
if(null != userBaseInfo){
resultObj.setNickname(StringUtils.isNotBlank(userBaseInfo.getNickname())?userBaseInfo.getNickname(): StrConstant.EPMETY_STR);
resultObj.setUserHeadPhoto(StringUtils.isNotBlank(userBaseInfo.getHeadImgUrl())?userBaseInfo.getHeadImgUrl(): StrConstant.EPMETY_STR);
}
}
//3.获取权限

36
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java

@ -39,11 +39,9 @@ import com.epmet.constant.UserAdviceConstant;
import com.epmet.dao.UserAdviceDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.UserAdviceDTO;
import com.epmet.dto.form.AdviceListFormDTO;
import com.epmet.dto.form.ReplyAdviceFormDTO;
import com.epmet.dto.form.SubmitAdviceFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.UserAdviceEntity;
import com.epmet.entity.UserAdviceImgEntity;
@ -258,11 +256,11 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
wrapper.eq(StringUtils.isNotBlank(dto.getCustomerId()), "CUSTOMER_ID", dto.getCustomerId());
//是否回复
if ("1".equals(dto.getIsReply())) {
wrapper.ne("REPLY_USER_ID", "");
wrapper.ne("REPLY_CONTENT", "");
wrapper.isNotNull("REPLY_USER_ID");
wrapper.isNotNull("REPLY_CONTENT");
} else if ("0".equals(dto.getIsReply())) {
wrapper.eq("REPLY_USER_ID", "");
wrapper.eq("REPLY_CONTENT", "");
wrapper.isNull("REPLY_USER_ID");
wrapper.isNull("REPLY_CONTENT");
}
//建议类型
wrapper.like(StringUtils.isNotBlank(dto.getAdviceType()), "ADVICE_TYPE", dto.getAdviceType());
@ -322,7 +320,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
* @param dto
* @param loginUserId
* @return void
* @Description 居民端-回复建议
* @Description 居民端提交建议
* @Author liushaowen
* @Date 2020/11/10 10:57
*/
@ -344,21 +342,17 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
logger.error("customerId:{},获取customerName失败",dto.getCustomerId());
}
//获取gridName,agencyId
Result<GridInfoResultDTO> gridInfoResultDTOResult = govOrgOpenFeignClient.queryGridInfo(dto.getGridId());
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(dto.getGridId());
Result<CustomerGridDTO> gridInfoResultDTOResult = govOrgOpenFeignClient.getCustomerGridByGridId(customerGridFormDTO);
if (gridInfoResultDTOResult.success()){
userAdviceDTO.setGridName(gridInfoResultDTOResult.getData().getGridName());
userAdviceDTO.setAgencyId(gridInfoResultDTOResult.getData().getParentAgencyId());
//获取agencyName
Result<CustomerAgencyDTO> agencyById = govOrgOpenFeignClient.getAgencyById(gridInfoResultDTOResult.getData().getParentAgencyId());
if (agencyById.success()){
userAdviceDTO.setAgencyName(agencyById.getData().getAllParentName());
userAdviceDTO.setAgencyAllParentName(agencyById.getData().getAllParentName());
userAdviceDTO.setAgencyPids(agencyById.getData().getPids());
}else {
logger.error("agencyId:{},获取组织详情失败",gridInfoResultDTOResult.getData().getParentAgencyId());
}
userAdviceDTO.setAgencyId(gridInfoResultDTOResult.getData().getPid());
userAdviceDTO.setAgencyPids(gridInfoResultDTOResult.getData().getPids());
userAdviceDTO.setAgencyName(gridInfoResultDTOResult.getData().getAgencyName());
userAdviceDTO.setAgencyAllParentName(gridInfoResultDTOResult.getData().getAllParentName());
}else {
logger.error("gridId:{},获取网格详情失败",dto.getGridId());
logger.error("gridId:{},获取网格和所属组织详情失败",dto.getGridId());
}
//获取userName,regPhone

272
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

@ -8,17 +8,22 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dao.ResiUserBadgeDao;
import com.epmet.dao.UserBadgeDao;
import com.epmet.dao.*;
import com.epmet.dto.ResiUserBadgeDTO;
import com.epmet.dto.UserBadgeCertificateRecordDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.redis.UserBadgeRedis;
import com.epmet.service.UserBadgeService;
import com.epmet.service.UserBaseInfoService;
import com.epmet.util.ModuleConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -26,10 +31,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -50,9 +53,21 @@ public class UserBadgeServiceImpl implements UserBadgeService {
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient messageFeignClient;
@Autowired
private UserRoleDao userRoleDao;
@Autowired
private ResiUserBadgeDao resiUserBadgeDao;
@Autowired
private BadgeDao badgeDao;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private BadgeCertificationConfigDao badgeCertificationConfigDao;
/**
* @Description 查询已经点亮的徽章
* @Description 查询已经点亮的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 1:33 下午
@ -67,7 +82,7 @@ public class UserBadgeServiceImpl implements UserBadgeService {
List<UserBadgeListResultDTO> redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class);
List<UserBadgeListResultDTO> userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO);
if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){
return redisUserBadgeList;
return redisUserBadgeList.stream().sorted(Comparator.comparing(UserBadgeListResultDTO::getSort)).collect(Collectors.toList());
}
redisUserBadgeList.forEach(u -> {
userBadgeListResultDTOS.forEach(badge -> {
@ -77,12 +92,16 @@ public class UserBadgeServiceImpl implements UserBadgeService {
}
});
});
List<UserBadgeListResultDTO> noOpenBadge = new ArrayList<>();
redisUserBadgeList.forEach(u -> {
if (!u.getStatus()){
userBadgeListResultDTOS.add(u);
noOpenBadge.add(u);
}
});
return userBadgeListResultDTOS;
if (!CollectionUtils.isEmpty(noOpenBadge)){
userBadgeListResultDTOS.addAll(noOpenBadge);
}
return userBadgeListResultDTOS.stream().sorted(Comparator.comparing(UserBadgeListResultDTO::getIsOpened,Comparator.reverseOrder()).thenComparing(UserBadgeListResultDTO::getUpdatedTime,Comparator.reverseOrder()).thenComparing(UserBadgeListResultDTO::getSort)).collect(Collectors.toList());
}
/**
@ -105,25 +124,112 @@ public class UserBadgeServiceImpl implements UserBadgeService {
});
return userOperListResultDTOS;
}
List<UserOperListResultDTO> badgeIsOpenedList = userBadgeDao.selectBadgeByUserId(userOperListFormDTO.getUserId());
userOperListResultDTOS.forEach(ub -> {
userAuthBadgeList.forEach(u -> {
if (ub.getBadgeId().equals(u.getBadgeId())){
ub.setIsReject(u.getAuditStatus().equals(BadgeConstant.REJECTED) ? true : false);
ub.setIsCertificated(u.getAuditStatus().equals(BadgeConstant.APPROVED) ? BadgeConstant.YES : BadgeConstant.NO);
ub.setIsLighted(u.getIsOpened().equals(NumConstant.ZERO_STR) ? BadgeConstant.NO : BadgeConstant.YES);
}
});
if (CollectionUtils.isEmpty(badgeIsOpenedList)){
ub.setIsLighted(BadgeConstant.NO);
}else {
badgeIsOpenedList.forEach(b -> {
if (ub.getBadgeId().equals(b.getBadgeId())){
ub.setIsLighted(b.getIsOpened().equals(NumConstant.ZERO_STR) ? BadgeConstant.NO : BadgeConstant.YES);
});
Map<String, List<UserOperListResultDTO>> collect = userOperListResultDTOS.stream().collect(Collectors.groupingBy(UserOperListResultDTO::getIsLighted));
List<UserOperListResultDTO> result = collect.get(BadgeConstant.YES);
List<UserOperListResultDTO> noLight = collect.get(BadgeConstant.NO);
List<UserOperListResultDTO> resultFin = new ArrayList<>();
resultFin.addAll(CollectionUtils.isEmpty(result)?new ArrayList<>():result);
resultFin.addAll(CollectionUtils.isEmpty(noLight)?new ArrayList<>():noLight.stream().sorted(Comparator.comparing(UserOperListResultDTO::getSort)).collect(Collectors.toList()));
return resultFin;
}
/**
* @Description 初始化党员徽章
* @Param userId
* @author zxc
* @date 2020/11/18 下午3:04
*/
@Override
public void initPartyMemberBadge(String userId,TokenDto tokenDto){
List<UserIdAndBadgeIdResultDTO> userIds = resiUserBadgeDao.selectUserIds();
List<ResiUserBadgeDTO> badges = new ArrayList<>();
String partyBadgeId = badgeDao.getPartyBadgeId(null);
if (StringUtils.isEmpty(userId)) {
List<PartyMemberUserIdsResultDTO> partyMemberUserIds = userRoleDao.selectPartyMemberUserIds();
if (CollectionUtils.isEmpty(partyMemberUserIds)) {
return;
}
if (!CollectionUtils.isEmpty(userIds)) {
userIds.forEach(u -> {
partyMemberUserIds.forEach(p -> {
if (u.getUserId().equals(p.getUserId()) && u.getBadgeId().equals(partyBadgeId)){
p.setReStatus(true);
}
});
});
}
List<String> reUserIds = partyMemberUserIds.stream().filter(p -> !p.getReStatus()).map(p -> p.getUserId()).collect(Collectors.toList());
if (CollectionUtils.isEmpty(reUserIds)){
return;
}
List<UserBaseInfoResultDTO> userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(reUserIds);
if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)) {
log.error("未查询到党员基本信息......");
throw new RenException("未查询到党员基本信息......");
}
userBaseInfoResultDTOS.forEach(u -> {
ResiUserBadgeDTO dto = new ResiUserBadgeDTO();
dto.setBadgeId(partyBadgeId);
dto.setCertificationAutidStatus("approved");
dto.setCustomerId(u.getCustomerId());
dto.setGridId(u.getRegisteredGridId());
dto.setIsOpened(NumConstant.ZERO);
dto.setUserId(u.getUserId());
badges.add(dto);
});
resiUserBadgeDao.insertResiUserBadge(badges);
}else {
List<String> oneUserIds = new ArrayList<>();
oneUserIds.add(userId);
List<UserBaseInfoResultDTO> userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(oneUserIds);
if (!CollectionUtils.isEmpty(userIds)) {
AtomicReference<Boolean> status = new AtomicReference<>(true);
userIds.forEach(u -> {
if(u.equals(userId)){
status.set(false);
}
});
if (status.get()==false){
return;
}else {
userBaseInfoResultDTOS.forEach(u -> {
ResiUserBadgeDTO dto = new ResiUserBadgeDTO();
dto.setBadgeId(partyBadgeId);
dto.setCertificationAutidStatus("approved");
dto.setCustomerId(u.getCustomerId());
dto.setGridId(u.getRegisteredGridId());
dto.setIsOpened(NumConstant.ZERO);
dto.setUserId(u.getUserId());
dto.setCreatedBy(tokenDto.getUserId());
dto.setUpdatedBy(tokenDto.getUserId());
badges.add(dto);
});
}
}else {
userBaseInfoResultDTOS.forEach(u -> {
ResiUserBadgeDTO dto = new ResiUserBadgeDTO();
dto.setBadgeId(partyBadgeId);
dto.setCertificationAutidStatus("approved");
dto.setCustomerId(u.getCustomerId());
dto.setGridId(u.getRegisteredGridId());
dto.setIsOpened(NumConstant.ZERO);
dto.setUserId(u.getUserId());
dto.setCreatedBy(tokenDto.getUserId());
dto.setUpdatedBy(tokenDto.getUserId());
badges.add(dto);
});
}
});
return userOperListResultDTOS;
resiUserBadgeDao.insertResiUserBadge(badges);
}
}
/**
@ -136,9 +242,14 @@ public class UserBadgeServiceImpl implements UserBadgeService {
@Transactional(rollbackFor = Exception.class)
public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) {
log.info(JSON.toJSONString(certificationAddFormDTO));
if (StringUtils.isNotBlank(certificationAddFormDTO.getMobile())){
AuthFieldFormDTO authFieldFormDTO = new AuthFieldFormDTO();
authFieldFormDTO.setCustomerId(certificationAddFormDTO.getCustomerId());
authFieldFormDTO.setBadgeId(certificationAddFormDTO.getBadgeId());
validateParams(certificationAddFormDTO, authFieldFormDTO);
if (StringUtils.isNotBlank(certificationAddFormDTO.getMobile())) {
String smsCode = userBadgeRedis.getBadgeSmsCode(certificationAddFormDTO.getMobile());
if (!StringUtils.isNotBlank(smsCode)){
if (!StringUtils.isNotBlank(smsCode)) {
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}
}
@ -146,7 +257,7 @@ public class UserBadgeServiceImpl implements UserBadgeService {
List<String> userIds = new ArrayList<>();
userIds.add(certificationAddFormDTO.getUserId());
List<UserBaseInfoResultDTO> userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(userIds);
if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)){
if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)) {
throw new RenException("查询用户基本信息集合为空......");
}
userBadgeDao.updateCertificateRecordIsLast(form.getBadgeId(),form.getUserId());
@ -157,35 +268,25 @@ public class UserBadgeServiceImpl implements UserBadgeService {
log.info(JSON.toJSONString(form));
userBadgeDao.insertUserBadgeCertificateRecord(form);
//TODO 站内信发送 您好,您的xxx徽章因认证失败未成功点亮,请查看
this.sendMessageByUser(form);
//TODO 站内信发送
String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId());
sendMessage(BadgeConstant.AUTH_TITLE,String.format(BadgeConstant.READ_FLAG,userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()),badgeName),form.getGridId(),form.getUserId(),form.getCustomerId());
return new Result();
}
/**
* @Description 站内信发送提交徽章认证
* @Param form
* @author zxc
* @date 2020/11/10 9:04 上午
*/
public void sendMessageByUser(UserBadgeCertificateRecordDTO form){
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO formDTO = new UserMessageFormDTO();
formDTO.setApp(BadgeConstant.RESI);
formDTO.setCustomerId(form.getCustomerId());
formDTO.setGridId(form.getGridId());
UserBadgeListResultDTO userBadgeListResultDTO = userBadgeDao.selectBadgeByBadgeId(form.getCustomerId(), form.getBadgeId());
if (null == userBadgeListResultDTO){
log.error(BadgeConstant.GET_BADGE_NAME_FAILURE);
return;
private void validateParams(CertificationAddFormDTO certificationAddFormDTO, AuthFieldFormDTO authFieldFormDTO) {
List<AuthFieldResultDTO> authFieldResultDTOS = this.authField(authFieldFormDTO);
if (CollectionUtils.isEmpty(authFieldResultDTOS)) {
throw new RenException("该徽章配置配置错误,参数参数:{}", JSON.toJSONString(authFieldFormDTO));
}
Set<String> requiredColumns = authFieldResultDTOS.stream()
.filter(o -> NumConstant.ONE_STR.equals(o.getIsRequired()))
.map(AuthFieldResultDTO::getEnName).collect(Collectors.toSet());
List<String> missColumns = ValidatorUtils.hasAllRequired(JSON.toJSONString(certificationAddFormDTO), requiredColumns);
if (!CollectionUtils.isEmpty(missColumns)) {
throw new RenException(JSON.toJSONString(missColumns).concat("不能为空"));
}
formDTO.setMessageContent(String.format(BadgeConstant.MESSAGE_CONTENT,userBadgeListResultDTO.getBadgeName()));
formDTO.setTitle(BadgeConstant.AUTH_TITLE);
formDTO.setReadFlag(BadgeConstant.READ_FLAG);
formDTO.setUserId(form.getUserId());
msgList.add(formDTO);
Result result = messageFeignClient.saveUserMessageList(msgList);
}
/**
@ -242,7 +343,11 @@ public class UserBadgeServiceImpl implements UserBadgeService {
public List<AuthFieldResultDTO> authField(AuthFieldFormDTO authFieldFormDTO) {
List<AuthFieldResultDTO> authFieldResultDTOS = userBadgeDao.selectAuthField(authFieldFormDTO);
if (CollectionUtils.isEmpty(authFieldResultDTOS)){
return new ArrayList<>();
authFieldFormDTO.setCustomerId(BadgeConstant.DEFAULT_CUSTOMER);
authFieldResultDTOS = userBadgeDao.selectAuthField(authFieldFormDTO);
if (CollectionUtils.isEmpty(authFieldResultDTOS)) {
return new ArrayList<>();
}
}
return authFieldResultDTOS;
}
@ -294,15 +399,80 @@ public class UserBadgeServiceImpl implements UserBadgeService {
* @Description 批量获取用户显示徽章
* @param customerId
* @param userIds
* @return java.util.Map<java.lang.String,java.util.List< com.epmet.dto.result.UserBadgeInfoResultDTO>>
* @return java.util.Map<java.lang.String, java.util.List < com.epmet.dto.result.UserBadgeInfoResultDTO>>
* @author wangc
* @date 2020.11.10 15:12
*/
@Override
public Map<String, List<UserBadgeInfoResultDTO>> getBatchUserSortedBadge(String customerId, List<String> userIds) {
List<UserBadgeInfoResultDTO> badges = userBadgeDao.selectBatchUserSortedBadge(customerId,userIds);
if(CollectionUtils.isEmpty(badges)) return Collections.EMPTY_MAP;
return badges.stream().collect(Collectors.groupingBy(UserBadgeInfoResultDTO :: getUserId));
List<UserBadgeInfoResultDTO> badges = userBadgeDao.selectBatchUserSortedBadge(customerId, userIds);
if (CollectionUtils.isEmpty(badges)) return Collections.EMPTY_MAP;
return badges.stream().collect(Collectors.groupingBy(UserBadgeInfoResultDTO::getUserId));
}
/**
* @Description 发送站内信
* @Param title 标题
* @Param msg 信息
* @Param gridId 网格ID
* @Param userId 用户ID
* @Param customerId 客户ID
* @author zxc
* @date 2020/11/19 上午9:16
*/
public void sendMessage(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<List<String>> 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<String> roleKeys = new ArrayList<String>();
roleKeys.add(ModuleConstant.STAFF_ROLE_GRID_MANAGER);
rolesUsersListFormDTO.setRoleKeys(roleKeys);
rolesUsersListFormDTO.setUserIds(gridstaffs.getData());
Result<List<String>> staffRoles =
epmetUserOpenFeignClient.specificRolesStaffs(rolesUsersListFormDTO);
//3.发送消息
if(staffRoles.success() && null != staffRoles.getData() && staffRoles.getData().size() > 0){
List<UserMessageFormDTO> msgList = new ArrayList<>();
List<WxSubscribeMessageFormDTO> 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(ModuleConstant.BADGE_AUDIT_MESSAGE);
subscribeDTO.setMessageContent(msg);
subscribeDTO.setMessageTime(new Date());
subscribeList.add(subscribeDTO);
}
if (subscribeList.size() > NumConstant.ZERO){
epmetMessageOpenFeignClient.sendWxSubscribeMessage(subscribeList);
}
Result result = epmetMessageOpenFeignClient.saveUserMessageList(msgList);
if(result.success()){
return;
}
}
}
}
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -46,6 +47,7 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
@ -127,6 +129,26 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param userId
* @return java.util.List<com.epmet.dto.result.UserBaseInfoResultDTO>
* @author yinzuomei
* @description 传入用户id集合返回用户的基本信息包含微信基本信息
* @Date 2020/7/22 9:35
**/
@Override
public UserBaseInfoResultDTO queryUserBaseInfoFromCache(String userId) {
if (StringUtils.isBlank(userId)) {
throw new RenException("用户Id不能为空");
}
List<UserBaseInfoResultDTO> userBaseInfoResultDTOS = this.queryUserBaseInfo(Arrays.asList(userId));
if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)) {
logger.warn("queryUserBaseInfo return empty,userId:{}", userId);
return null;
}
return userBaseInfoResultDTOS.get(0);
}
/**
* @param userIdList
* @return java.util.List<com.epmet.dto.result.UserBaseInfoResultDTO>
@ -136,10 +158,10 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
**/
@Override
public List<UserBaseInfoResultDTO> queryUserBaseInfo(List<String> userIdList) {
if(null==userIdList||userIdList.size()<1){
if (null == userIdList || userIdList.size() < 1) {
return new ArrayList<>();
}
List<UserBaseInfoResultDTO> userBaseInfoList=new ArrayList<>();
List<UserBaseInfoResultDTO> userBaseInfoList = new ArrayList<>();
/* for(String userId:userIdList){
UserBaseInfoResultDTO userBaseInfoResultDTO=baseDao.selectListByUserIdList(userId);
if(null!=userBaseInfoResultDTO){
@ -152,7 +174,7 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
UserBaseInfoResultDTO baseInfo = userBaseInfoRedis.getUserInfo(id);
//为了保证传过来的user数量与返回的一致,就算查出的用户信息为空也要添加进集合里
//if(null != baseInfo && StringUtils.isNotBlank(baseInfo.getId())){
userBaseInfoList.add(baseInfo);
userBaseInfoList.add(baseInfo);
//}
});
return userBaseInfoList;
@ -166,7 +188,7 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
**/
@Override
public void initBaseInfo() {
List<UserWechatDTO> userWechatDTOList=userWechatDao.selectNotInUserBaseInfoTemp();
List<UserWechatDTO> userWechatDTOList = userWechatDao.selectNotInUserBaseInfoTemp();
List<String> userIdList=new ArrayList<>();
for(UserWechatDTO userWechatDTO:userWechatDTOList){
userIdList.add(userWechatDTO.getUserId());

12
epmet-user/epmet-user-server/src/main/java/com/epmet/util/ModuleConstant.java

@ -34,4 +34,16 @@ public interface ModuleConstant {
String GENDER_UNKNOWN = "未知";
/**
* 工作人员角色key网格长
* */
String STAFF_ROLE_GRID_MANAGER = "grid_manager";
/**
* APP 政府端
* */
String APP_GOV = "gov";
String BADGE_AUDIT_MESSAGE = "徽章审核消息";
}

1
epmet-user/epmet-user-server/src/main/resources/bootstrap.yml

@ -141,7 +141,6 @@ openapi:
imgSyncScan: /imgSyncScan
textSyncScan: /textSyncScan
dingTalk:
robot:
webHook: @dingTalk.robot.webHook@

199
epmet-user/epmet-user-server/src/main/resources/db/migration/2020-11-03_badege.sql

@ -1,199 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : 亿
Source Server Type : MySQL
Source Server Version : 50728
Source Host : 192.168.1.130:3306
Source Schema : epmet_user
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 03/11/2020 10:36:00
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for badege
-- ----------------------------
DROP TABLE IF EXISTS `badege`;
CREATE TABLE `badege`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`BADEGE_NAME` varchar(32) NOT NULL COMMENT '徽章名称',
`BADEGE_ICON` varchar(256) NOT NULL COMMENT '徽章图标url',
`FIXATION_BADEGE_TYPE` varchar(32) NOT NULL DEFAULT 'none' COMMENT '固有徽章类型 前端页面跳转标识,党员徽章:party;无:none',
`BADEGE_STATUS` varchar(16) NOT NULL COMMENT '状态 上线:online;下线:offline;',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`, `CUSTOMER_ID`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='徽章';
-- ----------------------------
-- Records of badege
-- ----------------------------
BEGIN;
INSERT INTO `badege`
VALUES ('1', 'default', '党员徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg',
'party', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00');
INSERT INTO `badege`
VALUES ('2', 'default', '人大代表徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg',
'none', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00');
INSERT INTO `badege`
VALUES ('3', 'default', '政协委员徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg',
'none', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00');
COMMIT;
-- ----------------------------
-- Table structure for badege_certification_config
-- ----------------------------
DROP TABLE IF EXISTS `badege_certification_config`;
CREATE TABLE `badege_certification_config`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`CERTIFICATION_TYPE` varchar(16) NOT NULL COMMENT '认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='徽章认证配置';
-- ----------------------------
-- Records of badege_certification_config
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for badege_certification_config_field
-- ----------------------------
DROP TABLE IF EXISTS `badege_certification_config_field`;
CREATE TABLE `badege_certification_config_field`
(
`ID` varchar(64) NOT NULL,
`CN_NAME` varchar(64) NOT NULL COMMENT '中文名',
`EN_NAME` varchar(64) NOT NULL COMMENT '英文名(字段名)',
`FIELD_TYPE` varchar(32) NOT NULL COMMENT '字段类型 img:图片,text:文本',
`IS_REQUIRED` tinyint(1) NOT NULL COMMENT '是否必填',
`CERTIFICATION_TYPE` varchar(255) NOT NULL COMMENT '认证信息类型',
`SORT` int(10) NOT NULL COMMENT '字段排序',
`DEL_FLAG` int(11) DEFAULT NULL COMMENT '删除标识 1删除0未删除',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT =' 徽章认证配置字段表\n';
-- ----------------------------
-- Records of badege_certification_config_field
-- ----------------------------
BEGIN;
INSERT INTO `badege_certification_config_field`
VALUES ('a5be5d931cf411eb8dcfc03fd56f7847', '手机号', 'mobile', 'text', 1, 'mobile', 3, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c01dd81cf411eb8dcfc03fd56f7847', '', 'subName', 'text', 1, 'fullName', 0, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c01de81cf411eb8dcfc03fd56f7847', '', 'name', 'text', 1, 'fullName', 1, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c22e511cf411eb8dcfc03fd56f7847', '身份证', 'idcard', 'text', 1, 'idcard', 2, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c4c2c11cf411eb8dcfc03fd56f7847', '认证证件', 'certificate', 'img', 1, 'certificate', 4, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c608301cf411eb8dcfc03fd56f7847', '认证说明(备注)', 'remark', 'text', 1, 'remark', 5, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
COMMIT;
-- ----------------------------
-- Table structure for resi_user_badege
-- ----------------------------
DROP TABLE IF EXISTS `resi_user_badege`;
CREATE TABLE `resi_user_badege`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`GRID_ID` varchar(64) NOT NULL COMMENT '用户注册网格ID',
`USER_ID` varchar(64) NOT NULL COMMENT '用户ID',
`BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`IS_OPENED` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启(点亮) 1:点亮;0:未点亮',
`CERTIFICATION_AUTID_STATUS` varchar(16) NOT NULL DEFAULT 'auditing' COMMENT '认证(审核)状态 待审核:auditing;审核通过:pass;驳回:rejected;',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='用户徽章关系表';
-- ----------------------------
-- Records of resi_user_badege
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for user_badege_certificate_record
-- ----------------------------
DROP TABLE IF EXISTS `user_badege_certificate_record`;
CREATE TABLE `user_badege_certificate_record`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id ',
`GRID_ID` varchar(64) NOT NULL COMMENT '用户注册网格ID',
`USER_ID` varchar(64) NOT NULL COMMENT '用户ID',
`BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`SURNAME` varchar(8) DEFAULT NULL COMMENT '',
`NAME` varchar(16) DEFAULT NULL COMMENT '',
`ID_NUM` varchar(32) DEFAULT NULL COMMENT '身份证号 网格内去重',
`CERTIFICATION_IMG` varchar(512) DEFAULT NULL COMMENT '认证证件图片',
`REMAEK` varchar(128) DEFAULT NULL COMMENT '认证说明(备注)',
`AUDIT_STATUS` varchar(32) NOT NULL DEFAULT 'auditing' COMMENT '审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中',
`AUDIT_REMARK` varchar(128) DEFAULT NULL COMMENT '审核意见',
`STAFF_ID` varchar(32) DEFAULT NULL COMMENT '审核人 审核人Id',
`AUDIT_TIME` datetime DEFAULT NULL COMMENT '审核时间',
`DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`),
KEY `IDX_USER_ID` (`USER_ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='用户认证徽章记录表';
-- ----------------------------
-- Records of user_badege_certificate_record
-- ----------------------------
BEGIN;
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

219
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.10__add_badege.sql

@ -0,0 +1,219 @@
/*
Navicat Premium Data Transfer
Source Server : 亿
Source Server Type : MySQL
Source Server Version : 50728
Source Host : 192.168.1.130:3306
Source Schema : epmet_user
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 19/11/2020 11:19:00
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for badge
-- ----------------------------
DROP TABLE IF EXISTS `badge`;
CREATE TABLE `badge`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`BADGE_NAME` varchar(32) NOT NULL COMMENT '徽章名称',
`BADGE_ICON` varchar(256) NOT NULL COMMENT '徽章图标url',
`FIXATION_BADGE_TYPE` varchar(32) NOT NULL DEFAULT 'none' COMMENT '固有徽章类型 前端页面跳转标识,党员徽章:party;无:none',
`SORT` int(11) NOT NULL COMMENT '徽章排序',
`BADGE_STATUS` varchar(16) NOT NULL COMMENT '状态 上线:online;下线:offline;',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`, `CUSTOMER_ID`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='徽章';
-- ----------------------------
-- Records of badge
-- ----------------------------
BEGIN;
INSERT INTO `badge`
VALUES ('1', 'default', '党员徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201117/57d817af26e74af2928d7a0dcd53fa69.png',
'party', 2, 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00');
INSERT INTO `badge`
VALUES ('2', 'default', '人大代表徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201117/eae64f4039d340f7b83d17c662f29fba.png',
'none', 1, 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:53', 'APP_USER', '2020-11-03 10:34:00');
INSERT INTO `badge`
VALUES ('3', 'default', '政协委员徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201117/5a1d29eabe014d6fb3d8a19a4bd1cc35.png',
'none', 0, 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:54', 'APP_USER', '2020-11-03 10:34:00');
COMMIT;
-- ----------------------------
-- Table structure for badge_certification_config
-- ----------------------------
DROP TABLE IF EXISTS `badge_certification_config`;
CREATE TABLE `badge_certification_config`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`BADGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`CERTIFICATION_TYPE` varchar(16) NOT NULL COMMENT '认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='徽章认证配置';
-- ----------------------------
-- Records of badge_certification_config
-- ----------------------------
BEGIN;
INSERT INTO `badge_certification_config`
VALUES ('1001', 'default', '1', 'fullname', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('1002', 'default', '1', 'idcard', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('1003', 'default', '1', 'mobile', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('1004', 'default', '1', 'remark', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('2001', 'default', '2', 'fullname', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('2002', 'default', '2', 'idcard', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('2003', 'default', '2', 'mobile', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('2004', 'default', '2', 'certificate', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('2005', 'default', '2', 'remark', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('3001', 'default', '3', 'fullname', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('3002', 'default', '3', 'idcard', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('3003', 'default', '3', 'mobile', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('3004', 'default', '3', 'certificate', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
INSERT INTO `badge_certification_config`
VALUES ('3005', 'default', '3', 'remark', '0', 0, '1', '2020-11-04 16:46:43', '1', '2020-11-04 16:46:47');
COMMIT;
-- ----------------------------
-- Table structure for badge_certification_config_field
-- ----------------------------
DROP TABLE IF EXISTS `badge_certification_config_field`;
CREATE TABLE `badge_certification_config_field`
(
`ID` varchar(64) NOT NULL,
`CN_NAME` varchar(64) NOT NULL COMMENT '中文名',
`EN_NAME` varchar(64) NOT NULL COMMENT '英文名(字段名)',
`FIELD_TYPE` varchar(32) NOT NULL COMMENT '字段类型 img:图片,text:文本',
`IS_REQUIRED` tinyint(1) NOT NULL COMMENT '是否必填',
`CERTIFICATION_TYPE` varchar(16) NOT NULL COMMENT '认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark',
`SORT` int(10) NOT NULL COMMENT '字段排序',
`DEL_FLAG` int(1) DEFAULT NULL COMMENT '删除标识 1删除0未删除',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT =' 徽章认证配置字段表\n';
-- ----------------------------
-- Records of badge_certification_config_field
-- ----------------------------
BEGIN;
INSERT INTO `badge_certification_config_field`
VALUES ('a5be5d931cf411eb8dcfc03fd56f7847', '手机号', 'mobile', 'text', 1, 'mobile', 3, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badge_certification_config_field`
VALUES ('a5c01dd81cf411eb8dcfc03fd56f7847', '', 'surname', 'text', 1, 'fullName', 0, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badge_certification_config_field`
VALUES ('a5c01de81cf411eb8dcfc03fd56f7847', '', 'name', 'text', 1, 'fullName', 1, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badge_certification_config_field`
VALUES ('a5c22e511cf411eb8dcfc03fd56f7847', '身份证', 'idcard', 'text', 1, 'idcard', 2, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badge_certification_config_field`
VALUES ('a5c4c2c11cf411eb8dcfc03fd56f7847', '认证证件', 'certificationImg', 'img', 1, 'certificate', 4, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badge_certification_config_field`
VALUES ('a5c608301cf411eb8dcfc03fd56f7847', '备注', 'remark', 'text', 1, 'remark', 5, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
COMMIT;
-- ----------------------------
-- Table structure for resi_user_badge
-- ----------------------------
DROP TABLE IF EXISTS `resi_user_badge`;
CREATE TABLE `resi_user_badge`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`GRID_ID` varchar(64) NOT NULL COMMENT '用户注册网格ID',
`USER_ID` varchar(64) NOT NULL COMMENT '用户ID',
`BADGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`IS_OPENED` tinyint(1) NOT NULL COMMENT '是否开启(点亮) 1:点亮;0:未点亮',
`CERTIFICATION_AUTID_STATUS` varchar(16) NOT NULL DEFAULT 'auditing' COMMENT '认证(审核)状态 待审核:auditing;审核通过: approved;驳回:rejected;',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='用户徽章关系表';
-- ----------------------------
-- Table structure for user_badge_certificate_record
-- ----------------------------
DROP TABLE IF EXISTS `user_badge_certificate_record`;
CREATE TABLE `user_badge_certificate_record`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id ',
`GRID_ID` varchar(64) NOT NULL COMMENT '用户注册网格ID',
`USER_ID` varchar(64) NOT NULL COMMENT '用户ID',
`BADGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`SURNAME` varchar(8) DEFAULT NULL COMMENT '',
`NAME` varchar(16) DEFAULT NULL COMMENT '',
`MOBILE` varchar(64) DEFAULT NULL COMMENT '手机号',
`ID_NUM` varchar(32) DEFAULT NULL COMMENT '身份证号 网格内去重',
`CERTIFICATION_IMG` varchar(512) DEFAULT NULL COMMENT '认证证件图片',
`REMAEK` varchar(256) DEFAULT NULL COMMENT '认证说明(备注)',
`AUDIT_STATUS` varchar(32) NOT NULL DEFAULT 'auditing' COMMENT '审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中',
`AUDIT_REMARK` varchar(256) DEFAULT NULL COMMENT '审核意见',
`STAFF_ID` varchar(32) DEFAULT NULL COMMENT '审核人 审核人Id',
`AUDIT_TIME` datetime DEFAULT NULL COMMENT '审核时间',
`IS_LAST` varchar(8) NOT NULL COMMENT '是否是最新纪录:yes:最新纪录,no:非最新纪录',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`),
KEY `IDX_USER_ID` (`USER_ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='用户认证徽章记录表';
SET FOREIGN_KEY_CHECKS = 1;

4
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.8__alter_useradvice_pids.sql

@ -0,0 +1,4 @@
ALTER TABLE `user_advice` DROP COLUMN `AGENCY_PIDS`;
ALTER TABLE `user_advice`
ADD COLUMN `AGENCY_PIDS` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `AGENCY_ID`;

9
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.9__alter_useradvice_content.sql

@ -0,0 +1,9 @@
ALTER TABLE `user_advice` DROP COLUMN `ADVICE_CONTENT`;
ALTER TABLE `user_advice`
ADD COLUMN `ADVICE_CONTENT` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '建议内容' NOT NULL AFTER `REG_PHONE`;
ALTER TABLE `user_advice` DROP COLUMN `GOV_CONTENT`;
ALTER TABLE `user_advice`
ADD COLUMN `GOV_CONTENT` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '建议回复内容' NULL AFTER `REPLY_TIME`;

52
epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

@ -25,6 +25,7 @@
`BADGE_ICON`,
`FIXATION_BADGE_TYPE`,
`BADGE_STATUS`,
`SORT`,
`DEL_FLAG`,
`REVISION`,
`CREATED_BY`,
@ -38,6 +39,7 @@
#{badgeIcon},
#{fixationBadgeType},
#{badgeStatus},
#{sort},
#{delFlag},
#{revision},
#{createdBy},
@ -64,7 +66,8 @@
ID AS "badgeId",
BADGE_NAME,
BADGE_ICON,
BADGE_STATUS
BADGE_STATUS,
FIXATION_BADGE_TYPE AS "type"
FROM
(
SELECT * FROM badge
@ -75,7 +78,7 @@
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t
ORDER BY
CREATED_TIME DESC
SORT
</select>
<select id="getDuplicateName" resultType="com.epmet.dto.result.BadgeListResultDTO">
SELECT
@ -138,7 +141,8 @@
WHERE BADGE_NAME = #{badgeName} AND badgeId != #{badgeId}
</select>
<select id="selectBadgeInfo" resultType="com.epmet.entity.BadgeEntity">
select * from badge where DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND ID = #{badgeId}
select ID,CUSTOMER_ID,BADGE_NAME,BADGE_ICON,FIXATION_BADGE_TYPE,SORT,BADGE_STATUS from badge where DEL_FLAG = '0' AND CUSTOMER_ID =
#{customerId} AND ID = #{badgeId}
</select>
<select id="selectAuditingList" resultType="com.epmet.dto.result.BadgeAuditingResultDTO">
SELECT
@ -152,7 +156,7 @@
unix_timestamp(ubcr.CREATED_TIME) AS "createTime"
FROM
user_badge_certificate_record ubcr
LEFT JOIN user_base_info ubi ON ubcr.USER_ID = ubi.USER_ID
LEFT JOIN user_base_info ubi ON ubcr.USER_ID = ubi.USER_ID AND ubi.DEL_FLAG = '0'
LEFT JOIN (SELECT
ID,
BADGE_NAME,
@ -188,7 +192,7 @@
unix_timestamp(ubcr.CREATED_TIME) AS "createTime"
FROM
user_badge_certificate_record ubcr
LEFT JOIN user_base_info ubi ON ubcr.USER_ID = ubi.USER_ID
LEFT JOIN user_base_info ubi ON ubcr.USER_ID = ubi.USER_ID AND ubi.DEL_FLAG = '0'
LEFT JOIN (SELECT
ID,
BADGE_NAME,
@ -267,4 +271,42 @@
</foreach>
group by m.GRID_ID
</select>
<select id="getPartyBadgeId" resultType="java.lang.String">
SELECT
ID
FROM
badge
WHERE
DEL_FLAG = '0'
<if test="customerId != null and customerId != '' ">
AND (CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} OR CUSTOMER_ID = 'default')
</if>
<if test="customerId == null and customerId == '' ">
AND CUSTOMER_ID = 'default'
</if>
AND FIXATION_BADGE_TYPE = 'party'
order by CREATED_TIME desc LIMIT 1
</select>
<select id="selectNextSort" resultType="int">
SELECT
ifnull(max(sort),0)+1
FROM
badge
WHERE
DEL_FLAG = '0'
AND (CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} OR CUSTOMER_ID = 'default')
</select>
<!-- 查询徽章名称 -->
<select id="selectBadgeName" resultType="java.lang.String">
SELECT
BADGE_NAME
FROM badge
WHERE DEL_FLAG = 0
AND (CUSTOMER_ID = 'default' OR CUSTOMER_ID = #{customerId})
ORDER BY CREATED_TIME DESC
LIMIT 1
</select>
</mapper>

56
epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml

@ -3,21 +3,47 @@
<mapper namespace="com.epmet.dao.ResiUserBadgeDao">
<resultMap type="com.epmet.entity.ResiUserBadgeEntity" id="resiUserBadgeMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="userId" column="USER_ID"/>
<result property="badgeId" column="BADGE_ID"/>
<result property="isOpened" column="IS_OPENED"/>
<result property="certificationAutidStatus" column="CERTIFICATION_AUTID_STATUS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 初始化党员徽章插入 -->
<insert id="insertResiUserBadge">
INSERT INTO resi_user_badge
(
ID,
CUSTOMER_ID,
GRID_ID,
USER_ID,
BADGE_ID,
IS_OPENED,
CERTIFICATION_AUTID_STATUS,
DEL_FLAG,
REVISION,
CREATED_TIME,
CREATED_BY,
UPDATED_TIME,
UPDATED_BY
)
VALUES
<foreach collection="badges" item="b" separator=",">
(
REPLACE(UUID(),'-',''),
#{b.customerId},
#{b.gridId},
#{b.userId},
#{b.badgeId},
#{b.isOpened},
#{b.certificationAutidStatus},
#{b.delFlag},
#{b.revision},
NOW(),
#{b.createdBy},
NOW(),
#{b.updatedBy}
)
</foreach>
</insert>
<select id="selectUserIds" resultType="com.epmet.dto.result.UserIdAndBadgeIdResultDTO">
SELECT USER_ID,BADGE_ID FROM resi_user_badge WHERE DEL_FLAG = 0
</select>
</mapper>

6
epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml

@ -56,7 +56,7 @@
</resultMap>
<select id="myAdviceList" resultMap="myAdviceListResultMap">
select id,advice_type,advice_content,advice_time,IFNULL(reply_content,''),IFNULL(reply_time,'')
select id,advice_type,advice_content,advice_time,reply_content,reply_time
from user_advice
where del_flag = 0 and user_id = #{userId}
order by created_time desc
@ -77,6 +77,8 @@
customer_id,
customer_name,
agency_id,
agency_pids,
agency_all_parent_name,
agency_name,
grid_id,
grid_name,
@ -99,6 +101,8 @@
#{customerId},
#{customerName},
#{agencyId},
#{agencyPids},
#{agencyAllParentName},
#{agencyName},
#{gridId},
#{gridName},

22
epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml

@ -27,7 +27,9 @@
SELECT
ub.BADGE_ID,
ub.IS_OPENED,
b.FIXATION_BADGE_TYPE as badgeType
b.FIXATION_BADGE_TYPE as badgeType,
b.sort,
UNIX_TIMESTAMP(ub.updated_time) AS updatedTime
FROM resi_user_badge ub
LEFT JOIN badge b ON b.ID = ub.BADGE_ID
WHERE ub.DEL_FLAG = '0'
@ -46,13 +48,14 @@
CUSTOMER_ID,
BADGE_NAME,
BADGE_ICON,
FIXATION_BADGE_TYPE AS badgeType
FIXATION_BADGE_TYPE AS badgeType,
sort
FROM (
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' AND BADGE_STATUS = 'online'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND BADGE_STATUS = 'online'
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t
ORDER BY
@ -64,12 +67,13 @@
SELECT
CUSTOMER_ID,
BADGE_ID,
CERTIFICATION_IMG,
AUDIT_STATUS
FROM user_badge_certificate_record
CERTIFICATION_AUTID_STATUS AS auditStatus,
IS_OPENED
FROM resi_user_badge
WHERE DEL_FLAG = 0
AND IS_LAST = 'yes'
AND USER_ID = #{userId}
AND CERTIFICATION_AUTID_STATUS = 'approved'
AND USER_ID = #{userId}
order by created_time desc
</select>
<!-- 根据UserId查询个人徽章点亮信息 -->

44
epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml

@ -28,28 +28,24 @@
<!-- 根据用户id查询user_base_info基本信息 -->
<select id="selectListByUserIdList" parameterType="java.lang.String" resultType="com.epmet.dto.result.UserBaseInfoResultDTO">
SELECT
ubi.id,
wechat.USER_ID,
ubi.MOBILE,
ubi.SURNAME,
ubi.`NAME`,
ubi.real_name,
ubi.ID_NUM,
ubi.GENDER,
ubi.STREET,
ubi.DISTRICT,
ubi.BUILDING_ADDRESS,
wechat.NICKNAME,
wechat.HEAD_IMG_URL
FROM
user_wechat wechat
LEFT JOIN user_base_info ubi ON wechat.USER_ID = ubi.USER_ID
AND wechat.DEL_FLAG = '0'
AND ubi.DEL_FLAG = '0'
AND ubi.USER_ID = #{userId}
WHERE
wechat.USER_ID = #{userId}
ubi.id,
ubi.USER_ID,
ubi.MOBILE,
ubi.SURNAME,
ubi.`NAME`,
ubi.real_name,
ubi.ID_NUM,
ubi.GENDER,
ubi.STREET,
ubi.DISTRICT,
ubi.BUILDING_ADDRESS,
ubi.NICKNAME,
ubi.HEAD_IMG_URL
FROM
user_base_info ubi
WHERE
ubi.DEL_FLAG = '0'
AND ubi.USER_ID = #{userId}
</select>
<!-- 根据用户id获取user_wechat表微信用户基本信息 -->
@ -103,8 +99,8 @@
<if test ='null != idNum and "" != idNum'>id_num = #{idNum},</if>
<if test ='null != gender and "" != gender'>gender = #{gender},</if>
<if test ='null != street and "" != street'>street = #{street},</if>
<if test ='null != district and "" != district'>district = #{district},</if>
<if test ='null != buildingAddress and "" != buildingAddress'>building_address = #{buildingAddress},</if>
<if test ='null != district'>district = #{district},</if>
<if test ='null != buildingAddress'>building_address = #{buildingAddress},</if>
<if test ='null != nickname and "" != nickname'>nickname = #{nickname},</if>
<if test ='null != headImgUrl and "" != headImgUrl'>head_img_url = #{headImgUrl},</if>
<if test ='null != delFlag and "" != delFlag'>del_flag = #{delFlag},</if>

2
epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml

@ -40,7 +40,7 @@
LEFT JOIN
USER_RESI_INFO resi ON user.ID = resi.USER_ID AND resi.DEL_FLAG = '0'
LEFT JOIN
USER_WECHAT wechat ON user.ID = wechat.USER_ID AND wechat.DEL_FLAG = '0'
user_base_info wechat ON user.ID = wechat.USER_ID AND wechat.DEL_FLAG = '0'
LEFT JOIN
REGISTER_RELATION relation ON user.ID = relation.USER_ID
AND relation.DEL_FLAG = '0'

38
epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

@ -66,11 +66,11 @@
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
ubi.HEAD_IMG_URL AS head_photo,
ubi.NICKNAME as nickName
FROM
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
ubi.USER_ID =#{userId}
AND ubi.DEL_FLAG = '0'
@ -89,12 +89,10 @@
) AS show_name
FROM
user_resi_info uri
LEFT JOIN user_wechat uw ON (uri.USER_ID = uw.USER_ID)
LEFT JOIN user_wechat uw ON (uri.USER_ID = uw.USER_ID AND uw.DEL_FLAG = '0' AND uw.USER_ID = #{userId})
WHERE
uri.DEL_FLAG = '0'
AND uw.DEL_FLAG = '0'
AND uri.USER_ID = #{userId}
AND uw.USER_ID = #{userId}
</select>
<select id="selectResiInfoByMobile" parameterType="string"
@ -113,26 +111,24 @@
<!-- 根据userId集合查询用户注册信息 -->
<select id="selectListUserResiInfoDTO" resultType="com.epmet.dto.result.UserResiInfoResultDTO">
SELECT
uri.id,
uri.USER_ID,
ubi.USER_ID,
uri.REG_MOBILE,
uri.SURNAME,
uri.`NAME`,
uri.STREET,
uri.DISTRICT,
uri.BUILDING_ADDRESS,
ubi.SURNAME,
ubi.`NAME`,
ubi.STREET,
ubi.DISTRICT,
ubi.BUILDING_ADDRESS,
CONCAT(
uri.STREET,
ubi.STREET,
'-',
uri.SURNAME,
( CASE WHEN uw.SEX = '1' THEN '先生' WHEN uw.SEX = '2' THEN '女士' ELSE '先生/女士' END )
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_resi_info uri
left join user_wechat uw on(uri.user_id=uw.USER_ID)
WHERE uri.DEL_FLAG = '0'
and uw.DEL_FLAG='0'
AND uri.USER_ID in
ubi.HEAD_IMG_URL as head_photo
FROM user_base_info ubi
left join user_resi_info uri on(ubi.user_id=uri.user_id and uri.del_flag='0')
WHERE ubi.DEL_FLAG = '0'
AND ubi.USER_ID in
<foreach item="userId" collection="userIdList" separator="," open="(" close=")" index="">
#{userId}
</foreach>

12
epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml

@ -100,4 +100,16 @@
AND ur.user_id = #{userId}
AND ( ur.grid_id = #{gridId} OR ur.grid_id = 'all' )
</select>
<!-- 查询所有党员UserId -->
<select id="selectPartyMemberUserIds" resultType="com.epmet.dto.result.PartyMemberUserIdsResultDTO">
SELECT
ur.USER_ID
FROM user_role ur
LEFT JOIN epmet_role er ON er.ID = ur.ROLE_ID
WHERE ur.DEL_FLAG = 0
AND er.DEL_FLAG = 0
AND er.ROLE_KEY = 'partymember'
</select>
</mapper>

4
epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

@ -70,7 +70,7 @@
user_id AS userId,
IFNULL(head_img_url,'') AS userHeadPhoto
FROM
user_wechat
user_base_info
WHERE
user_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
@ -96,7 +96,7 @@
SELECT
wechat.USER_ID,
IFNULL(wechat.NICKNAME,'') AS userNickname,
IFNULL(wechat.HEAD_IMG_URL,'') AS userHeadPhoto,
IFNULL(base.HEAD_IMG_URL,'') AS userHeadPhoto,
IFNULL(base.REAL_NAME,'') AS userName
FROM
user_wechat wechat

Loading…
Cancel
Save