diff --git a/egovframe-template-simple-react-contribution/src/css/page.css b/egovframe-template-simple-react-contribution/src/css/page.css index 4413141..f6def02 100644 --- a/egovframe-template-simple-react-contribution/src/css/page.css +++ b/egovframe-template-simple-react-contribution/src/css/page.css @@ -193,6 +193,24 @@ .roleList .result .list_item .checkboxDiv {width: 60px;} .roleList .result .list_item .saveBtnDiv {width: 100px;} + /*사이트 관리 > 컨텐츠 관리 > 설문 관리*/ + .surveyList .head > span:nth-child(1) {width: 250px;} + .surveyList .head > span:nth-child(2) {width: 150px;} + .surveyList .head > span:nth-child(3) {width: 100px;} + .surveyList .head > span:nth-child(4) {width: 100px;} + .surveyList .head > span:nth-child(5) {width: 120px;} + .surveyList .head > span:nth-child(6) {width: 100px;} + .surveyList .head > span:nth-child(7) {width: 80px;} + .surveyList .head > span:nth-child(8) {width: 80px;} + .surveyList .result .list_item > div:nth-child(1) {width: 250px;} + .surveyList .result .list_item > div:nth-child(2) {width: 150px;} + .surveyList .result .list_item > div:nth-child(3) {width: 100px;} + .surveyList .result .list_item > div:nth-child(4) {width: 100px;} + .surveyList .result .list_item > div:nth-child(5) {width: 120px;} + .surveyList .result .list_item > div:nth-child(6) {width: 100px;} + .surveyList .result .list_item > div:nth-child(7) {width: 80px;} + .surveyList .result .list_item > div:nth-child(8) {width: 80px;} + /* 사이트소개 */ .SITE_INTRO .ds_1 .t_1 {margin-top: 52px; color: #000; font-size: 26px; font-weight: 500; text-align: center;} .SITE_INTRO .ds_1 .li_1 {position: relative; margin-top: 34px; font-size: 0; text-align: center;} 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 af66715..33318a0 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 @@ -1,49 +1,112 @@ -import React from 'react'; +import React, {useCallback, useEffect, useState} from 'react'; import { Link } from 'react-router-dom'; 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"; -function Survey(props) { +function Survey({}) { - const Location = React.memo(function Location() { - return ( -
- -
- ) - }); + const [listTag, setListTag] = useState([]); + const [show, setShow] = useState(false); + const [modalBody, setModalBody] = useState(); + + const handleClose = () => setShow(false); + const handleShow = () => setShow(true); + + const retrieveList = useCallback(() => { + handleClose() + EgovNet.requestFetch( + '/admin/survey/list', + { + method: "GET" + }, + (resp) => { + let mutListTag = []; + + setListTag([]); + // 리스트 항목 구성 + resp.result.surveyList.forEach(function (item, index) { + mutListTag.push( +
+
{item.svyTitle}
+
{item.svyStartDt}~{item.svyEndDt}
+
+
+
+
+
+ +
+
+ +
+
+ ); + }); + if(!mutListTag.length) mutListTag.push(

검색된 결과가 없습니다.

); // 게시판 목록 초기값 + setListTag(mutListTag); + }, + function (resp) { + console.log("err response : ", resp); + } + ); + },[]); + + function editSurvey(){ + handleShow(); + setModalBody(<>); + } + + useEffect(()=>{ + retrieveList(); + }, []) return (
- {/* */} - - {/* */} +
+
    +
  • Home
  • +
  • 사이트 관리
  • +
  • 컨텐츠 관리
  • +
  • 설문 관리
  • +
+
- {/* */} - {/* */}
- {/* */}

설문 관리

- 여기에 구현해주세요. - {/* */} +
+
+ 제목 + 참여기한 + 질문관리 + 사용여부 + 설문지 보기 + 통계 보기 + + +
+
+ {listTag} +
+
+ + + {modalBody} +
); } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/AdminConfigController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/AdminConfigController.java index 60e06e0..92412e5 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/AdminConfigController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/config/AdminConfigController.java @@ -1,13 +1,10 @@ package com.dbnt.kcscbackend.admin.config; -import com.dbnt.kcscbackend.admin.boards.entity.TnBbs; import com.dbnt.kcscbackend.admin.config.entity.TcMenu; import com.dbnt.kcscbackend.admin.config.entity.TnPartnerSite; import com.dbnt.kcscbackend.admin.config.model.CreateCommitteeCodeManagementVO; import com.dbnt.kcscbackend.admin.config.model.SetCommitteeCodeManagementVO; import com.dbnt.kcscbackend.admin.config.service.AdminCommitteeCodeManagementService; -import com.dbnt.kcscbackend.admin.contents.popUp.model.UpdatePopupVO; -import com.dbnt.kcscbackend.admin.standardResearch.service.AdminStandardResearchService; import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp; import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem; import com.dbnt.kcscbackend.admin.config.service.AdminConfigService; @@ -22,13 +19,11 @@ 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.springframework.data.domain.Pageable; import org.springframework.http.MediaType; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.validation.Errors; import org.springframework.validation.FieldError; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; 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 new file mode 100644 index 0000000..56d4c9b --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/AdminSurveyController.java @@ -0,0 +1,33 @@ +package com.dbnt.kcscbackend.admin.contents.survey; + +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; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/admin/survey") +public class AdminSurveyController { + + private final AdminSurveyService adminSurveyService; + + @RequestMapping(method = RequestMethod.GET, value = "/list") + public ResultVO getSurveyList(HttpServletRequest request, @AuthenticationPrincipal LoginVO user) throws Exception{ + + ResultVO resultVO = new ResultVO(); + Map resultMap = new HashMap<>(); + resultMap.put("surveyList", adminSurveyService.selectSurveyList()); + resultVO.setResult(resultMap); + return resultVO; + } +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurvey.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurvey.java new file mode 100644 index 0000000..94832e1 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurvey.java @@ -0,0 +1,52 @@ +package com.dbnt.kcscbackend.admin.contents.survey.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; +import javax.persistence.Table; +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "tn_survey") +public class TnSurvey { + @Id + @Column(name = "svy_seq") + private Integer svySeq; + + @Column(name = "svy_title") + private String svyTitle; + @Column(name = "svy_desc") + private String svyDesc; + @Column(name = "svy_start_dt") + private LocalDate svyStartDt; + @Column(name = "svy_end_dt") + private LocalDate svyEndDt; + @Column(name = "file_grp_id") + private String fileGrpId; + @Column(name = "svy_subcnt") + private Integer svySubcnt; + @Column(name = "frst_crt_id") + private String frstCrtId; + @Column(name = "frst_crt_dt") + private LocalDateTime frstCrtDt; + @Column(name = "last_chg_id") + private String lastChgId; + @Column(name = "last_chg_dt") + private LocalDateTime lastChgDt; + @Column(name = "use_yn") + private String useYn; + @Column(name = "old_seq") + private Integer oldSeq; +} 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 new file mode 100644 index 0000000..d37fbfd --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurveyQt.java @@ -0,0 +1,44 @@ +package com.dbnt.kcscbackend.admin.contents.survey.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; +import javax.persistence.Table; +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "tn_survey_qt") +public class TnSurveyQt { + @Id + @Column(name = "qt_seq") + private Integer qtSeq; + + @Column(name = "svy_seq") + private Integer svySeq; + @Column(name = "qt_title") + private String qtTitle; + @Column(name = "qt_desc") + private String qtDesc; + @Column(name = "qt_type") + private Integer qtType; + @Column(name = "max_no") + private Integer maxNo; + @Column(name = "mandatory_yn") + private String mandatoryYn; + @Column(name = "etc_yn") + private String etcYn; + @Column(name = "old_seq") + private Integer oldSeq; +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurveyQtItem.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurveyQtItem.java new file mode 100644 index 0000000..c2e81a4 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/entity/TnSurveyQtItem.java @@ -0,0 +1,34 @@ +package com.dbnt.kcscbackend.admin.contents.survey.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; +import javax.persistence.Table; + +@Getter +@Setter +@Entity +@NoArgsConstructor +@DynamicInsert +@DynamicUpdate +@Table(name = "tn_survey_qt_item") +public class TnSurveyQtItem { + @Id + @Column(name = "qt_item_seq") + private Integer qtItemSeq; + + @Column(name = "qt_seq") + private Integer qtSeq; + @Column(name = "item_nm") + private String itemNm; + @Column(name = "question_yn") + private String questionYn; + @Column(name = "old_seq") + private Integer oldSeq; +} 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 new file mode 100644 index 0000000..6e5e18c --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtItemRepository.java @@ -0,0 +1,7 @@ +package com.dbnt.kcscbackend.admin.contents.survey.repository; + +import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQtItem; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface TnSurveyQtItemRepository extends JpaRepository { +} 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 new file mode 100644 index 0000000..15f276d --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyQtRepository.java @@ -0,0 +1,7 @@ +package com.dbnt.kcscbackend.admin.contents.survey.repository; + +import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQt; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface TnSurveyQtRepository extends JpaRepository { +} diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyRepository.java new file mode 100644 index 0000000..5a8a9a4 --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/repository/TnSurveyRepository.java @@ -0,0 +1,11 @@ +package com.dbnt.kcscbackend.admin.contents.survey.repository; + +import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurvey; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface TnSurveyRepository extends JpaRepository { + + List findAllByOrderBySvySeqDesc(); +} 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 new file mode 100644 index 0000000..56bf02f --- /dev/null +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/survey/service/AdminSurveyService.java @@ -0,0 +1,22 @@ +package com.dbnt.kcscbackend.admin.contents.survey.service; + +import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurvey; +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.List; + +@Service +@RequiredArgsConstructor +public class AdminSurveyService { + private final TnSurveyRepository surveyRepository; + private final TnSurveyQtRepository qtRepository; + private final TnSurveyQtItemRepository itemRepository; + + public List selectSurveyList() { + return surveyRepository.findAllByOrderBySvySeqDesc(); + } +}