diff --git a/src/main/java/cokr/xit/fims/crdn/Crdn.java b/src/main/java/cokr/xit/fims/crdn/Crdn.java index 68a9d298..bd620bd0 100644 --- a/src/main/java/cokr/xit/fims/crdn/Crdn.java +++ b/src/main/java/cokr/xit/fims/crdn/Crdn.java @@ -12,31 +12,6 @@ import lombok.Setter; public class Crdn extends AbstractEntity { public static String INF_TYPE = "100"; - /** - * 수정할 파일키 목록 - */ - private String[] modifyFileKeyList; - - /** - * 삭제할 파일키 목록 - */ - private String[] deleteFileKeyList; - - /** - * 파일 변경 건수 - */ - private int fileChgCnt; - - /** - * 수정 처리할 정보 - */ - private String updateInfomation; - - /** - * 등록 옵션 - 계도처리 - */ - private String doGuidance; - /** * 단속 ID */ @@ -47,11 +22,6 @@ public class Crdn extends AbstractEntity { */ private String sggCd; - /** - * 기관 - */ - private String institute; - /** * 업무 구분 코드 */ @@ -127,11 +97,6 @@ public class Crdn extends AbstractEntity { */ 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 vltnCd; + } diff --git a/src/main/java/cokr/xit/fims/crdn/dao/Crdn05Mapper.java b/src/main/java/cokr/xit/fims/crdn/dao/Crdn05Mapper.java index 2e371e53..86f608bf 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/Crdn05Mapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/Crdn05Mapper.java @@ -54,4 +54,10 @@ public interface Crdn05Mapper extends AbstractMapper { */ int selectBasicAmt(CrdnQuery query); + String selectSggCd(String institute); + + default String selectSggCdForCurrentUser() { + return selectSggCd(currentUser().getInstitute()); + }; + } diff --git a/src/main/java/cokr/xit/fims/crdn/dao/CrdnCvlcptMapper.java b/src/main/java/cokr/xit/fims/crdn/dao/CrdnCvlcptMapper.java index 1045ccc2..6da97872 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/CrdnCvlcptMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/CrdnCvlcptMapper.java @@ -1,10 +1,10 @@ package cokr.xit.fims.crdn.dao; import java.util.List; +import java.util.Map; 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.CrdnQuery; import cokr.xit.foundation.component.AbstractMapper; @@ -67,16 +67,16 @@ public interface CrdnCvlcptMapper extends AbstractMapper { */ int insertCvlcpt(CrdnCvlcpt cvlcpt); - /** 단속민원을 수용한다. + /** 단속민원 처리 정보를 수정한다. * @param crdn 민원정보 * @return 저장된 정보 수 */ - int acceptCvlcpt(CrdnCvlcpt cvlcpt); + int updateCvlcptPrcs(CrdnCvlcpt cvlcpt); /** 단속정보를 수정한다. - * @param crdn 단속정보 + * @param params 단속정보 수정 파라미터 * @return 저장된 정보 수 */ - int updateCrdn(Crdn crdn); + int updateCrdn(Map params); } diff --git a/src/main/java/cokr/xit/fims/crdn/service/CrdnCvlcptService.java b/src/main/java/cokr/xit/fims/crdn/service/CrdnCvlcptService.java new file mode 100644 index 00000000..0740deab --- /dev/null +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnCvlcptService.java @@ -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 출력 요청 결과 + * + */ + Map makeFileFromHwpFormat(CrdnQuery crdnQuery); + + /** 단속민원 부과요청을 수용한다. + * @param crdn 단속정보, newFileInfoList 업로드 파일 목록 + * @return 저장여부 + */ + boolean updateCvlcptPrcs(Map nonQueryRequest, Crdn crdn, List newFileInfoList); + + +} diff --git a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java index ac359d0d..ad2ee60b 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java @@ -29,34 +29,12 @@ public interface CrdnService { * @param crdn 단속정보, newFileList 업로드 파일 목록 * @return 저장여부 */ - boolean create(Crdn crdn, List newFileInfoList); + boolean create(Map nonQueryRequest, Crdn crdn, List newFileInfoList); /** 단속 자료를 수정한다. - * @param crdn 단속정보, newFileInfoList 업로드 파일 목록 + * @param crdn 단속정보, nonQueryRequest 요청정보, newFileInfoList 업로드 파일 목록 * @return 저장여부 */ - boolean update(Crdn crdn, List newFileInfoList); - - /** 단속민원 부과요청을 수용한다. - * @param crdn 단속정보, newFileInfoList 업로드 파일 목록 - * @return 저장여부 - */ - boolean acceptCvlcpt(Crdn crdn, List newFileInfoList); - - /** 한글 서식 출력물을 생성한다. - * @param crdnQuery 출력 요청 - * @return map 출력 요청 결과 - *
  • filePath: 결과 파일 경로
  • - *
  • fileName: 다운로드 파일명
  • - *
- */ - Map makeFileFromHwpFormat(CrdnQuery crdnQuery); - - DataObject getCivilComplaintOriginalInfo(CrdnQuery req); - - DataObject getAnswerPreview(CrdnQuery req); - - DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery req); - + boolean update(Map nonQueryRequest, Crdn crdn, List newFileInfoList); } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn02Bean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn02Bean.java deleted file mode 100644 index b2418580..00000000 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn02Bean.java +++ /dev/null @@ -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 { - - - -} diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06Bean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06Bean.java index 1afa4dc0..6edf8508 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06Bean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06Bean.java @@ -1,5 +1,7 @@ package cokr.xit.fims.crdn.service.bean; +import java.util.Map; + import javax.annotation.Resource; import org.springframework.stereotype.Component; @@ -24,8 +26,10 @@ public class Crdn06Bean extends AbstractComponent { *
  • 그렇지 않으면 false
  • * */ - public boolean update(Crdn crdn) { - switch (ifEmpty(crdn.getUpdateInfomation(), () -> "")) { + public boolean update(Map nonQueryRequest, Crdn crdn) { + String updateInfomation = (String)nonQueryRequest.get("updateInfomation"); + + switch (ifEmpty(updateInfomation, () -> "")) { case "tagInformationUndefinedData": return crdn06Mapper.updateTagInformation(crdn) == 1 ? true : false; default: diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01Bean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnCvlcptBean.java similarity index 71% rename from src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01Bean.java rename to src/main/java/cokr/xit/fims/crdn/service/bean/CrdnCvlcptBean.java index ea29c025..41eb32a3 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01Bean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnCvlcptBean.java @@ -21,8 +21,8 @@ import cokr.xit.foundation.data.DataObject; /** 민원 관리 Bean * @author leebj */ -@Component("crdn01Bean") -public class Crdn01Bean extends AbstractComponent { +@Component("crdnCvlcptBean") +public class CrdnCvlcptBean extends AbstractComponent { @Resource(name = "crdnCvlcptMapper") private CrdnCvlcptMapper crdnCvlcptMapper; @@ -48,12 +48,18 @@ public class Crdn01Bean extends AbstractComponent { return crdnCvlcptMapper.selectCivilComplaintOriginalInfo(crdnQuery); } - public boolean accept(CrdnCvlcpt cvlcpt) { - return crdnCvlcptMapper.acceptCvlcpt(cvlcpt) == 1 ? true : false; + public boolean updateCvlcptPrcs(CrdnCvlcpt cvlcpt) { + return crdnCvlcptMapper.updateCvlcptPrcs(cvlcpt) == 1 ? true : false; } - public boolean update(Crdn crdn) { - return crdnCvlcptMapper.updateCrdn(crdn) == 1 ? true : false; + public boolean updateCrdn(Map nonQueryRequest, Crdn crdn) { + 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; } } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnCvlcptServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnCvlcptServiceBean.java new file mode 100644 index 00000000..cb00e9b9 --- /dev/null +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnCvlcptServiceBean.java @@ -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 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 strings = new ArrayList(); + strings.add(dataObject.string("CVLCPT_APLCNT_NM")); + FieldFinder.setClickHereText(baseFormatFile, "신청자", strings); + + strings = new ArrayList(); + String cvlcptRcptYmd = dataObject.string("CVLCPT_RCPT_YMD"); + cvlcptRcptYmd = ymdHypenFormat.format(ymdFormat.parse(cvlcptRcptYmd)); + strings.add(cvlcptRcptYmd); + FieldFinder.setClickHereText(baseFormatFile, "접수일자", strings); + + strings = new ArrayList(); + String cvlcptRrcsPrnmntDt = dataObject.string("CVLCPT_PRCS_PRNMNT_DT"); + cvlcptRrcsPrnmntDt = ymdHypenFormat.format(ymdFormat.parse(cvlcptRrcsPrnmntDt)); + strings.add(cvlcptRrcsPrnmntDt); + FieldFinder.setClickHereText(baseFormatFile, "처리기한", strings); + + strings = new ArrayList(); + strings.add(dataObject.string("CVLCPT_RCPT_NO")); + FieldFinder.setClickHereText(baseFormatFile, "접수번호", strings); + + strings = new ArrayList(); + 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 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 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 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 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 nonQueryRequest, Crdn crdn, List 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; + } + +} diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java index c49d0826..cc2b9563 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java @@ -1,30 +1,21 @@ 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.Iterator; 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.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.crdn.Crdn; -import cokr.xit.fims.crdn.CrdnCvlcpt; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.Crdn05Mapper; 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.excl.Excl01; 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.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") public class CrdnServiceBean extends AbstractServiceBean implements CrdnService { @@ -56,11 +41,8 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService @Resource(name="fileBean") private FileBean fileBean; - @Resource(name="crdn01Bean") - protected Crdn01Bean crdn01Bean; - - @Resource(name="crdn02Bean") - protected Crdn02Bean crdn02Bean; + @Resource(name="crdnCvlcptBean") + protected CrdnCvlcptBean crdnCvlcptBean; @Resource(name="crdn05Bean") protected Crdn05Bean crdn05Bean; @@ -151,205 +133,13 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService @Override public boolean remove(String... crdnIDs) { - return crdn01Bean.remove(crdnIDs); - } - - @Override - public DataObject getCivilComplaintOriginalInfo(CrdnQuery req) { - return crdn01Bean.getCivilComplaintOriginalInfo(req); - } - - @Override - public Map 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 strings = new ArrayList(); - strings.add(dataObject.string("CVLCPT_APLCNT_NM")); - FieldFinder.setClickHereText(baseFormatFile, "신청자", strings); - - strings = new ArrayList(); - String cvlcptRcptYmd = dataObject.string("CVLCPT_RCPT_YMD"); - cvlcptRcptYmd = ymdHypenFormat.format(ymdFormat.parse(cvlcptRcptYmd)); - strings.add(cvlcptRcptYmd); - FieldFinder.setClickHereText(baseFormatFile, "접수일자", strings); - - strings = new ArrayList(); - String cvlcptRrcsPrnmntDt = dataObject.string("CVLCPT_PRCS_PRNMNT_DT"); - cvlcptRrcsPrnmntDt = ymdHypenFormat.format(ymdFormat.parse(cvlcptRrcsPrnmntDt)); - strings.add(cvlcptRrcsPrnmntDt); - FieldFinder.setClickHereText(baseFormatFile, "처리기한", strings); - - strings = new ArrayList(); - strings.add(dataObject.string("CVLCPT_RCPT_NO")); - FieldFinder.setClickHereText(baseFormatFile, "접수번호", strings); - - strings = new ArrayList(); - 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 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 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 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 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; + return crdnCvlcptBean.remove(crdnIDs); } - @Override - public boolean acceptCvlcpt(Crdn crdn, List 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 - public boolean create(Crdn crdn, List fileInfoList) { + public boolean create(Map nonQueryRequest, Crdn crdn, List fileInfoList) { if(fileInfoList != null && !fileInfoList.isEmpty()) { crdn.setAtchFileCnt(fileInfoList.size()); @@ -364,14 +154,15 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService crdn.setAdvntceLevyAmt(basicAmt[1]); - - if(ifEmpty(crdn.getDoGuidance(), () -> "").equals("on")) { + if(ifEmpty((String)nonQueryRequest.get("doGuidance"), () -> "").equals("on")) { crdn.setCrdnSttsCd("83"); } else { crdn.setCrdnSttsCd("01"); } - crdn.setInstitute(UserInfo.current().getInstitute()); + + String currentSggCd = crdn05Mapper.selectSggCdForCurrentUser(); + crdn.setSggCd(currentSggCd); boolean result = crdn05Bean.insertCrdn(crdn); SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); @@ -383,7 +174,7 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService if(crdn.getCrdnSttsCd().equals("83")) { // 부과제외(TB_LEVY_EXCL) 대장 등록 Excl01 excl01 = new Excl01(); - excl01.setSggCd(""); // TODO:시군구 + excl01.setSggCd(currentSggCd); excl01.setTaskSeCd(crdn.getTaskSeCd()); excl01.setCrdnId(crdn.getCrdnId()); excl01.setLevyExclYmd(strCurrentDate); @@ -423,8 +214,10 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService } @Override - public boolean update(Crdn crdn, List newFileInfoList) { - return crdn06Bean.update(crdn); + public boolean update(Map nonQueryRequest, Crdn crdn, List newFileInfoList) { + return crdn06Bean.update(nonQueryRequest, crdn); } + + } diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java index f3899537..f0007245 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java @@ -1,6 +1,7 @@ package cokr.xit.fims.crdn.web; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; 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.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; +import cokr.xit.fims.crdn.service.CrdnCvlcptService; import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -32,6 +34,9 @@ public class Crdn01Controller extends ApplicationController { @Resource(name="crdnService") private CrdnService crdnService; + @Resource(name="crdnCvlcptService") + private CrdnCvlcptService crdnCvlcptService; + /** 민원 접수 자료 메인화면을 연다. * @return fims/crdn/crdn01010-main */ @@ -94,7 +99,7 @@ public class Crdn01Controller extends ApplicationController { Map> commonCodes = getCodesOf("FIM039"); mav.addObject("FIM039List", commonCodes.get("FIM039")); - DataObject info = crdnService.getCivilComplaintOriginalInfo(req); + DataObject info = crdnCvlcptService.getCivilComplaintOriginalInfo(req); mav.addObject("cvlcptInfo", json ? info : toJson(info)); return mav; @@ -132,7 +137,7 @@ public class Crdn01Controller extends ApplicationController { String urlTaskSeCd = request.getServletPath().split("/")[1]; mav.addObject("taskSeCd", urlTaskSeCd); - DataObject info = crdnService.getCivilComplaintReceiptInitialDataInfo(req); + DataObject info = crdnCvlcptService.getCivilComplaintReceiptInitialDataInfo(req); mav.addObject("crdnInfo", json ? info : toJson(info)); @@ -234,10 +239,13 @@ public class Crdn01Controller extends ApplicationController { * } */ @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; + String[] deleteFileKeyList = req.getParameterValues("deleteFileKeyList"); + String[] modifyFileKeyList = req.getParameterValues("modifyFileKeyList"); + List newFileInfoList = new ArrayList(); if(newFileList != null || modifyFileList != null) { @@ -251,19 +259,24 @@ public class Crdn01Controller extends ApplicationController { if(modifyFileList != null) { newFileInfoList.addAll(new FileInfoFactory().makeFileInfos(relation, modifyFileList)); - if(crdn.getDeleteFileKeyList() == null) { - crdn.setDeleteFileKeyList(crdn.getModifyFileKeyList()); + if(deleteFileKeyList == null) { + deleteFileKeyList = modifyFileKeyList; } else { - String[] arr1 = crdn.getDeleteFileKeyList(); - String[] arr2 = crdn.getModifyFileKeyList(); + String[] arr1 = deleteFileKeyList; + String[] arr2 = modifyFileKeyList; String[] sumArr = Stream.of(arr1, arr2).flatMap(Stream::of).toArray(String[]::new); - crdn.setDeleteFileKeyList(sumArr); + deleteFileKeyList = (sumArr); } } } - crdn.setCvlcptLinkYn("Y"); - saved = crdnService.acceptCvlcpt(crdn, newFileInfoList); + Map nonQueryRequest = new HashMap(); + nonQueryRequest.put("deleteFileKeyList", deleteFileKeyList); + + String acceptType = req.getParameter("acceptType"); + nonQueryRequest.put("acceptType", acceptType); + saved = crdnCvlcptService.updateCvlcptPrcs(nonQueryRequest, crdn, newFileInfoList); + return new ModelAndView("jsonView") .addObject("saved", saved); @@ -275,7 +288,7 @@ public class Crdn01Controller extends ApplicationController { @RequestMapping(name="민원내역 원본 한글 파일 생성", value="/050/makeFileFromHwpFormat.do") public ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery, HttpServletRequest request) { - Map result = crdnService.makeFileFromHwpFormat(crdnQuery); + Map result = crdnCvlcptService.makeFileFromHwpFormat(crdnQuery); ModelAndView mav = new ModelAndView("jsonView"); mav.addAllObjects(result); return mav; @@ -294,7 +307,7 @@ public class Crdn01Controller extends ApplicationController { mav.addObject("taskSeCd", urlTaskSeCd); req.setTaskSeCd(urlTaskSeCd); - DataObject cvlcptInfo = crdnService.getAnswerPreview(req); + DataObject cvlcptInfo = crdnCvlcptService.getAnswerPreview(req); mav.addObject("cvlcptInfo", json ? cvlcptInfo : toJson(cvlcptInfo)); return mav; diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java index f55f9d71..d6bd45a3 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -1,6 +1,7 @@ package cokr.xit.fims.crdn.web; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -125,7 +126,7 @@ public class Crdn05Controller extends ApplicationController { * } */ @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; crdn.setCrdnRegSeCd("01"); @@ -136,7 +137,11 @@ public class Crdn05Controller extends ApplicationController { fileInfoList = new FileInfoFactory().makeFileInfos(null, newFileList); } - saved = crdnService.create(crdn, fileInfoList); + Map nonQueryRequest = new HashMap(); + + nonQueryRequest.put("doGuidance", req.getParameter("doGuidance")); + + saved = crdnService.create(nonQueryRequest , crdn, fileInfoList); return new ModelAndView("jsonView") diff --git a/src/main/java/cokr/xit/fims/excl/service/bean/Excl03ServiceBean.java b/src/main/java/cokr/xit/fims/excl/service/bean/Excl03ServiceBean.java index 1ae00125..e0d85333 100644 --- a/src/main/java/cokr/xit/fims/excl/service/bean/Excl03ServiceBean.java +++ b/src/main/java/cokr/xit/fims/excl/service/bean/Excl03ServiceBean.java @@ -58,7 +58,7 @@ public class Excl03ServiceBean extends AbstractServiceBean implements Excl03Serv crdn.setTaskSeCd(infoCrdn.string("TASK_SE_CD")); // 업무 구분 코드 crdn.setCrdnRegSeCd("03"); // 단속 등록 구분 코드(FIM026) - 재 등록 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.setRtpyrId(infoCrdn.string("RTPYR_ID")); // 납부자 ID crdn.setCrdnSeCd(infoCrdn.string("CRDN_SE_CD")); // 단속 구분 코드 @@ -105,11 +105,10 @@ public class Excl03ServiceBean extends AbstractServiceBean implements Excl03Serv crdn.setMinusAmt(0); // 감경 금액 crdn.setRcvmtAmt(0); // 수납 금액 crdn.setBfrCrdnId(infoCrdn.string("CRDN_ID")); // 이전 단속 ID - crdn.setDoGuidance(""); // 계고 여부 crdn.setDelYn("N"); // 단속 대장 입력 - retSuccess = crdnService.create(crdn, null); + retSuccess = crdnService.create(null, crdn, null); if (!retSuccess) { // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback throw new RuntimeException("재부과 등록 중 단속대장 등록에 실패하였습니다."); diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt03ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt03ServiceBean.java index e4998bc0..9d3d18de 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt03ServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt03ServiceBean.java @@ -35,13 +35,13 @@ public class Sprt03ServiceBean extends AbstractServiceBean implements Sprt03Serv CrdnQuery crdnQuery = new CrdnQuery(); crdnQuery.setCrdnId(crdnId); DataObject cvlcptInfo = crdnCvlcptMapper.selectCivilComplaintReceiptInitialDataInfo(crdnQuery); - String linkNm = cvlcptInfo.string("LINK_TBL_NM"); - if(!linkNm.equals("")) { + String linkTblNm = cvlcptInfo.string("LINK_TBL_NM"); + if(!linkTblNm.equals("")) { FileQuery fileQuery = new FileQuery(); - if(linkNm.equals("TB_ESB_INTERFACE")) { + if(linkTblNm.equals("TB_ESB_INTERFACE")) { fileQuery.setInfoType("010"); - } else if(linkNm.equals("TB_SAEOL")) { + } else if(linkTblNm.equals("TB_SAEOL")) { fileQuery.setInfoType("020"); } else { throw new RuntimeException("파일 조회 중 오류가 발생하였습니다."); diff --git a/src/main/java/cokr/xit/fims/task/web/DpvController.java b/src/main/java/cokr/xit/fims/task/web/DpvController.java index 1f4791cc..b3170823 100644 --- a/src/main/java/cokr/xit/fims/task/web/DpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/DpvController.java @@ -1,5 +1,8 @@ package cokr.xit.fims.task.web; +import java.util.HashMap; +import java.util.Map; + import javax.annotation.Resource; import org.springframework.stereotype.Controller; @@ -59,8 +62,9 @@ public class DpvController { */ @PostMapping(name = "표지정보 미확인 자료 수정", value = "/030/update.do") public ModelAndView update(Crdn crdn) { - crdn.setUpdateInfomation("tagInformationUndefinedData"); - boolean saved = crdnService.update(crdn, null); + Map nonQueryRequest = new HashMap(); + nonQueryRequest.put("updateInfomation", "tagInformationUndefinedData"); + boolean saved = crdnService.update(nonQueryRequest, crdn, null); return new ModelAndView("jsonView") .addObject("saved", saved); } diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml index 6161159a..d33eb9a5 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml @@ -84,11 +84,11 @@ INSERT INTO TB_CRDN ( , DEL_RSN ) VALUES ( #{crdnId} - , (SELECT SGG_CD FROM TB_SGG_INFO WHERE INST_CD = #{institute}) + , #{sggCd} , #{crdnRegSeCd} , #{crdnInptSeCd} , #{taskSeCd} - , #{linkNm} + , #{linkTblNm} , #{linkId} , #{rtpyrId} , #{crdnYmd} @@ -97,13 +97,11 @@ INSERT INTO TB_CRDN ( , #{crdnStdgNm} , #{crdnRoadNm} , #{crdnPlc} - , (SELECT B.VLTN_ID - FROM TB_SGG_INFO A - INNER JOIN TB_VLTN_INFO B - WHERE A.SGG_CD = B.SGG_CD - AND A.INST_CD = #{institute} - AND B.TASK_SE_CD = #{taskSeCd} - AND B.VLTN_CD = #{vltnCd}) + , (SELECT A.VLTN_ID + FROM TB_VLTN_INFO A + WHERE A.SGG_CD = #{sggCd} + AND A.TASK_SE_CD = #{taskSeCd} + AND A.VLTN_CD = #{vltnCd}) , #{gpsX} , #{gpsY} , #{atchFileCnt} @@ -219,4 +217,9 @@ SELECT AMT + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml index 5d235b86..db3d16b9 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml @@ -477,7 +477,7 @@ SELECT C.CRDN_ID UPDATE TB_CRDN SET MDFCN_DT = /* 수정일시 */ , MDFR = #{modifiedBy} /* 수정자 */ - , ATCH_FILE_CNT = ATCH_FILE_CNT + (#{fileChgCnt}) + , ATCH_FILE_CNT = ATCH_FILE_CNT + (#{changeFileCnt}) , RTPYR_ID = #{rtpyrId} , CRDN_YMD = #{crdnYmd} , CRDN_TM = #{crdnTm} diff --git a/src/main/resources/sql/mapper/fims/crdn/crdnCvlcpt-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdnCvlcpt-mapper.xml index 419f6b4a..44379638 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdnCvlcpt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdnCvlcpt-mapper.xml @@ -399,44 +399,44 @@ INSERT INTO TB_CRDN_CVLCPT ( , #{delRsn} ) - - /* 단속민원 수용(crdnCvlcptMapper.acceptCvlcpt) */ + + /* 단속민원 처리 수정(crdnCvlcptMapper.updateCvlcptPrcs) */ UPDATE TB_CRDN_CVLCPT SET CVLCPT_PRCS_CMPTN_DT = - , CVLCPT_PRCS_CD = '01' - , CVLCPT_TRSM_CD = #{cvlcptTrsmCd} - , CVLCPT_PRCS_SUMRY = #{cvlcptPrcsSumry} - , CVLCPT_PRCS_RSLT_CN = #{cvlcptPrcsRsltCn} - , CVLCPT_PRCS_PIC = #{modifiedBy} - , MDFCN_DT = /* 수정일시 */ - , MDFR = #{modifiedBy} /* 수정자 */ - WHERE CVLCPT_LINK_ID = #{linkId} /* 연계 ID */ + , CVLCPT_PRCS_CD = #{cvlcptPrcsCd} + , CVLCPT_TRSM_CD = #{cvlcptTrsmCd} + , CVLCPT_PRCS_SUMRY = #{cvlcptPrcsSumry} + , CVLCPT_PRCS_RSLT_CN = #{cvlcptPrcsRsltCn} + , CVLCPT_PRCS_PIC = #{modifiedBy} + , MDFCN_DT = /* 수정일시 */ + , MDFR = #{modifiedBy} /* 수정자 */ + WHERE CVLCPT_LINK_ID = #{cvlcptLinkId} /* 연계 ID */ /* 단속정보 수정(crdnCvlcptMapper.updateCrdn) */ UPDATE TB_CRDN SET MDFCN_DT = /* 수정일시 */ - , MDFR = #{modifiedBy} /* 수정자 */ - , ATCH_FILE_CNT = ATCH_FILE_CNT + (#{fileChgCnt}) - , RTPYR_ID = #{rtpyrId} - , CRDN_YMD = #{crdnYmd} - , CRDN_TM = #{crdnTm} - , VHRNO = #{vhrno} - , CRDN_STDG_NM = #{crdnStdgNm} - , CRDN_PLC = #{crdnPlc} - , VLTN_ID = #{vltnId} - , VIN = #{vin} - , VHCL_NM = #{vhclNm} - , VHCL_COLOR = #{vhclColor} - , ETC_CN = #{etcCn} - , FFNLG_AMT = #{ffnlgAmt} - , LEVY_AMT = #{levyAmt} - , FFNLG_RDUCT_RT = #{ffnlgRductRt} - , ADVNTCE_LEVY_AMT = #{advntceLevyAmt} + , MDFR = #{currentUser.modifiedBy} /* 수정자 */ + , ATCH_FILE_CNT = ATCH_FILE_CNT + (#{changeFileCnt}) + , RTPYR_ID = #{crdn.rtpyrId} /* 납부자 ID */ + , CRDN_YMD = #{crdn.crdnYmd} /* 단속 일자 */ + , CRDN_TM = #{crdn.crdnTm} /* 단속 시각 */ + , VHRNO = #{crdn.vhrno} /* 차량번호 */ + , CRDN_STDG_NM = #{crdn.crdnStdgNm} /* 단속 법정동 명 */ + , CRDN_PLC = #{crdn.crdnPlc} /* 단속 장소 */ + , VLTN_ID = #{crdn.vltnId} /* 위반 ID */ + , VIN = #{crdn.vin} /* 차대번호 */ + , VHCL_NM = #{crdn.vhclNm} /* 차량 명 */ + , VHCL_COLOR = #{crdn.vhclColor} /* 차량 색상 */ + , ETC_CN = #{crdn.etcCn} /* 기타 내용 */ + , FFNLG_AMT = #{crdn.ffnlgAmt} /* 과태료 금액 */ + , LEVY_AMT = #{crdn.levyAmt} /* 부과 금액 */ + , FFNLG_RDUCT_RT = #{crdn.ffnlgRductRt} /* 과태료 감경 율 */ + , ADVNTCE_LEVY_AMT = #{crdn.advntceLevyAmt} /* 사전통지 부과 금액 */ - , CRDN_STTS_CD = #{crdnSttsCd} - , CRDN_STTS_CHG_DT = + , CRDN_STTS_CD = #{crdnSttsCd} /* 단속 상태 코드 */ + , CRDN_STTS_CHG_DT = /* 단속 상태 변경 일시 */ WHERE CRDN_ID = #{crdnId} /* 단속 ID */ diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01020-info.jsp index 3f43e53c..70b6c8dd 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01020-info.jsp @@ -403,6 +403,8 @@ $(document).ready(function(){ } } + formData.append("acceptType", "accept"); + ajax.post({ url:!create ? $P.crdnControl.urls.update : $P.crdnControl.urls.create, data: formData, contentType : false, processData : false,