From 636a2ab73b851047e5f9e5bf1a7c0df1de76ebea Mon Sep 17 00:00:00 2001 From: mashili Date: Fri, 10 Oct 2025 11:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E4=BB=B7=E9=85=8D=E7=BD=AE-=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=A0=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4-?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=8F=AA=E5=8F=96=E5=B9=B4=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ems/EmsEnergyPriceConfigController.java | 13 +++---------- .../ems/service/IEmsEnergyPriceConfigService.java | 2 +- .../impl/EmsEnergyPriceConfigServiceImpl.java | 8 ++++---- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsEnergyPriceConfigController.java b/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsEnergyPriceConfigController.java index e8818d2..b6c8e6a 100644 --- a/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsEnergyPriceConfigController.java +++ b/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsEnergyPriceConfigController.java @@ -5,14 +5,7 @@ import java.util.List; import com.xzzn.ems.domain.vo.EnergyPriceVo; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.xzzn.common.annotation.Log; import com.xzzn.common.core.controller.BaseController; import com.xzzn.common.core.domain.AjaxResult; @@ -38,9 +31,9 @@ public class EmsEnergyPriceConfigController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:config:list')") @GetMapping("/list") - public TableDataInfo list() + public TableDataInfo list(String startTime,String endTime) { - List list = emsEnergyPriceConfigService.selectEmsEnergyPriceConfigList(); + List list = emsEnergyPriceConfigService.selectEmsEnergyPriceConfigList(startTime,endTime); return getDataTable2(list); } diff --git a/ems-system/src/main/java/com/xzzn/ems/service/IEmsEnergyPriceConfigService.java b/ems-system/src/main/java/com/xzzn/ems/service/IEmsEnergyPriceConfigService.java index ae44a2e..1be7b8d 100644 --- a/ems-system/src/main/java/com/xzzn/ems/service/IEmsEnergyPriceConfigService.java +++ b/ems-system/src/main/java/com/xzzn/ems/service/IEmsEnergyPriceConfigService.java @@ -25,7 +25,7 @@ public interface IEmsEnergyPriceConfigService * * @return 电价配置集合 */ - public List selectEmsEnergyPriceConfigList(); + public List selectEmsEnergyPriceConfigList(String startTime,String endTime); /** * 新增电价配置-按月 diff --git a/ems-system/src/main/java/com/xzzn/ems/service/impl/EmsEnergyPriceConfigServiceImpl.java b/ems-system/src/main/java/com/xzzn/ems/service/impl/EmsEnergyPriceConfigServiceImpl.java index d288835..187662b 100644 --- a/ems-system/src/main/java/com/xzzn/ems/service/impl/EmsEnergyPriceConfigServiceImpl.java +++ b/ems-system/src/main/java/com/xzzn/ems/service/impl/EmsEnergyPriceConfigServiceImpl.java @@ -61,12 +61,12 @@ public class EmsEnergyPriceConfigServiceImpl implements IEmsEnergyPriceConfigSer * @return 电价配置 */ @Override - public List selectEmsEnergyPriceConfigList() + public List selectEmsEnergyPriceConfigList(String startTime,String endTime) { List responses = new ArrayList<>(); - // 仅查询当年配置 - LocalDate currentDate = LocalDate.now(); - int currentYear = currentDate.getYear(); + // 根据时间截取年份 + String[] startTimeArr = startTime.split("-"); + int currentYear = Integer.valueOf(startTimeArr[0]); List priceConfigs = emsEnergyPriceConfigMapper.getCurrentYearConfigList(currentYear);