강석 최 2023-11-08 13:53:26 +09:00
commit 35c90bbb53
8 changed files with 190 additions and 27 deletions

View File

@ -5,11 +5,11 @@ import * as EgovNet from 'api/egovFetch';
import URL from 'constants/url';
import { NOTICE_BBS_ID } from 'config';
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavInform';
import EgovPaging from 'components/EgovPaging';
import { itemIdxByPage } from 'utils/calc';
import StandardCodeListModal from './StandardCodeListModal'
import {StandardCodeListModal, StandardCodeListModalTable} from './StandardCodeListModal'
function StandardCodeList(props) {
const {listCode} = useParams();
@ -17,8 +17,48 @@ function StandardCodeList(props) {
const [groupseq,setgroupseq] = useState();
function showhandling(e){
const param = e.currentTarget.dataset;
const groupseq = param.groupseq;
console.log(groupseq);
EgovNet.requestFetch(
'/standardCode/testCodeList.do',
{
method: "POST",
headers: {
'Content-type': 'application/json'
},
body: JSON.stringify(
groupseq
)
},(resp) =>{
console.log(resp+"------------------------resp")
const body =[];
const head =[];
if(resp.length>0){
resp.forEach(function (item,index){
const formattedDate = item.aplcnBgngYmd.match(/\d{4}-\d{2}-\d{2}/)[0];
const url = "https://www.kcsc.re.kr/file/DownloadGrp/"+item.docFileGrpId;
body.push(
<tr>
<td>{formattedDate}</td>
<td><a href={url}>{item.docFileGrpId}</a></td>
<td></td>
</tr>)
})
head.push(
<tr>
<td>년도</td>
<td>기준코드</td>
<td>신구건설기준비교</td>
</tr>
)
}
setgroupseq(<StandardCodeListModalTable head={head} content={body}/>);
}
)
setshow(true);
setgroupseq(param.groupseq);
}
function close () {
setshow(false);
@ -75,29 +115,22 @@ function StandardCodeList(props) {
mutListTag.push(
<Link
to={"#"}
state={{
docInfoSeq: item.docInfoSeq,
docNm: item.docNm,
kcscCd: item.kcscCd,
searchCondition: searchCondition
}}
key={listIdx}
className="list_item" >
<div></div>
<div></div>
className="list_item List_Codes" >
<div>{item.mainCategory}</div>
<div>{item.middleCategory}</div>
<div>{item.kcscCd}</div>
{(item.replyLc * 1 ? true : false) &&
<div className="al reply">
{item.docNm}
{item.groupNm}
</div>}
{(item.replyLc * 1 ? false : true) &&
<div className="al">
{item.docNm}
{item.groupNm}
</div>}
<div><button onClick={showhandling} data-groupseq = {item.groupSeq}>개정이력</button></div>
<div></div>
<div></div>
<div>{item.contentcount>0?<a href = {"/standardCode/viewer/"+item.kcscCd}>{item.kcscCd}</a>:null}</div>
<div>{item.docFileGrpId}</div>
<div></div>
</Link>
@ -134,14 +167,14 @@ function StandardCodeList(props) {
<div className="layout">
{/* <!-- Navigation --> */}
<EgovLeftNav/>
{/* <!--// Navigation --> */}
<div className="contents NOTICE_LIST" id="contents">
{/* <!-- 본문 --> */}
<div className="top_tit">
<h1 className="tit_1">건설기준코드</h1>
<h2 className="tit_1">건설기준코드</h2>
</div>
<h2 className="tit_2">설계기준, 표준시방서 내용을 열람할 있습니다.</h2>
@ -206,7 +239,8 @@ function StandardCodeList(props) {
retrieveList({ ...searchCondition, pageIndex: passedPage, searchCnd: cndRef.current.value, searchWrd: wrdRef.current.value })
}} />
{/* <!--/ Paging --> */}
<StandardCodeListModal show ={show} groupseq ={groupseq} onClose = {close}/>
<StandardCodeListModal size={"lg"} show ={show} content ={groupseq} onClose = {close} title={"개정이력"}/>
</div>
{/* <!--// 본문 --> */}

View File

@ -1,17 +1,30 @@
import {Button, Modal, ModalBody, ModalFooter, ModalHeader, ModalTitle} from "react-bootstrap";
function StandardCodeListModal({show,groupseq,onClose}){
//todo 로직추가구현필요
function StandardCodeListModal({show,content,onClose,title,size}){
return(
<Modal show={show}>
<Modal size={size} show={show} aria-labelledby="example-modal-sizes-title-lg">
<ModalHeader>
<ModalTitle>개정이력</ModalTitle>
<ModalTitle id="example-modal-sizes-title-lg">{title}</ModalTitle>
</ModalHeader>
<ModalBody>
{groupseq}
{content}
</ModalBody>
<ModalFooter><Button onClick={onClose}>닫기</Button></ModalFooter>
</Modal>)
}
export default StandardCodeListModal;
function StandardCodeListModalTable({head,content}){
return(
<table>
<thead>
{head}
</thead>
<tbody>
{content}
</tbody>
</table>
)
}
export {StandardCodeListModal,StandardCodeListModalTable};

View File

@ -15,6 +15,7 @@ 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -117,7 +119,7 @@ public class StandardCodeController extends BaseController {
tnDocumentInfo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("resultList", standardCodeService.selectStandardCodeList(tnDocumentInfo));
resultMap.put("resultList", standardCodeService.selectStandardcodelist(tnDocumentInfo.getListCode()));
resultMap.put("resultCnt", standardCodeService.selectStandardCodeListCnt(tnDocumentInfo));
Integer totCnt = (Integer) resultMap.get("resultCnt");
paginationInfo.setTotalRecordCount(totCnt);
@ -130,4 +132,17 @@ public class StandardCodeController extends BaseController {
resultVO.setResult(resultMap);
return resultVO;
}
@Operation(
summary = "건설기준코드 개정이력 조회",
description = "건설기준코드 개정이력 조회",
tags = {"StandardCodeController"}
)
@PostMapping("/testCodeList.do")
public ResponseEntity<List<TnDocumentInfo>> testCodeList(@RequestBody Integer groupseq){
return ResponseEntity.ok(standardCodeService.selectStandardCodeRevisionhistoryList(groupseq));
}
}

View File

@ -0,0 +1,36 @@
package com.dbnt.kcscbackend.standardCode.entity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
public class TnDocumentCodeList {
@Column(name = "main_category")
private String mainCategory;
@Column(name = "middle_category")
private String middleCategory;
@Column(name = "group_nm")
private String groupNm;
@Column(name = "kcsc_cd")
private String kcscCd;
@Column(name = "doc_file_grp_id")
private String docFileGrpId;
@Id
@Column(name ="group_seq")
private Integer groupSeq;
@Column(name = "contentcount")
private Integer contentcount;
}

View File

@ -87,6 +87,8 @@ public class TnDocumentInfo {
@Column(name = "old_seq")
private Integer oldSeq;
@Schema(description = "현재페이지")
private int pageIndex = 1;
@Schema(description = "페이지갯수")

View File

@ -1,6 +1,7 @@
package com.dbnt.kcscbackend.standardCode.mapper;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentCodeList;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentInfo;
import org.apache.ibatis.annotations.Mapper;
@ -13,4 +14,7 @@ public interface StandardCodeMapper {
Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo);
List<TnDocumentInfo> selectStandardCodeRevisionhistoryList(Integer groupseq);
List<TnDocumentCodeList> selectStandardcodelist(String code);
}

View File

@ -1,5 +1,6 @@
package com.dbnt.kcscbackend.standardCode.service;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentCodeList;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentInfo;
import com.dbnt.kcscbackend.standardCode.mapper.StandardCodeMapper;
import com.dbnt.kcscbackend.standardCode.repository.TnDocumentContentRepository;
@ -34,4 +35,11 @@ public class StandardCodeService {
return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo);
}
public List<TnDocumentInfo> selectStandardCodeRevisionhistoryList(Integer groupseq) {
return standardCodeMapper.selectStandardCodeRevisionhistoryList(groupseq);
}
public List<TnDocumentCodeList> selectStandardcodelist(String code){
return standardCodeMapper.selectStandardcodelist(code);
}
}

View File

@ -61,4 +61,55 @@
</where>
</sql>
<select id="selectStandardCodeRevisionhistoryList" resultType="TnDocumentInfo">
select tdi.aplcn_bgng_ymd,tdi.doc_file_grp_id from tn_document_info tdi, tn_document_group tdg
where 1 = 1
and tdi.group_seq = tdg.group_seq
and tdi.kcsc_cd like 'KDS%'
and tdi.group_seq =#{groupseq}
and tdi.use_yn = 'Y'
order by tdi.kcsc_cd;
</select>
<select id="selectStandardcodelist" resultType="TnDocumentCodeList">
select
case
when a3.doc_level > 1 then a3.doc_code_name
else a2.doc_code_name
end as main_category,
case
when a3.doc_level > 1 then a2.doc_code_name
else a.group_nm
end as middle_category,
a.group_nm,
a.kcsc_cd,
tdi.doc_file_grp_id,
a.group_seq,
count(tdc.full_content) as contentcount
from
tn_document_group a
left join tn_document_info tdi on
a.group_seq = tdi.group_seq
left join tn_document_content tdc on
tdi.doc_info_seq = tdc.doc_info_seq,
sp_get_tn_document_code_by_tree() a2,
sp_get_tn_document_code_by_tree() a3
where
a.parent_group_seq = a2.seq
and a2.parent_seq = a3.seq
and a.group_full_cd like #{code} || '%'
and a.group_type = 'D'
and tdi.last_yn = 'Y'
group by
main_category,
middle_category,
a.group_nm,
a.kcsc_cd,
tdi.doc_file_grp_id,
a.group_seq
order by
a.kcsc_cd;
</select>
</mapper>