충전중 정보조회 소스정리

This commit is contained in:
2026-07-30 15:28:27 +09:00
parent bcfdfe52a9
commit 4970d3d5fa
8 changed files with 748 additions and 0 deletions
@@ -5,6 +5,8 @@ import net.jwsi.jcms.vpp.chgr.ChgrResponseDto;
import net.jwsi.jcms.vpp.chgrCurrState.ChgrCurrState;
import net.jwsi.jcms.vpp.chgrHist.ChgrHistResponseDto;
import net.jwsi.jcms.vpp.provider.ProviderDto;
import net.jwsi.jcms.vpp.rehchgingList.RechgingList;
import net.jwsi.jcms.vpp.rehchgingList.RechgingListDto;
import net.jwsi.jcms.vpp.station.StationDto;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.stereotype.Component;
@@ -64,4 +66,15 @@ public class ApiClient {
.retrieve()
.body(new ParameterizedTypeReference<ApiResponse<List<ChgrCurrState>>>() {});
}
public ApiResponse<List<RechgingListDto>> fetchRechgingList() {
return externalApiClient.post()
.uri("/api/charge/chargingInfo")
.body(Collections.emptyMap())
.retrieve()
.body(new ParameterizedTypeReference<ApiResponse<List<RechgingListDto>>>() {});
}
}
@@ -0,0 +1,82 @@
package net.jwsi.jcms.vpp.rehchgingList;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import net.jwsi.jcms.base.BaseStEntity;
@NoArgsConstructor
@Setter
@Getter
@ToString
@Entity(name = "vpp_rechging_list")
public class RechgingList extends BaseStEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "RECHGING_LIST_ID")
private Long rechgingListId;
@Column(name = "SEARCH_DT")
private String searchDt;
@Column(name = "PROVIDER_ID")
private String providerId;
@Column(name = "ST_ID")
private String stId;
@Column(name = "CHGR_ID")
private String chgrId;
@Column(name = "CH_ID")
private Integer chId;
@Column(name = "PLUG_TYPE")
private String plugType;
@Column(name = "MEM_AUTH_INPUT_NO")
private String memAuthInputNo;
@Column(name = "CREDIT_P_PAY_TRX_NO")
private String creditPPayTrxNo;
@Column(name = "CREDIT_P_PAY_TRX_DT")
private String creditPPayTrxDt;
@Column(name = "RECHG_SDT")
private String rechgSdt;
@Column(name = "RECHG_REMAIN_TIME")
private String rechgRemainTime;
@Column(name = "RECHGING_WH")
private Integer rechgingWh;
@Column(name = "RECHG_DEMAND_AMT")
private Integer rechgDemandAmt;
@Column(name = "RECHGING_AMT")
private Integer rechgingAmt;
@Column(name = "PAY_TYPE")
private String payType;
@Column(name = "INTEGRATED_WH")
private Double integratedWh;
@Column(name = "DC_POWER_WH")
private Double dcPowerWh;
@Column(name = "AC_POWER_WH")
private Double AcPowerWh;
@Column(name = "CURR_VOLT")
private Double currVolt;
@Column(name = "CURR_C")
private Double currC;
}
@@ -0,0 +1,57 @@
package net.jwsi.jcms.vpp.rehchgingList;
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;
@Controller
@Slf4j
@RequestMapping("/cms/rechgingList")
public class RechgingListController extends BaseController<RechgingList, Long, RechgingListRepository, RechgingListService> {
private final String path = "/system/rechgingList/";
private final RechgingListService rechgingListService;
public RechgingListController(RechgingListService service, RechgingListService rechgingListService) {
super(service);
this.rechgingListService = rechgingListService;
}
@GetMapping("list")
public String list() throws IllegalAccessException {
return path + "list";
}
@PostMapping("list.json")
@ResponseBody
public Map<String, Object> list(RechgingList rechgingList) {
return svcSelectList(rechgingList);
}
@PostMapping("view.json")
@ResponseBody
public Map<String, Object> viewData(RechgingList rechgingList) throws JsonDataException {
return svcSelectList(rechgingList);
}
@Override
protected void chkSelectList(List<RechgingList> list) throws JsonDataException {
}
@Override
protected void chkSelect(RechgingList data) throws JsonDataException {
}
}
@@ -0,0 +1,59 @@
package net.jwsi.jcms.vpp.rehchgingList;
import lombok.*;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class RechgingListDto {
private Long rechgingListId;
private String searchDt;
private String providerId;
private String stId;
private String chgrId;
private Integer chId;
private String plugType;
private String memAuthInputNo;
private String creditPPayTrxNo;
private String creditPPayTrxDt;
private String rechgSdt;
private String rechgRemainTime;
private Integer rechgingWh;
private Integer rechgDemandAmt;
private Integer rechgingAmt;
private String payType;
private Double integratedWh;
private Double dcPowerWh;
private Double acPowerWh;
private Double currVolt;
private Double currC;
public RechgingList toEntity() {
RechgingList rechgingList = new RechgingList();
rechgingList.setRechgingListId(this.rechgingListId);
rechgingList.setSearchDt(this.searchDt);
rechgingList.setProviderId(this.providerId);
rechgingList.setStId(this.stId);
rechgingList.setChgrId(this.chgrId);
rechgingList.setChId(this.chId);
rechgingList.setPlugType(this.plugType);
rechgingList.setMemAuthInputNo(this.memAuthInputNo);
rechgingList.setCreditPPayTrxNo(this.creditPPayTrxNo);
rechgingList.setCreditPPayTrxDt(this.creditPPayTrxDt);
rechgingList.setRechgSdt(this.rechgSdt);
rechgingList.setRechgRemainTime(this.rechgRemainTime);
rechgingList.setRechgingWh(this.rechgingWh);
rechgingList.setRechgDemandAmt(this.rechgDemandAmt);
rechgingList.setRechgingAmt(this.rechgingAmt);
rechgingList.setPayType(this.payType);
rechgingList.setIntegratedWh(this.integratedWh);
rechgingList.setDcPowerWh(this.dcPowerWh);
rechgingList.setAcPowerWh(this.acPowerWh);
rechgingList.setCurrVolt(this.currVolt);
rechgingList.setCurrC(this.currC);
return rechgingList;
}
}
@@ -0,0 +1,8 @@
package net.jwsi.jcms.vpp.rehchgingList;
import net.jwsi.jcms.base.BaseRecStRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface RechgingListRepository extends BaseRecStRepository<RechgingList, Long> {
}
@@ -0,0 +1,99 @@
package net.jwsi.jcms.vpp.rehchgingList;
import jakarta.transaction.Transactional;
import lombok.extern.slf4j.Slf4j;
import net.jwsi.jcms.base.BaseService;
import net.jwsi.jcms.base.EnumSqlType;
import net.jwsi.jcms.utils.HttpUtil;
import net.jwsi.jcms.utils.LoginUtil;
import net.jwsi.jcms.vpp.api.ApiClient;
import net.jwsi.jcms.vpp.api.ApiResponse;
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.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service
public class RechgingListService extends BaseService<RechgingList, Long, RechgingListRepository> {
private final ApiClient apiClient;
public RechgingListService(RechgingListRepository repository, ApiClient apiClient) {
super(repository);
this.apiClient = apiClient;
}
@Transactional
@Scheduled(cron = "0 0 0 * * *")
public void getRechgingList() {
ApiResponse<List<RechgingListDto>> response = apiClient.fetchRechgingList();
if (response == null || !Integer.valueOf(200).equals(response.getCode())) {
String msg =(response != null) ? response.getMessage() : "응답 없음";
throw new RuntimeException("API 호출 실패: " + msg);
}
List<RechgingListDto> dtoList = response.getData();
if (dtoList == null || dtoList.isEmpty()) {
log.info("가져온 충전중 데이터가 없습니다.");
}
List<RechgingList> entityList = dtoList.stream()
.map(RechgingListDto::toEntity)
.collect(Collectors.toList());
List<RechgingList> savedRechgingList = super.repository.saveAll(entityList);
log.info("총 {}건의 충전중 데이터가 DB에 동기화되었습니다.",savedRechgingList.size());
}
@Override
protected Integer getUserId() {
return HttpUtil.getUserId();
}
@Override
protected String getUserName(Integer id) {
return LoginUtil.getUserName(id);
}
@Override
protected RechgingList newSearchParam(RechgingList rechgingList) {
if (rechgingList == null) {
rechgingList = new RechgingList();
}
return rechgingList;
}
@Override
protected EnumSqlType useSqlTyp() {
return EnumSqlType.SPECIFICATION;
}
@Override
protected Specification<RechgingList> getSpecification(RechgingList srch) {
if (srch == null) return null;
Specification<RechgingList> rst = null;
rst = addWhere(rst, srch.getRechgingListId(), RechgingListSpecification.rechgingListId(srch.getRechgingListId()));
return rst;
}
@Override
protected Page<RechgingList> _selectPage(RechgingList rechgingList) {
return null;
}
@Override
protected List<RechgingList> _selectList(RechgingList rechgingList) {
return null;
}
}
@@ -0,0 +1,11 @@
package net.jwsi.jcms.vpp.rehchgingList;
import org.springframework.data.jpa.domain.Specification;
public class RechgingListSpecification {
public static Specification<RechgingList> rechgingListId(Long rechgingListId) {
return (root, query, criteriaBuilder) -> criteriaBuilder.equal(root.get("rechgingListId"), rechgingListId);
}
}
@@ -0,0 +1,419 @@
<!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:300px">요청 일시</span>
<input type="text" id="searchDtLike" name="searchDtLike" 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:300px">충전사업자 ID</span>
<input type="text" id="providerIdLike" name="providerIdLike" class="form-control" placeholder="충전사업자 ID 입력" 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:300px">충전소 ID</span>
<input type="text" id="stIdLike" name="stIdLike" class="form-control" placeholder="충전소 ID 입력" 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:300px">충전기 ID</span>
<input type="text" id="chgrIdLike" name="chgrIdLike" class="form-control" placeholder="충전기 ID 입력" 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:300px">플러그 타입</span>
<input type="text" id="plugTypeLike" name="plugTypeLike" 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:300px">회원카드번호</span>
<input type="text" id="memAuthInputNoLike" name="memAuthInputNoLike" 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:300px">선결제 관련 신용카드 승인번호</span>
<input type="text" id="creditPPayTrxNoLike" name="creditPPayTrxNoLike" 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:300px">선결제 관련 신용카드 승인일시</span>
<input type="text" id="creditPPayTrxDtLike" name="creditPPayTrxDtLike" 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:300px">충전 시작일시</span>
<input type="text" id="rechgSdtLike" name="rechgSdtLike" 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:300px">충전 잔여 시간</span>
<input type="text" id="rechgRemainTimeLike" name="rechgRemainTimeLike" 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:300px">결제타입</span>
<input type="text" id="payTypeLike" name="payTypeLike" 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 = "/cms/rechgingList/";
let datatable;
$(document).ready(function() {
const className = "dt-head-center dt-body-center";
datatable = newDataTable(
"#datatable",
rootPath + "list.json",
function(d) {
if (strUtil.isNotEmpty($('#searchDtLike').val())) {d.searchDt = $('#searchDtLike').val();}
if (strUtil.isNotEmpty($('#providerIdLike').val())) {d.providerId = $('#providerIdLike').val();}
if (strUtil.isNotEmpty($('#stIdLike').val())) {d.stId = $('#stIdLike').val();}
if (strUtil.isNotEmpty($('#chgrIdLike').val())) {d.chgrId = $('#chgrIdLike').val();}
if (strUtil.isNotEmpty($('#plugTypeLike').val())) {d.plugType = $('#plugTypeLike').val();}
if (strUtil.isNotEmpty($('#memAuthInputNoLike').val())) {d.memAuthInputNo = $('#memAuthInputNoLike').val();}
if (strUtil.isNotEmpty($('#creditPPayTrxNoLike').val())) {d.creditPPayTrxNo = $('#creditPPayTrxNoLike').val();}
if (strUtil.isNotEmpty($('#creditPPayTrxDtLike').val())) {d.creditPPayTrxDt = $('#creditPPayTrxDtLike').val();}
if (strUtil.isNotEmpty($('#rechgSdtLike').val())) {d.rechgSdt = $('#rechgSdtLike').val();}
if (strUtil.isNotEmpty($('#rechgRemainTimeLike').val())) {d.rechgRemainTime = $('#rechgRemainTimeLike').val();}
if (strUtil.isNotEmpty($('#payTypeLike').val())) {d.payType = $('#payTypeLike').val();}
return d;
},
{
order: [[0, 'desc'], [2, 'desc'], [3, 'desc'], [4, 'desc']],
columns: [
{title: "충전중 ID", name: "RECHGING_LIST_ID", data: "rechgingListId", className, visible: false},
{title: "요청 일시", name: "SEARCH_DT", data: "searchDt", className, orderable: false},
{title: "충전사업자 ID", name: "PROVIDER_ID", data: "providerId", className},
{title: "충전소 ID", name: "ST_ID", data: "stId", className},
{title: "충전기 ID", name: "CHGR_ID", data: "chgrId", className},
{title: "채널 ID", name: "CH_ID", data: "chId", className, orderable: false},
{title: "플러그 타입", name: "PLUG_TYPE", data: "plugType", className, orderable: false},
{title: "회원카드번호", name: "MEM_AUTH_INPUT_NO", data: "memAuthInputNo", className, orderable: false},
{title: "신용카드 승인번호", name: "CREDIT_P_PAY_TRX_NO", data: "creditPPayTrxNo", className, orderable: false},
{title: "신용카드 승인일시", name: "CREDIT_P_PAY_TRX_DT", data: "creditPPayTrxDt", className, orderable: false},
{title: "충전 시작일시", name: "RECHG_SDT", data: "rechgSdt", className, orderable: false},
{title: "충전 잔여 시간", name: "RECHG_REMAIN_TIME", data: "rechgRemainTime", className, orderable: false},
{title: "진행 충전량", name: "RECHGING_WH", data: "rechgingWh", className, orderable: false},
{title: "선결제 금액", name: "RECHG_DEMAND_AMT", data: "rechgDemandAmt", className, orderable: false},
{title: "진행 충전 금액", name: "RECHGING_AMT", data: "rechgingAmt", className, orderable: false},
{title: "결제타입", name: "PAY_TYPE", data: "payType", className, orderable: false},
{title: "적산량", name: "INTEGRATED_WH", data: "integratedWh", className, orderable: false},
{title: "DC 적산량", name: "DC_POWER_WH", data: "dcPowerWh", className, orderable: false},
{title: "AC 적산량", name: "AC_POWER_WH", data: "acPowerWh", className, orderable: false},
{title: "현재 전압", name: "CURR_VOLT", data: "currVolt", className, orderable: false},
{title: "현재 전류", name: "CURR_C", data: "currC", className, orderable: false},
{title: "등록인ID", name: "REG_ID", data: "regIdNm", className, orderable: false},
{title: "등록일시", name: "REG_DT", data: "regDt", className, orderable: false,
render: (data, type, row) => dateUtil.toYmd(row["regDt"]) },
{title: "수정인ID", name: "UPD_ID", data: "updIdNm", className, orderable: false},
{title: "수정일시", name: "UPD_DT", data: "updDt", className, orderable: false,
render: (data, type, row) => dateUtil.toYmd(row["updDt"]) },
{title: "삭제인ID", name: "DEL_ID", data: "delIdNm", className, orderable: false},
{title: "삭제일시", name: "DEL_DT", data: "delDt", className, orderable: false,
render: (data, type, row) => dateUtil.toYmd(row["delDt"]) },
{title: "사용상태", name: "REC_ST", data: "recSt", className, orderable: false}
],
allCheck: false,
});
});
const showModal = (mode, ids, title) => {
if(!checkRole(mode)) { alert("권한이 없습니다."); return; }
let modalInputArray = [
new ModalInput({
inputType: ModalInputType.hidden,
inputId: "rechgingListId",
inputName: "rechgingListId",
}),
new ModalInput({
inputType: ModalInputType.textarea,
inputId: "searchDt",
inputName: "searchDt",
inputLabel: "요청 일시",
inputPlaceholder: "요청 일시",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 250,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "providerId",
inputName: "providerId",
hasOldPk: true,
inputLabel: "충전사업자 ID",
inputPlaceholder: "충전사업자 ID",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 20,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "stId",
inputName: "stId",
hasOldPk: true,
inputLabel: "충전소 ID",
inputPlaceholder: "충전소 ID",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 20,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "chgrId",
inputName: "chgrId",
hasOldPk: true,
inputLabel: "충전기 ID",
inputPlaceholder: "충전기 ID",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 20,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "chId",
inputName: "chId",
inputLabel: "채널 ID",
inputPlaceholder: "채널 ID",
isReq: false,
isEnable: true,
}),
new ModalInput({
inputType: ModalInputType.textarea,
inputId: "plugType",
inputName: "plugType",
inputLabel: "플러그 타입",
inputPlaceholder: "플러그 타입",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 250,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "memAuthInputNo",
inputName: "memAuthInputNo",
inputLabel: "회원카드번호",
inputPlaceholder: "회원카드번호",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 20,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "creditPPayTrxNo",
inputName: "creditPPayTrxNo",
inputLabel: "선결제 관련 신용카드 승인번호",
inputPlaceholder: "선결제 관련 신용카드 승인번호",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 20,
}),
new ModalInput({
inputType: ModalInputType.textarea,
inputId: "creditPPayTrxDt",
inputName: "creditPPayTrxDt",
inputLabel: "선결제 관련 신용카드 승인일시",
inputPlaceholder: "선결제 관련 신용카드 승인일시",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 250,
}),
new ModalInput({
inputType: ModalInputType.textarea,
inputId: "rechgSdt",
inputName: "rechgSdt",
inputLabel: "충전 시작일시",
inputPlaceholder: "충전 시작일시",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 250,
}),
new ModalInput({
inputType: ModalInputType.textarea,
inputId: "rechgRemainTime",
inputName: "rechgRemainTime",
inputLabel: "충전 잔여 시간",
inputPlaceholder: "충전 잔여 시간",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 250,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "rechgingWh",
inputName: "rechgingWh",
inputLabel: "진행 충전량",
inputPlaceholder: "진행 충전량",
isReq: false,
isEnable: true,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "rechgDemandAmt",
inputName: "rechgDemandAmt",
inputLabel: "선결제 금액",
inputPlaceholder: "선결제 금액",
isReq: false,
isEnable: true,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "rechgingAmt",
inputName: "rechgingAmt",
inputLabel: "진행 충전 금액",
inputPlaceholder: "진행 충전 금액",
isReq: false,
isEnable: true,
}),
new ModalInput({
inputType: ModalInputType.textarea,
inputId: "payType",
inputName: "payType",
inputLabel: "결제타입",
inputPlaceholder: "결제타입",
isReq: false,
isEnable: true,
minLen: 0,
maxLen: 250,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "integratedWh",
inputName: "integratedWh",
inputLabel: "적산량",
inputPlaceholder: "적산량",
isReq: false,
isEnable: true,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "dcPowerWh",
inputName: "dcPowerWh",
inputLabel: "DC 적산량",
inputPlaceholder: "DC 적산량",
isReq: false,
isEnable: true,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "acPowerWh",
inputName: "acPowerWh",
inputLabel: "AC 적산량",
inputPlaceholder: "AC 적산량",
isReq: false,
isEnable: true,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "currVolt",
inputName: "currVolt",
inputLabel: "현재 전압",
inputPlaceholder: "현재 전압",
isReq: false,
isEnable: true,
}),
new ModalInput({
inputType: ModalInputType.text,
inputId: "currC",
inputName: "currC",
inputLabel: "현재 젅류",
inputPlaceholder: "현재 젅류",
isReq: false,
isEnable: true,
})
];
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() {
$("#searchDtLike").val("");
$("#providerIdLike").val("");
$("#stIdLike").val("");
$("#chgrIdLike").val("");
$("#plugTypeLike").val("");
$("#memAuthInputNoLike").val("");
$("#creditPPayTrxNoLike").val("");
$("#creditPPayTrxDtLike").val("");
$("#rechgSdtLike").val("");
$("#rechgRemainTimeLike").val("");
$("#payTypeLike").val("");
datatable.ajax.reload();
});
</script>
</section>
</body>
</html>