| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TSysQualifications; |
| | | import com.ruoyi.system.query.TSysQualificationsQuery; |
| | | import com.ruoyi.system.service.TSysQualificationsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-08-20 |
| | | */ |
| | | @Api(tags = "资质管理") |
| | | @RestController |
| | | @RequestMapping("/t-sys-qualifications") |
| | | public class TSysQualificationsController { |
| | | |
| | | private final TSysQualificationsService sysQualificationsService; |
| | | @Autowired |
| | | public TSysQualificationsController(TSysQualificationsService sysQualificationsService) { |
| | | this.sysQualificationsService = sysQualificationsService; |
| | | } |
| | | |
| | | /** |
| | | * 获取资质管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取资质管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TSysQualifications>> pageList(@RequestBody TSysQualificationsQuery query) { |
| | | return R.ok(sysQualificationsService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取资质管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取资质管理列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TSysQualifications>> list() { |
| | | return R.ok(sysQualificationsService.list(Wrappers.lambdaQuery(TSysQualifications.class).orderByDesc(TSysQualifications::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | | * 添加资质管理管理 |
| | | */ |
| | | @Log(title = "资质管理信息-新增资质管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加资质管理") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TSysQualifications dto) { |
| | | if (sysQualificationsService.isExit(dto)) { |
| | | return R.fail("资质管理名称已存在"); |
| | | } |
| | | return R.ok(sysQualificationsService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改资质管理 |
| | | */ |
| | | @Log(title = "资质管理信息-修改资质管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改资质管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TSysQualifications dto) { |
| | | if (sysQualificationsService.isExit(dto)) { |
| | | return R.fail("资质管理名称已存在"); |
| | | } |
| | | return R.ok(sysQualificationsService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 查看资质管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看资质管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TSysQualifications> getDetailById(@RequestParam String id) { |
| | | return R.ok(sysQualificationsService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除资质管理 |
| | | */ |
| | | @Log(title = "资质管理信息-删除资质管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除资质管理") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(sysQualificationsService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除资质管理 |
| | | */ |
| | | @Log(title = "资质管理信息-删除资质管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除资质管理") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(sysQualificationsService.removeByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除资质管理 |
| | | */ |
| | | @Log(title = "资质管理信息-上下架", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "批量删除资质管理") |
| | | @PutMapping(value = "/upAndDown") |
| | | public R<String> upAndDown(@RequestParam(value = "id") String id, |
| | | @RequestParam(value = "status")Integer status) { |
| | | sysQualificationsService.update(Wrappers.<TSysQualifications>lambdaUpdate() |
| | | .set(TSysQualifications::getStatus,status) |
| | | .eq(TSysQualifications::getId,id)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |