불법조업외국어선 > 처리현황 조회모달 동작 수정.

master
강석 최 2023-05-12 16:19:14 +09:00
parent f0b541057c
commit 7972cf12f7
10 changed files with 172 additions and 186 deletions

View File

@ -83,9 +83,33 @@ public class FishingBoatController {
return mav;
}
@RequestMapping("/processResult")
public ModelAndView processResult(@AuthenticationPrincipal UserInfo loginUser, UnlawfulFishingParam params) {
ModelAndView mav = new ModelAndView("faStatistics/processResult/processResult");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/processResult").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
if(params.getYear()==null){
params.setYear(LocalDateTime.now().getYear());
}
List<Integer> yearList = fishingBoatService.selectFishingBoatYearParam(params);
if(!yearList.contains(params.getYear())){
yearList.add(params.getYear());
}
List<CrackdownStatusDTO> csDTOList = fishingBoatService.selectCrackdownStatusList(params);
CSStatistics statistics = fishingBoatService.calculationCSStatistics(csDTOList);
mav.addObject("statistics", statistics);
mav.addObject("crackdownStatusList", csDTOList);
mav.addObject("yearList", yearList);
mav.addObject("searchParams", params);
return mav;
}
@GetMapping("/fishingBoatViewModal")
public ModelAndView fishingBoatViewModal(@AuthenticationPrincipal UserInfo loginUser, CrackdownStatus crackdownStatus){
ModelAndView mav = new ModelAndView("faStatistics/fishingBoat/fishingBoatViewModal");
mav.addObject("modalType", crackdownStatus.getModalType());
crackdownStatus = fishingBoatService.selectCrackdownStatus(crackdownStatus.getCdsKey());
mav.addObject("crackdownStatus", crackdownStatus);

View File

@ -28,37 +28,6 @@ public class ProcessResultController {
private final FishingBoatRepository fishingBoatRepository;
private final ProcessResultRepository processResultRepository;
@RequestMapping("/processResult")
public ModelAndView processResult(@AuthenticationPrincipal UserInfo loginUser, ProcessResult processResult) {
ModelAndView mav = new ModelAndView("faStatistics/processResult/processResult");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/processResult").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
processResult.setQueryInfo();
if(processResult.getYear()==null){
processResult.setYear(LocalDateTime.now().getYear());
}
List<Integer> yearList = processResultService.selectProcessResultYearParam(processResult);
if(!yearList.contains(processResult.getYear())){
yearList.add(processResult.getYear());
}
List<ProcessResult> processResultList = processResultService.selectProcessResultList(processResult);
for (ProcessResult pr:processResultList) {
pr.setCrackdownStatus(crackdownStatusRepository.findByCdsKey(pr.getCdsKey()).orElse(null));
pr.setFishingBoat(fishingBoatRepository.findByCdsKey(pr.getCdsKey()).orElse(null));
pr.setViolationList(violationRepository.findByFbKey(pr.getFishingBoat().getFbKey()));
}
mav.addObject("processResultList", processResultList);
mav.addObject("searchParams", processResult);
return mav;
}
@GetMapping("/processResult/processResultViewModal")
public ModelAndView processResultViewModal(@AuthenticationPrincipal UserInfo loginUser, ProcessResult processResult){
ModelAndView mav = new ModelAndView("faStatistics/processResult/processResultViewModal");

View File

@ -84,4 +84,7 @@ public class UnlawfulFishingParam extends BaseModel {
private String seniorRestriction;
private String normalRestriction;
private String sentencingCourt;
private String sentencingDetail;
private String executionDetail;
}

View File

@ -79,6 +79,8 @@ public class CrackdownStatusDTO extends BaseModel {
private String middleTakeoverBoat;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate confiscationDt;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate boatDisposalDt;
private Integer captainRestriction;
private Integer navigaterRestriction;
private Integer engineerRestriction;
@ -104,6 +106,12 @@ public class CrackdownStatusDTO extends BaseModel {
private String confiscationGae;
private String confiscationEtc;
private String sentencingCourt;
private String sentencingDetail;
private String executionDetail;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime updDt;
private String wrtOrgan;
private String wrtPart;
private Integer wrtUserSeq;

View File

@ -334,6 +334,9 @@
b.handover_boat ,
b.middle_takeover_boat ,
b.confiscation_dt,
b.sentencing_court,
b.sentencing_detail,
b.execution_detail,
coalesce(e.captainRestriction, 0) as captainRestriction,
coalesce(e.navigaterRestriction, 0) as navigaterRestriction,
coalesce(e.engineerRestriction, 0) as engineerRestriction,

View File

@ -52,7 +52,7 @@ $(document).on('click', '#getFishingBoatEditModalBtn', function (){
getFishingBoatEditModal(null);
})
$(document).on('click', '.crackdownStatusTr', function (){
getFishingBoatViewModal($(this).find(".cdsKey").val())
getFishingBoatViewModal($(this).attr("data-cdskey"), $(this).attr("data-modaltype"))
})
$(document).on('click', '#editFishingBoatBtn', function (){
getFishingBoatEditModal($("#fishingBoatViewModalContent").find(".cdsKey").val());
@ -306,10 +306,10 @@ function getFishingBoatEditModal(cdsKey){
}
});
}
function getFishingBoatViewModal(cdsKey){
function getFishingBoatViewModal(cdsKey, modalType){
$.ajax({
url: '/faStatistics/fishingBoatViewModal',
data: {cdsKey: cdsKey},
data: {cdsKey: cdsKey, modalType: modalType},
type: 'GET',
dataType:"html",
success: function(html){
@ -473,12 +473,14 @@ function valueCheck(status){
function calculationReleaseToNapo(form){
let napoDt = form.find("#napoDt").val();
let releaseDt = form.find("#releaseDt").val();
if(napoDt !== undefined && releaseDt !== undefined){
if(napoDt.length>15&&releaseDt.length>15){
releaseDt = new Date(releaseDt);
napoDt = new Date(napoDt);
form.find("#releaseToNapo").val(Math.ceil((releaseDt.getTime()-napoDt.getTime())/(1000*60*60*24))+"일");
}
}
}
function setViolationInput(){
let violationInputText = "";

View File

@ -543,9 +543,7 @@
</thead>
<tbody class="table-group-divider align-middle">
<th:block th:each="dto,cnt:${crackdownStatusList}">
<tr class="crackdownStatusTr">
<input type="hidden" class="cdsKey" th:value="${dto.cdsKey}">
<!--<td th:text="${crackdownStatus.cdsKey}"></td>-->
<tr class="crackdownStatusTr" th:data-cdskey="${dto.cdsKey}" data-modaltype="viewOnly">
<td th:text="${cnt.count}"></td>
<td th:text="${#temporals.format(dto.napoDt, 'yyyy-MM-dd HH:mm')}"></td>
<td class="text-wrap min-width-300" th:text="${dto.violationStr}"></td>
@ -684,20 +682,6 @@
<div class="modal-dialog modal-xxl modal-dialog-scrollable">
<div class="modal-content" id="fishingBoatViewModalContent">
</div>
</div>
</div>
<div class="modal fade" id="crackdownStatusEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="crackdownStatusEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="crackdownStatusEditModalContent">
</div>
</div>
</div>
<div class="modal fade" id="crackdownStatusViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="crackdownStatusViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="crackdownStatusViewBody">
</div>
</div>
</div>

View File

@ -185,8 +185,9 @@
</tr>
</thead>
<tbody class="table-group-divider align-middle">
<tr class="crackdownStatusTr" th:each="crackdownStatus,cnt:${crackdownStatusList}">
<input type="hidden" class="cdsKey" th:value="${crackdownStatus.cdsKey}">
<th:block th:each="crackdownStatus,cnt:${crackdownStatusList}">
<tr class="crackdownStatusTr" th:data-cdskey="${crackdownStatus.cdsKey}">
<input type="hidden">
<td th:text="${cnt.count}"></td>
<td th:text="${#temporals.format(crackdownStatus.napoDt, 'yyyy-MM-dd HH:mm')}"></td>
<td>
@ -240,6 +241,7 @@
</td>
<td th:text="${#temporals.format(crackdownStatus.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
</tr>
</th:block>
</tbody>
</table>
</div>

View File

@ -590,6 +590,7 @@
</div>
</div>
</div>
<th:block th:if="${modalType ne 'viewOnly'}">
<th:block th:if="${userSeq eq crackdownStatus.fishingBoat.wrtUserSeq
or (accessAuth eq 'ACC003' and #lists.contains(mgtOrganList, crackdownStatus.fishingBoat.wrtOrgan))}">
<!--작성자, 관리자일 경우 수정, 삭제 허용-->
@ -602,3 +603,4 @@
</div>
</div>
</th:block>
</th:block>

View File

@ -6,7 +6,19 @@
<script th:inline="javascript">
const commonCode = [[${session.commonCode}]];
</script>
<script type="text/javascript" th:src="@{/js/faStatistics/processResult.js}"></script>
<!--<script type="text/javascript" th:src="@{/js/faStatistics/processResult.js}"></script>-->
<script type="text/javascript" th:src="@{/js/faStatistics/fishingBoatMgt.js}"></script>
</th:block>
<th:block layout:fragment="css">
<style>
#violationSelectDiv{
position: absolute;
top: 45px;
left: 1203px;
display: none;
z-index: 10;
}
</style>
</th:block>
<div layout:fragment="content">
<main>
@ -54,14 +66,16 @@
<div class="col-2">
<input class="form-control form-control-sm" name="boatNameKr" id="boatNameKr" placeholder="피의자(선박명)" th:value="${searchParams.boatNameKr}">
</div>
<div class="col-2">
<select class="form-select form-select-sm violation" name="violation">
<option value="">위반내용</option>
<th:block th:each="commonCode:${session.commonCode.get('VT')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq searchParams.violation}"></option>></option>
<div class="col-4">
<input type="text" class="form-control form-control-sm" id="violationInput" placeholder="위반형태" readonly>
<div class="bg-white border p-2 text-start" id="violationSelectDiv">
<th:block th:each="code:${session.commonCode.get('VT')}">
<div>
<input type="checkbox" name="violationList" class="violationParams" th:id="|violation${code.itemCd}|" th:value="${code.itemCd}" th:checked="${searchParams.violationList ne null?#lists.contains(searchParams.violationList, code.itemCd):false}">
<label th:for="|violation${code.itemCd}|" class="form-label col-form-label-sm mb-0" th:text="${code.itemValue}"></label>
</div>
</th:block>
</select>
</div>
</div>
</div>
<div class="row justify-content-end">
@ -131,54 +145,43 @@
</tr>
</thead>
<tbody class="table-group-divider align-middle">
<th:block th:each="processResult,cnt:${processResultList}">
<tr class="tr" th:data-key="${processResult.prKey}">
<th:block th:each="dto,cnt:${crackdownStatusList}">
<tr class="crackdownStatusTr" th:data-cdskey="${dto.cdsKey}" data-modaltype="viewOnly">
<td th:text="${cnt.count}"></td>
<!--<td th:text="${processResult.prKey}"></td>-->
<td th:text="${processResult.crackdownStatus.caseNum}"></td>
<th:block th:each="commonCode:${session.commonCode.get('CPO')}">
<td th:if="${processResult.crackdownStatus.crackdownPolice eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<th:block th:if="${!#strings.contains(processResult.crackdownStatus.crackdownPolice, 'CPO')}">
<td th:text="${processResult.crackdownStatus.crackdownPolice}"></td>
</th:block>
<td th:text="${processResult.boatNameKr}"></td>
<td th:text="${dto.caseNum}"></td>
<td>
<span th:text="${processResult.crackdownStatus.napoSeaPointLon}"></span>
<span th:if="${processResult.crackdownStatus.napoSeaPointLon ne null && processResult.crackdownStatus.napoSeaPointLon ne ''}" th:text="${' ~ '}"></span>
<span th:text="${processResult.crackdownStatus.napoSeaPointLat}"></span>
<div th:text="${processResult.crackdownStatus.napoSeaPointDetail}"></div>
</td>
<td class="text-wrap min-width-300">
<th:block th:if="${#lists.size(processResult.violationList) >= 1}">
<th:block th:each="violation, i:${processResult.violationList}">
<th:block th:each="commonCode:${session.commonCode.get('VT')}">
<th:block th:if="${violation.violation eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<th:block th:if="${violation.violation ne null && !#strings.contains(violation.violation, 'VT')}" th:text="${violation.violation}"></th:block>
<th:block th:if="${#lists.size(processResult.violationList) >= 1 && i.index < #lists.size(processResult.violationList)-1}">
<th:block>, </th:block>
</th:block>
<th:block th:each="code:${session.commonCode.get('CPO')}">
<th:block th:if="${dto.crackdownPolice eq code.itemCd}" th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:if="${!#strings.contains(dto.crackdownPolice, 'CPO')}">
<th:block th:text="${dto.crackdownPolice}"></th:block>
</th:block>
</td>
<td th:text="${processResult.sentencingCourt}"></td>
<td th:text="${processResult.sentencingDetail}"></td>
<th:block th:each="commonCode:${session.commonCode.get('PR')}">
<th:block th:if="${processResult.executionDetail ne null && #strings.contains(processResult.executionDetail, 'PR')}">
<td th:if="${processResult.executionDetail eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
<td th:text="${dto.boatNameKr}"></td>
<td>
<span th:text="${dto.napoSeaPointLon}"></span>
<span th:if="${dto.napoSeaPointLon ne null && dto.napoSeaPointLon ne ''}" th:text="${' ~ '}"></span>
<span th:text="${dto.napoSeaPointLat}"></span>
<div th:text="${dto.napoSeaPointDetail}"></div>
</td>
<td class="text-wrap min-width-300" th:text="${dto.violationStr}"></td>
<td th:text="${dto.sentencingCourt}"></td>
<td th:text="${dto.sentencingDetail}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('PR')}">
<th:block th:if="${dto.executionDetail ne null && #strings.contains(dto.executionDetail, 'PR')}">
<th:block th:if="${dto.executionDetail eq code.itemCd}" th:text="${code.itemValue}"></th:block>
</th:block>
</th:block>
<td th:if="${processResult.executionDetail ne null && !#strings.contains(processResult.executionDetail, 'PR')}" th:text="${processResult.executionDetail}"></td>
<th:block th:if="${processResult.executionDetail eq null}">
<td></td>
</th:block>
<td th:text="${processResult.returnDt}"></td>
<td th:text="${processResult.consignmentStartDt}"></td>
<td th:text="${processResult.consignmentEndDt}"></td>
<td th:text="${processResult.confiscationDt}"></td>
<td th:text="${processResult.boatDisposalDt}"></td>
<td th:text="${#temporals.format(processResult.updDt, 'yyyy-MM-dd HH:mm')}"></td>
<th:block th:if="${dto.executionDetail ne null && !#strings.contains(dto.executionDetail, 'PR')}" th:text="${dto.executionDetail}"></th:block>
</td>
<td th:text="${dto.returnDt}"></td>
<td th:text="${dto.consignmentStartDt}"></td>
<td th:text="${dto.consignmentEndDt}"></td>
<td th:text="${dto.confiscationDt}"></td>
<td th:text="${dto.boatDisposalDt}"></td>
<td th:text="${#temporals.format(dto.updDt, 'yyyy-MM-dd HH:mm')}"></td>
</tr>
</th:block>
</tbody>
@ -198,23 +201,9 @@
</div>
</div>
</div>
<div class="modal fade" id="processResultAddModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="processResultAddModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="processResultAddModalContent">
</div>
</div>
</div>
<div class="modal fade" id="processResultEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="processResultEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="processResultEditModalContent">
</div>
</div>
</div>
<div class="modal fade" id="processResultViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="processResultViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="processResultViewBody">
<div class="modal fade" id="fishingBoatViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="fishingBoatViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xxl modal-dialog-scrollable">
<div class="modal-content" id="fishingBoatViewModalContent">
</div>
</div>