From f5e34bf16eeb901b21c6055cd771bfe7e2dd89fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Fri, 11 Nov 2022 11:31:33 +0900 Subject: [PATCH] =?UTF-8?q?=EC=96=B4=EC=84=A0=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=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 --- .../FishingBoatController.java | 14 +++---- .../fishingBoat/FishingBoatBaseEntity.java | 2 +- .../ViolationVersionRepository.java | 3 ++ .../service/FishingBoatService.java | 32 ++++++++++++++- .../static/js/faStatistics/fishingBoatMgt.js | 2 + .../fishingBoat/fishingBoardVersionInfo.html | 40 +++++++++---------- .../fishingBoat/fishingBoatEditModal.html | 34 ++++++++-------- .../fishingBoat/fishingBoatViewModal.html | 6 +-- 8 files changed, 84 insertions(+), 49 deletions(-) diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/FishingBoatController.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/FishingBoatController.java index 05413f48..accb2861 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/FishingBoatController.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/FishingBoatController.java @@ -78,12 +78,11 @@ public class FishingBoatController { }else{ crackdownStatus.setFishingBoat(new FishingBoat()); crackdownStatus.setProcessResult(new ProcessResult()); - crackdownStatus.setWrtOrgan(loginUser.getOgCd()); - crackdownStatus.setWrtPart(loginUser.getOfcCd()); - crackdownStatus.setWrtUserSeq(loginUser.getUserSeq()); - crackdownStatus.setWrtUserNm(loginUser.getUserNm()); - crackdownStatus.setWrtUserGrd(loginUser.getTitleCd()); - crackdownStatus.setWrtDt(LocalDateTime.now()); + crackdownStatus.getFishingBoat().setWrtOrgan(loginUser.getOgCd()); + crackdownStatus.getFishingBoat().setWrtPart(loginUser.getOfcCd()); + crackdownStatus.getFishingBoat().setWrtUserSeq(loginUser.getUserSeq()); + crackdownStatus.getFishingBoat().setWrtUserNm(loginUser.getUserNm()); + crackdownStatus.getFishingBoat().setWrtUserGrd(loginUser.getTitleCd()); } mav.addObject("ataList", codeMgtService.selectCodeMgtList("ATA")); mav.addObject("cpoList", codeMgtService.selectCodeMgtList("CPO")); @@ -105,9 +104,10 @@ public class FishingBoatController { public Integer checkCaseNum(String caseNum){ return fishingBoatService.checkCaseNum(caseNum); } + @GetMapping("/fishingBoatVersionInfo") public ModelAndView fishingBoatVersionInfo(FishingBoatVersion version){ - ModelAndView mav = new ModelAndView("faStatistics/fishingBoat/fishingBoatVersionInfo"); + ModelAndView mav = new ModelAndView("faStatistics/fishingBoat/fishingBoardVersionInfo"); mav.addObject("fishingBoat", fishingBoatService.selectFishingBoatVersion(version.getFbKey(), version.getVersionNo())); mav.addObject("vtList", codeMgtService.selectCodeMgtList("VT")); mav.addObject("ftList", codeMgtService.selectCodeMgtList("FT")); diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/model/fishingBoat/FishingBoatBaseEntity.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/model/fishingBoat/FishingBoatBaseEntity.java index 7f2103fe..19c5e05c 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/model/fishingBoat/FishingBoatBaseEntity.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/model/fishingBoat/FishingBoatBaseEntity.java @@ -28,7 +28,7 @@ public class FishingBoatBaseEntity extends BaseModel { @Column(name = "sailor_cnt") private Integer sailorCnt; @Column(name = "ton_cnt") - private Integer tonCnt; + private Double tonCnt; @Column(name = "fishery_type") private String fisheryType; @Column(name = "boat_material") diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/repository/ViolationVersionRepository.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/repository/ViolationVersionRepository.java index 1aa4e47c..2b352c46 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/repository/ViolationVersionRepository.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/repository/ViolationVersionRepository.java @@ -3,8 +3,11 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.ViolationVersion; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; import java.util.Optional; public interface ViolationVersionRepository extends JpaRepository { Optional findTop1ByFbKeyOrderByVersionNoDesc(Integer fbKey); + + List findByFbKeyAndVersionNoOrderByViolationKeyAsc(Integer fbKey, Integer versionNo); } diff --git a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/FishingBoatService.java b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/FishingBoatService.java index d7ceeb65..60bc1a39 100644 --- a/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/FishingBoatService.java +++ b/src/main/java/com/dbnt/faisp/main/faStatistics/crackdownsStatus/service/FishingBoatService.java @@ -66,6 +66,7 @@ public class FishingBoatService extends BaseService { if (crackdownStatus.getCdsKey()==null || crackdownStatus.getCdsKey().equals(0)){ // 최초 등록시 단속현황, 처리현황, 선원정보를 같이 등록. // 단속현황, 단속현황버전 저장. + crackdownStatus = setWriteInfo(crackdownStatus); cdsKey = crackdownStatusRepository.save(crackdownStatus).getCdsKey(); CrackdownStatusVersion crackdownStatusVersion = new CrackdownStatusVersion(); BeanUtils.copyProperties(crackdownStatus, crackdownStatusVersion); @@ -154,6 +155,35 @@ public class FishingBoatService extends BaseService { } public FishingBoatVersion selectFishingBoatVersion(Integer fbKey, Integer versionNo) { - return fishingBoatVersionRepository.findById(new FishingBoatVersion.FishingBoatVersionId(fbKey, versionNo)).orElse(null); + FishingBoatVersion fishingBoat = fishingBoatVersionRepository.findById(new FishingBoatVersion.FishingBoatVersionId(fbKey, versionNo)).orElse(null); + fishingBoat.setViolationList(violationVersionRepository.findByFbKeyAndVersionNoOrderByViolationKeyAsc(fbKey, versionNo)); + return fishingBoat; + } + + private CrackdownStatus setWriteInfo(CrackdownStatus crackdownStatus){ + FishingBoat fishingBoat = crackdownStatus.getFishingBoat(); + crackdownStatus.setWrtOrgan(fishingBoat.getWrtOrgan()); + crackdownStatus.setWrtPart(fishingBoat.getWrtPart()); + crackdownStatus.setWrtUserSeq(fishingBoat.getWrtUserSeq()); + crackdownStatus.setWrtUserNm(fishingBoat.getWrtUserNm()); + crackdownStatus.setWrtUserGrd(fishingBoat.getWrtUserGrd()); + crackdownStatus.setWrtDt(LocalDateTime.now()); + + crackdownStatus.getProcessResult().setWrtOrgan(fishingBoat.getWrtOrgan()); + crackdownStatus.getProcessResult().setWrtPart(fishingBoat.getWrtPart()); + crackdownStatus.getProcessResult().setWrtUserSeq(fishingBoat.getWrtUserSeq()); + crackdownStatus.getProcessResult().setWrtUserNm(fishingBoat.getWrtUserNm()); + crackdownStatus.getProcessResult().setWrtUserGrd(fishingBoat.getWrtUserGrd()); + crackdownStatus.getProcessResult().setWrtDt(LocalDateTime.now()); + + for(Sailor sailor: crackdownStatus.getSailorList()){ + sailor.setWrtOrgan(fishingBoat.getWrtOrgan()); + sailor.setWrtPart(fishingBoat.getWrtPart()); + sailor.setWrtUserSeq(fishingBoat.getWrtUserSeq()); + sailor.setWrtUserNm(fishingBoat.getWrtUserNm()); + sailor.setWrtUserGrd(fishingBoat.getWrtUserGrd()); + sailor.setWrtDt(LocalDateTime.now()); + } + return crackdownStatus; } } diff --git a/src/main/resources/static/js/faStatistics/fishingBoatMgt.js b/src/main/resources/static/js/faStatistics/fishingBoatMgt.js index b01a6f94..ec1a4e62 100644 --- a/src/main/resources/static/js/faStatistics/fishingBoatMgt.js +++ b/src/main/resources/static/js/faStatistics/fishingBoatMgt.js @@ -60,6 +60,8 @@ $(document).on('change', '#violationSelector', function (){ } }) $(document).on('click', '.versionInfoTr', function (){ + $(".versionInfoChkbox").prop("checked", false); + $(this).find(".versionInfoChkbox")[0].checked = true $.ajax({ url: '/faStatistics/fishingBoatVersionInfo', data: { diff --git a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoardVersionInfo.html b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoardVersionInfo.html index cd1f2c56..c7dc28c1 100644 --- a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoardVersionInfo.html +++ b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoardVersionInfo.html @@ -1,8 +1,8 @@
- -
+ +
@@ -22,12 +22,12 @@
- -
+ +
- -
+ +
@@ -40,14 +40,14 @@
- -
+ +
- -
+ +
@@ -61,37 +61,37 @@
- -
+ +
-
+
- +
- -
+ +
- -
+ +
- +
- +
diff --git a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatEditModal.html b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatEditModal.html index d27596fa..bb6fb42d 100644 --- a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatEditModal.html +++ b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatEditModal.html @@ -78,7 +78,7 @@
- +
@@ -118,7 +118,7 @@
- +
@@ -182,7 +182,7 @@
- +
@@ -223,7 +223,7 @@
- +
@@ -289,7 +289,7 @@
- +
@@ -429,7 +429,7 @@
- +
@@ -463,7 +463,7 @@
- +
@@ -473,7 +473,7 @@
- +
@@ -489,13 +489,13 @@
- +
- +
@@ -564,21 +564,21 @@
- +
- +
- +
- +
@@ -591,7 +591,7 @@
- +
@@ -663,7 +663,7 @@
@@ -699,7 +699,7 @@
- +
diff --git a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatViewModal.html b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatViewModal.html index b1b71550..bdf8fc13 100644 --- a/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatViewModal.html +++ b/src/main/resources/templates/faStatistics/fishingBoat/fishingBoatViewModal.html @@ -401,7 +401,7 @@
-
+
@@ -414,7 +414,7 @@ - +
@@ -430,7 +430,7 @@
-
+