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
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
17 deletions
+36
-17
App.config
Src/App.config
+4
-4
FrmMain.Designer.cs
Src/FrmMain.Designer.cs
+0
-0
FrmMain.cs
Src/FrmMain.cs
+28
-9
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"
?>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
configuration
>
<
connectionStrings
>
<
connectionStrings
>
<!--<
add
name
=
"Database"
providerName
=
"Sqlite"
connectionString
=
"$ROOT\AppData\primary.sqlite"
/>-->
<!--<
add
name
=
"Database"
providerName
=
"Sqlite"
connectionString
=
"$ROOT\AppData\primary.sqlite"
/>-->
</
connectionStrings
>
</
connectionStrings
></
configuration
>
</
configuration
>
\ No newline at end of file
\ 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
...
@@ -128,7 +128,7 @@ namespace Kivii.Client.Finances.Icbc
task
.
Success
(
resp
=>
task
.
Success
(
resp
=>
{
{
initK5FormCtl
(
false
);
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
}
"
);
outputMessage
(
$"登录成功:
{
resp
.
FullName
}
"
);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
},
true
);
},
true
);
...
@@ -179,6 +179,7 @@ namespace Kivii.Client.Finances.Icbc
...
@@ -179,6 +179,7 @@ namespace Kivii.Client.Finances.Icbc
{
{
_timer
=
new
Timer
();
_timer
=
new
Timer
();
_timer
.
Interval
=
(
int
)(
nudxNcInterval
.
Value
*
60
*
1000
);
_timer
.
Interval
=
(
int
)(
nudxNcInterval
.
Value
*
60
*
1000
);
//_timer.Interval = (int)(nudxNcInterval.Value * 1000);
_timer
.
Tick
+=
_timer_Tick
;
_timer
.
Tick
+=
_timer_Tick
;
}
}
_timer
.
Start
();
_timer
.
Start
();
...
@@ -208,7 +209,7 @@ namespace Kivii.Client.Finances.Icbc
...
@@ -208,7 +209,7 @@ namespace Kivii.Client.Finances.Icbc
private
void
btnNcSync_Click
(
object
sender
,
EventArgs
e
)
private
void
btnNcSync_Click
(
object
sender
,
EventArgs
e
)
{
{
SyncPayments
();
executeSync
();
}
}
private
void
_timer_Tick
(
object
sender
,
EventArgs
e
)
private
void
_timer_Tick
(
object
sender
,
EventArgs
e
)
...
@@ -216,7 +217,7 @@ namespace Kivii.Client.Finances.Icbc
...
@@ -216,7 +217,7 @@ namespace Kivii.Client.Finances.Icbc
try
try
{
{
_timer
.
Stop
();
_timer
.
Stop
();
SyncPayments
();
executeSync
();
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -228,13 +229,22 @@ namespace Kivii.Client.Finances.Icbc
...
@@ -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
));
syncICBC
();
return
;
});
th
.
Start
();
}
}
private
void
syncICBC
()
{
//if (InvokeRequired)
//{
// this.Invoke(new Action(SyncPayments));
// return;
//}
if
(!
int
.
TryParse
(
tbxNcPort
.
Text
,
out
int
port
))
if
(!
int
.
TryParse
(
tbxNcPort
.
Text
,
out
int
port
))
{
{
outputMessage
(
"NC端口号设置错误"
);
outputMessage
(
"NC端口号设置错误"
);
...
@@ -282,7 +292,7 @@ namespace Kivii.Client.Finances.Icbc
...
@@ -282,7 +292,7 @@ namespace Kivii.Client.Finances.Icbc
try
try
{
{
var
rtns
=
_client
.
Post
(
request
);
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
;
DateTime
maxTime
=
DateTime
.
MinValue
;
foreach
(
var
item
in
items
)
foreach
(
var
item
in
items
)
...
@@ -295,13 +305,22 @@ namespace Kivii.Client.Finances.Icbc
...
@@ -295,13 +305,22 @@ namespace Kivii.Client.Finances.Icbc
}
}
if
(
maxTime
!=
DateTime
.
MinValue
)
if
(
maxTime
!=
DateTime
.
MinValue
)
{
{
this
.
Invoke
(
new
Action
(()
=>
{
dtpCurrentTime
.
Value
=
maxTime
;
dtpCurrentTime
.
Value
=
maxTime
;
setDefault
(
dtpCurrentTime
);
setDefault
(
dtpCurrentTime
);
}));
}
}
}
}
catch
(
Exception
ex
)
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 @@
...
@@ -33,16 +33,16 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference
Include=
"Kivii.Common.V4.0, Version=5.6.2024.1160, Culture=neutral, processorArchitecture=MSIL"
>
<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>
<Reference
Include=
"Kivii.Core.V4.0, Version=5.6.2023.9000, Culture=neutral, processorArchitecture=MSIL"
>
<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>
<Reference
Include=
"Kivii.Linq.Sqlite.V4.0, Version=5.6.2023.3000, Culture=neutral, processorArchitecture=MSIL"
>
<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>
<Reference
Include=
"Kivii.Linq.V4.0, Version=5.6.2024.2000, Culture=neutral, processorArchitecture=MSIL"
>
<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>
<Reference
Include=
"System"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<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