Merge branch 'master' of http://118.219.150.34:50501/DBNT/kcscDev into thkim
commit
ac4625a174
|
|
@ -182,14 +182,12 @@
|
||||||
.menuList .result .list_item > div:nth-child(5) {width: 100px;}
|
.menuList .result .list_item > div:nth-child(5) {width: 100px;}
|
||||||
|
|
||||||
/* 사이트관리 > 환경설정 > 메뉴권한관리 */
|
/* 사이트관리 > 환경설정 > 메뉴권한관리 */
|
||||||
.roleList .head > span:nth-child(1) {width: 120px;}
|
.roleList .head > span:nth-child(1) {width: 180px;}
|
||||||
.roleList .head > span:nth-child(2) {width: 180px;}
|
.roleList .head > span:nth-child(2) {width: 120px;}
|
||||||
.roleList .head > span:nth-child(3) {width: 120px;}
|
|
||||||
.roleList .head .checkboxDiv {width: 60px;}
|
.roleList .head .checkboxDiv {width: 60px;}
|
||||||
.roleList .head .saveBtnDiv {width: 100px;}
|
.roleList .head .saveBtnDiv {width: 100px;}
|
||||||
.roleList .result .list_item > div:nth-child(1) {width: 120px;}
|
.roleList .result .list_item > div:nth-child(1) {width: 180px;}
|
||||||
.roleList .result .list_item > div:nth-child(2) {width: 180px;}
|
.roleList .result .list_item > div:nth-child(2) {width: 120px;}
|
||||||
.roleList .result .list_item > div:nth-child(3) {width: 120px;}
|
|
||||||
.roleList .result .list_item .checkboxDiv {width: 60px;}
|
.roleList .result .list_item .checkboxDiv {width: 60px;}
|
||||||
.roleList .result .list_item .saveBtnDiv {width: 100px;}
|
.roleList .result .list_item .saveBtnDiv {width: 100px;}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ function MenuAuthMgt(props) {
|
||||||
// 리스트 항목 구성
|
// 리스트 항목 구성
|
||||||
menuList.forEach(function (item, index) {
|
menuList.forEach(function (item, index) {
|
||||||
const checkboxs = [];
|
const checkboxs = [];
|
||||||
|
|
||||||
roleList.forEach(function (role) {
|
roleList.forEach(function (role) {
|
||||||
checkboxs.push(
|
checkboxs.push(
|
||||||
<div className={"checkboxDiv"}>
|
<div className={"checkboxDiv"}>
|
||||||
|
|
@ -44,12 +45,19 @@ function MenuAuthMgt(props) {
|
||||||
defaultChecked={item.menuAuth.includes(role.itemCd)}/>
|
defaultChecked={item.menuAuth.includes(role.itemCd)}/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
/*if(item.menuGroup){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
checkboxs.push(
|
||||||
|
<div className={"checkboxDiv"}></div>
|
||||||
|
)
|
||||||
|
}*/
|
||||||
});
|
});
|
||||||
|
|
||||||
mutListTag.push(
|
mutListTag.push(
|
||||||
<div className={"list_item"} key={"userListDiv_"+index}>
|
<div className={"list_item"} key={"userListDiv_"+index}>
|
||||||
<div>{item.menuId}</div>
|
<div>{item.menuGroup?'└ ':''}{item.menuId}</div>
|
||||||
<div>{item.menuTitle}</div>
|
<div>{item.menuTitle}</div>
|
||||||
<div>{item.menuGroup}</div>
|
|
||||||
{checkboxs}
|
{checkboxs}
|
||||||
<div className={"saveBtnDiv"}>
|
<div className={"saveBtnDiv"}>
|
||||||
<button className={"btn btn_blue_h31 px-1"} onClick={()=>{editMenu(item)}}>저장</button>
|
<button className={"btn btn_blue_h31 px-1"} onClick={()=>{editMenu(item)}}>저장</button>
|
||||||
|
|
@ -73,7 +81,6 @@ function MenuAuthMgt(props) {
|
||||||
},[]);
|
},[]);
|
||||||
|
|
||||||
function editMenu(menu){
|
function editMenu(menu){
|
||||||
if(window.confirm("수정하시겠습니까?")) {
|
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/menu-auth-mgt',
|
'/admin/config/menu-auth-mgt',
|
||||||
{
|
{
|
||||||
|
|
@ -94,7 +101,6 @@ function MenuAuthMgt(props) {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
retrieveList();
|
retrieveList();
|
||||||
|
|
@ -126,7 +132,6 @@ function MenuAuthMgt(props) {
|
||||||
<div className="head">
|
<div className="head">
|
||||||
<span>메뉴 코드</span>
|
<span>메뉴 코드</span>
|
||||||
<span>메뉴 이름</span>
|
<span>메뉴 이름</span>
|
||||||
<span>부모 메뉴</span>
|
|
||||||
{roleHeader}
|
{roleHeader}
|
||||||
<span className={"saveBtnDiv"}></span>
|
<span className={"saveBtnDiv"}></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import Col from "react-bootstrap/Col";
|
||||||
import Form from "react-bootstrap/Form";
|
import Form from "react-bootstrap/Form";
|
||||||
import Table from "react-bootstrap/Table";
|
import Table from "react-bootstrap/Table";
|
||||||
import * as EgovNet from "api/egovFetch";
|
import * as EgovNet from "api/egovFetch";
|
||||||
|
import CODE from "../../../../constants/code";
|
||||||
|
|
||||||
function QuestionModal({svySeq}){
|
function QuestionModal({svySeq}){
|
||||||
|
|
||||||
|
|
@ -44,12 +45,54 @@ function QuestionModal({svySeq}){
|
||||||
setTempSeq(tempSeq+1);
|
setTempSeq(tempSeq+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addItem(){
|
function qtOptionChange(target, value){
|
||||||
|
const temp = {...selectedQt}
|
||||||
|
temp[target] = value;
|
||||||
|
setSelectedQt(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addItem(){
|
||||||
|
const temp = {...selectedQt}
|
||||||
|
temp.itemList.push({
|
||||||
|
qtItemSeq: null,
|
||||||
|
qtSeq:null,
|
||||||
|
itemNm: null,
|
||||||
|
questionYn:'Y'
|
||||||
|
})
|
||||||
|
setSelectedQt(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeQt(index){
|
||||||
|
const temp = [...qtList]
|
||||||
|
temp.splice(index, 1);
|
||||||
|
setQtList(temp);
|
||||||
|
setSelectedQt(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeItem(index){
|
||||||
|
const temp = {...selectedQt}
|
||||||
|
temp.itemList.splice(index, 1)
|
||||||
|
setSelectedQt(temp)
|
||||||
}
|
}
|
||||||
|
|
||||||
function editSurveyQt(e){
|
function editSurveyQt(e){
|
||||||
|
EgovNet.requestFetch(
|
||||||
|
'/admin/survey/info-qt',
|
||||||
|
{
|
||||||
|
method: "PUT",
|
||||||
|
headers: {
|
||||||
|
'Content-type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify(qtList)
|
||||||
|
},
|
||||||
|
(resp) => {
|
||||||
|
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||||
|
alert("저장되었습니다.")
|
||||||
|
}else{
|
||||||
|
alert(resp.resultMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -60,16 +103,20 @@ function QuestionModal({svySeq}){
|
||||||
const tempQt = [...qtList];
|
const tempQt = [...qtList];
|
||||||
tempQt.forEach(function (qt, index){
|
tempQt.forEach(function (qt, index){
|
||||||
if(qt.qtSeq === null){
|
if(qt.qtSeq === null){
|
||||||
if(qt.tempSeq === selectedQt.tempSeq){
|
if(qt.tempSeq === selectedQt?.tempSeq){
|
||||||
qt = selectedQt;
|
tempQt[index] = selectedQt;
|
||||||
}
|
}
|
||||||
}else if(qt.qtSeq === selectedQt.qtSeq){
|
}else if(qt.qtSeq === selectedQt?.qtSeq){
|
||||||
qt = selectedQt;
|
tempQt[index] = selectedQt;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
setQtList(tempQt);
|
setQtList(tempQt);
|
||||||
}, [selectedQt]);
|
}, [selectedQt]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
}, [qtList]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal.Header closeButton>
|
<Modal.Header closeButton>
|
||||||
|
|
@ -79,17 +126,29 @@ function QuestionModal({svySeq}){
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
<Table>
|
<Table>
|
||||||
|
<colgroup>
|
||||||
|
<col/>
|
||||||
|
<col className={"w_100"}/>
|
||||||
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>질문</th>
|
<th>질문</th>
|
||||||
|
<th>삭제</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{qtList.map(qt=>{
|
{qtList.map((qt, index)=>{
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr onClick={()=>setSelectedQt({...qt})}>
|
||||||
<td>
|
<td>
|
||||||
<Form.Control type={"text"} defaultValue={qt.qtTitle} onClick={()=>{setSelectedQt(qt)}}/>
|
<Form.Control type={"text"} defaultValue={qt.qtTitle} value={qt.qtTitle}
|
||||||
|
onChange={(e)=>{
|
||||||
|
qt.qtTitle = e.target.value
|
||||||
|
setSelectedQt({...qt})
|
||||||
|
}} />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button className={"btn btn_red_h31"} onClick={()=>removeQt(index)}>삭제</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
|
@ -97,7 +156,7 @@ function QuestionModal({svySeq}){
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td colSpan={2}>
|
||||||
<button className={"btn btn_blue_h31"} onClick={addQt}>추가</button>
|
<button className={"btn btn_blue_h31"} onClick={addQt}>추가</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -110,10 +169,38 @@ function QuestionModal({svySeq}){
|
||||||
질문유형
|
질문유형
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
<Col sm={9} key={`inline-radio`} className={'my-auto'}>
|
<Col sm={9} key={`inline-radio`} className={'my-auto'}>
|
||||||
<Form.Check inline label="체크박스" name="qtType" type={'radio'} value={1} checked={selectedQt?.qtType === 1} onClick={()=>{setSelectedQt({...selectedQt, qtType:1})}}/>
|
<Form.Check inline label="체크박스" name="qtType" type={'radio'} value={1}
|
||||||
<Form.Check inline label="라디오버튼" name="qtType" type={'radio'} value={2} checked={selectedQt?.qtType === 2} onClick={()=>{setSelectedQt({...selectedQt, qtType:2})}}/>
|
checked={selectedQt?.qtType === 1} defaultChecked={selectedQt?.qtType === 1}
|
||||||
<Form.Check inline label="직접입력" name="qtType" type={'radio'} value={3} checked={selectedQt?.qtType === 3} onClick={()=>{setSelectedQt({...selectedQt, qtType:3})}}/>
|
onClick={(e)=>{
|
||||||
<Form.Check inline label="이용자만족도" name="qtType" type={'radio'} value={4} checked={selectedQt?.qtType === 4} onClick={()=>{setSelectedQt({...selectedQt, qtType:4})}}/>
|
qtOptionChange("qtType", Number(e.target.value));
|
||||||
|
}}/>
|
||||||
|
<Form.Check inline label="라디오버튼" name="qtType" type={'radio'} value={2}
|
||||||
|
checked={selectedQt?.qtType === 2} defaultChecked={selectedQt?.qtType === 2}
|
||||||
|
onClick={(e)=>{
|
||||||
|
qtOptionChange("qtType", Number(e.target.value));
|
||||||
|
}}/>
|
||||||
|
<Form.Check inline label="직접입력" name="qtType" type={'radio'} value={3}
|
||||||
|
checked={selectedQt?.qtType === 3} defaultChecked={selectedQt?.qtType === 3}
|
||||||
|
onClick={(e)=>{
|
||||||
|
qtOptionChange("qtType", Number(e.target.value));
|
||||||
|
}}/>
|
||||||
|
<Form.Check inline label="이용자만족도" name="qtType" type={'radio'} value={4}
|
||||||
|
checked={selectedQt?.qtType === 4} defaultChecked={selectedQt?.qtType === 4}
|
||||||
|
onClick={(e)=>{
|
||||||
|
qtOptionChange("qtType", Number(e.target.value));
|
||||||
|
}}/>
|
||||||
|
</Col>
|
||||||
|
</Form.Group>
|
||||||
|
<Form.Group as={Row}>
|
||||||
|
<Form.Label column sm={3}>
|
||||||
|
설명
|
||||||
|
</Form.Label>
|
||||||
|
<Col sm={9}>
|
||||||
|
<Form.Control as={"textarea"} rows={3} name="qtDesc"
|
||||||
|
defaultValue={selectedQt?.qtDesc?selectedQt?.qtDesc:''} value={selectedQt?.qtDesc?selectedQt?.qtDesc:''}
|
||||||
|
onChange={(e)=>{
|
||||||
|
qtOptionChange("qtDesc", e.target.value);
|
||||||
|
}}/>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
<Form.Group as={Row} className={`mb-3 ${selectedQt?.qtType!==1?'d-none':''}`}>
|
<Form.Group as={Row} className={`mb-3 ${selectedQt?.qtType!==1?'d-none':''}`}>
|
||||||
|
|
@ -121,19 +208,34 @@ function QuestionModal({svySeq}){
|
||||||
최대 선택 개수
|
최대 선택 개수
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
<Col sm={3}>
|
<Col sm={3}>
|
||||||
<Form.Control type="text" name="maxNo" defaultValue={selectedQt?.maxNo} onChange={(e)=>{setSelectedQt({...selectedQt, maxNo:e.target.value})}}/>
|
<Form.Control type="text" name="maxNo"
|
||||||
|
defaultValue={selectedQt?.maxNo} value={selectedQt?.maxNo}
|
||||||
|
onChange={(e)=>{
|
||||||
|
qtOptionChange("maxNo", e.target.value);
|
||||||
|
}}/>
|
||||||
</Col>
|
</Col>
|
||||||
<Form.Label column sm={'auto'}>
|
<Form.Label column sm={'auto'}>
|
||||||
기타 여부
|
기타 여부
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
<Col sm={3} className={'my-auto'}>
|
<Col sm={3} className={'my-auto'}>
|
||||||
<Form.Check type="checkbox" name="etcYn" checked={selectedQt?.etcYn==='Y'} onClick={(e)=>{setSelectedQt({...selectedQt, etcYn:e.target.checked?'Y':'N'})}}/>
|
<Form.Check type="checkbox" name="etcYn"
|
||||||
|
defaultChecked={selectedQt?.etcYn==='Y'} checked={selectedQt?.etcYn==='Y'}
|
||||||
|
onClick={(e)=>{
|
||||||
|
qtOptionChange("etcYn", e.target.checked?'Y':'N');
|
||||||
|
}}/>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
<Table>
|
<Table className={`mb-3 ${selectedQt?.qtType===3?'d-none':''}`}>
|
||||||
|
<colgroup>
|
||||||
|
<col/>
|
||||||
|
<col className={"w_50"}/>
|
||||||
|
<col className={"w_100"}/>
|
||||||
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>보기</th>
|
<th>보기</th>
|
||||||
|
<th>응답</th>
|
||||||
|
<th>삭제</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -148,13 +250,25 @@ function QuestionModal({svySeq}){
|
||||||
setSelectedQt(qt);
|
setSelectedQt(qt);
|
||||||
}}/>
|
}}/>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<Form.Check type="checkbox" name="questionYn"
|
||||||
|
defaultChecked={item.questionYn==='Y'} checked={item.questionYn==='Y'}
|
||||||
|
onClick={(e)=>{
|
||||||
|
const qt = {...selectedQt}
|
||||||
|
qt.itemList[index].questionYn = e.target.checked?'Y':'N'
|
||||||
|
setSelectedQt(qt);
|
||||||
|
}}/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button className={"btn btn_red_h31"} onClick={()=>removeItem(index)}>삭제</button>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td colSpan={2}>
|
||||||
<button className={"btn btn_blue_h31"} onClick={addItem}>추가</button>
|
<button className={"btn btn_blue_h31"} onClick={addItem}>추가</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -164,7 +278,7 @@ function QuestionModal({svySeq}){
|
||||||
</Row>
|
</Row>
|
||||||
</Modal.Body>
|
</Modal.Body>
|
||||||
<Modal.Footer>
|
<Modal.Footer>
|
||||||
<button type="button" className={"btn btn_blue_h31 px-3"}>저장</button>
|
<button type="button" className={"btn btn_blue_h31 px-3"} onClick={editSurveyQt}>저장</button>
|
||||||
</Modal.Footer>
|
</Modal.Footer>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dbnt.kcscbackend.admin.contents.survey;
|
package com.dbnt.kcscbackend.admin.contents.survey;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurvey;
|
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.service.AdminSurveyService;
|
import com.dbnt.kcscbackend.admin.contents.survey.service.AdminSurveyService;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
||||||
|
|
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -75,7 +77,7 @@ public class AdminSurveyController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/info-qt")
|
@RequestMapping(method = RequestMethod.GET, value = "/info-qt")
|
||||||
public ResultVO surveyEditQt(TnSurvey survey) throws Exception{
|
public ResultVO surveyQt(TnSurvey survey) throws Exception{
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
|
@ -83,4 +85,15 @@ public class AdminSurveyController {
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(method = RequestMethod.PUT, value = "/info-qt")
|
||||||
|
public ResultVO surveyQtEdit(@RequestBody List<TnSurveyQt> qtList, @AuthenticationPrincipal LoginVO user) throws Exception{
|
||||||
|
ResultVO resultVO = new ResultVO();
|
||||||
|
|
||||||
|
adminSurveyService.insertSurveyQt(qtList, user.getId());
|
||||||
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
|
resultVO.setResultMessage("저장 되었습니다.");
|
||||||
|
|
||||||
|
return resultVO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,5 @@ import java.util.List;
|
||||||
|
|
||||||
public interface TnSurveyQtItemRepository extends JpaRepository<TnSurveyQtItem, Integer> {
|
public interface TnSurveyQtItemRepository extends JpaRepository<TnSurveyQtItem, Integer> {
|
||||||
List<TnSurveyQtItem> findByQtSeqInOrderByQtItemSeq(List<Integer> qtSeqList);
|
List<TnSurveyQtItem> findByQtSeqInOrderByQtItemSeq(List<Integer> qtSeqList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@ import java.util.List;
|
||||||
|
|
||||||
public interface TnSurveyQtRepository extends JpaRepository<TnSurveyQt, Integer> {
|
public interface TnSurveyQtRepository extends JpaRepository<TnSurveyQt, Integer> {
|
||||||
List<TnSurveyQt> findBySvySeqOrderByQtSeq(Integer svySeq);
|
List<TnSurveyQt> findBySvySeqOrderByQtSeq(Integer svySeq);
|
||||||
|
|
||||||
|
void deleteBySvySeq(Integer svySeq);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,4 +77,20 @@ public class AdminSurveyService {
|
||||||
public void deleteSurvey(Integer svySeq) {
|
public void deleteSurvey(Integer svySeq) {
|
||||||
surveyRepository.deleteById(svySeq);
|
surveyRepository.deleteById(svySeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void insertSurveyQt(List<TnSurveyQt> qtList, String id) {
|
||||||
|
qtRepository.deleteBySvySeq(qtList.get(0).getSvySeq());
|
||||||
|
for(TnSurveyQt qt: qtList){
|
||||||
|
qt.setQtSeq(null);
|
||||||
|
}
|
||||||
|
qtRepository.saveAll(qtList);
|
||||||
|
for(TnSurveyQt qt: qtList){
|
||||||
|
for(TnSurveyQtItem item: qt.getItemList()){
|
||||||
|
item.setQtSeq(qt.getQtSeq());
|
||||||
|
}
|
||||||
|
itemRepository.saveAll(qt.getItemList());
|
||||||
|
}
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,8 @@ public class CustomUrlAuthenticationSuccessHandler extends SimpleUrlAuthenticati
|
||||||
MediaType jsonMimeType = MediaType.APPLICATION_JSON;
|
MediaType jsonMimeType = MediaType.APPLICATION_JSON;
|
||||||
HashMap<String, Object> resultMap = new HashMap<>();
|
HashMap<String, Object> resultMap = new HashMap<>();
|
||||||
|
|
||||||
|
/*
|
||||||
|
// 관리자 계정 로그인 제한 if문
|
||||||
if(securityUser.getUserId().equals("admin") && !adminIpList.contains(accessIp)){
|
if(securityUser.getUserId().equals("admin") && !adminIpList.contains(accessIp)){
|
||||||
resultMap.put("resultCode", ResponseCode.FAILED.getCode());
|
resultMap.put("resultCode", ResponseCode.FAILED.getCode());
|
||||||
resultMap.put("resultMessage", "관리자 계정은 지정된 아이피에서만 접속할 수 있습니다.\n필요한 경우 관리자에게 요청하십시오.\n접속자 아이피: "+ClientUtils.getRemoteIP(request));
|
resultMap.put("resultMessage", "관리자 계정은 지정된 아이피에서만 접속할 수 있습니다.\n필요한 경우 관리자에게 요청하십시오.\n접속자 아이피: "+ClientUtils.getRemoteIP(request));
|
||||||
|
|
@ -74,16 +76,16 @@ public class CustomUrlAuthenticationSuccessHandler extends SimpleUrlAuthenticati
|
||||||
resultMap.put("refreshToken", refreshToken);
|
resultMap.put("refreshToken", refreshToken);
|
||||||
//로그인 로그 기록
|
//로그인 로그 기록
|
||||||
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
|
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
|
||||||
}
|
}*/
|
||||||
/*
|
|
||||||
// 로그인 제한 해제시 주석 해제 및 위 if문 주석처리 할 것.
|
// 관리자 로그인 제한 해제 위 if문 주석처리 할 것.
|
||||||
String accessToken = jwtTokenUtil.generateAccessToken(securityUser, request.getRemoteAddr());
|
String accessToken = jwtTokenUtil.generateAccessToken(securityUser, request.getRemoteAddr());
|
||||||
String refreshToken = jwtTokenUtil.generateRefreshTokenToken(securityUser, request.getRemoteAddr());
|
String refreshToken = jwtTokenUtil.generateRefreshTokenToken(securityUser, request.getRemoteAddr());
|
||||||
resultMap.put("resultCode", ResponseCode.SUCCESS.getCode());
|
resultMap.put("resultCode", ResponseCode.SUCCESS.getCode());
|
||||||
resultMap.put("accessToken", accessToken);
|
resultMap.put("accessToken", accessToken);
|
||||||
resultMap.put("refreshToken", refreshToken);
|
resultMap.put("refreshToken", refreshToken);
|
||||||
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
|
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
|
||||||
*/
|
|
||||||
|
|
||||||
if (jsonConverter.canWrite(resultMap.getClass(), jsonMimeType)) {
|
if (jsonConverter.canWrite(resultMap.getClass(), jsonMimeType)) {
|
||||||
jsonConverter.write(resultMap, jsonMimeType, new ServletServerHttpResponse(response));
|
jsonConverter.write(resultMap, jsonMimeType, new ServletServerHttpResponse(response));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue