소스정리
This commit is contained in:
@@ -4,9 +4,12 @@ import net.jwsi.jcms.JcmsCmsApp;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@Import({JcmsCmsApp.class})
|
||||
@SpringBootApplication
|
||||
public class JcmsVppApplication {
|
||||
@EnableScheduling
|
||||
class JcmsVppApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(JcmsVppApplication.class, args);
|
||||
}
|
||||
|
||||
@@ -5,12 +5,16 @@ import net.jwsi.jcms.cms.board.arti.BodArti;
|
||||
import net.jwsi.jcms.cms.board.arti.BodArtiService;
|
||||
import net.jwsi.jcms.exception.JsonDataException;
|
||||
import net.jwsi.jcms.utils.HttpUtil;
|
||||
import net.jwsi.jcms.vpp.station.Station;
|
||||
import net.jwsi.jcms.vpp.station.StationService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@Slf4j
|
||||
@Controller
|
||||
@@ -35,4 +39,11 @@ public class MainController {
|
||||
public Map<String, Object> listData(BodArti srch) throws JsonDataException {
|
||||
return HttpUtil.responseList(bodArtiService.selectList(srch));
|
||||
}
|
||||
|
||||
@GetMapping("/cms/test")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> test() {
|
||||
List<Station> stations = stationService.getStations();
|
||||
return ResponseEntity.ok("테스트 ㅇ! 건수: " + stations.size());
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,36 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import net.jwsi.jcms.base.BaseController;
|
||||
import net.jwsi.jcms.exception.JsonDataException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequestMapping("/${jcms.manager-path:system}/station/")
|
||||
public class StationController extends BaseController<Station,String,StationRepository,StationService> {
|
||||
|
||||
public StationController(StationService service) {
|
||||
private final StationService stationService;
|
||||
private final String path = "/system/station/";
|
||||
|
||||
public StationController(StationService service, StationService stationService) {
|
||||
super(service);
|
||||
this.stationService = stationService;
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
public String list() {
|
||||
return path + "list";
|
||||
}
|
||||
@PostMapping("list.json")
|
||||
@ResponseBody
|
||||
public Map<String,Object> list(Station station){
|
||||
stationService.getStations();
|
||||
return svcSelectList(station);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.jwsi.jcms.vpp.api.ApiClient;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/cmsLayout}">
|
||||
<body>
|
||||
<section layout:fragment="Content">
|
||||
<div class="w-100" style="margin-bottom: .3rem;">
|
||||
<div th:replace="~{common/fragments/searchBox :: SearchBoxFragment(~{ :: #searchBoxContent}, ~{ :: #searchBoxFooter})}">
|
||||
<div id="searchBoxContent">
|
||||
<div class="row px-2">
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">충전소명</span>
|
||||
<input type="text" id="stNmLike" name="stNmLike" class="form-control" placeholder="충전소명 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">주소 도로명 메인</span>
|
||||
<input type="text" id="addrRdMLike" name="addrRdMLike" class="form-control" placeholder="주소 도로명 메인 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">주소 도로명 상세</span>
|
||||
<input type="text" id="addrRdDLike" name="addrRdDLike" class="form-control" placeholder="주소 도로명 상세 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">주소 지번 메인</span>
|
||||
<input type="text" id="addrLdMLike" name="addrLdMLike" class="form-control" placeholder="주소 지번 메인 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">주소 지번 상세</span>
|
||||
<input type="text" id="addrLdDLike" name="addrLdDLike" class="form-control" placeholder="주소 지번 상세 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-lg-4 col-sm-6 col-xs-12 pb-1">-->
|
||||
<!-- <div class="input-group">-->
|
||||
<!-- <span class="input-group-text" style="width:200px">시설 구분 코드</span>-->
|
||||
<!-- <select id="stFacilTpCdLike" name="stFacilTpCdLike" class="form-control"></select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="col-lg-4 col-sm-6 col-xs-12 pb-1">-->
|
||||
<!-- <div class="input-group">-->
|
||||
<!-- <span class="input-group-text" style="width:200px">시설 상세 구분 코드</span>-->
|
||||
<!-- <select id="stFacilDTpCdLike" name="stFacilDTpCdLike" class="form-control"></select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">주차비 상세정보</span>
|
||||
<input type="text" id="parkingFeeDetlLike" name="parkingFeeDetlLike" class="form-control" placeholder="주차비 상세정보 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">PNU 코드</span>
|
||||
<input type="text" id="pnuNoLike" name="pnuNoLike" class="form-control" placeholder="PNU 코드 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">법정동 도 명</span>
|
||||
<input type="text" id="pnuDoNmLike" name="pnuDoNmLike" class="form-control" placeholder="법정동 도 명 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">법정동 시 명</span>
|
||||
<input type="text" id="pnuSiNmLike" name="pnuSiNmLike" class="form-control" placeholder="법정동 시 명 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" style="width:200px">법정동 읍면동 명</span>
|
||||
<input type="text" id="pnuDongNmLike" name="pnuDongNmLike" class="form-control" placeholder="법정동 읍면동 명 입력" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="searchBoxFooter">
|
||||
<div class="row float-end">
|
||||
<div class="col-xs-12 ">
|
||||
<button type="button" class="btn btn-sm btn-info" id="searchBtn">검색</button>
|
||||
<button type="button" class="btn btn-sm btn-info" id="resetBtn">리셋</button>
|
||||
<th:block th:if="${menuRole?.roleWrite eq true}">
|
||||
<button type="button" class="btn btn-sm btn-primary pl-2" onclick="showModal(ModalMode.REGISTER, {}, '');">등록</button>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100">
|
||||
<div class="box box-primary">
|
||||
<div class="form">
|
||||
<table id="datatable" class="table table-striped table-hover dataTable" style="width:100%;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script th:inline="none">
|
||||
const rootPath = "/system/vppStation/";
|
||||
let datatable;
|
||||
// const stFacilTpCdCdList = getCdDtlList("####"); const stFacilDTpCdCdList = getCdDtlList("####");
|
||||
|
||||
$(document).ready(function() {
|
||||
// setSearchCdDtlOptions("stFacilTpCdLike", stFacilTpCdCdList);
|
||||
// setSearchCdDtlOptions("stFacilDTpCdLike", stFacilDTpCdCdList);
|
||||
const className = "dt-head-center dt-body-center";
|
||||
datatable = newDataTable(
|
||||
"#datatable",
|
||||
rootPath + "list.json",
|
||||
function(d) {
|
||||
if (strUtil.isNotEmpty($('#stNmLike').val())) {d.stNm = $('#stNmLike').val();}
|
||||
if (strUtil.isNotEmpty($('#addrRdMLike').val())) {d.addrRdM = $('#addrRdMLike').val();}
|
||||
if (strUtil.isNotEmpty($('#addrRdDLike').val())) {d.addrRdD = $('#addrRdDLike').val();}
|
||||
if (strUtil.isNotEmpty($('#addrLdMLike').val())) {d.addrLdM = $('#addrLdMLike').val();}
|
||||
if (strUtil.isNotEmpty($('#addrLdDLike').val())) {d.addrLdD = $('#addrLdDLike').val();}
|
||||
// if (strUtil.isNotEmpty($('#stFacilTpCdLike').val())) {d.stFacilTpCd = $('#stFacilTpCdLike').val();}
|
||||
// if (strUtil.isNotEmpty($('#stFacilDTpCdLike').val())) {d.stFacilDTpCd = $('#stFacilDTpCdLike').val();}
|
||||
if (strUtil.isNotEmpty($('#parkingFeeDetlLike').val())) {d.parkingFeeDetl = $('#parkingFeeDetlLike').val();}
|
||||
if (strUtil.isNotEmpty($('#pnuNoLike').val())) {d.pnuNo = $('#pnuNoLike').val();}
|
||||
if (strUtil.isNotEmpty($('#pnuDoNmLike').val())) {d.pnuDoNm = $('#pnuDoNmLike').val();}
|
||||
if (strUtil.isNotEmpty($('#pnuSiNmLike').val())) {d.pnuSiNm = $('#pnuSiNmLike').val();}
|
||||
if (strUtil.isNotEmpty($('#pnuDongNmLike').val())) {d.pnuDongNm = $('#pnuDongNmLike').val();}
|
||||
return d;
|
||||
},
|
||||
{
|
||||
order: [],
|
||||
columns: [
|
||||
{title: "충전소명", name: "ST_NM", data: "stNm", className, orderable: false},
|
||||
{title: "주소 도로명 메인", name: "ADDR_RD_M", data: "addrRdM", className, orderable: false},
|
||||
{title: "주소 도로명 상세", name: "ADDR_RD_D", data: "addrRdD", className, orderable: false},
|
||||
{title: "주소 지번 메인", name: "ADDR_LD_M", data: "addrLdM", className, orderable: false},
|
||||
{title: "주소 지번 상세", name: "ADDR_LD_D", data: "addrLdD", className, orderable: false},
|
||||
// {title: "시설 구분 코드", name: "st_facil_tp_cd", data: "stFacilTpCd", className, orderable: false,
|
||||
// render: (data, type, row) => getCdDtlDtColNm(stFacilTpCdCdList, row["stFacilTpCd"]) },
|
||||
// {title: "시설 상세 구분 코드", name: "st_facil_d_tp_cd", data: "stFacilDTpCd", className, orderable: false,
|
||||
// render: (data, type, row) => getCdDtlDtColNm(stFacilDTpCdCdList, row["stFacilDTpCd"]) },
|
||||
{title: "주차비 여부", name: "parking_fee_yn", data: "parkingFeeYn", className, orderable: false},
|
||||
{title: "주차비 상세정보", name: "PARKING_FEE_DETL", data: "parkingFeeDetl", className, orderable: false},
|
||||
{title: "PNU 코드", name: "pnu_no", data: "pnuNo", className, orderable: false},
|
||||
{title: "법정동 도 명", name: "PNU_DO_NM", data: "pnuDoNm", className, orderable: false},
|
||||
{title: "법정동 시 명", name: "PNU_SI_NM", data: "pnuSiNm", className, orderable: false},
|
||||
{title: "법정동 읍면동 명", name: "PNU_DONG_NM", data: "pnuDongNm", className, orderable: false},
|
||||
null
|
||||
],
|
||||
allCheck: false,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
const showModal = (mode, ids, title) => {
|
||||
if(!checkRole(mode)) { alert("권한이 없습니다."); return; }
|
||||
|
||||
let modalInputArray = [
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.hidden,
|
||||
inputId: "providerId",
|
||||
inputName: "providerId",
|
||||
hasOldPk: true,
|
||||
inputLabel: "충전사업자ID",
|
||||
inputPlaceholder: "충전사업자ID",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 100,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.hidden,
|
||||
inputId: "stId",
|
||||
inputName: "stId",
|
||||
hasOldPk: true,
|
||||
inputLabel: "충전소ID",
|
||||
inputPlaceholder: "충전소ID",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 255,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.text,
|
||||
inputId: "stNm",
|
||||
inputName: "stNm",
|
||||
inputLabel: "충전소명",
|
||||
inputPlaceholder: "충전소명",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 100,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.textarea,
|
||||
inputId: "addrRdM",
|
||||
inputName: "addrRdM",
|
||||
inputLabel: "주소 도로명 메인",
|
||||
inputPlaceholder: "주소 도로명 메인",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 250,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.textarea,
|
||||
inputId: "addrRdD",
|
||||
inputName: "addrRdD",
|
||||
inputLabel: "주소 도로명 상세",
|
||||
inputPlaceholder: "주소 도로명 상세",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 250,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.textarea,
|
||||
inputId: "addrLdM",
|
||||
inputName: "addrLdM",
|
||||
inputLabel: "주소 지번 메인",
|
||||
inputPlaceholder: "주소 지번 메인",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 250,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.textarea,
|
||||
inputId: "addrLdD",
|
||||
inputName: "addrLdD",
|
||||
inputLabel: "주소 지번 상세",
|
||||
inputPlaceholder: "주소 지번 상세",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 250,
|
||||
}),
|
||||
// new ModalInput({
|
||||
// inputType: ModalInputType.select,
|
||||
// inputId: "stFacilTpCd",
|
||||
// inputName: "stFacilTpCd",
|
||||
// inputLabel: "시설 구분 코드",
|
||||
// inputPlaceholder: "시설 구분 코드",
|
||||
// isReq: false,
|
||||
// isEnable: true,
|
||||
// itemArray: toCdDtlItemArray(stFacilTpCdCdList),
|
||||
// }),
|
||||
// new ModalInput({
|
||||
// inputType: ModalInputType.select,
|
||||
// inputId: "stFacilDTpCd",
|
||||
// inputName: "stFacilDTpCd",
|
||||
// inputLabel: "시설 상세 구분 코드",
|
||||
// inputPlaceholder: "시설 상세 구분 코드",
|
||||
// isReq: false,
|
||||
// isEnable: true,
|
||||
// itemArray: toCdDtlItemArray(stFacilDTpCdCdList),
|
||||
// }),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.switch,
|
||||
inputId: "parkingFeeYn",
|
||||
inputName: "parkingFeeYn",
|
||||
inputLabel: "주차비 여부",
|
||||
inputPlaceholder: "주차비 여부",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.text,
|
||||
inputId: "parkingFeeDetl",
|
||||
inputName: "parkingFeeDetl",
|
||||
inputLabel: "주차비 상세정보",
|
||||
inputPlaceholder: "주차비 상세정보",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 100,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.textarea,
|
||||
inputId: "pnuNo",
|
||||
inputName: "pnuNo",
|
||||
inputLabel: "PNU 코드",
|
||||
inputPlaceholder: "PNU 코드",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 255,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.text,
|
||||
inputId: "pnuDoNm",
|
||||
inputName: "pnuDoNm",
|
||||
inputLabel: "법정동 도 명",
|
||||
inputPlaceholder: "법정동 도 명",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 30,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.text,
|
||||
inputId: "pnuSiNm",
|
||||
inputName: "pnuSiNm",
|
||||
inputLabel: "법정동 시 명",
|
||||
inputPlaceholder: "법정동 시 명",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 30,
|
||||
}),
|
||||
new ModalInput({
|
||||
inputType: ModalInputType.text,
|
||||
inputId: "pnuDongNm",
|
||||
inputName: "pnuDongNm",
|
||||
inputLabel: "법정동 읍면동 명",
|
||||
inputPlaceholder: "법정동 읍면동 명",
|
||||
isReq: false,
|
||||
isEnable: true,
|
||||
minLen: 0,
|
||||
maxLen: 30,
|
||||
})
|
||||
];
|
||||
if(!rootPath){ alert("rootPath를 지정하십시요."); return; }
|
||||
const insertUrl = rootPath+"insert.json";
|
||||
const updateUrl = rootPath+"update.json";
|
||||
const loadUrl = rootPath+"view.json";
|
||||
const deleteUrl = rootPath+"delete.json";
|
||||
const modalWidth = 500;
|
||||
const labelWidth = '90px';
|
||||
if(mode === ModalMode.REGISTER) {
|
||||
newModal(new ModalInfo({modalTitle: "등록", inputArray: modalInputArray, modalWidth}), mode, 'main', {insertUrl, labelWidth, callBack: () => { defaultCallback(); }})
|
||||
} else if(mode===ModalMode.VIEW || mode===ModalMode.VIEW_ONLY || mode===ModalMode.MODIFY) {
|
||||
newModal(new ModalInfo({modalTitle: "상세정보", inputArray: modalInputArray, modalWidth}), mode, 'main', {loadUrl, updateUrl, ids, labelWidth, callBack: () => { defaultCallback(); }})
|
||||
} else if(mode === ModalMode.DELETE) {
|
||||
newDelete(deleteUrl, ids, title, () => { defaultCallback(); });
|
||||
}
|
||||
const defaultCallback = () => {
|
||||
datatable.ajax.reload();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
$("#searchBtn").click(function() {
|
||||
datatable.ajax.reload();
|
||||
});
|
||||
|
||||
$("#resetBtn").click(function() {
|
||||
$("#stNmLike").val("");
|
||||
$("#addrRdMLike").val("");
|
||||
$("#addrRdDLike").val("");
|
||||
$("#addrLdMLike").val("");
|
||||
$("#addrLdDLike").val("");
|
||||
// $("#stFacilTpCdLike").val("");
|
||||
// $("#stFacilDTpCdLike").val("");
|
||||
$("#parkingFeeDetlLike").val("");
|
||||
$("#pnuNoLike").val("");
|
||||
$("#pnuDoNmLike").val("");
|
||||
$("#pnuSiNmLike").val("");
|
||||
$("#pnuDongNmLike").val("");
|
||||
datatable.ajax.reload();
|
||||
});
|
||||
</script>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user