parent
f01974b28c
commit
06168d71de
|
|
@ -1,21 +1,11 @@
|
|||
package com.dbnt.faisp.main.budget;
|
||||
|
||||
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
||||
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
||||
import com.dbnt.faisp.main.faRpt.model.FaRptBoard;
|
||||
import com.dbnt.faisp.main.faRpt.model.FaRptReadUser;
|
||||
import com.dbnt.faisp.main.faRpt.service.FaRptService;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/budget")
|
||||
|
|
|
|||
|
|
@ -91,13 +91,13 @@ public class CounterIntelligenceController {
|
|||
|
||||
@PostMapping("/deleteCiWork")
|
||||
public Integer deleteCiWork(@AuthenticationPrincipal UserInfo loginUser, CounterIntelligenceWork ciWork){
|
||||
String accessAuth = authMgtService.selectAccessConfigList
|
||||
(loginUser.getUserSeq(), "/counterIntelligence/ciWorkList").get(0).getAccessAuth();
|
||||
if(accessAuth.equals("ACC003")){
|
||||
// String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/counterIntelligence/ciWorkList").get(0).getAccessAuth();
|
||||
return ciService.deleteCiWork(ciWork.getCiwKey());
|
||||
/*if(accessAuth.equals("ACC003")){
|
||||
return ciService.deleteCiWork(ciWork.getCiwKey());
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@GetMapping("/CiWorkStatistics")
|
||||
public ModelAndView ciWorkStatistics(@AuthenticationPrincipal UserInfo loginUser, CiWorkStatistics ciWorkStatistics){
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public class CounterIntelligenceService extends BaseService {
|
|||
|
||||
@Transactional
|
||||
public Integer deleteCiWork(Integer ciwKey) {
|
||||
CounterIntelligenceWork ciWork = ciwRepository.findById(ciwKey).orElse(null);
|
||||
CounterIntelligenceWork ciWork = ciwRepository.findById(ciwKey).orElse(new CounterIntelligenceWork());
|
||||
ciWork.setStatus("DST008");
|
||||
return ciwKey;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,4 +100,10 @@ public class IvsgtController {
|
|||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/deleteIvsgtReport")
|
||||
@ResponseBody
|
||||
public void deleteIvsgtReport(@RequestBody InvestigationBoard ivsgtReport){
|
||||
ivsgtService.deleteIvsgtReport(ivsgtReport.getIvsgtKey());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,12 @@ package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.repository;
|
|||
|
||||
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationBoard;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
|
||||
public interface InvestigationBoardRepository extends JpaRepository<InvestigationBoard, Integer> {
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query("update InvestigationBoard set status = :status where ivsgtKey = :ivsgtKey")
|
||||
void bulkModifyingByIvsgtKeyToStatus(Integer ivsgtKey, String status);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,4 +113,9 @@ public class IvsgtService extends BaseService {
|
|||
public FileInfo selectIvsgtFile(Integer parentKey, Integer fileSeq) {
|
||||
return ivsgtFileRepository.findById(new InvestigationFile.InvestigationFileId(parentKey, fileSeq)).orElse(null);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteIvsgtReport(Integer ivsgtKey) {
|
||||
ivsgtboardRepository.bulkModifyingByIvsgtKeyToStatus(ivsgtKey, "DST008");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<mapper namespace="com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.mapper.InvestigationBoardMapper">
|
||||
<sql id="selectInvestigationBoardListWhere">
|
||||
<where>
|
||||
status <> 'DST008'
|
||||
<if test='downOrganCdList != null'>
|
||||
and a.wrt_organ in
|
||||
<foreach collection="downOrganCdList" item="organCd" separator="," open="(" close=")">
|
||||
|
|
@ -109,5 +110,6 @@
|
|||
INNER JOIN investigation_board i
|
||||
ON i.ivsgt_key = a.related_report_key
|
||||
WHERE a.parent_ivsgt_key = #{ivsgtKey}
|
||||
and i.status <> 'DST008'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -7,6 +7,29 @@ $(document).on('click', '#ivsgtEditBtn', function () {
|
|||
getIvsgtEditModal(Number($("#ivsgtViewBody").find("[name='ivsgtKey']").val()));
|
||||
});
|
||||
|
||||
$(document).on('click', '#ivsgtDeleteBtn', function (){
|
||||
if(confirm("삭제하시겠습니까?\n되돌릴 수 없습니다.")){
|
||||
contentFade("in");
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : JSON.stringify({ivsgtKey: $("#ivsgtViewBody").find("[name='ivsgtKey']").val()}),
|
||||
url : "/ivsgt/deleteIvsgtReport",
|
||||
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('change', '#arrestCd', function (){
|
||||
$(".arrestCd2").hide();
|
||||
$("."+this.value).show();
|
||||
|
|
|
|||
|
|
@ -132,7 +132,9 @@
|
|||
</div>
|
||||
<th:block th:if="${modalType ne 'viewOnly'}">
|
||||
<div class="modal-footer bg-light">
|
||||
<th:block th:if="${userSeq eq investigation.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||
<th:block th:if="${userSeq eq investigation.wrtUserSeq or accessAuth eq 'ACC003'}">
|
||||
<!--작성자, 관리자일 경우 -->
|
||||
<button type="button" class="btn btn-danger" id="ivsgtDeleteBtn">삭제</button>
|
||||
<button type="button" class="btn btn-warning" id="ivsgtEditBtn">수정</button>
|
||||
</th:block>
|
||||
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue