修改页面和接口

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.ISysRoleService;
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.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
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.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@ -110,6 +111,9 @@ public class BaseUserController extends BaseController
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("posts", postService.selectPostAll());
mmap.put("perList",personnelService.selectTAmentPersonnelList(new TAmentPersonnel()));
return prefix + "/add";
}

View File

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

View File

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

View File

@ -2,6 +2,9 @@ package com.cyx.web.controller.system;
import java.util.List;
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.shiro.authz.annotation.RequiresPermissions;
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.ISysUserService;
import javax.annotation.Resource;
/**
* 用户信息
*
@ -109,6 +114,8 @@ public class SysUserController extends BaseController
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("posts", postService.selectPostAll());
mmap.put("perList",personnelService.selectTAmentPersonnelList(new TAmentPersonnel()));
return prefix + "/add";
}

View File

@ -59,12 +59,15 @@ public class WechatController extends BaseController {
@GetMapping(value = "/getUserInfo")
@ResponseBody
public AjaxResult getUserInfo(SysUser user){
JSONObject res = new JSONObject();
UsernamePasswordToken token = new UsernamePasswordToken(user.getLoginName(), user.getPassword(), true);
Subject subject = SecurityUtils.getSubject();
try
{
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)
{

View File

@ -10,14 +10,14 @@
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<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>
<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="ui-layout-content">
<div id="tree" class="ztree"></div>

View File

@ -10,14 +10,14 @@
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<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>
<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="ui-layout-content">
<div id="tree" class="ztree"></div>

View File

@ -130,6 +130,23 @@
field: 'reviewedTime',
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: '操作',
// align: 'center',

View File

@ -10,14 +10,14 @@
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<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>
<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="ui-layout-content">
<div id="tree" class="ztree"></div>

View File

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

View File

@ -10,14 +10,14 @@
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<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>
<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="ui-layout-content">
<div id="tree" class="ztree"></div>

View File

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

View File

@ -14,7 +14,11 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">用户名称:</label>
<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>

View File

@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="title" column="title" />
<result property="workDate" column="work_date" />
<result property="branchId" column="branch_id" />
<result property="branchName" column="branch_name" />
<result property="partyDate" column="party_date" />
<result property="partyDuties" column="party_duties" />
<result property="remark" column="remark" />
@ -31,7 +32,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<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>
<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">
<include refid="selectTAmentPersonnelVo"/>
where id = #{id}
where a.id = #{id}
</select>
<insert id="insertTAmentPersonnel" parameterType="TAmentPersonnel">