diff --git a/src/main/java/com/no1/wms/account/AccountController.java b/src/main/java/com/no1/wms/account/AccountController.java index 6f2218d..196cb1c 100644 --- a/src/main/java/com/no1/wms/account/AccountController.java +++ b/src/main/java/com/no1/wms/account/AccountController.java @@ -3,17 +3,22 @@ package com.no1.wms.account; import com.no1.wms.utils.ConstantValues; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import java.util.List; @Controller +@RequestMapping("/account") public class AccountController { @Autowired AccountService accountService; + @GetMapping("/list") public ModelAndView list(ModelAndView mav, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "0") int start){ List list = accountService.selectAll(search, start, ConstantValues.PER_PAGE); @@ -23,4 +28,19 @@ public class AccountController { return mav; } + @PostMapping("/create") + public ModelAndView create(ModelAndView mav){ + mav.setViewName("account/create"); + return mav; + } + + @PostMapping("/show_modal") + public ModelAndView showModal(ModelAndView mav, @RequestParam String name){ + //db에서 데이터 가져오는거 필요 + + // + mav.setViewName(name); + return mav; + } + } diff --git a/src/main/java/com/no1/wms/account/AccountDto.java b/src/main/java/com/no1/wms/account/AccountDto.java index ae525d4..33ef0aa 100644 --- a/src/main/java/com/no1/wms/account/AccountDto.java +++ b/src/main/java/com/no1/wms/account/AccountDto.java @@ -1,5 +1,6 @@ package com.no1.wms.account; +import com.no1.wms.authority.AuthorityDto; import com.no1.wms.department.DepartmentDto; import com.no1.wms.position.PositionDto; import lombok.AllArgsConstructor; @@ -27,8 +28,14 @@ public class AccountDto { private Date birth; private String telephone; private String address; - private DepartmentDto department; - private PositionDto position; + private String departmentId; + private String positionId; + + private DepartmentDto departmentDto; + private PositionDto positionDto; + private AuthorityDto groupAuthorityDto; + private AuthorityDto personalAuthorityDto; + @Builder.Default private Boolean activation = true; diff --git a/src/main/java/com/no1/wms/account/AccountService.java b/src/main/java/com/no1/wms/account/AccountService.java index b0e64e6..8ee5c24 100644 --- a/src/main/java/com/no1/wms/account/AccountService.java +++ b/src/main/java/com/no1/wms/account/AccountService.java @@ -25,7 +25,9 @@ public class AccountService { public List selectAll(String search, int start, int perPage){ HashMap map = new HashMap(); - + map.put("search", search); + map.put("start", start); + map.put("perPage", perPage); diff --git a/src/main/java/com/no1/wms/account/DeptAndPositionDto.java b/src/main/java/com/no1/wms/account/DeptAndPositionDto.java new file mode 100644 index 0000000..7f9a328 --- /dev/null +++ b/src/main/java/com/no1/wms/account/DeptAndPositionDto.java @@ -0,0 +1,17 @@ +package com.no1.wms.account; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.ibatis.type.Alias; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Alias("DeptPositionDto") +public class DeptAndPositionDto { + private String id; + private String name; +} diff --git a/src/main/resources/mappers/AccountMapper.xml b/src/main/resources/mappers/AccountMapper.xml index 571d0fd..77da4d4 100644 --- a/src/main/resources/mappers/AccountMapper.xml +++ b/src/main/resources/mappers/AccountMapper.xml @@ -1,6 +1,72 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into account + ( + id, employee_number, password, email, group_authority_id, + personal_authority_id, name, gender, birth, telephone, address, + department_id, position_id, activation + ) + VALUES + ( + UUID(), #{employeeNumber}, #{password}, + #{email}, #{groupAuthorityId}, + #{personalAuthorityId},#{name},#{gender}, + #{birth},#{stelephone}, #{address}, + #{departmentId},#{positionId},#{activation} + ) + \ No newline at end of file diff --git a/src/main/resources/static/css/base.css b/src/main/resources/static/css/base.css index 5e56a4d..0c6c846 100644 --- a/src/main/resources/static/css/base.css +++ b/src/main/resources/static/css/base.css @@ -63,4 +63,8 @@ .col-centered{ margin: 0 auto; float: none; +} + +input:read-only{ + background-color: #ececec; } \ No newline at end of file diff --git a/src/main/resources/static/dev/authority_list_dev.html b/src/main/resources/static/dev/authority_list_dev.html index ffa5c9c..f70b8f0 100644 --- a/src/main/resources/static/dev/authority_list_dev.html +++ b/src/main/resources/static/dev/authority_list_dev.html @@ -4,9 +4,9 @@ - + - + diff --git a/src/main/resources/static/dev/layout_dev.html b/src/main/resources/static/dev/layout_dev.html index f396b95..1b8f7bd 100644 --- a/src/main/resources/static/dev/layout_dev.html +++ b/src/main/resources/static/dev/layout_dev.html @@ -157,6 +157,7 @@ //검색 팝업 모달 관련 const searchModalBootStrap = new bootstrap.Modal("#search_modal"); $("#search_modal_show_button").on("click", function(){ + searchModalBootStrap.show(); }); diff --git a/src/main/webapp/WEB-INF/tiles/tiles.xml b/src/main/webapp/WEB-INF/tiles/tiles.xml index bd77f29..f087feb 100644 --- a/src/main/webapp/WEB-INF/tiles/tiles.xml +++ b/src/main/webapp/WEB-INF/tiles/tiles.xml @@ -12,7 +12,7 @@ - + diff --git a/src/main/webapp/WEB-INF/views/account/create.jsp b/src/main/webapp/WEB-INF/views/account/create.jsp new file mode 100644 index 0000000..8d67b42 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/account/create.jsp @@ -0,0 +1,89 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + + +
+
+
+
+

사용자 추가

+
+
+
+
+
+
+
+
+
+ 사용자 명 + + + 사번 + +
+
+ 부서 명 + + + + 직책 + + +
+
+ 권한 + + + +
+
+ 이메일 + + + 전화번호 + +
+
+ 성별 + + + 생일 + +
+
+
+
+
+ + +
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/account/dept_modal.html b/src/main/webapp/WEB-INF/views/account/dept_modal.html new file mode 100644 index 0000000..d0574ea --- /dev/null +++ b/src/main/webapp/WEB-INF/views/account/dept_modal.html @@ -0,0 +1,59 @@ + + + + + Title + + + + + + + + + +
+
+
+

권한 검색

+
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + +
권한명
관리자
사원
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/account/list.jsp b/src/main/webapp/WEB-INF/views/account/list.jsp new file mode 100644 index 0000000..2b727c5 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/account/list.jsp @@ -0,0 +1,101 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + + + +
+
+
+
+

그룹 권한 관리

+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + +
사번사용자 명활성 여부
${dto.employeeNumber}${dto.name} + + O + X + +
+
+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/base/layout.jsp b/src/main/webapp/WEB-INF/views/base/layout.jsp index 13e2bf8..a4fa431 100644 --- a/src/main/webapp/WEB-INF/views/base/layout.jsp +++ b/src/main/webapp/WEB-INF/views/base/layout.jsp @@ -23,7 +23,7 @@ +
+
+
+ + + + + + + + + + + + + + + +
번호권한 명선택
${status.count}${dto.name}
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/modal/auth.jsp b/src/main/webapp/WEB-INF/views/modal/auth.jsp new file mode 100644 index 0000000..f6c767f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/modal/auth.jsp @@ -0,0 +1,49 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + +
+
+
+ +
+
+ + + + + + + + + + + + + + +
권한명
관리자
사원
+
+
+
\ No newline at end of file