첩보수집활동 > 모니터링 하위 페이지 삭제기능 추가.
parent
e9cdca0be2
commit
6ae270e042
|
|
@ -2,6 +2,7 @@ package com.dbnt.faisp.main.fpiMgt.monitoring;
|
||||||
|
|
||||||
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
||||||
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
||||||
|
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanApprv;
|
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanApprv;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanBoard;
|
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanBoard;
|
||||||
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlan;
|
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlan;
|
||||||
|
|
@ -159,7 +160,13 @@ public class MonitoringController { // 첩보수집활동 > 해양외사모니
|
||||||
apprv.setSaveDt(LocalDateTime.now());
|
apprv.setSaveDt(LocalDateTime.now());
|
||||||
return monitoringService.designationStateChange(apprv);
|
return monitoringService.designationStateChange(apprv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/deleteMonitoringDesignation")
|
||||||
|
@ResponseBody
|
||||||
|
public void deleteMonitoringDesignation (@RequestBody MonitoringDesignation md){
|
||||||
|
monitoringService.deleteMonitoringDesignation(md.getMdKey());
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/resultList/{type}")
|
@GetMapping("/resultList/{type}")
|
||||||
public ModelAndView resultList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, MonitoringResult mr){
|
public ModelAndView resultList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, MonitoringResult mr){
|
||||||
ModelAndView mav = new ModelAndView("igActivities/monitoring/resultList");
|
ModelAndView mav = new ModelAndView("igActivities/monitoring/resultList");
|
||||||
|
|
@ -303,5 +310,10 @@ public class MonitoringController { // 첩보수집활동 > 해양외사모니
|
||||||
return monitoringService.resultStateChange(apprv);
|
return monitoringService.resultStateChange(apprv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/deleteMonitoringResult")
|
||||||
|
@ResponseBody
|
||||||
|
public void deleteMonitoringResult (@RequestBody MonitoringResult mr){
|
||||||
|
monitoringService.deleteMonitoringResult(mr.getMrKey());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,16 @@ package com.dbnt.faisp.main.fpiMgt.monitoring.repository;
|
||||||
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringDesignation;
|
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringDesignation;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
||||||
public interface MonitoringDesignationRepository extends JpaRepository<MonitoringDesignation, Integer> {
|
public interface MonitoringDesignationRepository extends JpaRepository<MonitoringDesignation, Integer> {
|
||||||
|
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("update MonitoringDesignation set mdState = :mdState where mdKey = :mdKey")
|
||||||
|
void bulkModifyingByMdKeyToMdState(Integer mdKey, String mdState);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,16 @@ package com.dbnt.faisp.main.fpiMgt.monitoring.repository;
|
||||||
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringResult;
|
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringResult;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
||||||
public interface MonitoringResultRepository extends JpaRepository<MonitoringResult, Integer> {
|
public interface MonitoringResultRepository extends JpaRepository<MonitoringResult, Integer> {
|
||||||
|
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("update MonitoringResult set mrState = :mrState where mrKey = :mrKey")
|
||||||
|
void bulkModifyingByMrKeyToMrState(Integer mrKey, String mrState);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,11 @@ public class MonitoringService extends BaseService {
|
||||||
public MonitoringDesignationFile selectDesignationFile(Integer parentKey, Integer fileSeq) {
|
public MonitoringDesignationFile selectDesignationFile(Integer parentKey, Integer fileSeq) {
|
||||||
return monitoringDesignationFileRepository.findById(new monitoringDesignationFileId(parentKey,fileSeq)).orElse(null);
|
return monitoringDesignationFileRepository.findById(new monitoringDesignationFileId(parentKey,fileSeq)).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deleteMonitoringDesignation(Integer mdKey) {
|
||||||
|
monitoringDesignationRepository.bulkModifyingByMdKeyToMdState(mdKey, "DST008");
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Integer saveResult(MonitoringResult mr, List<Integer> deleteFileSeq) {
|
public Integer saveResult(MonitoringResult mr, List<Integer> deleteFileSeq) {
|
||||||
|
|
@ -338,7 +343,8 @@ public class MonitoringService extends BaseService {
|
||||||
return monitoringReportRepository.findById(new MonitoringReportId(parentKey,infoSeq)).orElse(null);
|
return monitoringReportRepository.findById(new MonitoringReportId(parentKey,infoSeq)).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deleteMonitoringResult(Integer mrKey) {
|
||||||
|
monitoringResultRepository.bulkModifyingByMrKeyToMrState(mrKey, "DST008");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<mapper namespace="com.dbnt.faisp.main.fpiMgt.monitoring.mapper.MonitoringMapper">
|
<mapper namespace="com.dbnt.faisp.main.fpiMgt.monitoring.mapper.MonitoringMapper">
|
||||||
<sql id="selectDesignationListWhere">
|
<sql id="selectDesignationListWhere">
|
||||||
<where>
|
<where>
|
||||||
|
md_state <> 'DST008'
|
||||||
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||||
and md.wrt_user_seq = #{wrtUserSeq}
|
and md.wrt_user_seq = #{wrtUserSeq}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -99,6 +100,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="selectResultListWhere">
|
<sql id="selectResultListWhere">
|
||||||
|
and mr_state <> 'DST008'
|
||||||
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||||
and mr.wrt_user_seq = #{wrtUserSeq}
|
and mr.wrt_user_seq = #{wrtUserSeq}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,29 @@ $(document).on('click', '#editBtn', function (){
|
||||||
getDesignationEditModal($(this).attr("data-mdkey"));
|
getDesignationEditModal($(this).attr("data-mdkey"));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '#deleteBtn', function (){
|
||||||
|
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||||
|
contentFade("in");
|
||||||
|
$.ajax({
|
||||||
|
type : 'POST',
|
||||||
|
data : JSON.stringify({mdKey: $(this).attr('data-mdkey')}),
|
||||||
|
url : "/monitoring/deleteMonitoringDesignation",
|
||||||
|
contentType: 'application/json',
|
||||||
|
beforeSend: function (xhr){
|
||||||
|
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||||
|
},
|
||||||
|
success : function(result) {
|
||||||
|
alert("삭제되었습니다.");
|
||||||
|
location.reload();
|
||||||
|
},
|
||||||
|
error : function(xhr, status) {
|
||||||
|
alert("삭제를 실패하였습니다.")
|
||||||
|
contentFade("out");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
$(document).on('click', '#saveBtn', function (){
|
$(document).on('click', '#saveBtn', function (){
|
||||||
if(!$("#mdDt").val()){
|
if(!$("#mdDt").val()){
|
||||||
alert("대상지정일을 입력해주세요.");
|
alert("대상지정일을 입력해주세요.");
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,29 @@ $(document).on('click', '#editBtn', function (){
|
||||||
getResultEditModal($(this).attr("data-mrkey"));
|
getResultEditModal($(this).attr("data-mrkey"));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '#deleteBtn', function (){
|
||||||
|
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||||
|
contentFade("in");
|
||||||
|
$.ajax({
|
||||||
|
type : 'POST',
|
||||||
|
data : JSON.stringify({mrKey: $(this).attr('data-mrkey')}),
|
||||||
|
url : "/monitoring/deleteMonitoringResult",
|
||||||
|
contentType: 'application/json',
|
||||||
|
beforeSend: function (xhr){
|
||||||
|
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||||
|
},
|
||||||
|
success : function(result) {
|
||||||
|
alert("삭제되었습니다.");
|
||||||
|
location.reload();
|
||||||
|
},
|
||||||
|
error : function(xhr, status) {
|
||||||
|
alert("삭제를 실패하였습니다.")
|
||||||
|
contentFade("out");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
$(document).on('click', '#saveBtn', function (){
|
$(document).on('click', '#saveBtn', function (){
|
||||||
if($("#clearTitle").val() == ""){
|
if($("#clearTitle").val() == ""){
|
||||||
alert("결과보고서 제목을 입력해주세요");
|
alert("결과보고서 제목을 입력해주세요");
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer justify-content-between bg-light">
|
<div class="modal-footer justify-content-between bg-light">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
|
<th:block th:unless="${md.mdState eq 'DST004' or md.mdState eq 'DST006'}">
|
||||||
|
<th:block th:if="${userSeq eq md.wrtUserSeq or accessAuth eq 'ACC003'}">
|
||||||
|
<button type="button" class="btn btn-danger" th:data-mdkey="${md.mdKey}" id="deleteBtn">삭제</button>
|
||||||
|
</th:block>
|
||||||
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<th:block th:unless="${md.mdState eq 'DST004' or md.mdState eq 'DST006'}"><!--승인 상태일때는 수정 불가 -->
|
<th:block th:unless="${md.mdState eq 'DST004' or md.mdState eq 'DST006'}"><!--승인 상태일때는 수정 불가 -->
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer justify-content-between bg-light">
|
<div class="modal-footer justify-content-between bg-light">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
|
<th:block th:unless="${mr.mrState eq 'DST004' or mr.mrState eq 'DST006'}">
|
||||||
|
<th:block th:if="${userSeq eq mr.wrtUserSeq or accessAuth eq 'ACC003'}">
|
||||||
|
<button type="button" class="btn btn-danger" th:data-mrkey="${mr.mrKey}" id="deleteBtn">삭제</button>
|
||||||
|
</th:block>
|
||||||
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<th:block th:unless="${mr.mrState eq 'DST004' or mr.mrState eq 'DST006'}"><!--승인 상태일때는 수정 불가 -->
|
<th:block th:unless="${mr.mrState eq 'DST004' or mr.mrState eq 'DST006'}"><!--승인 상태일때는 수정 불가 -->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue