박정하 박정하 2023-07-20
20230720 박정하 대상자 및 보호자 계정 관련 작업
@03838e9daef0538ac5d5986f1979acc56df636f6
client/resources/css/main.css
--- client/resources/css/main.css
+++ client/resources/css/main.css
@@ -849,7 +849,7 @@
   margin-bottom: 0;
 }
 
-/* 생활보호사 정보 */
+/* 보호사 정보 */
 .caregiver-info p {
   font-size: 1.6rem;
   margin-bottom: 1rem;
client/views/component/Modal_Guardian.jsx
--- client/views/component/Modal_Guardian.jsx
+++ client/views/component/Modal_Guardian.jsx
@@ -61,6 +61,11 @@
       alert("연락처를 입력해 주세요.");
       return false;
     }
+    if (guardian['user_phonenumber'].length < 7) {
+      guardianRef.current['user_phonenumber'].focus();
+      alert("연락처를 7자리 이상 입력해 주세요.");
+      return false;
+    }
 
     guardian['user_id'] = guardian['user_phonenumber'];
     fetch("/user/userSelectOne.json", {
@@ -186,6 +191,11 @@
       alert("연락처 중복확인을 해주세요.");
       return false;
     }
+    if (guardian['user_phonenumber'].length < 7) {
+      guardianRef.current['user_phonenumber'].focus();
+      alert("연락처를 7자리 이상 입력해 주세요.");
+      return false;
+    }
     if (CommonUtil.isEmpty(guardian['user_address']) == true) {
       guardianRef.current['user_address'].focus();
       alert("주소를 입력해 주세요.");
client/views/component/Modal_Matching.jsx
--- client/views/component/Modal_Matching.jsx
+++ client/views/component/Modal_Matching.jsx
@@ -24,9 +24,9 @@
 
   const thead = [
     "No",
-    "생활보호사 명",
-    "생활보호사 ID",
-    "생활보호사 연락처",
+    "보호사 명",
+    "보호사 ID",
+    "보호사 연락처",
     "매칭 일자",
     "삭제"
   ];
client/views/component/Modal_SeniorInsert.jsx
--- client/views/component/Modal_SeniorInsert.jsx
+++ client/views/component/Modal_SeniorInsert.jsx
@@ -170,6 +170,11 @@
       alert("연락처를 입력해 주세요.");
       return false;
     }
+    if (senior['user_phonenumber'].length < 7) {
+      seniorRef.current['user_phonenumber'].focus();
+      alert("연락처를 7자리 이상 입력해 주세요.");
+      return false;
+    }
 
     senior['user_id'] = senior['user_phonenumber'];
     fetch("/user/userSelectOne.json", {
@@ -229,6 +234,11 @@
       alert("연락처 중복확인을 해주세요.");
       return false;
     }
+    if (senior['user_phonenumber'].length < 7) {
+      seniorRef.current['user_phonenumber'].focus();
+      alert("연락처를 7자리 이상 입력해 주세요.");
+      return false;
+    }
     if (CommonUtil.isEmpty(senior['user_address']) == true) {
       seniorRef.current['user_address'].focus();
       alert("주소를 입력해 주세요.");
client/views/pages/App.jsx
--- client/views/pages/App.jsx
+++ client/views/pages/App.jsx
@@ -11,7 +11,7 @@
 import { setLoginUser, setSeniorList, setCurrentSeniorIndex } from "./AppStore.jsx";
 
 //Application의 Route 정보를 관리하는 Component
-import {AdminApp, GovernmentApp, AgencyApp, AgencyAdminApp, GuardianApp} from "./AppRoute.jsx";
+import { AdminApp, GovernmentApp, AgencyApp, AgencyAdminApp, GuardianApp } from "./AppRoute.jsx";
 
 //Test Layout
 import Header from "../layout/Header.jsx";
@@ -49,7 +49,7 @@
 
   /**************** Firebase 푸시 설정 (시작) ****************/
   const messaging = getMessaging();
-  
+
   onMessage(messaging, (payload) => {
     console.log('Message received. ', payload);
   });
@@ -72,17 +72,17 @@
             setToken(currentToken);
 
             if (CommonUtil.isEmpty(loginUser) == false
-                && (CommonUtil.isEmpty(loginUser['push_token']) || loginUser['push_token'] != currentToken)) {  
+              && (CommonUtil.isEmpty(loginUser['push_token']) || loginUser['push_token'] != currentToken)) {
               loginUser['push_token'] = currentToken
               userUpdateForPushToken(loginUser);
             }
-      
+
             /* navigator.clipboard.writeText(currentToken).then(() => {
                 console.log("Text copied to clipboard... : ", currentToken);
             }).catch(err => {
                 console.log('Something went wrong', err);
             }); */
-      
+
           } else {
             // Show permission request UI
             console.log('No registration token available. Request permission to generate one.');
@@ -110,7 +110,7 @@
 
             // FCM 메세지 처리
             if (CommonUtil.isEmpty(loginUser) == false
-                && (CommonUtil.isEmpty(loginUser['is_push']) || loginUser['is_push'] == false)) {
+              && (CommonUtil.isEmpty(loginUser['is_push']) || loginUser['is_push'] == false)) {
               loginUser['is_push'] = true;
               userUpdateForIsPush(loginUser);
             }
@@ -118,7 +118,7 @@
             setIsPush(false);
 
             if (CommonUtil.isEmpty(loginUser) == false
-                && (CommonUtil.isEmpty(loginUser['is_push']) || loginUser['is_push'] == true)) {
+              && (CommonUtil.isEmpty(loginUser['is_push']) || loginUser['is_push'] == true)) {
               loginUser['is_push'] = false;
               userUpdateForIsPush(loginUser);
             }
@@ -136,18 +136,18 @@
   //const navigate = useNavigate();
 
   //전역 변수 저장 객체
-  const state = useSelector((state) => {return state});
+  const state = useSelector((state) => { return state });
   const dispatch = useDispatch();
 
   //로그인 여부
   const [isLogin, setIsLogin] = React.useState(false);
   //기본 비밀번호 사용 여부 확인 (로그인 여부 확인 후, 사용 바람)
   const [isDefaultPassword, setIsDefaultPassword] = React.useState(false);
-  
+
   //로그인에 따라 각기 다른 App 주입 대상 변수(AdminApp, GovernmentApp, AgencyApp, GuardianApp)
   const [appRoute, setAppRoute] = React.useState(null);
   const [menuItems, setMenuItems] = React.useState(null);
-  
+
   //로그인 사용자 조회
   const loginUserSelectOne = (clientLoginCheck) => {
     fetch("/user/loginUserSelectOne.json", {
@@ -158,8 +158,20 @@
       body: JSON.stringify({}),
     }).then((response) => response.json()).then((loginUser) => {
       console.log("로그인 결과 : ", loginUser);
+
       //로그인 사용자 정보 전역 변수에 저장
       dispatch(setLoginUser(loginUser));
+
+      if (loginUser) {
+        if (loginUser['government_type'] == 'HOSPITAL') {
+          loginUser['title_name'] = '의료사회복지사'
+        } else if (loginUser['government_type'] == 'WELFARE') {
+          loginUser['title_name'] = '생활지원사'
+        } else {
+          loginUser['title_name'] = '생활보호사'
+        }
+        dispatch(setLoginUser(loginUser));
+      }
 
       //로그인 유무(로그인 정보가 있으면 True, 없으면 False)
       let isLogin = (loginUser != null && loginUser['user_id'] != null);
@@ -235,7 +247,7 @@
     }).then((response) => response.json()).then((data) => {
       console.log("특정 보호자의 대상자(시니어) 목록 조회 : ", data);
       //로그인 사용자 정보 전역 변수에 저장
-      dispatch(setSeniorList({value: data}));
+      dispatch(setSeniorList({ value: data }));
     }).catch((error) => {
       console.log('login() /user/seniorSelectListByGuardian.json error : ', error);
     });
@@ -251,19 +263,19 @@
       if (isLogin == true) {
         if (loginResultData['authority'] == 'ROLE_ADMIN') {
           setMenuItems(AdminApp.menuItems);
-          setAppRoute(<AdminApp.AppRoute/>);
+          setAppRoute(<AdminApp.AppRoute />);
         } else if (loginResultData['authority'] == 'ROLE_GOVERNMENT') {
           setMenuItems(GovernmentApp.menuItems);
-          setAppRoute(<GovernmentApp.AppRoute/>);
+          setAppRoute(<GovernmentApp.AppRoute />);
         } else if (loginResultData['authority'] == 'ROLE_AGENCYADMIN') {
           setMenuItems(AgencyAdminApp.menuItems);
-          setAppRoute(<AgencyAdminApp.AppRoute/>);
+          setAppRoute(<AgencyAdminApp.AppRoute />);
         } else if (loginResultData['authority'] == 'ROLE_AGENCY') {
           setMenuItems(AgencyApp.menuItems);
-          setAppRoute(<AgencyApp.AppRoute/>);
+          setAppRoute(<AgencyApp.AppRoute />);
         } else if (loginResultData['authority'] == 'ROLE_GUARDIAN' || loginResultData['authority'] == 'ROLE_SENIOR') {
           setMenuItems(GuardianApp.menuItems);
-          setAppRoute(<GuardianApp.AppRoute/>);
+          setAppRoute(<GuardianApp.AppRoute />);
           if (loginResultData['authority'] == 'ROLE_GUARDIAN' && CommonUtil.isEmpty(state['seniorList'].value) == true) {
             seniorSelectListByGuardian(loginResultData);
           }
@@ -282,8 +294,8 @@
         setIsPush(null);
         setToken(null);
         dispatch(setLoginUser({}));
-        dispatch(setSeniorList({value: []}));
-        dispatch(setCurrentSeniorIndex({value: 0}));
+        dispatch(setSeniorList({ value: [] }));
+        dispatch(setCurrentSeniorIndex({ value: 0 }));
       }
     });
   }, [location]);
@@ -294,14 +306,14 @@
       {isLogin == true ?
         isDefaultPassword == false ? (
           <div id="layout">
-            <Header/>
-            <Menu items={menuItems != null ? menuItems : null}/>
+            <Header />
+            <Menu items={menuItems != null ? menuItems : null} />
             <div id="pages">
               {appRoute != null ? appRoute : null}
             </div>
           </div>
-        ) : (<PasswordChange/>)
-      : (<Login/>)}
+        ) : (<PasswordChange />)
+        : (<Login />)}
     </div>
   );
 }
client/views/pages/authority/AuthorityManagement-ryu.jsx
--- client/views/pages/authority/AuthorityManagement-ryu.jsx
+++ client/views/pages/authority/AuthorityManagement-ryu.jsx
@@ -7,7 +7,7 @@
   const [checkArr, setCheckArr] = React.useState([]); //check 배열
   const [menuCheckArr, setMenuCheckArr] = React.useState([]); //menu check 배열
 
-  const authorityList = ["보호자", "생활보호사", "병원", "지자체", "관리자"];
+  const authorityList = ["보호자", state.loginUser['title_name'], "병원", "지자체", "관리자"];
   const menuList = [
     {
       menu: {
client/views/pages/healthcare/Healthcare.jsx
--- client/views/pages/healthcare/Healthcare.jsx
+++ client/views/pages/healthcare/Healthcare.jsx
@@ -43,7 +43,7 @@
   React.useEffect(() => {
     searching();
   }, [isMySenior])
-  //생활보호사(간호사)의 돌봄 대상자(시니어)
+  //보호사(간호사)의 돌봄 대상자(시니어)
   const [senior, setSenior] = React.useState({
     seniorList: [], seniorListCount: 0, search: {
       'government_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id'],
@@ -54,7 +54,7 @@
       'perPage': 10,
     }
   });
-  //생활보호사(간호사)의 돌봄 대상자(시니어) 목록 조회
+  //보호사(간호사)의 돌봄 대상자(시니어) 목록 조회
   const seniorSelectList = (currentPage) => {
     senior.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage;
 
client/views/pages/healthcare/HealthcareAdmin.jsx
--- client/views/pages/healthcare/HealthcareAdmin.jsx
+++ client/views/pages/healthcare/HealthcareAdmin.jsx
@@ -43,7 +43,7 @@
   React.useEffect(() => {
     searching();
   }, [isMySenior])
-  //생활보호사(간호사)의 돌봄 대상자(시니어)
+  //보호사(간호사)의 돌봄 대상자(시니어)
   const [senior, setSenior] = React.useState({
     seniorList: [], seniorListCount: 0, search: {
       'government_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id'],
@@ -54,7 +54,7 @@
       'perPage': 10,
     }
   });
-  //생활보호사(간호사)의 돌봄 대상자(시니어) 목록 조회
+  //보호사(간호사)의 돌봄 대상자(시니어) 목록 조회
   const seniorSelectList = (currentPage) => {
     senior.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage;
 
client/views/pages/healthcare/Medicalcare.jsx
--- client/views/pages/healthcare/Medicalcare.jsx
+++ client/views/pages/healthcare/Medicalcare.jsx
@@ -46,7 +46,7 @@
     React.useEffect(() => {
         searching();
     }, [isMySenior])
-    //생활보호사(간호사)의 돌봄 대상자(시니어)
+    //보호사(간호사)의 돌봄 대상자(시니어)
 	const [senior, setSenior] = React.useState({seniorList: [], seniorListCount: 0, search: {
         'government_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id'],
         'agency_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['agency_id'],
@@ -55,7 +55,7 @@
 		'currentPage': 1,
 		'perPage': 10,
 	}});
-	//생활보호사(간호사)의 돌봄 대상자(시니어) 목록 조회
+	//보호사(간호사)의 돌봄 대상자(시니어) 목록 조회
 	const seniorSelectList = (currentPage) => {
 		senior.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage;
 
client/views/pages/healthcare/MedicalcareAdmin.jsx
--- client/views/pages/healthcare/MedicalcareAdmin.jsx
+++ client/views/pages/healthcare/MedicalcareAdmin.jsx
@@ -46,7 +46,7 @@
   React.useEffect(() => {
     searching();
   }, [isMySenior])
-  //생활보호사(간호사)의 돌봄 대상자(시니어)
+  //보호사(간호사)의 돌봄 대상자(시니어)
   const [senior, setSenior] = React.useState({
     seniorList: [], seniorListCount: 0, search: {
       'government_id': CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id'],
@@ -57,7 +57,7 @@
       'perPage': 10,
     }
   });
-  //생활보호사(간호사)의 돌봄 대상자(시니어) 목록 조회
+  //보호사(간호사)의 돌봄 대상자(시니어) 목록 조회
   const seniorSelectList = (currentPage) => {
     senior.search.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage;
 
client/views/pages/join/Join.jsx
--- client/views/pages/join/Join.jsx
+++ client/views/pages/join/Join.jsx
@@ -310,7 +310,7 @@
                     {CommonUtil.isEmpty(state.loginUser) == false && (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT' || state.loginUser['authority'] == 'ROLE_AGENCYADMIN') ?
                       <option value="ROLE_AGENCYADMIN" selected={user['authority'] == "ROLE_AGENCYADMIN"}>센터 관리자</option>
                     : null}
-                    <option value="ROLE_AGENCY" selected={user['authority'] == "ROLE_AGENCY"}>생활보호사</option>
+                    <option value="ROLE_AGENCY" selected={user['authority'] == "ROLE_AGENCY"}>{state.loginUser['title_name']}</option>
                 </select>
               </div>
             </div>
client/views/pages/main/Main_agencyAdmin.jsx
--- client/views/pages/main/Main_agencyAdmin.jsx
+++ client/views/pages/main/Main_agencyAdmin.jsx
@@ -358,7 +358,7 @@
         </div>
         <div className="content-box combine-right-government">
           <div className="flex">
-            <Title title={`생활보호사별 대상자 등록 현황`} explanation={"약상자 사용자의 데이터 차트가 보여집니다."} />
+            <Title title={state.loginUser['title_name'] + '별 대상자 등록 현황'} explanation={"약상자 사용자의 데이터 차트가 보여집니다."} />
           </div>
           <div style={{ height: 'calc(100% - 60px)' }}>
             {
client/views/pages/main/PasswordChange.jsx
--- client/views/pages/main/PasswordChange.jsx
+++ client/views/pages/main/PasswordChange.jsx
@@ -15,15 +15,15 @@
 
   //등록할 사용자 정보
   const [user, setUser] = React.useState({
-    'user_id': null,
-    'user_name': null,
+    // 'user_id': null,
+    // 'user_name': null,
     'user_password': null,
     'user_password_check': null,
-    'user_phonenumber': null,
-    'user_birth': null,
-    'user_gender': null,
-    'user_address': null,
-    'user_email': null,
+    // 'user_phonenumber': null,
+    // 'user_birth': null,
+    // 'user_gender': null,
+    // 'user_address': null,
+    // 'user_email': null,
     //'authority': CommonUtil.isEmpty(defaultAuthority) ? state.loginUser['authority'] : defaultAuthority,
     //'agency_id': CommonUtil.isEmpty(defaultAgencyId) ? state.loginUser['agency_id'] : defaultAgencyId,
     //'government_id': CommonUtil.isEmpty(defaultGovernmentId) ? state.loginUser['government_id'] : defaultGovernmentId,
@@ -55,25 +55,31 @@
     return true;
   }
 
-  //사용자 등록
+  //비밀번호 변경
   const userUpdate = () => {
     if (userInsertValidation() == false) {
       return;
     }
+
+    const userData = { ...state.loginUser };
+
+    userData['user_password'] = user['user_password'];
+
+    console.log("userData: ", userData)
 
     fetch("/user/userUpdate.json", {
       method: "POST",
       headers: {
         'Content-Type': 'application/json; charset=UTF-8'
       },
-      body: JSON.stringify(user),
+      body: JSON.stringify(userData),
     }).then((response) => response.json()).then((data) => {
-      console.log("사용자 등록 결과(건수) : ", data);
+      console.log("사용자 수정 결과(건수) : ", data);
       if (data > 0) {
-        alert("계정생성완료");
-        navigate(-1);
+        alert("비밀번호 변경 완료");
+        navigate('/');
       } else {
-        alert("계정생성에 실패하였습니다. 관리자에게 문의바랍니다.");
+        alert("비밀번호 변경에 실패하였습니다. 관리자에게 문의바랍니다.");
       }
     }).catch((error) => {
       console.log('userUpdate() /user/userInsert.json error : ', error);
client/views/pages/org/OrgSelect.jsx
--- client/views/pages/org/OrgSelect.jsx
+++ client/views/pages/org/OrgSelect.jsx
@@ -587,7 +587,7 @@
                                     <th>기관명</th>
                                     <th>관리장비개수</th>
                                     <th>관리자(명)</th>
-                                    <th>생활보호사(명)</th>
+                                    <th>{state.loginUser['title_name']}(명)</th>
                                     <th>돌봄 대상자(명)</th>
                                     <th>주소</th>
                                     <th>대표연락처</th>
@@ -608,7 +608,7 @@
                                             <td data-label="기관명">{item['government_name']}</td>
                                             <td data-label="관리 장비 개수">{item['equipment_count']}</td>
                                             <td data-label="관리자(명)">{item['government_user_count']}</td>
-                                            <td data-label="생활보호사(명)">{item['agent_user_count']}</td>
+                                            <td data-label="보호사(명)">{item['agent_user_count']}</td>
                                             <td data-label="돌봄 대상자(명)">{item['senior_user_count']}</td>
                                             <td data-label="주소">{item['government_address']}</td>
                                             <td data-label="대표 연락처">{item['government_phonenumber']}</td>
@@ -696,7 +696,7 @@
                                     <th>구분</th>
                                     <th>관리기관명</th>
                                     <th>기관명</th>
-                                    <th>생활보호사(명)</th>
+                                    <th>{state.loginUser['title_name']}(명)</th>
                                     <th>돌봄 대상자(명)</th>
                                     <th>주소</th>
                                     <th>대표연락처</th>
@@ -713,7 +713,7 @@
                                             <td data-label="구분">{orgTypes[item['agency_type']]}</td>
                                             <td data-label="관리기관명">{item['government_name']}</td>
                                             <td data-label="기관명">{item['agency_name']}</td>
-                                            <td data-label="생활보호사(명)">{item['agent_user_count']}</td>
+                                            <td data-label="보호사(명)">{item['agent_user_count']}</td>
                                             <td data-label="돌봄 대상자(명)">{item['senior_user_count']}</td>
                                             <td data-label="주소">{item['agency_address']}</td>
                                             <td data-label="대표 연락처">{item['agency_phonenumber']}</td>
client/views/pages/senior_management/SeniorSelectOne.jsx
--- client/views/pages/senior_management/SeniorSelectOne.jsx
+++ client/views/pages/senior_management/SeniorSelectOne.jsx
@@ -1,5 +1,6 @@
 import React from "react";
 import { useNavigate, useLocation } from "react-router";
+import { useSelector } from "react-redux";
 
 import Modal from "../../component/Modal.jsx";
 import SubTitle from "../../component/SubTitle.jsx";
@@ -13,6 +14,9 @@
 export default function SeniorSelectOne() {
   const navigate = useNavigate();
   const location = useLocation();
+
+  //전역 변수 저장 객체
+  const state = useSelector((state) => { return state });
 
   //보호자 모달 오픈 여부
   const [modalGuardianIsOpen, setModalGuardianIsOpen] = React.useState(false);
@@ -329,6 +333,7 @@
   const [agent, setAgent] = React.useState({ agentListBySenior: [], agentListCountBySenior: 0 });
   //대상자의 생활보호사 목록 조회
   const agentSelectListBySenior = () => {
+    
     fetch("/user/agentSelectListBySenior.json", {
       method: "POST",
       headers: {
@@ -392,7 +397,6 @@
         if (!senior_delete) {
           if (data > 0) {
             alert("담당자 매칭이 종료 되었습니다.");
-            seniorSelectListByAgent();
             agentSelectListBySenior();
           } else {
             alert("담당자 매칭 종료에 실패하였습니다.");
@@ -700,7 +704,7 @@
         </div>
 
 
-        <SubTitle explanation={"대상자의 생활보호사"} className="margin-bottom" />
+        <SubTitle explanation={"대상자의 " + state.loginUser['title_name']} className="margin-bottom" />
         <div className="margin-bottom5">
           <table className={"senior-user protector-user"}>
             <thead>
@@ -728,7 +732,7 @@
                     <td data-label="이름">{item['user_name']}</td>
                     <td data-label="연락처">{item['user_phonenumber']}</td>
                     <td data-label="이메일">{item['user_email']}</td>
-                    <td data-label="상태">{item['agent_match_state'] ? <span className="green">현재 생활보호사</span> : <span className="grey">이전 생활보호사</span>}</td>
+                    <td data-label="상태">{item['agent_match_state'] ? <span className="green">현재 {state.loginUser['title_name']}</span> : <span className="grey">이전 {state.loginUser['title_name']}</span>}</td>
                     <td data-label="배정시작일">{item['agent_match_start_date']}</td>
                     <td data-label="배정종료일">{item['agent_match_end_date']}</td>
                     <td data-label="관리">
client/views/pages/user_management/AgencyAdminSeniorSelect.jsx
--- client/views/pages/user_management/AgencyAdminSeniorSelect.jsx
+++ client/views/pages/user_management/AgencyAdminSeniorSelect.jsx
@@ -168,7 +168,7 @@
   // 시니어 - 담당자 매칭 
   const MatchSeniorAgency = () => {
     if (CommonUtil.isEmpty(workerId) == true) {
-      alert("생활보호사를 선택해 주세요.");
+      alert(state.loginUser['title_name'] + "를 선택해 주세요.");
       return;
     }
     var insertBtn = confirm("등록하시겠습니까?");
@@ -226,6 +226,58 @@
     });
   }
 
+
+  //대상자(시니어) 복구
+  const userUpdate = (senior) => {
+    senior.user_use = true
+
+    console.log("복구할 시니어 정보 : ", senior);
+
+    fetch("/user/userUpdate.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify(senior),
+    }).then((response) => response.json()).then((data) => {
+      console.log("사용자 수정 결과(건수) : ", data);
+      if (data > 0) {
+        alert("계정복구완료");
+        agentSelectList();
+        searching();
+      } else {
+        alert("계정복구에 실패하였습니다. 관리자에게 문의바랍니다.");
+      }
+    }).catch((error) => {
+      console.log('userUpdate() /user/userUpdate.json error : ', error);
+    });
+  }
+
+
+  //대상자(시니어) 삭제
+  const userDelete = (senior) => {
+    confirm("계정을 삭제하시겠습니까?\n계정을 삭제할 경우 복구할 수 없습니다.");
+
+    fetch("/user/userDelete.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify(senior),
+    }).then((response) => response.json()).then((data) => {
+      console.log("사용자 수정 결과(건수) : ", data);
+      if (data > 0) {
+        alert("계정삭제완료");
+        agentSelectList();
+        searching();
+      } else {
+        alert("계정삭제에 실패하였습니다. 관리자에게 문의바랍니다.");
+      }
+    }).catch((error) => {
+      console.log('userUpdate() /user/userUpdate.json error : ', error);
+    });
+  }
+
   React.useEffect(() => {
     agentSelectList();
     searching();
@@ -241,7 +293,7 @@
       <div>
         <div className="flex-align-start userauthoriylist gap5">
           <div className="left">
-            <SubTitle explanation={"우리기관 생활보호사"} />
+            <SubTitle explanation={"우리기관 " + state.loginUser['title_name']} />
             <div style={{ fontSize: '16px', marginTop: '0px' }} className="category">
               <a className="active" onClick={() => { agentChange(null) }}>
                 {state.loginUser['government_name']}
@@ -291,7 +343,7 @@
               } />
               <div className="btn-wrap flex-end margin-bottom ">
                 <button className={"btn-small gray-btn"} onClick={modalSeniorInsertOpen}>신규등록</button>
-                <button className={"btn-small gray-btn"} onClick={() => { openModal() }}>생활보호사 배정하기</button>
+                <button className={"btn-small gray-btn"} onClick={() => { openModal() }}>{state.loginUser['title_name']} 배정하기</button>
               </div>
             </div>
             <table className={"protector-user"}>
@@ -307,7 +359,7 @@
                   <th>성별</th>
                   <th>연락처</th>
                   <th>보호자</th>
-                  <th>생활보호사</th>
+                  <th>{state.loginUser['title_name']}</th>
                   <th>대상자관리</th>
                 </tr>
               </thead>
@@ -331,7 +383,7 @@
                           : item['guardian_user_names']
                         }
                       </td>
-                      <td data-label="생활보호사">
+                      <td data-label={state.loginUser['title_name']}>
                         {item['agent_user_names']}
                       </td>
                       <td data-label="대상자관리">
@@ -383,6 +435,8 @@
               <th>성별</th>
               <th>연락처</th>
               <th>보호자</th>
+              <th>계정복구</th>
+              <th>계정삭제</th>
               <th>대상자관리</th>
             </tr>
           </thead>
@@ -401,6 +455,12 @@
                       ? '없음'
                       : item['guardian_user_names']
                     }
+                  </td>
+                  <td>
+                    <button className="btn-small red-btn" onClick={() => { userUpdate(item) }}>계정복구</button>
+                  </td>
+                  <td>
+                    <button className="btn-small red-btn" onClick={() => { userDelete(item) }}>계정삭제</button>
                   </td>
                   <td data-label="대상자관리">
                     <button className="btn-small gray-btn" onClick={() => {
@@ -485,18 +545,18 @@
           </ul>
         </div>
       </div>
-      <Modal open={modalOpen} close={closeModal} header="생활보호사 배정하기">
+      <Modal open={modalOpen} close={closeModal} header={state.loginUser['title_name'] + " 배정하기"}>
         <div className="modal-visit board-wrap">
           <table className="margin-bottom">
             <tbody>
               <tr>
-                <th>담당 생활보호사</th>
+                <th>담당 {state.loginUser['title_name']}</th>
                 <td>
                   <select onChange={(e) => {
                     console.log('e.target.value : ', e.target.value);
                     setWorkerId(e.target.value);
                   }}>
-                    <option value="">담당 생활보호사를 선택해주세요.</option>
+                    <option value="">담당 {state.loginUser['title_name']}를 선택해주세요.</option>
                     {agent.userList.map((user, idx) => {
                       return (
                         <option key={idx} value={user['user_id']}>{user['user_name']}</option>
client/views/pages/user_management/AgentSelectOne.jsx
--- client/views/pages/user_management/AgentSelectOne.jsx
+++ client/views/pages/user_management/AgentSelectOne.jsx
@@ -1,5 +1,6 @@
 import React from "react";
 import { useNavigate, useLocation } from "react-router";
+import { useSelector } from "react-redux";
 
 import SubTitle from "../../component/SubTitle.jsx";
 import Modal_Guardian from "../../component/Modal_Guardian.jsx";
@@ -10,6 +11,8 @@
   const navigate = useNavigate();
   const location = useLocation();
 
+  //전역 변수 저장 객체
+  const state = useSelector((state) => { return state });
 
   //대상자(시니어) 등록 모달 오픈 여부
   const [modalSeniorInsertIsOpen, setModalSeniorInsertIsOpen] = React.useState(false);
@@ -239,7 +242,7 @@
 
         {agent['authority'] == 'ROLE_AGENCYADMIN' ? null : (
           <>
-            <SubTitle explanation={"생활보호사의 보호대상자"} className="margin-bottom display-inline-block" />
+            <SubTitle explanation={state.loginUser['title_name'] + "의 보호대상자"} className="margin-bottom display-inline-block" />
             <button className={"btn-small gray-btn display-inline-block float-right"} onClick={() => modalSeniorInsertOpen()}>보호대상자 추가</button>
             <div className="margin-bottom5">
               <table className={"agent-user"}>
client/views/pages/user_management/UserSelect.jsx
--- client/views/pages/user_management/UserSelect.jsx
+++ client/views/pages/user_management/UserSelect.jsx
@@ -253,8 +253,8 @@
     agent.search['government_id'] = null;
     agent.search['agency_id'] = null;
     agentSelectList();
-    agent.search['government_id'] = null;
-    agent.search['agency_id'] = null;
+    agentAdmin.search['government_id'] = null;
+    agentAdmin.search['agency_id'] = null;
     agentAdminSelectList();
     if (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') {
       government.search['government_id'] = null;
@@ -273,8 +273,8 @@
     agent.search['government_id'] = government_id;
     agent.search['agency_id'] = null;
     agentSelectList();
-    agent.search['government_id'] = government_id;
-    agent.search['agency_id'] = null;
+    agentAdmin.search['government_id'] = government_id;
+    agentAdmin.search['agency_id'] = null;
     agentAdminSelectList();
     if (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') {
       government.search['government_id'] = government_id;
@@ -293,8 +293,9 @@
     agent.search['government_id'] = government_id;
     agent.search['agency_id'] = agency_id;
     agentSelectList();
-    agent.search['government_id'] = government_id;
-    agent.search['agency_id'] = agency_id;
+
+    agentAdmin.search['government_id'] = government_id;
+    agentAdmin.search['agency_id'] = agency_id;
     agentAdminSelectList();
   }
 
@@ -331,6 +332,50 @@
       }
     }).catch((error) => {
       console.log('userUpdate() /user/userUpdate.json error : ', error);
+    });
+  }
+
+  //대상자 복구
+  const userRestore = (user) => {
+    user.user_use = true
+
+    console.log("복구할 계정 정보 : ", user);
+
+    fetch("/user/userUpdate.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify(user),
+    }).then((response) => response.json()).then((data) => {
+      console.log("사용자 수정 결과(건수) : ", data);
+      if (data > 0) {
+        alert("계정복구완료");
+        orgSelectListOfHierarchy();
+
+        if (CommonUtil.isEmpty(location.state) == false) {
+          const param = location.state;
+          if (CommonUtil.isEmpty(param['tabActiveByRoleType']) == false) {
+            setTabActiveByRoleType(param['tabActiveByRoleType']);
+          }
+          governmentChange(param['government_id']);
+          agencyChange(param['government_id'], param['agency_id']);
+        } else {
+          agentSelectList();
+          agentAdminSelectList();
+          if (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') {
+            governmentSelectList();
+          }
+        }
+
+        if (state.loginUser['authority'] == 'ROLE_ADMIN') {
+          adminSelectList();
+        }
+      } else {
+        alert("계정복구에 실패하였습니다. 관리자에게 문의바랍니다.");
+      }
+    }).catch((error) => {
+      console.log('userRestore() /user/userUpdate.json error : ', error);
     });
   }
 
@@ -423,7 +468,9 @@
 
                 {/* 탭 제목 */}
                 <ul className="tab-menu flex-end" >
-                  <li onClick={() => setTabActiveByRoleType('ROLE_AGENCY')} className={tabActiveByRoleType == 'ROLE_AGENCY' ? "active" : null}>생활보호사 ({agent.userListCount})</li>
+                  <li onClick={() => setTabActiveByRoleType('ROLE_AGENCY')} className={tabActiveByRoleType == 'ROLE_AGENCY' ? "active" : null}>
+                    {state.loginUser['title_name']}
+                    ({agent.userListCount})</li>
                   {state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_AGENCYADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT' ?
                     <li onClick={() => setTabActiveByRoleType('ROLE_AGENCYADMIN')} className={tabActiveByRoleType == 'ROLE_AGENCYADMIN' ? "active" : null}>센터 관리자 ({agentAdmin.userListCount})</li>
                     : null}
@@ -485,6 +532,7 @@
                                 <th>연락처</th>
                                 <th>이메일</th>
                                 <th>가입승인</th>
+                                {!isAgentType ? <th>활성화</th> : null}
                                 <th>상세보기</th>
                               </tr>
                             </thead>
@@ -503,6 +551,11 @@
                                         <button className={"btn-small red-btn"} onClick={() => { userUpdate(item, agentSelectList) }}>가입승인</button>
                                       }
                                     </td>
+                                    {!isAgentType ?
+                                      <td>
+                                        <button className={"btn-small red-btn"} onClick={() => { userRestore(item) }}>활성화</button>
+                                      </td>
+                                      : null}
                                     <td data-label="상세보기">
                                       <button className={"btn-small lightgray-btn"} onClick={() => { navigate("/AgentSelectOne", { state: { 'agent_id': item['user_id'] } }) }}>상세 페이지 이동</button>
                                     </td>
@@ -575,6 +628,9 @@
                                 <th>연락처</th>
                                 <th>이메일</th>
                                 <th>가입승인</th>
+                                {!isAgentAdminType ?
+                                  <th>활성화</th>
+                                  : null}
                                 <th>상세보기</th>
                               </tr>
                             </thead>
@@ -593,6 +649,11 @@
                                         <button className={"btn-small red-btn"} onClick={() => { userUpdate(item, agentAdminSelectList) }}>가입승인</button>
                                       }
                                     </td>
+                                    {!isAgentAdminType ?
+                                      <td>
+                                        <button className={"btn-small red-btn"} onClick={() => { userRestore(item) }}>활성화</button>
+                                      </td>
+                                      : null}
                                     <td data-label="상세보기">
                                       <button className={"btn-small lightgray-btn"} onClick={() => { navigate("/AgentSelectOne", { state: { 'agent_id': item['user_id'] } }) }}>상세 페이지 이동</button>
                                     </td>
@@ -639,20 +700,6 @@
                           </div>
 
                           <div className="radio-tab btn-wrap flex-end margin-bottom">
-                            <div className="flex-start">
-                              <div>
-                                <input type="radio" name="viewGovType" id="useGovTrue"
-                                  checked={isGovType}
-                                  onChange={(e) => { e.target.checked ? changeGovType(true) : null }} />
-                                <label htmlFor="useGovTrue">활성화</label>
-                              </div>
-                              <div>
-                                <input type="radio" name="viewGovType" id="useGovFalse"
-                                  checked={!isGovType}
-                                  onChange={(e) => { e.target.checked ? changeGovType(false) : null }} />
-                                <label htmlFor="useGovFalse">미활성화</label>
-                              </div>
-                            </div>
                             <button className={"btn-small gray-btn"} onClick={join}>등록</button>
                           </div>
 
Add a comment
List