parent
36b3e5f652
commit
b9d259eb4a
@ -0,0 +1,79 @@
|
|||||||
|
package com.ruoyi.web.controller.manager;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import com.ruoyi.common.utils.ShiroUtils;
|
||||||
|
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||||
|
import com.ruoyi.system.domain.SysCaseReport;
|
||||||
|
import com.ruoyi.system.domain.SysColumn;
|
||||||
|
import com.ruoyi.system.service.SysCaseReportService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: CaseReportManager
|
||||||
|
* Package: com.ruoyi.web.controller.manager
|
||||||
|
* Description:
|
||||||
|
*
|
||||||
|
* @Author wangxy
|
||||||
|
* @Create 2025/5/19 9:34
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class CaseReportManager {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysCaseReportService caseReportService;
|
||||||
|
|
||||||
|
|
||||||
|
public List<SysCaseReport> selectSysCaseReportList(SysCaseReport caseReport) {
|
||||||
|
return caseReportService.selectSysCaseReportList(caseReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean saveOrUpdate(SysCaseReport caseReport) {
|
||||||
|
if (CharSequenceUtil.isNotBlank(caseReport.getCaseId())) {
|
||||||
|
caseReport.setUpdateTime(new Date());
|
||||||
|
caseReport.setUpdateBy(ShiroUtils.getSysUser().getUserName());
|
||||||
|
} else {
|
||||||
|
caseReport.setCaseId(IdUtils.simpleUUID());
|
||||||
|
caseReport.setCreateTime(new Date());
|
||||||
|
caseReport.setCreateBy(ShiroUtils.getSysUser().getUserName());
|
||||||
|
}
|
||||||
|
caseReport.setStatus("0");
|
||||||
|
caseReport.setType("6");
|
||||||
|
return caseReportService.saveOrUpdate(caseReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SysCaseReport selectSysCaseReportById(String caseId) {
|
||||||
|
return caseReportService.lambdaQuery()
|
||||||
|
.eq(SysCaseReport::getCaseId, caseId)
|
||||||
|
.eq(SysCaseReport::getStatus, "0")
|
||||||
|
.one();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean deletedSysCaseReportIds(String ids) {
|
||||||
|
List<String> list = Arrays.asList(Convert.toStrArray(ids));
|
||||||
|
return caseReportService.removeByIds(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<SysCaseReport> selectSysCaseReportHomeList() {
|
||||||
|
return caseReportService.lambdaQuery()
|
||||||
|
.eq(SysCaseReport::getStatus, "0")
|
||||||
|
.last("limit 10")
|
||||||
|
.orderByDesc(SysCaseReport::getCreateTime)
|
||||||
|
.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.system.domain.SysCaseReport;
|
||||||
|
import com.ruoyi.web.controller.manager.CaseReportManager;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: SysCaseReportController
|
||||||
|
* Package: com.ruoyi.web.controller.system
|
||||||
|
* Description:办案情况通报
|
||||||
|
*
|
||||||
|
* @Author wangxy
|
||||||
|
* @Create 2025/5/19 9:35
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/system/caseReport")
|
||||||
|
public class SysCaseReportController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CaseReportManager caseReportManager;
|
||||||
|
|
||||||
|
|
||||||
|
private String prefix = "system/caseReport";
|
||||||
|
|
||||||
|
@RequiresPermissions("system:caseReport:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String caseReport() {
|
||||||
|
return prefix + "/caseReport";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工作列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:caseReport:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysCaseReport caseReport) {
|
||||||
|
startPage();
|
||||||
|
List<SysCaseReport> list = caseReportManager.selectSysCaseReportList(caseReport);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增办案情况
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add() {
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存办案情况
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:caseReport:add")
|
||||||
|
@Log(title = "办案情况通报", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(@Validated SysCaseReport caseReport) {
|
||||||
|
return toAjax(caseReportManager.saveOrUpdate(caseReport));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改办案情况
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:caseReport:edit")
|
||||||
|
@GetMapping("/edit/{caseId}")
|
||||||
|
public String edit(@PathVariable("caseId") String caseId, ModelMap mmap) {
|
||||||
|
mmap.put("caseReport", caseReportManager.selectSysCaseReportById(caseId));
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存办案情况
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:caseReport:edit")
|
||||||
|
@Log(title = "办案情况通报", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(@Validated SysCaseReport caseReport) {
|
||||||
|
return toAjax(caseReportManager.saveOrUpdate(caseReport));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除办案情况
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:caseReport:remove")
|
||||||
|
@Log(title = "办案情况通报", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) {
|
||||||
|
return toAjax(caseReportManager.deletedSysCaseReportIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('新增办案情况通报')" />
|
||||||
|
<th:block th:include="include :: summernote-css" />
|
||||||
|
<th:block th:include="include :: jasny-bootstrap-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-case-add">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label is-required">办案情况名称:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input id="caseTitle" name="caseTitle" class="form-control" type="text" required maxlength="100">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">办案情况内容:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input id="caseContent" name="caseContent" type="hidden">
|
||||||
|
<div class="summernote"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">文件上传:</label>
|
||||||
|
<div class="fileinput fileinput-new" data-provides="fileinput">
|
||||||
|
<span class="btn btn-white btn-file">
|
||||||
|
<span class="fileinput-new">选择文件</span>
|
||||||
|
<span class="fileinput-exists">更改</span>
|
||||||
|
<input type="file" id="fileUrlId" name="...">
|
||||||
|
<input type="hidden" id="fileUrl" name="fileUrl">
|
||||||
|
<input type="hidden" id="fileName" name="fileName">
|
||||||
|
</span>
|
||||||
|
<span class="fileinput-filename"></span>
|
||||||
|
<a href="#" class="close fileinput-exists" data-dismiss="fileinput" style="float: none">×</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">办案情况通报状态:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_business_status')}">
|
||||||
|
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
|
||||||
|
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: summernote-js" />
|
||||||
|
<th:block th:include="include :: jasny-bootstrap-js" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
var prefix = ctx + "system/caseReport";
|
||||||
|
|
||||||
|
$('.summernote').summernote({
|
||||||
|
placeholder: '请输入办案情况内容',
|
||||||
|
height : 192,
|
||||||
|
lang : 'zh-CN',
|
||||||
|
followingToolbar: false,
|
||||||
|
dialogsInBody: true,
|
||||||
|
callbacks: {
|
||||||
|
onImageUpload: function (files) {
|
||||||
|
sendFile(files[0], this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
function sendFile(file, obj) {
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", file);
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$(obj).summernote('editor.insertImage', result.url, result.fileName);
|
||||||
|
} else {
|
||||||
|
$.modal.alertError(result.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("图片上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#form-business-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
var sHTML = $('.summernote').summernote('code');
|
||||||
|
$("#caseContent").val(sHTML);
|
||||||
|
$.operate.save(prefix + "/add", $('#form-case-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//文件上传
|
||||||
|
$('#fileUrlId').on('change.bs.fileinput ', function (e) {
|
||||||
|
// 处理自己的业务
|
||||||
|
var file = e.target.files[0];
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", file);
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$("#fileUrl").val(result.url);
|
||||||
|
$("#fileName").val(result.originalFilename);
|
||||||
|
} else {
|
||||||
|
$("#fileUrl").val("");
|
||||||
|
$("#fileName").val("");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("文件上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,99 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('办案情况通报列表')" />
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 search-collapse">
|
||||||
|
<form id="notice-form">
|
||||||
|
<div class="select-list">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
办案情况通报名称:<input type="text" name="caseTitle"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
操作人员:<input type="text" name="createBy"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="system:caseReport:add">
|
||||||
|
<i class="fa fa-plus"></i> 新增
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.editFull()" shiro:hasPermission="system:caseReport:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:caseReport:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var editFlag = [[${@permission.hasPermi('system:caseReport:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('system:caseReport:remove')}]];
|
||||||
|
var datas = [[${@dict.getType('sys_business_status')}]];
|
||||||
|
var prefix = ctx + "system/caseReport";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
uniqueId: "caseId",
|
||||||
|
url: prefix + "/list",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
modalName: "办案情况通报",
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field : 'caseTitle',
|
||||||
|
title : '办案情况通报名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '状态',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
return $.table.selectDictLabel(datas, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field : 'createBy',
|
||||||
|
title : '创建人'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
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.editFull(\'' + row.caseId + '\')"><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.caseId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,140 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('修改办案情况通报')" />
|
||||||
|
<th:block th:include="include :: summernote-css" />
|
||||||
|
<th:block th:include="include :: jasny-bootstrap-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-case-edit" th:object="${caseReport}">
|
||||||
|
<input id="caseId" name="caseId" th:field="*{caseId}" type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label is-required">办案情况通报名称:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input id="caseTitle" name="caseTitle" th:field="*{caseTitle}" class="form-control" type="text" required maxlength="100">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">办案情况通报内容:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input id="caseContent" name="caseContent" th:field="*{caseContent}" type="hidden">
|
||||||
|
<div id="editor" class="summernote"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">文件上传:</label>
|
||||||
|
<div class="fileinput fileinput-new" data-provides="fileinput">
|
||||||
|
<span class="btn btn-white btn-file">
|
||||||
|
<span class="fileinput-new">选择文件</span>
|
||||||
|
<span class="fileinput-exists">更改</span>
|
||||||
|
<input type="file" id="fileUrlId" name="...">
|
||||||
|
<input type="hidden" id="fileUrl" name="fileUrl" th:field="*{fileUrl}">
|
||||||
|
<input type="hidden" id="fileName" name="fileName" th:field="*{fileName}">
|
||||||
|
</span>
|
||||||
|
<span class="fileinput-filename">[[*{fileName}]]</span>
|
||||||
|
<a href="#" class="close fileinput-exists" data-dismiss="fileinput" style="float: none">×</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">办案情况通报状态:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_business_status')}">
|
||||||
|
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
||||||
|
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: summernote-js" />
|
||||||
|
<th:block th:include="include :: jasny-bootstrap-js" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
var prefix = ctx + "system/caseReport";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$('.summernote').summernote({
|
||||||
|
placeholder: '请输入办案情况通报内容',
|
||||||
|
height : 192,
|
||||||
|
lang : 'zh-CN',
|
||||||
|
followingToolbar: false,
|
||||||
|
dialogsInBody: true,
|
||||||
|
callbacks: {
|
||||||
|
onImageUpload: function (files) {
|
||||||
|
sendFile(files[0], this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var content = $("#caseContent").val();
|
||||||
|
$('#editor').summernote('code', content);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
function sendFile(file, obj) {
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", file);
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$(obj).summernote('editor.insertImage', result.url, result.fileName);
|
||||||
|
} else {
|
||||||
|
$.modal.alertError(result.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("图片上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#form-case-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
var sHTML = $('.summernote').summernote('code');
|
||||||
|
$("#caseContent").val(sHTML);
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-case-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//文件上传
|
||||||
|
$('#fileUrlId').on('change.bs.fileinput ', function (e) {
|
||||||
|
// 处理自己的业务
|
||||||
|
var file = e.target.files[0];
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", file);
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$("#fileUrl").val(result.url);
|
||||||
|
$("#fileName").val(result.originalFilename);
|
||||||
|
} else {
|
||||||
|
$("#fileUrl").val("");
|
||||||
|
$("#fileName").val("");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("文件上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.system.domain.SysCaseReport;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: SysCaseReportMapper
|
||||||
|
* Package: com.ruoyi.system.mapper
|
||||||
|
* Description:
|
||||||
|
*
|
||||||
|
* @Author wangxy
|
||||||
|
* @Create 2025/5/19 9:20
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface SysCaseReportMapper extends BaseMapper<SysCaseReport> {
|
||||||
|
|
||||||
|
|
||||||
|
public List<SysCaseReport> selectSysCaseReportList(SysCaseReport caseReport);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.system.domain.SysBusiness;
|
||||||
|
import com.ruoyi.system.domain.SysCaseReport;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: SysCaseReportService
|
||||||
|
* Package: com.ruoyi.system.service
|
||||||
|
* Description:
|
||||||
|
*
|
||||||
|
* @Author wangxy
|
||||||
|
* @Create 2025/5/19 9:21
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface SysCaseReportService extends IService<SysCaseReport> {
|
||||||
|
|
||||||
|
|
||||||
|
public List<SysCaseReport> selectSysCaseReportList(SysCaseReport caseReport);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.system.domain.SysBusiness;
|
||||||
|
import com.ruoyi.system.domain.SysCaseReport;
|
||||||
|
import com.ruoyi.system.mapper.SysCaseReportMapper;
|
||||||
|
import com.ruoyi.system.service.SysCaseReportService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: SysCaseReportServiceImpl
|
||||||
|
* Package: com.ruoyi.system.service.impl
|
||||||
|
* Description:
|
||||||
|
*
|
||||||
|
* @Author wangxy
|
||||||
|
* @Create 2025/5/19 9:22
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysCaseReportServiceImpl extends ServiceImpl<SysCaseReportMapper, SysCaseReport> implements SysCaseReportService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCaseReportMapper caseReportMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysCaseReport> selectSysCaseReportList(SysCaseReport caseReport) {
|
||||||
|
return caseReportMapper.selectSysCaseReportList(caseReport);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
<?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.ruoyi.system.mapper.SysCaseReportMapper">
|
||||||
|
|
||||||
|
<resultMap type="SysCaseReport" id="SysCaseReportResult">
|
||||||
|
<result property="caseId" column="case_id" />
|
||||||
|
<result property="caseTitle" column="case_title" />
|
||||||
|
<result property="caseContent" column="case_content" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<result property="fileUrl" column="file_url" />
|
||||||
|
<result property="fileName" column="file_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSysCaseReportVo">
|
||||||
|
select case_id, case_title, case_content, status, create_by, create_time, update_by, update_time, remark,type,file_url,file_name
|
||||||
|
from sys_case_report
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSysCaseReportById" parameterType="String" resultMap="SysCaseReportResult">
|
||||||
|
<include refid="selectSysCaseReportVo"/>
|
||||||
|
where case_id = #{caseId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysCaseReportList" parameterType="SysCaseReport" resultMap="SysCaseReportResult">
|
||||||
|
<include refid="selectSysCaseReportVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="caseTitle != null and caseTitle != ''">
|
||||||
|
AND case_title like concat('%', #{caseTitle}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
AND create_by like concat('%', #{createBy}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
AND status = #{status}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysCaseReportHomeList" parameterType="SysCaseReport" resultMap="SysCaseReportResult">
|
||||||
|
<include refid="selectSysCaseReportVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="caseTitle != null and caseTitle != ''">
|
||||||
|
AND case_title like concat('%', #{caseTitle}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
AND create_by like concat('%', #{createBy}, '%')
|
||||||
|
</if>
|
||||||
|
AND status = '0'
|
||||||
|
</where>
|
||||||
|
order by create_time desc limit 10
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in new issue