통계 비고 기능 추가.
parent
67d328aaee
commit
b9e4d5b33f
|
|
@ -147,6 +147,7 @@ public class SecurityConfig{
|
|||
"/monitoring/**",
|
||||
"/intelligenceNetwork/**",
|
||||
"/budget/**",
|
||||
"/faics/**",
|
||||
"/deadline/**",
|
||||
"/search/**"
|
||||
).hasRole(Role.USER.name()) // USER 접근 허용
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.dbnt.faisp.main.faStatistics.unlawfulFishing;
|
|||
|
||||
import com.dbnt.faisp.main.authMgt.model.AccessConfig;
|
||||
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.ShipStatisticsEtc;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.StatisticsModel;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.UnlawfulFishingParam;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.crackdownStatus.*;
|
||||
|
|
@ -416,4 +417,9 @@ public class UnlawfulFishingController {
|
|||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/statEtc")
|
||||
public void saveStatEtc(ShipStatisticsEtc statEtc){
|
||||
unlawfulFishingService.saveStatEtc(statEtc);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.dbnt.faisp.main.faStatistics.unlawfulFishing.model;
|
||||
|
||||
import com.dbnt.faisp.config.BaseModel;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name="ship_statistics_etc")
|
||||
public class ShipStatisticsEtc extends BaseModel {
|
||||
@Id
|
||||
@Column(name = "year")
|
||||
private Integer year;
|
||||
|
||||
@Column(name = "etc")
|
||||
private String etc;
|
||||
}
|
||||
|
|
@ -84,7 +84,4 @@ public class SailorBaseEntity extends BaseModel {
|
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime wrtDt;
|
||||
|
||||
@Column(name="detention_yn")
|
||||
private String detentionYn;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.dbnt.faisp.main.faStatistics.unlawfulFishing.repository;
|
||||
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.ShipStatisticsEtc;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.asfCov.AsfCov;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface ShipStatisticsEtcRepository extends JpaRepository<ShipStatisticsEtc, Integer> {
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.dbnt.faisp.main.faStatistics.unlawfulFishing.service;
|
||||
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.ShipStatisticsEtc;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.StatisticsModel;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.UnlawfulFishingParam;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.crackdownStatus.*;
|
||||
|
|
@ -40,6 +41,7 @@ public class UnlawfulFishingService {
|
|||
private final ShipProcessInfoHistoryRepository spihRepository;
|
||||
private final IllegalShipSailorRepository issRepository;
|
||||
private final IllegalShipSailorHistoryRepository isshRepository;
|
||||
private final ShipStatisticsEtcRepository sseRepository;
|
||||
private final UnlawfulFishingMapper unlawfulFishingMapper;
|
||||
|
||||
@Transactional
|
||||
|
|
@ -331,4 +333,9 @@ public class UnlawfulFishingService {
|
|||
public List<StatisticsModel> selectStatisticsListType3(StatisticsModel params) {
|
||||
return unlawfulFishingMapper.selectStatisticsListType3(params);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void saveStatEtc(ShipStatisticsEtc statEtc){
|
||||
sseRepository.save(statEtc);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@
|
|||
ci.case_num ,
|
||||
iss.sailor_name_kr ,
|
||||
iss.birthdate ,
|
||||
iss.detention_yn ,
|
||||
iss.is_restriction ,
|
||||
iss.position ,
|
||||
iss.career ,
|
||||
iss.similar_criminal_history ,
|
||||
|
|
@ -425,8 +425,8 @@
|
|||
sum(detention_not_cnt) as detention_not_cnt
|
||||
from (
|
||||
select EXTRACT(YEAR FROM a.napo_dt) as year,
|
||||
case when detention_yn = 'Y' then 1 else 0 end as detention_cnt,
|
||||
case when detention_yn = 'N' then 1 else 0 end as detention_not_cnt
|
||||
case when is_restriction = 'Y' then 1 else 0 end as detention_cnt,
|
||||
case when is_restriction = 'N' then 1 else 0 end as detention_not_cnt
|
||||
from crackdown_info a
|
||||
inner join illegal_ship_info b on a.cds_key = b.cds_key and b.status <> 'DST008'
|
||||
inner join illegal_ship_sailor c on b.fb_key = c.fb_key and c.status <> 'DST008'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,32 @@
|
|||
$(document).on('click', '#statisticsTab', function (event){
|
||||
$(document).on('click', '.nav-item', function (event){
|
||||
location.href = "/unlawfulFishing/statistics?type="+event.target.id.replace("Tab", "");
|
||||
})
|
||||
|
||||
$(document).on('click', '.type1Row', function (){
|
||||
$('#statYear').val($(this).attr('data-year'));
|
||||
$('#statEtc').val($(this).find('.etc').text())
|
||||
$("#statEtcModal").modal('show');
|
||||
})
|
||||
|
||||
$(document).on('click', '#statEtcSubmitBtn', function (){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
const formData = new FormData($("#statEtcForm")[0]);
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/unlawfulFishing/statEtc",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend: function (xhr){
|
||||
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||
},
|
||||
success : function(data) {
|
||||
alert("저장되었습니다.");
|
||||
location.reload();
|
||||
},
|
||||
error : function(xhr) {
|
||||
alert("저장에 실패하였습니다.");
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
<div class="row mx-0">
|
||||
<div class="col-12 card bg-light">
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-tabs" id="statisticsTab" role="tablist">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" th:classappend="${searchParams.type eq 'type1'?'active':''}" id="type1Tab" data-bs-toggle="tab" type="button" role="tab">통계1</button>
|
||||
</li>
|
||||
|
|
@ -42,8 +42,6 @@
|
|||
<table class="table table-sm table-hover table-bordered ws-nowrap">
|
||||
<th:block th:if="${searchParams.type eq 'type1'}">
|
||||
<colgroup>
|
||||
<col style="width: 10%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 8%">
|
||||
<col style="width: 8%">
|
||||
<col style="width: 8%">
|
||||
|
|
@ -54,6 +52,8 @@
|
|||
<col style="width: 8%">
|
||||
<col style="width: 8%">
|
||||
<col style="width: 8%">
|
||||
<col style="width: 8%">
|
||||
<col style="width: 12%">
|
||||
</colgroup>
|
||||
<thead class="align-middle text-center">
|
||||
<tr class="table-secondary">
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
</thead>
|
||||
<tbody class="align-middle text-center">
|
||||
<th:block th:each="stat:${statisticsList}">
|
||||
<tr>
|
||||
<tr th:class="${stat.year ne null?'type1Row':''}" th:data-year="${stat.year}">
|
||||
<td th:text="${stat.yearStr}"></td>
|
||||
<td th:text="${stat.captureCnt}"></td>
|
||||
<td th:text="${stat.eezCnt}"></td>
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
</td>
|
||||
<td th:text="${#strings.concat(stat.forfeitCnt, '/', stat.disposeCnt)}"></td>
|
||||
<td th:text="${#strings.concat(stat.violation51, '건 ', stat.violation52, '척')}"></td>
|
||||
<td th:text="${stat.etc}"></td>
|
||||
<td class="etc" th:text="${stat.etc}"></td>
|
||||
</tr>
|
||||
</th:block>
|
||||
</tbody>
|
||||
|
|
@ -137,6 +137,31 @@
|
|||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<div class="modal fade" id="statEtcModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="statEtcModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-scrollable">
|
||||
<div class="modal-content" id="statEtcModalContent">
|
||||
<div class="modal-header bg-dark">
|
||||
<h5 class="modal-title text-white" id="statEtcModalLabel">비고 수정</h5>
|
||||
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body" id="statEtcBody">
|
||||
<form action="#" method="post" id="statEtcForm">
|
||||
<input type="hidden" name="year" id="statYear">
|
||||
<input type="text" class="d-none">
|
||||
<div class="mb-3 mt-3 row">
|
||||
<label for="statEtc" class="col-sm-2 col-form-label col-form-label-sm text-center">비고</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control form-control-sm" name="etc" id="statEtc">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer py-1">
|
||||
<input type="button" class="btn btn-primary" value="저장" id="statEtcSubmitBtn">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue