강석 최 2022-11-18 18:01:27 +09:00
commit 61f001f3cb
19 changed files with 1418 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.SailorService;
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
import com.dbnt.faisp.main.fpiMgt.affairPlan.service.PlanService;
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
import com.dbnt.faisp.main.fpiMgt.sri.service.SriService;
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService;
import com.dbnt.faisp.main.publicBoard.service.PublicBoardService;
import lombok.RequiredArgsConstructor;
@ -40,6 +41,7 @@ public class FileController {
private final ResultService resultService;
private final BoardInvestigationService boardInvestigationService;
private final FishingBoatService fishingBoatService;
private final SriService sriService;
@Value("${file.dir}")
protected String fileDir;
@ -138,6 +140,9 @@ public class FileController {
case "sailor":
downloadFile = fishingBoatService.selectSailorFile(parentKey, fileSeq);
break;
case "sri":
downloadFile = sriService.selectFaSriFile(parentKey, fileSeq);
break;
}
return downloadFile;
}

View File

@ -88,7 +88,8 @@ public class SecurityConfig{
"/affairResult/**",
"/faStatistics/**",
"/translator/**",
"/faisp/**"
"/faisp/**",
"/sri/**"
).hasRole(Role.USER.name()) // USER 접근 허용
.antMatchers(
"/authMgt/**",

View File

@ -0,0 +1,128 @@
package com.dbnt.faisp.main.fpiMgt.sri;
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
import com.dbnt.faisp.main.faRpt.model.FaRptReadUser;
import com.dbnt.faisp.main.fpiMgt.sri.model.Sri;
import com.dbnt.faisp.main.fpiMgt.sri.model.SriReadUser;
import com.dbnt.faisp.main.fpiMgt.sri.service.SriService;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequiredArgsConstructor
@RequestMapping("/sri")
public class SriController {
private final SriService sriService;
private final AuthMgtService authMgtService;
private final CodeMgtService codeMgtService;
@GetMapping("/sriBoard")
public ModelAndView faRptBoard(@AuthenticationPrincipal UserInfo loginUser, Sri sri){
ModelAndView mav = new ModelAndView("sri/sriBoard");
if(sri.getActiveTab()==null){
sri.setActiveTab("send");
}
mav.addObject("searchUrl", "/sri/sriBoard");
String accessAuth = authMgtService.selectAccessConfigList
(loginUser.getUserSeq(), "/sri/sriBoard").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
if(sri.getActiveTab().equals("send")){
sri.setWrtUserSeq(loginUser.getUserSeq());
}else if(sri.getActiveTab().equals("receive")){
sri.setStatus("DST007");
sri.setReceiveUserSeq(loginUser.getUserSeq());
}else if(sri.getActiveTab().equals("all") && accessAuth.equals("ACC003")){
sri.setDownOrganCdList(loginUser.getDownOrganCdList());
}else if(sri.getActiveTab().equals("all")){
sri.setActiveTab("send");
sri.setWrtUserSeq(loginUser.getUserSeq());
}
if(accessAuth.equals("ACC003")){
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
}
sri.setQueryInfo();
mav.addObject("SriList", sriService.selectSriList(sri));
sri.setContentCnt(sriService.selectSriCnt(sri));
sri.setPaginationInfo();
mav.addObject("searchParams", sri);
return mav;
}
@GetMapping("/sriEditModal")
public ModelAndView faRptEditModal(@AuthenticationPrincipal UserInfo loginUser, Sri sri){
ModelAndView mav = new ModelAndView("sri/sriEditModal");
if(sri.getFaSriKey()!=null){
sri = sriService.selectFaSriBoard(sri.getFaSriKey(), null);
}else{
if(sri.getRefKey()!=null){
SriReadUser readUser = new SriReadUser();
readUser.setUserSeq(sri.getWrtUserSeq());
readUser.setOgCd(sri.getWrtOrgan());
readUser.setOfcCd(sri.getWrtPart());
readUser.setTitleCd(sri.getWrtTitle());
readUser.setUserNm(sri.getWrtUserNm());
sri.setReadUserList(new ArrayList<>());
sri.getReadUserList().add(readUser);
}
sri.setWrtUserSeq(loginUser.getUserSeq());
sri.setWrtOrgan(loginUser.getOgCd());
sri.setWrtPart(loginUser.getOfcCd());
sri.setWrtTitle(loginUser.getTitleCd());
sri.setWrtUserNm(loginUser.getUserNm());
sri.setWrtDt(LocalDateTime.now());
}
mav.addObject("SriCategoryList", codeMgtService.selectCodeMgtList("SRI",""));
mav.addObject("sri", sri);
return mav;
}
@PostMapping("/selectedUserTable")
@ResponseBody
public ModelAndView selectedUserTable(@RequestBody List<FaRptReadUser> userList){
ModelAndView mav = new ModelAndView("sri/readUserRow");
mav.addObject("userList", userList);
return mav;
}
@PostMapping("/saveSri")
public Integer saveFaRpt(Sri sri,
MultipartHttpServletRequest request,
@RequestParam(value = "fileSeq", required = false) List<Integer> deleteFileSeq){
sri.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
return sriService.saveSriBoard(sri, deleteFileSeq);
}
@GetMapping("/sriViewModal")
public ModelAndView faRptViewModal(@AuthenticationPrincipal UserInfo loginUser, Sri sri){
ModelAndView mav = new ModelAndView("sri/sriViewModal");
mav.addObject("FaSri", sriService.selectFaSriBoard(sri.getFaSriKey(), loginUser.getUserSeq()));
mav.addObject("userSeq",loginUser.getUserSeq());
//메뉴권한 확인
mav.addObject("accessAuth", authMgtService.selectAccessConfigList
(loginUser.getUserSeq(), "/sri/sriBoard").get(0).getAccessAuth());
return mav;
}
@PostMapping("/sriDelete")
public void sriDelete(@AuthenticationPrincipal UserInfo loginUser, @RequestBody List<Sri> sri){
sriService.sriDelete(sri);
}
}

View File

@ -0,0 +1,19 @@
package com.dbnt.faisp.main.fpiMgt.sri.mapper;
import com.dbnt.faisp.main.fpiMgt.sri.model.Sri;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SriMapper {
List<Sri> selectSriList(Sri sri);
Integer selectSriCnt(Sri sri);
}

View File

@ -0,0 +1,86 @@
package com.dbnt.faisp.main.fpiMgt.sri.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 org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;
import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "fa_sri_board")
public class Sri extends BaseModel {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "fa_sri_key")
private Integer faSriKey;
@Column(name = "fa_sri_type")
private String faSriType;
@Column(name = "title")
private String title;
@Column(name = "content")
private String content;
@Column(name = "status")
private String status;
@Column(name = "fa_sri_edate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate faSriEdate;
@Column(name = "wrt_organ")
private String wrtOrgan;
@Column(name = "wrt_part")
private String wrtPart;
@Column(name = "wrt_user_seq")
private Integer wrtUserSeq;
@Column(name = "wrt_title")
private String wrtTitle;
@Column(name = "wrt_user_nm")
private String wrtUserNm;
@Column(name = "wrt_dt")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime wrtDt;
@Column(name = "ref_key")
private Integer refKey;
@Transient
private Integer receiveUserSeq;
@Transient
private String activeTab;
@Transient
private Integer fileCnt;
@Transient
private Integer readCnt;
@Transient
private Integer userCnt;
@Transient
private List<SriFile> fileList;
@Transient
private List<SriReadUser> readUserList;
@Transient
private List<MultipartFile> multipartFileList;
@Override
public String toString() {
return "Sri [faSriKey=" + faSriKey + ", faSriType=" + faSriType + ", title=" + title + ", content=" + content
+ ", status=" + status + ", faSriEdate=" + faSriEdate + ", wrtOrgan=" + wrtOrgan + ", wrtPart=" + wrtPart
+ ", wrtUserSeq=" + wrtUserSeq + ", wrtTitle=" + wrtTitle + ", wrtUserNm=" + wrtUserNm + ", wrtDt=" + wrtDt
+ ", receiveUserSeq=" + receiveUserSeq + ", activeTab=" + activeTab + ", fileCnt=" + fileCnt + ", readCnt="
+ readCnt + ", userCnt=" + userCnt + ", fileList=" + fileList + ", readUserList=" + readUserList
+ ", multipartFileList=" + multipartFileList + "]";
}
}

View File

@ -0,0 +1,56 @@
package com.dbnt.faisp.main.fpiMgt.sri.model;
import com.dbnt.faisp.config.FileInfo;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "fa_sri_file")
@IdClass(SriFile.SriFileId.class)
public class SriFile extends FileInfo {
@Id
@Column(name = "fa_sri_key")
private Integer faSriKey;
@Id
@Column(name = "file_seq")
private Integer fileSeq;
@Column(name = "orig_nm")
private String origNm;
@Column(name = "conv_nm")
private String convNm;
@Column(name = "file_extn")
private String fileExtn;
@Column(name = "file_size")
private String fileSize;
@Column(name = "save_path")
private String savePath;
@Override
public String toString() {
return "SriFile [faSriKey=" + faSriKey + ", fileSeq=" + fileSeq + ", origNm=" + origNm + ", convNm=" + convNm
+ ", fileExtn=" + fileExtn + ", fileSize=" + fileSize + ", savePath=" + savePath + "]";
}
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class SriFileId implements Serializable {
private Integer faSriKey;
private Integer fileSeq;
}
}

View File

@ -0,0 +1,53 @@
package com.dbnt.faisp.main.fpiMgt.sri.model;
import com.dbnt.faisp.config.FileInfo;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "fa_sri_read_user")
@IdClass(SriReadUser.SriReadUserId.class)
public class SriReadUser extends FileInfo {
@Id
@Column(name = "fa_sri_key")
private Integer faSriKey;
@Id
@Column(name = "user_seq")
private Integer userSeq;
@Column(name = "read_yn")
private String readYn;
@Column(name = "og_cd")
private String ogCd;
@Column(name = "ofc_cd")
private String ofcCd;
@Column(name = "title_cd")
private String titleCd;
@Column(name = "user_nm")
private String userNm;
@Override
public String toString() {
return "SriReadUser [faSriKey=" + faSriKey + ", userSeq=" + userSeq + ", readYn=" + readYn + ", ogCd=" + ogCd
+ ", ofcCd=" + ofcCd + ", titleCd=" + titleCd + ", userNm=" + userNm + "]";
}
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class SriReadUserId implements Serializable {
private Integer faSriKey;
private Integer userSeq;
}
}

View File

@ -0,0 +1,28 @@
package com.dbnt.faisp.main.fpiMgt.sri.repository;
import com.dbnt.faisp.main.fpiMgt.sri.model.SriFile;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface SriFileRepository extends JpaRepository<SriFile, SriFile.SriFileId> {
Optional<SriFile> findTopByFaSriKeyOrderByFileSeq(Integer faSriKey);
List<SriFile> findByFaSriKey(Integer faSriKey);
}

View File

@ -0,0 +1,15 @@
package com.dbnt.faisp.main.fpiMgt.sri.repository;
import com.dbnt.faisp.main.fpiMgt.sri.model.SriReadUser;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface SriReadUserRepository extends JpaRepository<SriReadUser, SriReadUser.SriReadUserId> {
void deleteByFaSriKey(Integer faSriKey);
List<SriReadUser> findByFaSriKey(Integer faSriKey);
}

View File

@ -0,0 +1,12 @@
package com.dbnt.faisp.main.fpiMgt.sri.repository;
import com.dbnt.faisp.main.fpiMgt.sri.model.Sri;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SriRepository extends JpaRepository<Sri, Integer> {
}

View File

@ -0,0 +1,139 @@
package com.dbnt.faisp.main.fpiMgt.sri.service;
import com.dbnt.faisp.config.BaseService;
import com.dbnt.faisp.config.FileInfo;
import com.dbnt.faisp.main.fpiMgt.sri.mapper.SriMapper;
import com.dbnt.faisp.main.fpiMgt.sri.model.Sri;
import com.dbnt.faisp.main.fpiMgt.sri.model.SriFile;
import com.dbnt.faisp.main.fpiMgt.sri.model.SriReadUser;
import com.dbnt.faisp.main.fpiMgt.sri.repository.SriFileRepository;
import com.dbnt.faisp.main.fpiMgt.sri.repository.SriReadUserRepository;
import com.dbnt.faisp.main.fpiMgt.sri.repository.SriRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.List;
import java.util.UUID;
@Service
@RequiredArgsConstructor
public class SriService extends BaseService {
private final SriRepository sriRepository;
private final SriReadUserRepository sriReadUserRepository;
private final SriFileRepository sriFileRepository;
private final SriMapper sriMapper;
@Value("${file.dir}")
protected String fileDir;
@Value("${file.dir.sri}")
protected String sriDir;
public List<Sri> selectSriList(Sri sri) {
return sriMapper.selectSriList(sri);
}
public Integer selectSriCnt(Sri sri) {
return sriMapper.selectSriCnt(sri);
}
@Transactional
public Integer saveSriBoard(Sri sri, List<Integer> deleteFileSeq) {
Integer faSriKey = sriRepository.save(sri).getFaSriKey();
if(deleteFileSeq!=null && deleteFileSeq.size()>0){
deleteFaRptFile(faSriKey, deleteFileSeq);
}
if(sri.getMultipartFileList() != null){
saveUploadFiles(faSriKey, sri.getMultipartFileList());
}
if(sri.getReadUserList() != null){
saveSriReadUser(faSriKey, sri.getReadUserList());
}
return faSriKey;
}
@Transactional
public Sri selectFaSriBoard(Integer faSriKey, Integer userSeq) {
Sri sri = sriRepository.findById(faSriKey).orElse(null);
if(sri != null){
sri.setFileList(sriFileRepository.findByFaSriKey(faSriKey));
sri.setReadUserList(sriReadUserRepository.findByFaSriKey(faSriKey));
if(sri.getStatus().equals("DST007")){
for(SriReadUser readUser: sri.getReadUserList()){
if(readUser.getUserSeq().equals(userSeq)){
readUser.setReadYn("T");
sriReadUserRepository.save(readUser);
}
}
}
}
return sri;
}
private void saveSriReadUser(Integer faSriKey, List<SriReadUser> readUserList) {
sriReadUserRepository.deleteByFaSriKey(faSriKey);
for(SriReadUser readUser: readUserList){
readUser.setFaSriKey(faSriKey);
}
sriReadUserRepository.saveAll(readUserList);
}
private void saveUploadFiles(Integer faSriKey, List<MultipartFile> multipartFileList) {
SriFile lastFile = sriFileRepository.findTopByFaSriKeyOrderByFileSeq(faSriKey).orElse(null);
int fileSeq = lastFile==null?1:(lastFile.getFileSeq()+1);
for(MultipartFile file: multipartFileList){
String saveName = UUID.randomUUID().toString();
String path = fileDir+sriDir;
saveFile(file, new File(path+File.separator+saveName));
String originalFilename = file.getOriginalFilename();
int extnIdx = originalFilename.lastIndexOf(".");
SriFile fileInfo = new SriFile();
fileInfo.setFaSriKey(faSriKey);
fileInfo.setFileSeq(fileSeq++);
fileInfo.setOrigNm(originalFilename.substring(0, extnIdx));
fileInfo.setFileExtn(originalFilename.substring(extnIdx+1));
fileInfo.setConvNm(saveName);
fileInfo.setFileSize(calculationSize(file.getSize()));
fileInfo.setSavePath(path);
sriFileRepository.save(fileInfo);
}
}
private void deleteFaRptFile(Integer faSriKey, List<Integer> deleteFileSeq) {
List<SriFile> fileList = sriFileRepository.findByFaSriKey(faSriKey);
for(SriFile file: fileList){
if(deleteFileSeq.contains(file.getFileSeq())){
deleteStoredFile(new File(file.getSavePath(), file.getConvNm()));
sriFileRepository.delete(file);
}
}
}
public FileInfo selectFaSriFile(Integer faSriKey, Integer fileSeq) {
return sriFileRepository.findById(new SriFile.SriFileId(faSriKey, fileSeq)).orElse(null);
}
@Transactional
public void sriDelete(List<Sri> sri) {
for(Sri sriData : sri) {
Sri dbSri = sriRepository.findById(sriData.getFaSriKey()).orElse(null);
dbSri.setStatus("DST008");
sriRepository.save(dbSri);
}
}
}

View File

@ -16,6 +16,7 @@ file.dir.equip=/equip
file.dir.sailor=sailor
file.dir.affair=affair
file.dir.editor=editor
file.dir.sri=/sri
editor.img.view=/file/editorFileDisplay?fileNm=

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dbnt.faisp.main.fpiMgt.sri.mapper.SriMapper">
<sql id="selectSriWhere">
<where>
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
and a.wrt_user_seq = #{wrtUserSeq}
</if>
<if test='receiveUserSeq != null and receiveUserSeq != ""'>
and a.fa_sri_key in (select fa_sri_key
from fa_sri_read_user
where user_seq = #{receiveUserSeq})
</if>
<if test='wrtUserNm != null and wrtUserNm != ""'>
and a.wrt_user_nm like '%'||#{wrtUserNm}||'%'
</if>
<if test='wrtOrgan != null and wrtOrgan != ""'>
and a.wrt_organ = #{wrtOrgan}
</if>
<if test='title != null and title != ""'>
and a.title like '%'||#{title}||'%'
</if>
<if test='startDate != null and startDate != ""'>
and a.wrt_dt >= #{startDate}::date
</if>
<if test='endDate != null and endDate != ""'>
and a.wrt_dt &lt;= #{endDate}::date+1
</if>
<if test='status != null and status != ""'>
and a.status = #{status}
</if>
<if test="downOrganCdList != null">
and a.wrt_organ in
<foreach collection="downOrganCdList" item="organCd" separator="," open="(" close=")">
#{organCd}
</foreach>
</if>
</where>
</sql>
<select id="selectSriList" resultType="Sri" parameterType="Sri">
select a.fa_sri_key,
a.title,
a.fa_sri_type,
a.status,
a.fa_sri_edate,
a.wrt_organ,
a.wrt_part,
a.wrt_user_nm,
a.wrt_title,
a.wrt_user_seq,
a.wrt_dt,
b.fileCnt,
c.readCnt,
c.userCnt
from fa_sri_board a
left outer join (select fa_sri_key,
count(file_seq) as fileCnt
from fa_sri_file
group by fa_sri_key) b
on a.fa_sri_key = b.fa_sri_key
left outer join (select fa_sri_key,
count(read_yn='T') as readCnt,
count(*) as userCnt
from fa_sri_read_user
group by fa_sri_key) c
on a.fa_sri_key = c.fa_sri_key
<include refid="selectSriWhere"></include>
order by fa_sri_key desc
limit #{rowCnt} offset #{firstIndex}
</select>
<select id="selectSriCnt" resultType="int" parameterType="Sri">
select count(*)
from fa_sri_board a
<include refid="selectSriWhere"></include>
</select>
</mapper>

View File

@ -116,6 +116,10 @@ $(document).ready( function() {
});
$(document).on('click', '#deleteCellPhone', function (){
if($('input:checkbox[name=cpChk]:checked').length < 1){
alert("게시물을 선택해주세요")
return false;
}
if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
$('input:checkbox[name=cpChk]:checked').each(function (idx, el){

View File

@ -0,0 +1,276 @@
let selectedList = [];
$(document).on('click', '#addSriBtn', function (){
getSriEditModal({faSriKey: null})
})
function getSriEditModal(faSriKey){
$.ajax({
url: '/sri/sriEditModal',
data: faSriKey,
type: 'GET',
dataType:"html",
success: function(html){
$("#sriEditModalContent").empty().append(html)
$("#faSriEdate").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
CrossEditor = new NamoSE('editor');
CrossEditor.params.ParentEditor = document.getElementById("editor");
CrossEditor.params.Width = "100%";
CrossEditor.params.UserLang = "auto";
CrossEditor.params.NewToolbar = true;
CrossEditor.params.UploadFileExecutePath = "/Crosseditor/uploadImg";
CrossEditor.params.FullScreen = false;
$("#editor").show();
/*CrossEditor.OnInitCompleted(function (e){
e.editorTarget.SetBodyValue(document.getElementById("pe_bhr").value);
})*/
CrossEditor.EditorStart();
setUploadDiv();
$("#sriEditModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '#addReadUserBtn', function (){
searchModalSubmit(1);
$("#userModal").modal('show');
})
$(document).on('click', '#getMenuBtn', function (){
$.ajax({
type : 'POST',
url : "/sri/selectedUserTable",
data : JSON.stringify(selectedList),
contentType: 'application/json',
dataType:"html",
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(html) {
$("#readUserRow").empty().append(html);
setReadUserRowNum();
$("#userModal").modal("hide");
},
error : function(xhr, status) {
}
})
})
$(document).on('click', '#saveSriBtn', function (){
saveSri('DST007')
})
function saveSri(faSriState){
if(faSriState == 'DST001'){
if(confirm("임시저장하시겠습니까?")){
save(faSriState);
}
}else{
if(contentCheck()){
if(confirm("저장하시겠습니까?")){
save(faSriState);
}
}
}
}
function save(faSriState){
$("#status").val(faSriState);
contentFade("in");
const formData = new FormData($("#sriEditForm")[0]);
for(const file of files) {
if(!file.isDelete)
formData.append('uploadFiles', file, file.name);
}
formData.append('content', CrossEditor.GetBodyValue());
$.each($(".readUserRow"), function (idx, row){
formData.append('readUserList['+idx+'].userSeq', $(row).find('.userSeq').val());
formData.append('readUserList['+idx+'].ogCd', $(row).find('.ogCd').val());
formData.append('readUserList['+idx+'].ofcCd', $(row).find('.ofcCd').val());
formData.append('readUserList['+idx+'].titleCd', $(row).find('.titleCd').val());
formData.append('readUserList['+idx+'].userNm', $(row).find('.userNm').val());
});
$(".text-decoration-line-through").each(function (idx, el){
formData.append('fileSeq', $(el).attr("data-fileseq"));
})
$.ajax({
type : 'POST',
data : formData,
url : "/sri/saveSri",
processData: false,
contentType: false,
success : function(result) {
if(faSriState == 'DST001'){
alert("임시저장되었습니다.");
}else{
alert("저장되었습니다.");
}
contentFade("out");
$("#sriEditModal").modal('hide');
getSriViewModal(result);
},
error : function(xhr, status) {
if(faSriState == 'DST001'){
alert("임시저장에 실패하였습니다.")
}else{
alert("저장에 실패하였습니다.")
}
contentFade("out");
}
})
}
$(document).on('click', '.faSriTr', function (event){
const target = event.target;
if(!(target.className === "sriChk" ||$(target).parents("td").length>0)){
getSriViewModal(Number($(this).find(".faSriKey").val()));
}
})
function getSriViewModal(faSriKey){
$.ajax({
url: '/sri/sriViewModal',
data: {faSriKey: faSriKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#sriViewBody").empty().append(html)
$("#sriViewModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '#sendTab', function (){
location.href = "/sri/sriBoard?activeTab=send";
})
$(document).on('click', '#receiveTab', function (){
location.href = "/sri/sriBoard?activeTab=receive";
})
$(document).on('click', '#allTab', function (){
location.href = "/sri/sriBoard?activeTab=all";
})
$(document).on('click', '#editFaSriBtn', function (){
$("#sriViewModal").modal('hide');
getSriEditModal({faSriKey: Number($(this).attr("data-fasrikey"))});
})
function OnInitCompleted(e){
e.editorTarget.SetBodyValue(document.getElementById("content").value);
}
$(document).on('click', '#reSendBtn', function (){
$("#sriViewModal").modal('hide');
const faSri = {
refKey: Number($(this).attr("data-fasrikey")),
wrtUserSeq: $("#wrtUserSeq").val(),
wrtOrgan: $("#wrtOrgan").val(),
wrtPart: $("#wrtPart").val(),
wrtTitle: $("#wrtTitle").val(),
wrtUserNm: $("#wrtUserNm").val()
}
getSriEditModal(faSri);
})
$(document).on('click', '#saveTempBtn', function (){
saveSri('DST001')
})
$(document).on('click', '#sriDeleteBtn', function (){
if($('input:checkbox[name=sriChk]:checked').length < 1){
alert("게시물을 선택해주세요");
return false;
}
if(confirm("삭제시 되돌릴 수 없습니다. 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
$('input:checkbox[name=sriChk]:checked').each(function (idx, el){
checkArr.push({});
const target = $(el);
checkArr[idx].faSriKey = Number(target.parents('tr').find('.faSriKey').val());
})
deleteSri(checkArr);
}
})
$(document).on('click', '#deleteSri', function (){
if(confirm("삭제시 되돌릴 수 없습니다. 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
checkArr.push({});
checkArr[0].faSriKey = Number($(this).attr("data-fasrikey"));
deleteSri(checkArr);
}
})
function deleteSri(checkArr){
$.ajax({
type : 'POST',
url : "/sri/sriDelete",
data : JSON.stringify(checkArr),
contentType: 'application/json',
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function() {
alert("삭제처리 되었습니다.");
location.reload();
},
error : function(xhr, status) {
alert("삭제처리에 실패하였습니다");
}
})
}
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
})
$(document).on('click', '.rowDeleteBtn', function (){
$(this).parents(".readUserRow").remove()
setReadUserRowNum();
})
function setReadUserRowNum(){
$.each($(".readUserRow"), function (idx, row){
$(row).find(".rowSeq")[0].innerText = idx+1;
})
}
function contentCheck(){
let flag = true;
if(!$("#faSriType").val()){
alert("분류를 선택해주세요.")
flag = false;
}
if(!$("#title").val()){
alert("제목을 입력해주세요.")
flag = false;
}
if($("#readUserRow").children().length===0){
alert("수신자를 입력해주세요.")
flag = false;
}
flag = fileCheck(flag, files);
return flag;
}

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<th:block th:each="readUser:${userList}">
<div class="row my-1 readUserRow">
<input type="hidden" class="userSeq" th:value="${readUser.userSeq}">
<input type="hidden" class="ogCd" th:value="${readUser.ogCd}">
<input type="hidden" class="ofcCd" th:value="${readUser.ofcCd}">
<input type="hidden" class="titleCd" th:value="${readUser.titleCd}">
<input type="hidden" class="userNm" th:value="${readUser.userNm}">
<div class="col-1 rowSeq"></div>
<div class="col-9">
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${commonCode.itemCd eq readUser.ogCd}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<th:block th:if="${commonCode.itemCd eq readUser.ofcCd}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<!--<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq readUser.titleCd}" th:text="|${commonCode.itemValue} ${readUser.userNm}|"></th:block>
</th:block>-->
<th:block th:text="${readUser.userNm}"></th:block>
</div>
<div class="col-2">
<button type="button" class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button>
</div>
</div>
</th:block>
</html>

View File

@ -0,0 +1,206 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
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/igActivities/fpiMgt/sri/sri.js}"></script>
<script type="text/javascript" th:src="@{/js/modal/userModal.js}"></script>
</th:block>
<div layout:fragment="content">
<main class="pt-3">
<p>첩보수집활동 > SRI</p>
<h4>SRI</h4>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mx-0">
<div class="col-12 card text-center">
<div class="card-body">
<ul class="nav nav-tabs" id="userTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link" th:classappend="${searchParams.activeTab eq 'send'?' active':''}" id="sendTab" data-bs-toggle="tab" type="button" role="tab">하달</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" th:classappend="${searchParams.activeTab eq 'receive'?' active':''}" id="receiveTab" data-bs-toggle="tab" type="button" role="tab">수신</button>
</li>
<th:block th:if="${accessAuth eq 'ACC003'}">
<li class="nav-item" role="presentation" >
<button class="nav-link" th:classappend="${searchParams.activeTab eq 'all'?' active':''}" id="allTab" data-bs-toggle="tab" type="button" role="tab">전체(관리자)</button>
</li>
</th:block>
</ul>
<div class="tab-content border border-top-0 p-2">
<form method="get" th:action="${searchUrl}">
<input type="hidden" name="activeTab" id="activeTab" th:value="${searchParams.activeTab}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1">
<div class="col-auto">
<select class="form-select" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt eq num*10}"></option>
</th:block>
</select>
</div>
<div class="col-auto">
<div class="row justify-content-end">
<div class="col-auto" th:if="${searchParams.activeTab ne 'send'}">
<select class="form-select form-select-sm" name="wrtOrgan">
<option value="">관서 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.wrtOrgan}"></option>
</th:block>
</select>
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.title}">
</div>
<div class="col-auto" th:if="${accessAuth eq 'ACC003'}">
<input type="text" class="form-control form-control-sm" placeholder="작성자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}">
</div>
<div class="col-auto">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}">
<input type="text" class="form-control form-control-sm" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}">
</div>
</div>
<input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">
</div>
</div>
</div>
</form>
<div class="row justify-content-start">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<table class="table table-hover">
<thead>
<tr>
<th></th>
<th th:if="${searchParams.status ne 'receive'}">상태</th>
<th>보고서<br>번호</th>
<th>분류</th>
<th>제출기한</th>
<th>제목</th>
<th>관서</th>
<th>부서</th>
<th>작성자</th>
<th>작성일시</th>
</tr>
</thead>
<tbody>
<tr class="faSriTr" th:each="sri:${SriList}">
<th:block>
<input type="hidden" class="faSriKey" th:value="${sri.faSriKey}">
</th:block>
<th:block th:unless="${sri.status eq 'DST008'}">
<td class="sriChk"><input type="checkbox" name="sriChk" class="trChkBox"></td>
<td th:if="${sri.status ne 'receive'}">
<th:block th:each="commonCode:${session.commonCode.get('DST')}">
<th:text th:if="${commonCode.itemCd eq sri.status}" th:text="${commonCode.itemValue}"></th:text>
</th:block>
</td>
<td th:text="${sri.faSriKey}"></td>
<td>
<th:block th:each="commonCode:${session.commonCode.get('SRI')}">
<th:text th:if="${commonCode.itemCd eq sri.faSriType}" th:text="${commonCode.itemValue}"></th:text>
</th:block>
</td>
<td th:text="${sri.faSriEdate}"></td>
<td th:text="${sri.title}"></td>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<td th:if="${sri.wrtOrgan eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<td th:if="${sri.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<td th:text="${sri.wrtUserNm}"></td>
<td th:text="${#temporals.format(sri.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
</th:block>
</tr>
</tbody>
</table>
</div>
<div class="row justify-content-between">
<div class="col-auto">
<button type="button" class="btn btn-danger" id="sriDeleteBtn">삭제</button>
</div>
<div class="col-auto">
<nav aria-label="Page navigation">
<ul class="pagination">
<th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex eq num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>
</ul>
</nav>
</div>
<div class="col-auto">
<input type="button" class="btn btn-success" value="등록" id="addSriBtn" th:unless="${accessAuth eq 'ACC001'}">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<div class="modal fade" id="sriEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="faRptEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xxl modal-dialog-scrollable">
<div class="modal-content" id="sriEditModalContent">
</div>
</div>
</div>
<div class="modal fade" id="sriViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="sriViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="sriViewBody">
</div>
</div>
</div>
<div class="modal fade" id="userModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="menuModalLabel">수신자 검색</h5>
<input type="hidden" id="modalUrl" value="/modal/userModal">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="subModalBody">
<div class="row">
<div class="col-12">
<form method="get" action="#" id="modalSearchForm">
<input type="hidden" name="pageIndex" id="modalPageIndex" value="1">
<input type="hidden" name="rowCnt" value="10">
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="getMenuBtn">추가</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</div>
</div>
</div>
</div>
</html>

View File

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="faRptEditModalLabel" th:text="${sri.faSriKey eq null?'SRI 작성':'SRI 수정'}"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="faRptEditBody">
<form action="#" method="post" id="sriEditForm">
<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="faSriKey" th:value="${sri.faSriKey}">
<input type="hidden" name="wrtOrgan" th:value="${sri.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${sri.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${sri.wrtUserSeq}">
<input type="hidden" name="wrtTitle" th:value="${sri.wrtTitle}">
<input type="hidden" name="status" id="status" th:value="${sri.status}">
<input type="hidden" name="refKey" th:value="${sri.refKey}">
<div class="row">
<div class="col-8">
<div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-2 col-form-label col-form-label-sm text-center">작성자</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm" id="wrtUserNm" name="wrtUserNm" th:value="${sri.wrtUserNm}" readonly>
</div>
<label for="wrtDt" class="col-sm-2 col-form-label col-form-label-sm text-center">작성일시</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm" id="wrtDt" name="wrtDt" th:value="${#temporals.format(sri.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly>
</div>
</div>
<th:block th:if="${sri.refKey eq null}">
<div class="mb-3 row">
<label for="faRptType" class="col-sm-2 col-form-label col-form-label-sm text-center">분류</label>
<div class="col-sm-4">
<select class="form-select form-select-sm" id="faSriType" name="faSriType">
<option value="">선택해주세요.</option>
<th:block th:each="SriCategory:${SriCategoryList}">
<option th:value="${SriCategory.itemCd}" th:text="${SriCategory.itemValue}" th:selected="${SriCategory.itemCd eq sri.faSriType}"></option>
</th:block>
</select>
</div>
<label for="faRptType" class="col-sm-2 col-form-label col-form-label-sm text-center">제출기한</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm" id="faSriEdate" name="faSriEdate" th:value="${sri.faSriEdate}" readonly>
</div>
</div>
</th:block>
<div class="mb-3 row">
<label for="title" class="col-sm-2 col-form-label col-form-label-sm text-center">제목</label>
<div class="col-sm-10">
<th:block th:if="${sri.refKey eq null}">
<input type="text" class="form-control form-control-sm" id="title" name="title" th:value="${sri.title}">
</th:block>
<th:block th:unless="${sri.refKey eq null}">
<input type="text" class="form-control form-control-sm" id="title" name="title" th:value="[회신]">
</th:block>
</div>
</div>
<div class="mb-3 row justify-content-center">
<label for="content" class="col-sm-2 col-form-label col-form-label-sm text-center">내용</label>
<div class="col-sm-10">
<div id="editor"></div>
<textarea id="content" class="d-none" th:utext="${sri.content}"></textarea>
</div>
</div>
<div class="row mb-3">
<label for="fileInputer" class="col-sm-2 col-form-label col-form-label-sm text-center">업로드 자료</label>
<div class="col-sm-10" style="min-height: 70px;">
<div class="w-100 h-100 border border-info rounded text-center" id="uploadDiv">
<th:block th:if="${#arrays.isEmpty(sri.fileList)}">
<br>파일을 업로드 해주세요.
</th:block>
<th:block th:unless="${#arrays.isEmpty(sri.fileList)}">
<div class='row-col-6' th:each="sriFile:${sri.fileList}">
<span th:data-fileseq="${sriFile.fileSeq}" th:text="|${sriFile.origNm}.${sriFile.fileExtn} ${sriFile.fileSize}|"></span>
<a href='#' class='uploadedFileDelete text-danger text-decoration-none'>삭제</a>
</div>
</th:block>
</div>
</div>
<input type="file" class="d-none" id="fileInputer" multiple>
</div>
</div>
<div class="col-4">
<div class="row">
<div class="col-12 pb-2">
<div class="row justify-content-between">
<div class="col-auto">■ 수신자</div>
<div class="col-auto"><button type="button" class="btn btn-sm btn-info" id="addReadUserBtn">추가</button></div>
</div>
</div>
<div class="col-1">no</div>
<div class="col-9">수신자</div>
<div class="col-2">삭제</div>
</div>
<hr class="my-1">
<div class="row">
<div class="col-12" id="readUserRow">
<th:block th:each="readUser, idx:${sri.readUserList}">
<div class="row my-1 readUserRow">
<input type="hidden" class="userSeq" th:value="${readUser.userSeq}">
<input type="hidden" class="ogCd" th:value="${readUser.ogCd}">
<input type="hidden" class="ofcCd" th:value="${readUser.ofcCd}">
<input type="hidden" class="titleCd" th:value="${readUser.titleCd}">
<input type="hidden" class="userNm" th:value="${readUser.userNm}">
<div class="col-1 rowSeq" th:text="${idx.index+1}"></div>
<div class="col-9">
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${commonCode.itemCd eq readUser.ogCd}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<th:block th:if="${commonCode.itemCd eq readUser.ofcCd}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<!--<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq readUser.titleCd}" th:text="|${commonCode.itemValue} ${readUser.userNm}|"></th:block>
</th:block>-->
<th:block th:text="${readUser.userNm}"></th:block>
</div>
<div class="col-2">
<button type="button" class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button>
</div>
</div>
</th:block>
</div>
</div>
</div>
</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="saveSriBtn">저장</button>
</div>

View File

@ -0,0 +1,146 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="faRptViewModalLabel">SRI 열람</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="faSriViewBody">
<div class="row">
<div class="col-8">
<div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-2 col-form-label col-form-label-sm text-center">작성자</label>
<div class="col-sm-4">
<input type="hidden" id="faSriKey" th:value="${FaSri.faSriKey}">
<input type="hidden" id="wrtUserSeq" th:value="${FaSri.wrtUserSeq}">
<input type="hidden" id="wrtOrgan" th:value="${FaSri.wrtOrgan}">
<input type="hidden" id="wrtPart" th:value="${FaSri.wrtPart}">
<input type="hidden" id="wrtTitle" th:value="${FaSri.wrtTitle}">
<input type="text" class="form-control form-control-sm border-0" id="wrtUserNm" name="wrtUserNm" th:value="${FaSri.wrtUserNm}" readonly>
</div>
<label for="wrtDt" class="col-sm-2 col-form-label col-form-label-sm text-center">작성일시</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm border-0" id="wrtDt" name="wrtDt" th:value="${#temporals.format(FaSri.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly>
</div>
</div>
<div class="mb-3 row">
<label for="faRptType" class="col-sm-2 col-form-label col-form-label-sm text-center">분류</label>
<div class="col-sm-4">
<th:block th:each="code:${session.commonCode.get('SRI')}">
<th:block th:if="${code.itemCd eq FaSri.faSriType}">
<input type="text" class="form-control form-control-sm border-0" id="faSriType" th:value="${code.itemValue}" readonly>
</th:block>
</th:block>
</div>
<label for="status" class="col-sm-2 col-form-label col-form-label-sm text-center">상태</label>
<div class="col-sm-4">
<th:block th:each="code:${session.commonCode.get('DST')}">
<th:block th:if="${code.itemCd eq FaSri.status}">
<input type="text" class="form-control form-control-sm border-0" id="status" th:value="${code.itemValue}" readonly>
</th:block>
</th:block>
</div>
</div>
<div class="mb-3 row">
<label for="title" class="col-sm-2 col-form-label col-form-label-sm text-center">제출기한</label>
<div class="col-sm-10">
<input type="text" class="form-control form-control-sm border-0" id="faSriEdate" name="faSriEdate" th:value="${FaSri.faSriEdate}" readonly>
</div>
</div>
<div class="mb-3 row">
<label for="title" class="col-sm-2 col-form-label col-form-label-sm text-center">제목</label>
<div class="col-sm-10">
<input type="text" class="form-control form-control-sm border-0" id="title" name="title" th:value="${FaSri.title}" readonly>
</div>
</div>
<div class="mb-3 row justify-content-center">
<label for="content" class="col-sm-2 col-form-label col-form-label-sm text-center">내용</label>
<div class="col-sm-10" id="content" th:utext="${FaSri.content}">
</div>
</div>
<div class="row mb-3">
<label for="fileTable" class="col-sm-2 col-form-label col-form-label-sm text-center">업로드 자료</label>
<div class="col-sm-10">
<table class="table" id="fileTable">
<thead>
<tr>
<th>파일명</th>
<th>사이즈</th>
</tr>
</thead>
<tbody>
<th:block th:if="${#lists.isEmpty(FaSri.fileList)}">
<tr>
<td colspan="2">파일이 없습니다.</td>
</tr>
</th:block>
<th:block th:unless="${#lists.isEmpty(FaSri.fileList)}">
<th:block th:each="file:${FaSri.fileList}">
<tr class="fileInfoTr">
<td><a href="#" class="fileDownLink" data-board="sri"
th:data-parentkey="${file.faSriKey}" th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn}|"></a></td>
<td th:text="${file.fileSize}"></td>
</tr>
</th:block>
</th:block>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-4">
<div class="row">
<div class="col-12 pb-2">
<div class="row justify-content-start">
<div class="col-auto">■ 수신자</div>
</div>
</div>
<div class="col-1">no</div>
<div class="col-9">수신자</div>
<div class="col-2">열람</div>
</div>
<hr class="my-1">
<div class="row">
<div class="col-12">
<th:block th:each="readUser, idx:${FaSri.readUserList}">
<div class="row my-1">
<div class="col-1" th:text="${idx.index+1}"></div>
<div class="col-9">
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${commonCode.itemCd eq readUser.ogCd}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<th:block th:if="${commonCode.itemCd eq readUser.ofcCd}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<!--<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq readUser.titleCd}" th:text="|${commonCode.itemValue} ${readUser.userNm}|"></th:block>
</th:block>-->
<th:block th:text="${readUser.userNm}"></th:block>
</div>
<div class="col-2">
<th:block th:text="${readUser.readYn eq 'T'?'O':'X'}"></th:block>
</div>
</div>
</th:block>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<div class="col-auto">
<th:block th:unless="${FaSri.status eq 'DST008'}">
<button type="button" class="btn btn-danger" id="deleteSri" th:if="${userSeq eq FaSri.wrtUserSeq} and ${accessAuth eq 'ACC003'}" th:data-fasrikey="${FaSri.faSriKey}">삭제</button>
</th:block>
</div>
<div class="col-auto">
<th:block th:if="${userSeq eq FaSri.wrtUserSeq}">
<button type="button" class="btn btn-warning" id="editFaSriBtn" th:data-fasrikey="${FaSri.faSriKey}">수정</button>
</th:block>
<th:block th:if="${userSeq ne FaSri.wrtUserSeq}">
<th:block th:unless="${FaSri.faSriEdate eq null}">
<button type="button" class="btn btn-success" id="reSendBtn" th:if="${FaSri.faSriEdate} >= ${#temporals.createToday()}" th:data-fasrikey="${FaSri.faSriKey}">회신</button>
</th:block>
</th:block>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</div>