Explorar o código

Merge branch 'databank' of http://wcollector.idatabank.com:5230/dbs289/LifeCenter.git into databank

huiwon.seo %!s(int64=4) %!d(string=hai) anos
pai
achega
5c69cfa110

+ 18 - 0
src/main/java/com/lemon/lifecenter/controller/ApiManagerController.java

@@ -0,0 +1,18 @@
+package com.lemon.lifecenter.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.lemon.lifecenter.common.LifeCenterController;
+
+@RestController
+@RequestMapping("/apiManager")
+public class ApiManagerController extends LifeCenterController {
+    
+    @RequestMapping("/list")
+    public ModelAndView apiMangerList() {
+        ModelAndView mv = setMV("api/list");
+        return mv;
+    }
+}

+ 20 - 2
src/main/java/com/lemon/lifecenter/controller/ClinicController.java

@@ -47,12 +47,14 @@ import com.lemon.lifecenter.common.LifeCenterController;
 import com.lemon.lifecenter.common.LifeCenterFileDownload;
 import com.lemon.lifecenter.common.LifeCenterFunction;
 import com.lemon.lifecenter.common.LifeCenterSessionController;
+import com.lemon.lifecenter.dto.FileDownloadDTO;
 import com.lemon.lifecenter.dto.PatientDTO;
 import com.lemon.lifecenter.dto.PatientMemoDTO;
 import com.lemon.lifecenter.dto.PatientPHRHistoryDTO;
 import com.lemon.lifecenter.dto.PatientPHRLatestDTO;
 import com.lemon.lifecenter.dto.PatientSymptomSimDTO;
 import com.lemon.lifecenter.service.ClinicService;
+import com.lemon.lifecenter.service.FileDownloadService;
 import com.lemon.lifecenter.service.PHRService;
 import com.lemon.lifecenter.service.PatientService;
 
@@ -69,6 +71,9 @@ public class ClinicController extends LifeCenterController {
 	@Autowired
 	private PatientService patientService;
 	
+	@Autowired
+    private FileDownloadService fileDownloadService;
+	
 	private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
 	@RequestMapping("/state")
@@ -473,12 +478,25 @@ public class ClinicController extends LifeCenterController {
 	@RequestMapping("/excel")
 	public void getExcelFile(
 			@RequestParam(value="phrType", required=true, defaultValue="temperature") String phrType,
-			@RequestParam(value="patientIdx", required=true, defaultValue="") int patientIdx,
+      @RequestParam(value="patientIdx", required=true, defaultValue="") int patientIdx,
+      @RequestParam(value="downMemo", required=true, defaultValue="") String downMemo,
 			HttpServletRequest request, HttpServletResponse response ) {
 
 		PatientDTO patientDto = new PatientDTO();
 		patientDto.setPatientIdx(patientIdx);
-		patientDto = patientService.selectPatientOne(patientDto);		
+	    patientDto = patientService.selectPatientOne(patientDto);		
+	    
+	    //excel 다운로드 로그 남기기
+	    String userId = LifeCenterSessionController.getSession(request, "sesId");
+	
+	    FileDownloadDTO fileDTO = new FileDownloadDTO();
+	    fileDTO.setId( userId );
+	    fileDTO.setIp( LifeCenterFunction.getRemoteAddr( request ) );
+	    fileDTO.setUrl( request.getRequestURI().toString() );
+	    fileDTO.setMemo( downMemo );
+	    fileDTO.setEtc( "진료관리, " + patientDto.getPatientName() + ", " + patientDto.getJumin() + ", " + Integer.toString(patientDto.getCenterCode()) );
+	    fileDTO.setPatientIdx( patientIdx );
+	    fileDownloadService.insertExcelDownloadLog( fileDTO );
 		
 		this.createExcel(request, response, patientDto);
 	}

+ 186 - 0
src/main/webapp/WEB-INF/jsp/api/list.jsp

@@ -0,0 +1,186 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+    pageEncoding="UTF-8"%>
+<jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+</head>
+<body>
+    <div class="wrapper">
+        <jsp:include page="${data._INCLUDE}/sidebar.jsp"></jsp:include>
+
+        <div class="main">
+            <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
+
+            <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>
+                        </div>
+                        <div class="col-12 col-lg-6  text-right">
+                            <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> -->
+                                </ol>
+                            </nav>
+                        </div>
+                    </div>
+                    <div class="row">
+                        <div class="col-12">
+                            <div class="card">
+                                <form action="?" method="get">
+                                    <div class="card-body">
+                                        <table class="table mobile-table">
+                                            <colgroup>
+                                                <col style="width:10%">
+                                                <col style="width:40%">
+                                                <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>
+                                                    </div>
+                                                </td>
+                                                <td colspan="2">
+                                                    <button class="btn btn-primary">검색</button>
+                                                </td>
+                                            </tr>
+                                        </table>
+                                    </div>
+                                </form>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="row">
+                        <div class="col-12">
+                            <div class="card">
+                                <div class="card-body">
+                                    <div class="row mb-3">
+                                        <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: 10%; ">
+                                                <col style=" width: 10%; ">
+                                            </colgroup>
+                                            <thead>
+                                                <tr>
+                                                    <th>번호</th>
+                                                    <th>제목</th>
+                                                    <th>작성자</th>
+                                                    <th>작성일</th>
+                                                    <th>조회</th>
+                                                    <th>파일</th>
+                                                </tr>
+                                            </thead>
+                                            
+                                            <tbody>
+                                                <c:choose>
+                                                
+                                                    <c:when test="${total > 0}">
+                                                        <c:forEach var="l" items="${list}" varStatus="lStatus">
+                                                        
+                                                            <c:set var="pageNum" value="${ ( total - lStatus.index ) - ( (page - 1) * pageSize ) }" />
+                                                            <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>
+                                                                    
+                                                                </td>
+                                                            </tr>
+                                                        </c:forEach>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <tr>
+                                                            <td colspan="9">등록된 게시글이 없습니다.</td>
+                                                        </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">
+                                                <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>
+
+            <jsp:include page="${data._INCLUDE}/footer.jsp"></jsp:include>
+        </div>
+    </div>
+</body>
+</html>

+ 55 - 4
src/main/webapp/WEB-INF/jsp/clinic/info.jsp

@@ -715,11 +715,26 @@ function gotoPatientInfo() {
 	location.href = url;
 }
 
-function getExcel(type) {
-	const phrType = (type === "") ? "all" : type;
+function getExcel() {
 
-	const url = "./excel?patientIdx=" + mPatientIdx + "&phrType=" + phrType;
+  if (!$("#downMemo").val().trim()) {
+		alert("다운로드 사유를 입력해 주세요.");
+		$("#downMemo").val("").foucs();
+		return;
+	}
+
+  if ($("#downMemo").val().trim().length < 3) {
+		alert("다운로드 사유는 3글자 이상이어야 합니다.");
+		$("#downMemo").foucs();
+		return;
+	}
+
+  const downMemo = $("#downMemo").val().trim();
+  donwMemo = encodeURIComponent(downMemo);
+	const url = "./excel?patientIdx=" + mPatientIdx + "&downMemo=" + downMemo;
 	window.open(url);
+
+  $("#excelDownMemo").modal("hide");
 }
 
 function handleModifyMemo(memoId, recordedDate) {
@@ -813,6 +828,11 @@ $(document).ready(function() {
     }
   });
 
+  // 건강정보 엑셀 다운로드 사유 팝업 닫힐 때 처리
+  $('#excelDownMemo').on('hidden.bs.modal', function () {
+    $("#downMemo").val("");
+  })
+
   // phrData 기록 추가 클릭 이벤트
   $('#defaultModalPrimary_1').on('hidden.bs.modal', function () {
     $("#eventDateTime1").val("");
@@ -1035,6 +1055,37 @@ $(document).ready(function() {
   <div class="preloader">
 		<div class="loadingIcon"></div>
 	</div>
+  <div class="modal fade" id="excelDownMemo" tabindex="-1" role="dialog" aria-hidden="true" data-memoid="">
+        <div class="modal-dialog" role="document">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h5 class="modal-title">건강정보 Excel 다운로드</h5>
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
+                            aria-hidden="true">&times;</span> </button>
+                </div>
+                <div class="modal-body m-3">
+                    <table class="table mobile-table">
+                        <colgroup>
+                            <col style="width: 20%">
+                            <col style="width: 80%">
+                        </colgroup>
+                        <tr>
+                            <th><span class="fix">*</span>다운로드 사유</th>
+                            <td>
+                                <div class="form-row">
+                                    <textarea id="downMemo" name="downMemo" class="form-control" cols="" rows="6" placeholder="" maxlength="200"></textarea>
+                                </div>
+                            </td>
+                        </tr>
+                    </table>
+                </div>
+                <div class="addMemoTools modal-footer">
+                    <button type="button" class="btn btn-outline-primary" data-dismiss="modal">취소</button>
+                    <button type="button" class="btn btn-primary" onclick="getExcel();">제출 후 다운로드</button>
+                </div>
+            </div>
+        </div>
+    </div>
 	<div class="modal fade" id="legendGuide" tabindex="-1" role="dialog" aria-hidden="true">
 		<div class="modal-dialog modal-sm" role="document">
 			<div class="modal-content">
@@ -1239,7 +1290,7 @@ $(document).ready(function() {
                     <div class="col-12">
                       <button class="btn btn-lg btn-secondary mr-2" onclick="gotoList()"><i class="mdi mdi-backburger"></i> 대시보드</button>
                       <c:if test="${data._SES_GROUP_IDX ne '3'}">
-                      <button id="downloadData" type="button" class="btn btn-lg btn-success" onclick="getExcel('');"><i class="mdi mdi-file-excel-outline"></i> 건강정보 다운로드</button>
+                      <button id="downloadData" type="button" class="btn btn-lg btn-success" data-toggle="modal" data-target="#excelDownMemo"><i class="mdi mdi-file-excel-outline"></i> 건강정보 다운로드</button>
                       </c:if>
                     </div>
                   </div>

+ 3 - 0
src/main/webapp/WEB-INF/jsp/include/sidebar.jsp

@@ -89,6 +89,9 @@
                         <li class="sidebar-item <c:if test='${data._MENUPATH eq "push"}'>active</c:if>">
                             <a class="sidebar-link" href="/push/list">푸시 서비스 관리</a>
                         </li>
+                        <li class="sidebar-item <c:if test='${data._MENUPATH eq "apiManager"}'>active</c:if>">
+                            <a class="sidebar-link" href="/apiManager/list">API 서비스 관리</a>
+                        </li>
                         
 <%--                         <li class="sidebar-item <c:if test='${data._MENUPATH eq "role"}'>active</c:if>"> --%>
 <!--                             <a class="sidebar-link" href="/role/list">그룹 권한 관리</a> -->