첩보수집활동 > 외사첩보망 견문관리 하위 페이지 삭제 기능 추가.
parent
4d70665529
commit
e9cdca0be2
|
|
@ -157,6 +157,12 @@ public class IntelligenceNetworkController {
|
|||
return intelligenceNetworkService.operationPlanStateChange(apprv);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteOperationPlan")
|
||||
@ResponseBody
|
||||
public void deleteOperationPlan (@RequestBody OperationPlan plan){
|
||||
intelligenceNetworkService.deleteOperationPlan(plan.getOpKey());
|
||||
}
|
||||
|
||||
@GetMapping("/intelligenceAnalyzeList/{type}")
|
||||
public ModelAndView intelligenceAnalyzeList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, IntelligenceAnalyze ia){
|
||||
ModelAndView mav = new ModelAndView("igActivities/intelligenceNetwork/analyzeList");
|
||||
|
|
@ -302,6 +308,13 @@ public class IntelligenceNetworkController {
|
|||
return intelligenceNetworkService.intelligenceAnalyzeChange(apprv);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteIntelligenceAnalyze")
|
||||
@ResponseBody
|
||||
public void deleteIntelligenceAnalyze (@RequestBody IntelligenceAnalyze intelligenceAnalyze){
|
||||
intelligenceNetworkService.deleteIntelligenceAnalyze(intelligenceAnalyze.getIaKey());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/fireExtensionReportList/{type}")
|
||||
public ModelAndView fireExtensionReportList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, FireExtensionReport fer){
|
||||
ModelAndView mav = new ModelAndView("igActivities/intelligenceNetwork/fireExtensionReportList");
|
||||
|
|
@ -447,5 +460,10 @@ public class IntelligenceNetworkController {
|
|||
return intelligenceNetworkService.fireExtensionReportStateChange(apprv);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteFireExtensionReport")
|
||||
@ResponseBody
|
||||
public void deleteFireExtensionReport (@RequestBody FireExtensionReport feReport){
|
||||
intelligenceNetworkService.deleteFireExtensionReport(feReport.getFerKey());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository;
|
|||
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReport;
|
||||
|
||||
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.Optional;
|
||||
|
|
@ -12,5 +14,7 @@ public interface FireExtensionReportRepository extends JpaRepository<FireExtensi
|
|||
|
||||
Optional<FireExtensionReport> findByFerKey(Integer ferKey);
|
||||
|
||||
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query("update FireExtensionReport set ferState = :ferState where ferKey = :ferKey")
|
||||
void bulkModifyingByFerKeyToFerState(Integer ferKey, String ferState);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,13 @@ package com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository;
|
|||
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.IntelligenceAnalyze;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
|
||||
public interface IntelligenceAnalyzeRepository extends JpaRepository<IntelligenceAnalyze, Integer> {
|
||||
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query("update IntelligenceAnalyze set iaState = :iaState where iaKey = :iaKey")
|
||||
void bulkModifyingByIaKeyToIaState(Integer iaKey, String iaState);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@ package com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository;
|
|||
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlan;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
|
||||
public interface OperationPlanRepository extends JpaRepository<OperationPlan, Integer> {
|
||||
|
||||
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query("update OperationPlan set opState = :opState where opKey = :opKey")
|
||||
void bulkModifyingByOpKeyToOpStatus(Integer opKey, String opState);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,6 +136,11 @@ public class IntelligenceNetworkService extends BaseService {
|
|||
return operationPlanFileRepository.findById(new OperationPlanFileId(parentKey,fileSeq)).orElse(null);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteOperationPlan(Integer opKey) {
|
||||
operationPlanRepository.bulkModifyingByOpKeyToOpStatus(opKey, "DST008");
|
||||
}
|
||||
|
||||
public IntelligenceAnalyze selectAffairCnt(IntelligenceAnalyze ia) {
|
||||
return intelligenceNetworkMapper.selectAffairCnt(ia);
|
||||
}
|
||||
|
|
@ -198,6 +203,11 @@ public class IntelligenceNetworkService extends BaseService {
|
|||
return apprv.getIaKey();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteIntelligenceAnalyze(Integer iaKey) {
|
||||
intelligenceAnalyzeRepository.bulkModifyingByIaKeyToIaState(iaKey, "DST008");
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Integer saveFireExtensionReport(FireExtensionReport fer) {
|
||||
Integer ferKey = fireExtensionReportRepository.save(fer).getFerKey();
|
||||
|
|
@ -247,7 +257,8 @@ public class IntelligenceNetworkService extends BaseService {
|
|||
return apprv.getFerKey();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Transactional
|
||||
public void deleteFireExtensionReport(Integer ferKey) {
|
||||
fireExtensionReportRepository.bulkModifyingByFerKeyToFerState(ferKey, "DST008");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<mapper namespace="com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.mapper.IntelligenceNetworkMapper">
|
||||
<sql id="selectOperationPlanListWhere">
|
||||
<where>
|
||||
op_state <> 'DST008'
|
||||
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||
and op.wrt_user_seq = #{wrtUserSeq}
|
||||
</if>
|
||||
|
|
@ -129,6 +130,7 @@
|
|||
|
||||
<sql id="selectIntelligenceAnalyzeListWhere">
|
||||
<where>
|
||||
ia_state <> 'DST008'
|
||||
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||
and wrt_user_seq = #{wrtUserSeq}
|
||||
</if>
|
||||
|
|
@ -415,6 +417,7 @@
|
|||
</select>
|
||||
|
||||
<sql id="selectIFireExtensionReportListWhere">
|
||||
and fer_state <> 'DST008'
|
||||
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||
and fer.wrt_user_seq = #{wrtUserSeq}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -241,7 +241,11 @@ $(document).on('click', '#deleteBtn', function (){
|
|||
},
|
||||
success : function(result) {
|
||||
alert("삭제되었습니다.");
|
||||
location.reload();
|
||||
let searchParam = location.search;
|
||||
if(searchParam.includes("refDocKey")){
|
||||
searchParam = searchParam.substring(0, searchParam.indexOf("&"))
|
||||
}
|
||||
location.href = location.pathname+searchParam;
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("삭제를 실패하였습니다.")
|
||||
|
|
|
|||
|
|
@ -111,6 +111,29 @@ $(document).on('click', '#editBtn', function (){
|
|||
getFireExtensionReportEditModal($(this).attr("data-ferkey"));
|
||||
})
|
||||
|
||||
$(document).on('click', '#deleteBtn', function (){
|
||||
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||
contentFade("in");
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : JSON.stringify({ferKey: $(this).attr('data-ferKey')}),
|
||||
url : "/intelligenceNetwork/deleteFireExtensionReport",
|
||||
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 (){
|
||||
if(!$("input[name=opKey]").val()){
|
||||
alert("정보협력자를 선택해주세요.");
|
||||
|
|
|
|||
|
|
@ -126,6 +126,29 @@ $(document).on('click', '#editBtn', function (){
|
|||
getIntelligenceAnalyzeEditModal($(this).attr("data-iakey"));
|
||||
})
|
||||
|
||||
$(document).on('click', '#deleteBtn', function (){
|
||||
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||
contentFade("in");
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : JSON.stringify({iaKey: $(this).attr('data-iakey')}),
|
||||
url : "/intelligenceNetwork/deleteIntelligenceAnalyze",
|
||||
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 (){
|
||||
if(!$("#iaSdate").val()){
|
||||
alert("실적시작일을 입력해주세요.");
|
||||
|
|
|
|||
|
|
@ -49,6 +49,29 @@ $(document).on('click', '#editBtn', function (){
|
|||
getOperationPlanEditModal($(this).attr("data-opkey"));
|
||||
})
|
||||
|
||||
$(document).on('click', '#deleteBtn', function (){
|
||||
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||
contentFade("in");
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : JSON.stringify({opKey: $(this).attr('data-opkey')}),
|
||||
url : "/intelligenceNetwork/deleteOperationPlan",
|
||||
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 (){
|
||||
if(!$("#opSdate").val()){
|
||||
alert("운용시작일을 입력해주세요.");
|
||||
|
|
|
|||
|
|
@ -123,10 +123,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between bg-light">
|
||||
<div class="col-auto">
|
||||
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="col-auto">
|
||||
<th:block th:unless="${fer.ferState eq 'DST004' or fer.ferState eq 'DST006'}"><!--승인 상태일때는 삭제 불가 -->
|
||||
<th:block th:if="${userSeq eq fer.wrtUserSeq or accessAuth eq 'ACC003'}"><!--관리자작성자일 경우 삭제 허용-->
|
||||
<button type="button" class="btn btn-danger" th:data-ferkey="${fer.ferKey}" id="deleteBtn">삭제</button>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<th:block th:if="${(apprvAuth eq 'APC001' or apprvAuth eq 'APC002') and fer.ferState eq 'DST002'}">
|
||||
<button type="button" class="btn btn-danger apprvBtn" th:data-planstate="${apprvAuth eq 'APC004'||apprvAuth eq 'APC003'?'DST003':'DST005'}" th:value="반려">반려</button>
|
||||
<button type="button" class="btn btn-success apprvBtn" th:data-planstate="${apprvAuth eq 'APC004'||apprvAuth eq 'APC003'?'DST004':'DST006'}" th:value="승인">승인</button>
|
||||
|
|
@ -136,5 +140,5 @@
|
|||
<button type="button" class="btn btn-warning" th:data-ferkey="${fer.ferKey}" id="editBtn">수정</button>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -189,7 +189,11 @@
|
|||
</div>
|
||||
<div class="modal-footer justify-content-between bg-light">
|
||||
<div class="col-auto">
|
||||
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
|
||||
<th:block th:unless="${ia.iaState eq 'DST004' or ia.iaState eq 'DST006'}"><!--승인 상태일때는 삭제 불가 -->
|
||||
<th:block th:if="${userSeq eq ia.wrtUserSeq or accessAuth eq 'ACC003'}"><!--관리자작성자일 경우 삭제 허용-->
|
||||
<button type="button" class="btn btn-danger" th:data-iakey="${ia.iaKey}" id="deleteBtn">삭제</button>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<th:block th:if="${(apprvAuth eq 'APC001' or apprvAuth eq 'APC002') and ia.iaState eq 'DST002'}">
|
||||
|
|
|
|||
|
|
@ -145,10 +145,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between bg-light">
|
||||
<div class="col-auto">
|
||||
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="col-auto">
|
||||
<th:block th:unless="${op.opState eq 'DST004' or op.opState eq 'DST006'}">
|
||||
<th:block th:if="${userSeq eq op.wrtUserSeq or accessAuth eq 'ACC003'}">
|
||||
<button type="button" class="btn btn-danger" th:data-opkey="${op.opKey}" id="deleteBtn">삭제</button>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<th:block th:if="${(apprvAuth eq 'APC001' or apprvAuth eq 'APC002') and op.opState eq 'DST002'}">
|
||||
<button type="button" class="btn btn-danger apprvBtn" th:data-planstate="${apprvAuth eq 'APC004'||apprvAuth eq 'APC003'?'DST003':'DST005'}" th:value="반려">반려</button>
|
||||
<button type="button" class="btn btn-success apprvBtn" th:data-planstate="${apprvAuth eq 'APC004'||apprvAuth eq 'APC003'?'DST004':'DST006'}" th:value="승인">승인</button>
|
||||
|
|
@ -158,6 +162,5 @@
|
|||
<button type="button" class="btn btn-warning" th:data-opkey="${op.opKey}" id="editBtn">수정</button>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue