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
7cc77bc9
Commit
7cc77bc9
authored
Jan 15, 2020
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加更新物流供应商期初和期末金额的方法
parent
e16d8360
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
20 deletions
+85
-20
Program.cs
Bailun.DC.HappenAmount/Program.cs
+20
-19
FinanceReportServices.cs
Bailun.DC.Services/FinanceReportServices.cs
+65
-1
No files found.
Bailun.DC.HappenAmount/Program.cs
View file @
7cc77bc9
...
...
@@ -7,28 +7,29 @@ namespace Bailun.DC.HappenAmount
{
class
Program
{
static
async
Task
Main
(
string
[]
args
)
{
Console
.
WriteLine
(
"启动服务 "
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
{
services
.
AddHostedService
<
Services
>();
});
//
static async Task Main(string[] args)
//
{
//
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
//
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
//
{
//
services.AddHostedService<Services>();
//
});
await
builder
.
RunConsoleAsync
();
}
//
await builder.RunConsoleAsync();
//
}
//static void Main(string[] args)
//{
// //var start = DateTime.Parse("2019-11-01");
// //while (start.AddDays(1) < DateTime.Now)
// //{
// // new Services().Init(start, start.AddDays(1));
// // start = start.AddDays(1);
// //}
static
void
Main
(
string
[]
args
)
{
var
start
=
DateTime
.
Parse
(
"2019-12-01"
);
//while (start.AddDays(3) < DateTime.Now)
//{
// //new Services().Init(start, start.AddDays(1));
// new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(start, 0);
// start = start.AddDays(1);
//}
// new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(DateTime.Parse("2020-01-15"), 0
);
new
Bailun
.
DC
.
Services
.
FinanceReportServices
().
UpdateLogisticsWaitPay
(
start
,
0
,
"admin"
,
null
);
//
}
}
}
}
Bailun.DC.Services/FinanceReportServices.cs
View file @
7cc77bc9
...
...
@@ -272,13 +272,77 @@ namespace Bailun.DC.Services
var
result
=
cn
.
Update
<
dc_daily_lg_waitpay
>(
obj
);
UpdateLogisticsEndAmount
(
obj
.
day
,
obj
.
amount_end
);
UpdateLogisticsEndAmount
(
obj
.
day
,
obj
.
amount_end
);
//同步更新该日期后面的期初和期末
UpdateLogisticsWaitPay
(
obj
.
day
,
userid
,
username
,
null
);
return
result
>
0
?
""
:
"保存异常,请重试!"
;
}
}
/// <summary>
/// 更新后面数据的期初和期末
/// </summary>
/// <param name="day">日期</param>
/// <param name="userid">用户id</param>
/// <param name="username">用户名称</param>
/// <param name="cn"></param>
public
void
UpdateLogisticsWaitPay
(
DateTime
day
,
int
userid
,
string
username
,
MySqlConnection
cn
)
{
try
{
var
sql
=
"select * from dc_daily_lg_waitpay where day='"
+
day
.
AddDays
(
1
).
ToString
(
"yyyy-MM-dd"
)
+
"'"
;
if
(
cn
==
null
)
{
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
);
cn
.
Open
();
}
else
{
if
(
cn
.
State
==
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
}
var
obj
=
cn
.
QueryFirstOrDefault
<
dc_daily_lg_waitpay
>(
sql
);
if
(
obj
==
null
)
{
return
;
}
sql
=
"select * from dc_daily_lg_waitpay where day='"
+
day
.
ToString
(
"yyyy-MM-dd"
)
+
"'"
;
var
objPre
=
cn
.
QueryFirstOrDefault
<
dc_daily_lg_waitpay
>(
sql
);
if
(
objPre
==
null
)
{
return
;
}
obj
.
amount_start
=
objPre
.
amount_end
;
obj
.
amount_end
=
obj
.
amount_start
+
obj
.
amount_happen
+
obj
.
amount_happen_adjust
-
obj
.
amount_payed
-
obj
.
amount_payed_adjust
;
obj
.
lastupdatetime
=
DateTime
.
Now
;
obj
.
lastupdateuserid
=
userid
;
obj
.
lastupdateusername
=
username
;
cn
.
Update
(
obj
);
UpdateLogisticsEndAmount
(
obj
.
day
,
obj
.
amount_end
);
UpdateLogisticsWaitPay
(
obj
.
day
,
userid
,
username
,
cn
);
cn
.
Close
();
cn
.
Dispose
();
}
catch
(
Exception
ex
)
{
}
}
/// <summary>
/// 增加物流供应商应付账款记录
/// </summary>
/// <param name="date">日期</param>
...
...
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