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
7bba2879
Commit
7bba2879
authored
Nov 15, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加获取采购单明细接口
parent
9303d435
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
Program.cs
Bailun.DC.DailyPayAndIncoming/Program.cs
+1
-1
PurchaseServices.cs
Bailun.DC.Services/PurchaseServices.cs
+30
-0
ApiController.cs
Bailun.DC.Web/Controllers/ApiController.cs
+35
-0
No files found.
Bailun.DC.DailyPayAndIncoming/Program.cs
View file @
7bba2879
...
...
@@ -22,7 +22,7 @@ namespace Bailun.DC.DailyPayAndIncoming
//{
// var _services = new Services();
// var start = DateTime.Parse("2019-
10
-01");
// var start = DateTime.Parse("2019-
09
-01");
// while (start < DateTime.Now)
// {
...
...
Bailun.DC.Services/PurchaseServices.cs
View file @
7bba2879
...
...
@@ -123,5 +123,35 @@ namespace Bailun.DC.Services
}
}
/// <summary>
/// 根据时间段获取采购单明细
/// </summary>
/// <param name="page">当前页</param>
/// <param name="pagesize">每页记录数</param>
/// <param name="start">开始时间</param>
/// <param name="end">结束时间</param>
/// <param name="suppliername">供应商名称</param>
/// <returns></returns>
public
List
<
Models
.
dc_base_purchase_details
>
ListPurchaseDetail
(
int
page
,
int
pagesize
,
DateTime
start
,
DateTime
end
,
string
suppliername
)
{
var
sql
=
$@"select * from dc_base_purchase_details where gmt_modified>='
{
start
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
' and gmt_modified<'
{
end
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
'"
;
if
(!
string
.
IsNullOrWhiteSpace
(
suppliername
))
{
sql
+=
$" and deliver_name='
{
suppliername
}
'"
;
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
Query
<
dc_base_purchase_details
>(
sql
+
" limit "
+
((
page
-
1
)
*
pagesize
)
+
","
+
pagesize
,
null
,
null
,
true
,
2
*
60
).
AsList
();
return
obj
;
}
}
}
}
Bailun.DC.Web/Controllers/ApiController.cs
View file @
7bba2879
...
...
@@ -495,5 +495,39 @@ namespace Bailun.DC.Web.Controllers
}
/// <summary>
/// 根据时间段获取采购单明细
/// </summary>
/// <param name="page">当前页码</param>
/// <param name="start">开始时间</param>
/// <param name="end">结束时间</param>
/// <param name="suppliername">供应商名称</param>
/// <returns></returns>
[
HttpPost
]
public
JsonResult
ListPuchaseDetail
(
int
page
,
DateTime
start
,
DateTime
end
,
string
suppliername
)
{
var
pagesize
=
1000
;
try
{
var
obj
=
new
Services
.
PurchaseServices
().
ListPurchaseDetail
(
page
,
pagesize
,
start
,
end
,
suppliername
);
return
Json
(
new
{
success
=
true
,
msg
=
""
,
data
=
obj
});
}
catch
(
Exception
ex
)
{
return
Json
(
new
{
success
=
false
,
msg
=
ex
.
Message
,
});
}
}
}
}
\ No newline at end of file
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