企业资质管理

This commit is contained in:
Vinjor 2024-08-04 16:55:48 +08:00
parent 55716462b9
commit 17e1c168eb
2 changed files with 45 additions and 10 deletions

View File

@ -4,17 +4,18 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
import cn.iocoder.yudao.module.company.service.CompanyQualsService;
import cn.iocoder.yudao.module.company.vo.CompanyQualsRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.ok;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
@ -32,15 +33,49 @@ public class CompanyQualsController {
private CompanyQualsService companyQualsService;
/**
* 分页查询
* 列表查询--分页
* @author vinjor-M
* @date 9:52 2024/8/2
* @param corpId 企业id
**/
@GetMapping("/page")
@Operation(summary = "获得企业资质信息表分页")
@GetMapping("/list")
@Operation(summary = "获得企业资质信息表分页")
@PreAuthorize("@ss.hasPermission('base:company-quals:query')")
public CommonResult<List<?>> getCompanyPage(String corpId) {
return success(companyQualsService.list(new LambdaQueryWrapperX<CompanyQuals>().eq(CompanyQuals::getCorpId,corpId)));
return success(companyQualsService.list(new LambdaQueryWrapperX<CompanyQuals>().
eq(CompanyQuals::getCorpId,corpId).orderByDesc(CompanyQuals::getCreateTime)));
}
@PostMapping("/create")
@Operation(summary = "创建企业资质")
@PreAuthorize("@ss.hasPermission('base:company-quals:create')")
public CommonResult<String> createCompanyQuals(@RequestBody CompanyQualsRespVO createReqVO) {
companyQualsService.saveDataObj(createReqVO);
return ok();
}
@PutMapping("/update")
@Operation(summary = "更新企业资质")
@PreAuthorize("@ss.hasPermission('base:company-quals:update')")
public CommonResult<Boolean> updateCompanyQuals(@RequestBody CompanyQualsRespVO updateReqVO) {
companyQualsService.updateDataObj(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除企业资质")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:company-quals:delete')")
public CommonResult<Boolean> deleteCompanyQuals(@RequestParam("id") String id) {
companyQualsService.removeDataObj(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得企业资质")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:company-quals:query')")
public CommonResult<CompanyQuals> getCompanyQuals(@RequestParam("id") String id) {
return success(companyQualsService.getById(id));
}
}

View File

@ -28,7 +28,7 @@ public class CompanyQualsServiceImpl extends ServiceImpl<CompanyQualsMapper, Com
**/
@Override
public void saveDataObj(CompanyQualsRespVO companyQualsRespVO) {
this.save(companyQualsRespVO);
}
/**
@ -40,7 +40,7 @@ public class CompanyQualsServiceImpl extends ServiceImpl<CompanyQualsMapper, Com
**/
@Override
public void updateDataObj(CompanyQualsRespVO companyQualsRespVO) {
this.updateById(companyQualsRespVO);
}
/**
@ -52,6 +52,6 @@ public class CompanyQualsServiceImpl extends ServiceImpl<CompanyQualsMapper, Com
**/
@Override
public void removeDataObj(String id) {
this.removeById(id);
}
}