Commit 2320e31d by Neo Turing

优化

parent 9a13ddf3
<?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
......@@ -30,6 +30,10 @@
{
this.plConfigs = new System.Windows.Forms.Panel();
this.gbIcbc = new System.Windows.Forms.GroupBox();
this.dtpCurrentTime = new System.Windows.Forms.DateTimePicker();
this.lbCurrentTime = new System.Windows.Forms.Label();
this.nudxNcInterval = new System.Windows.Forms.NumericUpDown();
this.btnNcStop = new System.Windows.Forms.Button();
this.lbNcIntervalUnit = new System.Windows.Forms.Label();
this.lbNcInterval = new System.Windows.Forms.Label();
this.tbxNcAcc = new System.Windows.Forms.TextBox();
......@@ -56,14 +60,10 @@
this.lblPassword = new System.Windows.Forms.Label();
this.lblUser = new System.Windows.Forms.Label();
this.rtbMessage = new System.Windows.Forms.RichTextBox();
this.btnNcStop = new System.Windows.Forms.Button();
this.nudxNcInterval = new System.Windows.Forms.NumericUpDown();
this.lbCurrentTime = new System.Windows.Forms.Label();
this.dtpCurrentTime = new System.Windows.Forms.DateTimePicker();
this.plConfigs.SuspendLayout();
this.gbIcbc.SuspendLayout();
this.gbk5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudxNcInterval)).BeginInit();
this.gbk5.SuspendLayout();
this.SuspendLayout();
//
// plConfigs
......@@ -72,8 +72,9 @@
this.plConfigs.Controls.Add(this.gbk5);
this.plConfigs.Dock = System.Windows.Forms.DockStyle.Left;
this.plConfigs.Location = new System.Drawing.Point(0, 0);
this.plConfigs.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.plConfigs.Name = "plConfigs";
this.plConfigs.Size = new System.Drawing.Size(422, 532);
this.plConfigs.Size = new System.Drawing.Size(255, 355);
this.plConfigs.TabIndex = 1;
//
// gbIcbc
......@@ -99,145 +100,175 @@
this.gbIcbc.Controls.Add(this.btnNcSync);
this.gbIcbc.Controls.Add(this.btnNcStart);
this.gbIcbc.Dock = System.Windows.Forms.DockStyle.Fill;
this.gbIcbc.Location = new System.Drawing.Point(0, 174);
this.gbIcbc.Location = new System.Drawing.Point(0, 116);
this.gbIcbc.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gbIcbc.Name = "gbIcbc";
this.gbIcbc.Size = new System.Drawing.Size(422, 358);
this.gbIcbc.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gbIcbc.Size = new System.Drawing.Size(255, 239);
this.gbIcbc.TabIndex = 31;
this.gbIcbc.TabStop = false;
this.gbIcbc.Text = "ICBC配置";
//
// dtpCurrentTime
//
this.dtpCurrentTime.Location = new System.Drawing.Point(69, 187);
this.dtpCurrentTime.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.dtpCurrentTime.Name = "dtpCurrentTime";
this.dtpCurrentTime.Size = new System.Drawing.Size(121, 21);
this.dtpCurrentTime.TabIndex = 48;
//
// lbCurrentTime
//
this.lbCurrentTime.AutoSize = true;
this.lbCurrentTime.Location = new System.Drawing.Point(9, 193);
this.lbCurrentTime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lbCurrentTime.Name = "lbCurrentTime";
this.lbCurrentTime.Size = new System.Drawing.Size(65, 12);
this.lbCurrentTime.TabIndex = 47;
this.lbCurrentTime.Text = "起始时间:";
//
// nudxNcInterval
//
this.nudxNcInterval.Location = new System.Drawing.Point(69, 160);
this.nudxNcInterval.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.nudxNcInterval.Name = "nudxNcInterval";
this.nudxNcInterval.Size = new System.Drawing.Size(91, 21);
this.nudxNcInterval.TabIndex = 46;
//
// btnNcStop
//
this.btnNcStop.Location = new System.Drawing.Point(133, 212);
this.btnNcStop.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnNcStop.Name = "btnNcStop";
this.btnNcStop.Size = new System.Drawing.Size(115, 21);
this.btnNcStop.TabIndex = 45;
this.btnNcStop.Text = "停止同步";
this.btnNcStop.UseVisualStyleBackColor = true;
this.btnNcStop.Click += new System.EventHandler(this.btnNcStop_Click);
//
// lbNcIntervalUnit
//
this.lbNcIntervalUnit.AutoSize = true;
this.lbNcIntervalUnit.Location = new System.Drawing.Point(245, 224);
this.lbNcIntervalUnit.Location = new System.Drawing.Point(164, 165);
this.lbNcIntervalUnit.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lbNcIntervalUnit.Name = "lbNcIntervalUnit";
this.lbNcIntervalUnit.Size = new System.Drawing.Size(44, 18);
this.lbNcIntervalUnit.Size = new System.Drawing.Size(29, 12);
this.lbNcIntervalUnit.TabIndex = 44;
this.lbNcIntervalUnit.Text = "分钟";
//
// lbNcInterval
//
this.lbNcInterval.AutoSize = true;
this.lbNcInterval.Location = new System.Drawing.Point(13, 222);
this.lbNcInterval.Location = new System.Drawing.Point(9, 165);
this.lbNcInterval.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lbNcInterval.Name = "lbNcInterval";
this.lbNcInterval.Size = new System.Drawing.Size(80, 18);
this.lbNcInterval.Size = new System.Drawing.Size(53, 12);
this.lbNcInterval.TabIndex = 42;
this.lbNcInterval.Text = "循 环:";
//
// tbxNcAcc
//
this.tbxNcAcc.Location = new System.Drawing.Point(103, 110);
this.tbxNcAcc.Margin = new System.Windows.Forms.Padding(4);
this.tbxNcAcc.Location = new System.Drawing.Point(69, 78);
this.tbxNcAcc.Name = "tbxNcAcc";
this.tbxNcAcc.Size = new System.Drawing.Size(305, 28);
this.tbxNcAcc.Size = new System.Drawing.Size(179, 21);
this.tbxNcAcc.TabIndex = 41;
//
// lbNcAcc
//
this.lbNcAcc.AutoSize = true;
this.lbNcAcc.Location = new System.Drawing.Point(13, 113);
this.lbNcAcc.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbNcAcc.Location = new System.Drawing.Point(9, 81);
this.lbNcAcc.Name = "lbNcAcc";
this.lbNcAcc.Size = new System.Drawing.Size(80, 18);
this.lbNcAcc.Size = new System.Drawing.Size(53, 12);
this.lbNcAcc.TabIndex = 40;
this.lbNcAcc.Text = "账 号:";
//
// tbxNcVersion
//
this.tbxNcVersion.Location = new System.Drawing.Point(286, 73);
this.tbxNcVersion.Margin = new System.Windows.Forms.Padding(4);
this.tbxNcVersion.Location = new System.Drawing.Point(181, 51);
this.tbxNcVersion.Name = "tbxNcVersion";
this.tbxNcVersion.Size = new System.Drawing.Size(122, 28);
this.tbxNcVersion.Size = new System.Drawing.Size(67, 21);
this.tbxNcVersion.TabIndex = 39;
//
// lbNcVersion
//
this.lbNcVersion.AutoSize = true;
this.lbNcVersion.Location = new System.Drawing.Point(206, 78);
this.lbNcVersion.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbNcVersion.Location = new System.Drawing.Point(131, 54);
this.lbNcVersion.Name = "lbNcVersion";
this.lbNcVersion.Size = new System.Drawing.Size(80, 18);
this.lbNcVersion.Size = new System.Drawing.Size(53, 12);
this.lbNcVersion.TabIndex = 38;
this.lbNcVersion.Text = "版本号:";
//
// tbxNcCertId
//
this.tbxNcCertId.Location = new System.Drawing.Point(103, 183);
this.tbxNcCertId.Margin = new System.Windows.Forms.Padding(4);
this.tbxNcCertId.Location = new System.Drawing.Point(69, 132);
this.tbxNcCertId.Name = "tbxNcCertId";
this.tbxNcCertId.Size = new System.Drawing.Size(305, 28);
this.tbxNcCertId.Size = new System.Drawing.Size(179, 21);
this.tbxNcCertId.TabIndex = 37;
//
// lbNcCertId
//
this.lbNcCertId.AutoSize = true;
this.lbNcCertId.Location = new System.Drawing.Point(13, 186);
this.lbNcCertId.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbNcCertId.Location = new System.Drawing.Point(9, 135);
this.lbNcCertId.Name = "lbNcCertId";
this.lbNcCertId.Size = new System.Drawing.Size(80, 18);
this.lbNcCertId.Size = new System.Drawing.Size(53, 12);
this.lbNcCertId.TabIndex = 36;
this.lbNcCertId.Text = "证书号:";
//
// lbNcUrl
//
this.lbNcUrl.AutoSize = true;
this.lbNcUrl.Location = new System.Drawing.Point(13, 39);
this.lbNcUrl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbNcUrl.Location = new System.Drawing.Point(9, 27);
this.lbNcUrl.Name = "lbNcUrl";
this.lbNcUrl.Size = new System.Drawing.Size(71, 18);
this.lbNcUrl.Size = new System.Drawing.Size(47, 12);
this.lbNcUrl.TabIndex = 30;
this.lbNcUrl.Text = "NC服务:";
//
// tbxNcPort
//
this.tbxNcPort.Location = new System.Drawing.Point(103, 73);
this.tbxNcPort.Margin = new System.Windows.Forms.Padding(4);
this.tbxNcPort.Location = new System.Drawing.Point(69, 51);
this.tbxNcPort.Name = "tbxNcPort";
this.tbxNcPort.Size = new System.Drawing.Size(95, 28);
this.tbxNcPort.Size = new System.Drawing.Size(56, 21);
this.tbxNcPort.TabIndex = 34;
//
// tbxNcUrl
//
this.tbxNcUrl.BackColor = System.Drawing.SystemColors.Window;
this.tbxNcUrl.Location = new System.Drawing.Point(103, 36);
this.tbxNcUrl.Margin = new System.Windows.Forms.Padding(4);
this.tbxNcUrl.Location = new System.Drawing.Point(69, 24);
this.tbxNcUrl.Name = "tbxNcUrl";
this.tbxNcUrl.Size = new System.Drawing.Size(305, 28);
this.tbxNcUrl.Size = new System.Drawing.Size(179, 21);
this.tbxNcUrl.TabIndex = 33;
//
// tbxNcGroupId
//
this.tbxNcGroupId.Location = new System.Drawing.Point(103, 147);
this.tbxNcGroupId.Margin = new System.Windows.Forms.Padding(4);
this.tbxNcGroupId.Location = new System.Drawing.Point(69, 105);
this.tbxNcGroupId.Name = "tbxNcGroupId";
this.tbxNcGroupId.Size = new System.Drawing.Size(305, 28);
this.tbxNcGroupId.Size = new System.Drawing.Size(179, 21);
this.tbxNcGroupId.TabIndex = 35;
//
// lbNcGroupId
//
this.lbNcGroupId.AutoSize = true;
this.lbNcGroupId.Location = new System.Drawing.Point(13, 150);
this.lbNcGroupId.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbNcGroupId.Location = new System.Drawing.Point(9, 108);
this.lbNcGroupId.Name = "lbNcGroupId";
this.lbNcGroupId.Size = new System.Drawing.Size(80, 18);
this.lbNcGroupId.Size = new System.Drawing.Size(53, 12);
this.lbNcGroupId.TabIndex = 32;
this.lbNcGroupId.Text = "组织号:";
//
// lbNcPort
//
this.lbNcPort.AutoSize = true;
this.lbNcPort.Location = new System.Drawing.Point(13, 78);
this.lbNcPort.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbNcPort.Location = new System.Drawing.Point(9, 54);
this.lbNcPort.Name = "lbNcPort";
this.lbNcPort.Size = new System.Drawing.Size(80, 18);
this.lbNcPort.Size = new System.Drawing.Size(53, 12);
this.lbNcPort.TabIndex = 31;
this.lbNcPort.Text = "端口号:";
//
// btnNcSync
//
this.btnNcSync.Location = new System.Drawing.Point(296, 218);
this.btnNcSync.Location = new System.Drawing.Point(194, 160);
this.btnNcSync.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnNcSync.Name = "btnNcSync";
this.btnNcSync.Size = new System.Drawing.Size(112, 30);
this.btnNcSync.Size = new System.Drawing.Size(54, 48);
this.btnNcSync.TabIndex = 28;
this.btnNcSync.Text = "立即执行";
this.btnNcSync.UseVisualStyleBackColor = true;
......@@ -245,9 +276,10 @@
//
// btnNcStart
//
this.btnNcStart.Location = new System.Drawing.Point(16, 292);
this.btnNcStart.Location = new System.Drawing.Point(11, 212);
this.btnNcStart.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnNcStart.Name = "btnNcStart";
this.btnNcStart.Size = new System.Drawing.Size(194, 32);
this.btnNcStart.Size = new System.Drawing.Size(114, 21);
this.btnNcStart.TabIndex = 29;
this.btnNcStart.Text = "开始同步";
this.btnNcStart.UseVisualStyleBackColor = true;
......@@ -265,8 +297,10 @@
this.gbk5.Controls.Add(this.lblUser);
this.gbk5.Dock = System.Windows.Forms.DockStyle.Top;
this.gbk5.Location = new System.Drawing.Point(0, 0);
this.gbk5.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gbk5.Name = "gbk5";
this.gbk5.Size = new System.Drawing.Size(422, 174);
this.gbk5.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gbk5.Size = new System.Drawing.Size(255, 116);
this.gbk5.TabIndex = 30;
this.gbk5.TabStop = false;
this.gbk5.Text = "K5配置";
......@@ -274,37 +308,33 @@
// lblUrl
//
this.lblUrl.AutoSize = true;
this.lblUrl.Location = new System.Drawing.Point(13, 40);
this.lblUrl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblUrl.Location = new System.Drawing.Point(9, 27);
this.lblUrl.Name = "lblUrl";
this.lblUrl.Size = new System.Drawing.Size(80, 18);
this.lblUrl.Size = new System.Drawing.Size(53, 12);
this.lblUrl.TabIndex = 13;
this.lblUrl.Text = "服务器:";
//
// tbxUserName
//
this.tbxUserName.Location = new System.Drawing.Point(103, 73);
this.tbxUserName.Margin = new System.Windows.Forms.Padding(4);
this.tbxUserName.Location = new System.Drawing.Point(69, 49);
this.tbxUserName.Name = "tbxUserName";
this.tbxUserName.Size = new System.Drawing.Size(221, 28);
this.tbxUserName.Size = new System.Drawing.Size(121, 21);
this.tbxUserName.TabIndex = 17;
//
// tbxServiceUrl
//
this.tbxServiceUrl.BackColor = System.Drawing.SystemColors.Window;
this.tbxServiceUrl.Location = new System.Drawing.Point(103, 37);
this.tbxServiceUrl.Margin = new System.Windows.Forms.Padding(4);
this.tbxServiceUrl.Location = new System.Drawing.Point(69, 25);
this.tbxServiceUrl.Name = "tbxServiceUrl";
this.tbxServiceUrl.Size = new System.Drawing.Size(221, 28);
this.tbxServiceUrl.Size = new System.Drawing.Size(121, 21);
this.tbxServiceUrl.TabIndex = 16;
//
// btnLogout
//
this.btnLogout.Enabled = false;
this.btnLogout.Location = new System.Drawing.Point(332, 105);
this.btnLogout.Margin = new System.Windows.Forms.Padding(4);
this.btnLogout.Location = new System.Drawing.Point(197, 70);
this.btnLogout.Name = "btnLogout";
this.btnLogout.Size = new System.Drawing.Size(76, 34);
this.btnLogout.Size = new System.Drawing.Size(51, 23);
this.btnLogout.TabIndex = 27;
this.btnLogout.Text = "退出";
this.btnLogout.UseVisualStyleBackColor = true;
......@@ -312,19 +342,17 @@
//
// tbxPassword
//
this.tbxPassword.Location = new System.Drawing.Point(103, 110);
this.tbxPassword.Margin = new System.Windows.Forms.Padding(4);
this.tbxPassword.Location = new System.Drawing.Point(69, 73);
this.tbxPassword.Name = "tbxPassword";
this.tbxPassword.PasswordChar = '*';
this.tbxPassword.Size = new System.Drawing.Size(221, 28);
this.tbxPassword.Size = new System.Drawing.Size(121, 21);
this.tbxPassword.TabIndex = 18;
//
// btnLogin
//
this.btnLogin.Location = new System.Drawing.Point(332, 37);
this.btnLogin.Margin = new System.Windows.Forms.Padding(4);
this.btnLogin.Location = new System.Drawing.Point(197, 25);
this.btnLogin.Name = "btnLogin";
this.btnLogin.Size = new System.Drawing.Size(76, 64);
this.btnLogin.Size = new System.Drawing.Size(51, 43);
this.btnLogin.TabIndex = 26;
this.btnLogin.Text = "登录";
this.btnLogin.UseVisualStyleBackColor = true;
......@@ -333,81 +361,48 @@
// lblPassword
//
this.lblPassword.AutoSize = true;
this.lblPassword.Location = new System.Drawing.Point(13, 113);
this.lblPassword.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblPassword.Location = new System.Drawing.Point(9, 75);
this.lblPassword.Name = "lblPassword";
this.lblPassword.Size = new System.Drawing.Size(80, 18);
this.lblPassword.Size = new System.Drawing.Size(53, 12);
this.lblPassword.TabIndex = 15;
this.lblPassword.Text = "密 码:";
//
// lblUser
//
this.lblUser.AutoSize = true;
this.lblUser.Location = new System.Drawing.Point(13, 79);
this.lblUser.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblUser.Location = new System.Drawing.Point(9, 53);
this.lblUser.Name = "lblUser";
this.lblUser.Size = new System.Drawing.Size(80, 18);
this.lblUser.Size = new System.Drawing.Size(53, 12);
this.lblUser.TabIndex = 14;
this.lblUser.Text = "用户名:";
//
// rtbMessage
//
this.rtbMessage.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtbMessage.Location = new System.Drawing.Point(422, 0);
this.rtbMessage.Location = new System.Drawing.Point(255, 0);
this.rtbMessage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.rtbMessage.Name = "rtbMessage";
this.rtbMessage.Size = new System.Drawing.Size(683, 532);
this.rtbMessage.Size = new System.Drawing.Size(482, 355);
this.rtbMessage.TabIndex = 2;
this.rtbMessage.Text = "";
//
// btnNcStop
//
this.btnNcStop.Location = new System.Drawing.Point(214, 292);
this.btnNcStop.Name = "btnNcStop";
this.btnNcStop.Size = new System.Drawing.Size(194, 32);
this.btnNcStop.TabIndex = 45;
this.btnNcStop.Text = "停止同步";
this.btnNcStop.UseVisualStyleBackColor = true;
this.btnNcStop.Click += new System.EventHandler(this.btnNcStop_Click);
//
// nudxNcInterval
//
this.nudxNcInterval.Location = new System.Drawing.Point(103, 219);
this.nudxNcInterval.Name = "nudxNcInterval";
this.nudxNcInterval.Size = new System.Drawing.Size(136, 28);
this.nudxNcInterval.TabIndex = 46;
//
// lbCurrentTime
//
this.lbCurrentTime.AutoSize = true;
this.lbCurrentTime.Location = new System.Drawing.Point(13, 259);
this.lbCurrentTime.Name = "lbCurrentTime";
this.lbCurrentTime.Size = new System.Drawing.Size(134, 18);
this.lbCurrentTime.TabIndex = 47;
this.lbCurrentTime.Text = "到账时间起始:";
//
// dtpCurrentTime
//
this.dtpCurrentTime.Location = new System.Drawing.Point(140, 254);
this.dtpCurrentTime.Name = "dtpCurrentTime";
this.dtpCurrentTime.Size = new System.Drawing.Size(268, 28);
this.dtpCurrentTime.TabIndex = 48;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1105, 532);
this.ClientSize = new System.Drawing.Size(737, 355);
this.Controls.Add(this.rtbMessage);
this.Controls.Add(this.plConfigs);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "FrmMain";
this.Text = "工商银行流水同步";
this.Load += new System.EventHandler(this.FrmMain_Load);
this.plConfigs.ResumeLayout(false);
this.gbIcbc.ResumeLayout(false);
this.gbIcbc.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudxNcInterval)).EndInit();
this.gbk5.ResumeLayout(false);
this.gbk5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudxNcInterval)).EndInit();
this.ResumeLayout(false);
}
......
......@@ -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)
{
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}");
}
}
}
}
......
......@@ -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" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment