电价配置

This commit is contained in:
2025-10-09 19:58:50 +08:00
parent 7121fdecfa
commit d8d0a83c87
11 changed files with 1145 additions and 0 deletions

View File

@ -0,0 +1,89 @@
package com.xzzn.web.controller.ems;
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 com.xzzn.common.annotation.Log;
import com.xzzn.common.core.controller.BaseController;
import com.xzzn.common.core.domain.AjaxResult;
import com.xzzn.common.enums.BusinessType;
import com.xzzn.ems.service.IEmsEnergyPriceConfigService;
import com.xzzn.common.core.page.TableDataInfo;
/**
* 电价配置Controller
*
* @author xzzn
* @date 2025-09-28
*/
@RestController
@RequestMapping("/ems/energyPriceConfig")
public class EmsEnergyPriceConfigController extends BaseController
{
@Autowired
private IEmsEnergyPriceConfigService emsEnergyPriceConfigService;
/**
* 查询电价配置列表
*/
@PreAuthorize("@ss.hasPermi('system:config:list')")
@GetMapping("/list")
public TableDataInfo list()
{
List<EnergyPriceVo> list = emsEnergyPriceConfigService.selectEmsEnergyPriceConfigList();
return getDataTable2(list);
}
/**
* 获取电价配置详细信息
*/
@PreAuthorize("@ss.hasPermi('system:config:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(emsEnergyPriceConfigService.selectEmsEnergyPriceConfigById(id));
}
/**
* 新增电价配置
*/
@PreAuthorize("@ss.hasPermi('system:config:add')")
@Log(title = "电价配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EnergyPriceVo priceVo)
{
return toAjax(emsEnergyPriceConfigService.insertEmsEnergyPriceConfig(priceVo));
}
/**
* 修改电价配置
*/
@PreAuthorize("@ss.hasPermi('system:config:edit')")
@Log(title = "电价配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EnergyPriceVo priceVo)
{
return toAjax(emsEnergyPriceConfigService.updateEmsEnergyPriceConfig(priceVo));
}
/**
* 删除电价配置
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "电价配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(emsEnergyPriceConfigService.deleteEmsEnergyPriceConfigByIds(ids));
}
}