|
|
|
@ -97,10 +97,13 @@ public class VoucherController {
|
|
|
|
|
@Operation(summary = "删除会计凭证")
|
|
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('accounting:voucher:delete')")
|
|
|
|
|
public CommonResult<Boolean> deleteVoucher(@RequestParam("id") Long id) {
|
|
|
|
|
VoucherDO voucher = voucherService.getVoucher(id);
|
|
|
|
|
if (voucher.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())){
|
|
|
|
|
return error("该凭证已归档,请勿删除!");
|
|
|
|
|
public CommonResult<Boolean> deleteVoucher(@RequestParam("id") Long[] id) {
|
|
|
|
|
List<Long> listId = new ArrayList(Arrays.asList(id)) ;
|
|
|
|
|
List<VoucherDO> voucherList = voucherService.getVoucherList(listId);
|
|
|
|
|
for (VoucherDO voucher : voucherList) {
|
|
|
|
|
if (voucher.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())){
|
|
|
|
|
return error("凭证号:"+voucher.getVoucherNum()+" 该凭证已归档,请勿删除!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
voucherService.deleteVoucher(id);
|
|
|
|
|
return success(true);
|
|
|
|
|