修改页面和接口

This commit is contained in:
liuwu 2023-09-15 14:15:54 +08:00
parent 547e3f9065
commit 654c8acf77
14 changed files with 105 additions and 36 deletions

View File

@ -19,9 +19,9 @@ import com.cyx.system.service.ISysDeptService;
import com.cyx.system.service.ISysPostService; import com.cyx.system.service.ISysPostService;
import com.cyx.system.service.ISysRoleService; import com.cyx.system.service.ISysRoleService;
import com.cyx.system.service.ISysUserService; import com.cyx.system.service.ISysUserService;
import org.apache.catalina.User; import com.cyx.web.base.domain.TAmentPersonnel;
import com.cyx.web.base.service.ITAmentPersonnelService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -30,6 +30,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -110,6 +111,9 @@ public class BaseUserController extends BaseController
return util.importTemplateExcel("用户数据"); return util.importTemplateExcel("用户数据");
} }
@Resource
private ITAmentPersonnelService personnelService;
/** /**
* 新增用户 * 新增用户
*/ */
@ -118,6 +122,7 @@ public class BaseUserController extends BaseController
{ {
mmap.put("roles", roleService.selectRoleAll().stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); mmap.put("roles", roleService.selectRoleAll().stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
mmap.put("posts", postService.selectPostAll()); mmap.put("posts", postService.selectPostAll());
mmap.put("perList",personnelService.selectTAmentPersonnelList(new TAmentPersonnel()));
return prefix + "/add"; return prefix + "/add";
} }

View File

@ -69,6 +69,9 @@ public class TAmentPartyAffairsController extends BaseController
public TableDataInfo warnList(TAmentPartyAffairs tAmentPartyAffairs) public TableDataInfo warnList(TAmentPartyAffairs tAmentPartyAffairs)
{ {
startPage(); startPage();
if (!getLoginName().equals("admin")){
tAmentPartyAffairs.setPerId(getSysUser().getUserId());
}
List<TAmentPartyAffairs> list = tAmentPartyAffairsService.warnList(tAmentPartyAffairs); List<TAmentPartyAffairs> list = tAmentPartyAffairsService.warnList(tAmentPartyAffairs);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -101,6 +101,15 @@ public class TAmentPersonnel extends BaseEntity
/** 支部ID */ /** 支部ID */
@Excel(name = "支部ID") @Excel(name = "支部ID")
private Long branchId; private Long branchId;
private String branchName;
public String getBranchName() {
return branchName;
}
public void setBranchName(String branchName) {
this.branchName = branchName;
}
/** 入党时间 */ /** 入党时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")

View File

@ -2,6 +2,9 @@ package com.cyx.web.controller.system;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.cyx.web.base.domain.TAmentPersonnel;
import com.cyx.web.base.service.ITAmentPersonnelService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -34,6 +37,8 @@ import com.cyx.system.service.ISysPostService;
import com.cyx.system.service.ISysRoleService; import com.cyx.system.service.ISysRoleService;
import com.cyx.system.service.ISysUserService; import com.cyx.system.service.ISysUserService;
import javax.annotation.Resource;
/** /**
* 用户信息 * 用户信息
* *
@ -109,6 +114,8 @@ public class SysUserController extends BaseController
return util.importTemplateExcel("用户数据"); return util.importTemplateExcel("用户数据");
} }
@Resource
private ITAmentPersonnelService personnelService;
/** /**
* 新增用户 * 新增用户
*/ */
@ -117,6 +124,7 @@ public class SysUserController extends BaseController
{ {
mmap.put("roles", roleService.selectRoleAll().stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); mmap.put("roles", roleService.selectRoleAll().stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
mmap.put("posts", postService.selectPostAll()); mmap.put("posts", postService.selectPostAll());
mmap.put("perList",personnelService.selectTAmentPersonnelList(new TAmentPersonnel()));
return prefix + "/add"; return prefix + "/add";
} }

View File

@ -59,12 +59,15 @@ public class WechatController extends BaseController {
@GetMapping(value = "/getUserInfo") @GetMapping(value = "/getUserInfo")
@ResponseBody @ResponseBody
public AjaxResult getUserInfo(SysUser user){ public AjaxResult getUserInfo(SysUser user){
JSONObject res = new JSONObject();
UsernamePasswordToken token = new UsernamePasswordToken(user.getLoginName(), user.getPassword(), true); UsernamePasswordToken token = new UsernamePasswordToken(user.getLoginName(), user.getPassword(), true);
Subject subject = SecurityUtils.getSubject(); Subject subject = SecurityUtils.getSubject();
try try
{ {
subject.login(token); subject.login(token);
return AjaxResult.success(token); res.put("userInfo",getSysUser());
res.put("perInfo",personnelService.selectTAmentPersonnelById(getSysUser().getUserId()));
return AjaxResult.success(res);
} }
catch (AuthenticationException e) catch (AuthenticationException e)
{ {

View File

@ -10,14 +10,14 @@
<div class="box box-main"> <div class="box box-main">
<div class="box-header"> <div class="box-header">
<div class="box-title"> <div class="box-title">
<i class="fa fa-sitemap"></i> 组织机构 <i class="fa fa-sitemap"></i> 党内职务
</div>
<div class="box-tools pull-right">
<a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
</div> </div>
<!-- <div class="box-tools pull-right">-->
<!-- <a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>-->
<!-- </div>-->
</div> </div>
<div class="ui-layout-content"> <div class="ui-layout-content">
<div id="tree" class="ztree"></div> <div id="tree" class="ztree"></div>

View File

@ -10,14 +10,14 @@
<div class="box box-main"> <div class="box box-main">
<div class="box-header"> <div class="box-header">
<div class="box-title"> <div class="box-title">
<i class="fa fa-sitemap"></i> 组织机构 <i class="fa fa-sitemap"></i> 部门
</div>
<div class="box-tools pull-right">
<a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
</div> </div>
<!-- <div class="box-tools pull-right">-->
<!-- <a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>-->
<!-- </div>-->
</div> </div>
<div class="ui-layout-content"> <div class="ui-layout-content">
<div id="tree" class="ztree"></div> <div id="tree" class="ztree"></div>

View File

@ -130,6 +130,23 @@
field: 'reviewedTime', field: 'reviewedTime',
title: '审核时间' title: '审核时间'
}, },
{
field: 'status',
title: '状态',
formatter: function(value, row, index) {
var actions = [];
if (row.status === '1'){
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)">待提交</a> ');
}else if (row.status === '2'){
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)">待审核</a> ');
}else if (row.status === '3'){
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)">已驳回</a> ');
}else if (row.status === '4'){
actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)">已完成</a> ');
}
return actions.join('');
}
},
// { // {
// title: '操作', // title: '操作',
// align: 'center', // align: 'center',

View File

@ -10,14 +10,14 @@
<div class="box box-main"> <div class="box box-main">
<div class="box-header"> <div class="box-header">
<div class="box-title"> <div class="box-title">
<i class="fa fa-sitemap"></i> 组织机构 <i class="fa fa-sitemap"></i> 党内职务
</div>
<div class="box-tools pull-right">
<a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
</div> </div>
<!-- <div class="box-tools pull-right">-->
<!-- <a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>-->
<!-- </div>-->
</div> </div>
<div class="ui-layout-content"> <div class="ui-layout-content">
<div id="tree" class="ztree"></div> <div id="tree" class="ztree"></div>

View File

@ -154,7 +154,7 @@
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
if (row.status === '1'){ if (row.status === '1'){
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)">待提交</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)">待提交</a> ');
}else if (row.status === '2'){ }else if (row.status === '2'){
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)">待审核</a> '); actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)">待审核</a> ');
}else if (row.status === '3'){ }else if (row.status === '3'){

View File

@ -10,14 +10,14 @@
<div class="box box-main"> <div class="box box-main">
<div class="box-header"> <div class="box-header">
<div class="box-title"> <div class="box-title">
<i class="fa fa-sitemap"></i> 组织机构 <i class="fa fa-sitemap"></i> 部门
</div>
<div class="box-tools pull-right">
<a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
</div> </div>
<!-- <div class="box-tools pull-right">-->
<!-- <a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>-->
<!-- <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>-->
<!-- </div>-->
</div> </div>
<div class="ui-layout-content"> <div class="ui-layout-content">
<div id="tree" class="ztree"></div> <div id="tree" class="ztree"></div>

View File

@ -10,11 +10,15 @@
<input name="deptId" type="hidden" id="treeId"/> <input name="deptId" type="hidden" id="treeId"/>
<h4 class="form-header h4">基本信息</h4> <h4 class="form-header h4">基本信息</h4>
<div class="row"> <div class="row">
<input name="userName" id="userName" placeholder="请输入用户名称" class="form-control" type="hidden" maxlength="30" required>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">用户名称:</label> <label class="col-sm-4 control-label is-required">用户名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" required> <select name="userId" id="userId" class="form-control" onchange="userNameChange(this.options[this.selectedIndex].value,this.options[this.selectedIndex].text)">
<option value="">请选择</option>
<option th:each="item : ${perList}" th:text="${item.name}" th:value="${item.id}"></option>
</select>
</div> </div>
</div> </div>
</div> </div>
@ -148,6 +152,14 @@
<th:block th:include="include :: select2-js" /> <th:block th:include="include :: select2-js" />
<script> <script>
var prefix = ctx + "base/user"; var prefix = ctx + "base/user";
// $("#userId").on("change", function() {
// console.log($(this))
// })
function userNameChange(value,text){
$("#userName").val(text)
}
$("#form-user-add").validate({ $("#form-user-add").validate({
onkeyup: false, onkeyup: false,

View File

@ -14,7 +14,11 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">用户名称:</label> <label class="col-sm-4 control-label is-required">用户名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" required> <!-- <input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" required>-->
<select name="userId" id="userId" class="form-control">
<option value="">请选择</option>
<option th:each="item : ${perList}" th:text="${item.name}" th:value="${item.id}"></option>
</select>
</div> </div>
</div> </div>
</div> </div>

View File

@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="title" column="title" /> <result property="title" column="title" />
<result property="workDate" column="work_date" /> <result property="workDate" column="work_date" />
<result property="branchId" column="branch_id" /> <result property="branchId" column="branch_id" />
<result property="branchName" column="branch_name" />
<result property="partyDate" column="party_date" /> <result property="partyDate" column="party_date" />
<result property="partyDuties" column="party_duties" /> <result property="partyDuties" column="party_duties" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
@ -31,7 +32,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTAmentPersonnelVo"> <sql id="selectTAmentPersonnelVo">
select id, unit, name, sex, nation, dept_id, mphone, email, native_place, post, duties, title, work_date, branch_id, party_date, party_duties, remark, del_flag, create_by, create_time, update_by, update_time from t_ament_personnel SELECT
b.dept_name,
c.branch_name,
a.*
FROM
t_ament_personnel a
LEFT JOIN sys_dept b ON a.dept_id = b.dept_id
LEFT JOIN t_ament_branch c ON a.branch_id = c.branch_id
</sql> </sql>
<select id="selectTAmentPersonnelList" parameterType="TAmentPersonnel" resultMap="TAmentPersonnelResult"> <select id="selectTAmentPersonnelList" parameterType="TAmentPersonnel" resultMap="TAmentPersonnelResult">
@ -62,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTAmentPersonnelById" parameterType="Long" resultMap="TAmentPersonnelResult"> <select id="selectTAmentPersonnelById" parameterType="Long" resultMap="TAmentPersonnelResult">
<include refid="selectTAmentPersonnelVo"/> <include refid="selectTAmentPersonnelVo"/>
where id = #{id} where a.id = #{id}
</select> </select>
<insert id="insertTAmentPersonnel" parameterType="TAmentPersonnel"> <insert id="insertTAmentPersonnel" parameterType="TAmentPersonnel">