From 6e306ebe9b82c6f26ae692f91a2ff251c7cef245 Mon Sep 17 00:00:00 2001 From: "DESKTOP-QGC5RJO\\DBNT" Date: Tue, 10 Jan 2023 18:03:52 +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=202?= =?UTF-8?q?=EC=B0=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crackdownsStatus/AsfCovController.java | 16 +- .../crackdownsStatus/model/asfCov/AsfCov.java | 102 ++++- .../resources/mybatisMapper/AsfCovMapper.xml | 37 +- .../static/js/faStatistics/asfCov.js | 218 ++++++++++ .../common/modal/crackdownStatusModal.html | 2 + .../templates/faStatistics/asfCov/asfCov.html | 51 ++- .../faStatistics/asfCov/asfCovEditModal.html | 393 ++++-------------- .../faStatistics/asfCov/asfCovViewModal.html | 73 +++- 8 files changed, 541 insertions(+), 351 deletions(-) create mode 100644 src/main/resources/static/js/faStatistics/asfCov.js 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 a7396062..9aaabeef 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 @@ -43,8 +43,8 @@ public class AsfCovController { @GetMapping("/asfCovEditModal") public ModelAndView asfCovEditModal(@AuthenticationPrincipal UserInfo loginUser, AsfCov asfCov) { ModelAndView mav = new ModelAndView("faStatistics/asfCov/asfCovEditModal"); - if (asfCov.getAsfcovKey() != null) { - asfCov = asfCovService.selectAsfCov(asfCov.getAsfcovKey()); + if (asfCov.getAsfCovKey() != null) { + asfCov = asfCovService.selectAsfCov(asfCov.getAsfCovKey()); } else { asfCov.setWrtOrgan(loginUser.getOgCd()); asfCov.setWrtPart(loginUser.getOfcCd()); @@ -52,13 +52,23 @@ public class AsfCovController { asfCov.setWrtUserGrd(loginUser.getTitleCd()); asfCov.setWrtUserNm(loginUser.getUserNm()); asfCov.setWrtDt(loginUser.getWrtDt()); - asfCov.setWrtDt(loginUser.getWrtDt()); } mav.addObject("asfCov", asfCov); mav.addObject("userSeq", loginUser.getUserSeq()); return mav; } + + @GetMapping("/asfCovViewModal") + 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); + + return mav; + } } diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/model/asfCov/AsfCov.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/model/asfCov/AsfCov.java index 9d5bbf4b..1f843c63 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/model/asfCov/AsfCov.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/model/asfCov/AsfCov.java @@ -3,6 +3,7 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.asfCov; import com.dbnt.faisp.config.BaseModel; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatusBaseEntity; +import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat; import io.micrometer.core.annotation.Counted; import lombok.Getter; import lombok.NoArgsConstructor; @@ -25,7 +26,7 @@ public class AsfCov extends BaseModel { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "asfcov_key") - private Integer asfcovKey; + private Integer asfCovKey; @Column(name="version_no") private Integer versionNo; @@ -70,9 +71,106 @@ public class AsfCov extends BaseModel { @Column(name = "wrt_part") private String wrtPart; + +//////////////////////////////////////////////////////////////////////// + + @Transient private CrackdownStatus crackdownStatus; + @Column(name = "case_num") + private String caseNum; + + @Column(name = "case_police_officer") + private String casePoliceOfficer; + + @Column(name = "crackdown_boat") + private String crackdownBoat; + + @Column(name = "napo_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime napoDt; + + @Column(name = "napo_sea_point_lon") + private String napoSeaPointLon; + + @Column(name = "napo_sea_point_lat") + private String napoSeaPointLat; + + @Column(name = "napo_sea_point_detail") + private String napoSeaPointDetail; + + @Column(name = "invasion_type") + private String invasionType; + + @Column(name = "nll") + private String nll; + + @Column(name = "case_agency") + private String caseAgency; + + @Column(name = "crackdown_police") + private String crackdownPolice; + + @Column(name = "mmsi") + private String mmsi; + + @Column(name = "field_ivsgt") + private String fieldIvsgt; + + @Column(name = "obstr_exspd_cnt") + private Integer obstrExspdCnt; + + @Column(name = "person_damage_cnt") + private Integer personDamageCnt; + + @Column(name = "person_damage_amount") + private Integer personDamageAmount; + + @Column(name = "person_damage_detail") + private String personDamageDetail; + + @Column(name = "material_damage_cnt") + private Integer materialDamageCnt; + + @Column(name = "material_damage_amount") + private Integer materialDamageAmount; + + @Column(name = "material_damage_detail") + private String materialDamageDetail; + + @Column(name = "field_ivsgt_napo_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime fieldIvsgtNapoDt; + + @Column(name = "field_ivsgt_release_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime fieldIvsgtReleaseDt; + + @Column(name = "field_ivsgt_time_taken") + private String fieldIvsgtTimeTaken; + + @Column(name = "pressurized_start_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime pressurizedStartDt; + + @Column(name = "pressurized_end_dt") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime pressurizedEndDt; + + @Column(name = "distance") + private String distance; + + //////////////////////////////////////////////////////////// + @Transient - private Integer caseNum; + private FishingBoat fishingBoat; + + @Column(name = "boat_name_kr") + private String boatNameKr; + @Column(name = "boat_name_cn") + private String boatNameCn; + + + } diff --git a/src/main/resources/mybatisMapper/AsfCovMapper.xml b/src/main/resources/mybatisMapper/AsfCovMapper.xml index 95b63702..5d3920db 100644 --- a/src/main/resources/mybatisMapper/AsfCovMapper.xml +++ b/src/main/resources/mybatisMapper/AsfCovMapper.xml @@ -79,14 +79,37 @@ , cs.pressurized_start_dt , cs.pressurized_end_dt , cs.distance - , cs.wrt_organ - , cs.wrt_user_seq - , cs.wrt_user_nm - , cs.wrt_dt + , 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.save_yn - FROM crackdown_status cs - INNER JOIN asfcov_status a - ON cs.cds_key = a.cds_key + 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 order by a.asfcov_key desc diff --git a/src/main/resources/static/js/faStatistics/asfCov.js b/src/main/resources/static/js/faStatistics/asfCov.js new file mode 100644 index 00000000..70253860 --- /dev/null +++ b/src/main/resources/static/js/faStatistics/asfCov.js @@ -0,0 +1,218 @@ + + +$("#jqueryBtn").click(function(){ + $(".quiz-text").text("Javascript"); + $(".quiz-text").css('color', 'blue'); +}); + + + +$(document).on('click', '#saveBtn', function (){ + if(confirm("저장하시겠습니까?")){ + if($('#contentTitle').val() == ''){ + alert("제목을 입력해주세요."); + $('#contentTitle').focus(); + return false; + } + if($('#majorType').val() == ''){ + alert("종류를 선택해주세요."); + $('#majorType').focus(); + return false; + } + saveContent('DST007'); + } +}) + +$(document).on('click', '#saveTempBtn', function (){ + if(confirm("임시저장 하시겠습니까?")){ + if($('#contentTitle').val() == ''){ + alert("제목을 입력해주세요."); + $('#contentTitle').focus(); + return false; + } + if($('#majorType').val() == ''){ + alert("종류를 선택해주세요."); + $('#majorType').focus(); + return false; + } + saveContent('DST001'); + } +}) + + + +$(document).on('click', '#addAsfCovBtn', function (){ + getEditModal(null) +}) + +$(document).on('click', '.tr', function (){ + $(".trChkBox").prop("checked", false); + $(this).find(".trChkBox").prop("checked", true); + getViewModal(Number($(this).find(".asfCovKey").val())); +}) + + +// $(document).on('click', '#saveBtn', function (){ +// saveContent("MajorEditForm") +// }) + +$(document).on('click', '#editBtn', function (){ + $("#asfCovViewModal").modal('hide') + getEditModal($(this).attr("data-asfCovKey")); +}) + + + + + +$(function(){ + $("#dateSelectorDiv").datepicker({ + format: "yyyy-mm-dd", + language: "ko", + autoclose: true + }); +}) + + +$(document).on('click', '#deleteMajorBtn', function (){ + const asfCovKey = $('input[name=asfCovKey]').val(); + console.log(asfCovKey); + if(confirm("삭제하시겠습니까?")){ + //contentFade("in"); + $.ajax({ + type : 'POST', + url : "/ivsgt/deleteContent", + data : JSON.stringify({asfCovKey:asfCovKey}), + contentType: 'application/json', + beforeSend: function (xhr){ + xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); + }, + success : function(data) { + alert("삭제 처리되었습니다."); + //contentFade("out"); + location.reload(); + }, + error : function(xhr, status) { + alert("삭제 처리에 실패하였습니다"); + //contentFade("out"); + } + }) + } +}) + + + +function getEditModal(asfCovKey){ + $.ajax({ + url: '/faStatistics/asfCovEditModal', + data: {asfCovKey: asfCovKey}, + type: 'GET', + dataType:"html", + success: function(html){ + const crackdownPolice = $("#crackdownPolice").val() + if(crackdownPolice){ + getCrackdownBoatOption(crackdownPolice) + } + $("#asfCovEditModalContent").empty().append(html); + $("#asfCovEditModal").modal('show'); + + }, + error:function(){ + + } + }); +} + +function getViewModal(asfCovKey){ + $.ajax({ + url: '/faStatistics/asfCovViewModal', + data: {asfCovKey: asfCovKey}, + type: 'GET', + dataType:"html", + success: function(html){ + $("#asfCovViewModalContent").empty().append(html) + $("#asfCovViewModal").modal('show'); + }, + error:function(){ + + } + }); +} + +function saveContent(contentStatus){ + const formData = new FormData($("#asfCovEditForm")[0]); + 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")); + }) + formData.append('contentStatus', contentStatus); + formData.append('contentInfo', CrossEditor.GetBodyValue()); + $.ajax({ + type : 'POST', + data : formData, + url : "/ivsgt/saveContent", + processData: false, + contentType: false, + success : function(result) { + alert("저장되었습니다."); + contentFade("out"); + location.reload(); + }, + error : function(xhr, status) { + alert("저장에 실패하였습니다.") + contentFade("out"); + } + }) +} + + +function contentCheck(formId){ + let flag = true; + if(!$("#contentTitle").val()){ + alert("제목을 입력해주세요.") + flag = false; + } + + flag = fileCheck(flag, files); + 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'); +}); + +$(document).on('click', '#caseNumBtn', function (){ + searchModalSubmit(1); + $("#asfCovSubModal").modal('show'); +}) + +$(document).on('click', '#getCrackdownBtn', function (){ + getEditModal($(".crackdownChkbox:checked").parents(".crackdownTr").attr("data-key")); + $("#asfCovSubModal").modal('hide'); +}) + +$(function(){ + const searchFormBoat = $("#searchFormBoat") + if(searchFormBoat.val()!==""){ + searchFormBoat.find("."+$("#searchFormPolice").val()).show(); + searchFormBoat.removeAttr("disabled"); + } + $("#dateSelectorDiv").datepicker({ + format: "yyyy-mm-dd", + language: "ko", + autoclose: true + }); +}); + + diff --git a/src/main/resources/templates/common/modal/crackdownStatusModal.html b/src/main/resources/templates/common/modal/crackdownStatusModal.html index b8061fcc..78f13fcb 100644 --- a/src/main/resources/templates/common/modal/crackdownStatusModal.html +++ b/src/main/resources/templates/common/modal/crackdownStatusModal.html @@ -193,6 +193,8 @@ + //여기에추가 6개 + // diff --git a/src/main/resources/templates/faStatistics/asfCov/asfCov.html b/src/main/resources/templates/faStatistics/asfCov/asfCov.html index 37825f23..d78bcb57 100644 --- a/src/main/resources/templates/faStatistics/asfCov/asfCov.html +++ b/src/main/resources/templates/faStatistics/asfCov/asfCov.html @@ -1,9 +1,10 @@ - +
@@ -327,7 +328,7 @@
- +
@@ -366,19 +367,23 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -388,10 +393,10 @@
- +
- +
@@ -399,17 +404,17 @@ + +
사건번호