gaoluyang
4 天以前 cdaec80a5ffa474f69e5c36f0312be3c0abf2210
yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/supplier/SrmSupplierController.java
@@ -63,29 +63,34 @@
    @GetMapping("/get")
    @Operation(summary = "获取供应商详情")
    @Parameter(name = "id", description = "编号", required = true)
    @PreAuthorize("@ss.hasPermission('srm:supplier:query')")
    public CommonResult<SrmSupplierRespVO> getSupplier(@RequestParam("id") Long id) {
        SrmSupplierDO supplier = supplierService.getSupplier(id);
        return success(BeanUtils.toBean(supplier, SrmSupplierRespVO.class));
        SrmSupplierRespVO respVO = BeanUtils.toBean(supplier, SrmSupplierRespVO.class);
        if (respVO != null) {
            respVO.setContacts(BeanUtils.toBean(supplierService.getSupplierContactList(id),
                    SrmSupplierContactRespVO.class));
            respVO.setBanks(BeanUtils.toBean(supplierService.getSupplierBankList(id),
                    SrmSupplierBankRespVO.class));
        }
        return success(respVO);
    }
    @GetMapping("/page")
    @Operation(summary = "供应商分页查询")
    @PreAuthorize("@ss.hasPermission('srm:supplier:query')")
    public CommonResult<PageResult<SrmSupplierRespVO>> getSupplierPage(@Valid SrmSupplierPageReqVO pageReqVO) {
        PageResult<SrmSupplierDO> pageResult = supplierService.getSupplierPage(pageReqVO);
        return success(BeanUtils.toBean(pageResult, SrmSupplierRespVO.class));
    }
    @GetMapping("/simple-list")
    @Operation(summary = "获取供应商精简列表(仅返回已通过准入审批的供应商)")
    @Operation(summary = "获取供应商精简列表(仅返回启用状态的供应商)")
    public CommonResult<List<SrmSupplierRespVO>> getSupplierSimpleList() {
        List<SrmSupplierDO> list = supplierService.getSupplierSimpleList();
        return success(BeanUtils.toBean(list, SrmSupplierRespVO.class));
    }
    @GetMapping("/list")
    @Operation(summary = "获取供应商档案列表(不过滤准入状态)")
    @Operation(summary = "获取供应商档案列表(排除停用供应商)")
    public CommonResult<List<SrmSupplierRespVO>> getSupplierAllList() {
        List<SrmSupplierDO> list = supplierService.getSupplierAllList();
        return success(BeanUtils.toBean(list, SrmSupplierRespVO.class));