Merge branch 'master' of http://118.219.150.34:50501/DBNT/kcscDev
commit
47bd58c75f
|
|
@ -20,9 +20,7 @@ function List({}) {
|
|||
});
|
||||
|
||||
const [listTag, setListTag] = useState([]);
|
||||
|
||||
const [paginationInfo, setPaginationInfo] = useState({});
|
||||
|
||||
const [show, setShow] = useState(false);
|
||||
const [modalBody, setModalBody] = useState();
|
||||
|
||||
|
|
@ -42,13 +40,15 @@ function List({}) {
|
|||
|
||||
setListTag([]);
|
||||
// 리스트 항목 구성
|
||||
const cmtList = resp.result.cmtList;
|
||||
resp.result.userList.forEach(function (item, index) {
|
||||
mutListTag.push(
|
||||
<div className={"list_item"} key={"userListDiv_"+index}>
|
||||
<div><a href={"#"} onClick={()=>{userInfoModal(item)}}>{item.userId}</a></div>
|
||||
<div><a href={"#"} onClick={()=>{userInfoModal(item, cmtList)}}>{item.userId}</a></div>
|
||||
<div>{item.userNm}</div>
|
||||
<div>{item.email}</div>
|
||||
<div>{item.phoneNum}</div>
|
||||
<div>{item.cmtOrgNm}</div>
|
||||
<div>{item.statusValue}</div>
|
||||
<div><button className={"btn btn_red_h31 px-1"} onClick={()=>{removeUserInfo(item.userSeq)}}>삭제</button></div>
|
||||
</div>
|
||||
|
|
@ -72,9 +72,9 @@ function List({}) {
|
|||
setSearchCondition({...searchCondition, pageIndex: passedPage})
|
||||
});
|
||||
|
||||
function userInfoModal(userInfo){
|
||||
function userInfoModal(userInfo, cmtList){
|
||||
handleShow()
|
||||
setModalBody(<UserInfoModal savedInfo={userInfo} reloadFunction={retrieveList}></UserInfoModal>)
|
||||
setModalBody(<UserInfoModal savedInfo={userInfo} cmtList={cmtList} reloadFunction={retrieveList}></UserInfoModal>)
|
||||
}
|
||||
|
||||
const removeUserInfo = useCallback((seq)=>{
|
||||
|
|
@ -151,6 +151,7 @@ function List({}) {
|
|||
<span>이름</span>
|
||||
<span>이메일</span>
|
||||
<span>연락처</span>
|
||||
<span>위원회</span>
|
||||
<span>상태</span>
|
||||
<span>삭제</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, {useCallback, useEffect, useState} from "react"
|
||||
import React, {useEffect, useState} from "react"
|
||||
import Modal from "react-bootstrap/Modal";
|
||||
import * as EgovNet from "api/egovFetch";
|
||||
import Form from "react-bootstrap/Form";
|
||||
|
|
@ -6,11 +6,12 @@ import Row from "react-bootstrap/Row";
|
|||
import Col from "react-bootstrap/Col";
|
||||
import Button from "react-bootstrap/Button";
|
||||
import SelectOption from "components/commonCode/SelectOption";
|
||||
import CheckBox from "components/commonCode/CheckBox";
|
||||
import CODE from "../../../constants/code";
|
||||
|
||||
function UserInfoModal({savedInfo, reloadFunction}){
|
||||
|
||||
function UserInfoModal({savedInfo, cmtList, reloadFunction}){
|
||||
const [selectedCmtList, setSelectedCmtList] = useState(cmtList);
|
||||
const [cmtOrg, setCmtOrg] = useState({cmtSeq: savedInfo?.cmtOrg, cmtNm: savedInfo?.cmtOrgNm});
|
||||
|
||||
function userInfoChange(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
|
@ -23,18 +24,10 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
userNm: form.userNm.value,
|
||||
email: form.email.value,
|
||||
phoneNum: form.phoneNum.value,
|
||||
userRole: '',
|
||||
userRole: form.userRole.value,
|
||||
cmtOrg: form.cmtOrg.value,
|
||||
status: form.status.value,
|
||||
}
|
||||
let userRole = '';
|
||||
form.userRole.forEach(function (input){
|
||||
if(input.checked){
|
||||
userRole += input.value+','
|
||||
}
|
||||
})
|
||||
if(userRole){
|
||||
info.userRole = userRole.slice(0, -1)
|
||||
}
|
||||
EgovNet.requestFetch(
|
||||
'/admin/users/mgt/info',
|
||||
{
|
||||
|
|
@ -56,8 +49,19 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
}
|
||||
)
|
||||
}
|
||||
|
||||
function modalOpen(){
|
||||
const changeSelectorOption = (e) => {
|
||||
selectedCmtList.forEach(function (cmt){
|
||||
if(cmt.cmtSeq === Number(e.target.value)){
|
||||
setCmtOrg({cmtSeq: cmt.cmtSeq, cmtNm: cmt.cmtNm});
|
||||
if(cmt.childList.length === 0){
|
||||
setSelectedCmtList(cmtList);
|
||||
}else{
|
||||
setSelectedCmtList(cmt.childList);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
/*function modalOpen(){
|
||||
EgovNet.requestFetch(
|
||||
'/admin/users/mgt/info?userId='+savedInfo?.userId,
|
||||
{
|
||||
|
|
@ -70,10 +74,10 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
|
||||
}
|
||||
)
|
||||
}
|
||||
}*/
|
||||
|
||||
useEffect(() => {
|
||||
modalOpen();
|
||||
/*modalOpen();*/
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
|
@ -143,6 +147,21 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
<SelectOption name={"userRole"} grpCd={"ROLE"} selectedValue={savedInfo?.userRole} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
<Form.Label column sm={3}>
|
||||
위원회
|
||||
</Form.Label>
|
||||
<Col sm={9} className={"cmtSelector"}>
|
||||
<input type={"hidden"} name={"cmtOrg"} id={"cmtOrg"} value={cmtOrg?.cmtSeq}/>
|
||||
<Form.Control type={"text"} id={"cmtOrgNm"} value={cmtOrg?.cmtNm} disabled />
|
||||
<Form.Select name={"cmtLv1"} onChange={changeSelectorOption}>
|
||||
<option value={""}>선택</option>
|
||||
{selectedCmtList.map((cmt) => (
|
||||
<option key={cmt.cmtSeq} value={cmt.cmtSeq} data-cmt={cmt} selected={savedInfo?.cmtOrg === cmt.cmtSeq}>{cmt.cmtNm}</option>
|
||||
))}
|
||||
</Form.Select>
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
<Form.Label column sm={3}>
|
||||
상태
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.dbnt.kcscbackend.admin.logs.service.AdminLogsService;
|
|||
import com.dbnt.kcscbackend.admin.users.service.UsersService;
|
||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||
import com.dbnt.kcscbackend.auth.entity.UserInfo;
|
||||
import com.dbnt.kcscbackend.commonCode.service.CmtService;
|
||||
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
|
||||
import com.dbnt.kcscbackend.config.common.BaseController;
|
||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
||||
|
|
@ -38,6 +39,7 @@ public class AdminUsersController extends BaseController {
|
|||
private final UsersService usersService;
|
||||
private final AdminLogsService adminLogsService;
|
||||
private final CommonCodeService commonCodeService;
|
||||
private final CmtService cmtService;
|
||||
|
||||
@Operation(
|
||||
summary = "사용자 목록 조회",
|
||||
|
|
@ -55,6 +57,7 @@ public class AdminUsersController extends BaseController {
|
|||
Map<String, Object> resultMap = new HashMap<>();
|
||||
params.setQueryInfo();
|
||||
resultMap.put("userSeOption", commonCodeService.selectCodeItemList("ACC_TYPE"));
|
||||
resultMap.put("cmtList", cmtService.selectCmtOrgList());
|
||||
resultMap.put("userList", usersService.selectUserList(params));
|
||||
params.setContentCnt(usersService.selectUserListCnt(params));
|
||||
params.setPaginationInfo();
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public class UsersService extends EgovAbstractServiceImpl {
|
|||
savedInfo.setEmail(info.getEmail());
|
||||
savedInfo.setPhoneNum(info.getPhoneNum());
|
||||
savedInfo.setUserRole(info.getUserRole());
|
||||
savedInfo.setCmtOrg(info.getCmtOrg());
|
||||
savedInfo.setStatus(info.getStatus());
|
||||
savedInfo.setLastChgId(updateUser);
|
||||
savedInfo.setLastChgDt(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ public class UserInfo extends BoardParams implements UserDetails{
|
|||
private String phoneNum;
|
||||
@Column(name = "user_role")
|
||||
private String userRole;
|
||||
@Column(name = "cmt_org")
|
||||
private Integer cmtOrg;
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
@Column(name = "frst_crt_dt")
|
||||
|
|
@ -72,6 +74,8 @@ public class UserInfo extends BoardParams implements UserDetails{
|
|||
private String passwordChk;
|
||||
@Transient
|
||||
private String statusValue;
|
||||
@Transient
|
||||
private String cmtOrgNm;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -57,6 +59,9 @@ public class TnCmtOrg {
|
|||
@Column(name = "old_seq")
|
||||
private Long oldSeq;
|
||||
|
||||
@Transient
|
||||
private List<TnCmtOrg> childList = new ArrayList<>();
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public interface TnCmtOrgRepository extends JpaRepository<TnCmtOrg, TnCmtOrg.TnCmtOrgId> {
|
||||
|
||||
List<TnCmtOrg> findByUseYnOrderByCmtTypeAsc(String useYn);
|
||||
List<TnCmtOrg> findByUseYnAndUpCmtSeqOrderByCmtOrder(String useYn, Long upCmtSeq);
|
||||
TnCmtOrg findByUseYnAndCmtSeq(String useYn, Long cmtSeq);
|
||||
List<TnCmtOrg> findByUseYnAndUpCmtSeqAndCmtTypeOrderByCmtOrder(String useYn, Long upCmtSeq, String cmtType);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.dbnt.kcscbackend.commonCode.service;
|
||||
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TnCmtOrg;
|
||||
import com.dbnt.kcscbackend.commonCode.repository.TnCmtOrgRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CmtService {
|
||||
private final TnCmtOrgRepository tnCmtOrgRepository;
|
||||
|
||||
public List<TnCmtOrg> selectCmtOrgList(){
|
||||
List<TnCmtOrg> cmtList = tnCmtOrgRepository.findByUseYnOrderByCmtTypeAsc("Y");
|
||||
List<TnCmtOrg> lv1List = new ArrayList<>();
|
||||
for(TnCmtOrg cmt: cmtList){
|
||||
if(cmt.getCmtType().equals("LV_01")){
|
||||
lv1List.add(cmt);
|
||||
}
|
||||
cmt.getChildList().addAll(findChildCmt(cmt, cmtList));
|
||||
}
|
||||
return lv1List;
|
||||
}
|
||||
|
||||
private List<TnCmtOrg> findChildCmt(TnCmtOrg parent, List<TnCmtOrg> cmtList){
|
||||
List<TnCmtOrg> tempList = new ArrayList<>();
|
||||
for(TnCmtOrg cmt: cmtList){
|
||||
if(parent.getCmtSeq().equals(cmt.getUpCmtSeq())){
|
||||
tempList.add(cmt);
|
||||
}
|
||||
}
|
||||
return tempList;
|
||||
}
|
||||
}
|
||||
|
|
@ -12,10 +12,13 @@
|
|||
a.phone_num,
|
||||
a.user_role,
|
||||
a.status,
|
||||
c.item_nm as status_value
|
||||
c.item_nm as status_value,
|
||||
a.cmt_org,
|
||||
d.cmt_nm as cmt_org_nm
|
||||
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
|
||||
left outer join tn_cmt_org d on a.cmt_org = d.cmt_seq
|
||||
<include refid="selectUserListWhere"></include>
|
||||
order by user_seq desc
|
||||
limit #{rowCnt} offset #{firstIndex}
|
||||
|
|
|
|||
Loading…
Reference in New Issue