진행보고서, 결과보고서 완료

jiHyung 2022-10-12 10:42:22 +09:00
parent 455410eb65
commit 313b44ace4
13 changed files with 364 additions and 118 deletions

View File

@ -3,6 +3,7 @@ package com.dbnt.faisp.ivsgtMgt.boardInvestigation;
import com.dbnt.faisp.authMgt.service.AuthMgtService; import com.dbnt.faisp.authMgt.service.AuthMgtService;
import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.ArrestType; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.ArrestType;
import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.BoardInvestigation; 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.ivsgtMgt.boardInvestigation.service.BoardInvestigationService;
import com.dbnt.faisp.userInfo.model.UserInfo; import com.dbnt.faisp.userInfo.model.UserInfo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -22,30 +23,30 @@ public class IvsgtController {
private final AuthMgtService authMgtService; private final AuthMgtService authMgtService;
private final BoardInvestigationService boardInvestigationService; private final BoardInvestigationService boardInvestigationService;
@GetMapping("/arrest") @GetMapping("/{ivsgtType}")
public ModelAndView ivsgt(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation) { public ModelAndView arrest(@AuthenticationPrincipal UserInfo loginUser, @PathVariable("ivsgtType") String ivsgtType,BoardInvestigation boardInvestigation) {
ModelAndView mav = new ModelAndView("ivsgt/arrest"); ModelAndView mav = new ModelAndView("ivsgt/ivsgt");
boardInvestigation.setIvsgtType(ivsgtType);
//메뉴권한 확인 //메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth(); String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/"+ivsgtType).get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("boardInvestigationList", boardInvestigationService.selectBoardInvestigationList(boardInvestigation)); mav.addObject("accessAuth", accessAuth);
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
boardInvestigation.setQueryInfo(); boardInvestigation.setQueryInfo();
mav.addObject("boardInvestigationList", boardInvestigationService.selectBoardInvestigationList(boardInvestigation));
boardInvestigation.setContentCnt(boardInvestigationService.selectBoardInvestigationListCnt(boardInvestigation)); boardInvestigation.setContentCnt(boardInvestigationService.selectBoardInvestigationListCnt(boardInvestigation));
boardInvestigation.setPaginationInfo(); boardInvestigation.setPaginationInfo();
mav.addObject("searchParams", boardInvestigation); mav.addObject("searchParams", boardInvestigation);
return mav; return mav;
} }
@GetMapping("/arrestEditModal") @GetMapping("/ivsgtEditModal")
public ModelAndView arrestEditModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ public ModelAndView ivsgtEditModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){
ModelAndView mav = new ModelAndView("ivsgt/arrestEditModal"); ModelAndView mav = new ModelAndView("ivsgt/ivsgtEditModal");
if(boardInvestigation.getIvsgtKey()!=null){ if(boardInvestigation.getIvsgtKey()!=null){
boardInvestigation = boardInvestigationService.selectBoardInvestigation(boardInvestigation.getIvsgtKey()); boardInvestigation = boardInvestigationService.selectBoardInvestigation(boardInvestigation.getIvsgtKey());
System.out.println(boardInvestigation.toString());
}else{ }else{
boardInvestigation.setWrtOrgan(loginUser.getOgCd()); boardInvestigation.setWrtOrgan(loginUser.getOgCd());
boardInvestigation.setWrtNm(loginUser.getUserNm()); boardInvestigation.setWrtNm(loginUser.getUserNm());
@ -55,25 +56,39 @@ public class IvsgtController {
return mav; return mav;
} }
@GetMapping("/arrestViewModal") @GetMapping("/ivsgtViewModal")
public ModelAndView arrestViewModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ public ModelAndView ivsgtViewModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){
ModelAndView mav = new ModelAndView("ivsgt/arrestViewModal"); ModelAndView mav = new ModelAndView("ivsgt/ivsgtViewModal");
boardInvestigation = boardInvestigationService.selectBoardInvestigation(boardInvestigation.getIvsgtKey()); boardInvestigation = boardInvestigationService.selectBoardInvestigation(boardInvestigation.getIvsgtKey());
mav.addObject("boardInvestigation", boardInvestigation); mav.addObject("boardInvestigation", boardInvestigation);
mav.addObject("userSeq",loginUser.getUserSeq()); 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; return mav;
} }
@PostMapping("/saveBoardInvestigation") @PostMapping("/saveBoardInvestigation")
public Integer saveBoardInvestigation(@AuthenticationPrincipal UserInfo loginUser, public Integer saveBoardInvestigation(@AuthenticationPrincipal UserInfo loginUser,
BoardInvestigation boardInvestigation, BoardInvestigation boardInvestigation,
ArrestType arrestType, ArrestType arrestType,
MultipartHttpServletRequest request, RelatedReports relatedReports,
@RequestParam(value = "fileSeq", required = false) List<Integer> deleteFileSeq){ MultipartHttpServletRequest request,
@RequestParam(value = "fileSeq", required = false) List<Integer> deleteFileSeq){
boardInvestigation.setWrtUserSeq(loginUser.getUserSeq()); boardInvestigation.setWrtUserSeq(loginUser.getUserSeq());
boardInvestigation.setMultipartFileList(request.getMultiFileMap().get("uploadFiles")); 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;
}
} }

View File

@ -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.ArrestType;
import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.BoardInvestigation; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.BoardInvestigation;
import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.RelatedReports;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -12,4 +13,5 @@ public interface BoardInvestigationMapper {
Integer selectBoardInvestigationListCnt(BoardInvestigation boardInvestigation); Integer selectBoardInvestigationListCnt(BoardInvestigation boardInvestigation);
String selectHashTags(Integer ivsgtKey); String selectHashTags(Integer ivsgtKey);
ArrestType selectArrestType(Integer ivsgtKey); ArrestType selectArrestType(Integer ivsgtKey);
List<RelatedReports> selectRelatedReportsList(Integer ivsgtKey);
} }

View File

@ -58,6 +58,12 @@ public class BoardInvestigation extends BaseModel {
@Transient @Transient
private ArrestType arrestType; private ArrestType arrestType;
@Transient @Transient
private RelatedReports relatedReports;
@Transient
private List<RelatedReports> relatedReportsList;
@Transient
private Integer arrestTypeKey;
@Transient
private String arrestCd; private String arrestCd;
@Transient @Transient
private String arrestCd2; private String arrestCd2;

View File

@ -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<Integer> relatedReportsKeyList;
@Transient
private List<Integer> childIvsgtKeyList;
@Transient
private List<Integer> deleteKeyList;
@Transient
private String contentTitle;
}

View File

@ -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;
}

View File

@ -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<RelatedReports, Integer> {
@Transactional
@Modifying
@Query("delete from RelatedReports r where r.relatedReportsKey in :idList")
void deleteAllByIdInQuery(@Param("idList") List<Integer> deleteKeyList);
}

View File

@ -6,20 +6,15 @@ import com.dbnt.faisp.config.FileInfo;
import com.dbnt.faisp.fpiMgt.affair.model.HashTag; import com.dbnt.faisp.fpiMgt.affair.model.HashTag;
import com.dbnt.faisp.fpiMgt.affair.repository.HashTagRepository; import com.dbnt.faisp.fpiMgt.affair.repository.HashTagRepository;
import com.dbnt.faisp.ivsgtMgt.boardInvestigation.mapper.BoardInvestigationMapper; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.mapper.BoardInvestigationMapper;
import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.ArrestType; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.*;
import com.dbnt.faisp.ivsgtMgt.boardInvestigation.model.BoardInvestigation; import com.dbnt.faisp.ivsgtMgt.boardInvestigation.repository.*;
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 lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -29,6 +24,7 @@ public class BoardInvestigationService extends BaseService {
private final BoardInvestigationRepository boardInvestigationRepository; private final BoardInvestigationRepository boardInvestigationRepository;
private final IvsgtFileRepository ivsgtFileRepository; private final IvsgtFileRepository ivsgtFileRepository;
private final ArrestTypeRepository arrestTypeRepository; private final ArrestTypeRepository arrestTypeRepository;
private final RelatedReportsRepository relatedReportsRepository;
private final HashTagRepository hashTagRepository; private final HashTagRepository hashTagRepository;
private final HashTagLinkIvsgtRepository hashTagLinkIvsgtRepository; private final HashTagLinkIvsgtRepository hashTagLinkIvsgtRepository;
private final BoardInvestigationMapper boardInvestigationMapper; private final BoardInvestigationMapper boardInvestigationMapper;
@ -47,12 +43,13 @@ public class BoardInvestigationService extends BaseService {
savedBoardInvestigation.setFileList(ivsgtFileRepository.findByIvsgtKey(ivsgtKey)); savedBoardInvestigation.setFileList(ivsgtFileRepository.findByIvsgtKey(ivsgtKey));
savedBoardInvestigation.setHashTags(boardInvestigationMapper.selectHashTags(ivsgtKey)); savedBoardInvestigation.setHashTags(boardInvestigationMapper.selectHashTags(ivsgtKey));
savedBoardInvestigation.setArrestType(boardInvestigationMapper.selectArrestType(ivsgtKey)); savedBoardInvestigation.setArrestType(boardInvestigationMapper.selectArrestType(ivsgtKey));
savedBoardInvestigation.setRelatedReportsList(boardInvestigationMapper.selectRelatedReportsList(ivsgtKey));
} }
return savedBoardInvestigation; return savedBoardInvestigation;
} }
@Transactional @Transactional
public Integer saveBoardInvestigation(BoardInvestigation boardInvestigation, ArrestType arrestType, List<Integer> deleteFileSeq) { public Integer saveBoardInvestigation(BoardInvestigation boardInvestigation, ArrestType arrestType, RelatedReports relatedReports, List<Integer> deleteFileSeq) {
Integer ivsgtKey = boardInvestigationRepository.save(boardInvestigation).getIvsgtKey(); Integer ivsgtKey = boardInvestigationRepository.save(boardInvestigation).getIvsgtKey();
String[] hashTagAry = boardInvestigation.getHashTags().split(" "); String[] hashTagAry = boardInvestigation.getHashTags().split(" ");
if(hashTagAry.length>0){ if(hashTagAry.length>0){
@ -60,8 +57,27 @@ public class BoardInvestigationService extends BaseService {
} }
arrestType.setIvsgtKey(ivsgtKey); arrestType.setIvsgtKey(ivsgtKey);
arrestTypeRepository.save(arrestType); arrestTypeRepository.save(arrestType);
if (relatedReports.getDeleteKeyList() != null) {
relatedReportsRepository.deleteAllByIdInQuery(relatedReports.getDeleteKeyList());
}
if (relatedReports.getChildIvsgtKeyList() != null) {
List<RelatedReports> 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){ if(deleteFileSeq != null && deleteFileSeq.size()>0){
deletePlanFile(ivsgtKey, deleteFileSeq); deletIvsgtFile(ivsgtKey, deleteFileSeq);
} }
if(boardInvestigation.getMultipartFileList()!=null){ if(boardInvestigation.getMultipartFileList()!=null){
saveUploadFiles(ivsgtKey, boardInvestigation.getMultipartFileList()); saveUploadFiles(ivsgtKey, boardInvestigation.getMultipartFileList());
@ -91,7 +107,7 @@ public class BoardInvestigationService extends BaseService {
} }
} }
private void deletePlanFile(Integer ivsgtKey, List<Integer> deleteFileSeq) { private void deletIvsgtFile(Integer ivsgtKey, List<Integer> deleteFileSeq) {
List<IvsgtFile> ivsgtFileList = ivsgtFileRepository.findByIvsgtKey(ivsgtKey); List<IvsgtFile> ivsgtFileList = ivsgtFileRepository.findByIvsgtKey(ivsgtKey);
for(IvsgtFile file: ivsgtFileList){ for(IvsgtFile file: ivsgtFileList){
if(deleteFileSeq.contains(file.getFileSeq())){ if(deleteFileSeq.contains(file.getFileSeq())){

View File

@ -6,6 +6,9 @@
<mapper namespace="com.dbnt.faisp.ivsgtMgt.boardInvestigation.mapper.BoardInvestigationMapper"> <mapper namespace="com.dbnt.faisp.ivsgtMgt.boardInvestigation.mapper.BoardInvestigationMapper">
<sql id="selectBoardInvestigationListWhere"> <sql id="selectBoardInvestigationListWhere">
<where> <where>
<if test='ivsgtType != null and ivsgtType != ""'>
AND ivsgt_type = #{ivsgtType}
</if>
<if test='wrtNm != null and wrtNm != ""'> <if test='wrtNm != null and wrtNm != ""'>
AND a.wrt_nm LIKE '%'||#{wrtNm}||'%' AND a.wrt_nm LIKE '%'||#{wrtNm}||'%'
</if> </if>
@ -26,22 +29,24 @@
</where> </where>
</sql> </sql>
<select id="selectBoardInvestigationList" resultType="BoardInvestigation" parameterType="BoardInvestigation"> <select id="selectBoardInvestigationList" resultType="BoardInvestigation" parameterType="BoardInvestigation">
SELECT a.ivsgt_key, SELECT
a.ivsgt_type, a.ivsgt_key,
a.content_title, a.ivsgt_type,
a.content_info, a.content_title,
a.content_main, a.content_info,
a.content_status, a.content_main,
a.wrt_organ, a.content_status,
a.wrt_user_seq, a.wrt_organ,
a.wrt_nm, a.wrt_user_seq,
a.wrt_dt, a.wrt_nm,
b.fileCnt, a.wrt_dt,
t.arrest_cd, b.fileCnt,
t.arrest_cd2, t.arrest_type_key,
cm.item_value AS arrestCdName, t.arrest_cd,
cm2.item_value AS arrestCd2Name t.arrest_cd2,
FROM board_investigation a cm.item_value AS arrestCdName,
cm2.item_value AS arrestCd2Name
FROM board_investigation a
LEFT OUTER JOIN ( LEFT OUTER JOIN (
SELECT SELECT
ivsgt_key, ivsgt_key,
@ -92,4 +97,16 @@
ON a.arrest_cd2 = cm2.item_cd ON a.arrest_cd2 = cm2.item_cd
WHERE a.ivsgt_key = #{ivsgtKey} WHERE a.ivsgt_key = #{ivsgtKey}
</select> </select>
<select id="selectRelatedReportsList" resultType="RelatedReports" parameterType="int">
SELECT
a.related_reports_key,
a.child_ivsgt_key,
a.parent_ivsgt_key,
i.content_title
FROM related_reports a
INNER JOIN board_investigation i
ON i.ivsgt_key = a.child_ivsgt_key
WHERE a.parent_ivsgt_key = #{ivsgtKey}
</select>
</mapper> </mapper>

View File

@ -1,10 +1,10 @@
$(document).on('click', '#arrestAddBtn', function () { $(document).on('click', '#ivsgtAddBtn', function () {
getArrestEditModal(null); getIvsgtEditModal(null, $("input[name='ivsgtType']").val());
}); });
$(document).on('click', '#arrestEditBtn', function () { $(document).on('click', '#ivsgtEditBtn', function () {
$("#arrestViewModal").modal('hide'); $("#ivsgtViewModal").modal('hide');
getArrestEditModal(Number($("#arrestViewBody").find("[name='ivsgtKey']").val())); getIvsgtEditModal(Number($("#ivsgtViewBody").find("[name='ivsgtKey']").val()));
}); });
@ -12,7 +12,7 @@ $(document).on('click', '#contentInfoAddBtn', function (){
$("#contentInfoDiv").append("<input type='text' class='form-control' name='contentInfos'>") $("#contentInfoDiv").append("<input type='text' class='form-control' name='contentInfos'>")
}); });
$(document).on('click', '#saveArrestBtn', function (){ $(document).on('click', '#saveIvsgtBtn', function (){
saveBoardInvestigation('N') saveBoardInvestigation('N')
}); });
@ -21,9 +21,41 @@ $(document).on('click', '#saveTempBtn', function (){
}); });
$(document).on('click', '.tr', 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(
'<input type="hidden" name="relatedReportsKeyList" value="0">'
+ '<input type="hidden" name="childIvsgtKeyList" value="' + element.value + '">'
+ '<div class="col-auto"><input class="border-0" type="text" name="relatedReportsText" value="' + element.name + '" readonly>'
+ '<button class="btn btn-sm btn-primary col-auto cancel-btn" >X</button></div>'
)
}
});
});
$(document).on('click', '.cancel-btn', function (){
$(this).parent().remove();
let deleteKey = $(this).parent().children("input[name='relatedReportsKeyList']").val();
$("#ivsgtEditForm").append('<input type="hidden" name="deleteKeyList" value="' + deleteKey + '">');
});
$(function(){ $(function(){
$("#dateSelectorDiv").datepicker({ $("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
@ -32,15 +64,15 @@ $(function(){
}); });
function getArrestViewModal(ivsgtKey){ function getIvsgtViewModal(ivsgtKey){
$.ajax({ $.ajax({
url: '/ivsgt/arrestViewModal', url: '/ivsgt/ivsgtViewModal',
data: {ivsgtKey: ivsgtKey}, data: {ivsgtKey: ivsgtKey},
type: 'GET', type: 'GET',
dataType:"html", dataType:"html",
success: function(html){ success: function(html){
$("#arrestViewBody").empty().append(html) $("#ivsgtViewBody").empty().append(html)
$("#arrestViewModal").modal('show'); $("#ivsgtViewModal").modal('show');
}, },
error:function(){ error:function(){
@ -48,15 +80,18 @@ function getArrestViewModal(ivsgtKey){
}); });
} }
function getArrestEditModal(ivsgtKey){ function getIvsgtEditModal(ivsgtKey, ivsgtType){
$.ajax({ $.ajax({
url: '/ivsgt/arrestEditModal', url: '/ivsgt/ivsgtEditModal',
data: {ivsgtKey: ivsgtKey}, data: {
ivsgtKey: ivsgtKey,
ivsgtType: ivsgtType
},
type: 'GET', type: 'GET',
dataType:"html", dataType:"html",
success: function(html){ success: function(html){
$("#arrestEditModalContent").empty().append(html) $("#ivsgtEditModalContent").empty().append(html)
$("#arrestEditModal").modal('show'); $("#ivsgtEditModal").modal('show');
$("[name='contentInfo']").summernote({ $("[name='contentInfo']").summernote({
lang:'ko-KR', lang:'ko-KR',
height: 120, 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){ function saveBoardInvestigation(contentState){
if(contentCheck()){ if(contentCheck()){
if(confirm("저장하시겠습니까?")){ if(confirm("저장하시겠습니까?")){
$("#contentStatus").val(contentState); $("#contentStatus").val(contentState);
contentFade("in"); contentFade("in");
const formData = new FormData($("#arrestEditForm")[0]); const formData = new FormData($("#ivsgtEditForm")[0]);
for(const file of files) { for(const file of files) {
if(!file.isDelete) if(!file.isDelete)
formData.append('uploadFiles', file, file.name); formData.append('uploadFiles', file, file.name);
@ -111,8 +165,8 @@ function saveBoardInvestigation(contentState){
success : function(result) { success : function(result) {
alert("저장되었습니다."); alert("저장되었습니다.");
contentFade("out"); contentFade("out");
$("#arrestEditModal").modal('hide'); $("#ivsgtEditModal").modal('hide');
getArrestViewModal(result); getIvsgtViewModal(result);
}, },
error : function(xhr, status) { error : function(xhr, status) {
alert("저장에 실패하였습니다.") alert("저장에 실패하였습니다.")
@ -137,6 +191,12 @@ function contentCheck(){
alert("검거유형2를 선택해주세요.") alert("검거유형2를 선택해주세요.")
flag = false; flag = false;
} }
else if(!$("#relatedReport").is(':checked')) {
if ($('input[name="relatedReportsText"]').length < 1) {
alert("연관보고서를 확인해 주세요.")
flag = false;
}
}
flag = fileCheck(flag, files); flag = fileCheck(flag, files);
return flag; return flag;

View File

@ -4,7 +4,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}">
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/ivsgt/arrest.js}"></script> <script type="text/javascript" th:src="@{/js/ivsgt/ivsgt.js}"></script>
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main class="pt-3"> <main class="pt-3">
@ -14,9 +14,10 @@
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card"> <div class="col-12 card">
<div class="card-body"> <div class="card-body">
<form method="get" th:action="@{/ivsgt/arrest}"> <form method="get" th:action="@{/ivsgt/{ivsgtType}(ivsgtType = ${searchParams.ivsgtType})}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}"> <input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<input type="hidden" name="dateSelector" value="wrtDt"> <input type="hidden" name="dateSelector" value="wrtDt">
<input type="hidden" name="ivsgtType" th:value="${searchParams.ivsgtType}">
<div class="row justify-content-between pe-3 py-1"> <div class="row justify-content-between pe-3 py-1">
<div class="col-auto"> <div class="col-auto">
<select class="form-select" name="rowCnt" id="rowCnt"> <select class="form-select" name="rowCnt" id="rowCnt">
@ -55,19 +56,19 @@
<!-- 탭 메뉴 --> <!-- 탭 메뉴 -->
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link active" id="arrest-tab" data-bs-toggle="tab" <button class="nav-link ivsgtTab" th:classappend="${searchParams.ivsgtType eq 'arrest'?' active':''}" id="arrest-tab" data-bs-toggle="tab"
data-bs-target="#arrest" type="button" role="tab" aria-controls="arrest" data-bs-target="#arrest" type="button" role="tab" aria-controls="arrest" data-ivsgt-type="arrest"
aria-selected="true">검거보고서</button> aria-selected="true">검거보고서</button>
</li> </li>
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link" id="proceeding-tab" data-bs-toggle="tab" <button class="nav-link ivsgtTab" th:classappend="${searchParams.ivsgtType eq 'proceeding'?' active':''}" id="proceeding-tab" data-bs-toggle="tab"
data-bs-target="#proceeding" type="button" role="tab" data-bs-target="#proceeding" type="button" role="tab" data-ivsgt-type="proceeding"
aria-controls="proceeding" aria-selected="false">진행보고서</button> aria-controls="proceeding">진행보고서</button>
</li> </li>
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link" id="result-tab" data-bs-toggle="tab" <button class="nav-link ivsgtTab" th:classappend="${searchParams.ivsgtType eq 'result'?' active':''}" id="result-tab" data-bs-toggle="tab"
data-bs-target="#result" type="button" role="tab" data-bs-target="#result" type="button" role="tab" data-ivsgt-type="result"
aria-controls="result" aria-selected="false">결과보고서</button> aria-controls="result">결과보고서</button>
</li> </li>
</ul> </ul>
@ -101,7 +102,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<button id="arrestAddBtn">등록</button> <button id="ivsgtAddBtn">등록</button>
</div> </div>
<div class="tab-pane fade" id="proceeding" role="tabpanel" <div class="tab-pane fade" id="proceeding" role="tabpanel"
aria-labelledby="proceeding-tab">진행보고서</div> aria-labelledby="proceeding-tab">진행보고서</div>
@ -141,16 +142,16 @@
</div> </div>
</div> </div>
<div class="modal fade" id="arrestEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="arrestEditModalLabel" aria-hidden="true"> <div class="modal fade" id="ivsgtEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="ivsgtEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable"> <div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="arrestEditModalContent"> <div class="modal-content" id="ivsgtEditModalContent">
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="arrestViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="arrestViewModalLabel" aria-hidden="true"> <div class="modal fade" id="ivsgtViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="ivsgtViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable"> <div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="arrestViewBody"> <div class="modal-content" id="ivsgtViewBody">
</div> </div>
</div> </div>

View File

@ -1,19 +1,39 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"> <html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="planEditModalLabel" th:text="${boardInvestigation.ivsgtKey eq null?'검거보고서 작성':'검거보고서 수정'}"></h5> <th:block th:if="${boardInvestigation.ivsgtKey eq null}">
<th:block th:if="${boardInvestigation.ivsgtType eq 'arrest'}">
<h5 class="modal-title" id="planEditModalLabel">검거보고서 작성</h5>
</th:block>
<th:block th:if="${boardInvestigation.ivsgtType eq 'proceeding'}">
<h5 class="modal-title" id="planEditModalLabel">진행보고서 작성</h5>
</th:block>
<th:block th:if="${boardInvestigation.ivsgtType eq 'result'}">
<h5 class="modal-title" id="planEditModalLabel">결과보고서 작성</h5>
</th:block>
</th:block>
<th:block th:if="${boardInvestigation.ivsgtKey != null}">
<th:block th:if="${boardInvestigation.ivsgtType eq 'arrest'}">
<h5 class="modal-title" id="planEditModalLabel">검거보고서 수정</h5>
</th:block>
<th:block th:if="${boardInvestigation.ivsgtType eq 'proceeding'}">
<h5 class="modal-title" id="planEditModalLabel">진행보고서 수정</h5>
</th:block>
<th:block th:if="${boardInvestigation.ivsgtType eq 'result'}">
<h5 class="modal-title" id="planEditModalLabel">결과보고서 수정</h5>
</th:block>
</th:block>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body" id="arrestEditBody"> <div class="modal-body" id="ivsgtEditBody">
<form action="#" method="post" id="arrestEditForm"> <form action="#" method="post" id="ivsgtEditForm">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/> <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="ivsgtKey" th:value="${boardInvestigation.ivsgtKey}"> <input type="hidden" name="ivsgtKey" th:value="${boardInvestigation.ivsgtKey}">
<input type="hidden" name="ivsgtKey" th:value="${boardInvestigation.wrtNm}">
<input type="hidden" name="ivsgtKey" th:value="${boardInvestigation.wrtDt}">
<input type="hidden" name="wrtOrgan" th:value="${boardInvestigation.wrtOrgan}"> <input type="hidden" name="wrtOrgan" th:value="${boardInvestigation.wrtOrgan}">
<input type="hidden" id="contentStatus" name="contentStatus"> <input type="hidden" id="contentStatus" name="contentStatus">
<input type="hidden" name="ivsgtType" value="arrest"> <input type="hidden" name="ivsgtType" th:value="${boardInvestigation.ivsgtType}">
<input type="hidden" name="arrestTypeKey" th:value="${boardInvestigation.arrestType != null ? boardInvestigation.arrestType.arrestTypeKey: ''}">
<div class="mb-3 row"> <div class="mb-3 row">
<label for="wrtNm" class="col-sm-2 col-form-label text-center">작성자</label> <label for="wrtNm" class="col-sm-2 col-form-label text-center">작성자</label>
<div class="col-sm-2"> <div class="col-sm-2">
@ -87,12 +107,50 @@
</div> </div>
<input type="file" class="d-none" id="fileInputer" multiple> <input type="file" class="d-none" id="fileInputer" multiple>
</div> </div>
<th:block th:if="${boardInvestigation.ivsgtType eq 'proceeding' or boardInvestigation.ivsgtType eq 'result'}">
<div class="row mb-3">
<label for="relatedReportDiv" class="col-sm-2 col-form-label text-center">연관보고서</label>
<div class="col-sm-10" id="relatedReportDiv">
<div class="row justify-content-start">
<div class="col-4">
<input type="text" class="form-control form-control-sm" placeholder="" name="searchTitle">
</div>
<input type="button" class="btn btn-sm btn-primary col-auto" id="relatedReportSearchBtn" value="검색">
<div class="col-auto">
<input type="checkbox" id="relatedReport" th:checked="${#lists.isEmpty(boardInvestigation.relatedReportsList)}">
<label for="relatedReport">연관보고서 없음</label>
</div>
</div>
</div>
</div>
<div class="row mb-3">
<label for="relatedReportDiv" class="col-sm-2 col-form-label text-center"></label>
<div class="col-sm-10 mb-3 row" id="relatedReportSearchDiv">
<th:block th:each="relatedReports:${boardInvestigation.relatedReportsList}">
<div class="col-auto">
<input type="hidden" name="relatedReportsKeyList" th:value="${relatedReports.relatedReportsKey}">
<input type="hidden" name="childIvsgtKeyList" th:value="${relatedReports.childIvsgtKey}">
<input class="border-0" type="text" name="relatedReportsText" th:value="${relatedReports.contentTitle}" readonly>
<button class="btn btn-sm btn-primary col-auto cancel-btn">X</button>
</div>
</th:block>
</div>
</div>
<div class="modal fade" id="searchViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="searchViewModalLabel" aria-hidden="true" style="z-index: 1060; background-color: var(--bs-border-color-translucent);">
<div class="modal-dialog modal-s modal-dialog-scrollable">
<div class="modal-content" id="searchViewBody">
</div>
</div>
</div>
</th:block>
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-warning" id="saveTempBtn">임시저장</button> <button type="button" class="btn btn-warning" id="saveTempBtn">임시저장</button>
<button type="button" class="btn btn-primary" id="saveArrestBtn">저장</button> <button type="button" class="btn btn-primary" id="saveIvsgtBtn">저장</button>
</div> </div>
</html> </html>

View File

@ -1,17 +1,25 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"> <html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="arrestViewModalLabel">검거보고서</h5> <th:block th:if="${boardInvestigation.ivsgtType eq 'arrest'}">
<h5 class="modal-title" id="ivsgtViewModalLabel">검거보고서</h5>
</th:block>
<th:block th:if="${boardInvestigation.ivsgtType eq 'proceeding'}">
<h5 class="modal-title" id="ivsgtViewModalLabel">진행보고서</h5>
</th:block>
<th:block th:if="${boardInvestigation.ivsgtType eq 'result'}">
<h5 class="modal-title" id="ivsgtViewModalLabel">결과보고서</h5>
</th:block>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body" id="arrestViewBody"> <div class="modal-body" id="ivsgtViewBody">
<form action="#" method="post" id="arrestEditForm"> <form action="#" method="post" id="ivsgtEditForm">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/> <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="ivsgtKey" th:value="${boardInvestigation.ivsgtKey}"> <input type="hidden" name="ivsgtKey" th:value="${boardInvestigation.ivsgtKey}">
<input type="hidden" name="wrtOrgan" th:value="${boardInvestigation.wrtOrgan}"> <input type="hidden" name="wrtOrgan" th:value="${boardInvestigation.wrtOrgan}">
<input type="hidden" name="contentState"> <input type="hidden" name="contentState">
<input type="hidden" name="ivsgtType" value="arrest"> <input type="hidden" name="ivsgtType" th:value="${boardInvestigation.ivsgtType}">
<div class="mb-3 row"> <div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label> <label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label>
<div class="col-sm-2"> <div class="col-sm-2">
@ -86,12 +94,26 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<th:block th:if="${boardInvestigation.ivsgtType eq 'proceeding' or boardInvestigation.ivsgtType eq 'result'}">
<div class="row mb-3">
<label for="relatedReportDiv" class="col-sm-2 col-form-label text-center">연관보고서</label>
<div class="col-sm-10" id="relatedReportDiv">
<div class="row justify-content-start">
<th:block th:each="relatedReports:${boardInvestigation.relatedReportsList}">
<div class="col-auto">
<input class="border-0" type="text" name="relatedReportsText" th:value="${relatedReports.contentTitle}" readonly>
</div>
</th:block>
</div>
</div>
</div>
</th:block>
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<th:block th:if="${userSeq eq boardInvestigation.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용--> <th:block th:if="${userSeq eq boardInvestigation.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="arrestEditBtn">수정</button> <button type="button" class="btn btn-warning" id="ivsgtEditBtn">수정</button>
</th:block> </th:block>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div> </div>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="arrestViewModalLabel">검거보고서</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="searchViewBody">
<th:block th:if="${#lists.isEmpty(boardInvestigationList)}">
<div>검색된 보고서가 없습니다.</div>
</th:block>
<div th:each="boardInvestigation:${boardInvestigationList}">
<input type="checkbox" class="reportChk" th:id="'reportChk'+${boardInvestigation.ivsgtKey}" th:name="${boardInvestigation.contentTitle}" th:value="${boardInvestigation.ivsgtKey}">
<label th:for="'reportChk'+${boardInvestigation.ivsgtKey}" th:text="${boardInvestigation.contentTitle}"></label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="completeBtn" data-bs-dismiss="modal">선택완료</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</html>