diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 15da7173b4..d48669325b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -10,6 +10,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", "基层治理:群组管理:审核历史", "基层治理:群组管理:审核历史列表查询"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 7b1d8d53cb..e6222a10e1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -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; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 463ec06427..444077098f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -353,4 +353,11 @@ public class RedisKeys { public static String getScreenIndexDataLockKey() { return rootPrefix.concat("stats:indexcal:lock"); } + + /** + * @Description 用户缓存Key + **/ + public static String getResiUserKey(String userId){ + return rootPrefix.concat("resi:user:").concat(userId); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index a4cecaa3c0..e4a6cf94cb 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -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(); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java index e98cc09fe7..85dc25bd0d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java +++ b/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> customerShowGroups = new ArrayList<>(); List> 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 hasAllRequired(final String jsonString, Set requiredColumns) { + List 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 requiredColumns = new HashSet<>(); + requiredColumns.add("content"); + requiredColumns.add("secret"); + List s = ValidatorUtils.hasAllRequired(JSON.toJSONString(form), requiredColumns); + System.out.println(s); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java index d8e6a43485..0d390bfc31 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java @@ -278,12 +278,12 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { decrease = wxmpWorkUserSubscribeDao.decreaseWorkSubscribeCount(openId, templateId, customerId, 1,userId); } if (decrease == 0) { - logger.error("消息{}发送成功但订阅条数-1失败", JSON.toJSONString(msg)); + logger.warn("消息{}发送成功但订阅条数-1失败", JSON.toJSONString(msg)); } //存表 int saveRes = wxmpMsgSendRecordService.saveRecord(initRecord(msg, templateId, openId, WxmpMessageConstant.SUCCESS)); if (saveRes == 0) { - logger.error("消息{}发送成功但存入记录表失败", JSON.toJSONString(msg)); + logger.warn("消息{}发送成功但存入记录表失败", JSON.toJSONString(msg)); } } else { //发送失败 @@ -296,7 +296,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { clear = wxmpWorkUserSubscribeDao.clearWorkSubscribeCount(openId, templateId, customerId,userId); } if (clear == 0) { - logger.error("消息{}发送失败且清空订阅条数失败", JSON.toJSONString(msg)); + logger.warn("消息{}发送失败且清空订阅条数失败", JSON.toJSONString(msg)); } } @@ -316,11 +316,11 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { wxmpMsgSendRecordEntity.setReason(errMsg); int saveRes = wxmpMsgSendRecordService.saveRecord(wxmpMsgSendRecordEntity); if (saveRes == 0) { - logger.error("消息{}发送失败且存入记录表失败", JSON.toJSONString(msg)); + logger.warn("消息{}发送失败且存入记录表失败", JSON.toJSONString(msg)); } } - logger.error("消息:{}发送失败,原因是:{}", JSON.toJSONString(msg), errMsg); + logger.warn("消息:{}发送失败,原因是:{}", JSON.toJSONString(msg), errMsg); continue; } } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java index c9cbe06642..fdb09a68f3 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.Max; @@ -17,7 +18,9 @@ import java.io.Serializable; public class WorkPointVerificationFormDTO implements Serializable { private static final long serialVersionUID = -590822390667788693L; - @NotBlank(message = "获取不到用户Id",groups = ResiCommonUserIdFormDTO.UserIdGroup.class) + public interface WorkPointVerifyGroup extends CustomerClientShowGroup{} + + @NotBlank(message = "获取不到用户Id",groups = WorkPointVerifyGroup.class) private String staffId; /** diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java index 8bb1d31cc5..4624abcaff 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java @@ -6,7 +6,6 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.PointVerificationFormDTO; -import com.epmet.dto.form.ResiCommonUserIdFormDTO; import com.epmet.dto.form.WorkPointVerificationFormDTO; import com.epmet.dto.result.PointVerificationResultDTO; import com.epmet.dto.result.WorkPointVerficationListResultDTO; @@ -54,7 +53,7 @@ public class ExchangeController { @PostMapping("recordmonthly") public Result getStaffVerificationRecordMonthly(@LoginUser TokenDto token,@RequestBody WorkPointVerificationFormDTO verificationParam){ verificationParam.setStaffId(token.getUserId()); - ValidatorUtils.validateEntity(verificationParam, ResiCommonUserIdFormDTO.UserIdGroup.class); + ValidatorUtils.validateEntity(verificationParam, WorkPointVerificationFormDTO.WorkPointVerifyGroup.class); return new Result().ok(pointVerificationLogService.getStaffVerificationRecordMonthly(verificationParam)); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java index 207ce24099..193e5bac1e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java @@ -11,6 +11,7 @@ import com.epmet.resi.group.dto.group.result.*; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.ResiGroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -31,6 +32,8 @@ import java.util.List; public class ResiGroupController { @Autowired ResiGroupService resiGroupService; + @Autowired + ResiGroupOpenFeignClient groupOpenFeignClient; /** * 小组审核历史列表 * @@ -127,4 +130,49 @@ public class ResiGroupController { ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); return resiGroupService.disagreeApplying(disAgreeApplyGroupFormDTO); } + + /** + * @Description 工作端 查询组变更待审核列表 + * @param param + * @return + * @author wangc + * @date 2020.11.03 10:19 + */ + @PostMapping("edit-auditing-list") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDITINGLIST) + public Result> getEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){ + ValidatorUtils.validateEntity(param, CommonGridAndPageFormDTO.GridPageGroup.class); + return groupOpenFeignClient.govEditAuditingList(param); + } + + /** + * @Description 工作端-查询小组修改信息的详情内容 + * @param param + * @returncom.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @PostMapping("edit-auditing-detail") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_DETAIL) + public Result getEditAuditingDetail(@RequestBody GovGroupSummarizeFromDTO param){ + ValidatorUtils.validateEntity(param, GovGroupSummarizeFromDTO.GroupIdG.class); + return groupOpenFeignClient.govEditAuditingDetail(param); + } + + /** + * @Description 工作端-工作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @PostMapping("audit-edit") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDIT) + public Result auditEdit(@LoginUser TokenDto tokenDto,@RequestBody GroupEditionAuditFormDTO param){ + param.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(param, GroupEditionAuditFormDTO.GroupEditionAuditGroup.class); + return groupOpenFeignClient.govAuditEdit(param); + } + + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java index 18815b635a..2fc38efdf0 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java @@ -143,7 +143,7 @@ public interface ResiGroupFeignClient { * @param gridIdList * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei - * @Description 查询网格下待审核的小组总数 + * @Description 查询网格下待审核的小组总数+变更小组信息申请数 * @Date 2020/5/13 15:49 **/ @PostMapping(value = "/resi/group/group/groupprocessingcount",consumes = MediaType.APPLICATION_JSON_VALUE) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java index 015eda6a35..45ed993354 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java @@ -84,6 +84,8 @@ public interface IssueVoteDetailDao extends BaseDao { */ List myPartIssues(@Param("userId")String userId); + List myPartIssuesByTopicId(@Param("topicIds")List topicIds); + /** * @return com.epmet.dto.IssueVoteDetailDTO * @param userId diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index 7f678ba465..d995c8166a 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/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 page(Map params) { @@ -545,16 +550,27 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl myPartIssues(MyPartIssuesFormDTO myPartIssuesFormDTO) { List myPartIssuesResult = issueVoteDetailDao.myPartIssues(myPartIssuesFormDTO.getUserId()); + MyPartIssueFormDTO formDTO = new MyPartIssueFormDTO(); + formDTO.setUserId(myPartIssuesFormDTO.getUserId()); + Result myPartIssueResult = resiGroupOpenFeignClient.selectMyPartTopic(formDTO); + if (!myPartIssueResult.success()){ + throw new RenException("查询我评论过的话题失败......"); + } + if (!CollectionUtils.isEmpty(myPartIssueResult.getData().getTopicIds())){ + List myPartIssuesResultDTOS = issueVoteDetailDao.myPartIssuesByTopicId(myPartIssueResult.getData().getTopicIds()); + myPartIssuesResult.addAll(myPartIssuesResultDTOS); + } if (CollectionUtils.isEmpty(myPartIssuesResult)){ return new ArrayList<>(); } - List orgIds = myPartIssuesResult.stream().map(m -> m.getGridId()).collect(Collectors.toList()); + List collect = myPartIssuesResult.stream().sorted(Comparator.comparing(MyPartIssuesResultDTO::getShiftIssueTime).reversed()).distinct().collect(Collectors.toList()); + List orgIds = collect.stream().map(m -> m.getGridId()).collect(Collectors.toList()); Result> 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; } } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml index 08249e8651..ff7d88384a 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml @@ -88,6 +88,22 @@ ORDER BY i.CREATED_TIME DESC + + - \ No newline at end of file + diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupAuditStatusConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupAuditStatusConstant.java new file mode 100644 index 0000000000..8544c6fe12 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupAuditStatusConstant.java @@ -0,0 +1,14 @@ +package com.epmet.resi.group.constant; + +public interface GroupAuditStatusConstant { + + // 审核中 + String UNDER_AUDITING = "under_auditing"; + + // 驳回 + String REJECTED = "rejected"; + + // 支持 + String APPROVED = "approved"; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupLimitConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupLimitConstant.java new file mode 100644 index 0000000000..0e158a8804 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupLimitConstant.java @@ -0,0 +1,10 @@ +package com.epmet.resi.group.constant; + +public interface GroupLimitConstant { + + /** + * 每月可以编辑2次 + */ + Integer EDIT_NUM_LIMIT_MONTH = 2; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java new file mode 100644 index 0000000000..169073eb68 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java @@ -0,0 +1,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; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java new file mode 100644 index 0000000000..a86f1bb9ae --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java @@ -0,0 +1,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; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java index 7757d54e37..00163136a2 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java @@ -1,7 +1,9 @@ package com.epmet.resi.group.dto.group.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -12,8 +14,12 @@ import java.io.Serializable; @Data public class GovGroupSummarizeFromDTO implements Serializable { private static final long serialVersionUID = 1L; + + public interface GroupIdG extends CustomerClientShowGroup{} + /** * 小组id */ + @NotBlank(message = "群组Id不能为空",groups = GroupIdG.class) private String groupId; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupEditionAuditFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupEditionAuditFormDTO.java new file mode 100644 index 0000000000..fccd849619 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupEditionAuditFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.resi.group.dto.group.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 组信息修改审核入参DTO + * @ClassName GroupEditionAuditFormDTO + * @Auth wangc + * @Date 2020-11-02 17:30 + */ +@Data +public class GroupEditionAuditFormDTO implements Serializable { + private static final long serialVersionUID = 3851649860177395296L; + + public interface GroupEditionAuditGroup extends CustomerClientShowGroup{} + + /** + * 组Id + */ + @NotBlank(message = "组Id不能为空",groups = GroupEditionAuditGroup.class) + private String groupId; + + /** + * 审核结果 审核结果。approved:支持;rejected:拒绝 + */ + @NotBlank(message = "审核结果不能为空",groups = GroupEditionAuditGroup.class) + private String auditResult; + + /** + * 拒绝时的备注 + */ + private String remark; + + /** + * 工作人员Id + */ + @NotBlank(message = "工作人员Id不能为空",groups = GroupEditionAuditGroup.class) + private String staffId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java new file mode 100644 index 0000000000..c7767054d4 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class GroupDetailResultDTO { + + private String groupHeadPhoto; + private String groupName; + private String groupIntroduction; + private Integer editNumLimit; + private Integer avaliableEditNum; + private String auditStatus; + private Boolean editable; + private String remark; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java new file mode 100644 index 0000000000..0cf88d6802 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * @Description 工作端 群信息修改申请详情 + * @ClassName GroupEditionDetailResultDTO + * @Auth wangc + * @Date 2020-11-02 17:54 + */ +@Data +public class GroupEditionDetailResultDTO implements Serializable { + private static final long serialVersionUID = -784043668974222480L; + + /** + * 待审核的小组Id + */ + private String groupId; + + /** + * 待审核小组名称 是提交的名称,如果没有更改群名称则还是原来的 + */ + private String groupName; + + /** + * 待审核小组图片 是提交的群头像,如果没有更改群头像则还是原来的 + */ + private String groupHeadPhoto; + + /** + * 待审核小组的介绍 是提交的群介绍,如果没有更改群介绍则还是原来的 + */ + private String groupIntroduction; + + /** + * 群主的昵称 xx路-xx先生/女士 + */ + private String groupLeaderName; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyPartIssueFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyPartIssueFormDTO.java new file mode 100644 index 0000000000..98e5100d07 --- /dev/null +++ b/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; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyPartIssueResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyPartIssueResultDTO.java new file mode 100644 index 0000000000..35759b6bbc --- /dev/null +++ b/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 topicIds; + + public MyPartIssueResultDTO() { + this.topicIds = new ArrayList<>(); + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicClosingMsgResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicClosingMsgResultDTO.java index ab8262e70c..8989cf472d 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicClosingMsgResultDTO.java +++ b/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; + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java index 97c0a12faf..06efffca1e 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java +++ b/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 badgeList; - + /** + * 话题被屏蔽详情 + */ + private TopicHiddenDetailDTO hiddenDetail; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicHiddenDetailDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicHiddenDetailDTO.java new file mode 100644 index 0000000000..aa0d5d9400 --- /dev/null +++ b/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; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 0650373fe0..5197cf9b93 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -1,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> govEditAuditingList(@RequestBody CommonGridAndPageFormDTO param); + + /** + * @Description 查询小组修改信息的详情内容 + * @param param + * @returncom.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @PostMapping("/resi/group/group/gov-edit-auditing-detail") + Result govEditAuditingDetail(@RequestBody GovGroupSummarizeFromDTO param); + + /** + * @Description 工作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @PostMapping("/resi/group/group/gov-audit-edit") + Result govAuditEdit(@RequestBody GroupEditionAuditFormDTO param); + + /** * @Description 查询用户参与的且不是自己发表的话题对应的议题Id集合 * @author sun @@ -74,6 +112,16 @@ public interface ResiGroupOpenFeignClient { @PostMapping("resi/group/topic/select-my-create-topic") Result> selectMyCreateTopic(@RequestBody TopicIdListFormDTO topicIdListFormDTO); + /** + * @Description 查询我评论过的话题 + * @Param myPartIssueFormDTO + * @author zxc + * @date 2020/11/17 3:34 下午 + */ + @PostMapping("resi/group/topic/myparttopic") + Result selectMyPartTopic(@RequestBody MyPartIssueFormDTO myPartIssueFormDTO); +} + /** * @Description 待审核||已驳回 申请详情 * @Param applicationDetailFormDTO diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 4b8f0cdd64..ff1df0075e 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -1,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> govEditAuditingList(CommonGridAndPageFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "govEditAuditingList", param); + } + + @Override + public Result govEditAuditingDetail(GovGroupSummarizeFromDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "govEditAuditingDetail", param); + } + + @Override + public Result govAuditEdit(GroupEditionAuditFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "govAuditEdit", param); + } @Override public Result> topicToIssueList(MyPartProjectsFormDTO formDTO) { @@ -52,6 +76,11 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectMyCreateTopic", topicIdListFormDTO); } + @Override + public Result selectMyPartTopic(MyPartIssueFormDTO myPartIssueFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectMyPartTopic", myPartIssueFormDTO); + } + @Override public Result applicationDetail(ApplicationDetailFormDTO applicationDetailFormDTO) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "applicationDetail", applicationDetailFormDTO); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java index d7da80088c..dcc8e30fce 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java @@ -59,6 +59,11 @@ public interface UserMessageConstant { */ String CREATION_OF_GROUP_MESSAGE_TEMPLATE = "%s%s申请创建小组【%s】,请审核。"; + /** + * 变更组信息时的消息模板 + */ + String EDIT_OF_GROUP_MESSAGE_TEMPLATE = "%s%s申请变更小组【%s】,请审核。"; + /** * 组长审核入组申请时的微信订阅behavior */ diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index e73d12fc0e..d9f1b60ead 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -297,7 +297,7 @@ public class ResiGroupController { * @param gridIdList * @return com.epmet.commons.tools.utils.Result> * @Author yinzuomei - * @Description 传入网格id列表,返回每个网格的待审核小组总数 + * @Description 传入网格id列表,返回每个网格的待审核小组总数+变更小组信息申请数 * @Date 2020/5/13 21:33 **/ @PostMapping("groupprocessingcount") @@ -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> govEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){ + return new Result>().ok(resiGroupService.getEditAuditingList(param)); + } + + /** + * @Description 工作端-查询小组修改信息的详情内容 + * @param param + * @returncom.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @PostMapping("gov-edit-auditing-detail") + public Result govEditAuditingDetail(@RequestBody GovGroupSummarizeFromDTO param){ + return new Result().ok(resiGroupService.getEditAuditingDetail(param)); + } + + /** + * @Description 工作端-作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @PostMapping("gov-audit-edit") + public Result govAuditEdit(@RequestBody GroupEditionAuditFormDTO param){ + resiGroupService.auditEdit(param); + return new Result(); + } + + /** * @Description 查询话题所属小组名 * @Param groupInfoFormDTO diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupEditSubmitRecordDao.java new file mode 100644 index 0000000000..829beba4f7 --- /dev/null +++ b/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 + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.group.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.group.entity.GroupEditSubmitRecordEntity; +import 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 { + + /** + * 查询指定组,指定时间段内的编辑次数 + * @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 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); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index fc7ec20e09..363210b6ec 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -26,6 +26,7 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + import java.util.List; /** @@ -197,6 +198,19 @@ public interface ResiGroupDao extends BaseDao { */ 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 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java new file mode 100644 index 0000000000..9f8b5c8816 --- /dev/null +++ b/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 + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.group.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 组编辑提交记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("group_edit_submit_record") +public class GroupEditSubmitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 小组ID + */ + private String groupId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private 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; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/GroupEditSubmitRecordRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/GroupEditSubmitRecordRedis.java new file mode 100644 index 0000000000..346ebd5924 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/GroupEditSubmitRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.group.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 组编辑提交记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-02 + */ +@Component +public class GroupEditSubmitRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java index 7f2442a8e7..03dcc4ecba 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java @@ -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 userParam = new LinkedList<>(); userParam.add(userId); + Result> userCacheResult = epmetUserOpenFeignClient.queryUserBaseInfo(userParam); + if(userCacheResult.success() && !CollectionUtils.isEmpty(userCacheResult.getData())){ + return userCacheResult.getData().iterator().next().getRealName(); + } + return null; + } } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index 0c05c0ac76..bea33897d6 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -294,6 +294,37 @@ public interface ResiGroupService extends BaseService { */ List 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 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 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 60eefa77ce..3c628bdf81 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -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 page(Map params) { IPage page = baseDao.selectPage( @@ -338,38 +365,45 @@ public class ResiGroupServiceImpl extends BaseServiceImpl resiResult = - epmetUserFeignClient.getUserResiInfoDTO(resiParam); - String userName = ""; - if(resiResult.success() && null != resiResult.getData()){ - userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) - + (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); - } + //4.获取居民注册信息 + UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); + resiParam.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); + resiParam.setUserId(applyCreateGroupFormDTO.getUserId()); + Result resiResult = + epmetUserFeignClient.getUserResiInfoDTO(resiParam); + String userName = ""; + if(resiResult.success() && null != resiResult.getData()){ + userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) + + (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); + } userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; - String msg = String.format(UserMessageConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO.getGroupName()); - //3.2、插入一条待审核的操作记录 + String msg = String.format(UserMessageConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO.getGroupName()); + //4.2、插入一条待审核的操作记录 ResiGroupOperationDTO resiGroupOperation = new ResiGroupOperationDTO(); resiGroupOperation.setResiGroupId(resiGroupEntity.getId()); resiGroupOperation.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); @@ -377,7 +411,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl 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 resiRoles = getResiRoles(app, customerId, userId, gridId); + boolean isPartymember = false; + boolean isWarmhearted = false; + for (UserRoleResultDTO role : resiRoles) { + if (EpmetRoleKeyConstant.WARMHEARTED.equals(role.getRoleKey())) { + isWarmhearted = true; + } + if (EpmetRoleKeyConstant.PARTYMEMBER.equals(role.getRoleKey())) { + isPartymember = true; + } + } + if (!isWarmhearted && isPartymember) { + throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode(), "只有党员和热心居民才能创建和编辑小组"); + } + String roleName = ""; + if (isPartymember) { + roleName = ModuleConstant.PARTYMEMBER; + } else if (isWarmhearted) { + roleName = ModuleConstant.WAREMHEARTED_RESI; + } + + //3.获取居民注册信息 + UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); + resiParam.setCustomerId(customerId); + resiParam.setUserId(userId); + Result resiResult = + epmetUserFeignClient.getUserResiInfoDTO(resiParam); + String userName = ""; + if (resiResult.success() && null != resiResult.getData()) { + userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) + + (StringUtils.isBlank(resiResult.getData().getName()) ? "" : resiResult.getData().getName()); + } + userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; + return String.format(UserMessageConstant.EDIT_OF_GROUP_MESSAGE_TEMPLATE, roleName, userName, groupName); + } + + /** + * 查询居民的角色列表 + * @param app + * @param customerId + * @param userId + * @param gridId + * @return + */ + private List getResiRoles(String app, String customerId, String userId, String gridId) { + UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); + userRoleFormDTO.setApp(app); + userRoleFormDTO.setCustomerId(customerId); + userRoleFormDTO.setUserId(userId); + userRoleFormDTO.setGridId(gridId); + Result> rolesResult = epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO); + + if (! rolesResult.success()) { + logger.error("修改组信息:查询居民角色失败,详情:{}", rolesResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), "查询居民角色失败"); + } else { + List roles = rolesResult.getData(); + if (CollectionUtils.isEmpty(roles)) { + roles = new ArrayList<>(); + } + return roles; + } + } + + /** + * 内容检查 + * @param groupName + * @param groupIntroduction + * @param groupHeadPhoto + */ + private void scanGroupEditContent(String groupName, String groupIntroduction, String groupHeadPhoto) { + // 文本内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + String content = groupName.concat("-").concat(groupIntroduction); + taskDTO.setContent(content); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("调用内容审核服务审核文本发生错误:{}", textSyncScanResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + } + } + + // 图片内容审核 + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(groupHeadPhoto); + imgScanParamDTO.getTasks().add(task); + + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + logger.error("调用内容审核服务审核图片发生错误:{}", textSyncScanResult.getInternalMsg()); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + } + } + } + + /** + * @Description 工作端 查询组变更待审核列表 + * @param param + * @return + * @author wangc + * @date 2020.11.03 10:19 + */ + @Override + public List getEditAuditingList(CommonGridAndPageFormDTO param) { + return Optional.ofNullable(PageHelper.startPage(null == param.getPageNo() ? NumConstant.ONE : param.getPageNo() , null == param.getPageSize() ? NumConstant.TWELVE : param.getPageSize()) + .doSelectPage(() -> { + groupEditSubmitRecordDao.selectGroupEditApplyList(param.getGridId());}).getResult()).orElse(new LinkedList<>()) + .stream().map(o -> { return (ApplyingGroupResultDTO)o; }).collect(Collectors.toList()); + } + + /** + * @Description 查询小组修改信息的详情内容 不加事务! + * @param param + * @return com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO + * @author wangc + * @date 2020.11.03 14:10 + */ + @Override + public GroupEditionDetailResultDTO getEditAuditingDetail(GovGroupSummarizeFromDTO param) { + GroupEditSubmitRecordEntity edit = groupEditSubmitRecordDao.selectEditDetail(param.getGroupId(),null); + if(null == edit) { + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.getEditAuditingDetail,未找到小组变更信息记录,传参:{}",JSON.toJSONString(param)); + return null;} + //取消未读状态 + GroupEditSubmitRecordEntity _update = new GroupEditSubmitRecordEntity(); + _update.setId(edit.getId());_update.setReadFlag(ModuleConstant.READ); + groupEditSubmitRecordDao.updateById(_update); + GroupEditionDetailResultDTO result = ConvertUtils.sourceToTarget(edit, GroupEditionDetailResultDTO.class); + result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy())); + return result; + } + + /** + * @Description 工作人员提交审核 + * @param param + * @return void + * @author wangc + * @date 2020.11.03 16:02 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void auditEdit(GroupEditionAuditFormDTO param) { + if(StringUtils.equals(param.getAuditResult(),ModuleConstant.AUDITING_OPERATION_REJECT) && StringUtils.isBlank(param.getRemark())){ + throw new RenException("拒绝理由不能为空"); + } + GroupEditSubmitRecordEntity edit = groupEditSubmitRecordDao.selectEditDetail(param.getGroupId(),null); + if(null == edit){ + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.auditEdit,找不到待审核的组更新记录,传参:{}",JSON.toJSONString(param)); + throw new RenException("找不到待审核的组更新记录"); + } + + int affectedRows = groupEditSubmitRecordDao.updateAuditResult(param.getGroupId(),param.getStaffId(),param.getAuditResult(),param.getRemark()); + if(affectedRows <= NumConstant.ZERO){ + logger.error("com.epmet.modules.group.service.impl.ResiGroupServiceImpl.auditEdit,更新组编辑记录时受影响行数小于1,传参:{}",JSON.toJSONString(param)); + throw new RenException("更新组编辑记录时受影响行数小于1"); + } + if(!StringUtils.equals(param.getAuditResult(),ModuleConstant.AUDITING_OPERATION_REJECT)){ + //同意 + ResiGroupEntity _update = ConvertUtils.sourceToTarget(edit,ResiGroupEntity.class); + _update.setId(param.getGroupId()); + baseDao.updateById(_update); + } + resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(edit.getGridId()); + resiGroupRedis.delGroup(param.getGroupId()); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index 0015e79113..19aed166d8 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/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>().ok(topicService.selectMyCreateTopic(topicIdListFormDTO)); } + /** + * @Description 查询我评论过的话题 + * @Param myPartIssueFormDTO + * @author zxc + * @date 2020/11/17 3:34 下午 + */ + @PostMapping("myparttopic") + public Result selectMyPartTopic(@RequestBody MyPartIssueFormDTO myPartIssueFormDTO){ + return new Result().ok(topicService.selectMyPartTopic(myPartIssueFormDTO)); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index 3c06ced85b..6590732567 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/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 { * @date 2020/11/13 4:32 下午 */ List selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO); + + /** + * @Description 查询我评论过的话题 + * @Param myPartIssueFormDTO + * @author zxc + * @date 2020/11/17 3:34 下午 + */ + List selectMyPartTopic(MyPartIssueFormDTO myPartIssueFormDTO); /** * 获取小组内话题ID * @author zhaoqifeng diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index bf66a029e5..26115713eb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/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 { * @date 2020/11/13 4:32 下午 */ List selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO); + + /** + * @Description 查询我评论过的话题 + * @Param myPartIssueFormDTO + * @author zxc + * @date 2020/11/17 3:34 下午 + */ + MyPartIssueResultDTO selectMyPartTopic(MyPartIssueFormDTO myPartIssueFormDTO); /** * 获取小组内话题ID * @author zhaoqifeng diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 3023465da1..b39a18e782 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -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>> 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> 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 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>> badgeR + = userOpenFeignClient.userShowBadge( + new UserGroupFormDTO(group.getCustomerId(),other)); + if (null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()) { + Map> 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>().ok(latestTenTopics); @@ -437,15 +440,16 @@ public class ResiTopicServiceImpl extends BaseServiceImpl 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>> 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> badgeM = badgeR.getData(); pastTopics.forEach(top -> { @@ -462,7 +466,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); @@ -691,11 +696,37 @@ public class ResiTopicServiceImpl extends BaseServiceImpl 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 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 userId = new LinkedList<>();userId.add(topicDetail.getCreatedBy()); String customerId; @@ -747,32 +778,33 @@ public class ResiTopicServiceImpl extends BaseServiceImpl>> 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> 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 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>> badgeR + = userOpenFeignClient.userShowBadge( + new UserGroupFormDTO(group.getCustomerId(), other)); + if (null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()) { + Map> 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>().ok(hiddenTopics); @@ -911,9 +943,6 @@ public class ResiTopicServiceImpl extends BaseServiceImpl> getPastTopicListGov(ResiTopicPageFormDTO topicPageFormDTO) { //1.查询历史话题列表 - - topicPageFormDTO.setUserId(topicPageFormDTO.getUserId()); - topicPageFormDTO.setPageNo((topicPageFormDTO.getPageNo() - NumConstant.ONE) * topicPageFormDTO.getPageSize()); List pastTopics = @@ -961,7 +990,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl> getHiddenTopicsGov(ResiTopicPageFormDTO topicPageFormDTO) { - return getHiddenTopics(null,topicPageFormDTO); + topicPageFormDTO.setStatus("hidden"); + return getPastTopicListGov(topicPageFormDTO); } @Override @@ -1632,6 +1662,23 @@ public class ResiTopicServiceImpl extends BaseServiceImpl 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 topicIds = baseDao.selectMyPartTopic(myPartIssueFormDTO); + if (CollectionUtils.isEmpty(topicIds)){ + return new MyPartIssueResultDTO(); + } + MyPartIssueResultDTO myPartIssueResultDTO = new MyPartIssueResultDTO(); + myPartIssueResultDTO.setTopicIds(topicIds); + return myPartIssueResultDTO; + } /** * 获取小组内话题ID * diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java index 92ed858aef..dd235abc8c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java @@ -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"; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.4__createGroupSubmitRecord.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.4__createGroupSubmitRecord.sql new file mode 100644 index 0000000000..1e53a7d6f1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.4__createGroupSubmitRecord.sql @@ -0,0 +1,24 @@ +CREATE TABLE `group_edit_submit_record` +( + `ID` varchar(64) NOT NULL, + `GROUP_ID` varchar(64) NOT NULL COMMENT '小组ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) DEFAULT NULL COMMENT '网格ID', + `GROUP_HEAD_PHOTO` varchar(255) NOT NULL COMMENT '头像', + `GROUP_NAME` varchar(10) NOT NULL COMMENT '小组名称', + `GROUP_INTRODUCTION` varchar(500) NOT NULL COMMENT '小组介绍', + `AUDIT_STATUS` varchar(30) NOT NULL COMMENT '审核状态。under_auditting:审核中,approved:通过,rejected:驳回', + `STAFF_ID` varchar(64) DEFAULT NULL COMMENT '审核人ID', + `REMARK` varchar(255) DEFAULT NULL COMMENT '回复', + `AUDIT_TIME` datetime DEFAULT NULL COMMENT '审核时间', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(8) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人 提交人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '修改人ID', + `UPDATED_TIME` datetime NOT NULL COMMENT '修改时间', + `READ_FLAG` varchar(8) NOT NULL COMMENT '已读read 未读unread', + `MESSAGE_TEXT` varchar(255) NOT NULL COMMENT '审核人员查看待审核列表时的文案,如:党员李华申请变更小组【原小组名】,请审核。', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='组编辑提交记录表' \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml new file mode 100644 index 0000000000..b9b2924cdb --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml @@ -0,0 +1,150 @@ + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE + group_edit_submit_record + SET + AUDIT_STATUS = #{auditStatus}, + STAFF_ID = #{staffId}, + + REMARK = #{remark}, + + AUDIT_TIME = NOW(),UPDATED_TIME = NOW(),UPDATED_BY = #{staffId} + WHERE + DEL_FLAG = '0' + AND + GROUP_ID = #{groupId} + AND + AUDIT_STATUS = 'under_auditIng' + AND + STAFF_ID IS NULL + LIMIT 1 + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index bc2e24ea2a..95a6b66ce3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -398,6 +398,27 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml index 221c9c3d3f..912e6ed558 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml @@ -3,21 +3,47 @@ - - - - - - - - - - - - - - - + + + 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 + + ( + REPLACE(UUID(),'-',''), + #{b.customerId}, + #{b.gridId}, + #{b.userId}, + #{b.badgeId}, + #{b.isOpened}, + #{b.certificationAutidStatus}, + #{b.delFlag}, + #{b.revision}, + NOW(), + #{b.createdBy}, + NOW(), + #{b.updatedBy} + ) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index 1499c9581b..53433e05ec 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -56,7 +56,7 @@ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index cc86f83ccd..276e11a1ac 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -28,28 +28,24 @@ @@ -103,8 +99,8 @@ id_num = #{idNum}, gender = #{gender}, street = #{street}, - district = #{district}, - building_address = #{buildingAddress}, + district = #{district}, + building_address = #{buildingAddress}, nickname = #{nickname}, head_img_url = #{headImgUrl}, del_flag = #{delFlag}, diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml index c1f8791e16..a46001c8c6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml +++ b/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' diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index 1203a01e12..3e6adef055 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/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 - 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 #{userId} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml index d7726d3b7b..4472c48b77 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml +++ b/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' ) + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index 5797e95eef..d51c98cf19 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -70,7 +70,7 @@ user_id AS userId, IFNULL(head_img_url,'') AS userHeadPhoto FROM - user_wechat + user_base_info WHERE user_id in @@ -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