feat(credit): 添加行政许可、破产重整和分支机构管理功能
- 创建了CreditAdministrativeLicense实体类及对应的Controller、Service、Mapper和XML映射文件 - 创建了CreditBankruptcy实体类及对应的Controller、Service、Mapper和XML映射文件 - 创建了CreditBranch实体类及对应的Controller、Service、Mapper和XML映射文件 - 实现了分页查询、列表查询、详情查询、新增、修改、删除等基础CRUD功能 - 添加了批量操作功能包括批量新增、批量修改和批量删除 - 集成了权限控制和操作日志功能 - 实现了关联查询和排序功能 - 添加了完整的参数验证和查询条件支持
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditAdministrativeLicense;
|
||||
import com.gxwebsoft.credit.param.CreditAdministrativeLicenseParam;
|
||||
import com.gxwebsoft.credit.service.CreditAdministrativeLicenseService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 行政许可控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-07 13:52:14
|
||||
*/
|
||||
@Tag(name = "行政许可管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-administrative-license")
|
||||
public class CreditAdministrativeLicenseController extends BaseController {
|
||||
@Resource
|
||||
private CreditAdministrativeLicenseService creditAdministrativeLicenseService;
|
||||
|
||||
@Operation(summary = "分页查询行政许可")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditAdministrativeLicense>> page(CreditAdministrativeLicenseParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditAdministrativeLicenseService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部行政许可")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditAdministrativeLicense>> list(CreditAdministrativeLicenseParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditAdministrativeLicenseService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询行政许可")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditAdministrativeLicense> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditAdministrativeLicenseService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加行政许可")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditAdministrativeLicense creditAdministrativeLicense) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditAdministrativeLicense.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditAdministrativeLicenseService.save(creditAdministrativeLicense)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改行政许可")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditAdministrativeLicense creditAdministrativeLicense) {
|
||||
if (creditAdministrativeLicenseService.updateById(creditAdministrativeLicense)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除行政许可")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditAdministrativeLicenseService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加行政许可")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditAdministrativeLicense> list) {
|
||||
if (creditAdministrativeLicenseService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改行政许可")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditAdministrativeLicense> batchParam) {
|
||||
if (batchParam.update(creditAdministrativeLicenseService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除行政许可")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditAdministrativeLicenseService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditBankruptcy;
|
||||
import com.gxwebsoft.credit.param.CreditBankruptcyParam;
|
||||
import com.gxwebsoft.credit.service.CreditBankruptcyService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 破产重整控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-07 13:52:14
|
||||
*/
|
||||
@Tag(name = "破产重整管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-bankruptcy")
|
||||
public class CreditBankruptcyController extends BaseController {
|
||||
@Resource
|
||||
private CreditBankruptcyService creditBankruptcyService;
|
||||
|
||||
@Operation(summary = "分页查询破产重整")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditBankruptcy>> page(CreditBankruptcyParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditBankruptcyService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部破产重整")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditBankruptcy>> list(CreditBankruptcyParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditBankruptcyService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询破产重整")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditBankruptcy> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditBankruptcyService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBankruptcy:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加破产重整")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditBankruptcy creditBankruptcy) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditBankruptcy.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditBankruptcyService.save(creditBankruptcy)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBankruptcy:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改破产重整")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditBankruptcy creditBankruptcy) {
|
||||
if (creditBankruptcyService.updateById(creditBankruptcy)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBankruptcy:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除破产重整")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditBankruptcyService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBankruptcy:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加破产重整")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditBankruptcy> list) {
|
||||
if (creditBankruptcyService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBankruptcy:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改破产重整")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditBankruptcy> batchParam) {
|
||||
if (batchParam.update(creditBankruptcyService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBankruptcy:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除破产重整")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditBankruptcyService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditBranch;
|
||||
import com.gxwebsoft.credit.param.CreditBranchParam;
|
||||
import com.gxwebsoft.credit.service.CreditBranchService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分支机构控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-07 13:52:14
|
||||
*/
|
||||
@Tag(name = "分支机构管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-branch")
|
||||
public class CreditBranchController extends BaseController {
|
||||
@Resource
|
||||
private CreditBranchService creditBranchService;
|
||||
|
||||
@Operation(summary = "分页查询分支机构")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditBranch>> page(CreditBranchParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditBranchService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部分支机构")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditBranch>> list(CreditBranchParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditBranchService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询分支机构")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditBranch> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditBranchService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBranch:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加分支机构")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditBranch creditBranch) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditBranch.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditBranchService.save(creditBranch)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBranch:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改分支机构")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditBranch creditBranch) {
|
||||
if (creditBranchService.updateById(creditBranch)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBranch:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除分支机构")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditBranchService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBranch:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加分支机构")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditBranch> list) {
|
||||
if (creditBranchService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBranch:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改分支机构")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditBranch> batchParam) {
|
||||
if (batchParam.update(creditBranchService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBranch:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除分支机构")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditBranchService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditHistoricalLegalPerson;
|
||||
import com.gxwebsoft.credit.param.CreditHistoricalLegalPersonParam;
|
||||
import com.gxwebsoft.credit.service.CreditHistoricalLegalPersonService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 历史法定代表人控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-07 13:52:14
|
||||
*/
|
||||
@Tag(name = "历史法定代表人管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-historical-legal-person")
|
||||
public class CreditHistoricalLegalPersonController extends BaseController {
|
||||
@Resource
|
||||
private CreditHistoricalLegalPersonService creditHistoricalLegalPersonService;
|
||||
|
||||
@Operation(summary = "分页查询历史法定代表人")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditHistoricalLegalPerson>> page(CreditHistoricalLegalPersonParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditHistoricalLegalPersonService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部历史法定代表人")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditHistoricalLegalPerson>> list(CreditHistoricalLegalPersonParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditHistoricalLegalPersonService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询历史法定代表人")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditHistoricalLegalPerson> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditHistoricalLegalPersonService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加历史法定代表人")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditHistoricalLegalPerson creditHistoricalLegalPerson) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditHistoricalLegalPerson.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditHistoricalLegalPersonService.save(creditHistoricalLegalPerson)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改历史法定代表人")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditHistoricalLegalPerson creditHistoricalLegalPerson) {
|
||||
if (creditHistoricalLegalPersonService.updateById(creditHistoricalLegalPerson)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除历史法定代表人")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditHistoricalLegalPersonService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加历史法定代表人")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditHistoricalLegalPerson> list) {
|
||||
if (creditHistoricalLegalPersonService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改历史法定代表人")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditHistoricalLegalPerson> batchParam) {
|
||||
if (batchParam.update(creditHistoricalLegalPersonService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除历史法定代表人")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditHistoricalLegalPersonService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditNearbyCompany;
|
||||
import com.gxwebsoft.credit.param.CreditNearbyCompanyParam;
|
||||
import com.gxwebsoft.credit.service.CreditNearbyCompanyService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 附近企业控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-07 13:52:14
|
||||
*/
|
||||
@Tag(name = "附近企业管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-nearby-company")
|
||||
public class CreditNearbyCompanyController extends BaseController {
|
||||
@Resource
|
||||
private CreditNearbyCompanyService creditNearbyCompanyService;
|
||||
|
||||
@Operation(summary = "分页查询附近企业")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditNearbyCompany>> page(CreditNearbyCompanyParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditNearbyCompanyService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部附近企业")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditNearbyCompany>> list(CreditNearbyCompanyParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditNearbyCompanyService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询附近企业")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditNearbyCompany> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditNearbyCompanyService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditNearbyCompany:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加附近企业")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditNearbyCompany creditNearbyCompany) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditNearbyCompany.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditNearbyCompanyService.save(creditNearbyCompany)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditNearbyCompany:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改附近企业")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditNearbyCompany creditNearbyCompany) {
|
||||
if (creditNearbyCompanyService.updateById(creditNearbyCompany)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditNearbyCompany:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除附近企业")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditNearbyCompanyService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditNearbyCompany:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加附近企业")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditNearbyCompany> list) {
|
||||
if (creditNearbyCompanyService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditNearbyCompany:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改附近企业")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditNearbyCompany> batchParam) {
|
||||
if (batchParam.update(creditNearbyCompanyService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditNearbyCompany:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除附近企业")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditNearbyCompanyService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditPatent;
|
||||
import com.gxwebsoft.credit.param.CreditPatentParam;
|
||||
import com.gxwebsoft.credit.service.CreditPatentService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 专利控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-07 13:52:14
|
||||
*/
|
||||
@Tag(name = "专利管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-patent")
|
||||
public class CreditPatentController extends BaseController {
|
||||
@Resource
|
||||
private CreditPatentService creditPatentService;
|
||||
|
||||
@Operation(summary = "分页查询专利")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditPatent>> page(CreditPatentParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditPatentService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部专利")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditPatent>> list(CreditPatentParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditPatentService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询专利")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditPatent> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditPatentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditPatent:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加专利")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditPatent creditPatent) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditPatent.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditPatentService.save(creditPatent)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditPatent:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改专利")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditPatent creditPatent) {
|
||||
if (creditPatentService.updateById(creditPatent)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditPatent:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除专利")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditPatentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditPatent:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加专利")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditPatent> list) {
|
||||
if (creditPatentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditPatent:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改专利")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditPatent> batchParam) {
|
||||
if (batchParam.update(creditPatentService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditPatent:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除专利")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditPatentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditSuspectedRelationship;
|
||||
import com.gxwebsoft.credit.param.CreditSuspectedRelationshipParam;
|
||||
import com.gxwebsoft.credit.service.CreditSuspectedRelationshipService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 疑似关系控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-07 13:52:14
|
||||
*/
|
||||
@Tag(name = "疑似关系管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-suspected-relationship")
|
||||
public class CreditSuspectedRelationshipController extends BaseController {
|
||||
@Resource
|
||||
private CreditSuspectedRelationshipService creditSuspectedRelationshipService;
|
||||
|
||||
@Operation(summary = "分页查询疑似关系")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditSuspectedRelationship>> page(CreditSuspectedRelationshipParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditSuspectedRelationshipService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部疑似关系")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditSuspectedRelationship>> list(CreditSuspectedRelationshipParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditSuspectedRelationshipService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询疑似关系")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditSuspectedRelationship> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditSuspectedRelationshipService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加疑似关系")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditSuspectedRelationship creditSuspectedRelationship) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditSuspectedRelationship.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditSuspectedRelationshipService.save(creditSuspectedRelationship)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改疑似关系")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditSuspectedRelationship creditSuspectedRelationship) {
|
||||
if (creditSuspectedRelationshipService.updateById(creditSuspectedRelationship)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除疑似关系")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditSuspectedRelationshipService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加疑似关系")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditSuspectedRelationship> list) {
|
||||
if (creditSuspectedRelationshipService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改疑似关系")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditSuspectedRelationship> batchParam) {
|
||||
if (batchParam.update(creditSuspectedRelationshipService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除疑似关系")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditSuspectedRelationshipService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user