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

pg_adapter
dshclm 8 months ago
commit cc9a4f7e1c

@ -0,0 +1,58 @@
package com.ruoyi.web.controller.manager;
import cn.hutool.core.convert.Convert;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.TdMeeting;
import com.ruoyi.system.service.TdMeetingService;
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
*
* @author wangxy
* @version JDK 8
* @className TdMeetingManager
* @date 2024/8/6
* @description
*/
@Component
public class TdMeetingManager {
@Resource
private TdMeetingService meetingService;
public List<TdMeeting> selectTdMeetingList(TdMeeting tdMeeting) {
return meetingService.selectTdMeetingList(tdMeeting);
}
public boolean saveOrUpdate(TdMeeting tdMeeting) {
if (StringUtils.isNotBlank(tdMeeting.getId())) {
tdMeeting.setUpdateBy(ShiroUtils.getSysUser().getLoginName());
tdMeeting.setUpdateTime(new Date());
} else {
tdMeeting.setCreateBy(ShiroUtils.getSysUser().getLoginName());
tdMeeting.setCreateTime(new Date());
}
return meetingService.saveOrUpdate(tdMeeting);
}
public TdMeeting selectTdMeeting(String id) {
return meetingService.getById(id);
}
public boolean deleteTdMeetingByids(String ids) {
List<String> list = Arrays.asList(Convert.toStrArray(ids));
return meetingService.removeByIds(list);
}
}

@ -0,0 +1,110 @@
package com.ruoyi.web.controller.system.meet;
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.TdMeeting;
import com.ruoyi.web.controller.manager.TdMeetingManager;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* packageName com.ruoyi.web.controller.system.meet
*
* @author wangxy
* @version JDK 8
* @className TdMeetingController
* @date 2024/8/6
* @description
*/
@Controller
@RequestMapping("/system/tdmeeting")
public class TdMeetingController extends BaseController {
private String prefix = "system/tdmeeting";
@Resource
private TdMeetingManager meetingManager;
@RequiresPermissions("system:tdmeeting:view")
@GetMapping()
public String tdmeeting() {
return prefix + "/tdmeeting";
}
/**
*
*/
@RequiresPermissions("system:tdmeeting:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TdMeeting tdMeeting) {
startPage();
List<TdMeeting> tdMeetings = meetingManager.selectTdMeetingList(tdMeeting);
return getDataTable(tdMeetings);
}
/**
*
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("system:tdmeeting:add")
@Log(title = "涉密会议", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TdMeeting tdMeeting) {
return toAjax(meetingManager.saveOrUpdate(tdMeeting));
}
/**
*
*/
@RequiresPermissions("system:tdmeeting:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap) {
TdMeeting meeting = meetingManager.selectTdMeeting(id);
mmap.put("meeting", meeting);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("system:tdmeeting:edit")
@Log(title = "涉密会议", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TdMeeting tdMeeting) {
return toAjax(meetingManager.saveOrUpdate(tdMeeting));
}
/**
*
*/
@RequiresPermissions("system:tdmeeting:remove")
@Log(title = "涉密会议", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(meetingManager.deleteTdMeetingByids(ids));
}
}

@ -0,0 +1,286 @@
<!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="trainName"/>
</li>
<li>
<label>所属地区:</label>
<select id="City" name="AREAID" @change="getAreaList()" v-model="City">
<option value="">请选择</option>
<option v-for="option in CityList" :value="option.id" :key="option.id">
{{ option.name }}
</option>
</select>
</li>
<li>
<label>培训日期:</label>
<input type="text" class="time-input" placeholder="请选择培训日期" name="trainDate"/>
</li>
<li>
<label>培训状态:</label>
<select name="trainState" th:with="type=${@dict.getType('sys_examine_state')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</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:train:add">
<i class="fa fa-plus"></i> 记录
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:train:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:train:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:train:export">
<i class="fa fa-download"></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:train:detail')}]];
var editFlag = [[${@permission.hasPermi('system:train:edit')}]];
var examineFlag = [[${@permission.hasPermi('system:train:examine')}]];
var removeFlag = [[${@permission.hasPermi('system:train:remove')}]];
var trainTypeDatas = [[${@dict.getType('sys_usertrain_typer')}]];
var trainSubjectDatas = [[${@dict.getType('sys_usertrain_obj')}]];
var trainStateDatas = [[${@dict.getType('sys_examine_state')}]];
var prefix = ctx + "system/train";
let datas = []
$.ajax({
url: ctx + "system/area/getAllList",
type: 'GET',
data:{parentId:''} ,
success:((res)=>{
datas = res.data
}) ,
});
let userList = []
$.ajax({
url: ctx + "system/user/list",
type: 'POST',
success:((res)=>{
userList = res.rows
}) ,
});
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
detailUrl: prefix + "/detail/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "涉密人员培训",
columns: [{
checkbox: true
},
{
field: 'id',
title: 'ID',
visible: false
},
{
field: 'areaid',
title: '所属地市',
visible: false,
formatter: function(value, row, index) {
return getCity(datas, value)
}
},
{
field: 'trainName',
title: '培训人员'
},
{
field: 'framework',
title: '所属区县',
visible: false,
formatter: function(value, row, index) {
return getCity(datas, value)
}
},
{
field: 'username',
title: '人员姓名',
formatter:function (value, row, index) {
return getUser(userList,value)
}
},
{
field: 'deptName',
title: '单位名称',
visible: false
},
{
field: 'trainType',
title: '培训类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(trainTypeDatas, value);
}
},
{
field: 'trainSubject',
title: '培训对象',
formatter: function(value, row, index) {
return $.table.selectDictLabel(trainSubjectDatas, value);
}
},
{
field: 'trainAddress',
title: '培训地点'
},
{
field: 'trainDate',
title: '培训开始日期'
},
{
field: 'trainTimeend',
title: '培训结束日期'
},
{
field: 'createStaffid',
title: '创建人',
visible: false
},
{
field: 'createDepartid',
title: '创建单位',
visible: false
},
{
field: 'createDate',
title: '创建日期',
visible: false
},
{
field: 'updateDepartid',
title: '更新单位',
visible: false
},
{
field: 'updateStaffid',
title: '审核人员'//
},
{
field: 'updateDate',
title: '审核时间',
visible: false
},
{
field: 'trainState',
title: '培训状态',//
formatter: function(value, row, index) {
return $.table.selectDictLabel(trainStateDatas, value);
}
},
{
field: 'part',
title: '部门',
visible: false
},
{
field: 'traininfo',
title: '培训评价',//
visible: false
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if (row.trainState === 2){
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-success btn-xs ' + examineFlag + '" href="javascript:void(0)" onclick="examine(\'' + 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>');
}else{
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 disabled class="btn btn-success btn-xs ' + examineFlag + '" href="javascript:void(0)"><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);
});
function examine(id) {
var url = prefix + '/examine/' + id;
$.modal.open("涉密人员培训审核", url);
}
function getUser(datas,value){
if ($.common.isEmpty(datas) || $.common.isEmpty(value)) {
return '';
}
var actions = []
$.each(datas, function(index, user) {
if (user.userId == value) {
actions.push($.common.sprintf("<span>%s</span>", user.userName));
return false;
}
});
if (actions.length === 0) {
actions.push($.common.sprintf("<span>%s</span>", value))
}
return actions.join('');
}
var app = new Vue({
el: '#app',
data: {
CityList: [],
City:'',
params:{
parentId:'',
}
},
mounted(){
// 初始化地市列表
this.getCityList();
},
methods:{
getCityList(){
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params ,
success:((res)=>{
this.CityList = res.data
}) ,
});
},
}
})
</script>
</body>
</html>

@ -2,8 +2,9 @@ package com.ruoyi.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@ -16,7 +17,7 @@ import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TdMeeting implements Serializable {
public class TdMeeting extends BaseEntity {
/**
* id
*/
@ -73,11 +74,6 @@ public class TdMeeting implements Serializable {
*/
private String fileId;
/**
*
*/
private String remarks;
/**
*
*/

@ -2,6 +2,9 @@ package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.TdMeeting;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author 13560
@ -9,8 +12,12 @@ import com.ruoyi.system.domain.TdMeeting;
* @createDate 2024-08-06 09:30:17
* @Entity generator.domain.TdMeeting
*/
@Mapper
public interface TdMeetingMapper extends BaseMapper<TdMeeting> {
public List<TdMeeting> selectTdMeetingList(TdMeeting tdMeeting);
}

@ -3,6 +3,8 @@ package com.ruoyi.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.TdMeeting;
import java.util.List;
/**
* @author 13560
* @description td_meetingService
@ -10,4 +12,7 @@ import com.ruoyi.system.domain.TdMeeting;
*/
public interface TdMeetingService extends IService<TdMeeting> {
public List<TdMeeting> selectTdMeetingList(TdMeeting tdMeeting);
}

@ -6,6 +6,9 @@ import com.ruoyi.system.mapper.TdMeetingMapper;
import com.ruoyi.system.service.TdMeetingService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author 13560
* @description td_meetingService
@ -15,6 +18,13 @@ import org.springframework.stereotype.Service;
public class TdMeetingServiceImpl extends ServiceImpl<TdMeetingMapper, TdMeeting>
implements TdMeetingService {
@Resource
private TdMeetingMapper meetingMapper;
@Override
public List<TdMeeting> selectTdMeetingList(TdMeeting tdMeeting) {
return meetingMapper.selectTdMeetingList(tdMeeting);
}
}

@ -16,15 +16,34 @@
<result property="agenda" column="agenda" jdbcType="VARCHAR"/>
<result property="summary" column="summary" jdbcType="VARCHAR"/>
<result property="fileId" column="file_id" jdbcType="VARCHAR"/>
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
<result property="fileName" column="file_name" jdbcType="VARCHAR"/>
<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" />
</resultMap>
<sql id="Base_Column_List">
id,meeting_title,meeting_time,
meeting_address,meeting_usernum,meeting_host,
meeting_type,meeting_state,agenda,
summary,file_id,remarks,
file_name
summary,file_id,
file_name,create_by, create_time, update_by, update_time, remark
</sql>
<select id="selectTdMeetingList" resultType="com.ruoyi.system.domain.TdMeeting">
select <include refid="Base_Column_List"/> from td_meeting
<trim prefix="where" prefixOverrides="and|or">
<if test="meetingType!=null">
AND meeting_type = #{meetingType}
</if>
<if test="meetingState!=null">
AND meeting_state = #{meetingState}
</if>
<if test="meetingTitle!=null and meetingTitle!=''">
AND meeting_title LIKE concat('%',#{meetingTitle},'%')
</if>
</trim>
ORDER BY create_time DESC
</select>
</mapper>

Loading…
Cancel
Save