Compare commits
9 Commits
6601e744c4
...
a5bb7fdaa9
| Author | SHA1 | Date |
|---|---|---|
|
|
a5bb7fdaa9 | |
|
|
2944f9d95e | |
|
|
5677e0dfe9 | |
|
|
f6d0399f82 | |
|
|
1a656c8f6d | |
|
|
6c3aa18b94 | |
|
|
8013ce1456 | |
|
|
4f85ca9bf5 | |
|
|
b2cedd163f |
|
|
@ -139,9 +139,9 @@ function SchedulesDetail(props) {
|
|||
|
||||
{/* <!-- 버튼영역 --> */}
|
||||
<div className="board_btn_area">
|
||||
{user.id &&
|
||||
{user.id || true &&
|
||||
<div className="left_col btn1">
|
||||
<Link to={{pathname: URL.ADMIN_SCHEDULE_MODIFY}}
|
||||
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__MODIFY}}
|
||||
state={{
|
||||
schdulId: location.state?.schdulId
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -147,19 +147,41 @@ function SchedulesEdit(props) {
|
|||
setScheduleInit(
|
||||
resp
|
||||
);
|
||||
|
||||
if (modeInfo.mode === CODE.MODE_CREATE) {// 조회/등록이면 조회 안함
|
||||
setScheduleDetail({
|
||||
...scheduleDetail,
|
||||
schdulBgnde: location.state.iUseDate,
|
||||
schdulEndde: location.state.iUseDate,
|
||||
startDate: convertDate(location.state.iUseDate),
|
||||
endDate: convertDate(location.state.iUseDate),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const retrieveDetailURL = `/schedule/${location.state?.schdulId}`;
|
||||
const requestOptions = {
|
||||
method: "GET",
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
}
|
||||
}
|
||||
EgovNet.requestFetch(retrieveDetailURL,
|
||||
requestOptions,
|
||||
function (resp) {
|
||||
|
||||
let rawScheduleDetail = resp.result;
|
||||
//기본값 설정
|
||||
setScheduleDetail({
|
||||
...scheduleDetail,
|
||||
...rawScheduleDetail,
|
||||
startDate: convertDate(rawScheduleDetail.schdulBgnde),
|
||||
endDate: convertDate(rawScheduleDetail.schdulEndde),
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
if (modeInfo.mode === CODE.MODE_CREATE) {// 조회/등록이면 조회 안함
|
||||
setScheduleDetail({
|
||||
...scheduleDetail,
|
||||
schdulBgnde: location.state.iUseDate,
|
||||
schdulEndde: location.state.iUseDate,
|
||||
startDate: convertDate(location.state.iUseDate),
|
||||
endDate: convertDate(location.state.iUseDate),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -243,6 +265,11 @@ function SchedulesEdit(props) {
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(function () {
|
||||
console.log("------------------------------EgovAdminScheduleEdit [%o]", scheduleDetail);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scheduleDetail]);
|
||||
|
||||
useEffect(function () {
|
||||
|
||||
EgovNet.requestFetch(`/schedule/api/org-api/depth/list?paramCodeGroup=${scheduleDetail.upCommittee}`,
|
||||
|
|
@ -253,7 +280,7 @@ function SchedulesEdit(props) {
|
|||
);
|
||||
}
|
||||
);
|
||||
|
||||
console.log("------------------------------EgovAdminScheduleEdit [%o]", scheduleDetail);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scheduleDetail && scheduleDetail.upCommittee]);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {Link} from "react-router-dom";
|
|||
import URL from "constants/url";
|
||||
import * as EgovNet from "api/egovFetch";
|
||||
import Form from "react-bootstrap/Form";
|
||||
import CODE from "../../../constants/code";
|
||||
|
||||
|
||||
function MenuAuthMgt(props) {
|
||||
|
|
@ -28,8 +29,21 @@ function MenuAuthMgt(props) {
|
|||
// 리스트 항목 구성
|
||||
menuList.forEach(function (item, index) {
|
||||
const checkboxs = [];
|
||||
roleList.forEach(function (item, index) {
|
||||
checkboxs.push(<div><Form.Check /></div>)
|
||||
roleList.forEach(function (role) {
|
||||
checkboxs.push(
|
||||
<div>
|
||||
<Form.Check className={role.itemCd} value={role.itemCd}
|
||||
onClick={(e)=>{
|
||||
const checked = e.target.checked;
|
||||
if(checked) {
|
||||
item.menuAuth += ","+role.itemCd
|
||||
}else{
|
||||
item.menuAuth = item.menuAuth.replace(","+role.itemCd, '');
|
||||
}
|
||||
}}
|
||||
defaultChecked={item.menuAuth.includes(role.itemCd)}/>
|
||||
</div>
|
||||
)
|
||||
});
|
||||
mutListTag.push(
|
||||
<div className={"list_item"} key={"userListDiv_"+index}>
|
||||
|
|
@ -59,7 +73,27 @@ function MenuAuthMgt(props) {
|
|||
},[]);
|
||||
|
||||
function editMenu(menu){
|
||||
|
||||
if(window.confirm("수정하시겠습니까?")) {
|
||||
EgovNet.requestFetch(
|
||||
'/admin/config/menu-auth-mgt',
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(menu)
|
||||
},
|
||||
(resp) => {
|
||||
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||
alert("수정되었습니다.")
|
||||
} else if (Number(resp.resultCode) === Number(CODE.RCV_ERROR_AUTH)) {
|
||||
console.log("토큰 갱신중.")
|
||||
} else {
|
||||
alert(resp.result.resultMessage)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ function EgovAdminScheduleList(props) {
|
|||
});
|
||||
|
||||
useEffect(() => {
|
||||
retrieveList(searchCondition);
|
||||
//retrieveList(searchCondition); disabled by thkim
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [searchCondition]);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.dbnt.kcscbackend.admin.committee.schedules.controller;
|
|||
|
||||
|
||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.UpdateScheduleVO;
|
||||
import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovIndvdlSchdulManageService;
|
||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
||||
|
|
@ -95,6 +96,86 @@ public class SchedulesApiController {
|
|||
return resultVO;
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "'위원회 일정 등록' 페이지에서 일정 수정하는 API",
|
||||
description = "관리자 단에서 '위원회 관리' > '위원회 일정 관리'에 특정 일정을 누른 후, '수정' > '저장' 버튼을 누르면 해당 일정을 수정하는 API",
|
||||
tags = {"SchedulesApiController"}
|
||||
)
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||
})
|
||||
@PutMapping(value = "/schedule/{scheduleId}")
|
||||
public ResultVO updateSchedule
|
||||
(
|
||||
@AuthenticationPrincipal LoginVO user,
|
||||
HttpServletRequest request,
|
||||
UpdateScheduleVO updateScheduleVO,
|
||||
@PathVariable("scheduleId") Long scheduleId
|
||||
) throws Exception {
|
||||
|
||||
ResultVO resultVO = new ResultVO();
|
||||
|
||||
try {
|
||||
resultVO = egovIndvdlSchdulManageService.updateSchedule(resultVO, request, updateScheduleVO);
|
||||
} catch (Exception e) {
|
||||
resultVO.setResultCode(-1);
|
||||
resultVO.setResultMessage(e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " OUT:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"resultVO.toString():" + "\n" +
|
||||
resultVO.toString() + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "'위원회 일정 등록' 페이지에서 일정 삭제하는 API",
|
||||
description = "관리자 단에서 '위원회 관리' > '위원회 일정 관리'에서 특정 일정을 삭제하는 API",
|
||||
tags = {"SchedulesApiController"}
|
||||
)
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||
})
|
||||
@DeleteMapping(value = "/schedule/{scheduleId}")
|
||||
public ResultVO deleteSchedule
|
||||
(
|
||||
@AuthenticationPrincipal LoginVO user,
|
||||
HttpServletRequest request,
|
||||
@PathVariable("scheduleId") String schdulId
|
||||
) throws Exception {
|
||||
|
||||
ResultVO resultVO = new ResultVO();
|
||||
Long test = Long.valueOf(schdulId);
|
||||
try {
|
||||
resultVO = egovIndvdlSchdulManageService.deleteSchedule(resultVO, request, test);
|
||||
} catch (Exception e) {
|
||||
resultVO.setResultCode(-1);
|
||||
resultVO.setResultMessage(e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " OUT:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"resultVO.toString():" + "\n" +
|
||||
resultVO.toString() + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "일정 상세조회",
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import java.time.LocalDateTime;
|
|||
public class CreateScheduleVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6544623713351174876L;
|
||||
|
||||
@ApiModelProperty(value = "eventId")
|
||||
private Integer eventId;
|
||||
@ApiModelProperty(value = "startDate")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package com.dbnt.kcscbackend.admin.committee.schedules.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel(value = "createScheduleVO", description =
|
||||
"관리자 단에서 '위원회 관리' > '위원회 일정 관리'에서 일정을 수정할 때 사용된다." + ""
|
||||
)
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class UpdateScheduleVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4730156840930491646L;
|
||||
|
||||
@ApiModelProperty(value = "startDate")
|
||||
private String startDate;
|
||||
@ApiModelProperty(value = "endDate")
|
||||
private String endDate;
|
||||
@ApiModelProperty(value = "eventId")
|
||||
private Integer eventId;
|
||||
@ApiModelProperty(value = "upCommitteeNm")
|
||||
private String upCommitteeNm;
|
||||
@ApiModelProperty(value = "committee")
|
||||
private Integer committee;
|
||||
@ApiModelProperty(value = "committeeNm")
|
||||
private String committeeNm;
|
||||
@ApiModelProperty(value = "divMeet")
|
||||
private String divMeet;
|
||||
@ApiModelProperty(value = "title")
|
||||
private String title;
|
||||
@ApiModelProperty(value = "divMeetNm")
|
||||
private String divMeetNm;
|
||||
@ApiModelProperty(value = "schdulEndde")
|
||||
private String schdulEndde;
|
||||
@ApiModelProperty(value = "evtSeq")
|
||||
private Integer evtSeq;
|
||||
@ApiModelProperty(value = "contents")
|
||||
private String contents;
|
||||
@ApiModelProperty(value = "upCommittee")
|
||||
private Integer upCommittee;
|
||||
@ApiModelProperty(value = "location")
|
||||
private String location;
|
||||
@ApiModelProperty(value = "schdulBgnde")
|
||||
private String schdulBgnde;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.dbnt.kcscbackend.admin.committee.schedules.service;
|
|||
|
||||
|
||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.UpdateScheduleVO;
|
||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
|
|
@ -34,6 +35,10 @@ public interface EgovIndvdlSchdulManageService {
|
|||
public ResultVO scheduleApiOrgApiDepthList(ResultVO resultVO, Long paramCodeGroup) throws Exception;
|
||||
|
||||
public ResultVO createSchedule(ResultVO resultVO, HttpServletRequest request, CreateScheduleVO createScheduleVO) throws Exception;
|
||||
public ResultVO updateSchedule(ResultVO resultVO, HttpServletRequest request, UpdateScheduleVO updateScheduleVO) throws Exception;
|
||||
public ResultVO deleteSchedule(ResultVO resultVO, HttpServletRequest request, Long scheduleId) throws Exception;
|
||||
|
||||
|
||||
|
||||
public ResultVO scheduleDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long scheduleId) throws Exception;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.dbnt.kcscbackend.admin.committee.schedules.service.impl;
|
|||
|
||||
|
||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.CreateScheduleVO;
|
||||
import com.dbnt.kcscbackend.admin.committee.schedules.model.UpdateScheduleVO;
|
||||
import com.dbnt.kcscbackend.admin.committee.schedules.service.EgovIndvdlSchdulManageService;
|
||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
||||
|
|
@ -149,6 +150,81 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultVO updateSchedule(ResultVO resultVO, HttpServletRequest request, UpdateScheduleVO updateScheduleVO) throws Exception {
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"updateScheduleVO:" + "\n" +
|
||||
updateScheduleVO.toString() + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
|
||||
Map<String, Object> response = tnCmtEventRepository.spUpdateTnCmtEvent(
|
||||
updateScheduleVO.getEvtSeq(),
|
||||
updateScheduleVO.getDivMeet(), // 구분
|
||||
updateScheduleVO.getUpCommittee(), // 심의위원회 상위 코드 번호
|
||||
updateScheduleVO.getCommittee(), // 심의위원회 하위 코드 번호
|
||||
updateScheduleVO.getTitle(), // 제목
|
||||
updateScheduleVO.getLocation(), // 장소
|
||||
updateScheduleVO.getContents(), // 내용
|
||||
updateScheduleVO.getStartDate(), // 날짜/시간의 시작 일시
|
||||
updateScheduleVO.getEndDate(), // 날짜/시간의 종료 일시
|
||||
"admin",
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
|
||||
Map<String, Object> dto = new HashMap<String, Object>();
|
||||
dto.put("errorMessage", response.get("_error_message") );
|
||||
dto.put("schdulId", updateScheduleVO.getEvtSeq() );
|
||||
|
||||
resultVO.setResult(dto);
|
||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultVO deleteSchedule(ResultVO resultVO, HttpServletRequest request, Long scheduleId) throws Exception {
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"scheduleId:" + "\n" +
|
||||
scheduleId + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
|
||||
Map<String, Object> response = tnCmtEventRepository.spDeleteTnCmtEvent(
|
||||
scheduleId.intValue(),
|
||||
"admin",
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
|
||||
Map<String, Object> dto = new HashMap<String, Object>();
|
||||
dto.put("errorMessage", response.get("_error_message") );
|
||||
dto.put("schdulId", scheduleId );
|
||||
|
||||
resultVO.setResult(dto);
|
||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ResultVO scheduleDetail(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long scheduleId) throws Exception {
|
||||
|
||||
|
|
@ -168,23 +244,28 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
|||
throw new Exception("대상이 존재하지 않습니다.");
|
||||
}
|
||||
|
||||
TnCmtEvent tnCmtEvent = tnCmtEventRepository.findByEvtSeq(scheduleId);
|
||||
TnCmtEvent tnCmtEvent = tnCmtEventRepository.findByEvtSeq(scheduleId);
|
||||
|
||||
TcCodeItem tcCodeItem = tcCodeItemRepository.findByItemCdAndUseYn(tnCmtEvent.getEvtType(), "Y");
|
||||
TcCodeItem tcCodeItem = tcCodeItemRepository.findByItemCdAndUseYn(tnCmtEvent.getEvtType(), "Y");
|
||||
|
||||
TnCmtOrg tnCmtOrgForUpCommitteeNm = tnCmtOrgRepository.findByUseYnAndCmtSeq("Y", tnCmtEvent.getUpCmtSeq());
|
||||
TnCmtOrg tnCmtOrgForCommitteeNm = tnCmtOrgRepository.findByUseYnAndCmtSeq("Y", tnCmtEvent.getCmtSeq());
|
||||
TnCmtOrg tnCmtOrgForUpCommitteeNm = tnCmtOrgRepository.findByUseYnAndCmtSeq("Y", tnCmtEvent.getUpCmtSeq());
|
||||
TnCmtOrg tnCmtOrgForCommitteeNm = tnCmtOrgRepository.findByUseYnAndCmtSeq("Y", tnCmtEvent.getCmtSeq());
|
||||
|
||||
Map<String, Object> dto = new HashMap<String, Object>();
|
||||
dto.put("evtSeq", tnCmtEvent.getEvtSeq()); // sequence
|
||||
dto.put("divMeetNm", tcCodeItem.getItemNm()); // 구분
|
||||
dto.put("upCommitteeNm", tnCmtOrgForUpCommitteeNm.getCmtNm()); // 심의위원회 상위 이름
|
||||
dto.put("committeeNm", tnCmtOrgForCommitteeNm.getCmtNm()); // 심의위원회 하위 이름
|
||||
dto.put("title", tnCmtEvent.getEvtTitle()); // 제목
|
||||
dto.put("location", tnCmtEvent.getEvtLocation()); // 장소
|
||||
dto.put("contents", tnCmtEvent.getEvtContents()); // 내용
|
||||
dto.put("startDate", tnCmtEvent.getEvtStartDt().plusHours(9)); // 날짜/시간의 시작 일시
|
||||
dto.put("endDate", tnCmtEvent.getEvtEndDt().plusHours(9)); // 날짜/시간의 종료 일시
|
||||
Map<String, Object> dto = new HashMap<String, Object>();
|
||||
dto.put("evtSeq", tnCmtEvent.getEvtSeq()); // sequence
|
||||
dto.put("divMeetNm", tcCodeItem.getItemNm()); // 구분 명
|
||||
dto.put("divMeet", tnCmtEvent.getEvtType()); // 구분 코드
|
||||
dto.put("upCommittee", tnCmtEvent.getUpCmtSeq()); // 심의위원회 상위 코드
|
||||
dto.put("upCommitteeNm", tnCmtOrgForUpCommitteeNm.getCmtNm()); // 심의위원회 상위 이름
|
||||
dto.put("committee", tnCmtEvent.getCmtSeq()); // 심의위원회 하위 코드
|
||||
dto.put("committeeNm", tnCmtOrgForCommitteeNm.getCmtNm()); // 심의위원회 하위 이름
|
||||
dto.put("title", tnCmtEvent.getEvtTitle()); // 제목
|
||||
dto.put("location", tnCmtEvent.getEvtLocation()); // 장소
|
||||
dto.put("contents", tnCmtEvent.getEvtContents()); // 내용
|
||||
dto.put("startDate", tnCmtEvent.getEvtStartDt().plusHours(9)); // 날짜/시간의 시작 일시
|
||||
dto.put("endDate", tnCmtEvent.getEvtEndDt().plusHours(9)); // 날짜/시간의 종료 일시
|
||||
dto.put("schdulBgnde", tnCmtEvent.getEvtStartDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 시작 일시 - yyyyMMddHHmmss
|
||||
dto.put("schdulEndde", tnCmtEvent.getEvtEndDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 종료 일시
|
||||
|
||||
// 문자열로 리턴하도록 수정해야 함.
|
||||
|
||||
|
|
@ -251,8 +332,8 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
|||
.stream()
|
||||
.map(item -> {
|
||||
Map<String, Object> mapDto = new HashMap<>();
|
||||
mapDto.put("evt_start_dt", item.getEvtStartDt().format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSS")));
|
||||
mapDto.put("evt_end_dt", item.getEvtEndDt().format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSS")));
|
||||
mapDto.put("evt_start_dt", item.getEvtStartDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSS")));
|
||||
mapDto.put("evt_end_dt", item.getEvtEndDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSS")));
|
||||
mapDto.put("schdulId", item.getEvtSeq());
|
||||
mapDto.put("schdulNm", item.getEvtTitle());
|
||||
|
||||
|
|
|
|||
|
|
@ -318,10 +318,36 @@ public class AdminConfigController extends BaseController {
|
|||
public ResultVO getMenuAuthMgt(){
|
||||
ResultVO resultVO = new ResultVO();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("menuList", adminConfigService.selectMenuList());
|
||||
resultMap.put("menuList", adminConfigService.selectMenuAuthList());
|
||||
resultMap.put("roleList", commonCodeService.selectCodeItemList("ROLE"));
|
||||
resultVO.setResult(resultMap);
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "메뉴 권한 수정",
|
||||
description = "메뉴 권한 수정",
|
||||
tags = {"AdminConfigController"}
|
||||
)
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "수정 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||
})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/menu-auth-mgt")
|
||||
public ResultVO editMenuAuthMgt(@RequestBody TcMenu menu, @AuthenticationPrincipal LoginVO user){
|
||||
ResultVO resultVO = new ResultVO();
|
||||
if(user == null){
|
||||
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
|
||||
}else {
|
||||
if (!user.getUserSe().equals("ACC_TP01")) {
|
||||
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
|
||||
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
|
||||
} else {
|
||||
adminConfigService.editMenuAuth(menu);
|
||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||
}
|
||||
}
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package com.dbnt.kcscbackend.admin.config.entity;
|
||||
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "tb_menu_role")
|
||||
@IdClass(TbMenuRole.TbMenuRoleId.class)
|
||||
public class TbMenuRole {
|
||||
@Id
|
||||
@Column(name = "role_id")
|
||||
private String roleId;
|
||||
@Id
|
||||
@Column(name = "menu_id")
|
||||
private String menuId;
|
||||
@Column(name = "write_yn")
|
||||
private String writeYn;
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class TbMenuRoleId implements Serializable {
|
||||
private String roleId;
|
||||
private String menuId;
|
||||
}
|
||||
}
|
||||
|
|
@ -55,4 +55,7 @@ public class TcMenu {
|
|||
|
||||
@Transient
|
||||
private String menuTypeValue;
|
||||
|
||||
@Transient
|
||||
private String menuAuth;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,5 @@ public interface TcMenuMapper {
|
|||
|
||||
List<TcMenu> selectMenuList();
|
||||
|
||||
List<TcMenu> selectMenuAuthList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.dbnt.kcscbackend.admin.config.repository;
|
||||
|
||||
import com.dbnt.kcscbackend.admin.config.entity.TbMenuRole;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbMenuRoleRepository extends JpaRepository<TbMenuRole, TbMenuRole.TbMenuRoleId> {
|
||||
|
||||
void deleteByMenuId(String menuId);
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
package com.dbnt.kcscbackend.admin.config.service;
|
||||
|
||||
import com.dbnt.kcscbackend.admin.config.entity.TbMenuRole;
|
||||
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
||||
import com.dbnt.kcscbackend.admin.config.mapper.TcMenuMapper;
|
||||
import com.dbnt.kcscbackend.admin.config.repository.TbMenuRoleRepository;
|
||||
import com.dbnt.kcscbackend.admin.config.repository.TcMenuRepository;
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp;
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
||||
|
|
@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
|
@ -22,6 +25,7 @@ public class AdminConfigService extends EgovAbstractServiceImpl {
|
|||
private final TcCodeGrpRepository codeGrpRepository;
|
||||
private final TcCodeItemRepository codeItemRepository;
|
||||
private final TcMenuRepository menuRepository;
|
||||
private final TbMenuRoleRepository menuRoleRepository;
|
||||
private final TcMenuMapper menuMapper;
|
||||
|
||||
public List<TcCodeGrp> selectCodeGrpList(){
|
||||
|
|
@ -140,4 +144,25 @@ public class AdminConfigService extends EgovAbstractServiceImpl {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public List<TcMenu> selectMenuAuthList(){
|
||||
return menuMapper.selectMenuAuthList();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void editMenuAuth(TcMenu menu) {
|
||||
String[] roleAry = menu.getMenuAuth().split(",");
|
||||
menuRoleRepository.deleteByMenuId(menu.getMenuId());
|
||||
List<TbMenuRole> roleList = new ArrayList<>();
|
||||
for(String role: roleAry){
|
||||
if(!role.isEmpty()){
|
||||
TbMenuRole menuRole = new TbMenuRole();
|
||||
menuRole.setMenuId(menu.getMenuId());
|
||||
menuRole.setRoleId(role);
|
||||
menuRole.setWriteYn("Y");
|
||||
roleList.add(menuRole);
|
||||
}
|
||||
}
|
||||
menuRoleRepository.saveAll(roleList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,61 @@ public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEve
|
|||
);
|
||||
|
||||
|
||||
@Query(value = "CALL sp_update_tn_cmt_event (" +
|
||||
":_evt_seq, " +
|
||||
":_evt_type, " +
|
||||
":_up_cmt_seq, " +
|
||||
":_cmt_seq, " +
|
||||
":_evt_title, " +
|
||||
":_evt_location, " +
|
||||
":_evt_contents, " +
|
||||
"TO_TIMESTAMP(" +
|
||||
" :_evt_start_dt," +
|
||||
" 'YYYY-MM-DD HH24:MI:SS'" +
|
||||
")::::timestamptz AT TIME ZONE 'UTC', " +
|
||||
"TO_TIMESTAMP(" +
|
||||
" :_evt_end_dt," +
|
||||
" 'YYYY-MM-DD HH24:MI:SS'" +
|
||||
")::::timestamptz AT TIME ZONE 'UTC', " +
|
||||
":_modi_id, " +
|
||||
":_result_count, " +
|
||||
":_result_code, " +
|
||||
":_error_message)",
|
||||
nativeQuery = true)
|
||||
Map<String, Object> spUpdateTnCmtEvent(
|
||||
@Param("_evt_seq") Integer evtSeq,
|
||||
@Param("_evt_type") String evtType,
|
||||
@Param("_up_cmt_seq") Integer upCmtSeq,
|
||||
@Param("_cmt_seq") Integer cmtSeq,
|
||||
@Param("_evt_title") String evtTitle,
|
||||
@Param("_evt_location") String evtLocation,
|
||||
@Param("_evt_contents") String evtContents,
|
||||
@Param("_evt_start_dt") String evtStartDt,
|
||||
@Param("_evt_end_dt") String evtEndDt,
|
||||
@Param("_modi_id") String modiId,
|
||||
@Param("_result_count") Integer resultCount,
|
||||
@Param("_result_code") String resultCode,
|
||||
@Param("_error_message") String errorMessage
|
||||
);
|
||||
|
||||
|
||||
|
||||
@Query(value = "CALL sp_delete_tn_cmt_event (" +
|
||||
":_evt_seq, " +
|
||||
":_modi_id, " +
|
||||
":_result_count, " +
|
||||
":_result_code, " +
|
||||
":_error_message)",
|
||||
nativeQuery = true)
|
||||
Map<String, Object> spDeleteTnCmtEvent(
|
||||
@Param("_evt_seq") Integer evtSeq,
|
||||
@Param("_modi_id") String modiId,
|
||||
@Param("_result_count") Integer resultCount,
|
||||
@Param("_result_code") String resultCode,
|
||||
@Param("_error_message") String errorMessage
|
||||
);
|
||||
|
||||
|
||||
//@Procedure
|
||||
//Map<String, Object> sp_is_valid_tn_cmt_event_id( @Param("_evt_seq") Long evtSeq );
|
||||
|
||||
|
|
@ -76,12 +131,12 @@ public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEve
|
|||
" TO_TIMESTAMP(" + " \n" +
|
||||
" :sSearchDate," + " \n" +
|
||||
" 'YYYYMM'" + " \n" +
|
||||
" ) <= tce.evt_start_dt AND" + " \n" +
|
||||
" ) AT TIME ZONE 'UTC+9' <= tce.evt_start_dt AND" + " \n" +
|
||||
|
||||
" tce.evt_start_dt < TO_TIMESTAMP(" + " \n" +
|
||||
" :sSearchDate," + " \n" +
|
||||
" 'YYYYMM'" + " \n" +
|
||||
" ) + INTERVAL '1 MONTH';\n",
|
||||
" ) AT TIME ZONE 'UTC+9' + INTERVAL '1 MONTH' ;\n",
|
||||
nativeQuery = true)
|
||||
List<TnCmtEvent> getByYyyyMm(
|
||||
@Param("sSearchDate") String sSearchDate
|
||||
|
|
|
|||
|
|
@ -24,4 +24,18 @@
|
|||
order by menu_id asc
|
||||
</select>
|
||||
|
||||
<select id="selectMenuAuthList" resultType="TcMenu">
|
||||
select a.menu_id ,
|
||||
a.menu_title ,
|
||||
a.menu_group ,
|
||||
coalesce(b.role_cd, '') as menu_auth
|
||||
from tc_menu a
|
||||
left outer join (
|
||||
select menu_id , string_agg(role_id, ',') as role_cd
|
||||
from tb_menu_role
|
||||
group by menu_id
|
||||
) b on a.menu_id = b.menu_id
|
||||
where a.use_yn = 'Y'
|
||||
order by a.menu_id asc
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue