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
221987cc
Commit
221987cc
authored
Aug 31, 2021
by
zhouminghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
appsettings.json update
parent
27ba4d4f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
5 deletions
+32
-5
Bailun.DC.Common.csproj
Bailun.DC.Common/Bailun.DC.Common.csproj
+1
-0
NewConfigHelper.cs
Bailun.DC.Common/NewConfigHelper.cs
+18
-0
Bailun.DC.ExportTask.csproj
Bailun.DC.ExportTask/Bailun.DC.ExportTask.csproj
+6
-0
FinanceService.cs
Bailun.DC.Services/WebApiService/FinanceService.cs
+7
-5
No files found.
Bailun.DC.Common/Bailun.DC.Common.csproj
View file @
221987cc
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
<PackageReference Include="NPOI" Version="2.4.1" />
<PackageReference Include="NPOI" Version="2.4.1" />
<PackageReference Include="Qiniu.Shared" Version="7.2.15" />
<PackageReference Include="Qiniu.Shared" Version="7.2.15" />
...
...
Bailun.DC.Common/NewConfigHelper.cs
0 → 100644
View file @
221987cc
using
System
;
using
System.Collections.Generic
;
using
Microsoft.Extensions.Configuration
;
using
System.Text
;
namespace
Bailun.DC.Common
{
public
class
NewConfigHelper
{
public
static
string
GetByName
(
string
name
)
{
var
builder
=
new
ConfigurationBuilder
()
.
AddJsonFile
(
"appsettings.json"
);
var
configuration
=
builder
.
Build
();
return
configuration
[
name
];
}
}
}
Bailun.DC.ExportTask/Bailun.DC.ExportTask.csproj
View file @
221987cc
...
@@ -16,4 +16,10 @@
...
@@ -16,4 +16,10 @@
<ProjectReference Include="..\Bailun.DC.Services\Bailun.DC.Services.csproj" />
<ProjectReference Include="..\Bailun.DC.Services\Bailun.DC.Services.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
</Project>
Bailun.DC.Services/WebApiService/FinanceService.cs
View file @
221987cc
...
@@ -1743,6 +1743,8 @@ AND platform_type = '{item.platform_type}' AND financecategoryname = '{item.fina
...
@@ -1743,6 +1743,8 @@ AND platform_type = '{item.platform_type}' AND financecategoryname = '{item.fina
}
}
else
else
{
{
Console
.
WriteLine
(
Common
.
NewConfigHelper
.
GetByName
(
"QiNiu:AccessKey"
));
Console
.
WriteLine
(
Common
.
NewConfigHelper
.
GetByName
(
"QiNiu:SecretKey"
));
Console
.
WriteLine
(
$"
{
DateTime
.
Now
.
ToString
(
"yyyy - MM - dd HH: mm:ss"
)}
不存在需要导出的任务!"
);
Console
.
WriteLine
(
$"
{
DateTime
.
Now
.
ToString
(
"yyyy - MM - dd HH: mm:ss"
)}
不存在需要导出的任务!"
);
}
}
}
}
...
@@ -1935,11 +1937,11 @@ AND platform_type = '{item.platform_type}' AND financecategoryname = '{item.fina
...
@@ -1935,11 +1937,11 @@ AND platform_type = '{item.platform_type}' AND financecategoryname = '{item.fina
var
filepath
=
Directory
.
GetCurrentDirectory
()
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyyMMdd"
)
+
"\\"
;
var
filepath
=
Directory
.
GetCurrentDirectory
()
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyyMMdd"
)
+
"\\"
;
ExcelHelper
.
DataTableToExcel
(
table
,
filepath
+
filename
,
true
);
ExcelHelper
.
DataTableToExcel
(
table
,
filepath
+
filename
,
true
);
var
content
=
File
.
ReadAllBytes
(
filepath
+
filename
);
var
content
=
File
.
ReadAllBytes
(
filepath
+
filename
);
//var accesskey = ConfigHelper.AppSetting
("QiNiu:AccessKey");
var
accesskey
=
Common
.
NewConfigHelper
.
GetByName
(
"QiNiu:AccessKey"
);
//var secretkey = ConfigHelper.AppSetting
("QiNiu:SecretKey");
var
secretkey
=
Common
.
NewConfigHelper
.
GetByName
(
"QiNiu:SecretKey"
);
//
Console.WriteLine($"accesskey:【{accesskey}】");
Console
.
WriteLine
(
$"accesskey:【
{
accesskey
}
】"
);
//
Console.WriteLine($"secretkey:【{secretkey}】");
Console
.
WriteLine
(
$"secretkey:【
{
secretkey
}
】"
);
var
qiuniu
=
new
QiNiuHelper
(
"QSvtvN4Ons1CiNzaMGqx8XmDaiM1L0ZqSwJ2YoTn"
,
"yagRd-cBOVhkRGGT-o_reMqNVjI8_k7YwoTXkhrm"
);
var
qiuniu
=
new
QiNiuHelper
(
accesskey
,
secretkey
);
return
qiuniu
.
UploadStream
(
content
,
filename
);
return
qiuniu
.
UploadStream
(
content
,
filename
);
}
}
#
endregion
#
endregion
...
...
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