외사대상목표 > 외사분실 삭제 기능 추가.
parent
9455c8e8cb
commit
da56efe8eb
|
|
@ -5,20 +5,15 @@ import com.dbnt.faisp.main.fipTarget.model.PartInfo;
|
||||||
|
|
||||||
|
|
||||||
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 PartInfoRepository extends JpaRepository<PartInfo, PartInfo.PartInfoId> {
|
public interface PartInfoRepository extends JpaRepository<PartInfo, PartInfo.PartInfoId> {
|
||||||
|
|
||||||
PartInfo findFirstByOrderByPiSeqDesc();
|
PartInfo findFirstByOrderByPiSeqDesc();
|
||||||
|
|
||||||
void deleteByPiSeq(Integer piSeq);
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("update PartInfo set piState = :piState where piSeq = :piSeq")
|
||||||
|
void bulkModifyingByPiSeqToPiState(Integer piSeq, String piState);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,24 +4,15 @@ package com.dbnt.faisp.main.fipTarget.repository;
|
||||||
import com.dbnt.faisp.main.fipTarget.model.PartWork;
|
import com.dbnt.faisp.main.fipTarget.model.PartWork;
|
||||||
|
|
||||||
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 PartWorkRepository extends JpaRepository<PartWork, PartWork.PartWorkId> {
|
public interface PartWorkRepository extends JpaRepository<PartWork, PartWork.PartWorkId> {
|
||||||
|
|
||||||
PartWork findTopByPiSeqOrderByPwSeqDesc(Integer piSeq);
|
PartWork findTopByPiSeqOrderByPwSeqDesc(Integer piSeq);
|
||||||
|
|
||||||
void deleteByPwSeqAndPiSeq(Integer pwSeq, Integer piSeq);
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("update PartWork set status = :status where pwSeq = :pwSeq and piSeq = :piSeq")
|
||||||
void deleteByPiSeq(Integer piSeq);
|
void bulkModifyingByPwSeqAndPiSeqToStatus(Integer pwSeq, Integer piSeq, String status);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -195,25 +195,7 @@ public class FipTargetService extends BaseService {
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deletePartInfo(PartInfo partInfo) {
|
public void deletePartInfo(PartInfo partInfo) {
|
||||||
//외사실적 파일,데이터삭제
|
partInfoRepository.bulkModifyingByPiSeqToPiState(partInfo.getPiSeq(), "DST008");
|
||||||
List<PartWorkFile> partWorkFileList = partWorkFileRepository.findByPiSeq(partInfo.getPiSeq());
|
|
||||||
if(partWorkFileList != null) {
|
|
||||||
for(PartWorkFile file: partWorkFileList){
|
|
||||||
deleteStoredFile(new File(file.getFilePath(), file.getConvNm()));
|
|
||||||
partWorkFileRepository.deleteByPwSeqAndPiSeq(file.getPwSeq(),file.getPiSeq());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
partWorkRepository.deleteByPiSeq(partInfo.getPiSeq());
|
|
||||||
//외사분실운영현황파일삭제
|
|
||||||
List<PartInfoFile> partInfoFileList= selectPartInfoFile(partInfo);
|
|
||||||
for(PartInfoFile file: partInfoFileList){
|
|
||||||
if(file.getOrigNm() != null){
|
|
||||||
deleteStoredFile(new File(file.getFilePath(), file.getConvNm()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
partInfoFileRepository.deleteByPiSeq(partInfo.getPiSeq());
|
|
||||||
partInfoRepository.deleteByPiSeq(partInfo.getPiSeq());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartInfoFile selectPartInfoFileDown(Integer fileSeq, Integer piSeq, Integer versionNo) {
|
public PartInfoFile selectPartInfoFileDown(Integer fileSeq, Integer piSeq, Integer versionNo) {
|
||||||
|
|
@ -312,15 +294,7 @@ public class FipTargetService extends BaseService {
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deletePartWork(PartWork partWork) {
|
public void deletePartWork(PartWork partWork) {
|
||||||
//파일삭제
|
partWorkRepository.bulkModifyingByPwSeqAndPiSeqToStatus(partWork.getPwSeq(), partWork.getPiSeq(), "DST008");
|
||||||
List<PartWorkFile> partWorkFileList= partWorkFileRepository.findByPwSeqAndPiSeq(partWork.getPwSeq(),partWork.getPiSeq());
|
|
||||||
if(partWorkFileList != null) {
|
|
||||||
for(PartWorkFile file: partWorkFileList){
|
|
||||||
deleteStoredFile(new File(file.getFilePath(), file.getConvNm()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
partWorkFileRepository.deleteByPwSeqAndPiSeq(partWork.getPwSeq(),partWork.getPiSeq());
|
|
||||||
partWorkRepository.deleteByPwSeqAndPiSeq(partWork.getPwSeq(),partWork.getPiSeq());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartWorkFile selectPartWorkFileDown(Integer fileSeq, Integer pwSeq, Integer piSeq) {
|
public PartWorkFile selectPartWorkFileDown(Integer fileSeq, Integer pwSeq, Integer piSeq) {
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@
|
||||||
<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>-->
|
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
|
||||||
<!--<button type="button" class="btn btn-danger" id="deletePartInfo">삭제</button>-->
|
<button type="button" class="btn btn-danger" id="deletePartInfo">삭제</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<button type="button" class="btn btn-warning" id="mSaveTempBtn">임시저장</button>
|
<button type="button" class="btn btn-warning" id="mSaveTempBtn">임시저장</button>
|
||||||
|
|
|
||||||
|
|
@ -81,15 +81,8 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer justify-content-between bg-light">
|
<div class="modal-footer justify-content-between bg-light">
|
||||||
<div class="col-auto">
|
|
||||||
<!--
|
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
|
||||||
-->
|
|
||||||
<th:block th:if="${userSeq eq pwInfo.wrtUserSeq} or ${accessAuth eq 'ACC003'}">
|
<th:block th:if="${userSeq eq pwInfo.wrtUserSeq} or ${accessAuth eq 'ACC003'}">
|
||||||
<button type="button" class="btn btn-danger" id="deletePartWork">삭제</button>
|
<button type="button" class="btn btn-danger" id="deletePartWork">삭제</button>
|
||||||
</th:block>
|
|
||||||
</div>
|
|
||||||
<th:block th:if="${userSeq eq pwInfo.wrtUserSeq} or ${accessAuth eq 'ACC003'}"><!--작성자 관리자일 경우 수정 허용-->
|
|
||||||
<button type="button" class="btn btn-warning" id="updateBtn">수정</button>
|
<button type="button" class="btn btn-warning" id="updateBtn">수정</button>
|
||||||
</th:block>
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue