외사방첩관리 > 외사활동 > 담당사건목록 삭제기능 추가.
parent
e46bdafa64
commit
9455c8e8cb
|
|
@ -86,6 +86,7 @@ public class ActivityCaseController {
|
|||
ModelAndView mav = new ModelAndView("counterIntelligence/activityCase/activityCaseSummaryModal");
|
||||
mav.addObject("modalType", activityCase.getModalType());
|
||||
List<ActivityCaseSummary> activityCaseList = activityCaseService.selectActivityCaseInfoList(activityCase.getReceiptKey());
|
||||
|
||||
mav.addObject("viewUserSeq", loginUser.getUserSeq());
|
||||
mav.addObject("wrtUserSeq", activityCaseList.get(activityCaseList.size()-1).getWrtUserSeq());
|
||||
mav.addObject("lastCaseType", activityCaseList.get(activityCaseList.size()-1).getCaseType());
|
||||
|
|
@ -125,14 +126,15 @@ public class ActivityCaseController {
|
|||
}
|
||||
|
||||
@PostMapping("/deleteActivityCase")
|
||||
public Integer deleteActivityCase(@AuthenticationPrincipal UserInfo loginUser, ActivityCase activityCase){
|
||||
String accessAuth = authMgtService.selectAccessConfigList
|
||||
(loginUser.getUserSeq(), "/counterIntelligence/activityCaseList").get(0).getAccessAuth();
|
||||
if(accessAuth.equals("ACC003")){
|
||||
return activityCaseService.deleteActivityCase(activityCase.getReceiptKey());
|
||||
}else{
|
||||
return 0;
|
||||
@ResponseBody
|
||||
public void deleteActivityCase(@AuthenticationPrincipal UserInfo loginUser, @RequestBody ActivityCase activityCase){
|
||||
activityCaseService.deleteActivityCase(activityCase.getReceiptKey());
|
||||
}
|
||||
|
||||
@PostMapping("/deleteActivityCaseInfo")
|
||||
@ResponseBody
|
||||
public void deleteActivityCaseInfo(@AuthenticationPrincipal UserInfo loginUser, @RequestBody ActivityCaseInfo acInfo) {
|
||||
activityCaseService.deleteActivityCaseInfo(acInfo.getCaseKey());
|
||||
}
|
||||
|
||||
@GetMapping("/activityCaseMgt")
|
||||
|
|
|
|||
|
|
@ -2,8 +2,16 @@ package com.dbnt.faisp.main.counterIntelligence.activityCase.repository;
|
|||
|
||||
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseInfo;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
|
||||
public interface ActivityCaseInfoRepository extends JpaRepository<ActivityCaseInfo, Integer> {
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query("update ActivityCaseInfo set status = :status where receiptKey = :receiptKey")
|
||||
void bulkModifyingByReceiptKeyToStatus(Integer receiptKey, String status);
|
||||
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query("update ActivityCaseInfo set status = :status where caseKey = :caseKey")
|
||||
void bulkModifyingByCaseKeyToStatus(Integer caseKey, String status);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,16 +124,12 @@ public class ActivityCaseService extends BaseService {
|
|||
}
|
||||
|
||||
@Transactional
|
||||
public Integer deleteActivityCase(Integer receiptKey) {
|
||||
ActivityCase activityCase = acRepository.findById(receiptKey).orElse(null);
|
||||
|
||||
return receiptKey;
|
||||
public void deleteActivityCase(Integer receiptKey) {
|
||||
aciRepository.bulkModifyingByReceiptKeyToStatus(receiptKey, "DST008");
|
||||
}
|
||||
@Transactional
|
||||
public Integer deleteActivityCaseInfo(Integer caseKey) {
|
||||
ActivityCaseInfo activityCaseInfo = aciRepository.findById(caseKey).orElse(null);
|
||||
|
||||
return caseKey;
|
||||
public void deleteActivityCaseInfo(Integer caseKey) {
|
||||
aciRepository.bulkModifyingByCaseKeyToStatus(caseKey, "DST008");
|
||||
}
|
||||
|
||||
private String makeReceiptNum(int year){
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<mapper namespace="com.dbnt.faisp.main.counterIntelligence.activityCase.mapper.ActivityCaseMapper">
|
||||
<sql id="selectActivityCaseListWhere">
|
||||
<where>
|
||||
c.status <> 'DST008'
|
||||
<if test='receiptKey != null and receiptKey != ""'>
|
||||
and a.receipt_key = #{receiptKey}
|
||||
</if>
|
||||
|
|
@ -172,6 +173,7 @@
|
|||
group by case_key
|
||||
) d on b.case_key = d.case_key
|
||||
where a.receipt_key = #{receiptKey}
|
||||
and b.status <> 'DST008'
|
||||
order by b.wrt_dt asc
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,13 @@ $(document).on('click', '#editInfoBtn', function (){
|
|||
getActivityCaseEditModal(modalBody.find('#receiptKey').val(), modalBody.find('#caseKey').val(), modalBody.find('#caseType').val())
|
||||
})
|
||||
|
||||
$(document).on('click', '#deleteAllBtn', function (){
|
||||
deleteActivityCase("/counterIntelligence/deleteActivityCase", "receiptKey", $(this).attr('data-receiptkey'));
|
||||
})
|
||||
$(document).on('click', '#deleteInfoBtn', function (){
|
||||
deleteActivityCase("/counterIntelligence/deleteActivityCaseInfo", "caseKey", $("#caseKey").val());
|
||||
})
|
||||
|
||||
$(document).on('click', '.apprvBtn', function (){
|
||||
const apprvValue = $(this).attr('data-apprvvalue');
|
||||
if (confirm((apprvValue==="Y"?"승인":"반려")+"하시겠습니까?")){
|
||||
|
|
@ -257,23 +264,21 @@ function setApprvResult(caseKey, userSeq, instructions, apprvValue){
|
|||
})
|
||||
}
|
||||
|
||||
function deleteActivityCase(caseKey){
|
||||
if(confirm("삭제하시겠습니까?")){
|
||||
function deleteActivityCase(url, keyName, keyValue){
|
||||
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||
contentFade("in");
|
||||
const formData = new FormData();
|
||||
formData.append('caseKey', caseKey);
|
||||
const param = {};
|
||||
param[keyName] = keyValue;
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/counterIntelligence/deleteActivityCase",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
data : JSON.stringify(param),
|
||||
url : url,
|
||||
contentType: 'application/json',
|
||||
beforeSend: function (xhr){
|
||||
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||
},
|
||||
success : function(result) {
|
||||
alert("삭제되었습니다.");
|
||||
contentFade("out");
|
||||
location.reload();
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
|
|
|
|||
|
|
@ -45,8 +45,13 @@
|
|||
</table>
|
||||
</div>
|
||||
<th:block th:if="${modalType ne 'viewOnly'}">
|
||||
<div class="modal-footer bg-light" th:if="${lastCaseType ne 'ACT003' and viewUserSeq eq wrtUserSeq}">
|
||||
<div class="modal-footer bg-light">
|
||||
<th:block>
|
||||
<button type="button" class="btn btn-outline-dark" id="deleteAllBtn" th:data-receiptkey="${receiptKey}">전체 삭제</button>
|
||||
</th:block>
|
||||
<th:block th:if="${lastCaseType ne 'ACT003' and viewUserSeq eq wrtUserSeq}">
|
||||
<button type="button" class="btn btn-outline-dark addInfoBtn" th:data-receiptkey="${receiptKey}" data-casetype="ACT002" th:data-laststatus="${lastStatus}">진행보고서 작성</button>
|
||||
<button type="button" class="btn btn-outline-dark addInfoBtn" th:data-receiptkey="${receiptKey}" data-casetype="ACT003" th:data-laststatus="${lastStatus}">결과보고서 작성</button>
|
||||
</th:block>
|
||||
</div>
|
||||
</th:block>
|
||||
|
|
@ -192,8 +192,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<th:block th:if="${modalType ne 'viewOnly'}">
|
||||
<div class="modal-footer bg-light" th:if="${activityCaseInfo.status eq 'DST001' and viewUserSeq eq activityCase.wrtUserSeq}">
|
||||
<!--<button type="button" class="btn btn-danger" id="deleteInfoBtn">삭제</button>-->
|
||||
<div class="modal-footer bg-light">
|
||||
<th:block th:if="${viewUserSeq eq activityCase.wrtUserSeq}">
|
||||
<button type="button" class="btn btn-danger" id="deleteInfoBtn">삭제</button>
|
||||
</th:block>
|
||||
<th:block th:if="${activityCaseInfo.status eq 'DST001' and viewUserSeq eq activityCase.wrtUserSeq}">
|
||||
<button type="button" class="btn btn-warning" id="editInfoBtn">수정</button>
|
||||
</th:block>
|
||||
</div>
|
||||
</th:block>
|
||||
Loading…
Reference in New Issue