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