Compare commits

..

2 Commits

Author SHA1 Message Date
Hyung Geun ee1f36f263 Merge branch 'master' of http://192.168.0.157:3000/DBNT/GGWEB
# Conflicts:
#	src/main/webapp/WEB-INF/jsp/admin/history.jsp
2022-03-16 09:48:48 +09:00
Hyung Geun 425920e8e2 대시보드 방문자수 바꾸기. 2022-03-16 09:34:46 +09:00
7 changed files with 86 additions and 107 deletions

View File

@ -94,17 +94,26 @@ public class AdminController {
model.addAttribute("standFieldData", standFieldData);
// 일, 월 방문자 수
BaseSearchVO searchVO = new BaseSearchVO();
/*BaseSearchVO searchVO = new BaseSearchVO();
LocalDate searchStartDate = LocalDate.now();
searchVO.setSearchStartDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
searchVO.setSearchEndDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
model.addAttribute("dayLoginCount", logService.selectLoginCnt(searchVO));
searchVO.setSearchStartDate(searchStartDate.minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
model.addAttribute("monthLoginCount", logService.selectLoginCnt(searchVO));
model.addAttribute("monthLoginCount", logService.selectLoginCnt(searchVO));*/
UseHistorySearchVO useHistorySearchVO = new UseHistorySearchVO();
LocalDate searchStartDate = LocalDate.now();
useHistorySearchVO.setSearchStartDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
useHistorySearchVO.setSearchEndDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
model.addAttribute("userVisitDay", useHistoryService.selectUseVisit(useHistorySearchVO));
useHistorySearchVO.setSearchStartDate(searchStartDate.minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
model.addAttribute("userVisitMonth", useHistoryService.selectUseVisit(useHistorySearchVO));
//일별 지도사용 수
UseHistorySearchVO useHistorySearchVO = new UseHistorySearchVO();
useHistorySearchVO.setSearchEndDate(searchVO.getSearchEndDate());
useHistorySearchVO = new UseHistorySearchVO();
useHistorySearchVO.setSearchEndDate(searchStartDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
useHistorySearchVO.setSearchStartDate(searchStartDate.minusDays(14).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
List<ChartVO> dayMapUseDataList = useHistoryService.selectDayMapUseData(useHistorySearchVO);
model.addAttribute("dayMapUseDataList", dayMapUseDataList);

View File

@ -15,4 +15,8 @@ public interface UseHistoryMapper {
int selectUseHistoryCnt(UseHistorySearchVO useHistorySearchVO);
List<ChartVO> selectDayMapUseData(UseHistorySearchVO useHistorySearchVO);
int selectUseVisit(UseHistorySearchVO useHistorySearchVO); // 방문자수
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import javax.annotation.Resource;
import com.mca.cmmn.vo.BaseSearchVO;
import com.mca.map.vo.ChartVO;
import org.springframework.stereotype.Service;
import com.mca.map.mapper.UseHistoryMapper;
@ -29,4 +30,12 @@ public class UseHistoryService {
public List<ChartVO> selectDayMapUseData(UseHistorySearchVO useHistorySearchVO) {
return useHistoryMapper.selectDayMapUseData(useHistorySearchVO);
}
// 방문자수.
public int selectUseVisit(UseHistorySearchVO useHistorySearchVO) {
return useHistoryMapper.selectUseVisit(useHistorySearchVO);
}
}

View File

@ -8,6 +8,13 @@ public class UseHistorySearchVO extends BaseSearchVO{
private String company;
private String area;
private int useVisit;
public int getUseVisit() {
return useVisit;
}
public void setUseVisit(int useVisit) { this.useVisit = useVisit; }
public String getUserid() {
return userid;
}

View File

@ -33,6 +33,18 @@
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
</select>
<!-- 방문자수-->
<select id="selectUseVisit" parameterType="useHistorySearchVO" resultType="int">
SELECT
COUNT(*)
FROM
map_use_history
WHERE
log_type = '0'
AND log_date >= CONCAT(#{searchStartDate}, ' 00:00:00')
AND log_date &lt;= CONCAT(#{searchEndDate}, ' 23:59:59')
</select>
<select id="selectUseHistoryCnt" resultType="int" >
SELECT
COUNT(*)

View File

@ -68,8 +68,9 @@
</div>
<div class="col-auto">
<p class="mb-0 text-black-50">오늘 방문자 수</p>
<h3><c:out value="${dayLoginCount}"/></h3>
<h3><c:out value="${userVisitDay}"/></h3>
</div>
</div>
</div>
<div class="card my-2">
@ -79,7 +80,7 @@
</div>
<div class="col-auto">
<p class="mb-0 text-black-50">최근 한달 방문자 수</p>
<h3><c:out value="${monthLoginCount}"/></h3>
<h3><c:out value="${userVisitMonth}"/></h3>
</div>
</div>
</div>

View File

@ -15,8 +15,8 @@
<form:form commandName="UseHistorySearchVO" name="searchForm" action="/admin/history" method="get">
<div class="row justify-content-end bg-white mx-3 py-2">
<div class="col-12 col-sm-4 row">
<div class="col-12 col-sm-4">
<div class="col-auto row">
<div class="col-auto">
<select class="form-select" name="searchCondition">
<option value="all" ${UseHistorySearchVO.searchCondition eq 'all'?'selected':''}>통합검색</option>
<option value="name" ${UseHistorySearchVO.searchCondition eq 'name'?'selected':''}>이름</option>
@ -24,25 +24,23 @@
<option value="req_area" ${UseHistorySearchVO.searchCondition eq 'req_area'?'selected':''}>위치</option>
</select>
</div>
<div class="col-8 col-sm-5">
<div class="col-auto">
<input type="text" class="form-control" name="searchKeyword" value="${UseHistorySearchVO.searchKeyword}"/>
</div>
<div class="col-4 col-sm-3">
<input class="btn btn-outline-secondary w-100" type="submit" value="검색"/>
<div class="col-auto">
<input class="btn btn-outline-secondary" type="submit" value="검색"/>
</div>
</div>
</div>
<div class="row m-3 p-2 bg-white">
<div class="col-12 d-none d-sm-block">
<table class="table table-hover text-center">
<thead>
<tr>
<th>위치</th>
<th>소속</th>
<th>담당자</th>
<th>동작</th>
<th>위치</th>
<th>날짜</th>
</tr>
</thead>
@ -50,22 +48,10 @@
<c:if test="${count >= 1}">
<c:forEach var="item" items="${useHistoryList}">
<tr>
<td><c:out value="${item.reqArea}"/></td>
<td><c:out value="${useVisit}"/></td>
<td><c:out value="${item.company}"/></td>
<td><c:out value="${item.name}"/></td>
<td>
<c:choose>
<c:when test="${item.log_type eq '0'}">
<span class="status-bar status-success w-50 mx-auto">로그인</span>
</c:when>
<c:when test="${item.log_type eq '1'}">
<span class="status-bar status-danger w-50 mx-auto">로그아웃</span>
</c:when>
<c:when test="${item.log_type eq '2'}">
<span class="status-bar status-warning w-50 mx-auto">지도사용</span>
</c:when>
</c:choose>
</td>
<td><c:out value="${item.reqArea}"/></td>
<td class="td_date"><c:out value="${item.logDate}"/></td>
</tr>
</c:forEach>
@ -78,55 +64,6 @@
</tbody>
</table>
</div>
<div class="col-12 d-block d-sm-none">
<table class="table table-hover text-center">
<tbody class="border-0 border-top border-bottom border-2 border-dark">
<c:if test="${count >= 1}">
<c:forEach var="item" items="${useHistoryList}">
<tr class="border-bottom">
<th class="bg-secondary" style="--bs-bg-opacity: .5">소속</th>
<td><c:out value="${item.company}"/></td>
</tr>
<tr class="border-bottom">
<th class="bg-secondary" style="--bs-bg-opacity: .5">담당자</th>
<td><c:out value="${item.name}"/></td>
</tr>
<tr class="border-bottom">
<th class="bg-secondary" style="--bs-bg-opacity: .5">동작</th>
<td>
<c:choose>
<c:when test="${item.log_type eq '0'}">
<span class="status-bar status-success">로그인</span>
</c:when>
<c:when test="${item.log_type eq '1'}">
<span class="status-bar status-danger">로그아웃</span>
</c:when>
<c:when test="${item.log_type eq '2'}">
<span class="status-bar status-warning">지도사용</span>
</c:when>
</c:choose>
</td>
</tr>
<tr class="border-bottom">
<th class="bg-secondary" style="--bs-bg-opacity: .5">위치</th>
<td><c:out value="${item.reqArea}"/></td>
</tr>
<tr class="border-0 border-bottom border-2 border-dark">
<th class="bg-secondary" style="--bs-bg-opacity: .5">날짜</th>
<td class="td_date"><c:out value="${item.logDate}"/></td>
</tr>
</c:forEach>
</c:if>
<c:if test="${count == 0}">
<tr>
<td colspan="5">요청한 목록이 없습니다.</td>
</tr>
</c:if>
</tbody>
</table>
</div>
</div>
<div class="text-page">
<form:hidden path="pageIndex"/></form:form>
<nav aria-label="Page navigation">