diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java index 9f4e8f58..932234e6 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java @@ -42,5 +42,6 @@ public interface NumConstant { String FOUR_STR = "4"; String FIVE_STR = "5"; String SIX_STR = "6"; + String SEVEN_STR = "7"; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java index ebc3ca20..22c50ea6 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java @@ -4,10 +4,7 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.PartyGroupOfficialsResultDTO; -import com.elink.esua.epdc.dto.result.PartyGroupResultDTO; -import com.elink.esua.epdc.dto.result.PartyTopicResultDTO; -import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO; +import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.service.PartyGroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; @@ -164,4 +161,16 @@ public class ApiPartyGroupController { return partyGroupService.joinGroup(userDetail, formDto); } + /** + * 获取论坛指南信息 + * @param partyGroupId 党群ID + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:48 2020-06-17 + **/ + @GetMapping("group/guideInfo/{partyGroupId}") + public Result> guideInfo(@PathVariable("partyGroupId") String partyGroupId){ + return partyGroupService.getGuideInfo(partyGroupId); + } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java index ba8e869c..4df0afee 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java @@ -3,10 +3,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.PartyGroupOfficialsResultDTO; -import com.elink.esua.epdc.dto.result.PartyGroupResultDTO; -import com.elink.esua.epdc.dto.result.PartyTopicResultDTO; -import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO; +import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.fallback.PartyGroupFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -144,4 +141,14 @@ public interface PartyGroupFeignClient { @GetMapping(value = "partyGroup/topic/myTopicList", consumes = MediaType.APPLICATION_JSON_VALUE) Result myTopicList(MyPartyTopicFormDTO formDto); + + /** + * 获取论坛指南信息 + * @param partyGroupId 党群ID + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:48 2020-06-17 + **/ + @GetMapping(value = "partyGroup/epdc-app/partygroupguide/group/guideInfo/{partyGroupId}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getGuideInfo(@PathVariable("partyGroupId") String partyGroupId); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java index 97998906..e948313d 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java @@ -4,10 +4,7 @@ import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.PartyGroupOfficialsResultDTO; -import com.elink.esua.epdc.dto.result.PartyGroupResultDTO; -import com.elink.esua.epdc.dto.result.PartyTopicResultDTO; -import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO; +import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.PartyGroupFeignClient; import org.springframework.stereotype.Component; @@ -85,4 +82,9 @@ public class PartyGroupFeignClientFallback implements PartyGroupFeignClient { public Result myTopicList(MyPartyTopicFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "myTopicList",formDto); } + + @Override + public Result> getGuideInfo(String partyGroupId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "getGuideInfo",partyGroupId); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java index eb5ac438..654f2c44 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java @@ -3,10 +3,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.PartyGroupOfficialsResultDTO; -import com.elink.esua.epdc.dto.result.PartyGroupResultDTO; -import com.elink.esua.epdc.dto.result.PartyTopicResultDTO; -import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO; +import com.elink.esua.epdc.dto.result.*; import java.util.List; @@ -18,7 +15,7 @@ import java.util.List; public interface PartyGroupService { /** - * @Description 党群列表接口 + * @Description 党群列表接口 * @Author songyunpeng * @Date 2020/6/3 * @Param [] @@ -26,7 +23,7 @@ public interface PartyGroupService { **/ Result> groupList(TokenDto userDetail); /** - * @Description 网格长列表 + * @Description 网格长列表 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDTO] @@ -34,7 +31,7 @@ public interface PartyGroupService { **/ Result> officialsList(TokenDto userDetail, PartyGroupOfficialsFormDTO formDTO); /** - * @Description 评论 + * @Description 评论 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDto] @@ -42,7 +39,7 @@ public interface PartyGroupService { **/ Result commentSubmit(TokenDto userDetail, PartyTopicCommentFormDTO formDto); /** - * @Description 话题列表 + * @Description 话题列表 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDto] @@ -50,7 +47,7 @@ public interface PartyGroupService { **/ Result topicList(TokenDto userDetail, PartyTopicFormDTO formDto); /** - * @Description 发布话题 + * @Description 发布话题 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDto] @@ -58,7 +55,7 @@ public interface PartyGroupService { **/ Result topicSubmit(TokenDto userDetail, PartyTopicSubmitFormDTO formDto); /** - * @Description 话题(赞/踩)接口 + * @Description 话题(赞/踩)接口 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDto] @@ -66,7 +63,7 @@ public interface PartyGroupService { **/ Result topicStatement(TokenDto userDetail, TopicStatementFormDTO formDto); /** - * @Description 群成员列表 + * @Description 群成员列表 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDto] @@ -74,7 +71,7 @@ public interface PartyGroupService { **/ Result userList(TokenDto userDetail, PartyUserGroupFormDTO formDto); /** - * @Description 当前用户在群里的信息 + * @Description 当前用户在群里的信息 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDto] @@ -82,7 +79,7 @@ public interface PartyGroupService { **/ Result currentUserInfo(String partyGroupId); /** - * @Description 禁言 + * @Description 禁言 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDto] @@ -90,7 +87,7 @@ public interface PartyGroupService { **/ Result banned( PartyUserBannedFormDTO formDto); /** - * @Description 身份认证 + * @Description 身份认证 * @Author songyunpeng * @Date 2020/6/3 * @Param [userDetail, formDto] @@ -98,7 +95,7 @@ public interface PartyGroupService { **/ Result modifyIdentity(PartyUserIdentityFormDTO formDto); /** - * @Description 加入党群 + * @Description 加入党群 * @Author songyunpeng * @Date 2020/6/4 * @Param [userDetail, formDto] @@ -106,11 +103,20 @@ public interface PartyGroupService { **/ Result joinGroup(TokenDto userDetail, PartyUserJoinGroupFormDTO formDto); /** - * @Description 我的话题列表 + * @Description 我的话题列表 * @Author songyunpeng * @Date 2020/6/11 * @Param [userDetail, formDto] * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result myTopicList(TokenDto userDetail, MyPartyTopicFormDTO formDto); + + /** + * 获取论坛指南信息 + * @param partyGroupId 党群ID + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:48 2020-06-17 + **/ + Result> getGuideInfo(String partyGroupId); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java index c1a08107..7bb9ae5f 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java @@ -4,10 +4,7 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.form.*; -import com.elink.esua.epdc.dto.result.PartyGroupOfficialsResultDTO; -import com.elink.esua.epdc.dto.result.PartyGroupResultDTO; -import com.elink.esua.epdc.dto.result.PartyTopicResultDTO; -import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO; +import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.PartyGroupFeignClient; import com.elink.esua.epdc.service.PartyGroupService; @@ -154,4 +151,9 @@ public class PartyGroupServiceImpl implements PartyGroupService { formDto.setUserId(userDetail.getUserId()); } return partyGroupFeignClient.myTopicList(formDto); } + + @Override + public Result> getGuideInfo(String partyGroupId) { + return partyGroupFeignClient.getGuideInfo(partyGroupId); + } } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupDTO.java index 7d14d171..3f655e00 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupDTO.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupDTO.java @@ -21,6 +21,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -132,4 +133,9 @@ public class PartyGroupDTO implements Serializable { */ private Integer sort; + /** + * 部门回显 + */ + private List deptIdList; + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideDTO.java new file mode 100644 index 00000000..efc317d7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideDTO.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import lombok.Data; + + +/** + * 党群指南 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@Data +public class PartyGroupGuideDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 内容 + */ + private String content; + + /** + * 显示时间:1-周一,2-周二,3-周三,4-周四,5-周五,6-周六,7-周日 + */ + private String dayOfWeek; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识(0-否,1-是) + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + // 虚字段 + + /** + * 党群id + */ + private List partyGroupIdList; + + /** + * 党群名称 + */ + private String partyGroupName; + + /** + * 党群id + */ + private String partyGroupId; +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideRelationDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideRelationDTO.java new file mode 100644 index 00000000..9bee934a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideRelationDTO.java @@ -0,0 +1,81 @@ +/** + * 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.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党群指南关系表 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@Data +public class PartyGroupGuideRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 党群ID + */ + private String partyGroupId; + + /** + * 党群指南表ID + */ + private String partyGroupGuideId; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识(0-否,1-是) + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/enums/DayOfWeekEnum.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/enums/DayOfWeekEnum.java new file mode 100644 index 00000000..d50b95e0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/enums/DayOfWeekEnum.java @@ -0,0 +1,77 @@ +package com.elink.esua.epdc.dto.enums; + +import com.elink.esua.epdc.commons.tools.constant.NumConstant; + +/** + * 一周七天 枚举 + * + * @author zhangyong + * @date 2020-06-17 + */ +public enum DayOfWeekEnum { + + /** + * 1-周一 + */ + ONE(NumConstant.ONE_STR, "周一"), + /** + * 2-周二 + */ + TWO(NumConstant.TWO_STR, "周二"), + /** + * 3-周三 + */ + THREE(NumConstant.THREE_STR, "周三"), + /** + * 4-周四 + */ + FOUR(NumConstant.FOUR_STR, "周四"), + /** + * 5-周五 + */ + FIVE(NumConstant.FIVE_STR, "周五"), + /** + * 6-周六 + */ + SIX(NumConstant.SIX_STR, "周六"), + /** + * 7-周天 + */ + SEVEN(NumConstant.SEVEN_STR, "周天"); + + private String key; + private String value; + + DayOfWeekEnum(String key, String value) { + this.key = key; + this.value = value; + } + + public String getKey() { + return key; + } + + public String getValue() { + return value; + } + + + /** + * 根据key获取value + * + * @param key + * @return com.elink.esua.epdc.enums.AppNewsLikeEnum + * @author zhangyong + * @date 2020-06-17 + */ + public static String getEnumByKey(String key) { + DayOfWeekEnum[] enums = DayOfWeekEnum.values(); + for (DayOfWeekEnum anEnum : enums) { + if (anEnum.getKey().equals(key)) { + return anEnum.getValue(); + } + } + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyUserNewInfoFormDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyUserNewInfoFormDTO.java index 429362de..358b557c 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyUserNewInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyUserNewInfoFormDTO.java @@ -37,5 +37,30 @@ public class PartyUserNewInfoFormDTO implements Serializable { * 党员标识 */ private String partyMember; + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; + + /** + * 网格 + */ + private String grid; + /** + * 网格ID + */ + private Long gridId; } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/AllUsers.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/AllUsers.java index 51f3944f..cca307f2 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/AllUsers.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/AllUsers.java @@ -38,6 +38,10 @@ public class AllUsers implements Serializable { * 身份标识 0:群员 1:群主 2:副群主 */ private String identityFlag; + /** + * 是否是本社区居民:0-否,1-是 + */ + private String thisCommunity; /** * 禁言状态:0-未禁言,1-禁言1天,2-禁言1周,3-禁言一个月,4-永久禁言 diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/CurrentUser.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/CurrentUser.java index db0fbccd..419bc722 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/CurrentUser.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/CurrentUser.java @@ -38,6 +38,10 @@ public class CurrentUser implements Serializable { * 身份标识 0:群员 1:群主 2:副群主 */ private String identityFlag; + /** + * 是否是本社区居民:0-否,1-是 + */ + private String thisCommunity; /** * 禁言状态:0-未禁言,1-禁言1天,2-禁言1周,3-禁言一个月,4-永久禁言 diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcPartyGroupGuideResultDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcPartyGroupGuideResultDTO.java new file mode 100644 index 00000000..d78dcb4f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcPartyGroupGuideResultDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 获取当天(周几)的-论坛指南信息 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-06-17 + */ +@Data +public class EpdcPartyGroupGuideResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 党群指南 显示时间 + */ + private String showTime; + + /** + * 党群指南 内容 + */ + private String content; +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyTopicSupportResultDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyTopicSupportResultDTO.java new file mode 100644 index 00000000..62416017 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyTopicSupportResultDTO.java @@ -0,0 +1,51 @@ +/** + * 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.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 话题点赞表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-05-29 + */ +@Data +public class PartyTopicSupportResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 评论人昵称 + */ + private String nickname; + + /** + * 评论人头像 + */ + private String userAvatar; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/TopicList.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/TopicList.java index c97dd724..513ce52c 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/TopicList.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/TopicList.java @@ -97,10 +97,24 @@ public class TopicList implements Serializable { * 是否点赞 */ private String likeFlag; + /** + * 身份标识 - 话题发布人所在话题所属党群 + */ + private String identityFlag; + /** + * 是否是本社区居民 + */ + private String thisCommunity; /** * 评论列表 */ private List comments; + + /** + * 点赞列表 + */ + private List likes; + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/EpdcPartyGroupGuideController.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/EpdcPartyGroupGuideController.java new file mode 100644 index 00000000..7ac0115c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/EpdcPartyGroupGuideController.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO; +import com.elink.esua.epdc.service.PartyGroupGuideService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 党群指南 app接口 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@RestController +@RequestMapping(Constant.EPDC_APP + "partygroupguide") +public class EpdcPartyGroupGuideController { + + @Autowired + private PartyGroupGuideService partyGroupGuideService; + + /** + * 获取论坛指南信息 + * @param partyGroupId 党群ID + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:48 2020-06-17 + **/ + @GetMapping("group/guideInfo/{partyGroupId}") + public Result> guideInfo(@PathVariable("partyGroupId") String partyGroupId){ + return partyGroupGuideService.getGuideInfo(partyGroupId); + } +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java index 1f85b048..fb775a63 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java @@ -34,8 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; +import java.util.*; /** @@ -60,6 +59,15 @@ public class PartyGroupController { @GetMapping("{id}") public Result get(@PathVariable("id") String id){ PartyGroupDTO data = partyGroupService.get(id); + String[] allDeptIds = data.getAllDeptIds().split(","); + List deptIdList = new ArrayList<>(2); + //防止之前选择街道报错 + if(allDeptIds.length == 3){ + Collections.addAll(deptIdList,allDeptIds[1],allDeptIds[2]); + }else{ + Collections.addAll(deptIdList,allDeptIds[1]); + } + data.setDeptIdList(deptIdList); return new Result().ok(data); } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideController.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideController.java new file mode 100644 index 00000000..c9c7819a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideController.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.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.PartyGroupGuideDTO; +import com.elink.esua.epdc.excel.PartyGroupGuideExcel; +import com.elink.esua.epdc.service.PartyGroupGuideService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党群指南 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@RestController +@RequestMapping("partygroupguide") +public class PartyGroupGuideController { + + @Autowired + private PartyGroupGuideService partyGroupGuideService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = partyGroupGuideService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PartyGroupGuideDTO data = partyGroupGuideService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PartyGroupGuideDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return partyGroupGuideService.save(dto); + } + + @PutMapping + public Result update(@RequestBody PartyGroupGuideDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return partyGroupGuideService.update(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + partyGroupGuideService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = partyGroupGuideService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PartyGroupGuideExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideRelationController.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideRelationController.java new file mode 100644 index 00000000..054db935 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideRelationController.java @@ -0,0 +1,94 @@ +/** + * 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.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.PartyGroupGuideRelationDTO; +import com.elink.esua.epdc.excel.PartyGroupGuideRelationExcel; +import com.elink.esua.epdc.service.PartyGroupGuideRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党群指南关系表 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@RestController +@RequestMapping("partygroupguiderelation") +public class PartyGroupGuideRelationController { + + @Autowired + private PartyGroupGuideRelationService partyGroupGuideRelationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = partyGroupGuideRelationService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PartyGroupGuideRelationDTO data = partyGroupGuideRelationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PartyGroupGuideRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + partyGroupGuideRelationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PartyGroupGuideRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + partyGroupGuideRelationService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + partyGroupGuideRelationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = partyGroupGuideRelationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PartyGroupGuideRelationExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java index 3c11779a..8c449e9b 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java @@ -65,7 +65,7 @@ public interface PartyGroupDao extends BaseDao { * @Param [] * @return java.util.List **/ - List getAllPartyGroup(String userId,String streetId); + List getAllPartyGroup(String userId); /** * @Description 根据党群名获取党群 * @Author songyunpeng diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideDao.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideDao.java new file mode 100644 index 00000000..1b9120b2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideDao.java @@ -0,0 +1,73 @@ +/** + * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.PartyGroupGuideDTO; +import com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO; +import com.elink.esua.epdc.entity.PartyGroupGuideEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 党群指南 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface PartyGroupGuideDao extends BaseDao { + + /** + * 党群指南 首页查询 + * @param params + * @return java.util.List + * @Author zhangyong + * @Date 08:44 2020-06-17 + **/ + List selectListPartyGroupGuidePage(Map params); + + /** + * 拿周几查指南表 取出指南ID + * @param dayOfWeek + * @return java.util.List + * @Author zhangyong + * @Date 09:35 2020-06-17 + **/ + List selectPartyGroupGuideByDayOfWeek(String dayOfWeek); + + /** + * 获取论坛指南信息 - 今日 + * @param partyGroupId 党群ID + * @return String + * @Author zhangyong + * @Date 13:48 2020-06-17 + **/ + String selectOneGuideInfo(String partyGroupId); + + /** + * 获取论坛指南信息 - 本周 + * @param partyGroupId 党群ID + * @return java.util.List + * @Author zhangyong + * @Date 13:48 2020-06-17 + **/ + List selectListGuideInfo(String partyGroupId); +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideRelationDao.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideRelationDao.java new file mode 100644 index 00000000..6cc59032 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideRelationDao.java @@ -0,0 +1,64 @@ +/** + * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.PartyGroupGuideRelationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 党群指南关系表 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface PartyGroupGuideRelationDao extends BaseDao { + + /** + * 根据 党群指南表ID 删除 党群指南表与党群的关联 + * @param partyGroupGuideId, delFlag + * @return void + * @Author zhangyong + * @Date 08:22 2020-06-17 + **/ + void deletePartyGroupGuideRelation(@Param("partyGroupGuideId") String partyGroupGuideId, @Param("delFlag") String delFlag); + + /** + * 根据 党群指南表ID 查询 相关联的 社群id + * @param partyGroupGuideId + * @return java.util.List + * @Author zhangyong + * @Date 09:08 2020-06-17 + **/ + List selectListPartyGroupIdList(String partyGroupGuideId); + + /** + * 根据 指南ID,+党群ID查党群指南关系表, + * 返回党群名称,逗号分隔 + * @param map + * @return java.lang.String + * @Author zhangyong + * @Date 09:41 2020-06-17 + **/ + String selectPartyGroupName(Map map); +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideEntity.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideEntity.java new file mode 100644 index 00000000..3cccc5d5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideEntity.java @@ -0,0 +1,51 @@ +/** + * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党群指南 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_party_group_guide") +public class PartyGroupGuideEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 内容 + */ + private String content; + + /** + * 显示时间:1-周一,2-周二,3-周三,4-周四,5-周五,6-周六,7-周日 + */ + private String dayOfWeek; + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideRelationEntity.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideRelationEntity.java new file mode 100644 index 00000000..7151b5cd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideRelationEntity.java @@ -0,0 +1,51 @@ +/** + * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党群指南关系表 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_party_group_guide_relation") +public class PartyGroupGuideRelationEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 党群ID + */ + private String partyGroupId; + + /** + * 党群指南表ID + */ + private String partyGroupGuideId; + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideExcel.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideExcel.java new file mode 100644 index 00000000..6ad988d6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideExcel.java @@ -0,0 +1,62 @@ +/** + * 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.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党群指南 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class PartyGroupGuideExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "内容") + private String content; + + @Excel(name = "显示时间:1-周一,2-周二,3-周三,4-周四,5-周五,6-周六,7-周日") + private String dayOfWeek; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标识(0-否,1-是)") + private String delFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideRelationExcel.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideRelationExcel.java new file mode 100644 index 00000000..615de543 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideRelationExcel.java @@ -0,0 +1,62 @@ +/** + * 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.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党群指南关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class PartyGroupGuideRelationExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "党群ID") + private String partyGroupId; + + @Excel(name = "党群指南表ID") + private String partyGroupGuideId; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标识(0-否,1-是)") + private String delFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRedis.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRedis.java new file mode 100644 index 00000000..a49f4a7c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRedis.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.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党群指南 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Component +public class PartyGroupGuideRedis { + @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/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRelationRedis.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRelationRedis.java new file mode 100644 index 00000000..c8d24cde --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRelationRedis.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.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党群指南关系表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Component +public class PartyGroupGuideRelationRedis { + @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/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideRelationService.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideRelationService.java new file mode 100644 index 00000000..e7e2a8db --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideRelationService.java @@ -0,0 +1,123 @@ +/** + * 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.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.PartyGroupGuideRelationDTO; +import com.elink.esua.epdc.entity.PartyGroupGuideRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党群指南关系表 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +public interface PartyGroupGuideRelationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PartyGroupGuideRelationDTO + * @author generator + * @date 2020-06-16 + */ + PartyGroupGuideRelationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(PartyGroupGuideRelationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(PartyGroupGuideRelationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + /** + * 根据 党群指南表ID 删除/恢复 党群指南表与党群的关联 + * @param partyGroupGuideId, delFlag + * @return void + * @Author zhangyong + * @Date 08:22 2020-06-17 + **/ + void deleteAllPartyGroupGuideRelation(String partyGroupGuideId, String delFlag); + + /** + * 根据 党群指南表ID 查询 相关联的 社群id + * @param partyGroupGuideId + * @return java.util.List + * @Author zhangyong + * @Date 09:08 2020-06-17 + **/ + List listPartyGroupIdList(String partyGroupGuideId); + + /** + * 根据 指南ID,+党群ID查党群指南关系表, + * 返回党群名称,逗号分隔 + * @param map + * @return java.lang.String + * @Author zhangyong + * @Date 09:41 2020-06-17 + **/ + String listPartyGroupName(Map map); +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideService.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideService.java new file mode 100644 index 00000000..de28e74f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.PartyGroupGuideDTO; +import com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO; +import com.elink.esua.epdc.entity.PartyGroupGuideEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党群指南 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +public interface PartyGroupGuideService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PartyGroupGuideDTO + * @author generator + * @date 2020-06-16 + */ + PartyGroupGuideDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return Result + * @author generator + * @date 2020-06-16 + */ + Result save(PartyGroupGuideDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return Result + * @author generator + * @date 2020-06-16 + */ + Result update(PartyGroupGuideDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + /** + * 获取论坛指南信息 + * @param partyGroupId 党群ID + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:48 2020-06-17 + **/ + Result> getGuideInfo(String partyGroupId); +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideRelationServiceImpl.java new file mode 100644 index 00000000..14284a84 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideRelationServiceImpl.java @@ -0,0 +1,119 @@ +/** + * 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.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.PartyGroupGuideRelationDao; +import com.elink.esua.epdc.dto.PartyGroupGuideRelationDTO; +import com.elink.esua.epdc.entity.PartyGroupGuideRelationEntity; +import com.elink.esua.epdc.redis.PartyGroupGuideRelationRedis; +import com.elink.esua.epdc.service.PartyGroupGuideRelationService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党群指南关系表 + * + * @author zhangyong + * @since v1.0.0 2020-06-16 + */ +@Service +public class PartyGroupGuideRelationServiceImpl extends BaseServiceImpl implements PartyGroupGuideRelationService { + + @Autowired + private PartyGroupGuideRelationRedis partyGroupGuideRelationRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PartyGroupGuideRelationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PartyGroupGuideRelationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PartyGroupGuideRelationDTO get(String id) { + PartyGroupGuideRelationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PartyGroupGuideRelationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PartyGroupGuideRelationDTO dto) { + PartyGroupGuideRelationEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupGuideRelationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PartyGroupGuideRelationDTO dto) { + PartyGroupGuideRelationEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupGuideRelationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void deleteAllPartyGroupGuideRelation(String partyGroupGuideId, String delFlag) { + baseDao.deletePartyGroupGuideRelation(partyGroupGuideId, delFlag); + } + + @Override + public List listPartyGroupIdList(String partyGroupGuideId) { + return baseDao.selectListPartyGroupIdList(partyGroupGuideId); + } + + @Override + public String listPartyGroupName(Map map) { + return baseDao.selectPartyGroupName(map); + } + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideServiceImpl.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideServiceImpl.java new file mode 100644 index 00000000..ebe35b9b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideServiceImpl.java @@ -0,0 +1,202 @@ +/** + * 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.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.PartyGroupGuideDao; +import com.elink.esua.epdc.dto.PartyGroupGuideDTO; +import com.elink.esua.epdc.dto.PartyGroupGuideRelationDTO; +import com.elink.esua.epdc.dto.enums.DayOfWeekEnum; +import com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO; +import com.elink.esua.epdc.entity.PartyGroupGuideEntity; +import com.elink.esua.epdc.redis.PartyGroupGuideRedis; +import com.elink.esua.epdc.service.PartyGroupGuideRelationService; +import com.elink.esua.epdc.service.PartyGroupGuideService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 党群指南 + * + * @authorzhangyong + * @since v1.0.0 2020-06-16 + */ +@Service +public class PartyGroupGuideServiceImpl extends BaseServiceImpl implements PartyGroupGuideService { + + @Autowired + private PartyGroupGuideRedis partyGroupGuideRedis; + + @Autowired + private PartyGroupGuideRelationService partyGroupGuideRelationService; + + @Override + public PageData page(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListPartyGroupGuidePage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PartyGroupGuideDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PartyGroupGuideDTO get(String id) { + PartyGroupGuideEntity entity = baseDao.selectById(id); + // 查询 关联的党群名称 + PartyGroupGuideDTO dto = ConvertUtils.sourceToTarget(entity, PartyGroupGuideDTO.class); + dto.setPartyGroupIdList(partyGroupGuideRelationService.listPartyGroupIdList(id)); + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(PartyGroupGuideDTO dto) { + // 判断是否插入 + StringBuffer partyGroupName = this.partyGroupOpertionLimit(dto); + if (null != partyGroupName && partyGroupName.length() > 0){ + return new Result().error("[" + partyGroupName + "]已存在" + DayOfWeekEnum.getEnumByKey(dto.getDayOfWeek()) + "显示的党群指南"); + } + // 保存到党群指南表 + PartyGroupGuideEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupGuideEntity.class); + insert(entity); + // 保存到党群指南关联表 + dto.setId(entity.getId()); + this.savePartyGroupGuideRelation(dto); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result update(PartyGroupGuideDTO dto) { + // 删除 党群指南关联表 + partyGroupGuideRelationService.deleteAllPartyGroupGuideRelation(dto.getId(), NumConstant.ONE_STR); + // 判断是否修改 + StringBuffer partyGroupName = this.partyGroupOpertionLimit(dto); + if (null != partyGroupName && partyGroupName.length() > 0){ + // 如果存在,则恢复 党群指南关联关系 + partyGroupGuideRelationService.deleteAllPartyGroupGuideRelation(dto.getId(), NumConstant.ZERO_STR); + return new Result().error("[" + partyGroupName + "]已存在" + DayOfWeekEnum.getEnumByKey(dto.getDayOfWeek()) + "显示的党群指南"); + } + // 修改党群指南表 + PartyGroupGuideEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupGuideEntity.class); + updateById(entity); + // 重新保存到党群指南关联表 + this.savePartyGroupGuideRelation(dto); + return new Result(); + } + + /** + * 保存到 党群指南关联表 + * @param dto + * @return void + * @Author zhangyong + * @Date 18:28 2020-06-16 + **/ + private void savePartyGroupGuideRelation(PartyGroupGuideDTO dto){ + for (int i = 0; i < dto.getPartyGroupIdList().size(); i++){ + PartyGroupGuideRelationDTO partyGroupGuideRelation = new PartyGroupGuideRelationDTO(); + partyGroupGuideRelation.setPartyGroupId(dto.getPartyGroupIdList().get(i)); + partyGroupGuideRelation.setPartyGroupGuideId(dto.getId()); + partyGroupGuideRelationService.save(partyGroupGuideRelation); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + // 先删除 党群指南表 + baseDao.deleteBatchIds(Arrays.asList(ids)); + // 在删除 党群指南关联表 + partyGroupGuideRelationService.deleteAllPartyGroupGuideRelation(ids[0], NumConstant.ONE_STR); + } + + /** + * 限制 一个党群一天只有一条指南 + * @param dto + * @return java.lang.StringBuffer + * @Author zhangyong + * @Date 09:30 2020-06-17 + **/ + private StringBuffer partyGroupOpertionLimit(PartyGroupGuideDTO dto){ + StringBuffer stringBuffer = new StringBuffer(); + // 一个党群一天只有一条指南,拿周几查指南表,为空跳过,有,取出指南ID, + List dayOfWeekList = baseDao.selectPartyGroupGuideByDayOfWeek(dto.getDayOfWeek()); + if (dayOfWeekList != null && dayOfWeekList.size() > NumConstant.ZERO){ + // 指南ID,+党群ID查党群指南关系表,没有,跳过,有一个有的:提示某某某党群已存在周几显示的指南 + for (String guideId : dayOfWeekList){ + Map map = new HashMap<>(); + map.put("partyGroupGuideId", guideId); + map.put("partyGroupIdList",dto.getPartyGroupIdList()); + String partyGroupName = partyGroupGuideRelationService.listPartyGroupName(map); + if (null != partyGroupName){ + stringBuffer.append(partyGroupName); + } + } + } + return stringBuffer; + } + + @Override + public Result> getGuideInfo(String partyGroupId) { + List dto = new ArrayList<>(); + // 今日话题 + EpdcPartyGroupGuideResultDTO oneDto = new EpdcPartyGroupGuideResultDTO(); + oneDto.setShowTime("今日话题"); + String content = baseDao.selectOneGuideInfo(partyGroupId); + if (null == content){ + oneDto.setContent("暂无"); + } else { + oneDto.setContent(content); + } + dto.add(oneDto); + // 本周话题 + List listDto = baseDao.selectListGuideInfo(partyGroupId); + for (int i = 0; i < listDto.size(); i++){ + listDto.get(i).setShowTime(DayOfWeekEnum.getEnumByKey(listDto.get(i).getShowTime()) + "话题"); + dto.add(listDto.get(i)); + } + return new Result>().ok(dto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java index fc4ef054..a469d97f 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java @@ -258,15 +258,7 @@ public class PartyGroupServiceImpl extends BaseServiceImpl getAllPartyGroup(PartyGroupListFormDTO partyGroupListFormDTO) { - //根据网格ID获取街道ID - Result parentResult = adminFeignClient.getParentAndAllDept(partyGroupListFormDTO.getGridId()); - if (!parentResult.success() || parentResult.getData() == null) { - throw new RenException("获取用户部门信息失败"); - } - ParentAndAllDeptDTO parentAndAllDeptDTO = parentResult.getData(); - String allDeptIds = parentAndAllDeptDTO.getAllDeptIds(); - String[] allDeptIdList = allDeptIds.split(","); - return baseDao.getAllPartyGroup(partyGroupListFormDTO.getUserId(),allDeptIdList[1]); + return baseDao.getAllPartyGroup(partyGroupListFormDTO.getUserId()); } @Override @@ -277,6 +269,33 @@ public class PartyGroupServiceImpl extends BaseServiceImpl userInfoById = userFeignClient.getUserInfoById(partyUserJoinGroupFormDTO.getUserId()); + if (!userInfoById.success() || userInfoById.getData() == null) { + throw new RenException("获取用户信息失败"); + } + UserDTO userDto = userInfoById.getData(); + //网格信息 + if (userDto.getGridId() != null && userDto.getGridId() != 0) { + partyUserGroupDTO.setGrid(userDto.getGrid()); + partyUserGroupDTO.setGridId(userDto.getGridId()); + partyUserGroupDTO.setAllDeptIds(userDto.getAllDeptIds()); + partyUserGroupDTO.setAllDeptNames(userDto.getAllDeptNames()); + partyUserGroupDTO.setParentDeptIds(userDto.getParentDeptIds()); + partyUserGroupDTO.setParentDeptNames(userDto.getParentDeptNames()); + } else { + Result userFirstScanGird = userFeignClient.getUserFirstScanGird(partyUserJoinGroupFormDTO.getUserId()); + if (!userFirstScanGird.success() || userFirstScanGird.getData() == null) { + throw new RenException("获取用户网格关联信息失败"); + } + UserGridRelationDTO userGridRelationDTO = userFirstScanGird.getData(); + partyUserGroupDTO.setGrid(userGridRelationDTO.getGrid()); + partyUserGroupDTO.setGridId(userGridRelationDTO.getGridId()); + partyUserGroupDTO.setAllDeptIds(userGridRelationDTO.getAllDeptIds()); + partyUserGroupDTO.setAllDeptNames(userGridRelationDTO.getAllDeptNames()); + partyUserGroupDTO.setParentDeptIds(userGridRelationDTO.getParentDeptIds()); + partyUserGroupDTO.setParentDeptNames(userGridRelationDTO.getParentDeptNames()); + } //身份标识为群成员 partyUserGroupDTO.setIdentityFlag("2"); partyUserGroupDTO.setState(0); diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java index 41f841c6..24c9831d 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java @@ -28,9 +28,7 @@ import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.DateUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dao.PartyUserGroupDao; -import com.elink.esua.epdc.dto.GroupUserBannedFormDTO; -import com.elink.esua.epdc.dto.GroupUserManagerFormDTO; -import com.elink.esua.epdc.dto.PartyUserGroupDTO; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.constant.PartyGroupConstant; import com.elink.esua.epdc.dto.form.PartyUserBannedFormDTO; import com.elink.esua.epdc.dto.form.PartyUserGroupFormDTO; @@ -41,6 +39,7 @@ import com.elink.esua.epdc.dto.result.CurrentUser; import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO; import com.elink.esua.epdc.entity.PartyUserGroupEntity; import com.elink.esua.epdc.enums.BannedEnum; +import com.elink.esua.epdc.feign.UserFeignClient; import com.elink.esua.epdc.redis.PartyUserGroupRedis; import com.elink.esua.epdc.service.PartyUserGroupService; import org.apache.commons.lang3.StringUtils; @@ -65,6 +64,8 @@ public class PartyUserGroupServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -203,6 +204,33 @@ public class PartyUserGroupServiceImpl extends BaseServiceImpl userInfoById = userFeignClient.getUserInfoById(formDTO.getUserId()); + if (!userInfoById.success() || userInfoById.getData() == null) { + throw new RenException("获取用户信息失败"); + } + UserDTO userDto = userInfoById.getData(); + //网格信息 + if (userDto.getGridId() != null && userDto.getGridId() != 0) { + formDTO.setGrid(userDto.getGrid()); + formDTO.setGridId(userDto.getGridId()); + formDTO.setAllDeptIds(userDto.getAllDeptIds()); + formDTO.setAllDeptNames(userDto.getAllDeptNames()); + formDTO.setParentDeptIds(userDto.getParentDeptIds()); + formDTO.setParentDeptNames(userDto.getParentDeptNames()); + } else { + Result userFirstScanGird = userFeignClient.getUserFirstScanGird(formDTO.getUserId()); + if (!userFirstScanGird.success() || userFirstScanGird.getData() == null) { + throw new RenException("获取用户网格关联信息失败"); + } + UserGridRelationDTO userGridRelationDTO = userFirstScanGird.getData(); + formDTO.setGrid(userGridRelationDTO.getGrid()); + formDTO.setGridId(userGridRelationDTO.getGridId()); + formDTO.setAllDeptIds(userGridRelationDTO.getAllDeptIds()); + formDTO.setAllDeptNames(userGridRelationDTO.getAllDeptNames()); + formDTO.setParentDeptIds(userGridRelationDTO.getParentDeptIds()); + formDTO.setParentDeptNames(userGridRelationDTO.getParentDeptNames()); + } baseDao.updateInfoByUserId(formDTO); return new Result(); } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml index 99b54fad..5bade5fe 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml @@ -104,7 +104,7 @@ if(t1.ID is not null ,1,0) as isJoin from epdc_party_group t left join epdc_party_user_group t1 on t1.PARTY_GROUP_ID = t.ID and t1.DEL_FLAG ='0' and t1.USER_ID=#{userId} - where t.DEL_FLAG ='0' and t.STATE ='0' and t.DEPT_ID = #{streetId} order by t.SORT, t.CREATED_TIME desc + where t.DEL_FLAG ='0' and t.STATE ='0' order by t.SORT, t.CREATED_TIME desc + SELECT + g.ID, + g.CONTENT, + g.DAY_OF_WEEK, + GROUP_CONCAT(pg.id SEPARATOR ',') partyGroupId, + GROUP_CONCAT(pg.PARTY_GROUP_NAME SEPARATOR ',') partyGroupName, + g.CREATED_TIME, + g.UPDATED_TIME + FROM + epdc_party_group_guide g + LEFT JOIN epdc_party_group_guide_relation gr ON g.id = gr.PARTY_GROUP_GUIDE_ID + LEFT JOIN epdc_party_group pg ON gr.PARTY_GROUP_ID = pg.id + WHERE g.DEL_FLAG = 0 and gr.DEL_FLAG = 0 + + and g.DAY_OF_WEEK = #{dayOfWeek} + + GROUP BY g.ID + + HAVING instr(GROUP_CONCAT(pg.id SEPARATOR ',') , #{partyGroupId}) >0 + + ORDER BY CREATED_TIME DESC + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideRelationDao.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideRelationDao.xml new file mode 100644 index 00000000..9416d38d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideRelationDao.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + update epdc_party_group_guide_relation + set DEL_FLAG = #{delFlag} + where PARTY_GROUP_GUIDE_ID =#{partyGroupGuideId} + + + + + + diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml index 03e846ff..58062a4e 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml @@ -142,6 +142,8 @@ + + @@ -152,9 +154,13 @@ + + + + +