140 lines
5.4 KiB
Java
140 lines
5.4 KiB
Java
package com.dbnt.kcscbackend.standardCode;
|
|
|
|
import com.dbnt.kcscbackend.config.common.BaseController;
|
|
import com.dbnt.kcscbackend.config.common.LoginVO;
|
|
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
|
import com.dbnt.kcscbackend.config.common.ResultVO;
|
|
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentCodeList;
|
|
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentInfo;
|
|
import com.dbnt.kcscbackend.standardCode.service.StandardCodeService;
|
|
import com.dbnt.kcscbackend.standardCode.service.StandardCodeVO;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.egovframe.rte.fdl.property.EgovPropertyService;
|
|
import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* 건설기준코드 관리를 위한 컨트롤러 클래스
|
|
*
|
|
* <pre>
|
|
* << 개정이력(Modification Information) >>
|
|
*
|
|
* 수정일 수정자 수정내용
|
|
* ------- -------- ---------------------------
|
|
* 2023.10.11 최강석 최초 생성
|
|
*
|
|
* </pre>
|
|
*/
|
|
@RestController
|
|
@RequiredArgsConstructor
|
|
@RequestMapping("/standardCode")
|
|
@Tag(name="StandardCodeController",description = "건설기준코드 관리 컨트롤러")
|
|
public class StandardCodeController extends BaseController {
|
|
|
|
@Resource(name = "propertiesService")
|
|
protected EgovPropertyService propertyService;
|
|
private final StandardCodeService standardCodeService;
|
|
|
|
|
|
|
|
@Operation(
|
|
summary = "건설기준코드 트리 조회",
|
|
description = "건설기준코드 트리 조회",
|
|
tags = {"StandardCodeController"}
|
|
)
|
|
@ApiResponses(value = {
|
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
|
})
|
|
@RequestMapping(method = RequestMethod.POST, value = "/getCodeTree.do", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
public ResultVO getCodeTree() throws Exception {
|
|
ResultVO resultVO = new ResultVO();
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
resultMap.put("codeTree", standardCodeService.selectStandardCodeTree());
|
|
resultVO.setResult(resultMap);
|
|
return resultVO;
|
|
}
|
|
|
|
|
|
@Operation(
|
|
summary = "건설기준코드 내용 조회",
|
|
description = "건설기준코드 내용 조회",
|
|
tags = {"StandardCodeController"}
|
|
)
|
|
@ApiResponses(value = {
|
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
|
})
|
|
@PostMapping(value = "/getCodeDetailInfo.do", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
public ResultVO getCodeDetailInfo(@RequestBody StandardCodeVO param, @AuthenticationPrincipal LoginVO user)
|
|
throws Exception {
|
|
ResultVO resultVO = new ResultVO();
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
resultMap.put("document", standardCodeService.selectStandardCodeDocument(param));
|
|
resultVO.setResult(resultMap);
|
|
return resultVO;
|
|
}
|
|
|
|
|
|
@Operation(
|
|
summary = "건설기준코드 리스트 조회",
|
|
description = "건설기준코드 리스트 조회",
|
|
tags = {"StandardCodeController"}
|
|
)
|
|
@ApiResponses(value = {
|
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
|
})
|
|
@PostMapping(value = "/selectStandardCodeList.do", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
public ResultVO selectStandardCodeList(@RequestBody TnDocumentInfo tnDocumentInfo, @AuthenticationPrincipal LoginVO user)
|
|
throws Exception {
|
|
ResultVO resultVO = new ResultVO();
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
PaginationInfo paginationInfo = new PaginationInfo();
|
|
paginationInfo.setCurrentPageNo(tnDocumentInfo.getPageIndex());
|
|
paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit"));
|
|
paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize"));
|
|
resultMap.put("paginationInfo", paginationInfo);
|
|
|
|
System.out.println("@@@ searchCnd : " + tnDocumentInfo.getSearchCnd());
|
|
if (!tnDocumentInfo.getSearchCnd().isEmpty()) {
|
|
tnDocumentInfo.setListCode(tnDocumentInfo.getSearchCnd());
|
|
}
|
|
List<TnDocumentCodeList> tnDocumentCodeList = standardCodeService.selectStandardCodeList(tnDocumentInfo);
|
|
resultMap.put("resultList", tnDocumentCodeList);
|
|
Integer totCnt = tnDocumentCodeList.get(0).getContentcount();
|
|
resultMap.put("resultCnt", totCnt);
|
|
resultMap.put("user", user);
|
|
|
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
resultVO.setResult(resultMap);
|
|
return resultVO;
|
|
}
|
|
|
|
@Operation(
|
|
summary = "건설기준코드 개정이력 조회",
|
|
description = "건설기준코드 개정이력 조회",
|
|
tags = {"StandardCodeController"}
|
|
)
|
|
@PostMapping("/codeListModal.do")
|
|
public ResponseEntity<List<TnDocumentInfo>> testCodeList(@RequestBody Integer groupseq){
|
|
return ResponseEntity.ok(standardCodeService.selectStandardCodeRevisionhistoryList(groupseq));
|
|
}
|
|
|
|
|
|
|
|
} |