민원 수정

main
이범준 1 year ago
parent 784705bc44
commit 653923781f

@ -326,4 +326,9 @@ public class Crdn extends AbstractEntity {
* *
*/ */
private String dtlAddr; private String dtlAddr;
/**
*
*/
private String levyExclRsnCd;
} }

@ -26,13 +26,13 @@ public interface CrdnService {
boolean remove(String... crdnIDs); boolean remove(String... crdnIDs);
/** . /** .
* @param crdn , newFileList * @param nonQueryRequest , crdn , newFileList
* @return * @return
*/ */
boolean create(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList); boolean create(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList);
/** . /** .
* @param crdn , nonQueryRequest , newFileInfoList * @param nonQueryRequest , crdn , newFileInfoList
* @return * @return
*/ */
boolean update(Map<String,Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList); boolean update(Map<String,Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList);

@ -20,7 +20,7 @@ public class Crdn06Bean extends AbstractComponent {
private Crdn06Mapper crdn06Mapper; private Crdn06Mapper crdn06Mapper;
/** . /** .
* @param crdn * @param nonQueryRequest , crdn
* @return * @return
* <ul><li> true</li> * <ul><li> true</li>
* <li> false</li> * <li> false</li>

@ -71,7 +71,7 @@ public interface CrdnCvlcptMapper extends AbstractMapper {
* @param crdn * @param crdn
* @return * @return
*/ */
int updateCvlcptPrcs(CrdnCvlcpt cvlcpt); int updateCvlcptPrcsSe(CrdnCvlcpt cvlcpt);
/** . /** .
* @param params * @param params
@ -79,4 +79,16 @@ public interface CrdnCvlcptMapper extends AbstractMapper {
*/ */
int updateCrdn(Map<String, Object> params); int updateCrdn(Map<String, Object> params);
/** .
* @param crdnId
* @return
*/
DataObject getCrdnInfo(String crdnId);
/** .
* @param crdnCvlcpt
* @return
*/
int initCvlcptPrcsRsltCn(CrdnCvlcpt crdnCvlcpt);
} }

@ -44,11 +44,11 @@ public interface CrdnCvlcptService {
*/ */
Map<String, String> makeFileFromHwpFormat(CrdnQuery query); Map<String, String> makeFileFromHwpFormat(CrdnQuery query);
/** . /** .
* @param crdnCvlcpt , crdn , newFileInfoList * @param nonQueryRequest , crdnCvlcpt , crdn , newFileInfoList
* @return * @return
*/ */
boolean updateCvlcptPrcs(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList); boolean updateCvlcptPrcsSe(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList);
} }

