Browse Source

Merge remote-tracking branch 'origin/feature/lc_modifyPartyGroup'

feature/syp_points
liuchuang 5 years ago
parent
commit
c7f6426fac
  1. 1
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java
  2. 17
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java
  3. 15
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java
  4. 10
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java
  5. 38
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java
  6. 10
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java
  7. 6
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupDTO.java
  8. 99
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideDTO.java
  9. 81
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideRelationDTO.java
  10. 77
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/enums/DayOfWeekEnum.java
  11. 25
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyUserNewInfoFormDTO.java
  12. 4
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/AllUsers.java
  13. 4
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/CurrentUser.java
  14. 29
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcPartyGroupGuideResultDTO.java
  15. 51
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyTopicSupportResultDTO.java
  16. 14
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/TopicList.java
  17. 36
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/EpdcPartyGroupGuideController.java
  18. 12
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java
  19. 92
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideController.java
  20. 94
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideRelationController.java
  21. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java
  22. 73
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideDao.java
  23. 64
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideRelationDao.java
  24. 51
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideEntity.java
  25. 51
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideRelationEntity.java
  26. 62
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideExcel.java
  27. 62
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideRelationExcel.java
  28. 47
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRedis.java
  29. 47
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRelationRedis.java
  30. 123
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideRelationService.java
  31. 106
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideService.java
  32. 119
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideRelationServiceImpl.java
  33. 202
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideServiceImpl.java
  34. 37
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java
  35. 34
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java
  36. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml
  37. 70
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideDao.xml
  38. 49
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideRelationDao.xml
  39. 29
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml
  40. 101
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyUserGroupDao.xml
  41. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

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

17
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<java.util.List <com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO>>
* @Author zhangyong
* @Date 13:48 2020-06-17
**/
@GetMapping("group/guideInfo/{partyGroupId}")
public Result<List<EpdcPartyGroupGuideResultDTO>> guideInfo(@PathVariable("partyGroupId") String partyGroupId){
return partyGroupService.getGuideInfo(partyGroupId);
}
}

15
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<PartyTopicResultDTO> myTopicList(MyPartyTopicFormDTO formDto);
/**
* 获取论坛指南信息
* @param partyGroupId 党群ID
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List <com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO>>
* @Author zhangyong
* @Date 13:48 2020-06-17
**/
@GetMapping(value = "partyGroup/epdc-app/partygroupguide/group/guideInfo/{partyGroupId}", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<EpdcPartyGroupGuideResultDTO>> getGuideInfo(@PathVariable("partyGroupId") String partyGroupId);
}

10
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<PartyTopicResultDTO> myTopicList(MyPartyTopicFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "myTopicList",formDto);
}
@Override
public Result<List<EpdcPartyGroupGuideResultDTO>> getGuideInfo(String partyGroupId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "getGuideInfo",partyGroupId);
}
}

38
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<List<PartyGroupResultDTO>> groupList(TokenDto userDetail);
/**
* @Description 网格长列表
* @Description 网格长列表
* @Author songyunpeng
* @Date 2020/6/3
* @Param [userDetail, formDTO]
@ -34,7 +31,7 @@ public interface PartyGroupService {
**/
Result<List<PartyGroupOfficialsResultDTO>> 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<PartyTopicResultDTO> 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<PartyUserGroupResultDTO> userList(TokenDto userDetail, PartyUserGroupFormDTO formDto);
/**
* @Description 当前用户在群里的信息
* @Description 当前用户在群里的信息
* @Author songyunpeng
* @Date 2020/6/3
* @Param [userDetail, formDto]
@ -82,7 +79,7 @@ public interface PartyGroupService {
**/
Result<PartyUserGroupResultDTO> 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<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>
**/
Result<PartyTopicResultDTO> myTopicList(TokenDto userDetail, MyPartyTopicFormDTO formDto);
/**
* 获取论坛指南信息
* @param partyGroupId 党群ID
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List <com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO>>
* @Author zhangyong
* @Date 13:48 2020-06-17
**/
Result<List<EpdcPartyGroupGuideResultDTO>> getGuideInfo(String partyGroupId);
}

10
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<List<EpdcPartyGroupGuideResultDTO>> getGuideInfo(String partyGroupId) {
return partyGroupFeignClient.getGuideInfo(partyGroupId);
}
}

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

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

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

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

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

4
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-永久禁言

4
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-永久禁言

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

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

14
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<PartyTopicCommentResultDTO> comments;
/**
* 点赞列表
*/
private List<PartyTopicSupportResultDTO> likes;
}

36
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<java.util.List <com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO>>
* @Author zhangyong
* @Date 13:48 2020-06-17
**/
@GetMapping("group/guideInfo/{partyGroupId}")
public Result<List<EpdcPartyGroupGuideResultDTO>> guideInfo(@PathVariable("partyGroupId") String partyGroupId){
return partyGroupGuideService.getGuideInfo(partyGroupId);
}
}

12
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<PartyGroupDTO> get(@PathVariable("id") String id){
PartyGroupDTO data = partyGroupService.get(id);
String[] allDeptIds = data.getAllDeptIds().split(",");
List<String> 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<PartyGroupDTO>().ok(data);
}

92
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PageData<PartyGroupGuideDTO>> page(@RequestParam Map<String, Object> params){
PageData<PartyGroupGuideDTO> page = partyGroupGuideService.page(params);
return new Result<PageData<PartyGroupGuideDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PartyGroupGuideDTO> get(@PathVariable("id") String id){
PartyGroupGuideDTO data = partyGroupGuideService.get(id);
return new Result<PartyGroupGuideDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<PartyGroupGuideDTO> list = partyGroupGuideService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PartyGroupGuideExcel.class);
}
}

94
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PageData<PartyGroupGuideRelationDTO>> page(@RequestParam Map<String, Object> params){
PageData<PartyGroupGuideRelationDTO> page = partyGroupGuideRelationService.page(params);
return new Result<PageData<PartyGroupGuideRelationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PartyGroupGuideRelationDTO> get(@PathVariable("id") String id){
PartyGroupGuideRelationDTO data = partyGroupGuideRelationService.get(id);
return new Result<PartyGroupGuideRelationDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<PartyGroupGuideRelationDTO> list = partyGroupGuideRelationService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PartyGroupGuideRelationExcel.class);
}
}

2
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<PartyGroupEntity> {
* @Param []
* @return java.util.List<com.elink.esua.epdc.dto.result.PartyGroupResultDTO>
**/
List<PartyGroupResultDTO> getAllPartyGroup(String userId,String streetId);
List<PartyGroupResultDTO> getAllPartyGroup(String userId);
/**
* @Description 根据党群名获取党群
* @Author songyunpeng

73
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PartyGroupGuideEntity> {
/**
* 党群指南 首页查询
* @param params
* @return java.util.List<com.elink.esua.epdc.dto.PartyGroupGuideDTO>
* @Author zhangyong
* @Date 08:44 2020-06-17
**/
List<PartyGroupGuideDTO> selectListPartyGroupGuidePage(Map<String, Object> params);
/**
* 拿周几查指南表 取出指南ID
* @param dayOfWeek
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 09:35 2020-06-17
**/
List<String> 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 <com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO>
* @Author zhangyong
* @Date 13:48 2020-06-17
**/
List<EpdcPartyGroupGuideResultDTO> selectListGuideInfo(String partyGroupId);
}

64
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PartyGroupGuideRelationEntity> {
/**
* 根据 党群指南表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<java.lang.String>
* @Author zhangyong
* @Date 09:08 2020-06-17
**/
List<String> selectListPartyGroupIdList(String partyGroupGuideId);
/**
* 根据 指南ID+党群ID查党群指南关系表
* 返回党群名称逗号分隔
* @param map
* @return java.lang.String
* @Author zhangyong
* @Date 09:41 2020-06-17
**/
String selectPartyGroupName(Map<String, Object> map);
}

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

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

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

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

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

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

123
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PartyGroupGuideRelationEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PartyGroupGuideRelationDTO>
* @author generator
* @date 2020-06-16
*/
PageData<PartyGroupGuideRelationDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PartyGroupGuideRelationDTO>
* @author generator
* @date 2020-06-16
*/
List<PartyGroupGuideRelationDTO> list(Map<String, Object> 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<java.lang.String>
* @Author zhangyong
* @Date 09:08 2020-06-17
**/
List<String> listPartyGroupIdList(String partyGroupGuideId);
/**
* 根据 指南ID+党群ID查党群指南关系表
* 返回党群名称逗号分隔
* @param map
* @return java.lang.String
* @Author zhangyong
* @Date 09:41 2020-06-17
**/
String listPartyGroupName(Map<String, Object> map);
}

