Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Client.Finances.Icbc
Project
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
陶然
Kivii.Client.Finances.Icbc
Commits
2320e31d
Commit
2320e31d
authored
Apr 23, 2024
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
9a13ddf3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
20 deletions
+39
-20
App.config
Src/App.config
+4
-4
FrmMain.Designer.cs
Src/FrmMain.Designer.cs
+0
-0
FrmMain.cs
Src/FrmMain.cs
+31
-12
Kivii.Client.Finances.Icbc.V4.0.csproj
Src/Kivii.Client.Finances.Icbc.V4.0.csproj
+4
-4
No files found.
Src/App.config
View file @
2320e31d
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
connectionStrings
>
<
connectionStrings
>
<!--<
add
name
=
"Database"
providerName
=
"Sqlite"
connectionString
=
"$ROOT\AppData\primary.sqlite"
/>-->
</
connectionStrings
>
</
configuration
>
\ No newline at end of file
</
connectionStrings
></
configuration
>
\ No newline at end of file
Src/FrmMain.Designer.cs
View file @
2320e31d
This diff is collapsed.
Click to expand it.
Src/FrmMain.cs
View file @
2320e31d
...
...
@@ -128,7 +128,7 @@ namespace Kivii.Client.Finances.Icbc
task
.
Success
(
resp
=>
{
initK5FormCtl
(
false
);
setDefault
(
tbxServiceUrl
,
tbxUserName
,
tbxPassword
,
tbxNcAcc
,
tbxNcCertId
,
tbxNcGroupId
,
nudxNcInterval
,
tbxNcPort
,
tbxNcUrl
,
tbxNcVersion
);
setDefault
(
tbxServiceUrl
,
tbxUserName
,
tbxPassword
,
tbxNcAcc
,
tbxNcCertId
,
tbxNcGroupId
,
nudxNcInterval
,
tbxNcPort
,
tbxNcUrl
,
tbxNcVersion
,
dtpCurrentTime
);
outputMessage
(
$"登录成功:
{
resp
.
FullName
}
"
);
Thread
.
Sleep
(
100
);
},
true
);
...
...
@@ -179,6 +179,7 @@ namespace Kivii.Client.Finances.Icbc
{
_timer
=
new
Timer
();
_timer
.
Interval
=
(
int
)(
nudxNcInterval
.
Value
*
60
*
1000
);
//_timer.Interval = (int)(nudxNcInterval.Value * 1000);
_timer
.
Tick
+=
_timer_Tick
;
}
_timer
.
Start
();
...
...
@@ -208,7 +209,7 @@ namespace Kivii.Client.Finances.Icbc
private
void
btnNcSync_Click
(
object
sender
,
EventArgs
e
)
{
SyncPayments
();
executeSync
();
}
private
void
_timer_Tick
(
object
sender
,
EventArgs
e
)
...
...
@@ -216,7 +217,7 @@ namespace Kivii.Client.Finances.Icbc
try
{
_timer
.
Stop
();
SyncPayments
();
executeSync
();
}
catch
(
Exception
ex
)
{
...
...
@@ -228,13 +229,22 @@ namespace Kivii.Client.Finances.Icbc
}
}
private
void
SyncPayments
()
private
void
executeSync
()
{
if
(
InvokeRequired
)
var
th
=
KiviiContext
.
NewThread
(()
=>
{
this
.
Invoke
(
new
Action
(
SyncPayments
));
return
;
}
syncICBC
();
});
th
.
Start
();
}
private
void
syncICBC
()
{
//if (InvokeRequired)
//{
// this.Invoke(new Action(SyncPayments));
// return;
//}
if
(!
int
.
TryParse
(
tbxNcPort
.
Text
,
out
int
port
))
{
outputMessage
(
"NC端口号设置错误"
);
...
...
@@ -282,7 +292,7 @@ namespace Kivii.Client.Finances.Icbc
try
{
var
rtns
=
_client
.
Post
(
request
);
outputMessage
(
$"New:
{
DateTime
.
Now
:
yyyy
-
MM
-
dd
HH
:
mm
:
ss
}
成功查询
{
rtns
.
Total
}
条收款,插入
{
rtns
.
Insert
}
条,跳过重复
{
rtns
.
Skip
}
条!"
);
outputMessage
(
$"New:
查询日期:
{
beginTime
:
yyyy
-
MM
-
dd
}
成功查询
{
rtns
.
Total
}
条收款,插入
{
rtns
.
Insert
}
条,跳过重复
{
rtns
.
Skip
}
条!"
);
DateTime
maxTime
=
DateTime
.
MinValue
;
foreach
(
var
item
in
items
)
...
...
@@ -295,13 +305,22 @@ namespace Kivii.Client.Finances.Icbc
}
if
(
maxTime
!=
DateTime
.
MinValue
)
{
dtpCurrentTime
.
Value
=
maxTime
;
setDefault
(
dtpCurrentTime
);
this
.
Invoke
(
new
Action
(()
=>
{
dtpCurrentTime
.
Value
=
maxTime
;
setDefault
(
dtpCurrentTime
);
}));
}
}
catch
(
Exception
ex
)
{
outputMessage
(
$"请求同步流水失败,原因:
{
ex
.
Message
}
"
);
var
resp
=
ex
.
GetResponseStatus
();
if
(
resp
==
null
)
outputMessage
(
$"请求同步流水失败,原因:
{
ex
.
Message
}
"
);
else
{
var
msg
=
resp
.
Message
;
outputMessage
(
$"请求同步流水失败,原因:
{
msg
}
"
);
}
}
}
}
...
...
Src/Kivii.Client.Finances.Icbc.V4.0.csproj
View file @
2320e31d
...
...
@@ -33,16 +33,16 @@
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Kivii.Common.V4.0, Version=5.6.2024.1160, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Common.5.6.2024.1160\lib\net40\Kivii.Common.V4.0.dll
</HintPath>
<HintPath>
..\
..\
packages\Kivii.Common.5.6.2024.1160\lib\net40\Kivii.Common.V4.0.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Core.V4.0, Version=5.6.2023.9000, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Core.5.6.2023.9000\lib\net40\Kivii.Core.V4.0.dll
</HintPath>
<HintPath>
..\
..\
packages\Kivii.Core.5.6.2023.9000\lib\net40\Kivii.Core.V4.0.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Linq.Sqlite.V4.0, Version=5.6.2023.3000, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Linq.Sqlite.5.6.2023.3000\lib\net40\Kivii.Linq.Sqlite.V4.0.dll
</HintPath>
<HintPath>
..\
..\
packages\Kivii.Linq.Sqlite.5.6.2023.3000\lib\net40\Kivii.Linq.Sqlite.V4.0.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Linq.V4.0, Version=5.6.2024.2000, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Linq.5.6.2024.2000\lib\net40\Kivii.Linq.V4.0.dll
</HintPath>
<HintPath>
..\
..\
packages\Kivii.Linq.5.6.2024.2000\lib\net40\Kivii.Linq.V4.0.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
...
...
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