xiaoyi
3 天以前 abf1c0a35d85d38239ff5d2ed746a4e4b797c9d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package cn.iocoder.yudao.module.mes.controller.admin.pd.price;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.mes.controller.admin.pd.price.vo.MesPdPriceCalcReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.pd.price.vo.MesPdPriceCalcRespVO;
import cn.iocoder.yudao.module.mes.service.pd.price.MesPdPriceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - MES 阶梯电价测算")
@RestController
@RequestMapping("/mes/pd/price")
@Validated
public class MesPdPriceController {
 
    @Resource
    private MesPdPriceService priceService;
 
    @PostMapping("/calc")
    @Operation(summary = "阶梯电价测算:分档累计 + 优惠策略")
    @PreAuthorize("@ss.hasPermission('mes:pd-basedata:query')")
    public CommonResult<MesPdPriceCalcRespVO> calcPrice(@Valid @RequestBody MesPdPriceCalcReqVO calcReqVO) {
        return success(priceService.calcPrice(calcReqVO));
    }
 
}