diff --git a/egovframe-template-simple-react-contribution/public/assets/images/banner_m_01.png b/egovframe-template-simple-react-contribution/public/assets/images/banner_m_01.png deleted file mode 100644 index 41619c7..0000000 Binary files a/egovframe-template-simple-react-contribution/public/assets/images/banner_m_01.png and /dev/null differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/banner_m_02.png b/egovframe-template-simple-react-contribution/public/assets/images/banner_m_02.png deleted file mode 100644 index 247f7bc..0000000 Binary files a/egovframe-template-simple-react-contribution/public/assets/images/banner_m_02.png and /dev/null differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/banner_w_01.png b/egovframe-template-simple-react-contribution/public/assets/images/banner_w_01.png deleted file mode 100644 index 0b65d27..0000000 Binary files a/egovframe-template-simple-react-contribution/public/assets/images/banner_w_01.png and /dev/null differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/banner_w_02.png b/egovframe-template-simple-react-contribution/public/assets/images/banner_w_02.png deleted file mode 100644 index a53ee85..0000000 Binary files a/egovframe-template-simple-react-contribution/public/assets/images/banner_w_02.png and /dev/null differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/copy.png b/egovframe-template-simple-react-contribution/public/assets/images/copy.png new file mode 100644 index 0000000..f393326 Binary files /dev/null and b/egovframe-template-simple-react-contribution/public/assets/images/copy.png differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/copy2.png b/egovframe-template-simple-react-contribution/public/assets/images/copy2.png new file mode 100644 index 0000000..bc0fb0d Binary files /dev/null and b/egovframe-template-simple-react-contribution/public/assets/images/copy2.png differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/copy3.png b/egovframe-template-simple-react-contribution/public/assets/images/copy3.png new file mode 100644 index 0000000..27bd178 Binary files /dev/null and b/egovframe-template-simple-react-contribution/public/assets/images/copy3.png differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/f-logo.png b/egovframe-template-simple-react-contribution/public/assets/images/f-logo.png new file mode 100644 index 0000000..37742e6 Binary files /dev/null and b/egovframe-template-simple-react-contribution/public/assets/images/f-logo.png differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/logo.png b/egovframe-template-simple-react-contribution/public/assets/images/logo.png new file mode 100644 index 0000000..5821b04 Binary files /dev/null and b/egovframe-template-simple-react-contribution/public/assets/images/logo.png differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/logo_footer_m.png b/egovframe-template-simple-react-contribution/public/assets/images/logo_footer_m.png deleted file mode 100644 index 43efe6a..0000000 Binary files a/egovframe-template-simple-react-contribution/public/assets/images/logo_footer_m.png and /dev/null differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/logo_footer_w.png b/egovframe-template-simple-react-contribution/public/assets/images/logo_footer_w.png deleted file mode 100644 index f153be3..0000000 Binary files a/egovframe-template-simple-react-contribution/public/assets/images/logo_footer_w.png and /dev/null differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/logo_m.png b/egovframe-template-simple-react-contribution/public/assets/images/logo_m.png index 6af6761..a16dd4c 100644 Binary files a/egovframe-template-simple-react-contribution/public/assets/images/logo_m.png and b/egovframe-template-simple-react-contribution/public/assets/images/logo_m.png differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/logo_w.png b/egovframe-template-simple-react-contribution/public/assets/images/logo_w.png deleted file mode 100644 index 12e87f6..0000000 Binary files a/egovframe-template-simple-react-contribution/public/assets/images/logo_w.png and /dev/null differ diff --git a/egovframe-template-simple-react-contribution/public/assets/images/search.png b/egovframe-template-simple-react-contribution/public/assets/images/search.png new file mode 100644 index 0000000..843d049 Binary files /dev/null and b/egovframe-template-simple-react-contribution/public/assets/images/search.png differ diff --git a/egovframe-template-simple-react-contribution/src/components/EgovFooter.jsx b/egovframe-template-simple-react-contribution/src/components/EgovFooter.jsx index 62582ff..cc5dd62 100644 --- a/egovframe-template-simple-react-contribution/src/components/EgovFooter.jsx +++ b/egovframe-template-simple-react-contribution/src/components/EgovFooter.jsx @@ -7,30 +7,36 @@ function EgovFooter() { }else{ return (
+
+
+
건설기준코드
건설기준위원회
정보제공
센터소개
+
건설기준코드 안내 | 건설기준코드 검색 | (구)건설기준 검색
+ 진행현황 | 위원회 일정
+ 공지사항 | Q&A | 수요조사 | 주요행사 | 건설교육안내 | 기술자료 | 보도자료 | 관련사이트 | API서비스 | 영문기준 제공 | 건설기준용어 | 건설기준 연구
+ 인사말 | 연혁 | 홍보자료 | 주요업무 | 찾아오시는길 +
+
+

- - 국가건설 기준센터 - {/* - */} - +

- 대표문의메일 : kcsc@kict.re.kr |
대표전화 : 0000-0000 (000-0000-0000)
- 호환성확인 : 000-0000-0000 | 교육문의 : 0000-0000-0000 + 상호명 : 한국건설기술연구원 | 대표자 : 김병석 | 대표메일 : kcsc@kict.re.kr
+ 사업자등록번호 : 229-82-01135 | 주소 : 경기도 고양시 일산서구 고양대로 283(대화동)

-

Copyright © 2021 Ministry Of The Interior And Safety. All Rights Reserved.

+

Copyright © 2011 KOREA INSTITUTE of CIVIL ENGINEERING and BUILDING TECHNOLOGY. All Rights Reserved.

- - - - - - - - + {/**/} + {/* */} + {/* */} + {/**/} + {/**/} + {/* */} + {/* */} + {/**/}
diff --git a/egovframe-template-simple-react-contribution/src/components/EgovHeader.jsx b/egovframe-template-simple-react-contribution/src/components/EgovHeader.jsx index 2b4ff7a..ef899bb 100644 --- a/egovframe-template-simple-react-contribution/src/components/EgovHeader.jsx +++ b/egovframe-template-simple-react-contribution/src/components/EgovHeader.jsx @@ -71,21 +71,34 @@ function EgovHeader({ loginUser, onChangeLogin }) {

- 국가건설기준센터{/*국가건설기준센터*/} - 국가건설기준센터{/*국가건설기준센터*/} + +
국가건설기준센터
국가건설기준센터 + 국가건설기준센터{/*국가건설기준센터*/}

주메뉴

    -
  • (isActive ? "cur" : "")}>건설기준코드
  • - {/*
  • (isActive ? "cur" : "")}>사이트소개
  • */} -
  • (isActive ? "cur" : "")}>정보마당
  • -
  • (isActive ? "cur" : "")}>고객지원
  • -
  • (isActive ? "cur" : "")}>알림마당
  • - {sessionUserSe ==='ACC_TP01' && -
  • (isActive ? "cur" : "")}>사이트관리
  • - } +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + {/*
  • (isActive ? "cur" : "")}>건설기준코드
  • */} + {/*/!*
  • (isActive ? "cur" : "")}>사이트소개
  • *!/*/} + {/*
  • (isActive ? "cur" : "")}>정보마당
  • */} + {/*
  • (isActive ? "cur" : "")}>고객지원
  • */} + {/*
  • (isActive ? "cur" : "")}>알림마당
  • */} + {/*{sessionUserSe ==='ACC_TP01' &&*/} + {/*
  • (isActive ? "cur" : "")}>사이트관리
  • */} + {/*}*/}
