Commit c82eb3dc by zhoujinhui

新增付现明细接口

parent 1217eccf
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Common.Page
namespace Bailun.DC.Models.Common.Page
{
/// <summary>
/// 分页请求参数
......@@ -12,7 +8,7 @@ namespace Bailun.DC.Models.Common.Page
/// <summary>
/// 当前页
/// </summary>
public int PageIndex { get; set; }
public int PageIndex { get; set; } = 1;
/// <summary>
/// 每页行数
/// </summary>
......@@ -32,4 +28,13 @@ namespace Bailun.DC.Models.Common.Page
}
public class PageResponse
{
public int Total { get; set; }
public int CurrentPage { get; set; }
public int PageSize { get; set; }
}
}
using Bailun.DC.Models.Common.Page;
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Dtos.Finance
{
/// <summary>
/// 分页查询付现明细
/// </summary>
public class FinanceFeeDetailsPageInputDto: PageRequest
{
}
}
using Bailun.DC.Models.Common.Page;
using System.Collections.Generic;
namespace Bailun.DC.Models.Dtos.Finance
{
/// <summary>
/// 分页查询付现明细
/// </summary>
public class FinanceFeeDetailsPageOutputDto
{
public FinanceFeeDetailsPageOutputDto()
{
Pages = new PageResponse();
Items = new List<FinanceFeeDetailsListItem>();
}
/// <summary>
///
/// </summary>
public List<FinanceFeeDetailsListItem> Items { get; set; }
/// <summary>
///
/// </summary>
public PageResponse Pages { get; set; }
}
public class FinanceFeeDetailsListItem : dc_base_finance_fee
{
}
}
......@@ -5,6 +5,7 @@ using Bailun.DC.Models.Common;
using Bailun.DC.Models.Common.Page;
using Bailun.DC.Models.Dtos.Finance;
using Dapper;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -56,7 +57,41 @@ and s2.company_type = @CorporateEntity";
}
#region 付现流水明细
/// <summary>
/// 分页查询付现流水明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public CommonApiResponseDto<FinanceFeeDetailsPageOutputDto> GetFinanceFeeDetailsPage(FinanceFeeDetailsPageInputDto input)
{
var result = new CommonApiResponseDto<FinanceFeeDetailsPageOutputDto> { Data = new FinanceFeeDetailsPageOutputDto() };
var sqlWhere = BuildAllotOperationLogPageQuerySqlWhere(input, out DynamicParameters parameters);
using (var cn = new MySqlConnection(GlobalConfig.ConnectionString))
{
int total = 0;
result.Data.Items = cn.Page<FinanceFeeDetailsListItem>(input.PageIndex, input.PageNumber, sqlWhere, ref total, parameters).AsList();
result.Data.Pages.CurrentPage = input.PageIndex;
result.Data.Pages.PageSize = input.PageNumber;
result.Data.Pages.Total = total;
}
return result;
}
public string BuildAllotOperationLogPageQuerySqlWhere(FinanceFeeDetailsPageInputDto input, out DynamicParameters parameters)
{
parameters = new DynamicParameters();
StringBuilder sqlText = new StringBuilder();
sqlText.Append(@"SELECT t1.* FROM dc_base_finance_fee AS t1
INNER JOIN dc_base_finance_company AS t2 ON t2.company_name = t1.company_name
WHERE t1.cost_status = 4
AND (t1.is_lend IS NULL OR t1.is_lend = 1
OR (t1.is_lend = 2 AND t1.lend_balance > 0)
OR (t1.is_lend = 2 AND t1.cost_form = 1)
)");
sqlText.Append(" ORDER BY t1.create_time DESC ");
return sqlText.ToString();
}
#endregion
}
}
......@@ -30,7 +30,7 @@ namespace Bailun.DC.WebApi.Controllers
[BrowseLog("Bailun_data", "访问【百伦数据中心】->【财务报表】->【资产负债表】->【查询】页面", 0)]
public CommonApiResponseDto<List<dc_base_finance_fee>> Test()
{
var list = new Services.FinanceReportServices().ListFinanceFee(DateTime.Now.AddDays(-5), DateTime.Now, "", "", "",null,null);
var list = new Services.FinanceReportServices().ListFinanceFee(DateTime.Now.AddDays(-5), DateTime.Now, "", "", "", null, null);
return new CommonApiResponseDto<List<dc_base_finance_fee>> { Data = list, IsSuccess = true };
}
......@@ -45,7 +45,16 @@ namespace Bailun.DC.WebApi.Controllers
#region 付现流水明细
/// <summary>
/// 分页查询付现流水明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("GetFinanceFeeDetailsPage"), BailunAuthentication(LoginMode.Enforce)]
public CommonApiResponseDto<FinanceFeeDetailsPageOutputDto> GetFinanceFeeDetailsPage([FromBody] FinanceFeeDetailsPageInputDto input)
{
return new FinanceService().GetFinanceFeeDetailsPage(input);
}
#endregion
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment