진행보고서, 결과보고서 완료
parent
455410eb65
commit
313b44ace4
|
|
@ -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<Integer> deleteFileSeq){
|
||||
BoardInvestigation boardInvestigation,
|
||||
ArrestType arrestType,
|
||||
RelatedReports relatedReports,
|
||||
MultipartHttpServletRequest request,
|
||||
@RequestParam(value = "fileSeq", required = false) List<Integer> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<RelatedReports> selectRelatedReportsList(Integer ivsgtKey);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,12 @@ public class BoardInvestigation extends BaseModel {
|
|||
@Transient
|
||||
private ArrestType arrestType;
|
||||
@Transient
|
||||
private RelatedReports relatedReports;
|
||||
@Transient
|
||||
private List<RelatedReports> relatedReportsList;
|
||||
@Transient
|
||||
private Integer arrestTypeKey;
|
||||
@Transient
|
||||
private String arrestCd;
|
||||
@Transient
|
||||
private String arrestCd2;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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<Integer> deleteFileSeq) {
|
||||
public Integer saveBoardInvestigation(BoardInvestigation boardInvestigation, ArrestType arrestType, RelatedReports relatedReports, List<Integer> 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<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){
|
||||
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<Integer> deleteFileSeq) {
|
||||
private void deletIvsgtFile(Integer ivsgtKey, List<Integer> deleteFileSeq) {
|
||||
List<IvsgtFile> ivsgtFileList = ivsgtFileRepository.findByIvsgtKey(ivsgtKey);
|
||||
for(IvsgtFile file: ivsgtFileList){
|
||||
if(deleteFileSeq.contains(file.getFileSeq())){
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
<mapper namespace="com.dbnt.faisp.ivsgtMgt.boardInvestigation.mapper.BoardInvestigationMapper">
|
||||
<sql id="selectBoardInvestigationListWhere">
|
||||
<where>
|
||||
<if test='ivsgtType != null and ivsgtType != ""'>
|
||||
AND ivsgt_type = #{ivsgtType}
|
||||
</if>
|
||||
<if test='wrtNm != null and wrtNm != ""'>
|
||||
AND a.wrt_nm LIKE '%'||#{wrtNm}||'%'
|
||||
</if>
|
||||
|
|
@ -26,22 +29,24 @@
|
|||
</where>
|
||||
</sql>
|
||||
<select id="selectBoardInvestigationList" resultType="BoardInvestigation" parameterType="BoardInvestigation">
|
||||
SELECT a.ivsgt_key,
|
||||
a.ivsgt_type,
|
||||
a.content_title,
|
||||
a.content_info,
|
||||
a.content_main,
|
||||
a.content_status,
|
||||
a.wrt_organ,
|
||||
a.wrt_user_seq,
|
||||
a.wrt_nm,
|
||||
a.wrt_dt,
|
||||
b.fileCnt,
|
||||
t.arrest_cd,
|
||||
t.arrest_cd2,
|
||||
cm.item_value AS arrestCdName,
|
||||
cm2.item_value AS arrestCd2Name
|
||||
FROM board_investigation a
|
||||
SELECT
|
||||
a.ivsgt_key,
|
||||
a.ivsgt_type,
|
||||
a.content_title,
|
||||
a.content_info,
|
||||
a.content_main,
|
||||
a.content_status,
|
||||
a.wrt_organ,
|
||||
a.wrt_user_seq,
|
||||
a.wrt_nm,
|
||||
a.wrt_dt,
|
||||
b.fileCnt,
|
||||
t.arrest_type_key,
|
||||
t.arrest_cd,
|
||||
t.arrest_cd2,
|
||||
cm.item_value AS arrestCdName,
|
||||
cm2.item_value AS arrestCd2Name
|
||||
FROM board_investigation a
|
||||
LEFT OUTER JOIN (
|
||||
SELECT
|
||||
ivsgt_key,
|
||||
|
|
@ -92,4 +97,16 @@
|
|||
ON a.arrest_cd2 = cm2.item_cd
|
||||
WHERE a.ivsgt_key = #{ivsgtKey}
|
||||
</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>
|
||||
|
|
@ -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("<input type='text' class='form-control' name='contentInfos'>")
|
||||
});
|
||||
|
||||
$(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(
|
||||
'<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(){
|
||||
$("#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;
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{layout/layout}">
|
||||
<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>
|
||||
<div layout:fragment="content">
|
||||
<main class="pt-3">
|
||||
|
|
@ -14,9 +14,10 @@
|
|||
<div class="row mx-0">
|
||||
<div class="col-12 card">
|
||||
<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="dateSelector" value="wrtDt">
|
||||
<input type="hidden" name="ivsgtType" th:value="${searchParams.ivsgtType}">
|
||||
<div class="row justify-content-between pe-3 py-1">
|
||||
<div class="col-auto">
|
||||
<select class="form-select" name="rowCnt" id="rowCnt">
|
||||
|
|
@ -55,19 +56,19 @@
|
|||
<!-- 탭 메뉴 -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="arrest-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#arrest" type="button" role="tab" aria-controls="arrest"
|
||||
<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-ivsgt-type="arrest"
|
||||
aria-selected="true">검거보고서</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="proceeding-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#proceeding" type="button" role="tab"
|
||||
aria-controls="proceeding" aria-selected="false">진행보고서</button>
|
||||
<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-ivsgt-type="proceeding"
|
||||
aria-controls="proceeding">진행보고서</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="result-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#result" type="button" role="tab"
|
||||
aria-controls="result" aria-selected="false">결과보고서</button>
|
||||
<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-ivsgt-type="result"
|
||||
aria-controls="result">결과보고서</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -101,7 +102,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button id="arrestAddBtn">등록</button>
|
||||
<button id="ivsgtAddBtn">등록</button>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="proceeding" role="tabpanel"
|
||||
aria-labelledby="proceeding-tab">진행보고서</div>
|
||||
|
|
@ -141,16 +142,16 @@
|
|||
</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-content" id="arrestEditModalContent">
|
||||
<div class="modal-content" id="ivsgtEditModalContent">
|
||||
|
||||
</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-content" id="arrestViewBody">
|
||||
<div class="modal-content" id="ivsgtViewBody">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,19 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
<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>
|
||||
</div>
|
||||
<div class="modal-body" id="arrestEditBody">
|
||||
<form action="#" method="post" id="arrestEditForm">
|
||||
<div class="modal-body" id="ivsgtEditBody">
|
||||
<form action="#" method="post" id="ivsgtEditForm">
|
||||
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
|
||||
<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.wrtNm}">
|
||||
<input type="hidden" name="ivsgtKey" th:value="${boardInvestigation.wrtDt}">
|
||||
<input type="hidden" name="wrtOrgan" th:value="${boardInvestigation.wrtOrgan}">
|
||||
<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">
|
||||
<label for="wrtNm" class="col-sm-2 col-form-label text-center">작성자</label>
|
||||
<div class="col-sm-2">
|
||||
|
|
@ -87,12 +107,50 @@
|
|||
</div>
|
||||
<input type="file" class="d-none" id="fileInputer" multiple>
|
||||
</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>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<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-primary" id="saveArrestBtn">저장</button>
|
||||
<button type="button" class="btn btn-primary" id="saveIvsgtBtn">저장</button>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,17 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
<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>
|
||||
</div>
|
||||
<div class="modal-body" id="arrestViewBody">
|
||||
<form action="#" method="post" id="arrestEditForm">
|
||||
<div class="modal-body" id="ivsgtViewBody">
|
||||
<form action="#" method="post" id="ivsgtEditForm">
|
||||
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
||||
<input type="hidden" name="ivsgtKey" th:value="${boardInvestigation.ivsgtKey}">
|
||||
<input type="hidden" name="wrtOrgan" th:value="${boardInvestigation.wrtOrgan}">
|
||||
<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">
|
||||
<label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label>
|
||||
<div class="col-sm-2">
|
||||
|
|
@ -86,12 +94,26 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<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>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
</div>
|
||||
|
|
@ -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>
|
||||
Loading…
Reference in New Issue