Quellcode durchsuchen

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

junekeunsong vor 4 Jahren
Ursprung
Commit
f306597b8f

+ 14 - 0
src/main/java/com/lemon/lifecenter/dto/PatientPHRHistoryDTO.java

@@ -1,5 +1,8 @@
 package com.lemon.lifecenter.dto;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.springframework.stereotype.Repository;
 
 @Repository
@@ -96,4 +99,15 @@ public class PatientPHRHistoryDTO {
 		
 		return false;
 	}
+	public String getCreateDateFormatted() {
+		SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+		SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		try {
+			Date t = originalFormat.parse(this.createDate);
+			return targetFormat.format(t);
+		}
+		catch (Exception e) {
+			return createDate;
+		}
+	}
 }

+ 13 - 9
src/main/webapp/WEB-INF/jsp/clinic/info.jsp

@@ -8,6 +8,10 @@
 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
 <script>
 
+function dateFormatter(date) {
+	return moment(date).format("YYYY-MM-DD HH:mm:ss");
+}
+
 /*
  * 비대면 진료 시작
  */
@@ -129,12 +133,12 @@ function retrievePhrData() {
 					var danger = d.isWarning ? "text-danger" : "";
 					var row = "";
 					row += "<tr>";
-					row += "<td>" + d.createDate + "</td>";
+					row += "<td>" + dateFormatter(d.createDate) + "</td>";
 					if (phrType==="bloodPressure") {
 					row += "<td><span class='"+danger+"'>" + (isNaN(parseInt(d.phrValue)) ? "--" : parseInt(d.phrValue)) + " / " + (isNaN(parseInt(d.phrValue2)) ? "--" : parseInt(d.phrValue2)) + "</span></td>";
 					}
 					else if (phrType==="temperature") {
-					row += "<td><span class='"+danger+"'>" + d.phrValue + "</span></td>";
+					row += "<td><span class='"+danger+"'>" + parseFloat(d.phrValue).toFixed(1) + "</span></td>";
 					}
 					else {
 					row += "<td><span class='"+danger+"'>" + parseInt(d.phrValue) + "</span></td>";
@@ -168,7 +172,7 @@ function drawPhrChart(data, dataName) {
 	var xDatas = [];
 	var yDatas = [];
 	data.forEach(d=> {
-		var t = moment(d.createDate).format("MM-DD HH:mm:ss");
+		var t = dateFormatter(d.createDate);
 		xDatas.push(t);
 		yDatas.push(d.phrValue);
 	});
@@ -203,7 +207,7 @@ function drawBPChart(data) {
 	var y1Datas = [];
 	var y2Datas = [];
 	data.forEach(d=> {
-		var t = moment(d.createDate).format("MM-DD HH:mm:ss");
+		var t = dateFormatter(d.createDate);
 		xDatas.push(t);
 		y1Datas.push(d.phrValue);
 		y2Datas.push(d.phrValue2);
@@ -321,7 +325,7 @@ function retrieveSymptomData() {
 				html = "";
 				contents = datas.forEach(d => {
 					html += "<tr>";
-					html += "<th>" + d.createDate + "</th>";
+					html += "<th>" + dateFormatter(d.createDate) + "</th>";
 					html += "<td>" + (d.coughCheck === "Y" ? checkSymbol : "-") + "</td>";
 					html += "<td>" + (d.dyspneaCheck === "Y" ? checkSymbol : "-") + "</td>";
 					html += "<td>" + (d.coldFitCheck === "Y" ? checkSymbol : "-") + "</td>";
@@ -409,7 +413,7 @@ function retrieveMemoData() {
 				html = "";
 				contents = datas.forEach(d => {
 					html += "<tr>";
-					html += "<td>" + d.createDate + "</td>";
+					html += "<td>" + dateFormatter(d.createDate) + "</td>";
 					html += "<td><pre>" + d.contents + "</pre></td>";
 					html += "<td>" + d.recordedByName + "</td>";
 					html += "</tr>";
@@ -1009,8 +1013,8 @@ $(document).ready(function() {
 											- 건강정보 조회 <label> <select class="custom-select ml-1 form-control" id=phrTypeSelect name="inputState" onchange="retrievePhrData()">
 													<option value="temperature" selected>체온</option>
 													<option value="bloodPressure">혈압</option>
-													<option value="pulseRate">맥박</option>
 													<option value="oxygenSaturation">산소포화도</option>
+													<option value="pulseRate">맥박</option>
 													<option value="bloodSugar">혈당</option>
 											</select>
 											</label> <label class="ml-1">
@@ -1036,8 +1040,8 @@ $(document).ready(function() {
 														<c:when test="${phrTotal > 0}">
 															<c:forEach var="i" begin="1" end="${phrTotal}">
 																<tr>
-																	<td><c:out value="${phrItems[phrTotal-i].createDate}" /></td>
-																	<td><span class="${phrItems[phrTotal-i].isWarning ? 'text-danger' : ''}"><c:out value="${phrItems[phrTotal-i].phrValue}" /></span></td>
+																	<td><c:out value="${phrItems[phrTotal-i].createDateFormatted}" /></td>
+																	<td><span class="${phrItems[phrTotal-i].isWarning ? 'text-danger' : ''}"><c:out value="${phrItems[phrTotal-i].phrValue}" /></span></td>
 																	<td><c:out value="${phrItems[phrTotal-i].recordedByName}" /></td>
 																</tr>
 															</c:forEach>