forked from rongchao/epmet-cloud-rizhao
33 changed files with 2038 additions and 0 deletions
@ -0,0 +1,95 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicAttachmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id,关联resi_topic的id |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,109 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicCommentAttachmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String topicCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicCommentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id,来自resi_topic |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String commentContent; |
|||
|
|||
/** |
|||
* 评论状态:讨论中:discussing;已屏蔽 :hidden |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人,评论人Id,来自user |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,125 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 关闭状态:已解决 resolved,未解决 unresolved |
|||
*/ |
|||
private String closedStatus; |
|||
|
|||
/** |
|||
* 省 |
|||
*/ |
|||
private String province; |
|||
|
|||
/** |
|||
* 市 |
|||
*/ |
|||
private String city; |
|||
|
|||
/** |
|||
* 区 |
|||
*/ |
|||
private String area; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 维度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 定位地址 |
|||
*/ |
|||
private String locateAddress; |
|||
|
|||
/** |
|||
* 定位经度 |
|||
*/ |
|||
private String locateLongitude; |
|||
|
|||
/** |
|||
* 定位维度 |
|||
*/ |
|||
private String locateLatitude; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人,发布人Id来源于user |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 话题表决记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
public class YtTopicVoteDetailDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题ID |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 态度 - opposition(反对)support(赞成) |
|||
*/ |
|||
private String attitude; |
|||
|
|||
/** |
|||
* 删除标识 0未删除、1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,86 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:17 |
|||
*/ |
|||
@Data |
|||
public class CreateYtTopicFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String customerId; |
|||
|
|||
private String gridId; |
|||
|
|||
|
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 经度 |
|||
* */ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
* */ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 地址 |
|||
* */ |
|||
@NotBlank(message = "地址信息不能为空") |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
* */ |
|||
private String locateLongitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
* */ |
|||
private String locateLatitude; |
|||
|
|||
/** |
|||
* 地址 |
|||
* */ |
|||
private String locateAddress; |
|||
|
|||
/** |
|||
* 省份 |
|||
* */ |
|||
private String province; |
|||
|
|||
/** |
|||
* 城市 |
|||
* */ |
|||
private String city; |
|||
|
|||
/** |
|||
* 地区 |
|||
* */ |
|||
private String area; |
|||
|
|||
/** |
|||
* 图片附件 |
|||
*/ |
|||
private List<String> imageList; |
|||
/** |
|||
* 文件附件 |
|||
*/ |
|||
private List<FileDTO> docList; |
|||
/** |
|||
* 语音附件 |
|||
*/ |
|||
private List<FileDTO> voiceList; |
|||
/** |
|||
* 视频附件 |
|||
*/ |
|||
private List<FileDTO> videoList; |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ResiPublishCommentFormDTO |
|||
* @Author wangc |
|||
* @date 2020.03.31 17:32 |
|||
*/ |
|||
@Data |
|||
public class YtTopicCommentFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@NotBlank(message = "话题Id不能为空") |
|||
private String topicId; |
|||
|
|||
//@NotBlank(message = "评论内容不能为空")
|
|||
private String commentContent; |
|||
|
|||
/** |
|||
* 图片附件集合 |
|||
*/ |
|||
private List<NoticeFileDTO> imageList; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ResiTopicDetailFormDTO |
|||
* @Author wangc |
|||
* @date 2020.04.07 09:07 |
|||
*/ |
|||
@Data |
|||
public class YtTopicDetailFormDTO extends PageFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 话题Id |
|||
* */ |
|||
@NotBlank(message = "话题Id不能为空") |
|||
private String topicId; |
|||
|
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class YtTopicPageFormDTO extends PageFormDTO implements Serializable{ |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 组Id |
|||
* */ |
|||
@NotBlank(message = "网格Id不能为空") |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 搜索时可以带状态的查询,也可以不带 |
|||
* */ |
|||
private String status; |
|||
|
|||
/** |
|||
* 用户Id |
|||
* */ |
|||
private String userId; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.resi.group.dto.topic.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ResiPublishCommentFormDTO |
|||
* @Author wangc |
|||
* @date 2020.03.31 17:32 |
|||
*/ |
|||
@Data |
|||
public class YtTopicVoteFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@NotBlank(message = "话题Id不能为空") |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 态度opposition(反对)support(赞成) |
|||
*/ |
|||
@NotBlank(message = "投票结果不能为空") |
|||
private String attitude; |
|||
|
|||
} |
@ -0,0 +1,65 @@ |
|||
package com.epmet.resi.group.dto.topic.result; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName ResiCommentResultDTO |
|||
* @Author wangc |
|||
* @date 2020.04.01 17:07 |
|||
*/ |
|||
@Data |
|||
public class YtTopicCommentResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 评论Id |
|||
* */ |
|||
private String commentId; |
|||
|
|||
/** |
|||
* 评论内容 |
|||
* */ |
|||
private String commentContent; |
|||
|
|||
/** |
|||
* 评论者头像 |
|||
* */ |
|||
private String commentUserHeadPhoto; |
|||
|
|||
/** |
|||
* 评论者姓名 |
|||
* */ |
|||
private String commentUserName; |
|||
|
|||
/** |
|||
* 用户Id 评论者Id |
|||
* */ |
|||
@JsonIgnore |
|||
private String userId; |
|||
|
|||
/** |
|||
* 评论时间 yyyy-MM-dd HH:mm |
|||
* */ |
|||
@JSONField(format="yyyy-MM-dd HH:mm") |
|||
private Date commentTime; |
|||
|
|||
/** |
|||
* 评论状态 |
|||
* */ |
|||
private String commentStatus; |
|||
|
|||
/** |
|||
* 图片附件集合 |
|||
*/ |
|||
private List<CommentFileDTO> imageList = new ArrayList<>(); |
|||
} |
@ -0,0 +1,85 @@ |
|||
package com.epmet.resi.group.dto.topic.result; |
|||
|
|||
import com.epmet.resi.group.dto.topic.form.FileDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class YtTopicDetailResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -6790536784979922200L; |
|||
|
|||
/** |
|||
* 话题Id |
|||
* */ |
|||
private String topicId; |
|||
|
|||
|
|||
/** |
|||
* 发布人名称 |
|||
* */ |
|||
private String releaseUserName; |
|||
|
|||
/** |
|||
* 发布人头像 |
|||
* */ |
|||
private String releaseUserHeadPhoto; |
|||
|
|||
/** |
|||
* 发布时间 yyyy-MM-dd HH:mm |
|||
* */ |
|||
private String releaseTime; |
|||
|
|||
/** |
|||
* 发布地址 |
|||
* */ |
|||
private String releaseAddress; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 维度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 话题内容 |
|||
* */ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 话题状态 |
|||
* */ |
|||
private String topicStatus; |
|||
|
|||
/** |
|||
* 图片访问地址 |
|||
* */ |
|||
private List<String> topicImages; |
|||
|
|||
/** |
|||
* 话题语音详情 |
|||
* */ |
|||
private List<FileDTO> topicVoices; |
|||
|
|||
/** |
|||
* 本人投票状态opposition(反对)support(赞成) none(未投票) |
|||
* */ |
|||
private String voteStatus; |
|||
/** |
|||
* 投票支持数 |
|||
* */ |
|||
private String supportCount; |
|||
/** |
|||
* 投票反对数 |
|||
* */ |
|||
private String oppositionCount; |
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
package com.epmet.resi.group.dto.topic.result; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class YtTopicInfoResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -7029232911456325417L; |
|||
|
|||
/** |
|||
* 话题Id |
|||
* */ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 用户Id 话题发布人 |
|||
* */ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 发布人名称 |
|||
* */ |
|||
private String releaseUserName; |
|||
|
|||
/** |
|||
* 发布人头像 |
|||
* */ |
|||
private String releaseUserHeadPhoto; |
|||
|
|||
/** |
|||
* 发布时间 yyyy-MM-dd HH:mm |
|||
* */ |
|||
@JSONField(format="yyyy-MM-dd HH:mm") |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 话题内容 |
|||
* */ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 话题状态 讨论中 已关闭 |
|||
* */ |
|||
private String status; |
|||
|
|||
/** |
|||
* 是否本人 me other |
|||
* */ |
|||
private String releaseUserFlag; |
|||
|
|||
/** |
|||
* 第一张图片 |
|||
* */ |
|||
private List<String> imageList; |
|||
|
|||
} |
@ -0,0 +1,134 @@ |
|||
package com.epmet.modules.topic.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.modules.topic.service.YtTopicService; |
|||
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; |
|||
import com.epmet.resi.group.dto.topic.form.*; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 烟台话题信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("ytTopic") |
|||
public class YtTopicController { |
|||
|
|||
@Autowired |
|||
private YtTopicService ytTopicService; |
|||
|
|||
/** |
|||
* 发布话题 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:32 |
|||
*/ |
|||
@PostMapping("createTopic") |
|||
@NoRepeatSubmit |
|||
public Result createTopic(@LoginUser TokenDto tokenDto, @RequestBody CreateYtTopicFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
ytTopicService.createTopic(tokenDto, formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 话题详情 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param topicDetailFormDTO |
|||
* @Return {@link Result< YtTopicDetailResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:39 |
|||
*/ |
|||
@PostMapping("topicDetail") |
|||
public Result<YtTopicDetailResultDTO> getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO topicDetailFormDTO) { |
|||
ValidatorUtils.validateEntity(topicDetailFormDTO); |
|||
return new Result<YtTopicDetailResultDTO>().ok(ytTopicService.getTopicDetail(tokenDto, topicDetailFormDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 话题列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param topicPageFormDTO |
|||
* @Return {@link Result< PageData< YtTopicInfoResultDTO>>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:55 |
|||
*/ |
|||
@PostMapping("topicList") |
|||
public Result<PageData<YtTopicInfoResultDTO>> getTopicList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicPageFormDTO topicPageFormDTO) { |
|||
topicPageFormDTO.setUserId(tokenDto.getUserId()); |
|||
ValidatorUtils.validateEntity(topicPageFormDTO); |
|||
return new Result<PageData<YtTopicInfoResultDTO>>().ok(ytTopicService.getTopicList(tokenDto, topicPageFormDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 话题详情评论列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param queryCommentFormDTO |
|||
* @Return {@link Result<List<ResiCommentResultDTO>>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:57 |
|||
*/ |
|||
@PostMapping("topicCommentList") |
|||
public Result<PageData<YtTopicCommentResultDTO>> getTopiCommentList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
return new Result<PageData<YtTopicCommentResultDTO>>().ok(ytTopicService.getTopicCommentList(tokenDto, formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 评论话题 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:06 |
|||
*/ |
|||
@PostMapping("topicComment") |
|||
@NoRepeatSubmit |
|||
public Result topiComment(@LoginUser TokenDto tokenDto, @RequestBody YtTopicCommentFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
ytTopicService.topicComment(tokenDto, formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 话题投票 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:08 |
|||
*/ |
|||
@PostMapping("topicVote") |
|||
@NoRepeatSubmit |
|||
public Result topicVote(@LoginUser TokenDto tokenDto, @RequestBody YtTopicVoteFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
ytTopicService.topicVote(tokenDto, formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.modules.topic.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.topic.entity.YtTopicAttachmentEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 烟台话题附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Mapper |
|||
public interface YtTopicAttachmentDao extends BaseDao<YtTopicAttachmentEntity> { |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.modules.topic.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.topic.entity.YtTopicCommentAttachmentEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 烟台话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Mapper |
|||
public interface YtTopicCommentAttachmentDao extends BaseDao<YtTopicCommentAttachmentEntity> { |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.epmet.modules.topic.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.topic.entity.YtTopicCommentEntity; |
|||
import com.epmet.resi.group.dto.topic.form.YtTopicDetailFormDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 烟台话题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Mapper |
|||
public interface YtTopicCommentDao extends BaseDao<YtTopicCommentEntity> { |
|||
|
|||
/** |
|||
* 获取评论列表 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link List<YtTopicCommentResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/31 14:11 |
|||
*/ |
|||
List<YtTopicCommentResultDTO> selectCommentList(YtTopicDetailFormDTO formDTO); |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.modules.topic.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.topic.entity.YtTopicEntity; |
|||
import com.epmet.resi.group.dto.topic.form.YtTopicPageFormDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 烟台话题信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Mapper |
|||
public interface YtTopicDao extends BaseDao<YtTopicEntity> { |
|||
/** |
|||
* 话题列表 |
|||
* |
|||
* @Param topicPageFormDTO |
|||
* @Return {@link List<YtTopicInfoResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/31 13:52 |
|||
*/ |
|||
List<YtTopicInfoResultDTO> selectTopicList(YtTopicPageFormDTO topicPageFormDTO); |
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.modules.topic.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.topic.entity.YtTopicVoteDetailEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 话题表决记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Mapper |
|||
public interface YtTopicVoteDetailDao extends BaseDao<YtTopicVoteDetailEntity> { |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.epmet.modules.topic.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 烟台话题附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("yt_topic_attachment") |
|||
public class YtTopicAttachmentEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id,关联resi_topic的id |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.epmet.modules.topic.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 烟台话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("yt_topic_comment_attachment") |
|||
public class YtTopicCommentAttachmentEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String topicCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.epmet.modules.topic.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 烟台话题评论表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("yt_topic_comment") |
|||
public class YtTopicCommentEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id,来自resi_topic |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String commentContent; |
|||
|
|||
/** |
|||
* 评论状态:讨论中:discussing;已屏蔽 :hidden |
|||
*/ |
|||
private String status; |
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
package com.epmet.modules.topic.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 烟台话题信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("yt_topic") |
|||
public class YtTopicEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 关闭状态:已解决 resolved,未解决 unresolved |
|||
*/ |
|||
private String closedStatus; |
|||
|
|||
/** |
|||
* 省 |
|||
*/ |
|||
private String province; |
|||
|
|||
/** |
|||
* 市 |
|||
*/ |
|||
private String city; |
|||
|
|||
/** |
|||
* 区 |
|||
*/ |
|||
private String area; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 维度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 定位地址 |
|||
*/ |
|||
private String locateAddress; |
|||
|
|||
/** |
|||
* 定位经度 |
|||
*/ |
|||
private String locateLongitude; |
|||
|
|||
/** |
|||
* 定位维度 |
|||
*/ |
|||
private String locateLatitude; |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.modules.topic.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 话题表决记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("yt_topic_vote_detail") |
|||
public class YtTopicVoteDetailEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题ID |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 态度 - opposition(反对)support(赞成) |
|||
*/ |
|||
private String attitude; |
|||
|
|||
} |
@ -0,0 +1,85 @@ |
|||
package com.epmet.modules.topic.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.modules.topic.entity.YtTopicEntity; |
|||
import com.epmet.resi.group.dto.topic.form.*; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; |
|||
|
|||
/** |
|||
* 烟台话题信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
public interface YtTopicService extends BaseService<YtTopicEntity> { |
|||
|
|||
/** |
|||
* 发布话题 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:18 |
|||
*/ |
|||
void createTopic(TokenDto tokenDto, CreateYtTopicFormDTO formDTO); |
|||
|
|||
/** |
|||
* 话题详情 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link YtTopicDetailResultDTO} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:39 |
|||
*/ |
|||
YtTopicDetailResultDTO getTopicDetail(TokenDto tokenDto, YtTopicDetailFormDTO formDTO); |
|||
|
|||
/** |
|||
* 话题列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param topicPageFormDTO |
|||
* @Return {@link PageData<YtTopicInfoResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:56 |
|||
*/ |
|||
PageData<YtTopicInfoResultDTO> getTopicList(TokenDto tokenDto, YtTopicPageFormDTO topicPageFormDTO); |
|||
|
|||
/** |
|||
* 话题详情评论列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link PageData<YtTopicCommentResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:02 |
|||
*/ |
|||
PageData<YtTopicCommentResultDTO> getTopicCommentList(TokenDto tokenDto, YtTopicDetailFormDTO formDTO); |
|||
|
|||
/** |
|||
* 评论话题 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:05 |
|||
*/ |
|||
void topicComment(TokenDto tokenDto, YtTopicCommentFormDTO formDTO); |
|||
|
|||
/** |
|||
* 话题投票 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:08 |
|||
*/ |
|||
void topicVote(TokenDto tokenDto, YtTopicVoteFormDTO formDTO); |
|||
} |
@ -0,0 +1,355 @@ |
|||
package com.epmet.modules.topic.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; |
|||
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.modules.topic.dao.*; |
|||
import com.epmet.modules.topic.entity.*; |
|||
import com.epmet.modules.topic.service.YtTopicService; |
|||
import com.epmet.modules.utils.ModuleConstant; |
|||
import com.epmet.resi.group.constant.TopicConstant; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import com.epmet.resi.group.dto.topic.form.*; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO; |
|||
import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; |
|||
import com.github.pagehelper.PageInfo; |
|||
import com.github.pagehelper.page.PageMethod; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.*; |
|||
import java.util.concurrent.atomic.AtomicInteger; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 烟台话题信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-01-30 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class YtTopicServiceImpl extends BaseServiceImpl<YtTopicDao, YtTopicEntity> implements YtTopicService { |
|||
|
|||
@Resource |
|||
private YtTopicAttachmentDao ytTopicAttachmentDao; |
|||
@Resource |
|||
private YtTopicCommentDao ytTopicCommentDao; |
|||
@Resource |
|||
private YtTopicCommentAttachmentDao ytTopicCommentAttachmentDao; |
|||
@Resource |
|||
private YtTopicVoteDetailDao ytTopicVoteDetailDao; |
|||
|
|||
/** |
|||
* 发布话题 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:18 |
|||
*/ |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void createTopic(TokenDto tokenDto, CreateYtTopicFormDTO formDTO) { |
|||
if(StringUtils.isBlank(formDTO.getTopicContent()) && CollectionUtils.isEmpty(formDTO.getVoiceList())) { |
|||
//话题内容和语音不能同时为空
|
|||
log.error(ModuleConstant.TOPIC_CONTENT_AND_VOICE_IS_NULL); |
|||
throw new EpmetException(ModuleConstant.TOPIC_CONTENT_AND_VOICE_IS_NULL); |
|||
} |
|||
|
|||
//1.保存话题草稿
|
|||
if(formDTO.getTopicContent().length() > TopicConstant.MAX_NUMBER_OF_CONTENT){ |
|||
//内容超过最大限制
|
|||
log.error(ModuleConstant.TOPIC_CONTENT_NUMBER_OF_WORDS_EXCEEDED); |
|||
throw new EpmetException(ModuleConstant.TOPIC_CONTENT_NUMBER_OF_WORDS_EXCEEDED); |
|||
} |
|||
|
|||
YtTopicEntity topic = ConvertUtils.sourceToTarget(formDTO, YtTopicEntity.class); |
|||
//如果只有语音,则话题内容为语音话题
|
|||
if (CollectionUtils.isNotEmpty(formDTO.getVoiceList()) && StringUtils.isBlank(formDTO.getTopicContent())) { |
|||
topic.setTopicContent("语音话题"); |
|||
} |
|||
topic.setCustomerId(tokenDto.getCustomerId()); |
|||
topic.setStatus(TopicConstant.PUBLISHMENT); |
|||
baseDao.insert(topic); |
|||
|
|||
//保存图片附件
|
|||
if(CollectionUtils.isNotEmpty(formDTO.getImageList())){ |
|||
int sort = 0; |
|||
for(String url : formDTO.getImageList()){ |
|||
YtTopicAttachmentEntity attachment = new YtTopicAttachmentEntity(); |
|||
attachment.setCustomerId(formDTO.getCustomerId()); |
|||
attachment.setAttachmentUrl(url); |
|||
attachment.setTopicId(topic.getId()); |
|||
attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase()); |
|||
attachment.setSort(sort++); |
|||
attachment.setAttachmentType(TopicConstant.IMAGE); |
|||
ytTopicAttachmentDao.insert(attachment); |
|||
} |
|||
} |
|||
|
|||
//保存语音附件
|
|||
if(CollectionUtils.isNotEmpty(formDTO.getVoiceList())){ |
|||
int sort = 0; |
|||
for(FileDTO file : formDTO.getVoiceList()){ |
|||
YtTopicAttachmentEntity attachment = new YtTopicAttachmentEntity(); |
|||
attachment.setCustomerId(formDTO.getCustomerId()); |
|||
attachment.setAttachmentUrl(file.getUrl()); |
|||
attachment.setTopicId(topic.getId()); |
|||
attachment.setCreatedBy(tokenDto.getUserId()); |
|||
attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase()); |
|||
attachment.setSort(sort++); |
|||
attachment.setAttachmentType(TopicConstant.VOICE); |
|||
attachment.setDuration(file.getDuration()); |
|||
ytTopicAttachmentDao.insert(attachment); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
/** |
|||
* 话题详情 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link YtTopicDetailResultDTO} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:39 |
|||
*/ |
|||
@Override |
|||
public YtTopicDetailResultDTO getTopicDetail(TokenDto tokenDto, YtTopicDetailFormDTO formDTO) { |
|||
//1.查询话题信息
|
|||
YtTopicEntity entity = baseDao.selectById(formDTO.getTopicId()); |
|||
if(null == entity){ |
|||
log.error(ModuleConstant.NO_SUCH_TOPIC); |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), ModuleConstant.NO_SUCH_TOPIC, ModuleConstant.NO_SUCH_TOPIC); |
|||
} |
|||
YtTopicDetailResultDTO result = ConvertUtils.sourceToTarget(entity, YtTopicDetailResultDTO.class); |
|||
result.setTopicId(formDTO.getTopicId()); |
|||
result.setTopicStatus(entity.getStatus()); |
|||
result.setReleaseTime(DateUtils.format(entity.getCreatedTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); |
|||
result.setReleaseAddress(entity.getAddress()); |
|||
|
|||
//2.查询话题图片附件
|
|||
LambdaQueryWrapper<YtTopicAttachmentEntity> imgWrapper = new LambdaQueryWrapper<>(); |
|||
imgWrapper.eq(YtTopicAttachmentEntity::getTopicId, formDTO.getTopicId()); |
|||
imgWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.IMAGE); |
|||
imgWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); |
|||
List<YtTopicAttachmentEntity> imgList = ytTopicAttachmentDao.selectList(imgWrapper); |
|||
if (CollectionUtils.isNotEmpty(imgList)) { |
|||
List<String> imageUrls = imgList.stream().map(YtTopicAttachmentEntity::getAttachmentUrl).collect(Collectors.toList()); |
|||
result.setTopicImages(imageUrls); |
|||
} |
|||
|
|||
//3.查询话题音频附件
|
|||
LambdaQueryWrapper<YtTopicAttachmentEntity> voiceWrapper = new LambdaQueryWrapper<>(); |
|||
voiceWrapper.eq(YtTopicAttachmentEntity::getTopicId, formDTO.getTopicId()); |
|||
voiceWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.VOICE); |
|||
voiceWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); |
|||
List<YtTopicAttachmentEntity> voiceList = ytTopicAttachmentDao.selectList(voiceWrapper); |
|||
if (CollectionUtils.isNotEmpty(voiceList)) { |
|||
List<FileDTO> voiceUrls = voiceList.stream().map(item ->{ |
|||
FileDTO fileDTO = new FileDTO(); |
|||
fileDTO.setUrl(item.getAttachmentUrl()); |
|||
fileDTO.setDuration(item.getDuration()); |
|||
return fileDTO; |
|||
}).collect(Collectors.toList()); |
|||
result.setTopicVoices(voiceUrls); |
|||
} |
|||
|
|||
|
|||
//4.获取发布人信息
|
|||
ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(entity.getCreatedBy()); |
|||
if (null == userInfo) { |
|||
String msg = "获取发布人信息失败"; |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); |
|||
} |
|||
result.setReleaseUserName(userInfo.getShowName()); |
|||
result.setReleaseUserHeadPhoto(userInfo.getHeadImgUrl()); |
|||
//5.获取投票信息
|
|||
result.setOppositionCount(NumConstant.ZERO_STR); |
|||
result.setSupportCount(NumConstant.ZERO_STR); |
|||
LambdaQueryWrapper<YtTopicVoteDetailEntity> voteWrapper = new LambdaQueryWrapper<>(); |
|||
voteWrapper.eq(YtTopicVoteDetailEntity::getTopicId, formDTO.getTopicId()); |
|||
List<YtTopicVoteDetailEntity> voteList = ytTopicVoteDetailDao.selectList(voteWrapper); |
|||
if (CollectionUtils.isNotEmpty(voteList)) { |
|||
Map<String, Long> voteMap = voteList.stream().collect(Collectors.groupingBy(YtTopicVoteDetailEntity::getAttitude, Collectors.counting())); |
|||
if (voteMap.containsKey(TopicConstant.OPPOSITION)) { |
|||
result.setOppositionCount(String.valueOf(voteMap.get(TopicConstant.OPPOSITION))); |
|||
} |
|||
if (voteMap.containsKey(TopicConstant.SUPPORT)) { |
|||
result.setSupportCount(String.valueOf(voteMap.get(TopicConstant.SUPPORT))); |
|||
} |
|||
} |
|||
voteWrapper.eq(YtTopicVoteDetailEntity::getCreatedBy, tokenDto.getUserId()); |
|||
voteList = ytTopicVoteDetailDao.selectList(voteWrapper); |
|||
if (CollectionUtils.isNotEmpty(voteList)) { |
|||
result.setVoteStatus(voteList.get(NumConstant.ZERO).getAttitude()); |
|||
} else { |
|||
result.setVoteStatus(TopicConstant.NONE); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* 话题列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param topicPageFormDTO |
|||
* @Return {@link PageData<YtTopicInfoResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 16:56 |
|||
*/ |
|||
@Override |
|||
public PageData<YtTopicInfoResultDTO> getTopicList(TokenDto tokenDto, YtTopicPageFormDTO topicPageFormDTO) { |
|||
PageMethod.startPage(topicPageFormDTO.getPageNo(), topicPageFormDTO.getPageSize()); |
|||
List<YtTopicInfoResultDTO> list = baseDao.selectTopicList(topicPageFormDTO); |
|||
PageInfo<YtTopicInfoResultDTO> pageInfo = new PageInfo<>(list); |
|||
if (CollectionUtils.isNotEmpty(list)) { |
|||
list.forEach(item -> { |
|||
ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(item.getUserId()); |
|||
if (null != userInfo) { |
|||
item.setReleaseUserName(userInfo.getShowName()); |
|||
item.setReleaseUserHeadPhoto(userInfo.getHeadImgUrl()); |
|||
} |
|||
if (tokenDto.getUserId().equals(item.getUserId())) { |
|||
item.setReleaseUserFlag("me"); |
|||
} else { |
|||
item.setReleaseUserFlag("other"); |
|||
} |
|||
//获取附件图片
|
|||
LambdaQueryWrapper<YtTopicAttachmentEntity> imgWrapper = new LambdaQueryWrapper<>(); |
|||
imgWrapper.eq(YtTopicAttachmentEntity::getTopicId, item.getTopicId()); |
|||
imgWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.IMAGE); |
|||
imgWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); |
|||
imgWrapper.last("limit 3"); |
|||
List<YtTopicAttachmentEntity> imgList = ytTopicAttachmentDao.selectList(imgWrapper); |
|||
if (CollectionUtils.isNotEmpty(imgList)) { |
|||
List<String> imageUrls = imgList.stream().map(YtTopicAttachmentEntity::getAttachmentUrl).collect(Collectors.toList()); |
|||
item.setImageList(imageUrls); |
|||
} |
|||
}); |
|||
} |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
/** |
|||
* 话题详情评论列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link PageData<YtTopicCommentResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:02 |
|||
*/ |
|||
@Override |
|||
public PageData<YtTopicCommentResultDTO> getTopicCommentList(TokenDto tokenDto, YtTopicDetailFormDTO formDTO) { |
|||
PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
|||
List<YtTopicCommentResultDTO> list = ytTopicCommentDao.selectCommentList(formDTO); |
|||
PageInfo<YtTopicCommentResultDTO> pageInfo = new PageInfo<>(list); |
|||
if (CollectionUtils.isNotEmpty(list)) { |
|||
//获取评论附件信息
|
|||
LambdaQueryWrapper<YtTopicCommentAttachmentEntity> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(YtTopicCommentAttachmentEntity::getTopicId, formDTO.getTopicId()); |
|||
List<YtTopicCommentAttachmentEntity> attachmentList = ytTopicCommentAttachmentDao.selectList(wrapper); |
|||
Map<String, List<YtTopicCommentAttachmentEntity>> map = new HashMap<>(); |
|||
if (CollectionUtils.isNotEmpty(attachmentList)) { |
|||
map = attachmentList.stream().sorted(Comparator.comparingInt(YtTopicCommentAttachmentEntity::getSort)) |
|||
.collect(Collectors.groupingBy(YtTopicCommentAttachmentEntity::getTopicCommentId, LinkedHashMap::new, Collectors.toList())); |
|||
} |
|||
Map<String, List<YtTopicCommentAttachmentEntity>> finalMap = map; |
|||
list.forEach(item -> { |
|||
ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(item.getUserId()); |
|||
if (null != userInfo) { |
|||
item.setCommentUserName(userInfo.getShowName()); |
|||
item.setCommentUserHeadPhoto(userInfo.getHeadImgUrl()); |
|||
} |
|||
if (finalMap.containsKey(item.getCommentId())) { |
|||
List<CommentFileDTO> fileList = finalMap.get(item.getCommentId()).stream().map(i -> { |
|||
CommentFileDTO file = new CommentFileDTO(); |
|||
file.setName(i.getAttachmentName()); |
|||
file.setUrl(i.getAttachmentUrl()); |
|||
file.setDuration(i.getDuration()); |
|||
file.setSize(i.getAttachmentSize()); |
|||
file.setFormat(i.getAttachmentFormat()); |
|||
file.setType(i.getAttachmentType()); |
|||
return file; |
|||
}).collect(Collectors.toList()); |
|||
item.setImageList(fileList); |
|||
} |
|||
}); |
|||
} |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
/** |
|||
* 评论话题 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:05 |
|||
*/ |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void topicComment(TokenDto tokenDto, YtTopicCommentFormDTO formDTO) { |
|||
YtTopicCommentEntity comment = ConvertUtils.sourceToTarget(formDTO, YtTopicCommentEntity.class); |
|||
comment.setStatus(TopicConstant.PUBLISHMENT); |
|||
comment.setCustomerId(tokenDto.getCustomerId()); |
|||
ytTopicCommentDao.insert(comment); |
|||
//保存评论附件
|
|||
//图片
|
|||
if (CollectionUtils.isNotEmpty(formDTO.getImageList())) { |
|||
AtomicInteger sort = new AtomicInteger(); |
|||
formDTO.getImageList().forEach(img -> { |
|||
YtTopicCommentAttachmentEntity attachment = new YtTopicCommentAttachmentEntity(); |
|||
attachment.setCustomerId(tokenDto.getCustomerId()); |
|||
attachment.setTopicId(formDTO.getTopicId()); |
|||
attachment.setTopicCommentId(comment.getId()); |
|||
attachment.setFileName(img.getName()); |
|||
attachment.setAttachmentName(""); |
|||
attachment.setAttachmentSize(img.getSize()); |
|||
attachment.setAttachmentFormat(img.getFormat()); |
|||
attachment.setAttachmentType(img.getType()); |
|||
attachment.setAttachmentUrl(img.getUrl()); |
|||
attachment.setSort(sort.get()); |
|||
attachment.setDuration(img.getDuration()); |
|||
sort.getAndIncrement(); |
|||
ytTopicCommentAttachmentDao.insert(attachment); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 话题投票 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/1/30 17:08 |
|||
*/ |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void topicVote(TokenDto tokenDto, YtTopicVoteFormDTO formDTO) { |
|||
YtTopicVoteDetailEntity entity = ConvertUtils.sourceToTarget(formDTO, YtTopicVoteDetailEntity.class); |
|||
entity.setCustomerId(tokenDto.getCustomerId()); |
|||
ytTopicVoteDetailDao.insert(entity); |
|||
} |
|||
} |
@ -0,0 +1,92 @@ |
|||
CREATE TABLE `yt_topic` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', |
|||
`GRID_ID` varchar(64) DEFAULT NULL COMMENT '网格ID', |
|||
`TOPIC_CONTENT` text COMMENT '话题内容', |
|||
`STATUS` varchar(32) NOT NULL COMMENT '话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed)', |
|||
`CLOSED_STATUS` varchar(32) DEFAULT NULL COMMENT '关闭状态:已解决 resolved,未解决 unresolved', |
|||
`PROVINCE` varchar(32) DEFAULT NULL COMMENT '省', |
|||
`CITY` varchar(32) DEFAULT NULL COMMENT '市', |
|||
`AREA` varchar(32) DEFAULT NULL COMMENT '区 ', |
|||
`ADDRESS` varchar(255) NOT NULL COMMENT '地址', |
|||
`LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度', |
|||
`LATITUDE` varchar(32) DEFAULT NULL COMMENT '维度', |
|||
`LOCATE_ADDRESS` varchar(255) DEFAULT NULL COMMENT '定位地址', |
|||
`LOCATE_LONGITUDE` varchar(32) DEFAULT NULL COMMENT '定位经度', |
|||
`LOCATE_LATITUDE` varchar(32) DEFAULT NULL COMMENT '定位维度', |
|||
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人,发布人Id来源于user', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题信息表'; |
|||
CREATE TABLE `yt_topic_attachment` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', |
|||
`TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id,关联resi_topic的id', |
|||
`ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', |
|||
`ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', |
|||
`ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', |
|||
`ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', |
|||
`SORT` int(1) NOT NULL COMMENT '排序字段', |
|||
`DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', |
|||
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', |
|||
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE, |
|||
KEY `idx_topic_id` (`TOPIC_ID`) USING BTREE COMMENT '话题主键' |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题附件表'; |
|||
CREATE TABLE `yt_topic_comment` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', |
|||
`TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id,来自resi_topic', |
|||
`COMMENT_CONTENT` varchar(300) DEFAULT NULL, |
|||
`STATUS` varchar(32) DEFAULT NULL COMMENT '评论状态:讨论中:discussing;已屏蔽 :hidden', |
|||
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', |
|||
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人,评论人Id,来自user', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题评论表'; |
|||
CREATE TABLE `yt_topic_comment_attachment` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', |
|||
`TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id', |
|||
`TOPIC_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', |
|||
`FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', |
|||
`ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', |
|||
`ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', |
|||
`ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', |
|||
`ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', |
|||
`ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', |
|||
`SORT` int(1) NOT NULL COMMENT '排序字段', |
|||
`DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', |
|||
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题评论附件表'; |
|||
CREATE TABLE `yt_topic_vote_detail` ( |
|||
`ID` varchar(32) NOT NULL COMMENT '主键ID', |
|||
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', |
|||
`TOPIC_ID` varchar(32) NOT NULL COMMENT '话题ID', |
|||
`ATTITUDE` varchar(32) NOT NULL COMMENT '态度 - opposition(反对)support(赞成)', |
|||
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', |
|||
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`), |
|||
KEY `idx_topic_id` (`TOPIC_ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题表决记录表'; |
@ -0,0 +1,7 @@ |
|||
<?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.epmet.modules.topic.dao.YtTopicAttachmentDao"> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,7 @@ |
|||
<?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.epmet.modules.topic.dao.YtTopicCommentAttachmentDao"> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
<?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.epmet.modules.topic.dao.YtTopicCommentDao"> |
|||
<select id="selectCommentList" resultType="com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO"> |
|||
SELECT ID AS commentId, |
|||
COMMENT_CONTENT, |
|||
STATUS AS commentStatus, |
|||
CREATED_BY AS userId, |
|||
CREATED_TIME AS commentTime |
|||
FROM yt_topic_comment |
|||
WHERE DEL_FLAG = '0' |
|||
AND TOPIC_ID = #{topicId} |
|||
ORDER BY CREATED_TIME DESC |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,19 @@ |
|||
<?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.epmet.modules.topic.dao.YtTopicDao"> |
|||
<select id="selectTopicList" resultType = "com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO"> |
|||
SELECT |
|||
ID AS topicId, |
|||
TOPIC_CONTENT, |
|||
STATUS, |
|||
CREATED_BY AS userId, |
|||
CREATED_TIME AS releaseTime |
|||
FROM |
|||
yt_topic |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND GRID_ID = #{gridId} |
|||
ORDER BY CREATED_TIME DESC |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,8 @@ |
|||
<?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.epmet.modules.topic.dao.YtTopicVoteDetailDao"> |
|||
|
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue