diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/UnlawfulFishingService.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/UnlawfulFishingService.java index ead4d60d..784ba5da 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/UnlawfulFishingService.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/UnlawfulFishingService.java @@ -23,11 +23,13 @@ public class UnlawfulFishingService { int cdsKey = crackdownStatusService.saveCrackdownStatusOnly(crackdownStatus); int fbKey = fishingBoatService.saveFishingBoatOnly(cdsKey, crackdownStatus.getFishingBoat(), crackdownStatus.getViolationList()); processResultService.saveProcessResultOnly(cdsKey, crackdownStatus.getProcessResult()); - for(Sailor sailor: crackdownStatus.getSailorList()){ - if(sailor.getPosition().equals("POS001")){ - sailorService.saveSailorOnly(fbKey, sailor, crackdownStatus.getSailorFileList()); - }else{ - sailorService.saveSailorOnly(fbKey, sailor, null); + if(crackdownStatus.getSailorList()!=null){ + for(Sailor sailor: crackdownStatus.getSailorList()){ + if(sailor.getPosition().equals("POS001")){ + sailorService.saveSailorOnly(fbKey, sailor, crackdownStatus.getSailorFileList()); + }else{ + sailorService.saveSailorOnly(fbKey, sailor, null); + } } } return cdsKey; diff --git a/src/main/resources/static/js/faStatistics/fishingBoatMgt.js b/src/main/resources/static/js/faStatistics/fishingBoatMgt.js index 560d50c7..6da92dde 100644 --- a/src/main/resources/static/js/faStatistics/fishingBoatMgt.js +++ b/src/main/resources/static/js/faStatistics/fishingBoatMgt.js @@ -194,11 +194,11 @@ $(document).on('click', '.saveEditInfoBtn', function (){ }) $(document).on('change', '#napoDate, #napoTime', function (){ $("#napoDt").val($("#napoDate").val()+" "+$("#napoTime").val()); - calculationReleaseToNapo() + calculationReleaseToNapo($('#fishingBoatEditModalContent')) }) $(document).on('change', '#releaseDate, #releaseTime', function (){ $("#releaseDt").val($("#releaseDate").val()+" "+$("#releaseTime").val()); - calculationReleaseToNapo() + calculationReleaseToNapo($('#fishingBoatEditModalContent')) }) $(document).on('change', '#paymentPaymentDate, #paymentPaymentTime', function (){ $("#paymentPaymentDt").val($("#paymentPaymentDate").val()+" "+$("#paymentPaymentTime").val()); @@ -232,7 +232,8 @@ function getFishingBoatEditModal(cdsKey){ type: 'GET', dataType:"html", success: function(html){ - $("#fishingBoatEditModalContent").empty().append(html) + const contentDiv = $("#fishingBoatEditModalContent"); + contentDiv.empty().append(html) $(".dateSelector").datepicker({ format: "yyyy-mm-dd", language: "ko", @@ -262,6 +263,7 @@ function getFishingBoatEditModal(cdsKey){ } }) setUploadDiv(); + calculationReleaseToNapo(contentDiv); $("#fishingBoatEditModal").modal('show'); }, error:function(e){ @@ -276,11 +278,13 @@ function getFishingBoatViewModal(cdsKey){ type: 'GET', dataType:"html", success: function(html){ - $("#fishingBoatViewModalContent").empty().append(html) + const contentDiv = $("#fishingBoatViewModalContent"); + contentDiv.empty().append(html) const crackdownPolice = $("#crackdownPolice").val() if(crackdownPolice){ getCrackdownBoatOption(crackdownPolice) } + calculationReleaseToNapo(contentDiv) $("#fishingBoatViewModal").modal('show'); }, error:function(e){ @@ -333,7 +337,10 @@ function saveFishingBoatInfo(status){ // 선장 정보 입력 const sailorNameKr = $("#sailorNameKr").val(); if(sailorNameKr){ - formData.append('sailorList['+sailorCnt+'].sailorKey', $("#captainSailorKey").val()); + let sailorKey = $("#captainSailorKey").val(); + if(sailorKey!==undefined) { + formData.append('sailorList[' + sailorCnt + '].sailorKey', sailorKey); + } formData.append('sailorList['+sailorCnt+'].sailorNameKr', sailorNameKr); formData.append('sailorList['+sailorCnt+'].sailorNameCn', $("#sailorNameCn").val()); formData.append('sailorList['+sailorCnt+'].sailorNamePinyin', $("#sailorNamePinyin").val()); @@ -350,7 +357,10 @@ function saveFishingBoatInfo(status){ // 선주 정보 입력 const sailorNameKr2 = $("#sailorNameKr2").val(); if(sailorNameKr) { - formData.append('sailorList['+sailorCnt+'].sailorKey', $("#ownerSailorKey").val()); + let sailorKey = $("#ownerSailorKey").val(); + if(sailorKey!==undefined) { + formData.append('sailorList[' + sailorCnt + '].sailorKey', sailorKey); + } formData.append('sailorList[' + sailorCnt + '].sailorNameKr', sailorNameKr2); formData.append('sailorList[' + sailorCnt + '].sailorNameCn', $("#sailorNameCn2").val()); formData.append('sailorList[' + sailorCnt + '].sailorNamePinyin', $("#sailorNamePinyin2").val()); @@ -363,14 +373,20 @@ function saveFishingBoatInfo(status){ } const navigatingOfficerRestriction = $("#navigatingOfficerRestriction").val() if(navigatingOfficerRestriction){ - formData.append('sailorList['+sailorCnt+'].sailorKey', $("#navigatingOfficerKey").val()); + let sailorKey = $("#navigatingOfficerKey").val(); + if(sailorKey!==undefined) { + formData.append('sailorList[' + sailorCnt + '].sailorKey', sailorKey); + } formData.append('sailorList['+sailorCnt+'].isRestriction', navigatingOfficerRestriction); formData.append('sailorList['+sailorCnt+'].position', "POS002"); sailorCnt++; } const chiefEngineerRestriction = $("#chiefEngineerRestriction").val(); if(chiefEngineerRestriction){ - formData.append('sailorList['+sailorCnt+'].sailorKey', $("#chiefEngineerKey").val()); + let sailorKey = $("#chiefEngineerKey").val(); + if(sailorKey!==undefined) { + formData.append('sailorList[' + sailorCnt + '].sailorKey', sailorKey); + } formData.append('sailorList['+sailorCnt+'].isRestriction', chiefEngineerRestriction); formData.append('sailorList['+sailorCnt+'].position', "POS003"); sailorCnt++; @@ -381,7 +397,10 @@ function saveFishingBoatInfo(status){ alert("선원의 직책이 선택되지 않았습니다.") return false } - formData.append('sailorList['+(idx+sailorCnt)+'].sailorKey', $(div).find(".sailorKey").val()); + let sailorKey = $(div).find(".sailorKey").val(); + if(sailorKey!==undefined){ + formData.append('sailorList['+(idx+sailorCnt)+'].sailorKey', sailorKey); + } formData.append('sailorList['+(idx+sailorCnt)+'].isRestriction', $(div).find(".normalSailorRestriction").val()); formData.append('sailorList['+(idx+sailorCnt)+'].sailorNameKr', $(div).find(".normalSailorNm").val()); formData.append('sailorList['+(idx+sailorCnt)+'].position', position); @@ -405,12 +424,12 @@ function saveFishingBoatInfo(status){ } } -function calculationReleaseToNapo(){ - let napoDt = $("#napoDt").val(); - let releaseDt = $("#releaseDt").val(); +function calculationReleaseToNapo(form){ + let napoDt = form.find("#napoDt").val(); + let releaseDt = form.find("#releaseDt").val(); if(napoDt.length>15&&releaseDt.length>15){ releaseDt = new Date(releaseDt); napoDt = new Date(napoDt); - $("#releaseToNapo").val(Math.ceil((releaseDt.getTime()-napoDt.getTime())/(1000*60*60*24))+"일"); + form.find("#releaseToNapo").val(Math.ceil((releaseDt.getTime()-napoDt.getTime())/(1000*60*60*24))+"일"); } } diff --git a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatEditModal.html b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatEditModal.html index d8b92bd8..4f242db6 100644 --- a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatEditModal.html +++ b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatEditModal.html @@ -128,6 +128,7 @@
@@ -162,12 +163,12 @@
0 || + crackdownStatus.personDamageCnt > 0 || + crackdownStatus.personDamageAmount > 0 || crackdownStatus.personDamageDetail ne null || - crackdownStatus.materialDamageCnt ne null || - crackdownStatus.materialDamageAmount ne null || + crackdownStatus.materialDamageCnt > 0 || + crackdownStatus.materialDamageAmount > 0 || crackdownStatus.materialDamageDetail ne null}">
@@ -183,12 +184,12 @@
- +
- +
@@ -203,12 +204,12 @@
- +
- +
@@ -218,8 +219,8 @@
+ th:with="catchFlag=${crackdownStatus.fishingBoat.catchFishSpecies ne null || + crackdownStatus.fishingBoat.catchCnt > 0}">
@@ -227,7 +228,7 @@
- +
@@ -639,11 +640,11 @@
- +
- +
@@ -659,7 +660,7 @@
- +
@@ -680,7 +681,7 @@
- +
@@ -806,6 +807,7 @@
@@ -833,6 +835,7 @@ diff --git a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatMgt.html b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatMgt.html index e7e41b10..e3869ce2 100644 --- a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatMgt.html +++ b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatMgt.html @@ -14,6 +14,9 @@ display: none; z-index: 10; } + .bg-gainsboro{ + background-color: gainsboro; + }
diff --git a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatViewModal.html b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatViewModal.html index bd96ed9a..bcde01ce 100644 --- a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatViewModal.html +++ b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatViewModal.html @@ -17,174 +17,22 @@
-
+
-
■ 기본정보
+
■ 단속정보
- +
- +
- +
-
-
- -
- - - -
- -
- -
- -
- - - -
- -
- - - -
-
-
- -
- -
- -
- -
-
-
-
■ 선장·선주 정보
-
-
- - -
-
- -
-
- - - -
- -
-
-
- - -
-
-
-
-
-
-
-
- -
사진 없음
-
- - 선장 사진 - -
-
-
- -
- -
- -
- -
-
-
- -
- -
- -
- -
-
-
- -
- -
-
-
-
-
- - -
-
- -
-
- - - -
-
-
-
- -
- -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
-
-
■ 어선 정보
-
-
- -
-
- - -
-
- +
@@ -198,37 +46,289 @@
- + +
+ + + +
+ +
+ +
+ +
+ + + +
+ +
+ + + +
+
+
+ +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
+ + +
+ +
+
+ +
+
+ + + + + + +
+
+ +
+
+
+
+
+
+ +
+
+ + + + +
+
+ +
+
+
+
+
+
+
+
+
+ + +
+ +
+
+ + + + +
+
+
+
+
+ +
+
■ 선장·선주 정보
+
+
+ + +
+
+ +
+
+ + + +
+ +
+
+
+ + +
+
+
+
+
+
+
+
+ +
사진 없음
+
+ + 선장 사진 + +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + +
+
+ +
+
+ + + +
+
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
■ 어선 정보
+
+
+ +
+
+ + +
+
+
+
+
- +
- -
+ +
- -
+ +
- +
- +
- +
@@ -237,128 +337,158 @@
- -
- -
-
- -
- -
- -
- -
+ + + + + + + +
- -
- -
- -
- -
- -
- -
- + + + + +
- -
- -
+ +
■ 처리 결과
- +
- + +
+ +
+ + + + +
+
+
- + + +
- +
- +
- + +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
- +
- +
- +
- +
- -
- -
- -
- -
- +
-
-
- +
- +
- +
+
+ +
+ +
+
- +
@@ -366,7 +496,7 @@
- +
@@ -374,7 +504,7 @@
- +
@@ -384,7 +514,7 @@
- +
@@ -405,21 +535,21 @@