Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
김현주
2025-06-27 11:12:56 +09:00
19 changed files with 75 additions and 56 deletions

View File

@@ -48,8 +48,8 @@ public class AdminCreateValidator implements Validator {
if (vo.getName() == null || vo.getName().isBlank()) {
errors.rejectValue("name", "error.name", "이름을 입력해주세요.");
}
if (vo.getName().length() > 4) {
errors.rejectValue("name", "error.name", "이름은 4자리까지 입력가능합니다.");
if (vo.getName().length() > 10) {
errors.rejectValue("name", "error.name", "이름은 10자까지 입력가능합니다.");
}
if (vo.getPhone1() == null || vo.getPhone1().isBlank()) {
errors.rejectValue("phone1", "error.phone1", "전화번호 앞자리를 입력해주세요.");

View File

@@ -34,8 +34,8 @@ public class AdminUpdateValidator implements Validator {
if (vo.getName() == null || vo.getName().isBlank()) {
errors.rejectValue("name", "error.name", "이름을 입력해주세요.");
}
if (vo.getName().length() > 4) {
errors.rejectValue("name", "error.name", "이름은 4자리까지 입력가능합니다.");
if (vo.getName().length() > 10) {
errors.rejectValue("name", "error.name", "이름은 10자까지 입력가능합니다.");
}
if (vo.getPhone1() == null || vo.getPhone1().isBlank()) {
errors.rejectValue("phone1", "error.phone1", "전화번호 앞자리를 입력해주세요.");

View File

@@ -115,4 +115,5 @@ public class ResearcherDao implements ResearcherPortOut {
}
return i;
}
}

View File

@@ -17,6 +17,7 @@ import java.util.Objects;
@RequiredArgsConstructor
@RequestMapping(path = "/api/researcher")
class ResearcherApiController {
private final ResearcherPortIn researcherPortIn;
@GetMapping(path = "/list")
@@ -63,4 +64,5 @@ class ResearcherApiController {
ResponseEntity<?> updateMappingHousehold(@RequestBody MappingHouseholdListReqVO reqVO ) {
return ResponseEntity.status(HttpStatus.OK).body(researcherPortIn.updateMappingHousehold(reqVO));
}
}

View File

@@ -7,6 +7,7 @@ import org.springframework.data.domain.Page;
import java.util.List;
public interface ResearcherPortIn {
Page<ResearchersDto> list(ResearchersListReqVO reqVO);
ResearchersDto detail(Integer adminSeq);
Page<ResearchersMappingHouseholdDto> mappingHouseholdList(ResearchersDetailReqVO reqVO);
@@ -17,4 +18,5 @@ public interface ResearcherPortIn {
Integer visitHouseholdDelete(List<Integer> selectIds);
Page<GetPopupHouseholds> searchMappingHousehold(HouseholdSearchReqVO reqVO);
Integer updateMappingHousehold(MappingHouseholdListReqVO reqVO);
}

View File

@@ -64,9 +64,9 @@ app:
permit: 5
session:
validity:
# 세션 유효기간(초) - 1시간 (3600초)
# 세션 유효기간(초) - 무한정으로 수정,,,
period:
seconds: 3600
seconds: -1
maximum:
# 최대 세션 갯수 (1일 경우 중복 로그인 불가)
num: 1

View File

@@ -19,6 +19,9 @@
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 = 'ROLE_RESEARCHER'
<if test="searchField == '' and searchValue != null and searchValue != ''">
and ( a.name LIKE CONCAT('%', #{searchValue}, '%') or a.phone LIKE CONCAT('%', #{searchValue}, '%') )
</if>
<if test="searchField == 'name' and searchValue != null and searchValue != ''">
and a.name LIKE CONCAT('%', #{searchValue}, '%')
</if>

View File

@@ -79,7 +79,7 @@
<div class="input-field">
<input id="name" type="text" name="name"
th:classappend="${#fields.hasErrors('name')} ? 'is-invalid'"
th:field="*{name}"/>
th:field="*{name}" maxlength="10"/>
<div class="invalid-feedback fw-bold"
th:if="${#fields.hasErrors('name')}">
에러 메세지
@@ -97,12 +97,12 @@
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone1" name="phone1" placeholder="" th:field="*{phone1}">
<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}">
<input type="number" id="phone2" name="phone2" placeholder="" th:field="*{phone2}" maxlength="4">
</div>
</div>
</div>

View File

@@ -165,7 +165,6 @@
f.searchDisabled.value = '';
}
function goUpdate(adminId) {
location.href = '/settings/admins/update/' + adminId; // 쿼리 파라미터 없이 이동
}

View File

@@ -71,7 +71,7 @@
<div class="input-field">
<input id="name" type="text" name="name"
th:classappend="${#fields.hasErrors('name')} ? 'is-invalid'"
th:field="*{name}"/>
th:field="*{name}" maxlength="10" />
<div class="invalid-feedback fw-bold"
th:if="${#fields.hasErrors('name')}">
에러 메세지
@@ -89,7 +89,7 @@
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone1" name="phone1" placeholder=""
<input type="number" id="phone1" name="phone1" placeholder="" maxlength="4"
th:value="${bindingVO.phone1 != null ? bindingVO.phone1 : ''}">
</div>
</div>
@@ -99,7 +99,7 @@
</div>
<div class="component-input">
<div class="input-field">
<input type="number" id="phone2" name="phone2" placeholder=""
<input type="number" id="phone2" name="phone2" placeholder="" maxlength="4"
th:value="${bindingVO.phone2 != null ? bindingVO.phone2 : ''}">
</div>
</div>

View File

@@ -145,6 +145,7 @@
(response) => {
console.log("임가방문정보 상세 응답값 : ", response);
setVisitFormData(response);
document.querySelector(".modal-visit-info").ui.open();
},
function (code, rstData) {
console.log("error : ", code);
@@ -152,9 +153,9 @@
'get',
'json'
);
} else {
document.querySelector(".modal-visit-info").ui.open();
}
document.querySelector(".modal-visit-info").ui.open();
}
// 임가방문정보 상세 값 set

View File

@@ -222,9 +222,6 @@
etUI.dialog.confirm({
title: '삭제 안내',
message: '선택하신 내용을 삭제하시겠습니까?<br>삭제한 항목은 복구할 수 없습니다.',
negativeCallback: function () {
},
positiveCallback: function () {
goDeleteForestProduct(checkedIds);
},
@@ -234,7 +231,6 @@
// 임산물현황 삭제
const goDeleteForestProduct = (checkedIds) => {
const f = document.reqForm;
console.log("f.monthlyInputStatusId.value", f.monthlyInputStatusId.value);
ajaxUtil._ajaxMethod(
'/api/household/forestProducts/delete',

View File

@@ -10,7 +10,7 @@
<h3></h3>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn small btn-secondary" onclick="goDeleteVisitInfo();">
<button type="button" class="btn small btn-secondary" onclick="showDeleteVisitInfoConfirm();">
<span class=" btn-txt">삭제</span>
</button>
<button type="button" class="btn small btn-primary" onclick="showVisitInfoModal();">
@@ -94,38 +94,47 @@
);
}
// 임가방문정보 삭제
const goDeleteVisitInfo = () => {
// 임가방문정보 삭제 confirm
const showDeleteVisitInfoConfirm = () => {
const checkedIds = Array.from(
document.querySelectorAll('input[name="visitRemoveIds"]:checked')
).map(el => Number(el.value));
if(checkedIds.length <= 0) {
alert("임가방문정보를 선택해주세요.");
return
return;
}
if(confirm("선택하신 내용을 삭제하시겠습니까? 삭제한 항목은 복구할 수 없습니다.")) {
const f = document.reqForm;
etUI.dialog.confirm({
title: '삭제 안내',
message: '선택하신 내용을 삭제하시겠습니까?<br>삭제한 항목은 복구할 수 없습니다.',
positiveCallback: function () {
goDeleteVisitInfo(checkedIds);
},
});
}
ajaxUtil._ajaxMethod(
'/api/visitInfo/remove',
JSON.stringify({
householdSeq: f.householdSeq.value,
visitRemoveIds: checkedIds
}),
(response) => { // 성공
alert("방문정보가 삭제되었습니다.");
getVisitInfo();
},
function (code, rstData) {
if(code == 422) alert(rstData.responseText);
},
'delete',
'json',
{ handle422Type: 'alert' }
);
}
// 임가방문정보 삭제
const goDeleteVisitInfo = (checkedIds) => {
const f = document.reqForm;
ajaxUtil._ajaxMethod(
'/api/visitInfo/remove',
JSON.stringify({
householdSeq: f.householdSeq.value,
visitRemoveIds: checkedIds
}),
() => { // 성공
alert("방문정보가 삭제되었습니다.");
getVisitInfo();
},
function (code, rstData) {
if(code == 422) alert(rstData.responseText);
},
'delete',
'json',
{ handle422Type: 'alert' }
);
}
</script>
</div>

View File

@@ -25,7 +25,7 @@
</div>
<div class="component-input">
<div class="input-field">
<input type="text" id="temp_input_0001" th:field="*{searchValue}" placeholder="검색어를 입력하세요.">
<input type="text" id="temp_input_0001" th:field="*{searchValue}" placeholder="검색어를 입력하세요." onkeypress="if(event.key === 'Enter') goSearch();">
</div>
</div>
</div>
@@ -181,6 +181,8 @@
f.searchValue.value = '';
f.searchArea.value = '';
f.searchAccountDisabled.value = '';
f.method = 'GET';
f.submit();
}
// 상세페이지 이동
function goDetail(seq) {

View File

@@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
public class UpdateUserReqVO {
@NotBlank(message = "이름을 입력해주세요.")//"이름은 필수 항목입니다.")
@Pattern(regexp = "^[가-힣]{2,10}$", message = "이름을 입력해주세요.")//"이름은 2~10자의 한글이어야 합니다.")
@Pattern(regexp = "^[가-힣0-9()]{2,10}$", message = "이름을 입력해주세요.")//"이름은 2~10자의 한글이어야 합니다.")
private String ownerName;
@NotNull(message = "나이를 입력해주세요.")
@@ -19,13 +19,13 @@ public class UpdateUserReqVO {
@Max(value = 120, message = "나이를 입력해주세요.")//"나이는 120세 이하이어야 합니다.")
private Integer ownerAge;
@Pattern(regexp = "^\\d{2,3}$", message = "가구 연락처를 입력해주세요.")//"가구 연락처는 2~3자리 숫자여야 합니다.")
@Pattern(regexp = "^$|^\\d{2,3}$", message = "가구 연락처를 입력해주세요.")//"가구 연락처는 2~3자리 숫자여야 합니다.")
private String tel1;
@Pattern(regexp = "^\\d{3,4}$", message = "가구 연락처를 입력해주세요.")//"가운데 번호는 3~4자리 숫자여야 합니다.")
@Pattern(regexp = "^$|^\\d{3,4}$", message = "가구 연락처를 입력해주세요.")//"가운데 번호는 3~4자리 숫자여야 합니다.")
private String tel2;
@Pattern(regexp = "^\\d{4}$", message = "가구 연락처를 입력해주세요.")//"끝 번호는 4자리 숫자여야 합니다.")
@Pattern(regexp = "^$|^\\d{4}$", message = "가구 연락처를 입력해주세요.")//"끝 번호는 4자리 숫자여야 합니다.")
private String tel3;
@Pattern(regexp = "^\\d{2,3}$", message = "휴대폰 번호를 입력해주세요.")//"휴대폰 번호는 2~3자리 숫자여야 합니다.")

View File

@@ -369,7 +369,6 @@
errors.push({field: form.transferCategoryCode.value+"_value", message: '수입대상을 입력해주세요.'});
}
}
if (!form.sourcePurpose.value) errors.push({field: 'sourcePurpose', message: '수입원을 입력해주세요.'});
if(form.count.value){
if(!form.unitCode.value){
@@ -559,7 +558,9 @@
</div>
<ul class="detail-list">
<li><p>재배형태</p><span>${getCrop(product.cropCode)}</span></li>
<li><p>수입원</p><span>${product.sourcePurpose}</span></li>
${product.sourcePurpose != null && product.sourcePurpose != ''
? `<li><p>수입원</p><span>${product.sourcePurpose}</span></li>`
: ''}
${tagCount}
<li><p>현금</p><span>${format(product.price)}원</span></li>
</ul>

View File

@@ -86,12 +86,16 @@
<!-- transferCategory+Text-->
<th:block th:each="item : ${transferCategoryList}">
<div class="component-input " th:data-option="${item.codeText}">
<div class="input-field">
<input type="text" th:id="${item.id}+'_value'" th:name="${item.id}+'_value'" value="" placeholder="수입 대상을 입력해 주세요." maxlength="30">
<div class="input-field" th:if="${item.id != 'code.bank.input.10' and item.id != 'code.bank.input.12' and item.id != 'code.bank.input.13'}">
<input type="text" th:id="${item.id}+'_value'" th:name="${item.id}+'_value'"
value="" maxlength="30"
th:placeholder="${item.id == 'code.bank.input.self' ? '수입의 종류를 입력해 주세요.' : '수입 대상을 입력해 주세요.'}">
</div>
<th:block th:if="${item.id == 'code.bank.input.1' or item.id == 'code.bank.input.4'}">
<ul class="guide-info" th:if="${item.msgCode}">
<li class="txt-blue" th:text="${item.msgCode}"></li>
</ul>
</th:block>
</div>
</th:block>
</div>
@@ -100,7 +104,6 @@
<div class="input-label">
<label for="sourcePurpose" class="label-txt">
수입원
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field">

View File

@@ -361,7 +361,6 @@
}
}
if (!form.sourcePurpose.value) errors.push({field: 'sourcePurpose', message: '용도 입력해주세요.'});
if(form.count.value){
if(!form.unitCode.value){
errors.push({
@@ -552,7 +551,9 @@
${buttonGroupHtml}
</div>
<ul class="detail-list">
<li><p>용도</p><span>${product.sourcePurpose}</span></li>
${product.sourcePurpose != null && product.sourcePurpose != ''
? `<li><p>용도</p><span>${product.sourcePurpose}</span></li>`
: ''}
${tagCount}
<li><p>현금</p><span>${format(product.price)}원</span></li>
</ul>

View File

@@ -63,7 +63,6 @@
<div class="input-label">
<label for="sourcePurpose" class="label-txt">
용도
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field">