Browse Source

api관리리스트 추가

databank102 4 years ago
parent
commit
ecd460fd0f

+ 61 - 1
src/main/java/com/lemon/lifecenter/controller/ApiManagerController.java

@@ -1,18 +1,78 @@
 package com.lemon.lifecenter.controller;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.ModelAndView;
 
+import com.lemon.lifecenter.common.LifeCenterConfigVO;
 import com.lemon.lifecenter.common.LifeCenterController;
+import com.lemon.lifecenter.common.LifeCenterFunction;
+import com.lemon.lifecenter.common.LifeCenterPaging;
+import com.lemon.lifecenter.common.LifeCenterSessionController;
+
+import com.lemon.lifecenter.dto.ApiManagerDTO;
+import com.lemon.lifecenter.dto.CooperationDTO;
+import com.lemon.lifecenter.service.ApiManagerService;
 
 @RestController
 @RequestMapping("/apiManager")
 public class ApiManagerController extends LifeCenterController {
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private ApiManagerService service;
+    
+    @Autowired
+    private LifeCenterConfigVO config;
+    
+    private LifeCenterPaging paging;
     
     @RequestMapping("/list")
-    public ModelAndView apiMangerList() {
+    public ModelAndView apiMangerList(
+            @ModelAttribute("dto") ApiManagerDTO dto,
+            @RequestParam(value="useYn", required=false, defaultValue="") String inputUseYn,
+            @RequestParam(value="hospitalName", required=false, defaultValue="") String inputHospitalName,
+            @RequestParam(value="page", required=false, defaultValue="1") int page,
+            
+            HttpServletRequest request,HttpServletResponse response) {
+        
+        dto.setLimit( ( Integer.valueOf( page ) - 1 ) * config.pageDataSize );
+        dto.setLimitMax( config.pageDataSize );
+        
+        int total = service.selectApiManagerCount(dto);
+        List<ApiManagerDTO> list = new ArrayList<ApiManagerDTO>();
+        if (total > 0) {
+            list = service.selectApiManagerList(dto);
+        }
+        
+        String param = "useYn="+inputUseYn+"&hospitalName="+inputHospitalName;
+        paging = LifeCenterPaging.getInstance();
+        paging.paging(config, total, page, param);
+            
         ModelAndView mv = setMV("api/list");
+        
+        mv.addObject("total", total);
+        mv.addObject("list", list);
+        mv.addObject("useYn", inputUseYn);
+        mv.addObject("hospitalName", inputHospitalName);
+        
+        mv.addObject("paging", paging);
+        mv.addObject("page", page);
+        mv.addObject("pageSize", dto.getLimitMax());
+        
         return mv;
     }
     

+ 26 - 58
src/main/webapp/WEB-INF/jsp/api/list.jsp

@@ -4,6 +4,10 @@
 <%@ page language="java" contentType="text/html; charset=UTF-8"
     pageEncoding="UTF-8"%>
 <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+<script>
+
+
+</script>
 </head>
 <body>
     <div class="wrapper">
@@ -14,7 +18,6 @@
 
             <main class="content">
                 <div class="container-fluid p-0">
-                    <!-- 의료진 관리 START -->
                     <div class="row">
                         <div class="col-12 col-lg-6">
                             <h1 class="h3 mb-3">API 서비스 관리</h1>
@@ -23,8 +26,7 @@
                             <nav aria-label="breadcrumb">
                                 <ol class="breadcrumb">
                                     <li class="breadcrumb-item"><a href="javscript:;">Home</a></li>
-                                    <li class="breadcrumb-item">공지사항</li>
-<!--                                     <li class="breadcrumb-item active">의료진 관리</li> -->
+                                    <li class="breadcrumb-item">API 서비스 관리</li>
                                 </ol>
                             </nav>
                         </div>
@@ -37,27 +39,28 @@
                                         <table class="table mobile-table">
                                             <colgroup>
                                                 <col style="width:10%">
-                                                <col style="width:40%">
+                                                <col style="width:20%">
+                                                <col style="width:10%">
+                                                <col style="width:50%">
                                                 <col style="width:10%">
-                                                <col style="width:40%">
                                             </colgroup>
                                             <tr>
                                                 <th>구분</th>
                                                 <td>
                                                     <div class="form-row">
-                                                        <div class="col-6">
-                                                            <select class="custom-select  form-control" id="selectState" name="selectState">
-                                                                <option value="title" <c:if test="${selectState eq 'title'}">selected="selected"</c:if>>제목</option>
-                                                                <option value="content" <c:if test="${selectState eq 'content'}">selected="selected"</c:if>>내용</option>
-<%--                                                                 <option value="sCenterName" <c:if test="${selectState eq 'sCenterName'}"> selected="selected"</c:if>>치료센터명</option> --%>
-                                                            </select>
-                                                        </div>
-                                                        <div class="col-6">
-                                                            <input type="text" class="form-control" name="searchTxt" value="${searchTxt}" placeholder="검색어를 입력하세요.">
-                                                        </div>
+                                                        <select class="custom-select  form-control" id="useYn" name="useYn">
+                                                            <option value="" <c:if test="${useYn eq ''}">selected="selected"</c:if>>전체</option>
+                                                            <option value="W" <c:if test="${useYn eq 'W'}">selected="selected"</c:if>>승인요청</option>
+                                                            <option value="C" <c:if test="${useYn eq 'C'}">selected="selected"</c:if>>승인완료</option>
+                                                            <option value="D" <c:if test="${useYn eq 'D'}">selected="selected"</c:if>>승인해제</option>
+                                                        </select>
                                                     </div>
                                                 </td>
-                                                <td colspan="2">
+                                                <th>검색어</th>
+                                                <td>
+                                                    <input type="text" class="form-control" name="hospitalName" value="${hospitalName}" placeholder="검색어를 입력하세요.">
+                                                </td>
+                                                <td>
                                                     <button class="btn btn-primary">검색</button>
                                                 </td>
                                             </tr>
@@ -75,30 +78,21 @@
                                         <div class="col-6">전체 :
                                             <fmt:formatNumber value="${total}" pattern="#,###" />
                                         </div>
-                                        <div class="col-6 text-right">
-                                            <c:if test="${sesGroupIdx eq '1'}">
-                                                <button class="btn btn-primary" onclick="location.href='./new';">게시글 등록</button>
-                                            </c:if>
-                                        </div>
                                     </div>
                                     <div class="table-responsive">
                                         <table class="table table-striped text-center">
                                             <colgroup>
                                                 <col style=" width: 10%; ">
-                                                <col style=" width: 40%; ">
-                                                <col style=" width: 15%; ">
-                                                <col style=" width: 15%; ">
+                                                <col style=" width: 70%; ">
                                                 <col style=" width: 10%; ">
                                                 <col style=" width: 10%; ">
                                             </colgroup>
                                             <thead>
                                                 <tr>
                                                     <th>번호</th>
-                                                    <th>제목</th>
-                                                    <th>작성자</th>
-                                                    <th>작성일</th>
-                                                    <th>조회</th>
-                                                    <th>파일</th>
+                                                    <th>신청 병원명</th>
+                                                    <th>신청자명</th>
+                                                    <th>상태</th>
                                                 </tr>
                                             </thead>
                                             
@@ -112,20 +106,10 @@
                                                             <tr>
                                                                 <td><c:out value="${pageNum}" /></td>
                                                                 <td class="text-left">
-                                                                    <a href="./content?postSeq=${l.postSeq}"><c:out value="${l.title}" /></a>
-                                                                </td>
-                                                                <td><c:out value="${l.createByName}(${l.createBy})" /></td>
-                                                                <td><c:out value="${l.createDate}" /></td>
-                                                                <td><fmt:formatNumber value="${l.views}" pattern="#,###" /></td>
-                                                                <td>
-                                                                    <c:if test="${l.fileExtension eq ''}">
-                                                                        -
-                                                                    </c:if>
-                                                                    <c:if test="${l.fileExtension ne ''}">
-                                                                        <c:out value="${l.fileExtension}" />
-                                                                    </c:if>
-                                                                    
+                                                                    <a href="./content?idx=${l.idx}"><c:out value="${l.hospitalName}" /></a>
                                                                 </td>
+                                                                <td><c:out value="${l.managerName}" /></td>
+                                                                <td><c:out value="${l.useYnNm}" /></td>
                                                             </tr>
                                                         </c:forEach>
                                                     </c:when>
@@ -135,26 +119,11 @@
                                                         </tr>
                                                     </c:otherwise>
                                                 </c:choose>
-<!--                                                 <tr> -->
-<!--                                                     <td>1</td> -->
-<!--                                                     <td> -->
-<!--                                                         <a href="javscript:;">제목제목제목제목제목</a> -->
-<!--                                                     </td> -->
-<!--                                                     <td>시스템(system)</td> -->
-<!--                                                     <td>2020-10-13 15:23</td> -->
-<!--                                                     <td>1501</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">
@@ -175,7 +144,6 @@
                             </div>
                         </div>
                     </div>
-                    <!-- 의료진 관리 END -->
                 </div>
             </main>