Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
797fa862
Commit
797fa862
authored
Jul 15, 2021
by
GhostUI
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/f-zmh-付现流水'
parents
d7ef241a
e253f22b
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
238 additions
and
5 deletions
+238
-5
ConfigHelper.cs
Bailun.DC.DB/Base/ConfigHelper.cs
+2
-2
DapperHelper.cs
Bailun.DC.DB/Base/DapperHelper.cs
+18
-0
CommonApiResponseDto.cs
Bailun.DC.Models/Common/CommonApiResponseDto.cs
+1
-1
PageRequest.cs
Bailun.DC.Models/Common/Page/PageRequest.cs
+35
-0
PageResult.cs
Bailun.DC.Models/Common/Page/PageResult.cs
+81
-0
GetCashFlowStatementInput.cs
Bailun.DC.Models/Dtos/Finance/GetCashFlowStatementInput.cs
+23
-0
FinanceService.cs
Bailun.DC.Services/WebApiService/FinanceService.cs
+58
-0
Bailun.DC.WebApi.csproj
Bailun.DC.WebApi/Bailun.DC.WebApi.csproj
+4
-1
FinanceController.cs
Bailun.DC.WebApi/Controllers/FinanceController.cs
+13
-0
Startup.cs
Bailun.DC.WebApi/Startup.cs
+3
-1
No files found.
Bailun.DC.DB/Base/ConfigHelper.cs
View file @
797fa862
...
...
@@ -10,7 +10,7 @@ namespace Bailun.DC.DB.Base
/// </summary>
public
static
class
ConfigHelper
{
private
static
IConfiguration
Section
_appSection
=
null
;
private
static
IConfiguration
_appSection
=
null
;
public
static
string
AppSetting
(
string
key
)
{
...
...
@@ -22,7 +22,7 @@ namespace Bailun.DC.DB.Base
return
str
;
}
public
static
void
SetAppSetting
(
IConfiguration
Section
section
)
public
static
void
SetAppSetting
(
IConfiguration
section
)
{
_appSection
=
section
;
}
...
...
Bailun.DC.DB/Base/DapperHelper.cs
View file @
797fa862
...
...
@@ -683,7 +683,25 @@ namespace Dapper
return
connection
.
Query
<
T
>(
strsql
,
parameters
,
null
,
true
,
timeout
);
}
public
static
IEnumerable
<
T
>
Query
<
T
>(
string
sql
,
DynamicParameters
param
,
string
connection
)
{
if
(
string
.
IsNullOrEmpty
(
connection
))
{
throw
new
Exception
(
"连接字符不能为空"
);
}
IEnumerable
<
T
>
result
=
null
;
using
(
MySql
.
Data
.
MySqlClient
.
MySqlConnection
con
=
new
MySql
.
Data
.
MySqlClient
.
MySqlConnection
(
connection
))
{
result
=
con
.
Query
<
T
>(
sql
,
param
,
null
,
true
,
60000
);
con
.
Dispose
();
}
return
result
;
}
//build update statement based on list on an entity
private
static
void
BuildUpdateSet
<
T
>(
T
entityToUpdate
,
StringBuilder
sb
)
...
...
Bailun.DC.Models/Common/CommonApiResponseDto.cs
View file @
797fa862
...
...
@@ -13,7 +13,7 @@ namespace Bailun.DC.Models.Common
/// <summary>
/// 指示是否成功
/// </summary>
public
bool
IsSuccess
{
get
;
set
;
}
public
bool
IsSuccess
{
get
;
set
;
}
=
true
;
/// <summary>
/// 返回的业务数据
...
...
Bailun.DC.Models/Common/Page/PageRequest.cs
0 → 100644
View file @
797fa862
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models.Common.Page
{
/// <summary>
/// 分页请求参数
/// </summary>
public
class
PageRequest
{
/// <summary>
/// 当前页
/// </summary>
public
int
PageIndex
{
get
;
set
;
}
/// <summary>
/// 每页行数
/// </summary>
public
int
PageNumber
{
get
;
set
;
}
=
20
;
/// <summary>
/// 总条数
/// </summary>
public
long
Total
{
get
;
set
;
}
/// <summary>
/// 排序字段
/// </summary>
public
string
SortField
{
get
;
set
;}
/// <summary>
/// 排序类型:asc/desc
/// </summary>
public
string
Sort
{
get
;
set
;}
}
}
Bailun.DC.Models/Common/Page/PageResult.cs
0 → 100644
View file @
797fa862
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models.Common.Page
{
/// <summary>
/// 分页返回值
/// </summary>
/// <typeparam name="TData"></typeparam>
public
class
PageResult
<
TData
>
where
TData
:
IList
{
/// <summary>
/// 每页行数
/// </summary>
public
int
Rows
{
get
{
if
(
Data
!=
null
)
{
return
Data
.
Count
;
}
return
0
;
}
}
public
bool
IsSuccess
{
get
;
set
;
}
=
true
;
public
TData
Data
{
get
;
set
;
}
public
int
PageIndex
{
get
;
set
;
}
public
long
Total
{
get
;
set
;
}
public
long
TotalPage
{
get
{
if
(
Total
>
0
)
{
return
(
Total
%
Rows
==
0L
)
?
(
Total
/
Rows
)
:
(
Total
/
Rows
+
1
);
}
return
0L
;
}
}
/// <summary>
/// 构造返回值
/// </summary>
/// <param name="pageIndex">当前页</param>
/// <param name="records">总条数</param>
/// <param name="data">分页数据</param>
/// <returns></returns>
public
PageResult
<
TData
>
ToPageResult
(
int
pageIndex
,
long
records
,
TData
data
)
{
return
new
PageResult
<
TData
>
{
Data
=
data
,
PageIndex
=
pageIndex
,
Total
=
records
,
};
}
}
}
Bailun.DC.Models/Dtos/Finance/GetCashFlowStatementInput.cs
0 → 100644
View file @
797fa862
using
Bailun.DC.Models.Common.Page
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models.Dtos.Finance
{
public
class
GetCashFlowStatementInput
:
PageRequest
{
/// <summary>
/// 付款开始
/// </summary>
public
DateTime
PaymentTimeStart
{
get
;
set
;
}
/// <summary>
/// 付款结束
/// </summary>
public
DateTime
PaymentTimeEnd
{
get
;
set
;
}
/// <summary>
/// 公司主体
/// </summary>
public
string
CorporateEntity
{
get
;
set
;
}
}
}
Bailun.DC.Services/WebApiService/FinanceService.cs
0 → 100644
View file @
797fa862
using
Bailun.DC.Common
;
using
Bailun.DC.DB.Base
;
using
Bailun.DC.Models
;
using
Bailun.DC.Models.Common
;
using
Bailun.DC.Models.Common.Page
;
using
Bailun.DC.Models.Dtos.Finance
;
using
Dapper
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Net.Http
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Bailun.DC.Services.WebApiService
{
public
partial
class
FinanceService
{
public
async
Task
<
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>>>
GetCashFlowStatement
(
GetCashFlowStatementInput
input
)
{
try
{
var
sql
=
$@"select * from dc_base_finance_fee s1
left JOIN dc_base_finance_company s2
ON s1.company_name = s2.company_name
where s1.cost_status = 4
and (s1.is_lend is null or s1.is_lend = 1
or (s1.is_lend = 2 and s1.lend_balance > 0) or (s1.is_lend = 2 and s1.cost_form = 1))
and s1.pay_time >= @PaymentTimeStart and s1.pay_time < @PaymentTimeEnd
and s2.company_type = @CorporateEntity"
;
var
para
=
new
DynamicParameters
();
para
.
Add
(
"PaymentTimeStart"
,
input
.
PaymentTimeStart
.
Date
);
para
.
Add
(
"PaymentTimeEnd"
,
input
.
PaymentTimeEnd
.
Date
);
para
.
Add
(
"CorporateEntity"
,
input
.
CorporateEntity
);
var
data
=
SimpleCRUD
.
Query
<
dc_base_finance_fee
>(
sql
,
para
,
GlobalConfig
.
ConnectionString
).
ToList
();
var
url
=
ConfigHelper
.
AppSetting
(
"cwUrl"
);
return
new
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>>
{
Data
=
data
};
}
catch
(
Exception
e
)
{
return
new
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>>
{
IsSuccess
=
false
,
Message
=
e
.
Message
};
}
}
private
async
Task
<
List
<
Models
.
Api
.
mInterestExpense
>>
GetMInterestExpense
(
string
url
)
{
using
(
var
http
=
new
HttpClient
())
{
var
result
=
await
http
.
GetStringAsync
(
url
);
var
obj
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
List
<
Models
.
Api
.
mInterestExpense
>>(
result
);
return
obj
;
};
}
}
}
Bailun.DC.WebApi/Bailun.DC.WebApi.csproj
View file @
797fa862
...
...
@@ -10,7 +10,10 @@
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
<Compile Remove="wwwroot\**" />
<Content Remove="wwwroot\**" />
<EmbeddedResource Remove="wwwroot\**" />
<None Remove="wwwroot\**" />
</ItemGroup>
<ItemGroup>
...
...
Bailun.DC.WebApi/Controllers/FinanceController.cs
View file @
797fa862
using
Bailun.DC.Models
;
using
Bailun.DC.Models.Common
;
using
Bailun.DC.Models.Common.Page
;
using
Bailun.DC.Models.Dtos.Finance
;
using
Bailun.DC.Services
;
using
Bailun.DC.Services.WebApiService
;
using
Bailun.DC.WebApi.Attribute
;
using
Bailun.ServiceFabric.Authorize
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
namespace
Bailun.DC.WebApi.Controllers
{
...
...
@@ -29,5 +34,13 @@ namespace Bailun.DC.WebApi.Controllers
return
new
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>>
{
Data
=
list
,
IsSuccess
=
true
};
}
/// <summary>
/// 获取付现流水报表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[
HttpPost
(
"getCashFlowStatement"
)]
public
async
Task
<
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>>>
GetCashFlowStatement
(
GetCashFlowStatementInput
input
)
=>
await
new
FinanceService
().
GetCashFlowStatement
(
input
);
}
}
Bailun.DC.WebApi/Startup.cs
View file @
797fa862
using
Bailun.ServiceFabric.Extension
;
using
Bailun.DC.DB.Base
;
using
Bailun.ServiceFabric.Extension
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Mvc
;
...
...
@@ -32,6 +33,7 @@ namespace Bailun.DC.WebApi
public
void
ConfigureServices
(
IServiceCollection
services
)
{
ConfigManagerConf
.
SetConfiguration
(
Configuration
);
ConfigHelper
.
SetAppSetting
(
Configuration
);
services
.
AddSwaggerGen
(
c
=>
{
c
.
SwaggerDoc
(
"v1"
,
new
OpenApiInfo
{
Title
=
"Bailun.DC.WebApi"
,
Version
=
"v1"
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment