diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java index a9a06577..2f1f0e60 100644 --- a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java @@ -10,9 +10,6 @@ import org.springframework.validation.Validator; @Component public class AdminUpdateValidator implements Validator { - // 비밀번호: 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상 - private final String PASSWORD_REGEX = "^(?=.*[0-9])(?=.*[!@#$%_\\-]).{5}$"; - @Override public boolean supports(Class clazz) { return AdminUpdateBindingVO.class.equals(clazz); @@ -66,11 +63,5 @@ public class AdminUpdateValidator implements Validator { errors.rejectValue("regionMainCode", "valid.common.required","필수입력항목을 확인해주세요."); } }); - - // [2] 비밀번호 형식 검사 - if (!vo.getUpdatePassword().matches(PASSWORD_REGEX)) { - errors.rejectValue("updatePassword", "valid.common.password.wrong", - "비밀번호는 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상입니다."); - } } } diff --git a/admin/src/main/resources/application-dev.yml b/admin/src/main/resources/application-dev.yml index bd584fd4..a40f9336 100644 --- a/admin/src/main/resources/application-dev.yml +++ b/admin/src/main/resources/application-dev.yml @@ -1,32 +1,17 @@ -# ============================================== -# 애플리케이션 로깅 설정 -# ============================================== -logging: - file: - # 로그 파일 저장 경로 (사용자 홈 디렉토리 내 logs 폴더) - # ${user.home}은 시스템 사용자 홈 디렉토리를 가리킵니다 - path: ${user.home}/logs - - level: - # 애플리케이션 기본 패키지 로깅 레벨 설정 (DEBUG로 설정됨) - # 중요: 실제 애플리케이션 기본 패키지 경로로 변경해야 정상 작동합니다 - app.module: DEBUG - - # Spring 프레임워크 코어 로깅 레벨 (INFO 로 설정) - org.springframework: INFO - -# ============================================== -# 메시지 및 국제화(i18n) 설정 -# ============================================== spring: + # ============================================== + # 메시지 및 국제화(i18n) 설정 + # ============================================== messages: # 메시지 소스 캐시 지속 시간(초) # 4초마다 메시지 파일을 다시 읽어옵니다 # 개발 시에는 짧은 간격으로, 운영 시에는 길게 설정하는 것이 일반적 cache-duration: 10s - thymeleaf: - # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장) - cache: false + # ============================================== + # 타임리프 설정 + # ============================================== + thymeleaf: + cache: false # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장) # ============================================== # 데이터베이스 설정 # ============================================== @@ -44,6 +29,14 @@ spring: maximum-pool-size: 2 minimum-idle: 1 +# ============================================== +# 로깅 설정 +# ============================================== +logging: + level: + app: + module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정) + # ============================================== # 암호화 설정 # ============================================== diff --git a/admin/src/main/resources/application-local.yml b/admin/src/main/resources/application-local.yml index 61912755..1236aac5 100644 --- a/admin/src/main/resources/application-local.yml +++ b/admin/src/main/resources/application-local.yml @@ -1,29 +1,15 @@ -# ============================================== -# 애플리케이션 로깅 설정 -# ============================================== -logging: - file: - # 로그 파일 저장 경로 (시스템 사용자 홈 디렉토리 하위 logs 폴더) - path: ${user.home}/logs - level: - # 애플리케이션 기본 패키지 로깅 레벨 (INFO 로 설정) - # 주의: 기본 패키지 변경 시 app.module 부분을 반드시 수정해야 애플리케이션 로그가 출력됨 - app.module: DEBUG - # Spring 프레임워크 로깅 레벨 - org.springframework: INFO - # Spring Security 로깅 레벨 - org.springframework.security: INFO - -# ============================================== -# 메시지 및 다국어 처리 설정 -# ============================================== spring: + # ============================================== + # 메시지 및 다국어 처리 설정 + # ============================================== messages: # 메시지 캐시 지속 시간(초) cache-duration: 10s + # ============================================== + # 타임리프 설정 + # ============================================== thymeleaf: - # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장) - cache: false + cache: false # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장) # ============================================== # 데이터베이스 설정 # ============================================== @@ -40,13 +26,18 @@ spring: password: hyunjoo1@#4 maximum-pool-size: 2 minimum-idle: 1 - hikari: - maximum-pool-size: 10 - minimum-idle: 5 - idle-timeout: 120000 - max-lifetime: 900000 - connection-timeout: 5000 - leak-detection-threshold: 30000 + +# ============================================== +# 로깅 설정 +# ============================================== +logging: + level: + app: + module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정) + # Spring Bean 등록 과정도 확인 + org.springframework.beans.factory.support.DefaultListableBeanFactory: DEBUG + org.apache.ibatis: TRACE + org.mybatis.spring: TRACE # ============================================== # 암호화 설정 diff --git a/admin/src/main/resources/application-prod.yml b/admin/src/main/resources/application-prod.yml index 368452f4..5dadfef0 100644 --- a/admin/src/main/resources/application-prod.yml +++ b/admin/src/main/resources/application-prod.yml @@ -1,25 +1,12 @@ -# ============================================== -# 애플리케이션 로깅 설정 -# ============================================== -logging: - file: - # 로그 파일 저장 위치 (사용자 홈 디렉토리 내 logs 폴더) - # ${user.home}은 시스템의 사용자 홈 디렉토리를 참조합니다 - path: ${user.home}/logs - - level: - # 애플리케이션 기본 패키지 로깅 레벨 (INFO 레벨로 설정) - # 주의: 실제 애플리케이션의 기본 패키지 경로로 변경해야 합니다 - app.module: INFO - - # Spring Framework 코어 모듈 로깅 레벨 (INFO 레벨로 설정) - org.springframework: INFO - -# ============================================== -# 메시지 및 국제화(i18n) 설정 -# ============================================== spring: # ============================================== + # 메시지 및 국제화(i18n) 설정 + # ============================================== + messages: + # 메시지 소스 캐시 지속 시간 (단위: 초) + # 개발 환경에서는 짧은 간격(10-60초), 운영 환경에서는 긴 간격(3600초 이상) 권장 + cache-duration: 5m + # ============================================== # 데이터베이스 설정 # ============================================== datasource: @@ -35,8 +22,9 @@ spring: password: ENC(kUIzqWTu0+bqjYH4Jq9TFOOh3UwY+XVvA2OlT4VXJvxWCas66UNdGRmWDQKri5fI) maximum-pool-size: 2 minimum-idle: 1 + # ============================================== -# 서버 압축 설정 +# 세션 설정 # ============================================== server: servlet: diff --git a/admin/src/main/resources/application.yml b/admin/src/main/resources/application.yml index 35b91794..a340d4f4 100644 --- a/admin/src/main/resources/application.yml +++ b/admin/src/main/resources/application.yml @@ -1,7 +1,7 @@ -# ============================================== -# 메세지 및 다국어 처리 설정 -# ============================================== spring: + # ============================================== + # 메세지 및 다국어 처리 설정 + # ============================================== messages: # 다국어 메시지 파일 위치 설정 (쉼표로 구분) basename: messages/message,messages/exception,messages/validation,messages/uri,messages/operation,messages/security-message,messages/operation-log @@ -36,11 +36,6 @@ spring: enabled: true # 버저닝 적용 경로 paths: /** - # ============================================== - # 타임리프 설정 - # ============================================== - thymeleaf: # 타임리프 템플릿 캐시 비활성화 (개발시 false 권장) - cache: false # ============================================== # 서버 압축 설정 @@ -90,6 +85,9 @@ app: # 로깅 설정 # ============================================== logging: + file: + # 로그 파일 저장 경로 (시스템 사용자 홈 디렉토리 하위 logs 폴더) + path: ${user.home}/logs level: org: hibernate: @@ -97,16 +95,10 @@ logging: jdbc: # Hibernate SQL 파라미터 바인딩 값 로깅 레벨 bind: trace - app.module: DEBUG - org.springframework: INFO - org.apache.ibatis: TRACE - org.mybatis.spring: TRACE - # Spring Bean 등록 과정도 확인 - org.springframework.beans.factory.support.DefaultListableBeanFactory: DEBUG - file: - # 로그 파일 저장 경로 - path: ${user.home}/logs - + # Spring Framework 코어 모듈 로깅 레벨 (INFO 레벨로 설정) + springframework: INFO + app: + module: INFO # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정) # ============================================== # MyBatis 설정 @@ -117,3 +109,11 @@ mybatis: mms: classpath*:mappers/mms/*Mapper.xml # 매퍼 파일 위치 configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # SQL 로깅 구현체 + +# ============================================== +# 암호화 설정 +# ============================================== +jasypt: + encryptor: + password: #별도관리 + algorithm: #별도관리 diff --git a/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml b/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml index d76fd0ce..4aee8c9a 100644 --- a/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml +++ b/admin/src/main/resources/mappers/household/CreateHouseholdMapper.xml @@ -24,18 +24,10 @@ region_sub_code, region_detail_code, address, - industry_large_code, - - industry_middle_code, - - industry_sub_middle, - - industry_detail, - is_panel, usage_type, employment_type, diff --git a/admin/src/main/resources/mappers/household/UpdateHouseholdMapper.xml b/admin/src/main/resources/mappers/household/UpdateHouseholdMapper.xml index 5d16fa24..ca0668e3 100644 --- a/admin/src/main/resources/mappers/household/UpdateHouseholdMapper.xml +++ b/admin/src/main/resources/mappers/household/UpdateHouseholdMapper.xml @@ -18,18 +18,10 @@ region_sub_code = #{regionSubCode}, region_detail_code = #{regionDetailCode}, address = #{address}, - industry_large_code = #{industryLargeCode}, - - industry_middle_code = #{industryMiddleCode}, - - industry_sub_middle = #{industrySubMiddle}, - - industry_detail = #{industryDetail}, - is_panel = #{isPanel}, usage_type = #{usageType}, diff --git a/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml b/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml index c5745ffa..18185429 100644 --- a/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml +++ b/admin/src/main/resources/mappers/researcher/ResearcherMapper.xml @@ -342,9 +342,15 @@ ) AS hvr 1=1 - + /* 경영주 검색 */ + + AND ( + hvr.householdName ILIKE '%' || #{cmd.ownerValue} || '%' + OR hvr.householdPhone ILIKE '%' || #{cmd.ownerValue} || '%' + ) + AND hvr.householdName ILIKE '%' || #{cmd.ownerValue} || '%' diff --git a/admin/src/main/resources/static/ui/uiUtil.js b/admin/src/main/resources/static/ui/uiUtil.js index 3d681c70..816ba08e 100644 --- a/admin/src/main/resources/static/ui/uiUtil.js +++ b/admin/src/main/resources/static/ui/uiUtil.js @@ -492,8 +492,9 @@ const setSelectBoxUiCode = ({ codeList, parentSelector, childSelector, + defaultOptionText = '전체', selectedParentCode = '', - selectedChildCode = '' + selectedChildCode = '', }) => { const $parent = $(parentSelector); const $child = $(childSelector); @@ -501,16 +502,20 @@ const setSelectBoxUiCode = ({ if (!codeList?.nodes || !$parent.length || !$child.length) return; const renderOptions = ($el, list, selected) => { - $el.html(''); + $el.html(``); list.forEach(item => { const val = item.id.split('.').pop(); const isSelected = item.id === selected ? 'selected' : ''; $el.append(``); }); + + if (selected) { + $el.val(selected); + } }; const loadChildren = (parentId, selectedChild = '') => { - $child.html(''); + $child.html(``); if (!parentId) return; const parent = codeList.nodes.find(n => n.id === parentId); diff --git a/admin/src/main/resources/templates/common/components.html b/admin/src/main/resources/templates/common/components.html index 39bccce9..fc9b66dd 100644 --- a/admin/src/main/resources/templates/common/components.html +++ b/admin/src/main/resources/templates/common/components.html @@ -168,7 +168,6 @@ 홈 diff --git a/admin/src/main/resources/templates/common/modal-household-mapping.html b/admin/src/main/resources/templates/common/modal-household-mapping.html index 073890fb..4c139999 100644 --- a/admin/src/main/resources/templates/common/modal-household-mapping.html +++ b/admin/src/main/resources/templates/common/modal-household-mapping.html @@ -10,7 +10,7 @@ -
+ @@ -94,7 +95,7 @@ - @@ -161,6 +162,7 @@ codeList: regionList, parentSelector: '#regionSubCode', childSelector: '#regionDetailCode', + defaultOptionText: '전체' }); document.querySelector(".modal01").ui.open(); @@ -178,6 +180,8 @@ $('#isPanel').val(''); $('#searchMapping').val(''); $('#ownerValue').val(''); + + initSearchHousehold(); }; const searchHouseholdList = (pageNo,regionMainCode) => { @@ -214,6 +218,16 @@ `); }); + + // nodata 처리 + if (!$(response.content).length) { + tbody.append(` + + 임가정보가 존재하지 않습니다. + + `); + } + // Pagination 구성하기 const paging = $('.mapping-paging'); paging.empty(); @@ -271,6 +285,11 @@ ); } }; + + const initSearchHousehold = () => { + const regionMainCode = document.querySelector('[name="regionMainCode"]')?.value || ''; + searchHouseholdList(0, regionMainCode); + }; \ No newline at end of file diff --git a/admin/src/main/resources/templates/households/create.html b/admin/src/main/resources/templates/households/create.html index ae0bbb64..5b985079 100644 --- a/admin/src/main/resources/templates/households/create.html +++ b/admin/src/main/resources/templates/households/create.html @@ -121,7 +121,7 @@
- +
@@ -140,7 +140,7 @@
@@ -160,7 +160,7 @@
@@ -168,7 +168,7 @@
@@ -320,7 +320,8 @@ setSelectBoxUiCode({ codeList: regionList, parentSelector: '#regionSubCode', - childSelector: '#regionDetailCode' + childSelector: '#regionDetailCode', + defaultOptionText: '선택' }); // 업종 대분류, 중분류 셀렉트박스 세팅 @@ -328,6 +329,7 @@ codeList: industryLargeList, parentSelector: '#industryLargeCode', childSelector: '#industryMiddleCode', + defaultOptionText: '선택' }); }); diff --git a/admin/src/main/resources/templates/households/households.html b/admin/src/main/resources/templates/households/households.html index 1d8dd70c..9de2bce3 100644 --- a/admin/src/main/resources/templates/households/households.html +++ b/admin/src/main/resources/templates/households/households.html @@ -307,22 +307,27 @@ $(document).ready(function () { // 지역, 세부지역 셀렉트박스 세팅 - setSelectBoxUiCode({ + setSelectBoxUiCode({ codeList: regionList, parentSelector: '#regionSubCode', childSelector: '#regionDetailCode', + defaultOptionText: '전체', selectedParentCode: selectedRegionSubCode, selectedChildCode: selectedRegionDetailCode }); - // 업종 대분류, 중분류 셀렉트박스 세팅 - setSelectBoxUiCode({ - codeList: industryLargeList, - parentSelector: '#industryLargeCode', - childSelector: '#industryMiddleCode', - selectedParentCode: selectedIndustryLargeCode, - selectedChildCode: selectedIndustryMiddleCode - }); + // 업종 대분류, 중분류 셀렉트박스 세팅 + setSelectBoxUiCode({ + codeList: industryLargeList, + parentSelector: '#industryLargeCode', + childSelector: '#industryMiddleCode', + defaultOptionText: '전체', + selectedParentCode: selectedIndustryLargeCode, + selectedChildCode: selectedIndustryMiddleCode + }); + + // 최초 리스트 로드 + getHouseholds(document.reqForm.page.value); }); @@ -409,9 +414,6 @@ 'json' ); } - - // 최초 리스트 로드 - getHouseholds(document.reqForm.page.value); diff --git a/front/src/main/resources/templates/info/notice/{id}.html b/front/src/main/resources/templates/info/notice/{id}.html index a56633a6..210173fd 100644 --- a/front/src/main/resources/templates/info/notice/{id}.html +++ b/front/src/main/resources/templates/info/notice/{id}.html @@ -13,15 +13,21 @@
-

+

첨부파일

@@ -57,13 +63,71 @@ root: /*[[|#{uri.front.info.user.path}/password|]]*/'rootUrl', */ const previousUrl = document.referrer; - if (previousUrl.includes('/info/notice')) { +/* if (previousUrl.includes('/info/notice')) { history.back(); - } else { + } else {*/ location.href = '/info/notice'; + // } + }, + fileDownload(element) { + const url = element.dataset.url; + const fileName = element.dataset.filename; + if (!url || !fileName) { + console.error('Invalid URL or fileName:', url, fileName); + ajaxUtil._alert('파일 다운로드를 시작할 수 없습니다: 유효하지 않은 URL 또는 파일명입니다.', null); + return; } + fetch(url, { + method: 'GET', + headers: { + 'Accept': 'application/octet-stream' + } + }).then(response => { + console.log('Response status:', response.status); + if (!response.ok) { + // 응답 본문 읽기 + return response.text().then(errorMessage => { + let message = errorMessage || '파일 다운로드에 실패했습니다. 상태 코드: ' + response.status; + if (response.status === 404) { + message = errorMessage || '파일을 찾을 수 없습니다.'; + } else if (response.status === 500) { + message = errorMessage || '서버 오류로 인해 파일 다운로드에 실패했습니다.'; + } + throw new Error(message); + }); + } + // Content-Disposition 헤더에서 파일명 추출 + const disposition = response.headers.get('Content-Disposition'); + console.log('Content-Disposition:', disposition); + let serverFileName = fileName; + if (disposition && disposition.includes('filename*=')) { + const matches = disposition.match(/filename\*=UTF-8''(.+)/); + if (matches && matches[1]) { + try { + serverFileName = decodeURIComponent(matches[1]); + } catch (e) { + console.error('Failed to decode filename:', e); + } + } + } + return response.blob().then(blob => ({ blob, fileName: serverFileName })); + }) + .then(({ blob, fileName }) => { + console.log('Blob received, size:', blob.size); + const link = document.createElement('a'); + link.href = window.URL.createObjectURL(blob); + link.download = fileName; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(link.href); + }) + .catch(error => { + console.error('Download error:', error); + ajaxUtil._alert('파일 다운로드에 실패했습니다: ', null); + }); - } + }, } diff --git a/front/src/main/resources/templates/info/user/user.html b/front/src/main/resources/templates/info/user/user.html index d39c7a0e..4fbc30a2 100644 --- a/front/src/main/resources/templates/info/user/user.html +++ b/front/src/main/resources/templates/info/user/user.html @@ -420,13 +420,11 @@ f.tel1.value = ENV.select.selectTel.getValue(); f.phone1.value = ENV.select.selectPhone.getValue(); - const obj = $(f).serializeObject(); ajaxUtil._ajaxAsync( ENV.httpUrl.user, $(f).serializeObject(), function (rstData, status) { if (rstData.code === 'SUCCESS') { - // 유효성 검사를 모두 통과한 후 ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => { location.href = '/info'; });