feat(controller): 添加硬删除功能并替换现有删除方法
- 在 BatchImportSupport 中新增 hardRemoveById 和 hardRemoveByIds 方法实现物理删除 - 替换所有控制器中的删除方法调用为新的硬删除方法 - 硬删除方法支持通过实体类和ID进行单个或批量物理删除 - 实现了分块处理大量ID的批量删除功能,避免数据库限制 - 保持 MyBatis-Plus 拦截器兼容性以
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
package com.gxwebsoft.credit.controller;
|
package com.gxwebsoft.credit.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
|
||||||
import com.gxwebsoft.credit.entity.CreditCompany;
|
import com.gxwebsoft.credit.entity.CreditCompany;
|
||||||
import com.gxwebsoft.credit.service.CreditCompanyService;
|
import com.gxwebsoft.credit.service.CreditCompanyService;
|
||||||
import org.springframework.dao.DataIntegrityViolationException;
|
import org.springframework.dao.DataIntegrityViolationException;
|
||||||
@@ -13,6 +16,7 @@ import org.springframework.transaction.TransactionDefinition;
|
|||||||
import org.springframework.transaction.support.TransactionTemplate;
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
@@ -50,6 +54,66 @@ public class BatchImportSupport {
|
|||||||
return requiresNewTx.execute(status -> supplier.get());
|
return requiresNewTx.execute(status -> supplier.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 硬删除(物理删除),用于替代 MyBatis-Plus 的 @TableLogic 逻辑删除。
|
||||||
|
*
|
||||||
|
* <p>注意:SQL 仍会经过 MyBatis-Plus 拦截器(如 TenantLine),用于保证租户隔离。</p>
|
||||||
|
*/
|
||||||
|
public boolean hardRemoveById(Class<?> entityClass, Serializable id) {
|
||||||
|
if (entityClass == null || id == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass);
|
||||||
|
if (tableInfo == null) {
|
||||||
|
throw new IllegalArgumentException("MyBatis-Plus TableInfo not found for entityClass=" + entityClass.getName());
|
||||||
|
}
|
||||||
|
String tableName = tableInfo.getTableName();
|
||||||
|
String keyColumn = tableInfo.getKeyColumn();
|
||||||
|
if (keyColumn == null || keyColumn.trim().isEmpty()) {
|
||||||
|
keyColumn = "id";
|
||||||
|
}
|
||||||
|
String sql = "DELETE FROM " + tableName + " WHERE " + keyColumn + " = {0}";
|
||||||
|
return SqlRunner.db().delete(sql, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 硬删除(物理删除)- 批量
|
||||||
|
*/
|
||||||
|
public boolean hardRemoveByIds(Class<?> entityClass, List<? extends Serializable> ids) {
|
||||||
|
if (entityClass == null || CollectionUtils.isEmpty(ids)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass);
|
||||||
|
if (tableInfo == null) {
|
||||||
|
throw new IllegalArgumentException("MyBatis-Plus TableInfo not found for entityClass=" + entityClass.getName());
|
||||||
|
}
|
||||||
|
String tableName = tableInfo.getTableName();
|
||||||
|
String keyColumn = tableInfo.getKeyColumn();
|
||||||
|
if (keyColumn == null || keyColumn.trim().isEmpty()) {
|
||||||
|
keyColumn = "id";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keep IN-list size under common DB/driver limits.
|
||||||
|
final int chunkSize = 900;
|
||||||
|
boolean anyDeleted = false;
|
||||||
|
for (int i = 0; i < ids.size(); i += chunkSize) {
|
||||||
|
List<? extends Serializable> chunk = ids.subList(i, Math.min(ids.size(), i + chunkSize));
|
||||||
|
if (CollectionUtils.isEmpty(chunk)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
StringBuilder inPlaceholders = new StringBuilder();
|
||||||
|
for (int j = 0; j < chunk.size(); j++) {
|
||||||
|
if (j > 0) {
|
||||||
|
inPlaceholders.append(",");
|
||||||
|
}
|
||||||
|
inPlaceholders.append("{").append(j).append("}");
|
||||||
|
}
|
||||||
|
String sql = "DELETE FROM " + tableName + " WHERE " + keyColumn + " IN (" + inPlaceholders + ")";
|
||||||
|
anyDeleted = SqlRunner.db().delete(sql, chunk.toArray()) || anyDeleted;
|
||||||
|
}
|
||||||
|
return anyDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
public static final class CompanyIdRefreshStats {
|
public static final class CompanyIdRefreshStats {
|
||||||
public final boolean anyDataRead;
|
public final boolean anyDataRead;
|
||||||
public final int updated;
|
public final int updated;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditAdministrativeLicenseController extends BaseController {
|
|||||||
@Operation(summary = "删除行政许可")
|
@Operation(summary = "删除行政许可")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditAdministrativeLicenseService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditAdministrativeLicense.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditAdministrativeLicenseController extends BaseController {
|
|||||||
@Operation(summary = "批量删除行政许可")
|
@Operation(summary = "批量删除行政许可")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditAdministrativeLicenseService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditAdministrativeLicense.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditBankruptcyController extends BaseController {
|
|||||||
@Operation(summary = "删除破产重整")
|
@Operation(summary = "删除破产重整")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditBankruptcyService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditBankruptcy.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditBankruptcyController extends BaseController {
|
|||||||
@Operation(summary = "批量删除破产重整")
|
@Operation(summary = "批量删除破产重整")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditBankruptcyService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditBankruptcy.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditBranchController extends BaseController {
|
|||||||
@Operation(summary = "删除分支机构")
|
@Operation(summary = "删除分支机构")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditBranchService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditBranch.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditBranchController extends BaseController {
|
|||||||
@Operation(summary = "批量删除分支机构")
|
@Operation(summary = "批量删除分支机构")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditBranchService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditBranch.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class CreditBreachOfTrustController extends BaseController {
|
|||||||
@Operation(summary = "删除失信被执行人")
|
@Operation(summary = "删除失信被执行人")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditBreachOfTrustService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditBreachOfTrust.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -132,7 +132,7 @@ public class CreditBreachOfTrustController extends BaseController {
|
|||||||
@Operation(summary = "批量删除失信被执行人")
|
@Operation(summary = "批量删除失信被执行人")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditBreachOfTrustService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditBreachOfTrust.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditCaseFilingController extends BaseController {
|
|||||||
@Operation(summary = "删除司法大数据")
|
@Operation(summary = "删除司法大数据")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditCaseFilingService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditCaseFiling.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditCaseFilingController extends BaseController {
|
|||||||
@Operation(summary = "批量删除司法大数据")
|
@Operation(summary = "批量删除司法大数据")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditCaseFilingService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditCaseFiling.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class CreditCompanyController extends BaseController {
|
|||||||
@Operation(summary = "删除企业")
|
@Operation(summary = "删除企业")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditCompanyService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditCompany.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -132,7 +132,7 @@ public class CreditCompanyController extends BaseController {
|
|||||||
@Operation(summary = "批量删除企业")
|
@Operation(summary = "批量删除企业")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditCompanyService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditCompany.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditCompetitorController extends BaseController {
|
|||||||
@Operation(summary = "删除竞争对手")
|
@Operation(summary = "删除竞争对手")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditCompetitorService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditCompetitor.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditCompetitorController extends BaseController {
|
|||||||
@Operation(summary = "批量删除竞争对手")
|
@Operation(summary = "批量删除竞争对手")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditCompetitorService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditCompetitor.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditCourtAnnouncementController extends BaseController {
|
|||||||
@Operation(summary = "删除法院公告司法大数据")
|
@Operation(summary = "删除法院公告司法大数据")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditCourtAnnouncementService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditCourtAnnouncement.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditCourtAnnouncementController extends BaseController {
|
|||||||
@Operation(summary = "批量删除法院公告司法大数据")
|
@Operation(summary = "批量删除法院公告司法大数据")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditCourtAnnouncementService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditCourtAnnouncement.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditCourtSessionController extends BaseController {
|
|||||||
@Operation(summary = "删除开庭公告司法大数据")
|
@Operation(summary = "删除开庭公告司法大数据")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditCourtSessionService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditCourtSession.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditCourtSessionController extends BaseController {
|
|||||||
@Operation(summary = "批量删除开庭公告司法大数据")
|
@Operation(summary = "批量删除开庭公告司法大数据")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditCourtSessionService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditCourtSession.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class CreditCustomerController extends BaseController {
|
|||||||
@Operation(summary = "删除客户")
|
@Operation(summary = "删除客户")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditCustomerService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditCustomer.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -134,7 +134,7 @@ public class CreditCustomerController extends BaseController {
|
|||||||
@Operation(summary = "批量删除客户")
|
@Operation(summary = "批量删除客户")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditCustomerService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditCustomer.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditDeliveryNoticeController extends BaseController {
|
|||||||
@Operation(summary = "删除送达公告司法大数据")
|
@Operation(summary = "删除送达公告司法大数据")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditDeliveryNoticeService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditDeliveryNotice.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditDeliveryNoticeController extends BaseController {
|
|||||||
@Operation(summary = "批量删除送达公告司法大数据")
|
@Operation(summary = "批量删除送达公告司法大数据")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditDeliveryNoticeService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditDeliveryNotice.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditExternalController extends BaseController {
|
|||||||
@Operation(summary = "删除对外投资")
|
@Operation(summary = "删除对外投资")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditExternalService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditExternal.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditExternalController extends BaseController {
|
|||||||
@Operation(summary = "批量删除对外投资")
|
@Operation(summary = "批量删除对外投资")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditExternalService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditExternal.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditFinalVersionController extends BaseController {
|
|||||||
@Operation(summary = "删除终本案件")
|
@Operation(summary = "删除终本案件")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditFinalVersionService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditFinalVersion.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditFinalVersionController extends BaseController {
|
|||||||
@Operation(summary = "批量删除终本案件")
|
@Operation(summary = "批量删除终本案件")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditFinalVersionService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditFinalVersion.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditGqdjController extends BaseController {
|
|||||||
@Operation(summary = "删除股权冻结")
|
@Operation(summary = "删除股权冻结")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditGqdjService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditGqdj.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditGqdjController extends BaseController {
|
|||||||
@Operation(summary = "批量删除股权冻结")
|
@Operation(summary = "批量删除股权冻结")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditGqdjService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditGqdj.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditHistoricalLegalPersonController extends BaseController {
|
|||||||
@Operation(summary = "删除历史法定代表人")
|
@Operation(summary = "删除历史法定代表人")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditHistoricalLegalPersonService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditHistoricalLegalPerson.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditHistoricalLegalPersonController extends BaseController {
|
|||||||
@Operation(summary = "批量删除历史法定代表人")
|
@Operation(summary = "批量删除历史法定代表人")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditHistoricalLegalPersonService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditHistoricalLegalPerson.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class CreditJudgmentDebtorController extends BaseController {
|
|||||||
@Operation(summary = "删除被执行人")
|
@Operation(summary = "删除被执行人")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditJudgmentDebtorService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditJudgmentDebtor.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -146,7 +146,7 @@ public class CreditJudgmentDebtorController extends BaseController {
|
|||||||
@Operation(summary = "批量删除被执行人")
|
@Operation(summary = "批量删除被执行人")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditJudgmentDebtorService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditJudgmentDebtor.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditJudicialDocumentController extends BaseController {
|
|||||||
@Operation(summary = "删除裁判文书司法大数据")
|
@Operation(summary = "删除裁判文书司法大数据")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditJudicialDocumentService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditJudicialDocument.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditJudicialDocumentController extends BaseController {
|
|||||||
@Operation(summary = "批量删除裁判文书司法大数据")
|
@Operation(summary = "批量删除裁判文书司法大数据")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditJudicialDocumentService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditJudicialDocument.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class CreditJudiciaryController extends BaseController {
|
|||||||
@Operation(summary = "删除司法案件")
|
@Operation(summary = "删除司法案件")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditJudiciaryService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditJudiciary.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -136,7 +136,7 @@ public class CreditJudiciaryController extends BaseController {
|
|||||||
@Operation(summary = "批量删除司法案件")
|
@Operation(summary = "批量删除司法案件")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditJudiciaryService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditJudiciary.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditMediationController extends BaseController {
|
|||||||
@Operation(summary = "删除诉前调解司法大数据")
|
@Operation(summary = "删除诉前调解司法大数据")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditMediationService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditMediation.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditMediationController extends BaseController {
|
|||||||
@Operation(summary = "批量删除诉前调解司法大数据")
|
@Operation(summary = "批量删除诉前调解司法大数据")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditMediationService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditMediation.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditNearbyCompanyController extends BaseController {
|
|||||||
@Operation(summary = "删除附近企业")
|
@Operation(summary = "删除附近企业")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditNearbyCompanyService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditNearbyCompany.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditNearbyCompanyController extends BaseController {
|
|||||||
@Operation(summary = "批量删除附近企业")
|
@Operation(summary = "批量删除附近企业")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditNearbyCompanyService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditNearbyCompany.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditPatentController extends BaseController {
|
|||||||
@Operation(summary = "删除专利")
|
@Operation(summary = "删除专利")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditPatentService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditPatent.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditPatentController extends BaseController {
|
|||||||
@Operation(summary = "批量删除专利")
|
@Operation(summary = "批量删除专利")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditPatentService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditPatent.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditRiskRelationController extends BaseController {
|
|||||||
@Operation(summary = "删除风险关系表")
|
@Operation(summary = "删除风险关系表")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditRiskRelationService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditRiskRelation.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditRiskRelationController extends BaseController {
|
|||||||
@Operation(summary = "批量删除风险关系表")
|
@Operation(summary = "批量删除风险关系表")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditRiskRelationService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditRiskRelation.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditSupplierController extends BaseController {
|
|||||||
@Operation(summary = "删除供应商")
|
@Operation(summary = "删除供应商")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditSupplierService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditSupplier.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditSupplierController extends BaseController {
|
|||||||
@Operation(summary = "批量删除供应商")
|
@Operation(summary = "批量删除供应商")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditSupplierService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditSupplier.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditSuspectedRelationshipController extends BaseController {
|
|||||||
@Operation(summary = "删除疑似关系")
|
@Operation(summary = "删除疑似关系")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditSuspectedRelationshipService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditSuspectedRelationship.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditSuspectedRelationshipController extends BaseController {
|
|||||||
@Operation(summary = "批量删除疑似关系")
|
@Operation(summary = "批量删除疑似关系")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditSuspectedRelationshipService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditSuspectedRelationship.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class CreditUserController extends BaseController {
|
|||||||
@Operation(summary = "删除招投标信息表")
|
@Operation(summary = "删除招投标信息表")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditUserService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditUser.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -145,7 +145,7 @@ public class CreditUserController extends BaseController {
|
|||||||
@Operation(summary = "批量删除招投标信息表")
|
@Operation(summary = "批量删除招投标信息表")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditUserService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditUser.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class CreditXgxfController extends BaseController {
|
|||||||
@Operation(summary = "删除限制高消费")
|
@Operation(summary = "删除限制高消费")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (creditXgxfService.removeById(id)) {
|
if (batchImportSupport.hardRemoveById(CreditXgxf.class, id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
@@ -137,7 +137,7 @@ public class CreditXgxfController extends BaseController {
|
|||||||
@Operation(summary = "批量删除限制高消费")
|
@Operation(summary = "批量删除限制高消费")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (creditXgxfService.removeByIds(ids)) {
|
if (batchImportSupport.hardRemoveByIds(CreditXgxf.class, ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
|
|||||||
Reference in New Issue
Block a user