강석 최 2023-01-06 14:56:55 +09:00
commit 857af5419a
15 changed files with 198 additions and 176 deletions

View File

@ -48,6 +48,8 @@ public class BaseService {
protected String ciaEduPath; protected String ciaEduPath;
@Value("${file.dir.activityCase}") @Value("${file.dir.activityCase}")
protected String activityCasePath; protected String activityCasePath;
@Value("${file.dir.majorStatus}")
protected String majorStatusPath;
protected String calculationSize(double fileSize){ protected String calculationSize(double fileSize){
String[] units = {"bytes", "KB", "MB", "GB", "TB", "PB"}; String[] units = {"bytes", "KB", "MB", "GB", "TB", "PB"};

View File

@ -9,6 +9,7 @@ import com.dbnt.faisp.main.fpiMgt.affairPlan.service.PlanService;
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService; import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
import com.dbnt.faisp.main.fpiMgt.sri.service.SriService; import com.dbnt.faisp.main.fpiMgt.sri.service.SriService;
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService; import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.service.MajorStatusService;
import com.dbnt.faisp.main.publicBoard.service.PublicBoardService; import com.dbnt.faisp.main.publicBoard.service.PublicBoardService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -44,6 +45,7 @@ public class FileController extends BaseService{
private final FishingBoatService fishingBoatService; private final FishingBoatService fishingBoatService;
private final SriService sriService; private final SriService sriService;
private final CounterIntelligenceService ciService; private final CounterIntelligenceService ciService;
private final MajorStatusService majorStatusService;
@GetMapping("/editorFileDisplay") @GetMapping("/editorFileDisplay")
public ResponseEntity<Resource> editorFileDisplay(HttpServletRequest request, public ResponseEntity<Resource> editorFileDisplay(HttpServletRequest request,
@ -143,6 +145,9 @@ public class FileController extends BaseService{
case "ciWork": case "ciWork":
downloadFile = ciService.selectCiWorkFile(parentKey, fileSeq); downloadFile = ciService.selectCiWorkFile(parentKey, fileSeq);
break; break;
case "MajorFile" :
downloadFile = majorStatusService.selectMajorFile(parentKey, fileSeq);
break;
} }
return downloadFile; return downloadFile;
} }

View File

@ -106,6 +106,7 @@ public class BoardInvestigationService extends BaseService {
} }
} }
private void deletIvsgtFile(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){

View File

@ -3,7 +3,9 @@ package com.dbnt.faisp.main.ivsgtMgt.majorStatus;
import com.dbnt.faisp.main.authMgt.service.AuthMgtService; import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
import com.dbnt.faisp.main.equip.model.Equip;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorStatusRepository;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.service.MajorStatusService; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.service.MajorStatusService;
import com.dbnt.faisp.main.userInfo.model.UserInfo; import com.dbnt.faisp.main.userInfo.model.UserInfo;
@ -50,23 +52,33 @@ public class MajorStatusController {
majorStatus = majorStatusService.selectMajor(majorStatus.getMajorKey()); majorStatus = majorStatusService.selectMajor(majorStatus.getMajorKey());
}else{ }else{
majorStatus.setWrtOrgan(loginUser.getOgCd()); majorStatus.setWrtOrgan(loginUser.getOgCd());
majorStatus.setWrtPart(loginUser.getOfcCd());
majorStatus.setWrtUserSeq(loginUser.getUserSeq());
majorStatus.setWrtUserGrd(loginUser.getTitleCd());
majorStatus.setWrtUserNm(loginUser.getUserNm()); majorStatus.setWrtUserNm(loginUser.getUserNm());
majorStatus.setWrtDt(LocalDateTime.now()); majorStatus.setWrtDt(loginUser.getWrtDt());
majorStatus.setWrtDt(loginUser.getWrtDt());
} }
mav.addObject("majorStatus", majorStatus); mav.addObject("majorStatus", majorStatus);
mav.addObject("userSeq", loginUser.getUserSeq());
return mav; return mav;
} }
@GetMapping("/majorViewModal") @GetMapping("/majorViewModal")
public ModelAndView majorViewModal(@AuthenticationPrincipal UserInfo loginUser,MajorStatus majorStatus){ public ModelAndView majorViewModal(@AuthenticationPrincipal UserInfo loginUser,MajorStatus majorStatus){
ModelAndView mav = null;
mav = new ModelAndView("ivsgt/majorStatus/majorStatusViewModal"); ModelAndView mav = new ModelAndView("ivsgt/majorStatus/majorStatusViewModal");
majorStatus = majorStatusService.selectMajor(majorStatus.getMajorKey());
mav.addObject("userSeq", loginUser.getUserSeq()); mav.addObject("userSeq", loginUser.getUserSeq());
mav.addObject("major", majorStatus); mav.addObject("majorStatus", majorStatus);
//메뉴권한 확인
// mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/"+majorStatus.getMajorType()).get(0).getAccessAuth());
return mav; return mav;
} }
@ -79,5 +91,12 @@ public class MajorStatusController {
} }
@PostMapping("/deleteContent")
@ResponseBody
public void deleteContent(@AuthenticationPrincipal UserInfo loginUser, @RequestBody List<MajorStatus> majorStatuses){
majorStatusService.deleteContent(majorStatuses,loginUser);
}
} }

View File

@ -14,7 +14,7 @@ import java.io.Serializable;
@NoArgsConstructor @NoArgsConstructor
@DynamicInsert @DynamicInsert
@DynamicUpdate @DynamicUpdate
@Table(name = "major_file") @Table(name = "major_status_file")
@IdClass(MajorFile.MajorFileId.class) @IdClass(MajorFile.MajorFileId.class)
public class MajorFile extends FileInfo { public class MajorFile extends FileInfo {
@Id @Id

View File

@ -4,4 +4,6 @@ import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface MajorStatusRepository extends JpaRepository<MajorStatus, Integer> { public interface MajorStatusRepository extends JpaRepository<MajorStatus, Integer> {
void deleteByMajorKey(Integer majorKey);
} }

View File

@ -3,17 +3,24 @@ package com.dbnt.faisp.main.ivsgtMgt.majorStatus.service;
import com.dbnt.faisp.config.BaseService; import com.dbnt.faisp.config.BaseService;
import com.dbnt.faisp.config.FileInfo; import com.dbnt.faisp.config.FileInfo;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseFile;
import com.dbnt.faisp.main.equip.model.Equip;
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.BoardInvestigation; import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.BoardInvestigation;
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.IvsgtFile;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.mapper.MajorStatusMapper; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.mapper.MajorStatusMapper;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorFile; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorFile;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorFileRepository; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorFileRepository;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorStatusRepository; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorStatusRepository;
import com.dbnt.faisp.main.publicBoard.model.PublicBoard;
import com.dbnt.faisp.main.publicBoard.model.PublicComment;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
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 javax.swing.*;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -35,14 +42,14 @@ public class MajorStatusService extends BaseService {
} }
public MajorStatus selectMajor(Integer majorKey) { public MajorStatus selectMajor(Integer majorKey) {
MajorStatus savedBoardInvestigation = majorStatusRepository.findById(majorKey).orElse(null); MajorStatus majorStatus= majorStatusRepository.findById(majorKey).orElse(null);
if (savedBoardInvestigation != null) { majorStatus.setFileList(majorFileRepository.findByMajorKey(majorKey));
savedBoardInvestigation.setFileList(majorFileRepository.findByMajorKey(majorKey)); // List<PublicComment> commentList = publicCommentRepository.findByPublicKeyAndParentCommentOrderByCommentKeyAsc(publicKey, null);
// for(PublicComment comment: commentList){
// savedBoardInvestigation.setArrestType(majorStatusMapper.selectArrestType(majorKey)); // comment.setChildCommentList(publicCommentRepository.findByPublicKeyAndParentCommentOrderByCommentKeyAsc(publicKey, comment.getCommentKey()));
// savedBoardInvestigation.setRelatedReportsList(majorStatusMapper.selectRelatedReportsList(majorKey)); // }
} // publicBoard.setCommentList(commentList);
return savedBoardInvestigation; return majorStatus;
} }
@Transactional @Transactional
@ -57,27 +64,38 @@ public class MajorStatusService extends BaseService {
return majorKey; return majorKey;
} }
private void saveUploadFiles(Integer majorkey, List<MultipartFile> multipartFileList) { private void saveUploadFiles(Integer majorKey, List<MultipartFile> multipartFileList){
MajorFile lastFileInfo = majorFileRepository.findTopByMajorKeyOrderByFileSeq(majorkey).orElse(null); MajorFile lastFileInfo = majorFileRepository.findTopByMajorKeyOrderByFileSeq(majorKey).orElse(null);
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1); int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
for(MultipartFile file : multipartFileList){ for(MultipartFile file : multipartFileList){
String saveName = UUID.randomUUID().toString(); String saveName = UUID.randomUUID().toString();
String path = locationPath+ File.separator+"major";
saveFile(file, new File(path+File.separator+saveName));
String originalFilename = file.getOriginalFilename(); String originalFilename = file.getOriginalFilename();
int extnIdx = originalFilename.lastIndexOf("."); int extnIdx = originalFilename.lastIndexOf(".");
MajorFile fileInfo = new MajorFile(); MajorFile fileInfo = new MajorFile();
fileInfo.setMajorKey(majorkey); fileInfo.setMajorKey(majorKey);
fileInfo.setFileSeq(fileSeq++); fileInfo.setFileSeq(fileSeq++);
fileInfo.setOrigNm(originalFilename.substring(0, extnIdx)); fileInfo.setOrigNm(originalFilename.substring(0, extnIdx));
fileInfo.setFileExtn(originalFilename.substring(extnIdx+1)); fileInfo.setFileExtn(originalFilename.substring(extnIdx+1));
fileInfo.setConvNm(saveName); fileInfo.setConvNm(saveName);
fileInfo.setFileSize(calculationSize(file.getSize())); fileInfo.setFileSize(calculationSize(file.getSize()));
fileInfo.setSavePath(path);
majorFileRepository.save(fileInfo); majorFileRepository.save(fileInfo);
} }
} }
public void deleteContent(List<MajorStatus> majorStatuses, UserInfo loginUser){
for(MajorStatus majorStatus : majorStatuses){
majorStatusRepository.deleteByMajorKey(majorStatus.getMajorKey());
}
}
private void deleteMajorFile(Integer majorKey, List<Integer> deleteFileSeq) { private void deleteMajorFile(Integer majorKey, List<Integer> deleteFileSeq) {
List<MajorFile> majorFileList = majorFileRepository.findByMajorKey(majorKey); List<MajorFile> majorFileList = majorFileRepository.findByMajorKey(majorKey);
for(MajorFile file: majorFileList){ for(MajorFile file: majorFileList){

View File

@ -26,6 +26,7 @@ file.dir.cia.company=/cia/company
file.dir.cia.foreigner=/cia/foreigner file.dir.cia.foreigner=/cia/foreigner
file.dir.cia.edu=/cia/edu file.dir.cia.edu=/cia/edu
file.dir.activityCase=/activityCase file.dir.activityCase=/activityCase
file.dir.majorStatus=/majorStatus
editor.img.view=/file/editorFileDisplay?fileNm= editor.img.view=/file/editorFileDisplay?fileNm=

View File

@ -26,6 +26,7 @@ file.dir.cia.company=/cia/company
file.dir.cia.foreigner=/cia/foreigner file.dir.cia.foreigner=/cia/foreigner
file.dir.cia.edu=/cia/edu file.dir.cia.edu=/cia/edu
file.dir.activityCase=/activityCase file.dir.activityCase=/activityCase
file.dir.majorStatus=/majorStatus
editor.img.view=/file/editorFileDisplay?fileNm= editor.img.view=/file/editorFileDisplay?fileNm=

View File

@ -25,6 +25,7 @@ file.dir.cia.company=/cia/company
file.dir.cia.foreigner=/cia/foreigner file.dir.cia.foreigner=/cia/foreigner
file.dir.cia.edu=/cia/edu file.dir.cia.edu=/cia/edu
file.dir.activityCase=/activityCase file.dir.activityCase=/activityCase
file.dir.majorStatus=/majorStatus
editor.img.view=/file/editorFileDisplay?fileNm= editor.img.view=/file/editorFileDisplay?fileNm=

View File

@ -14,7 +14,7 @@
and a.wrt_organ = #{wrtOrgan} and a.wrt_organ = #{wrtOrgan}
</if> </if>
<if test="contentTitle != null and contentTitle != ''"> <if test="contentTitle != null and contentTitle != ''">
AND a.content_title LIKE CONCAT('%', #{content_title}, '%') AND a.content_title LIKE CONCAT('%', #{contentTitle}, '%')
</if> </if>
<if test="wrtUserNm != null and wrtUserNm != ''"> <if test="wrtUserNm != null and wrtUserNm != ''">
AND a.wrt_user_nm LIKE CONCAT('%', #{wrtUserNm}, '%') AND a.wrt_user_nm LIKE CONCAT('%', #{wrtUserNm}, '%')
@ -42,13 +42,20 @@
a.content_info, a.content_info,
a.content_status, a.content_status,
a.wrt_user_grd, a.wrt_user_grd,
a.wrt_user_seq,
a.wrt_user_nm, a.wrt_user_nm,
a.wrt_dt, a.wrt_dt,
a.wrt_organ, a.wrt_organ,
wrt_user_seq, a.wrt_part,
wrt_part b.fileCnt
from major_status a from major_status a
left outer join (select major_key,
count(file_seq) as fileCnt
from major_status_file
group by major_key) b
on a.major_key = b.major_key
<include refid="selectMajorListWhere"></include> <include refid="selectMajorListWhere"></include>
order by major_key desc order by major_key desc
limit #{rowCnt} offset #{firstIndex} limit #{rowCnt} offset #{firstIndex}
@ -60,4 +67,6 @@
<include refid="selectMajorListWhere"></include> <include refid="selectMajorListWhere"></include>
</select> </select>
</mapper> </mapper>

View File

@ -1,4 +1,37 @@
$(document).on('click', '#addMajorBtn', function (){
getEditModal(null)
})
$(document).on('click', '.tr', function (){
$(".trChkBox").prop("checked", false);
$(this).find(".trChkBox").prop("checked", true);
getViewModal(Number($(this).find(".majorKey").val()));
})
// $(document).on('click', '.tr', function (event){
// const target = event.target;
// if(!(target.className === "cpChk" ||$(target).parents("td").length>0)){
// const phoneKey = (Number($(this).find(".phoneKey").val()));
// showModal(phoneKey);
// }
// });
$(document).on('click', '#saveBtn', function (){
saveContent("boardEditForm")
})
$(document).on('click', '#editBtn', function (){
$("#MajorViewModal").modal('hide')
getEditModal($(this).attr("data-majorkey"));
})
$(function(){ $(function(){
$("#dateSelectorDiv").datepicker({ $("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
@ -7,89 +40,63 @@ $(function(){
}); });
}) })
// $(document).on('click', '#commentSaveBtn', function (){
// if(!$("#comment").val()) {
// alert("댓글을 입력해주세요.")
// }else{
// if (confirm("등록하시겠습니까?")) { $(document).on('click', '#delectMajorBtn', function (){
// contentFade("in") if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
// const formData = new FormData($("#commentForm")[0]); const checkArr = [];
// $.ajax({ $('input:checkbox[name=equChk]:checked').each(function (idx, el){
// type : 'POST', checkArr.push({});
// data : formData, const target = $(el);
// url : "/publicBoard/saveComment", checkArr[idx].equKey = Number(target.parents('tr').find('.majorKey').val());
// processData: false, })
// contentType: false, deleteMajor(checkArr);
// dataType:"html",
// beforeSend: function (xhr){ }
// xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); })
// },
// success : function(html) { // $(document).on('click', '#deleteEquip', function (){
// const parentComment = $("#parentComment"); // if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
// if(!parentComment.val()){ // const checkArr = [];
// $("#commentDiv").append(html) // checkArr.push({});
// }else{ // checkArr[0].equKey = Number($('#mEquKey').val());
// $("#childComment"+parentComment.val()).append(html); // deleteEquip(checkArr);
// }
// commentFormReset();
// alert("저장되었습니다.");
// contentFade("out");
// },
// error : function(xhr, status) {
// alert("저장에 실패하였습니다.")
// contentFade("out");
// }
// })
// }
// } // }
// }) // })
// $(document).on('click', '.childCommentBtn', function (){ function deleteMajor(checkArr){
// const childCommentFormDiv = $(this).parents(".commentRow").find(".childCommentFormDiv") $.ajax({
// childCommentFormDiv.show(); type : 'POST',
// $("#parentComment").val($(this).parents(".commentRow").find(".commentKey").val()); url : "/ivsgt/deleteContent",
// $("#childFormRemoveBtn").show(); data : JSON.stringify(checkArr),
// childCommentFormDiv.empty().append($("#commentForm")) contentType: 'application/json',
// }) beforeSend: function (xhr){
// $(document).on('click', '#childFormRemoveBtn', function (){ xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
// commentFormReset(); },
// }) success : function() {
// $(document).on('click', '.deleteCommentBtn', function (){ alert("삭제처리 되었습니다.");
// const commentRow = $(this).parents(".commentRow"); location.reload();
// const publicKey = Number(commentRow.find(".publicKey").val()); },
// const commentKey = Number(commentRow.find(".commentKey").val()); error : function(xhr, status) {
// $.ajax({ alert("삭제처리에 실패하였습니다");
// type : 'POST', }
// data : JSON.stringify({publicKey: publicKey, commentKey: commentKey}), })
// url : "/publicBoard/deleteComment", }
// contentType: 'application/json',
// beforeSend: function (xhr){
// xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
// },
// success : function(result) {
// commentRow.remove();
// $("#childComment"+commentKey).remove();
// alert("삭제되었습니다.");
// contentFade("out");
// },
// error : function(xhr, status) {
// alert("삭제를 실패하였습니다.")
// contentFade("out");
// }
// })
// })
function getEditModal(majorKey, majorType){ function getEditModal(majorKey){
$.ajax({ $.ajax({
url: '/ivsgt/majorEditModal', url: '/ivsgt/majorEditModal',
data: {majorKey: majorKey, majorType:majorType}, data: {majorKey: majorKey},
type: 'GET', type: 'GET',
dataType:"html", dataType:"html",
success: function(html){ success: function(html){
$("#editContent").empty().append(html) $("#editContent").empty().append(html);
setUploadDiv(); setUploadDiv();
setEditor('editor', '570'); setEditor('editor', '570');
$("#majorEditModal").modal('show'); $("#MajorEditModal").modal('show');
}, },
error:function(){ error:function(){
@ -97,15 +104,15 @@ function getEditModal(majorKey, majorType){
}); });
} }
function getViewModal(majorKey, majorType){ function getViewModal(majorKey){
$.ajax({ $.ajax({
url: '/ivsgt/majorViewModal', url: '/ivsgt/majorViewModal',
data: {majorKey: majorKey, majorType: majorType}, data: {majorKey: majorKey},
type: 'GET', type: 'GET',
dataType:"html", dataType:"html",
success: function(html){ success: function(html){
$("#viewContent").empty().append(html) $("#viewContent").empty().append(html)
$("#majorViewModal").modal('show'); $("#MajorViewModal").modal('show');
}, },
error:function(){ error:function(){
@ -126,7 +133,7 @@ function saveContent(formId, majorType){
$(".text-decoration-line-through").each(function (idx, el){ $(".text-decoration-line-through").each(function (idx, el){
formData.append('fileSeq', $(el).attr("data-fileseq")); formData.append('fileSeq', $(el).attr("data-fileseq"));
}) })
formData.append('content', CrossEditor.GetBodyValue()); formData.append('contentInfo', CrossEditor.GetBodyValue());
$.ajax({ $.ajax({
type : 'POST', type : 'POST',
data : formData, data : formData,
@ -136,8 +143,8 @@ function saveContent(formId, majorType){
success : function(result) { success : function(result) {
alert("저장되었습니다."); alert("저장되었습니다.");
contentFade("out"); contentFade("out");
$("#editModal").modal('hide'); $("#MajorEditModal").modal('hide');
getViewModal(result, majorType); getViewModal(result);
}, },
error : function(xhr, status) { error : function(xhr, status) {
alert("저장에 실패하였습니다.") alert("저장에 실패하였습니다.")
@ -150,16 +157,11 @@ function saveContent(formId, majorType){
function contentCheck(formId){ function contentCheck(formId){
let flag = true; let flag = true;
if(!$("#title").val()){ if(!$("#contentTitle").val()){
alert("제목을 입력해주세요.") alert("제목을 입력해주세요.")
flag = false; flag = false;
} }
if($("#majorType").val()==="PLB003"){
if(!$("#tabStatus").val()){
alert("분류를 선택해주세요.")
flag = false;
}
}
flag = fileCheck(flag, files); flag = fileCheck(flag, files);
return flag; return flag;
} }
@ -174,23 +176,3 @@ function commentFormReset(){
$(document).on('click', '#addMajorBtn', function (){
getEditModal(null)
})
$(document).on('click', '.planTr', function (){
$(".trChkBox").prop("checked", false);
$(this).find(".trChkBox").prop("checked", true);
getViewModal(Number($(this).find(".planKey").val()));
})
$(document).on('click', '#saveBtn', function (){
savePublicBoard("boardEditForm")
})
$(document).on('click', '#editBtn', function (){
$("#MajorStatusViewModal").modal('hide')
getEditModal($(this).attr("data-ciwkey"));
})

View File

@ -1,20 +1,20 @@
<!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 bg-dark"> <div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="MajorEditModalLabel" th:text="${majorStatus.majorKey eq null?'주요사건 작성':'주요사건 수정'}"></h5> <h5 class="modal-title text-white" id="MajorEditModalLabel" th:text="${majorStatus.majorKey eq null?'주요사건처리현황 작성':'주요사건처리현황 게시글 수정'}"></h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body" id="MajorEditBody"> <div class="modal-body" id="MajorEditBody">
<form action="#" method="post" id="boardEditForm"> <form action="#" method="post" id="boardEditForm">
<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="majorKey" th:value="${majorStatus.majorKey}"> <input type="hidden" name="majorKey" th:value="${majorStatus.majorKey}">
<input type="hidden" name="majorType" th:value="${majorStatus.majorType}"> <input type="hidden" name="majorType" th:value="${majorStatus.majorType}">
<input type="hidden" name="wrtOrgan" th:value="${majorStatus.wrtOrgan}"> <input type="hidden" name="wrtOrgan" th:value="${majorStatus.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${majorStatus.wrtPart}"> <input type="hidden" name="wrtPart" th:value="${majorStatus.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${majorStatus.wrtUserSeq}"> <input type="hidden" name="wrtUserSeq" th:value="${majorStatus.wrtUserSeq}">
<input type="hidden" name="wrtUserGrd" th:value="${majorStatus.wrtUserGrd}"> <input type="hidden" name="wrtUserGrd" th:value="${majorStatus.wrtUserGrd}">
<input type="hidden" name="wrtUserNm" th:value="${majorStatus.wrtUserNm}">--> <input type="hidden" name="wrtUserNm" th:value="${majorStatus.wrtUserNm}">
<div class="row mb-1"> <div class="row mb-1">
<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">
@ -29,18 +29,18 @@
<input type="text" class="form-control" id="wrtDt" name="wrtDt" th:value="${#temporals.format(majorStatus.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly> <input type="text" class="form-control" id="wrtDt" name="wrtDt" th:value="${#temporals.format(majorStatus.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly>
</div> </div>
<!-- <div class="col-sm-auto my-auto">--> <!-- <div class="col-sm-auto my-auto">-->
<!-- <input type="checkbox" id="organChk" name="organChk" value="T" th:checked="${major.organChk eq 'T'}">--> <!-- <input type="checkbox" id="organChk" name="organChk" value="T" th:checked="${majorStatus.organChk eq 'T'}">-->
<!-- </div>--> <!-- </div>-->
<!-- <label for="organChk" class="col-sm-3 col-form-label text-left">소속관서에만 노출</label>--> <!-- <label for="organChk" class="col-sm-3 col-form-label text-left">소속관서에만 노출</label>-->
</div> </div>
<div class="row mb-1"> <div class="row mb-1">
<label for="title" class="col-sm-2 col-form-label text-center">제목</label> <label for="contentTitle" class="col-sm-2 col-form-label text-center">제목</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" id="title" name="title" th:value="${majorStatus.contentTitle}" autocomplete="off"> <input type="text" class="form-control" id="contentTitle" name="contentTitle" th:value="${majorStatus.contentTitle}" autocomplete="off">
</div> </div>
</div> </div>
<div class="row mb-1 justify-content-center"> <div class="row mb-1 justify-content-center">
<label for="content" class="col-sm-2 col-form-label text-center">내용</label> <label for="editor" class="col-sm-2 col-form-label text-center">내용</label>
<div class="col-sm-10"> <div class="col-sm-10">
<div id="editor"></div> <div id="editor"></div>
<textarea id="content" class="d-none" th:utext="${majorStatus.contentInfo}"></textarea> <textarea id="content" class="d-none" th:utext="${majorStatus.contentInfo}"></textarea>
@ -55,7 +55,7 @@
</th:block> </th:block>
<!-- <th:block th:unless="${#arrays.isEmpty(majorStatus.fileList)}">--> <!-- <th:block th:unless="${#arrays.isEmpty(majorStatus.fileList)}">-->
<!-- <div class='row-col-6' th:each="infoFile:${majorStatus.fileList}">--> <!-- <div class='row-col-6' th:each="infoFile:${majorStatus.fileList}">-->
<!-- <span th:data-fileseq="${majorFile.fileSeq}" th:text="|${majorFile.origNm}.${majorFile.fileExtn} ${majorFile.fileSize}|"></span>--> <!-- <span th:data-fileseq="${majorFile.fileSeq}" th:text="|${majorFile.origNm}.${majorFile.fileExtn} $majorFile.fileSize}|"></span>-->
<!-- <a href='#' class='uploadedFileDelete text-danger text-decoration-none'>삭제</a>--> <!-- <a href='#' class='uploadedFileDelete text-danger text-decoration-none'>삭제</a>-->
<!-- </div>--> <!-- </div>-->
<!-- </th:block>--> <!-- </th:block>-->

View File

@ -8,7 +8,7 @@
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main> <main>
<h4>주요사건처리현황</h4> <h4>주요사건처리현황t</h4>
<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}"/>
<div class="row mx-0"> <div class="row mx-0">
@ -40,7 +40,7 @@
<input type="text" class="form-control form-control-sm" placeholder="작성자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}"> <input type="text" class="form-control form-control-sm" placeholder="작성자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}">
</div> </div>
<div class="col-auto"> <div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.contentTitle}"> <input type="text" class="form-control form-control-sm" placeholder="제목" name="contentTitle" th:value="${searchParams.contentTitle}">
</div> </div>
<div class="col-4"> <div class="col-4">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv"> <div class="input-group w-auto input-daterange" id="dateSelectorDiv">
@ -76,7 +76,7 @@
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<tr class="" th:each="major:${majorList}"> <tr class="tr" th:each="major:${majorList}">
<input type="hidden" class="majorKey" th:value="${major.majorKey}"> <input type="hidden" class="majorKey" th:value="${major.majorKey}">
<td><input type="checkbox" class="trChkBox"></td> <td><input type="checkbox" class="trChkBox"></td>
<td th:test="${major.majorType}"></td> <td th:test="${major.majorType}"></td>
@ -126,6 +126,7 @@
</nav> </nav>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<!-- <input type="button" class="btn btn-danger" value="삭제" id="delectMajorBtn">-->
<input type="button" class="btn btn-success" value="등록" id="addMajorBtn" sec:authorize="hasRole('ROLE_SUB_ADMIN')"> <input type="button" class="btn btn-success" value="등록" id="addMajorBtn" sec:authorize="hasRole('ROLE_SUB_ADMIN')">
</div> </div>
</div> </div>

View File

@ -1,17 +1,17 @@
<!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 bg-dark"> <div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="publicViewModalLabel">주요사건처리현황 열람</h5> <h5 class="modal-title text-white" id="MajorViewModalLabel">주요사건처리현황 열람</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<input type="hidden" name="publicKeyKey" id="viewModalPublicKey" th:value="${major.majorKey}"> <input type="hidden" name="majorKey" id="viewModalMajorKey" th:value="${majorStatus.majorKey}">
<ul class="nav nav-tabs" id="userTab" role="tablist"> <ul class="nav nav-tabs" id="userTab" role="tablist">
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link active" id="boardTab" data-bs-toggle="tab" data-bs-target="#boardTabPanel" type="button" role="tab" aria-controls="boardTabPanel" aria-selected="true">본문</button> <button class="nav-link active" id="boardTab" data-bs-toggle="tab" data-bs-target="#boardTabPanel" type="button" role="tab" aria-controls="boardTabPanel" aria-selected="true">본문</button>
</li> </li>
<li class="nav-item" role="presentation" th:if="${#lists.size(major.fileList)>0}"> <li class="nav-item" role="presentation" th:if="${#lists.size(majorStatus.fileList)>0}">
<button class="nav-link" id="fileTab" data-bs-toggle="tab" data-bs-target="#fileTabPanel" type="button" role="tab" aria-controls="fileTabPanel" aria-selected="false" th:text="${#strings.concat('첨부파일(', #lists.size(major.fileList), ')')}"></button> <button class="nav-link" id="fileTab" data-bs-toggle="tab" data-bs-target="#fileTabPanel" type="button" role="tab" aria-controls="fileTabPanel" aria-selected="false" th:text="${#strings.concat('첨부파일(', #lists.size(majorStatus.fileList), ')')}"></button>
</li> </li>
</ul> </ul>
<div class="tab-content bg-white border border-top-0 p-2"> <div class="tab-content bg-white border border-top-0 p-2">
@ -19,23 +19,23 @@
<div class="row mb-1"> <div class="row mb-1">
<div class="col-sm-9"></div> <div class="col-sm-9"></div>
<label class="col-sm-1 col-form-label col-form-label-sm text-center">작성일시</label> <label class="col-sm-1 col-form-label col-form-label-sm text-center">작성일시</label>
<label class="col-sm-2 col-form-label col-form-label-sm text-start" th:text="${#temporals.format(major.wrtDt, 'yyyy-MM-dd HH:mm')}"></label> <label class="col-sm-2 col-form-label col-form-label-sm text-start" th:text="${#temporals.format(majorStatus.wrtDt, 'yyyy-MM-dd HH:mm')}"></label>
<label class="col-sm-1 col-form-label col-form-label-sm text-center">제목</label> <label class="col-sm-1 col-form-label col-form-label-sm text-center">제목</label>
<label class="col-sm-8 col-form-label col-form-label-sm text-start" th:text="${major.title}"></label> <label class="col-sm-8 col-form-label col-form-label-sm text-start" th:text="${majorStatus.contentTitle}"></label>
<label class="col-sm-1 col-form-label col-form-label-sm text-center">작성자</label> <label class="col-sm-1 col-form-label col-form-label-sm text-center">작성자</label>
<label class="col-sm-2 col-form-label col-form-label-sm text-start"> <label class="col-sm-2 col-form-label col-form-label-sm text-start">
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> <th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${commonCode.itemCd eq major.wrtOrgan}" th:text="${commonCode.itemValue}"></th:block> <th:block th:if="${commonCode.itemCd eq majorStatus.wrtOrgan}" th:text="${commonCode.itemValue}"></th:block>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}"> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq major.wrtUserGrd}" th:text="${commonCode.itemValue}"></th:block> <th:block th:if="${commonCode.itemCd eq majorStatus.wrtUserGrd}" th:text="${commonCode.itemValue}"></th:block>
</th:block> </th:block>
<th:block th:text="${major.wrtUserNm}"></th:block> <th:block th:text="${majorStatus.wrtUserNm}"></th:block>
</label> </label>
<hr class="my-1"> <hr class="my-1">
<label for="content" class="col-sm-1 col-form-label col-form-label-sm text-center">내용</label> <label for="contentInfo" class="col-sm-1 col-form-label col-form-label-sm text-center">내용</label>
<div class="col-sm-10 form-control-sm"> <div class="col-sm-10 form-control-sm">
<div id="content" th:utext="${major.content}"></div> <div id="contentInfo" th:utext="${majorStatus.contentInfo}"></div>
</div> </div>
</div> </div>
</div> </div>
@ -50,16 +50,16 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<th:block th:if="${#lists.isEmpty(major.fileList)}"> <th:block th:if="${#lists.isEmpty(majorStatus.fileList)}">
<tr> <tr>
<td colspan="2">파일이 없습니다.</td> <td colspan="2">파일이 없습니다.</td>
</tr> </tr>
</th:block> </th:block>
<th:block th:unless="${#lists.isEmpty(major.fileList)}"> <th:block th:unless="${#lists.isEmpty(majorStatus.fileList)}">
<th:block th:each="file:${major.fileList}"> <th:block th:each="file:${majorStatus.fileList}">
<tr class="fileInfoTr"> <tr class="fileInfoTr">
<td><a href="#" class="fileDownLink" data-board="publicFile" <td><a href="#" class="fileDownLink" data-board="majorFile"
th:data-parentkey="${file.publicKey}" th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn}|"></a></td> th:data-parentkey="${file.majorKey}" th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn}|"></a></td>
<td th:text="${file.fileSize}"></td> <td th:text="${file.fileSize}"></td>
</tr> </tr>
</th:block> </th:block>
@ -70,31 +70,11 @@
</div> </div>
</div> </div>
<hr class="my-1"> <hr class="my-1">
<div class="row justify-content-start">
<div class="col-12 mx-3" id="commentFormHome">
<form action="#" method="post" id="commentForm">
<div class="row">
<div class="col-11">
<input type="hidden" name="publicKey" th:value="${major.majorKey}">
<input type="hidden" name="parentComment" id="parentComment">
<input type="text" class=" form-control form-control-sm" id="comment" name="comment" placeholder="댓글작성">
</div>
<div class="col-1 d-grid gap-0">
<div class="input-group">
<input type="button" class="btn btn-sm btn-primary" id="commentSaveBtn" value="작성">
<input type="button" class="btn btn-sm btn-warning" id="childFormRemoveBtn" value="취소" style="display: none">
</div>
</div>
</div>
</form>
</div>
</div>
</div> </div>
</div> </div>
<div class="modal-footer bg-light"> <div class="modal-footer bg-light">
<th:block th:if="${userSeq eq major.wrtUserSeq}"><!--작성자일 경우 수정 허용--> <th:block th:if="${userSeq eq majorStatus.wrtUserSeq}"><!--작성자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="editBtn">수정</button> <button type="button" class="btn btn-warning" id="editBtn" th:data-majorkey="${majorStatus.majorKey}">수정</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>