From d7c5281d2b393fe7451188a142d05f62d08fafb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=84=9C=EC=98=88=EB=A6=B0?= Date: Thu, 12 Jan 2023 23:09:48 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95=EC=9D=B4=EB=A0=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crackdownsStatus/AsfCovController.java | 20 ++ .../repository/AsfCovRepository.java | 4 +- .../service/AsfCovService.java | 9 + .../static/js/faStatistics/asfCov.js | 51 ++++- .../asfCov/asfCovHistoryDetail.html | 69 ++++++ .../asfCov/asfCovHistoryViewModal.html | 201 ++++++++++++++++++ 6 files changed, 346 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/templates/faStatistics/asfCov/asfCovHistoryDetail.html create mode 100644 src/main/resources/templates/faStatistics/asfCov/asfCovHistoryViewModal.html diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/AsfCovController.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/AsfCovController.java index 3dd9887a..3bd3cb74 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/AsfCovController.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/AsfCovController.java @@ -5,6 +5,7 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus; import com.dbnt.faisp.main.codeMgt.service.CodeMgtService; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.asfCov.AsfCov; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus; +import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatusVersion; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.processResult.ProcessResult; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.AsfCovService; @@ -72,6 +73,25 @@ public class AsfCovController { return mav; } + @GetMapping("/asfCovHistoryViewModal") + public ModelAndView asfCovHistoryViewModal(@AuthenticationPrincipal UserInfo loginUser, AsfCov asfCov){ + ModelAndView mav = new ModelAndView("faStatistics/asfCov/asfCovHistoryViewModal"); + asfCov = asfCovService.selectAsfCov(asfCov.getAsfCovKey()); + mav.addObject("userSeq",loginUser.getUserSeq()); + mav.addObject("asfCovList", asfCovService.selectAsfCovList(asfCov)); + mav.addObject("asfCov", asfCov); + return mav; + } + + @GetMapping("/asfCovHistoryDetail") + public ModelAndView asfCovHistoryDetail(@AuthenticationPrincipal UserInfo loginUser, AsfCov asfCov){ + ModelAndView mav = new ModelAndView("faStatistics/asfCov/asfCovHistoryDetail"); + asfCov = asfCovService.selectAsfCov(asfCov.getAsfCovKey()); + mav.addObject("userSeq",loginUser.getUserSeq()); + mav.addObject("asfCov", asfCov); + return mav; + } + @PostMapping("/saveContent") public Integer saveContent (AsfCov asfCov){ return asfCovService.saveContent(asfCov); diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/repository/AsfCovRepository.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/repository/AsfCovRepository.java index 20f9e5e9..f19e8601 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/repository/AsfCovRepository.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/repository/AsfCovRepository.java @@ -3,6 +3,7 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.asfCov.AsfCov; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus; +import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatusVersion; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; @@ -11,7 +12,8 @@ import java.util.Optional; public interface AsfCovRepository extends JpaRepository { Optional findByCdsKey(Integer cdsKey); Optional findByAsfCovKey(Integer asfCovKey); - // void deleteByAsfCov(Integer asfCovKey); + // void deleteByAsfCov(Integer asfCovKey); + AsfCov findByVersionNoAndAsfCovKey(Integer versionNo, Integer asfCovKey); Optional findTop1ByAsfCovKeyOrderByVersionNoDesc(Integer asfCovKey); Optional findTop1ByOrderByAsfCovKeyDesc(); diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/AsfCovService.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/AsfCovService.java index 8340ee0b..d5221464 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/AsfCovService.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/AsfCovService.java @@ -4,6 +4,7 @@ import com.dbnt.faisp.config.BaseService; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper.AsfCovMapper; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.asfCov.AsfCov; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus; +import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatusVersion; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository.AsfCovRepository; @@ -53,6 +54,14 @@ public class AsfCovService extends BaseService { return asfCov; } +// public List selectCrackdownStatusVersionList(Integer asfCovKey) { +// return asfCovRepository.findByAsfCovKey(asfCovKey); +// } +// +// public CrackdownStatusVersion selectCrackdownStatusVersion(Integer versionNo, Integer asfCovKey) { +// return asfCovRepository.findByVersionNoAndAsfCovKey(versionNo, asfCovKey); +// } + @Transactional public Integer saveContent(AsfCov asfCov) { if(asfCov.getAsfCovKey()==null){ diff --git a/src/main/resources/static/js/faStatistics/asfCov.js b/src/main/resources/static/js/faStatistics/asfCov.js index 8efc0898..c5658a49 100644 --- a/src/main/resources/static/js/faStatistics/asfCov.js +++ b/src/main/resources/static/js/faStatistics/asfCov.js @@ -173,13 +173,6 @@ function contentCheck(formId){ return flag; } -function commentFormReset(){ - const commentForm = $("#commentForm"); - commentForm[0].reset(); - $("#childFormRemoveBtn").hide(); - $("#parentComment").val(''); - $("#commentFormHome").append(commentForm) -} $(document).on('click', '#asfCovDownExcel', function (){ exportExcel('ASF 및 코로나19 관련 조치현황', 'asfCovTable'); @@ -230,6 +223,50 @@ $(document).on('change', '#searchFormPolice', function (){ } }) +$(document).on('click', '.version-tr', function (){ + $(this).find('input[name="versionNo"]').prop('checked', true); + const versionNo = $(this).find('input[name="versionNo"]').val(); + const asfCovKey = $('#asfCovEditForm').find('input[name="cdsKey"]').val(); + getHistoryDetail(versionNo, asfCovKey); +}); + +function getHistoryDetail(versionNo, asfCovKey){ + $.ajax({ + url: '/faStatistics/asfCovHistoryDetail', + data: { + versionNo : versionNo, + asfCovKe : asfCovKey + }, + type: 'GET', + dataType:"html", + success: function(html){ + $("#historyDetailDiv").empty().append(html); + }, + error:function(e){ + ajaxErrorAction(e); + } + }); +} + +$(document).on('click', '#history-tab', function (){ + getHistoryViewModal($('#asfCovEditForm').find('input[name="asfCovKey"]').val()); +}); + +function getHistoryViewModal(asfCovKey){ + $.ajax({ + url: '/faStatistics/asfCovHistoryViewModal', + data: {asfCovKey: asfCovKey}, + type: 'GET', + dataType:"html", + success: function(html){ + $("#asfCovViewModalContent").empty().append(html) + $("#asfCovViewModal").modal('show'); + }, + error:function(e){ + ajaxErrorAction(e); + } + }); +} diff --git a/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryDetail.html b/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryDetail.html new file mode 100644 index 00000000..fee29b43 --- /dev/null +++ b/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryDetail.html @@ -0,0 +1,69 @@ + + +
+ 나포정보 +
+
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryViewModal.html b/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryViewModal.html new file mode 100644 index 00000000..fdb76676 --- /dev/null +++ b/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryViewModal.html @@ -0,0 +1,201 @@ + + + + + + + +
+
+ +
+
+ + \ No newline at end of file