From 30cda893f5654c8b27264ab0fee6fa49fab18fe6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-QGC5RJO\\DBNT" Date: Fri, 13 Jan 2023 15:48:23 +0900 Subject: [PATCH] =?UTF-8?q?asf=20=EB=B0=8F=20=EC=BD=94=EB=A1=9C=EB=82=9819?= =?UTF-8?q?=20=EA=B4=80=EB=A0=A8=EC=A1=B0=EC=B9=98=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=A4=91=EA=B0=84=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crackdownsStatus/AsfCovController.java | 24 +- .../crackdownsStatus/mapper/AsfCovMapper.java | 1 + .../service/AsfCovService.java | 13 +- .../resources/mybatisMapper/AsfCovMapper.xml | 66 ++-- .../static/js/faStatistics/asfCov.js | 70 ++-- .../templates/faStatistics/asfCov/asfCov.html | 10 +- .../faStatistics/asfCov/asfCovEditModal.html | 4 +- .../asfCov/asfCovHistoryDetail.html | 146 +++++---- .../asfCov/asfCovHistoryViewModal.html | 201 ------------ .../faStatistics/asfCov/asfCovViewModal.html | 304 +++++++++--------- .../processResult/processResultViewModal.html | 1 + 11 files changed, 320 insertions(+), 520 deletions(-) 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 3bd3cb74..50cb3858 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 @@ -38,6 +38,7 @@ public class AsfCovController { mav.addObject("searchParams", asfCov); asfCov.setQueryInfo(); + mav.addObject("asfCov", asfCov); mav.addObject("asfCovList", asfCovService.selectAsfCovList(asfCov)); asfCov.setPaginationInfo(); return mav; @@ -66,28 +67,27 @@ public class AsfCovController { public ModelAndView asfCovViewModal(@AuthenticationPrincipal UserInfo loginUser, AsfCov asfCov){ ModelAndView mav= new ModelAndView("faStatistics/asfCov/asfCovViewModal"); - asfCov = asfCovService.selectAsfCov(asfCov.getAsfCovKey()); mav.addObject("userSeq",loginUser.getUserSeq()); - mav.addObject("asfCov", asfCov); - + mav.addObject("asfCov", asfCovService.selectAsfCov(asfCov.getAsfCovKey())); + mav.addObject("asfCovHistory", asfCovService.selectAsfCovHistory(asfCov.getAsfCovKey())); 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("/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)); +// 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("asfCovHistory", asfCovService.selectAsfCovHistory(asfCov.getAsfCovKey())); mav.addObject("asfCov", asfCov); return mav; } 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 7cdeb03d..71a1ae50 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 @@ -14,4 +14,5 @@ public interface AsfCovMapper { // ArrestType selectArrestType(AsfCov asfCov); List selectAsfCovListWhere(AsfCov asfCov); + List selectAsfCovHistory(Integer asfCovKey); } 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 d5221464..62099b65 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 @@ -14,6 +14,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; @@ -54,14 +55,6 @@ 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){ @@ -70,6 +63,7 @@ public class AsfCovService extends BaseService { asfCov.setVersionNo(1); }else{ asfCov.setVersionNo(asfCov.getVersionNo()+1); + asfCov.setWrtDt(LocalDateTime.now()); } asfCovRepository.save(asfCov); return asfCov.getAsfCovKey(); @@ -82,4 +76,7 @@ public class AsfCovService extends BaseService { } + public List selectAsfCovHistory(Integer asfCovKey) { + return asfCovMapper.selectAsfCovHistory(asfCovKey); + } } diff --git a/src/main/resources/mybatisMapper/AsfCovMapper.xml b/src/main/resources/mybatisMapper/AsfCovMapper.xml index 52fc5ce6..1c602dad 100644 --- a/src/main/resources/mybatisMapper/AsfCovMapper.xml +++ b/src/main/resources/mybatisMapper/AsfCovMapper.xml @@ -57,62 +57,23 @@ cs.cds_key , cs.case_num , cs.napo_dt - , cs.napo_sea_point_lon - , cs.napo_sea_point_lat - , cs.napo_sea_point_detail - , cs.invasion_type - , cs.nll , cs.case_agency , cs.case_police_officer , cs.crackdown_boat , cs.crackdown_police - , cs.mmsi - , cs.field_ivsgt - , cs.obstr_exspd_cnt - , cs.person_damage_cnt - , cs.person_damage_amount - , cs.person_damage_detail - , cs.material_damage_cnt - , cs.material_damage_amount - , cs.material_damage_detail - , cs.field_ivsgt_napo_dt - , cs.field_ivsgt_release_dt - , cs.field_ivsgt_time_taken - , cs.pressurized_start_dt - , cs.pressurized_end_dt - , cs.distance , fb.fb_key , fb.boat_name_kr , fb.boat_name_cn - , fb.ton_cnt - , fb.fishery_type - , fb.boat_material - , fb.boat_nny_sung - , fb.boat_nny_si - , fb.offense_quantity - , fb.offense_amount - , fb.offense_illegal_waste_quantity - , fb.dambo_unpaid_amount - , fb.dambo_payment - , fb.payment_payment_dt - , fb.confiscation_frame - , fb.confiscation_width - , fb.confiscation_jo - , fb.confiscation_gae - , fb.confiscation_etc - , fb.catch_fish_species - , fb.catch_cnt - , fb.offense_fish_species - , fb.offense_catch_cnt , fb.status FROM asfcov_status a - INNER JOIN crackdown_status cs - ON a.cds_key = cs.cds_key - - INNER JOIN fishing_boat fb - ON a.cds_key = fb.cds_key - + inner join (select asfcov_key, max(version_no) as lastVersion + from asfcov_status + group by asfcov_key) b on a.asfcov_key = b.asfcov_key and a.version_no = b.lastVersion + INNER JOIN crackdown_status cs + ON a.cds_key = cs.cds_key + INNER JOIN fishing_boat fb + ON a.cds_key = fb.cds_key order by a.asfcov_key desc limit #{rowCnt} offset #{firstIndex} @@ -126,6 +87,17 @@ - + \ No newline at end of file diff --git a/src/main/resources/static/js/faStatistics/asfCov.js b/src/main/resources/static/js/faStatistics/asfCov.js index c5658a49..5b32475a 100644 --- a/src/main/resources/static/js/faStatistics/asfCov.js +++ b/src/main/resources/static/js/faStatistics/asfCov.js @@ -75,7 +75,7 @@ $(function(){ $(document).on('click', '#deleteMajorBtn', function (){ - const asfCovKey = $('#processResultEditBody').find(".asfCovKey").val(); + const asfCovKey = $('#asfCovEditModalContent').find(".asfCovKey").val(); console.log(asfCovKey); if(confirm("삭제하시겠습니까?")){ //contentFade("in"); @@ -109,10 +109,6 @@ function getEditModal(asfCovKey){ type: 'GET', dataType:"html", success: function(html){ - const crackdownPolice = $("#crackdownPolice").val() - if(crackdownPolice){ - getCrackdownBoatOption(crackdownPolice) - } $("#asfCovEditModalContent").empty().append(html); $("#asfCovEditModal").modal('show'); $("#editContent").empty().append(html); @@ -124,10 +120,13 @@ function getEditModal(asfCovKey){ }); } -function getViewModal(asfCovKey){ +function getViewModal(asfCovKey,versionNo){ $.ajax({ url: '/faStatistics/asfCovViewModal', - data: {asfCovKey: asfCovKey}, + data: { + versionNo : versionNo, + asfCovKey : asfCovKey + }, type: 'GET', dataType:"html", success: function(html){ @@ -223,10 +222,34 @@ $(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(); +// $(document).on('click', '#history-tab', function (){ +// const asfCovKey = $('#asfCovEditModalContent').find('.asfCovKey').val(); +// getHistoryViewModal(asfCovKey); +// }); +// +// function getHistoryViewModal(asfCovKey){ +// $.ajax({ +// url: '/faStatistics/asfCovHistoryViewModal', +// data: { +// asfCovKey: asfCovKey, +// cdsKey : cdsKey, +// }, +// type: 'GET', +// dataType:"html", +// success: function(html){ +// $("#asfCovViewModalContent").empty().append(html) +// $("#asfCovViewModal").modal('show'); +// }, +// error:function(e){ +// ajaxErrorAction(e); +// } +// }); +// } + +$(document).on('click', '.versionInfoTr', function (){ + $(this).find(".versionNo").prop('checked', true); + const versionNo = $(this).find(".versionNo").val(); + const asfCovKey = $(this).find(".asfCovKey").val(); getHistoryDetail(versionNo, asfCovKey); }); @@ -235,32 +258,12 @@ function getHistoryDetail(versionNo, asfCovKey){ url: '/faStatistics/asfCovHistoryDetail', data: { versionNo : versionNo, - asfCovKe : asfCovKey + asfCovKey : 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'); + $("#asfcovVersionInfoDiv").empty().append(html); }, error:function(e){ ajaxErrorAction(e); @@ -271,3 +274,4 @@ function getHistoryViewModal(asfCovKey){ + diff --git a/src/main/resources/templates/faStatistics/asfCov/asfCov.html b/src/main/resources/templates/faStatistics/asfCov/asfCov.html index c76788fe..3090cb03 100644 --- a/src/main/resources/templates/faStatistics/asfCov/asfCov.html +++ b/src/main/resources/templates/faStatistics/asfCov/asfCov.html @@ -114,7 +114,6 @@ - @@ -130,14 +129,19 @@ - + + + + + + O - + diff --git a/src/main/resources/templates/faStatistics/asfCov/asfCovEditModal.html b/src/main/resources/templates/faStatistics/asfCov/asfCovEditModal.html index 984cdf7a..1b051d80 100644 --- a/src/main/resources/templates/faStatistics/asfCov/asfCovEditModal.html +++ b/src/main/resources/templates/faStatistics/asfCov/asfCovEditModal.html @@ -78,7 +78,7 @@ - + @@ -119,7 +119,7 @@
-
+
diff --git a/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryDetail.html b/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryDetail.html index fee29b43..559a1acd 100644 --- a/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryDetail.html +++ b/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryDetail.html @@ -1,69 +1,91 @@ -
- 나포정보 -
-
- -
- + +
+ +
+ +
+ +
+
+ +
+
-
-
- -
- -
-
- -
- -
- -
- -
- -
-
-
- -
- + + + - - + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
-
- - - - - - - \ 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 index fdb76676..e69de29b 100644 --- a/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryViewModal.html +++ b/src/main/resources/templates/faStatistics/asfCov/asfCovHistoryViewModal.html @@ -1,201 +0,0 @@ - - - - - - - -
-
- -
-
- - \ No newline at end of file diff --git a/src/main/resources/templates/faStatistics/asfCov/asfCovViewModal.html b/src/main/resources/templates/faStatistics/asfCov/asfCovViewModal.html index cd49e5ae..e5b24df3 100644 --- a/src/main/resources/templates/faStatistics/asfCov/asfCovViewModal.html +++ b/src/main/resources/templates/faStatistics/asfCov/asfCovViewModal.html @@ -1,182 +1,182 @@ -