feat:作废发票

This commit is contained in:
dzc committed 2025-06-30 16:51:05 +08:00
1 parent 7ff1eb93dc
commit 7aa19b5e07
3 files changed
+25

No files matched your search

@@ -42,6 +42,13 @@ public class WalletRechargeInvoiceController {
return R.ok(walletRechargeInvoiceService.getInvoice(id));
}
@GetMapping("/back")
@Operation(summary = "退回作废发票")
public R backInvoice(@RequestParam Long id) {
walletRechargeInvoiceService.backInvoice(id);
return R.ok();
}
@PostMapping("/bind-invoice")
@Operation(summary = "绑定发票")
public R bindInvoice(@Valid @RequestBody WalletRechargeBindInvoiceDto dto) {
@@ -13,6 +13,11 @@ import java.util.ArrayList;
public interface WalletRechargeInvoiceService extends IService<WalletRechargeInvoiceEntity> {
/**
* 退回作废发票
*/
void backInvoice(Long id);
/**
* 分页查询
*/
@@ -50,6 +50,19 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
private final RemoteUserService remoteUserService;
private final RemoteWalletSettingService remoteWalletSettingService;
/**
* 退回作废发票
*/
@Override
public void backInvoice(Long id) {
WalletRechargeInvoiceVo detail = baseMapper.joinById(id);
if (ObjectUtil.isEmpty(detail)) throw new RuntimeException("查询不到发票");
baseMapper.update(new LambdaUpdateWrapper<WalletRechargeInvoiceEntity>()
.set(WalletRechargeInvoiceEntity::getPicUrl, null)
.eq(WalletRechargeInvoiceEntity::getId, id)
);
}
/**
* 分页查询
*/