Merge remote-tracking branch 'origin/new-exam' into new-exam

pg_adapter
20918 9 months ago
commit bebfc1da70

@ -1,9 +1,16 @@
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.system.domain.place.TdPlaceRegist;
import com.ruoyi.system.service.place.TdPlaceRegistService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* packageName com.ruoyi.web.controller.manager
@ -20,4 +27,32 @@ public class TdPlaceRegistManager {
@Resource
private TdPlaceRegistService placeRegistService;
public List<TdPlaceRegist> selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist) {
return placeRegistService.selectTdPlaceRegistList(tdPlaceRegist);
}
public boolean saveOrUpdate(TdPlaceRegist tdPlaceRegist) {
if (CharSequenceUtil.isNotBlank(tdPlaceRegist.getId())) {
tdPlaceRegist.setUpdateBy(ShiroUtils.getSysUser().getLoginName());
tdPlaceRegist.setUpdateTime(new Date());
} else {
tdPlaceRegist.setCreateBy(ShiroUtils.getSysUser().getLoginName());
tdPlaceRegist.setCreateTime(new Date());
}
return placeRegistService.saveOrUpdate(tdPlaceRegist);
}
public TdPlaceRegist selectTdPlaceRegist(String id) {
return placeRegistService.getById(id);
}
public boolean deleteTdPlaceRegistByids(String ids) {
List<String> list = Arrays.asList(Convert.toStrArray(ids));
return placeRegistService.removeByIds(list);
}
}

@ -1,11 +1,19 @@
package com.ruoyi.web.controller.place;
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.place.TdPlaceRegist;
import com.ruoyi.web.controller.manager.TdPlaceRegistManager;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* packageName com.ruoyi.web.controller.place
@ -21,8 +29,95 @@ import javax.annotation.Resource;
public class TdPlaceRegistController extends BaseController {
private String prefix = "system/placeRegist";
@Resource
private TdPlaceRegistManager placeRegistManager;
@RequiresPermissions("system:placeRegist:view")
@GetMapping()
public String placeRegist() {
return prefix + "/placeRegist";
}
/**
*
*/
@RequiresPermissions("system:placeRegist:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TdPlaceRegist tdPlaceRegist) {
startPage();
List<TdPlaceRegist> tdPlaceRegists = placeRegistManager.selectTdPlaceRegistList(tdPlaceRegist);
return getDataTable(tdPlaceRegists);
}
/**
*
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("system:placeRegist:add")
@Log(title = "场所出入登记", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TdPlaceRegist tdPlaceRegist) {
return toAjax(placeRegistManager.saveOrUpdate(tdPlaceRegist));
}
/**
*
*/
@RequiresPermissions("system:placeRegist:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap) {
TdPlaceRegist tdPlaceRegist = placeRegistManager.selectTdPlaceRegist(id);
mmap.put("tdPlaceRegist", tdPlaceRegist);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("system:placeRegist:edit")
@Log(title = "场所出入登记", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TdPlaceRegist tdPlaceRegist) {
return toAjax(placeRegistManager.saveOrUpdate(tdPlaceRegist));
}
/**
*
*/
@RequiresPermissions("system:placeRegist:detail")
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") String id, ModelMap mmap) {
TdPlaceRegist tdPlaceRegist = placeRegistManager.selectTdPlaceRegist(id);
mmap.put("tdPlaceRegist", tdPlaceRegist);
return prefix + "/detail";
}
/**
*
*/
@RequiresPermissions("system:placeRegist:remove")
@Log(title = "场所出入登记", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(placeRegistManager.deleteTdPlaceRegistByids(ids));
}
}

@ -0,0 +1,58 @@
<!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 :: jasny-bootstrap-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
<form class="form-horizontal m" id="form-place-add">
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label is-required">场所名称:</label>
<div class="col-sm-10">
<input name="placeName" required placeholder="请输入场所名称" class="form-control m-b" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">场所规范:</label>
<div class="col-sm-10">
<textarea name="placeRule" rows="4" placeholder="请输入场所规范" class="form-control"></textarea>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">备注:</label>
<div class="col-sm-10">
<textarea name="remark" rows="4" placeholder="请输入备注" class="form-control"></textarea>
</div>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script th:inline="javascript">
var prefix = ctx + "system/place"
$("#form-place-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-place-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,59 @@
<!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 :: jasny-bootstrap-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
<form class="form-horizontal m" id="form-place-add" th:object="${tdPlace}">
<input name="userId" type="hidden" th:field="*{id}" />
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">场所名称:</label>
<div class="col-sm-10">
<input name="meetingTitle" readonly placeholder="请输入场所名称" th:field="*{placeName}" class="form-control m-b" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">场所规范:</label>
<div class="col-sm-10">
<textarea name="placeRule" readonly rows="4" placeholder="请输入场所规范" th:field="*{placeRule}" class="form-control"></textarea>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">备注:</label>
<div class="col-sm-10">
<textarea name="remark" readonly rows="4" placeholder="请输入备注" th:field="*{remark}" class="form-control"></textarea>
</div>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script th:inline="javascript">
var prefix = ctx + "system/place"
$("#form-place-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-place-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,59 @@
<!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 :: jasny-bootstrap-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
<form class="form-horizontal m" id="form-place-add" th:object="${tdPlace}">
<input name="userId" type="hidden" th:field="*{id}" />
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label is-required">场所名称:</label>
<div class="col-sm-10">
<input name="meetingTitle" required placeholder="请输入场所名称" th:field="*{placeName}" class="form-control m-b" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">场所规范:</label>
<div class="col-sm-10">
<textarea name="placeRule" rows="4" placeholder="请输入场所规范" th:field="*{placeRule}" class="form-control"></textarea>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">备注:</label>
<div class="col-sm-10">
<textarea name="remark" rows="4" placeholder="请输入备注" th:field="*{remark}" class="form-control"></textarea>
</div>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script th:inline="javascript">
var prefix = ctx + "system/place"
$("#form-place-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-place-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,90 @@
<!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" id="app">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>场所名称:</label>
<input type="text" name="placeName"></input>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:place:add">
<i class="fa fa-plus"></i> 记录
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:place:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:place: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 detailFlag = [[${@permission.hasPermi('system:place:detail')}]];
var editFlag = [[${@permission.hasPermi('system:place:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:place:remove')}]];
var prefix = ctx + "system/place";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
detailUrl: prefix + "/detail/{id}",
removeUrl: prefix + "/remove",
modalName: "涉密会议登记",
columns: [{
checkbox: true
},
{
field: 'id',
title: 'ID',
visible: false
},
{
field: 'placeName',
title: '场所名称',
width: '200'
},
{
field: 'placeRule',
title: '场所规范',
width: '800'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></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('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.place.TdPlaceRegist;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author 13560
* @description td_place_regist()Mapper
@ -13,6 +15,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TdPlaceRegistMapper extends BaseMapper<TdPlaceRegist> {
public List<TdPlaceRegist> selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist);
}

@ -1,8 +1,11 @@
package com.ruoyi.system.service.place;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.place.TdPlace;
import com.ruoyi.system.domain.place.TdPlaceRegist;
import java.util.List;
/**
* @author 13560
* @description td_place_regist()Service
@ -10,4 +13,7 @@ import com.ruoyi.system.domain.place.TdPlaceRegist;
*/
public interface TdPlaceRegistService extends IService<TdPlaceRegist> {
public List<TdPlaceRegist> selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist);
}

@ -2,10 +2,14 @@ package com.ruoyi.system.service.place.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.place.TdPlaceRegist;
import com.ruoyi.system.mapper.place.TdPlaceMapper;
import com.ruoyi.system.mapper.place.TdPlaceRegistMapper;
import com.ruoyi.system.service.place.TdPlaceRegistService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author 13560
* @description td_place_regist()Service
@ -15,6 +19,14 @@ import org.springframework.stereotype.Service;
public class TdPlaceRegistServiceImpl extends ServiceImpl<TdPlaceRegistMapper, TdPlaceRegist>
implements TdPlaceRegistService {
@Resource
private TdPlaceRegistMapper tdPlaceRegistMapper;
@Override
public List<TdPlaceRegist> selectTdPlaceRegistList(TdPlaceRegist tdPlaceRegist) {
return tdPlaceRegistMapper.selectTdPlaceRegistList(tdPlaceRegist);
}
}

@ -29,4 +29,20 @@
dept_id,create_by,create_time,
update_by,update_time,remark
</sql>
<select id="selectTdPlaceRegistList" resultType="com.ruoyi.system.domain.place.TdPlaceRegist">
select <include refid="Base_Column_List"/> from td_place_regist
<trim prefix="where" prefixOverrides="and|or">
<if test="placeName!=null and placeName!=''">
AND place_name LIKE concat('%',#{placeName},'%')
</if>
<if test="registName!=null and registName!=''">
AND regist_name LIKE concat('%',#{registName},'%')
</if>
<if test="registTime!=null">
AND regist_time = #{registTime}
</if>
</trim>
ORDER BY create_time DESC
</select>
</mapper>

Loading…
Cancel
Save