요금제 추가
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,25 @@
|
|||||||
|
package net.jwsi.jcms.vpp.RatePlanDetailTime;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import net.jwsi.jcms.base.BaseStEntity;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@Entity(name="vpp_rate_plan_detail_time")
|
||||||
|
public class RatePlanDetailTime extends BaseStEntity {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer detailTimeId; //상세 id (계시별 단가 기준)(pk)
|
||||||
|
private Integer ratePlanId; //요금제 id (fk)
|
||||||
|
private Integer detailCapacityId; //상세 id (충전용량 기준, fk)
|
||||||
|
private Integer timeSlotId; //시간대 id (fk: time_slots)(fk)
|
||||||
|
private Double price; //시간대별 단가
|
||||||
|
private String seasonType; //계절 타입
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package net.jwsi.jcms.vpp.RatePlanDetailTime;
|
||||||
|
|
||||||
|
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.RequestMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping("/cms/ratePlanDetailTime")
|
||||||
|
public class RatePlanDetailTimeController extends BaseController<RatePlanDetailTime,Integer,RatePlanDetailTimeRepository,RatePlanDetailTimeService> {
|
||||||
|
public RatePlanDetailTimeController(RatePlanDetailTimeService service) {
|
||||||
|
super(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void chkSelectList(List<RatePlanDetailTime> list) throws JsonDataException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void chkSelect(RatePlanDetailTime data) throws JsonDataException {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package net.jwsi.jcms.vpp.RatePlanDetailTime;
|
||||||
|
|
||||||
|
|
||||||
|
import net.jwsi.jcms.base.BaseRecStRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface RatePlanDetailTimeRepository extends BaseRecStRepository<RatePlanDetailTime, Integer> {
|
||||||
|
void deleteByRatePlanId(Integer ratePlanId);
|
||||||
|
List<RatePlanDetailTime> findByRatePlanId(Integer ratePlanId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package net.jwsi.jcms.vpp.RatePlanDetailTime;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.jwsi.jcms.base.BaseService;
|
||||||
|
import net.jwsi.jcms.base.EnumSqlType;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class RatePlanDetailTimeService extends BaseService<RatePlanDetailTime,Integer,RatePlanDetailTimeRepository> {
|
||||||
|
|
||||||
|
|
||||||
|
public RatePlanDetailTimeService(RatePlanDetailTimeRepository repository) {
|
||||||
|
super(repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Integer getUserId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getUserName(Integer id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected RatePlanDetailTime newSearchParam(RatePlanDetailTime ratePlanDetailTime) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected EnumSqlType useSqlTyp() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Specification<RatePlanDetailTime> getSpecification(RatePlanDetailTime ratePlanDetailTime) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Page<RatePlanDetailTime> _selectPage(RatePlanDetailTime ratePlanDetailTime) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<RatePlanDetailTime> _selectList(RatePlanDetailTime ratePlanDetailTime) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package net.jwsi.jcms.vpp.RatePlanDetailTime;
|
||||||
|
|
||||||
|
public class SeasonTimeDetailDto {
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import net.jwsi.jcms.vpp.chgr.ChgrResponseDto;
|
|||||||
import net.jwsi.jcms.vpp.chgrCurrState.ChgrCurrState;
|
import net.jwsi.jcms.vpp.chgrCurrState.ChgrCurrState;
|
||||||
import net.jwsi.jcms.vpp.chgrHist.ChgrHistResponseDto;
|
import net.jwsi.jcms.vpp.chgrHist.ChgrHistResponseDto;
|
||||||
import net.jwsi.jcms.vpp.provider.ProviderDto;
|
import net.jwsi.jcms.vpp.provider.ProviderDto;
|
||||||
|
import net.jwsi.jcms.vpp.ratePlan.RatePlanResponseDto;
|
||||||
import net.jwsi.jcms.vpp.station.StationDto;
|
import net.jwsi.jcms.vpp.station.StationDto;
|
||||||
import org.springframework.core.ParameterizedTypeReference;
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -56,12 +57,24 @@ public class ApiClient {
|
|||||||
.body(new ParameterizedTypeReference<ApiResponse<List<ChgrHistResponseDto>>>() {});
|
.body(new ParameterizedTypeReference<ApiResponse<List<ChgrHistResponseDto>>>() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiResponse<List<ChgrCurrState>> fetchChgrCurrState() {
|
public ApiResponse<List<ChgrCurrState>> fetchChgrCurrState(String pageSize) {
|
||||||
|
Map<String, String> requestBody = Map.of(
|
||||||
|
"pageSize", pageSize
|
||||||
|
);
|
||||||
|
|
||||||
return externalApiClient.post()
|
return externalApiClient.post()
|
||||||
.uri("/api/charge/stateInfo")
|
.uri("/api/charge/stateInfo")
|
||||||
.body(Collections.emptyMap())
|
.body(requestBody)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.body(new ParameterizedTypeReference<ApiResponse<List<ChgrCurrState>>>() {});
|
.body(new ParameterizedTypeReference<ApiResponse<List<ChgrCurrState>>>() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ApiResponse<List<RatePlanResponseDto>> fetchRatePlan(){
|
||||||
|
return externalApiClient.post()
|
||||||
|
.uri("/api/ratePlan/list")
|
||||||
|
.body(Collections.emptyMap())
|
||||||
|
.retrieve()
|
||||||
|
.body(new ParameterizedTypeReference<ApiResponse<List<RatePlanResponseDto>>>() {
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package net.jwsi.jcms.vpp.chargerRatePlan;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import net.jwsi.jcms.base.BaseStEntity;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@Entity(name="vpp_charger_rate_plan")
|
||||||
|
public class ChargerRatePlan extends BaseStEntity {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY) // 🚨 무조건 추가!
|
||||||
|
private Integer id; //적용 이력 id(pk)
|
||||||
|
private String chargerCd; //충전기 코드 (사업자코드+충전소번호+충전기번호)
|
||||||
|
private Integer ratePlanId; //적용 요금제 id (fk)
|
||||||
|
private String applyStartDate; //적용 시작일
|
||||||
|
private String applyEndDate; //적용 종료일 (null = 현재 적용중)
|
||||||
|
private String isActive; //활성화 여부
|
||||||
|
private String notes; //비고 / 변경 이유
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package net.jwsi.jcms.vpp.chargerRatePlan;
|
||||||
|
|
||||||
|
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.RequestMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping("/cms/chargerRatePlan")
|
||||||
|
public class ChargerRatePlanController extends BaseController<ChargerRatePlan,Integer,ChargerRatePlanRepository,ChargerRatePlanService> {
|
||||||
|
public ChargerRatePlanController(ChargerRatePlanService service) {
|
||||||
|
super(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void chkSelectList(List<ChargerRatePlan> list) throws JsonDataException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void chkSelect(ChargerRatePlan data) throws JsonDataException {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package net.jwsi.jcms.vpp.chargerRatePlan;
|
||||||
|
|
||||||
|
import net.jwsi.jcms.base.BaseRecStRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface ChargerRatePlanRepository extends BaseRecStRepository<ChargerRatePlan,Integer> {
|
||||||
|
void deleteByRatePlanId(Integer ratePlanId);
|
||||||
|
List<ChargerRatePlan> findByRatePlanId(Integer ratePlanId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package net.jwsi.jcms.vpp.chargerRatePlan;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.jwsi.jcms.base.BaseService;
|
||||||
|
import net.jwsi.jcms.base.EnumSqlType;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class ChargerRatePlanService extends BaseService<ChargerRatePlan,Integer,ChargerRatePlanRepository> {
|
||||||
|
public ChargerRatePlanService(ChargerRatePlanRepository repository) {
|
||||||
|
super(repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Integer getUserId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getUserName(Integer id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ChargerRatePlan newSearchParam(ChargerRatePlan chargerRatePlan) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected EnumSqlType useSqlTyp() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Specification<ChargerRatePlan> getSpecification(ChargerRatePlan chargerRatePlan) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Page<ChargerRatePlan> _selectPage(ChargerRatePlan chargerRatePlan) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<ChargerRatePlan> _selectList(ChargerRatePlan chargerRatePlan) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package net.jwsi.jcms.vpp.chgr;
|
package net.jwsi.jcms.vpp.chgr;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Entity;
|
|
||||||
import jakarta.persistence.Id;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -14,12 +12,20 @@ import net.jwsi.jcms.base.BaseStEntity;
|
|||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@Entity(name = "vpp_chgr")
|
@Entity(name = "vpp_chgr")
|
||||||
|
@IdClass(ChgrId.class)
|
||||||
public class Chgr extends BaseStEntity {
|
public class Chgr extends BaseStEntity {
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private ChgrId oldId__;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "CHGR_ID")
|
@Column(name = "CHGR_ID")
|
||||||
private String chgrId; //충전기 id(pk)
|
private String chgrId; //충전기 id(pk)
|
||||||
|
@Id
|
||||||
@Column(name = "PROVIDER_ID")
|
@Column(name = "PROVIDER_ID")
|
||||||
private String providerId; //충전사업자 id(pk) @Id
|
private String providerId; //충전사업자 id(pk) @Id
|
||||||
|
@Id
|
||||||
|
@Column(name = "ST_ID")
|
||||||
private String stId; //충전소 id(pk) @Id
|
private String stId; //충전소 id(pk) @Id
|
||||||
private String stNm; //충전소 명
|
private String stNm; //충전소 명
|
||||||
private String chgrNm; //충전기 명
|
private String chgrNm; //충전기 명
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class ChgrController extends BaseController<Chgr,String,ChgrRepository,Ch
|
|||||||
}
|
}
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public String list(){
|
public String list(){
|
||||||
|
chgrService.getCharger();
|
||||||
return path+"list";
|
return path+"list";
|
||||||
}
|
}
|
||||||
@PostMapping("list.json")
|
@PostMapping("list.json")
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package net.jwsi.jcms.vpp.chgr;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class ChgrId implements Serializable {
|
||||||
|
private String providerId;
|
||||||
|
private String stId;
|
||||||
|
private String chgrId;
|
||||||
|
}
|
||||||
@@ -29,7 +29,7 @@ public class ChgrCurrStateService extends BaseService<ChgrCurrState,ChgrCurrStat
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Scheduled(cron = "0 0 0 * * *")
|
@Scheduled(cron = "0 0 0 * * *")
|
||||||
public void getChgrCurrState() {
|
public void getChgrCurrState() {
|
||||||
ApiResponse<List<ChgrCurrState>> response = apiClient.fetchChgrCurrState();
|
ApiResponse<List<ChgrCurrState>> response = apiClient.fetchChgrCurrState("12");
|
||||||
|
|
||||||
if (response == null || !Integer.valueOf(200).equals(response.getCode())) {
|
if (response == null || !Integer.valueOf(200).equals(response.getCode())) {
|
||||||
String msg = (response != null) ? response.getMessage() : "응답 없음";
|
String msg = (response != null) ? response.getMessage() : "응답 없음";
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package net.jwsi.jcms.vpp.ratePlan;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import net.jwsi.jcms.base.BaseStEntity;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@Entity(name="vpp_rate_plan")
|
||||||
|
public class RatePlan extends BaseStEntity {
|
||||||
|
@Id
|
||||||
|
private Integer ratePlanId; //요금제 id(pk)
|
||||||
|
private String ratePlanName; //요금제명
|
||||||
|
private String ratePlanType; //요금제 타입 (고정/계시별/충전용량별/계시+충전용량별)
|
||||||
|
private String seasonType; //계절 타입 (연중/봄/여름/가을/겨울)
|
||||||
|
private String applyStartDate; //적용 시작일
|
||||||
|
private String applyEndDate; //적용 종료일
|
||||||
|
private Double fixedPrice; //고정 단가 (rate_plan_type=fixed일 경우)
|
||||||
|
private String description; //요금제 설명
|
||||||
|
private String approvalStatus; //승인 상태
|
||||||
|
private String rejectionReason; //승인 거절 사유
|
||||||
|
@Column(name = "IS_ACTIVE")
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package net.jwsi.jcms.vpp.ratePlan;
|
||||||
|
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping("/cms/ratePlan")
|
||||||
|
public class RatePlanController extends BaseController<RatePlan,Integer,RatePlanRepository,RatePlanService> {
|
||||||
|
|
||||||
|
private final String path = "/system/ratePlan/";
|
||||||
|
private final RatePlanService ratePlanService;
|
||||||
|
|
||||||
|
|
||||||
|
public RatePlanController(RatePlanService service, RatePlanService ratePlanService) {
|
||||||
|
super(service);
|
||||||
|
this.ratePlanService = ratePlanService;
|
||||||
|
}
|
||||||
|
@GetMapping("list")
|
||||||
|
public String list(){
|
||||||
|
ratePlanService.getRatePlan();
|
||||||
|
return path+"list";
|
||||||
|
}
|
||||||
|
@PostMapping("list.json")
|
||||||
|
@ResponseBody
|
||||||
|
public Map<String,Object> list(RatePlan ratePlan){
|
||||||
|
if(ratePlan == null) ratePlan = new RatePlan();
|
||||||
|
return svcSelectList(ratePlan);
|
||||||
|
}
|
||||||
|
@PostMapping("view.json")
|
||||||
|
@ResponseBody
|
||||||
|
public Map<String, Object> viewData(@RequestParam("ratePlanId") Integer ratePlanId) {
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
try {
|
||||||
|
RatePlanResponseDto detailData = ratePlanService.getRatePlanDetail(ratePlanId);
|
||||||
|
result.put("result", "success");
|
||||||
|
result.put("data", detailData);
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.put("result", "fail");
|
||||||
|
result.put("message", e.getMessage());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void chkSelectList(List<RatePlan> list) throws JsonDataException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void chkSelect(RatePlan data) throws JsonDataException {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package net.jwsi.jcms.vpp.ratePlan;
|
||||||
|
|
||||||
|
import net.jwsi.jcms.base.BaseRecStRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface RatePlanRepository extends BaseRecStRepository<RatePlan,Integer> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package net.jwsi.jcms.vpp.ratePlan;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import net.jwsi.jcms.vpp.RatePlanDetailTime.RatePlanDetailTime;
|
||||||
|
import net.jwsi.jcms.vpp.chargerRatePlan.ChargerRatePlan;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
public class RatePlanResponseDto {
|
||||||
|
|
||||||
|
private Integer ratePlanId;
|
||||||
|
private String ratePlanName;
|
||||||
|
private String ratePlanType;
|
||||||
|
private String seasonType;
|
||||||
|
private String applyStartDate;
|
||||||
|
private String applyEndDate;
|
||||||
|
private Double fixedPrice;
|
||||||
|
private String isActive;
|
||||||
|
private String approvalStatus;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
|
// 계시별 단가 리스트
|
||||||
|
private List<DetailsTimeDto> detailsTime;
|
||||||
|
|
||||||
|
// 적용 대상 충전기 리스트
|
||||||
|
private List<ChargerListDto> chargerList;
|
||||||
|
|
||||||
|
public RatePlan toEntity() {
|
||||||
|
RatePlan ratePlan = new RatePlan();
|
||||||
|
ratePlan.setRatePlanId(this.ratePlanId);
|
||||||
|
ratePlan.setRatePlanName(this.ratePlanName);
|
||||||
|
ratePlan.setRatePlanType(this.ratePlanType);
|
||||||
|
ratePlan.setSeasonType(this.seasonType);
|
||||||
|
ratePlan.setApplyStartDate(this.applyStartDate);
|
||||||
|
ratePlan.setApplyEndDate(this.applyEndDate);
|
||||||
|
ratePlan.setFixedPrice(this.fixedPrice);
|
||||||
|
ratePlan.setApprovalStatus(this.approvalStatus);
|
||||||
|
return ratePlan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RatePlanDetailTime> toDetailTimeEntities() {
|
||||||
|
List<RatePlanDetailTime> detailTimeList = new ArrayList<>();
|
||||||
|
if (this.detailsTime == null) return detailTimeList;
|
||||||
|
|
||||||
|
for (DetailsTimeDto seasonDto : this.detailsTime) {
|
||||||
|
if (seasonDto.getTimeRates() == null) continue;
|
||||||
|
|
||||||
|
for (TimeRateDto timeRateDto : seasonDto.getTimeRates()) {
|
||||||
|
RatePlanDetailTime detailTime = new RatePlanDetailTime();
|
||||||
|
detailTime.setRatePlanId(this.ratePlanId);
|
||||||
|
detailTime.setSeasonType(seasonDto.getSeasonType());
|
||||||
|
detailTime.setTimeSlotId(timeRateDto.getId());
|
||||||
|
detailTime.setPrice(timeRateDto.getPrice());
|
||||||
|
|
||||||
|
detailTimeList.add(detailTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return detailTimeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ChargerRatePlan> toChargerRatePlanEntities() {
|
||||||
|
List<ChargerRatePlan> chargerRatePlanList = new ArrayList<>();
|
||||||
|
if (this.chargerList == null) return chargerRatePlanList;
|
||||||
|
|
||||||
|
for (ChargerListDto chargerDto : this.chargerList) {
|
||||||
|
ChargerRatePlan chargerRatePlan = new ChargerRatePlan();
|
||||||
|
if (this.ratePlanId != null && chargerDto.getChargerCd() != null) {
|
||||||
|
chargerRatePlan.setRatePlanId((this.ratePlanId));
|
||||||
|
}
|
||||||
|
chargerRatePlan.setChargerCd(chargerDto.getChargerCd());
|
||||||
|
chargerRatePlan.setApplyStartDate(chargerDto.getApplyStartDate());
|
||||||
|
chargerRatePlan.setApplyEndDate(chargerDto.getApplyEndDate());
|
||||||
|
|
||||||
|
if (chargerDto.getIsActive() != null) {
|
||||||
|
chargerRatePlan.setIsActive(chargerDto.getIsActive() ? "Y" : "N");
|
||||||
|
}
|
||||||
|
|
||||||
|
chargerRatePlanList.add(chargerRatePlan);
|
||||||
|
}
|
||||||
|
return chargerRatePlanList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
public static class DetailsTimeDto {
|
||||||
|
private String seasonType;
|
||||||
|
private List<TimeRateDto> timeRates;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
public static class TimeRateDto {
|
||||||
|
private Integer id;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
private Double price;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
public static class ChargerListDto {
|
||||||
|
private String chargerCd;
|
||||||
|
private String applyStartDate;
|
||||||
|
private String applyEndDate;
|
||||||
|
private Boolean isActive;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,200 @@
|
|||||||
|
package net.jwsi.jcms.vpp.ratePlan;
|
||||||
|
|
||||||
|
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.RatePlanDetailTime.RatePlanDetailTime;
|
||||||
|
import net.jwsi.jcms.vpp.RatePlanDetailTime.RatePlanDetailTimeRepository;
|
||||||
|
import net.jwsi.jcms.vpp.api.ApiClient;
|
||||||
|
import net.jwsi.jcms.vpp.api.ApiResponse;
|
||||||
|
import net.jwsi.jcms.vpp.chargerRatePlan.ChargerRatePlan;
|
||||||
|
import net.jwsi.jcms.vpp.chargerRatePlan.ChargerRatePlanRepository;
|
||||||
|
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.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class RatePlanService extends BaseService<RatePlan, Integer, RatePlanRepository> {
|
||||||
|
|
||||||
|
private final ApiClient apiClient;
|
||||||
|
private final RatePlanRepository ratePlanRepository;
|
||||||
|
private final RatePlanDetailTimeRepository ratePlanDetailTimeRepository;
|
||||||
|
private final ChargerRatePlanRepository chargerRatePlanRepository;
|
||||||
|
|
||||||
|
public RatePlanService(RatePlanRepository repository, ApiClient apiClient, RatePlanRepository ratePlanRepository, RatePlanDetailTimeRepository ratePlanDetailTimeRepository, ChargerRatePlanRepository chargerRatePlanRepository) {
|
||||||
|
super(repository);
|
||||||
|
this.apiClient = apiClient;
|
||||||
|
this.ratePlanRepository = ratePlanRepository;
|
||||||
|
this.ratePlanDetailTimeRepository = ratePlanDetailTimeRepository;
|
||||||
|
this.chargerRatePlanRepository = chargerRatePlanRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Scheduled(cron = "0 0 0 * * *")
|
||||||
|
public void getRatePlan() {
|
||||||
|
ApiResponse<List<RatePlanResponseDto>> response = apiClient.fetchRatePlan();
|
||||||
|
|
||||||
|
if (response == null || !Integer.valueOf(200).equals(response.getCode())) {
|
||||||
|
String msg = (response != null) ? response.getMessage() : "응답 없음";
|
||||||
|
throw new RuntimeException("API 호출 실패: " + msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<RatePlanResponseDto> dtoList = response.getData();
|
||||||
|
if (dtoList == null || dtoList.isEmpty()) {
|
||||||
|
log.info("가져온 요금제 데이터가 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<RatePlan> ratePlanEntities = new ArrayList<>();
|
||||||
|
List<RatePlanDetailTime> allDetailTimes = new ArrayList<>();
|
||||||
|
List<ChargerRatePlan> allChargerRatePlans = new ArrayList<>();
|
||||||
|
|
||||||
|
Set<Integer> processedIds = new HashSet<>();
|
||||||
|
|
||||||
|
for (RatePlanResponseDto dto : dtoList) {
|
||||||
|
Integer currentRatePlanId = dto.getRatePlanId();
|
||||||
|
|
||||||
|
if (processedIds.contains(currentRatePlanId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
processedIds.add(currentRatePlanId);
|
||||||
|
|
||||||
|
RatePlan entity = ratePlanRepository.findById(currentRatePlanId)
|
||||||
|
.orElseGet(() -> {
|
||||||
|
RatePlan newEntity = new RatePlan();
|
||||||
|
newEntity.setRatePlanId(currentRatePlanId);
|
||||||
|
return newEntity;
|
||||||
|
});
|
||||||
|
|
||||||
|
entity.setRatePlanName(dto.getRatePlanName());
|
||||||
|
entity.setRatePlanType(dto.getRatePlanType());
|
||||||
|
entity.setSeasonType(dto.getSeasonType());
|
||||||
|
entity.setApplyStartDate(dto.getApplyStartDate());
|
||||||
|
entity.setApplyEndDate(dto.getApplyEndDate());
|
||||||
|
entity.setFixedPrice(dto.getFixedPrice());
|
||||||
|
entity.setApprovalStatus(dto.getApprovalStatus());
|
||||||
|
entity.setIsActive(dto.getIsActive());
|
||||||
|
|
||||||
|
ratePlanEntities.add(entity);
|
||||||
|
|
||||||
|
allDetailTimes.addAll(dto.toDetailTimeEntities());
|
||||||
|
allChargerRatePlans.addAll(dto.toChargerRatePlanEntities());
|
||||||
|
|
||||||
|
ratePlanDetailTimeRepository.deleteByRatePlanId(currentRatePlanId);
|
||||||
|
chargerRatePlanRepository.deleteByRatePlanId(currentRatePlanId);
|
||||||
|
}
|
||||||
|
|
||||||
|
ratePlanRepository.saveAll(ratePlanEntities);
|
||||||
|
|
||||||
|
ratePlanDetailTimeRepository.flush();
|
||||||
|
chargerRatePlanRepository.flush();
|
||||||
|
|
||||||
|
if (!allDetailTimes.isEmpty()) {
|
||||||
|
ratePlanDetailTimeRepository.saveAll(allDetailTimes);
|
||||||
|
}
|
||||||
|
if (!allChargerRatePlans.isEmpty()) {
|
||||||
|
chargerRatePlanRepository.saveAll(allChargerRatePlans);
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("요금제 동기화 완료: 마스터 {}건, 상세단가 {}건, 충전기매핑 {}건",
|
||||||
|
ratePlanEntities.size(), allDetailTimes.size(), allChargerRatePlans.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
public RatePlanResponseDto getRatePlanDetail(Integer ratePlanId) {
|
||||||
|
RatePlan ratePlan = ratePlanRepository.findById(ratePlanId)
|
||||||
|
.orElseThrow(() -> new RuntimeException("해당 요금제를 찾을 수 없습니다. ID: " + ratePlanId));
|
||||||
|
|
||||||
|
RatePlanResponseDto dto = new RatePlanResponseDto();
|
||||||
|
dto.setRatePlanId(ratePlan.getRatePlanId());
|
||||||
|
dto.setRatePlanName(ratePlan.getRatePlanName());
|
||||||
|
dto.setRatePlanType(ratePlan.getRatePlanType());
|
||||||
|
dto.setSeasonType(ratePlan.getSeasonType());
|
||||||
|
dto.setApplyStartDate(ratePlan.getApplyStartDate());
|
||||||
|
dto.setApplyEndDate(ratePlan.getApplyEndDate());
|
||||||
|
dto.setFixedPrice(ratePlan.getFixedPrice());
|
||||||
|
dto.setIsActive(ratePlan.getIsActive());
|
||||||
|
dto.setApprovalStatus(ratePlan.getApprovalStatus());
|
||||||
|
dto.setDescription(ratePlan.getDescription());
|
||||||
|
|
||||||
|
List<RatePlanDetailTime> detailTimes = ratePlanDetailTimeRepository.findByRatePlanId(ratePlanId);
|
||||||
|
Map<String, List<RatePlanDetailTime>> groupedBySeason = detailTimes.stream()
|
||||||
|
.collect(Collectors.groupingBy(RatePlanDetailTime::getSeasonType));
|
||||||
|
|
||||||
|
List<RatePlanResponseDto.DetailsTimeDto> detailsTimeDtos = new ArrayList<>();
|
||||||
|
for (Map.Entry<String, List<RatePlanDetailTime>> entry : groupedBySeason.entrySet()) {
|
||||||
|
RatePlanResponseDto.DetailsTimeDto seasonDto = new RatePlanResponseDto.DetailsTimeDto();
|
||||||
|
seasonDto.setSeasonType(entry.getKey());
|
||||||
|
seasonDto.setTimeRates(entry.getValue().stream().map(dt -> {
|
||||||
|
RatePlanResponseDto.TimeRateDto tr = new RatePlanResponseDto.TimeRateDto();
|
||||||
|
tr.setId(dt.getTimeSlotId());
|
||||||
|
tr.setPrice(dt.getPrice());
|
||||||
|
return tr;
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
|
detailsTimeDtos.add(seasonDto);
|
||||||
|
}
|
||||||
|
dto.setDetailsTime(detailsTimeDtos);
|
||||||
|
|
||||||
|
List<ChargerRatePlan> chargerRatePlans = chargerRatePlanRepository.findByRatePlanId(ratePlanId);
|
||||||
|
|
||||||
|
log.info("🚨 [디버깅] 조회된 충전기 매핑 개수: {}", chargerRatePlans.size());
|
||||||
|
|
||||||
|
List<RatePlanResponseDto.ChargerListDto> chargerListDtos = chargerRatePlans.stream().map(cp -> {
|
||||||
|
RatePlanResponseDto.ChargerListDto cpDto = new RatePlanResponseDto.ChargerListDto();
|
||||||
|
cpDto.setChargerCd(cp.getChargerCd());
|
||||||
|
cpDto.setApplyStartDate(cp.getApplyStartDate());
|
||||||
|
cpDto.setApplyEndDate(cp.getApplyEndDate());
|
||||||
|
cpDto.setIsActive("Y".equals(cp.getIsActive()));
|
||||||
|
return cpDto;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
dto.setChargerList(chargerListDtos);
|
||||||
|
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Integer getUserId() {
|
||||||
|
return HttpUtil.getUserId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getUserName(Integer id) {
|
||||||
|
return LoginUtil.getUserName(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected RatePlan newSearchParam(RatePlan ratePlan) {
|
||||||
|
if (ratePlan == null) {
|
||||||
|
ratePlan = new RatePlan();
|
||||||
|
}
|
||||||
|
return ratePlan;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected EnumSqlType useSqlTyp() {
|
||||||
|
return EnumSqlType.SPECIFICATION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Specification<RatePlan> getSpecification(RatePlan ratePlan) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Page<RatePlan> _selectPage(RatePlan ratePlan) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<RatePlan> _selectList(RatePlan ratePlan) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package net.jwsi.jcms.vpp.timeslots;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import net.jwsi.jcms.base.BaseStEntity;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@Entity(name="vpp_time_slots")
|
||||||
|
public class TimeSlots extends BaseStEntity {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer id; //시간대 id(pk)
|
||||||
|
private String name; //시간대명 (예: 경부하, 최대부하, 09시)
|
||||||
|
private String slotType; //시간대 구분 (basic=계시별, hour=시간단위)
|
||||||
|
private Integer hourNumber; //시간 구분 (slot_type=hour일 경우 0~23)
|
||||||
|
private String startTime; //시작 시간
|
||||||
|
private String endTime; //종료 시간
|
||||||
|
private String description; //시간대 설명
|
||||||
|
private String isActive; //활성화 여부
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package net.jwsi.jcms.vpp.timeslots;
|
||||||
|
|
||||||
|
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.RequestMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping("/cms/timeSlots")
|
||||||
|
public class TimeSlotsController extends BaseController<TimeSlots,Integer,TimeSlotsRepository,TimeSlotsService> {
|
||||||
|
public TimeSlotsController(TimeSlotsService service) {
|
||||||
|
super(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void chkSelectList(List<TimeSlots> list) throws JsonDataException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void chkSelect(TimeSlots data) throws JsonDataException {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package net.jwsi.jcms.vpp.timeslots;
|
||||||
|
|
||||||
|
import net.jwsi.jcms.base.BaseRecStRepository;
|
||||||
|
|
||||||
|
public interface TimeSlotsRepository extends BaseRecStRepository<TimeSlots,Integer> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package net.jwsi.jcms.vpp.timeslots;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.jwsi.jcms.base.BaseService;
|
||||||
|
import net.jwsi.jcms.base.EnumSqlType;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class TimeSlotsService extends BaseService<TimeSlots,Integer,TimeSlotsRepository> {
|
||||||
|
public TimeSlotsService(TimeSlotsRepository repository) {
|
||||||
|
super(repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Integer getUserId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getUserName(Integer id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected TimeSlots newSearchParam(TimeSlots timeSlots) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected EnumSqlType useSqlTyp() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Specification<TimeSlots> getSpecification(TimeSlots timeSlots) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Page<TimeSlots> _selectPage(TimeSlots timeSlots) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<TimeSlots> _selectList(TimeSlots timeSlots) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,12 +6,6 @@
|
|||||||
<div th:replace="~{common/fragments/searchBox :: SearchBoxFragment(~{ :: #searchBoxContent}, ~{ :: #searchBoxFooter})}">
|
<div th:replace="~{common/fragments/searchBox :: SearchBoxFragment(~{ :: #searchBoxContent}, ~{ :: #searchBoxFooter})}">
|
||||||
<div id="searchBoxContent">
|
<div id="searchBoxContent">
|
||||||
<div class="row px-2">
|
<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:180px">provider_id</span>
|
|
||||||
<input type="text" id="providerIdLike" name="providerIdLike" class="form-control" placeholder="provider_id 입력" maxlength="50">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-text" style="width:180px">st_id</span>
|
<span class="input-group-text" style="width:180px">st_id</span>
|
||||||
@@ -24,18 +18,6 @@
|
|||||||
<input type="text" id="chgrIdLike" name="chgrIdLike" class="form-control" placeholder="chgr_id 입력" maxlength="50">
|
<input type="text" id="chgrIdLike" name="chgrIdLike" class="form-control" placeholder="chgr_id 입력" maxlength="50">
|
||||||
</div>
|
</div>
|
||||||
</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:180px">상태 일시</span>
|
|
||||||
<input type="text" id="stateDtLike" name="stateDtLike" 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:180px">op_mode</span>
|
|
||||||
<input type="text" id="opModeLike" name="opModeLike" class="form-control" placeholder="op_mode_cd 입력" maxlength="50">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
<div class="col-lg-4 col-sm-6 col-xs-12 pb-1">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-text" style="width:180px">ch1_rechg_state_cd</span>
|
<span class="input-group-text" style="width:180px">ch1_rechg_state_cd</span>
|
||||||
@@ -54,8 +36,8 @@
|
|||||||
<select id="ch1PlugStateCdLike" name="ch1PlugStateCdLike" class="form-control"></select>
|
<select id="ch1PlugStateCdLike" name="ch1PlugStateCdLike" class="form-control"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- row 닫힘 -->
|
</div>
|
||||||
</div> <!-- searchBoxContent 닫힘 -->
|
</div>
|
||||||
|
|
||||||
<div id="searchBoxFooter">
|
<div id="searchBoxFooter">
|
||||||
<div class="row float-end">
|
<div class="row float-end">
|
||||||
@@ -67,9 +49,9 @@
|
|||||||
</th:block>
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- searchBoxFooter 닫힘 -->
|
</div>
|
||||||
</div> <!-- SearchBoxFragment 닫힘 -->
|
</div>
|
||||||
</div> <!-- w-100 닫힘 -->
|
</div>
|
||||||
|
|
||||||
<div class="w-100">
|
<div class="w-100">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
@@ -79,13 +61,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 권한 변수 선언 -->
|
|
||||||
<script th:inline="javascript">
|
|
||||||
const menuRoleWrite = /*[[${menuRole != null ? menuRole.roleWrite : false}]]*/ false;
|
|
||||||
const menuRoleModify = /*[[${menuRole != null ? menuRole.roleModify : false}]]*/ false;
|
|
||||||
const menuRoleDel = /*[[${menuRole != null ? menuRole.roleDel : false}]]*/ false;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script th:inline="none">
|
<script th:inline="none">
|
||||||
const rootPath = "/cms/chgrCurrState/";
|
const rootPath = "/cms/chgrCurrState/";
|
||||||
let datatable;
|
let datatable;
|
||||||
@@ -120,9 +95,7 @@
|
|||||||
{title: "사업자 ID", name: "provider_id", data: "providerId", className},
|
{title: "사업자 ID", name: "provider_id", data: "providerId", className},
|
||||||
{title: "충전소 ID", name: "st_id", data: "stId", className},
|
{title: "충전소 ID", name: "st_id", data: "stId", className},
|
||||||
{title: "충전기 ID", name: "chgr_id", data: "chgrId", className},
|
{title: "충전기 ID", name: "chgr_id", data: "chgrId", className},
|
||||||
{title: "상태 일시", name: "state_dt", data: "stateDt", className, orderable: false},
|
|
||||||
{title: "운영모드", name: "op_mode", data: "opMode", className, orderable: false},
|
{title: "운영모드", name: "op_mode", data: "opMode", className, orderable: false},
|
||||||
|
|
||||||
{title: "CH1 상태", orderable: false, className,
|
{title: "CH1 상태", orderable: false, className,
|
||||||
render: (data, type, row) => {
|
render: (data, type, row) => {
|
||||||
let s1 = getCdDtlDtColNm(ch1RechgStateCdCdList, row["ch1RechgStateCd"]) || "";
|
let s1 = getCdDtlDtColNm(ch1RechgStateCdCdList, row["ch1RechgStateCd"]) || "";
|
||||||
@@ -131,6 +104,8 @@
|
|||||||
return `<div class="d-flex justify-content-center gap-1">${s1} ${s2} ${s3}</div>`;
|
return `<div class="d-flex justify-content-center gap-1">${s1} ${s2} ${s3}</div>`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{title: "상태 일시", name: "state_dt", data: "stateDt", className, orderable: false},
|
||||||
{title: "integrated_kwh", name: "integrated_kwh", data: "integratedKwh", className, visible: false},
|
{title: "integrated_kwh", name: "integrated_kwh", data: "integratedKwh", className, visible: false},
|
||||||
{title: "dc_power_wh", name: "dc_power_wh", data: "dcPowerWh", className, visible: false},
|
{title: "dc_power_wh", name: "dc_power_wh", data: "dcPowerWh", className, visible: false},
|
||||||
{title: "ac_power_wh", name: "ac_power_wh", data: "acPowerWh", className, visible: false},
|
{title: "ac_power_wh", name: "ac_power_wh", data: "acPowerWh", className, visible: false},
|
||||||
|
|||||||
@@ -0,0 +1,350 @@
|
|||||||
|
<!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:120px">요금제명</span>
|
||||||
|
<input type="text" id="ratePlanNameLike" name="ratePlanNameLike" 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:120px">승인 상태</span>
|
||||||
|
<select id="approvalStatusLike" name="approvalStatusLike" class="form-control">
|
||||||
|
<option value="">전체</option>
|
||||||
|
<option value="approved">승인완료</option>
|
||||||
|
<option value="pending">대기중</option>
|
||||||
|
</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:120px">활성화 여부</span>
|
||||||
|
<select id="isActiveLike" name="isActiveLike" class="form-control">
|
||||||
|
<option value="">전체</option>
|
||||||
|
<option value="true">활성</option>
|
||||||
|
<option value="false">비활성</option>
|
||||||
|
</select>
|
||||||
|
</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>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#ratePlanDetailScrollArea {
|
||||||
|
max-height: 65vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
#ratePlanDetailScrollArea::-webkit-scrollbar { width: 6px; }
|
||||||
|
#ratePlanDetailScrollArea::-webkit-scrollbar-track { background: #f5f5f5; border-radius: 3px; }
|
||||||
|
#ratePlanDetailScrollArea::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
|
||||||
|
#ratePlanDetailScrollArea::-webkit-scrollbar-thumb:hover { background: #b5b5b5; }
|
||||||
|
|
||||||
|
.custom-card {
|
||||||
|
border: 1px solid #e5e5e5;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.custom-card-header {
|
||||||
|
color: #333;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 0.88rem;
|
||||||
|
padding: 0.6rem 1rem;
|
||||||
|
border-bottom: 1px solid #e5e5e5;
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
.custom-card-body {
|
||||||
|
padding: 0.75rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-table th, .info-table td {
|
||||||
|
padding: 0.15rem 0 !important;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
.info-table th { font-weight: 600; width: 100px; color: #222; }
|
||||||
|
|
||||||
|
.price-table { font-size: 0.85rem; border-color: #e5e5e5; }
|
||||||
|
.price-table th, .price-table td { border-color: #e5e5e5; padding: 0.5rem; }
|
||||||
|
.price-table thead th { border-bottom-width: 1px; font-weight: 600; color: #555; }
|
||||||
|
.price-table thead th:first-child { color: #222; }
|
||||||
|
|
||||||
|
.val-price { color: #222; font-weight: 700; }
|
||||||
|
.val-unit { color: #999; font-size: 0.8rem; }
|
||||||
|
|
||||||
|
.charger-item {
|
||||||
|
border: 1px solid #e5e5e5;
|
||||||
|
border-radius: 0.35rem;
|
||||||
|
padding: 0.6rem;
|
||||||
|
background-color: #fff;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.charger-cd { font-size: 0.9rem; font-weight: bold; color: #222; margin-bottom: 0.1rem; }
|
||||||
|
.charger-dt { font-size: 0.75rem; color: #aaa; margin-bottom: 0.4rem; }
|
||||||
|
|
||||||
|
.badge-square {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
color: #333;
|
||||||
|
border: 1px solid #d8d8d8;
|
||||||
|
padding: 0.15rem 0.4rem;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.badge-square.active {
|
||||||
|
background-color: #eef1fb;
|
||||||
|
color: #3b5bdb;
|
||||||
|
border-color: #d6dcf5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.approval-ok { color: #333; font-weight: 600; }
|
||||||
|
.approval-ok i { color: #3b5bdb; }
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script th:inline="none">
|
||||||
|
const rootPath = "/cms/ratePlan/";
|
||||||
|
let datatable;
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
const className = "dt-head-center dt-body-center";
|
||||||
|
datatable = newDataTable(
|
||||||
|
"#datatable",
|
||||||
|
rootPath + "list.json",
|
||||||
|
function(d) {
|
||||||
|
if (strUtil.isNotEmpty($('#ratePlanNameLike').val())) {d.ratePlanName = $('#ratePlanNameLike').val();}
|
||||||
|
if (strUtil.isNotEmpty($('#approvalStatusLike').val())) {d.approvalStatus = $('#approvalStatusLike').val();}
|
||||||
|
if (strUtil.isNotEmpty($('#isActiveLike').val())) {d.isActive = $('#isActiveLike').val();}
|
||||||
|
return d;
|
||||||
|
},
|
||||||
|
{
|
||||||
|
order: [[0, 'desc']],
|
||||||
|
columns: [
|
||||||
|
{title: "요금제 ID", name: "RATE_PLAN_ID", data: "ratePlanId", className, width: "80px"},
|
||||||
|
{title: "요금제명", name: "RATE_PLAN_NAME", data: "ratePlanName", className: "dt-head-center dt-body-left"},
|
||||||
|
{title: "요금제 구분", name: "RATE_PLAN_TYPE", data: "ratePlanType", className,
|
||||||
|
render: (data) => data === 'time' ? '계시별 요금제' : data
|
||||||
|
},
|
||||||
|
{title: "적용 시작일", name: "APPLY_START_DATE", data: "applyStartDate", className, width: "120px"},
|
||||||
|
{title: "적용 종료일", name: "APPLY_END_DATE", data: "applyEndDate", className, width: "120px"},
|
||||||
|
{title: "승인 상태", name: "APPROVAL_STATUS", data: "approvalStatus", className, width: "100px",
|
||||||
|
render: (data) => data === 'approved' ? '<span class="text-success fw-bold"><i class="bi bi-check-lg"></i> 승인완료</span>' : '<span class="text-secondary">대기중</span>'
|
||||||
|
},
|
||||||
|
{title: "활성화", name: "IS_ACTIVE", data: "isActive", className, width: "80px",
|
||||||
|
render: (data) => data === "true" || data === 'Y' ? '<span class="text-primary fw-bold">활성</span>' : '<span class="text-secondary">비활성</span>'
|
||||||
|
},
|
||||||
|
{title: "기능", orderable:false, width:"80px",
|
||||||
|
render: (data, type, row) => {
|
||||||
|
return mkRowDataFunctions({ratePlanId: row['ratePlanId']}, row['ratePlanName'], true, false, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
allCheck: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const showModal = (mode, ids, title) => {
|
||||||
|
if(!checkRole(mode)) { alert("권한이 없습니다."); return; }
|
||||||
|
|
||||||
|
let modalInputArray = [
|
||||||
|
new ModalInput({
|
||||||
|
inputType: ModalInputType.customer,
|
||||||
|
inputId: "detailViewTemplate",
|
||||||
|
inputName: "detailViewTemplate",
|
||||||
|
options: () => {
|
||||||
|
return `
|
||||||
|
<div class="col-12 p-0" id="ratePlanDetailScrollArea">
|
||||||
|
<div class="custom-card">
|
||||||
|
<div class="custom-card-header">기본 정보</div>
|
||||||
|
<div class="custom-card-body">
|
||||||
|
<table class="table table-borderless mb-0 info-table">
|
||||||
|
<tr><th>요금제명:</th><td id="v_ratePlanName">-</td></tr>
|
||||||
|
<tr><th>요금제 구분:</th><td id="v_ratePlanType">-</td></tr>
|
||||||
|
<tr><th>적용 기간:</th><td id="v_applyDate">-</td></tr>
|
||||||
|
<tr><th>활성화 상태:</th><td id="v_isActive">-</td></tr>
|
||||||
|
<tr><th>설명:</th><td id="v_description">-</td></tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-card">
|
||||||
|
<div class="custom-card-header">승인 정보</div>
|
||||||
|
<div class="custom-card-body">
|
||||||
|
<table class="table table-borderless mb-0 info-table">
|
||||||
|
<tr><th>승인 상태:</th><td id="v_approvalStatus">-</td></tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-card">
|
||||||
|
<div class="custom-card-header">시간대별 단가 설정</div>
|
||||||
|
<div class="custom-card-body p-0">
|
||||||
|
<table class="table mb-0 text-center align-middle price-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="border-end text-dark">시간대구분</th>
|
||||||
|
<th>봄 (Spring)</th>
|
||||||
|
<th>여름 (Summer)</th>
|
||||||
|
<th>가을 (Fall)</th>
|
||||||
|
<th>겨울 (Winter)</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="border-end py-2">
|
||||||
|
<div class="fw-bold text-dark">경부하</div>
|
||||||
|
<div class="text-muted" style="font-size:0.7rem; letter-spacing: -0.5px;">(22:00~08:00)</div>
|
||||||
|
</td>
|
||||||
|
<td id="price_spring_4">-</td>
|
||||||
|
<td id="price_summer_4">-</td>
|
||||||
|
<td id="price_fall_4">-</td>
|
||||||
|
<td id="price_winter_4">-</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="border-end py-2">
|
||||||
|
<div class="fw-bold text-dark">중간부하</div>
|
||||||
|
<div class="text-muted" style="font-size:0.7rem; letter-spacing: -0.5px;">(08:00~16:00)</div>
|
||||||
|
</td>
|
||||||
|
<td id="price_spring_12">-</td>
|
||||||
|
<td id="price_summer_12">-</td>
|
||||||
|
<td id="price_fall_12">-</td>
|
||||||
|
<td id="price_winter_12">-</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="border-end py-2">
|
||||||
|
<div class="fw-bold text-dark">최대부하</div>
|
||||||
|
<div class="text-muted" style="font-size:0.7rem; letter-spacing: -0.5px;">(16:00~22:00)</div>
|
||||||
|
</td>
|
||||||
|
<td id="price_spring_20">-</td>
|
||||||
|
<td id="price_summer_20">-</td>
|
||||||
|
<td id="price_fall_20">-</td>
|
||||||
|
<td id="price_winter_20">-</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-card mb-1">
|
||||||
|
<div class="custom-card-header" style="border-bottom: 1px solid #e5e5e5;">
|
||||||
|
적용 충전기 목록 (<span id="v_chargerCount">0</span>개)
|
||||||
|
</div>
|
||||||
|
<div class="custom-card-body pt-3 pb-2" style="background-color: #fcfcfc;">
|
||||||
|
<div class="row g-2" id="v_chargerListArea"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
const loadUrl = rootPath + "view.json";
|
||||||
|
const modalWidth = 780;
|
||||||
|
const labelWidth = '1px';
|
||||||
|
|
||||||
|
if(mode === ModalMode.VIEW || mode === ModalMode.VIEW_ONLY) {
|
||||||
|
newModal(new ModalInfo({modalTitle: "요금제 상세보기", inputArray: modalInputArray, modalWidth}), mode, 'main', {
|
||||||
|
loadUrl: loadUrl,
|
||||||
|
ids: ids,
|
||||||
|
labelWidth: labelWidth,
|
||||||
|
callInit: function(param1, param2, param3) {
|
||||||
|
let data;
|
||||||
|
if (param1 && param1.ratePlanId) data = param1;
|
||||||
|
else if (param2 && param2.ratePlanId) data = param2;
|
||||||
|
else if (param1 && param1.data) data = param1.data;
|
||||||
|
else if (param2 && param2.data) data = param2.data;
|
||||||
|
|
||||||
|
if(!data) {
|
||||||
|
console.error("데이터 추출 실패!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
$('#v_ratePlanName').text(data.ratePlanName || '-');
|
||||||
|
$('#v_ratePlanType').text(data.ratePlanType === 'time' ? '계시별 요금제' : data.ratePlanType);
|
||||||
|
$('#v_applyDate').text(`${data.applyStartDate || ''} ~ ${data.applyEndDate || ''}`);
|
||||||
|
$('#v_isActive').text((data.isActive === "true" || data.isActive === 'Y' || data.active === true) ? '활성화' : '비활성');
|
||||||
|
$('#v_description').text(data.description || '-');
|
||||||
|
|
||||||
|
if(data.approvalStatus === 'approved') {
|
||||||
|
$('#v_approvalStatus').html('<span class="approval-ok"><i class="bi bi-check-lg"></i> 승인완료</span>');
|
||||||
|
} else {
|
||||||
|
$('#v_approvalStatus').text(data.approvalStatus || '대기중');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.detailsTime && data.detailsTime.length > 0) {
|
||||||
|
data.detailsTime.forEach(seasonData => {
|
||||||
|
let season = seasonData.seasonType;
|
||||||
|
if(seasonData.timeRates) {
|
||||||
|
seasonData.timeRates.forEach(rate => {
|
||||||
|
$(`#price_${season}_${rate.id}`).html(`<span class="val-price">${rate.price}</span> <span class="val-unit">원/kWh</span>`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.chargerList && data.chargerList.length > 0) {
|
||||||
|
$('#v_chargerCount').text(data.chargerList.length);
|
||||||
|
let chargerHtml = data.chargerList.map(c => {
|
||||||
|
let isActive = (c.isActive === true || c.active === true || c.isActive === 'Y');
|
||||||
|
let badgeClass = isActive ? 'badge-square active' : 'badge-square';
|
||||||
|
let badgeText = isActive ? '적용중' : '중지';
|
||||||
|
|
||||||
|
return `
|
||||||
|
<div class="col-6 col-sm-4 mb-2">
|
||||||
|
<div class="charger-item">
|
||||||
|
<div class="charger-cd"><i class="bi bi-ev-front"></i> ${c.chargerCd}</div>
|
||||||
|
<div class="charger-dt">${c.applyStartDate || ''} ~ ${c.applyEndDate || ''}</div>
|
||||||
|
<div><span class="${badgeClass}">${badgeText}</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`}).join('');
|
||||||
|
$('#v_chargerListArea').html(chargerHtml);
|
||||||
|
} else {
|
||||||
|
$('#v_chargerCount').text('0');
|
||||||
|
$('#v_chargerListArea').html('<div class="col-12 text-center text-muted py-4">적용된 충전기가 없습니다.</div>');
|
||||||
|
}
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$("#searchBtn").click(function() { datatable.ajax.reload(); });
|
||||||
|
$("#resetBtn").click(function() {
|
||||||
|
$("#ratePlanNameLike").val("");
|
||||||
|
$("#approvalStatusLike").val("");
|
||||||
|
$("#isActiveLike").val("");
|
||||||
|
datatable.ajax.reload();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</section>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user