Merge branch 'dev' into deploy-dev-front

This commit is contained in:
주수현
2025-07-15 15:33:57 +09:00
43 changed files with 740 additions and 661 deletions

View File

@@ -15,9 +15,17 @@ import org.springframework.web.bind.annotation.RestController;
class AdminIdDuplicateCheckPostController {
private final CheckAdminIdPortIn checkAdminIdPortIn;
private final String ID_REGEX = "^[a-zA-Z0-9가-힣_-]{4,15}$";
private final String INVALID_ID_MSG = "아이디는 4~15자, 영문/숫자/한글/특수문자(_,-)만 가능합니다.";
@GetMapping("/api/settings/admin/idCheck")
ResponseEntity<?> selectIdCheck(@RequestParam String id ) {
if (!id.matches(ID_REGEX)) {
return ResponseEntity
.status(HttpStatus.UNPROCESSABLE_ENTITY)
.body(INVALID_ID_MSG);
}
return ResponseEntity.status(HttpStatus.OK).body(checkAdminIdPortIn.connect(id));
}
}

View File

@@ -28,4 +28,5 @@ public class AdminCreateBindingVO {
private Boolean accountDisabled;
/* private Boolean accountLocked;*/
private String roleId;
private Boolean checkDuplicate;
}

View File

@@ -24,51 +24,68 @@ public class AdminCreateValidator implements Validator {
public void validate(Object target, Errors errors) {
AdminCreateBindingVO vo = (AdminCreateBindingVO) target;
if (vo.getRoleId() == null || vo.getRoleId().isEmpty()) {
errors.rejectValue("roleId", "error.roleId", "권한을 선택해주세요.");
// [1] 필수값 누락 체크
if(vo.getRoleId() == null || vo.getRoleId().isEmpty()) {
errors.rejectValue("roleId", "error.roleId", "필수입력항목을 확인해주세요.");
return;
}
if(vo.getId() == null || vo.getId().isBlank()) {
errors.rejectValue("id", "error.id", "필수입력항목을 확인해주세요.");
return;
}
if(vo.getPassword() == null || vo.getPassword().isBlank()) {
errors.rejectValue("password", "error.password", "필수입력항목을 확인해주세요.");
return;
}
if (vo.getAccountDisabled() == null ) {
errors.rejectValue("accountDisabled", "error.accountDisabled", "사용여부를 선택해주세요.");
}
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "id", "valid.common.required","아이디는 필수입력값입니다.");
Optional.ofNullable(vo.getId())
.filter(id -> !id.matches(ID_REGEX))
.ifPresent(id -> errors.rejectValue("id", "valid.common.id.wrong","아이디를 4~15자, 영문/숫자/한글/특수문자(_,-) 입니다."));
// 비밀번호 유효성 검사
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "valid.common.required","비밀번호는 필수입력값입니다.");
Optional.ofNullable(vo.getPassword())
.filter(password -> !password.matches(PASSWORD_REGEX))
.ifPresent(password -> errors.rejectValue("password", "valid.common.password.wrong","비밀번호는 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상입니다."));
if (vo.getRoleId() != null && "ROLE_RESEARCHER".equals(vo.getRoleId())) {
if (vo.getName() == null || vo.getName().isBlank()) {
errors.rejectValue("name", "error.name", "이름을 입력해주세요.");
// 권한 조사원으로 선택했을 경우
if(vo.getRoleId() != null && "ROLE_RESEARCHER".equals(vo.getRoleId())) {
if(vo.getName() == null || vo.getName().isEmpty()) {
errors.rejectValue("name", "error.name", "필수입력항목을 확인해주세요.");
return;
}
if (vo.getName().length() > 10) {
errors.rejectValue("name", "error.name", "이름은 10자까지 입력가능합니다.");
if(vo.getPhone1() == null || vo.getPhone1().isBlank()) {
errors.rejectValue("phone1", "error.phone1", "필수입력항목을 확인해주세요.");
return;
}
if (vo.getPhone1() == null || vo.getPhone1().isBlank()) {
errors.rejectValue("phone1", "error.phone1", "전화번호 앞자리를 입력해주세요.");
} else if (!vo.getPhone1().matches("^\\d{4}$")) {
if(vo.getPhone2() == null || vo.getPhone2().isBlank()) {
errors.rejectValue("phone2", "error.phone2", "필수입력항목을 확인해주세요.");
return;
}
if (!vo.getPhone1().matches("^\\d{4}$")) {
errors.rejectValue("phone1", "error.phone1", "전화번호 앞자리는 4자리 숫자여야 합니다.");
return;
}
if (vo.getPhone2() == null || vo.getPhone2().isBlank()) {
errors.rejectValue("phone2", "error.phone2", "전화번호 뒷자리를 입력해주세요.");
} else if (!vo.getPhone2().matches("^\\d{4}$")) {
if (!vo.getPhone2().matches("^\\d{4}$")) {
errors.rejectValue("phone2", "error.phone2", "전화번호 뒷자리는 4자리 숫자여야 합니다.");
return;
}
}
// ROLE_ADMIN이 아닌 경우 regionMainCode null체크
if(vo.getAccountDisabled() == null) {
errors.rejectValue("accountDisabled", "error.accountDisabled", "필수입력항목을 확인해주세요.");
return;
}
// ROLE_ADMIN이 아닌 경우 실사지역 null체크
Optional.ofNullable(vo.getRoleId())
.filter(id -> !id.equals("ROLE_ADMIN"))
.ifPresent(nonAdmins -> {
if (vo.getRegionMainCode() == null || vo.getRegionMainCode().isBlank()) {
errors.rejectValue("regionMainCode", "valid.common.required","실사지역은 필수입력값입니다.");
errors.rejectValue("regionMainCode", "valid.common.required","필수입력항목을 확인해주세요.");
}
});
// [2] 아이디 중복 확인 여부
if (vo.getCheckDuplicate() == null || !vo.getCheckDuplicate()) {
errors.rejectValue("checkDuplicate", "error.checkDuplicate", "아이디 중복 확인을 먼저 진행해주세요.");
return;
}
// [3] 비밀번호 형식 검사
if (!vo.getPassword().matches(PASSWORD_REGEX)) {
errors.rejectValue("password", "valid.common.password.wrong",
"비밀번호는 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상입니다.");
}
}
}

View File

@@ -22,39 +22,55 @@ public class AdminUpdateValidator implements Validator {
public void validate(Object target, Errors errors) {
AdminUpdateBindingVO vo = (AdminUpdateBindingVO) target;
if (vo.getRoleId() == null || vo.getRoleId().isEmpty()) {
errors.rejectValue("roleId", "error.roleId", "권한을 선택해주세요.");
// [1] 필수값 누락 체크
if(vo.getRoleId() == null || vo.getRoleId().isEmpty()) {
errors.rejectValue("roleId", "error.roleId", "필수입력항목을 확인해주세요.");
return;
}
Optional.ofNullable(vo.getUpdatePassword())
.filter(password -> !password.trim().isEmpty() && !password.matches(PASSWORD_REGEX))
.ifPresent(password -> errors.rejectValue("updatePassword", "valid.common.password.wrong","비밀번호는 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상입니다."));
if (vo.getRoleId() != null && "ROLE_RESEARCHER".equals(vo.getRoleId())) {
if (vo.getName() == null || vo.getName().isBlank()) {
errors.rejectValue("name", "error.name", "이름을 입력해주세요.");
// 권한 조사원으로 선택했을 경우
if(vo.getRoleId() != null && "ROLE_RESEARCHER".equals(vo.getRoleId())) {
if(vo.getName() == null || vo.getName().isEmpty()) {
errors.rejectValue("name", "error.name", "필수입력항목을 확인해주세요.");
return;
}
if (vo.getName().length() > 10) {
errors.rejectValue("name", "error.name", "이름은 10자까지 입력가능합니다.");
if(vo.getPhone1() == null || vo.getPhone1().isBlank()) {
errors.rejectValue("phone1", "error.phone1", "필수입력항목을 확인해주세요.");
return;
}
if (vo.getPhone1() == null || vo.getPhone1().isBlank()) {
errors.rejectValue("phone1", "error.phone1", "전화번호 앞자리를 입력해주세요.");
} else if (!vo.getPhone1().matches("^\\d{4}$")) {
if(vo.getPhone2() == null || vo.getPhone2().isBlank()) {
errors.rejectValue("phone2", "error.phone2", "필수입력항목을 확인해주세요.");
return;
}
if (!vo.getPhone1().matches("^\\d{4}$")) {
errors.rejectValue("phone1", "error.phone1", "전화번호 앞자리는 4자리 숫자여야 합니다.");
return;
}
if (vo.getPhone2() == null || vo.getPhone2().isBlank()) {
errors.rejectValue("phone2", "error.phone2", "전화번호 뒷자리를 입력해주세요.");
} else if (!vo.getPhone2().matches("^\\d{4}$")) {
if (!vo.getPhone2().matches("^\\d{4}$")) {
errors.rejectValue("phone2", "error.phone2", "전화번호 뒷자리는 4자리 숫자여야 합니다.");
return;
}
}
// ROLE_ADMIN이 아닌 경우 regionMainCode null체크
// 사용여부
if(vo.getAccountDisabled() == null) {
errors.rejectValue("accountDisabled", "error.accountDisabled", "필수입력항목을 확인해주세요.");
return;
}
// ROLE_ADMIN이 아닌 경우 실사지역 null체크
Optional.ofNullable(vo.getRoleId())
.filter(id -> !id.equals("ROLE_ADMIN"))
.ifPresent(nonAdmins -> {
if (vo.getRegionMainCode() == null || vo.getRegionMainCode().isBlank()) {
errors.rejectValue("regionMainCode", "valid.common.required","실사지역을 선택해주세요.");
errors.rejectValue("regionMainCode", "valid.common.required","필수입력항목을 확인해주세요.");
}
});
// [2] 비밀번호 형식 검사
if (!vo.getUpdatePassword().matches(PASSWORD_REGEX)) {
errors.rejectValue("updatePassword", "valid.common.password.wrong",
"비밀번호는 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상입니다.");
}
}
}

View File

@@ -15,11 +15,6 @@ class SaveHouseholdVisitInfoDao implements SaveHouseholdVisitInfoPortOut {
@Override
@Transactional
public void operate(SaveHouseholdVisitInfoCmd cmd) {
// 답례품 전달 완료일 경우 기존 방문들 중 true → false로 변경
if (Boolean.TRUE.equals(cmd.getIsGiftSent())) {
mapper.updateGiftSentToFalse(AuditUtil.update(cmd));
}
if (cmd.getVisitInfoId() != null) {
mapper.findById(cmd.getHouseholdSeq())
.ifPresentOrElse(v -> mapper.updateHouseholdVisitInfo(AuditUtil.update(cmd)),
@@ -29,5 +24,10 @@ class SaveHouseholdVisitInfoDao implements SaveHouseholdVisitInfoPortOut {
} else {
mapper.createHouseholdVisitInfo(AuditUtil.create(cmd));
}
// 답례품 전달 완료일 경우 기존 방문들 중 true → false로 변경
if (Boolean.TRUE.equals(cmd.getIsGiftSent())) {
mapper.updateGiftSentToFalse(AuditUtil.update(cmd));
}
}
}

View File

@@ -67,11 +67,13 @@ public class ResearcherDao implements ResearcherPortOut {
@Override
@UpdateCommand
public Integer updateVisitHousehold(ResearchersVisitDetailReqVO reqVO) {
if(Boolean.TRUE.equals(reqVO.getIsGiftSent())) {
int updated = researcherMapper.updateVisitHousehold(reqVO);
if (Boolean.TRUE.equals(reqVO.getIsGiftSent())) {
researcherMapper.updateGiftSentToFalse(reqVO);
}
return researcherMapper.updateVisitHousehold(reqVO);
return updated;
}
@Override

View File

@@ -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 # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 암호화 설정
# ==============================================

View File

@@ -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
# ==============================================
# 암호화 설정

View File

@@ -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:

View File

@@ -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: #별도관리

View File

@@ -25,13 +25,18 @@
AND rhh.is_deleted = false
WHERE a.is_deleted = false AND a.account_disabled = false
<if test="cmd.searchField != null and cmd.searchField != '' and cmd.searchValue != ''">
<if test="cmd.searchValue != null and cmd.searchValue != ''">
/* 조사원 검색 */
<choose>
<when test="cmd.searchField == ''">
AND (
a.name ILIKE '%' || #{cmd.searchValue} || '%'
OR a.phone ILIKE '%' || #{cmd.searchValue} || '%'
)
</when>
<when test="cmd.searchField eq 'name'">
AND a.name ILIKE '%' || #{cmd.searchValue} || '%'
</when>
<when test="cmd.searchField eq 'phone'">
AND a.phone ILIKE '%' || #{cmd.searchValue} || '%'
</when>

View File

@@ -44,8 +44,10 @@
WHERE household_seq = #{householdSeq}
AND TO_CHAR(visit_date, 'YYYYMM') = TO_CHAR(TO_DATE(#{visitDate}, 'YYYY-MM-DD'), 'YYYYMM')
AND is_gift_sent = true
AND (#{visitInfoId} IS NULL OR id != #{visitInfoId})
AND is_deleted = false
<if test="visitInfoId != null">
AND id != #{visitInfoId}
</if>
</update>
<select id="findById" resultType="java.lang.Long">

View File

@@ -156,7 +156,7 @@
<if test="searchMonth != null and searchMonth != ''">
and TO_CHAR(rhv.visit_date ,'YYYYMM')= #{searchMonth}
</if>
order by rhv.visit_date
order by rhv.visit_date, h.household_num
</select>
<select id="selectVisitHouseholdPercentage">
@@ -253,8 +253,8 @@
WHERE household_seq = #{householdSeq}
AND TO_CHAR(visit_date, 'YYYYMM') = TO_CHAR(#{visitDate}, 'YYYYMM')
AND is_gift_sent = true
AND (#{id} IS NULL OR id != #{id})
AND is_deleted = false
AND id != #{id}
</update>
<update id="updateVisitHousehold">

View File

@@ -2,8 +2,8 @@ uri=Home
uri.admin.settings=Settings
uri.admin.settings.admins.group=\uAD00\uB9AC\uC790 & \uC5ED\uD560
uri.admin.settings.admins=\uAD00\uB9AC\uC790
uri.admin.settings.admins.create=\uB4F1\uB85D
uri.admin.settings.admins.update.{{pathVar}}=\uC218\uC815
uri.admin.settings.admins.create=\uAD00\uB9AC\uC790 \uB4F1\uB85D
uri.admin.settings.admins.update.{{pathVar}}=\uAD00\uB9AC\uC790 \uC218\uC815
uri.admin.settings.uri.admin=URI \uAD00\uB9AC (Admin)
uri.admin.settings.uri.front=URI \uAD00\uB9AC (Front)
uri.admin.settings.uicode=UI \uCF54\uB4DC \uAD00\uB9AC

View File

@@ -9,166 +9,155 @@
th:action="@{/settings/admins/create}"
th:object="${bindingVO}"
name="adminCreateForm">
<div class="content-inner">
<table class="type-form">
<colgroup>
<col width="8%" />
<col width="33.3%" />
<col width="8%" />
<col width="33.3%" />
</colgroup>
<table class="type-form">
<tbody>
<tr>
<th><label for="roleId">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
<div class="component-input">
<tbody>
<tr>
<th><label for="roleId">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
<div class="component-input">
<div class="component-select">
<select class="select-list" id="roleId"
th:classappend="${#fields.hasErrors('roleId')} ? 'is-invalid'"
th:field="*{roleId}"
onchange="onRoleChange(this);">
<option value="">선택</option>
<option th:each="role : ${roles}" th:text="${role.description}"
th:value="${role.id}"></option>
</select>
</div>
</div>
</div>
</td>
</tr>
<tr>
<th>ID<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td>
<div class="d-flex">
<div class="component-input">
<div class="d-flex">
<div class="input-field">
<input id="id"
name="id"
th:classappend="${#fields.hasErrors('id')} ? 'is-invalid'"
th:field="*{id}"
maxlength="15"
oninput="checkDuplicate = false;"/>
</div>
<button type="button" class="btn" onclick="adminIdCheckDuplicate();">
<span class="btn-txt">중복확인</span>
</button>
</div>
<span>4~15자 / 영문,숫자,한글 가능/ 특수문자 _,- 사용가능</span>
</div>
</div>
</td>
<th><label for="password">Password<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="password" type="password" maxlength="5"
th:classappend="${#fields.hasErrors('password')} ? 'is-invalid'"
th:field="*{password}"/>
</div>
<span>총 5자 / 숫자 + 특수문자 1개 이상 (!,@,#,$,%,_,-)</span>
</div>
</td>
</tr>
<tr class="researcherArea"
th:classappend="${bindingVO.roleId == 'ROLE_LOCAL_INSPECTOR'} ? 'd-none'">
<th><label for="name">이름<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="name" type="text" name="name"
th:classappend="${#fields.hasErrors('name')} ? 'is-invalid'"
th:field="*{name}" maxlength="10"/>
</div>
</div>
</td>
<th><label for="name">전화번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
<div class="component-select">
<select class="select-list" required>
<option value="value1" selected>010</option>
</select>
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone1" name="phone1" placeholder="" th:field="*{phone1}"
maxlength="4" oninput="limitMaxLength(this);">
</div>
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone2" name="phone2" placeholder="" th:field="*{phone2}"
maxlength="4" oninput="limitMaxLength(this);">
</div>
</div>
</div>
</td>
</tr>
<tr class="regionMainCodeArea"
th:classappend="${bindingVO.roleId != 'ROLE_ADMIN'} ? 'd-none'">
<th><label for="regionMainCode">실사<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-select">
<select class="select-list" id="roleId"
th:classappend="${#fields.hasErrors('roleId')} ? 'is-invalid'"
th:field="*{roleId}"
onchange="onRoleChange(this);">
<select class="select-list" id="regionMainCode" name="regionMainCode"
th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
th:field="*{regionMainCode}">
<option value="">선택</option>
<option th:each="role : ${roles}" th:text="${role.description}"
th:value="${role.id}"></option>
<option th:each="code : ${regionMainCode}"
th:value="${code.id}"
th:text="${code.codeText}">
</option>
</select>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{roleId}"
th:if="${#fields.hasErrors('roleId')}">
에러 메세지
</td>
</tr>
<tr>
<th><label>사용 여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td class="radio-group">
<div class="component-input">
<label for="inlineRadio1" class="radio-inner">
<input id="inlineRadio1" name="accountDisabled" type="radio" value="true">
<span class="radio-item">
<span class="radio-txt">미사용</span>
</span>
</label>
</div>
</div>
</div>
</td>
</tr>
<tr>
<th><label for="id">ID<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="id"
name="id"
th:classappend="${#fields.hasErrors('id')} ? 'is-invalid'"
th:field="*{id}"/>
<button type="button" class="btn btn-primary" onclick="adminIdCheckDuplicate();">
<span class="btn-txt">중복확인</span>
</button>
<div class="invalid-feedback fw-bold" th:errors="*{id}"
th:if="${#fields.hasErrors('id')}">
에러 메세지
<div class="component-input">
<label for="inlineRadio2" class="radio-inner">
<input id="inlineRadio2" name="accountDisabled" type="radio" value="false" checked>
<span class="radio-item">
<span class="radio-txt">사용</span>
</span>
</label>
</div>
</div>
<span>4~15자 / 영문,숫자,한글 가능/ 특수문자 _,- 사용가능</span>
</div>
</td>
<th><label for="password">Password<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="password" type="password"
th:classappend="${#fields.hasErrors('password')} ? 'is-invalid'"
th:field="*{password}"/>
<div class="invalid-feedback fw-bold" th:errors="*{password}"
th:if="${#fields.hasErrors('password')}">
에러 메세지
</div>
</div>
<span>총 5자 / 숫자 + 특수문자 1개 이상 (!,@,#,$,%,_,-)</span>
</div>
</td>
</tr>
<tr class="researcherArea"
th:classappend="${bindingVO.roleId == 'ROLE_LOCAL_INSPECTOR'} ? 'd-none'">
<th><label for="name">이름<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="name" type="text" name="name"
th:classappend="${#fields.hasErrors('name')} ? 'is-invalid'"
th:field="*{name}" maxlength="10"/>
<div class="invalid-feedback fw-bold"
th:if="${#fields.hasErrors('name')}">
에러 메세지
</div>
</div>
</div>
</td>
<th><label for="name">전화번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
<div class="component-select">
<select class="select-list" required>
<option value="value1" selected>010</option>
</select>
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone1" name="phone1" placeholder="" th:field="*{phone1}" maxlength="4">
</div>
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone2" name="phone2" placeholder="" th:field="*{phone2}" maxlength="4">
</div>
</div>
</div>
<div class="invalid-feedback fw-bold"
th:if="${#fields.hasErrors('phone1')}">
에러 메세지
</div>
</td>
</tr>
<tr class="regionMainCodeArea"
th:classappend="${bindingVO.roleId != 'ROLE_ADMIN'} ? 'd-none'">
<th><label for="regionMainCode">실사<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-select">
<select class="select-list" id="regionMainCode" name="regionMainCode"
th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
th:field="*{regionMainCode}">
<option value="">선택</option>
<option th:each="code : ${regionMainCode}"
th:value="${code.id}"
th:text="${code.codeText}">
</option>
</select>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}"
th:if="${#fields.hasErrors('regionMainCode')}">
에러 메세지
</div>
</td>
</tr>
<tr>
<th><label>사용 여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td class="radio-group">
<div class="component-input">
<label for="inlineRadio1" class="radio-inner">
<input id="inlineRadio1" th:field="*{accountDisabled}" type="radio" value="true">
<span class="radio-item">
<span class="radio-txt">미사용</span>
</span>
</label>
</div>
<div class="component-input">
<label for="inlineRadio2" class="radio-inner">
<input id="inlineRadio2" th:field="*{accountDisabled}" type="radio" value="false" checked>
<span class="radio-item">
<span class="radio-txt">사용</span>
</span>
</label>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{accountDisabled}"
th:if="${#fields.hasErrors('accountDisabled')}">
에러 메세지
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn btn-secondary" onclick="gotoList();return false;">
<span class="btn-txt">목록으로 이동</span>
</button>
<button type="button" class="btn btn-primary" onclick="createAdmin();">
<span class="btn-txt">저장</span>
</button>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn btn-secondary" onclick="gotoList();return false;">
<span class="btn-txt">취소</span>
</button>
<button type="button" class="btn btn-primary" onclick="createAdmin();">
<span class="btn-txt">등록</span>
</button>
</div>
</div>
</div>
</form>
@@ -187,8 +176,8 @@
$(document).ready(() => {
const roleSelect = document.getElementById('roleId');
onRoleChange(roleSelect);
});
const onRoleChange = (el) => {
const selectedValues = Array.from(el.selectedOptions).map(option => option.value);
const isAdmin = !selectedValues.length || selectedValues.includes('ROLE_ADMIN');
@@ -218,19 +207,19 @@
function (code, rstData) {
console.log("error : ", code);
if(code == 400) alert("아이디를 입력해주세요.");
if(code == 422) alert(rstData.responseText);
checkDuplicate = false;
},
'get',
'json'
'json',
{ handle422Type: 'alert' }
);
}
const createAdmin = () => {
if (!checkDuplicate) {
alert("아이디 중복 확인을 해주세요.");
return false;
}
const createAdmin = () => {
const f = document.adminCreateForm;
let dataOj = $(f).serializeObject();
dataOj.checkDuplicate = checkDuplicate;
ajaxUtil._ajaxMethod(
'/api/settings/admin/create',

View File

@@ -13,161 +13,150 @@
<input type="hidden" name="seq" th:field="*{seq}"/>
<table class="type-form">
<colgroup>
<col width="8%" />
<col width="33.3%" />
<col width="8%" />
<col width="33.3%" />
</colgroup>
<tbody>
<tr>
<th> <label for="roleId">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
<tr>
<th> <label for="roleId">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
<div class="component-input">
<div class="component-select">
<select class="select-list" id="roleId"
th:classappend="${#fields.hasErrors('roleId')} ? 'is-invalid'"
th:field="*{roleId}"
onchange="onRoleChange(this);">
<option value="">선택</option>
<option th:each="role : ${roles}" th:text="${role.description}"
th:value="${role.id}"></option>
</select>
</div>
</div>
</div>
</td>
</tr>
<tr>
<th><label for="id">ID<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="id" readonly="readonly" maxlength="15" th:field="*{id}"/>
</div>
</div>
</td>
<th><label for="updatePassword">비밀번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="updatePassword" placeholder="암호를 변경하고 싶다면 입력하세요"
th:classappend="${#fields.hasErrors('updatePassword')} ? 'is-invalid'"
th:field="*{updatePassword}"
type="password" maxlength="5"/>
</div>
<span>총 5자 / 숫자 + 특수문자 1개 이상 (!,@,#,$,%,_,-)</span>
</div>
</td>
</tr>
<tr class="researcherArea"
th:classappend="${#lists.isEmpty(bindingVO.roleId) or #lists.contains(bindingVO.roleId, 'ROLE_LOCAL_INSPECTOR')} ? 'd-none'">
<th><label for="name">이름<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="name" type="text" name="name"
th:classappend="${#fields.hasErrors('name')} ? 'is-invalid'"
th:field="*{name}" maxlength="10" />
</div>
</div>
</td>
<th><label for="name">전화번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
<div class="component-select">
<select class="select-list" id="roleId"
th:classappend="${#fields.hasErrors('roleId')} ? 'is-invalid'"
th:field="*{roleId}"
onchange="onRoleChange(this);">
<option value="">선택</option>
<option th:each="role : ${roles}" th:text="${role.description}"
th:value="${role.id}"></option>
<select class="select-list" required>
<option value="value1" selected>010</option>
</select>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{roleId}"
th:if="${#fields.hasErrors('roleId')}">
에러 메세지
<div class="component-input">
<div class="input-field">
<input type="number" id="phone1" name="phone1" placeholder=""
maxlength="4" oninput="limitMaxLength(this);"
th:value="${bindingVO.phone1 != null ? bindingVO.phone1 : ''}">
</div>
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone2" name="phone2" placeholder=""
maxlength="4" oninput="limitMaxLength(this);"
th:value="${bindingVO.phone2 != null ? bindingVO.phone2 : ''}">
</div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<th><label for="id">ID<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="id" readonly="readonly" th:field="*{id}"/>
</div>
</div>
</td>
<th><label for="updatePassword">비밀번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="updatePassword" placeholder="암호를 변경하고 싶다면 입력하세요"
th:classappend="${#fields.hasErrors('updatePassword')} ? 'is-invalid'"
th:field="*{updatePassword}"
type="password"/>
<div class="invalid-feedback fw-bold" th:errors="*{updatePassword}"
th:if="${#fields.hasErrors('updatePassword')}">
에러 메세지
</div>
</div>
<span>총 5자 / 숫자 + 특수문자 1개 이상 (!,@,#,$,%,_,-)</span>
</div>
</td>
</tr>
<tr class="researcherArea"
th:classappend="${#lists.isEmpty(bindingVO.roleId) or #lists.contains(bindingVO.roleId, 'ROLE_LOCAL_INSPECTOR')} ? 'd-none'">
<th><label for="name">이름<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="name" type="text" name="name"
th:classappend="${#fields.hasErrors('name')} ? 'is-invalid'"
th:field="*{name}" maxlength="10" />
<div class="invalid-feedback fw-bold"
th:if="${#fields.hasErrors('name')}">
에러 메세지
</div>
</div>
</div>
</td>
<th><label for="name">전화번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
</td>
</tr>
<tr class="regionMainCodeArea"
th:classappend="${#lists.isEmpty(bindingVO.roleId) or #lists.contains(bindingVO.roleId, 'ROLE_ADMIN')} ? 'd-none'">
<th><label for="regionMainCode">실사<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-select">
<select class="select-list" required>
<option value="value1" selected>010</option>
<select class="select-list" id="regionMainCode" name="regionMainCode"
th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
th:field="*{regionMainCode}">
<option value="">선택</option>
<option th:each="code : ${regionMainCode}"
th:value="${code.id}"
th:text="${code.codeText}">
</option>
</select>
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone1" name="phone1" placeholder="" maxlength="4"
th:value="${bindingVO.phone1 != null ? bindingVO.phone1 : ''}">
</div>
</div>
<div class="invalid-feedback fw-bold"
th:if="${#fields.hasErrors('phone1')}">
<div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}"
th:if="${#fields.hasErrors('regionMainCode')}">
에러 메세지
</div>
</td>
</tr>
<tr>
<th> <label>사용 여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td class="radio-group">
<div class="component-input">
<div class="input-field">
<input type="number" id="phone2" name="phone2" placeholder="" maxlength="4"
th:value="${bindingVO.phone2 != null ? bindingVO.phone2 : ''}">
</div>
<label for="inlineRadio1" class="radio-inner">
<input id="inlineRadio1" th:field="*{accountDisabled}" type="radio" value="true">
<span class="radio-item">
<span class="radio-txt">미사용</span>
</span>
</label>
</div>
<div class="invalid-feedback fw-bold"
th:if="${#fields.hasErrors('phone2')}">
<div class="component-input">
<label for="inlineRadio2" class="radio-inner">
<input id="inlineRadio2" th:field="*{accountDisabled}" type="radio" value="false">
<span class="radio-item">
<span class="radio-txt">사용</span>
</span>
</label>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{accountDisabled}"
th:if="${#fields.hasErrors('accountDisabled')}">
에러 메세지
</div>
</div>
</td>
</tr>
<tr class="regionMainCodeArea"
th:classappend="${#lists.isEmpty(bindingVO.roleId) or #lists.contains(bindingVO.roleId, 'ROLE_ADMIN')} ? 'd-none'">
<th><label for="regionMainCode">실사<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-select">
<select class="select-list" id="regionMainCode" name="regionMainCode"
th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
th:field="*{regionMainCode}">
<option value="">선택</option>
<option th:each="code : ${regionMainCode}"
th:value="${code.id}"
th:text="${code.codeText}">
</option>
</select>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}"
th:if="${#fields.hasErrors('regionMainCode')}">
에러 메세지
</div>
</td>
</tr>
<tr>
<th> <label>사용 여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td class="radio-group">
<div class="component-input">
<label for="inlineRadio1" class="radio-inner">
<input id="inlineRadio1" th:field="*{accountDisabled}" type="radio" value="true">
<span class="radio-item">
<span class="radio-txt">미사용</span>
</span>
</label>
</div>
<div class="component-input">
<label for="inlineRadio2" class="radio-inner">
<input id="inlineRadio2" th:field="*{accountDisabled}" type="radio" value="false">
<span class="radio-item">
<span class="radio-txt">사용</span>
</span>
</label>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{accountDisabled}"
th:if="${#fields.hasErrors('accountDisabled')}">
에러 메세지
</div>
</td>
</tr>
</td>
</tr>
</tbody>
</table>
<!-- <div th:replace="common/components :: auditArea"></div>-->
<div class="component-btns bottom-btn-group">
<div class="btns-row">
<div class="btns-row align-right">
<button type="button" class="btn btn-secondary" onclick="gotoList();return false;">
<span class="btn-txt">목록</span>
<span class="btn-txt">취소</span>
</button>
<button type="button" class="btn btn-primary" onclick="updateAdmin();">
<span class="btn-txt">저장</span>
<span class="btn-txt">등록</span>
</button>
</div>
</div>

View File

@@ -3,7 +3,7 @@
layout:decorate="~{layout/layout}">
<div class="layer-wrap" th:fragment="modalFragment">
<form autocomplete="off" method="get" name="reqResearcherForm">
<form autocomplete="off" method="get" name="reqResearcherForm" onsubmit="return false;">
<input name="page" value="0" type="hidden"/>
<input name="size" value="10" type="hidden">
@@ -38,7 +38,9 @@
</div>
<div class="component-input">
<div class="input-field">
<input type="text" id="searchField" name="searchValue" placeholder="">
<input type="text" id="searchField"
name="searchValue" placeholder=""
onkeydown="if(event.key === 'Enter'){ event.preventDefault(); getResearchers(0); }">
</div>
</div>
</div>

View File

@@ -197,7 +197,9 @@
<div class="d-flex">
<div class="component-input">
<div class="input-field">
<input type="text" name="researcherName" id="researcherName" placeholder="">
<input type="text" name="researcherName" id="researcherName"
placeholder="" readonly
style="background-color: #fff; color: #000; cursor: default;">
</div>
</div>
<button type="button" class="btn" onclick="showResearcherModal();">

View File

@@ -425,7 +425,11 @@
// 일계부 등록 현황 상세
const getDailyRecordsView = (id, groupNo, dayGroupText) => {
if (id == null) {
showDailyCreateConfirm(groupNo);
if ($('.underline:contains("' + dayGroupText + '")').parent().find('.tag').text().indexOf('대기') === -1) {
showDailyCreateConfirm(groupNo);
} else {
alert('등록된 내역이 없습니다.');
}
return;
}

View File

@@ -213,8 +213,9 @@
<div class="component-input">
<div class="input-field">
<input type="text" name="researcherName" id="researcherName"
placeholder=""
th:value="${householdInfo.researcherName}">
placeholder="" readonly
th:value="${householdInfo.researcherName}"
style="background-color: #fff; color: #000; cursor: default;">
<input type="hidden" name="researcherSeq" id="researcherSeq"
th:value="${householdInfo.researcherSeq}">
</div>

View File

@@ -3,7 +3,7 @@
layout:decorate="~{layout/layout}">
<section layout:fragment="content">
<form autocomplete="off" method="get" name="reqForm">
<form autocomplete="off" method="get" name="reqForm" onsubmit="return false;">
<input type="hidden" name="householdSeq" th:value="${seq}">
<div class="content-inner">

View File

@@ -60,8 +60,10 @@
<button type="button" class="tab-label" data-tab-value="tab1">담당 임가 목록</button>
<button type="button" class="tab-label" data-tab-value="tab2">임가방문정보</button>
<div class="component-select select-date" id="monthTab2" style="display: none;">
<select name="searchMonth" class="select-list search-month-container" onchange="getHouseholdVisitList();">
<option th:each="month : ${monthList}"
<select name="searchMonth" class="select-list search-month-container"
onchange="getVisitHouseholdPercentage();
getHouseholdVisitList();">
<option th:each="month : ${monthList}"
th:value="${month.value}"
th:text="${month.label}"
th:selected="${month.value == currentMonth}">
@@ -150,7 +152,7 @@
<th>방문일</th>
<th>관리분야</th>
<th>내용</th>
<th>작성일</th>
<th>최종 수정자</th>
<th>답례품 전달</th>
</tr>
</thead>
@@ -272,7 +274,7 @@
}
// 임가 방문 퍼센트
const getVisitHouseholdPercentage=()=>{
const getVisitHouseholdPercentage = () => {
const f = document.householdReqForm;
let dataObj = {

View File

@@ -19,7 +19,7 @@
</div>
<div class="component-input">
<div class="input-field">
<input type="text" id="floatingInput" name="username" placeholder="아이디 입력">
<input type="text" id="floatingInput" name="username" placeholder="아이디 입력" maxlength="15">
</div>
</div>
</div>

View File

@@ -38,7 +38,7 @@ class DownloadFileController {
// 로컬 파일 경로
File downloadedFile = new File(file.getLocalPath());
if (!downloadedFile.exists()) {
throw new IllegalStateException("Downloaded file not found: " + file.getLocalPath());
throw new IllegalStateException("파일 다운로드에 실패하였습니다.");
}

View File

@@ -41,7 +41,7 @@ class UpdateFileDao implements UpdateFilePortOut {
command.getType().getName()
)));
for (UploadFileDto file : deletedFileList) {
/* for (UploadFileDto file : deletedFileList) {
try {
sftpFileDeleteUtil.deleteRealFile(file);
} catch (JSchException | SftpException e) {
@@ -51,7 +51,7 @@ class UpdateFileDao implements UpdateFilePortOut {
log.error("Unexpected error while deleting file for mapping ID {}: {}", file.getId(), e.getMessage(), e);
throw new RuntimeException("Unexpected error while deleting file", e);
}
}
}*/
if (!deletedFileList.isEmpty()) {
mapper.deleteFile(

View File

@@ -18,7 +18,7 @@ public class SftpFileUrlStrategy implements FileUrlStrategy {
@Override
public String getAttachmentURL(Long fileId) {
return String.format("/api/file/download/%s", fileId);
return String.format("/content-disposition/attachment/%s", fileId);
}
}

View File

@@ -1,27 +1,42 @@
package app.module.core.usecase.getAttachment.adapters.web;
import app.module.core.config.application.enums.FileStorageType;
import app.module.core.config.application.util.SftpFileDownloader;
import app.module.core.usecase.file.getFile.ports.GetFilePortIn;
import app.module.core.usecase.file.getFile.ports.application.domain.GetFile;
import app.module.core.usecase.file.getFile.ports.application.domain.GetFileCmd;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.SftpException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.UrlResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.util.UriUtils;
@Slf4j
@RestController
@RequiredArgsConstructor
class GetAttachmentController {
private final GetFilePortIn getFilePortIn;
private final SftpFileDownloader sftpFileDownloader;
@Value("${path.upload.public}")
private String publicPath;
@Value("${app.aws.s3.domain:null}")
@@ -34,11 +49,14 @@ class GetAttachmentController {
@GetMapping(path = "/content-disposition/attachment/{fileId}")
ResponseEntity<?> operate(@PathVariable Long fileId) throws MalformedURLException {
GetFile getFile =
getFilePortIn
.operate(new GetFileCmd(fileId))
.orElseThrow(
() -> new RuntimeException(String.format("파일을 찾을 수 없습니다. ID: %s", fileId)));
GetFile getFile;
try {
getFile = getFilePortIn.operate(new GetFileCmd(fileId))
.orElseThrow(() -> new RuntimeException(String.format("파일을 찾을 수 없습니다. ID: %s", fileId)));
} catch (RuntimeException e) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body("파일을 찾을 수 없습니다: " + e.getMessage());
}
// TODO - private 업로드 기능을 일단 mute
@@ -56,35 +74,74 @@ class GetAttachmentController {
// () -> new AccessDeniedException("[AccessDenied] Private 파일 리소스 접근 권한이 없습니다."));
// }
// HTTP 헤더 설정
String encodedFileName = URLEncoder.encode(getFile.getOriginName(), StandardCharsets.UTF_8)
.replace("+", "%20");
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename*=UTF-8''" + encodedFileName);
headers.add(HttpHeaders.CACHE_CONTROL, "no-cache, no-store, must-revalidate");
headers.add(HttpHeaders.PRAGMA, "no-cache");
headers.add(HttpHeaders.EXPIRES, "0");
UrlResource resource = null;
switch (FileStorageType.valueOf(uploadStorageType)) {
case LOCAL:
String filePath =
Paths.get(publicPath, getFile.getPath(), getFile.getName())
.toString();
String filePath = Paths.get(publicPath, getFile.getPath(), getFile.getName()).toString();
File localFile = new File(filePath);
if (!localFile.exists()) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body("파일을 찾을 수 없습니다: ");
}
return ResponseEntity.ok()
.headers(headers)
.contentLength(localFile.length())
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(new FileSystemResource(localFile));
resource = new UrlResource("file:" + filePath);
break;
case S3:
resource =
new UrlResource(
"https://"
+ cloudFrontDomain
+ bucketFolder
+ getFile.getPath()
+ "/"
+ getFile.getName());
break;
String s3Url = "https://" + cloudFrontDomain + bucketFolder + getFile.getPath() + "/" + getFile.getName();
UrlResource s3Resource = new UrlResource(s3Url);
if (!s3Resource.exists()) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body("S3 파일을 찾을 수 없습니다: " + s3Url);
}
return ResponseEntity.ok()
.headers(headers)
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(s3Resource);
case SFTP:
try {
sftpFileDownloader.downloadFile(getFile);
} catch (JSchException | SftpException | IOException e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("SFTP 파일 다운로드에 실패했습니다: " + e.getMessage());
}
File downloadedFile = new File(getFile.getLocalPath());
if (!downloadedFile.exists()) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body("다운로드된 파일을 찾을 수 없습니다: " + getFile.getLocalPath());
}
return ResponseEntity.ok()
.headers(headers)
.contentLength(downloadedFile.length())
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(new FileSystemResource(downloadedFile));
default:
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body("지원되지 않는 저장소 타입입니다: " + uploadStorageType);
}
String encodedUploadFileName = UriUtils.encode(getFile.getOriginName(),
/* String encodedUploadFileName = UriUtils.encode(getFile.getOriginName(),
StandardCharsets.UTF_8);
String contentDisposition = "attachment; filename=\"" + encodedUploadFileName + "\"";
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, contentDisposition)
.body(resource);
.body(resource);*/
}
}

View File

@@ -23,8 +23,14 @@
LEFT JOIN uicode u ON u.parent_id = 'code.region.main' AND u.id = a.region_main_code
WHERE a.is_deleted = false
<if test="cmd.searchField != null and cmd.searchValue != null and cmd.searchValue != ''">
<if test="cmd.searchValue != null and cmd.searchValue != ''">
<choose>
<when test="cmd.searchField == ''">
AND (
a.id ILIKE '%' || #{cmd.searchValue} || '%'
OR a.name ILIKE '%' || #{cmd.searchValue} || '%'
)
</when>
<when test="cmd.searchField == 'name'">AND a.name LIKE '%' || #{cmd.searchValue} || '%'</when>
<when test="cmd.searchField == 'id'">AND a.id LIKE '%' || #{cmd.searchValue} || '%'</when>
</choose>
@@ -48,24 +54,7 @@
)
</if>
<if test="pageable.sort != null and !pageable.sort.isEmpty()">
ORDER BY
<foreach collection="pageable.sort" item="order" separator=",">
<choose>
<when test="order.property eq 'id'">a.id</when>
<when test="order.property eq 'email'">a.email</when>
<when test="order.property eq 'accountDisabled'">a.account_disabled</when>
<when test="order.property eq 'accountLocked'">a.account_locked</when>
<when test="order.property eq 'createdAt'">a.created_at</when>
<when test="order.property eq 'updatedAt'">a.updated_at</when>
<otherwise>a.created_at</otherwise>
</choose>
<choose>
<when test="order.direction.toString() eq 'DESC'">DESC</when>
<otherwise>ASC</otherwise>
</choose>
</foreach>
</if>
ORDER BY a.seq DESC
OFFSET #{pageable.offset} ROWS FETCH NEXT #{pageable.pageSize} ROWS ONLY
</select>

View File

@@ -22,7 +22,7 @@ delete from uri where id in (
'uri.admin.settings.adminRoles'
);
-- front_user
-- front_user 테이블 : household 로 사용되어 삭제
DROP TABLE IF EXISTS front_user_has_upload_file;
DROP TABLE IF EXISTS front_user_has_role;
DROP TABLE IF EXISTS front_user_social;
@@ -33,6 +33,7 @@ DROP SEQUENCE IF EXISTS front_user_has_upload_file_seq;
DROP SEQUENCE IF EXISTS front_user_has_role_seq;
DROP SEQUENCE IF EXISTS front_user_social_seq ;
-- 일계부 테이블 : daily_xxx 로 사용되어 삭제
DROP TABLE IF EXISTS input_day_group;
DROP TABLE IF EXISTS daily_input_status;
DROP TABLE IF EXISTS income_expense_record;
@@ -51,10 +52,17 @@ DROP SEQUENCE IF EXISTS work_input_seq;
DROP SEQUENCE IF EXISTS forestry_self_consumption_seq;
DROP SEQUENCE IF EXISTS agriculture_self_consumption_seq;
-- 샘플 게시판 테이블 : 미사용으로 삭제
DROP TABLE IF EXISTS article_has_upload_file ;
DROP TABLE IF EXISTS article_comment ;
DROP TABLE IF EXISTS article ;
DROP SEQUENCE IF EXISTS article_comment_seq ;
-- 이월금(매달 1일, 말일) 테이블 : daily_summary 로 사용되어 삭제
DROP TABLE IF EXISTS monthly_carryover;
DROP SEQUENCE IF EXISTS monthly_carryover_seq;

View File

@@ -39,7 +39,6 @@ DROP TABLE IF EXISTS suggestion;
DROP TABLE IF EXISTS upload_receipt_files;
DROP TABLE IF EXISTS forest_product_yield;
DROP TABLE IF EXISTS forest_product;
DROP TABLE IF EXISTS monthly_carryover;
DROP TABLE IF EXISTS bank_auto_transfer;
DROP TABLE IF EXISTS monthly_input_status;
@@ -84,7 +83,6 @@ DROP SEQUENCE IF EXISTS research_area_seq;
DROP SEQUENCE IF EXISTS upload_receipt_files_seq;
DROP SEQUENCE IF EXISTS forest_product_yield_seq;
DROP SEQUENCE IF EXISTS forest_product_seq;
DROP SEQUENCE IF EXISTS monthly_carryover_seq;
DROP SEQUENCE IF EXISTS bank_auto_transfer_seq;

View File

@@ -1016,46 +1016,6 @@ COMMENT ON COLUMN bank_auto_transfer.transfer_category_code IS '이체 카테고
COMMENT ON COLUMN bank_auto_transfer.unit IS '단위(직접입력)';
COMMENT ON COLUMN bank_auto_transfer.category IS '카테고리';
-- 6. monthly_carryover
-- ============================================
-- TABLE : monthly_carryover
-- DESC : 이월금(매달 1일, 말일) 테이블
-- ============================================
CREATE SEQUENCE monthly_carryover_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
CREATE TABLE monthly_carryover (
id bigint DEFAULT nextval('monthly_carryover_seq') NOT NULL, -- 이월금 ID
household_seq bigint NOT NULL, -- 임가정보 일련번호 (FK)
month varchar(7) NOT NULL, -- 조사시행 월 (yyyy-mm)
start_price integer, -- 월초이월금(현금)
end_price integer, -- 월말현금
created_at timestamp(6) NOT NULL, -- 생성일
created_by varchar(255) NOT NULL, -- 생성자
updated_at timestamp(6) NOT NULL, -- 수정일
updated_by varchar(255) NOT NULL, -- 수정자
deleted_at timestamp(6), -- 삭제일
deleted_by varchar(255), -- 삭제자
is_deleted boolean DEFAULT false, -- 삭제여부
CONSTRAINT monthly_carryover_pkey PRIMARY KEY (id),
CONSTRAINT fk_monthly_carryover__household FOREIGN KEY (household_seq) REFERENCES household(seq)
);
COMMENT ON TABLE monthly_carryover IS '이월금(매달 1일, 말일)';
COMMENT ON COLUMN monthly_carryover.id IS '이월금 ID';
COMMENT ON COLUMN monthly_carryover.household_seq IS '임가정보 일련번호';
COMMENT ON COLUMN monthly_carryover.month IS '조사시행 월 (yyyy-mm)';
COMMENT ON COLUMN monthly_carryover.start_price IS '월초이월금(현금)';
COMMENT ON COLUMN monthly_carryover.end_price IS '월말현금';
COMMENT ON COLUMN monthly_carryover.created_at IS '생성일';
COMMENT ON COLUMN monthly_carryover.created_by IS '생성자';
COMMENT ON COLUMN monthly_carryover.updated_at IS '수정일';
COMMENT ON COLUMN monthly_carryover.updated_by IS '수정자';
COMMENT ON COLUMN monthly_carryover.deleted_at IS '삭제일';
COMMENT ON COLUMN monthly_carryover.deleted_by IS '삭제자';
COMMENT ON COLUMN monthly_carryover.is_deleted IS '삭제여부';
-- 12. upload_receipt_files
-- ============================================

View File

@@ -86,7 +86,7 @@ public class DailyStatusUIController {
dailyPowerPortIn.monthList(new DailyPowerUIReqVO(searchMonth, "")));
}
case FORESTRY -> {
processStep(model, DailySort.EXPENSE,
processStep(model, DailySort.FORESTRY,
dailyForestryPortIn.monthList(new DailyForestryUIReqVO(searchMonth, "")));
}
case FARMING -> {

View File

@@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.util.HtmlUtils;
import java.util.List;
import java.util.Optional;
@@ -29,6 +30,11 @@ class GetNoticeDao implements GetNoticePortOut {
@Transactional
public Optional<GetNotice> operate(GetNoticeCmd command) {
GetNotice secArticle = mapper.getNotice(command);
if (secArticle.getContent() != null) {
String cleanedContent = HtmlUtils.htmlUnescape(secArticle.getContent());
cleanedContent = cleanedContent.replaceAll("<p>\\s*</p>", "</br>");
secArticle.setContent(cleanedContent);
}
List<GetNoticeUploadFile> setArticleUploadFile =
mapper.getUploadFiles(command.getId());

View File

@@ -1,25 +1,17 @@
# ==============================================
# 로깅 설정
# ==============================================
logging:
file:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
messages:
# 메시지 소스 캐시 지속 시간(초)
# 4초마다 메시지 파일을 다시 읽어옵니다
# 개발 시에는 짧은 간격으로, 운영 시에는 길게 설정하는 것이 일반적
cache-duration: 10s
thymeleaf:
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
cache: false
# ==============================================
# 타임리프 설정
# ==============================================
thymeleaf:
cache: false # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
# ==============================================
# 데이터베이스 설정
# ==============================================
@@ -30,6 +22,14 @@ spring:
username: ENC(37ccHxlpbsEz8vVcZUZA/j6azKYhP3eHwhOYVjYGf+zKC3u/qc+khKcKuBuE8+Ck)
password: ENC(uBHyXdI39UzPNvYNHDGfjmMMuhN83xoP8F3wDq/S9DxizhFwbMeEqa36oZ205CBg)
# ==============================================
# 로깅 설정
# ==============================================
logging:
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 암호화 설정
# ==============================================

View File

@@ -1,22 +1,37 @@
# ==============================================
# 로깅 설정
# ==============================================
logging:
file:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 다국어 처리 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 다국어 처리 설정
# ==============================================
messages:
# 메시지 캐시 지속 시간(초)
cache-duration: 10s
# ==============================================
# 타임리프 설정
# ==============================================
thymeleaf:
cache: false # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
# ==============================================
# 데이터베이스 설정
# ==============================================
datasource:
kri:
driver-class-name: org.postgresql.Driver
jdbc-url: ENC(SH5G+4mdOrW3PpVEmVyNXIFyV7eFC6uLTa0e18qa+7ueQeWrduIeGVJLrQP3mUw86dzqLK7AUHjTRuex4ud+rTt026L7csDLFYzLWGkGCTEqfFBOwHng3uQ7n+qmkKiW)
username: ENC(37ccHxlpbsEz8vVcZUZA/j6azKYhP3eHwhOYVjYGf+zKC3u/qc+khKcKuBuE8+Ck)
password: ENC(uBHyXdI39UzPNvYNHDGfjmMMuhN83xoP8F3wDq/S9DxizhFwbMeEqa36oZ205CBg)
# ==============================================
# 로깅 설정
# ==============================================
logging:
level:
app:
module: DEBUG # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# Spring Bean 등록 과정도 확인
org.springframework.beans.factory.support.DefaultListableBeanFactory: DEBUG
org.apache.ibatis: TRACE
org.mybatis.spring: TRACE
# ==============================================
# 암호화 설정
# ==============================================

View File

@@ -1,24 +1,11 @@
# ==============================================
# 로깅 설정
# ==============================================
logging:
file:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
app:
module: INFO # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
spring:
# ==============================================
# 메시지 및 국제화(i18n) 설정
# ==============================================
messages:
# 메시지 소스 캐시 지속 시간 (단위: 초)
# 개발 환경에서는 짧은 간격(10-60초), 운영 환경에서는 긴 간격(3600초 이상) 권장
cache-duration: 5m
thymeleaf:
# 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장)
cache: false
# ==============================================
# 데이터베이스 설정
# ==============================================
@@ -30,7 +17,7 @@ spring:
password: ENC(kUIzqWTu0+bqjYH4Jq9TFOOh3UwY+XVvA2OlT4VXJvxWCas66UNdGRmWDQKri5fI)
# ==============================================
# 서버 압축 설정
# 세션 설정
# ==============================================
server:
servlet:

View File

@@ -1,7 +1,7 @@
# ==============================================
# 메세지 및 다국어 처리를 위한 설정
# ==============================================
spring:
# ==============================================
# 메세지 및 다국어 처리를 위한 설정
# ==============================================
messages:
basename: messages/exception,messages/validation,messages/uri,messages/operation
encoding: UTF-8
@@ -21,56 +21,25 @@ spring:
max-lifetime: 900000
connection-timeout: 5000
leak-detection-threshold: 30000
# 정적 자원 캐싱 설정
# ==============================================
# 정적 리소스 설정
# ==============================================
web:
resources:
# 정적 리소스 캐싱 기간(초) - 1년 (31536000초)
cache:
period: 31536000 # 캐싱 기간 1년(초)
period: 31536000
# 리소스 버저닝 설정
chain:
strategy:
content:
enabled: true # 리소스 버저닝 활성화
paths: /** # 버저닝 적용 경로
# 타임리프 설정
thymeleaf:
cache: false # 타임리프 캐시 비활성화
# OAuth2 설정
security:
oauth2:
client:
registration:
naver:
client-id: vxAbBgwMTU0gXiMSCSGT # 네이버 개발자센터에서 발급받은 클라이언트 ID
client-secret: fBVwFSOcGd # 네이버 개발자센터에서 발급받은 클라이언트 시크릿 (보안 주의!)
redirect-uri: http://localhost:9001/login/oauth2/code/naver # 인증 후 리다이렉트될 URI
authorization-grant-type: authorization_code # OAuth2 인증 유형 (authorization_code 고정)
client-name: Naver # 로그인 화면에 표시될 프로바이더 이름
scope: name,email,birthday,phone # 요청할 사용자 정보 범위 (프로필, 이메일, 생일, 전화번호)
kakao:
client-id: 75ab31248046bef7b5077a07b9bee808 # 카카오 개발자센터에서 발급받은 클라이언트 ID
client-secret: 2YEhGfQ8fFTf3A5IexrrII8qvMzFw998 # 카카오 개발자센터에서 발급받은 클라이언트 시크릿
redirect-uri: http://localhost:9001/login/oauth2/code/kakao # 인증 후 리다이렉트 URI
authorization-grant-type: authorization_code
client-name: Kakao # 로그인 버튼에 표시될 이름
client-authentication-method: client_secret_post
scope: profile_nickname, profile_image # 카카오에서 지원하는 스코프 (필요한 정보 선택)
provider:
naver:
authorization-uri: https://nid.naver.com/oauth2.0/authorize # 인증 요청 URI
token-uri: https://nid.naver.com/oauth2.0/token # 토큰 발급 URI
user-info-uri: https://openapi.naver.com/v1/nid/me # 사용자 정보 조회 URI
user-name-attribute: response # 사용자 정보 응답에서 이름을 추출할 JSON 필드 경로
kakao:
authorization-uri: https://kauth.kakao.com/oauth/authorize # 카카오 인증 URI
token-uri: https://kauth.kakao.com/oauth/token # 토큰 발급 URI
user-info-uri: https://kapi.kakao.com/v2/user/me # 사용자 정보 조회 URI
user-name-attribute: id # 사용자 정보 응답에서 이름 추출할 필드 (기본값은 'id')
# 콘텐츠 기반 버저닝 활성화
enabled: true
# 버저닝 적용 경로
paths: /**
# ==============================================
# 프론트엔드 설정
# 사용자 관련 설정
# ==============================================
app:
front:
@@ -96,12 +65,20 @@ app:
# 로깅 설정
# ==============================================
logging:
file:
path: ${user.home}/logs # 로그 파일 저장 경로 (사용자 홈 디렉토리 하위 logs 폴더)
level:
org:
hibernate:
orm:
jdbc:
bind: trace # Hibernate SQL 파라미터 바인딩 로깅
# Hibernate SQL 파라미터 바인딩 값 로깅 레벨
bind: trace
# Spring Framework 코어 모듈 로깅 레벨 (INFO 레벨로 설정)
springframework: INFO
app:
module: INFO # 애플리케이션 기본 패키지 로깅 레벨 (패키지 경로 변경 필요시 수정)
# ==============================================
# MyBatis 설정
# ==============================================
@@ -110,11 +87,20 @@ mybatis:
kri: classpath*:mappers/**/*Mapper.xml # 매퍼 파일 위치
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # SQL 로깅 구현체
# ==============================================
# 서버 압축 설정
# 세션 설정
# ==============================================
server:
servlet:
session:
cookie:
name: FRONT_SESSION
name: FRONT_SESSION
# ==============================================
# 암호화 설정
# ==============================================
jasypt:
encryptor:
password: #별도관리
algorithm: #별도관리

View File

@@ -39,8 +39,7 @@
resultType="app.module.front.usecase.info.notice.getNotice.ports.application.domain.GetNoticeUploadFile">
/* getUploadFiles 상세 게시글 조회 시, 첨부파일 조회 */
SELECT
awuf.notice_id AS noticeId,
awuf.upload_files_id AS uploadfileId,
uf.mapping_id AS noticeId,
uf.id AS id,
uf.created_at AS createdAt,
uf.created_by AS createdBy,
@@ -51,9 +50,7 @@
uf.origin_name AS originName,
uf.path AS path,
uf.type AS type
FROM notice_has_upload_file awuf
INNER JOIN upload_file uf
ON awuf.upload_files_id = uf.id
WHERE awuf.notice_id = #{id}
FROM upload_file uf
WHERE uf.mapping_id = #{id} and uf.is_deleted = false and uf.type='NOTICE'
</select>
</mapper>

View File

@@ -38,7 +38,6 @@ etUI.utils.ready(function () {
// [공통] container 클래스 업데이트
etUI.pages.updateContainerClassByLayout = function () {
const container = document.getElementById('container');
const modalcontainer = document.querySelector('.modal-container');
if (!container) return;
const hasFixedBtns = document.querySelector('.component-btns.fixed');
@@ -56,15 +55,6 @@ etUI.utils.ready(function () {
} else {
container.classList.remove('btm-footer');
}
// modalcontainer 클래스 처리 (fixed 버튼만 체크)
if (modalcontainer) {
if (hasFixedBtns) {
modalcontainer.classList.add('btm-fixbtn');
} else {
modalcontainer.classList.remove('btm-fixbtn');
}
}
};
// [공통] 탭 버튼 활성화 토글

File diff suppressed because one or more lines are too long

View File

@@ -13,15 +13,21 @@
</dd>
</dl>
<div class="detail-content">
<p th:utext="${notice.content}"></p>
<p th:utext="${ notice.content }"></p>
</div>
<div class="download-file" th:if="${!#lists.isEmpty(notice.uploadFiles)}">
<p class="tit">첨부파일</p>
<ul>
<li th:each="item : ${notice.uploadFiles}"><a th:href="${item.attachmentURL}" download
th:text="${item.originName}"></a></li>
<li th:each="item : ${notice.uploadFiles}">
<a href="javascript:void(0);"
th:text="${item.originName}"
th:data-url="${item.attachmentURL}"
th:data-filename="${item.originName}"
onclick="formControl.fileDownload(this)">
</a>
</li>
</ul>
</div>
@@ -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);
});
}
},
}
</script>

View File

@@ -222,7 +222,7 @@
<div class="component-modal term-wrap confirmPopup" data-props-dimm-click="true">
<div class="modal-dimm"></div>
<div class="modal-frame">
<div class="modal-container">
<div class="modal-container btm-fixbtn">
<div class="modal-header">
<h3 class="modal-tit">개인정보 변경 약관</h3>
</div>

View File

@@ -341,6 +341,16 @@
_initializeMonthMode() {
const allCells = this._getAllCells()
allCells.forEach(cell => cell.classList.remove(DatepickerComponent.CONSTANTS.CLASSES.HIDE))
// 요일 헤더와 셀 상태 초기화
if (this.instances.datepicker?.refresh) {
this.instances.datepicker.refresh()
}
this.instances.datepicker.setOptions({
...this.instances.datepickerComp.core.props,
weekStart: DatepickerComponent.CONSTANTS.WEEK_START_SUNDAY
})
}
// // Week navigation