UIJIN_KIM 4 months ago
commit 43de9a1557

@ -12,6 +12,11 @@ This project is the "Ilsan Dong-gu Illegal Building Integrated Management System
### 각 컨트롤러 클래스에 스웨거 적용
### 기존소스의 공백제거 등 로직에 필요없는 부분은 수정 불가!!
### mvc 패턴, springboot + mybatis + jsp 구조, tiles 사용
### view 단과, controller, 등 mode 값을 통일 시켜줘
- mode : C = 등록
- mode : U = 수정
- mode : V = 보기
- mode : D = 삭제
### session 보안
### 기본적인 코딩 스타일은 noticeSample 참조 (xml, java, jsp)
### url 은 기본적으로 <c:url/> 사용

@ -69,19 +69,27 @@ public class BldgNewPrcCrtrAmtController {
}
/**
* / .
* PK(, ) , .
* // .
* mode (C), (U), (V) .
* @param vo PK VO
* @param mode (C: , U: , V: )
* @param model
* @return
*/
@GetMapping("/bldgNewPrcCrtrAmtPopup.do")
@Operation(summary = "등록/수정 팝업", description = "window.open으로 호출되는 팝업")
public String popup(@ModelAttribute BldgNewPrcCrtrAmtVO vo, Model model){
log.debug("건물신축가격기준액 팝업 조회 - 연도: {}, 번호: {}", vo.getYr(), vo.getNo());
if (vo.getYr() != null && vo.getNo() != null){
model.addAttribute("data", service.selectOne(vo));
@Operation(summary = "등록/수정/조회 팝업", description = "window.open으로 호출되는 팝업, mode 파라미터로 C/U/V 구분")
public String popup(
@ModelAttribute BldgNewPrcCrtrAmtVO vo,
@RequestParam(required = false) String mode,
Model model){
log.debug("건물신축가격기준액 팝업 조회 - 모드: {}, 연도: {}, 번호: {}", mode, vo.getYr(), vo.getNo());
// 수정/조회 모드인 경우 기존 데이터 조회
if (("U".equals(mode) || "V".equals(mode)) && vo.getYr() != null && vo.getNo() != null){
BldgNewPrcCrtrAmtVO data = service.selectOne(vo);
model.addAttribute("data", data);
}
return "baseData/bldgNewPrcCrtrAmt/bldgNewPrcCrtrAmtPopup"+ TilesConstants.POPUP;
}

@ -102,7 +102,7 @@ public class CrdnActInfoController {
CrdnActInfoVO data = null;
// 수정 모드인 경우 기존 데이터 조회
if ("update".equals(mode) && actInfoId != null) {
if ("U".equals(mode) && actInfoId != null) {
data = service.selectActInfoByPk(actInfoId);
}

@ -208,7 +208,10 @@ public class CrdnRegistAndViewController {
@PostMapping("/insert.ajax")
public ResponseEntity<?> insert(@ModelAttribute CrdnRegistAndViewVO paramVO) {
log.debug("단속 정보 등록 요청 - 단속연도: {}, 단속번호: {}", paramVO.getCrdnYr(), paramVO.getCrdnNo());
paramVO.setSggCd(SessionUtil.getSessionVO().getUser().getOrgCd());
paramVO.setRgtr(SessionUtil.getUserId());
//paramVO.setMdfr(SessionUtil.getUserId());
int result = service.insert(paramVO);
if (result > 0) {

@ -1,11 +1,13 @@
package go.kr.project.crdn.crndRegistAndView.main.service.impl;
import egovframework.constant.CrdnPrcsSttsConstants;
import egovframework.exception.MessageException;
import egovframework.util.SessionUtil;
import egovframework.util.StringUtil;
import go.kr.project.crdn.crndRegistAndView.main.mapper.CrdnRegistAndViewMapper;
import go.kr.project.crdn.crndRegistAndView.main.model.CrdnRegistAndViewVO;
import go.kr.project.crdn.crndRegistAndView.main.service.CrdnRegistAndViewService;
import jdk.vm.ci.meta.Constant;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
@ -107,9 +109,9 @@ public class CrdnRegistAndViewServiceImpl extends EgovAbstractServiceImpl implem
// 년도별 시퀀스 존재 여부 확인 및 생성
ensureSequenceExists(vo.getCrdnYr() == null ? LocalDate.now().getYear() + "" : vo.getCrdnYr());
vo.setCrdnPrcsSttsCd(CrdnPrcsSttsConstants.CRDN_PRCS_STTS_CD_10_CRDN);
// 등록자 정보 설정 및 등록 수행
vo.setRgtr(SessionUtil.getUserId());
int result = mapper.insert(vo);
log.debug("단속 등록 완료 - 등록 건수: {}", result);
return result;

@ -99,19 +99,19 @@
<div class="popup_foot">
<c:choose>
<c:when test="${param.mode eq 'V'}">
<!-- 삭제/보기 모드: 삭제 버튼만 노출 -->
<a href="#" id="btnDelete" class="newbtns bg2">삭제</a>
<!-- 보기 모드: 삭제 버튼만 노출 -->
<a href="#" id="btnDelete" class="newbtns bg6">삭제</a>
</c:when>
<c:when test="${not empty data.yr and not empty data.no}">
<c:when test="${param.mode eq 'U'}">
<!-- 수정 모드 -->
<a href="#" id="btnSave" class="newbtns bg4">수정</a>
</c:when>
<c:otherwise>
<!-- 등록 모드 -->
<a href="#" id="btnSave" class="newbtns bg4">저장</a>
<!-- 등록 모드 (mode=C 또는 mode 없음) -->
<a href="#" id="btnSave" class="newbtns bg1">저장</a>
</c:otherwise>
</c:choose>
<a href="#" class="newbtns bg1 modalclose">닫기</a>
<a href="#" class="newbtns bg2 modalclose">닫기</a>
</div>
</div>
</div>

@ -268,7 +268,7 @@
* 등록 팝업 열기
*/
openRegisterPopup: function() {
window.open('<c:url value="/baseData/bldgNewPrcCrtrAmt/bldgNewPrcCrtrAmtPopup.do"/>', 'bldgNewPrcCrtrAmtReg', 'width=700,height=500,scrollbars=yes');
window.open('<c:url value="/baseData/bldgNewPrcCrtrAmt/bldgNewPrcCrtrAmtPopup.do"/>?mode=C', 'bldgNewPrcCrtrAmtReg', 'width=700,height=500,scrollbars=yes');
},
/**

@ -10,7 +10,7 @@
<div class="popup_tit">
<h2 class="tit" id="popupTitle">
<c:choose>
<c:when test="${mode eq 'update'}">불법행위정보 수정</c:when>
<c:when test="${mode eq 'U'}">불법행위정보 수정</c:when>
<c:otherwise>불법행위정보 등록</c:otherwise>
</c:choose>
</h2>
@ -346,11 +346,11 @@
var mode = $('#mode').val();
var formData = $('#actInfoForm').serialize();
var url = (mode === 'update') ?
var url = (mode === 'U') ?
'<c:url value="/crdn/crndRegistAndView/crdnActInfo/update.ajax"/>' :
'<c:url value="/crdn/crndRegistAndView/crdnActInfo/insert.ajax"/>';
var actionText = (mode === 'update') ? '수정' : '등록';
var actionText = (mode === 'U') ? '수정' : '등록';
$.ajax({
url: url,

@ -111,14 +111,14 @@
<div class="popup_foot">
<c:choose>
<c:when test="${param.mode eq 'V'}">
<a href="#" id="btnDelete" class="newbtns bg2">삭제</a>
<a href="#" id="btnDelete" class="newbtns bg6">삭제</a>
<a href="#" id="btnSave" class="newbtns bg4">수정</a>
</c:when>
<c:otherwise>
<a href="#" id="btnSave" class="newbtns bg4">저장</a>
<a href="#" id="btnSave" class="newbtns bg1">저장</a>
</c:otherwise>
</c:choose>
<a href="#" class="newbtns bg1 modalclose">닫기</a>
<a href="#" class="newbtns bg2 modalclose">닫기</a>
</div>
</div>
</div>

@ -286,13 +286,13 @@
return;
}
// 중요로직: 수정모드 팝업 URL 구성 (mode=update, actInfoId 추가)
// 중요로직: 수정모드 팝업 URL 구성 (mode=U, actInfoId 추가)
var url = '<c:url value="/crdn/crndRegistAndView/crdnActInfo/crdnActInfoRegistPopup.do"/>'
+ '?crdnYr=' + encodeURIComponent(crdnYr)
+ '&pstnInfoId=' + encodeURIComponent(pstnInfoId)
+ '&crdnNo=' + encodeURIComponent(crdnNo)
+ '&actInfoId=' + encodeURIComponent(actInfoId)
+ '&mode=update';
+ '&mode=U';
var w = 1200, h = 480;
var left = Math.max(0, (screen.width - w) / 2);

@ -257,6 +257,7 @@
* 실제 tb_pstn_info 데이터를 삭제하고 그리드를 리로드한다.
*/
removePstnInfo: function() {
if (!this.grid.instance) {
alert('위치정보 그리드가 초기화되지 않았습니다.');
return;
@ -282,6 +283,16 @@
alert('삭제할 수 있는 위치정보가 없습니다.');
return;
}
//console.log( CrdnDetailView.grids.ownrInfo.grid.instance.getData() && CrdnDetailView.grids.ownrInfo.grid.instance.getData().length > 0 );
//console.log( CrdnDetailView.grids.actInfo.grid.instance.getData() && CrdnDetailView.grids.actInfo.grid.instance.getData().length > 0 );
//console.log( CrdnDetailView.grids.actrInfo.grid.instance.getData() && CrdnDetailView.grids.actrInfo.grid.instance.getData().length > 0 );
if( (CrdnDetailView.grids.ownrInfo.grid.instance.getData() && CrdnDetailView.grids.ownrInfo.grid.instance.getData().length > 0)
&& (CrdnDetailView.grids.actrInfo.grid.instance.getData() && CrdnDetailView.grids.actrInfo.grid.instance.getData().length > 0)
){
alert('소유자정보, 행위정보, 행위자정보 를 삭제 후 위치정보를 삭제 할 수 있습니다.');
}
// 중요로직: 서버에 삭제 요청
$.ajax({

@ -106,7 +106,7 @@
<li class="tit">1. 위치 정보</li>
<li class="rig">
<button type="button" id="pstnInfoRegistBtn" class="newbtn bg2-1">위치정보 추가</button>
<button type="button" id="pstnInfoDeleteBtn" class="newbtn bg2">삭제</button>
<button type="button" id="pstnInfoDeleteBtn" class="newbtn bg6">삭제</button>
</li>
</ul>
<div class="containers">
@ -120,7 +120,7 @@
<li class="tit">2. 소유자 정보</li>
<li class="rig">
<button type="button" id="ownrSelectBtn" class="newbtn bg2-1">소유자 선택</button>
<button type="button" id="ownrRemoveBtn" class="newbtn bg2" style="margin-left: 5px;">제거</button>
<button type="button" id="ownrRemoveBtn" class="newbtn bg6" style="margin-left: 5px;">삭제</button>
</li>
</ul>
<div class="containers">
@ -137,7 +137,7 @@
<li class="tit">3. 불법행위 정보</li>
<li class="rig">
<button type="button" id="actInfoRegistBtn" class="newbtn bg2-1">불법행위 추가</button>
<button type="button" id="actInfoDeleteBtn" class="newbtn bg2" style="margin-left: 5px;">삭제</button>
<button type="button" id="actInfoDeleteBtn" class="newbtn bg6" style="margin-left: 5px;">삭제</button>
</li>
</ul>
<div class="containers">
@ -443,21 +443,31 @@
* 위치정보 그리드 데이터 유무에 따라 소유자 선택/제거 버튼을 활성화/비활성화
*/
updateOwnrButtonsState: function(hasLocationData) {
var $ownrSelectBtn = $('#ownrSelectBtn');
var $ownrRemoveBtn = $('#ownrRemoveBtn');
if (hasLocationData) {
// 위치정보가 있을 때 버튼 활성화
$ownrSelectBtn.prop('disabled', false);
$ownrRemoveBtn.prop('disabled', false);
$ownrSelectBtn.removeClass('disabled');
$ownrRemoveBtn.removeClass('disabled');
$('#ownrSelectBtn').prop('disabled', false);
$('#ownrRemoveBtn').prop('disabled', false);
$('#ownrSelectBtn').removeClass('disabled');
$('#ownrRemoveBtn').removeClass('disabled');
$('#actInfoRegistBtn').prop('disabled', false);
$('#actInfoDeleteBtn').prop('disabled', false);
$('#actInfoRegistBtn').removeClass('disabled');
$('#actInfoDeleteBtn').removeClass('disabled');
} else {
// 위치정보가 없을 때 버튼 비활성화
$ownrSelectBtn.prop('disabled', true);
$ownrRemoveBtn.prop('disabled', true);
$ownrSelectBtn.addClass('disabled');
$ownrRemoveBtn.addClass('disabled');
$('#ownrSelectBtn').prop('disabled', true);
$('#ownrRemoveBtn').prop('disabled', true);
$('#ownrSelectBtn').addClass('disabled');
$('#ownrRemoveBtn').addClass('disabled');
$('#actInfoRegistBtn').prop('disabled', true);
$('#actInfoDeleteBtn').prop('disabled', true);
$('#actInfoRegistBtn').addClass('disabled');
$('#actInfoDeleteBtn').addClass('disabled');
}
},

@ -179,9 +179,9 @@
header: '구분',
name: 'ownrSeCdNm',
align: 'center',
width: 80,
width: 60,
sortingType: 'desc',
sortable: true
sortable: false
},
{
header: '주민등록번호',
@ -200,13 +200,13 @@
header: '주소',
name: 'addr',
align: 'center',
width: 120
width: 180
},
{
header: '상세주소',
name: 'daddr',
align: 'center',
width: 100
width: 180
},
{
header: '우편번호',
@ -236,7 +236,7 @@
header: '수정일시',
name: 'mdfcnDt',
align: 'center',
width: 100
width: 150
}
];
},

@ -159,14 +159,14 @@
<div class="popup_foot">
<c:choose>
<c:when test="${param.mode eq 'V'}">
<a href="#" id="btnDelete" class="newbtns bg2">삭제</a>
<a href="#" id="btnDelete" class="newbtns bg6">삭제</a>
<a href="#" id="btnSave" class="newbtns bg4">수정</a>
</c:when>
<c:otherwise>
<a href="#" id="btnSave" class="newbtns bg4">저장</a>
<a href="#" id="btnSave" class="newbtns bg1">저장</a>
</c:otherwise>
</c:choose>
<a href="#" class="newbtns bg1 modalclose">닫기</a>
<a href="#" class="newbtns bg2 modalclose">닫기</a>
</div>
</div>
</div>

@ -266,9 +266,9 @@ ol {
.newbtn.bg4,
.newbtns.bg4,
.newbtnss.bg4 {
background-color: #007bff;
background-color: #034186;
color: #fff;
border-color: #007bff;
border-color: #034186;
}
.newbtn.bg4:disabled,
@ -293,6 +293,21 @@ ol {
cursor: not-allowed;
}
.newbtn.bg6,
.newbtns.bg6,
.newbtnss.bg6 {
background-color: #fff !important;
color: #8f1e29 !important;
border: 1px solid #8f1e29 !important;
}
.newbtn.bg6:disabled,
.newbtns.bg6:disabled,
.newbtnss.bg6:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.smallb {
padding: 5px 10px;
font-size: 13px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Loading…
Cancel
Save