l3能源成本分摊(部分完成留存)
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
package com.klp.ems.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.ems.domain.bo.EmsRateTierBo;
|
||||
import com.klp.ems.domain.vo.EmsRateTierVo;
|
||||
import com.klp.ems.service.IEmsRateTierService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 梯度费率
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ems/rateTier")
|
||||
public class EmsRateTierController extends BaseController {
|
||||
|
||||
private final IEmsRateTierService iEmsRateTierService;
|
||||
|
||||
/**
|
||||
* 查询梯度费率列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<EmsRateTierVo> list(EmsRateTierBo bo, PageQuery pageQuery) {
|
||||
return iEmsRateTierService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据费率ID查询梯度费率列表
|
||||
*/
|
||||
@GetMapping("/listByRate/{energyRateId}")
|
||||
public R<List<EmsRateTierVo>> listByRate(@NotNull(message = "费率ID不能为空")
|
||||
@PathVariable Long energyRateId) {
|
||||
return R.ok(iEmsRateTierService.queryByRateId(energyRateId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出梯度费率列表
|
||||
*/
|
||||
@Log(title = "梯度费率", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(EmsRateTierBo bo, HttpServletResponse response) {
|
||||
List<EmsRateTierVo> list = iEmsRateTierService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "梯度费率", EmsRateTierVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取梯度费率详细信息
|
||||
*/
|
||||
@GetMapping("/{tierId}")
|
||||
public R<EmsRateTierVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long tierId) {
|
||||
return R.ok(iEmsRateTierService.queryById(tierId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增梯度费率
|
||||
*/
|
||||
@Log(title = "梯度费率", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EmsRateTierBo bo) {
|
||||
return toAjax(iEmsRateTierService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改梯度费率
|
||||
*/
|
||||
@Log(title = "梯度费率", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EmsRateTierBo bo) {
|
||||
return toAjax(iEmsRateTierService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除梯度费率
|
||||
*/
|
||||
@Log(title = "梯度费率", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{tierIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] tierIds) {
|
||||
return toAjax(iEmsRateTierService.deleteWithValidByIds(Arrays.asList(tierIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user