ads367 / yj_portal star
박정하 박정하 04-26
240426 박정하 일반 회원 관리
@358478e358ae50c8e9414e5796b171a6a2e14535
.idea/dataSources.xml
--- .idea/dataSources.xml
+++ .idea/dataSources.xml
@@ -12,5 +12,17 @@
       </jdbc-additional-properties>
       <working-dir>$ProjectFileDir$</working-dir>
     </data-source>
+    <data-source source="LOCAL" name="[email protected]" uuid="b6b803e3-d638-4654-8d07-5ac10c3c3829">
+      <synchronize>true</synchronize>
+      <imported>true</imported>
+      <configured-by-url>true</configured-by-url>
+      <remarks>$PROJECT_DIR$/src/main/resources/application.yml</remarks>
+      <jdbc-driver>net.sf.log4jdbc.sql.jdbcapi.DriverSpy</jdbc-driver>
+      <jdbc-url>jdbc:log4jdbc:postgresql://210.180.118.83:5432/yj_cms?currentSchema=yj_cms</jdbc-url>
+      <jdbc-additional-properties>
+        <property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
+      </jdbc-additional-properties>
+      <working-dir>$ProjectFileDir$</working-dir>
+    </data-source>
   </component>
 </project>
(파일 끝에 줄바꿈 문자 없음)
src/main/java/com/takensoft/cms/author/service/Impl/AuthorServiceImpl.java
--- src/main/java/com/takensoft/cms/author/service/Impl/AuthorServiceImpl.java
+++ src/main/java/com/takensoft/cms/author/service/Impl/AuthorServiceImpl.java
@@ -99,8 +99,6 @@
         return result;
     }
 
-
-
     /**
      * @author takensoft
      * @since 2024.04.05
src/main/java/com/takensoft/cms/mber/dao/MberDAO.java
--- src/main/java/com/takensoft/cms/mber/dao/MberDAO.java
+++ src/main/java/com/takensoft/cms/mber/dao/MberDAO.java
@@ -89,8 +89,15 @@
 
     /**
      * @author 박정하
-     * @since 2024.04.03
+     * @since 2024.04.23
      * 사용자 정보 수정
      */
     int updateUser(HashMap<String, Object> params);
+
+    /**
+     * @author 박정하
+     * @since 2024.04.26
+     * 회원 권한 삭제
+     */
+    int deleteByMbrId(HashMap<String, Object> params);
 }
src/main/java/com/takensoft/cms/mber/dto/JoinDTO.java
--- src/main/java/com/takensoft/cms/mber/dto/JoinDTO.java
+++ src/main/java/com/takensoft/cms/mber/dto/JoinDTO.java
@@ -83,6 +83,14 @@
      */
     private boolean useYn;
     /**
+     * 차단일
+     */
+    private String cntrlDt;
+    /**
+     * 차단사유
+     */
+    private String cntrlRsn;
+    /**
      * 문자수신여부
      * N: 거부, Y: 허용
      */
src/main/java/com/takensoft/cms/mber/service/Impl/MberServiceImpl.java
--- src/main/java/com/takensoft/cms/mber/service/Impl/MberServiceImpl.java
+++ src/main/java/com/takensoft/cms/mber/service/Impl/MberServiceImpl.java
@@ -1,5 +1,6 @@
 package com.takensoft.cms.mber.service.Impl;
 
+import com.takensoft.cms.author.dto.AuthorDTO;
 import com.takensoft.cms.mber.dao.MberDAO;
 import com.takensoft.cms.mber.dto.JoinDTO;
 import com.takensoft.cms.mber.dto.PasswordDTO;
@@ -195,6 +196,8 @@
         if (mberVO.getTelno() != null && !mberVO.getTelno().equals("")) {
             mberVO.setTelno(Secret.decrypt(mberVO.getTelno().toString()));
         }
+        // 사용자 권한 조회
+
         return mberVO;
     }
 
@@ -235,7 +238,25 @@
         }
 
         // 수정자 조회 및 등록
-        params.put("rgtr", jwtUtil.getWriter());
+        if(jwtUtil.getWriter() != null && !jwtUtil.getWriter().equals("")) {
+            params.put("mdfr", jwtUtil.getWriter());
+        }
+
+        // 권한 수정
+        result += mberDAO.deleteByMbrId(params);
+        if(params.get("authorList") != null && !params.get("authorList").equals("")) {
+            List<HashMap<String, Object>> authorList = (List<HashMap<String, Object>>) params.get("authorList");
+            for(HashMap<String, Object> author : authorList) {
+                MberAuthorVO mberAuthorVO = new MberAuthorVO();
+                mberAuthorVO.setMbrId(author.get("mbrId").toString());
+                mberAuthorVO.setAuthrtCd(author.get("authrtCd").toString());
+                // 작성자 조회 및 등록
+                if(jwtUtil.getWriter() != null && !jwtUtil.getWriter().equals("")) {
+                    mberAuthorVO.setRgtr(jwtUtil.getWriter());
+                }
+                result += mberDAO.authorSave(mberAuthorVO);
+            }
+        }
 
         // 회원정보 수정
         result += mberDAO.updateUser(params);
src/main/java/com/takensoft/cms/mber/web/AdmMberController.java
--- src/main/java/com/takensoft/cms/mber/web/AdmMberController.java
+++ src/main/java/com/takensoft/cms/mber/web/AdmMberController.java
@@ -93,20 +93,24 @@
      */
     @PostMapping(value = "/joinProc.json")
     public ResponseEntity<?> joinProc(@RequestBody @Valid JoinDTO joinDTO, HttpServletRequest req) throws Exception {
+        // 응답 처리
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(new MediaType("application", "json", Charset.forName("UTF-8")));
+        ResponseData responseData = new ResponseData();
+
         // 아이디 중복 검사
         boolean isExistence = mberService.findByCheckLoginId(joinDTO.getLgnId());
         if(isExistence) {
-            throw new IdDuplicationException("이미 존재하는 아이디입니다.");
+            responseData.setStatus(HttpStatus.OK);
+            responseData.setMessage("이미 존재하는 아이디입니다.");
+            return new ResponseEntity<>(responseData, headers, HttpStatus.INTERNAL_SERVER_ERROR);
+//            throw new IdDuplicationException("이미 존재하는 아이디입니다.");
         }
 
         // 회원가입 진행
         HashMap<String, Object> result = mberService.userJoin(req, joinDTO);
         int insertResult = (int) result.get("result");
 
-        // 응답 처리
-        HttpHeaders headers = new HttpHeaders();
-        headers.setContentType(new MediaType("application", "json", Charset.forName("UTF-8")));
-        ResponseData responseData = new ResponseData();
         if(insertResult > 0) {
             responseData.setStatus(HttpStatus.OK);
             responseData.setMessage("정상적으로 회원가입 처리되었습니다.");
src/main/resources/mybatis/mapper/entInfo/entInfo-SQL.xml
--- src/main/resources/mybatis/mapper/entInfo/entInfo-SQL.xml
+++ src/main/resources/mybatis/mapper/entInfo/entInfo-SQL.xml
@@ -48,7 +48,7 @@
             , #{clsbizYn}
             , 'Y'
             , #{rgtr}
-            , now()::timestamp
+            , now()
         )
     </insert>
 
src/main/resources/mybatis/mapper/mber/mber-SQL.xml
--- src/main/resources/mybatis/mapper/mber/mber-SQL.xml
+++ src/main/resources/mybatis/mapper/mber/mber-SQL.xml
@@ -77,6 +77,8 @@
             , daddr
             , mbr_stts
             , use_yn
+            , cntrl_dt
+            , cntrl_rsn
             , sms_rcptn_agre_yn
             , eml_rcptn_agre_yn
             , prvc_rcptn_agre_yn
@@ -98,8 +100,10 @@
             , #{zip}
             , #{addr}
             , #{daddr}
-            , 1
+            , #{mbrStts}
             , 'Y'
+            , #{cntrlDt}::timestamp
+            , #{cntrlRsn}
             , #{smsRcptnAgreYn}
             , #{emlRcptnAgreYn}
             , #{prvcRcptnAgreYn}
@@ -145,7 +149,7 @@
              , mi.daddr
              , mi.mbr_stts
              , mi.use_yn
-             , TO_CHAR(mi.cntrl_dt, 'YYYY-MM-DD HH24:MI') AS cntrl_dt
+             , TO_CHAR(mi.cntrl_dt, 'YYYY-MM-DD') AS cntrl_dt
              , mi.cntrl_rsn
              , mi.sms_rcptn_agre_yn
              , mi.eml_rcptn_agre_yn
@@ -287,7 +291,7 @@
     <select id="findAllMbr" resultMap="mberMap">
         <include refid="findAll"></include>
         WHERE mi.use_yn = 'Y'
-        AND mai.authrt_cd = 'ROLE_USER'
+        AND mai.authrt_cd != 'ROLE_ADMIN'
         <include refid="selectRequirement" />
         ORDER BY mi.reg_dt DESC
         OFFSET #{limitStart} LIMIT #{recordSize}
@@ -329,26 +333,37 @@
         내 용 : 회원정보 수정
     -->
     <update id="updateUser" parameterType="HashMap">
-        UPDATE mbr_info AS mi
-        SET mi.mbr_nm = #{mbrNm}
-          , mi.ncnm = #{ncnm}
-          , mi.mbl_telno = #{mblTelno}
-          , mi.telno = #{telno}
-          , mi.eml = #{eml}
-          , mi.zip = #{zip}
-          , mi.addr = #{addr}
-          , mi.daddr = #{daddr}
-          , mi.mbr_stts = #{mbrStts}
-          , mi.use_yn = #{useYn}
-          , mi.cntrl_dt = #{cntrlDt}
-          , mi.cntrl_rsn = #{cntrlRsn}
-          , mi.sms_rcptn_agre_yn = #{smsRcptnAgreYn}
-          , mi.eml_rcptn_agre_yn = #{emlRcptnAgreYn}
-          , mi.prvc_rcptn_agre_yn = #{prvcRcptnAgreYn}
-          , mi.mbr_type = #{mbrType}
-          , mi.sys_pvsn_yn = #{sysPvsnYn}
-          , mi.mdfr = #{mdfr}
-          , mi.mdfcn_dt = NOW()
+        UPDATE mbr_info
+        SET mbr_nm = #{mbrNm}
+          , ncnm = #{ncnm}
+          , mbl_telno = #{mblTelno}
+          , telno = #{telno}
+          , eml = #{eml}
+          , zip = #{zip}
+          , addr = #{addr}
+          , daddr = #{daddr}
+          , mbr_stts = #{mbrStts}
+          , use_yn = #{useYn}
+          , cntrl_dt = #{cntrlDt}::timestamp
+          , cntrl_rsn = #{cntrlRsn}
+          , sms_rcptn_agre_yn = #{smsRcptnAgreYn}
+          , eml_rcptn_agre_yn = #{emlRcptnAgreYn}
+          , prvc_rcptn_agre_yn = #{prvcRcptnAgreYn}
+          , mbr_type = #{mbrType}
+          , sys_pvsn_yn = #{sysPvsnYn}
+          , mdfr = #{mdfr}
+          , mdfcn_dt = NOW()
         WHERE mbr_id = #{mbrId}
     </update>
+
+    <!--
+        작성자 : 박정하
+        작성일 : 2024.04.26
+        내 용 : 회원 권한 삭제
+    -->
+    <delete id="deleteByMbrId" parameterType="HashMap">
+        DELETE
+        FROM mbr_authrt_info
+        WHERE mbr_id = #{mbrId}
+    </delete>
 </mapper>
(파일 끝에 줄바꿈 문자 없음)
Add a comment
List