7 天以前 e1797a873bf114329f4870062201d388155ef014
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
37
38
39
40
41
42
package cn.iocoder.yudao.module.srm.controller.admin.tender;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.SrmTenderConfigRespVO;
import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.SrmTenderConfigSaveReqVO;
import cn.iocoder.yudao.module.srm.service.tender.SrmTenderConfigService;
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.*;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - SRM 招投标配置")
@RestController
@RequestMapping("/srm/tender-config")
@Validated
public class SrmTenderConfigController {
 
    @Resource
    private SrmTenderConfigService tenderConfigService;
 
    @GetMapping("/get")
    @Operation(summary = "获取招投标配置")
    @PreAuthorize("@ss.hasPermission('srm:tender-config:query')")
    public CommonResult<SrmTenderConfigRespVO> getConfig() {
        return success(BeanUtils.toBean(tenderConfigService.getConfig(), SrmTenderConfigRespVO.class));
    }
 
    @PutMapping("/save")
    @Operation(summary = "保存招投标配置")
    @PreAuthorize("@ss.hasPermission('srm:tender-config:update')")
    public CommonResult<Boolean> saveConfig(@Valid @RequestBody SrmTenderConfigSaveReqVO saveReqVO) {
        tenderConfigService.saveConfig(saveReqVO.getDefaultBiddingMode());
        return success(true);
    }
 
}