diff --git a/egovframe-template-simple-react-contribution/src/css/layout.css b/egovframe-template-simple-react-contribution/src/css/layout.css index f4781f8..e669895 100644 --- a/egovframe-template-simple-react-contribution/src/css/layout.css +++ b/egovframe-template-simple-react-contribution/src/css/layout.css @@ -5,16 +5,17 @@ body {min-width: 1400px;} .header {position: relative;} .header::after {content: ""; display: block; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: #dedede;} .header > .inner {position: relative; width: 1400px; height: 150px; margin: 0 auto; padding: 0 50px;} -.header h1 {display: inline-block; margin-top: 62px;} +.header h1 {display: inline-block; margin-top: 32px;} .header h1 a, .header h1 img {display: block;} .header .logo .m {display: none;} -.header .user_info {position: absolute; right: 50px; top: 20px; line-height: 30px;} +.header .logo .logotop {display: flex; width: 220px; justify-content: flex-end;} +.header .user_info {position: absolute; right: 50px; top: 10px; line-height: 30px;} .header .user_info .person {display: inline-block; color: #169bd5; font-weight: 500;} .header .user_info .person::before {content: ""; display: inline-block; width: 22px; height: 22px; margin-right: 7px; background: url(css/images/ico_person.png) no-repeat; background-size: contain; vertical-align: -4px;} .header .user_info .btn {margin-left: 14px; padding: 0 20px; border-radius: 15px; color: #fff; font-size: 14px; line-height: 30px; background: #169bd5;} -.header .gnb {position: absolute; left: 430px; top: 78px; width: 920px;} +.header .gnb {position: absolute; left: 430px; top: 50px; width: 920px;} .header .gnb ul {font-size: 0; text-align: center;} .header .gnb ul::after {content: ""; display: block; clear: both;} .header .gnb ul li {float: left;} @@ -22,11 +23,13 @@ body {min-width: 1400px;} .header .gnb ul li a {color: #666; font-size: 20px; font-weight: 700; letter-spacing: -0.25px;} .header .gnb ul li a.cur {color: #222;} -.header .right_a {position: absolute; right: 50px; top: 75px;} +.header .right_a {position: absolute; right: 50px; top: 65px;} .header .right_a .btn {width: 30px; height: 30px; font-size: 0; background: url(css/images/ico_allmenu.png) no-repeat right; background-size: 22px 18px;} .header .right_a .btn.active {background: url(css/images/ico_allmenu_close.png) no-repeat right; background-size: 22px 18px;} .header .right_a .btn.mobile {display: none;} +.header .topsearch {width: 25px; height: 27px; background: url(css/images/ico_search_b.png) no-repeat; margin: 5px;} + /* All menu */ .all_menu {transition: transform .2s ease-in-out, opacity .2s ease-in-out; transform-origin: top; z-index: 10;} .all_menu.Mobile {display: none;} @@ -75,14 +78,18 @@ body {min-width: 1400px;} .location ul li a.home::before {content: ""; display: block; position: absolute; left: 0; top: 3px; width: 14px; height: 13px; background: url(css/images/ico_home.png) no-repeat;} -.footer {position: relative; height: 180px;} +.footer {position: relative; background-color: #2c394b; } +.footer .upper {width: 100%; background-color: #384556; font-size: 12px;} +.footer .upper .up {width: 1400px; margin: 0 auto; padding: 10px 50px; } +.footer .upper .up .left {text-align: right; color: #B4B5B7; font-weight: 700;} +.footer .upper .up .right {color: #96A1AE; } .footer::before {content: ""; display: block; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: #ccc;} .footer .inner {position: relative; width: 1400px; margin: 0 auto; padding: 0 50px;} .footer .inner::after {content: ""; display: block; clear: both;} -.footer h1 {float: left; width: 220px; padding-top: 50px;} +.footer h1 {float: left; width: 220px; padding-top: 20px;} .footer h1 .m {display: none;} -.footer .info {float: left; padding-top: 44px; color: #888; font-size: 16px; line-height: 26px;} -.footer .info .copy {margin-top: 12px;} +.footer .info {float: left; padding: 14px 10px; color: #888; font-size: 13px; } +.footer .info .copy {padding-top: 5px;} .footer .info .m_show {display: none;} .footer .right_col {position: absolute; right: 0; top: 73px; font-size: 0;} .footer .right_col a {display: inline-block; margin-right: 60px; vertical-align: top;} diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/contents/Survey.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/contents/Survey.jsx index 33318a0..c4cad4f 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/contents/Survey.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/contents/Survey.jsx @@ -6,12 +6,15 @@ import URL from 'constants/url'; import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; import * as EgovNet from "../../../api/egovFetch"; import Modal from "react-bootstrap/Modal"; +import SurveyModal from "./survey/SurveyModal"; +import QuestionModal from "./survey/QuestionModal"; function Survey({}) { const [listTag, setListTag] = useState([]); const [show, setShow] = useState(false); + const [modalSize, setModalSize] = useState("md"); const [modalBody, setModalBody] = useState(); const handleClose = () => setShow(false); @@ -34,7 +37,7 @@ function Survey({}) {
{item.svyTitle}
{item.svyStartDt}~{item.svyEndDt}
-
+
@@ -56,9 +59,16 @@ function Survey({}) { ); },[]); - function editSurvey(){ + function editSurvey(item){ handleShow(); - setModalBody(<>); + setModalSize("md") + setModalBody(); + } + + function editSurveyQt(item){ + handleShow(); + setModalSize("xl") + setModalBody(); } useEffect(()=>{ @@ -104,7 +114,7 @@ function Survey({}) {
- + {modalBody}
diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/contents/survey/QuestionModal.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/contents/survey/QuestionModal.jsx new file mode 100644 index 0000000..66e22ad --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/admin/contents/survey/QuestionModal.jsx @@ -0,0 +1,141 @@ +import React, {useEffect, useState} from "react"; +import Modal from "react-bootstrap/Modal"; +import Row from "react-bootstrap/Row"; +import Col from "react-bootstrap/Col"; +import Form from "react-bootstrap/Form"; +import Table from "react-bootstrap/Table"; +import * as EgovNet from "api/egovFetch"; + +function QuestionModal({svySeq}){ + + const [qtTag, setQtTag] = useState([]); + const [itemTag, setItemTag] = useState([]); + + function getSurveyQt(){ + EgovNet.requestFetch( + '/admin/survey/edit-qt?svySeq='+svySeq, + { + method: "GET" + }, + (resp) => { + + const temp = []; + resp.result.qtList.forEach(function (qt, index){ + temp.push( + + selectQt(qt.itemList)}> + + + + ) + }) + setQtTag(temp); + + }, + function (resp) { + console.log("err response : ", resp); + } + ); + } + + function selectQt(itemList){ + const temp = []; + itemList.forEach(function (item, index){ + temp.push( + + + + + + ) + }) + setItemTag(temp); + } + + function addQt(){ + const temp = [...qtTag] + temp.push( + + + + + + ) + setQtTag(temp) + } + + function addItem(){ + const temp = [...itemTag] + temp.push( + + + + + + ) + setItemTag(temp) + } + + function editSurveyQt(e){ + + } + + useEffect(() => { + getSurveyQt() + }, []); + + return ( + <> + + 질문관리 + + + + + + + + + + + + {qtTag} + + + + + + +
질문
+ +
+ + + + + + + + + + {itemTag} + + + + + + +
보기
+ +
+ +
+
+ + + + + ); +} + +export default QuestionModal; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/contents/survey/SurveyModal.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/contents/survey/SurveyModal.jsx new file mode 100644 index 0000000..2858270 --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/admin/contents/survey/SurveyModal.jsx @@ -0,0 +1,107 @@ +import React from "react"; +import Modal from "react-bootstrap/Modal"; +import Form from "react-bootstrap/Form"; +import Row from "react-bootstrap/Row"; +import Col from "react-bootstrap/Col"; +import * as EgovNet from "api/egovFetch"; +import CODE from "constants/code"; + +function SurveyModal({savedInfo, reloadFunction}){ + + function editSurvey(e){ + e.preventDefault(); + e.stopPropagation(); + const form = e.target; + const info = { + menuId: form.menuId.value, + menuTitle: form.menuTitle.value, + menuGroup: form.menuGroup.value, + menuLevel: form.menuLevel.value, + menuSort: form.menuSort.value, + menuUrl: form.menuUrl.value, + menuTypeCd: form.menuTypeCd.value, + } + EgovNet.requestFetch( + '/admin/config/menu-mgt', + { + method: "PUT", + headers: { + 'Content-type': 'application/json' + }, + body: JSON.stringify(info) + }, + (resp) => { + if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { + alert("저장되었습니다.") + reloadFunction(); + }else if(Number(resp.resultCode) === Number(CODE.RCV_ERROR_AUTH)){ + console.log("토큰 갱신중.") + }else{ + alert(resp.resultMessage) + } + } + ) + } + + return ( + <> + + + {savedInfo!==undefined?savedInfo?.svyTitle:'설문 생성'} + + + +
{editSurvey(e)}} noValidate> + + + 제목 + + + + + + + + 설명 + + + + + + + + 시작일 + + + + + + + + 종료일 + + + + + + + + 첨부파일 + + + + + + + + + + + +
+
+ + ); +} + +export default SurveyModal; \ No newline at end of file diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/AdminSurveyController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/AdminSurveyController.java index 56d4c9b..a39ce99 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/AdminSurveyController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/AdminSurveyController.java @@ -1,9 +1,10 @@ package com.dbnt.kcscbackend.admin.contents.survey; +import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurvey; import com.dbnt.kcscbackend.admin.contents.survey.service.AdminSurveyService; import com.dbnt.kcscbackend.auth.entity.LoginVO; import com.dbnt.kcscbackend.config.common.ResultVO; -import com.dbnt.kcscbackend.config.util.ClientUtils; + import lombok.RequiredArgsConstructor; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.RequestMapping; @@ -22,7 +23,7 @@ public class AdminSurveyController { private final AdminSurveyService adminSurveyService; @RequestMapping(method = RequestMethod.GET, value = "/list") - public ResultVO getSurveyList(HttpServletRequest request, @AuthenticationPrincipal LoginVO user) throws Exception{ + public ResultVO getSurveyList() throws Exception{ ResultVO resultVO = new ResultVO(); Map resultMap = new HashMap<>(); @@ -30,4 +31,24 @@ public class AdminSurveyController { resultVO.setResult(resultMap); return resultVO; } + + @RequestMapping(method = RequestMethod.GET, value = "/edit") + public ResultVO surveyEdit(TnSurvey survey) throws Exception{ + + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap<>(); + resultMap.put("survey", adminSurveyService.selectSurvey(survey)); + resultVO.setResult(resultMap); + return resultVO; + } + + @RequestMapping(method = RequestMethod.GET, value = "/edit-qt") + public ResultVO surveyEditQt(TnSurvey survey) throws Exception{ + + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap<>(); + resultMap.put("qtList", adminSurveyService.selectSurveyQt(survey)); + resultVO.setResult(resultMap); + return resultVO; + } } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurveyQt.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurveyQt.java index d37fbfd..28f0041 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurveyQt.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurveyQt.java @@ -6,12 +6,11 @@ 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; -import javax.persistence.Table; +import javax.persistence.*; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; @Getter @Setter @@ -41,4 +40,7 @@ public class TnSurveyQt { private String etcYn; @Column(name = "old_seq") private Integer oldSeq; + + @Transient + private List itemList = new ArrayList<>(); } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtItemRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtItemRepository.java index 6e5e18c..fb2c308 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtItemRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtItemRepository.java @@ -3,5 +3,8 @@ package com.dbnt.kcscbackend.admin.contents.survey.repository; import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQtItem; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + public interface TnSurveyQtItemRepository extends JpaRepository { + List findByQtSeqInOrderByQtItemSeq(List qtSeqList); } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtRepository.java index 15f276d..72d38f2 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtRepository.java @@ -3,5 +3,8 @@ package com.dbnt.kcscbackend.admin.contents.survey.repository; import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQt; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + public interface TnSurveyQtRepository extends JpaRepository { + List findBySvySeqOrderByQtSeq(Integer svySeq); } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/service/AdminSurveyService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/service/AdminSurveyService.java index 56bf02f..8f1531b 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/service/AdminSurveyService.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/service/AdminSurveyService.java @@ -1,12 +1,15 @@ package com.dbnt.kcscbackend.admin.contents.survey.service; import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurvey; +import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQt; +import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQtItem; import com.dbnt.kcscbackend.admin.contents.survey.repository.TnSurveyQtItemRepository; import com.dbnt.kcscbackend.admin.contents.survey.repository.TnSurveyQtRepository; import com.dbnt.kcscbackend.admin.contents.survey.repository.TnSurveyRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; @Service @@ -19,4 +22,25 @@ public class AdminSurveyService { public List selectSurveyList() { return surveyRepository.findAllByOrderBySvySeqDesc(); } + + public TnSurvey selectSurvey(TnSurvey survey) { + return surveyRepository.findById(survey.getSvySeq()).orElse(null); + } + + public List selectSurveyQt(TnSurvey survey) { + List qtList = qtRepository.findBySvySeqOrderByQtSeq(survey.getSvySeq()); + List qtSeqList = new ArrayList<>(); + for(TnSurveyQt qt: qtList){ + qtSeqList.add(qt.getQtSeq()); + } + List itemList = itemRepository.findByQtSeqInOrderByQtItemSeq(qtSeqList); + for(TnSurveyQt qt: qtList){ + for(TnSurveyQtItem item: itemList){ + if(qt.getQtSeq().equals(item.getQtSeq())){ + qt.getItemList().add(item); + } + } + } + return qtList; + } }