Merge branch 'dev' into deploy-dev-admin
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,5 @@ public class AdminCreateBindingVO {
|
||||
private Boolean accountDisabled;
|
||||
/* private Boolean accountLocked;*/
|
||||
private String roleId;
|
||||
private Boolean checkDuplicate;
|
||||
}
|
||||
|
||||
@@ -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개 이상입니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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개 이상입니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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();">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -593,4 +601,27 @@ AS SELECT a.seq,
|
||||
LEFT JOIN researcher_has_household rhh ON rhh.admin_seq = a.seq AND rhh.is_deleted = false
|
||||
LEFT JOIN household h ON h.seq = rhh.household_seq AND h.is_panel IS TRUE AND h.is_deleted = false
|
||||
WHERE ahr.role_id::text = 'ROLE_RESEARCHER'::text
|
||||
GROUP BY a.seq, a.id, a.name, a.phone, a.account_disabled;
|
||||
GROUP BY a.seq, a.id, a.name, a.phone, a.account_disabled;
|
||||
|
||||
-- ============================================
|
||||
-- 개인정보 변경 동의 내역
|
||||
-- ============================================
|
||||
-- public.term_agreement
|
||||
|
||||
CREATE SEQUENCE public.term_agreement_seq
|
||||
INCREMENT BY 1
|
||||
MINVALUE 1
|
||||
MAXVALUE 9223372036854775807
|
||||
START 1
|
||||
CACHE 1
|
||||
NO CYCLE;
|
||||
|
||||
CREATE TABLE public.term_agreement (
|
||||
id int8 DEFAULT nextval('term_agreement_seq'::regclass) NOT NULL,
|
||||
seq int8 not NULL,
|
||||
"type" varchar(10) NULL,
|
||||
previous_data varchar(10) NULL,
|
||||
created_at timestamp(6) NULL,
|
||||
created_by varchar(255) null,
|
||||
CONSTRAINT term_agreement_pkey PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
-- ============================================
|
||||
|
||||
@@ -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 -> {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.front.usecase.info.userFront.insertTermAgreement.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.annotation.CreateCommand;
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.InsertTermAgreementPortOut;
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.application.domain.InsertTermAgreementCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class InsertTermAgreementDao implements InsertTermAgreementPortOut {
|
||||
|
||||
private final InsertTermAgreementMapper mapper;
|
||||
|
||||
@Override
|
||||
@CreateCommand
|
||||
public void operate(InsertTermAgreementCmd cmd) {
|
||||
mapper.insert(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.userFront.insertTermAgreement.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFront;
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.application.domain.InsertTermAgreementCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Mapper
|
||||
public interface InsertTermAgreementMapper {
|
||||
void insert(InsertTermAgreementCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.front.usecase.info.userFront.insertTermAgreement.ports;
|
||||
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.application.domain.InsertTermAgreementCmd;
|
||||
|
||||
public interface InsertTermAgreementPortIn {
|
||||
void operate(InsertTermAgreementCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.front.usecase.info.userFront.insertTermAgreement.ports;
|
||||
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.application.domain.InsertTermAgreementCmd;
|
||||
|
||||
public interface InsertTermAgreementPortOut {
|
||||
void operate(InsertTermAgreementCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.front.usecase.info.userFront.insertTermAgreement.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.InsertTermAgreementPortIn;
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.InsertTermAgreementPortOut;
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.application.domain.InsertTermAgreementCmd;
|
||||
import app.module.front.usecase.info.userFront.updateUser.ports.UpdateUserFrontPortIn;
|
||||
import app.module.front.usecase.info.userFront.updateUser.ports.UpdateUserFrontPortOut;
|
||||
import app.module.front.usecase.info.userFront.updateUser.ports.application.domain.UpdateUserFrontCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class InsertTermAgreementService implements InsertTermAgreementPortIn {
|
||||
private final InsertTermAgreementPortOut portOut;
|
||||
|
||||
@Override
|
||||
public void operate(InsertTermAgreementCmd cmd) { portOut.operate(cmd); }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.front.usecase.info.userFront.insertTermAgreement.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditCommand;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class InsertTermAgreementCmd extends AuditCommand {
|
||||
private Long seq;
|
||||
private String previousData;
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.front.usecase.info.userFront.updateUser.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditCommand;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class InsertUserFrontTermAgreementCmd extends AuditCommand {
|
||||
private Long seq;
|
||||
private String previousData;
|
||||
private String type;
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import app.module.front.config.application.response.ApiResponse;
|
||||
import app.module.front.usecase.info.userFront.getUserFront.ports.GetUserFrontPortIn;
|
||||
import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFront;
|
||||
import app.module.front.usecase.info.userFront.getUserFront.ports.application.domain.GetUserFrontCmd;
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.InsertTermAgreementPortIn;
|
||||
import app.module.front.usecase.info.userFront.insertTermAgreement.ports.application.domain.InsertTermAgreementCmd;
|
||||
import app.module.front.usecase.info.userFront.updateUser.ports.UpdateUserFrontPortIn;
|
||||
import app.module.front.usecase.info.userFront.updateUser.ports.application.domain.UpdateUserFrontCmd;
|
||||
import app.module.front.usecase.info.userUI.updateUserUI.adapters.web.model.UpdateUserReqVO;
|
||||
@@ -25,6 +27,7 @@ class UpdateUserController {
|
||||
private final UpdateUserFrontPortIn updateUserPortIn;
|
||||
|
||||
private final GetUserFrontPortIn getUserPortIn;
|
||||
private final InsertTermAgreementPortIn insertTermAgreementPortIn;
|
||||
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
@@ -36,6 +39,13 @@ class UpdateUserController {
|
||||
}
|
||||
GetUserFront getHousehold = getUserPortIn.operate(new GetUserFrontCmd(CommonUtil.getLoginUsername())).orElseThrow();
|
||||
|
||||
if(reqVO.getTermAgreement()){
|
||||
insertTermAgreementPortIn.operate(new InsertTermAgreementCmd(
|
||||
getHousehold.getSeq(),
|
||||
getHousehold.getOwnerName(),
|
||||
"PERSONAL"
|
||||
));
|
||||
}
|
||||
updateUserPortIn.operate(new UpdateUserFrontCmd(
|
||||
getHousehold.getSeq(),
|
||||
reqVO.getOwnerName(),
|
||||
|
||||
@@ -48,4 +48,7 @@ public class UpdateUserReqVO {
|
||||
@NotBlank(message = "전체 주소를 입력해주세요.")//"주소는 필수 항목입니다.")
|
||||
@Size(max = 255, message = "전체 주소를 입력해주세요.")//"주소는 255자 이하여야 합니다.")
|
||||
private String address;
|
||||
|
||||
private Boolean termAgreement;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.front.usecase.info.userFront.insertTermAgreement.adapters.persistence.InsertTermAgreementMapper">
|
||||
|
||||
<update id="insert">
|
||||
INSERT INTO term_agreement(
|
||||
id,
|
||||
seq,
|
||||
"type",
|
||||
previous_data,
|
||||
created_at,
|
||||
created_by
|
||||
)VALUES(
|
||||
nextval('term_agreement_seq'::regclass),
|
||||
#{seq},
|
||||
#{type},
|
||||
#{previousData},
|
||||
NOW(),
|
||||
#{createdBy}
|
||||
)
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -1,19 +0,0 @@
|
||||
[
|
||||
{"no":1, "start":1, "end":2, "children": []},
|
||||
{"no":2, "start":3, "end":4, "children": [{}, {}]},
|
||||
{"no":3, "start":5, "end":6, "children": []},
|
||||
{"no":4, "start":7, "end":7, "children": [{}]},
|
||||
{"no":5, "start":8, "end":9, "children": []},
|
||||
{"no":6, "start":10, "end":11, "children": []},
|
||||
{"no":7, "start":12, "end":13, "children": []},
|
||||
{"no":8, "start":14, "end":14, "children": []},
|
||||
{"no":9, "start":15, "end":16, "children": []},
|
||||
{"no":10, "start":17, "end":18, "children": []},
|
||||
{"no":11, "start":19, "end":20, "children": [{}, {}]},
|
||||
{"no":12, "start":21, "end":21, "children": []},
|
||||
{"no":13, "start":22, "end":23, "children": []},
|
||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||
{"no":16, "start":28, "end":29, "children": []},
|
||||
{"no":17, "start":30, "end":31, "children": []}
|
||||
]
|
||||
@@ -1,18 +0,0 @@
|
||||
[
|
||||
{"no":1, "start":1, "end":2, "children": []},
|
||||
{"no":2, "start":3, "end":4, "children": [{}, {}]},
|
||||
{"no":3, "start":5, "end":6, "children": []},
|
||||
{"no":4, "start":7, "end":7, "children": [{}]},
|
||||
{"no":5, "start":8, "end":9, "children": []},
|
||||
{"no":6, "start":10, "end":11, "children": []},
|
||||
{"no":7, "start":12, "end":13, "children": []},
|
||||
{"no":8, "start":14, "end":14, "children": []},
|
||||
{"no":9, "start":15, "end":16, "children": []},
|
||||
{"no":10, "start":17, "end":18, "children": []},
|
||||
{"no":11, "start":19, "end":20, "children": [{}, {}]},
|
||||
{"no":12, "start":21, "end":21, "children": []},
|
||||
{"no":13, "start":22, "end":23, "children": []},
|
||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||
{"no":16, "start":28, "end":28, "children": []}
|
||||
]
|
||||
@@ -1,19 +0,0 @@
|
||||
[
|
||||
{"no":1, "start":1, "end":2, "children": []},
|
||||
{"no":2, "start":3, "end":4, "children": [{}, {}]},
|
||||
{"no":3, "start":5, "end":6, "children": []},
|
||||
{"no":4, "start":7, "end":7, "children": [{}]},
|
||||
{"no":5, "start":8, "end":9, "children": []},
|
||||
{"no":6, "start":10, "end":11, "children": []},
|
||||
{"no":7, "start":12, "end":13, "children": []},
|
||||
{"no":8, "start":14, "end":14, "children": []},
|
||||
{"no":9, "start":15, "end":16, "children": []},
|
||||
{"no":10, "start":17, "end":18, "children": []},
|
||||
{"no":11, "start":19, "end":20, "children": [{}, {}]},
|
||||
{"no":12, "start":21, "end":21, "children": []},
|
||||
{"no":13, "start":22, "end":23, "children": []},
|
||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||
{"no":16, "start":28, "end":29, "children": []},
|
||||
{"no":17, "start":30, "end":31, "children": []}
|
||||
]
|
||||
@@ -1,19 +0,0 @@
|
||||
[
|
||||
{"no":1, "start":1, "end":2, "children": []},
|
||||
{"no":2, "start":3, "end":4, "children": [{}, {}]},
|
||||
{"no":3, "start":5, "end":6, "children": []},
|
||||
{"no":4, "start":7, "end":7, "children": [{}]},
|
||||
{"no":5, "start":8, "end":9, "children": []},
|
||||
{"no":6, "start":10, "end":11, "children": []},
|
||||
{"no":7, "start":12, "end":13, "children": []},
|
||||
{"no":8, "start":14, "end":14, "children": []},
|
||||
{"no":9, "start":15, "end":16, "children": []},
|
||||
{"no":10, "start":17, "end":18, "children": []},
|
||||
{"no":11, "start":19, "end":20, "children": [{}, {}]},
|
||||
{"no":12, "start":21, "end":21, "children": []},
|
||||
{"no":13, "start":22, "end":23, "children": []},
|
||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||
{"no":16, "start":28, "end":29, "children": []},
|
||||
{"no":17, "start":30, "end":30, "children": []}
|
||||
]
|
||||
@@ -1,19 +0,0 @@
|
||||
[
|
||||
{"no":1, "start":1, "end":2, "children": []},
|
||||
{"no":2, "start":3, "end":4, "children": [{}, {}]},
|
||||
{"no":3, "start":5, "end":6, "children": []},
|
||||
{"no":4, "start":7, "end":7, "children": [{}]},
|
||||
{"no":5, "start":8, "end":9, "children": []},
|
||||
{"no":6, "start":10, "end":11, "children": []},
|
||||
{"no":7, "start":12, "end":13, "children": []},
|
||||
{"no":8, "start":14, "end":14, "children": []},
|
||||
{"no":9, "start":15, "end":16, "children": []},
|
||||
{"no":10, "start":17, "end":18, "children": []},
|
||||
{"no":11, "start":19, "end":20, "children": [{}, {}]},
|
||||
{"no":12, "start":21, "end":21, "children": []},
|
||||
{"no":13, "start":22, "end":23, "children": []},
|
||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||
{"no":16, "start":28, "end":29, "children": []},
|
||||
{"no":17, "start":30, "end":31, "children": []}
|
||||
]
|
||||
@@ -1,19 +0,0 @@
|
||||
[
|
||||
{"no":1, "start":1, "end":2, "children": []},
|
||||
{"no":2, "start":3, "end":4, "children": [{}, {}]},
|
||||
{"no":3, "start":5, "end":6, "children": []},
|
||||
{"no":4, "start":7, "end":7, "children": [{}]},
|
||||
{"no":5, "start":8, "end":9, "children": []},
|
||||
{"no":6, "start":10, "end":11, "children": []},
|
||||
{"no":7, "start":12, "end":13, "children": []},
|
||||
{"no":8, "start":14, "end":14, "children": []},
|
||||
{"no":9, "start":15, "end":16, "children": []},
|
||||
{"no":10, "start":17, "end":18, "children": []},
|
||||
{"no":11, "start":19, "end":20, "children": []},
|
||||
{"no":12, "start":21, "end":21, "children": []},
|
||||
{"no":13, "start":22, "end":23, "children": []},
|
||||
{"no":14, "start":24, "end":25, "children": []},
|
||||
{"no":15, "start":26, "end":27, "children": []},
|
||||
{"no":16, "start":28, "end":29, "children": []},
|
||||
{"no":17, "start":30, "end":30, "children": []}
|
||||
]
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"name": "My App",
|
||||
"short_name": "MyApp",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#ffffff",
|
||||
//"theme_color": "#4BBC43",
|
||||
"icons": [
|
||||
{
|
||||
"src": "kri_appimg.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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
@@ -31,7 +31,7 @@
|
||||
<!-- iOS 홈화면 -->
|
||||
<link rel="apple-touch-icon" th:href="@{/static/assets/images/kri_appimg.png}">
|
||||
<!-- PWA -->
|
||||
<link rel="manifest" th:href="@{/static/assets/json/manifest.json}">
|
||||
<link rel="manifest" th:href="@{/static/manifest.json}">
|
||||
<link rel="icon" type="image/x-icon" th:href="@{/static/assets/images/kri_favicon.ico}" />
|
||||
<link rel="shortcut icon" type="image/x-icon" th:href="@{/static/assets/images/kri_favicon.ico}" />
|
||||
<link th:href="@{/static/assets/styles/style.css}" type="text/css" rel="stylesheet" />
|
||||
|
||||
@@ -204,40 +204,41 @@
|
||||
const clearAllItems = document.getElementById('clearAllItems');
|
||||
|
||||
if (ENV.data.editable) {
|
||||
if(ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508"){
|
||||
if( ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
|
||||
const handlePageShow = function(event) {
|
||||
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
|
||||
// history.back으로 돌아온 경우 (navigation.type == 2)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
sessionStorage.removeItem('pastInputAlertShown'); // 플래그 제거
|
||||
return; // 알림창 표시하지 않음
|
||||
}
|
||||
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
|
||||
const handlePageShow = function (event) {
|
||||
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
|
||||
// history.back으로 돌아온 경우 (navigation.type == 2)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
sessionStorage.removeItem('pastInputAlertShown'); // 플래그 제거
|
||||
return; // 알림창 표시하지 않음
|
||||
}
|
||||
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
kri.isReturn = true;
|
||||
const hasShownAlert = sessionStorage.getItem('pastInputAlertShown');
|
||||
if (!hasShownAlert && ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
etUI.dialog.alert({
|
||||
title: '지난달 정보 등록하기',
|
||||
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
|
||||
type: 'alert',
|
||||
callback: function() {
|
||||
sessionStorage.setItem('pastInputAlertShown', 'true');
|
||||
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
|
||||
},
|
||||
});
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
kri.isReturn = true;
|
||||
const hasShownAlert = sessionStorage.getItem('pastInputAlertShown');
|
||||
if (!hasShownAlert && ENV.data.pastBankList.length === 0) {
|
||||
etUI.dialog.alert({
|
||||
title: '지난달 정보 등록하기',
|
||||
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
sessionStorage.setItem('pastInputAlertShown', 'true');
|
||||
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// 초기 로드 시 실행
|
||||
handlePageShow({ persisted: false, performance: window.performance });
|
||||
// 초기 로드 시 실행
|
||||
handlePageShow({persisted: false, performance: window.performance});
|
||||
|
||||
}
|
||||
}
|
||||
if (ENV.data.currentStatus == "NONE") {
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
@@ -474,15 +475,30 @@
|
||||
const field = form.elements.namedItem(key);
|
||||
if (field) {
|
||||
field.value = val;
|
||||
if(key == 'transferCategoryCode' && val == "code.bank.input.self"){
|
||||
if(key === 'transferCategoryCode' && (val === "code.bank.input.self" || val === "code.bank.input.1" || val === "code.bank.input.4")){
|
||||
document.getElementById(val+"_value").value = product["transferCategory"];
|
||||
}
|
||||
if(key == 'unitCode' && val == "code.count.unit.self"){
|
||||
if(key === 'unitCode' && val === "code.count.unit.self"){
|
||||
document.getElementById("unitDiv").style.display = "";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (product.transferCategoryCode === "code.bank.input.self") {
|
||||
const transferCategoryInput = document.getElementById(product.transferCategoryCode + "_value");
|
||||
if (transferCategoryInput) {
|
||||
transferCategoryInput.value = product.transferCategory || "";
|
||||
}
|
||||
}
|
||||
|
||||
// 단위 입력 필드 표시 여부 처리
|
||||
if (product.unitCode === "code.count.unit.self") {
|
||||
const unitDiv = document.getElementById("unitDiv");
|
||||
if (unitDiv) {
|
||||
unitDiv.style.display = "";
|
||||
}
|
||||
}
|
||||
|
||||
ENV.elementRefs.select.cropCodeSelect.setValue(product.cropCode);
|
||||
ENV.elementRefs.select.transferCategoryCodeSelect.setValue(product.transferCategoryCode);
|
||||
ENV.elementRefs.select.unitCodeSelect.setValue(product.unitCode);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<section class="form-group">
|
||||
<form method="post" name="reqForm" id="reqForm" onsubmit="formControl.authInfoUser();"
|
||||
th:action="@{/api/front/info/user/update}" th:object="${userInfo}">
|
||||
<input type="hidden" name="termAgreement" value="false" />
|
||||
<!-- 이름 -->
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
@@ -61,6 +62,7 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="" th:classappend="${userInfo.tel1 == ''?' current':'' }">선택</li>
|
||||
<li class="option" data-value="02" th:classappend="${userInfo.tel1 == '02'?' current':'' }">02</li>
|
||||
<li class="option" data-value="031" th:classappend="${userInfo.tel1 == '031'?' current':'' }">31</li>
|
||||
<li class="option" data-value="033" th:classappend="${userInfo.tel1 == '033'?' current':'' }">033</li>
|
||||
@@ -135,7 +137,6 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="regionSubCodeId" class="component-select bottom-sheet" data-props-default="지역 선택"
|
||||
data-props-type="bottomSheet">
|
||||
<input type="hidden" name="regionSubCode" data-type="select" th:value="${userInfo.regionSubCode}">
|
||||
@@ -150,7 +151,6 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
|
||||
<ul class="">
|
||||
<!-- <th:block th:each="item : ${regionMainList}">-->
|
||||
<!-- <li class="option" th:data-value="${item.id}"-->
|
||||
@@ -197,7 +197,7 @@
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="text" id="temp_input_00023" placeholder="세부 주소를 입력해 주세요"
|
||||
<input type="text" id="temp_input_00023" placeholder="전체 주소를 입력해 주세요"
|
||||
th:field="*{address}" maxlength="50"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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>
|
||||
@@ -363,66 +363,73 @@
|
||||
// selectboxInstance1.setValue($('input[name=regionMainCode]').val());
|
||||
},
|
||||
confirmPopup() {
|
||||
//유효성 검사
|
||||
const form = document.getElementById('reqForm');
|
||||
kri.form.errorInit(form);
|
||||
const selects = ['tel1', 'phone1', 'regionSubCode', 'regionDetailCode'];
|
||||
selects.forEach(id => {
|
||||
const sel = document.getElementById(id);
|
||||
if (sel && sel.value) form[id].value = sel.value;
|
||||
});
|
||||
|
||||
const errors = [];
|
||||
if (!form.ownerName.value) errors.push({field: 'ownerName', message: '이름을 입력해 주세요.'});
|
||||
if (!form.ownerAge.value) errors.push({field: 'ownerAge', message: '연령을 입력해 주세요.'});
|
||||
if (form.ownerAge.value < 0 || form.ownerAge.value > 120) errors.push({field: 'ownerAge', message: '연령은 0세이상 120세 이하이어야 합니다.'});
|
||||
if (form.tel1.value || form.tel2.value || form.tel3.value) {
|
||||
if (!form.tel1.value || !form.tel2.value || !form.tel3.value) {
|
||||
errors.push({ field: 'tel1', message: '가구 연락처를 모두 입력해 주세요.' });
|
||||
} else {
|
||||
const telRegex = /^(0[2-7][0-9]?)$/; // 지역번호 (예: 02, 031, 032 등)
|
||||
if (!telRegex.test(form.tel1.value)) errors.push({ field: 'tel1', message: '가구 연락처를 입력해주세요' }); // 유효한 지역번호를 선택해 주세요.
|
||||
if (form.tel2.value.length < 3 || form.tel2.value.length > 4) errors.push({ field: 'tel2', message: '가구 연락처를 입력해주세요.' });// 가구 연락처 중간 자리수는 3~4자리여야 합니다.
|
||||
if (form.tel3.value.length !== 4) errors.push({ field: 'tel3', message: '가구 연락처를 입력해주세요.' }); // 가구 연락처 마지막 자리수는 4자리여야 합니다.
|
||||
}
|
||||
}
|
||||
if (form.phone1.value || form.phone2.value || form.phone3.value) {
|
||||
if (form.phone1.value.length !== 3) errors.push({ field: 'phone1', message: '핸드폰 번호를 입력해 주세요.' });
|
||||
if (form.phone2.value.length < 3 || form.phone2.value.length > 4) errors.push({ field: 'phone2', message: '핸드폰 번호를 입력해 주세요.' });
|
||||
if (form.phone3.value.length !== 4) errors.push({ field: 'phone3', message: '핸드폰 번호를 입력해 주세요.' });
|
||||
}
|
||||
if (!form.phone1.value ||!form.phone2.value || !form.phone3.value) errors.push({field: 'phone1', message: '휴대폰 번호를 입력해 주세요.'});
|
||||
if (!form.regionSubCode.value) errors.push({field: 'regionSubCode', message: '지역을 선택해 주세요.'});
|
||||
if (!form.regionDetailCode.value) errors.push({field: 'regionDetailCode', message: '세부 지역를 선택해 주세요.'});
|
||||
if (!form.address.value) errors.push({field: 'address', message: '전체 주소를 입력해 주세요.'});
|
||||
|
||||
kri.form.error(errors);
|
||||
if (errors.length > 0) return;
|
||||
|
||||
// 이름 변경 여부 처리
|
||||
const currentName = document.querySelector('input[name="ownerName"]').value.trim();
|
||||
const isNameChanged = currentName !== ENV.initialOwnerName;
|
||||
|
||||
formControl.updateUserInfo(isNameChanged);
|
||||
if(isNameChanged){
|
||||
ENV.module.confirmPopup.open();
|
||||
}else {
|
||||
formControl.updateUserInfo();
|
||||
}
|
||||
},
|
||||
confirmPopupOk() {
|
||||
ENV.module.confirmPopup.close();
|
||||
|
||||
setTimeout(() => {
|
||||
ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => {
|
||||
location.href = '/info';
|
||||
});
|
||||
}, 500);
|
||||
document.querySelector('input[name="termAgreement"]').value = true;
|
||||
formControl.updateUserInfo();
|
||||
},
|
||||
updateUserInfo(showPopupIfValidNameChanged = false) {
|
||||
|
||||
updateUserInfo() {
|
||||
const f = document.reqForm;
|
||||
// // TODO 어쩔수 없이 이렇게 하는데..... 콤포넌트값 핸들링 방법 UX에서 지정하면 수정해야함.
|
||||
// const tel1Element = document.getElementById('tel1Id');
|
||||
// const phone1IdElement = document.getElementById('phone1Id');
|
||||
// const regionMainCodeIdElement = document.getElementById('regionMainCodeId');
|
||||
// const regionSubCodeIdElement = document.getElementById('regionSubCodeId');
|
||||
// if (tel1Element && tel1Element.value) {
|
||||
// f.tel1.value = tel1Element.value;
|
||||
// }
|
||||
// if (phone1IdElement && phone1IdElement.value) {
|
||||
// f.phone1.value = phone1IdElement.value;
|
||||
// }
|
||||
// if (regionMainCodeIdElement && regionMainCodeIdElement.value) {
|
||||
// f.regionMainCode.value = regionMainCodeIdElement.value;
|
||||
// }
|
||||
// if (regionSubCodeIdElement && regionSubCodeIdElement.value) {
|
||||
// f.regionSubCode.value = regionSubCodeIdElement.value;
|
||||
// }
|
||||
|
||||
f.regionSubCode.value = ENV.select.regionSelect.getParentValue();
|
||||
f.regionDetailCode.value = ENV.select.regionSelect.getChildValue();
|
||||
f.tel1.value = ENV.select.selectTel.getValue();
|
||||
f.phone1.value = ENV.select.selectPhone.getValue();
|
||||
|
||||
|
||||
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
console.log(obj)
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.user,
|
||||
obj,
|
||||
$(f).serializeObject(),
|
||||
function (rstData, status) {
|
||||
if (rstData.code === 'SUCCESS') {
|
||||
// 유효성 검사를 모두 통과한 후
|
||||
if (showPopupIfValidNameChanged) {
|
||||
// 이름이 바뀐 경우만 팝업
|
||||
ENV.module.confirmPopup.open();
|
||||
} else {
|
||||
ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => {
|
||||
location.href = '/info';
|
||||
});
|
||||
}
|
||||
ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, () => {
|
||||
location.href = '/info';
|
||||
});
|
||||
} else if (rstData.code === 'ERROR') {
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user