| | |
| | | public void findApiIssue(ApiMonitorCondition apiMonitorCondition, Map<String, Object> resJsonData) { |
| | | |
| | | IssueTypeCondition issueTypeCondition = new IssueTypeCondition(); |
| | | issueTypeCondition.setIsApi(Issue.IS_API_YES); |
| | | List<IssueTypeVo> issueTypes = this.issueTypeService.findIssueType(issueTypeCondition); |
| | | |
| | | // 값이 없을 경우 초기값 입력 |
| | | if (StringUtils.isEmpty(apiMonitorCondition.getSearchPeriod())) { |
| | | apiMonitorCondition.setSearchPeriod(DateUtil.LAST_SEVEN_DAYS); |
| | | } |
| | | |
| | | // 검색 일자를 구한다. |
| | | List<Date> searchDates = CommonUtil.findSearchPeriod(apiMonitorCondition.getSearchPeriod()); |
| | | List<Date> searchDates = Lists.newArrayList(); |
| | | if (apiMonitorCondition.getSearchPeriod().equals(DateUtil.CUSTOM_INPUT)) { |
| | | Date startDate = DateUtil.convertStrToDate(apiMonitorCondition.getSearchStartDate(), "yyyy-MM-dd"); |
| | | Date endDate = DateUtil.addDays(DateUtil.convertStrToDate(apiMonitorCondition.getSearchEndDate(), "yyyy-MM-dd"), 1); |
| | | |
| | | searchDates = CommonUtil.findSearchPeriod(startDate, endDate); |
| | | } else { |
| | | searchDates = CommonUtil.findSearchPeriod(apiMonitorCondition.getSearchPeriod()); |
| | | } |
| | | |
| | | // 날짜가 검색되지 않았으면 오류 |
| | | if (searchDates.size() < 1) { |
| | |
| | | import java.security.MessageDigest; |
| | | import java.security.spec.KeySpec; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | public class CommonUtil { |
| | |
| | | return stringBuilder.toString(); |
| | | } |
| | | |
| | | public static List<Date> findSearchPeriod(Date startDate, Date endDate) { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(endDate); |
| | | List<Date> days = Lists.newArrayList(); |
| | | |
| | | // 이번달 날짜 리스트 가져오기 |
| | | while (cal.getTime().after(startDate)){ |
| | | days.add(cal.getTime()); |
| | | cal.add(Calendar.DATE, -1); |
| | | } |
| | | |
| | | return days; |
| | | } |
| | | |
| | | // 검색 일자를 구한다. |
| | | public static List<Date> findSearchPeriod(String searchPeriod) { |
| | | List<Date> searchDates = Lists.newArrayList(); |
| | |
| | | |
| | | $scope.vm = { |
| | | search : { |
| | | searchPeriod : "LAST_SEVEN_DAYS" |
| | | searchPeriod : "LAST_SEVEN_DAYS", |
| | | startEndDateRange : "" // 이슈 기록 조회 날짜 |
| | | }, |
| | | apiMonitorVos : [], |
| | | issueTypeVos : [], |
| | |
| | | } |
| | | }; |
| | | |
| | | // 직접 입력에서 날짜 선택시 이슈 기록 정보 조회 |
| | | $scope.$watch("vm.search.startEndDateRange", function (newValue) { |
| | | if ($rootScope.isDefined(newValue)) { |
| | | $scope.fn.drawChart(); |
| | | } |
| | | }); |
| | | |
| | | // 사용자 수 |
| | | |
| | | function changeSearchPeriod() { |
| | | drawChart(); |
| | | switch ($scope.vm.search.searchPeriod) { |
| | | case "CUSTOM_INPUT" : |
| | | $scope.vm.search.startEndDateRange = ""; |
| | | break; |
| | | default : |
| | | $scope.vm.search.startEndDateRange = ""; |
| | | $scope.fn.drawChart(); |
| | | } |
| | | } |
| | | |
| | | $scope.fn.drawChart(); |
| | |
| | | searchEndDate : "" |
| | | }; |
| | | |
| | | if ($rootScope.isDefined($scope.vm.search.startEndDateRange)) { |
| | | var startEndDateRange = $scope.vm.search.startEndDateRange.split("~"); |
| | | content.searchStartDate = startEndDateRange[0].trim(); |
| | | content.searchEndDate = startEndDateRange[1].trim(); |
| | | } |
| | | |
| | | Api.findHistory($resourceProvider.getContent(content, |
| | | $resourceProvider.getPageContent(0, 0))).then(function (result) { |
| | | |
| | |
| | | </h6> |
| | | |
| | | <div class="element-box"> |
| | | <div> |
| | | <select class="form-control form-control-sm rounded width-30 d-inline-block mb-10" ng-model="vm.search.searchPeriod" ng-change="fn.changeSearchPeriod()"> |
| | | <option value="LAST_SEVEN_DAYS" translate="common.last7Days">최근 7일</option> |
| | | <option value="THIS_WEEK" translate="common.thisWeek">이번 주</option> |
| | |
| | | <option value="CUSTOM_INPUT" translate="common.directInput">직접입력</option> |
| | | </select> |
| | | |
| | | <input type="text" |
| | | ng-show="vm.search.searchPeriod == 'CUSTOM_INPUT'" |
| | | class="form-control form-control-sm rounded col-md-4 d-inline-block input-readonly" |
| | | ng-model="vm.search.startEndDateRange" |
| | | modal-form-auto-scroll |
| | | parent-el="'#createdWidget'" |
| | | range-type="date" |
| | | onfocus="this.blur()" |
| | | style="height: 32px !important; padding: 0.25rem 0.5rem; font-size: 0.8rem; line-height: 1.5;" |
| | | date-range-picker> |
| | | <div class="row"> |
| | | <div class="col-xs-12"> |
| | | <div id="createdWidget" class="bootstrap-datepicker"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="no-cont1" |
| | | ng-if="vm.chartData.columns.length < 1" |
| | |
| | | 기록이 없습니다. |
| | | </div> |
| | | |
| | | </div> |
| | | <div ng-if="vm.chartData.columns.length > 0"> |
| | | <google-chart |
| | | columns="vm.chartData.columns" |