외사정보보고 작업중.
parent
580952a95b
commit
8e98adef4f
|
|
@ -0,0 +1,97 @@
|
|||
package com.dbnt.faisp.faRpt;
|
||||
|
||||
import com.dbnt.faisp.authMgt.service.AuthMgtService;
|
||||
import com.dbnt.faisp.faRpt.model.FaRptBoard;
|
||||
import com.dbnt.faisp.faRpt.service.FaRptService;
|
||||
import com.dbnt.faisp.fpiMgt.affairPlan.model.PlanBoard;
|
||||
import com.dbnt.faisp.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.List;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/faRpt")
|
||||
public class FaRptController {
|
||||
private final FaRptService faRptService;
|
||||
private final AuthMgtService authMgtService;
|
||||
|
||||
@GetMapping("/faRptBoard")
|
||||
public ModelAndView faRptBoard(@AuthenticationPrincipal UserInfo loginUser, FaRptBoard faRptBoard){
|
||||
ModelAndView mav;
|
||||
if(faRptBoard.getDashboardFlag()){
|
||||
mav = new ModelAndView("/faRpt/faRptDashboard");
|
||||
faRptBoard.setRowCnt(5);
|
||||
}else{
|
||||
mav = new ModelAndView("/faRpt/faRptBoard");
|
||||
}
|
||||
if(faRptBoard.getActiveTab()==null){
|
||||
faRptBoard.setActiveTab("send");
|
||||
}
|
||||
mav.addObject("searchUrl", "/faRpt/faRptBoard");
|
||||
String accessAuth = authMgtService.selectAccessConfigList
|
||||
(loginUser.getUserSeq(), "/affairPlan/planMgt").get(0).getAccessAuth();
|
||||
mav.addObject("accessAuth", accessAuth);
|
||||
|
||||
if(faRptBoard.getActiveTab().equals("send")){
|
||||
faRptBoard.setWrtUserSeq(loginUser.getUserSeq());
|
||||
}else if(faRptBoard.getActiveTab().equals("receive")){
|
||||
faRptBoard.setReceiveUserSeq(loginUser.getUserSeq());
|
||||
}else if(faRptBoard.getActiveTab().equals("all") && accessAuth.equals("ACC003")){
|
||||
faRptBoard.setDownOrganCdList(loginUser.getDownOrganCdList());
|
||||
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
|
||||
}else if(faRptBoard.getActiveTab().equals("all")){
|
||||
faRptBoard.setActiveTab("send");
|
||||
faRptBoard.setWrtUserSeq(loginUser.getUserSeq());
|
||||
}
|
||||
|
||||
faRptBoard.setQueryInfo();
|
||||
mav.addObject("faRptList", faRptService.selectFaRptList(faRptBoard));
|
||||
faRptBoard.setContentCnt(faRptService.selectFaRptCnt(faRptBoard));
|
||||
faRptBoard.setPaginationInfo();
|
||||
mav.addObject("searchParams", faRptBoard);
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/faRptEditModal")
|
||||
public ModelAndView faRptEditModal(@AuthenticationPrincipal UserInfo loginUser, FaRptBoard faRptBoard){
|
||||
ModelAndView mav = new ModelAndView("faRpt/faRptEditModal");
|
||||
if(faRptBoard.getFaRptKey()!=null){
|
||||
faRptBoard = faRptService.selectFaRptBoard(faRptBoard.getFaRptKey());
|
||||
}else{
|
||||
faRptBoard.setWrtOrgan(loginUser.getOgCd());
|
||||
faRptBoard.setWrtPart(loginUser.getOfcCd());
|
||||
faRptBoard.setWrtUserSeq(loginUser.getUserSeq());
|
||||
faRptBoard.setWrtUserGrd(loginUser.getTitleCd());
|
||||
faRptBoard.setWrtUserNm(loginUser.getUserNm());
|
||||
faRptBoard.setWrtDt(LocalDateTime.now());
|
||||
}
|
||||
mav.addObject("faRpt", faRptBoard);
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/faRptViewModal")
|
||||
public ModelAndView faRptViewModal(@AuthenticationPrincipal UserInfo loginUser, FaRptBoard faRptBoard){
|
||||
ModelAndView mav = new ModelAndView("faRpt/faRptViewModal");
|
||||
faRptBoard = faRptService.selectFaRptBoard(faRptBoard.getFaRptKey());
|
||||
mav.addObject("faRpt", faRptBoard);
|
||||
mav.addObject("userSeq",loginUser.getUserSeq());
|
||||
//메뉴권한 확인
|
||||
mav.addObject("accessAuth", authMgtService.selectAccessConfigList
|
||||
(loginUser.getUserSeq(), "/faRpt/faRptBoard").get(0).getAccessAuth());
|
||||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/savePlan")
|
||||
public Integer saveFaRpt(FaRptBoard faRptBoard,
|
||||
MultipartHttpServletRequest request,
|
||||
@RequestParam(value = "fileSeq", required = false) List<Integer> deleteFileSeq){
|
||||
faRptBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
|
||||
return faRptService.saveFaRptBoard(faRptBoard, deleteFileSeq);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.dbnt.faisp.faRpt.mapper;
|
||||
|
||||
import com.dbnt.faisp.faRpt.model.FaRptBoard;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface FaRptMapper {
|
||||
|
||||
List<FaRptBoard> selectFaRptList(FaRptBoard faRptBoard);
|
||||
|
||||
Integer selectFaRptCnt(FaRptBoard faRptBoard);
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.dbnt.faisp.faRpt.model;
|
||||
|
||||
import com.dbnt.faisp.config.BaseModel;
|
||||
import com.dbnt.faisp.publicBoard.model.PublicComment;
|
||||
import com.dbnt.faisp.publicBoard.model.PublicFile;
|
||||
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.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "fa_rpt_board")
|
||||
public class FaRptBoard extends BaseModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "fa_rpt_key")
|
||||
private Integer faRptKey;
|
||||
@Column(name = "fa_rpt_type")
|
||||
private String faRptType;
|
||||
@Column(name = "title")
|
||||
private String title;
|
||||
@Column(name = "content")
|
||||
private String content;
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
@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_user_grd")
|
||||
private String wrtUserGrd;
|
||||
@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 List<FaRptFile> fileList;
|
||||
@Transient
|
||||
private List<FaRptReadUser> readUserList;
|
||||
@Transient
|
||||
private List<MultipartFile> multipartFileList;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.dbnt.faisp.faRpt.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_rpt_file")
|
||||
@IdClass(FaRptFile.FaRptFileId.class)
|
||||
public class FaRptFile extends FileInfo {
|
||||
@Id
|
||||
@Column(name = "fa_rpt_key")
|
||||
private Integer faRptKey;
|
||||
@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;
|
||||
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class FaRptFileId implements Serializable {
|
||||
private Integer faRptKey;
|
||||
private Integer fileSeq;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.dbnt.faisp.faRpt.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_rpt_read_user")
|
||||
@IdClass(FaRptReadUser.FaRptReadUserId.class)
|
||||
public class FaRptReadUser extends FileInfo {
|
||||
@Id
|
||||
@Column(name = "fa_rpt_key")
|
||||
private Integer faRptKey;
|
||||
@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;
|
||||
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class FaRptReadUserId implements Serializable {
|
||||
private Integer faRptKey;
|
||||
private Integer userSeq;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.dbnt.faisp.faRpt.repository;
|
||||
|
||||
import com.dbnt.faisp.faRpt.model.FaRptBoard;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
|
||||
public interface FaRptBoardRepository extends JpaRepository<FaRptBoard, Integer> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.dbnt.faisp.faRpt.repository;
|
||||
|
||||
import com.dbnt.faisp.faRpt.model.FaRptFile;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public interface FaRptFileRepository extends JpaRepository<FaRptFile, FaRptFile.FaRptFileId> {
|
||||
List<FaRptFile> findByFaRptKey(Integer faRptKey);
|
||||
Optional<FaRptFile> findTopByFaRptKeyOrderByFileSeq(Integer faRptKey);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.dbnt.faisp.faRpt.repository;
|
||||
|
||||
import com.dbnt.faisp.faRpt.model.FaRptReadUser;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FaRptReadUserRepository extends JpaRepository<FaRptReadUser, FaRptReadUser.FaRptReadUserId> {
|
||||
List<FaRptReadUser> findByFaRptKey(Integer faRptKey);
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.dbnt.faisp.faRpt.service;
|
||||
|
||||
import com.dbnt.faisp.config.BaseService;
|
||||
import com.dbnt.faisp.config.FileInfo;
|
||||
import com.dbnt.faisp.faRpt.mapper.FaRptMapper;
|
||||
import com.dbnt.faisp.faRpt.model.FaRptBoard;
|
||||
import com.dbnt.faisp.faRpt.model.FaRptReadUser;
|
||||
import com.dbnt.faisp.faRpt.repository.FaRptBoardRepository;
|
||||
import com.dbnt.faisp.faRpt.repository.FaRptFileRepository;
|
||||
import com.dbnt.faisp.faRpt.repository.FaRptReadUserRepository;
|
||||
import com.dbnt.faisp.publicBoard.model.PublicBoard;
|
||||
import com.dbnt.faisp.publicBoard.model.PublicComment;
|
||||
import com.dbnt.faisp.publicBoard.model.PublicFile;
|
||||
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.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class FaRptService extends BaseService {
|
||||
private final FaRptBoardRepository faRptBoardRepository;
|
||||
private final FaRptFileRepository faRptFileRepository;
|
||||
private final FaRptReadUserRepository faRptReadUserRepository;
|
||||
private final FaRptMapper faRptMapper;
|
||||
|
||||
|
||||
public List<FaRptBoard> selectFaRptList(FaRptBoard faRptBoard) {
|
||||
return faRptMapper.selectFaRptList(faRptBoard);
|
||||
}
|
||||
|
||||
public Integer selectFaRptCnt(FaRptBoard faRptBoard) {
|
||||
return faRptMapper.selectFaRptCnt(faRptBoard);
|
||||
}
|
||||
|
||||
public Integer saveFaRptBoard(FaRptBoard faRptBoard, List<Integer> deleteFileSeq) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public FaRptBoard selectFaRptBoard(Integer faRptKey) {
|
||||
FaRptBoard faRptBoard = faRptBoardRepository.findById(faRptKey).orElse(null);
|
||||
faRptBoard.setFileList(faRptFileRepository.findByFaRptKey(faRptKey));
|
||||
faRptBoard.setReadUserList(faRptReadUserRepository.findByFaRptKey(faRptKey));
|
||||
return faRptBoard;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?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.faRpt.mapper.FaRptMapper">
|
||||
<sql id="selectFaRptWhere">
|
||||
<where>
|
||||
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||
and a.wrt_user_seq = #{wrtUserSeq}
|
||||
</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 <= #{endDate}::date+1
|
||||
</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="selectFaRptList" resultType="FaRptBoard" parameterType="FaRptBoard">
|
||||
select a.fa_rpt_key,
|
||||
a.title,
|
||||
a.wrt_organ,
|
||||
a.wrt_part,
|
||||
a.wrt_user_nm,
|
||||
a.wrt_user_grd,
|
||||
a.wrt_user_seq,
|
||||
a.wrt_dt,
|
||||
b.fileCnt
|
||||
from fa_rpt_board a
|
||||
left outer join (select fa_rpt_key,
|
||||
count(file_seq) as fileCnt
|
||||
from fa_rpt_file
|
||||
group by fa_rpt_key) b
|
||||
on a.fa_rpt_key = b.fa_rpt_key
|
||||
<include refid="selectFaRptWhere"></include>
|
||||
order by fa_rpt_key desc
|
||||
limit #{rowCnt} offset #{firstIndex}
|
||||
</select>
|
||||
<select id="selectFaRptCnt" resultType="int" parameterType="FaRptBoard">
|
||||
select count(*)
|
||||
from fa_rpt_board a
|
||||
<include refid="selectFaRptWhere"></include>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
|
||||
$(function(){
|
||||
$("#dateSelectorDiv").datepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
language: "ko"
|
||||
});
|
||||
})
|
||||
|
||||
$(document).on('click', '#sendTab', function (){
|
||||
location.href = "/faRpt/faRptBoard?activeTab=send";
|
||||
})
|
||||
$(document).on('click', '#receiveTab', function (){
|
||||
location.href = "/faRpt/faRptBoard?activeTab=receive";
|
||||
})
|
||||
$(document).on('click', '#allTab', function (){
|
||||
location.href = "/faRpt/faRptBoard?activeTab=all";
|
||||
})
|
||||
|
||||
$(document).on('click', '#addFaRptBtn', function (){
|
||||
getFaRptEditModal(null)
|
||||
})
|
||||
$(document).on('click', '#editFaRptBtn', function (){
|
||||
$("#faRptViewModal").modal('hide');
|
||||
getFaRptEditModal(Number($("#faRptViewBody").find("[name='faRptKey']").val()));
|
||||
})
|
||||
|
||||
$(document).on('click', '#faRptAddBtn', function (){
|
||||
$("#faRptDiv").append("<input type='text' class='form-control' name='faRptInfos'>")
|
||||
})
|
||||
|
||||
$(document).on('click', '#detailFaRptAddBtn', function (){
|
||||
const detailFaRptDiv = $("#detailFaRptDiv");
|
||||
detailFaRptDiv.append("<textarea type='text' name='detailFaRptInfos'></textarea>");
|
||||
const lastAppendTextarea = detailFaRptDiv.children()[detailFaRptDiv.children().length-1];
|
||||
$(lastAppendTextarea).summernote({
|
||||
lang:'ko-KR',
|
||||
height: 120,
|
||||
disableDragAndDrop: true,
|
||||
toolbar: [
|
||||
['style', ['style']],
|
||||
['font', ['bold', 'underline', 'clear']],
|
||||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph']],
|
||||
['table', ['table']]
|
||||
]
|
||||
});
|
||||
})
|
||||
|
||||
$(document).on('click', '#saveFaRptBtn', function (){
|
||||
saveFaRpt('DST002')
|
||||
})
|
||||
|
||||
$(document).on('click', '#saveTempBtn', function (){
|
||||
saveFaRpt('DST001')
|
||||
})
|
||||
|
||||
$(document).on('click', '.faRptTr', function (){
|
||||
const chkBox = $(this).find(".rowChkBox");
|
||||
if(chkBox.length>0){
|
||||
$(".trChkBox").prop("checked", false);
|
||||
chkBox[0].checked = !chkBox[0].checked;
|
||||
}
|
||||
getFaRptViewModal(Number($(this).find(".faRptKey").val()));
|
||||
})
|
||||
|
||||
$(document).on('click', '.apprvBtn', function (){
|
||||
$("#apprvFormFaRptKey").val($("#viewModalFaRptKey").val());
|
||||
$("#viewModalApprvValue").val($(this).attr("data-faRptstate"));
|
||||
if(confirm($(this).val()+"하시겠습니까?")){
|
||||
const formData = new FormData($("#apprvForm")[0]);
|
||||
contentFade("in")
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/faRpt/faRptStateChange",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend: function (xhr){
|
||||
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||
},
|
||||
success : function(result) {
|
||||
alert("저장되었습니다")
|
||||
getFaRptViewModal(result);
|
||||
contentFade("out");
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("저장에 실패하였습니다.");
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
function getFaRptViewModal(faRptKey){
|
||||
$.ajax({
|
||||
url: '/faRpt/faRptViewModal',
|
||||
data: {faRptKey: faRptKey},
|
||||
type: 'GET',
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#faRptViewBody").empty().append(html)
|
||||
$("#faRptViewModal").modal('show');
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getFaRptEditModal(faRptKey){
|
||||
$.ajax({
|
||||
url: '/faRpt/faRptEditModal',
|
||||
data: {faRptKey: faRptKey},
|
||||
type: 'GET',
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#faRptEditModalContent").empty().append(html)
|
||||
$("#faRptEditModal").modal('show');
|
||||
$("#faRptDt").datepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
language: "ko"
|
||||
});
|
||||
$("#content").summernote({
|
||||
lang:'ko-KR',
|
||||
height: 360,
|
||||
disableDragAndDrop: true,
|
||||
toolbar: [
|
||||
['style', ['style']],
|
||||
['font', ['bold', 'underline', 'clear']],
|
||||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph']],
|
||||
['table', ['table']]
|
||||
]
|
||||
});
|
||||
setUploadDiv();
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
function saveFaRpt(faRptState){
|
||||
if(contentCheck()){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
$("#faRptState").val(faRptState);
|
||||
contentFade("in");
|
||||
const formData = new FormData($("#faRptEditForm")[0]);
|
||||
for(const file of files) {
|
||||
if(!file.isDelete)
|
||||
formData.append('uploadFiles', file, file.name);
|
||||
}
|
||||
$(".text-decoration-line-through").each(function (idx, el){
|
||||
formData.append('fileSeq', $(el).attr("data-fileseq"));
|
||||
})
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/faRpt/saveFaRpt",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success : function(result) {
|
||||
alert("저장되었습니다.");
|
||||
contentFade("out");
|
||||
$("#faRptEditModal").modal('hide');
|
||||
getFaRptViewModal(result);
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("저장에 실패하였습니다.")
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function contentCheck(){
|
||||
let flag = true;
|
||||
if(!$("#contentTitle").val()){
|
||||
alert("제목을 입력해주세요.")
|
||||
flag = false;
|
||||
}
|
||||
flag = fileCheck(flag, files);
|
||||
return flag;
|
||||
}
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
<!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/faRpt/faRpt.js}"></script>
|
||||
</th:block>
|
||||
<div layout:fragment="content">
|
||||
<main class="pt-3">
|
||||
<p>외사정보관리 > 외사정보보고</p>
|
||||
<h4>외사정보보고</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="${accessAuth eq 'ACC003'}">
|
||||
<select class="form-select form-select-sm" name="wrtOrgan">
|
||||
<option value="">관서 선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
|
||||
<th:block th:if="${#lists.contains(mgtOrganList, commonCode.itemCd)}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.wrtOrgan}"></option>
|
||||
</th:block>
|
||||
</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-4">
|
||||
<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>
|
||||
<th>관서</th>
|
||||
<th>부서</th>
|
||||
<th>작성자</th>
|
||||
<th>작성일시</th>
|
||||
<th>첨부파일</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="faRptTr" th:each="faRpt:${faRptList}">
|
||||
<input type="hidden" class="faRptKey" th:value="${faRpt.faRptKey}">
|
||||
<td><input type="checkbox" class="trChkBox"></td>
|
||||
<td th:text="${faRpt.title}"></td>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
|
||||
<td th:if="${faRpt.wrtOrgan eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
|
||||
</th:block>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
|
||||
<td th:if="${faRpt.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
|
||||
</th:block>
|
||||
<td th:text="${faRpt.wrtUserNm}"></td>
|
||||
<td th:text="${#temporals.format(faRpt.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
|
||||
<td th:text="${faRpt.fileCnt eq null?'파일 없음':#strings.concat(faRpt.fileCnt,' 건')}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto"></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">«</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">»</span>
|
||||
</a>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn" th:unless="${accessAuth eq 'ACC001'}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="modal fade" id="faRptEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="faRptEditModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-content" id="faRptEditModalContent">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="faRptViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="faRptViewModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-content" id="faRptViewBody">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
<script type="text/javascript" th:src="@{/js/faRpt/faRpt.js}"></script>
|
||||
<div class="card">
|
||||
<div class="card-header bg-white">
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">월간계획</div>
|
||||
<div class="col-auto"><a href="/faRpt/faRptBoard" class="link-dark"><i class="bi bi-list"></i></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>제목</th>
|
||||
<th>작성일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="faRptTr" th:each="faRpt:${faRptList}">
|
||||
<input type="hidden" class="faRptKey" th:value="${faRpt.faRptKey}">
|
||||
<td th:text="${faRpt.title}"></td>
|
||||
<td th:text="${#temporals.format(faRpt.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="faRptViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="faRptViewModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-content" id="faRptViewBody">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="faRptEditModalLabel" th:text="${faRpt.faRptKey eq null?'외사정보보고 작성':'외사정보보고 수정'}"></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="faRptEditForm">
|
||||
<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="faRptKey" th:value="${faRpt.faRptKey}">
|
||||
<input type="hidden" name="wrtOrgan" th:value="${faRpt.wrtOrgan}">
|
||||
<input type="hidden" name="wrtPart" th:value="${faRpt.wrtPart}">
|
||||
<input type="hidden" name="wrtUserSeq" th:value="${faRpt.wrtUserSeq}">
|
||||
<input type="hidden" name="wrtUserGrd" th:value="${faRpt.wrtUserGrd}">
|
||||
<input type="hidden" name="status" id="status" th:value="${faRpt.status}">
|
||||
<div class="row">
|
||||
<div class="col-7">
|
||||
<div class="mb-3 row">
|
||||
<label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="wrtUserNm" name="wrtUserNm" th:value="${faRpt.wrtUserNm}" readonly>
|
||||
</div>
|
||||
<label for="wrtDt" class="col-sm-2 col-form-label text-center">작성일시</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="wrtDt" name="wrtDt" th:value="${#temporals.format(faRpt.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label for="title" class="col-sm-2 col-form-label text-center">제목</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="title" name="title" th:value="${faRpt.title}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row justify-content-center">
|
||||
<label for="content" class="col-sm-2 col-form-label text-center">내용</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type='text' id="content" name='content' th:utext="${faRpt.content}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="fileInputer" class="col-sm-2 col-form-label 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(faRpt.fileList)}">
|
||||
<br>파일을 업로드 해주세요.
|
||||
</th:block>
|
||||
<th:block th:unless="${#arrays.isEmpty(faRpt.fileList)}">
|
||||
<div class='row-col-6' th:each="faRptFile:${faRpt.fileList}">
|
||||
<span th:data-fileseq="${faRptFile.fileSeq}" th:text="|${faRptFile.origNm}.${faRptFile.fileExtn} ${faRptFile.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-5">
|
||||
<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">추가</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">
|
||||
</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="saveFaRptBtn">저장</button>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
<div class="row my-1 readUserRow" th:id="|row${idx}|">
|
||||
<input type="hidden" class="userSeq" th:name="${#strings.concat('readUserList[', idx,'].userSeq')}" th:value="${readUser.userSeq}">
|
||||
<div class="col-1 rowSeq" th:text="${idx+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>
|
||||
</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>
|
||||
|
|
@ -90,38 +90,29 @@
|
|||
<hr class="my-1">
|
||||
<div class="row">
|
||||
<div class="col-12" id="clearInfoRow">
|
||||
<th:block th:each="info:${result.clearInfoList}">
|
||||
<div class="row my-1 infoRow" th:id="|row${info.infoSeq}|">
|
||||
<input type="hidden" class="infoSeq clearInfoSeq" th:name="${#strings.concat('clearInfoList[', info.infoSeq,'].infoSeq')}" th:value="${info.infoSeq}">
|
||||
<div class="col-1 infoSeq" th:text="${info.infoSeq+1}"></div>
|
||||
<div class="col-3">
|
||||
<select class="form-select form-select-sm" th:name="${#strings.concat('clearInfoList[', info.infoSeq,'].useCatg')}">
|
||||
<option value="">선택</option>
|
||||
<th:block th:each="category:${categoryList}">
|
||||
<option th:value="${category.itemCd}" th:text="${category.itemValue}" th:selected="${category.itemCd eq info.useCatg}"></option>
|
||||
<th:block th:each="readUser, idx:${faRpt.readUserList}">
|
||||
<div class="row my-1 readUserRow" th:id="|row${idx.index}|">
|
||||
<input type="hidden" class="userSeq" th:name="${#strings.concat('readUserList[', idx.index,'].userSeq')}" th:value="${readUser.userSeq}">
|
||||
<input type="hidden" class="ogCd" th:name="${#strings.concat('readUserList[', idx.index,'].ogCd')}" th:value="${readUser.ogCd}">
|
||||
<input type="hidden" class="ofcCd" th:name="${#strings.concat('readUserList[', idx.index,'].ofcCd')}" th:value="${readUser.ofcCd}">
|
||||
<input type="hidden" class="titleCd" th:name="${#strings.concat('readUserList[', idx.index,'].titleCd')}" th:value="${readUser.titleCd}">
|
||||
<input type="hidden" class="userNm" th:name="${#strings.concat('readUserList[', idx.index,'].userNm')}" th:value="${readUser.usernm}">
|
||||
<div class="col-1 rowSeq" th:text="${idx.count}"></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>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<select class="form-select form-select-sm" th:name="${#strings.concat('clearInfoList[', info.infoSeq,'].useDetail')}">
|
||||
<option value="">선택</option>
|
||||
<th:block th:each="code:${codeList}">
|
||||
<option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq info.useDetail}"></option>
|
||||
<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>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<div class="row">
|
||||
<div class="col-7 pe-0">
|
||||
<input type="text" class="form-control form-control-sm" th:name="${#strings.concat('clearInfoList[', info.infoSeq,'].price')}" th:value="${#numbers.formatInteger(info.price, 1)}">
|
||||
</div>
|
||||
<label class="col-auto">원</label>
|
||||
<div class="col-auto">
|
||||
<div class="col-2">
|
||||
<button type="button" class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue