企业资质管理
This commit is contained in:
parent
55716462b9
commit
17e1c168eb
@ -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.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
|
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
|
||||||
import cn.iocoder.yudao.module.company.service.CompanyQualsService;
|
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.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.ok;
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,15 +33,49 @@ public class CompanyQualsController {
|
|||||||
private CompanyQualsService companyQualsService;
|
private CompanyQualsService companyQualsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 列表查询--不分页
|
||||||
* @author vinjor-M
|
* @author vinjor-M
|
||||||
* @date 9:52 2024/8/2
|
* @date 9:52 2024/8/2
|
||||||
* @param corpId 企业id
|
* @param corpId 企业id
|
||||||
**/
|
**/
|
||||||
@GetMapping("/page")
|
@GetMapping("/list")
|
||||||
@Operation(summary = "获得企业资质信息表分页")
|
@Operation(summary = "获得企业资质信息表不分页")
|
||||||
@PreAuthorize("@ss.hasPermission('base:company-quals:query')")
|
@PreAuthorize("@ss.hasPermission('base:company-quals:query')")
|
||||||
public CommonResult<List<?>> getCompanyPage(String corpId) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -28,7 +28,7 @@ public class CompanyQualsServiceImpl extends ServiceImpl<CompanyQualsMapper, Com
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void saveDataObj(CompanyQualsRespVO companyQualsRespVO) {
|
public void saveDataObj(CompanyQualsRespVO companyQualsRespVO) {
|
||||||
|
this.save(companyQualsRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,7 +40,7 @@ public class CompanyQualsServiceImpl extends ServiceImpl<CompanyQualsMapper, Com
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void updateDataObj(CompanyQualsRespVO companyQualsRespVO) {
|
public void updateDataObj(CompanyQualsRespVO companyQualsRespVO) {
|
||||||
|
this.updateById(companyQualsRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,6 +52,6 @@ public class CompanyQualsServiceImpl extends ServiceImpl<CompanyQualsMapper, Com
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void removeDataObj(String id) {
|
public void removeDataObj(String id) {
|
||||||
|
this.removeById(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user