diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java index 4c27209a..b830554e 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java @@ -51,7 +51,6 @@ public class IvsgtController { if(investigationBoard.getIvsgtKey()!=null){ investigationBoard = ivsgtService.selectBoardInvestigation(investigationBoard.getIvsgtKey()); }else{ - investigationBoard.setWrtOrgan(loginUser.getOgCd()); investigationBoard.setWrtPart(loginUser.getOfcCd()); investigationBoard.setWrtUserSeq(loginUser.getUserSeq()); @@ -70,7 +69,7 @@ public class IvsgtController { mav.addObject("investigation", investigationBoard); mav.addObject("userSeq",loginUser.getUserSeq()); //메뉴권한 확인 - mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth()); + mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrestReport").get(0).getAccessAuth()); return mav; } @@ -89,12 +88,13 @@ public class IvsgtController { public ModelAndView searchViewModal(@AuthenticationPrincipal UserInfo loginUser, InvestigationBoard investigationBoard){ ModelAndView mav = new ModelAndView("ivsgt/searchViewModal"); mav.addObject("userSeq",loginUser.getUserSeq()); - //메뉴권한 확인 - mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth()); investigationBoard.setFirstIndex(0); - investigationBoard.setRowCnt(Integer.MAX_VALUE); + investigationBoard.setQueryInfo(); investigationBoard.setWrtUserSeq(loginUser.getUserSeq()); - mav.addObject("boardInvestigationList", ivsgtService.selectBoardInvestigationList(investigationBoard)); + mav.addObject("investigationList", ivsgtService.selectBoardInvestigationList(investigationBoard)); + investigationBoard.setContentCnt(ivsgtService.selectBoardInvestigationListCnt(investigationBoard)); + investigationBoard.setPaginationInfo(); + mav.addObject("searchParams", investigationBoard); return mav; } diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationRelatedReports.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationRelatedReports.java index 0895ee58..f83b264b 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationRelatedReports.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationRelatedReports.java @@ -3,9 +3,11 @@ package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model; import lombok.*; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; +import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.*; import java.io.Serializable; +import java.time.LocalDateTime; import java.util.List; @Getter @@ -22,8 +24,20 @@ public class InvestigationRelatedReports{ @Column(name = "parent_ivsgt_key") private Integer parentIvsgtKey; @Id - @Column(name = "related_reports_key") - private Integer childReportsKey; + @Column(name = "related_report_key") + private Integer relatedReportKey; + + @Transient + private String ivsgtType; + @Transient + private String title; + @Transient + private String arrestCd; + @Transient + private String arrestCd2; + @Transient + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime wrtDt; @Embeddable @@ -32,6 +46,6 @@ public class InvestigationRelatedReports{ @AllArgsConstructor public static class InvestigationRelatedReportsId implements Serializable { private Integer parentIvsgtKey; - private Integer childReportsKey; + private Integer relatedReportKey; } } diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/IvsgtService.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/IvsgtService.java index 77f48456..2ddefac9 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/IvsgtService.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/IvsgtService.java @@ -56,6 +56,9 @@ public class IvsgtService extends BaseService { } if(investigationBoard.getRelatedReportsList() != null && investigationBoard.getRelatedReportsList().size()>0){ ivsgtRelatedReportsRepository.deleteByParentIvsgtKey(ivsgtKey); + for(InvestigationRelatedReports report: investigationBoard.getRelatedReportsList()){ + report.setParentIvsgtKey(ivsgtKey); + } ivsgtRelatedReportsRepository.saveAll(investigationBoard.getRelatedReportsList()); } if(investigationBoard.getMultipartFileList()!=null){ diff --git a/src/main/resources/application-was1.properties b/src/main/resources/application-was1.properties index 6e20a51a..cfd37df1 100644 --- a/src/main/resources/application-was1.properties +++ b/src/main/resources/application-was1.properties @@ -14,7 +14,7 @@ spring.servlet.multipart.max-file-size=200MB spring.servlet.multipart.max-request-size=500MB site.domain=10.187.58.12 -clipReport.print.url=http://118.219.150.34:50570/ClipReport5 +clipReport.print.url=http://10.187.58.47:8085/ClipReport5 #file file.dir.publicBoard=/publicBoard diff --git a/src/main/resources/application-was2.properties b/src/main/resources/application-was2.properties index 60302373..f2013b71 100644 --- a/src/main/resources/application-was2.properties +++ b/src/main/resources/application-was2.properties @@ -14,7 +14,7 @@ spring.servlet.multipart.max-file-size=200MB spring.servlet.multipart.max-request-size=500MB site.domain=10.187.58.12 -clipReport.print.url=http://118.219.150.34:50570/ClipReport5 +clipReport.print.url=http://10.187.58.48:8085/ClipReport5 #file file.dir.publicBoard=/publicBoard diff --git a/src/main/resources/mybatisMapper/InvestigationBoardMapper.xml b/src/main/resources/mybatisMapper/InvestigationBoardMapper.xml index 42cb8f69..64852f85 100644 --- a/src/main/resources/mybatisMapper/InvestigationBoardMapper.xml +++ b/src/main/resources/mybatisMapper/InvestigationBoardMapper.xml @@ -98,14 +98,16 @@ \ No newline at end of file diff --git a/src/main/resources/static/js/ivsgt/ivsgt.js b/src/main/resources/static/js/ivsgt/ivsgt.js index 12e77fcc..62d6e969 100644 --- a/src/main/resources/static/js/ivsgt/ivsgt.js +++ b/src/main/resources/static/js/ivsgt/ivsgt.js @@ -30,29 +30,24 @@ $(document).on('click', '#relatedReportSearchBtn', function (){ }); $(document).on('click', '#completeBtn', function (){ - const checkbox = document.getElementsByClassName('reportChk'); - - Array.from(checkbox).forEach(function(element) { - if (element.checked) { - $('#relatedReportSearchDiv').append( - '
' + - ' '+ - ' '+ - ' '+ - '
' + - ' '+ - ' ' + - '
' + - '
' - ) - } - }); + $.each($('.reportChk:checked'), function (idx, chkBox){ + const tr = $(chkBox).parents('tr'); + $('#relatedReportTbody').append( + '' + + ' '+ + ' '+tr.find('.ivsgtType')[0].innerText+'' + + ' '+tr.find('.title')[0].innerText+'' + + ' '+tr.find('.arrestCd')[0].innerText+'' + + ' '+tr.find('.arrestCd2')[0].innerText+'' + + ' '+tr.find('.wrtDt')[0].innerText+'' + + ' '+ + '' + ) + }) }); -$(document).on('click', '.cancel-btn', function (){ - $(this).parent().remove(); - let deleteKey = $(this).parent().children("input[name='relatedReportsKeyList']").val(); - $("#ivsgtEditForm").append(''); +$(document).on('click', '.deleteRelationBtn', function (){ + $(this).parents('tr').remove(); }); $(document).on('change', '#arrestCd', function (){ @@ -139,6 +134,9 @@ function saveBoardInvestigation(state){ formData.append('fileSeq', $(el).attr("data-fileseq")); }) formData.append('content', CrossEditor.GetBodyValue()); + $.each($("#relatedReportTbody").find('.ivsgtKey'), function (idx, ivsgtKey){ + formData.append('relatedReportsList['+idx+'].relatedReportKey', $(ivsgtKey).val()); + }) $.ajax({ type : 'POST', data : formData, @@ -175,13 +173,6 @@ function contentCheck(){ alert("위반유형을 선택해주세요.") flag = false; } - else if(!$("#relatedReport").is(':checked') && $("input[name='ivsgtType']").val() != "arrest") { - if ($('input[name="relatedReportsText"]').length < 1) { - alert("연관보고서를 확인해 주세요.") - flag = false; - } - } - flag = fileCheck(flag, files); return flag; } \ No newline at end of file diff --git a/src/main/resources/templates/ivsgt/ivsgt.html b/src/main/resources/templates/ivsgt/ivsgt.html index d9897934..46da078f 100644 --- a/src/main/resources/templates/ivsgt/ivsgt.html +++ b/src/main/resources/templates/ivsgt/ivsgt.html @@ -209,9 +209,18 @@ \ No newline at end of file