Commit dc5a8260 by GhostUI

冲突

parents b86daa53 c82eb3dc
...@@ -28,6 +28,6 @@ namespace Bailun.DC.Models.Common ...@@ -28,6 +28,6 @@ namespace Bailun.DC.Models.Common
/// <summary> /// <summary>
/// HTTP状态码 /// HTTP状态码
/// </summary> /// </summary>
public int Code { get; set; } public int Code => IsSuccess ? 200 : 0;
} }
} }
using System; namespace Bailun.DC.Models.Common.Page
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Common.Page
{ {
/// <summary> /// <summary>
/// 分页请求参数 /// 分页请求参数
...@@ -12,7 +8,7 @@ namespace Bailun.DC.Models.Common.Page ...@@ -12,7 +8,7 @@ namespace Bailun.DC.Models.Common.Page
/// <summary> /// <summary>
/// 当前页 /// 当前页
/// </summary> /// </summary>
public int PageIndex { get; set; } public int PageIndex { get; set; } = 1;
/// <summary> /// <summary>
/// 每页行数 /// 每页行数
/// </summary> /// </summary>
...@@ -32,4 +28,13 @@ namespace Bailun.DC.Models.Common.Page ...@@ -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; ...@@ -5,6 +5,7 @@ using Bailun.DC.Models.Common;
using Bailun.DC.Models.Common.Page; using Bailun.DC.Models.Common.Page;
using Bailun.DC.Models.Dtos.Finance; using Bailun.DC.Models.Dtos.Finance;
using Dapper; using Dapper;
using MySql.Data.MySqlClient;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -143,5 +144,43 @@ and s2.company_type = @CorporateEntity"; ...@@ -143,5 +144,43 @@ and s2.company_type = @CorporateEntity";
return obj; return obj;
}; };
} }
#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
} }
} }
...@@ -230,7 +230,13 @@ ...@@ -230,7 +230,13 @@
var _r = '<tr><td>' + result.rows[i].datatime+'</td>'; var _r = '<tr><td>' + result.rows[i].datatime+'</td>';
for (var r in _obj) { for (var r in _obj) {
_r += '<td style="width:160px;">' + '<div class="mules" title="' + _obj[r] + '">' + _obj[r] + '</div>' +'</td>';
var _v = _obj[r];
if (isJson(_obj[r])) {
_v = JSON.stringify(_obj[r]).replace(/"/g, "'");
}
_r += '<td style="width:160px;">' + '<div class="mules" title="' + _v + '">' + _v + '</div>' +'</td>';
} }
_r += '</tr>'; _r += '</tr>';
...@@ -291,6 +297,11 @@ ...@@ -291,6 +297,11 @@
} }
function isJson (obj) {
var isjson = typeof (obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length;
return isjson;
}
function ExportCSV() { function ExportCSV() {
//var website = $('#website').val(); //var website = $('#website').val();
//var month = $('#month').val(); //var month = $('#month').val();
......
...@@ -30,7 +30,7 @@ namespace Bailun.DC.WebApi.Controllers ...@@ -30,7 +30,7 @@ namespace Bailun.DC.WebApi.Controllers
[BrowseLog("Bailun_data", "访问【百伦数据中心】->【财务报表】->【资产负债表】->【查询】页面", 0)] [BrowseLog("Bailun_data", "访问【百伦数据中心】->【财务报表】->【资产负债表】->【查询】页面", 0)]
public CommonApiResponseDto<List<dc_base_finance_fee>> Test() 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 }; return new CommonApiResponseDto<List<dc_base_finance_fee>> { Data = list, IsSuccess = true };
} }
...@@ -42,5 +42,19 @@ namespace Bailun.DC.WebApi.Controllers ...@@ -42,5 +42,19 @@ namespace Bailun.DC.WebApi.Controllers
[HttpPost("getCashFlowStatement")] [HttpPost("getCashFlowStatement")]
public CommonApiResponseDto<FinanceDto> GetCashFlowStatement(GetCashFlowStatementInput input) public CommonApiResponseDto<FinanceDto> GetCashFlowStatement(GetCashFlowStatementInput input)
=> new FinanceService().GetCashFlowStatement(input); => new FinanceService().GetCashFlowStatement(input);
#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
} }
} }
...@@ -34,6 +34,7 @@ namespace Bailun.DC.WebApi ...@@ -34,6 +34,7 @@ namespace Bailun.DC.WebApi
{ {
ConfigManagerConf.SetConfiguration(Configuration); ConfigManagerConf.SetConfiguration(Configuration);
ConfigHelper.SetAppSetting(Configuration); ConfigHelper.SetAppSetting(Configuration);
services.AddCors(options =>options.AddPolicy("cors",p => p.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod().AllowCredentials()));
services.AddSwaggerGen(c => services.AddSwaggerGen(c =>
{ {
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Bailun.DC.WebApi", Version = "v1" }); c.SwaggerDoc("v1", new OpenApiInfo { Title = "Bailun.DC.WebApi", Version = "v1" });
...@@ -72,6 +73,7 @@ namespace Bailun.DC.WebApi ...@@ -72,6 +73,7 @@ namespace Bailun.DC.WebApi
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
app.UseCors("cors");
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(c => app.UseSwaggerUI(c =>
{ {
......
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