快乐的昕的电脑
2025-10-16 f6e4c06a6ea3b865c9e167b824ad6c00842170a9
Controllers/WomdaaController.cs
@@ -12,7 +12,15 @@
public class WomdaaController : ControllerBase
{
    private readonly WomdaaManager m = new();
    public class BillNoBgQueryDto
    {
        public string BillNo { get; set; }
        public string MachineNo { get; set; }
        public DateTime? From { get; set; }
        public DateTime? To { get; set; }
        public int PageIndex { get; set; } = 1;
        public int PageSize { get; set; } = 500;
    }
    //GetWomdaasByMachine
    [HttpPost("GetWomdaasByMachine")]
@@ -262,4 +270,34 @@
            return ResponseResult.ResponseError(ex);
        }
    }
}
    [HttpPost("GetByBillNoBG")]
    public IActionResult GetByBillNoBG([FromBody] BillNoBgQueryDto dto)
    {
        if (string.IsNullOrWhiteSpace(dto.BillNo))
            return Ok(new { status = 1, message = "billNo不能为空" });
        try
        {
            var (tbBillList, totalCount) = m.GetByBillNoBG(
                dto.BillNo, dto.MachineNo, dto.From, dto.To, dto.PageIndex, dto.PageSize);
            return Ok(new
            {
                status = 0,
                message = "Ok",
                data = new
                {
                    tbBillList,
                    totalCount
                }
            });
        }
        catch (Exception ex)
        {
            // 记录日志 ex
            return Ok(new { status = 1, message = "服务器错误" });
        }
    }
}