diff --git a/src/main/java/com/dbnt/faisp/config/FileController.java b/src/main/java/com/dbnt/faisp/config/FileController.java index 6e81561a..71129c38 100644 --- a/src/main/java/com/dbnt/faisp/config/FileController.java +++ b/src/main/java/com/dbnt/faisp/config/FileController.java @@ -10,7 +10,7 @@ import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.service.IntelligenceNetworkService; import com.dbnt.faisp.main.fpiMgt.monitoring.service.MonitoringService; import com.dbnt.faisp.main.faRpt.service.SriService; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.IvsgtService; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.service.MajorStatusService; import com.dbnt.faisp.main.publicBoard.service.PublicBoardService; import lombok.RequiredArgsConstructor; @@ -48,7 +48,7 @@ public class FileController extends BaseService{ private final PublicBoardService publicBoardService; private final AffairService affairService; private final ResultService resultService; - private final BoardInvestigationService boardInvestigationService; + private final IvsgtService ivsgtService; private final FishingBoatService fishingBoatService; private final SailorService sailorService; private final SriService sriService; @@ -212,7 +212,7 @@ public class FileController extends BaseService{ downloadFile = resultService.selectResultFile(parentKey, fileSeq); break; case "ivsgt": - downloadFile = boardInvestigationService.selectIvsgtFile(parentKey, fileSeq); + downloadFile = ivsgtService.selectIvsgtFile(parentKey, fileSeq); break; case "sailor": downloadFile = sailorService.selectSailorFile(parentKey, fileSeq); diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/mapper/AsfCovMapper.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/mapper/AsfCovMapper.java index 71a1ae50..2e48ba7c 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/mapper/AsfCovMapper.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/mapper/AsfCovMapper.java @@ -1,7 +1,6 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.asfCov.AsfCov; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.ArrestType; import org.apache.ibatis.annotations.Mapper; diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java index 558a07a1..861e6608 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java @@ -1,10 +1,9 @@ package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation; import com.dbnt.faisp.main.authMgt.service.AuthMgtService; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.ArrestType; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.BoardInvestigation; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.RelatedReports; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationBoard; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationRelatedReports; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.IvsgtService; import com.dbnt.faisp.main.userInfo.model.UserInfo; import lombok.RequiredArgsConstructor; import org.springframework.security.core.annotation.AuthenticationPrincipal; @@ -20,76 +19,80 @@ import java.util.List; @RequestMapping("/ivsgt") public class IvsgtController { - private final AuthMgtService authMgtService; - private final BoardInvestigationService boardInvestigationService; + private final AuthMgtService authMgtService; + private final IvsgtService ivsgtService; - @GetMapping("/{ivsgtType}") - public ModelAndView arrest(@AuthenticationPrincipal UserInfo loginUser, @PathVariable("ivsgtType") String ivsgtType, BoardInvestigation boardInvestigation) { - ModelAndView mav = new ModelAndView("ivsgt/ivsgt"); - boardInvestigation.setIvsgtType(ivsgtType); + @GetMapping("/{ivsgtType}") + public ModelAndView arrest(@AuthenticationPrincipal UserInfo loginUser, @PathVariable("ivsgtType") String ivsgtType, InvestigationBoard investigationBoard) { + ModelAndView mav = new ModelAndView("ivsgt/ivsgt"); + investigationBoard.setIvsgtType(ivsgtType); - //메뉴권한 확인 - String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth(); + //메뉴권한 확인 + String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth(); - mav.addObject("accessAuth", accessAuth); - mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); - - boardInvestigation.setDownOrganCdList(loginUser.getDownOrganCdList()); - boardInvestigation.setQueryInfo(); - mav.addObject("boardInvestigationList", boardInvestigationService.selectBoardInvestigationList(boardInvestigation)); - boardInvestigation.setContentCnt(boardInvestigationService.selectBoardInvestigationListCnt(boardInvestigation)); - boardInvestigation.setPaginationInfo(); - mav.addObject("searchParams", boardInvestigation); - return mav; + mav.addObject("accessAuth", accessAuth); + mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); + + investigationBoard.setDownOrganCdList(loginUser.getDownOrganCdList()); + investigationBoard.setQueryInfo(); + mav.addObject("investigationList", ivsgtService.selectBoardInvestigationList(investigationBoard)); + investigationBoard.setContentCnt(ivsgtService.selectBoardInvestigationListCnt(investigationBoard)); + investigationBoard.setPaginationInfo(); + mav.addObject("searchParams", investigationBoard); + return mav; + } + + @GetMapping("/ivsgtEditModal") + public ModelAndView ivsgtEditModal(@AuthenticationPrincipal UserInfo loginUser, InvestigationBoard investigationBoard){ + ModelAndView mav = new ModelAndView("ivsgt/ivsgtEditModal"); + if(investigationBoard.getIvsgtKey()!=null){ + investigationBoard = ivsgtService.selectBoardInvestigation(investigationBoard.getIvsgtKey()); + }else{ + + investigationBoard.setWrtOrgan(loginUser.getOgCd()); + investigationBoard.setWrtPart(loginUser.getOfcCd()); + investigationBoard.setWrtUserSeq(loginUser.getUserSeq()); + investigationBoard.setWrtUserGrd(loginUser.getTitleCd()); + investigationBoard.setWrtUserNm(loginUser.getUserNm()); + investigationBoard.setWrtDt(LocalDateTime.now()); } + mav.addObject("investigation", investigationBoard); + return mav; + } - @GetMapping("/ivsgtEditModal") - public ModelAndView ivsgtEditModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ - ModelAndView mav = new ModelAndView("ivsgt/ivsgtEditModal"); - if(boardInvestigation.getIvsgtKey()!=null){ - boardInvestigation = boardInvestigationService.selectBoardInvestigation(boardInvestigation.getIvsgtKey()); - }else{ - boardInvestigation.setWrtOrgan(loginUser.getOgCd()); - boardInvestigation.setWrtNm(loginUser.getUserNm()); - boardInvestigation.setWrtDt(LocalDateTime.now()); - } - mav.addObject("boardInvestigation", boardInvestigation); - return mav; - } + @GetMapping("/ivsgtViewModal") + public ModelAndView ivsgtViewModal(@AuthenticationPrincipal UserInfo loginUser, InvestigationBoard investigationBoard){ + ModelAndView mav = new ModelAndView("ivsgt/ivsgtViewModal"); + investigationBoard = ivsgtService.selectBoardInvestigation(investigationBoard.getIvsgtKey()); + mav.addObject("boardInvestigation", investigationBoard); + mav.addObject("userSeq",loginUser.getUserSeq()); + //메뉴권한 확인 + mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth()); + return mav; + } - @GetMapping("/ivsgtViewModal") - public ModelAndView ivsgtViewModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ - ModelAndView mav = new ModelAndView("ivsgt/ivsgtViewModal"); - boardInvestigation = boardInvestigationService.selectBoardInvestigation(boardInvestigation.getIvsgtKey()); - mav.addObject("boardInvestigation", boardInvestigation); - mav.addObject("userSeq",loginUser.getUserSeq()); - //메뉴권한 확인 - mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth()); - return mav; - } + @PostMapping("/saveBoardInvestigation") + public Integer saveBoardInvestigation(@AuthenticationPrincipal UserInfo loginUser, + InvestigationBoard investigationBoard, + InvestigationRelatedReports relatedReports, + MultipartHttpServletRequest request, + @RequestParam(value = "fileSeq", required = false) List deleteFileSeq){ + investigationBoard.setWrtUserSeq(loginUser.getUserSeq()); + investigationBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles")); + return ivsgtService.saveBoardInvestigation(investigationBoard, relatedReports, deleteFileSeq); + } - @PostMapping("/saveBoardInvestigation") - public Integer saveBoardInvestigation(@AuthenticationPrincipal UserInfo loginUser, - BoardInvestigation boardInvestigation, - ArrestType arrestType, - RelatedReports relatedReports, - MultipartHttpServletRequest request, - @RequestParam(value = "fileSeq", required = false) List deleteFileSeq){ - boardInvestigation.setWrtUserSeq(loginUser.getUserSeq()); - boardInvestigation.setMultipartFileList(request.getMultiFileMap().get("uploadFiles")); - return boardInvestigationService.saveBoardInvestigation(boardInvestigation, arrestType, relatedReports, deleteFileSeq); - } - - @GetMapping("/searchViewModal") - public ModelAndView searchViewModal(@AuthenticationPrincipal UserInfo loginUser, BoardInvestigation boardInvestigation){ - ModelAndView mav = new ModelAndView("ivsgt/searchViewModal"); - mav.addObject("userSeq",loginUser.getUserSeq()); - //메뉴권한 확인 - mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth()); - - boardInvestigation.setIvsgtType(null); - mav.addObject("boardInvestigationList", boardInvestigationService.selectBoardInvestigationList(boardInvestigation)); - return mav; - } + @GetMapping("/searchViewModal") + public ModelAndView searchViewModal(@AuthenticationPrincipal UserInfo loginUser, InvestigationBoard investigationBoard){ + ModelAndView mav = new ModelAndView("ivsgt/searchViewModal"); + mav.addObject("userSeq",loginUser.getUserSeq()); + //메뉴권한 확인 + mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth()); + investigationBoard.setFirstIndex(0); + investigationBoard.setRowCnt(Integer.MAX_VALUE); + investigationBoard.setWrtUserSeq(loginUser.getUserSeq()); + mav.addObject("boardInvestigationList", ivsgtService.selectBoardInvestigationList(investigationBoard)); + return mav; + } } diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/mapper/BoardInvestigationMapper.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/mapper/BoardInvestigationMapper.java deleted file mode 100644 index 119a7ea6..00000000 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/mapper/BoardInvestigationMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.mapper; - -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.ArrestType; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.BoardInvestigation; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.RelatedReports; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -@Mapper -public interface BoardInvestigationMapper { - List selectBoardInvestigationList(BoardInvestigation boardInvestigation); - Integer selectBoardInvestigationListCnt(BoardInvestigation boardInvestigation); - String selectHashTags(Integer ivsgtKey); - ArrestType selectArrestType(Integer ivsgtKey); - List selectRelatedReportsList(Integer ivsgtKey); -} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/mapper/InvestigationBoardMapper.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/mapper/InvestigationBoardMapper.java new file mode 100644 index 00000000..409f4443 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/mapper/InvestigationBoardMapper.java @@ -0,0 +1,15 @@ +package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.mapper; + +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationBoard; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationRelatedReports; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface InvestigationBoardMapper { + List selectInvestigationBoardList(InvestigationBoard investigationBoard); + Integer selectInvestigationBoardListCnt(InvestigationBoard investigationBoard); + String selectHashTags(Integer ivsgtKey); + List selectRelatedReportsList(Integer ivsgtKey); +} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/ArrestType.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/ArrestType.java deleted file mode 100644 index 8b116a52..00000000 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/ArrestType.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model; - -import com.dbnt.faisp.config.BaseModel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.hibernate.annotations.DynamicInsert; -import org.hibernate.annotations.DynamicUpdate; - -import javax.persistence.*; - -@Getter -@Setter -@Entity -@NoArgsConstructor -@DynamicInsert -@DynamicUpdate -@Table(name = "arrest_type") -public class ArrestType extends BaseModel { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "arrest_type_key") - private Integer arrestTypeKey; - @Column(name = "ivsgt_key") - private Integer ivsgtKey; - @Column(name = "arrest_cd") - private String arrestCd; - @Column(name = "arrest_cd2") - private String arrestCd2; - - @Transient - private String arrestCdName; - @Transient - private String arrestCd2Name; -} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/BoardInvestigation.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/BoardInvestigation.java deleted file mode 100644 index 16a48193..00000000 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/BoardInvestigation.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model; - -import com.dbnt.faisp.config.BaseModel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.hibernate.annotations.DynamicInsert; -import org.hibernate.annotations.DynamicUpdate; -import 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 = "board_investigation") -public class BoardInvestigation extends BaseModel { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "ivsgt_key") - private Integer ivsgtKey; - @Column(name = "ivsgt_type") - private String ivsgtType; - @Column(name = "content_title") - private String contentTitle; - @Column(name = "content_info") - private String contentInfo; - @Column(name = "content_main") - private String contentMain; - @Column(name = "content_status") - private String contentStatus; - @Column(name = "wrt_organ") - private String wrtOrgan; - @Column(name = "wrt_user_seq") - private Integer wrtUserSeq; - @Column(name = "wrt_nm") - private String wrtNm; - @Column(name = "wrt_dt") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") - private LocalDateTime wrtDt; - - @Transient - private Integer fileCnt; - @Transient - private List fileList; - @Transient - private List multipartFileList; - @Transient - private List contentInfos; - @Transient - private String hashTags; - @Transient - private ArrestType arrestType; - @Transient - private RelatedReports relatedReports; - @Transient - private List relatedReportsList; - @Transient - private Integer arrestTypeKey; - @Transient - private String arrestCd; - @Transient - private String arrestCd2; - @Transient - private String arrestCdName; - @Transient - private String arrestCd2Name; -} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationBoard.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationBoard.java new file mode 100644 index 00000000..84d1f0f5 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationBoard.java @@ -0,0 +1,66 @@ +package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model; + +import com.dbnt.faisp.config.BaseModel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; +import 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 = "investigation_board") +public class InvestigationBoard extends BaseModel { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ivsgt_key") + private Integer ivsgtKey; + @Column(name = "ivsgt_type") + private String ivsgtType; + @Column(name = "arrest_cd") + private String arrestCd; + @Column(name = "arrest_cd2") + private String arrestCd2; + @Column(name = "title") + private String title; + @Column(name = "summary_info") + private String summaryInfo; + @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; + + @Transient + private String hashTags; + @Transient + private Integer fileCnt; + @Transient + private List fileList; + @Transient + private List relatedReportsList; + @Transient + private List multipartFileList; +} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/IvsgtFile.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationFile.java similarity index 84% rename from src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/IvsgtFile.java rename to src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationFile.java index 7b2797ec..4f893b5c 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/IvsgtFile.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationFile.java @@ -15,8 +15,8 @@ import java.io.Serializable; @DynamicInsert @DynamicUpdate @Table(name = "ivsgt_file") -@IdClass(IvsgtFile.IvsgtFileId.class) -public class IvsgtFile extends FileInfo { +@IdClass(InvestigationFile.InvestigationFileId.class) +public class InvestigationFile extends FileInfo { @Id @Column(name = "ivsgt_key") private Integer ivsgtKey; @@ -39,7 +39,7 @@ public class IvsgtFile extends FileInfo { @Data @NoArgsConstructor @AllArgsConstructor - public static class IvsgtFileId implements Serializable { + public static class InvestigationFileId implements Serializable { private Integer ivsgtKey; private Integer fileSeq; } diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationRelatedReports.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationRelatedReports.java new file mode 100644 index 00000000..0895ee58 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/InvestigationRelatedReports.java @@ -0,0 +1,37 @@ +package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model; + +import lombok.*; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.List; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "investigation_related_reports") +@IdClass(InvestigationRelatedReports.InvestigationRelatedReportsId.class) +public class InvestigationRelatedReports{ + + @Id + @Column(name = "parent_ivsgt_key") + private Integer parentIvsgtKey; + @Id + @Column(name = "related_reports_key") + private Integer childReportsKey; + + + @Embeddable + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class InvestigationRelatedReportsId implements Serializable { + private Integer parentIvsgtKey; + private Integer childReportsKey; + } +} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/RelatedReports.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/RelatedReports.java deleted file mode 100644 index 35089de5..00000000 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/model/RelatedReports.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model; - -import com.dbnt.faisp.config.BaseModel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.hibernate.annotations.DynamicInsert; -import org.hibernate.annotations.DynamicUpdate; - -import javax.persistence.*; -import java.util.List; - -@Getter -@Setter -@Entity -@NoArgsConstructor -@DynamicInsert -@DynamicUpdate -@Table(name = "related_reports") -public class RelatedReports extends BaseModel { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "related_reports_key") - private Integer relatedReportsKey; - @Column(name = "parent_ivsgt_key") - private Integer parentIvsgtKey; - @Column(name = "child_ivsgt_key") - private Integer childIvsgtKey; - - @Transient - private List relatedReportsKeyList; - @Transient - private List childIvsgtKeyList; - @Transient - private List deleteKeyList; - @Transient - private String contentTitle; -} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/ArrestTypeRepository.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/ArrestTypeRepository.java deleted file mode 100644 index 1cd977c3..00000000 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/ArrestTypeRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository; - -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.ArrestType; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface ArrestTypeRepository extends JpaRepository { - -} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/BoardInvestigationRepository.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/BoardInvestigationRepository.java deleted file mode 100644 index 522c5cdb..00000000 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/BoardInvestigationRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository; - -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.BoardInvestigation; -import org.springframework.data.jpa.repository.JpaRepository; - - -public interface BoardInvestigationRepository extends JpaRepository { -} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationBoardRepository.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationBoardRepository.java new file mode 100644 index 00000000..e1f3f473 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationBoardRepository.java @@ -0,0 +1,8 @@ +package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository; + +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationBoard; +import org.springframework.data.jpa.repository.JpaRepository; + + +public interface InvestigationBoardRepository extends JpaRepository { +} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationFileRepository.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationFileRepository.java new file mode 100644 index 00000000..0c0b954d --- /dev/null +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationFileRepository.java @@ -0,0 +1,13 @@ +package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository; + +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationFile; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +import java.util.Optional; + + +public interface InvestigationFileRepository extends JpaRepository { + List findByIvsgtKey(Integer ivsgtKey); + Optional findTopByIvsgtKeyOrderByFileSeqDesc(Integer ivsgtKey); +} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/RelatedReportsRepository.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationRelatedReportsRepository.java similarity index 52% rename from src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/RelatedReportsRepository.java rename to src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationRelatedReportsRepository.java index aacd1c87..58e055c6 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/RelatedReportsRepository.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/InvestigationRelatedReportsRepository.java @@ -1,6 +1,6 @@ package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.RelatedReports; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationRelatedReports; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; @@ -9,9 +9,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.List; -public interface RelatedReportsRepository extends JpaRepository { - @Transactional - @Modifying - @Query("delete from RelatedReports r where r.relatedReportsKey in :idList") - void deleteAllByIdInQuery(@Param("idList") List deleteKeyList); +public interface InvestigationRelatedReportsRepository extends JpaRepository { + void deleteByParentIvsgtKey(Integer parentIvsgtKey); } diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/IvsgtFileRepository.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/IvsgtFileRepository.java deleted file mode 100644 index 9ef9ad7a..00000000 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/repository/IvsgtFileRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository; - -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.IvsgtFile; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.List; -import java.util.Optional; - - -public interface IvsgtFileRepository extends JpaRepository { - List findByIvsgtKey(Integer ivsgtKey); - Optional findTopByIvsgtKeyOrderByFileSeqDesc(Integer ivsgtKey); -} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/BoardInvestigationService.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/BoardInvestigationService.java deleted file mode 100644 index 75ff89f1..00000000 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/BoardInvestigationService.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service; - - -import com.dbnt.faisp.config.BaseService; -import com.dbnt.faisp.config.FileInfo; -import com.dbnt.faisp.main.hashTag.service.HashTagService; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.mapper.BoardInvestigationMapper; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.*; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository.*; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -@Service -@RequiredArgsConstructor -public class BoardInvestigationService extends BaseService { - private final HashTagService hashTagService; - private final BoardInvestigationRepository boardInvestigationRepository; - private final IvsgtFileRepository ivsgtFileRepository; - private final ArrestTypeRepository arrestTypeRepository; - private final RelatedReportsRepository relatedReportsRepository; - private final HashTagLinkIvsgtRepository hashTagLinkIvsgtRepository; - private final BoardInvestigationMapper boardInvestigationMapper; - - public List selectBoardInvestigationList(BoardInvestigation boardInvestigation) { - return boardInvestigationMapper.selectBoardInvestigationList(boardInvestigation); - } - - public Integer selectBoardInvestigationListCnt(BoardInvestigation boardInvestigation) { - return boardInvestigationMapper.selectBoardInvestigationListCnt(boardInvestigation); - } - - public BoardInvestigation selectBoardInvestigation(Integer ivsgtKey) { - BoardInvestigation savedBoardInvestigation = boardInvestigationRepository.findById(ivsgtKey).orElse(null); - if (savedBoardInvestigation != null) { - savedBoardInvestigation.setFileList(ivsgtFileRepository.findByIvsgtKey(ivsgtKey)); - savedBoardInvestigation.setHashTags(boardInvestigationMapper.selectHashTags(ivsgtKey)); - savedBoardInvestigation.setArrestType(boardInvestigationMapper.selectArrestType(ivsgtKey)); - savedBoardInvestigation.setRelatedReportsList(boardInvestigationMapper.selectRelatedReportsList(ivsgtKey)); - } - return savedBoardInvestigation; - } - - @Transactional - public Integer saveBoardInvestigation(BoardInvestigation boardInvestigation, ArrestType arrestType, RelatedReports relatedReports, List deleteFileSeq) { - Integer ivsgtKey = boardInvestigationRepository.save(boardInvestigation).getIvsgtKey(); - String[] hashTagAry = boardInvestigation.getHashTags().split(" "); - if(hashTagAry.length>0){ - saveHashTagLink(ivsgtKey, hashTagAry); - } - arrestType.setIvsgtKey(ivsgtKey); - arrestTypeRepository.save(arrestType); - - if (relatedReports.getDeleteKeyList() != null) { - relatedReportsRepository.deleteAllByIdInQuery(relatedReports.getDeleteKeyList()); - } - - if (relatedReports.getChildIvsgtKeyList() != null) { - List relatedReportsList = new ArrayList<>(); - for (int i = 0; i < relatedReports.getChildIvsgtKeyList().size(); i++) { - RelatedReports relatedReportsTemp = new RelatedReports(); - if (relatedReports.getRelatedReportsKeyList().get(i) > 0) { - relatedReportsTemp.setRelatedReportsKey(relatedReports.getRelatedReportsKeyList().get(i)); - } - relatedReportsTemp.setChildIvsgtKey(relatedReports.getChildIvsgtKeyList().get(i)); - relatedReportsTemp.setParentIvsgtKey(ivsgtKey); - relatedReportsList.add(relatedReportsTemp); - } - relatedReportsRepository.saveAll(relatedReportsList); - } - - if(deleteFileSeq != null && deleteFileSeq.size()>0){ - deletIvsgtFile(ivsgtKey, deleteFileSeq); - } - if(boardInvestigation.getMultipartFileList()!=null){ - saveUploadFiles(ivsgtKey, boardInvestigation.getMultipartFileList()); - } - return ivsgtKey; - } - - private void saveUploadFiles(Integer ivsgtKey, List multipartFileList){ - IvsgtFile lastFileInfo = ivsgtFileRepository.findTopByIvsgtKeyOrderByFileSeqDesc(ivsgtKey).orElse(null); - int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1); - for(MultipartFile file : multipartFileList){ - String saveName = UUID.randomUUID().toString(); - String path = locationPath+ File.separator+"ivsgt"; - saveFile(file, new File(path+File.separator+saveName)); - - String originalFilename = file.getOriginalFilename(); - int extnIdx = originalFilename.lastIndexOf("."); - IvsgtFile fileInfo = new IvsgtFile(); - fileInfo.setIvsgtKey(ivsgtKey); - 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); - ivsgtFileRepository.save(fileInfo); - } - } - - - private void deletIvsgtFile(Integer ivsgtKey, List deleteFileSeq) { - List ivsgtFileList = ivsgtFileRepository.findByIvsgtKey(ivsgtKey); - for(IvsgtFile file: ivsgtFileList){ - if(deleteFileSeq.contains(file.getFileSeq())){ - deleteStoredFile(new File(file.getSavePath(), file.getConvNm())); - ivsgtFileRepository.delete(file); - } - } - } - - private void saveHashTagLink(Integer ivsgtKey, String[] hashTagAry){ - hashTagLinkIvsgtRepository.deleteByIvsgtKey(ivsgtKey); - for(String tagNm : hashTagAry){ - HashTagLinkIvsgt hashTagLinkIvsgt = new HashTagLinkIvsgt(); - hashTagLinkIvsgt.setIvsgtKey(ivsgtKey); - hashTagLinkIvsgt.setTagKey(hashTagService.selectTagKey(tagNm)); - hashTagLinkIvsgtRepository.save(hashTagLinkIvsgt); - } - } - - public FileInfo selectIvsgtFile(Integer parentKey, Integer fileSeq) { - return ivsgtFileRepository.findById(new IvsgtFile.IvsgtFileId(parentKey, fileSeq)).orElse(null); - } -} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/IvsgtService.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/IvsgtService.java new file mode 100644 index 00000000..3fcd819c --- /dev/null +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/service/IvsgtService.java @@ -0,0 +1,113 @@ +package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service; + + +import com.dbnt.faisp.config.BaseService; +import com.dbnt.faisp.config.FileInfo; +import com.dbnt.faisp.main.hashTag.service.HashTagService; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.mapper.InvestigationBoardMapper; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.*; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository.*; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.util.List; +import java.util.UUID; + +@Service +@RequiredArgsConstructor +public class IvsgtService extends BaseService { + private final HashTagService hashTagService; + private final InvestigationBoardRepository ivsgtboardRepository; + private final InvestigationFileRepository ivsgtFileRepository; + private final InvestigationRelatedReportsRepository ivsgtRelatedReportsRepository; + private final HashTagLinkIvsgtRepository hashTagLinkIvsgtRepository; + private final InvestigationBoardMapper boardIvsgtMapper; + + public List selectBoardInvestigationList(InvestigationBoard investigationBoard) { + return boardIvsgtMapper.selectInvestigationBoardList(investigationBoard); + } + + public Integer selectBoardInvestigationListCnt(InvestigationBoard investigationBoard) { + return boardIvsgtMapper.selectInvestigationBoardListCnt(investigationBoard); + } + + public InvestigationBoard selectBoardInvestigation(Integer ivsgtKey) { + InvestigationBoard savedInvestigationBoard = ivsgtboardRepository.findById(ivsgtKey).orElse(null); + if (savedInvestigationBoard != null) { + savedInvestigationBoard.setFileList(ivsgtFileRepository.findByIvsgtKey(ivsgtKey)); + savedInvestigationBoard.setHashTags(boardIvsgtMapper.selectHashTags(ivsgtKey)); + savedInvestigationBoard.setRelatedReportsList(boardIvsgtMapper.selectRelatedReportsList(ivsgtKey)); + } + return savedInvestigationBoard; + } + + @Transactional + public Integer saveBoardInvestigation(InvestigationBoard investigationBoard, InvestigationRelatedReports relatedReports, List deleteFileSeq) { + Integer ivsgtKey = ivsgtboardRepository.save(investigationBoard).getIvsgtKey(); + String[] hashTagAry = investigationBoard.getHashTags().split(" "); + if(hashTagAry.length>0){ + saveHashTagLink(ivsgtKey, hashTagAry); + } + if(deleteFileSeq != null && deleteFileSeq.size()>0){ + deletIvsgtFile(ivsgtKey, deleteFileSeq); + } + if(investigationBoard.getRelatedReportsList().size()>0){ + ivsgtRelatedReportsRepository.deleteByParentIvsgtKey(ivsgtKey); + ivsgtRelatedReportsRepository.saveAll(investigationBoard.getRelatedReportsList()); + } + if(investigationBoard.getMultipartFileList()!=null){ + saveUploadFiles(ivsgtKey, investigationBoard.getMultipartFileList()); + } + return ivsgtKey; + } + + private void saveUploadFiles(Integer ivsgtKey, List multipartFileList){ + InvestigationFile lastFileInfo = ivsgtFileRepository.findTopByIvsgtKeyOrderByFileSeqDesc(ivsgtKey).orElse(null); + int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1); + for(MultipartFile file : multipartFileList){ + String saveName = UUID.randomUUID().toString(); + String path = locationPath+ File.separator+"ivsgt"; + saveFile(file, new File(path+File.separator+saveName)); + + String originalFilename = file.getOriginalFilename(); + int extnIdx = originalFilename.lastIndexOf("."); + InvestigationFile fileInfo = new InvestigationFile(); + fileInfo.setIvsgtKey(ivsgtKey); + 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); + ivsgtFileRepository.save(fileInfo); + } + } + + + private void deletIvsgtFile(Integer ivsgtKey, List deleteFileSeq) { + List investigationFileList = ivsgtFileRepository.findByIvsgtKey(ivsgtKey); + for(InvestigationFile file: investigationFileList){ + if(deleteFileSeq.contains(file.getFileSeq())){ + deleteStoredFile(new File(file.getSavePath(), file.getConvNm())); + ivsgtFileRepository.delete(file); + } + } + } + + private void saveHashTagLink(Integer ivsgtKey, String[] hashTagAry){ + hashTagLinkIvsgtRepository.deleteByIvsgtKey(ivsgtKey); + for(String tagNm : hashTagAry){ + HashTagLinkIvsgt hashTagLinkIvsgt = new HashTagLinkIvsgt(); + hashTagLinkIvsgt.setIvsgtKey(ivsgtKey); + hashTagLinkIvsgt.setTagKey(hashTagService.selectTagKey(tagNm)); + hashTagLinkIvsgtRepository.save(hashTagLinkIvsgt); + } + } + + public FileInfo selectIvsgtFile(Integer parentKey, Integer fileSeq) { + return ivsgtFileRepository.findById(new InvestigationFile.InvestigationFileId(parentKey, fileSeq)).orElse(null); + } +} diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/mapper/MajorStatusMapper.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/mapper/MajorStatusMapper.java index b236e819..5aec1fc4 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/mapper/MajorStatusMapper.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/mapper/MajorStatusMapper.java @@ -1,7 +1,6 @@ package com.dbnt.faisp.main.ivsgtMgt.majorStatus.mapper; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.ArrestType; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.RelatedReports; +import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationRelatedReports; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus; import org.apache.ibatis.annotations.Mapper; @@ -11,7 +10,6 @@ import java.util.List; public interface MajorStatusMapper { List selectMajorList(MajorStatus majorStatus); List selectContentListWhere(MajorStatus majorStatus); - ArrestType selectArrestType(Integer majorKey); Integer selectMajorListCnt(MajorStatus majorStatus); - List selectRelatedReportsList(Integer majorKey); + List selectRelatedReportsList(Integer majorKey); } diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java index c1f40466..3488c941 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java @@ -3,25 +3,16 @@ package com.dbnt.faisp.main.ivsgtMgt.majorStatus.service; import com.dbnt.faisp.config.BaseService; import com.dbnt.faisp.config.FileInfo; -import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseFile; -import com.dbnt.faisp.main.equip.model.Equip; -import com.dbnt.faisp.main.fipTarget.model.VulnFile; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.BoardInvestigation; -import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.IvsgtFile; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.mapper.MajorStatusMapper; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorFile; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorFileRepository; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorStatusRepository; -import com.dbnt.faisp.main.publicBoard.model.PublicBoard; -import com.dbnt.faisp.main.publicBoard.model.PublicComment; -import com.dbnt.faisp.main.userInfo.model.UserInfo; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import javax.swing.*; import java.io.File; import java.util.List; import java.util.UUID; diff --git a/src/main/resources/mybatisMapper/BoardInvestigationMapper.xml b/src/main/resources/mybatisMapper/BoardInvestigationMapper.xml deleted file mode 100644 index e529c9ab..00000000 --- a/src/main/resources/mybatisMapper/BoardInvestigationMapper.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - and a.wrt_organ in - - #{organCd} - - - - AND ivsgt_type = #{ivsgtType} - - - AND a.wrt_nm LIKE '%'||#{wrtNm}||'%' - - - AND a.wrt_organ = #{wrtOrgan} - - - AND a.content_title LIKE '%'||#{contentTitle}||'%' - - - AND t.arrest_cd = #{arrestCd} - - - AND t.arrest_cd2 = #{arrestCd2} - - - - And a.wrt_dt >= #{startDate}::DATE - - - AND a.wrt_dt <= #{endDate}::DATE+1 - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/mybatisMapper/InvestigationBoardMapper.xml b/src/main/resources/mybatisMapper/InvestigationBoardMapper.xml new file mode 100644 index 00000000..07ea1062 --- /dev/null +++ b/src/main/resources/mybatisMapper/InvestigationBoardMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + and a.wrt_organ in + + #{organCd} + + + + AND a.ivsgt_type = #{ivsgtType} + + + AND a.wrt_user_nm LIKE '%'||#{wrtUserNm}||'%' + + + AND a.wrt_organ = #{wrtOrgan} + + + AND a.wrt_part = #{wrtPart} + + + AND a.wrt_user_seq = #{wrtUserSeq} + + + AND a.title LIKE '%'||#{title}||'%' + + + AND a.arrest_cd = #{arrestCd} + + + AND a.arrest_cd2 = #{arrestCd2} + + + + And a.wrt_dt >= #{startDate}::DATE + + + AND a.wrt_dt <= #{endDate}::DATE+1 + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/js/ivsgt/ivsgt.js b/src/main/resources/static/js/ivsgt/ivsgt.js index 417fbb7f..5b7f1d29 100644 --- a/src/main/resources/static/js/ivsgt/ivsgt.js +++ b/src/main/resources/static/js/ivsgt/ivsgt.js @@ -7,15 +7,12 @@ $(document).on('click', '#ivsgtEditBtn', function () { getIvsgtEditModal(Number($("#ivsgtViewBody").find("[name='ivsgtKey']").val())); }); -$(document).on('click', '#saveIvsgtBtn', function (){ - saveBoardInvestigation('N') -}); $(document).on('change', '#arrestCd', function (){ $(".arrestCd2").hide(); $("."+this.value).show(); }) -$(document).on('click', '#saveTempBtn', function (){ - saveBoardInvestigation('Y') +$(document).on('click', '.saveBtn', function (){ + saveBoardInvestigation($(this).attr('data-state')) }); $(document).on('click', '.tr', function (){ @@ -104,10 +101,6 @@ function getIvsgtEditModal(ivsgtKey, ivsgtType){ $("#ivsgtViewBody").empty(); $("#ivsgtEditModalContent").empty().append(html) $("#ivsgtEditModal").modal('show'); - const selectedArrestCd = $("#ivsgtEditForm").find("#arrestCd").val() - if(selectedArrestCd){ - $("."+selectedArrestCd).show(); - } setEditor('editor', '400') setUploadDiv(); }, @@ -117,13 +110,9 @@ function getIvsgtEditModal(ivsgtKey, ivsgtType){ }); } -function getSearchViewModal(ivsgtType, contentTitle){ +function getSearchViewModal(){ $.ajax({ url: '/ivsgt/searchViewModal', - data: { - contentTitle: contentTitle, - ivsgtType: ivsgtType - }, type: 'GET', dataType:"html", success: function(html){ @@ -136,10 +125,10 @@ function getSearchViewModal(ivsgtType, contentTitle){ }); } -function saveBoardInvestigation(contentState){ - if(contentCheck()){ +function saveBoardInvestigation(state){ + if(state === "DST001" || contentCheck()){ if(confirm("저장하시겠습니까?")){ - $("#contentStatus").val(contentState); + $("#status").val(state); contentFade("in"); const formData = new FormData($("#ivsgtEditForm")[0]); for(const file of files) { @@ -174,7 +163,7 @@ function saveBoardInvestigation(contentState){ function contentCheck(){ let flag = true; - if(!$("#contentTitle").val()){ + if(!$("#title").val()){ alert("제목을 입력해주세요.") flag = false; } diff --git a/src/main/resources/templates/ivsgt/ivsgt.html b/src/main/resources/templates/ivsgt/ivsgt.html index 726ce2b3..d4e7b17d 100644 --- a/src/main/resources/templates/ivsgt/ivsgt.html +++ b/src/main/resources/templates/ivsgt/ivsgt.html @@ -73,18 +73,18 @@
@@ -92,10 +92,10 @@
- +
- +
@@ -119,7 +119,7 @@ 순번 - 관서 + 관서 범죄테마 위반유형 제목 @@ -128,17 +128,19 @@ - - + + - - - - - - - - + + + + + + + + + + diff --git a/src/main/resources/templates/ivsgt/ivsgtEditModal.html b/src/main/resources/templates/ivsgt/ivsgtEditModal.html index 11d2e0fe..bd77ed36 100644 --- a/src/main/resources/templates/ivsgt/ivsgtEditModal.html +++ b/src/main/resources/templates/ivsgt/ivsgtEditModal.html @@ -2,25 +2,25 @@