단속 > 소유자행위자 관리 : 등록팝업 벨리데이션 검증 항목 추가

수정,삭제 기능 적용
                       검색조건 이름,주민번호 적용 및 정리
dev
dg_kim 4 months ago
parent 70fb4177a2
commit c6a826e270

@ -5,7 +5,6 @@ import egovframework.constant.TilesConstants;
import egovframework.exception.MessageException;
import egovframework.util.ApiResponseUtil;
import egovframework.util.SessionUtil;
import go.kr.project.common.model.CmmnCodeSearchVO;
import go.kr.project.common.service.CommonCodeService;
import go.kr.project.ownact.ownActRegistAndView.model.OwnActRegistAndViewVO;
import go.kr.project.ownact.ownActRegistAndView.service.OwnActRegistAndViewService;
@ -159,4 +158,57 @@ public class OwnActRegistAndViewController {
}
}
/**
* .
*
* @param paramVO VO
* @return ResponseEntity
*/
@Operation(summary = "소유자행위자 수정", description = "기존 소유자행위자 정보를 수정합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "단속 수정 성공"),
@ApiResponse(responseCode = "400", description = "단속 수정 실패"),
@ApiResponse(description = "오류로 인한 실패")
})
@PostMapping("/update.ajax")
public ResponseEntity<?> update(@ModelAttribute OwnActRegistAndViewVO paramVO) {
log.debug("소유자행위자 정보 수정 요청 - 소유자ID: {}", paramVO.getOwnrId());
int result = service.update(paramVO);
if (result > 0) {
return ApiResponseUtil.success(MessageConstants.Common.UPDATE_SUCCESS);
} else {
return ApiResponseUtil.error(MessageConstants.Common.UPDATE_ERROR);
}
}
/**
* . ( )
*
* @param ownrId ID
* @return ResponseEntity
*/
@Operation(summary = "소유자행위자 삭제", description = "소유자행위자 정보를 삭제(논리삭제)합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "소유자행위자 삭제 성공"),
@ApiResponse(responseCode = "400", description = "소유자행위자 삭제 실패"),
@ApiResponse(description = "오류로 인한 실패")
})
@PostMapping("/delete.ajax")
public ResponseEntity<?> delete(@RequestParam String ownrId) {
log.debug("소유자행위자 정보 삭제 요청 - 소유자ID: {}", ownrId);
OwnActRegistAndViewVO paramVO = new OwnActRegistAndViewVO();
paramVO.setOwnrId(ownrId);
int result = service.delete(paramVO);
if (result > 0) {
return ApiResponseUtil.success(MessageConstants.Common.DELETE_SUCCESS);
} else {
return ApiResponseUtil.error(MessageConstants.Common.DELETE_ERROR);
}
}
}

@ -50,45 +50,17 @@ public interface OwnActRegistAndViewMapper {
int insert(OwnActRegistAndViewVO vo);
/**
* .
* @param vo VO
* .
* @param vo VO
* @return
*/
//int update(CrdnRegistAndViewVO vo);
int update(OwnActRegistAndViewVO vo);
/**
* . ( )
* @param vo PK (crdnYr, crdnNo) VO
* . ( )
* @param vo PK (ownrId) VO
* @return
*/
//int delete(CrdnRegistAndViewVO vo);
/**
* PK(+) .
* @param vo PK (crdnYr, crdnNo) VO
* @return (0 , 1 )
*/
//int selectDuplicateCheck(CrdnRegistAndViewVO vo);
/**
* 퀀 .
* @param sequenceName 퀀 (seq_crdn_no_YYYY )
* @return 퀀 ( )
*/
//String checkSequenceExists(String sequenceName);
/**
* 퀀 .
* @param sequenceName 퀀 (seq_crdn_no_YYYY )
* @return
*/
//void createSequence(String sequenceName);
/**
* .
* @param vo (crdnYr, crdnNo, crdnPrcsSttsCd, crdnPrcsYmd) VO
* @return
*/
//int updateStatus(CrdnRegistAndViewVO vo);
int delete(OwnActRegistAndViewVO vo);
}

@ -125,7 +125,10 @@ public class OwnActRegistAndViewVO extends PagingVO {
/** 이메일 */
private String eml;
/** 검색 조건 - 성명 */
private String schFlnm;
/** 검색 타입 */
private String schType; // 검색 구분 (1=이름, 2=주민번호)
/** 검색 입력 텍스트*/
private String schTypeTxt; // 검색어
}

@ -50,35 +50,19 @@ public interface OwnActRegistAndViewService {
int insert(OwnActRegistAndViewVO vo);
/**
* .
* .
*
* @param vo VO
* @param vo VO
* @return
*/
//int update(CrdnRegistAndViewVO vo);
int update(OwnActRegistAndViewVO vo);
/**
* . ( )
* . ( )
*
* @param vo PK (crdnYr, crdnNo) VO
* @param vo PK (ownrId) VO
* @return
*/
//int delete(CrdnRegistAndViewVO vo);
/**
* PK(+) .
*
* @param vo PK (crdnYr, crdnNo) VO
* @return (0 , 1 )
*/
//int selectDuplicateCheck(CrdnRegistAndViewVO vo);
/**
* .
*
* @param vo (crdnYr, crdnNo, crdnPrcsSttsCd) VO
* @return
*/
//int updateStatus(CrdnRegistAndViewVO vo);
int delete(OwnActRegistAndViewVO vo);
}

@ -71,7 +71,7 @@ public class OwnActRegistAndViewServiceImpl extends EgovAbstractServiceImpl impl
*/
@Override
public int insert(OwnActRegistAndViewVO vo) {
log.debug("소유자행위자 등록 - 성명: {}, 주민번호: {}", vo.getFlnm(), vo.getRrno());
log.debug("소유자행위자 등록 - 소유자ID: {}", vo.getOwnrId());
// 필수값 검증
validateRequiredFields(vo);
@ -84,64 +84,44 @@ public class OwnActRegistAndViewServiceImpl extends EgovAbstractServiceImpl impl
}
/**
* .
* .
*
* @param vo VO
* @param vo VO
* @return
*/
/*@Override
public int update(CrdnRegistAndViewVO vo) {
log.debug("단속 수정 - 단속연도: {}, 단속번호: {}", vo.getCrdnYr(), vo.getCrdnNo());
@Override
public int update(OwnActRegistAndViewVO vo) {
log.debug("소유자행위자 수정 - 소유자ID: {}", vo.getOwnrId());
// PK(단속연도+단속번호) 필수값 검증
validatePrimaryKey(vo);
//validatePrimaryKey(vo);
// 필수값 검증
validateRequiredFields(vo);
// 조사원 바이트 길이 검증 (한글 3바이트 기준 최대 100바이트)
if (vo.getExmnr() != null && !vo.getExmnr().trim().isEmpty()) {
int byteLength = StringUtil.calculateUtf8ByteLength(vo.getExmnr());
if (byteLength > 100) {
log.warn("단속 수정 실패 - 조사원 바이트 길이 초과: {}바이트", byteLength);
throw new MessageException("조사원명은 최대 100바이트까지 입력 가능합니다. (현재: " + byteLength + "바이트)");
}
}
// 비고 바이트 길이 검증 (한글 3바이트 기준 최대 1000바이트)
if (vo.getRmrk() != null && !vo.getRmrk().trim().isEmpty()) {
int byteLength = StringUtil.calculateUtf8ByteLength(vo.getRmrk());
if (byteLength > 1000) {
log.warn("단속 수정 실패 - 비고 바이트 길이 초과: {}바이트", byteLength);
throw new MessageException("비고는 최대 1000바이트까지 입력 가능합니다. (현재: " + byteLength + "바이트)");
}
}
// 수정 수행
// 수정자 정보 설정 및 수정 수행
vo.setMdfr(SessionUtil.getUserId());
int result = mapper.update(vo);
log.debug("단속 수정 완료 - 수정 건수: {}", result);
return result;
}*/
}
/**
* . ( )
* . ( )
*
* @param vo PK (crdnYr, crdnNo) VO
* @param vo PK (ownrId) VO
* @return
*/
/*@Override
public int delete(CrdnRegistAndViewVO vo) {
// PK(단속연도+단속번호) 필수값 검증
validatePrimaryKey(vo);
@Override
public int delete(OwnActRegistAndViewVO vo) {
// 삭제자 정보 설정 및 삭제 수행
vo.setDltr(SessionUtil.getUserId());
return mapper.delete(vo);
}*/
}
/**
* PK(+) .
*
*
* @param vo PK (crdnYr, crdnNo) VO
* @return (0 , 1 )
*/
@ -185,52 +165,4 @@ public class OwnActRegistAndViewServiceImpl extends EgovAbstractServiceImpl impl
throw new MessageException("주소는 필수값입니다.");
}
}
/**
* 퀀 .
* @param year (YYYY )
*/
/*private void ensureSequenceExists(String year) {
String sequenceName = SEQ_CRDN + year;
log.debug("년도별 시퀀스 확인 - 시퀀스명: {}", sequenceName);
try {
// 시퀀스 존재 여부 확인 (SHOW CREATE SEQUENCE 실행)
String sequenceDefinition = mapper.checkSequenceExists(sequenceName);
log.debug("년도별 시퀀스 이미 존재 - 시퀀스명: {}, 정의: {}", sequenceName, sequenceDefinition);
} catch (Exception e) {
// 시퀀스가 존재하지 않으면 예외 발생 -> 시퀀스 생성
log.info("년도별 시퀀스 생성 - 시퀀스명: {} (원인: {})", sequenceName, e.getMessage());
mapper.createSequence(sequenceName);
log.debug("년도별 시퀀스 생성 완료 - 시퀀스명: {}", sequenceName);
}
}*/
/**
* .
*
* @param vo (crdnYr, crdnNo, crdnPrcsSttsCd) VO
* @return
*/
/*@Override
public int updateStatus(CrdnRegistAndViewVO vo) {
log.debug("단속 상태 업데이트 - 단속연도: {}, 단속번호: {}, 상태코드: {}", vo.getCrdnYr(), vo.getCrdnNo(), vo.getCrdnPrcsSttsCd());
// PK(단속연도+단속번호) 필수값 검증
validatePrimaryKey(vo);
// 처리 상태 코드 필수값 검증
if (vo.getCrdnPrcsSttsCd() == null || vo.getCrdnPrcsSttsCd().trim().isEmpty()) {
log.warn("단속 상태 업데이트 실패 - 처리상태코드 미입력");
throw new MessageException("처리 상태 코드는 필수값입니다.");
}
// 단속 처리 일자를 현재 일자로 설정 (yyyyMMdd 형식)
vo.setCrdnPrcsYmd(LocalDate.now().toString().replace("-", ""));
// 상태 업데이트 수행
int result = mapper.updateStatus(vo);
log.debug("단속 상태 업데이트 완료 - 업데이트 건수: {}", result);
return result;
}*/
}

@ -44,8 +44,11 @@
ON c.CD_GROUP_ID = 'OWNR_SE_CD'
AND c.CD_ID = own.OWNR_SE_CD
WHERE own.DEL_YN = 'N'
<if test='schFlnm != null and schFlnm != ""'>
AND own.FLNM LIKE CONCAT('%', #{schFlnm}, '%')
<if test='schType == "1" and schTypeTxt != null and schTypeTxt != ""'>
AND own.FLNM LIKE CONCAT('%', #{schTypeTxt}, '%')
</if>
<if test='schType == "2" and schTypeTxt != null and schTypeTxt != ""'>
AND own.RRNO LIKE CONCAT('%', #{schTypeTxt}, '%')
</if>
ORDER BY own.OWNR_ID DESC
<if test='pagingYn != null and pagingYn == "Y"'>
@ -59,8 +62,11 @@
SELECT COUNT(*)
FROM tb_ownr
WHERE DEL_YN = 'N'
<if test='schFlnm != null and schFlnm != ""'>
AND FLNM LIKE CONCAT('%', #{schFlnm}, '%')
<if test='schType == "1" and schTypeTxt != null and schTypeTxt != ""'>
AND FLNM LIKE CONCAT('%', #{schTypeTxt}, '%')
</if>
<if test='schType == "2" and schTypeTxt != null and schTypeTxt != ""'>
AND RRNO LIKE CONCAT('%', #{schTypeTxt}, '%')
</if>
</select>
@ -166,4 +172,46 @@
)
</insert>
<!-- 소유자행위자 수정 -->
<update id="update" parameterType="OwnActRegistAndViewVO">
/* OwnActRegistAndViewMapper.update : 소유자행위자 수정 */
UPDATE tb_ownr
SET FLNM = #{flnm},
RRNO = #{rrno},
OWNR_SE_CD = #{ownrSeCd},
ADDR = #{addr},
DADDR = #{daddr},
ZIP = #{zip},
LOTNO_WHOL_ADDR = #{lotnoWholAddr},
ROAD_NM_WHOL_ADDR = #{roadNmWholAddr},
LOTNO_ADDR = #{lotnoAddr},
ROAD_NM_ADDR = #{roadNmAddr},
REF_ADDR = #{refAddr},
PBADMS_ZONE_CD = #{pbadmsZoneCd},
ROAD_NM_CD = #{roadNmCd},
LOTNO_MNO = #{lotnoMno},
LOTNO_SNO = #{lotnoSno},
BLDG_MNO = #{bldgMno},
BLDG_SNO = #{bldgSno},
UDGD_YN_CD = #{udgdYnCd},
MTN_YN_CD = #{mtnYnCd},
TELNO = #{telno},
EML = #{eml},
MDFCN_DT = NOW(),
MDFR = #{mdfr}
WHERE OWNR_ID = #{ownrId}
AND DEL_YN = 'N'
</update>
<!-- 소유자행위자 삭제 -->
<update id="delete" parameterType="OwnActRegistAndViewVO">
/* OwnActRegistAndViewMapper.delete : 소유자행위자 삭제 */
UPDATE tb_ownr
SET DEL_YN = 'Y',
DEL_DT = NOW(),
DLTR = #{dltr}
WHERE OWNR_ID = #{ownrId}
AND DEL_YN = 'N'
</update>
</mapper>

@ -20,7 +20,11 @@
<ul class="lef">
<li class="th">조회 조건</li>
<li>
<input type="text" id="schFlnm" name="schFlnm" maxlength="6" class="input" style="width: 100px;" autocomplete="off"/>
<select id="schType" name="schType" class="input">
<option value="1">이름</option>
<option value="2">주민등록번호</option>
</select>
<input type="text" id="schTypeTxt" name="schTypeTxt" maxlength="6" class="input" style="width: 120px;" autocomplete="off"/>
</li>
</ul>
<ul class="rig2">
@ -75,9 +79,11 @@
// 검색정보 설정
var setSearchCond = function() {
var schFlnm = $.trim(nvl($("#schFlnm").val(), ""));
var schType = $.trim(nvl($("#schType").val(), ""));
var schTypeTxt = $.trim(nvl($("#schTypeTxt").val(), ""));
SEARCH_COND.schFlnm = schFlnm;
SEARCH_COND.schType = schType;
SEARCH_COND.schTypeTxt = schTypeTxt;
};
@ -178,7 +184,7 @@
sortable: true
},
{
header: '주민·사업번호',
header: '주민등록번호',
name: 'rrno',
align: 'center',
width: 90,
@ -363,32 +369,6 @@
}
},
/**
* 단속 상태를 업데이트합니다.
* 선택된 행이 있을 때만 상태를 업데이트합니다.
*
* @param statusCode 변경할 상태 코드
* @param statusName 상태명 (확인 메시지용)
*/
updateStatus: function(statusCode, statusName) {
var self = this;
// 선택된 행 확인
if (!this.selectedRow) {
alert('상태를 변경할 단속 건을 선택해주세요.');
return;
}
var crdnYr = this.selectedRow.crdnYr;
var crdnNo = this.selectedRow.crdnNo;
// 확인 메시지
if (!confirm(crdnYr + '-' + crdnNo + ' 단속 건의 상태를 [' + statusName + ']으로 변경하시겠습니까?')) {
return;
}
},
/**
* 이벤트 핸들러 설정
*/
@ -403,7 +383,7 @@
// 초기화 버튼 클릭 이벤트
$("#reset_btn").on('click', function() {
// 모든 검색 조건 초기화
$("#schFlnm").val("");
$("#schTypeTxt").val("");
// 그리드 데이터 새로고침
self.grid.instance.readData(1);
@ -418,7 +398,7 @@
$("#updaterBtn").on('click', function() {
// 선택된 행 확인
if (!self.selectedRow) {
alert('수정할 단속 건을 선택해주세요.');
alert('수정할 소유자행위자를 선택해주세요.');
return;
}
@ -426,31 +406,6 @@
self.openViewPopup(self.selectedRow.ownrId);
});
// 상태 업데이트 버튼 클릭 이벤트들
$("#btnDsps").on('click', function() {
self.updateStatus('20', '처분사전');
});
$("#btnCrcCmd").on('click', function() {
self.updateStatus('30', '시정명령');
});
$("#btnCrcUrg").on('click', function() {
self.updateStatus('40', '시정촉구');
});
$("#btnLevyPrvntc").on('click', function() {
self.updateStatus('50', '부과예고');
});
$("#btnLevy").on('click', function() {
self.updateStatus('60', '부과');
});
$("#btnPayUrg").on('click', function() {
self.updateStatus('70', '납부촉구');
});
// 엔터키 검색
$(".gs_b_top input").on('keypress', function(e) {
if (e.which === 13) {

@ -14,6 +14,7 @@
<div class="forms_table_non">
<form id="ownActForm" name="ownActForm">
<input type="hidden" id="mode" name="mode" value="${param.mode}" />
<input type="hidden" id="ownrId" name="ownrId" value="${data.ownrId}">
<table>
<colgroup>
<col style="width: 20%;" />
@ -237,13 +238,12 @@
delete: function() {
if (!confirm('정말 삭제하시겠습니까?')) return;
var crdnYr = $("#crdnYr").val();
var crdnNo = $("#crdnNo").val();
var ownrId = $("#ownrId").val();
$.ajax({
url: '/crdn/crndRegistAndView/delete.ajax',
url: '/ownact/ownActRegistAndView/delete.ajax',
type: 'POST',
data: { crdnYr: crdnYr, crdnNo: crdnNo },
data: { ownrId: ownrId },
success: function(response) {
if (response.success) {
alert(response.message || '삭제되었습니다.');
@ -283,6 +283,22 @@
$('#flnm').focus();
return false;
}
// 전화번호 검증
if (!$.trim($('#telno').val())) {
var telnoElement = document.getElementById('telno');
errorElementCreate(telnoElement, '전화번호를 입력하세요.', false);
$('#telno').focus();
return false;
}
// 메일 검증
if (!$.trim($('#eml').val())) {
var emlElement = document.getElementById('eml');
errorElementCreate(emlElement, '메일주소를 입력하세요.', false);
$('#eml').focus();
return false;
}
}
return isValid;

Loading…
Cancel
Save