첩보수집활동 > 외사첩보망 견문관리 하위 페이지 삭제 기능 추가.

master
강석 최 2023-05-09 10:35:31 +09:00
parent 4d70665529
commit e9cdca0be2
13 changed files with 165 additions and 38 deletions

View File

@ -157,6 +157,12 @@ public class IntelligenceNetworkController {
return intelligenceNetworkService.operationPlanStateChange(apprv); return intelligenceNetworkService.operationPlanStateChange(apprv);
} }
@PostMapping("/deleteOperationPlan")
@ResponseBody
public void deleteOperationPlan (@RequestBody OperationPlan plan){
intelligenceNetworkService.deleteOperationPlan(plan.getOpKey());
}
@GetMapping("/intelligenceAnalyzeList/{type}") @GetMapping("/intelligenceAnalyzeList/{type}")
public ModelAndView intelligenceAnalyzeList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, IntelligenceAnalyze ia){ public ModelAndView intelligenceAnalyzeList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, IntelligenceAnalyze ia){
ModelAndView mav = new ModelAndView("igActivities/intelligenceNetwork/analyzeList"); ModelAndView mav = new ModelAndView("igActivities/intelligenceNetwork/analyzeList");
@ -302,6 +308,13 @@ public class IntelligenceNetworkController {
return intelligenceNetworkService.intelligenceAnalyzeChange(apprv); return intelligenceNetworkService.intelligenceAnalyzeChange(apprv);
} }
@PostMapping("/deleteIntelligenceAnalyze")
@ResponseBody
public void deleteIntelligenceAnalyze (@RequestBody IntelligenceAnalyze intelligenceAnalyze){
intelligenceNetworkService.deleteIntelligenceAnalyze(intelligenceAnalyze.getIaKey());
}
@GetMapping("/fireExtensionReportList/{type}") @GetMapping("/fireExtensionReportList/{type}")
public ModelAndView fireExtensionReportList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, FireExtensionReport fer){ public ModelAndView fireExtensionReportList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, FireExtensionReport fer){
ModelAndView mav = new ModelAndView("igActivities/intelligenceNetwork/fireExtensionReportList"); ModelAndView mav = new ModelAndView("igActivities/intelligenceNetwork/fireExtensionReportList");
@ -447,5 +460,10 @@ public class IntelligenceNetworkController {
return intelligenceNetworkService.fireExtensionReportStateChange(apprv); return intelligenceNetworkService.fireExtensionReportStateChange(apprv);
} }
@PostMapping("/deleteFireExtensionReport")
@ResponseBody
public void deleteFireExtensionReport (@RequestBody FireExtensionReport feReport){
intelligenceNetworkService.deleteFireExtensionReport(feReport.getFerKey());
}
} }

View File

@ -3,6 +3,8 @@ package com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReport; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReport;
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;
@ -12,5 +14,7 @@ public interface FireExtensionReportRepository extends JpaRepository<FireExtensi
Optional<FireExtensionReport> findByFerKey(Integer ferKey); Optional<FireExtensionReport> findByFerKey(Integer ferKey);
@Modifying(clearAutomatically = true)
@Query("update FireExtensionReport set ferState = :ferState where ferKey = :ferKey")
void bulkModifyingByFerKeyToFerState(Integer ferKey, String ferState);
} }

View File

@ -3,9 +3,13 @@ package com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.IntelligenceAnalyze; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.IntelligenceAnalyze;
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;
public interface IntelligenceAnalyzeRepository extends JpaRepository<IntelligenceAnalyze, Integer> { 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);
} }

View File

@ -3,10 +3,13 @@ package com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlan; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlan;
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;
public interface OperationPlanRepository extends JpaRepository<OperationPlan, Integer> { 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);
} }

View File

@ -136,6 +136,11 @@ public class IntelligenceNetworkService extends BaseService {
return operationPlanFileRepository.findById(new OperationPlanFileId(parentKey,fileSeq)).orElse(null); return operationPlanFileRepository.findById(new OperationPlanFileId(parentKey,fileSeq)).orElse(null);
} }
@Transactional
public void deleteOperationPlan(Integer opKey) {
operationPlanRepository.bulkModifyingByOpKeyToOpStatus(opKey, "DST008");
}
public IntelligenceAnalyze selectAffairCnt(IntelligenceAnalyze ia) { public IntelligenceAnalyze selectAffairCnt(IntelligenceAnalyze ia) {
return intelligenceNetworkMapper.selectAffairCnt(ia); return intelligenceNetworkMapper.selectAffairCnt(ia);
} }
@ -198,6 +203,11 @@ public class IntelligenceNetworkService extends BaseService {
return apprv.getIaKey(); return apprv.getIaKey();
} }
@Transactional
public void deleteIntelligenceAnalyze(Integer iaKey) {
intelligenceAnalyzeRepository.bulkModifyingByIaKeyToIaState(iaKey, "DST008");
}
@Transactional @Transactional
public Integer saveFireExtensionReport(FireExtensionReport fer) { public Integer saveFireExtensionReport(FireExtensionReport fer) {
Integer ferKey = fireExtensionReportRepository.save(fer).getFerKey(); Integer ferKey = fireExtensionReportRepository.save(fer).getFerKey();
@ -247,7 +257,8 @@ public class IntelligenceNetworkService extends BaseService {
return apprv.getFerKey(); return apprv.getFerKey();
} }
@Transactional
public void deleteFireExtensionReport(Integer ferKey) {
fireExtensionReportRepository.bulkModifyingByFerKeyToFerState(ferKey, "DST008");
}
} }

View File

@ -6,6 +6,7 @@
<mapper namespace="com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.mapper.IntelligenceNetworkMapper"> <mapper namespace="com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.mapper.IntelligenceNetworkMapper">
<sql id="selectOperationPlanListWhere"> <sql id="selectOperationPlanListWhere">
<where> <where>
op_state &lt;> 'DST008'
<if test='wrtUserSeq != null and wrtUserSeq != ""'> <if test='wrtUserSeq != null and wrtUserSeq != ""'>
and op.wrt_user_seq = #{wrtUserSeq} and op.wrt_user_seq = #{wrtUserSeq}
</if> </if>
@ -129,6 +130,7 @@
<sql id="selectIntelligenceAnalyzeListWhere"> <sql id="selectIntelligenceAnalyzeListWhere">
<where> <where>
ia_state &lt;> 'DST008'
<if test='wrtUserSeq != null and wrtUserSeq != ""'> <if test='wrtUserSeq != null and wrtUserSeq != ""'>
and wrt_user_seq = #{wrtUserSeq} and wrt_user_seq = #{wrtUserSeq}
</if> </if>
@ -415,6 +417,7 @@
</select> </select>
<sql id="selectIFireExtensionReportListWhere"> <sql id="selectIFireExtensionReportListWhere">
and fer_state &lt;> 'DST008'
<if test='wrtUserSeq != null and wrtUserSeq != ""'> <if test='wrtUserSeq != null and wrtUserSeq != ""'>
and fer.wrt_user_seq = #{wrtUserSeq} and fer.wrt_user_seq = #{wrtUserSeq}
</if> </if>

View File

@ -241,7 +241,11 @@ $(document).on('click', '#deleteBtn', function (){
}, },
success : function(result) { success : function(result) {
alert("삭제되었습니다."); 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) { error : function(xhr, status) {
alert("삭제를 실패하였습니다.") alert("삭제를 실패하였습니다.")

View File

@ -111,6 +111,29 @@ $(document).on('click', '#editBtn', function (){
getFireExtensionReportEditModal($(this).attr("data-ferkey")); 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 (){ $(document).on('click', '#saveBtn', function (){
if(!$("input[name=opKey]").val()){ if(!$("input[name=opKey]").val()){
alert("정보협력자를 선택해주세요."); alert("정보협력자를 선택해주세요.");

View File

@ -126,6 +126,29 @@ $(document).on('click', '#editBtn', function (){
getIntelligenceAnalyzeEditModal($(this).attr("data-iakey")); 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 (){ $(document).on('click', '#saveBtn', function (){
if(!$("#iaSdate").val()){ if(!$("#iaSdate").val()){
alert("실적시작일을 입력해주세요."); alert("실적시작일을 입력해주세요.");

View File

@ -49,6 +49,29 @@ $(document).on('click', '#editBtn', function (){
getOperationPlanEditModal($(this).attr("data-opkey")); 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 (){ $(document).on('click', '#saveBtn', function (){
if(!$("#opSdate").val()){ if(!$("#opSdate").val()){
alert("운용시작일을 입력해주세요."); alert("운용시작일을 입력해주세요.");

View File

@ -123,18 +123,22 @@
</div> </div>
</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="${fer.ferState eq 'DST004' or fer.ferState eq 'DST006'}"><!--승인 상태일때는 삭제 불가 -->
</div> <th:block th:if="${userSeq eq fer.wrtUserSeq or accessAuth eq 'ACC003'}"><!--관리자작성자일 경우 삭제 허용-->
<div class="col-auto"> <button type="button" class="btn btn-danger" th:data-ferkey="${fer.ferKey}" id="deleteBtn">삭제</button>
<th:block th:if="${(apprvAuth eq 'APC001' or apprvAuth eq 'APC002') and fer.ferState eq 'DST002'}"> </th:block>
<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>
</th:block>
<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-warning" th:data-ferkey="${fer.ferKey}" id="editBtn">수정</button>
</th:block> </th:block>
</th:block> </div>
</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>
</th:block>
<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-warning" th:data-ferkey="${fer.ferKey}" id="editBtn">수정</button>
</th:block>
</th:block>
</div>
</div> </div>

View File

@ -189,7 +189,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="${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>
<div class="col-auto"> <div class="col-auto">
<th:block th:if="${(apprvAuth eq 'APC001' or apprvAuth eq 'APC002') and ia.iaState eq 'DST002'}"> <th:block th:if="${(apprvAuth eq 'APC001' or apprvAuth eq 'APC002') and ia.iaState eq 'DST002'}">

View File

@ -145,19 +145,22 @@
</div> </div>
</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="${op.opState eq 'DST004' or op.opState eq 'DST006'}">
</div> <th:block th:if="${userSeq eq op.wrtUserSeq or accessAuth eq 'ACC003'}">
<div class="col-auto"> <button type="button" class="btn btn-danger" th:data-opkey="${op.opKey}" id="deleteBtn">삭제</button>
<th:block th:if="${(apprvAuth eq 'APC001' or apprvAuth eq 'APC002') and op.opState eq 'DST002'}"> </th:block>
<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>
</th:block>
<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-warning" th:data-opkey="${op.opKey}" id="editBtn">수정</button>
</th:block> </th:block>
</th:block> </div>
</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>
</th:block>
<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-warning" th:data-opkey="${op.opKey}" id="editBtn">수정</button>
</th:block>
</th:block>
</div>
</div> </div>