민원 수정

main
이범준 1 year ago
parent a9ac79b805
commit 43e955153c

@ -12,31 +12,6 @@ import lombok.Setter;
public class Crdn extends AbstractEntity { public class Crdn extends AbstractEntity {
public static String INF_TYPE = "100"; public static String INF_TYPE = "100";
/**
*
*/
private String[] modifyFileKeyList;
/**
*
*/
private String[] deleteFileKeyList;
/**
*
*/
private int fileChgCnt;
/**
*
*/
private String updateInfomation;
/**
* -
*/
private String doGuidance;
/** /**
* ID * ID
*/ */
@ -47,11 +22,6 @@ public class Crdn extends AbstractEntity {
*/ */
private String sggCd; private String sggCd;
/**
*
*/
private String institute;
/** /**
* *
*/ */
@ -127,11 +97,6 @@ public class Crdn extends AbstractEntity {
*/ */
private String vltnId; private String vltnId;
/**
*
*/
private String vltnCd;
/** /**
* *
*/ */
@ -430,10 +395,16 @@ public class Crdn extends AbstractEntity {
/** /**
* *
*/ */
private String linkNm; private String linkTblNm;
/** /**
* *
*/ */
private String cvlcptLinkYn; private String cvlcptLinkYn;
/**
*
*/
private String vltnCd;
} }

@ -54,4 +54,10 @@ public interface Crdn05Mapper extends AbstractMapper {
*/ */
int selectBasicAmt(CrdnQuery query); int selectBasicAmt(CrdnQuery query);
String selectSggCd(String institute);
default String selectSggCdForCurrentUser() {
return selectSggCd(currentUser().getInstitute());
};
} }

@ -1,10 +1,10 @@
package cokr.xit.fims.crdn.dao; package cokr.xit.fims.crdn.dao;
import java.util.List; import java.util.List;
import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnCvlcpt; import cokr.xit.fims.crdn.CrdnCvlcpt;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.component.AbstractMapper;
@ -67,16 +67,16 @@ public interface CrdnCvlcptMapper extends AbstractMapper {
*/ */
int insertCvlcpt(CrdnCvlcpt cvlcpt); int insertCvlcpt(CrdnCvlcpt cvlcpt);
/** . /** .
* @param crdn * @param crdn
* @return * @return
*/ */
int acceptCvlcpt(CrdnCvlcpt cvlcpt); int updateCvlcptPrcs(CrdnCvlcpt cvlcpt);
/** . /** .
* @param crdn * @param params
* @return * @return
*/ */
int updateCrdn(Crdn crdn); int updateCrdn(Map<String, Object> params);
} }

@ -0,0 +1,47 @@
package cokr.xit.fims.crdn.service;
import java.util.List;
import java.util.Map;
import cokr.xit.base.file.FileInfo;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.foundation.data.DataObject;
public interface CrdnCvlcptService {
/** .
* @param crdnQuery
* @return
*/
DataObject getCivilComplaintOriginalInfo(CrdnQuery crdnQuery);
/** .
* @param crdnQuery
* @return
*/
DataObject getAnswerPreview(CrdnQuery crdnQuery);
/** .
* @param crdnQuery
* @return
*/
DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery crdnQuery);
/** .
* @param crdnQuery
* @return map
* <ul><li>filePath: </li>
* <li>fileName: </li>
* </ul>
*/
Map<String, String> makeFileFromHwpFormat(CrdnQuery crdnQuery);
/** .
* @param crdn , newFileInfoList
* @return
*/
boolean updateCvlcptPrcs(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList);
}

@ -29,34 +29,12 @@ public interface CrdnService {
* @param crdn , newFileList * @param crdn , newFileList
* @return * @return
*/ */
boolean create(Crdn crdn, List<FileInfo> newFileInfoList); boolean create(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList);
/** . /** .
* @param crdn , newFileInfoList * @param crdn , nonQueryRequest , newFileInfoList
* @return * @return
*/ */
boolean update(Crdn crdn, List<FileInfo> newFileInfoList); boolean update(Map<String,Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList);
/** .
* @param crdn , newFileInfoList
* @return
*/
boolean acceptCvlcpt(Crdn crdn, List<FileInfo> newFileInfoList);
/** .
* @param crdnQuery
* @return map
* <ul><li>filePath: </li>
* <li>fileName: </li>
* </ul>
*/
Map<String, String> makeFileFromHwpFormat(CrdnQuery crdnQuery);
DataObject getCivilComplaintOriginalInfo(CrdnQuery req);
DataObject getAnswerPreview(CrdnQuery req);
DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery req);
} }

@ -1,15 +0,0 @@
package cokr.xit.fims.crdn.service.bean;
import org.springframework.stereotype.Component;
import cokr.xit.foundation.AbstractComponent;
/** Bean
* @author leebj
*/
@Component("crdn02Bean")
public class Crdn02Bean extends AbstractComponent {
}

@ -1,5 +1,7 @@
package cokr.xit.fims.crdn.service.bean; package cokr.xit.fims.crdn.service.bean;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -24,8 +26,10 @@ public class Crdn06Bean extends AbstractComponent {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public boolean update(Crdn crdn) { public boolean update(Map<String,Object> nonQueryRequest, Crdn crdn) {
switch (ifEmpty(crdn.getUpdateInfomation(), () -> "")) { String updateInfomation = (String)nonQueryRequest.get("updateInfomation");
switch (ifEmpty(updateInfomation, () -> "")) {
case "tagInformationUndefinedData": case "tagInformationUndefinedData":
return crdn06Mapper.updateTagInformation(crdn) == 1 ? true : false; return crdn06Mapper.updateTagInformation(crdn) == 1 ? true : false;
default: default:

@ -21,8 +21,8 @@ import cokr.xit.foundation.data.DataObject;
/** Bean /** Bean
* @author leebj * @author leebj
*/ */
@Component("crdn01Bean") @Component("crdnCvlcptBean")
public class Crdn01Bean extends AbstractComponent { public class CrdnCvlcptBean extends AbstractComponent {
@Resource(name = "crdnCvlcptMapper") @Resource(name = "crdnCvlcptMapper")
private CrdnCvlcptMapper crdnCvlcptMapper; private CrdnCvlcptMapper crdnCvlcptMapper;
@ -48,12 +48,18 @@ public class Crdn01Bean extends AbstractComponent {
return crdnCvlcptMapper.selectCivilComplaintOriginalInfo(crdnQuery); return crdnCvlcptMapper.selectCivilComplaintOriginalInfo(crdnQuery);
} }
public boolean accept(CrdnCvlcpt cvlcpt) { public boolean updateCvlcptPrcs(CrdnCvlcpt cvlcpt) {
return crdnCvlcptMapper.acceptCvlcpt(cvlcpt) == 1 ? true : false; return crdnCvlcptMapper.updateCvlcptPrcs(cvlcpt) == 1 ? true : false;
} }
public boolean update(Crdn crdn) { public boolean updateCrdn(Map<String, Object> nonQueryRequest, Crdn crdn) {
return crdnCvlcptMapper.updateCrdn(crdn) == 1 ? true : false; DataObject params = new DataObject();
params.set("currentUser", currentUser());
params.set("crdn", crdn);
for(String key : nonQueryRequest.keySet()){
params.set(key, nonQueryRequest.get(key));
}
return crdnCvlcptMapper.updateCrdn(params) == 1 ? true : false;
} }
} }

@ -0,0 +1,260 @@
package cokr.xit.fims.crdn.service.bean;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile;
import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnCvlcpt;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnCvlcptMapper;
import cokr.xit.fims.crdn.service.CrdnCvlcptService;
import cokr.xit.fims.sprt.Sprt;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
import kr.dogfoot.hwplib.object.HWPFile;
import kr.dogfoot.hwplib.reader.HWPReader;
import kr.dogfoot.hwplib.tool.objectfinder.FieldFinder;
import kr.dogfoot.hwplib.writer.HWPWriter;
@Service("crdnCvlcptService")
public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCvlcptService {
@Resource(name="fileBean")
private FileBean fileBean;
@Resource(name="crdnCvlcptBean")
protected CrdnCvlcptBean crdnCvlcptBean;
@Resource(name = "crdnCvlcptMapper")
private CrdnCvlcptMapper crdnCvlcptMapper;
@Override
public Map<String, String> makeFileFromHwpFormat(CrdnQuery crdnQuery) {
String baseFormatFilePath = ("classpath:format/cvlcptOrgnl_text.hwp");
String attachFormatFilePath = ("classpath:format/cvlcptOrgnl_photo.hwp");
crdnQuery.setViewType("hwp");
DataObject dataObject = crdnCvlcptBean.getCivilComplaintOriginalInfo(crdnQuery);
SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat ymdFormat = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat ymdHypenFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
File file = ResourceUtils.getFile(baseFormatFilePath);
HWPFile baseFormatFile = HWPReader.fromFile(file);
ArrayList<String> strings = new ArrayList<String>();
strings.add(dataObject.string("CVLCPT_APLCNT_NM"));
FieldFinder.setClickHereText(baseFormatFile, "신청자", strings);
strings = new ArrayList<String>();
String cvlcptRcptYmd = dataObject.string("CVLCPT_RCPT_YMD");
cvlcptRcptYmd = ymdHypenFormat.format(ymdFormat.parse(cvlcptRcptYmd));
strings.add(cvlcptRcptYmd);
FieldFinder.setClickHereText(baseFormatFile, "접수일자", strings);
strings = new ArrayList<String>();
String cvlcptRrcsPrnmntDt = dataObject.string("CVLCPT_PRCS_PRNMNT_DT");
cvlcptRrcsPrnmntDt = ymdHypenFormat.format(ymdFormat.parse(cvlcptRrcsPrnmntDt));
strings.add(cvlcptRrcsPrnmntDt);
FieldFinder.setClickHereText(baseFormatFile, "처리기한", strings);
strings = new ArrayList<String>();
strings.add(dataObject.string("CVLCPT_RCPT_NO"));
FieldFinder.setClickHereText(baseFormatFile, "접수번호", strings);
strings = new ArrayList<String>();
String cvlcptAplyCn = dataObject.string("CVLCPT_APLY_CN");
cvlcptAplyCn = CmmnUtil.escapeHTMLEntity(cvlcptAplyCn);
strings.add(cvlcptAplyCn);
FieldFinder.setClickHereText(baseFormatFile, "민원내용", strings);
String currentTime = ymdhmsFormat.format(new Date());
String formatFileResultRootPath = "files" + File.separator + "result";
File formatFileResultRootFolder = new File(formatFileResultRootPath);
if(!formatFileResultRootFolder.exists()) {
formatFileResultRootFolder.mkdirs();
}
String resultPath = formatFileResultRootPath + File.separator + currentTime + ".hwp";
HWPWriter.toFile(baseFormatFile, resultPath);
HWPFile resultFile = HWPReader.fromFile(resultPath);
String linkTblNm = dataObject.string("LINK_TBL_NM");
if(!linkTblNm.equals("")) {
FileQuery fileQuery = new FileQuery();
if(linkTblNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010");
} else if(linkTblNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
}
fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
List<DataObject> fileInfoList = fileBean.getFileList(fileQuery);
fileInfoList = fileInfoList.stream()
.filter(fileInfo -> fileInfo.string("MIME_TYPE").startsWith("image"))
.collect(Collectors.toList());
if(fileInfoList != null && fileInfoList.size() > 0) {
int photoCnt = fileInfoList.size();
int PHOTO_COUNT_PER_PAGE = 4;
for(int i=0; i < photoCnt; i += PHOTO_COUNT_PER_PAGE) {
file = ResourceUtils.getFile(attachFormatFilePath);
HWPFile attachFormatFile = HWPReader.fromFile(file);
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "왼쪽위사진", fileInfoList.get(i).string("URL"));
if(i+1 < photoCnt)
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "오른쪽위사진", fileInfoList.get(i+1).string("URL"));
if(i+2 < photoCnt)
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "왼쪽아래사진", fileInfoList.get(i+2).string("URL"));
if(i+3 < photoCnt)
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "오른쪽아래사진", fileInfoList.get(i+3).string("URL"));
AddingParagraphBetweenHWPFile.fileMerge(attachFormatFile, resultFile);
}
HWPWriter.toFile(resultFile, resultPath);
}
}
String downlaodFileName = "민원내역원본_" + currentTime + ".hwp";
Map<String, String> result = Map.of(
"filePath", resultPath,
"fileName", downlaodFileName
);
return result;
} catch (Exception e) {
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
}
}
@Override
public DataObject getCivilComplaintOriginalInfo(CrdnQuery req) {
return crdnCvlcptBean.getCivilComplaintOriginalInfo(req);
}
@Override
public DataObject getAnswerPreview(CrdnQuery req) {
return crdnCvlcptMapper.selectAnswerPreview(req);
}
@Override
public DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery req) {
//민원조회
DataObject dataObject = crdnCvlcptMapper.selectCivilComplaintReceiptInitialDataInfo(req);
//첨부파일 조회
FileQuery fileQuery = new FileQuery();
fileQuery.setInfoType(Crdn.INF_TYPE);
fileQuery.setInfoKeys(req.getCrdnId());
List<DataObject> fileList = fileBean.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) {
dataObject.set("fileList", fileList);
}
//동영상 존재 여부 확인
dataObject.set("videoExist", "N");
String linkTblNm = dataObject.string("LINK_TBL_NM");
if(!linkTblNm.equals("")) {
if(linkTblNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010");
} else if(linkTblNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
throw new RuntimeException("파일 조회 중 오류가 발생하였습니다.");
}
fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
List<DataObject> linkFileList = fileBean.getFileList(fileQuery);
if(linkFileList != null && !linkFileList.isEmpty()) {
for(int i=0; i < linkFileList.size(); i++) {
String mimeType = linkFileList.get(i).string("MIME_TYPE");
if(Arrays.asList(Sprt.VIDEO_MIME_TYPE).contains(mimeType)) {
dataObject.set("videoExist", "Y");
}
}
}
}
return dataObject;
}
@Override
public boolean updateCvlcptPrcs(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList) {
boolean saved = false;
int fileInsertEffected = 0;
int fileDeleteEffected = 0;
if(newFileInfoList != null && !newFileInfoList.isEmpty()) {
fileInsertEffected = fileBean.create(newFileInfoList);
}
if((String[])nonQueryRequest.get("deleteFileKeyList") != null) {
fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList"));
}
int changeFileCnt = (fileInsertEffected - fileDeleteEffected);
CrdnCvlcpt crdnCvlcpt = new CrdnCvlcpt();
crdnCvlcpt.setCvlcptLinkId(crdn.getLinkId());
String acceptType = (String)nonQueryRequest.get("acceptType");
if(acceptType.equals("someAccept")) {
///call 부과제외
} else if(acceptType.equals("nonAccept")) {
///call 부과제외
}
//TODO : 전송코드,처리코드 결정
crdnCvlcpt.setCvlcptPrcsCd("");
crdnCvlcpt.setCvlcptTrsmCd("02");
//TODO : 전송문구 조회
crdnCvlcpt.setCvlcptPrcsSumry("요약요약요약");
crdnCvlcpt.setCvlcptPrcsRsltCn("결과결과결과");
//민원정보변경
saved = crdnCvlcptBean.updateCvlcptPrcs(crdnCvlcpt);
nonQueryRequest.put("changeFileCnt", changeFileCnt);
//단속정보변경
saved = crdnCvlcptBean.updateCrdn(nonQueryRequest, crdn);
return saved;
}
}

@ -1,30 +1,21 @@
package cokr.xit.fims.crdn.service.bean; package cokr.xit.fims.crdn.service.bean;
import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.assertj.core.util.Arrays;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils;
import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.FileInfo;
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.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.CrdnSttsHstry; import cokr.xit.fims.cmmn.CrdnSttsHstry;
import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile;
import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnCvlcpt;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn05Mapper; import cokr.xit.fims.crdn.dao.Crdn05Mapper;
import cokr.xit.fims.crdn.dao.Crdn06Mapper; import cokr.xit.fims.crdn.dao.Crdn06Mapper;
@ -32,14 +23,8 @@ import cokr.xit.fims.crdn.dao.CrdnCvlcptMapper;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.excl.Excl01; import cokr.xit.fims.excl.Excl01;
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.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.reader.HWPReader;
import kr.dogfoot.hwplib.tool.objectfinder.FieldFinder;
import kr.dogfoot.hwplib.writer.HWPWriter;
@Service("crdnService") @Service("crdnService")
public class CrdnServiceBean extends AbstractServiceBean implements CrdnService { public class CrdnServiceBean extends AbstractServiceBean implements CrdnService {
@ -56,11 +41,8 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
@Resource(name="fileBean") @Resource(name="fileBean")
private FileBean fileBean; private FileBean fileBean;
@Resource(name="crdn01Bean") @Resource(name="crdnCvlcptBean")
protected Crdn01Bean crdn01Bean; protected CrdnCvlcptBean crdnCvlcptBean;
@Resource(name="crdn02Bean")
protected Crdn02Bean crdn02Bean;
@Resource(name="crdn05Bean") @Resource(name="crdn05Bean")
protected Crdn05Bean crdn05Bean; protected Crdn05Bean crdn05Bean;
@ -151,205 +133,13 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
@Override @Override
public boolean remove(String... crdnIDs) { public boolean remove(String... crdnIDs) {
return crdn01Bean.remove(crdnIDs); return crdnCvlcptBean.remove(crdnIDs);
}
@Override
public DataObject getCivilComplaintOriginalInfo(CrdnQuery req) {
return crdn01Bean.getCivilComplaintOriginalInfo(req);
}
@Override
public Map<String, String> makeFileFromHwpFormat(CrdnQuery crdnQuery) {
String baseFormatFilePath = ("classpath:format/cvlcptOrgnl_text.hwp");
String attachFormatFilePath = ("classpath:format/cvlcptOrgnl_photo.hwp");
crdnQuery.setViewType("hwp");
DataObject dataObject = crdn01Bean.getCivilComplaintOriginalInfo(crdnQuery);
SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat ymdFormat = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat ymdHypenFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
File file = ResourceUtils.getFile(baseFormatFilePath);
HWPFile baseFormatFile = HWPReader.fromFile(file);
ArrayList<String> strings = new ArrayList<String>();
strings.add(dataObject.string("CVLCPT_APLCNT_NM"));
FieldFinder.setClickHereText(baseFormatFile, "신청자", strings);
strings = new ArrayList<String>();
String cvlcptRcptYmd = dataObject.string("CVLCPT_RCPT_YMD");
cvlcptRcptYmd = ymdHypenFormat.format(ymdFormat.parse(cvlcptRcptYmd));
strings.add(cvlcptRcptYmd);
FieldFinder.setClickHereText(baseFormatFile, "접수일자", strings);
strings = new ArrayList<String>();
String cvlcptRrcsPrnmntDt = dataObject.string("CVLCPT_PRCS_PRNMNT_DT");
cvlcptRrcsPrnmntDt = ymdHypenFormat.format(ymdFormat.parse(cvlcptRrcsPrnmntDt));
strings.add(cvlcptRrcsPrnmntDt);
FieldFinder.setClickHereText(baseFormatFile, "처리기한", strings);
strings = new ArrayList<String>();
strings.add(dataObject.string("CVLCPT_RCPT_NO"));
FieldFinder.setClickHereText(baseFormatFile, "접수번호", strings);
strings = new ArrayList<String>();
String cvlcptAplyCn = dataObject.string("CVLCPT_APLY_CN");
cvlcptAplyCn = CmmnUtil.escapeHTMLEntity(cvlcptAplyCn);
strings.add(cvlcptAplyCn);
FieldFinder.setClickHereText(baseFormatFile, "민원내용", strings);
String currentTime = ymdhmsFormat.format(new Date());
String formatFileResultRootPath = "files" + File.separator + "result";
File formatFileResultRootFolder = new File(formatFileResultRootPath);
if(!formatFileResultRootFolder.exists()) {
formatFileResultRootFolder.mkdirs();
}
String resultPath = formatFileResultRootPath + File.separator + currentTime + ".hwp";
HWPWriter.toFile(baseFormatFile, resultPath);
HWPFile resultFile = HWPReader.fromFile(resultPath);
String linkNm = dataObject.string("LINK_TBL_NM");
if(!linkNm.equals("")) {
FileQuery fileQuery = new FileQuery();
if(linkNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010");
} else if(linkNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
}
fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
List<DataObject> fileInfoList = fileBean.getFileList(fileQuery);
fileInfoList = fileInfoList.stream()
.filter(fileInfo -> fileInfo.string("MIME_TYPE").startsWith("image"))
.collect(Collectors.toList());
if(fileInfoList != null && fileInfoList.size() > 0) {
int photoCnt = fileInfoList.size();
int PHOTO_COUNT_PER_PAGE = 4;
for(int i=0; i < photoCnt; i += PHOTO_COUNT_PER_PAGE) {
file = ResourceUtils.getFile(attachFormatFilePath);
HWPFile attachFormatFile = HWPReader.fromFile(file);
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "왼쪽위사진", fileInfoList.get(i).string("URL"));
if(i+1 < photoCnt)
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "오른쪽위사진", fileInfoList.get(i+1).string("URL"));
if(i+2 < photoCnt)
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "왼쪽아래사진", fileInfoList.get(i+2).string("URL"));
if(i+3 < photoCnt)
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "오른쪽아래사진", fileInfoList.get(i+3).string("URL"));
AddingParagraphBetweenHWPFile.fileMerge(attachFormatFile, resultFile);
}
HWPWriter.toFile(resultFile, resultPath);
}
}
String downlaodFileName = "민원내역원본_" + currentTime + ".hwp";
Map<String, String> result = Map.of(
"filePath", resultPath,
"fileName", downlaodFileName
);
return result;
} catch (Exception e) {
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
}
}
@Override
public DataObject getAnswerPreview(CrdnQuery req) {
return crdnCvlcptMapper.selectAnswerPreview(req);
}
@Override
public DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery req) {
//민원조회
DataObject dataObject = crdnCvlcptMapper.selectCivilComplaintReceiptInitialDataInfo(req);
//첨부파일 조회
FileQuery fileQuery = new FileQuery();
fileQuery.setInfoType(Crdn.INF_TYPE);
fileQuery.setInfoKeys(req.getCrdnId());
List<DataObject> fileList = fileBean.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) {
dataObject.set("fileList", fileList);
}
//동영상 존재 여부 확인
dataObject.set("videoExist", "N");
String linkNm = dataObject.string("LINK_TBL_NM");
if(!linkNm.equals("")) {
if(linkNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010");
} else if(linkNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020");
} else {
throw new RuntimeException("파일 조회 중 오류가 발생하였습니다.");
}
fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
List<DataObject> linkFileList = fileBean.getFileList(fileQuery);
if(linkFileList != null && !linkFileList.isEmpty()) {
for(int i=0; i < linkFileList.size(); i++) {
String mimeType = linkFileList.get(i).string("MIME_TYPE");
if(Arrays.asList(Sprt.VIDEO_MIME_TYPE).contains(mimeType)) {
dataObject.set("videoExist", "Y");
}
}
}
}
return dataObject;
} }
@Override
public boolean acceptCvlcpt(Crdn crdn, List<FileInfo> newFileInfoList) {
boolean saved;
int fileInsertEffected = 0;
int fileDeleteEffected = 0;
if(newFileInfoList != null && !newFileInfoList.isEmpty()) {
fileInsertEffected = fileBean.create(newFileInfoList);
}
if(crdn.getDeleteFileKeyList() != null) {
fileDeleteEffected = fileBean.remove(crdn.getDeleteFileKeyList());
}
crdn.setFileChgCnt(fileInsertEffected - fileDeleteEffected);
if(ifEmpty(crdn.getCvlcptLinkYn(),() -> "").equals("Y")) {
CrdnCvlcpt crdnCvlcpt = new CrdnCvlcpt();
crdnCvlcpt.setCvlcptLinkId(crdn.getLinkId());
//crdnCvlcpt.set(crdn.get);
//crdnCvlcpt.set(crdn.get);
//crdnCvlcpt.set(crdn.get);
saved = crdn01Bean.accept(crdnCvlcpt);
}
saved = crdn01Bean.update(crdn);
return saved;
}
@Override @Override
public boolean create(Crdn crdn, List<FileInfo> fileInfoList) { public boolean create(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> fileInfoList) {
if(fileInfoList != null && !fileInfoList.isEmpty()) { if(fileInfoList != null && !fileInfoList.isEmpty()) {
crdn.setAtchFileCnt(fileInfoList.size()); crdn.setAtchFileCnt(fileInfoList.size());
@ -364,14 +154,15 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
crdn.setAdvntceLevyAmt(basicAmt[1]); crdn.setAdvntceLevyAmt(basicAmt[1]);
if(ifEmpty((String)nonQueryRequest.get("doGuidance"), () -> "").equals("on")) {
if(ifEmpty(crdn.getDoGuidance(), () -> "").equals("on")) {
crdn.setCrdnSttsCd("83"); crdn.setCrdnSttsCd("83");
} else { } else {
crdn.setCrdnSttsCd("01"); crdn.setCrdnSttsCd("01");
} }
crdn.setInstitute(UserInfo.current().getInstitute());
String currentSggCd = crdn05Mapper.selectSggCdForCurrentUser();
crdn.setSggCd(currentSggCd);
boolean result = crdn05Bean.insertCrdn(crdn); boolean result = crdn05Bean.insertCrdn(crdn);
SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd");
@ -383,7 +174,7 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
if(crdn.getCrdnSttsCd().equals("83")) { if(crdn.getCrdnSttsCd().equals("83")) {
// 부과제외(TB_LEVY_EXCL) 대장 등록 // 부과제외(TB_LEVY_EXCL) 대장 등록
Excl01 excl01 = new Excl01(); Excl01 excl01 = new Excl01();
excl01.setSggCd(""); // TODO:시군구 excl01.setSggCd(currentSggCd);
excl01.setTaskSeCd(crdn.getTaskSeCd()); excl01.setTaskSeCd(crdn.getTaskSeCd());
excl01.setCrdnId(crdn.getCrdnId()); excl01.setCrdnId(crdn.getCrdnId());
excl01.setLevyExclYmd(strCurrentDate); excl01.setLevyExclYmd(strCurrentDate);
@ -423,8 +214,10 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
} }
@Override @Override
public boolean update(Crdn crdn, List<FileInfo> newFileInfoList) { public boolean update(Map<String, Object> nonQueryRequest, Crdn crdn, List<FileInfo> newFileInfoList) {
return crdn06Bean.update(crdn); return crdn06Bean.update(nonQueryRequest, crdn);
} }
} }

@ -1,6 +1,7 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -19,6 +20,7 @@ import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
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.service.CrdnCvlcptService;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -32,6 +34,9 @@ public class Crdn01Controller extends ApplicationController {
@Resource(name="crdnService") @Resource(name="crdnService")
private CrdnService crdnService; private CrdnService crdnService;
@Resource(name="crdnCvlcptService")
private CrdnCvlcptService crdnCvlcptService;
/** . /** .
* @return fims/crdn/crdn01010-main * @return fims/crdn/crdn01010-main
*/ */
@ -94,7 +99,7 @@ public class Crdn01Controller extends ApplicationController {
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM039"); Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM039");
mav.addObject("FIM039List", commonCodes.get("FIM039")); mav.addObject("FIM039List", commonCodes.get("FIM039"));
DataObject info = crdnService.getCivilComplaintOriginalInfo(req); DataObject info = crdnCvlcptService.getCivilComplaintOriginalInfo(req);
mav.addObject("cvlcptInfo", json ? info : toJson(info)); mav.addObject("cvlcptInfo", json ? info : toJson(info));
return mav; return mav;
@ -132,7 +137,7 @@ public class Crdn01Controller extends ApplicationController {
String urlTaskSeCd = request.getServletPath().split("/")[1]; String urlTaskSeCd = request.getServletPath().split("/")[1];
mav.addObject("taskSeCd", urlTaskSeCd); mav.addObject("taskSeCd", urlTaskSeCd);
DataObject info = crdnService.getCivilComplaintReceiptInitialDataInfo(req); DataObject info = crdnCvlcptService.getCivilComplaintReceiptInitialDataInfo(req);
mav.addObject("crdnInfo", json ? info : toJson(info)); mav.addObject("crdnInfo", json ? info : toJson(info));
@ -234,10 +239,13 @@ public class Crdn01Controller extends ApplicationController {
* }</code></pre> * }</code></pre>
*/ */
@RequestMapping(name="민원내용 수용", value="/020/save.do") @RequestMapping(name="민원내용 수용", value="/020/save.do")
public ModelAndView acceptCivilComplaint(Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) { public ModelAndView acceptCivilComplaint(HttpServletRequest req, Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
boolean saved = false; boolean saved = false;
String[] deleteFileKeyList = req.getParameterValues("deleteFileKeyList");
String[] modifyFileKeyList = req.getParameterValues("modifyFileKeyList");
List<FileInfo> newFileInfoList = new ArrayList<FileInfo>(); List<FileInfo> newFileInfoList = new ArrayList<FileInfo>();
if(newFileList != null || modifyFileList != null) { if(newFileList != null || modifyFileList != null) {
@ -251,19 +259,24 @@ public class Crdn01Controller extends ApplicationController {
if(modifyFileList != null) { if(modifyFileList != null) {
newFileInfoList.addAll(new FileInfoFactory().makeFileInfos(relation, modifyFileList)); newFileInfoList.addAll(new FileInfoFactory().makeFileInfos(relation, modifyFileList));
if(crdn.getDeleteFileKeyList() == null) { if(deleteFileKeyList == null) {
crdn.setDeleteFileKeyList(crdn.getModifyFileKeyList()); deleteFileKeyList = modifyFileKeyList;
} else { } else {
String[] arr1 = crdn.getDeleteFileKeyList(); String[] arr1 = deleteFileKeyList;
String[] arr2 = crdn.getModifyFileKeyList(); String[] arr2 = modifyFileKeyList;
String[] sumArr = Stream.of(arr1, arr2).flatMap(Stream::of).toArray(String[]::new); String[] sumArr = Stream.of(arr1, arr2).flatMap(Stream::of).toArray(String[]::new);
crdn.setDeleteFileKeyList(sumArr); deleteFileKeyList = (sumArr);
} }
} }
} }
crdn.setCvlcptLinkYn("Y"); Map<String, Object> nonQueryRequest = new HashMap<String, Object>();
saved = crdnService.acceptCvlcpt(crdn, newFileInfoList); nonQueryRequest.put("deleteFileKeyList", deleteFileKeyList);
String acceptType = req.getParameter("acceptType");
nonQueryRequest.put("acceptType", acceptType);
saved = crdnCvlcptService.updateCvlcptPrcs(nonQueryRequest, crdn, newFileInfoList);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);
@ -275,7 +288,7 @@ public class Crdn01Controller extends ApplicationController {
@RequestMapping(name="민원내역 원본 한글 파일 생성", value="/050/makeFileFromHwpFormat.do") @RequestMapping(name="민원내역 원본 한글 파일 생성", value="/050/makeFileFromHwpFormat.do")
public ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery, HttpServletRequest request) { public ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery, HttpServletRequest request) {
Map<String,String> result = crdnService.makeFileFromHwpFormat(crdnQuery); Map<String,String> result = crdnCvlcptService.makeFileFromHwpFormat(crdnQuery);
ModelAndView mav = new ModelAndView("jsonView"); ModelAndView mav = new ModelAndView("jsonView");
mav.addAllObjects(result); mav.addAllObjects(result);
return mav; return mav;
@ -294,7 +307,7 @@ public class Crdn01Controller extends ApplicationController {
mav.addObject("taskSeCd", urlTaskSeCd); mav.addObject("taskSeCd", urlTaskSeCd);
req.setTaskSeCd(urlTaskSeCd); req.setTaskSeCd(urlTaskSeCd);
DataObject cvlcptInfo = crdnService.getAnswerPreview(req); DataObject cvlcptInfo = crdnCvlcptService.getAnswerPreview(req);
mav.addObject("cvlcptInfo", json ? cvlcptInfo : toJson(cvlcptInfo)); mav.addObject("cvlcptInfo", json ? cvlcptInfo : toJson(cvlcptInfo));
return mav; return mav;

@ -1,6 +1,7 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -125,7 +126,7 @@ public class Crdn05Controller extends ApplicationController {
* }</code></pre> * }</code></pre>
*/ */
@PostMapping(name="단속자료 수기 등록", value="/030/create.do") @PostMapping(name="단속자료 수기 등록", value="/030/create.do")
public ModelAndView createCrdnDataByManual(Crdn crdn, MultipartFile[] newFileList) { public ModelAndView createCrdnDataByManual(HttpServletRequest req, Crdn crdn, MultipartFile[] newFileList) {
boolean saved = false; boolean saved = false;
crdn.setCrdnRegSeCd("01"); crdn.setCrdnRegSeCd("01");
@ -136,7 +137,11 @@ public class Crdn05Controller extends ApplicationController {
fileInfoList = new FileInfoFactory().makeFileInfos(null, newFileList); fileInfoList = new FileInfoFactory().makeFileInfos(null, newFileList);
} }
saved = crdnService.create(crdn, fileInfoList); Map<String, Object> nonQueryRequest = new HashMap<String, Object>();
nonQueryRequest.put("doGuidance", req.getParameter("doGuidance"));
saved = crdnService.create(nonQueryRequest , crdn, fileInfoList);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")

@ -58,7 +58,7 @@ public class Excl03ServiceBean extends AbstractServiceBean implements Excl03Serv
crdn.setTaskSeCd(infoCrdn.string("TASK_SE_CD")); // 업무 구분 코드 crdn.setTaskSeCd(infoCrdn.string("TASK_SE_CD")); // 업무 구분 코드
crdn.setCrdnRegSeCd("03"); // 단속 등록 구분 코드(FIM026) - 재 등록 crdn.setCrdnRegSeCd("03"); // 단속 등록 구분 코드(FIM026) - 재 등록
crdn.setCrdnInptSeCd(infoCrdn.string("CRDN_INPT_SE_CD")); // 단속 입력 구분 코드 crdn.setCrdnInptSeCd(infoCrdn.string("CRDN_INPT_SE_CD")); // 단속 입력 구분 코드
crdn.setLinkNm(infoCrdn.string("LINK_TBL_NM")); // 연계 테이블 명 crdn.setLinkTblNm(infoCrdn.string("LINK_TBL_NM")); // 연계 테이블 명
crdn.setLinkId(infoCrdn.string("LINK_ID")); // 연계 ID crdn.setLinkId(infoCrdn.string("LINK_ID")); // 연계 ID
crdn.setRtpyrId(infoCrdn.string("RTPYR_ID")); // 납부자 ID crdn.setRtpyrId(infoCrdn.string("RTPYR_ID")); // 납부자 ID
crdn.setCrdnSeCd(infoCrdn.string("CRDN_SE_CD")); // 단속 구분 코드 crdn.setCrdnSeCd(infoCrdn.string("CRDN_SE_CD")); // 단속 구분 코드
@ -105,11 +105,10 @@ public class Excl03ServiceBean extends AbstractServiceBean implements Excl03Serv
crdn.setMinusAmt(0); // 감경 금액 crdn.setMinusAmt(0); // 감경 금액
crdn.setRcvmtAmt(0); // 수납 금액 crdn.setRcvmtAmt(0); // 수납 금액
crdn.setBfrCrdnId(infoCrdn.string("CRDN_ID")); // 이전 단속 ID crdn.setBfrCrdnId(infoCrdn.string("CRDN_ID")); // 이전 단속 ID
crdn.setDoGuidance(""); // 계고 여부
crdn.setDelYn("N"); crdn.setDelYn("N");
// 단속 대장 입력 // 단속 대장 입력
retSuccess = crdnService.create(crdn, null); retSuccess = crdnService.create(null, crdn, null);
if (!retSuccess) { if (!retSuccess) {
// 예외를 발생시켜서 오류메세지를 보내고 DB Rollback // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback
throw new RuntimeException("재부과 등록 중 단속대장 등록에 실패하였습니다."); throw new RuntimeException("재부과 등록 중 단속대장 등록에 실패하였습니다.");

@ -35,13 +35,13 @@ public class Sprt03ServiceBean extends AbstractServiceBean implements Sprt03Serv
CrdnQuery crdnQuery = new CrdnQuery(); CrdnQuery crdnQuery = new CrdnQuery();
crdnQuery.setCrdnId(crdnId); crdnQuery.setCrdnId(crdnId);
DataObject cvlcptInfo = crdnCvlcptMapper.selectCivilComplaintReceiptInitialDataInfo(crdnQuery); DataObject cvlcptInfo = crdnCvlcptMapper.selectCivilComplaintReceiptInitialDataInfo(crdnQuery);
String linkNm = cvlcptInfo.string("LINK_TBL_NM"); String linkTblNm = cvlcptInfo.string("LINK_TBL_NM");
if(!linkNm.equals("")) { if(!linkTblNm.equals("")) {
FileQuery fileQuery = new FileQuery(); FileQuery fileQuery = new FileQuery();
if(linkNm.equals("TB_ESB_INTERFACE")) { if(linkTblNm.equals("TB_ESB_INTERFACE")) {
fileQuery.setInfoType("010"); fileQuery.setInfoType("010");
} else if(linkNm.equals("TB_SAEOL")) { } else if(linkTblNm.equals("TB_SAEOL")) {
fileQuery.setInfoType("020"); fileQuery.setInfoType("020");
} else { } else {
throw new RuntimeException("파일 조회 중 오류가 발생하였습니다."); throw new RuntimeException("파일 조회 중 오류가 발생하였습니다.");

@ -1,5 +1,8 @@
package cokr.xit.fims.task.web; package cokr.xit.fims.task.web;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -59,8 +62,9 @@ public class DpvController {
*/ */
@PostMapping(name = "표지정보 미확인 자료 수정", value = "/030/update.do") @PostMapping(name = "표지정보 미확인 자료 수정", value = "/030/update.do")
public ModelAndView update(Crdn crdn) { public ModelAndView update(Crdn crdn) {
crdn.setUpdateInfomation("tagInformationUndefinedData"); Map<String, Object> nonQueryRequest = new HashMap<String, Object>();
boolean saved = crdnService.update(crdn, null); nonQueryRequest.put("updateInfomation", "tagInformationUndefinedData");
boolean saved = crdnService.update(nonQueryRequest, crdn, null);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);
} }

@ -84,11 +84,11 @@ INSERT INTO TB_CRDN (
, DEL_RSN <!-- 삭제 사유 --> , DEL_RSN <!-- 삭제 사유 -->
) VALUES ( ) VALUES (
#{crdnId} <!-- 단속 ID --> #{crdnId} <!-- 단속 ID -->
, (SELECT SGG_CD FROM TB_SGG_INFO WHERE INST_CD = #{institute}) <!-- 시군구 코드 --> , #{sggCd} <!-- 시군구 코드 -->
, #{crdnRegSeCd} <!-- 단속 등록 구분 코드 --> , #{crdnRegSeCd} <!-- 단속 등록 구분 코드 -->
, #{crdnInptSeCd} <!-- 단속 입력 구분 코드 --> , #{crdnInptSeCd} <!-- 단속 입력 구분 코드 -->
, #{taskSeCd} <!-- 업무 구분 코드 --> , #{taskSeCd} <!-- 업무 구분 코드 -->
, #{linkNm} <!-- 연계 테이블 명 --> , #{linkTblNm} <!-- 연계 테이블 명 -->
, #{linkId} <!-- 연계 ID --> , #{linkId} <!-- 연계 ID -->
, #{rtpyrId} <!-- 납부자 ID --> , #{rtpyrId} <!-- 납부자 ID -->
, #{crdnYmd} <!-- 단속 일자 --> , #{crdnYmd} <!-- 단속 일자 -->
@ -97,13 +97,11 @@ INSERT INTO TB_CRDN (
, #{crdnStdgNm} <!-- 단속 법정동 명 --> , #{crdnStdgNm} <!-- 단속 법정동 명 -->
, #{crdnRoadNm} <!-- 단속 도로 명 --> , #{crdnRoadNm} <!-- 단속 도로 명 -->
, #{crdnPlc} <!-- 단속 장소 --> , #{crdnPlc} <!-- 단속 장소 -->
, (SELECT B.VLTN_ID , (SELECT A.VLTN_ID
FROM TB_SGG_INFO A FROM TB_VLTN_INFO A
INNER JOIN TB_VLTN_INFO B WHERE A.SGG_CD = #{sggCd}
WHERE A.SGG_CD = B.SGG_CD AND A.TASK_SE_CD = #{taskSeCd}
AND A.INST_CD = #{institute} AND A.VLTN_CD = #{vltnCd}) <!-- 위반 ID -->
AND B.TASK_SE_CD = #{taskSeCd}
AND B.VLTN_CD = #{vltnCd}) <!-- 위반 ID -->
, #{gpsX} <!-- GPS X --> , #{gpsX} <!-- GPS X -->
, #{gpsY} <!-- GPS Y --> , #{gpsY} <!-- GPS Y -->
, #{atchFileCnt} <!-- 첨부 파일 수 --> , #{atchFileCnt} <!-- 첨부 파일 수 -->
@ -219,4 +217,9 @@ SELECT AMT
</if> </if>
</select> </select>
<select id="selectSggCd" parameterType="string" resultType="string">
SELECT SGG_CD
FROM TB_SGG_INFO
WHERE INST_CD = #{institute}
</select>
</mapper> </mapper>

@ -477,7 +477,7 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
UPDATE TB_CRDN UPDATE TB_CRDN
SET MDFCN_DT = <include refid="utility.now" /> /* 수정일시 */ SET MDFCN_DT = <include refid="utility.now" /> /* 수정일시 */
, MDFR = #{modifiedBy} /* 수정자 */ , MDFR = #{modifiedBy} /* 수정자 */
, ATCH_FILE_CNT = ATCH_FILE_CNT + (#{fileChgCnt}) , ATCH_FILE_CNT = ATCH_FILE_CNT + (#{changeFileCnt})
, RTPYR_ID = #{rtpyrId} <!-- 납부자 ID --> , RTPYR_ID = #{rtpyrId} <!-- 납부자 ID -->
, CRDN_YMD = #{crdnYmd} <!-- 단속 일자 --> , CRDN_YMD = #{crdnYmd} <!-- 단속 일자 -->
, CRDN_TM = #{crdnTm} <!-- 단속 시각 --> , CRDN_TM = #{crdnTm} <!-- 단속 시각 -->

@ -399,44 +399,44 @@ INSERT INTO TB_CRDN_CVLCPT (
, #{delRsn} <!-- 삭제 사유 --> , #{delRsn} <!-- 삭제 사유 -->
)</insert> )</insert>
<update id="acceptCvlcpt" parameterType="cokr.xit.fims.crdn.CrdnCvlcpt"> <update id="updateCvlcptPrcs" parameterType="cokr.xit.fims.crdn.CrdnCvlcpt">
/* 단속민원 수용(crdnCvlcptMapper.acceptCvlcpt) */ /* 단속민원 처리 수정(crdnCvlcptMapper.updateCvlcptPrcs) */
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 = '01' , CVLCPT_PRCS_CD = #{cvlcptPrcsCd}
, CVLCPT_TRSM_CD = #{cvlcptTrsmCd} , CVLCPT_TRSM_CD = #{cvlcptTrsmCd}
, CVLCPT_PRCS_SUMRY = #{cvlcptPrcsSumry} , CVLCPT_PRCS_SUMRY = #{cvlcptPrcsSumry}
, CVLCPT_PRCS_RSLT_CN = #{cvlcptPrcsRsltCn} , CVLCPT_PRCS_RSLT_CN = #{cvlcptPrcsRsltCn}
, CVLCPT_PRCS_PIC = #{modifiedBy} , CVLCPT_PRCS_PIC = #{modifiedBy}
, MDFCN_DT = <include refid="utility.now" /> /* 수정일시 */ , MDFCN_DT = <include refid="utility.now" /> /* 수정일시 */
, MDFR = #{modifiedBy} /* 수정자 */ , MDFR = #{modifiedBy} /* 수정자 */
WHERE CVLCPT_LINK_ID = #{linkId} /* 연계 ID */ WHERE CVLCPT_LINK_ID = #{cvlcptLinkId} /* 연계 ID */
</update> </update>
<update id="updateCrdn" parameterType="cokr.xit.fims.crdn.Crdn"> <update id="updateCrdn" parameterType="cokr.xit.fims.crdn.Crdn">
/* 단속정보 수정(crdnCvlcptMapper.updateCrdn) */ /* 단속정보 수정(crdnCvlcptMapper.updateCrdn) */
UPDATE TB_CRDN UPDATE TB_CRDN
SET MDFCN_DT = <include refid="utility.now" /> /* 수정일시 */ SET MDFCN_DT = <include refid="utility.now" /> /* 수정일시 */
, MDFR = #{modifiedBy} /* 수정자 */ , MDFR = #{currentUser.modifiedBy} /* 수정자 */
, ATCH_FILE_CNT = ATCH_FILE_CNT + (#{fileChgCnt}) , ATCH_FILE_CNT = ATCH_FILE_CNT + (#{changeFileCnt})
, RTPYR_ID = #{rtpyrId} <!-- 납부자 ID --> , RTPYR_ID = #{crdn.rtpyrId} /* 납부자 ID */
, CRDN_YMD = #{crdnYmd} <!-- 단속 일자 --> , CRDN_YMD = #{crdn.crdnYmd} /* 단속 일자 */
, CRDN_TM = #{crdnTm} <!-- 단속 시각 --> , CRDN_TM = #{crdn.crdnTm} /* 단속 시각 */
, VHRNO = #{vhrno} <!-- 차량번호 --> , VHRNO = #{crdn.vhrno} /* 차량번호 */
, CRDN_STDG_NM = #{crdnStdgNm} <!-- 단속 법정동 명 --> , CRDN_STDG_NM = #{crdn.crdnStdgNm} /* 단속 법정동 명 */
, CRDN_PLC = #{crdnPlc} <!-- 단속 장소 --> , CRDN_PLC = #{crdn.crdnPlc} /* 단속 장소 */
, VLTN_ID = #{vltnId} <!-- 위반 ID --> , VLTN_ID = #{crdn.vltnId} /* 위반 ID */
, VIN = #{vin} <!-- 차대번호 --> , VIN = #{crdn.vin} /* 차대번호 */
, VHCL_NM = #{vhclNm} <!-- 차량 명 --> , VHCL_NM = #{crdn.vhclNm} /* 차량 명 */
, VHCL_COLOR = #{vhclColor} <!-- 차량 색상 --> , VHCL_COLOR = #{crdn.vhclColor} /* 차량 색상 */
, ETC_CN = #{etcCn} <!-- 기타 내용 --> , ETC_CN = #{crdn.etcCn} /* 기타 내용 */
, FFNLG_AMT = #{ffnlgAmt} <!-- 과태료 금액 --> , FFNLG_AMT = #{crdn.ffnlgAmt} /* 과태료 금액 */
, LEVY_AMT = #{levyAmt} <!-- 부과 금액 --> , LEVY_AMT = #{crdn.levyAmt} /* 부과 금액 */
, FFNLG_RDUCT_RT = #{ffnlgRductRt} <!-- 과태료 감경 율 --> , FFNLG_RDUCT_RT = #{crdn.ffnlgRductRt} /* 과태료 감경 율 */
, ADVNTCE_LEVY_AMT = #{advntceLevyAmt} <!-- 사전통지 부과 금액 --> , ADVNTCE_LEVY_AMT = #{crdn.advntceLevyAmt} /* 사전통지 부과 금액 */
<if test="crdnSttsCd != ''"> <if test="crdnSttsCd != ''">
, CRDN_STTS_CD = #{crdnSttsCd} <!-- 단속 상태 코드 --> , CRDN_STTS_CD = #{crdnSttsCd} /* 단속 상태 코드 */
, CRDN_STTS_CHG_DT = <include refid="utility.now" /> <!-- 단속 상태 변경 일시 --> , CRDN_STTS_CHG_DT = <include refid="utility.now" /> /* 단속 상태 변경 일시 */
</if> </if>
WHERE CRDN_ID = #{crdnId} /* 단속 ID */ WHERE CRDN_ID = #{crdnId} /* 단속 ID */
</update> </update>

@ -403,6 +403,8 @@ $(document).ready(function(){
} }
} }
formData.append("acceptType", "accept");
ajax.post({ ajax.post({
url:!create ? $P.crdnControl.urls.update : $P.crdnControl.urls.create, url:!create ? $P.crdnControl.urls.update : $P.crdnControl.urls.create,
data: formData, contentType : false, processData : false, data: formData, contentType : false, processData : false,

Loading…
Cancel
Save