중간저장

thkim
강석 최 2024-01-31 18:00:33 +09:00
parent dc0046a3c1
commit 52e6aed96e
11 changed files with 7580 additions and 7647 deletions

View File

@ -12,15 +12,16 @@
"@mui/icons-material": "^5.15.6",
"@mui/material": "^5.14.19",
"@mui/styles": "^5.15.3",
"apexcharts": "^3.45.2",
"bootstrap": "^5.3.2",
"date-fns": "^3.2.0",
"qs": "^6.11.0",
"prop-types": "^15.8.1",
"qs": "^6.11.0",
"react": "^18.2.0",
"react-apexcharts": "^1.4.0",
"react-bootstrap": "^2.9.0",
"react-csv": "^2.2.2",
"react-copy-to-clipboard": "^5.1.0",
"react-csv": "^2.2.2",
"react-datepicker": "^4.8.0",
"react-dom": "^18.2.0",
"react-element-to-jsx-string": "^15.0.0",

View File

@ -6,10 +6,14 @@ import URL from 'constants/url';
import {StandardCodeListModal, StandardCodeListModalTable} from './StandardCodeListModal'
import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai";
import StandardCodeSearchForm from "./StandardCodeSearchForm";
import Col from "react-bootstrap/Col";
import Row from "react-bootstrap/Row";
import Loading from "../../../components/Loading";
function StandardCodeList({}) {
const {listCode} = useParams();
const [listData, setListData] = useState([])
const [listLoading, setListLoading] = useState(true);
const [filterData, setFilterData] = useState('');
const [resultCnt, setResultCnt] = useState(0);
const [remarkCnt, setRemarkCnt] = useState(0);
@ -39,7 +43,6 @@ function StandardCodeList({}) {
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;
@ -66,63 +69,122 @@ function StandardCodeList({}) {
}
const retrieveList = useCallback((searchCondition) => {
if(searchCondition?.tab){
EgovNet.requestFetch('/standardCode/standard-code-list'+EgovNet.convParams(searchCondition),
{
method: "GET",
headers: {
'Content-type': 'application/json',
}
},
(resp) => {
setListData(resp.result.resultList);
setResultCnt(resp.result.resultCnt.allCnt);
setRemarkCnt(resp.result.resultCnt.remarkCnt);
},
function (resp) {
console.log("err response : ", resp);
setListLoading(true)
EgovNet.requestFetch('/standardCode/standard-code-list'+EgovNet.convParams(searchCondition),
{
method: "GET",
headers: {
'Content-type': 'application/json',
}
);
}
},
(resp) => {
setListData(resp.result.resultList);
setResultCnt(resp.result.resultCnt.allCnt);
setRemarkCnt(resp.result.resultCnt.remarkCnt);
setListLoading(false)
},
function (resp) {
console.log("err response : ", resp);
}
);
}, []);
return (
<div className="StandardCodeList container">
<div className="c_wrap codeListContent">
<div className="layout">
<div className="contents NOTICE_LIST listTableDiv">
<StandardCodeSearchForm param={listCode} reloadFunction={retrieveList} resultCnt={resultCnt} remarkCnt={remarkCnt}/>
<StandardCodeSearchForm param={listCode?listCode:'10'} reloadFunction={retrieveList} resultCnt={resultCnt} remarkCnt={remarkCnt}/>
<div className="board_list code_list">
<div className="head">
<span>대분류</span>
<span>중분류</span>
<span>코드번호</span>
<span>코드명</span>
<span>개정이력</span>
<span>보기</span>
<span className={"text-start"}>개정이력</span>
<span className={"text-start"}>보기</span>
<span>즐겨찾기</span>
</div>
<div className="result">
{listData.filter(item => {
if (item.groupNm.includes(filterData)) {
return item
}
return null
}).map(item => {
return (
<div className="list_item List_Codes">
<div className="mainCategory">{item.mainCategory}</div>
<div className="middleCategory">{item.middleCategory}</div>
<div className="kcscCd">{item.kcscCd}</div>
<div className="groupNm">{item.groupNm}<br/><span className={"text-danger"}>{item.rvsnRemark}</span></div>
<div className="Revisionhistory"><a className="vieweratag" onClick={showHandling} data-groupSeq={item.groupSeq}>개정이력</a></div>
<div className="fille"><a className="vieweratag" href={"/standardCode/viewer/" + item.kcscCd}>내용보기</a></div>
<div className="star"><AiFillStar/></div>
</div>
)
})}
</div>
{
listLoading?(<Loading/>):(
<div className="result">
{listData.filter(item => {
if (item.groupNm.includes(filterData)) {
return item
}
return null
}).map(item => {
return (
<div className="list_item List_Codes">
<div className="mainCategory">{item.mainCategory}</div>
<div className="middleCategory">{item.middleCategory}</div>
<div className="kcscCd">{item.kcscCd}</div>
<div className="groupNm">{item.groupNm}<br/><span className={"text-danger"}>{item.rvsnRemark}</span></div>
<div className="Revisionhistory">
<Row className={"justify-content-start"}>
{item.historyList.filter(history => {
return history;
}).map(history => {
let buttonClass = "btn btn-sm docInfoBtn docInfoActive "
let pClass = "yearInfo yearInfoActive";
if(history.docEr === 'E'){
buttonClass += "btn-success "
}else{
buttonClass += "btn-primary "
}
return (
<Col xs={"auto"} className={"px-1"}>
<input type="button"
className={buttonClass}
value={history.docEr==='E'?'제':'개'}
onClick={()=>{
/*window.open("/standardCode/viewer/"+history.kcscCd+":"+history.rvsnYmd.split('T')[0]);*/
}}
/>
<br/>
<p className={pClass}>{history.docYr}</p>
</Col>
)
})}
</Row>
</div>
<div className="fille">
<Row className={"justify-content-start"}>
{item.historyList.filter(history => {
return history;
}).map(history => {
let buttonClass = "btn btn-sm docInfoBtn docInfoActive "
let pClass = "yearInfo yearInfoActive";
if(history.docEr === 'E'){
buttonClass += "btn-success "
}else{
buttonClass += "btn-primary "
}
return (
<Col xs={"auto"} className={"px-1"}>
<input type="button"
className={buttonClass}
value={history.docEr==='E'?'제':'개'}
onClick={()=>{
window.open("/standardCode/viewer/"+history.kcscCd+":"+history.rvsnYmd.split('T')[0]);
}}
/>
<br/>
<p className={pClass}>{history.docYr}</p>
</Col>
)
})}
</Row>
</div>
<div className="star"><AiFillStar/></div>
</div>
)
})}
</div>
)
}
</div>
<StandardCodeListModal size={"lg"} show={show} content={groupSeq} onClose={close} title={"개정이력"}/>
</div>

View File

@ -4,18 +4,34 @@ import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col";
import {Link} from "react-router-dom";
import Button from "react-bootstrap/Button";
import * as EgovNet from "../../../api/egovFetch";
function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){
const [searchCondition, setSearchCondition] = useState({
pageIndex: 1,
tab: Number(param?.substring(0, 2)),
category1: param?.substring(2, 4),
category2: param?.substring(4, 6),
searchWrd: ''
category3: param?.substring(6, 8),
});
const [subTabsVisible, setSubTabsVisible] = useState(false);
function getSelectBoxOption(groupCd, handler){
EgovNet.requestFetch(
'/standardCode/category-option?listCode='+groupCd,
{
method: "GET",
headers: {
'Content-type': 'application/json',
}
},
handler,
function (resp) {
console.log("err response : ", resp);
}
);
}
useEffect(() => {
if(searchCondition.tab){
if(searchCondition.tab !== 10 && searchCondition.tab !== 20){
@ -27,6 +43,23 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){
reloadFunction(searchCondition)
}, [searchCondition]);
useEffect(() => {
if(searchCondition.tab){
getSelectBoxOption(searchCondition.tab, (resp)=>{
debugger
})
}
}, [searchCondition.tab]);
useEffect(() => {
}, [searchCondition.category1]);
useEffect(() => {
}, [searchCondition.category2]);
return (
<>
<div className="condition">

File diff suppressed because it is too large Load Diff

View File

@ -151,19 +151,7 @@ public class StandardCodeController extends BaseController {
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
String tab = tnDocumentInfo.getTab() != null ? tnDocumentInfo.getTab() : "";
String category1 = tnDocumentInfo.getCategory1() != null ? tnDocumentInfo.getCategory1() : "";
String category2 = tnDocumentInfo.getCategory2() != null ? tnDocumentInfo.getCategory2() : "";
String category3 = tnDocumentInfo.getCategory3() != null ? tnDocumentInfo.getCategory3() : "";
Integer categorySeq1 = standardCodeService.selectStandardCodeGroupSeq(tab);
Integer categorySeq2 = standardCodeService.selectStandardCodeGroupSeq(tab + category1);
Integer categorySeq3 = standardCodeService.selectStandardCodeGroupSeq(tab + category1 + category2);
resultMap.put("category1List", standardCodeService.selectStandardCodeCategoryList(categorySeq1));
resultMap.put("category2List", standardCodeService.selectStandardCodeCategoryList(categorySeq2));
resultMap.put("category3List", standardCodeService.selectStandardCodeCategoryList(categorySeq3));
tnDocumentInfo.setListCode(tab + category1 + category2 + category3);
tnDocumentInfo.makeListCode();
resultMap.put("resultList", standardCodeService.selectStandardCodeList(tnDocumentInfo));
resultMap.put("resultCnt", standardCodeService.selectStandardCodeListCnt(tnDocumentInfo));
resultMap.put("user", user);
@ -174,6 +162,28 @@ public class StandardCodeController extends BaseController {
return resultVO;
}
@Operation(
summary = "건설기준코드 검색조건 옵션 조회",
description = "건설기준코드 검색조건 옵션 조회",
tags = {"StandardCodeController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@GetMapping(value = "/category-option")
public ResultVO getCategoryOption(TnDocumentInfo tnDocumentInfo) throws Exception {
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("groupList", standardCodeService.selectTnDocumentGroupToGroupFullCdLike(tnDocumentInfo.getListCode()));
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
resultVO.setResult(resultMap);
return resultVO;
}
@Operation(
summary = "건설기준코드 개정이력 조회",
description = "건설기준코드 개정이력 조회",

View File

@ -10,6 +10,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.List;
@Getter
@Setter
@ -43,5 +44,7 @@ public class TnDocumentCodeList {
private Integer allCnt;
@Transient
private Integer remarkCnt;
@Transient
private List<TnDocumentInfo> historyList;
}

View File

@ -1,5 +1,6 @@
package com.dbnt.kcscbackend.standardCode.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
@ -92,11 +93,16 @@ public class TnDocumentInfo {
@Transient
private String searchWrd;
@Transient
private String tab;
private String tab = "";
@Transient
private String category1;
private String category1 = "";
@Transient
private String category2;
private String category2 = "";
@Transient
private String category3;
private String category3 = "";
@JsonIgnore
public void makeListCode(){
setListCode(getTab()+getCategory1()+getCategory2()+getCategory3());
}
}

View File

@ -20,6 +20,5 @@ public interface StandardCodeMapper {
Integer selectStandardCodeGroupSeq(String groupFullCd);
List<TnDocumentCodeList> selectStandardCodeCategoryList(Integer parentGroupSeq);
}

View File

@ -11,4 +11,6 @@ public interface TnDocumentGroupRepository extends JpaRepository<TnDocumentGroup
@Query(value = "select * from sp_get_tn_document_code_by_tree()", nativeQuery = true)
List<StandardCodeTreeInterface> spGetTnDocumentCodeByTree();
List<TnDocumentGroup> findByGroupFullCdLike(String groupFullCd);
}

View File

@ -2,6 +2,7 @@ package com.dbnt.kcscbackend.standardCode.service;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentCodeList;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentContent;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentGroup;
import com.dbnt.kcscbackend.standardCode.entity.TnDocumentInfo;
import com.dbnt.kcscbackend.standardCode.mapper.StandardCodeMapper;
import com.dbnt.kcscbackend.standardCode.repository.TnDocumentContentRepository;
@ -12,6 +13,7 @@ import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@Service
@ -47,9 +49,13 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
List<TnDocumentCodeList> codeList = standardCodeMapper.selectStandardCodeList(tnDocumentInfo);
List<TnDocumentInfo> historyList = standardCodeMapper.selectStandardCodeHistoryList(tnDocumentInfo);
for(TnDocumentCodeList code: codeList){
List<TnDocumentInfo> tempList = new ArrayList<>();
for(TnDocumentInfo history: historyList){
if(code.getKcscCd().equals(history.getKcscCd())){
tempList.add(history);
}
}
code.setHistoryList(tempList);
}
return codeList;
}
@ -64,6 +70,8 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
public Integer selectStandardCodeGroupSeq(String groupFullCd) { return standardCodeMapper.selectStandardCodeGroupSeq(groupFullCd); }
public List<TnDocumentCodeList> selectStandardCodeCategoryList(Integer parentGroupSeq){ return standardCodeMapper.selectStandardCodeCategoryList(parentGroupSeq); }
public List<TnDocumentGroup> selectTnDocumentGroupToGroupFullCdLike(String groupFullCd) {
return tnDocumentGroupRepository.findByGroupFullCdLike(groupFullCd+"__");
}
}

View File

@ -78,18 +78,6 @@
where group_full_cd = #{groupFullCd}
</select>
<select id="selectStandardCodeCategoryList" parameterType="Integer" resultType="TnDocumentCodeList">
select
group_seq,
group_full_cd,
kcsc_cd,
group_cur_cd,
group_nm,
parent_group_seq
from tn_document_group
where parent_group_seq = #{parentGroupSeq}
</select>
<select id="selectStandardCodeRevisionhistoryList" resultType="TnDocumentInfo">
select tdi.aplcn_bgng_ymd,tdi.doc_file_grp_id,tdi.rvsn_file_grp_id from tn_document_info tdi, tn_document_group tdg
where 1 = 1