Browse Source

党群管理数据权限bug修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
eaf1d41ce0
  1. 19
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java
  2. 4
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java
  3. 4
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java
  4. 4
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java
  5. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java
  6. 47
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/CurrentUser.java
  7. 48
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/OtherUsers.java
  8. 69
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyTopicResultDTO.java
  9. 32
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyUserGroupResultDTO.java
  10. 106
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/TopicList.java
  11. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java
  12. 15
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyUserGroupController.java
  13. 4
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java
  14. 9
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyUserGroupDao.java
  15. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicService.java
  16. 11
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyUserGroupService.java
  17. 26
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java
  18. 16
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java
  19. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml
  20. 8
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyUserGroupDao.xml

19
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPartyGroupController.java

@ -73,7 +73,7 @@ public class ApiPartyGroupController {
* @Param [formDto] * @Param [formDto]
**/ **/
@GetMapping(value = "topic/list", consumes = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value = "topic/list", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<PartyTopicResultDTO>> topicList(@LoginUser TokenDto userDetail, PartyTopicFormDTO formDto) { Result<PartyTopicResultDTO> topicList(@LoginUser TokenDto userDetail, PartyTopicFormDTO formDto) {
return partyGroupService.topicList(userDetail, formDto); return partyGroupService.topicList(userDetail, formDto);
} }
@ -108,25 +108,12 @@ public class ApiPartyGroupController {
* @Param [formDto] * @Param [formDto]
**/ **/
@GetMapping(value = "user/list", consumes = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value = "user/list", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<PartyUserGroupResultDTO>> userList(PartyUserGroupFormDTO formDto) { Result<PartyUserGroupResultDTO> userList(@LoginUser TokenDto userDetail,PartyUserGroupFormDTO formDto) {
return partyGroupService.userList(formDto); return partyGroupService.userList(userDetail,formDto);
} }
/**
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>>
* @Description 当前用户在群里的信息
* @Author songyunpeng
* @Date 2020/6/3
* @Param [formDto]
**/
@GetMapping(value = "user/currentUserInfo/{partyGroupId}", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<PartyUserGroupResultDTO> currentUserInfo(@PathVariable("partyGroupId") String partyGroupId) {
return partyGroupService.currentUserInfo(partyGroupId);
}
/** /**
* @return com.elink.esua.epdc.commons.tools.utils.Result * @return com.elink.esua.epdc.commons.tools.utils.Result
* @Description 禁言 * @Description 禁言

4
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/PartyGroupFeignClient.java

@ -62,7 +62,7 @@ public interface PartyGroupFeignClient {
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>>
**/ **/
@GetMapping(value = "partyGroup/topic/list", consumes = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value = "partyGroup/topic/list", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<PartyTopicResultDTO>> list(PartyTopicFormDTO formDTO); Result<PartyTopicResultDTO> list(PartyTopicFormDTO formDTO);
/** /**
* @Description 发布话题 * @Description 发布话题
@ -90,7 +90,7 @@ public interface PartyGroupFeignClient {
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>>
**/ **/
@GetMapping(value = "partyGroup/user/list", consumes = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value = "partyGroup/user/list", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<PartyUserGroupResultDTO>> list(PartyUserGroupFormDTO formDTO); Result<PartyUserGroupResultDTO> list(PartyUserGroupFormDTO formDTO);
/** /**

4
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/PartyGroupFeignClientFallback.java

@ -37,7 +37,7 @@ public class PartyGroupFeignClientFallback implements PartyGroupFeignClient {
} }
@Override @Override
public Result<List<PartyTopicResultDTO>> list(PartyTopicFormDTO formDTO) { public Result<PartyTopicResultDTO> list(PartyTopicFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "list",formDTO); return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "list",formDTO);
} }
@ -52,7 +52,7 @@ public class PartyGroupFeignClientFallback implements PartyGroupFeignClient {
} }
@Override @Override
public Result<List<PartyUserGroupResultDTO>> list(PartyUserGroupFormDTO formDTO) { public Result<PartyUserGroupResultDTO> list(PartyUserGroupFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "list",formDTO); return ModuleUtils.feignConError(ServiceConstant.EPDC_PARTY_GROUP_SERVER, "list",formDTO);
} }

4
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java

@ -48,7 +48,7 @@ public interface PartyGroupService {
* @Param [userDetail, formDto] * @Param [userDetail, formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>>
**/ **/
Result<List<PartyTopicResultDTO>> topicList(TokenDto userDetail, PartyTopicFormDTO formDto); Result<PartyTopicResultDTO> topicList(TokenDto userDetail, PartyTopicFormDTO formDto);
/** /**
* @Description 发布话题 * @Description 发布话题
* @Author songyunpeng * @Author songyunpeng
@ -72,7 +72,7 @@ public interface PartyGroupService {
* @Param [userDetail, formDto] * @Param [userDetail, formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>>
**/ **/
Result<List<PartyUserGroupResultDTO>> userList( PartyUserGroupFormDTO formDto); Result<PartyUserGroupResultDTO> userList(TokenDto userDetail, PartyUserGroupFormDTO formDto);
/** /**
* @Description 当前用户在群里的信息 * @Description 当前用户在群里的信息
* @Author songyunpeng * @Author songyunpeng

8
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java

@ -55,7 +55,7 @@ public class PartyGroupServiceImpl implements PartyGroupService {
} }
@Override @Override
public Result<List<PartyTopicResultDTO>> topicList(TokenDto userDetail, PartyTopicFormDTO formDto) { public Result<PartyTopicResultDTO> topicList(TokenDto userDetail, PartyTopicFormDTO formDto) {
if(userDetail!=null){ if(userDetail!=null){
formDto.setUserId(userDetail.getUserId()); formDto.setUserId(userDetail.getUserId());
} }
@ -97,7 +97,11 @@ public class PartyGroupServiceImpl implements PartyGroupService {
} }
@Override @Override
public Result<List<PartyUserGroupResultDTO>> userList( PartyUserGroupFormDTO formDto) { public Result<PartyUserGroupResultDTO> userList( TokenDto userDetail, PartyUserGroupFormDTO formDto) {
if(userDetail==null){
return new Result<PartyUserGroupResultDTO>().error("未登录");
}
formDto.setUserId(userDetail.getUserId());
return partyGroupFeignClient.list(formDto); return partyGroupFeignClient.list(formDto);
} }

47
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/CurrentUser.java

@ -0,0 +1,47 @@
package com.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author songyunpeng 群成员列表
* @Description
* @create 2020-06-05
*/
@Data
public class CurrentUser implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 用户ID
*/
private String userId;
/**
* 昵称
*/
private String nickname;
/**
* 用户头像
*/
private String userAvatar;
/**
* 身份标识 0:群员 1:群主 2:副群主
*/
private String identityFlag;
/**
* 禁言状态0-未禁言1-禁言1天2-禁言1周3-禁言一个月4-永久禁言
*/
private String bannedFlag;
}

48
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/OtherUsers.java

@ -0,0 +1,48 @@
package com.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author songyunpeng 群成员列表
* @Description
* @create 2020-06-05
*/
@Data
public class OtherUsers implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 用户ID
*/
private String userId;
/**
* 昵称
*/
private String nickname;
/**
* 用户头像
*/
private String userAvatar;
/**
* 身份标识 0:群员 1:群主 2:副群主
*/
private String identityFlag;
/**
* 禁言状态0-未禁言1-禁言1天2-禁言1周3-禁言一个月4-永久禁言
*/
private String bannedFlag;
}

69
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyTopicResultDTO.java

@ -20,7 +20,6 @@ package com.elink.esua.epdc.dto.result;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -33,74 +32,14 @@ import java.util.List;
public class PartyTopicResultDTO implements Serializable { public class PartyTopicResultDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户头像
*/
private String userFace;
/**
* 党员表示
*/
private String partyMember;
/**
* 话题内容
*/
private String topicContent;
/**
* 话题模块 0:事好儿鼓个掌 1:话对捧个场
*/
private String topicModule;
/**
* 话题地址
*/
private String topicAddress;
/** /**
* 评论数 * 用户是否被禁言
*/ */
private Integer commentNum; String bannedFlag;
/**
* 点赞数
*/
private Integer supportNum;
/** /**
* 创建时间 * 话题列表
*/ */
private Date createdTime; List<TopicList> topicList;
/**
* 图片
*/
private List<String> images;
/**
* 是否点赞
*/
private String likeFlag;
/**
* 评论列表
*/
private List<PartyTopicCommentResultDTO> comments;
} }

32
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyUserGroupResultDTO.java

@ -20,6 +20,7 @@ package com.elink.esua.epdc.dto.result;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
@ -32,37 +33,14 @@ import java.io.Serializable;
public class PartyUserGroupResultDTO implements Serializable { public class PartyUserGroupResultDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/** /**
* 用户ID * 当前用户
*/ */
private String userId; CurrentUser currentUser;
/**
* 昵称
*/
private String nickname;
/**
* 用户头像
*/
private String userAvatar;
/**
* 身份标识 0:群员 1:群主 2:副群主
*/
private String identityFlag;
/** /**
* 禁言状态0-未禁言1-禁言1天2-禁言1周3-禁言一个月4-永久禁言 * 其他成员
*/ */
private String bannedFlag; List<OtherUsers> otherUsers;
} }

106
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/TopicList.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.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 话题表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-05-29
*/
@Data
public class TopicList implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户头像
*/
private String userFace;
/**
* 党员表示
*/
private String partyMember;
/**
* 话题内容
*/
private String topicContent;
/**
* 话题模块 0:事好儿鼓个掌 1:话对捧个场
*/
private String topicModule;
/**
* 话题地址
*/
private String topicAddress;
/**
* 评论数
*/
private Integer commentNum;
/**
* 点赞数
*/
private Integer supportNum;
/**
* 创建时间
*/
private Date createdTime;
/**
* 图片
*/
private List<String> images;
/**
* 是否点赞
*/
private String likeFlag;
/**
* 评论列表
*/
private List<PartyTopicCommentResultDTO> comments;
}

2
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java

@ -50,7 +50,7 @@ public class AppPartyTopicController {
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>>
**/ **/
@GetMapping("list") @GetMapping("list")
public Result<List<PartyTopicResultDTO>> list(@RequestBody PartyTopicFormDTO formDTO){ public Result<PartyTopicResultDTO> list(@RequestBody PartyTopicFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
return partyTopicService.getAllPartyTopicResultDTO(formDTO); return partyTopicService.getAllPartyTopicResultDTO(formDTO);
} }

15
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyUserGroupController.java

@ -11,8 +11,6 @@ import com.elink.esua.epdc.service.PartyUserGroupService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* @author songyunpeng * @author songyunpeng
* @Description * @Description
@ -34,22 +32,11 @@ public class AppPartyUserGroupController {
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>>
**/ **/
@GetMapping("list") @GetMapping("list")
public Result<List<PartyUserGroupResultDTO>> list(@RequestBody PartyUserGroupFormDTO formDTO){ public Result<PartyUserGroupResultDTO> list(@RequestBody PartyUserGroupFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
return partyUserGroupService.getAllPartyUser(formDTO); return partyUserGroupService.getAllPartyUser(formDTO);
} }
/**
* @Description 当前用户在群里的信息
* @Author songyunpeng
* @Date 2020/6/3
* @Param [formDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>>
**/
@GetMapping("currentUserInfo/{partyGroupId}")
public Result<PartyUserGroupResultDTO> currentUserInfo(@PathVariable("partyGroupId") String partyGroupId){
return partyUserGroupService.currentUserInfo(partyGroupId);
}
/** /**
* @Description 禁言 * @Description 禁言
* @Author songyunpeng * @Author songyunpeng

4
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java

@ -20,7 +20,7 @@ package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.PartyTopicDTO; import com.elink.esua.epdc.dto.PartyTopicDTO;
import com.elink.esua.epdc.dto.form.PartyTopicFormDTO; import com.elink.esua.epdc.dto.form.PartyTopicFormDTO;
import com.elink.esua.epdc.dto.result.PartyTopicResultDTO; import com.elink.esua.epdc.dto.result.TopicList;
import com.elink.esua.epdc.entity.PartyTopicEntity; import com.elink.esua.epdc.entity.PartyTopicEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -60,7 +60,7 @@ public interface PartyTopicDao extends BaseDao<PartyTopicEntity> {
* @Param [formDto] * @Param [formDto]
* @return java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO> * @return java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>
**/ **/
List<PartyTopicResultDTO> selectListOfPartyTopic(PartyTopicFormDTO formDto); List<TopicList> selectListOfPartyTopic(PartyTopicFormDTO formDto);
/** /**
* @Description 更新评论数 * @Description 更新评论数
* @Author songyunpeng * @Author songyunpeng

9
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyUserGroupDao.java

@ -20,7 +20,8 @@ package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.PartyUserGroupDTO; import com.elink.esua.epdc.dto.PartyUserGroupDTO;
import com.elink.esua.epdc.dto.form.PartyUserGroupFormDTO; import com.elink.esua.epdc.dto.form.PartyUserGroupFormDTO;
import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO; import com.elink.esua.epdc.dto.result.CurrentUser;
import com.elink.esua.epdc.dto.result.OtherUsers;
import com.elink.esua.epdc.entity.PartyUserGroupEntity; import com.elink.esua.epdc.entity.PartyUserGroupEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -60,13 +61,13 @@ public interface PartyUserGroupDao extends BaseDao<PartyUserGroupEntity> {
**/ **/
List<PartyUserGroupDTO> getPartyUserGroupPageFromPC(Map<String, Object> params); List<PartyUserGroupDTO> getPartyUserGroupPageFromPC(Map<String, Object> params);
/** /**
* @Description APP获取群成员 * @Description APP获取其他群成员
* @Author songyunpeng * @Author songyunpeng
* @Date 2020/6/3 * @Date 2020/6/3
* @Param [formDTO] * @Param [formDTO]
* @return java.util.List<com.elink.esua.epdc.dto.result.CurrentUser> * @return java.util.List<com.elink.esua.epdc.dto.result.CurrentUser>
**/ **/
List<PartyUserGroupResultDTO> selectListOfPartyUserGroupWithoutCurrentUser(PartyUserGroupFormDTO formDTO); List<OtherUsers> selectListOfPartyUserGroupWithoutCurrentUser(PartyUserGroupFormDTO formDTO);
/** /**
* @Description APP获取当前用户的成员信息 * @Description APP获取当前用户的成员信息
@ -75,6 +76,6 @@ public interface PartyUserGroupDao extends BaseDao<PartyUserGroupEntity> {
* @Param [formDTO] * @Param [formDTO]
* @return java.util.List<com.elink.esua.epdc.dto.result.CurrentUser> * @return java.util.List<com.elink.esua.epdc.dto.result.CurrentUser>
**/ **/
PartyUserGroupResultDTO selectOneOfPartyUserGroup(String partyGroupId); CurrentUser selectOneOfPartyUserGroup(PartyUserGroupFormDTO formDTO);
} }

2
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicService.java

@ -121,7 +121,7 @@ public interface PartyTopicService extends BaseService<PartyTopicEntity> {
* @Param [formDTO] * @Param [formDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyTopicResultDTO>>
**/ **/
Result<List<PartyTopicResultDTO>> getAllPartyTopicResultDTO(PartyTopicFormDTO formDTO); Result<PartyTopicResultDTO> getAllPartyTopicResultDTO(PartyTopicFormDTO formDTO);
/** /**
* @Description 发布话题 * @Description 发布话题
* @Author songyunpeng * @Author songyunpeng

11
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyUserGroupService.java

@ -146,15 +146,8 @@ public interface PartyUserGroupService extends BaseService<PartyUserGroupEntity>
* @Param [formDTO] * @Param [formDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>>
**/ **/
Result<List<PartyUserGroupResultDTO>> getAllPartyUser(PartyUserGroupFormDTO formDTO); Result<PartyUserGroupResultDTO> getAllPartyUser(PartyUserGroupFormDTO formDTO);
/**
* @Description 当前用户的在指定群的信息
* @Author songyunpeng
* @Date 2020/6/3
* @Param [formDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO>>
**/
Result<PartyUserGroupResultDTO> currentUserInfo(String partyGroupId);
/** /**
* @Description app禁言 * @Description app禁言
* @Author songyunpeng * @Author songyunpeng

26
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java

@ -29,22 +29,26 @@ import com.elink.esua.epdc.dao.PartyTopicDao;
import com.elink.esua.epdc.dto.GroupTopicCloseFormDTO; import com.elink.esua.epdc.dto.GroupTopicCloseFormDTO;
import com.elink.esua.epdc.dto.PartyTopicDTO; import com.elink.esua.epdc.dto.PartyTopicDTO;
import com.elink.esua.epdc.dto.PartyTopicUserAttitudeDTO; import com.elink.esua.epdc.dto.PartyTopicUserAttitudeDTO;
import com.elink.esua.epdc.dto.PartyUserGroupDTO;
import com.elink.esua.epdc.dto.form.PartyTopicFormDTO; import com.elink.esua.epdc.dto.form.PartyTopicFormDTO;
import com.elink.esua.epdc.dto.form.PartyTopicSubmitFormDTO; import com.elink.esua.epdc.dto.form.PartyTopicSubmitFormDTO;
import com.elink.esua.epdc.dto.form.TopicStatementFormDTO; import com.elink.esua.epdc.dto.form.TopicStatementFormDTO;
import com.elink.esua.epdc.dto.result.PartyTopicResultDTO; import com.elink.esua.epdc.dto.result.PartyTopicResultDTO;
import com.elink.esua.epdc.dto.result.TopicList;
import com.elink.esua.epdc.entity.PartyTopicEntity; import com.elink.esua.epdc.entity.PartyTopicEntity;
import com.elink.esua.epdc.entity.PartyTopicUserAttitudeEntity; import com.elink.esua.epdc.entity.PartyTopicUserAttitudeEntity;
import com.elink.esua.epdc.redis.PartyTopicRedis; import com.elink.esua.epdc.redis.PartyTopicRedis;
import com.elink.esua.epdc.service.PartyTopicImgService; import com.elink.esua.epdc.service.PartyTopicImgService;
import com.elink.esua.epdc.service.PartyTopicService; import com.elink.esua.epdc.service.PartyTopicService;
import com.elink.esua.epdc.service.PartyTopicUserAttitudeService; import com.elink.esua.epdc.service.PartyTopicUserAttitudeService;
import com.elink.esua.epdc.service.PartyUserGroupService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -66,6 +70,9 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
@Autowired @Autowired
private PartyTopicUserAttitudeService partyTopicUserAttitudeService; private PartyTopicUserAttitudeService partyTopicUserAttitudeService;
@Autowired
private PartyUserGroupService partyUserGroupService;
@Override @Override
public PageData<PartyTopicDTO> page(Map<String, Object> params) { public PageData<PartyTopicDTO> page(Map<String, Object> params) {
IPage<PartyTopicEntity> page = baseDao.selectPage( IPage<PartyTopicEntity> page = baseDao.selectPage(
@ -135,16 +142,29 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
} }
@Override @Override
public Result<List<PartyTopicResultDTO>> getAllPartyTopicResultDTO(PartyTopicFormDTO formDto) { public Result<PartyTopicResultDTO> getAllPartyTopicResultDTO(PartyTopicFormDTO formDto) {
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize();
formDto.setPageIndex(pageIndex); formDto.setPageIndex(pageIndex);
List<PartyTopicResultDTO> data = baseDao.selectListOfPartyTopic(formDto); List<TopicList> topicLists = baseDao.selectListOfPartyTopic(formDto);
return new Result<List<PartyTopicResultDTO>>().ok(data); PartyTopicResultDTO partyTopicResultDTO = new PartyTopicResultDTO();
//获取当前用户在当前党群禁言状态
PartyUserGroupDTO userByGroupIdAndUserId = partyUserGroupService.getUserByGroupIdAndUserId(formDto.getPartyGroupId(), formDto.getUserId());
if(userByGroupIdAndUserId!=null && userByGroupIdAndUserId.getBannedEndTime()!=null && new Date().before(userByGroupIdAndUserId.getBannedEndTime())){
partyTopicResultDTO.setBannedFlag("1");
}else{
partyTopicResultDTO.setBannedFlag("0");
}
partyTopicResultDTO.setTopicList(topicLists);
return new Result<PartyTopicResultDTO>().ok(partyTopicResultDTO);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result saveTopic(PartyTopicSubmitFormDTO formDto) { public Result saveTopic(PartyTopicSubmitFormDTO formDto) {
PartyUserGroupDTO userByGroupIdAndUserId = partyUserGroupService.getUserByGroupIdAndUserId(formDto.getPartyGroupId(), formDto.getUserId());
if(userByGroupIdAndUserId!=null && userByGroupIdAndUserId.getBannedEndTime()!=null && new Date().before(userByGroupIdAndUserId.getBannedEndTime())){
return new Result().error("用户已被禁言");
}
PartyTopicEntity entity = ConvertUtils.sourceToTarget(formDto, PartyTopicEntity.class); PartyTopicEntity entity = ConvertUtils.sourceToTarget(formDto, PartyTopicEntity.class);
entity.setTopicModule(formDto.getTopicType()); entity.setTopicModule(formDto.getTopicType());
if(insert(entity)){ if(insert(entity)){

16
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java

@ -35,6 +35,8 @@ import com.elink.esua.epdc.dto.constant.PartyGroupConstant;
import com.elink.esua.epdc.dto.form.PartyUserBannedFormDTO; import com.elink.esua.epdc.dto.form.PartyUserBannedFormDTO;
import com.elink.esua.epdc.dto.form.PartyUserGroupFormDTO; import com.elink.esua.epdc.dto.form.PartyUserGroupFormDTO;
import com.elink.esua.epdc.dto.form.PartyUserIdentityFormDTO; import com.elink.esua.epdc.dto.form.PartyUserIdentityFormDTO;
import com.elink.esua.epdc.dto.result.CurrentUser;
import com.elink.esua.epdc.dto.result.OtherUsers;
import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO; import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO;
import com.elink.esua.epdc.entity.PartyUserGroupEntity; import com.elink.esua.epdc.entity.PartyUserGroupEntity;
import com.elink.esua.epdc.enums.BannedEnum; import com.elink.esua.epdc.enums.BannedEnum;
@ -169,17 +171,17 @@ public class PartyUserGroupServiceImpl extends BaseServiceImpl<PartyUserGroupDao
} }
@Override @Override
public Result<List<PartyUserGroupResultDTO>> getAllPartyUser(PartyUserGroupFormDTO formDTO) { public Result<PartyUserGroupResultDTO> getAllPartyUser(PartyUserGroupFormDTO formDTO) {
int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize(); int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageIndex(pageIndex); formDTO.setPageIndex(pageIndex);
List<PartyUserGroupResultDTO> data = baseDao.selectListOfPartyUserGroupWithoutCurrentUser(formDTO); List<OtherUsers> otherUsers = baseDao.selectListOfPartyUserGroupWithoutCurrentUser(formDTO);
return new Result<List<PartyUserGroupResultDTO>>().ok(data); CurrentUser currentUser = baseDao.selectOneOfPartyUserGroup(formDTO);
PartyUserGroupResultDTO partyUserGroupResultDTO = new PartyUserGroupResultDTO();
partyUserGroupResultDTO.setCurrentUser(currentUser);
partyUserGroupResultDTO.setOtherUsers(otherUsers);
return new Result<PartyUserGroupResultDTO>().ok(partyUserGroupResultDTO);
} }
@Override
public Result<PartyUserGroupResultDTO> currentUserInfo (String partyGroupId) {
return new Result<PartyUserGroupResultDTO>().ok(baseDao.selectOneOfPartyUserGroup(partyGroupId));
}
@Override @Override
public Result banned(PartyUserBannedFormDTO formDto) { public Result banned(PartyUserBannedFormDTO formDto) {

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

@ -130,7 +130,7 @@
and t.ID = #{id} and t.ID = #{id}
</select> </select>
<resultMap id="partyTopicResult" type="com.elink.esua.epdc.dto.result.PartyTopicResultDTO"> <resultMap id="partyTopicResult" type="com.elink.esua.epdc.dto.result.TopicList">
<result property="id" column="ID"/> <result property="id" column="ID"/>
<result property="nickname" column="NICKNAME"/> <result property="nickname" column="NICKNAME"/>
<result property="userFace" column="USER_FACE"/> <result property="userFace" column="USER_FACE"/>

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

@ -143,7 +143,7 @@
order by CREATED_TIME desc order by CREATED_TIME desc
</select> </select>
<select id="selectListOfPartyUserGroupWithoutCurrentUser" resultType="com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO"> <select id="selectListOfPartyUserGroupWithoutCurrentUser" resultType="com.elink.esua.epdc.dto.result.OtherUsers">
select select
ID, ID,
USER_ID, USER_ID,
@ -183,11 +183,11 @@
ALL_DEPT_IDS, ALL_DEPT_IDS,
GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime from epdc_party_user_group)a GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime from epdc_party_user_group)a
where DEL_FLAG='0' where DEL_FLAG='0'
and PARTY_GROUP_ID = #{partyGroupId} and PARTY_GROUP_ID = #{partyGroupId} and USER_ID != #{userId}
order by IDENTITY_FLAG,CREATED_TIME desc order by IDENTITY_FLAG,CREATED_TIME desc
LIMIT #{pageIndex},#{pageSize} LIMIT #{pageIndex},#{pageSize}
</select> </select>
<select id="selectOneOfPartyUserGroup" resultType="com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO"> <select id="selectOneOfPartyUserGroup" resultType="com.elink.esua.epdc.dto.result.CurrentUser">
select select
ID, ID,
USER_ID, USER_ID,
@ -227,7 +227,7 @@
ALL_DEPT_IDS, ALL_DEPT_IDS,
GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime from epdc_party_user_group)a GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime from epdc_party_user_group)a
where DEL_FLAG='0' where DEL_FLAG='0'
and id = #{partyGroupId} and PARTY_GROUP_ID = #{partyGroupId} and USER_ID = #{userId}
LIMIT 1 LIMIT 1
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save