Преглед изворни кода

[권한적용] 환자관리,의료진관리, 생치관리, 협력병원관리, 푸시관리, api 서비스 관리,api서비스신청

huiwon.seo пре 4 година
родитељ
комит
2d669737ee

+ 7 - 1
src/main/java/com/lemon/lifecenter/dto/StaffDTO.java

@@ -19,8 +19,14 @@ public class StaffDTO {
     private int limit = 0;
     private int limitMax = 0;
     private String sesId="";
+    private String groupName="";
     
-    
+    public String getGroupName() {
+        return groupName;
+    }
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
     public String getSesId() {
         return sesId;
     }

+ 12 - 17
src/main/resources/mybatis/mapper/staff/staff.xml

@@ -20,21 +20,15 @@
               LEFT OUTER JOIN CENTER_INFO CI
                 ON M.CENTER_CODE = CI.CENTER_CODE
              WHERE 1 = 1
-               AND (M.GROUP_IDX = 2 OR M.GROUP_IDX = 3)
+               AND M.CENTER_CODE != 0
         ]]>
         
-        <if test='groupIdx != "1"'>
+        <if test='centerCode != "0"'>
             <![CDATA[
                AND M.CENTER_CODE = #{centerCode}
             ]]>
         </if>
         
-        <if test='groupIdx != null and groupIdx != "" and groupIdx == "3"'>
-            <![CDATA[
-                AND M.ID = #{sesId}
-            ]]>
-        </if>
-        
         <if test='useYn != null and useYn != ""'>
             <![CDATA[
                 AND M.USE_YN = #{useYn}
@@ -73,25 +67,23 @@
                    GROUP_IDX                                         AS groupIdx,
                    DATE_FORMAT(M.LAST_LOGIN_TIME, '%Y-%m-%d %H:%i')  AS lastLoginTime,
                    DATE_FORMAT(M.CREATE_DATE, '%Y-%m-%d %H:%i')      AS createDate,
-                   M.USE_YN                                          AS useYn
+                   M.USE_YN                                          AS useYn,
+                   GL.GROUP_NAME                                     AS groupName
               FROM MEMBER M
               LEFT OUTER JOIN CENTER_INFO CI
                 ON M.CENTER_CODE = CI.CENTER_CODE
+              LEFT JOIN GROUP_LIST GL
+                ON GL.IDX = GROUP_IDX
              WHERE 1 = 1
-               AND (M.GROUP_IDX = 2 OR M.GROUP_IDX = 3)
+               AND M.CENTER_CODE != 0
         ]]>
         
-        <if test='groupIdx != "1"'>
+        <if test='centerCode != "0"'>
             <![CDATA[
                AND M.CENTER_CODE = #{centerCode}
             ]]>
         </if>
         
-        <if test='groupIdx != null and groupIdx != "" and groupIdx == "3"'>
-            <![CDATA[
-                AND M.ID = #{sesId}
-            ]]>
-        </if>
         <if test='useYn != null and useYn != ""'>
             <![CDATA[
                 AND M.USE_YN = #{useYn}
@@ -213,8 +205,11 @@
                    DATE_FORMAT(M.LAST_LOGIN_TIME, '%Y-%m-%d %H:%i') AS lastLoginTime,
                    DATE_FORMAT(M.CREATE_DATE, '%Y-%m-%d %H:%i')     AS createDate,
                    DATE_FORMAT(M.UPDATE_DATE, '%Y-%m-%d %H:%i')     AS updateDate,
-                   M.UPDATE_BY_ID                                   AS updateById
+                   M.UPDATE_BY_ID                                   AS updateById,
+                   GL.GROUP_NAME                                    AS groupName
               FROM MEMBER M
+              LEFT JOIN GROUP_LIST GL
+                ON GL.IDX = M.GROUP_IDX
              WHERE 1 = 1
                AND id = #{id}
         ]]>

+ 14 - 8
src/main/webapp/WEB-INF/jsp/api/info.jsp

@@ -182,12 +182,14 @@ $( function(){
                                                     <div class="col-12">
                                                         <c:if test="${viewType eq 'MANAGER'}">
                                                             <div class="text-right">
-                                                                <c:if test="${info.useYn ne 'D'}">
-                                                                    <c:if test="${info.useYn eq 'W'}">
-                                                                        <button type="submit" class="btn btn-primary w100">승인</button>
-                                                                    </c:if>
-                                                                    <c:if test="${info.useYn eq 'C'}">
-                                                                        <button type="submit" class="btn btn-danger w100">해제</button>
+                                                                <c:if test="${role._UPDATE eq 'Y'}">
+                                                                    <c:if test="${info.useYn ne 'D'}">
+                                                                        <c:if test="${info.useYn eq 'W'}">
+                                                                            <button type="submit" class="btn btn-primary w100">승인</button>
+                                                                        </c:if>
+                                                                        <c:if test="${info.useYn eq 'C'}">
+                                                                            <button type="submit" class="btn btn-danger w100">해제</button>
+                                                                        </c:if>
                                                                     </c:if>
                                                                 </c:if>
                                                                 <button type="button" class="btn btn-outline-primary w100" onclick="location.href='./list';">목록</button>
@@ -199,7 +201,9 @@ $( function(){
                                                 <c:if test="${viewType eq 'USER'}">
                                                     <div class="row mb-5">
                                                         <div class="col-12 text-center">
-                                                            <button type="button" class="btn btn-success btn-block p-2" onclick="location.href='./edit';">신청자 정보 수정</button>
+                                                            <c:if test="${role._UPDATE eq 'Y'}">
+                                                                <button type="button" class="btn btn-success btn-block p-2" onclick="location.href='./edit';">신청자 정보 수정</button>
+                                                            </c:if>
                                                         </div>
                                                     </div>
                                                 </c:if>
@@ -1367,7 +1371,9 @@ public static String aesEncrypt(String encKey, byte[] iv, String paramInput) thr
                                     
                                     <c:if test="${info eq null}">
                                         <div class="mt-5 border-top pt-5 pb-5">
-                                            <button type="button" class="btn btn-primary btn-lg btn-block p-2" onclick="location.href='./new';">비대면진료시스템 API 서비스 신청하기</button>
+                                            <c:if test="${role._CREATE eq 'Y'}">
+                                                <button type="button" class="btn btn-primary btn-lg btn-block p-2" onclick="location.href='./new';">비대면진료시스템 API 서비스 신청하기</button>
+                                            </c:if>
                                         </div>
                                     </c:if>
                                 </c:if>

+ 8 - 4
src/main/webapp/WEB-INF/jsp/center/info.jsp

@@ -62,9 +62,11 @@ function pwReset() {
                                 <div class="card-body">
                                     <div class="row mb-3">
                                         <div class="col-12">
-                                            <div class="text-right">
-                                                <button class="btn btn-primary w100" onclick="location.href='./edit?centerCode=${centerCode}';">정보수정</button>
-                                            </div>
+                                            <c:if test="${role._UPDATE eq 'Y'}">
+                                                <div class="text-right">
+                                                    <button class="btn btn-primary w100" onclick="location.href='./edit?centerCode=${centerCode}';">정보수정</button>
+                                                </div>
+                                            </c:if>
                                         </div>
                                     </div>
                                     <table class="table mobile-table">
@@ -145,7 +147,9 @@ function pwReset() {
                                     <div class="row mt-3">
                                         <div class="col-12">
                                             <div class="text-right">
-                                                <button type="button" class="btn btn-warning w150" onclick="pwReset();">비밀번호 초기화</button>
+                                                <c:if test="${role._UPDATE eq 'Y'}">
+                                                    <button type="button" class="btn btn-warning w150" onclick="pwReset();">비밀번호 초기화</button>
+                                                </c:if>
                                                 <button type="button" class="btn btn-primary w100" onclick="location.href='./list';">확인</button>
                                             </div>
                                         </div>

+ 3 - 4
src/main/webapp/WEB-INF/jsp/center/list.jsp

@@ -129,10 +129,7 @@ function getExcel(){
                                                         <option value="">전체</option>
                                                         <c:forEach var="i" items="${locationList}">
                                                             <option value="${i.locationCode}" <c:if test="${i.locationCode eq locationCode}"> selected="selected"</c:if>><c:out value="${i.locationName}"/></option>
-                                                            
                                                         </c:forEach>
-    <!--                                                     <option value="info">서울특별시</option> -->
-    <!--                                                     <option value="warning">경기도</option> -->
                                                     </select>
                                                 </td>
                                                 <th>생활치료센터명</th>
@@ -196,7 +193,9 @@ function getExcel(){
                                         </div>
                                         <div class="col-6 text-right">
                                             <button class="btn btn-success" data-toggle="modal" data-target="#excelDownMemo">Excel 다운로드</button>
-                                            <button class="btn btn-primary" onclick="location.href='./new';">생활치료센터 신규 등록</button>
+                                            <c:if test="${role._CREATE eq 'Y'}">
+                                                <button class="btn btn-primary" onclick="location.href='./new';">생활치료센터 신규 등록</button>
+                                            </c:if>
                                         </div>
                                     </div>
                                     <div class="table-responsive">

+ 3 - 1
src/main/webapp/WEB-INF/jsp/cooperation/info.jsp

@@ -38,7 +38,9 @@
                                         <div class="row mb-3">
                                             <div class="col-12">
                                                 <div class="text-right">
-                                                    <button type="button" class="btn btn-primary w100" onclick="location.href='./edit?cooperativeCode=${info.cooperativeCode}';">정보수정</button>
+                                                    <c:if test="${role._UPDATE eq 'Y'}">
+                                                        <button type="button" class="btn btn-primary w100" onclick="location.href='./edit?cooperativeCode=${info.cooperativeCode}';">정보수정</button>
+                                                    </c:if>
                                                 </div>
                                             </div>
                                         </div>

+ 3 - 1
src/main/webapp/WEB-INF/jsp/cooperation/list.jsp

@@ -116,7 +116,9 @@ var endDate   = "<c:out value='${endDate}'/>";
                                             <fmt:formatNumber value="${total}" pattern="#,###" />
                                         </div>
                                         <div class="col-6 text-right">
-                                            <button class="btn btn-primary" onclick="location.href='./new';">협력병원 신규 등록</button>
+                                            <c:if test="${role._CREATE eq 'Y'}">
+                                                <button class="btn btn-primary" onclick="location.href='./new';">협력병원 신규 등록</button>
+                                            </c:if>
                                         </div>
                                     </div>
                                     <div class="table-responsive">

+ 1 - 1
src/main/webapp/WEB-INF/jsp/patient/info.jsp

@@ -93,7 +93,7 @@ function goListPage(){
                                             <div class="col-12">
                                                 <div class="text-right">
                                                     <c:if test="${role._UPDATE eq 'Y'}">
-                                                        <button type="button" class="btn btn-dark" data-toggle="modal" data-target="#updateCenterInfo" onclick="">생활치료센터 이관</button>
+<!--                                                         <button type="button" class="btn btn-dark" data-toggle="modal" data-target="#updateCenterInfo" onclick="">생활치료센터 이관</button> -->
                                                     </c:if>
                                                     
                                                     <button type="button" class="btn btn-warning w100" onclick="location.href='/clinic/info?patientIdx=${patientIdx}';">건강정보</button>

+ 6 - 2
src/main/webapp/WEB-INF/jsp/push/info.jsp

@@ -199,8 +199,12 @@ function deleteConfirm(){
                                             <div class="col-12">
                                                 <div class="text-right">
                                                     <button type="button" class="btn btn-outline-primary w100" onclick="location.href='./list'">목록</button>
-                                                    <button type="submit" class="btn btn-primary w100">수정</button>
-                                                    <button type="button" class="btn btn-danger w100" onclick="deleteConfirm();">삭제</button>
+                                                    <c:if test="${role._UPDATE eq 'Y'}">
+                                                        <button type="submit" class="btn btn-primary w100">수정</button>
+                                                    </c:if>
+                                                    <c:if test="${role._DELETE eq 'Y'}">
+                                                        <button type="button" class="btn btn-danger w100" onclick="deleteConfirm();">삭제</button>
+                                                    </c:if>
                                                 </div>
                                             </div>
                                         </div>

+ 11 - 9
src/main/webapp/WEB-INF/jsp/push/list.jsp

@@ -173,6 +173,10 @@ function pushDetail( t ){
     targetBox.find( "textarea.push-content" ).val( $this.siblings( "input.push-content" ).val() );
 }
 </script>
+<style>
+.pointer{cursor:pointer;}
+.pointer span:hover{text-decoration: underline;}
+</style>
 </head>
 <body>
     <div class="modal fade" id="defaultModalPrimary_1" tabindex="-1" role="dialog" aria-hidden="true">
@@ -432,12 +436,10 @@ function pushDetail( t ){
                                         <div class="col-6">전체 :<fmt:formatNumber value="${total}" pattern="#,###" />
                                         </div>
                                         <div class="col-6 text-right">
-<%--                                             <c:if test="${data._SES_GROUP_IDX ne 1}"> --%>
-<%--                                                 <c:if test="${sesGroupIdx eq '1' or sesGroupIdx eq '2'}"> --%>
-                                                    <button class="btn btn-secondary" onclick="location.href='./schedule/list';">예약 푸시 현황</button>
-                                                    <button class="btn btn-primary" onclick="location.href='./send';">신규 푸시 발송</button>
-<%--                                                 </c:if> --%>
-<%--                                             </c:if> --%>
+                                            <button class="btn btn-secondary" onclick="location.href='./schedule/list';">예약 푸시 현황</button>
+                                            <c:if test="${role._CREATE eq 'Y'}">
+                                                <button class="btn btn-primary" onclick="location.href='./send';">신규 푸시 발송</button>
+                                            </c:if>
                                         </div>
                                     </div>
                                     <div class="table-responsive">
@@ -523,17 +525,17 @@ function pushDetail( t ){
                                                         <td class="text-right">
                                                             <fmt:formatNumber value="${pl.totalCount}" pattern="#,###" />
                                                         </td>
-                                                        <td class="text-right text-success">
+                                                        <td class="text-right text-success pointer">
                                                             <span class="text-link push-result" accesskey="success"  data-toggle="modal" data-target="#sendResultList">
                                                                 <fmt:formatNumber value="${pl.successCount}" pattern="#,###" />
                                                             </span>
                                                         </td>
-                                                        <td class="text-right text-danger">
+                                                        <td class="text-right text-danger pointer">
                                                             <span class="text-link push-result" accesskey="fail" data-toggle="modal" data-target="#sendResultList">
                                                                 <fmt:formatNumber value="${pl.failCount}" pattern="#,###" />
                                                             </span>
                                                         </td>
-                                                        <td class="text-right text-warning">
+                                                        <td class="text-right text-warning pointer">
                                                             <span class="text-link push-result" accesskey="wait" data-toggle="modal" data-target="#sendResultList">
                                                                 <fmt:formatNumber value="${pl.waitCount}" pattern="#,###" />
                                                             </span>

+ 4 - 79
src/main/webapp/WEB-INF/jsp/push/schedule.jsp

@@ -169,12 +169,10 @@
                                             <fmt:formatNumber value="${total}" pattern="#,###" />
                                         </div>
                                         <div class="col-6 text-right">
-<%--                                             <c:if test="${data._SES_GROUP_IDX ne 1}"> --%>
-<%--                                                 <c:if test="${sesGroupIdx eq '1' or sesGroupIdx eq '2'}"> --%>
-                                                    <button class="btn btn-info" onclick="location.href='../list';">푸시 발송 현황</button>
-                                                    <button class="btn btn-primary" onclick="location.href='../send';">신규 푸시 발송</button>
-<%--                                                 </c:if> --%>
-<%--                                             </c:if> --%>
+                                            <button class="btn btn-info" onclick="location.href='../list';">푸시 발송 현황</button>
+                                            <c:if test="${role._CREATE eq 'Y'}">
+                                                <button class="btn btn-primary" onclick="location.href='../send';">신규 푸시 발송</button>
+                                            </c:if>
                                         </div>
                                     </div>
                                     <div class="table-responsive">
@@ -244,86 +242,13 @@
                                                         </c:forEach>
                                                     </c:otherwise>
                                                 </c:choose>
-<%--                                                 <c:choose> --%>
-<%--                                                     <c:when test="${total > 0}"> --%>
-<%--                                                         <c:forEach var="l" items="${item}"> --%>
-<!--                                                             <tr> -->
-<%--                                                                 <td><c:out value="${l.num}" /></td> --%>
-<!--                                                                 <td> -->
-<%--                                                                     <a href="./info?staffId=${l.id}"><c:out value="${l.id}" /></a> --%>
-<!--                                                                 </td> -->
-<%--                                                                 <td><c:out value="${l.name}" /></td> --%>
-<%--                                                                 <td><c:out value="${l.centerName}" /></td> --%>
-<!--                                                                 <td> -->
-<%--                                                                     <c:if test="${l.groupIdx eq 1}">시스템관리자</c:if> --%>
-<%--                                                                     <c:if test="${l.groupIdx eq 2}">관리자</c:if> --%>
-<%--                                                                     <c:if test="${l.groupIdx eq 3}">일반사용자</c:if> --%>
-<!--                                                                 </td> -->
-<%--                                                                 <td><c:out value="${l.lastLoginTime}" /></td> --%>
-<%--                                                                 <td><c:out value="${l.createDate}" /></td> --%>
-<!--                                                                 <td> -->
-<%--                                                                     <c:choose> --%>
-<%--                                                                         <c:when test="${l.useYn == 'Y'}"> --%>
-<!--                                                                             <span class="text-success">활성</span> -->
-<%--                                                                         </c:when> --%>
-<%--                                                                         <c:otherwise> --%>
-<!--                                                                             <span class="text-danger">비활성</span> -->
-<%--                                                                         </c:otherwise> --%>
-                                                                    
-<%--                                                                     </c:choose> --%>
-<!--                                                                 </td> -->
-<!--                                                             </tr> -->
-<%--                                                         </c:forEach> --%>
-<%--                                                     </c:when> --%>
-<%--                                                     <c:otherwise> --%>
-<!--                                                         <tr> -->
-<!--                                                             <td colspan="11">등록된 푸시가 없습니다.</td> -->
-<!--                                                         </tr> -->
-<%--                                                     </c:otherwise> --%>
-<%--                                                 </c:choose> --%>
-                                                <!-- <tr>
-                                                    <td>9</td>
-                                                    <td>
-                                                        <a href="javscript:;">김레몬</a>
-                                                    </td>
-                                                    <td>남</td>
-                                                    <td>55</td>
-                                                    <td>1501</td>
-                                                    <td>2020-10-13 15:23</td>
-                                                    <td>2020-10-15 10:15</td>
-                                                    <td>-</td>
-                                                </tr> -->
                                             </tbody>
                                         </table>
                                     </div>
-                                    <div class="row mt-5">
-                                        <div class="col-12 col-lg-6 mb-2">
-<!--                                             <select class="custom-select form-control col-md-2" id="inputState" name="inputState"> -->
-<!--                                                 <option value="success" selected="">전체</option> -->
-<!--                                                 <option value="info">입소</option> -->
-<!--                                                 <option value="warning">퇴소</option> -->
-<!--                                             </select> -->
-                                        </div>
-                                        <div class="col-12 col-lg-6 mb-2">
-<%--                                             <jsp:include page="${data._INCLUDE}/paging.jsp" flush="true"> --%>
-<%--                                                 <jsp:param name="firstPageNo" value="${paging.firstPageNo}" /> --%>
-<%--                                                 <jsp:param name="prevPageNo"  value="${paging.prevPageNo}" /> --%>
-<%--                                                 <jsp:param name="startPageNo" value="${paging.startPageNo}" /> --%>
-<%--                                                 <jsp:param name="pageNo"      value="${paging.pageNo}" /> --%>
-<%--                                                 <jsp:param name="endPageNo"   value="${paging.endPageNo}" /> --%>
-<%--                                                 <jsp:param name="nextPageNo"  value="${paging.nextPageNo}" /> --%>
-<%--                                                 <jsp:param name="finalPageNo" value="${paging.finalPageNo}" /> --%>
-<%--                                                 <jsp:param name="preFix"      value="${paging.preFix}" /> --%>
-<%--                                                 <jsp:param name="url"         value="${paging.url}" /> --%>
-<%--                                                 <jsp:param name="total"       value="${paging.totalCount}" /> --%>
-<%--                                             </jsp:include> --%>
-                                        </div>
-                                    </div>
                                 </div>
                             </div>
                         </div>
                     </div>
-                    <!-- 의료진 관리 END -->
                 </div>
             </main>
 

+ 4 - 6
src/main/webapp/WEB-INF/jsp/staff/info.jsp

@@ -76,7 +76,7 @@ function deleteConfirm(){
                                     <div class="row mb-3">
                                         <div class="col-12">
                                             <div class="text-right">
-                                                <c:if test="${data._SES_GROUP_IDX ne '1'}">
+                                                <c:if test="${role._UPDATE eq 'Y'}">
                                                     <c:if test="${info.id eq sesId}">
                                                         <button class="btn btn-secondary w100" onclick="location.href='./myinfo';">내정보 변경</button>
                                                     </c:if>
@@ -123,9 +123,7 @@ function deleteConfirm(){
                                             <tr>
                                                 <th>권한</th>
                                                 <td>
-                                                    <c:if test="${info.groupIdx eq 1}">시스템관리자</c:if>
-                                                    <c:if test="${info.groupIdx eq 2}">관리자</c:if>
-                                                    <c:if test="${info.groupIdx eq 3}">일반사용자</c:if>
+                                                    <c:out value="${info.groupName}"/>
                                                 </td>
                                                 <th>상태</th>
                                                 <td>
@@ -165,11 +163,11 @@ function deleteConfirm(){
                                             <div class="col-12">
                                                 <div class="text-right">
                                                     <c:if test="${info.id ne sesId}">
-                                                        <c:if test="${data._SES_GROUP_IDX eq '2'}">
+                                                        <c:if test="${role._DELETE eq 'Y'}">
                                                             <button type="button" class="btn btn-danger w100" onclick="deleteConfirm();">삭제</button>
                                                         </c:if>
                                                     
-                                                        <c:if test="${data._SES_GROUP_IDX ne '1'}">
+                                                        <c:if test="${role._UPDATE eq 'Y'}">
                                                             <button type="button" class="btn btn-warning w150" onclick="pwReset();">비밀번호 초기화</button>
                                                         </c:if>
                                                     </c:if>

+ 3 - 9
src/main/webapp/WEB-INF/jsp/staff/list.jsp

@@ -88,10 +88,8 @@
                                             <fmt:formatNumber value="${total}" pattern="#,###" />
                                         </div>
                                         <div class="col-6 text-right">
-                                            <c:if test="${data._SES_GROUP_IDX ne 1}">
-                                                <c:if test="${sesGroupIdx eq '1' or sesGroupIdx eq '2'}">
-                                                    <button class="btn btn-primary" onclick="location.href='./new';">의료진 신규 등록</button>
-                                                </c:if>
+                                            <c:if test="${role._CREATE eq 'Y'}">
+                                                <button class="btn btn-primary" onclick="location.href='./new';">의료진 신규 등록</button>
                                             </c:if>
                                         </div>
                                     </div>
@@ -130,11 +128,7 @@
                                                                 </td>
                                                                 <td><c:out value="${l.name}" /></td>
                                                                 <td><c:out value="${l.centerName}" /></td>
-                                                                <td>
-                                                                    <c:if test="${l.groupIdx eq 1}">시스템관리자</c:if>
-                                                                    <c:if test="${l.groupIdx eq 2}">관리자</c:if>
-                                                                    <c:if test="${l.groupIdx eq 3}">일반사용자</c:if>
-                                                                </td>
+                                                                <td><c:out value="${l.groupName}" /></td>
                                                                 <td><c:out value="${l.lastLoginTime}" /></td>
                                                                 <td><c:out value="${l.createDate}" /></td>
                                                                 <td>