From cbd12550df9145af167597af041648f6df671734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Wed, 12 Oct 2022 18:22:20 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=9E=91=EC=97=85=EC=A4=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../faisp/userInfo/UserInfoController.java | 11 ++ .../faisp/userInfo/model/DashboardConfig.java | 36 +++++ .../repository/DashboardConfigRepository.java | 12 ++ .../userInfo/service/UserInfoService.java | 7 + .../faisp/userInfo/userMgtController.java | 6 +- src/main/resources/static/js/user/info.js | 25 +--- .../fpiMgt/affairResult/resultMgt.html | 2 +- src/main/resources/templates/user/myInfo.html | 133 +++--------------- 8 files changed, 87 insertions(+), 145 deletions(-) create mode 100644 src/main/java/com/dbnt/faisp/userInfo/model/DashboardConfig.java create mode 100644 src/main/java/com/dbnt/faisp/userInfo/repository/DashboardConfigRepository.java diff --git a/src/main/java/com/dbnt/faisp/userInfo/UserInfoController.java b/src/main/java/com/dbnt/faisp/userInfo/UserInfoController.java index b55e9cc6..f5cebc7e 100644 --- a/src/main/java/com/dbnt/faisp/userInfo/UserInfoController.java +++ b/src/main/java/com/dbnt/faisp/userInfo/UserInfoController.java @@ -3,9 +3,12 @@ package com.dbnt.faisp.userInfo; import com.dbnt.faisp.userInfo.model.UserInfo; import com.dbnt.faisp.userInfo.service.UserInfoService; import lombok.RequiredArgsConstructor; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +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.RestController; +import org.springframework.web.servlet.ModelAndView; @RestController @RequiredArgsConstructor @@ -18,4 +21,12 @@ public class UserInfoController { public String insertUserInfo(UserInfo insertReqInfo) { return userInfoService.insertUserInfo(insertReqInfo); } + + @GetMapping("/myInfo") + public ModelAndView myInfoPage(@AuthenticationPrincipal UserInfo loginUser){ + ModelAndView mav = new ModelAndView("user/myInfo"); + mav.addObject("userInfo", loginUser); + mav.addObject("dashboardConfig", userInfoService.getDashboardConfigList(loginUser.getUserSeq())); + return mav; + } } diff --git a/src/main/java/com/dbnt/faisp/userInfo/model/DashboardConfig.java b/src/main/java/com/dbnt/faisp/userInfo/model/DashboardConfig.java new file mode 100644 index 00000000..94182999 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/userInfo/model/DashboardConfig.java @@ -0,0 +1,36 @@ +package com.dbnt.faisp.userInfo.model; + +import lombok.*; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.io.Serializable; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "dashboard_config") +@IdClass(DashboardConfig.DashboardConfigId.class) +public class DashboardConfig { + @Id + @Column(name = "menu_key") + private Integer menuKey; + @Id + @Column(name = "user_seq") + private Integer userSeq; + @Column(name = "order_num") + private Integer orderNum; + + @Embeddable + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class DashboardConfigId implements Serializable { + private Integer menuKey; + private Integer userSeq; + } +} diff --git a/src/main/java/com/dbnt/faisp/userInfo/repository/DashboardConfigRepository.java b/src/main/java/com/dbnt/faisp/userInfo/repository/DashboardConfigRepository.java new file mode 100644 index 00000000..b97a87af --- /dev/null +++ b/src/main/java/com/dbnt/faisp/userInfo/repository/DashboardConfigRepository.java @@ -0,0 +1,12 @@ +package com.dbnt.faisp.userInfo.repository; + +import com.dbnt.faisp.userInfo.model.DashboardConfig; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + + +public interface DashboardConfigRepository extends JpaRepository { + + List findByUserSeqOrderByOrderNum(Integer userSeq); +} diff --git a/src/main/java/com/dbnt/faisp/userInfo/service/UserInfoService.java b/src/main/java/com/dbnt/faisp/userInfo/service/UserInfoService.java index dbfbd4f5..58de955f 100644 --- a/src/main/java/com/dbnt/faisp/userInfo/service/UserInfoService.java +++ b/src/main/java/com/dbnt/faisp/userInfo/service/UserInfoService.java @@ -2,7 +2,9 @@ package com.dbnt.faisp.userInfo.service; import com.dbnt.faisp.config.Role; import com.dbnt.faisp.userInfo.mapper.UserInfoMapper; +import com.dbnt.faisp.userInfo.model.DashboardConfig; import com.dbnt.faisp.userInfo.model.UserInfo; +import com.dbnt.faisp.userInfo.repository.DashboardConfigRepository; import com.dbnt.faisp.userInfo.repository.UserInfoRepository; import com.dbnt.faisp.util.ParamMap; @@ -22,6 +24,7 @@ import java.util.List; public class UserInfoService implements UserDetailsService { private final UserInfoRepository userInfoRepository; + private final DashboardConfigRepository dashboardConfigRepository; private final UserInfoMapper userInfoMapper; @Transactional @@ -112,4 +115,8 @@ public class UserInfoService implements UserDetailsService { public List selectManagerList(ParamMap param) { return userInfoMapper.selectManagerList(param); } + + public List getDashboardConfigList(Integer userSeq) { + return dashboardConfigRepository.findByUserSeqOrderByOrderNum(userSeq); + } } diff --git a/src/main/java/com/dbnt/faisp/userInfo/userMgtController.java b/src/main/java/com/dbnt/faisp/userInfo/userMgtController.java index b7789d8d..f79a79f6 100644 --- a/src/main/java/com/dbnt/faisp/userInfo/userMgtController.java +++ b/src/main/java/com/dbnt/faisp/userInfo/userMgtController.java @@ -1,8 +1,6 @@ package com.dbnt.faisp.userInfo; -import com.dbnt.faisp.authMgt.service.AuthMgtService; import com.dbnt.faisp.codeMgt.service.CodeMgtService; -import com.dbnt.faisp.menuMgt.service.MenuMgtService; import com.dbnt.faisp.userInfo.service.UserInfoService; import com.dbnt.faisp.userInfo.model.UserInfo; import lombok.RequiredArgsConstructor; @@ -18,16 +16,14 @@ import org.springframework.web.servlet.ModelAndView; @RequestMapping("/userMgt") public class userMgtController { - private final MenuMgtService menuMgtService; private final UserInfoService userInfoService; - private final AuthMgtService authMgtService; private final CodeMgtService codeMgtService; @GetMapping("/userMgtPage") public ModelAndView codeMgtPage(UserInfo userInfo) { ModelAndView mav = new ModelAndView("adminPage/userMgt/userMgt"); userInfo.setQueryInfo(); - if(userInfo.getUserStatus() == "" || userInfo.getUserStatus() == null) { + if(userInfo.getUserStatus().equals("") || userInfo.getUserStatus() == null) { userInfo.setUserStatus("USC003"); } mav.addObject("userInfoList", userInfoService.selectUserInfoList(userInfo)); diff --git a/src/main/resources/static/js/user/info.js b/src/main/resources/static/js/user/info.js index 16d169cd..9b57b749 100644 --- a/src/main/resources/static/js/user/info.js +++ b/src/main/resources/static/js/user/info.js @@ -1,5 +1,5 @@ $(function (){ - tableSort(); + }) $(document).on('click', '#savePasswordBtn', function (){ @@ -60,27 +60,4 @@ function passwordCheck(){ } } return returnFlag; - -} - -function tableSort(){ - $("#categorySelectBody").find("tbody").each(function (idx, tbody){ - let lastCategorySeq = 0 - $(tbody).find(".depth2Td").each(function (idx, td){ - lastCategorySeq = removeInnerText(td, lastCategorySeq); - }) - $(tbody).find(".depth3Td").each(function (idx, td){ - lastCategorySeq = removeInnerText(td, lastCategorySeq); - }) - }) -} - -function removeInnerText(td, lastCategorySeq){ - const categorySeq = Number($(td).attr("data-categoryseq")); - if(lastCategorySeq !== categorySeq){ - lastCategorySeq = categorySeq; - }else{ - td.innerText = '' - } - return lastCategorySeq; } \ No newline at end of file diff --git a/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultMgt.html b/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultMgt.html index 84866376..1192c4e3 100644 --- a/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultMgt.html +++ b/src/main/resources/templates/igActivities/fpiMgt/affairResult/resultMgt.html @@ -25,7 +25,7 @@ -
+
diff --git a/src/main/resources/templates/user/myInfo.html b/src/main/resources/templates/user/myInfo.html index 8347a7cf..2c28e5d1 100644 --- a/src/main/resources/templates/user/myInfo.html +++ b/src/main/resources/templates/user/myInfo.html @@ -7,124 +7,27 @@
-
-

개인정보

- -
+

마이페이지

+ +
-
+
-
-
-
계정정보
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- - - - - -
-
-
- -
- - - - - + +
+
+ +
+
-
-
-
- -
- -
-
-
-
- -
-
-
-
-
- -
-
작성 권한
-
-
-
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
연도중분류소분류
-
-
-
-
-
-
-
-
@@ -138,7 +41,7 @@