106
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PartyGroupGuideEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PartyGroupGuideDTO>
* @author generator
* @date 2020-06-16
*/
PageData<PartyGroupGuideDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PartyGroupGuideDTO>
* @author generator
* @date 2020-06-16
*/
List<PartyGroupGuideDTO> list(Map<String, Object> 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<java.util.List <com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO>>
* @Author zhangyong
* @Date 13:48 2020-06-17
**/
Result<List<EpdcPartyGroupGuideResultDTO>> getGuideInfo(String partyGroupId);
}

119
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PartyGroupGuideRelationDao, PartyGroupGuideRelationEntity> implements PartyGroupGuideRelationService {
@Autowired
private PartyGroupGuideRelationRedis partyGroupGuideRelationRedis;
@Override
public PageData<PartyGroupGuideRelationDTO> page(Map<String, Object> params) {
IPage<PartyGroupGuideRelationEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PartyGroupGuideRelationDTO.class);
}
@Override
public List<PartyGroupGuideRelationDTO> list(Map<String, Object> params) {
List<PartyGroupGuideRelationEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PartyGroupGuideRelationDTO.class);
}
private QueryWrapper<PartyGroupGuideRelationEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PartyGroupGuideRelationEntity> 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<String> listPartyGroupIdList(String partyGroupGuideId) {
return baseDao.selectListPartyGroupIdList(partyGroupGuideId);
}
@Override
public String listPartyGroupName(Map<String, Object> map) {
return baseDao.selectPartyGroupName(map);
}
}

202
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PartyGroupGuideDao, PartyGroupGuideEntity> implements PartyGroupGuideService {
@Autowired
private PartyGroupGuideRedis partyGroupGuideRedis;
@Autowired
private PartyGroupGuideRelationService partyGroupGuideRelationService;
@Override
public PageData<PartyGroupGuideDTO> page(Map<String, Object> params) {
IPage<PartyGroupGuideEntity> page = getPage(params);
List<PartyGroupGuideDTO> list = baseDao.selectListPartyGroupGuidePage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<PartyGroupGuideDTO> list(Map<String, Object> params) {
List<PartyGroupGuideEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PartyGroupGuideDTO.class);
}
private QueryWrapper<PartyGroupGuideEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PartyGroupGuideEntity> 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<String> dayOfWeekList = baseDao.selectPartyGroupGuideByDayOfWeek(dto.getDayOfWeek());
if (dayOfWeekList != null && dayOfWeekList.size() > NumConstant.ZERO){
// 指南ID,+党群ID查党群指南关系表,没有,跳过,有一个有的:提示某某某党群已存在周几显示的指南
for (String guideId : dayOfWeekList){
Map<String,Object> 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<List<EpdcPartyGroupGuideResultDTO>> getGuideInfo(String partyGroupId) {
List<EpdcPartyGroupGuideResultDTO> 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<EpdcPartyGroupGuideResultDTO> 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<List<EpdcPartyGroupGuideResultDTO>>().ok(dto);
}
}

37
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<PartyGroupDao, PartyG
@Override
public List<PartyGroupResultDTO> getAllPartyGroup(PartyGroupListFormDTO partyGroupListFormDTO) {
//根据网格ID获取街道ID
Result<ParentAndAllDeptDTO> 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<PartyGroupDao, PartyG
return new Result().error("用户已加入此群!");
}
PartyUserGroupDTO partyUserGroupDTO = ConvertUtils.sourceToTarget(partyUserJoinGroupFormDTO, PartyUserGroupDTO.class);
//获取用户基本信息
Result<UserDTO> 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<UserGridRelationDTO> 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);

34
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<PartyUserGroupDao
@Autowired
private PartyUserGroupRedis partyUserGroupRedis;
@Autowired
private UserFeignClient userFeignClient;
@Override
public PageData<PartyUserGroupDTO> page(Map<String, Object> params) {
IPage<PartyUserGroupEntity> page = baseDao.selectPage(
@ -203,6 +204,33 @@ public class PartyUserGroupServiceImpl extends BaseServiceImpl<PartyUserGroupDao
@Override
public Result updateInfo(PartyUserNewInfoFormDTO formDTO) {
//获取用户基本信息
Result<UserDTO> 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<UserGridRelationDTO> 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();
}

2
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>
<select id="getPartyGroupDTOByName" resultType="com.elink.esua.epdc.dto.PartyGroupDTO">
select ID from epdc_party_group where PARTY_GROUP_NAME = #{partyGroupName} and DEL_FLAG='0' limit 1;

70
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideDao.xml

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.PartyGroupGuideDao">
<resultMap type="com.elink.esua.epdc.entity.PartyGroupGuideEntity" id="partyGroupGuideMap">
<result property="id" column="ID"/>
<result property="content" column="CONTENT"/>
<result property="dayOfWeek" column="DAY_OF_WEEK"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListPartyGroupGuidePage" resultType="com.elink.esua.epdc.dto.PartyGroupGuideDTO">
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
<if test="dayOfWeek != null and dayOfWeek != '' ">
and g.DAY_OF_WEEK = #{dayOfWeek}
</if>
GROUP BY g.ID
<if test="partyGroupId != null and partyGroupId != '' ">
HAVING instr(GROUP_CONCAT(pg.id SEPARATOR ',') , #{partyGroupId}) >0
</if>
ORDER BY CREATED_TIME DESC
</select>
<select id="selectPartyGroupGuideByDayOfWeek" resultType="String">
SELECT
ID
FROM epdc_party_group_guide
WHERE DAY_OF_WEEK = #{dayOfWeek}
AND DEL_FLAG = 0
</select>
<select id="selectOneGuideInfo" resultType="String">
SELECT
CONTENT content
FROM epdc_party_group_guide g
LEFT JOIN epdc_party_group_guide_relation gr ON g.id = gr.PARTY_GROUP_GUIDE_ID
WHERE g.DEL_FLAG = 0 AND gr.DEL_FLAG = 0
AND g.DAY_OF_WEEK = dayofweek(curdate())-1
AND gr.PARTY_GROUP_ID = #{partyGroupId}
</select>
<select id="selectListGuideInfo" resultType="com.elink.esua.epdc.dto.result.EpdcPartyGroupGuideResultDTO">
SELECT
g.DAY_OF_WEEK showTime,
CONTENT content
FROM epdc_party_group_guide g
LEFT JOIN epdc_party_group_guide_relation gr ON g.id = gr.PARTY_GROUP_GUIDE_ID
WHERE g.DEL_FLAG = 0 AND gr.DEL_FLAG = 0
AND gr.PARTY_GROUP_ID = #{partyGroupId}
ORDER BY g.DAY_OF_WEEK
</select>
</mapper>

49
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideRelationDao.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.PartyGroupGuideRelationDao">
<resultMap type="com.elink.esua.epdc.entity.PartyGroupGuideRelationEntity" id="partyGroupGuideRelationMap">
<result property="id" column="ID"/>
<result property="partyGroupId" column="PARTY_GROUP_ID"/>
<result property="partyGroupGuideId" column="PARTY_GROUP_GUIDE_ID"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deletePartyGroupGuideRelation">
update epdc_party_group_guide_relation
set DEL_FLAG = #{delFlag}
where PARTY_GROUP_GUIDE_ID =#{partyGroupGuideId}
</delete>
<select id="selectListPartyGroupIdList" resultType="String">
SELECT
PARTY_GROUP_ID
FROM epdc_party_group_guide_relation
WHERE PARTY_GROUP_GUIDE_ID = #{partyGroupGuideId}
and DEL_FLAG='0'
</select>
<select id="selectPartyGroupName" resultType="String">
SELECT
GROUP_CONCAT(pg.PARTY_GROUP_NAME SEPARATOR ',') partyGroupName
FROM epdc_party_group_guide_relation gr
LEFT JOIN epdc_party_group pg ON gr.PARTY_GROUP_ID = pg.id
WHERE gr.DEL_FLAG = 0
<if test="partyGroupIdList!=null and partyGroupIdList.size()>0">
AND gr.PARTY_GROUP_ID IN
<foreach collection="partyGroupIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
<if test="partyGroupGuideId != null and partyGroupGuideId != ''">
AND gr.PARTY_GROUP_GUIDE_ID = #{partyGroupGuideId}
</if>
GROUP BY gr.PARTY_GROUP_GUIDE_ID
</select>
</mapper>

29
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml

@ -142,6 +142,8 @@
<result property="commentNum" column="COMMENT_NUM"/>
<result property="topicAddress" column="TOPIC_ADDRESS"/>
<result property="likeFlag" column="likeFlag"/>
<result property="identityFlag" column="IDENTITY_FLAG"/>
<result property="thisCommunity" column="thisCommunity"/>
<collection property="images" ofType="java.lang.String">
<result property="image" column="IMG_URL"/>
</collection>
@ -152,9 +154,13 @@
<result column="content" property="content"/>
<result column="commentPartyMember" property="partyMember"/>
</collection>
<collection property="likes" ofType="com.elink.esua.epdc.dto.result.PartyTopicSupportResultDTO">
<result column="supportUserId" property="userId"/>
<result column="supportNickname" property="nickname"/>
<result column="supportUserAvatar" property="userAvatar"/>
</collection>
</resultMap>
<select id="selectListOfPartyTopic" resultMap="partyTopicResult">
select t.ID,
t.NICKNAME,
t.USER_FACE,
@ -165,21 +171,30 @@
t.SUPPORT_NUM,
t.COMMENT_NUM,
t.TOPIC_ADDRESS,
<if test='userId != "" and userId != null'>
if( ATTITUDE_FLAG='0',1,0)likeFlag,
</if>
t6.IDENTITY_FLAG,
<if test='userId != "" and userId != null'>
if( t1.ATTITUDE_FLAG='0',1,0)likeFlag,
</if>
t2.IMG_URL,
t3.ID as commentId,
t3.USERNAME as username,
t3.USER_FACE as commentUserFace,
t3.CONTENT as content,
t3.PARTY_MEMBER as commentPartyMemberDEL_FLAG
t3.PARTY_MEMBER as commentPartyMember,
t5.USER_ID as supportUserId,
t5.NICKNAME as supportNickname,
t5.USER_AVATAR as supportUserAvatar,
(if(find_in_set(t7.DEPT_ID,t6.ALL_DEPT_IDS)>0,'1','0'))as thisCommunity
from epdc_party_topic t
<if test='userId != "" and userId != null'>
left join epdc_party_topic_user_attitude t1 on t.ID = t1.PARTY_TOPIC_ID and t1.DEL_FLAG='0' and t1.USER_ID = #{userId}
left join (select * from epdc_party_topic_user_attitude)t1 on t.ID = t1.PARTY_TOPIC_ID and t1.DEL_FLAG='0' and t1.USER_ID = #{userId}
</if>
left join epdc_party_topic_img t2 on t.ID = t2.REFERENCE_ID and t2.DEL_FLAG='0'
left join (select ID,USERNAME,USER_FACE,PARTY_MEMBER,CONTENT,TOPIC_ID,DEL_FLAG,CREATED_TIME from epdc_party_topic_comment order by CREATED_TIME desc) t3 on t.ID = t3.TOPIC_ID and t3.DEL_FLAG='0'
left join epdc_party_topic_user_attitude t4 on t.ID = t4.PARTY_TOPIC_ID and t4.DEL_FLAG='0'
left join (select epug.USER_ID,epug.NICKNAME,epug.USER_AVATAR,epug.DEL_FLAG from epdc_party_user_group epug where epug.DEL_FLAG='0' and epug.STATE ='0' group by epug.USER_ID)t5 on t4.USER_ID = t5.USER_ID
left join epdc_party_user_group t6 on t6.USER_ID = t.USER_ID and t6.PARTY_GROUP_ID = t.PARTY_GROUP_ID and t6.DEL_FLAG = '0' and t6.STATE ='0'
left join epdc_party_group t7 on t.PARTY_GROUP_ID = t7.ID and t7.DEL_FLAG = '0'
where
t.ID in (select tmp.ID from (SELECT
t1.ID
@ -202,7 +217,7 @@
ORDER BY
t1.CREATED_TIME DESC
LIMIT #{pageIndex},#{pageSize}) tmp)
order by t.CREATED_TIME desc,t3.CREATED_TIME
order by t.CREATED_TIME desc,t3.CREATED_TIME,t4.CREATED_TIME
</select>
<select id="selectListOfMyPartyTopic" resultMap="partyTopicResult">

101
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyUserGroupDao.xml

@ -25,7 +25,9 @@
</resultMap>
<update id="updateInfoByUserId" parameterType="com.elink.esua.epdc.dto.form.PartyUserNewInfoFormDTO">
update epdc_party_user_group set NICKNAME = #{nickname},
USER_AVATAR = #{userAvatar},MOBILE=#{mobile},PARTY_MEMBER=#{partyMember}
USER_AVATAR = #{userAvatar},MOBILE=#{mobile},PARTY_MEMBER=#{partyMember},
GRID = #{grid},GRID_ID=#{gridId},ALL_DEPT_IDS=#{allDeptIds},ALL_DEPT_NAMES=#{allDeptNames},
PARENT_DEPT_IDS=#{parentDeptIds},PARENT_DEPT_NAMES=#{parentDeptNames}
where USER_ID = #{userId} and DEL_FLAG = '0'
</update>
@ -166,27 +168,33 @@
when bannedTime > 31
then 4
else 0
END )) as bannedFlag
from (select ID,
PARTY_GROUP_ID,
USER_ID,
NICKNAME,
USER_AVATAR,
MOBILE,
IDENTITY_FLAG,
PARTY_MEMBER,
STATE,
REMARK,
BANNED_START_TIME,
BANNED_END_TIME,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
ALL_DEPT_IDS,
GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime from epdc_party_user_group)a
END )) as bannedFlag,
thisCommunity
from (select
epug.ID,
epug.PARTY_GROUP_ID,
epug.USER_ID,
epug.NICKNAME,
epug.USER_AVATAR,
epug.MOBILE,
epug.IDENTITY_FLAG,
epug.PARTY_MEMBER,
epug.STATE,
epug.REMARK,
epug.BANNED_START_TIME,
epug.BANNED_END_TIME,
epug.DEL_FLAG,
epug.REVISION,
epug.CREATED_BY,
epug.CREATED_TIME,
epug.UPDATED_BY,
epug.UPDATED_TIME,
epug.ALL_DEPT_IDS,
GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime,
if(find_in_set(eag.DEPT_ID,epug.ALL_DEPT_IDS)>0,1,0) as thisCommunity
from epdc_party_user_group epug
left join epdc_party_group eag on eag.ID = epug.PARTY_GROUP_ID and eag.DEL_FLAG = '0' and eag.STATE = '0'
)a
where DEL_FLAG='0'
and PARTY_GROUP_ID = #{partyGroupId}
order by IDENTITY_FLAG,CREATED_TIME desc
@ -210,27 +218,34 @@
when bannedTime > 31
then 4
else 0
END )) as bannedFlag
from (select ID,
PARTY_GROUP_ID,
USER_ID,
NICKNAME,
USER_AVATAR,
MOBILE,
IDENTITY_FLAG,
PARTY_MEMBER,
STATE,
REMARK,
BANNED_START_TIME,
BANNED_END_TIME,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
ALL_DEPT_IDS,
GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime from epdc_party_user_group)a
END )) as bannedFlag,
thisCommunity
from (
select
epug.ID,
epug.PARTY_GROUP_ID,
epug.USER_ID,
epug.NICKNAME,
epug.USER_AVATAR,
epug.MOBILE,
epug.IDENTITY_FLAG,
epug.PARTY_MEMBER,
epug.STATE,
epug.REMARK,
epug.BANNED_START_TIME,
epug.BANNED_END_TIME,
epug.DEL_FLAG,
epug.REVISION,
epug.CREATED_BY,
epug.CREATED_TIME,
epug.UPDATED_BY,
epug.UPDATED_TIME,
epug.ALL_DEPT_IDS,
GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime,
if(find_in_set(eag.DEPT_ID,epug.ALL_DEPT_IDS)>0,1,0) as thisCommunity
from epdc_party_user_group epug
left join epdc_party_group eag on eag.ID = epug.PARTY_GROUP_ID and eag.DEL_FLAG = '0' and eag.STATE = '0'
)a
where DEL_FLAG='0'
and PARTY_GROUP_ID = #{partyGroupId} and USER_ID = #{userId}
LIMIT 1

2
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -68,7 +68,7 @@
<if test="deptId !='' and deptId != null">
and v.ALL_DEPT_IDS like concat('%',#{deptId},'%')
</if>
ORDER BY v.CREATED_TIME DESC
ORDER BY u.POINTS desc,v.CREATED_TIME DESC
</select>
<select id="volunteerInfoCount" resultType="int">

Loading…
Cancel
Save