From 313b44ace4f9f8ad4f5d47bb067c45a949bc6d3a Mon Sep 17 00:00:00 2001 From: jiHyung Date: Wed, 12 Oct 2022 10:42:22 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=84=ED=96=89=EB=B3=B4=EA=B3=A0=EC=84=9C,?= =?UTF-8?q?=20=EA=B2=B0=EA=B3=BC=EB=B3=B4=EA=B3=A0=EC=84=9C=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boardInvestigation/IvsgtController.java | 53 ++++++---- .../mapper/BoardInvestigationMapper.java | 2 + .../model/BoardInvestigation.java | 6 ++ .../model/RelatedReports.java | 38 +++++++ .../boardInvestigation/model/parentIvsgt.java | 26 ----- .../repository/RelatedReportsRepository.java | 17 ++++ .../service/BoardInvestigationService.java | 38 ++++--- .../BoardInvestigationMapper.xml | 49 +++++++--- .../static/js/ivsgt/{arrest.js => ivsgt.js} | 98 +++++++++++++++---- .../ivsgt/{arrest.html => ivsgt.html} | 31 +++--- ...restEditModal.html => ivsgtEditModal.html} | 72 ++++++++++++-- ...restViewModal.html => ivsgtViewModal.html} | 32 +++++- .../templates/ivsgt/searchViewModal.html | 20 ++++ 13 files changed, 364 insertions(+), 118 deletions(-) create mode 100644 src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/RelatedReports.java delete mode 100644 src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/parentIvsgt.java create mode 100644 src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/repository/RelatedReportsRepository.java rename src/main/resources/static/js/ivsgt/{arrest.js => ivsgt.js} (51%) rename src/main/resources/templates/ivsgt/{arrest.html => ivsgt.html} (84%) rename src/main/resources/templates/ivsgt/{arrestEditModal.html => ivsgtEditModal.html} (57%) rename src/main/resources/templates/ivsgt/{arrestViewModal.html => ivsgtViewModal.html} (75%) create mode 100644 src/main/resources/templates/ivsgt/searchViewModal.html diff --git a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/IvsgtController.java b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/IvsgtController.java index ecb158f8..f60cc055 100644 --- a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/IvsgtController.java +++ b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/IvsgtController.java @@ -3,6 +3,7 @@ package com.dbnt.faisp.ivsgtMgt.boardInvestigation; import com.dbnt.faisp.authMgt.service.AuthMgtService; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.ArrestType; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.BoardInvestigation; +import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.RelatedReports; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.service.BoardInvestigationService; import com.dbnt.faisp.userInfo.model.UserInfo; import lombok.RequiredArgsConstructor; @@ -22,30 +23,30 @@ public class IvsgtController { private final AuthMgtService authMgtService; private final BoardInvestigationService boardInvestigationService; - @GetMapping("/arrest") - public ModelAndView ivsgt(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation) { - ModelAndView mav = new ModelAndView("ivsgt/arrest"); + @GetMapping("/{ivsgtType}") + public ModelAndView arrest(@AuthenticationPrincipal UserInfo loginUser, @PathVariable("ivsgtType") String ivsgtType,BoardInvestigation boardInvestigation) { + ModelAndView mav = new ModelAndView("ivsgt/ivsgt"); + boardInvestigation.setIvsgtType(ivsgtType); //메뉴권한 확인 - String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth(); - mav.addObject("accessAuth", accessAuth); + String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/"+ivsgtType).get(0).getAccessAuth(); - mav.addObject("boardInvestigationList", boardInvestigationService.selectBoardInvestigationList(boardInvestigation)); + mav.addObject("accessAuth", accessAuth); mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); boardInvestigation.setQueryInfo(); + mav.addObject("boardInvestigationList", boardInvestigationService.selectBoardInvestigationList(boardInvestigation)); boardInvestigation.setContentCnt(boardInvestigationService.selectBoardInvestigationListCnt(boardInvestigation)); boardInvestigation.setPaginationInfo(); mav.addObject("searchParams", boardInvestigation); return mav; } - @GetMapping("/arrestEditModal") - public ModelAndView arrestEditModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ - ModelAndView mav = new ModelAndView("ivsgt/arrestEditModal"); + @GetMapping("/ivsgtEditModal") + public ModelAndView ivsgtEditModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ + ModelAndView mav = new ModelAndView("ivsgt/ivsgtEditModal"); if(boardInvestigation.getIvsgtKey()!=null){ boardInvestigation = boardInvestigationService.selectBoardInvestigation(boardInvestigation.getIvsgtKey()); - System.out.println(boardInvestigation.toString()); }else{ boardInvestigation.setWrtOrgan(loginUser.getOgCd()); boardInvestigation.setWrtNm(loginUser.getUserNm()); @@ -55,25 +56,39 @@ public class IvsgtController { return mav; } - @GetMapping("/arrestViewModal") - public ModelAndView arrestViewModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ - ModelAndView mav = new ModelAndView("ivsgt/arrestViewModal"); + @GetMapping("/ivsgtViewModal") + public ModelAndView ivsgtViewModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ + ModelAndView mav = new ModelAndView("ivsgt/ivsgtViewModal"); boardInvestigation = boardInvestigationService.selectBoardInvestigation(boardInvestigation.getIvsgtKey()); mav.addObject("boardInvestigation", boardInvestigation); 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/"+boardInvestigation.getIvsgtType()).get(0).getAccessAuth()); return mav; } @PostMapping("/saveBoardInvestigation") public Integer saveBoardInvestigation(@AuthenticationPrincipal UserInfo loginUser, - BoardInvestigation boardInvestigation, - ArrestType arrestType, - MultipartHttpServletRequest request, - @RequestParam(value = "fileSeq", required = false) List deleteFileSeq){ + BoardInvestigation boardInvestigation, + ArrestType arrestType, + RelatedReports relatedReports, + MultipartHttpServletRequest request, + @RequestParam(value = "fileSeq", required = false) List deleteFileSeq){ boardInvestigation.setWrtUserSeq(loginUser.getUserSeq()); boardInvestigation.setMultipartFileList(request.getMultiFileMap().get("uploadFiles")); - return boardInvestigationService.saveBoardInvestigation(boardInvestigation, arrestType, deleteFileSeq); + return boardInvestigationService.saveBoardInvestigation(boardInvestigation, arrestType, relatedReports, deleteFileSeq); } + + @GetMapping("/searchViewModal") + public ModelAndView searchViewModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ + ModelAndView mav = new ModelAndView("ivsgt/searchViewModal"); + mav.addObject("userSeq",loginUser.getUserSeq()); + //메뉴권한 확인 + mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/"+boardInvestigation.getIvsgtType()).get(0).getAccessAuth()); + + boardInvestigation.setIvsgtType(null); + mav.addObject("boardInvestigationList", boardInvestigationService.selectBoardInvestigationList(boardInvestigation)); + return mav; + } + } diff --git a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/mapper/BoardInvestigationMapper.java b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/mapper/BoardInvestigationMapper.java index 2da33b82..db3ee3c1 100644 --- a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/mapper/BoardInvestigationMapper.java +++ b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/mapper/BoardInvestigationMapper.java @@ -2,6 +2,7 @@ package com.dbnt.faisp.ivsgtMgt.boardInvestigation.mapper; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.ArrestType; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.BoardInvestigation; +import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.RelatedReports; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -12,4 +13,5 @@ public interface BoardInvestigationMapper { Integer selectBoardInvestigationListCnt(BoardInvestigation boardInvestigation); String selectHashTags(Integer ivsgtKey); ArrestType selectArrestType(Integer ivsgtKey); + List selectRelatedReportsList(Integer ivsgtKey); } diff --git a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/BoardInvestigation.java b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/BoardInvestigation.java index 698694b3..3954feed 100644 --- a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/BoardInvestigation.java +++ b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/BoardInvestigation.java @@ -58,6 +58,12 @@ public class BoardInvestigation extends BaseModel { @Transient private ArrestType arrestType; @Transient + private RelatedReports relatedReports; + @Transient + private List relatedReportsList; + @Transient + private Integer arrestTypeKey; + @Transient private String arrestCd; @Transient private String arrestCd2; diff --git a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/RelatedReports.java b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/RelatedReports.java new file mode 100644 index 00000000..5e951559 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/RelatedReports.java @@ -0,0 +1,38 @@ +package com.dbnt.faisp.ivsgtMgt.boardInvestigation.model; + +import com.dbnt.faisp.config.BaseModel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.util.List; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "related_reports") +public class RelatedReports extends BaseModel { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "related_reports_key") + private Integer relatedReportsKey; + @Column(name = "parent_ivsgt_key") + private Integer parentIvsgtKey; + @Column(name = "child_ivsgt_key") + private Integer childIvsgtKey; + + @Transient + private List relatedReportsKeyList; + @Transient + private List childIvsgtKeyList; + @Transient + private List deleteKeyList; + @Transient + private String contentTitle; +} diff --git a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/parentIvsgt.java b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/parentIvsgt.java deleted file mode 100644 index 1554ca5c..00000000 --- a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/model/parentIvsgt.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.dbnt.faisp.ivsgtMgt.boardInvestigation.model; - -import com.dbnt.faisp.config.BaseModel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.hibernate.annotations.DynamicInsert; -import org.hibernate.annotations.DynamicUpdate; - -import javax.persistence.*; - -@Getter -@Setter -@Entity -@NoArgsConstructor -@DynamicInsert -@DynamicUpdate -@Table(name = "parent_ivsgt") -public class parentIvsgt extends BaseModel { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "parent_ivsgt") - private Integer parentIvsgt; - @Column(name = "ivsgt_key") - private String ivsgtKey; -} diff --git a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/repository/RelatedReportsRepository.java b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/repository/RelatedReportsRepository.java new file mode 100644 index 00000000..f4f3f0e8 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/repository/RelatedReportsRepository.java @@ -0,0 +1,17 @@ +package com.dbnt.faisp.ivsgtMgt.boardInvestigation.repository; + +import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.RelatedReports; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +public interface RelatedReportsRepository extends JpaRepository { + @Transactional + @Modifying + @Query("delete from RelatedReports r where r.relatedReportsKey in :idList") + void deleteAllByIdInQuery(@Param("idList") List deleteKeyList); +} diff --git a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/service/BoardInvestigationService.java b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/service/BoardInvestigationService.java index ee767bd6..49baeec3 100644 --- a/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/service/BoardInvestigationService.java +++ b/src/main/java/com/dbnt/faisp/ivsgtMgt/boardInvestigation/service/BoardInvestigationService.java @@ -6,20 +6,15 @@ import com.dbnt.faisp.config.FileInfo; import com.dbnt.faisp.fpiMgt.affair.model.HashTag; import com.dbnt.faisp.fpiMgt.affair.repository.HashTagRepository; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.mapper.BoardInvestigationMapper; -import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.ArrestType; -import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.BoardInvestigation; -import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.HashTagLinkIvsgt; -import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.IvsgtFile; -import com.dbnt.faisp.ivsgtMgt.boardInvestigation.repository.ArrestTypeRepository; -import com.dbnt.faisp.ivsgtMgt.boardInvestigation.repository.BoardInvestigationRepository; -import com.dbnt.faisp.ivsgtMgt.boardInvestigation.repository.HashTagLinkIvsgtRepository; -import com.dbnt.faisp.ivsgtMgt.boardInvestigation.repository.IvsgtFileRepository; +import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.*; +import com.dbnt.faisp.ivsgtMgt.boardInvestigation.repository.*; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.File; +import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -29,6 +24,7 @@ public class BoardInvestigationService extends BaseService { private final BoardInvestigationRepository boardInvestigationRepository; private final IvsgtFileRepository ivsgtFileRepository; private final ArrestTypeRepository arrestTypeRepository; + private final RelatedReportsRepository relatedReportsRepository; private final HashTagRepository hashTagRepository; private final HashTagLinkIvsgtRepository hashTagLinkIvsgtRepository; private final BoardInvestigationMapper boardInvestigationMapper; @@ -47,12 +43,13 @@ public class BoardInvestigationService extends BaseService { savedBoardInvestigation.setFileList(ivsgtFileRepository.findByIvsgtKey(ivsgtKey)); savedBoardInvestigation.setHashTags(boardInvestigationMapper.selectHashTags(ivsgtKey)); savedBoardInvestigation.setArrestType(boardInvestigationMapper.selectArrestType(ivsgtKey)); + savedBoardInvestigation.setRelatedReportsList(boardInvestigationMapper.selectRelatedReportsList(ivsgtKey)); } return savedBoardInvestigation; } @Transactional - public Integer saveBoardInvestigation(BoardInvestigation boardInvestigation, ArrestType arrestType, List deleteFileSeq) { + public Integer saveBoardInvestigation(BoardInvestigation boardInvestigation, ArrestType arrestType, RelatedReports relatedReports, List deleteFileSeq) { Integer ivsgtKey = boardInvestigationRepository.save(boardInvestigation).getIvsgtKey(); String[] hashTagAry = boardInvestigation.getHashTags().split(" "); if(hashTagAry.length>0){ @@ -60,8 +57,27 @@ public class BoardInvestigationService extends BaseService { } arrestType.setIvsgtKey(ivsgtKey); arrestTypeRepository.save(arrestType); + + if (relatedReports.getDeleteKeyList() != null) { + relatedReportsRepository.deleteAllByIdInQuery(relatedReports.getDeleteKeyList()); + } + + if (relatedReports.getChildIvsgtKeyList() != null) { + List relatedReportsList = new ArrayList<>(); + for (int i = 0; i < relatedReports.getChildIvsgtKeyList().size(); i++) { + RelatedReports relatedReportsTemp = new RelatedReports(); + if (relatedReports.getRelatedReportsKeyList().get(i) > 0) { + relatedReportsTemp.setRelatedReportsKey(relatedReports.getRelatedReportsKeyList().get(i)); + } + relatedReportsTemp.setChildIvsgtKey(relatedReports.getChildIvsgtKeyList().get(i)); + relatedReportsTemp.setParentIvsgtKey(ivsgtKey); + relatedReportsList.add(relatedReportsTemp); + } + relatedReportsRepository.saveAll(relatedReportsList); + } + if(deleteFileSeq != null && deleteFileSeq.size()>0){ - deletePlanFile(ivsgtKey, deleteFileSeq); + deletIvsgtFile(ivsgtKey, deleteFileSeq); } if(boardInvestigation.getMultipartFileList()!=null){ saveUploadFiles(ivsgtKey, boardInvestigation.getMultipartFileList()); @@ -91,7 +107,7 @@ public class BoardInvestigationService extends BaseService { } } - private void deletePlanFile(Integer ivsgtKey, List deleteFileSeq) { + private void deletIvsgtFile(Integer ivsgtKey, List deleteFileSeq) { List ivsgtFileList = ivsgtFileRepository.findByIvsgtKey(ivsgtKey); for(IvsgtFile file: ivsgtFileList){ if(deleteFileSeq.contains(file.getFileSeq())){ diff --git a/src/main/resources/mybatisMapper/BoardInvestigationMapper.xml b/src/main/resources/mybatisMapper/BoardInvestigationMapper.xml index f572db08..0c5f6c40 100644 --- a/src/main/resources/mybatisMapper/BoardInvestigationMapper.xml +++ b/src/main/resources/mybatisMapper/BoardInvestigationMapper.xml @@ -6,6 +6,9 @@ + + AND ivsgt_type = #{ivsgtType} + AND a.wrt_nm LIKE '%'||#{wrtNm}||'%' @@ -26,22 +29,24 @@ + + \ No newline at end of file diff --git a/src/main/resources/static/js/ivsgt/arrest.js b/src/main/resources/static/js/ivsgt/ivsgt.js similarity index 51% rename from src/main/resources/static/js/ivsgt/arrest.js rename to src/main/resources/static/js/ivsgt/ivsgt.js index c281f441..16bfd37a 100644 --- a/src/main/resources/static/js/ivsgt/arrest.js +++ b/src/main/resources/static/js/ivsgt/ivsgt.js @@ -1,10 +1,10 @@ -$(document).on('click', '#arrestAddBtn', function () { - getArrestEditModal(null); +$(document).on('click', '#ivsgtAddBtn', function () { + getIvsgtEditModal(null, $("input[name='ivsgtType']").val()); }); -$(document).on('click', '#arrestEditBtn', function () { - $("#arrestViewModal").modal('hide'); - getArrestEditModal(Number($("#arrestViewBody").find("[name='ivsgtKey']").val())); +$(document).on('click', '#ivsgtEditBtn', function () { + $("#ivsgtViewModal").modal('hide'); + getIvsgtEditModal(Number($("#ivsgtViewBody").find("[name='ivsgtKey']").val())); }); @@ -12,7 +12,7 @@ $(document).on('click', '#contentInfoAddBtn', function (){ $("#contentInfoDiv").append("") }); -$(document).on('click', '#saveArrestBtn', function (){ +$(document).on('click', '#saveIvsgtBtn', function (){ saveBoardInvestigation('N') }); @@ -21,9 +21,41 @@ $(document).on('click', '#saveTempBtn', function (){ }); $(document).on('click', '.tr', function (){ - getArrestViewModal($(this).data('key')); + getIvsgtViewModal($(this).data('key')); }); +$(document).on('click', '.ivsgtTab', function (){ + location.href = "/ivsgt/"+ $(this).data("ivsgt-type"); +}); + +$(document).on('click', '#relatedReportSearchBtn', function (){ + let contentTitle = $("#ivsgtEditBody").find("[name='searchTitle']").val(); + let ivsgtType = $("#ivsgtEditBody").find("[name='ivsgtType']").val(); + getSearchViewModal(ivsgtType, contentTitle) +}); + +$(document).on('click', '#completeBtn', function (){ + const checkbox = document.getElementsByClassName('reportChk'); + + Array.from(checkbox).forEach(function(element) { + if (element.checked) { + $('#relatedReportSearchDiv').append( + '' + + '' + + '
' + + '
' + ) + } + }); +}); + +$(document).on('click', '.cancel-btn', function (){ + $(this).parent().remove(); + let deleteKey = $(this).parent().children("input[name='relatedReportsKeyList']").val(); + $("#ivsgtEditForm").append(''); +}); + + $(function(){ $("#dateSelectorDiv").datepicker({ format: "yyyy-mm-dd", @@ -32,15 +64,15 @@ $(function(){ }); -function getArrestViewModal(ivsgtKey){ +function getIvsgtViewModal(ivsgtKey){ $.ajax({ - url: '/ivsgt/arrestViewModal', + url: '/ivsgt/ivsgtViewModal', data: {ivsgtKey: ivsgtKey}, type: 'GET', dataType:"html", success: function(html){ - $("#arrestViewBody").empty().append(html) - $("#arrestViewModal").modal('show'); + $("#ivsgtViewBody").empty().append(html) + $("#ivsgtViewModal").modal('show'); }, error:function(){ @@ -48,15 +80,18 @@ function getArrestViewModal(ivsgtKey){ }); } -function getArrestEditModal(ivsgtKey){ +function getIvsgtEditModal(ivsgtKey, ivsgtType){ $.ajax({ - url: '/ivsgt/arrestEditModal', - data: {ivsgtKey: ivsgtKey}, + url: '/ivsgt/ivsgtEditModal', + data: { + ivsgtKey: ivsgtKey, + ivsgtType: ivsgtType + }, type: 'GET', dataType:"html", success: function(html){ - $("#arrestEditModalContent").empty().append(html) - $("#arrestEditModal").modal('show'); + $("#ivsgtEditModalContent").empty().append(html) + $("#ivsgtEditModal").modal('show'); $("[name='contentInfo']").summernote({ lang:'ko-KR', height: 120, @@ -89,12 +124,31 @@ function getArrestEditModal(ivsgtKey){ }); } +function getSearchViewModal(ivsgtType, contentTitle){ + $.ajax({ + url: '/ivsgt/searchViewModal', + data: { + contentTitle: contentTitle, + ivsgtType: ivsgtType + }, + type: 'GET', + dataType:"html", + success: function(html){ + $("#searchViewBody").empty().append(html) + $("#searchViewModal").modal('show'); + }, + error:function(){ + + } + }); +} + function saveBoardInvestigation(contentState){ if(contentCheck()){ if(confirm("저장하시겠습니까?")){ $("#contentStatus").val(contentState); contentFade("in"); - const formData = new FormData($("#arrestEditForm")[0]); + const formData = new FormData($("#ivsgtEditForm")[0]); for(const file of files) { if(!file.isDelete) formData.append('uploadFiles', file, file.name); @@ -111,8 +165,8 @@ function saveBoardInvestigation(contentState){ success : function(result) { alert("저장되었습니다."); contentFade("out"); - $("#arrestEditModal").modal('hide'); - getArrestViewModal(result); + $("#ivsgtEditModal").modal('hide'); + getIvsgtViewModal(result); }, error : function(xhr, status) { alert("저장에 실패하였습니다.") @@ -137,6 +191,12 @@ function contentCheck(){ alert("검거유형2를 선택해주세요.") flag = false; } + else if(!$("#relatedReport").is(':checked')) { + if ($('input[name="relatedReportsText"]').length < 1) { + alert("연관보고서를 확인해 주세요.") + flag = false; + } + } flag = fileCheck(flag, files); return flag; diff --git a/src/main/resources/templates/ivsgt/arrest.html b/src/main/resources/templates/ivsgt/ivsgt.html similarity index 84% rename from src/main/resources/templates/ivsgt/arrest.html rename to src/main/resources/templates/ivsgt/ivsgt.html index 45134b03..6c1691cb 100644 --- a/src/main/resources/templates/ivsgt/arrest.html +++ b/src/main/resources/templates/ivsgt/ivsgt.html @@ -4,7 +4,7 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/layout}"> - +
@@ -14,9 +14,10 @@
-
+ +
- - - + +
@@ -87,12 +107,50 @@
+ +
+ +
+
+
+ +
+ +
+ + +
+
+
+
+
+ +
+ +
+ + + + +
+
+
+
+ + +
\ No newline at end of file diff --git a/src/main/resources/templates/ivsgt/arrestViewModal.html b/src/main/resources/templates/ivsgt/ivsgtViewModal.html similarity index 75% rename from src/main/resources/templates/ivsgt/arrestViewModal.html rename to src/main/resources/templates/ivsgt/ivsgtViewModal.html index d91b3b0d..b88ad83f 100644 --- a/src/main/resources/templates/ivsgt/arrestViewModal.html +++ b/src/main/resources/templates/ivsgt/ivsgtViewModal.html @@ -1,17 +1,25 @@ -