Commit 3153e911 authored by yuwenwen's avatar yuwenwen

解决冲突

parents 40bad449 aade6923
...@@ -95,8 +95,8 @@ spring: ...@@ -95,8 +95,8 @@ spring:
# 企业微信配置 # 企业微信配置
wx: wx:
cp: cp:
pc-redirect-url: https://wecom.jift.edu.cn/bbs/pc/wechatlogin pc-redirect-url: https://forum.jift.edu.cn/wechatlogin
mobile-redirect-url: https://wecom.jift.edu.cn/bbs/h5/pages/login/login mobile-redirect-url: https://forum.jift.edu.cn/h5/pages/login/login
corp-id: wxd2a84aa7529d3801 corp-id: wxd2a84aa7529d3801
app-configs: app-configs:
- name: '移动端应用配置' - name: '移动端应用配置'
......
...@@ -5,4 +5,4 @@ VUE_APP_TITLE = 一站式江服社区 ...@@ -5,4 +5,4 @@ VUE_APP_TITLE = 一站式江服社区
ENV = 'production' ENV = 'production'
# 若依管理系统/生产环境 # 若依管理系统/生产环境
VUE_APP_BASE_API = '/bbs/prod-api' VUE_APP_BASE_API = '/prod-api'
...@@ -182,7 +182,7 @@ Router.prototype.replace = function push(location) { ...@@ -182,7 +182,7 @@ Router.prototype.replace = function push(location) {
} }
export default new Router({ export default new Router({
base:'/bbs/pc', base:'/',
mode: 'history', // 去掉url中的# mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes
......
...@@ -11,18 +11,21 @@ ...@@ -11,18 +11,21 @@
<el-form-item label="账号"> <el-form-item label="账号">
<el-input v-model="queryParams.userName" placeholder="请输入"></el-input> <el-input v-model="queryParams.userName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="动态编号">
<el-input v-model="queryParams.momentId" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button> <el-button type="primary" @click="handleQuery">查询</el-button>
<el-button @click="handleReset">重置</el-button> <el-button @click="handleReset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row class="mb10"> <el-row class="mb10">
<el-button type="primary" @click="handleExport">导出</el-button>
</el-row> </el-row>
<el-table :data="tableList"> <el-table :data="tableList">
<el-table-column label="序号" width="55" type="index" align="center"></el-table-column>
<el-table-column label="评论内容" prop="content" align="center"></el-table-column> <el-table-column label="评论内容" prop="content" align="center"></el-table-column>
<el-table-column label="所属动态" prop="momentContent" align="center"></el-table-column> <el-table-column label="动态编号" align="center" prop="momentId" width="100"></el-table-column>
<el-table-column label="动态内容" prop="momentContent" align="center"></el-table-column>
<el-table-column label="账号" prop="userName" align="center"></el-table-column> <el-table-column label="账号" prop="userName" align="center"></el-table-column>
<el-table-column label="姓名" prop="nickName" align="center"></el-table-column> <el-table-column label="姓名" prop="nickName" align="center"></el-table-column>
<el-table-column label="创建时间" prop="createTime" align="center"></el-table-column> <el-table-column label="创建时间" prop="createTime" align="center"></el-table-column>
...@@ -94,6 +97,11 @@ export default { ...@@ -94,6 +97,11 @@ export default {
} }
this.getList() this.getList()
}, },
handleExport() {
this.download('bbs/moment/comment/list/export', {
...this.queryParams
}, `动态评论_${new Date().getTime()}.xlsx`)
},
// 置顶/取消置顶 // 置顶/取消置顶
handleTop(row, isTop) { handleTop(row, isTop) {
let text = isTop == '0' ? '取消置顶' : '置顶' let text = isTop == '0' ? '取消置顶' : '置顶'
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<el-button type="primary" @click="handleExport">导出</el-button> <el-button type="primary" @click="handleExport">导出</el-button>
</el-row> </el-row>
<el-table :data="tableList"> <el-table :data="tableList">
<el-table-column label="序号" width="55" type="index" align="center"></el-table-column> <el-table-column label="动态编号" align="center" prop="id" width="100"></el-table-column>
<el-table-column label="动态内容" prop="content" align="center"> <el-table-column label="动态内容" prop="content" align="center">
<template #default="{ row }"> <template #default="{ row }">
<div v-html="formatContent(row.content)" class="content-container"></div> <div v-html="formatContent(row.content)" class="content-container"></div>
......
...@@ -18,7 +18,7 @@ module.exports = { ...@@ -18,7 +18,7 @@ module.exports = {
// 部署生产环境和开发环境下的URL。 // 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/bbs/pc" : "/", publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist', outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
"h5" : { "h5" : {
"router" : { "router" : {
"mode" : "history", "mode" : "history",
"base" : "/bbs/h5/" "base" : "/h5/"
} }
} }
} }
...@@ -74,6 +74,18 @@ public class SysDept extends BaseEntity { ...@@ -74,6 +74,18 @@ public class SysDept extends BaseEntity {
*/ */
private String parentName; private String parentName;
private String deptType;
public String getDeptType() {
return deptType;
}
public void setDeptType(String deptType) {
this.deptType = deptType;
}
/** /**
* 子部门 * 子部门
*/ */
......
...@@ -5,6 +5,8 @@ import com.tangguo.common.core.controller.BaseController; ...@@ -5,6 +5,8 @@ import com.tangguo.common.core.controller.BaseController;
import com.tangguo.common.core.domain.AjaxResult; import com.tangguo.common.core.domain.AjaxResult;
import com.tangguo.common.core.page.TableDataInfo; import com.tangguo.common.core.page.TableDataInfo;
import com.tangguo.common.enums.BusinessType; import com.tangguo.common.enums.BusinessType;
import com.tangguo.common.utils.poi.ExcelUtil;
import com.tangguo.domain.BbsMoment;
import com.tangguo.domain.BbsMomentComment; import com.tangguo.domain.BbsMomentComment;
import com.tangguo.domain.bo.BbsCommentTopBO; import com.tangguo.domain.bo.BbsCommentTopBO;
import com.tangguo.service.IBbsMomentCommentService; import com.tangguo.service.IBbsMomentCommentService;
...@@ -15,6 +17,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -15,6 +17,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -45,6 +48,20 @@ public class BbsMomentCommentController extends BaseController { ...@@ -45,6 +48,20 @@ public class BbsMomentCommentController extends BaseController {
} }
/**
* 导出动态列表
*/
@ApiOperation("导出动态评论列表")
@PreAuthorize("@ss.hasPermi('bbs:moment:export')")
@Log(title = "导出动态评论列表", businessType = BusinessType.EXPORT)
@PostMapping("/list/export")
public void export(HttpServletResponse response, BbsMomentComment comment) {
List<BbsMomentComment> list = bbsMomentCommentService.selectBbsMomentCommentList(comment);
ExcelUtil<BbsMomentComment> util = new ExcelUtil<>(BbsMomentComment.class);
util.exportExcel(response, list, "动态评论数据");
}
/** /**
* 获取动态评论记录详细信息 * 获取动态评论记录详细信息
*/ */
......
...@@ -37,17 +37,17 @@ public class BbsMomentComment extends BaseEntity { ...@@ -37,17 +37,17 @@ public class BbsMomentComment extends BaseEntity {
private Long id; private Long id;
/** 轻享内容ID */ /** 轻享内容ID */
@Excel(name = "轻享内容ID") @Excel(name = "动态编号")
@ApiModelProperty("轻享内容ID") @ApiModelProperty("轻享内容ID")
private Long momentId; private Long momentId;
/** 评论用户姓名 */ /** 评论用户姓名 */
@Excel(name = "评论用户姓名") @Excel(name = "用户姓名")
@ApiModelProperty("评论用户姓名") @ApiModelProperty("评论用户姓名")
private String nickName; private String nickName;
/** 评论用户名 */ /** 评论用户名 */
@Excel(name = "评论用户名") @Excel(name = "用户名")
@ApiModelProperty("评论用户名") @ApiModelProperty("评论用户名")
private String userName; private String userName;
...@@ -57,37 +57,30 @@ public class BbsMomentComment extends BaseEntity { ...@@ -57,37 +57,30 @@ public class BbsMomentComment extends BaseEntity {
private String content; private String content;
/** 评论图片地址(1-3张) */ /** 评论图片地址(1-3张) */
@Excel(name = "评论图片地址", readConverterExp = "1=-3张")
@ApiModelProperty("评论图片地址(1-3张)") @ApiModelProperty("评论图片地址(1-3张)")
private String imgsUrl; private String imgsUrl;
/** 评论状态:0 删除、1 正常 */ /** 评论状态:0 删除、1 正常 */
@Excel(name = "评论状态:0 删除、1 正常")
@ApiModelProperty("评论状态:0 删除、1 正常、2 隐藏") @ApiModelProperty("评论状态:0 删除、1 正常、2 隐藏")
private Integer status; private Integer status;
/** 评论是否精选:0 否、1 是 */ /** 评论是否精选:0 否、1 是 */
@Excel(name = "评论是否精选:0 否、1 是")
@ApiModelProperty("评论是否精选:0 否、1 是") @ApiModelProperty("评论是否精选:0 否、1 是")
private Integer isFeatured; private Integer isFeatured;
/** 父级评论ID(为空为评论,否则为回复。) */ /** 父级评论ID(为空为评论,否则为回复。) */
@Excel(name = "父级评论ID", readConverterExp = "为=空为评论,否则为回复。")
@ApiModelProperty("父级评论ID(为空为评论,否则为回复。)") @ApiModelProperty("父级评论ID(为空为评论,否则为回复。)")
private Long parentId; private Long parentId;
/** 回复的用户姓名 */ /** 回复的用户姓名 */
@Excel(name = "回复的用户姓名")
@ApiModelProperty("回复的用户姓名") @ApiModelProperty("回复的用户姓名")
private String replyNickName; private String replyNickName;
/** 评论祖级路径(逗号分隔) */ /** 评论祖级路径(逗号分隔) */
@Excel(name = "评论祖级路径", readConverterExp = "逗=号分隔")
@ApiModelProperty("评论祖级路径(逗号分隔)") @ApiModelProperty("评论祖级路径(逗号分隔)")
private String ancestorPath; private String ancestorPath;
/** 删除评论内容 */ /** 删除评论内容 */
@Excel(name = "删除评论内容")
@ApiModelProperty("删除评论内容") @ApiModelProperty("删除评论内容")
private String deleteComment; private String deleteComment;
...@@ -102,6 +95,7 @@ public class BbsMomentComment extends BaseEntity { ...@@ -102,6 +95,7 @@ public class BbsMomentComment extends BaseEntity {
/** /**
* 动态内容 * 动态内容
*/ */
@Excel(name = "动态内容")
@TableField(exist = false) @TableField(exist = false)
private String momentContent; private String momentContent;
......
...@@ -42,4 +42,10 @@ public class BbsCommentDetailVO { ...@@ -42,4 +42,10 @@ public class BbsCommentDetailVO {
/** 评论是否精选:0 否、1 是 */ /** 评论是否精选:0 否、1 是 */
private Integer isFeatured; private Integer isFeatured;
/** 评论是否置顶:0 否、1 是 */
private Integer isTop;
/** 动态选项编码 */
private String voteOptionCode;
} }
...@@ -33,4 +33,7 @@ public class BbsCommentVO { ...@@ -33,4 +33,7 @@ public class BbsCommentVO {
/** 是否本人评论:0 否、1 是 */ /** 是否本人评论:0 否、1 是 */
private Integer isSelf; private Integer isSelf;
/** 是否置顶:0 否、1 是 */
private Integer isTop;
} }
package com.tangguo.mapper; package com.tangguo.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tangguo.common.core.domain.entity.SysDept;
import com.tangguo.domain.BbsMoment; import com.tangguo.domain.BbsMoment;
import com.tangguo.domain.bo.QueryMomentBO; import com.tangguo.domain.bo.QueryMomentBO;
import com.tangguo.domain.vo.BbsMomentListVO; import com.tangguo.domain.vo.BbsMomentListVO;
...@@ -20,7 +19,7 @@ public interface BbsMomentMapper extends BaseMapper<BbsMoment> { ...@@ -20,7 +19,7 @@ public interface BbsMomentMapper extends BaseMapper<BbsMoment> {
List<BbsMoment> selectBbsMomentList(@Param("moment") BbsMoment moment); List<BbsMoment> selectBbsMomentList(@Param("moment") BbsMoment moment);
List<String> selectBbsMomentDepts(@Param("deptIds") String[] deptIds); String selectBbsMomentDept(@Param("deptIds") String[] deptIds);
BbsUserMomentCountVO selectUserMomentCount(@Param("userName") String userName); BbsUserMomentCountVO selectUserMomentCount(@Param("userName") String userName);
......
...@@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil; ...@@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.dfa.FoundWord; import cn.hutool.dfa.FoundWord;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tangguo.common.core.domain.entity.SysDept;
import com.tangguo.common.core.domain.entity.SysUser; import com.tangguo.common.core.domain.entity.SysUser;
import com.tangguo.common.enums.*; import com.tangguo.common.enums.*;
import com.tangguo.common.exception.ServiceException; import com.tangguo.common.exception.ServiceException;
...@@ -82,9 +81,7 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment ...@@ -82,9 +81,7 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment
String[] deptIds = dbMoment.getAncestors().split(","); String[] deptIds = dbMoment.getAncestors().split(",");
if (ArrayUtil.isNotEmpty(deptIds)) { if (ArrayUtil.isNotEmpty(deptIds)) {
List<String> deptNames = this.baseMapper.selectBbsMomentDepts(deptIds); String deptName = this.baseMapper.selectBbsMomentDept(deptIds);
String deptName = deptNames.stream().filter(s -> s.contains("学院"))
.reduce((first, second) -> second).orElse(null);
dbMoment.setFullDeptName(deptName); dbMoment.setFullDeptName(deptName);
} }
} }
...@@ -355,6 +352,13 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment ...@@ -355,6 +352,13 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment
throw new ServiceException("评论失败,当前动态未开启评论。"); throw new ServiceException("评论失败,当前动态未开启评论。");
} }
if (EnableStatus.QY.getStatus() == dbMoment.getIsEnableVote()) {
long voteCount = this.voteService.getUserMomentVoteCount(dbMoment.getId(), SecurityUtils.getUsername());
if (voteCount < 1) {
throw new ServiceException("评论失败,请先对当前动态进行投票。");
}
}
// 检查评论内容 // 检查评论内容
String content = bo.getContent(); String content = bo.getContent();
FoundWord fw = SensitiveWordUtils.getFoundFirstSensitive(content); FoundWord fw = SensitiveWordUtils.getFoundFirstSensitive(content);
...@@ -674,6 +678,7 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment ...@@ -674,6 +678,7 @@ public class BbsMomentServiceImpl extends ServiceImpl<BbsMomentMapper, BbsMoment
cv.setUserName(c.getUserName()); cv.setUserName(c.getUserName());
cv.setContent(c.getContent()); cv.setContent(c.getContent());
cv.setIsSelf(c.getIsSelf()); cv.setIsSelf(c.getIsSelf());
cv.setIsTop(c.getIsTop());
cvs.add(cv); cvs.add(cv);
} }
moment.setComments(cvs); moment.setComments(cvs);
......
...@@ -25,6 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -25,6 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="comment.userName != null and comment.userName != ''"> <if test="comment.userName != null and comment.userName != ''">
AND c.user_name LIKE CONCAT('%', #{comment.userName}, '%') AND c.user_name LIKE CONCAT('%', #{comment.userName}, '%')
</if> </if>
<if test="comment.momentId != null">
AND c.moment_id = #{comment.momentId}
</if>
</where> </where>
ORDER BY ORDER BY
c.is_top DESC, c.top_time DESC, c.create_time DESC c.is_top DESC, c.top_time DESC, c.create_time DESC
...@@ -68,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -68,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.content, c.content,
c.parent_id, c.parent_id,
c.reply_nick_name, c.reply_nick_name,
c.is_top,
IF(c.user_name = #{userName}, 1, 0) AS is_self, IF(c.user_name = #{userName}, 1, 0) AS is_self,
ROW_NUMBER() OVER (PARTITION BY moment_id ORDER BY create_time) AS rn ROW_NUMBER() OVER (PARTITION BY moment_id ORDER BY create_time) AS rn
FROM FROM
...@@ -112,11 +116,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -112,11 +116,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.parent_id, c.parent_id,
c.reply_nick_name, c.reply_nick_name,
c.is_featured, c.is_featured,
c.is_top,
v.option_code AS vote_option_code,
IF(c.user_name = #{userName}, 1, 0) AS is_self IF(c.user_name = #{userName}, 1, 0) AS is_self
FROM FROM
bbs_moment_comment c bbs_moment_comment c
INNER JOIN INNER JOIN
bbs_moment m ON m.id = c.moment_id bbs_moment m ON m.id = c.moment_id
LEFT JOIN
(SELECT * FROM bbs_moment_vote WHERE user_name = #{userName}) v ON v.moment_id = m.id
WHERE WHERE
m.id = #{momentId} m.id = #{momentId}
AND AND
......
...@@ -44,16 +44,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -44,16 +44,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectBbsMomentDepts" resultType="java.lang.String"> <select id="selectBbsMomentDept" resultType="java.lang.String">
SELECT SELECT
dept_name dept_name
FROM FROM
sys_dept sys_dept
WHERE WHERE
dept_type = '3'
AND
dept_id IN dept_id IN
<foreach collection="deptIds" item="deptId" open="(" separator="," close=")"> <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
#{deptId} #{deptId}
</foreach> </foreach>
LIMIT 1
</select> </select>
......
...@@ -191,10 +191,10 @@ ...@@ -191,10 +191,10 @@
<update id="syncQwmhSysDeptToLocal"> <update id="syncQwmhSysDeptToLocal">
INSERT INTO sys_dept(dept_id, parent_id, ancestors, dept_name, order_num, create_time) INSERT INTO sys_dept(dept_id, parent_id, ancestors, dept_name, order_num, create_time, dept_type)
( (
SELECT SELECT
q.id, q.parent_id, q.ancestors, q.dept_name, q.order_num, q.create_time q.id, q.parent_id, q.ancestors, q.dept_name, q.order_num, q.create_time, q.dept_type
FROM FROM
ods_sys_dept_view q ods_sys_dept_view q
LEFT JOIN LEFT JOIN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment