첩보수집활동 > 외사경찰 견문관리 > 계획수립 삭제기능 추가.
parent
7152ceca7b
commit
c9a5e64646
|
|
@ -208,6 +208,12 @@ public class PlanController { // 첩보수집활동 > 외사경찰 견문관리
|
||||||
return planService.planStateChange(apprv);
|
return planService.planStateChange(apprv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/deletePlan")
|
||||||
|
@ResponseBody
|
||||||
|
public void deletePlan(@RequestBody PlanBoard planBoard){
|
||||||
|
planService.deletePlan(planBoard.getPlanKey());
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/planBoardJson")
|
@GetMapping("/planBoardJson")
|
||||||
public PlanBoard planBoardJson(PlanBoard planBoard, HttpSession session){
|
public PlanBoard planBoardJson(PlanBoard planBoard, 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.affairPlan.repository;
|
||||||
|
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanBoard;
|
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanBoard;
|
||||||
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 PlanBoardRepository extends JpaRepository<PlanBoard, Integer> {
|
public interface PlanBoardRepository extends JpaRepository<PlanBoard, Integer> {
|
||||||
|
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("update PlanBoard set planState = :planState where planKey = :planKey")
|
||||||
|
void bulkModifyingByPlanKeyToStatus(Integer planKey, String planState);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -157,4 +157,9 @@ public class PlanService extends BaseService { // 월간계획
|
||||||
planBoard.setWrtUserGrd(Utils.searchCodeValue(planBoard.getWrtUserGrd(), codeMap.get("JT")));
|
planBoard.setWrtUserGrd(Utils.searchCodeValue(planBoard.getWrtUserGrd(), codeMap.get("JT")));
|
||||||
return planBoard;
|
return planBoard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deletePlan(Integer planKey) {
|
||||||
|
planBoardRepository.bulkModifyingByPlanKeyToStatus(planKey, "DST008");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<mapper namespace="com.dbnt.faisp.main.fpiMgt.affairPlan.mapper.PlanMapper">
|
<mapper namespace="com.dbnt.faisp.main.fpiMgt.affairPlan.mapper.PlanMapper">
|
||||||
<sql id="selectPlanBoardListWhere">
|
<sql id="selectPlanBoardListWhere">
|
||||||
<where>
|
<where>
|
||||||
|
plan_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', '#editPlanBtn', function (){
|
||||||
getPlanEditModal(Number($("#planViewBody").find("[name='planKey']").val()));
|
getPlanEditModal(Number($("#planViewBody").find("[name='planKey']").val()));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '#deletePlanBtn', function (){
|
||||||
|
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||||
|
contentFade("in");
|
||||||
|
$.ajax({
|
||||||
|
type : 'POST',
|
||||||
|
data : JSON.stringify({planKey: $("#viewModalPlanKey").val()}),
|
||||||
|
url : "/affairPlan/deletePlan",
|
||||||
|
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', '#planAddBtn', function (){
|
$(document).on('click', '#planAddBtn', function (){
|
||||||
$("#planDiv").append("<input type='text' class='form-control' name='planInfos'>")
|
$("#planDiv").append("<input type='text' class='form-control' name='planInfos'>")
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -164,15 +164,23 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:if="${modalType ne 'viewOnly'}">
|
<th:block th:if="${modalType ne 'viewOnly'}">
|
||||||
<div class="modal-footer bg-light">
|
<div class="modal-footer justify-content-between bg-light">
|
||||||
<th:block th:if="${plan.planState eq 'DST006'}">
|
<div class="col-auto">
|
||||||
<button type="button" class="btn btn-secondary" id="planPrintBtn" th:data-plankey="${plan.planKey}">인쇄</button>
|
<th:block th:unless="${plan.planState eq 'DST004' or plan.planState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
||||||
</th:block>
|
<th:block th:if="${userSeq eq plan.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||||
<th:block th:unless="${plan.planState eq 'DST004' or plan.planState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
<button type="button" class="btn btn-danger" id="deletePlanBtn">삭제</button>
|
||||||
<th:block th:if="${userSeq eq plan.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
</th:block>
|
||||||
<button type="button" class="btn btn-warning" id="editPlanBtn">수정</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="${plan.planState eq 'DST006'}">
|
||||||
|
<button type="button" class="btn btn-secondary" id="planPrintBtn" th:data-plankey="${plan.planKey}">인쇄</button>
|
||||||
|
</th:block>
|
||||||
|
<th:block th:unless="${plan.planState eq 'DST004' or plan.planState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
||||||
|
<th:block th:if="${userSeq eq plan.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||||
|
<button type="button" class="btn btn-warning" id="editPlanBtn">수정</button>
|
||||||
|
</th:block>
|
||||||
|
</th:block>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</th:block>
|
</th:block>
|
||||||
Loading…
Reference in New Issue