mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
planin 추가
This commit is contained in:
@@ -30,6 +30,7 @@ public class AccountController {
|
|||||||
int count = accountService.count(searchn, search, startRow, perPage);
|
int count = accountService.count(searchn, search, startRow, perPage);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int pageNum = 4;//보여질 페이지 번호 수
|
int pageNum = 4;//보여질 페이지 번호 수
|
||||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ public class AccountController {
|
|||||||
|
|
||||||
|
|
||||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||||
List<AccountDto> list = accountService.selectAll(searchn, search, searchn, perPage);
|
List<AccountDto> list = accountService.selectAll(searchn, search, startRow, perPage);
|
||||||
|
|
||||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||||
int end = begin + pageNum - 1;
|
int end = begin + pageNum - 1;
|
||||||
@@ -48,8 +49,9 @@ public class AccountController {
|
|||||||
mav.addObject("end", end);
|
mav.addObject("end", end);
|
||||||
mav.addObject("searchn", searchn);
|
mav.addObject("searchn", searchn);
|
||||||
mav.addObject("search", search);
|
mav.addObject("search", search);
|
||||||
mav.addObject("page", startRow);
|
mav.addObject("pageNum", pageNum);
|
||||||
mav.addObject("begin", begin);
|
mav.addObject("begin", begin);
|
||||||
|
mav.addObject("page", page);
|
||||||
mav.setViewName("account/list");
|
mav.setViewName("account/list");
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,21 @@ public class LoginController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/pass_reset_call")
|
||||||
|
@ResponseBody
|
||||||
|
public String passResetCall(AccountDto dto, Gson gson)
|
||||||
|
{
|
||||||
|
return gson.toJson("s");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/passreset")
|
||||||
|
public String passReset()
|
||||||
|
{
|
||||||
|
return "pass_reset_call";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/login/check_password")
|
@PostMapping("/login/check_password")
|
||||||
|
|||||||
@@ -65,8 +65,8 @@
|
|||||||
from account acc join authority auth join authority auth2 on acc.personal_authority_id = auth.id and acc.group_authority_id = auth2.id
|
from account acc join authority auth join authority auth2 on acc.personal_authority_id = auth.id and acc.group_authority_id = auth2.id
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 1"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
order by acc.id desc limit #{start}, #{perPage}
|
order by acc.id desc limit #{start}, #{perPage}
|
||||||
@@ -140,6 +140,9 @@
|
|||||||
<update id="delete" parameterType="accountDto">
|
<update id="delete" parameterType="accountDto">
|
||||||
update account SET activation = false WHERE id = #{id}
|
update account SET activation = false WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="passReset" parameterType="accountDto">
|
||||||
|
update account SET password = #{password} WHERE employee_number = #{employeeNumber}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
||||||
select count(*) from ( SELECT 1 from account
|
select count(*) from ( SELECT 1 from account
|
||||||
@@ -149,6 +152,6 @@
|
|||||||
<when test="searchn == 0"> activation = 1 and employee_number like concat('%',#{search},'%') </when>
|
<when test="searchn == 0"> activation = 1 and employee_number like concat('%',#{search},'%') </when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
order by id desc limit #{start}, #{perPage} ) t
|
) t
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
3
src/main/resources/static/css/account.css
Normal file
3
src/main/resources/static/css/account.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
tbody tr{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||||
<!-- 이 안에 내용 복사해서 jsp에 붙여넣기 -->
|
<!-- 이 안에 내용 복사해서 jsp에 붙여넣기 -->
|
||||||
<link rel="stylesheet" href="authority.css">
|
<link rel="stylesheet" href="/resources/static/css/account.css">
|
||||||
<script>
|
<script>
|
||||||
/*
|
/*
|
||||||
yes no 모달의 확인 버튼을 누를때 재정의할 function
|
yes no 모달의 확인 버튼을 누를때 재정의할 function
|
||||||
@@ -57,14 +57,20 @@
|
|||||||
$form.trigger("submit");
|
$form.trigger("submit");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function goCreate(){
|
||||||
|
const $form = $("<form method='post' action='/account/create'></form> ");
|
||||||
|
$(".att").after($form);
|
||||||
|
$form.trigger("submit");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<div class="container-fluid">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="mt-5 mb-5 text-center">
|
<div class="mt-5 mb-5 text-center">
|
||||||
<h1>계정 관리</h1><form method="post" action="/account/create"><button class="btn btn-primary" type="submit" id="btn_create">생성</button></form>
|
<h1>계정 관리</h1>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<hr>
|
<hr>
|
||||||
@@ -72,60 +78,56 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12 att">
|
||||||
<div class="container">
|
<form class="d-inline" id="search_form">
|
||||||
<div class="row">
|
<select name="searchn">
|
||||||
<div class="col-12">
|
<option <c:if test="${searchn == 0}">selected="selected"</c:if> value="0">사번</option>
|
||||||
<div id="search" align="center">
|
<option <c:if test="${searchn == 1}">selected="selected"</c:if> value="1">사원명</option>
|
||||||
<form id="search_form">
|
</select>
|
||||||
<select name="searchn">
|
<input type="text" name="search" maxlength="50" value="${search}"/>
|
||||||
<option <c:if test="${searchn == 0}">selected="selected"</c:if> value="0">사번</option>
|
<button type="submit" class="btn btn-primary" >검색</button>
|
||||||
<option <c:if test="${searchn == 1}">selected="selected"</c:if> value="1">사원명</option>
|
<input id="pPage" hidden type="text" name="page">
|
||||||
</select>
|
</form>
|
||||||
<input type="text" name="search" maxlength="50" value="${search}"/>
|
<button style="float: right;" class="btn btn-primary" type="submit" id="btn_create" onclick="goCreate() ">생성</button>
|
||||||
<button type="submit" class="btn btn-primary" >검색</button>
|
|
||||||
<input id="pPage" hidden type="text" name="page">
|
</div>
|
||||||
</form>
|
<div class="row p-0 m-0">
|
||||||
</div>
|
<div class="col-12 m-0">
|
||||||
</div>
|
<table class="table" >
|
||||||
</div>
|
<thead class="table-dark">
|
||||||
<div class="row">
|
<tr><th>사번</th><th>사용자 명</th><th>활성 여부</th></tr>
|
||||||
<div class="col-12">
|
</thead>
|
||||||
<table class="table" >
|
<tbody>
|
||||||
<thead class="table-dark">
|
<c:forEach items="${list }" var="dto" varStatus="status">
|
||||||
<tr><th>사번</th><th>사용자 명</th><th>활성 여부</th></tr>
|
<tr class="group_tr" data-mingu = "111" data-tid="${dto.id}">
|
||||||
</thead>
|
<td>${dto.employeeNumber}</td>
|
||||||
<tbody>
|
<td>${dto.name}</td>
|
||||||
<c:forEach items="${list }" var="dto" varStatus="status">
|
<td>
|
||||||
<tr class="group_tr" data-mingu = "111" data-tid="${dto.id}">
|
<c:choose>
|
||||||
<td>${dto.employeeNumber}</td>
|
<c:when test="${dto.activation}">O</c:when>
|
||||||
<td>${dto.name}</td>
|
<c:otherwise>X</c:otherwise>
|
||||||
<td>
|
</c:choose>
|
||||||
<c:choose>
|
</td>
|
||||||
<c:when test="${dto.activation}">O</c:when>
|
</tr>
|
||||||
<c:otherwise>X</c:otherwise>
|
</c:forEach>
|
||||||
</c:choose>
|
</tbody>
|
||||||
</td>
|
</table>
|
||||||
</tr>
|
</div>
|
||||||
</c:forEach>
|
</div>
|
||||||
</tbody>
|
<div class="row">
|
||||||
</table>
|
<div class="col-12">
|
||||||
</div>
|
<div id="page">
|
||||||
</div>
|
<ul class="pagination justify-content-center">
|
||||||
<div class="row">
|
<c:if test="${begin > pageNum }">
|
||||||
<div class="col-12">
|
<li class="page-item"><a class="page-link" data-p='${begin-1 }' href="#" onclick="onPaging(this)">[<]</a></li>
|
||||||
<div id="page" align="center">
|
</c:if>
|
||||||
<c:if test="${begin > pageNum }">
|
<c:forEach begin="${begin }" end="${end}" var="i" varStatus="status">
|
||||||
<a data-p='${begin-1 }' href="#" onclick="onPaging(this)">[<]</a>
|
<li class="page-item <c:if test="${page eq status.count}">active</c:if> "><a class="page-link" data-p='${i}' href="#" onclick="onPaging(this)" >${i}</a></li>
|
||||||
</c:if>
|
</c:forEach>
|
||||||
<c:forEach begin="${begin }" end="${end}" var="i">
|
<c:if test="${end < totalPages }">
|
||||||
<a data-p='${i}' href="#" onclick="onPaging(this)" >${i}</a>
|
<li class="page-item"><a class="page-link" data-p='${end+1}' href="#" onclick="onPaging(this)">[>]</a></li>
|
||||||
</c:forEach>
|
</c:if>
|
||||||
<c:if test="${end < totalPages }">
|
</ul>
|
||||||
<a data-p='${end+1}' href="#" onclick="onPaging(this)">[>]</a>
|
|
||||||
</c:if>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4">
|
<div class="col-12">
|
||||||
<!-- 탭 부분 -->
|
<!-- 탭 부분 -->
|
||||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
@@ -81,21 +81,6 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
|
||||||
<div id="div_group_search" class="text-end">
|
|
||||||
<input id="search_group_input" type="text" class="w-60 d-inline form-control" placeholder="검색">
|
|
||||||
<button id="search_group_btn" type="button" class="btn btn-primary" onclick="onSearch(false)">검색</button>
|
|
||||||
</div>
|
|
||||||
<div id="div_personal_search" class="text-end">
|
|
||||||
<select name="search_select" class="form-select d-inline">
|
|
||||||
<option selected value="10">10</option>
|
|
||||||
<option value="20">20</option>
|
|
||||||
<option value="30">30</option>
|
|
||||||
</select>
|
|
||||||
<input id="search_personal_input" type="text" class="w-60 d-inline form-control" placeholder="검색">
|
|
||||||
<button id="search_personal_btn" type="button" class="btn btn-primary" onclick="onSearch(true)">검색</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
<div class="checkbox mb-3">
|
<div class="checkbox mb-3">
|
||||||
<label>
|
<label>
|
||||||
<a href="/">비밀번호를 잊으셨나요?</a>
|
<a href="/passreset">비밀번호를 잊으셨나요?</a>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<button class="w-100 btn btn-lg btn-primary" type="button" onclick="onLogin()">로그인</button>
|
<button class="w-100 btn btn-lg btn-primary" type="button" onclick="onLogin()">로그인</button>
|
||||||
|
|||||||
67
src/main/webapp/WEB-INF/views/modal/pass_reset_call.jsp
Normal file
67
src/main/webapp/WEB-INF/views/modal/pass_reset_call.jsp
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||||
|
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/feather-icons"></script>
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>No1 WMS</title>
|
||||||
|
<style>
|
||||||
|
.form-signin {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-top: 40px;
|
||||||
|
padding-bottom: 40px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body class="text-center">
|
||||||
|
<script>
|
||||||
|
function onPassReset(){
|
||||||
|
const data={};
|
||||||
|
data.employeeNumber=$("#employ_number").val();
|
||||||
|
$.ajax({
|
||||||
|
type: 'post', // 타입 (get, post, put 등등)
|
||||||
|
url: '/login/pass_reset_call', // 요청할 서버url
|
||||||
|
dataType: 'json', // 데이터 타입 (html, xml, json, text 등등)
|
||||||
|
data: data,
|
||||||
|
success: function (result) { // 결과 성공 콜백함수
|
||||||
|
alert("패스워드 초기화 요청이 완료되었습니다");
|
||||||
|
window.location.href = "/";
|
||||||
|
},
|
||||||
|
error: function (request, status, error) {
|
||||||
|
alert(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<main class="form-signin">
|
||||||
|
<img class="mb-4" src="/docs/5.0/assets/brand/bootstrap-logo.svg" alt="" width="72" height="57">
|
||||||
|
<h1 class="h3 mb-3 fw-normal">비밀번호 초기화 요청</h1>
|
||||||
|
|
||||||
|
<div class="form-floating mb-3">
|
||||||
|
<input type="text" class="form-control" id="employ_number" name="employeeNumber" placeholder="사번">
|
||||||
|
<label for="employ_number">사번</label>
|
||||||
|
</div>
|
||||||
|
<button class="w-100 btn btn-lg btn-primary" type="button" onclick="onPassReset()">초기화 요청</button>
|
||||||
|
<p class="mt-5 mb-3 text-muted">© 2023–2024</p>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user