mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
#update
ResetPasswordController.java ResetPasswordMapper.java ResetPasswordService.java ResetPasswordMapper.xml resetpassword/list.jsp
This commit is contained in:
@@ -17,15 +17,22 @@ public class ResetPasswordController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ResetPasswordService resetPasswordService;
|
ResetPasswordService resetPasswordService;
|
||||||
|
|
||||||
/*GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public String list(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
public String list(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||||
@RequestParam(name = "search", defaultValue = "") String search,
|
@RequestParam(name = "search", defaultValue = "") String search,
|
||||||
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
@RequestParam(name = "p", defaultValue = "1") int page, String resetpassword, String cancelrequest, Model m) {
|
||||||
int count = resetPasswordService.count(searchn, search);
|
int count = resetPasswordService.count(searchn, search);
|
||||||
|
|
||||||
int perPage = 10; // 한 페이지에 보일 글의 갯수
|
int perPage = 10; // 한 페이지에 보일 글의 갯수
|
||||||
int startRow = (page - 1) * perPage;
|
int startRow = (page - 1) * perPage;
|
||||||
|
|
||||||
|
if(resetpassword != null){
|
||||||
|
|
||||||
|
}
|
||||||
|
if(cancelrequest != null){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||||
List<Map<String, Object>> dto = resetPasswordService.list(searchn, search, startRow ,perPage);
|
List<Map<String, Object>> dto = resetPasswordService.list(searchn, search, startRow ,perPage);
|
||||||
m.addAttribute("rlist", dto);
|
m.addAttribute("rlist", dto);
|
||||||
@@ -51,8 +58,8 @@ public class ResetPasswordController {
|
|||||||
System.out.println("테스트 : : " + m);
|
System.out.println("테스트 : : " + m);
|
||||||
|
|
||||||
|
|
||||||
return "out/list";
|
return "resetpassword/list";
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@PostMapping("/insert")
|
@PostMapping("/insert")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|||||||
@@ -3,13 +3,22 @@ package com.no1.wms.resetpassword;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ResetPasswordMapper {
|
public interface ResetPasswordMapper {
|
||||||
|
|
||||||
|
List<Map<String, Object>> list(Map<String, Object> m);
|
||||||
|
|
||||||
|
int count(Map<String, Object> m);
|
||||||
|
|
||||||
void insert(ResetPasswordDto dto);
|
void insert(ResetPasswordDto dto);
|
||||||
|
|
||||||
void delete(ResetPasswordDto dto);
|
void delete(ResetPasswordDto dto);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,39 @@ package com.no1.wms.resetpassword;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ResetPasswordService {
|
public class ResetPasswordService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ResetPasswordMapper mapper;
|
ResetPasswordMapper mapper;
|
||||||
|
|
||||||
|
public int count(int searchn, String search) {
|
||||||
|
|
||||||
|
Map<String,Object> m = new HashMap<String, Object>();
|
||||||
|
m.put("searchn",searchn);
|
||||||
|
m.put("search", search);
|
||||||
|
return mapper.count(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Map<String, Object>> list(int searchn, String search, int start, int perPage){
|
||||||
|
|
||||||
|
System.out.println(searchn+search);
|
||||||
|
|
||||||
|
Map<String, Object> m = new HashMap<String, Object>();
|
||||||
|
m.put("searchn",searchn);
|
||||||
|
m.put("search", search);
|
||||||
|
m.put("start", start);
|
||||||
|
m.put("perPage", perPage);
|
||||||
|
|
||||||
|
return mapper.list(m);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void insert(ResetPasswordDto dto){
|
void insert(ResetPasswordDto dto){
|
||||||
mapper.insert(dto);
|
mapper.insert(dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,29 +20,36 @@
|
|||||||
(UUID(), (SELECT id from account where employee_number = #{employeeNumber} ), #{note}, NOW())
|
(UUID(), (SELECT id from account where employee_number = #{employeeNumber} ), #{note}, NOW())
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="resetpasswordAll" resultMap="resetPasswordResultMap" parameterType="map">
|
<select id="list" resultMap="resetPasswordResultMap" parameterType="map">
|
||||||
SELECT
|
SELECT
|
||||||
id, account_id, note, date, acc.id, acc.name, acc.mail, acc.employee_number
|
rs.id as id,
|
||||||
|
rs.account_id as account_id,
|
||||||
|
rs.note as note,
|
||||||
|
rs.date as date,
|
||||||
|
acc.id,
|
||||||
|
acc.name as name,
|
||||||
|
acc.email as email,
|
||||||
|
acc.employee_number as employee_number
|
||||||
|
|
||||||
from reset_password rs join account acc on rs.account_id = acc.id
|
from reset_password rs join account acc on rs.account_id = acc.id
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
<when test="searchn == 0"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
<when test="searchn == 1"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
order by date desc limit #{start}, #{perPage}
|
order by date desc limit #{start}, #{perPage}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count" resultMap="resetPasswordResultMap" parameterType="map">
|
<select id="count" resultType="int" parameterType="map">
|
||||||
SELECT
|
SELECT count(rs.id)
|
||||||
count(id)
|
from reset_password rs join account acc on rs.account_id = acc.id
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
<when test="searchn == 0"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
<when test="searchn == 1"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
order by date desc limit #{start}, #{perPage}
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAll" resultMap="resetPasswordResultMap" parameterType="map">
|
<select id="selectAll" resultMap="resetPasswordResultMap" parameterType="map">
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<div class="w-25">
|
<div class="w-25">
|
||||||
<select class="form-select" name="searchn" id="searchn">
|
<select class="form-select" name="searchn" id="searchn">
|
||||||
<option value="0">사원명</option>
|
<option value="0">사원명</option>
|
||||||
<option value="1">아이디</option>
|
<option value="1">사번</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>번호</th>
|
||||||
<th>사원명</th>
|
<th>사원명</th>
|
||||||
<th>아이디</th>
|
<th>email</th>
|
||||||
<th>요청사유</th>
|
<th>요청사유</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
|
||||||
@@ -53,9 +53,12 @@
|
|||||||
<tr class="detailTr col-5" data-id="${dto.id}" >
|
<tr class="detailTr col-5" data-id="${dto.id}" >
|
||||||
<td class="col-1">${start} <c:set var="start" value="${start +1 }"/></td>
|
<td class="col-1">${start} <c:set var="start" value="${start +1 }"/></td>
|
||||||
<td class="col-1">${dto.name }</td>
|
<td class="col-1">${dto.name }</td>
|
||||||
<td class="col-1">${dto.president_telephone }</td>
|
<td class="col-1">${dto.email }</td>
|
||||||
<td class="col-1">${dto.vendor_manager }</td>
|
<td class="col-1">${dto.note }</td>
|
||||||
<td class="col-1">${dto.vendor_manager_telephone }</td>
|
<td class="col-1">
|
||||||
|
<button type="button" class="btn btn-primary" value="${dto.id}" id="resetpassword">확인</button>
|
||||||
|
<button type="button" class="btn btn-warning" value="${dto.id}" id="cancelrequest">취소</button>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -65,36 +68,32 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row row-buttons">
|
<div class="row row-buttons">
|
||||||
<div class="col-3 text-start">
|
|
||||||
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
|
|
||||||
<button type="button" class="btn btn-success" id="uploadExcel">업로드</button>
|
|
||||||
<button type="button" class="btn btn-success" id="download">다운로드</button>
|
|
||||||
</div>
|
|
||||||
<div class="col-6 d-flex justify-content-center">
|
<div class="col-6 d-flex justify-content-center">
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
|
|
||||||
<c:if test="${begin > pageNum }">
|
<c:if test="${begin > pageNum }">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${begin - 1 }"><</a>
|
<a href="javascript:void(0);" class="page-link" id="before"
|
||||||
</li>
|
value="${begin - 1 }"><</a>
|
||||||
</c:if>
|
</li>
|
||||||
<c:forEach begin="${begin }" end="${end }" var="i">
|
</c:if>
|
||||||
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
<c:forEach begin="${begin }" end="${end }" var="i">
|
||||||
<a href="javascript:void(0);" class="page-link " onclick="pageingFunction(this.id); return false;" id="${i }">${i }</a>
|
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
||||||
</li>
|
<a href="javascript:void(0);" class="page-link " id="pageNow"
|
||||||
</c:forEach>
|
value="${i }">${i }</a>
|
||||||
<c:if test="${end < totalPages }">
|
</li>
|
||||||
<li class="page-item">
|
</c:forEach>
|
||||||
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${end + 1 }">></a>
|
<c:if test="${end < totalPages }">
|
||||||
</li>
|
<li class="page-item">
|
||||||
</c:if>
|
<a href="javascript:void(0);" class="page-link" id="after" value="${end + 1 }">></a>
|
||||||
|
</li>
|
||||||
|
</c:if>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 text-end">
|
|
||||||
<button type="button" class="btn btn-primary" id="createButton">생성</button>
|
|
||||||
</div>
|
|
||||||
</div><!-- row row-buttons -->
|
</div><!-- row row-buttons -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -104,31 +103,74 @@
|
|||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
//POST방식으로 create폼화면 출력
|
$("#resetpassword").on("click",function(){
|
||||||
$("#createButton").on("click",function(){
|
var resetpassword = $("#resetpassword").val();
|
||||||
|
|
||||||
var form = document.createElement("form");
|
var form = document.createElement("form");
|
||||||
form.action = "/vendor/create";
|
form.action = "/resetpassword/list";
|
||||||
form.method = "POST";
|
form.method = "get";
|
||||||
|
|
||||||
|
var input1 = document.createElement("input");
|
||||||
|
input1.type = "hidden";
|
||||||
|
input1.name = "searchn";
|
||||||
|
input1.value = searchn;
|
||||||
|
form.appendChild(input1);
|
||||||
|
|
||||||
|
var input2 = document.createElement("input");
|
||||||
|
input2.type = "hidden";
|
||||||
|
input2.name = "search";
|
||||||
|
input2.value = search;
|
||||||
|
form.appendChild(input2);
|
||||||
|
|
||||||
|
var input3 = document.createElement("input");
|
||||||
|
input3.type = "hidden";
|
||||||
|
input3.name = "p";
|
||||||
|
input3.value = pageNow;
|
||||||
|
form.appendChild(input3);
|
||||||
|
|
||||||
|
var input4 = document.createElement("input");
|
||||||
|
input4.type = "hidden";
|
||||||
|
input4.name = "resetpassword";
|
||||||
|
input4.value = resetpassword;
|
||||||
|
form.appendChild(input4);
|
||||||
|
|
||||||
document.body.appendChild(form);
|
document.body.appendChild(form);
|
||||||
form.submit();
|
form.submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("body").on("click", ".detailTr", function(){
|
$("#cancelrequest").on("click",function(){
|
||||||
var id = $(this).data("id");
|
var cancelrequest = $("#cancelrequest").val();
|
||||||
|
|
||||||
var form = document.createElement("form");
|
var form = document.createElement("form");
|
||||||
form.action = "/vendor/read";
|
form.action = "/resetpassword/list";
|
||||||
form.method = "POST";
|
form.method = "get";
|
||||||
|
|
||||||
|
var input1 = document.createElement("input");
|
||||||
|
input1.type = "hidden";
|
||||||
|
input1.name = "searchn";
|
||||||
|
input1.value = searchn;
|
||||||
|
form.appendChild(input1);
|
||||||
|
|
||||||
|
var input2 = document.createElement("input");
|
||||||
|
input2.type = "hidden";
|
||||||
|
input2.name = "search";
|
||||||
|
input2.value = search;
|
||||||
|
form.appendChild(input2);
|
||||||
|
|
||||||
|
var input3 = document.createElement("input");
|
||||||
|
input3.type = "hidden";
|
||||||
|
input3.name = "p";
|
||||||
|
input3.value = 1;
|
||||||
|
form.appendChild(input3);
|
||||||
|
|
||||||
|
var input4 = document.createElement("input");
|
||||||
|
input4.type = "hidden";
|
||||||
|
input4.name = "cancelrequest";
|
||||||
|
input4.value = cancelrequest;
|
||||||
|
form.appendChild(input4);
|
||||||
|
|
||||||
document.body.appendChild(form);
|
document.body.appendChild(form);
|
||||||
|
|
||||||
var input = document.createElement("input");
|
|
||||||
input.type = "hidden";
|
|
||||||
input.name = "id";
|
|
||||||
input.value = id;
|
|
||||||
form.appendChild(input);
|
|
||||||
|
|
||||||
form.submit();
|
form.submit();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//검색기능
|
//검색기능
|
||||||
@@ -138,7 +180,7 @@
|
|||||||
var search = $("#search").val();
|
var search = $("#search").val();
|
||||||
|
|
||||||
var form = document.createElement("form");
|
var form = document.createElement("form");
|
||||||
form.action = "/vendor/list";
|
form.action = "/resetpassword/list";
|
||||||
form.method = "get";
|
form.method = "get";
|
||||||
|
|
||||||
var input1 = document.createElement("input");
|
var input1 = document.createElement("input");
|
||||||
@@ -167,35 +209,36 @@
|
|||||||
|
|
||||||
|
|
||||||
});//ready
|
});//ready
|
||||||
function pageingFunction(clickedId){
|
$("#before, #pageNow, #after").on("click", function () {
|
||||||
var searchn1 = $("#searchn1").val();
|
var searchn = $("#searchn1").val();
|
||||||
var search1 = $("#search1").val();
|
var search = $("#search1").val();
|
||||||
|
|
||||||
var form = document.createElement("form");
|
var form = document.createElement("form");
|
||||||
form.action = "/vendor/list";
|
form.action = "/resetpassword/list";
|
||||||
form.method = "get";
|
form.method = "get";
|
||||||
|
|
||||||
var input1 = document.createElement("input");
|
var input1 = document.createElement("input");
|
||||||
input1.type = "hidden";
|
input1.type = "hidden";
|
||||||
input1.name = "searchn";
|
input1.name = "searchn";
|
||||||
input1.value = searchn1;
|
input1.value = searchn;
|
||||||
form.appendChild(input1);
|
form.appendChild(input1);
|
||||||
|
|
||||||
var input2 = document.createElement("input");
|
var input2 = document.createElement("input");
|
||||||
input2.type = "hidden";
|
input2.type = "hidden";
|
||||||
input2.name = "search";
|
input2.name = "search";
|
||||||
input2.value = search1;
|
input2.value = search;
|
||||||
form.appendChild(input2);
|
form.appendChild(input2);
|
||||||
|
|
||||||
var input3 = document.createElement("input");
|
var input3 = document.createElement("input");
|
||||||
input3.type = "hidden";
|
input3.type = "hidden";
|
||||||
input3.name = "p";
|
input3.name = "p1";
|
||||||
input3.value = clickedId;
|
input3.value = clickedId;
|
||||||
form.appendChild(input3);
|
form.appendChild(input3);
|
||||||
|
|
||||||
|
|
||||||
document.body.appendChild(form);
|
document.body.appendChild(form);
|
||||||
form.submit();
|
form.submit();
|
||||||
}
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user