기본코드관리 작업중.
parent
cb7773b0c5
commit
5f72e43ca1
|
|
@ -28,10 +28,9 @@ function BaseCodeMgt(props) {
|
|||
{/* <!-- 본문 --> */}
|
||||
|
||||
<div className="top_tit">
|
||||
<h1 className="tit_1">사이트관리</h1>
|
||||
<h1 className="tit_1">기본 코드 관리</h1>
|
||||
</div>
|
||||
|
||||
<h2 className="tit_2">기본 코드 관리</h2>
|
||||
<Row>
|
||||
<Col xs={"6"}>
|
||||
<ParentCodeDiv/>
|
||||
|
|
@ -40,9 +39,6 @@ function BaseCodeMgt(props) {
|
|||
<ChildCodeDiv/>
|
||||
</Col>
|
||||
</Row>
|
||||
<div className={"childCode"}>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,38 @@
|
|||
import React, { useState, useEffect, useCallback } from 'react';
|
||||
import {Container} from "react-bootstrap";
|
||||
import Row from "react-bootstrap/Row";
|
||||
import Col from "react-bootstrap/Col";
|
||||
import Form from 'react-bootstrap/Form'
|
||||
import Button from "react-bootstrap/Button";
|
||||
import * as EgovNet from "api/egovFetch";
|
||||
|
||||
function ParentCodeDiv(props){
|
||||
|
||||
const [codeGrpRow, setCodeGrpRow] = useState();
|
||||
|
||||
function getCodeGrp(){
|
||||
EgovNet.requestFetch(
|
||||
'/admin/config/code-grp',
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({})
|
||||
},
|
||||
(resp) => {
|
||||
debugger
|
||||
},
|
||||
function (resp) {
|
||||
console.log("err response : ", resp);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getCodeGrp();
|
||||
}, []);
|
||||
|
||||
function ParentCodeDiv(){
|
||||
return (
|
||||
<Container className={"pt-3"}>
|
||||
<Row className={"py-2 bg-light border-bottom"}>
|
||||
|
|
@ -13,7 +41,7 @@ function ParentCodeDiv(){
|
|||
<Col xs={2}>삭제</Col>
|
||||
<Col xs={2}>수정</Col>
|
||||
</Row>
|
||||
{}
|
||||
{codeGrpRow}
|
||||
<Row className={"py-1"}>
|
||||
<Col xs={4}>
|
||||
<Form.Control type={"text"} placeholder={"코드그룹"} size={"sm"}/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dbnt.kcscbackend.admin.config;
|
||||
|
||||
import com.dbnt.kcscbackend.admin.config.entity.TcCodeGrp;
|
||||
import com.dbnt.kcscbackend.admin.config.service.AdminConfigService;
|
||||
import com.dbnt.kcscbackend.config.common.BaseController;
|
||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/admin/config")
|
||||
@Tag(name="AdminConfigController", description = "사이트관리 환결설정 메뉴 컨트롤러")
|
||||
public class AdminConfigController extends BaseController {
|
||||
|
||||
private final AdminConfigService adminConfigService;
|
||||
|
||||
@Operation(
|
||||
summary = "기본코드 그룹 조회",
|
||||
description = "기본코드 그룹 조회",
|
||||
tags = {"AdminConfigController"}
|
||||
)
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||
})
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/code-grp", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResultVO getCodeGrp() throws Exception{
|
||||
ResultVO resultVO = new ResultVO();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("codeGrpList", adminConfigService.selectCodeGrpList());
|
||||
resultVO.setResult(resultMap);
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "기본코드 아이템 조회",
|
||||
description = "기본코드 아이템 조회",
|
||||
tags = {"AdminConfigController"}
|
||||
)
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||
})
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/code-item", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResultVO getCodeItem(TcCodeGrp param) throws Exception{
|
||||
ResultVO resultVO = new ResultVO();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("codeItemList", adminConfigService.selectCodeItemList(param.getGrpCd()));
|
||||
resultVO.setResult(resultMap);
|
||||
return resultVO;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.dbnt.kcscbackend.admin.config.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "tc_code_grp")
|
||||
public class TcCodeGrp {
|
||||
@Id
|
||||
@Column(name = "grp_cd")
|
||||
private String grpCd;
|
||||
@Column(name = "grp_cd_nm")
|
||||
private String grpCdNm;
|
||||
@Column(name = "grp_cd_desc")
|
||||
private String grpCdDesc;
|
||||
@Column(name = "frst_crt_id")
|
||||
private String frstCrtId;
|
||||
@Column(name = "frst_crt_dt")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime frstCrtDt;
|
||||
@Column(name = "last_chg_id")
|
||||
private String lastChgId;
|
||||
@Column(name = "last_chg_dt")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastChgDt;
|
||||
@Column(name = "use_yn")
|
||||
private String useYn;
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
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 java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "tc_code_item")
|
||||
@IdClass(TcCodeItem.TcCodeItemId.class)
|
||||
public class TcCodeItem {
|
||||
@Id
|
||||
@Column(name = "item_cd")
|
||||
private String itemCd;
|
||||
@Id
|
||||
@Column(name = "grp_cd")
|
||||
private String grpCd;
|
||||
@Column(name = "item_nm")
|
||||
private String itemNm;
|
||||
@Column(name = "frst_crt_id")
|
||||
private String frstCrtId;
|
||||
@Column(name = "frst_crt_dt")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime frstCrtDt;
|
||||
@Column(name = "last_chg_id")
|
||||
private String lastChgId;
|
||||
@Column(name = "last_chg_dt")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastChgDt;
|
||||
@Column(name = "use_yn")
|
||||
private String useYn;
|
||||
@Column(name = "grp_order")
|
||||
private Integer grpOrder;
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class TcCodeItemId implements Serializable {
|
||||
private String itemCd;
|
||||
private String grpCd;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.dbnt.kcscbackend.admin.config.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AdminConfigMapper {
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.dbnt.kcscbackend.admin.config.repository;
|
||||
|
||||
import com.dbnt.kcscbackend.admin.config.entity.TcCodeGrp;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TcCodeGrpRepository extends JpaRepository<TcCodeGrp, String> {
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.dbnt.kcscbackend.admin.config.repository;
|
||||
|
||||
import com.dbnt.kcscbackend.admin.config.entity.TcCodeItem;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TcCodeItemRepository extends JpaRepository<TcCodeItem, TcCodeItem.TcCodeItemId> {
|
||||
List<TcCodeItem> findByGrpCdOrderByGrpOrder(String grpCd);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.dbnt.kcscbackend.admin.config.service;
|
||||
|
||||
import com.dbnt.kcscbackend.admin.config.entity.TcCodeGrp;
|
||||
import com.dbnt.kcscbackend.admin.config.entity.TcCodeItem;
|
||||
import com.dbnt.kcscbackend.admin.config.mapper.AdminConfigMapper;
|
||||
import com.dbnt.kcscbackend.admin.config.repository.TcCodeGrpRepository;
|
||||
import com.dbnt.kcscbackend.admin.config.repository.TcCodeItemRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AdminConfigService extends EgovAbstractServiceImpl {
|
||||
|
||||
private final TcCodeGrpRepository codeGrpRepository;
|
||||
private final TcCodeItemRepository codeItemRepository;
|
||||
private final AdminConfigMapper adminConfigMapper;
|
||||
|
||||
public List<TcCodeGrp> selectCodeGrpList(){
|
||||
return codeGrpRepository.findAll();
|
||||
}
|
||||
|
||||
public List<TcCodeItem> selectCodeItemList(String grpCd){
|
||||
return codeItemRepository.findByGrpCdOrderByGrpOrder(grpCd);
|
||||
}
|
||||
}
|
||||
|
|
@ -66,6 +66,7 @@ public class SecurityConfig {
|
|||
"/auth/join",//회원가입
|
||||
"/auth/findId", // id 찾기
|
||||
"/auth/findPw", // pw 찾기
|
||||
|
||||
"/cmm/main/**.do", // 메인페이지
|
||||
"/cmm/fms/FileDown.do", //파일 다운로드
|
||||
"/cmm/fms/getImage.do", //갤러리 이미지보기
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
@RequiredArgsConstructor
|
||||
public class StandardCodeService extends EgovAbstractServiceImpl {
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dbnt.kcscbackend.admin.config.mapper.AdminConfigMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue