Browse Source

后台话题管理接口 init

dev
liuchuang 6 years ago
parent
commit
d738b1ca2e
  1. 24
      esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java
  2. 60
      esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentListDTO.java
  3. 16
      esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicDeleteCommentsFormDTO.java
  4. 28
      esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java
  5. 24
      esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupListDTO.java
  6. 69
      esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java
  7. 31
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentController.java
  8. 24
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentDao.java
  9. 27
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentService.java
  10. 22
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java
  11. 21
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/GroupController.java
  12. 12
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/dao/GroupDao.java
  13. 16
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/GroupService.java
  14. 5
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/impl/GroupServiceImpl.java
  15. 20
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java
  16. 25
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicDao.java
  17. 23
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java
  18. 13
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java
  19. 56
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentDao.xml
  20. 12
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml
  21. 79
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml

24
esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java

@ -0,0 +1,24 @@
package com.elink.esua.epdc.dto.comment;
import lombok.Data;
import java.io.Serializable;
/**
* 被回复的评论
* @Author LC
* @Date 2019/9/6 17:25
*/
@Data
public class ReplyCommentDto implements Serializable {
private static final long serialVersionUID = 3501567846629315395L;
/**
* 用户名
*/
private String userName;
/**
* 内容
*/
private String content;
}

60
esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentListDTO.java

@ -0,0 +1,60 @@
package com.elink.esua.epdc.dto.comment;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Authorliuchuang
* @Date2019/11/12 10:55
*/
@Data
public class TopicCommentListDTO implements Serializable {
private static final long serialVersionUID = 1678760230045285655L;
/**
* 评论ID
*/
private String commentId;
/**
* 内容
*/
private String content;
/**
* 用户是否赞过false未赞
*/
private boolean userLike;
/**
* 用户是否踩过true踩
*/
private boolean userDislike;
/**
* 评论时间
*/
private Date commentTime;
/**
* 赞数
*/
private Integer approveNum;
/**
* 踩数
*/
private Integer opposeNum;
/**
* 表态次数
*/
private Integer attitudeNum;
/**
* 用户信息
*/
private UserBaseInfoDto user;
/**
* 屏蔽标识 0未屏蔽1已屏蔽
*/
private String shieldFlag;
/**
* 回复评论信息
*/
private ReplyCommentDto replyComment;
}

16
esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicDeleteCommentsFormDTO.java

@ -0,0 +1,16 @@
package com.elink.esua.epdc.dto.comment;
import lombok.Data;
import java.io.Serializable;
/**
* @Authorliuchuang
* @Date2019/11/12 11:06
*/
@Data
public class TopicDeleteCommentsFormDTO implements Serializable {
private static final long serialVersionUID = -8359841146893592752L;
private String[] commentIds;
}

28
esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java

@ -0,0 +1,28 @@
package com.elink.esua.epdc.dto.comment;
import lombok.Data;
import java.io.Serializable;
/**
* 用户基础信息DTO
* @Author LC
* @Date 2019/9/6 17:23
*/
@Data
public class UserBaseInfoDto implements Serializable {
private static final long serialVersionUID = -6564298463849924671L;
/**
* 用户ID
*/
private String userId;
/**
* 用户名
*/
private String userName;
/**
* 用户头像
*/
private String userFace;
}

24
esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupListDTO.java

@ -0,0 +1,24 @@
package com.elink.esua.epdc.dto.group;
import lombok.Data;
import java.io.Serializable;
/**
* @Authorliuchuang
* @Date2019/11/12 9:28
*/
@Data
public class GroupListDTO implements Serializable {
private static final long serialVersionUID = 5340620329305821737L;
/**
* 社群ID
*/
private String groupId;
/**
* 社群名称
*/
private String groupName;
}

69
esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java

@ -0,0 +1,69 @@
package com.elink.esua.epdc.dto.topic;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
*
* 话题详情
*
* @Authorliuchuang
* @Date2019/11/12 10:14
*/
@Data
public class TopicDetailDTO implements Serializable {
private static final long serialVersionUID = -6928257901328686670L;
/**
* 话题内容
*/
private String topicContent;
/**
* 发布人
*/
private String nickname;
/**
* 手机号
*/
private String mobile;
/**
* 发布时间
*/
private Date createdTime;
/**
* 话题地址
*/
private String topicAddress;
/**
* 话题位置纬度
*/
private Double topicLatitude;
/**
* 话题位置经度
*/
private Double topicLongitude;
/**
* 友邻社群
*/
private String groupName;
/**
* 所属网格详细信息
*/
private String ownGrid;
/**
* 图片
*/
private List<String> images;
}

31
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentController.java

@ -26,6 +26,8 @@ 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.comment.TopicCommentDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentListDTO;
import com.elink.esua.epdc.dto.comment.TopicDeleteCommentsFormDTO;
import com.elink.esua.epdc.modules.comment.excel.TopicCommentExcel;
import com.elink.esua.epdc.modules.comment.service.TopicCommentService;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,4 +93,33 @@ public class TopicCommentController {
ExcelUtils.exportExcelToTarget(response, null, list, TopicCommentExcel.class);
}
/**
*
* 评论列表
*
* @params [params]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.comment.TopicCommentDTO>>
* @author liuchuang
* @since 2019/11/12 10:37
*/
@GetMapping("comments")
public Result<PageData<TopicCommentListDTO>> commentsList(@RequestParam Map<String, Object> params) {
PageData<TopicCommentListDTO> page = topicCommentService.listComments(params);
return new Result<PageData<TopicCommentListDTO>>().ok(page);
}
/**
*
* 屏蔽评论
*
* @params [formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author liuchuang
* @since 2019/11/12 11:07
*/
@PostMapping("deleteComment")
public Result deleteComment(@RequestBody TopicDeleteCommentsFormDTO formDto) {
return topicCommentService.modifyCommentById(formDto.getCommentIds());
}
}

24
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentDao.java

@ -18,12 +18,15 @@
package com.elink.esua.epdc.modules.comment.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.comment.TopicCommentListDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.topic.TopicCommentsDTO;
import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 话题评论表 话题评论表
@ -66,5 +69,26 @@ public interface TopicCommentDao extends BaseDao<TopicCommentEntity> {
List<TopicCommentsDTO> selectListOfComments(TopicCommentsFormDTO formDTO);
/**
*
* 评论列表
*
* @params [params]
* @return java.util.List<com.elink.esua.epdc.dto.comment.TopicCommentDTO>
* @author liuchuang
* @since 2019/11/12 10:41
*/
List<TopicCommentListDTO> selectListOfCommentsByTopicId(Map<String, Object> params);
/**
*
* 屏蔽评论
*
* @params [commentIds]
* @return void
* @author liuchuang
* @since 2019/11/12 11:08
*/
void updateCommentShieldFlag(@Param("commentIds") String[] commentIds);
}

27
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentService.java

@ -20,10 +20,7 @@ package com.elink.esua.epdc.modules.comment.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.comment.TopicCommentDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsResultDTO;
import com.elink.esua.epdc.dto.comment.*;
import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity;
import java.util.List;
@ -132,4 +129,26 @@ public interface TopicCommentService extends BaseService<TopicCommentEntity> {
* @param commentId
*/
void updateOpposeNumSubtract(String commentId);
/**
*
* 评论列表
*
* @params [params]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.comment.TopicCommentDTO>
* @author liuchuang
* @since 2019/11/12 10:38
*/
PageData<TopicCommentListDTO> listComments(Map<String, Object> params);
/**
*
* 屏蔽评论
*
* @params [commentIds]
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author liuchuang
* @since 2019/11/12 11:07
*/
Result modifyCommentById(String[] commentIds);
}

22
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java

@ -25,10 +25,7 @@ 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.dto.comment.TopicCommentDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsResultDTO;
import com.elink.esua.epdc.dto.comment.*;
import com.elink.esua.epdc.dto.constant.TopicNoticeConstant;
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO;
import com.elink.esua.epdc.dto.topic.TopicCommentsDTO;
@ -57,9 +54,6 @@ import java.util.Map;
@Service
public class TopicCommentServiceImpl extends BaseServiceImpl<TopicCommentDao, TopicCommentEntity> implements TopicCommentService {
@Autowired
private TopicCommentRedis topicCommentRedis;
@Autowired
private TopicService topicService;
@ -219,4 +213,18 @@ public class TopicCommentServiceImpl extends BaseServiceImpl<TopicCommentDao, To
public void updateOpposeNumSubtract(String commentId) {
baseDao.updateOpposeNumSubtract(commentId);
}
@Override
public PageData<TopicCommentListDTO> listComments(Map<String, Object> params) {
IPage<TopicCommentListDTO> page = getPage(params);
List<TopicCommentListDTO> list = baseDao.selectListOfCommentsByTopicId(params);
return new PageData<>(list, page.getTotal());
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result modifyCommentById(String[] commentIds) {
baseDao.updateCommentShieldFlag(commentIds);
return new Result();
}
}

21
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/GroupController.java

@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.group.controller;
import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
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;
@ -26,10 +27,7 @@ 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.group.GroupDTO;
import com.elink.esua.epdc.dto.group.GroupDetailDTO;
import com.elink.esua.epdc.dto.group.GroupManagementDTO;
import com.elink.esua.epdc.dto.group.GroupSettingStateDTO;
import com.elink.esua.epdc.dto.group.*;
import com.elink.esua.epdc.modules.group.excel.GroupExcel;
import com.elink.esua.epdc.modules.group.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
@ -136,4 +134,19 @@ public class GroupController {
return groupService.modifyGroupState(dto);
}
/**
*
* 获取网格下所有社群
*
* @params []
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.group.GroupListDTO>>
* @author liuchuang
* @since 2019/11/12 9:30
*/
@GetMapping("groupList")
public Result<List<GroupListDTO>> groupList() {
List<GroupListDTO> data = groupService.listOfGroupByGridId(SecurityUser.getDeptId());
return new Result<List<GroupListDTO>>().ok(data);
}
}

12
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/dao/GroupDao.java

@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.group.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.group.GroupDetailDTO;
import com.elink.esua.epdc.dto.group.GroupListDTO;
import com.elink.esua.epdc.dto.group.GroupManagementDTO;
import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO;
import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO;
@ -105,5 +106,16 @@ public interface GroupDao extends BaseDao<GroupEntity> {
* @since 2019/10/22 15:02
*/
GroupDetailForMobileEndResultDTO selectOneOfGroupDetailForMobileEnd(GroupDetailForMobileEndFormDTO formDto);
/**
*
* 获取网格下所有社群
*
* @params [deptId]
* @return java.util.List<com.elink.esua.epdc.dto.group.GroupListDTO>
* @author liuchuang
* @since 2019/11/12 9:35
*/
List<GroupListDTO> selectListOfGroupByGridId(Long deptId);
}

16
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/GroupService.java

@ -20,10 +20,7 @@ package com.elink.esua.epdc.modules.group.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.group.GroupDTO;
import com.elink.esua.epdc.dto.group.GroupDetailDTO;
import com.elink.esua.epdc.dto.group.GroupManagementDTO;
import com.elink.esua.epdc.dto.group.GroupSettingStateDTO;
import com.elink.esua.epdc.dto.group.*;
import com.elink.esua.epdc.dto.group.form.*;
import com.elink.esua.epdc.dto.group.result.*;
import com.elink.esua.epdc.modules.group.entity.GroupEntity;
@ -220,4 +217,15 @@ public interface GroupService extends BaseService<GroupEntity> {
*/
Result applyForGroup(GroupApplyFormDTO formDto);
/**
*
* 获取网格下所有社群
*
* @params [deptId]
* @return java.util.List<com.elink.esua.epdc.dto.group.GroupListDTO>
* @author liuchuang
* @since 2019/11/12 9:33
*/
List<GroupListDTO> listOfGroupByGridId(Long deptId);
}

5
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/impl/GroupServiceImpl.java

@ -306,4 +306,9 @@ public class GroupServiceImpl extends BaseServiceImpl<GroupDao, GroupEntity> imp
return new Result().error();
}
@Override
public List<GroupListDTO> listOfGroupByGridId(Long deptId) {
return baseDao.selectListOfGroupByGridId(deptId);
}
}

20
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java

@ -17,6 +17,7 @@
package com.elink.esua.epdc.modules.topic.controller;
import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter;
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.ExcelUtils;
@ -27,6 +28,7 @@ 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.topic.TopicDTO;
import com.elink.esua.epdc.dto.topic.TopicDetailDTO;
import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO;
import com.elink.esua.epdc.modules.topic.excel.TopicExcel;
@ -53,8 +55,9 @@ public class TopicController {
private TopicService topicService;
@GetMapping("page")
@DataFilter(tableAlias = "temp", deptId = "grid_id", prefix = "AND", isPendingCreator = false)
public Result<PageData<TopicDTO>> page(@RequestParam Map<String, Object> params){
PageData<TopicDTO> page = topicService.page(params);
PageData<TopicDTO> page = topicService.listTopic(params);
return new Result<PageData<TopicDTO>>().ok(page);
}
@ -138,4 +141,19 @@ public class TopicController {
return new Result();
}
/**
*
* 话题详情
*
* @params [id]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.topic.TopicDetailDTO>
* @author liuchuang
* @since 2019/11/12 10:22
*/
@GetMapping("detail/{id}")
public Result<TopicDetailDTO> detail(@PathVariable("id") String id) {
TopicDetailDTO data = topicService.getDetail(id);
return new Result<TopicDetailDTO>().ok(data);
}
}

25
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicDao.java

@ -19,6 +19,8 @@ package com.elink.esua.epdc.modules.topic.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO;
import com.elink.esua.epdc.dto.topic.TopicDTO;
import com.elink.esua.epdc.dto.topic.TopicDetailDTO;
import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO;
import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO;
import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO;
@ -26,6 +28,7 @@ import com.elink.esua.epdc.modules.topic.entity.TopicEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 话题表 话题表
@ -74,4 +77,26 @@ public interface TopicDao extends BaseDao<TopicEntity> {
*/
EpdcEventSubmitFormDTO selectOneOfTopicForChangeToIssue(String id);
/**
*
* 话题列表
*
* @params [params]
* @return java.util.List<com.elink.esua.epdc.dto.topic.TopicDTO>
* @author liuchuang
* @since 2019/11/12 9:45
*/
List<TopicDTO> selectListTopic(Map<String, Object> params);
/**
*
* 话题详情
*
* @params [id]
* @return com.elink.esua.epdc.dto.topic.TopicDetailDTO
* @author liuchuang
* @since 2019/11/12 10:25
*/
TopicDetailDTO selectOneOfTopic(String id);
}

23
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java

@ -22,6 +22,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO;
import com.elink.esua.epdc.dto.topic.TopicDTO;
import com.elink.esua.epdc.dto.topic.TopicDetailDTO;
import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO;
@ -52,6 +53,17 @@ public interface TopicService extends BaseService<TopicEntity> {
*/
PageData<TopicDTO> page(Map<String, Object> params);
/**
*
* 话题列表
*
* @params [params]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.topic.TopicDTO>
* @author liuchuang
* @since 2019/11/12 9:43
*/
PageData<TopicDTO> listTopic(Map<String, Object> params);
/**
* 默认查询
*
@ -184,4 +196,15 @@ public interface TopicService extends BaseService<TopicEntity> {
* @since 2019/11/11 10:50
*/
Result reviewCallback(TopicReviewFormDTO formDto);
/**
*
* 话题详情
*
* @params [id]
* @return com.elink.esua.epdc.dto.topic.TopicDetailDTO
* @author liuchuang
* @since 2019/11/12 10:24
*/
TopicDetailDTO getDetail(String id);
}

13
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java

@ -37,6 +37,7 @@ import com.elink.esua.epdc.dto.group.GroupDTO;
import com.elink.esua.epdc.dto.group.UserGroupDTO;
import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO;
import com.elink.esua.epdc.dto.topic.TopicDTO;
import com.elink.esua.epdc.dto.topic.TopicDetailDTO;
import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO;
@ -97,6 +98,13 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp
return getPageData(page, TopicDTO.class);
}
@Override
public PageData<TopicDTO> listTopic(Map<String, Object> params) {
IPage<TopicDTO> page = getPage(params);
List<TopicDTO> list = baseDao.selectListTopic(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<TopicDTO> list(Map<String, Object> params) {
List<TopicEntity> entityList = baseDao.selectList(getWrapper(params));
@ -315,6 +323,11 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp
return new Result();
}
@Override
public TopicDetailDTO getDetail(String id) {
return baseDao.selectOneOfTopic(id);
}
/**
*
* 话题转议题校验

56
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentDao.xml

@ -161,4 +161,60 @@
t2.CREATED_TIME DESC
</select>
<resultMap id="commentListMap" type="com.elink.esua.epdc.dto.comment.TopicCommentListDTO">
<result property="commentId" column="ID"/>
<result property="content" column="CONTENT"/>
<result property="commentTime" column="CREATED_TIME"/>
<result property="shieldFlag" column="SHIELD_FLAG"/>
<result property="user.userId" column="USER_ID"/>
<result property="user.userName" column="USER_NAME"/>
<result property="user.userFace" column="USER_FACE"/>
<result property="replyComment.userName" column="replyUserName"/>
<result property="replyComment.content" column="replyContent"/>
</resultMap>
<select id="selectListOfCommentsByTopicId" resultMap="commentListMap">
SELECT
t2.ID,
t2.COMMENT_ID,
t2.CONTENT,
t2.CREATED_TIME,
t2.USER_ID,
t2.USER_FACE,
t2.USERNAME,
t2.SHIELD_FLAG,
t3.ID AS replyId,
t3.USERNAME AS replyUserName,
t3.CONTENT AS replyContent
FROM
(
SELECT
t1.ID,
t1.COMMENT_ID,
t1.CONTENT,
t1.CREATED_TIME,
t1.USER_ID,
t1.USER_FACE,
t1.USERNAME,
t1.SHIELD_FLAG
FROM
epdc_topic_comment t1
WHERE
t1.DEL_FLAG = '0'
AND t1.TOPIC_ID = #{topicId}
ORDER BY
t1.CREATED_TIME DESC
) t2
LEFT JOIN epdc_topic_comment t3 ON t2.COMMENT_ID = t3.ID
ORDER BY
t2.CREATED_TIME DESC
</select>
<update id="updateCommentShieldFlag">
UPDATE epdc_topic_comment SET SHIELD_FLAG = '1' WHERE ID IN
<foreach collection="commentIds" item="commentId" index="no" open="("
separator="," close=")">
#{commentId}
</foreach>
</update>
</mapper>

12
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml

@ -164,5 +164,17 @@
AND gp.ID = #{id}
</select>
<select id="selectListOfGroupByGridId" resultType="com.elink.esua.epdc.dto.group.GroupListDTO">
SELECT
ID AS groupId,
GROUP_NAME AS groupName
FROM
epdc_group
WHERE
DEL_FLAG = '0'
AND STATE IN ( 10, 15, 20 )
AND GRID_ID = #{deptId}
</select>
</mapper>

79
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml

@ -182,4 +182,83 @@
img.IMG_URL
</select>
<select id="selectListTopic" resultType="com.elink.esua.epdc.dto.topic.TopicDTO">
SELECT
temp.ID,
temp.NICKNAME,
temp.CREATED_TIME,
temp.TOPIC_CONTENT,
temp.COMMENT_NUM,
temp.BROWSE_NUM,
temp.STATE
FROM
epdc_topic temp
WHERE
temp.DEL_FLAG = '0'
AND temp.STATE IN ( 0, 5, 20 )
<if test="streetId != null and streetId != ''">
AND temp.STREET_ID = #{streetId}
</if>
<if test="communityId != null and communityId != ''">
AND temp.COMMUNITY_ID = #{communityId}
</if>
<if test="gridId != null and gridId != ''">
AND temp.grid_id = #{gridId}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( temp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="groupId != null and groupId != ''">
AND temp.GROUP_ID = #{groupId}
</if>
<if test="keyword != null and keyword != ''">
AND temp.TOPIC_CONTENT like concat('%', #{keyword}, '%')
</if>
ORDER BY
<if test="orderType == 0">
temp.CREATED_TIME DESC
</if>
<if test="orderType == 1">
temp.BROWSE_NUM DESC
</if>
<if test="orderType == 2">
temp.COMMENT_NUM DESC
</if>
</select>
<resultMap id="topicDetail" type="com.elink.esua.epdc.dto.topic.TopicDetailDTO">
<result property="nickname" column="NICKNAME"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="topicContent" column="TOPIC_CONTENT"/>
<result property="mobile" column="MOBILE"/>
<result property="topicAddress" column="TOPIC_ADDRESS"/>
<result property="topicLatitude" column="TOPIC_LATITUDE"/>
<result property="topicLongitude" column="TOPIC_LONGITUDE"/>
<result property="groupName" column="GROUP_NAME"/>
<result property="ownGrid" column="ownGrid"/>
<collection property="images" ofType="java.lang.String">
<result property="image" column="IMG_URL"/>
</collection>
</resultMap>
<select id="selectOneOfTopic" resultMap="topicDetail">
SELECT
tp.NICKNAME,
tp.CREATED_TIME,
tp.TOPIC_CONTENT,
tp.MOBILE,
tp.TOPIC_ADDRESS,
tp.TOPIC_LATITUDE,
tp.TOPIC_LONGITUDE,
tp.GROUP_NAME,
CONCAT( tp.AREA, tp.STREET, tp.COMMUNITY, tp.GRID ) AS ownGrid,
img.IMG_URL
FROM
epdc_topic tp
LEFT JOIN epdc_topic_img img ON tp.ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
WHERE
tp.DEL_FLAG = '0'
AND tp.ID = #{id}
</select>
</mapper>

Loading…
Cancel
Save