Compare commits
4 Commits
2f7456ae62
...
081f34f883
| Author | SHA1 | Date |
|---|---|---|
|
|
081f34f883 | |
|
|
b3eecb0f50 | |
|
|
eef87b6e81 | |
|
|
5f855dc6b0 |
|
|
@ -11,13 +11,13 @@ function CheckBox({name, grpCd, selectedValue}){
|
|||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if(selectedValue){
|
||||
if(checkBox&&selectedValue){
|
||||
const itemCdAry = selectedValue.split(',');
|
||||
itemCdAry.forEach(function(itemCd){
|
||||
document.querySelector(`#chkBox_${itemCd}`).checked = true;
|
||||
})
|
||||
}
|
||||
}, [selectedValue]);
|
||||
}, [checkBox]);
|
||||
|
||||
function getCodeItemList() {
|
||||
EgovNet.requestFetch(
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ function SelectOption({name, grpCd, selectedValue}){
|
|||
useEffect(() => {
|
||||
getCodeItemList()
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setValue(selectedValue)
|
||||
}, [selectedValue]);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ function List({}) {
|
|||
});
|
||||
|
||||
const [listTag, setListTag] = useState([]);
|
||||
const [userSeOption, setUserSeOption] = useState([]);
|
||||
|
||||
const [paginationInfo, setPaginationInfo] = useState({});
|
||||
|
||||
|
|
@ -40,32 +39,24 @@ function List({}) {
|
|||
(resp) => {
|
||||
setPaginationInfo(resp.result.paginationInfo);
|
||||
let mutListTag = [];
|
||||
let userSeTag = [];
|
||||
|
||||
setListTag([]);
|
||||
setUserSeOption([]);
|
||||
// 리스트 항목 구성
|
||||
resp.result.userList.forEach(function (item, index) {
|
||||
mutListTag.push(
|
||||
<div className={"list_item"} key={"userListDiv_"+index}>
|
||||
<div>{item.userSe}</div>
|
||||
<div><a href={"#"} onClick={()=>{userInfoModal(item.userSeq)}}>{item.userId}</a></div>
|
||||
<div><a href={"#"} onClick={()=>{userInfoModal(item)}}>{item.userId}</a></div>
|
||||
<div>{item.userNm}</div>
|
||||
<div>{item.email}</div>
|
||||
<div>{item.phoneNum}</div>
|
||||
<div>{item.status}</div>
|
||||
<div>{item.statusValue}</div>
|
||||
<div><button className={"btn btn_red_h31 px-1"} onClick={()=>{removeUserInfo(item.userSeq)}}>삭제</button></div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
if(!mutListTag.length) mutListTag.push(<p className="no_data" key="0">검색된 결과가 없습니다.</p>); // 게시판 목록 초기값
|
||||
|
||||
resp.result.userSeOption.forEach(function (item, index){
|
||||
userSeTag.push(<option value={item.itemCd}>{item.itemNm}</option>)
|
||||
})
|
||||
|
||||
setListTag(mutListTag);
|
||||
setUserSeOption(userSeTag);
|
||||
},
|
||||
function (resp) {
|
||||
console.log("err response : ", resp);
|
||||
|
|
@ -85,9 +76,9 @@ function List({}) {
|
|||
setSearchCondition({...searchCondition, pageIndex: passedPage})
|
||||
});
|
||||
|
||||
function userInfoModal(userSeq){
|
||||
function userInfoModal(userInfo){
|
||||
handleShow()
|
||||
setModalBody(<UserInfoModal userSeq={userSeq} reloadFunction={retrieveList}></UserInfoModal>)
|
||||
setModalBody(<UserInfoModal savedInfo={userInfo} reloadFunction={retrieveList}></UserInfoModal>)
|
||||
}
|
||||
|
||||
const removeUserInfo = useCallback((seq)=>{
|
||||
|
|
@ -137,16 +128,6 @@ function List({}) {
|
|||
{/* <!-- 검색조건 --> */}
|
||||
<div className="condition">
|
||||
<ul>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
|
||||
<select id="sel1" title="구분" defaultValue={searchCondition.userSe}
|
||||
onChange={(e) => {setSearchCondition({...searchCondition, userSe: e.target.value})}}>
|
||||
<option value="">전체</option>
|
||||
{userSeOption}
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
<select id="sel1" title="조건" defaultValue={searchCondition.searchCondition}
|
||||
|
|
@ -170,7 +151,6 @@ function List({}) {
|
|||
|
||||
<div className="board_list userList">
|
||||
<div className="head">
|
||||
<span>구분</span>
|
||||
<span>아이디</span>
|
||||
<span>이름</span>
|
||||
<span>이메일</span>
|
||||
|
|
|
|||
|
|
@ -9,37 +9,7 @@ import SelectOption from "components/commonCode/SelectOption";
|
|||
import CheckBox from "components/commonCode/CheckBox";
|
||||
import CODE from "../../../constants/code";
|
||||
|
||||
function UserInfoModal({userSeq, reloadFunction}){
|
||||
|
||||
const [userInfo, setUserInfo] = useState({ userSeq: '', userId: '', password: '', passwordChk: '', userNm: '', email: '', phoneNum: '', userSe:'', userRole:'', status:''});
|
||||
|
||||
function getModalContent(){
|
||||
EgovNet.requestFetch(
|
||||
'/admin/users/info?userSeq='+userSeq,
|
||||
{
|
||||
method: "GET"
|
||||
},
|
||||
(resp) => {
|
||||
const respInfo = resp.result.userInfo;
|
||||
const info = {
|
||||
userSeq: respInfo.userSeq,
|
||||
userId: respInfo.userId,
|
||||
userNm: respInfo.userNm,
|
||||
email: respInfo.email,
|
||||
phoneNum: respInfo.phoneNum,
|
||||
password: "",
|
||||
passwordChk: "",
|
||||
userSe: respInfo.userSe,
|
||||
userRole: respInfo.userRole,
|
||||
status: respInfo.status
|
||||
}
|
||||
setUserInfo(info);
|
||||
},
|
||||
(resp) => {
|
||||
console.log("err response : ", resp);
|
||||
}
|
||||
);
|
||||
}
|
||||
function UserInfoModal({savedInfo, reloadFunction}){
|
||||
|
||||
function userInfoChange(e){
|
||||
e.preventDefault();
|
||||
|
|
@ -53,7 +23,6 @@ function UserInfoModal({userSeq, reloadFunction}){
|
|||
userNm: form.userNm.value,
|
||||
email: form.email.value,
|
||||
phoneNum: form.phoneNum.value,
|
||||
userSe: form.userSe.value,
|
||||
userRole: '',
|
||||
status: form.status.value,
|
||||
}
|
||||
|
|
@ -88,26 +57,22 @@ function UserInfoModal({userSeq, reloadFunction}){
|
|||
)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getModalContent();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title>
|
||||
{userInfo.userNm} 상세정보
|
||||
{savedInfo?.userNm} 상세정보
|
||||
</Modal.Title>
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
<Form onSubmit={(e) =>{userInfoChange(e)}} noValidate>
|
||||
<input type={"hidden"} name={"userSeq"} defaultValue={userInfo.userSeq} />
|
||||
<input type={"hidden"} name={"userSeq"} defaultValue={savedInfo?.userSeq} />
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
<Form.Label column sm={3}>
|
||||
아이디
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<Form.Control type="text" name="userId" placeholder="아이디" required defaultValue={userInfo?.userId} readOnly/>
|
||||
<Form.Control type="text" name="userId" placeholder="아이디" required defaultValue={savedInfo?.userId} readOnly/>
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -131,7 +96,7 @@ function UserInfoModal({userSeq, reloadFunction}){
|
|||
이름
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<Form.Control type="text" name="userNm" placeholder="이름" required defaultValue={userInfo?.userNm} />
|
||||
<Form.Control type="text" name="userNm" placeholder="이름" required defaultValue={savedInfo?.userNm} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -139,7 +104,7 @@ function UserInfoModal({userSeq, reloadFunction}){
|
|||
이메일
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<Form.Control type="email" name="email" placeholder="email" required defaultValue={userInfo?.email} />
|
||||
<Form.Control type="email" name="email" placeholder="email" required defaultValue={savedInfo?.email} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -147,15 +112,7 @@ function UserInfoModal({userSeq, reloadFunction}){
|
|||
연락처
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<Form.Control type="text" name="phoneNum" placeholder="연락처" required defaultValue={userInfo?.phoneNum} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
<Form.Label column sm={3}>
|
||||
사용자 유형
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<SelectOption name={"userSe"} grpCd={"ACC_TYPE"} selectedValue={userInfo?.userSe} />
|
||||
<Form.Control type="text" name="phoneNum" placeholder="연락처" required defaultValue={savedInfo?.phoneNum} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -163,7 +120,7 @@ function UserInfoModal({userSeq, reloadFunction}){
|
|||
사용자 권한
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<CheckBox name={"userRole"} grpCd={"ROLE"} selectedValue={userInfo?.userRole} />
|
||||
<CheckBox name={"userRole"} grpCd={"ROLE"} selectedValue={savedInfo?.userRole} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -171,7 +128,7 @@ function UserInfoModal({userSeq, reloadFunction}){
|
|||
상태
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<SelectOption name={"status"} grpCd={"ACC_STUS"} selectedValue={userInfo?.status} />
|
||||
<SelectOption name={"status"} grpCd={"ACC_STUS"} selectedValue={savedInfo?.status} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Row className="mb-3">
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
|||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
|
|
@ -161,6 +162,7 @@ public class PopUpApiController {
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "팝업 비활성화 API",
|
||||
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 팝업을 비활성화 API. 삭제가 아닌 비활성화 임. 삭제는 없음.",
|
||||
|
|
@ -199,6 +201,47 @@ public class PopUpApiController {
|
|||
return resultVO;
|
||||
}
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "팝업 활성화 또는 비활성화 설정하는 API",
|
||||
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 '사용여부'를 활성화 또는 비활성화 설정해주는 API.",
|
||||
tags = {"PopUpApiController"}
|
||||
)
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
|
||||
})
|
||||
@PutMapping(value = "/contents/api/popup-manage/activation-switch/{popupId}")
|
||||
public ResultVO contentsApiPopUpManageUpdateActivationSwitch(
|
||||
HttpServletRequest request,
|
||||
@AuthenticationPrincipal LoginVO loginVO,
|
||||
@ApiParam(value="활성화 여부") @RequestParam(required=true) String checked,
|
||||
@PathVariable("popupId") Long popupId
|
||||
) throws Exception {
|
||||
|
||||
ResultVO resultVO = new ResultVO();
|
||||
|
||||
try {
|
||||
resultVO = popUpApiService.contentsApiPopUpManageUpdateActivationSwitch(resultVO, request, loginVO, checked, popupId);
|
||||
} catch (Exception e) {
|
||||
resultVO.setResultCode(ResponseCode.FAILED.getCode());
|
||||
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",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,11 @@ import com.dbnt.kcscbackend.admin.contents.popUp.model.CreatePopupVO;
|
|||
import com.dbnt.kcscbackend.admin.contents.popUp.model.UpdatePopupVO;
|
||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
|
@ -14,6 +18,7 @@ public interface PopUpApiService {
|
|||
public ResultVO contentsApiPopUpManageCreate(ResultVO resultVO, HttpServletRequest request, LoginVO user, final MultipartHttpServletRequest multiRequest, CreatePopupVO createPopupVO) throws Exception;
|
||||
public ResultVO contentsApiPopUpManageRead(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
|
||||
public ResultVO contentsApiPopUpManageUpdate(ResultVO resultVO, HttpServletRequest request, LoginVO user, UpdatePopupVO updatePopupVO, Long popupId) throws Exception;
|
||||
|
||||
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
|
||||
public ResultVO contentsApiPopUpManageUpdateActivationSwitch(ResultVO resultVO, HttpServletRequest request, LoginVO user, String checked, Long popupId) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -236,6 +236,13 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
|
|||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Map<String, Object> dto = new HashMap<String, Object>();
|
||||
|
||||
if( false ) {
|
||||
// 삭제 procedure가 삭제가 아닌 비활성화만 시키므로 해당 프로시저 사용 안 함.
|
||||
Map<String, Object> response = tnPopupMngRepository.spDeleteTnPopupMng(
|
||||
popupId.intValue(),
|
||||
"admin",
|
||||
|
|
@ -243,9 +250,54 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
|
|||
null,
|
||||
null
|
||||
);
|
||||
dto.put("errorMessage", response.get("_error_message") );
|
||||
} else {
|
||||
tnPopupMngRepository.deleteById(popupId);
|
||||
}
|
||||
|
||||
|
||||
dto.put("popupId", popupId );
|
||||
|
||||
resultVO.setResult(dto);
|
||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultVO contentsApiPopUpManageUpdateActivationSwitch(ResultVO resultVO, HttpServletRequest request, LoginVO user, String checked, Long popupId) throws Exception {
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"checked:" + "\n" +
|
||||
checked + "\n" +
|
||||
"popupId:" + "\n" +
|
||||
popupId + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
|
||||
|
||||
// 유효성 검사 실시
|
||||
int isValid = tnPopupMngRepository.spIsValidTnPopupMngId( popupId.intValue() );
|
||||
|
||||
if( isValid == 0 ) {
|
||||
throw new Exception("대상이 존재하지 않습니다.");
|
||||
}
|
||||
|
||||
TnPopupMng tnPopupMng = tnPopupMngRepository.findByPopupSeq(popupId);
|
||||
if( Boolean.parseBoolean(checked) ) {
|
||||
tnPopupMng.setUseYn("Y");
|
||||
} else {
|
||||
tnPopupMng.setUseYn("N");
|
||||
}
|
||||
|
||||
tnPopupMngRepository.saveAndFlush(tnPopupMng);
|
||||
|
||||
|
||||
Map<String, Object> dto = new HashMap<String, Object>();
|
||||
dto.put("errorMessage", response.get("_error_message") );
|
||||
dto.put("popupId", popupId);
|
||||
|
||||
resultVO.setResult(dto);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ public class AdminUsersService extends EgovAbstractServiceImpl {
|
|||
}
|
||||
savedInfo.setEmail(info.getEmail());
|
||||
savedInfo.setPhoneNum(info.getPhoneNum());
|
||||
savedInfo.setUserSe(info.getUserSe());
|
||||
savedInfo.setUserRole(info.getUserRole());
|
||||
savedInfo.setStatus(info.getStatus());
|
||||
savedInfo.setLastChgId(updateUser);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ public class UserInfo extends BoardParams implements UserDetails{
|
|||
|
||||
@Transient
|
||||
private String passwordChk;
|
||||
@Transient
|
||||
private String statusValue;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public class TnPopupMng {
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class TnPopupMngId implements Serializable {
|
||||
private static final long serialVersionUID = -6558812991140219351L;
|
||||
private String popupSeq;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
|
||||
public interface TnPopupMngRepository extends JpaRepository<TnPopupMng, TnPopupMng.TnPopupMngId> {
|
||||
public interface TnPopupMngRepository extends JpaRepository<TnPopupMng, Long> {
|
||||
|
||||
@Query(value = "CALL sp_add_tn_popup_mng (" +
|
||||
":_popup_title, " +
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@
|
|||
a.user_nm,
|
||||
a.phone_num,
|
||||
a.user_role,
|
||||
c.item_nm as status
|
||||
a.status,
|
||||
c.item_nm as status_value
|
||||
from user_info a
|
||||
inner join tc_code_item b on a.user_se = b.item_cd
|
||||
inner join tc_code_item c on a.status = c.item_cd
|
||||
|
|
|
|||
Loading…
Reference in New Issue