From 87e231d0e4f571fe10fafc463e8acf9efc6d4383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Thu, 22 Jun 2023 18:11:04 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=91=EC=97=85=EC=A4=91=5F=EB=B6=88?= =?UTF-8?q?=EB=B2=95=EC=A1=B0=EC=97=85=20>=20=EB=B6=88=EB=B2=95=EC=A1=B0?= =?UTF-8?q?=EC=97=85=20=EC=99=B8=EA=B5=AD=EC=96=B4=EC=84=A0=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnlawfulFishingController.java | 31 +- .../model/UnlawfulFishingParam.java | 29 +- .../model/fishingBoat/IllegalShipInfo.java | 4 + .../fishingBoat/IllegalShipInfoHistory.java | 3 - .../IllegalShipInfoHistoryRepository.java | 3 + .../service/UnlawfulFishingService.java | 13 + .../mybatisMapper/UnlawfulFishingMapper.xml | 34 + .../unlawfulFishing/illegalShipInfo.js | 74 +- .../crackdownInfo/cdiViewModal.html | 64 +- .../crackdownInfo/crackdownInfoPage.html | 4 +- .../illegalShipInfo/illegalShipInfoPage.html | 54 +- .../illegalShipInfo/isiEditModal.html | 88 +-- .../illegalShipInfo/isiHistoryDiv.html | 97 +++ .../illegalShipInfo/isiViewModal.html | 654 +++++------------- 14 files changed, 554 insertions(+), 598 deletions(-) create mode 100644 src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiHistoryDiv.html diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/UnlawfulFishingController.java b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/UnlawfulFishingController.java index 3c30106d..824264c0 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/UnlawfulFishingController.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/UnlawfulFishingController.java @@ -5,6 +5,7 @@ import com.dbnt.faisp.main.authMgt.service.AuthMgtService; import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.UnlawfulFishingParam; import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.crackdownStatus.*; import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.fishingBoat.IllegalShipInfo; +import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.fishingBoat.IllegalShipInfoHistory; import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.processResult.ShipProcessInfo; import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.sailor.IllegalShipSailor; import com.dbnt.faisp.main.faStatistics.unlawfulFishing.service.UnlawfulFishingService; @@ -125,6 +126,7 @@ public class UnlawfulFishingController { ModelAndView mav = new ModelAndView("faStatistics/unlawfulFishing/illegalShipInfo/isiEditModal"); if(illegalShipInfo.getFbKey()!=null){ illegalShipInfo = unlawfulFishingService.selectIllegalShipInfo(illegalShipInfo.getFbKey()); + illegalShipInfo.setCaseNum(unlawfulFishingService.selectCrackdownInfo(illegalShipInfo.getCdsKey()).getCaseNum()); }else{ illegalShipInfo.setWrtOrgan(loginUser.getOgCd()); illegalShipInfo.setWrtPart(loginUser.getOfcCd()); @@ -132,7 +134,22 @@ public class UnlawfulFishingController { illegalShipInfo.setWrtUserGrd(loginUser.getTitleCd()); illegalShipInfo.setWrtUserNm(loginUser.getUserNm()); } - mav.addObject("illegalShipInfo", illegalShipInfo); + mav.addObject("shipInfo", illegalShipInfo); + return mav; + } + + @GetMapping("/isiViewModal") + public ModelAndView illegalShipInfoViewModal(@AuthenticationPrincipal UserInfo loginUser, IllegalShipInfo isi){ + ModelAndView mav = new ModelAndView("faStatistics/unlawfulFishing/illegalShipInfo/isiViewModal"); + isi = unlawfulFishingService.selectIllegalShipInfo(isi.getFbKey()); + isi.setHistoryList(unlawfulFishingService.selectIllegalShipInfoHistoryList(isi.getFbKey())); + mav.addObject("shipInfo", isi); + mav.addObject("crackdownInfo", unlawfulFishingService.selectCrackdownInfo(isi.getCdsKey())); + + AccessConfig accessConfig = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/unlawfulFishing/illegalShipInfo").get(0); + mav.addObject("accessAuth", accessConfig.getAccessAuth()); + mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); + mav.addObject("userSeq", loginUser.getUserSeq()); return mav; } @@ -142,6 +159,18 @@ public class UnlawfulFishingController { return unlawfulFishingService.saveIllegalShipInfo(illegalShipInfo); } + @PostMapping("/deleteIllegalShipInfo") + public void deleteIllegalShipInfo(IllegalShipInfo illegalShipInfo){ + unlawfulFishingService.deleteIllegalShipInfo(illegalShipInfo.getFbKey()); + } + + @GetMapping("/isiHistoryDiv") + public ModelAndView isiHistoryDiv(IllegalShipInfoHistory isih){ + ModelAndView mav = new ModelAndView("faStatistics/unlawfulFishing/illegalShipInfo/isiHistoryDiv"); + mav.addObject("shipInfo", unlawfulFishingService.selectIllegalShipInfoHistory(isih.getFbKey(), isih.getVersionNo())); + return mav; + } + @GetMapping("/isiSelectModal") public ModelAndView illegalShipInfoSelectModal(@AuthenticationPrincipal UserInfo loginUser, IllegalShipInfo params){ ModelAndView mav = new ModelAndView("faStatistics/unlawfulFishing/illegalShipInfo/isiSelectModal"); diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/UnlawfulFishingParam.java b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/UnlawfulFishingParam.java index a0ec5de5..52d4845a 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/UnlawfulFishingParam.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/UnlawfulFishingParam.java @@ -13,6 +13,14 @@ import java.util.List; @NoArgsConstructor public class UnlawfulFishingParam extends BaseModel { + private String caseNum; + private String permitNum; + private String boatNny; + private String boatName; + private String boatMaterial; + private String fisheryType; + + private Integer year; private Integer month; private String caseAgency; @@ -20,31 +28,10 @@ public class UnlawfulFishingParam extends BaseModel { private String crackdownPolice; private String crackdownBoat; private String napoPoint; - private String boatNameKr; - private String boatNnySung; - private String boatNnySi; private Double tonMin; private Double tonMax; - private String boatMaterial; - private String fisheryType; private List violationList; private String processStatus; - - /* - private List violationList; - private String caseAgency; - private String crackdownPolice; - private String crackdownBoat; - private String boatNameKr; - private String boatNnySung; - private String boatNnySi; - private Double tonMin; - private Double tonMax; - private String boatMaterial; - private String fisheryType; - private String processStatus; - */ - private String caseNum; private String napoSeaPointDetail; private String nll; private String mmsi; diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/fishingBoat/IllegalShipInfo.java b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/fishingBoat/IllegalShipInfo.java index bd2c8276..054932bd 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/fishingBoat/IllegalShipInfo.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/fishingBoat/IllegalShipInfo.java @@ -7,6 +7,7 @@ import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; import javax.persistence.*; +import java.util.List; @Getter @Setter @@ -27,4 +28,7 @@ public class IllegalShipInfo extends FishingBoatBaseEntity { @Transient private String caseNum; + + @Transient + private List historyList; } diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/fishingBoat/IllegalShipInfoHistory.java b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/fishingBoat/IllegalShipInfoHistory.java index 83fb2d2d..334c9e96 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/fishingBoat/IllegalShipInfoHistory.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/model/fishingBoat/IllegalShipInfoHistory.java @@ -25,9 +25,6 @@ public class IllegalShipInfoHistory extends FishingBoatBaseEntity { @Column(name = "version_no") private Integer versionNo; - @Transient - private List violationList; - @Embeddable @Data @NoArgsConstructor diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/repository/IllegalShipInfoHistoryRepository.java b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/repository/IllegalShipInfoHistoryRepository.java index 898a59a0..d971ecf7 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/repository/IllegalShipInfoHistoryRepository.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/repository/IllegalShipInfoHistoryRepository.java @@ -3,8 +3,11 @@ package com.dbnt.faisp.main.faStatistics.unlawfulFishing.repository; import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.fishingBoat.IllegalShipInfoHistory; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; import java.util.Optional; public interface IllegalShipInfoHistoryRepository extends JpaRepository { Optional findTop1ByFbKeyOrderByVersionNoDesc(Integer fbKey); + + List findByFbKeyOrderByVersionNoDesc(Integer fbKey); } diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/service/UnlawfulFishingService.java b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/service/UnlawfulFishingService.java index 9410cfc3..c0966abd 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/service/UnlawfulFishingService.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/unlawfulFishing/service/UnlawfulFishingService.java @@ -159,6 +159,10 @@ public class UnlawfulFishingService { return isiRepository.findByFbKey(fbKey).orElse(new IllegalShipInfo()); } + public List selectIllegalShipInfoHistoryList(Integer fbKey) { + return isihRepository.findByFbKeyOrderByVersionNoDesc(fbKey); + } + public ShipProcessInfo selectShipProcessInfo(Integer prKey) { return spiRepository.findByPrKey(prKey).orElse(new ShipProcessInfo()); } @@ -187,6 +191,15 @@ public class UnlawfulFishingService { return fbKey; } + public IllegalShipInfoHistory selectIllegalShipInfoHistory(Integer fbKey, Integer versionNo) { + return isihRepository.findById(new IllegalShipInfoHistory.IllegalShipInfoHistoryId(fbKey, versionNo)).orElse(null); + } + + @Transactional + public void deleteIllegalShipInfo(Integer fbKey) { + isiRepository.bulkModifyingByFbKeyToStatus(fbKey, "DST008"); + } + public List selectIllegalShipInfoList(UnlawfulFishingParam params) { return unlawfulFishingMapper.selectIllegalShipInfoList(params); } diff --git a/src/main/resources/mybatisMapper/UnlawfulFishingMapper.xml b/src/main/resources/mybatisMapper/UnlawfulFishingMapper.xml index a351fb7a..0dbe6100 100644 --- a/src/main/resources/mybatisMapper/UnlawfulFishingMapper.xml +++ b/src/main/resources/mybatisMapper/UnlawfulFishingMapper.xml @@ -134,5 +134,39 @@ where a.status <> 'DST008' + + and b.case_num like '%'||#{caseNum}||'%' + + + and a.permit_num like '%'||#{permitNum}||'%' + + + and (a.boat_nny_sung like '%'||#{boatNny}||'%' or a.boat_nny_si like '%'||#{boatNny}||'%') + + + and (a.boat_name_kr like '%'||#{boatName}||'%' or a.boat_name_cn like '%'||#{boatName}||'%') + + + and a.boat_material = #{boatMaterial} + + + and a.fishery_type = #{fisheryType} + + + + and a.payment_payment_dt >= #{startDate}::date + + + and a.payment_payment_dt <= #{endDate}::date+1 + + + + + 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/faStatistics/unlawfulFishing/illegalShipInfo.js b/src/main/resources/static/js/faStatistics/unlawfulFishing/illegalShipInfo.js index 12c718da..79bb305e 100644 --- a/src/main/resources/static/js/faStatistics/unlawfulFishing/illegalShipInfo.js +++ b/src/main/resources/static/js/faStatistics/unlawfulFishing/illegalShipInfo.js @@ -29,11 +29,28 @@ $(document).on('change', '#confiscationSelector', function (){ confiscationInput.removeAttr('disabled') } }) - +$(document).on('change', '#paymentDate,#paymentTime', function (){ + $("#paymentPaymentDt").val($("#paymentDate").val()+" "+$("#paymentTime").val()) +}) $(document).on('click', '.saveEditInfoBtn', function (){ saveIllegalShipInfo($(this).attr("data-status")) }) +$(document).on('click', '.shipInfoTr', function (){ + getIsiViewModal($(this).attr('data-fbkey')) +}) + +$(document).on('click', '#editShipInfoBtn', function (){ + $("#isiViewModal").modal('hide'); + getIsiEditModal($("#fishingBoatViewTabPanel").find(".fbKey").val()); +}) +$(document).on('click', '#deleteShipInfoBtn', function (){ + deleteShipInfo($("#fishingBoatViewTabPanel").find(".fbKey").val()); +}) +$(document).on('click', '.versionInfoTr', function (){ + getIsiHistory($(this).find(".fbKey").val(), $(this).find(".versionNo").val()); +}) + function getIsiEditModal(fbKey){ $.ajax({ url: '/unlawfulFishing/isiEditModal', @@ -56,6 +73,23 @@ function getIsiEditModal(fbKey){ }); } +function getIsiViewModal(fbKey){ + $.ajax({ + url: '/unlawfulFishing/isiViewModal', + data: {fbKey: fbKey}, + type: 'GET', + dataType:"html", + success: function(html){ + const contentDiv = $("#isiViewModalContent"); + contentDiv.empty().append(html) + $("#isiViewModal").modal('show'); + }, + error:function(e){ + ajaxErrorAction(e); + } + }); +} + function saveIllegalShipInfo(status){ if (confirm("저장하시겠습니까?")) { if (valueCheck(status)) { @@ -95,3 +129,41 @@ function valueCheck(status){ } return true; } + +function deleteShipInfo(fbKey){ + if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){ + contentFade("in"); + $.ajax({ + type : 'POST', + data : JSON.stringify({fbKey: fbKey}), + url : "/unlawfulFishing/deleteIllegalShipInfo", + contentType: 'application/json', + beforeSend: function (xhr){ + xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); + }, + success : function(result) { + alert("삭제되었습니다."); + location.reload(); + }, + error : function(xhr, status) { + alert("삭제를 실패하였습니다.") + contentFade("out"); + } + }) + } +} + +function getIsiHistory(fbKey, versionNo){ + $.ajax({ + url: '/unlawfulFishing/isiHistoryDiv', + data: {fbKey: fbKey, versionNo: versionNo}, + type: 'GET', + dataType:"html", + success: function(html){ + $("#versionInfoDiv").empty().append(html) + }, + error:function(e){ + ajaxErrorAction(e); + } + }); +} \ No newline at end of file diff --git a/src/main/resources/templates/faStatistics/unlawfulFishing/crackdownInfo/cdiViewModal.html b/src/main/resources/templates/faStatistics/unlawfulFishing/crackdownInfo/cdiViewModal.html index 41680fa2..9dacca73 100644 --- a/src/main/resources/templates/faStatistics/unlawfulFishing/crackdownInfo/cdiViewModal.html +++ b/src/main/resources/templates/faStatistics/unlawfulFishing/crackdownInfo/cdiViewModal.html @@ -36,11 +36,11 @@
- +
- +
@@ -54,23 +54,23 @@
- +
- +
- +
- +
@@ -78,31 +78,31 @@
- +
- +
- +
- +
- +
- +
@@ -116,47 +116,47 @@ !#strings.isEmpty(crackdownInfo.materialDamageDetail)}">
- +
- +
- -
- +
- +
- -
- +
@@ -170,14 +170,14 @@ crackdownInfo.catchCnt ne 0}">
- +
- - + - -
diff --git a/src/main/resources/templates/faStatistics/unlawfulFishing/crackdownInfo/crackdownInfoPage.html b/src/main/resources/templates/faStatistics/unlawfulFishing/crackdownInfo/crackdownInfoPage.html index 2169b8dc..66fa2d1a 100644 --- a/src/main/resources/templates/faStatistics/unlawfulFishing/crackdownInfo/crackdownInfoPage.html +++ b/src/main/resources/templates/faStatistics/unlawfulFishing/crackdownInfo/crackdownInfoPage.html @@ -7,7 +7,9 @@
diff --git a/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/illegalShipInfoPage.html b/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/illegalShipInfoPage.html index f731a5fc..267b7d3a 100644 --- a/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/illegalShipInfoPage.html +++ b/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/illegalShipInfoPage.html @@ -8,7 +8,9 @@
@@ -26,7 +28,7 @@
-
+
@@ -34,52 +36,42 @@
- +
- +
- +
- +
- +
- -
-
- +
diff --git a/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiEditModal.html b/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiEditModal.html index 4fa87cd3..943697f8 100644 --- a/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiEditModal.html +++ b/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiEditModal.html @@ -1,25 +1,25 @@ @@ -85,41 +85,41 @@
- - + +
- +
- +
- +
- +
- +
- +
- +
- - + +
@@ -127,20 +127,20 @@
+ th:with="confiscationFlag=${shipInfo.confiscationFrame ne null || + shipInfo.confiscationWidth ne null || + shipInfo.confiscationJo ne null || + shipInfo.confiscationGae ne null || + shipInfo.confiscationEtc ne null}"> - - - - - + + + + +
diff --git a/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiHistoryDiv.html b/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiHistoryDiv.html new file mode 100644 index 00000000..05b6cc72 --- /dev/null +++ b/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiHistoryDiv.html @@ -0,0 +1,97 @@ + + + +
+
■ 어선정보
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+ + + +
+ +
+ + + +
+ +
+
+ + +
+
+
+
+ + + + + + + + +
+
+ + + + + +
+ +
+
+
+ + +
\ No newline at end of file diff --git a/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiViewModal.html b/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiViewModal.html index f8ac5370..4a0621d1 100644 --- a/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiViewModal.html +++ b/src/main/resources/templates/faStatistics/unlawfulFishing/illegalShipInfo/isiViewModal.html @@ -9,53 +9,138 @@ -
- - -
-
-
-
- -
-
-
-
■ 단속정보
-
- - - - - (수정 이력 없음) - - - - -
-
+ +
+
+ +
+
+
+
■ 어선정보
+
+ + + + + (수정 이력 없음) + + + +
- -
- + +
+
+ + +
- +
+
+
- +
- -
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+ + + +
+ +
+ + + +
+ +
+
+ + +
+
+
+
+ + + + + + + + +
+
+ + + + + +
+ +
+
+
+ + +
+
+
■ 단속정보
+
+
+ +
+ +
+ +
- - -
- + + +
+
@@ -63,110 +148,110 @@
- +
- +
- +
- +
- +
- - + +
- +
- - + +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- -
- -
+ +
- +
- -
- -
+ +
@@ -175,382 +260,25 @@
- +
- +
- - - -
- -
-
■ 선장·선주 정보
-
-
- - -
-
- -
-
- - - -
- -
-
-
- - -
-
-
-
-
-
-
-
- -
사진 없음
-
- - 선장 사진 - -
-
-
- -
- -
- -
- -
-
-
- -
- -
- -
- -
-
-
- -
- -
-
-
-
-
- - -
-
- -
-
- - - -
-
-
-
- -
- -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
-
-
-
■ 어선 정보
-
-
- -
-
- - -
-
-
-
- -
- -
- -
- -
- -
- -
- -
- -
-
-
- -
- - - -
- -
- - - -
- -
-
- - -
-
-
-
- - - - - - - - -
-
- - - - - -
- -
-
-
- - -
-
-
■ 처리 결과
-
-
- -
- - - -
- -
- -
- - - - -
-
- -
- -
- - - -
- -
-
-
- -
- -
- -
- -
- -
- -
-
-
- -
- -
- -
- -
- -
- -
-
-
- -
- -
- -
-
- - -
-
- -
- -
- -
- -
-
-
- -
- -
- -
- -
- -
- - - -
-
-
- -
- -
- -
- -
-
-
- -
- - - - - -
- -
- - - - - -
- -
- - - - - -
-
-
- -
-
- - -
-
- - - - - - -
-
-
-
-
-
-
@@ -564,17 +292,17 @@ - - + + - - + +
- - + + @@ -590,17 +318,15 @@
- - + - \ No newline at end of file