@ -30,6 +30,13 @@ public class CrdnCvlcptBean extends AbstractComponent {
@Resource(name = "crdn05Mapper") @Resource(name = "crdn05Mapper")
private Crdn05Mapper crdn05Mapper; private Crdn05Mapper crdn05Mapper;
/** .
* @param crdnIDs
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean remove(String... crdnIDs) { public boolean remove(String... crdnIDs) {
if (isEmpty(crdnIDs)) return false; if (isEmpty(crdnIDs)) return false;
@ -41,6 +48,10 @@ public class CrdnCvlcptBean extends AbstractComponent {
return crdn05Mapper.removeCrdn(paramMap) == 1 ? true : false; return crdn05Mapper.removeCrdn(paramMap) == 1 ? true : false;
} }
/** .
* @param query
* @return
*/
public DataObject getCivilComplaintOriginalInfo(CrdnQuery query) { public DataObject getCivilComplaintOriginalInfo(CrdnQuery query) {
if(ifEmpty(query.getViewType(), () -> "").equals("hwp")) { if(ifEmpty(query.getViewType(), () -> "").equals("hwp")) {
return crdnCvlcptMapper.selectCivilComplaintOriginalInfoHwp(query); return crdnCvlcptMapper.selectCivilComplaintOriginalInfoHwp(query);
@ -48,10 +59,24 @@ public class CrdnCvlcptBean extends AbstractComponent {
return crdnCvlcptMapper.selectCivilComplaintOriginalInfo(query); return crdnCvlcptMapper.selectCivilComplaintOriginalInfo(query);
} }
public boolean updateCvlcptPrcs(CrdnCvlcpt cvlcpt) { /** .
return crdnCvlcptMapper.updateCvlcptPrcs(cvlcpt) == 1 ? true : false; * @param crdnCvlcpt
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean updateCvlcptPrcsSe(CrdnCvlcpt cvlcpt) {
return crdnCvlcptMapper.updateCvlcptPrcsSe(cvlcpt) == 1 ? true : false;
} }
/** .
* @param nonQueryRequest , crdn
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean updateCrdn(Map<String, Object> nonQueryRequest, Crdn crdn) { public boolean updateCrdn(Map<String, Object> nonQueryRequest, Crdn crdn) {
DataObject params = new DataObject(); DataObject params = new DataObject();
params.set("currentUser", currentUser()); params.set("currentUser", currentUser());
@ -62,4 +87,26 @@ public class CrdnCvlcptBean extends AbstractComponent {
return crdnCvlcptMapper.updateCrdn(params) == 1 ? true : false; return crdnCvlcptMapper.updateCrdn(params) == 1 ? true : false;
} }
/** .
* @param crdnId
* @return
*/
public DataObject getCrdnInfo(String crdnId) {
return crdnCvlcptMapper.getCrdnInfo(crdnId);
}
/** .
* @param cvlcptLinkId
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean initCvlcptPrcsRsltCn(String cvlcptLinkId) {
CrdnCvlcpt crdnCvlcpt = new CrdnCvlcpt();
crdnCvlcpt.setCvlcptLinkId(cvlcptLinkId);
return crdnCvlcptMapper.initCvlcptPrcsRsltCn(crdnCvlcpt) == 1 ? true : false;
}
} }

@ -2,6 +2,8 @@ package cokr.xit.fims.cvlc.service.bean;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -27,7 +29,10 @@ import cokr.xit.fims.crdn.dao.Crdn06Mapper;
import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper;
import cokr.xit.fims.cvlc.service.CrdnCvlcptService; import cokr.xit.fims.cvlc.service.CrdnCvlcptService;
import cokr.xit.fims.excl.Excl01;
import cokr.xit.fims.excl.service.bean.Excl01Bean;
import cokr.xit.fims.sprt.Sprt; import cokr.xit.fims.sprt.Sprt;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import kr.dogfoot.hwplib.object.HWPFile; import kr.dogfoot.hwplib.object.HWPFile;
@ -44,6 +49,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
@Resource(name="crdnCvlcptBean") @Resource(name="crdnCvlcptBean")
protected CrdnCvlcptBean crdnCvlcptBean; protected CrdnCvlcptBean crdnCvlcptBean;
@Resource(name="excl01Bean")
private Excl01Bean excl01Bean;
@Resource(name = "crdnCvlcptMapper") @Resource(name = "crdnCvlcptMapper")
private CrdnCvlcptMapper crdnCvlcptMapper; private CrdnCvlcptMapper crdnCvlcptMapper;
@ -237,46 +245,110 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
} }
@Override @Override
public boolean updateCvlcptPrcs(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList) { public boolean updateCvlcptPrcsSe(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList) {
boolean saved = false; boolean saved = false;
int fileInsertEffected = 0; DataObject crdnInfo = crdnCvlcptBean.getCrdnInfo(crdn.getCrdnId());
int fileDeleteEffected = 0;
if(newFileInfoList != null && !newFileInfoList.isEmpty()) { crdnCvlcpt.setCvlcptLinkId(crdnInfo.string("CVLCPT_LINK_ID"));
fileInsertEffected = fileBean.create(newFileInfoList);
}
if((String[])nonQueryRequest.get("deleteFileKeyList") != null) { String acceptType = (String)nonQueryRequest.get("acceptType");
fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList"));
}
int changeFileCnt = (fileInsertEffected - fileDeleteEffected);
if (crdnInfo.string("CRDN_REG_SE_CD").equals("02")) {
crdnCvlcpt.setCvlcptLinkId(crdn.getLinkId()); if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) { //일부수용,불수용
String acceptType = (String)nonQueryRequest.get("acceptType"); // 단속민원(TB_CRDN_CVLCPT) 대장
Excl01 updtCrdnCvlcpt = new Excl01();
boolean retSuccess = false;
String newCvlcptPrcsCd = "";
String newCvlcptTrsmCd = "";
updtCrdnCvlcpt.setCvlcptLinkId(crdnInfo.string("CVLCPT_LINK_ID")); // 민원 연계 ID
// 답변내용 초기화
retSuccess = crdnCvlcptBean.initCvlcptPrcsRsltCn(crdnCvlcpt.getCvlcptLinkId());
if (!retSuccess) {
// 예외를 발생시켜서 오류메세지를 보내고 DB Rollback
throw new RuntimeException("부과제외 등록 중 단속민원 대장의 민원처리결과내용 초기화에 실패하였습니다.");
}
// 답변완료 후 서손처리에 대해서는 답변 상태를 업데이트 하지 않는다
// 전송대상, 전송 미대상 자료에 대해서 업데이트한다.
if (crdnInfo.string("CVLCPT_TRSM_CD").equals("01")
|| crdnInfo.string("CVLCPT_TRSM_CD").equals("02")
|| crdnInfo.string("CVLCPT_TRSM_CD").equals("03")) {
// 민원 답변 문구(TB_CVLCPT_ANS_WORDS) 대장 조회
DataObject infoCvlcptAnsWords = excl01Bean.selectCvlcptAnsWordsInfo(crdn.getLevyExclRsnCd());
// 비부과(서손)사유가 민원 답변대상인가? 민원 답변 문구(TB_CVLCPT_ANS_WORDS) 대장에 답변 사유 코드가 존재한다면..
if (!infoCvlcptAnsWords.string("ANS_WORDS_ID").equals("")) {
newCvlcptPrcsCd = "04"; // 민원 처리 코드 - 불수용(과태료 부과제외)
newCvlcptTrsmCd = "01"; // 민원 전송 코드 - 전송 대상
} else {
newCvlcptPrcsCd = "07"; // 민원 처리 코드 - 비부과(서손)사유가 답변 미대상
newCvlcptTrsmCd = "03"; // 민원 전송 코드 - 비부과(서손)사유가 전송 미대상
}
// 현재 날짜 구하기
LocalDate now = LocalDate.now();
// 포맷 정의
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); // yyyy년 MM월 dd일 HH시 mm분 ss초
// 포맷 적용
String formatedNow = now.format(formatter);
// 단속민원(TB_CRDN_CVLCPT) 대장을 수정 한다.
updtCrdnCvlcpt.setCvlcptPrcsCd(newCvlcptPrcsCd); // 민원 처리 코드
updtCrdnCvlcpt.setCvlcptPrcsSumry(infoCvlcptAnsWords.string("PRCS_SUMRY")); // 민원 처리 요약
updtCrdnCvlcpt.setCvlcptPrcsRsltCn(infoCvlcptAnsWords.string("PRCS_RSLT_CN")); // 민원 처리 결과 내용
updtCrdnCvlcpt.setCvlcptPrcsCmptnDt(formatedNow); // 민원 처리 완료 일시
updtCrdnCvlcpt.setCvlcptPrcsPic(UserInfo.current().getId()); // 민원 처리 담당자
updtCrdnCvlcpt.setCvlcptTrsmCd(newCvlcptTrsmCd); // 민원 전송 코드
// 단속민원 민원처리코드 수정
retSuccess = excl01Bean.updateCrdnCvlcpt(updtCrdnCvlcpt);
if (!retSuccess) {
// 예외를 발생시켜서 오류메세지를 보내고 DB Rollback
throw new RuntimeException("부과제외 등록 중 단속민원답변 수정에 실패하였습니다.");
}
}
if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) {
///call 부과제외 } else { //수용일 때
//TODO : 전송코드,처리코드 결정
crdnCvlcpt.setCvlcptPrcsCd("");
crdnCvlcpt.setCvlcptTrsmCd("02");
//TODO : 전송문구 조회
crdnCvlcpt.setCvlcptPrcsSumry("요약요약요약");
crdnCvlcpt.setCvlcptPrcsRsltCn("결과결과결과");
//민원정보변경
saved = crdnCvlcptBean.updateCvlcptPrcsSe(crdnCvlcpt);
}
} }
//TODO : 전송코드,처리코드 결정
crdnCvlcpt.setCvlcptPrcsCd("");
crdnCvlcpt.setCvlcptTrsmCd("02");
//TODO : 전송문구 조회 int fileInsertEffected = 0;
crdnCvlcpt.setCvlcptPrcsSumry("요약요약요약"); int fileDeleteEffected = 0;
crdnCvlcpt.setCvlcptPrcsRsltCn("결과결과결과");
//민원정보변경 if(newFileInfoList != null && !newFileInfoList.isEmpty()) {
saved = crdnCvlcptBean.updateCvlcptPrcs(crdnCvlcpt); fileInsertEffected = fileBean.create(newFileInfoList);
}
if((String[])nonQueryRequest.get("deleteFileKeyList") != null) {
fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList"));
}
nonQueryRequest.put("changeFileCnt", changeFileCnt); int changeFileCnt = (fileInsertEffected - fileDeleteEffected);
//단속정보변경 //단속정보변경
nonQueryRequest.put("changeFileCnt", changeFileCnt);
saved = crdnCvlcptBean.updateCrdn(nonQueryRequest, crdn); saved = crdnCvlcptBean.updateCrdn(nonQueryRequest, crdn);
return saved; return saved;
} }

@ -231,7 +231,7 @@ public class Cvlc01Controller extends ApplicationController {
.addObject("saved", saved); .addObject("saved", saved);
} }
/** . /** .
* @param crdnId * @param crdnId
* @return jsonView * @return jsonView
* <pre><code> { * <pre><code> {
@ -240,7 +240,7 @@ public class Cvlc01Controller extends ApplicationController {
* }</code></pre> * }</code></pre>
*/ */
@RequestMapping(name="민원 정보 수정", value="/020/save.do") @RequestMapping(name="민원 정보 수정", value="/020/save.do")
public ModelAndView saveCivilComplaintProcess(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { public ModelAndView saveCivilComplaintProcessSe(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
boolean saved = false; boolean saved = false;
@ -276,7 +276,7 @@ public class Cvlc01Controller extends ApplicationController {
String acceptType = hReq.getParameter("acceptType"); String acceptType = hReq.getParameter("acceptType");
nonQueryRequest.put("acceptType", acceptType); nonQueryRequest.put("acceptType", acceptType);
saved = crdnCvlcptService.updateCvlcptPrcs(nonQueryRequest, crdnCvlcpt, crdn, newFileInfoList); saved = crdnCvlcptService.updateCvlcptPrcsSe(nonQueryRequest, crdnCvlcpt, crdn, newFileInfoList);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")

@ -369,8 +369,8 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
AND C.CRDN_ID = #{crdnId} AND C.CRDN_ID = #{crdnId}
</select> </select>
<update id="updateCvlcptPrcs" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt"> <update id="updateCvlcptPrcsSe" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt">
/* 단속민원 처리 수정(crdnCvlcptMapper.updateCvlcptPrcs) */ /* 단속민원 처리 구분 수정(crdnCvlcptMapper.updateCvlcptPrcsSe) */
UPDATE TB_CRDN_CVLCPT UPDATE TB_CRDN_CVLCPT
SET CVLCPT_PRCS_CMPTN_DT = <include refid="utility.now" /> SET CVLCPT_PRCS_CMPTN_DT = <include refid="utility.now" />
, CVLCPT_PRCS_CD = #{cvlcptPrcsCd} /* 민원처리코드 */ , CVLCPT_PRCS_CD = #{cvlcptPrcsCd} /* 민원처리코드 */
@ -413,4 +413,29 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
WHERE CRDN_ID = #{crdn.crdnId} /* 단속 ID */ WHERE CRDN_ID = #{crdn.crdnId} /* 단속 ID */
</update> </update>
<select id="getCrdnInfo" parameterType="string">
/* 단속정보 조회(crdnCvlcptMapper.getCrdnInfo) */
SELECT C.CRDN_ID <!-- 단속 ID -->
, C.CRDN_REG_SE_CD <!-- 단속 등록 구분 코드 -->
, CC.CVLCPT_LINK_ID <!-- 민원 연계 ID -->
, CC.CVLCPT_TRSM_CD <!-- 민원 전송 코드 -->
FROM TB_CRDN C
INNER JOIN TB_CRDN_ADI CA ON (C.CRDN_ID = CA.CRDN_ID)
INNER JOIN TB_CRDN_CVLCPT CC ON (C.CVLCPT_LINK_YN = 'Y' AND C.LINK_ID = CC.CVLCPT_LINK_ID)
LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID)
WHERE C.DEL_YN = 'N'
AND C.CRDN_ID = #{crdnId}
</select>
<update id="initCvlcptPrcsRsltCn" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt">
/* 단속민원 대장 민원처리결과내용 초기화(crdnCvlcptMapper.initCvlcptPrcsRsltCn) */
UPDATE TB_CRDN_CVLCPT
SET CVLCPT_PRCS_SUMRY = NULL /* 민원 처리 요약 */
, CVLCPT_PRCS_RSLT_CN = NULL /* 민원 처리 결과 내용 */
, MDFCN_DT = #{lastModified} /* 수정 일시 */
, MDFR = #{modifiedBy} /* 수정자 */
WHERE CVLCPT_LINK_ID = #{cvlcptLinkId} /* 민원 연계 ID */
AND DEL_YN = 'N'
</update>
</mapper> </mapper>
Loading…
Cancel
Save