移除对账功能 后期从长计议
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 1m57s
Docker Build & Deploy / Deploy to Production (push) Has been skipped
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
Some checks failed
Docker Build & Deploy / Build Docker Image (push) Failing after 1m57s
Docker Build & Deploy / Deploy to Production (push) Has been skipped
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
@@ -689,52 +689,7 @@ public class TransactionRecordController(
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取抵账候选列表
|
||||
/// </summary>
|
||||
[HttpGet("{id}")]
|
||||
public async Task<BaseResponse<TransactionRecord[]>> GetCandidatesForOffset(long id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var current = await transactionRepository.GetByIdAsync(id);
|
||||
if (current == null)
|
||||
{
|
||||
return ((TransactionRecord[])[]).Ok();
|
||||
}
|
||||
|
||||
var list = await transactionRepository.GetCandidatesForOffsetAsync(id, current.Amount, current.Type);
|
||||
|
||||
return list.ToArray().Ok();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, "获取抵账候选列表失败,交易ID: {TransactionId}", id);
|
||||
return $"获取抵账候选列表失败: {ex.Message}".Fail<TransactionRecord[]>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 抵账(删除两笔交易)
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> OffsetTransactions([FromBody] OffsetTransactionDto dto)
|
||||
{
|
||||
var t1 = await transactionRepository.GetByIdAsync(dto.Id1);
|
||||
var t2 = await transactionRepository.GetByIdAsync(dto.Id2);
|
||||
|
||||
if (t1 == null || t2 == null)
|
||||
{
|
||||
return NotFound("交易记录不存在");
|
||||
}
|
||||
|
||||
await transactionRepository.DeleteAsync(dto.Id1);
|
||||
await transactionRepository.DeleteAsync(dto.Id2);
|
||||
|
||||
return Ok(new { success = true, message = "抵账成功" });
|
||||
}
|
||||
|
||||
private async Task WriteEventAsync(string eventType, string data)
|
||||
private async Task WriteEventAsync(string eventType, string data)
|
||||
{
|
||||
var message = $"event: {eventType}\ndata: {data}\n\n";
|
||||
await Response.WriteAsync(message);
|
||||
@@ -821,15 +776,7 @@ public record BatchUpdateByReasonDto(
|
||||
/// </summary>
|
||||
public record BillAnalysisRequest(
|
||||
string UserInput
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// 抵账请求DTO
|
||||
/// </summary>
|
||||
public record OffsetTransactionDto(
|
||||
long Id1,
|
||||
long Id2
|
||||
);
|
||||
);
|
||||
|
||||
public record ParseOneLineRequestDto(
|
||||
string Text
|
||||
|
||||
Reference in New Issue
Block a user