feat: 관리자 - 컨텐츠관리 - 건설기준연구 관리에서 삭제 기능 구현 back-end
parent
d9f223960a
commit
bcaf14dfc3
|
|
@ -172,11 +172,11 @@ public class AdminStandardResearchController {
|
||||||
(
|
(
|
||||||
@AuthenticationPrincipal LoginVO user,
|
@AuthenticationPrincipal LoginVO user,
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
@PathVariable("rsId") String strPopupId
|
@PathVariable("rsId") String strRsId
|
||||||
) throws Exception {
|
) throws Exception {
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Long rsId = Long.valueOf(strPopupId);
|
Long rsId = Long.valueOf(strRsId);
|
||||||
try {
|
try {
|
||||||
resultVO = adminStandardResearchService.contentsStandardResearchDelete(resultVO, request, user, rsId);
|
resultVO = adminStandardResearchService.contentsStandardResearchDelete(resultVO, request, user, rsId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,18 @@
|
||||||
package com.dbnt.kcscbackend.admin.standardResearch.repository;
|
package com.dbnt.kcscbackend.admin.standardResearch.repository;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.standardResearch.model.TnResearchLightweight;
|
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.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> {
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
long totalRecordCount = tnResearchRepositoryLightweight.count();
|
long totalRecordCount = tnResearchRepositoryLightweight.countByUseYn("Y");
|
||||||
List<Map<String, Object>> list = tnResearchRepositoryLightweight.findAll(pageable)
|
List<Map<String, Object>> list = tnResearchRepositoryLightweight.findByUseYn("Y", pageable)
|
||||||
.stream()
|
.stream()
|
||||||
.map(item -> {
|
.map(item -> {
|
||||||
Map<String, Object> codeMap = new HashMap<>();
|
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("researchStartDate", item.getRsStartDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||||
codeMap.put("researchEndDate", item.getRsEndDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
codeMap.put("researchEndDate", item.getRsEndDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||||
codeMap.put("director", item.getRsDirector());
|
codeMap.put("director", item.getRsDirector());
|
||||||
codeMap.put("createDate", item.getFrstCrtDt());
|
//codeMap.put("createDate", item.getFrstCrtDt());
|
||||||
codeMap.put("createUserId", item.getFrstCrtId());
|
//codeMap.put("createUserId", item.getFrstCrtId());
|
||||||
codeMap.put("updateDate", item.getLastChgDt());
|
//codeMap.put("updateDate", item.getLastChgDt());
|
||||||
codeMap.put("updateUserId", item.getLastChgId());
|
//codeMap.put("updateUserId", item.getLastChgId());
|
||||||
codeMap.put("useYn", item.getUseYn());
|
//codeMap.put("useYn", item.getUseYn());
|
||||||
return codeMap;
|
return codeMap;
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
@ -165,10 +165,6 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
|
||||||
dto.put("updateUserId", tnResearch.getLastChgId());
|
dto.put("updateUserId", tnResearch.getLastChgId());
|
||||||
dto.put("useYn", tnResearch.getUseYn());
|
dto.put("useYn", tnResearch.getUseYn());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
resultVO.setResult(dto);
|
resultVO.setResult(dto);
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||||
|
|
@ -222,6 +218,7 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultVO contentsStandardResearchDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long rsId) throws Exception {
|
public ResultVO contentsStandardResearchDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long rsId) throws Exception {
|
||||||
|
|
||||||
System.out.println(
|
System.out.println(
|
||||||
"\n--------------------------------------------------------------\n" +
|
"\n--------------------------------------------------------------\n" +
|
||||||
request.getRequestURI() + " IN:" +
|
request.getRequestURI() + " IN:" +
|
||||||
|
|
@ -231,10 +228,6 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
|
||||||
"\n--------------------------------------------------------------\n"
|
"\n--------------------------------------------------------------\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> dto = new HashMap<String, Object>();
|
Map<String, Object> dto = new HashMap<String, Object>();
|
||||||
|
|
||||||
Map<String, Object> response = tnResearchRepository.spDeleteTnResearch(
|
Map<String, Object> response = tnResearchRepository.spDeleteTnResearch(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue