첩보수집활동 > 외사경찰 견문관리 > 청산보고서 삭제기능 추가.
parent
c9a5e64646
commit
4d70665529
|
|
@ -260,6 +260,13 @@ public class ResultController { // 첩보수집활동 > 외사경찰 견문관
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/deleteResult")
|
||||||
|
@ResponseBody
|
||||||
|
public void deleteResult (@RequestBody ResultBoard resultBoard){
|
||||||
|
resultService.deleteResult(resultBoard.getResultKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/resultBoardJson")
|
@GetMapping("/resultBoardJson")
|
||||||
public ResultBoard resultBoardJson(ResultBoard resultBoard, HttpSession session){
|
public ResultBoard resultBoardJson(ResultBoard resultBoard, HttpSession session){
|
||||||
Map<String, List<CodeMgt>> codeMap = (Map<String, List<CodeMgt>>) session.getAttribute("commonCode");
|
Map<String, List<CodeMgt>> codeMap = (Map<String, List<CodeMgt>>) session.getAttribute("commonCode");
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,13 @@ package com.dbnt.faisp.main.fpiMgt.affairResult.repository;
|
||||||
|
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairResult.model.ResultBoard;
|
import com.dbnt.faisp.main.fpiMgt.affairResult.model.ResultBoard;
|
||||||
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 ResultBoardRepository extends JpaRepository<ResultBoard, Integer> {
|
public interface ResultBoardRepository extends JpaRepository<ResultBoard, Integer> {
|
||||||
|
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("update ResultBoard set resultState = :resultState where resultKey = :resultKey")
|
||||||
|
void bulkModifyingByResultKeyToResultStatus(Integer resultKey, String resultState);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -206,4 +206,9 @@ public class ResultService extends BaseService { // 월간계획
|
||||||
}
|
}
|
||||||
resultToPlanRepository.saveAll(resultToPlanList);
|
resultToPlanRepository.saveAll(resultToPlanList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deleteResult(Integer resultKey) {
|
||||||
|
resultBoardRepository.bulkModifyingByResultKeyToResultStatus(resultKey, "DST008");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<mapper namespace="com.dbnt.faisp.main.fpiMgt.affairResult.mapper.ResultMapper">
|
<mapper namespace="com.dbnt.faisp.main.fpiMgt.affairResult.mapper.ResultMapper">
|
||||||
<sql id="selectResultBoardListWhere">
|
<sql id="selectResultBoardListWhere">
|
||||||
<where>
|
<where>
|
||||||
|
result_state <> 'DST008'
|
||||||
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
||||||
and a.wrt_user_seq = #{wrtUserSeq}
|
and a.wrt_user_seq = #{wrtUserSeq}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,29 @@ $(document).on('click', '#editResultBtn', function (){
|
||||||
getResultEditModal(Number($("#resultViewBody").find("[name='resultKey']").val()));
|
getResultEditModal(Number($("#resultViewBody").find("[name='resultKey']").val()));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '#deleteResultBtn', function (){
|
||||||
|
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||||
|
contentFade("in");
|
||||||
|
$.ajax({
|
||||||
|
type : 'POST',
|
||||||
|
data : JSON.stringify({resultKey: $("#viewModalResultKey").val()}),
|
||||||
|
url : "/affairResult/deleteResult",
|
||||||
|
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', '#resultAddBtn', function (){
|
$(document).on('click', '#resultAddBtn', function (){
|
||||||
$("#resultDiv").append("<input type='text' class='form-control' name='resultInfos'>")
|
$("#resultDiv").append("<input type='text' class='form-control' name='resultInfos'>")
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -296,15 +296,23 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-light">
|
<div class="modal-footer justify-content-between bg-light">
|
||||||
<th:block th:if="${result.resultState eq 'DST006'}">
|
<div class="col-auto">
|
||||||
<button type="button" class="btn btn-secondary" id="bundlePrintBtn" th:data-resultkey="${result.resultKey}">묶음인쇄</button>
|
<th:block th:unless="${result.resultState eq 'DST004' or result.resultState eq 'DST006'}">
|
||||||
<button type="button" class="btn btn-secondary" id="resultPrintBtn" th:data-resultkey="${result.resultKey}">개별인쇄</button>
|
<th:block th:if="${userSeq eq result.wrtUserSeq or accessAuth eq 'ACC003'}">
|
||||||
</th:block>
|
<button type="button" class="btn btn-danger" id="deleteResultBtn">삭제</button>
|
||||||
<th:block th:unless="${result.resultState eq 'DST004' or result.resultState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
</th:block>
|
||||||
<th:block th:if="${userSeq eq result.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
|
||||||
<button type="button" class="btn btn-warning" id="editResultBtn">수정</button>
|
|
||||||
</th:block>
|
</th:block>
|
||||||
</th:block>
|
</div>
|
||||||
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
|
<div class="col-auto">
|
||||||
|
<th:block th:if="${result.resultState eq 'DST006'}">
|
||||||
|
<button type="button" class="btn btn-secondary" id="bundlePrintBtn" th:data-resultkey="${result.resultKey}">묶음인쇄</button>
|
||||||
|
<button type="button" class="btn btn-secondary" id="resultPrintBtn" th:data-resultkey="${result.resultKey}">개별인쇄</button>
|
||||||
|
</th:block>
|
||||||
|
<th:block th:unless="${result.resultState eq 'DST004' or result.resultState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
||||||
|
<th:block th:if="${userSeq eq result.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||||
|
<button type="button" class="btn btn-warning" id="editResultBtn">수정</button>
|
||||||
|
</th:block>
|
||||||
|
</th:block>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Loading…
Reference in New Issue