feat: 관리자 - 컨텐츠관리 - 건설기준연구 관리에서 삭제 기능 구현 back-end

thkim
thkim 2024-01-26 13:18:12 +09:00
parent d9f223960a
commit bcaf14dfc3
3 changed files with 20 additions and 17 deletions

View File

@ -172,11 +172,11 @@ public class AdminStandardResearchController {
(
@AuthenticationPrincipal LoginVO user,
HttpServletRequest request,
@PathVariable("rsId") String strPopupId
@PathVariable("rsId") String strRsId
) throws Exception {
ResultVO resultVO = new ResultVO();
Long rsId = Long.valueOf(strPopupId);
Long rsId = Long.valueOf(strRsId);
try {
resultVO = adminStandardResearchService.contentsStandardResearchDelete(resultVO, request, user, rsId);
} catch (Exception e) {

View File

@ -1,8 +1,18 @@
package com.dbnt.kcscbackend.admin.standardResearch.repository;
import com.dbnt.kcscbackend.admin.standardResearch.model.TnResearchLightweight;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface TnResearchRepositoryLightweight extends JpaRepository<TnResearchLightweight, Long> {
@Query(value = "SELECT COUNT(1) FROM tn_research tr WHERE tr.use_yn = :use_yn", nativeQuery = true)
Long countByUseYn(@Param("use_yn") String useYn);
List<TnResearchLightweight> findByUseYn( String useYn, Pageable pageable);
}

View File

@ -54,8 +54,8 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
);
long totalRecordCount = tnResearchRepositoryLightweight.count();
List<Map<String, Object>> list = tnResearchRepositoryLightweight.findAll(pageable)
long totalRecordCount = tnResearchRepositoryLightweight.countByUseYn("Y");
List<Map<String, Object>> list = tnResearchRepositoryLightweight.findByUseYn("Y", pageable)
.stream()
.map(item -> {
Map<String, Object> codeMap = new HashMap<>();
@ -64,11 +64,11 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
codeMap.put("researchStartDate", item.getRsStartDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
codeMap.put("researchEndDate", item.getRsEndDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
codeMap.put("director", item.getRsDirector());
codeMap.put("createDate", item.getFrstCrtDt());
codeMap.put("createUserId", item.getFrstCrtId());
codeMap.put("updateDate", item.getLastChgDt());
codeMap.put("updateUserId", item.getLastChgId());
codeMap.put("useYn", item.getUseYn());
//codeMap.put("createDate", item.getFrstCrtDt());
//codeMap.put("createUserId", item.getFrstCrtId());
//codeMap.put("updateDate", item.getLastChgDt());
//codeMap.put("updateUserId", item.getLastChgId());
//codeMap.put("useYn", item.getUseYn());
return codeMap;
})
.collect(Collectors.toList());
@ -165,10 +165,6 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
dto.put("updateUserId", tnResearch.getLastChgId());
dto.put("useYn", tnResearch.getUseYn());
resultVO.setResult(dto);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
@ -222,6 +218,7 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
@Override
public ResultVO contentsStandardResearchDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long rsId) throws Exception {
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " IN:" +
@ -231,10 +228,6 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
"\n--------------------------------------------------------------\n"
);
Map<String, Object> dto = new HashMap<String, Object>();
Map<String, Object> response = tnResearchRepository.spDeleteTnResearch(