Merge remote-tracking branch 'origin/master'
commit
8f59fc8238
|
|
@ -6,6 +6,8 @@ import com.dbnt.faisp.fipTarget.model.PartInfo;
|
|||
import com.dbnt.faisp.fipTarget.model.PartInfoFile;
|
||||
import com.dbnt.faisp.fipTarget.model.PartWork;
|
||||
import com.dbnt.faisp.fipTarget.model.PartWorkFile;
|
||||
import com.dbnt.faisp.fipTarget.model.VulnFile;
|
||||
import com.dbnt.faisp.fipTarget.model.Vulnerable;
|
||||
import com.dbnt.faisp.fipTarget.service.FipTargetService;
|
||||
import com.dbnt.faisp.organMgt.service.OrganConfigService;
|
||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||||
|
|
@ -363,8 +365,108 @@ public class FipTargetController {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//외사분실실적 끝
|
||||
//외사분실실적 끝
|
||||
//외사취약지 시작
|
||||
|
||||
@GetMapping("/vulnerableList")
|
||||
public ModelAndView vulnerableList(@AuthenticationPrincipal UserInfo loginUser,Vulnerable vulnerable, HttpServletResponse response) {
|
||||
ModelAndView mav = new ModelAndView("fipTarget/vulnerableList");
|
||||
|
||||
mav.addObject("vulnerableList", fipTargetService.selectVulnerableList(vulnerable));
|
||||
//메뉴권한 확인
|
||||
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/target/vulnerableList").get(0).getAccessAuth();
|
||||
mav.addObject("accessAuth", accessAuth);
|
||||
mav.addObject("searchParams", vulnerable);
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/vulnEditModal")
|
||||
public ModelAndView vulnEditModal(@AuthenticationPrincipal UserInfo loginUser,Vulnerable vulnerable) {
|
||||
ModelAndView mav = new ModelAndView("fipTarget/vulnEditModal");
|
||||
vulnerable.setDownOrganCdList(loginUser.getDownOrganCdList());
|
||||
mav.addObject("organList", fipTargetService.selecetVulnOrganList(vulnerable));
|
||||
mav.addObject("userOrgan", loginUser.getOgCd());
|
||||
if(vulnerable.getVulnKey() != null) {
|
||||
vulnerable = fipTargetService.selectVulnInfo(vulnerable);
|
||||
vulnerable.setFileList(fipTargetService.selectVulnFile(vulnerable.getVulnKey()));
|
||||
mav.addObject("userId", loginUser.getUserId());
|
||||
}
|
||||
//메뉴권한 확인
|
||||
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/target/vulnerableList").get(0).getAccessAuth();
|
||||
mav.addObject("accessAuth", accessAuth);
|
||||
vulnerable.setWrtNm(loginUser.getUserId());
|
||||
vulnerable.setWrtPart(loginUser.getOfcCd());
|
||||
vulnerable.setWrtUserSeq(loginUser.getUserSeq());
|
||||
vulnerable.setWrtOrgan(loginUser.getOgCd());
|
||||
mav.addObject("info", vulnerable);
|
||||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/saveVulnerable")
|
||||
public Integer saveVulnerable (@AuthenticationPrincipal UserInfo loginUser, Vulnerable vulnerable,MultipartHttpServletRequest request,
|
||||
@RequestParam(value = "fileSeq", required = false) List < Integer > deleteFileSeq){
|
||||
vulnerable.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
|
||||
vulnerable.setWrtDt(LocalDateTime.now());
|
||||
Integer result = fipTargetService.saveVulnerable(vulnerable,deleteFileSeq);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/vulnInfoModal")
|
||||
public ModelAndView vulnInfoModal(@AuthenticationPrincipal UserInfo loginUser,Vulnerable vulnerable) {
|
||||
ModelAndView mav = new ModelAndView("fipTarget/vulnInfoModal");
|
||||
vulnerable.setDownOrganCdList(loginUser.getDownOrganCdList());;
|
||||
mav.addObject("vulnInfoList", fipTargetService.selectVulnInfoList(vulnerable));
|
||||
mav.addObject("organNm", fipTargetService.selectOrganName(vulnerable.getMgtOrgan()));
|
||||
//메뉴권한 확인
|
||||
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/target/vulnerableList").get(0).getAccessAuth();
|
||||
mav.addObject("accessAuth", accessAuth);
|
||||
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/vulnViewModal")
|
||||
public ModelAndView vulnViewModal(@AuthenticationPrincipal UserInfo loginUser,Vulnerable vulnerable) {
|
||||
ModelAndView mav = new ModelAndView("fipTarget/vulnViewModal");
|
||||
Vulnerable vulnInfo = fipTargetService.selectVulnInfo(vulnerable);
|
||||
vulnInfo.setFileList(fipTargetService.selectVulnFile(vulnInfo.getVulnKey()));
|
||||
mav.addObject("vulnInfo", vulnInfo);
|
||||
//메뉴권한 확인
|
||||
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/target/vulnerableList").get(0).getAccessAuth();
|
||||
mav.addObject("accessAuth", accessAuth);
|
||||
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/vulnFileDownload")
|
||||
public void vulnFileDownload(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
Integer fileSeq,
|
||||
Integer vulnKey) {
|
||||
VulnFile downloadFile = fipTargetService.selectVulnInfoFileDown(fileSeq, vulnKey);
|
||||
|
||||
BufferedInputStream in;
|
||||
BufferedOutputStream out;
|
||||
try {
|
||||
File file = new File(downloadFile.getFilePath(), downloadFile.getConvNm());
|
||||
|
||||
setDisposition(downloadFile.getOrigNm()+'.'+downloadFile.getFileExtn(), request, response);
|
||||
in = new BufferedInputStream(new FileInputStream(file));
|
||||
out = new BufferedOutputStream(response.getOutputStream());
|
||||
FileCopyUtils.copy(in, out);
|
||||
out.flush();
|
||||
if(out!=null) out.close();
|
||||
if(in!=null )in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/deleteVulnerable")
|
||||
@ResponseBody
|
||||
public void deleteVulnerable(@RequestBody Vulnerable vulnerable) {
|
||||
fipTargetService.deleteVulnerable(vulnerable);
|
||||
}
|
||||
//외사취약지 끝
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.dbnt.faisp.fipTarget.mapper;
|
|||
import com.dbnt.faisp.fipTarget.model.PartInfo;
|
||||
import com.dbnt.faisp.fipTarget.model.PartInfoFile;
|
||||
import com.dbnt.faisp.fipTarget.model.PartWork;
|
||||
import com.dbnt.faisp.fipTarget.model.Vulnerable;
|
||||
import com.dbnt.faisp.util.ParamMap;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -40,6 +41,16 @@ public interface FipTargetMapper {
|
|||
|
||||
PartWork selectPartWorkInfo(PartWork partWork);
|
||||
|
||||
List<ParamMap> selecetVulnOrganList(Vulnerable vulnerable);
|
||||
|
||||
List<ParamMap> selectVulnerableList(Vulnerable vulnerable);
|
||||
|
||||
List<Vulnerable> selectVulnInfoList(Vulnerable vulnerable);
|
||||
|
||||
String selectOrganName(String mgtOrgan);
|
||||
|
||||
Vulnerable selectVulnInfo(Vulnerable vulnerable);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
package com.dbnt.faisp.fipTarget.model;
|
||||
|
||||
import com.dbnt.faisp.config.BaseModel;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
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 javax.persistence.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@IdClass(VulnFile.VulnFileId.class)
|
||||
@Table(name = "vuln_file")
|
||||
public class VulnFile extends BaseModel implements Serializable{
|
||||
@Id
|
||||
@Column(name = "file_seq")
|
||||
private Integer fileSeq;
|
||||
@Id
|
||||
@Column(name = "vuln_key")
|
||||
private Integer vulnKey;
|
||||
@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 = "file_path")
|
||||
private String filePath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VulnFile [fileSeq=" + fileSeq + ", vulnKey=" + vulnKey + ", origNm=" + origNm + ", convNm=" + convNm
|
||||
+ ", fileExtn=" + fileExtn + ", fileSize=" + fileSize + ", filePath=" + filePath + "]";
|
||||
}
|
||||
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class VulnFileId implements Serializable {
|
||||
private Integer fileSeq;
|
||||
private Integer vulnKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.dbnt.faisp.fipTarget.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.web.multipart.MultipartFile;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "board_vuln")
|
||||
public class Vulnerable extends BaseModel{
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "vuln_key")
|
||||
private Integer vulnKey;
|
||||
@Column(name = "mgt_organ")
|
||||
private String mgtOrgan;
|
||||
@Column(name = "vuln_type")
|
||||
private String vulnType;
|
||||
@Column(name = "vuln_nm")
|
||||
private String vulnNm;
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
@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_nm")
|
||||
private String wrtNm;
|
||||
@Column(name = "wrt_dt")
|
||||
private LocalDateTime wrtDt;
|
||||
|
||||
@Transient
|
||||
private List<MultipartFile> multipartFileList;
|
||||
|
||||
@Transient
|
||||
private String organNm;
|
||||
|
||||
@Transient
|
||||
private List<VulnFile> fileList;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Vulnerable [vulnKey=" + vulnKey + ", mgtOrgan=" + mgtOrgan + ", vulnType=" + vulnType + ", vulnNm=" + vulnNm
|
||||
+ ", description=" + description + ", wrtOrgan=" + wrtOrgan + ", wrtPart=" + wrtPart + ", wrtUserSeq="
|
||||
+ wrtUserSeq + ", wrtNm=" + wrtNm + ", wrtDt=" + wrtDt + ", multipartFileList=" + multipartFileList
|
||||
+ ", organNm=" + organNm + ", fileList=" + fileList + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.dbnt.faisp.fipTarget.repository;
|
||||
|
||||
|
||||
import com.dbnt.faisp.fipTarget.model.VulnFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
|
||||
|
||||
public interface VulnFileRepository extends JpaRepository<VulnFile, VulnFile.VulnFileId> {
|
||||
|
||||
VulnFile findTopByVulnKeyOrderByFileSeqDesc(Integer vulnKey);
|
||||
|
||||
List<VulnFile> findByVulnKeyOrderByFileSeq(Integer vulnKey);
|
||||
|
||||
List<VulnFile> findByVulnKey(Integer vulnKey);
|
||||
|
||||
void deleteByVulnKey(Integer vulnKey);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.dbnt.faisp.fipTarget.repository;
|
||||
|
||||
|
||||
import com.dbnt.faisp.fipTarget.model.Vulnerable;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
|
||||
|
||||
public interface VulnRepository extends JpaRepository<Vulnerable, Integer> {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -12,10 +12,16 @@ import com.dbnt.faisp.fipTarget.model.PartWork;
|
|||
import com.dbnt.faisp.fipTarget.model.PartWork.PartWorkId;
|
||||
import com.dbnt.faisp.fipTarget.model.PartWorkFile;
|
||||
import com.dbnt.faisp.fipTarget.model.PartWorkFile.PartWorkFileId;
|
||||
import com.dbnt.faisp.fipTarget.model.VulnFile;
|
||||
import com.dbnt.faisp.fipTarget.model.VulnFile.VulnFileId;
|
||||
import com.dbnt.faisp.fipTarget.model.Vulnerable;
|
||||
import com.dbnt.faisp.fipTarget.repository.PartInfoFileRepository;
|
||||
import com.dbnt.faisp.fipTarget.repository.PartInfoRepository;
|
||||
import com.dbnt.faisp.fipTarget.repository.PartWorkFileRepository;
|
||||
import com.dbnt.faisp.fipTarget.repository.PartWorkRepository;
|
||||
import com.dbnt.faisp.fipTarget.repository.VulnFileRepository;
|
||||
import com.dbnt.faisp.fipTarget.repository.VulnRepository;
|
||||
import com.dbnt.faisp.publicBoard.model.PublicFile;
|
||||
import com.dbnt.faisp.util.ParamMap;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -38,6 +44,8 @@ public class FipTargetService extends BaseService {
|
|||
private final PartInfoFileRepository partInfoFileRepository;
|
||||
private final PartWorkRepository partWorkRepository;
|
||||
private final PartWorkFileRepository partWorkFileRepository;
|
||||
private final VulnRepository vulnRepository;
|
||||
private final VulnFileRepository vulnFileRepository;
|
||||
private final FipTargetMapper fipTargetMapper;
|
||||
|
||||
@Transactional
|
||||
|
|
@ -314,7 +322,91 @@ public class FipTargetService extends BaseService {
|
|||
public PartWorkFile selectPartWorkFileDown(Integer fileSeq, Integer pwSeq, Integer piSeq) {
|
||||
return partWorkFileRepository.findById(new PartWorkFileId(fileSeq, pwSeq,piSeq)).orElse(null);
|
||||
}
|
||||
|
||||
|
||||
public List<ParamMap> selecetVulnOrganList(Vulnerable vulnerable) {
|
||||
return fipTargetMapper.selecetVulnOrganList(vulnerable);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Integer saveVulnerable(Vulnerable vulnerable, List<Integer> deleteFileSeq) {
|
||||
Integer vulnKey = vulnRepository.save(vulnerable).getVulnKey();
|
||||
if(deleteFileSeq!=null && deleteFileSeq.size()>0){
|
||||
deleteVulnFile(vulnerable, deleteFileSeq);
|
||||
}
|
||||
if(vulnerable.getMultipartFileList()!= null){
|
||||
saveVulnerableFiles(vulnKey, vulnerable.getMultipartFileList());
|
||||
}
|
||||
return vulnKey;
|
||||
}
|
||||
|
||||
private void saveVulnerableFiles(Integer vulnKey, List<MultipartFile> multipartFileList) {
|
||||
VulnFile lastFileInfo = vulnFileRepository.findTopByVulnKeyOrderByFileSeqDesc(vulnKey);
|
||||
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
|
||||
for(MultipartFile file : multipartFileList){
|
||||
String saveName = UUID.randomUUID().toString();
|
||||
String path = locationPath+File.separator+"publicFile"+File.separator;
|
||||
saveFile(file, new File(path+File.separator+saveName));
|
||||
|
||||
String originalFilename = file.getOriginalFilename();
|
||||
int extnIdx = originalFilename.lastIndexOf(".");
|
||||
VulnFile fileInfo = new VulnFile();
|
||||
fileInfo.setVulnKey(vulnKey);
|
||||
fileInfo.setFileSeq(fileSeq++);
|
||||
fileInfo.setOrigNm(originalFilename.substring(0, extnIdx));
|
||||
fileInfo.setFileExtn(originalFilename.substring(extnIdx+1));
|
||||
fileInfo.setConvNm(saveName);
|
||||
fileInfo.setFileSize(calculationSize(file.getSize()));
|
||||
fileInfo.setFilePath(path);
|
||||
vulnFileRepository.save(fileInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteVulnFile(Vulnerable vulnerable, List<Integer> deleteFileSeq) {
|
||||
List<VulnFile> VulnFileList = vulnFileRepository.findByVulnKey(vulnerable.getVulnKey());
|
||||
for(VulnFile file: VulnFileList ){
|
||||
if(deleteFileSeq.contains(file.getFileSeq())){
|
||||
deleteStoredFile(new File(file.getFilePath(), file.getConvNm()));
|
||||
vulnFileRepository.delete(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<ParamMap> selectVulnerableList(Vulnerable vulnerable) {
|
||||
return fipTargetMapper.selectVulnerableList(vulnerable);
|
||||
}
|
||||
|
||||
public List<Vulnerable> selectVulnInfoList(Vulnerable vulnerable) {
|
||||
return fipTargetMapper.selectVulnInfoList(vulnerable);
|
||||
}
|
||||
|
||||
public String selectOrganName(String mgtOrgan) {
|
||||
return fipTargetMapper.selectOrganName(mgtOrgan);
|
||||
}
|
||||
|
||||
public Vulnerable selectVulnInfo(Vulnerable vulnerable) {
|
||||
return fipTargetMapper.selectVulnInfo(vulnerable);
|
||||
}
|
||||
|
||||
public List<VulnFile> selectVulnFile(Integer vulnKey) {
|
||||
return vulnFileRepository.findByVulnKeyOrderByFileSeq(vulnKey);
|
||||
}
|
||||
|
||||
public VulnFile selectVulnInfoFileDown(Integer fileSeq, Integer vulnKey) {
|
||||
return vulnFileRepository.findById(new VulnFileId(fileSeq, vulnKey)).orElse(null);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteVulnerable(Vulnerable vulnerable) {
|
||||
//파일삭제
|
||||
List<VulnFile> VulnFileList = vulnFileRepository.findByVulnKey(vulnerable.getVulnKey());
|
||||
if(VulnFileList != null) {
|
||||
for(VulnFile file: VulnFileList){
|
||||
deleteStoredFile(new File(file.getFilePath(), file.getConvNm()));
|
||||
}
|
||||
}
|
||||
vulnFileRepository.deleteByVulnKey(vulnerable.getVulnKey());
|
||||
vulnRepository.deleteById(vulnerable.getVulnKey());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -437,5 +437,96 @@
|
|||
and pw.pw_seq = #{pwSeq}
|
||||
and pw.pi_seq = #{piSeq}
|
||||
</select>
|
||||
|
||||
<select id="selecetVulnOrganList" resultType="com.dbnt.faisp.util.ParamMap" parameterType="Vulnerable">
|
||||
select item_cd,
|
||||
item_value
|
||||
from code_mgt cm,
|
||||
organ_config oc
|
||||
where cm.item_cd = oc.organ_cd
|
||||
and oc.organ_type = 'OGC003'
|
||||
and cm.use_chk = 'T'
|
||||
and item_cd in
|
||||
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by item_cd asc
|
||||
</select>
|
||||
|
||||
<select id="selectVulnerableList" resultType="com.dbnt.faisp.util.ParamMap" parameterType="Vulnerable">
|
||||
select gubun,
|
||||
parent_organ,
|
||||
item_cd,
|
||||
item_value,
|
||||
sum(A) as A,
|
||||
sum(B) as B,
|
||||
sum(C) as C
|
||||
from(
|
||||
select gubun,
|
||||
parent_organ,
|
||||
item_cd,
|
||||
item_value,
|
||||
case
|
||||
when bv.vuln_type = 'VULNT001' then 1
|
||||
else 0
|
||||
end as A,
|
||||
case
|
||||
when bv.vuln_type = 'VULNT002' then 1
|
||||
else 0
|
||||
end as B,
|
||||
case
|
||||
when bv.vuln_type = 'VULNT003' then 1
|
||||
else 0
|
||||
end as C
|
||||
from(
|
||||
select (select item_value from code_mgt cm2 where cm2.item_cd = oc.parent_organ) as gubun,
|
||||
oc.parent_organ,
|
||||
item_cd,
|
||||
item_value
|
||||
from code_mgt cm,
|
||||
organ_config oc
|
||||
where cm.item_cd = oc.organ_cd
|
||||
and oc.organ_type not in ('OGC001')
|
||||
and oc.organ_type = 'OGC003'
|
||||
) a left outer join board_vuln bv
|
||||
on a.item_cd = bv.mgt_organ
|
||||
) a
|
||||
group by gubun,parent_organ,item_cd,item_value
|
||||
order by parent_organ
|
||||
</select>
|
||||
|
||||
<select id="selectVulnInfoList" resultType="Vulnerable" parameterType="Vulnerable">
|
||||
select vuln_key,
|
||||
mgt_organ,
|
||||
vuln_nm,
|
||||
(select item_value from code_mgt where item_cd = vuln_type) as vuln_type,
|
||||
wrt_nm,
|
||||
wrt_dt
|
||||
from board_vuln
|
||||
where mgt_organ = #{mgtOrgan}
|
||||
and mgt_organ in
|
||||
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by wrt_dt desc
|
||||
</select>
|
||||
|
||||
<select id="selectOrganName" resultType="String" parameterType="String">
|
||||
select item_value
|
||||
from code_mgt
|
||||
where item_cd = #{mgtOrgan}
|
||||
</select>
|
||||
|
||||
<select id="selectVulnInfo" resultType="Vulnerable" parameterType="Vulnerable">
|
||||
select vuln_key,
|
||||
vuln_nm,
|
||||
mgt_organ,
|
||||
(select item_value from code_mgt where item_cd = vuln_type) as vuln_type,
|
||||
description,
|
||||
wrt_nm,
|
||||
wrt_dt
|
||||
from board_vuln
|
||||
where vuln_key = #{vulnKey}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,198 @@
|
|||
let files = [];
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".table_id").each(function(){
|
||||
var rows = $(".table_id:contains('"+$(this).text()+"')");
|
||||
if(rows.length > 1){
|
||||
rows.eq(0).attr("rowspan", rows.length);
|
||||
rows.not(":eq(0)").remove();
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '#addVuln', function (){
|
||||
const vulnKey =null;
|
||||
vulnEditModal(vulnKey);
|
||||
})
|
||||
|
||||
function vulnEditModal(vulnKey){
|
||||
$.ajax({
|
||||
url: '/target/vulnEditModal',
|
||||
type: 'GET',
|
||||
data: {vulnKey:vulnKey},
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#vulnEditModalContent").empty().append(html);
|
||||
$("#vulnEditModal").modal('show');
|
||||
setUploadDiv();
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('click', '#saveVuln', function() {
|
||||
if (Validation()) {
|
||||
if (confirm("저장하시겠습니까?")) {
|
||||
document.getElementById("mgtOrgan").disabled = false;
|
||||
contentFade("in");
|
||||
const formData = new FormData($("#saveVulnoFm")[0]);
|
||||
for (const file of files) {
|
||||
if (!file.isDelete)
|
||||
formData.append('uploadFiles', file, file.name);
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
url: "/target/saveVulnerable",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(result) {
|
||||
alert("저장되었습니다.");
|
||||
contentFade("out");
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status) {
|
||||
alert("저장에 실패하였습니다.")
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on('click', '#infoModal', function (){
|
||||
const mgtOrgan = $(this).attr("data-mgtOrgan");
|
||||
|
||||
$.ajax({
|
||||
url: '/target/vulnInfoModal',
|
||||
type: 'GET',
|
||||
data: {mgtOrgan:mgtOrgan},
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#vulnEditModalContent").empty().append(html);
|
||||
$("#vulnEditModal").modal('show');
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$(document).on('click', '#viewModal', function (){
|
||||
const vulnKey = $(this).attr("data-vulnKey");
|
||||
|
||||
$.ajax({
|
||||
url: '/target/vulnViewModal',
|
||||
type: 'GET',
|
||||
data: {vulnKey:vulnKey},
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#vulnEditModalContent").empty().append(html);
|
||||
$("#vulnEditModal").modal('show');
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$(document).on('click', '#fileDown', function (){
|
||||
const target = $(this)
|
||||
let url = "/target/vulnFileDownload?"
|
||||
url += "&fileSeq="+target.attr("data-fileSeq");
|
||||
url += "&vulnKey="+target.attr("data-vulnKey");
|
||||
window.open(encodeURI(url));
|
||||
})
|
||||
|
||||
$(document).on('click', '#deleteVuln', function (){
|
||||
const vulnKey = $('input[name=vulnKey]').val();
|
||||
if(confirm("삭제하시겠습니까?")){
|
||||
contentFade("in");
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : "/target/deleteVulnerable",
|
||||
data : JSON.stringify({vulnKey:vulnKey}),
|
||||
contentType: 'application/json',
|
||||
beforeSend: function (xhr){
|
||||
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||
},
|
||||
success : function(data) {
|
||||
alert("삭제 처리되었습니다.");
|
||||
location.reload();
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("삭제 처리에 실패하였습니다");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$(document).on('click', '#goEdit', function (){
|
||||
const vulnKey = $(this).attr("data-vulnKey");
|
||||
vulnEditModal(vulnKey);
|
||||
})
|
||||
|
||||
$(document).on('click', '#updateVuln', function (){
|
||||
if(Validation()){
|
||||
if(confirm("수정하시겠습니까?")){
|
||||
contentFade("in");
|
||||
const formData = new FormData($("#saveVulnoFm")[0]);
|
||||
document.getElementById("mgtOrgan").disabled = false;
|
||||
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 : "/target/saveVulnerable",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success : function(data) {
|
||||
alert("수정되었습니다.");
|
||||
contentFade("out");
|
||||
vulnEditModal(data)
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("수정에 실패하였습니다.")
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function Validation(){
|
||||
let flag = true;
|
||||
if($('#mgtOrgan').val() == ""){
|
||||
alert("경찰서를 선택해주세요.");
|
||||
$('#mgtOrgan').focus();
|
||||
flag = false;
|
||||
}
|
||||
if($('#vulnNm').val() == ""){
|
||||
alert("취약지명을 입력해주세요.");
|
||||
$('#vulnNm').focus();
|
||||
flag = false;
|
||||
}
|
||||
if($('#vulnType').val() == ""){
|
||||
alert("취약등급을 선택해 주세요.");
|
||||
$('#vulnType').focus();
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
$(document).on('click', '#btn-close', function (){
|
||||
location.reload();
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="menuEditModalLabel" th:text="${info.vulnKey eq null?'외사취약지 등록':'외사취약지 수정'}"></h5>
|
||||
<th:block th:if="${info.vulnKey eq null}">
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</th:block>
|
||||
<th:block th:unless="${info.vulnKey eq null}">
|
||||
<button type="button" class="btn-close" id="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</th:block>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="saveVulnoFm" method="post">
|
||||
<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="vulnKey" th:value="${info.vulnKey}">
|
||||
<input type="hidden" name="wrtOrgan" th:value="${info.wrtOrgan}">
|
||||
<input type="hidden" name="wrtPart" th:value="${info.wrtPart}">
|
||||
<input type="hidden" name="wrtUserSeq" th:value="${info.wrtUserSeq}">
|
||||
<input type="hidden" name="wrtNm" th:value="${info.wrtNm}">
|
||||
<div class="mb-3 row">
|
||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">경찰서</label>
|
||||
<div class="col-sm-3">
|
||||
<select class="form-select form-select-sm" id="mgtOrgan" name="mgtOrgan" th:disabled="${accessAuth ne 'ACC003'}">
|
||||
<option value="">선택</option>
|
||||
<th:block th:each="organList:${organList}">
|
||||
<th:block th:if="${info.vulnKey eq null}">
|
||||
<option th:value="${organList.item_cd}" th:text="${organList.item_value}" th:selected="${organList.item_cd eq userOrgan}"></option>
|
||||
</th:block>
|
||||
<th:block th:unless="${info.vulnKey eq null}">
|
||||
<option th:value="${organList.item_cd}" th:text="${organList.item_value}" th:selected="${organList.item_cd eq info.mgtOrgan}"></option>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">취약지명</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="vulnNm" name="vulnNm" th:value="${info.vulnNm}" placeholder="직접입력">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">취약등급</label>
|
||||
<div class="col-sm-3">
|
||||
<select class="form-select form-select-sm" id="vulnType" name="vulnType">
|
||||
<option value="">선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('VULNT')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemValue eq info.vulnType}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">비고</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="description" name="description" th:value="${info.description}">
|
||||
</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(info.fileList)}">
|
||||
<br>파일을 업로드 해주세요.
|
||||
</th:block>
|
||||
<th:block th:unless="${#arrays.isEmpty(info.fileList)}">
|
||||
<div class='row-col-6' th:each="infoFile:${info.fileList}">
|
||||
<span th:data-fileseq="${infoFile.fileSeq}" th:text="|${infoFile.origNm}.${infoFile.fileExtn} ${infoFile.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>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<div class="col-auto">
|
||||
<th:block th:if="${info.vulnKey eq null}">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary" id="saveVuln">저장</button>
|
||||
</th:block>
|
||||
<th:block th:unless="${info.vulnKey eq null}">
|
||||
<button type="button" id="btn-close" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-danger" id="deleteVuln" th:if="${accessAuth eq 'ACC003'} or ${info.wrtNm eq userId}">삭제</button>
|
||||
<button type="button" class="btn btn-primary" id="updateVuln" th:if="${accessAuth eq 'ACC003'} or ${info.wrtNm eq userId}">수정</button>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="menuEditModalLabel"
|
||||
th:text="|${organNm} 취약지 상세|"></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<table class="table table-striped" id="categoryTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>취약지명</th>
|
||||
<th>취약등급</th>
|
||||
<th>작성자</th>
|
||||
<th>작성일/수정일</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="info:${vulnInfoList}">
|
||||
<td id="viewModal" style="color: blue; cursor:pointer;" th:data-vulnKey="${info.vulnKey}" th:text="${info.vulnNm}"></td>
|
||||
<td th:text="${info.vulnType}"></td>
|
||||
<td th:text="${info.wrtNm}"></td>
|
||||
<td
|
||||
th:text="${#temporals.format(info.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="menuEditModalLabel" th:text="|${vulnInfo.vulnNm} 관리카드|"></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<table class="table table-striped" id="categoryTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>취약지명</th>
|
||||
<th>취약등급</th>
|
||||
<th>작성자</th>
|
||||
<th>작성일/수정일</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td id="goEdit" th:data-vulnKey="${vulnInfo.vulnKey}" style="color: blue; cursor:pointer;" th:text="${vulnInfo.vulnNm}"></td>
|
||||
<td th:text="${vulnInfo.vulnType}"></td>
|
||||
<td th:text="${vulnInfo.wrtNm}"></td>
|
||||
<td th:text="${#temporals.format(vulnInfo.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">비고</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" th:value="${vulnInfo.description}" disabled>
|
||||
</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">
|
||||
<th:block th:if="${#arrays.isEmpty(vulnInfo.fileList)}">
|
||||
업로드된 파일이 없습니다.
|
||||
</th:block>
|
||||
<th:block th:unless="${#arrays.isEmpty(vulnInfo.fileList)}">
|
||||
<div class='row-col-6' th:each="infoFile:${vulnInfo.fileList}">
|
||||
<a href='#' id="fileDown" th:data-fileseq="${infoFile.fileSeq}" th:data-vulnKey="${infoFile.vulnKey}" th:text="|${infoFile.origNm}.${infoFile.fileExtn} ${infoFile.fileSize}|"></a>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<!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/fipTarget/vulnerable.js}"></script>
|
||||
</th:block>
|
||||
<div layout:fragment="content">
|
||||
<main class="pt-3">
|
||||
<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">
|
||||
<form method="get" th:action="@{/userMgt/userMgtPage}">
|
||||
<input type="hidden" name="userStatus" id="userStatus" >
|
||||
<div class="row justify-content-between pe-3 py-1">
|
||||
<div class="col-auto">
|
||||
<div class="row justify-content-end">
|
||||
</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-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">구분</th>
|
||||
<th rowspan="2">경찰서</th>
|
||||
<th colspan="3">취약등급</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>A급</th>
|
||||
<th>B급</th>
|
||||
<th>C급</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="" th:each="vuln:${vulnerableList}">
|
||||
<td class="table_id" th:text="${vuln.gubun}"></td>
|
||||
<td id="infoModal" style="color: blue; cursor:pointer;" th:data-mgtOrgan="${vuln.item_cd}" th:text="${vuln.item_value}"></td>
|
||||
<td th:text="${vuln.a}"></td>
|
||||
<td th:text="${vuln.b}"></td>
|
||||
<td th:text="${vuln.c}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="button" class="btn btn-success" value="작성" id="addVuln" th:unless="${accessAuth eq 'ACC001'}">
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="modal fade" id="vulnEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userEditModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-scrollable">
|
||||
<div class="modal-content" id="vulnEditModalContent">
|
||||
<div class="modal-header">
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="tab-content border border-top-0" id="configInfo">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</html>
|
||||
Loading…
Reference in New Issue