会计档案-所有模块支持批量删除

new
zk 1 year ago
parent d9a1e69cc5
commit 2b3506f455

@ -129,7 +129,7 @@ public class AccountingBookController {
@Operation(summary = "删除会计账簿") @Operation(summary = "删除会计账簿")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('archives:accounting-book:delete')") @PreAuthorize("@ss.hasPermission('archives:accounting-book:delete')")
public CommonResult<Boolean> deleteAccountingBook(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteAccountingBook(@RequestParam("id") Long[] id) {
accountingBookService.deleteAccountingBook(id); accountingBookService.deleteAccountingBook(id);
return success(true); return success(true);
} }

@ -107,7 +107,7 @@ public class AccountingReportController {
@Operation(summary = "删除会计报表") @Operation(summary = "删除会计报表")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('archives:accounting-report:delete')") @PreAuthorize("@ss.hasPermission('archives:accounting-report:delete')")
public CommonResult<Boolean> deleteAccountingReport(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteAccountingReport(@RequestParam("id") Long[] id) {
accountingReportService.deleteAccountingReport(id); accountingReportService.deleteAccountingReport(id);
return success(true); return success(true);
} }

@ -76,7 +76,7 @@ public class AttachmentController {
@Operation(summary = "删除会计附件") @Operation(summary = "删除会计附件")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('accounting:attachment:delete')") @PreAuthorize("@ss.hasPermission('accounting:attachment:delete')")
public CommonResult<Boolean> deleteAttachment(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteAttachment(@RequestParam("id") Long[] id) {
attachmentService.deleteAttachment(id); attachmentService.deleteAttachment(id);
return success(true); return success(true);
} }

@ -67,7 +67,7 @@ public class BankSlipController {
@Operation(summary = "删除银行回单") @Operation(summary = "删除银行回单")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('archives:bank-slip:delete')") @PreAuthorize("@ss.hasPermission('archives:bank-slip:delete')")
public CommonResult<Boolean> deleteBankSlip(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteBankSlip(@RequestParam("id") Long[] id) {
bankSlipService.deleteBankSlip(id); bankSlipService.deleteBankSlip(id);
return success(true); return success(true);
} }

@ -114,7 +114,7 @@ public class FlowController {
@Operation(summary = "删除审批流程") @Operation(summary = "删除审批流程")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('archives:flow:delete')") @PreAuthorize("@ss.hasPermission('archives:flow:delete')")
public CommonResult<Boolean> deleteFlow(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteFlow(@RequestParam("id") Long[] id) {
flowService.deleteFlow(id); flowService.deleteFlow(id);
return success(true); return success(true);
} }

@ -87,7 +87,7 @@ public class InvoicesController {
@Operation(summary = "删除发票") @Operation(summary = "删除发票")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('accounting:invoices:delete')") @PreAuthorize("@ss.hasPermission('accounting:invoices:delete')")
public CommonResult<Boolean> deleteInvoices(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteInvoices(@RequestParam("id") Long[] id) {
invoicesService.deleteInvoices(id); invoicesService.deleteInvoices(id);
return success(true); return success(true);
} }

@ -72,7 +72,7 @@ public class OtherController {
@Operation(summary = "删除其他资料") @Operation(summary = "删除其他资料")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('accounting:other:delete')") @PreAuthorize("@ss.hasPermission('accounting:other:delete')")
public CommonResult<Boolean> deleteOther(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteOther(@RequestParam("id") Long[] id) {
otherService.deleteOther(id); otherService.deleteOther(id);
return success(true); return success(true);
} }

@ -56,7 +56,7 @@ public class VoucherDetailsController {
@Operation(summary = "删除凭证详情") @Operation(summary = "删除凭证详情")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('accounting:voucher-details:delete')") @PreAuthorize("@ss.hasPermission('accounting:voucher-details:delete')")
public CommonResult<Boolean> deleteVoucherDetails(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteVoucherDetails(@RequestParam("id") Long[] id) {
voucherDetailsService.deleteVoucherDetails(id); voucherDetailsService.deleteVoucherDetails(id);
return success(true); return success(true);
} }

@ -39,7 +39,7 @@ public interface AccountingBookService {
* *
* @param id * @param id
*/ */
void deleteAccountingBook(Long id); void deleteAccountingBook(Long[] id);
/** /**
* 簿 * 簿

@ -57,11 +57,9 @@ public class AccountingBookServiceImpl implements AccountingBookService {
} }
@Override @Override
public void deleteAccountingBook(Long id) { public void deleteAccountingBook(Long[] id) {
// 校验存在
validateAccountingBookExists(id);
// 删除 // 删除
accountingBookMapper.deleteById(id); accountingBookMapper.deleteBatchIds(Arrays.asList(id));
} }
private void validateAccountingBookExists(Long id) { private void validateAccountingBookExists(Long id) {

@ -37,7 +37,7 @@ public interface AccountingReportService {
* *
* @param id * @param id
*/ */
void deleteAccountingReport(Long id); void deleteAccountingReport(Long[] id);
/** /**
* *

@ -52,11 +52,10 @@ public class AccountingReportServiceImpl implements AccountingReportService {
} }
@Override @Override
public void deleteAccountingReport(Long id) { public void deleteAccountingReport(Long[] id) {
// 校验存在
validateAccountingReportExists(id);
// 删除 // 删除
accountingReportMapper.deleteById(id); accountingReportMapper.deleteBatchIds(Arrays.asList(id));
} }
private void validateAccountingReportExists(Long id) { private void validateAccountingReportExists(Long id) {

@ -33,7 +33,7 @@ public interface AttachmentService {
* *
* @param id * @param id
*/ */
void deleteAttachment(Long id); void deleteAttachment(Long[] id);
/** /**
* *

@ -46,11 +46,9 @@ public class AttachmentServiceImpl implements AttachmentService {
} }
@Override @Override
public void deleteAttachment(Long id) { public void deleteAttachment(Long[] id) {
// 校验存在
validateAttachmentExists(id);
// 删除 // 删除
attachmentMapper.deleteById(id); attachmentMapper.deleteBatchIds(Arrays.asList(id));
} }
private void validateAttachmentExists(Long id) { private void validateAttachmentExists(Long id) {

@ -42,7 +42,7 @@ public interface BankSlipService {
* *
* @param id * @param id
*/ */
void deleteBankSlip(Long id); void deleteBankSlip(Long[] id);
/** /**
* *

@ -24,6 +24,7 @@ import java.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -66,11 +67,10 @@ public class BankSlipServiceImpl implements BankSlipService {
} }
@Override @Override
public void deleteBankSlip(Long id) { public void deleteBankSlip(Long[] id) {
// 校验存在
validateBankSlipExists(id);
// 删除 // 删除
bankSlipMapper.deleteById(id); bankSlipMapper.deleteBatchIds(Arrays.asList(id));
} }
private void validateBankSlipExists(Long id) { private void validateBankSlipExists(Long id) {

@ -40,7 +40,7 @@ public interface FlowService {
* *
* @param id * @param id
*/ */
void deleteFlow(Long id); void deleteFlow(Long[] id);
/** /**
* *

@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -51,11 +52,9 @@ public class FlowServiceImpl implements FlowService {
} }
@Override @Override
public void deleteFlow(Long id) { public void deleteFlow(Long[] id) {
// 校验存在
validateFlowExists(id);
// 删除 // 删除
flowMapper.deleteById(id); flowMapper.deleteBatchIds(Arrays.asList(id));
} }
private void validateFlowExists(Long id) { private void validateFlowExists(Long id) {

@ -33,7 +33,7 @@ public interface InvoicesService {
* *
* @param id * @param id
*/ */
void deleteInvoices(Long id); void deleteInvoices(Long[] id);
/** /**
* *

@ -48,11 +48,10 @@ public class InvoicesServiceImpl implements InvoicesService {
} }
@Override @Override
public void deleteInvoices(Long id) { public void deleteInvoices(Long[] id) {
// 校验存在
validateInvoicesExists(id);
// 删除 // 删除
invoicesMapper.deleteById(id); invoicesMapper.deleteBatchIds(Arrays.asList(id));
} }
private void validateInvoicesExists(Long id) { private void validateInvoicesExists(Long id) {

@ -33,7 +33,7 @@ public interface OtherService {
* *
* @param id * @param id
*/ */
void deleteOther(Long id); void deleteOther(Long[] id);
/** /**
* *

@ -46,11 +46,10 @@ public class OtherServiceImpl implements OtherService {
} }
@Override @Override
public void deleteOther(Long id) { public void deleteOther(Long[] id) {
// 校验存在
validateOtherExists(id);
// 删除 // 删除
otherMapper.deleteById(id); otherMapper.deleteBatchIds(Arrays.asList(id));
} }
private void validateOtherExists(Long id) { private void validateOtherExists(Long id) {

@ -33,7 +33,7 @@ public interface VoucherDetailsService {
* *
* @param id * @param id
*/ */
void deleteVoucherDetails(Long id); void deleteVoucherDetails(Long[] id);
/** /**
* *

@ -77,11 +77,10 @@ public class VoucherDetailsServiceImpl implements VoucherDetailsService {
} }
@Override @Override
public void deleteVoucherDetails(Long id) { public void deleteVoucherDetails(Long[] id) {
// 校验存在
validateVoucherDetailsExists(id);
// 删除 // 删除
voucherDetailsMapper.deleteById(id); voucherDetailsMapper.deleteBatchIds(Arrays.asList(id));
} }
private void validateVoucherDetailsExists(Long id) { private void validateVoucherDetailsExists(Long id) {

Loading…
Cancel
Save