소스정리

main
이범준 1 year ago
parent f461a5b3ff
commit 030004fa1c

@ -54,7 +54,7 @@ public interface CrdnCvlcptService {
* @param nonQueryRequest , crdnCvlcpt , crdn , newFileInfoList * @param nonQueryRequest , crdnCvlcpt , crdn , newFileInfoList
* @return * @return
*/ */
boolean updateCvlcptPrcsSe(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList); boolean updateCvlcptProcessSection(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList);
/** . /** .
* @param crdnId ID * @param crdnId ID

@ -16,12 +16,9 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils; import org.springframework.util.ResourceUtils;
import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.FileInfo.Relation;
import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.CrdnPayerHstry;
import cokr.xit.fims.cmmn.CrdnSttsHstry; import cokr.xit.fims.cmmn.CrdnSttsHstry;
import cokr.xit.fims.cmmn.dao.CrdnPayerHstryMapper; import cokr.xit.fims.cmmn.dao.CrdnPayerHstryMapper;
import cokr.xit.fims.cmmn.dao.CrdnSttsHstryMapper; import cokr.xit.fims.cmmn.dao.CrdnSttsHstryMapper;
@ -39,7 +36,6 @@ import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.cvlc.dao.AnswerWordsMapper; import cokr.xit.fims.cvlc.dao.AnswerWordsMapper;
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.LevyExcl;
import cokr.xit.fims.excl.dao.LevyExclMapper; import cokr.xit.fims.excl.dao.LevyExclMapper;
import cokr.xit.fims.excl.service.bean.Excl01Bean; import cokr.xit.fims.excl.service.bean.Excl01Bean;
import cokr.xit.fims.sprt.Sprt; import cokr.xit.fims.sprt.Sprt;
@ -308,40 +304,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdnId); DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdnId);
//부과제외 대장을 등록 한다. saved = crdnCvlcptSubBean.executelevyExcl("sendBack", crdnId);
LevyExcl excl01 = new LevyExcl();
excl01.setSggCd(crdnInfo.string("SGG_CD"));
excl01.setTaskSeCd(crdnInfo.string("TASK_SE_CD"));
excl01.setCrdnId(crdnInfo.string("CRDN_ID"));
excl01.setLevyExclYmd((new SimpleDateFormat("yyyyMMdd")).format(new Date()));
excl01.setLevyExclSeCd("1");
excl01.setLevyExclRsnCd("191");
excl01.setEtcCn("이송(이첩)");
saved = levyExclMapper.insert(excl01);
if(!saved) { if(!saved) {
throw new RuntimeException("반송처리 중 부과제외 대장 등록에 실패하였습니다."); throw new RuntimeException("반송 처리 중 서손처리에 실패하였습니다.");
}
//단속상태를 변경한다.
Crdn crdn = new Crdn();
crdn.setCrdnId(crdnId);
crdn.setCrdnSttsCd("81");
saved = crdnUpdtMapper.updateCrdnStatus(crdn) == 1 ? true : false;
if (!saved) {
throw new RuntimeException("반송처리 중 단속상태변경에 실패하였습니다.");
}
//단속상태 변경 이력 기록
CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry();
crdnSttsHstry.setCrdnId(crdnId);
crdnSttsHstry.setBfrSttsCd(crdnInfo.string("CRDN_STTS_CD"));
crdnSttsHstry.setBfrSttsChgDt(crdnInfo.string("CRDN_STTS_CHG_DT"));
crdnSttsHstry.setCrdnSttsCd("81");
crdnSttsHstry.setTaskDtlId(excl01.getLevyExclId());
crdnSttsHstry.setEtcCn("이송(이첩)");
saved = crdnSttsHstryMapper.insert(crdnSttsHstry);
if (!saved) {
throw new RuntimeException("반송 처리 중 단속상태이력 등록에 실패하였습니다.");
} }
boolean isFirstBorn = crdnInfo.string("CRDN_REG_SE_CD").equals("02"); boolean isFirstBorn = crdnInfo.string("CRDN_REG_SE_CD").equals("02");
@ -370,136 +335,17 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
} }
@Override @Override
public boolean updateCvlcptPrcsSe(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList) { public boolean updateCvlcptProcessSection(Map<String, Object> nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List<FileInfo> newFileInfoList) {
boolean saved = false; boolean saved = false;
DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdn.getCrdnId()); DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdn.getCrdnId());
crdnCvlcpt.setCvlcptLinkId(crdnInfo.string("CVLCPT_LINK_ID"));
String acceptType = (String)ifEmpty(nonQueryRequest.get("acceptType"), ""); String acceptType = (String)ifEmpty(nonQueryRequest.get("acceptType"), "");
saved = crdnCvlcptSubBean.updateSubInfo(nonQueryRequest, crdn, newFileInfoList);
//첨수파일 수 변경
int fileInsertCnt = 0;
int fileDeleteCnt = 0;
if(newFileInfoList != null && !newFileInfoList.isEmpty()) {
fileInsertCnt = newFileInfoList.size();
}
String[] deleteFileKeyList = (String[])ifEmpty(nonQueryRequest.get("deleteFileKeyList"), new String[] {});
if(deleteFileKeyList.length > 0) {
fileDeleteCnt = deleteFileKeyList.length;
}
int changeFileCnt = (fileInsertCnt - fileDeleteCnt);
nonQueryRequest.put("changeFileCnt", changeFileCnt);
//금액 변경
if(crdnInfo.string("TASK_SE_CD").equals("PVS") && "Y".equals(crdnInfo.string("OVTIME_PRTTN_YN"))) {
nonQueryRequest.put("changeAmountYn","N");
} else {
int[] basicAmt = crdnStngBean.getBasicAmt(crdn);
int ffnlgCrdnAmt = crdnInfo.number("FFNLG_CRDN_AMT").intValue();
if(ffnlgCrdnAmt != basicAmt[0]){
nonQueryRequest.put("changeAmountYn","Y");
crdn.setFfnlgCrdnAmt(basicAmt[0]);
crdn.setFfnlgAmt(basicAmt[0]);
crdn.setAdvntceAmt(basicAmt[1]);
crdn.setFfnlgRductRt("0");
} else {
nonQueryRequest.put("changeAmountYn","N");
}
}
//납부자 변경
if(!crdnInfo.string("RTPYR_ID").equals(crdn.getRtpyrId())) {
nonQueryRequest.put("changePayerYn","Y");
} else {
nonQueryRequest.put("changePayerYn","N");
}
//단속상태값 변경
nonQueryRequest.put("changeStatusYn","Y");
if(acceptType.equals("accept")) {
if(!crdnInfo.string("CRDN_REG_SE_CD").equals("02")
|| Arrays.asList(new String[]{"04","05","06"}).contains(crdnInfo.string("CVLCPT_TRSM_CD"))) {
crdn.setCrdnSttsCd("22");
} else {
crdn.setCrdnSttsCd("21");
}
} else if(acceptType.equals("someAccept")){
crdn.setCrdnSttsCd("83");
} else if(acceptType.equals("nonAccept")) {
crdn.setCrdnSttsCd("81");
} else {
throw new RuntimeException("단속민원답변 수정에 실패하였습니다.");
}
//부과 제외 대장 등록
String dtlTaskId = "";
if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) { //일부수용,불수용
boolean retSuccess = false;
LevyExcl excl01 = new LevyExcl();
excl01.setCrdnId(crdn.getCrdnId());
excl01.setSggCd(crdn.getSggCd());
excl01.setTaskSeCd(crdn.getTaskSeCd());
excl01.setLevyExclYmd(crdn.getLevyExclYmd());
excl01.setLevyExclSeCd(crdn.getLevyExclSeCd());
excl01.setLevyExclRsnCd(crdn.getLevyExclRsnCd());
excl01.setEtcCn(crdn.getEtcCn());
retSuccess = levyExclMapper.insert(excl01);
if (!retSuccess) {
// 예외를 발생시켜서 오류메세지를 보내고 DB Rollback
throw new RuntimeException("부과제외 대장 등록에 실패하였습니다.");
}
dtlTaskId = excl01.getLevyExclId();
} else {
dtlTaskId = crdn.getCrdnId();
}
//단속정보변경
saved = crdnCvlcptSubBean.updateCrdn(nonQueryRequest, crdn);
if(!saved) { if(!saved) {
throw new RuntimeException("단속민원답변 수정 중 단속정보변경에 실패하였습니다."); throw new RuntimeException("민원자료 저장 중 오류가 발생하였습니다.");
}
//단속 납부자 변경 이력 등록
if(((String)nonQueryRequest.get("changePayerYn")).equals("Y")) {
CrdnPayerHstry crdnPayerHstry = new CrdnPayerHstry();
crdnPayerHstry.setCrdnId(crdn.getCrdnId());
crdnPayerHstry.setRtpyrId(crdn.getRtpyrId());
boolean retSuccess = crdnPayerHstryMapper.insert(crdnPayerHstry);
if(!retSuccess) {
throw new RuntimeException("단속민원답변 수정 중 단속납부자변경 이력 등록에 실패하였습니다.");
}
}
//단속상태 변경 이력 등록
if(((String)nonQueryRequest.get("changeStatusYn")).equals("Y")) {
CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry();
crdnSttsHstry.setCrdnId(crdn.getCrdnId());
crdnSttsHstry.setBfrSttsCd(crdnInfo.string("CRDN_STTS_CD"));
crdnSttsHstry.setBfrSttsChgDt(crdnInfo.string("CRDN_STTS_CHG_DT"));
crdnSttsHstry.setCrdnSttsCd(crdn.getCrdnSttsCd());
crdnSttsHstry.setTaskDtlId(dtlTaskId);
if(crdn.getCrdnSttsCd().equals("81") || crdn.getCrdnSttsCd().equals("83")) {
crdnSttsHstry.setEtcCn("부과제외 대장 등록");
} else {
crdnSttsHstry.setEtcCn("민원 요청 수용");
}
boolean retSuccess = crdnSttsHstryMapper.insert(crdnSttsHstry);
if(!retSuccess) {
throw new RuntimeException("단속민원답변 수정 중 단속상태변경 이력 등록에 실패하였습니다.");
}
} }
crdnCvlcpt.setCvlcptLinkId(crdnInfo.string("CVLCPT_LINK_ID"));
boolean isFirstBorn = crdnInfo.string("CRDN_REG_SE_CD").equals("02"); boolean isFirstBorn = crdnInfo.string("CRDN_REG_SE_CD").equals("02");
boolean isNotYetTransmit = !Arrays.asList(new String[]{"04","05","06"}).contains(crdnInfo.string("CVLCPT_TRSM_CD")); boolean isNotYetTransmit = !Arrays.asList(new String[]{"04","05","06"}).contains(crdnInfo.string("CVLCPT_TRSM_CD"));
@ -569,58 +415,12 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
} }
} }
//파일 처리
if(newFileInfoList != null && !newFileInfoList.isEmpty()) {
int fileInsertEffected = fileBean.create(newFileInfoList);
if(fileInsertCnt != fileInsertEffected) {
throw new RuntimeException("단속민원답변 수정 중 파일 등록에 실패하였습니다.");
}
}
if(deleteFileKeyList.length > 0) {
int fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList"));
if(fileDeleteCnt != fileDeleteEffected) {
throw new RuntimeException("단속민원답변 수정 중 파일 삭제에 실패하였습니다.");
}
}
return saved; return saved;
} }
@Override @Override
public boolean copyCvlcptCrdnInfo(String crdnId) { public boolean copyCvlcptCrdnInfo(String crdnId) {
return crdnCvlcptSubBean.copyCvlcptCrdnInfo(crdnId);
FileQuery fileQuery = new FileQuery().setInfoType(Crdn.INF_TYPE).setInfoKeys(crdnId);
List<DataObject> orgnlCrdnFileList = fileBean.getFileList(fileQuery);
String newCrdnId = crdnCvlcptSubBean.insertCrdnFromSelect(crdnId);
if(ifEmpty(newCrdnId, () -> "").equals("")) {
throw new RuntimeException("단속민원 복사 등록 중 단속대장 등록에 실패하였습니다.");
}
if (!orgnlCrdnFileList.isEmpty() && orgnlCrdnFileList.size() > 0) {
List<FileInfo> fileInfoList = new ArrayList<FileInfo>();
List<File> files = new ArrayList<>();
for (int iLoop = 0; iLoop < orgnlCrdnFileList.size(); iLoop++) {
files.add(new File(orgnlCrdnFileList.get(iLoop).string("FILE_PATH")));
}
Relation relation = new Relation();
relation.setInfoType(Crdn.INF_TYPE);
relation.setInfoKey(newCrdnId);
fileInfoList = new FileInfoFactory().createFileInfos(relation, files);
for (int iLoop = 0; iLoop < fileInfoList.size(); iLoop++) {
fileInfoList.get(iLoop).setName(orgnlCrdnFileList.get(iLoop).string("FILE_NM"));
}
int effected = fileBean.create(fileInfoList);
if(effected == 0) {
throw new RuntimeException("단속민원 복사 등록 중 파일복사에 실패하였습니다.");
}
}
return true;
} }
@Override @Override
@ -656,11 +456,6 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
return false; return false;
} }
int effected = crdnCvlcptMapper.updateAnswerTargetTransmitStatus(crdnCvlcpt);
if(effected != 1) {
throw new RuntimeException("민원 전송 상태 변경 중 오류가 발생하였습니다.");
}
//단속상태 변경(차적조회완료 -> 부과대상) //단속상태 변경(차적조회완료 -> 부과대상)
if(targetDataList.get(i).string("CRDN_STTS_CD").equals("21")) { if(targetDataList.get(i).string("CRDN_STTS_CD").equals("21")) {
CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry(); CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry();
@ -676,6 +471,10 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
} }
} }
int effected = crdnCvlcptMapper.updateAnswerTargetTransmitStatus(crdnCvlcpt);
if(effected != 1) {
throw new RuntimeException("민원 전송 상태 변경 중 오류가 발생하였습니다.");
}
if(processType.equals("answerExecute")) { if(processType.equals("answerExecute")) {
boolean result = crdnCvlcptMainBean.insertTransmitInfo(false, targetDataList.get(i).string("CVLCPT_LINK_ID")); boolean result = crdnCvlcptMainBean.insertTransmitInfo(false, targetDataList.get(i).string("CVLCPT_LINK_ID"));
@ -781,40 +580,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
boolean result = vehicleResultMap.get(vhrno); boolean result = vehicleResultMap.get(vhrno);
if(result) { if(result) {
//부과제외 대장을 등록 한다. boolean saved = crdnCvlcptSubBean.executelevyExcl("inquireTag", crdnInfo.string("CRDN_ID"));
LevyExcl excl01 = new LevyExcl();
excl01.setSggCd(crdnInfo.string("SGG_CD"));
excl01.setTaskSeCd(crdnInfo.string("TASK_SE_CD"));
excl01.setCrdnId(crdnInfo.string("CRDN_ID"));
excl01.setLevyExclYmd((new SimpleDateFormat("yyyyMMdd")).format(new Date()));
excl01.setLevyExclSeCd("1");
excl01.setLevyExclRsnCd("103");
excl01.setEtcCn("표지조회실행");
boolean saved = levyExclMapper.insert(excl01);
if (!saved) {
throw new RuntimeException("서손처리 중 부과제외 대장 등록에 실패하였습니다.");
}
//단속자료 변경
Crdn crdn = new Crdn();
crdn.setCrdnId(crdnInfo.string("CRDN_ID"));
crdn.setCrdnSttsCd("81");
saved = crdnUpdtMapper.updateCrdnStatus(crdn) == 1 ? true : false;
if(!saved) { if(!saved) {
throw new RuntimeException("서손처리 중 단속상태변경에 실패하였습니다."); throw new RuntimeException("서손처리에 실패하였습니다.");
}
//단속상태 변경 이력 기록
CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry();
crdnSttsHstry.setCrdnId(crdn.getCrdnId());
crdnSttsHstry.setBfrSttsCd(crdnInfo.string("CRDN_STTS_CD"));
crdnSttsHstry.setBfrSttsChgDt(crdnInfo.string("CRDN_STTS_CHG_DT"));
crdnSttsHstry.setCrdnSttsCd("81");
crdnSttsHstry.setTaskDtlId(excl01.getLevyExclId());
crdnSttsHstry.setEtcCn("표지조회실행");
saved = crdnSttsHstryMapper.insert(crdnSttsHstry);
if (!saved) {
throw new RuntimeException("서손처리 중 단속상태이력 등록에 실패하였습니다.");
} }
boolean isFirstBorn = crdnInfo.string("CRDN_REG_SE_CD").equals("02"); boolean isFirstBorn = crdnInfo.string("CRDN_REG_SE_CD").equals("02");
@ -850,7 +618,6 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
} }
} else { } else {
Crdn crdn = new Crdn(); Crdn crdn = new Crdn();
crdn.setCrdnId(crdnInfo.string("CRDN_ID")); crdn.setCrdnId(crdnInfo.string("CRDN_ID"));

@ -1,5 +1,10 @@
package cokr.xit.fims.cvlc.service.bean; package cokr.xit.fims.cvlc.service.bean;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -9,11 +14,26 @@ import org.springframework.stereotype.Component;
import cokr.xit.base.code.dao.CodeMapper; import cokr.xit.base.code.dao.CodeMapper;
import cokr.xit.base.code.service.CodeQuery; import cokr.xit.base.code.service.CodeQuery;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.FileInfo.Relation;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.fims.cmmn.CrdnPayerHstry;
import cokr.xit.fims.cmmn.CrdnSttsHstry;
import cokr.xit.fims.cmmn.dao.CrdnPayerHstryMapper;
import cokr.xit.fims.cmmn.dao.CrdnSttsHstryMapper;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
import cokr.xit.fims.crdn.dao.CrdnUpdtMapper;
import cokr.xit.fims.crdn.service.bean.CrdnStngBean;
import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.cvlc.dao.AnswerWordsMapper;
import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper;
import cokr.xit.fims.cvlc.dao.WarningWordsMapper; import cokr.xit.fims.cvlc.dao.WarningWordsMapper;
import cokr.xit.fims.excl.LevyExcl;
import cokr.xit.fims.excl.dao.LevyExclMapper;
import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -27,9 +47,33 @@ public class CrdnCvlcptSubBean extends AbstractComponent {
@Resource(name = "crdnCvlcptMapper") @Resource(name = "crdnCvlcptMapper")
private CrdnCvlcptMapper crdnCvlcptMapper; private CrdnCvlcptMapper crdnCvlcptMapper;
@Resource(name = "crdnInfoMapper")
private CrdnInfoMapper crdnInfoMapper;
@Resource(name = "crdnUpdtMapper")
private CrdnUpdtMapper crdnUpdtMapper;
@Resource(name = "crdnStngBean")
private CrdnStngBean crdnStngBean;
@Resource(name = "fileBean")
private FileBean fileBean;
@Resource(name = "codeMapper") @Resource(name = "codeMapper")
private CodeMapper codeMapper; private CodeMapper codeMapper;
@Resource(name = "levyExclMapper")
private LevyExclMapper levyExclMapper;
@Resource(name = "answerWordsMapper")
private AnswerWordsMapper answerWordsMapper;
@Resource(name = "crdnPayerHstryMapper")
private CrdnPayerHstryMapper crdnPayerHstryMapper;
@Resource(name = "crdnSttsHstryMapper")
private CrdnSttsHstryMapper crdnSttsHstryMapper;
@Resource(name = "warningWordsMapper") @Resource(name = "warningWordsMapper")
private WarningWordsMapper warningWordsMapper; private WarningWordsMapper warningWordsMapper;
@ -107,4 +151,258 @@ public class CrdnCvlcptSubBean extends AbstractComponent {
return warningWordsMapper.updateWarningWordsInfo(crdnCvlcpt) == 1 ? true : false; return warningWordsMapper.updateWarningWordsInfo(crdnCvlcpt) == 1 ? true : false;
} }
} }
/** , .
* @param nonQueryRequest , crdn , newFileInfoList
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean updateSubInfo(Map<String, Object> nonQueryRequest, Crdn crdn,
List<FileInfo> newFileInfoList) {
boolean saved = false;
DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdn.getCrdnId());
String acceptType = (String)ifEmpty(nonQueryRequest.get("acceptType"), "");
//첨수파일 수 변경
int fileInsertCnt = 0;
int fileDeleteCnt = 0;
if(newFileInfoList != null && !newFileInfoList.isEmpty()) {
fileInsertCnt = newFileInfoList.size();
}
String[] deleteFileKeyList = (String[])ifEmpty(nonQueryRequest.get("deleteFileKeyList"), new String[] {});
if(deleteFileKeyList.length > 0) {
fileDeleteCnt = deleteFileKeyList.length;
}
int changeFileCnt = (fileInsertCnt - fileDeleteCnt);
nonQueryRequest.put("changeFileCnt", changeFileCnt);
//금액 변경
if(crdnInfo.string("TASK_SE_CD").equals("PVS") && "Y".equals(crdnInfo.string("OVTIME_PRTTN_YN"))) {
nonQueryRequest.put("changeAmountYn","N");
} else {
int[] basicAmt = crdnStngBean.getBasicAmt(crdn);
int ffnlgCrdnAmt = crdnInfo.number("FFNLG_CRDN_AMT").intValue();
if(ffnlgCrdnAmt != basicAmt[0]){
nonQueryRequest.put("changeAmountYn","Y");
crdn.setFfnlgCrdnAmt(basicAmt[0]);
crdn.setFfnlgAmt(basicAmt[0]);
crdn.setAdvntceAmt(basicAmt[1]);
crdn.setFfnlgRductRt("0");
} else {
nonQueryRequest.put("changeAmountYn","N");
}
}
//납부자 변경
if(!crdnInfo.string("RTPYR_ID").equals(crdn.getRtpyrId())) {
nonQueryRequest.put("changePayerYn","Y");
} else {
nonQueryRequest.put("changePayerYn","N");
}
//단속상태값 변경
nonQueryRequest.put("changeStatusYn","Y");
if(acceptType.equals("accept")) {
if(!crdnInfo.string("CRDN_REG_SE_CD").equals("02")
|| Arrays.asList(new String[]{"04","05","06"}).contains(crdnInfo.string("CVLCPT_TRSM_CD"))) {
crdn.setCrdnSttsCd("22");
} else {
crdn.setCrdnSttsCd("21");
}
} else if(acceptType.equals("someAccept")){
crdn.setCrdnSttsCd("83");
} else if(acceptType.equals("nonAccept")) {
crdn.setCrdnSttsCd("81");
} else {
throw new RuntimeException("단속민원답변 수정에 실패하였습니다.");
}
//부과 제외 대장 등록
String dtlTaskId = "";
if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) { //일부수용,불수용
boolean retSuccess = false;
LevyExcl excl01 = new LevyExcl();
excl01.setCrdnId(crdn.getCrdnId());
excl01.setSggCd(crdn.getSggCd());
excl01.setTaskSeCd(crdn.getTaskSeCd());
excl01.setLevyExclYmd(crdn.getLevyExclYmd());
excl01.setLevyExclSeCd(crdn.getLevyExclSeCd());
excl01.setLevyExclRsnCd(crdn.getLevyExclRsnCd());
excl01.setEtcCn(crdn.getEtcCn());
retSuccess = levyExclMapper.insert(excl01);
if (!retSuccess) {
// 예외를 발생시켜서 오류메세지를 보내고 DB Rollback
throw new RuntimeException("부과제외 대장 등록에 실패하였습니다.");
}
dtlTaskId = excl01.getLevyExclId();
} else {
dtlTaskId = crdn.getCrdnId();
}
//단속정보변경
saved = this.updateCrdn(nonQueryRequest, crdn);
if(!saved) {
throw new RuntimeException("단속민원답변 수정 중 단속정보변경에 실패하였습니다.");
}
//단속 납부자 변경 이력 등록
if(((String)nonQueryRequest.get("changePayerYn")).equals("Y")) {
CrdnPayerHstry crdnPayerHstry = new CrdnPayerHstry();
crdnPayerHstry.setCrdnId(crdn.getCrdnId());
crdnPayerHstry.setRtpyrId(crdn.getRtpyrId());
boolean retSuccess = crdnPayerHstryMapper.insert(crdnPayerHstry);
if(!retSuccess) {
throw new RuntimeException("단속민원답변 수정 중 단속납부자변경 이력 등록에 실패하였습니다.");
}
}
//단속상태 변경 이력 등록
if(((String)nonQueryRequest.get("changeStatusYn")).equals("Y")) {
CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry();
crdnSttsHstry.setCrdnId(crdn.getCrdnId());
crdnSttsHstry.setBfrSttsCd(crdnInfo.string("CRDN_STTS_CD"));
crdnSttsHstry.setBfrSttsChgDt(crdnInfo.string("CRDN_STTS_CHG_DT"));
crdnSttsHstry.setCrdnSttsCd(crdn.getCrdnSttsCd());
crdnSttsHstry.setTaskDtlId(dtlTaskId);
if(crdn.getCrdnSttsCd().equals("81") || crdn.getCrdnSttsCd().equals("83")) {
crdnSttsHstry.setEtcCn("부과제외 대장 등록");
} else {
crdnSttsHstry.setEtcCn("민원 요청 수용");
}
boolean retSuccess = crdnSttsHstryMapper.insert(crdnSttsHstry);
if(!retSuccess) {
throw new RuntimeException("단속민원답변 수정 중 단속상태변경 이력 등록에 실패하였습니다.");
}
}
//파일 처리
if(newFileInfoList != null && !newFileInfoList.isEmpty()) {
int fileInsertEffected = fileBean.create(newFileInfoList);
if(fileInsertCnt != fileInsertEffected) {
throw new RuntimeException("단속민원답변 수정 중 파일 등록에 실패하였습니다.");
}
}
if(deleteFileKeyList.length > 0) {
int fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList"));
if(fileDeleteCnt != fileDeleteEffected) {
throw new RuntimeException("단속민원답변 수정 중 파일 삭제에 실패하였습니다.");
}
}
return true;
}
/** .
* @param crdnId ID
* @return
*/
public boolean copyCvlcptCrdnInfo(String crdnId) {
FileQuery fileQuery = new FileQuery().setInfoType(Crdn.INF_TYPE).setInfoKeys(crdnId);
List<DataObject> orgnlCrdnFileList = fileBean.getFileList(fileQuery);
String newCrdnId = this.insertCrdnFromSelect(crdnId);
if(ifEmpty(newCrdnId, () -> "").equals("")) {
throw new RuntimeException("단속민원 복사 등록 중 단속대장 등록에 실패하였습니다.");
}
if (!orgnlCrdnFileList.isEmpty() && orgnlCrdnFileList.size() > 0) {
List<FileInfo> fileInfoList = new ArrayList<FileInfo>();
List<File> files = new ArrayList<>();
for (int iLoop = 0; iLoop < orgnlCrdnFileList.size(); iLoop++) {
files.add(new File(orgnlCrdnFileList.get(iLoop).string("FILE_PATH")));
}
Relation relation = new Relation();
relation.setInfoType(Crdn.INF_TYPE);
relation.setInfoKey(newCrdnId);
fileInfoList = new FileInfoFactory().createFileInfos(relation, files);
for (int iLoop = 0; iLoop < fileInfoList.size(); iLoop++) {
fileInfoList.get(iLoop).setName(orgnlCrdnFileList.get(iLoop).string("FILE_NM"));
}
int effected = fileBean.create(fileInfoList);
if(effected == 0) {
throw new RuntimeException("단속민원 복사 등록 중 파일복사에 실패하였습니다.");
}
}
return true;
}
/** .
* @param trigger , crdnId ID
* @return
*/
public boolean executelevyExcl(String trigger, String crdnId) {
boolean saved = false;
String levyExclRsnCd = "";
String etcCn = "";
DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdnId);
if(trigger.equals("sendBack")) { //반송으로 인한 서손
levyExclRsnCd = "191";
etcCn = "이송(이첩)";
} else if(trigger.equals("inquireTag")) { //표지조회실행으로 인한 서손
levyExclRsnCd = "103";
etcCn = "표지조회실행";
} else {
return false;
}
//부과제외 대장을 등록 한다.
LevyExcl excl01 = new LevyExcl();
excl01.setSggCd(crdnInfo.string("SGG_CD"));
excl01.setTaskSeCd(crdnInfo.string("TASK_SE_CD"));
excl01.setCrdnId(crdnInfo.string("CRDN_ID"));
excl01.setLevyExclYmd((new SimpleDateFormat("yyyyMMdd")).format(new Date()));
excl01.setLevyExclSeCd("1");
excl01.setLevyExclRsnCd(levyExclRsnCd);
excl01.setEtcCn(etcCn);
saved = levyExclMapper.insert(excl01);
if (!saved) {
throw new RuntimeException("서손처리 중 부과제외 대장 등록에 실패하였습니다.");
}
//단속상태를 변경한다.
Crdn crdn = new Crdn();
crdn.setCrdnId(crdnId);
crdn.setCrdnSttsCd("81");
saved = crdnUpdtMapper.updateCrdnStatus(crdn) == 1 ? true : false;
if (!saved) {
throw new RuntimeException("서손처리 중 단속상태변경에 실패하였습니다.");
}
//단속상태 변경 이력 기록
CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry();
crdnSttsHstry.setCrdnId(crdnId);
crdnSttsHstry.setBfrSttsCd(crdnInfo.string("CRDN_STTS_CD"));
crdnSttsHstry.setBfrSttsChgDt(crdnInfo.string("CRDN_STTS_CHG_DT"));
crdnSttsHstry.setCrdnSttsCd("81");
crdnSttsHstry.setTaskDtlId(excl01.getLevyExclId());
crdnSttsHstry.setEtcCn(etcCn);
saved = crdnSttsHstryMapper.insert(crdnSttsHstry);
if (!saved) {
throw new RuntimeException("서손처리 중 단속상태이력 등록에 실패하였습니다.");
}
return true;
}
} }

@ -40,7 +40,7 @@ public class Cvlc01Controller extends ApplicationController {
getCivilComplaintReceiptDataList = "/010/list.do", getCivilComplaintReceiptDataList = "/010/list.do",
removeCivilComplaint = "/010/remove.do", removeCivilComplaint = "/010/remove.do",
getCivilComplaintReceiptInitialDataInfo = "/020/info.do", getCivilComplaintReceiptInitialDataInfo = "/020/info.do",
saveCivilComplaintProcessSe = "/020/update.do", saveCivilComplaintProcessSection = "/020/update.do",
copyCivilComplaintInfo = "/020/create.do", copyCivilComplaintInfo = "/020/create.do",
sendBackCivilComplaintInfo = "/020/remove.do", sendBackCivilComplaintInfo = "/020/remove.do",
getCivilComplaintOriginalInfo = "/050/info.do", getCivilComplaintOriginalInfo = "/050/info.do",
@ -196,7 +196,7 @@ public class Cvlc01Controller extends ApplicationController {
* "saved": true, false * "saved": true, false
* }</code></pre> * }</code></pre>
*/ */
public ModelAndView saveCivilComplaintProcessSe(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
String sggCd = globalStngMapper.selectSggCdForCurrentUser(); String sggCd = globalStngMapper.selectSggCdForCurrentUser();
crdn.setSggCd(sggCd); crdn.setSggCd(sggCd);
@ -245,7 +245,7 @@ public class Cvlc01Controller extends ApplicationController {
} }
} }
saved = crdnCvlcptService.updateCvlcptPrcsSe(nonQueryRequest, crdnCvlcpt, crdn, newFileInfoList); saved = crdnCvlcptService.updateCvlcptProcessSection(nonQueryRequest, crdnCvlcpt, crdn, newFileInfoList);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")

@ -41,9 +41,9 @@ public class BpvController {
} }
@Override @Override
@RequestMapping(name="전용차로과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSe) @RequestMapping(name="전용차로과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSection)
public ModelAndView saveCivilComplaintProcessSe(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
return super.saveCivilComplaintProcessSe(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList); return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList);
} }
@Override @Override

@ -40,9 +40,9 @@ public class DpvController {
} }
@Override @Override
@RequestMapping(name="장애인과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSe) @RequestMapping(name="장애인과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSection)
public ModelAndView saveCivilComplaintProcessSe(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
return super.saveCivilComplaintProcessSe(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList); return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList);
} }
@Override @Override

@ -41,9 +41,9 @@ public class EcaController {
} }
@Override @Override
@RequestMapping(name="전기차과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSe) @RequestMapping(name="전기차과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSection)
public ModelAndView saveCivilComplaintProcessSe(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
return super.saveCivilComplaintProcessSe(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList); return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList);
} }
@Override @Override

@ -41,9 +41,9 @@ public class PvsController {
} }
@Override @Override
@RequestMapping(name="주정차과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSe) @RequestMapping(name="주정차과태료업무 민원 정보 수정", value=METHOD_URL.saveCivilComplaintProcessSection)
public ModelAndView saveCivilComplaintProcessSe(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { public ModelAndView saveCivilComplaintProcessSection(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
return super.saveCivilComplaintProcessSe(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList); return super.saveCivilComplaintProcessSection(hReq, crdnCvlcpt, crdn, newFileList, modifyFileList);
} }
@Override @Override

Loading…
Cancel
Save