线上课程
This commit is contained in:
parent
6c6d42972a
commit
19832906cd
|
|
@ -1,15 +1,14 @@
|
|||
package com.ruoyi.front.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.front.domain.OnlineCoursesEvaluate;
|
||||
|
|
@ -123,4 +122,28 @@ public class OnlineCoursesEvaluateController extends BaseController
|
|||
{
|
||||
return toAjax(onlineCoursesEvaluateService.deleteOnlineCoursesEvaluateByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 评论批量审核
|
||||
*/
|
||||
@GetMapping("/audit")
|
||||
public String audit(@RequestParam String ids, ModelMap mmap)
|
||||
{
|
||||
mmap.put("ids", ids);
|
||||
return prefix + "/audit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论批量审核
|
||||
*/
|
||||
@PostMapping("/audit")
|
||||
@ResponseBody
|
||||
public AjaxResult audit(@RequestParam() String ids, @RequestParam String auditStatus,@RequestParam String remark)
|
||||
{
|
||||
// 未审核通过,则备注不能为空
|
||||
if (StringUtils.isEmpty(remark) && auditStatus.equals(Constants.NO_PASS_AUDIT)) {
|
||||
return error("备注不能为空");
|
||||
}
|
||||
return toAjax(onlineCoursesEvaluateService.audit(ids, auditStatus,remark));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ public class OnlineCoursesEvaluate extends BaseEntity
|
|||
.append("auditStatus", getAuditStatus())
|
||||
.append("checkBy", getCheckBy())
|
||||
.append("checkTime", getCheckTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.front.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.front.domain.OnlineCoursesEvaluate;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 线上课程评价Mapper接口
|
||||
|
|
@ -58,4 +59,12 @@ public interface OnlineCoursesEvaluateMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteOnlineCoursesEvaluateByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 审核评论
|
||||
* @param ids
|
||||
* @param auditStatus
|
||||
* @return
|
||||
*/
|
||||
public int auditOnlineCoursesEvaluateByIds(@Param("ids") String[] ids, @Param("auditStatus")String auditStatus, @Param("checkBy")String checkBy,@Param("remark")String remark);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.front.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.front.domain.OnlineCoursesEvaluate;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 线上课程评价Service接口
|
||||
|
|
@ -58,4 +59,11 @@ public interface IOnlineCoursesEvaluateService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteOnlineCoursesEvaluateById(Long id);
|
||||
/**
|
||||
* 审核评论
|
||||
* @param ids
|
||||
* @param auditStatus
|
||||
* @return
|
||||
*/
|
||||
public int audit(String ids, String auditStatus, String remark);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.front.service.impl;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.front.mapper.OnlineCoursesEvaluateMapper;
|
||||
|
|
@ -94,4 +96,17 @@ public class OnlineCoursesEvaluateServiceImpl implements IOnlineCoursesEvaluateS
|
|||
{
|
||||
return onlineCoursesEvaluateMapper.deleteOnlineCoursesEvaluateById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论批量审核
|
||||
* @param ids IDs
|
||||
* @param auditStatus 审核状态
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int audit(String ids, String auditStatus, String remark)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
return onlineCoursesEvaluateMapper.auditOnlineCoursesEvaluateByIds(Convert.toStrArray(ids), auditStatus, user.getUserId().toString(),remark);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,27 +17,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="auditStatus" column="audit_status" />
|
||||
<result property="checkBy" column="check_by" />
|
||||
<result property="checkTime" column="check_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOnlineCoursesEvaluateVo">
|
||||
select id, online_courses_id, evaluate_content, anonymous_flag, del_flag, create_by, create_time, update_by, update_time, audit_status, check_by, check_time from online_courses_evaluate
|
||||
select ce.id, ce.online_courses_id, ce.evaluate_content, ce.anonymous_flag, ce.create_by, ce.create_time, ce.update_by, ce.update_time, ce.audit_status, su.login_name check_by, ce.remark,ce.check_time from online_courses_evaluate ce left join sys_user su on ce.check_by=su.user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectOnlineCoursesEvaluateList" parameterType="OnlineCoursesEvaluate" resultMap="OnlineCoursesEvaluateResult">
|
||||
<include refid="selectOnlineCoursesEvaluateVo"/>
|
||||
<where>
|
||||
<if test="onlineCoursesId != null "> and online_courses_id = #{onlineCoursesId}</if>
|
||||
<if test="evaluateContent != null and evaluateContent != ''"> and evaluate_content = #{evaluateContent}</if>
|
||||
<if test="anonymousFlag != null and anonymousFlag != ''"> and anonymous_flag = #{anonymousFlag}</if>
|
||||
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
|
||||
<if test="checkBy != null and checkBy != ''"> and check_by = #{checkBy}</if>
|
||||
<if test="checkTime != null "> and check_time = #{checkTime}</if>
|
||||
<if test="onlineCoursesId != null "> and ce.online_courses_id = #{onlineCoursesId}</if>
|
||||
<if test="evaluateContent != null and evaluateContent != ''"> and ce.evaluate_content = #{evaluateContent}</if>
|
||||
<if test="anonymousFlag != null and anonymousFlag != ''"> and ce.anonymous_flag = #{anonymousFlag}</if>
|
||||
<if test="auditStatus != null and auditStatus != ''"> and ce.audit_status = #{auditStatus}</if>
|
||||
<if test="checkBy != null and checkBy != ''"> and su.login_name = #{checkBy}</if>
|
||||
<if test="checkTime != null "> and ce.check_time = #{checkTime}</if>
|
||||
and ce.del_flag='0'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOnlineCoursesEvaluateById" parameterType="Long" resultMap="OnlineCoursesEvaluateResult">
|
||||
<include refid="selectOnlineCoursesEvaluateVo"/>
|
||||
where id = #{id}
|
||||
where ce.id = #{id} and ce.del_flag='0'
|
||||
</select>
|
||||
|
||||
<insert id="insertOnlineCoursesEvaluate" parameterType="OnlineCoursesEvaluate" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
@ -89,14 +91,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<delete id="deleteOnlineCoursesEvaluateById" parameterType="Long">
|
||||
delete from online_courses_evaluate where id = #{id}
|
||||
update online_courses_evaluate set del_flag='1' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOnlineCoursesEvaluateByIds" parameterType="String">
|
||||
delete from online_courses_evaluate where id in
|
||||
update online_courses_evaluate set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="auditOnlineCoursesEvaluateByIds">
|
||||
update online_courses_evaluate
|
||||
set check_by = #{checkBy},
|
||||
remark = #{remark},
|
||||
check_time = now(),
|
||||
audit_status = #{auditStatus}
|
||||
where id in
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -101,8 +101,7 @@
|
|||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID',
|
||||
visible: false
|
||||
title: 'ID'
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('审核评论')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
<th:block th:include="include :: summernote-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-organization-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">审核状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="ids" name="ids" th:value="${ids}">
|
||||
<select name="auditStatus" th:with="type=${@dict.getType('audit_status')}" class="col-sm-8">
|
||||
<!-- 审核状态不等于0的才显示 -->
|
||||
<th:block th:each="dict : ${type}">
|
||||
<th:block th:if="${dict.dictValue ne '0'}">
|
||||
<!-- 默认显示审核通过 -->
|
||||
<option th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue eq '2'}"/>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" rows="5" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: summernote-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "front/evaluate"
|
||||
$("#form-organization-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/audit", $('#form-organization-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -19,12 +19,26 @@
|
|||
<!--<input type="text" name="anonymousFlag"/>-->
|
||||
<!--</li>-->
|
||||
<li>
|
||||
<label>审核状态:</label>
|
||||
<select name="auditStatus" th:with="type=${@dict.getType('audit_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<!--<li>
|
||||
<label>状态:</label>
|
||||
<select name="delFlag" th:with="type=${@dict.getType('sys_normal_disable')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>-->
|
||||
<!--<li>
|
||||
<label>状态:</label>
|
||||
<select name="auditStatus">
|
||||
<option value="">所有</option>
|
||||
<option value="-1">代码生成请选择字典属性</option>
|
||||
</select>
|
||||
</li>
|
||||
</li>-->
|
||||
<li>
|
||||
<label>审核者:</label>
|
||||
<input type="text" name="checkBy"/>
|
||||
|
|
@ -45,18 +59,21 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="front:evaluate:add">
|
||||
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="front:evaluate:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="front:evaluate:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>-->
|
||||
<a class="btn btn-primary multiple disabled" onclick="$.operate.auditAll()" shiro:hasPermission="front:evaluate:edit">
|
||||
<i class="fa fa-edit"></i> 审核
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="front:evaluate:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="front:evaluate:export">
|
||||
<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="front:evaluate:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</a>-->
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
|
|
@ -67,15 +84,17 @@
|
|||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('front:evaluate:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('front:evaluate:remove')}]];
|
||||
var auditStatus = [[${@dict.getType('audit_status')}]];
|
||||
var prefix = ctx + "front/evaluate";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
// createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
auditUrl: prefix + "/audit",
|
||||
// exportUrl: prefix + "/export",
|
||||
modalName: "线上课程评价",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
|
|
@ -99,7 +118,14 @@
|
|||
},
|
||||
{
|
||||
field: 'auditStatus',
|
||||
title: '状态'
|
||||
title: '审核状态',
|
||||
formatter: function(value, item, index) {
|
||||
return $.table.selectDictLabel(auditStatus, item.auditStatus);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
},
|
||||
{
|
||||
field: 'checkBy',
|
||||
|
|
@ -114,7 +140,7 @@
|
|||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@
|
|||
<div class="summernote" id="content"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<!--<div class="form-group">
|
||||
<label class="col-sm-3 control-label">点击量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="hits" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态:</label>
|
||||
<div class="col-sm-8">
|
||||
|
|
@ -42,12 +42,12 @@
|
|||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<!--<div class="form-group">
|
||||
<label class="col-sm-3 control-label">删除标志:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="delFlag" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue