From 1e1510907c9505565ddefd6e6b5b70a87ccdc048 Mon Sep 17 00:00:00 2001 From: 8402134 <8402134@qq.com> Date: Thu, 29 Sep 2022 18:35:00 +0800 Subject: [PATCH] w --- 应用/BackupAndImport/AutoBakThread.cs | 89 + 应用/BackupAndImport/BackupAndImport.csproj | 206 + .../BackupAndImport/CheckAdminForm.Designer.cs | 117 + 应用/BackupAndImport/CheckAdminForm.cs | 56 + 应用/BackupAndImport/CheckAdminForm.resx | 123 + 应用/BackupAndImport/Class1.cs | 76 + 应用/BackupAndImport/Config.cs | 67 + 应用/BackupAndImport/ECO/Eco.cs | 1004 +++ .../ECO/Entitys/ECOMemberInfo.cs | 33 + .../BackupAndImport/ECO/Entitys/ECOOrderInfo.cs | 50 + .../BackupAndImport/ECO/Entitys/EcoLoginInfo.cs | 20 + 应用/BackupAndImport/ECO/EventLog.cs | 32 + 应用/BackupAndImport/ECO/Events/LogEvent.cs | 20 + 应用/BackupAndImport/ECO/Tools.cs | 62 + .../EditRobotNameForm.Designer.cs | 177 + 应用/BackupAndImport/EditRobotNameForm.cs | 117 + 应用/BackupAndImport/EditRobotNameForm.resx | 123 + 应用/BackupAndImport/Entitys/AliOrder.cs | 33 + 应用/BackupAndImport/Entitys/BindCache.cs | 25 + .../BackupAndImport/Entitys/PrimaryKeyTemp.cs | 18 + .../BackupAndImport/Entitys/RobotUpdateName.cs | 26 + .../Entitys/alitools/AliOrder.cs | 32 + .../Entitys/alitools/MemberInfo.cs | 28 + .../Entitys/annaer/上下级管理.cs | 11 + .../BackupAndImport/Entitys/annaer/会员信息.cs | 254 + .../Entitys/annaer_cloud/fission.cs | 20 + .../Entitys/annaer_cloud/member.cs | 44 + .../Entitys/lieke/GroupInvite.cs | 125 + 应用/BackupAndImport/Entitys/lieke/Member.cs | 405 ++ 应用/BackupAndImport/Entitys/念初/member.cs | 175 + 应用/BackupAndImport/Entitys/念初/orders.cs | 161 + 应用/BackupAndImport/Entitys/悠哉/member.cs | 226 + .../Entitys/淘某喵/members_41235.cs | 99 + .../Entitys/淘某喵/members_46349.cs | 99 + .../Entitys/淘某喵/rewarded_orders_41235.cs | 109 + .../Entitys/淘某喵/rewarded_orders_46349.cs | 109 + .../BackupAndImport/Entitys/速推客/代理管理.cs | 86 + .../BackupAndImport/Entitys/速推客/会员信息.cs | 179 + 应用/BackupAndImport/Enums.cs | 23 + 应用/BackupAndImport/MainForm.Designer.cs | 2799 ++++++++ 应用/BackupAndImport/MainForm.cs | 6075 +++++++++++++++++ 应用/BackupAndImport/MainForm.resx | 237 + .../BackupAndImport/NianChu/Entitys/TbOrder.cs | 302 + .../BackupAndImport/NianChu/Entitys/members.cs | 205 + .../BackupAndImport/NianChu/Entitys/robots.cs | 96 + 应用/BackupAndImport/NianChu/EventLog.cs | 30 + 应用/BackupAndImport/NianChu/Nianchu.cs | 704 ++ .../BackupAndImport/Properties/AssemblyInfo.cs | 36 + .../Properties/Resources.Designer.cs | 100 + .../BackupAndImport/Properties/Resources.resx | 136 + .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 6 + 应用/BackupAndImport/Properties/licenses.licx | 5 + 应用/BackupAndImport/Resources/备份与导入.png | Bin 0 -> 5963 bytes .../TestMutipleThreadRestEvent.cs | 59 + 应用/BackupAndImport/Tools.cs | 101 + 应用/BackupAndImport/UserId.cs | 33 + .../Utils/SetConnectionConfig.cs | 67 + .../速推客云端/Entitys/STKMemberInfo.cs | 91 + 应用/BackupAndImport/速推客云端/EventLog.cs | 30 + 应用/BackupAndImport/速推客云端/Stk.cs | 865 +++ 61 files changed, 16662 insertions(+) create mode 100644 应用/BackupAndImport/AutoBakThread.cs create mode 100644 应用/BackupAndImport/BackupAndImport.csproj create mode 100644 应用/BackupAndImport/CheckAdminForm.Designer.cs create mode 100644 应用/BackupAndImport/CheckAdminForm.cs create mode 100644 应用/BackupAndImport/CheckAdminForm.resx create mode 100644 应用/BackupAndImport/Class1.cs create mode 100644 应用/BackupAndImport/Config.cs create mode 100644 应用/BackupAndImport/ECO/Eco.cs create mode 100644 应用/BackupAndImport/ECO/Entitys/ECOMemberInfo.cs create mode 100644 应用/BackupAndImport/ECO/Entitys/ECOOrderInfo.cs create mode 100644 应用/BackupAndImport/ECO/Entitys/EcoLoginInfo.cs create mode 100644 应用/BackupAndImport/ECO/EventLog.cs create mode 100644 应用/BackupAndImport/ECO/Events/LogEvent.cs create mode 100644 应用/BackupAndImport/ECO/Tools.cs create mode 100644 应用/BackupAndImport/EditRobotNameForm.Designer.cs create mode 100644 应用/BackupAndImport/EditRobotNameForm.cs create mode 100644 应用/BackupAndImport/EditRobotNameForm.resx create mode 100644 应用/BackupAndImport/Entitys/AliOrder.cs create mode 100644 应用/BackupAndImport/Entitys/BindCache.cs create mode 100644 应用/BackupAndImport/Entitys/PrimaryKeyTemp.cs create mode 100644 应用/BackupAndImport/Entitys/RobotUpdateName.cs create mode 100644 应用/BackupAndImport/Entitys/alitools/AliOrder.cs create mode 100644 应用/BackupAndImport/Entitys/alitools/MemberInfo.cs create mode 100644 应用/BackupAndImport/Entitys/annaer/上下级管理.cs create mode 100644 应用/BackupAndImport/Entitys/annaer/会员信息.cs create mode 100644 应用/BackupAndImport/Entitys/annaer_cloud/fission.cs create mode 100644 应用/BackupAndImport/Entitys/annaer_cloud/member.cs create mode 100644 应用/BackupAndImport/Entitys/lieke/GroupInvite.cs create mode 100644 应用/BackupAndImport/Entitys/lieke/Member.cs create mode 100644 应用/BackupAndImport/Entitys/念初/member.cs create mode 100644 应用/BackupAndImport/Entitys/念初/orders.cs create mode 100644 应用/BackupAndImport/Entitys/悠哉/member.cs create mode 100644 应用/BackupAndImport/Entitys/淘某喵/members_41235.cs create mode 100644 应用/BackupAndImport/Entitys/淘某喵/members_46349.cs create mode 100644 应用/BackupAndImport/Entitys/淘某喵/rewarded_orders_41235.cs create mode 100644 应用/BackupAndImport/Entitys/淘某喵/rewarded_orders_46349.cs create mode 100644 应用/BackupAndImport/Entitys/速推客/代理管理.cs create mode 100644 应用/BackupAndImport/Entitys/速推客/会员信息.cs create mode 100644 应用/BackupAndImport/Enums.cs create mode 100644 应用/BackupAndImport/MainForm.Designer.cs create mode 100644 应用/BackupAndImport/MainForm.cs create mode 100644 应用/BackupAndImport/MainForm.resx create mode 100644 应用/BackupAndImport/NianChu/Entitys/TbOrder.cs create mode 100644 应用/BackupAndImport/NianChu/Entitys/members.cs create mode 100644 应用/BackupAndImport/NianChu/Entitys/robots.cs create mode 100644 应用/BackupAndImport/NianChu/EventLog.cs create mode 100644 应用/BackupAndImport/NianChu/Nianchu.cs create mode 100644 应用/BackupAndImport/Properties/AssemblyInfo.cs create mode 100644 应用/BackupAndImport/Properties/Resources.Designer.cs create mode 100644 应用/BackupAndImport/Properties/Resources.resx create mode 100644 应用/BackupAndImport/Properties/Settings.Designer.cs create mode 100644 应用/BackupAndImport/Properties/Settings.settings create mode 100644 应用/BackupAndImport/Properties/licenses.licx create mode 100644 应用/BackupAndImport/Resources/备份与导入.png create mode 100644 应用/BackupAndImport/TestMutipleThreadRestEvent.cs create mode 100644 应用/BackupAndImport/Tools.cs create mode 100644 应用/BackupAndImport/UserId.cs create mode 100644 应用/BackupAndImport/Utils/SetConnectionConfig.cs create mode 100644 应用/BackupAndImport/速推客云端/Entitys/STKMemberInfo.cs create mode 100644 应用/BackupAndImport/速推客云端/EventLog.cs create mode 100644 应用/BackupAndImport/速推客云端/Stk.cs diff --git a/应用/BackupAndImport/AutoBakThread.cs b/应用/BackupAndImport/AutoBakThread.cs new file mode 100644 index 0000000..e7dae78 --- /dev/null +++ b/应用/BackupAndImport/AutoBakThread.cs @@ -0,0 +1,89 @@ +using Api.Framework; +using Api.Framework.SDK; +using Api.Framework.Tools; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace DataDocking +{ + internal class AutoBakThread : TimerTask + { + public override void Run(object state, bool timedOut) + { + try + { + #region 定时备份sqlite数据库的数据 + if (Class1.Config.Auto_Bak_OnOff) + { + if (ApiClient.GetSession().CurrentConnectionConfig.DbType == SqlSugar.DbType.MySql) return; + if (string.IsNullOrWhiteSpace(Class1.Config.Auto_Bak_Path)) + { + Class1.Config.Auto_Bak_Path = Util.MapPath($"File\\备份"); + Util.Save(Class1.Config); + } + if (!string.IsNullOrWhiteSpace(Class1.Config.Auto_Bak_Path) && Directory.Exists(Class1.Config.Auto_Bak_Path)) + { + try + { + var now = DateTime.Now; + if (Class1.Config.Lately_Bak_Time.Date <= now.Date) + { + if (DateTime.Now.AddSeconds(-3).ToString("HHmm") == Class1.Config.Auto_Bak_Time.ToString("HHmm")) + { + Class1.Config.Lately_Bak_Time = Class1.Config.Lately_Bak_Time.Date.AddDays(Class1.Config.Auto_Bak_Day); + Api.Framework.Tools.Util.Save(Class1.Config); + + #region 删除很久以前的备份 + DirectoryInfo root = new DirectoryInfo(Class1.Config.Auto_Bak_Path.Trim()); + List files = root.GetFiles().ToList().Where(f => f.Name.StartsWith("数据库")).OrderBy(f => f.CreationTime).ToList(); + if (files.Count >= 7) + { + int removeNum = files.Count - 7; + for (int i = 0; i < removeNum; i++) + { + try + { + File.Delete(files[i].FullName); + } + catch (Exception) + { } + } + } + #endregion + + var path = Path.Combine(new string[] { Class1.Config.Auto_Bak_Path.Trim(), "数据库" + DateTime.Now.ToString("yyyyMMddHHmmssfff") }); + File.Copy(Util.MapFile("数据库.db", "Config"), path); + if (File.Exists(path)) + { + if (Class1.Config.Is_Bak_Send_Email) + { + Zip.Process(new string[] { path }); + + var zipPath = path + ".zip"; + if (File.Exists(zipPath)) + ApiClient.SendAdminEmail(ApiClient.Setting.SystemConfig.account_admin_email, $"数据库备份{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}", "数据库备份", zipPath, true); + } + EventClient.OnEvent(this, "定时备份成功 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:dd")); + } + else + EventClient.OnEvent(this, "定时备份失败 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:dd")); + } + } + } + catch (Exception ex) + { + EventClient.OnEvent(this, "定时备份异常" + ex.Message + "-" + ex.StackTrace); + } + } + } + #endregion + } + catch (System.Exception ex) + { + EventClient.OnEvent(this, ex.Message + " - " + ex.StackTrace); + } + } + } +} \ No newline at end of file diff --git a/应用/BackupAndImport/BackupAndImport.csproj b/应用/BackupAndImport/BackupAndImport.csproj new file mode 100644 index 0000000..36d8ab2 --- /dev/null +++ b/应用/BackupAndImport/BackupAndImport.csproj @@ -0,0 +1,206 @@ + + + + + Debug + AnyCPU + {35A30202-1D63-413A-AD12-8FFB24165B43} + Library + Properties + BackupAndImport + BackupAndImport + v4.6.1 + 512 + + + true + full + false + ..\..\Debug\Plugin\ + DEBUG;TRACE + prompt + 4 + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\Debug\Api.Framework.dll + False + + + ..\..\Debug\Chat.Framework.dll + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + ..\..\Debug\Grant.Framework.dll + False + + + False + ..\..\Debug\HttpHelper.dll + False + + + False + ..\..\DLL\Newtonsoft.Json.dll + False + + + ..\..\DLL\NPOI.HSSF.dll + False + + + False + ..\..\Debug\SqlSugar.dll + False + + + + + + + + + + + + + + ..\..\Debug\UI.Framework.dll + False + + + + + + Form + + + CheckAdminForm.cs + + + + + + + + + + + + Form + + + EditRobotNameForm.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + + + True + True + Resources.resx + + + True + True + Settings.settings + + + + + + + + + + + + CheckAdminForm.cs + + + EditRobotNameForm.cs + + + MainForm.cs + Designer + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + \ No newline at end of file diff --git a/应用/BackupAndImport/CheckAdminForm.Designer.cs b/应用/BackupAndImport/CheckAdminForm.Designer.cs new file mode 100644 index 0000000..c7f5637 --- /dev/null +++ b/应用/BackupAndImport/CheckAdminForm.Designer.cs @@ -0,0 +1,117 @@ +namespace BackupAndImport +{ + partial class CheckAdminForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(71, 37); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(127, 14); + this.label1.TabIndex = 0; + this.label1.Text = "请输入软件登录密码:"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(204, 34); + this.textBox1.Name = "textBox1"; + this.textBox1.PasswordChar = '*'; + this.textBox1.Size = new System.Drawing.Size(259, 22); + this.textBox1.TabIndex = 1; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(156, 95); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(122, 30); + this.button1.TabIndex = 2; + this.button1.Text = "确 定"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(317, 95); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(122, 30); + this.button2.TabIndex = 2; + this.button2.Text = "取 消"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.ForeColor = System.Drawing.Color.Blue; + this.label2.Location = new System.Drawing.Point(186, 70); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(211, 14); + this.label2.TabIndex = 0; + this.label2.Text = "注:确保数据为管理导出,请验证身份"; + // + // CheckAdminForm + // + this.AcceptButton = this.button1; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.button2; + this.ClientSize = new System.Drawing.Size(539, 147); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "CheckAdminForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "用户身份验证"; + this.Load += new System.EventHandler(this.CheckAdminForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label2; + } +} \ No newline at end of file diff --git a/应用/BackupAndImport/CheckAdminForm.cs b/应用/BackupAndImport/CheckAdminForm.cs new file mode 100644 index 0000000..c0f8d92 --- /dev/null +++ b/应用/BackupAndImport/CheckAdminForm.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; +using DevExpress.XtraEditors; +using UI.Framework.Forms; +using Api.Framework.Tools; +using CsharpHttpHelper; +using Grant.Framework; + +namespace BackupAndImport +{ + public partial class CheckAdminForm : BaseForm + { + public CheckAdminForm() + { + InitializeComponent(); + } + + private void button2_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void button1_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrWhiteSpace(textBox1.Text.Trim())) + throw new Exception("请输入软件登录密码"); + + string pass = HttpExtend.DESEncrypt(textBox1.Text.Trim(), "12345678", "12378946"); + //var Config = new Api.Framework.Tools.IniHelper(HttpExtend.MapFile("系统配置.ini", "Config")); + //var passData = Config.GetValue("帐号信息", "密码"); + if (pass == GrantClient.LoginPassMd5) + this.DialogResult = DialogResult.OK; + else + throw new Exception("密码错误"); + } + catch (Exception ex) + { + ShowErrorAutoClose(ex); + } + } + + private void CheckAdminForm_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/应用/BackupAndImport/CheckAdminForm.resx b/应用/BackupAndImport/CheckAdminForm.resx new file mode 100644 index 0000000..9bcc643 --- /dev/null +++ b/应用/BackupAndImport/CheckAdminForm.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/应用/BackupAndImport/Class1.cs b/应用/BackupAndImport/Class1.cs new file mode 100644 index 0000000..2321c57 --- /dev/null +++ b/应用/BackupAndImport/Class1.cs @@ -0,0 +1,76 @@ +using Api.Framework; +using Api.Framework.SDK; +using BackupAndImport.Properties; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataDocking +{ + public class Class1 : Plugin + { + + public Class1() + { + this.Logo = Resources.备份与导入; + this.Name = Resources.PluginName; + this.Note = Resources.PluginNote; + } + + #region 自定义变量 + public static Config Config = null; + private MainForm mainForm = null; + #endregion + + public override void Start() + { + try + { + Config = this.ReadConfig(); + //创建线程 + TimerTask.NewTimer(60); //创建线程 - 自动备份的线程 60秒 + } + catch (Exception ex) + { + this.OnLog(ex.Message); + } + } + + public override void ShowForm() + { + try + { + if (mainForm == null || mainForm.IsDisposed) + { + mainForm = new MainForm(); + mainForm.Show(); + } + mainForm.TopMost = true; + mainForm.TopMost = false; + } + catch (Exception ex) + { + this.OnLog(ex.Message); + } + } + + public override void Stop() + { + try + { + if (mainForm != null) + { + mainForm.CloseForm(); + mainForm = null; + } + } + catch (Exception ex) + { + this.OnLog(ex.Message); + } + } + + } +} diff --git a/应用/BackupAndImport/Config.cs b/应用/BackupAndImport/Config.cs new file mode 100644 index 0000000..7fd42fa --- /dev/null +++ b/应用/BackupAndImport/Config.cs @@ -0,0 +1,67 @@ +using Api.Framework.SDK; +using Api.Framework.Tools; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataDocking +{ + [Config(Name = "插件-数据对接-配置")] + public class Config + { + public Config() + { + + #region 自动备份 + this.Auto_Bak_OnOff = true; + this.Auto_Bak_Path = Util.MapPath($"File\\备份"); + this.Auto_Bak_Time = DateTime.Parse("2019-5-15 23:59:59"); + this.Auto_Bak_Day = 1; + this.Lately_Bak_Time = DateTime.Parse("2019-5-15 00:00:00"); + this.Is_Bak_Send_Email = false; + #endregion + + } + + #region 自动备份 + /// + /// 自动备份开关 + /// + [Browsable(false)] + public bool Auto_Bak_OnOff { get; set; } + + /// + /// 自动备份路径 + /// + [Browsable(false)] + public string Auto_Bak_Path { get; set; } + + /// + /// 自动备份时间 + /// + [Browsable(false)] + public DateTime Auto_Bak_Time { get; set; } + + /// + /// 自动备份间隔 + /// + [Browsable(false)] + public int Auto_Bak_Day { get; set; } + + /// + /// 自动备份间隔 + /// + [Browsable(false)] + public bool Is_Bak_Send_Email { get; set; } + + /// + /// 最近自动备份日期(记录) + /// + public DateTime Lately_Bak_Time { get; set; } + + #endregion + } +} diff --git a/应用/BackupAndImport/ECO/Eco.cs b/应用/BackupAndImport/ECO/Eco.cs new file mode 100644 index 0000000..97ad22d --- /dev/null +++ b/应用/BackupAndImport/ECO/Eco.cs @@ -0,0 +1,1004 @@ +using Api.Framework; +using Api.Framework.Enums; +using Api.Framework.Model; +using Api.Framework.SDK; +using Api.Framework.Tools; +using BackupAndImport.ECO.Entitys; +using CsharpHttpHelper; +using CsharpHttpHelper.Enum; +using Eson.Utils.ExcelHelper; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using static BackupAndImport.ECO.EventLog; + +namespace BackupAndImport.ECO +{ + public class Eco + { + Random random = new Random(); + + public enum LoginType + { + 账户密码登录 = 0, + 手机号码登录 = 1 + } + + /// + /// 登录验证 + /// + /// 账号/手机号 + /// 密码/验证码 + /// 验证方式 + /// html响应json + public string ECOLogin(string param1, string param2, LoginType type) + { + try + { + switch (type) + { + case LoginType.账户密码登录: + { + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = $"http://console.ecostudio.cn/back/user/loginuser?t=true&withCredentials=true&username={param1}&password={param2}&w=null&f=null",//URL 必需项 + Method = "post", + Encoding = System.Text.Encoding.GetEncoding("utf-8"), + Timeout = 100000, + ReadWriteTimeout = 30000, + UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0", + ContentType = "application/x-www-form-urlencoded", + }; + HttpResult result = http.GetHtml(item); + return result.Html; + } + case LoginType.手机号码登录: + { + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = $"http://console.ecostudio.cn/back/user/phoneLogin?phone={param1}&smsCode={param2}&f=null&w=null", + Encoding = Encoding.GetEncoding("utf-8"), + Method = "post", + Referer = "http://www.ecostudio.cn/work/wechatlist", + UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)", + ContentType = "text/html" + }; + HttpResult result = http.GetHtml(item); + string html = result.Html; + string cookie = result.Cookie; + return html; + } + } + + } + catch (Exception ex) + { + throw ex; + } + return "登录失败"; + } + + + /// + /// 获取验证码 + /// + /// 手机号码 + /// + public bool ECOFindCerificationCode(string param1) + { + try + { + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = $"http://console.ecostudio.cn/back/user/sendsns?_allow_anonymous=true&phone={param1}", + Encoding = Encoding.GetEncoding("utf-8"), + Method = "post", + Referer = "http://www.ecostudio.cn/work/wechatlist", + UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)", + ContentType = "text/html" + }; + HttpResult result = http.GetHtml(item); + string html = result.Html; + if (html.Contains("验证码发送成功")) + return true; + } + catch (Exception ex) + { + throw ex; + } + return false; + } + + /// + /// 获取机器人列表 + /// + /// 第几页的数据 + /// loginValicateName + /// loginValicateSingle + public void ECOFindRobotList(string loginValicateName, string loginValicateSingle, string token, List robotids, int page = 1) + { + try + { + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = $"http://console.ecostudio.cn/back/device/list?keyword=&page={page}&status=&w={loginValicateName}&f={loginValicateSingle}", + Encoding = Encoding.GetEncoding("utf-8"), + Method = "get", + Referer = "http://www.ecostudio.cn/work/device", + UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)", + ContentType = "text/html" + }; + item.Header["Authorization"] = token; + var html = string.Empty; + for (int i = 0; i < 5; i++) + { + HttpResult result = http.GetHtml(item); + html = result.Html; + if (!CheckHttpCallsFrequently(html)) break; + } + var dic = HttpExtend.JsonToDictionary(html); + if (dic == null) throw new Exception("数据异常,转换失败"); + if (dic.ContainsKey("status")) + { + if (dic["status"].ToString() == "200") + { + if (dic.ContainsKey("data")) + { + var data = dic["data"] as Dictionary; + + if (data.ContainsKey("list")) + { + var list = data["list"] as ArrayList; + foreach (Dictionary obj in list) + { + if (!obj.ContainsKey("device")) throw new Exception("数据异常,不包含device"); + var device = obj["device"] as Dictionary; + if (!device.ContainsKey("wxId")) throw new Exception("数据异常,不包含wxId"); + robotids.Add(device["wxId"].ToString()); + } + } + if (data.ContainsKey("currentPage") || data.ContainsKey("totalPage")) + { + var currentPage = int.Parse(data["currentPage"].ToString()); + var totalPage = int.Parse(data["totalPage"].ToString()); + if (totalPage > currentPage) + { + Thread.Sleep(500); + currentPage++; + ECOFindRobotList(loginValicateName, loginValicateSingle, token, robotids, currentPage); + } + } + } + } + else + { + OnEvent(this, $"获取机器人列表失败:" + html); + } + } + } + catch (Exception ex) + { + OnEvent(this, $"获取机器人列表异常:{ex.Message} - {ex.StackTrace} - {page}"); + throw new Exception($"{ex.Message} - {ex.StackTrace} - {page}"); + } + } + + #region 通过机器人id下载用户excel + /// + /// 通过机器人id下载用户excel + /// + /// + public void ECODownloadMemberExcel(List robotids, string token, string savepath = "") + { + try + { + OnEvent(this, $"删除文件开始..."); + Tools.DeleteDir(Util.MapPath(savepath)); + OnEvent(this, $"删除文件完毕!"); + + //Parallel.ForEach(robotids, f => + //{ + // DownloadMemberExcel(f, token, savepath); + // Thread.Sleep(200 + random.Next(300)); + //}); + + var t1 = Task.Run(() => + { + foreach (var f in robotids) + { + OnEvent(this, $"正在下载:{f}账号的用户数据"); + DownloadMemberExcel(f, token, savepath); + OnEvent(this, $"{f}账号的用户数据下载完成"); + //Thread.Sleep(4000 + random.Next(300, 2000)); + } + }); + Task.WaitAll(t1); + } + catch (Exception ex) + { + OnEvent(this, $"获取用户数据失败-1:{ex.Message} - {ex.StackTrace}"); + throw ex; + } + } + + /// + /// 下载excel + /// + /// + /// + private void DownloadMemberExcel(string robotid, string token, string savepath = "") + { + try + { + for (int i = 0; i < 5; i++) + { + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = $"http://console.ecostudio.cn/back/agent/downAgentInfo?wxId={robotid}", + Encoding = Encoding.GetEncoding("utf-8"), + Method = "get", + Referer = "http://www.ecostudio.cn/work/wechatlist", + UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)", + ContentType = "application/vnd.ms-excel", + PostDataType = PostDataType.Byte + }; + item.ResultType = ResultType.Byte; + item.Header["Authorization"] = token; + HttpResult result = http.GetHtml(item); + var file = result.ResultByte; + if (file.Length != 80) + { + WriteByteToFile(file, Util.MapFile(robotid + ".xlsx", savepath)); + break; + } + Thread.Sleep(3000); + } + } + catch (Exception ex) + { + OnEvent(this, $"获取用户数据失败-2:{ex.Message} - {ex.StackTrace}"); + throw ex; + } + } + + + /// + /// 写byte[]到fileName + /// + /// byte[] + /// 保存至硬盘路径 + /// + public static bool WriteByteToFile(byte[] pReadByte, string fileName) + { + FileStream pFileStream = null; + try + { + pFileStream = new FileStream(fileName, FileMode.OpenOrCreate); + pFileStream.Write(pReadByte, 0, pReadByte.Length); + } + catch + { + return false; + } + finally + { + if (pFileStream != null) + pFileStream.Close(); + } + return true; + } + #endregion + + + #region 通过机器人id爬取用户数据 + + public List ECOFindMembers(string token, List _robotids) + { + List members = new List(); + try + { + List robotids = _robotids; + var t1 = Task.Run(() => + { + foreach (var f in robotids) + { + OnEvent(this, $"正在下载:{f}账号的用户数据"); + ECOFindMemberList(token, f, members); + OnEvent(this, $"{f}账号的用户数据下载完成"); + //Thread.Sleep(4000 + random.Next(300, 2000)); + } + }); + Task.WaitAll(t1); + } + catch (Exception ex) + { + OnEvent(this, $"获取用户数据失败-1:{ex.Message} - {ex.StackTrace}"); + throw ex; + } + return members; + } + + /// + /// 获取用户列表 + /// + /// 第几页的数据 + /// loginValicateName + /// loginValicateSingle + public void ECOFindMemberList(string token, string robotid, List memberInfos, int page = 1) + { + try + { + if (!string.IsNullOrWhiteSpace(robotid)) + OnEvent(this, $"正在获取{robotid}机器人第{page}页数据..."); + else + OnEvent(this, $"正在采集用户列表第{page}页数据..."); + + HttpHelper http = new HttpHelper(); + + var PostData = "{'currentPage':" + page + ",'wechatSearchTimeBegin':null,'wechatSearchTimeEnd':null,'orderTimeBegin':null,'orderTimeEnd':null,'createTimeBegin':null,'createTimeEnd':null,'cashTimeBegin':null,'cashTimeEnd':null,'sort':'2'}"; + if (!string.IsNullOrWhiteSpace(robotid)) + PostData = "{'currentPage':" + page + ",'wechatSearchTimeBegin':null,'wechatSearchTimeEnd':null,'orderTimeBegin':null,'orderTimeEnd':null,'createTimeBegin':null,'createTimeEnd':null,'cashTimeBegin':null,'cashTimeEnd':null,'type':'2','keyValue':'" + robotid + "','sort':'2'}"; + + HttpItem item = new HttpItem() + { + URL = $"http://console.ecostudio.cn/back/agent/eslist?w=undefined&f=undefined&page={page}", + Encoding = Encoding.GetEncoding("utf-8"), + Method = "POST", + Referer = "http://www.ecostudio.cn/work/wechatlist", + UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)", + ContentType = "text/html", + Postdata = PostData + }; + item.Header["Authorization"] = token; + var html = string.Empty; + for (int i = 0; i < 5; i++) + { + HttpResult result = http.GetHtml(item); + html = result.Html; + if (!CheckHttpCallsFrequently(html)) break; + } + var dic = HttpExtend.JsonToDictionary(html); + if (dic == null) throw new Exception("数据异常,转换失败"); + if (dic.ContainsKey("status")) + { + if (dic["status"].ToString() == "200") + { + if (!string.IsNullOrWhiteSpace(robotid)) + OnEvent(this, $"获取{robotid}机器人第{page}页数据成功,正在收集用户数据"); + else + OnEvent(this, $"获取用户列表第{page}页数据成功,正在收集用户数据"); + + if (dic.ContainsKey("data")) + { + var data = dic["data"] as Dictionary; + + if (data.ContainsKey("list")) + { + var list = data["list"] as ArrayList; + foreach (Dictionary obj in list) + { + //余额 + decimal balance = 0m; + if (obj.ContainsKey("balance")) + balance = decimal.Parse(obj["balance"].ToString()); + //设备id(机器人id) + var deviceWxid = robotid; + if (obj.ContainsKey("deviceWxid")) + deviceWxid = obj["deviceWxid"].ToString(); + //微信id + if (!obj.ContainsKey("wxId")) throw new Exception("数据异常,不包含wxId"); + var wxId = obj["wxId"].ToString(); + //昵称 + var wxName = string.Empty; + if (obj.ContainsKey("wxName")) + wxName = obj["wxName"].ToString(); + //上级微信id + var parentWxid = string.Empty; + if (obj.ContainsKey("parentWxid")) + parentWxid = obj["parentWxid"].ToString(); + + var memberInfo = memberInfos.FirstOrDefault(f => f.username == wxId); + if (memberInfo == null) + memberInfos.Add(new ECOMemberInfo() { usernick = wxName, username = wxId, device_id = deviceWxid, cur_point = (double)balance, invite_username = parentWxid }); + else if (!string.IsNullOrWhiteSpace(robotid)) + memberInfo.cur_point = (double)((decimal)memberInfo.cur_point + balance); + } + } + if (data.ContainsKey("currentPage") || data.ContainsKey("totalPage")) + { + var currentPage = int.Parse(data["currentPage"].ToString()); + var totalPage = int.Parse(data["totalPage"].ToString()); + if (totalPage > currentPage) + { + Thread.Sleep(700); + currentPage++; + ECOFindMemberList(token, robotid, memberInfos, currentPage); + } + } + } + } + else + { + OnEvent(this, $"获取机器人列表失败:" + html); + } + } + } + catch (Exception ex) + { + OnEvent(this, $"获取用户列表异常:{ex.Message} - {ex.StackTrace} - {page} - {robotid}"); + throw new Exception($"{ex.Message} - {ex.StackTrace} - {page} - {robotid}"); + } + } + + + #endregion + + + /// + /// 读取excel中的用户信息 + /// + /// + /// + public List ECOReadExcel(string savePath) + { + var memberInfos = new List(); + try + { + var directory = Util.MapPath(savePath); + if (Directory.Exists(directory)) + { + var files = Directory.GetFiles(directory); + + var excelTool = new ExcelStreamExport(); + + foreach (var file in files) + { + var dataTable = excelTool.ConvertExcelToTable(file, 0); + foreach (DataRow item in dataTable.Rows) + { + var memberInfo = memberInfos.FirstOrDefault(f => f.username == item[1].ToString()); + if (memberInfo == null) + memberInfos.Add(new ECOMemberInfo() { usernick = item[0].ToString(), username = item[1].ToString(), device_id = item[2].ToString(), cur_point = double.Parse(item[3].ToString()), invite_username = item[4].ToString() }); + else + memberInfo.cur_point = (double)((decimal)memberInfo.cur_point + decimal.Parse(item[3].ToString())); + } + } + } + } + catch (Exception ex) + { + OnEvent(this, $"第二个阶段异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + return memberInfos; + } + + /// + /// 插入用户数据到秒单客数据库(包括绑定上下级) + /// + /// + public void ECOInsertMember(List ecoMemberInfos) + { + var session = ApiClient.GetSession(); + session.BeginTransaction(); + try + { + var srcMemberInfo = session.Find("select * from fl_member_info"); + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + foreach (var member in ecoMemberInfos) + { + //TODO 这里就不判断企业微信了 + var user = srcMemberInfo.FirstOrDefault(f => f.username == member.username && f.robot_type == ChatType.微信); + if (user == null) + { + user = new fl_member_info() + { + username = member.username, + robot_type = ChatType.微信, + usernick = member.usernick.Replace("'", "''"), + cur_point = member.cur_point, + sum_point = 0, + ext_point = 0, + finish_order = 0, + robot_name = member.device_id, + alipay_name = string.Empty, + alipay_num = string.Empty, + remark = string.Empty + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + user.group_id = groups[0].id; + unMemberInfos.Add(user); + } + else + { + user.cur_point = (double)((decimal)user.cur_point + ((decimal)member.cur_point)); + //user.finish_order = user.finish_order + (long)item.总成功订单; + + if (string.IsNullOrWhiteSpace(user.robot_name)) + { + user.robot_name = member.device_id; + user.robot_type = ChatType.微信; + } + memberInfos.Add(user); + } + } + OnEvent(this, $"执行用户导入操作..."); + + var _num1 = (int)Math.Ceiling((decimal)unMemberInfos.Count / 1000m); + for (int o = 1; o <= _num1; o++) + { + var _list = unMemberInfos.Skip((o - 1) * 1000).Take(1000).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + } + + var _num2 = (int)Math.Ceiling((decimal)memberInfos.Count / 1000m); + for (int o = 1; o <= _num2; o++) + { + var _list = memberInfos.Skip((o - 1) * 1000).Take(1000).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + } + + OnEvent(this, $"导入数据完成,正在绑定上下级..."); + //将有上级的用户筛选出来 + ecoMemberInfos = ecoMemberInfos.Where(f => !string.IsNullOrEmpty(f.invite_username)).ToList(); + //绑定上下级 + if (ecoMemberInfos != null && ecoMemberInfos.Count != 0) + { + var newDbs = session.Queryable().ToList(); + + foreach (var item in ecoMemberInfos) + { + var new_user = newDbs.FirstOrDefault(f => f.username == item.username); + if (new_user != null && new_user.inviter_id == 0) + { + var inviter = newDbs.FirstOrDefault(f => f.username == item.invite_username);//找出上级账号 + if (inviter != null) + { + new_user.inviter_id = inviter.id;//填写上级ID + session.Updateable(new { inviter_id = inviter.id }).Where(f => f.id == new_user.id).ExecuteCommand(); + } + else + { + + } + } + } + } + OnEvent(this, $"用户上下级关系绑定成功!"); + session.Commit(); + srcMemberInfo.Clear(); + } + catch (Exception ex) + { + OnEvent(this, $"导入用户数据异常,开始回滚数据..."); + session.Rollback(); + OnEvent(this, $"导入用户数据异常,回滚执行成功! 异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + } + + #region 订单操作 + + public enum OrderType + { + 淘宝 = 1, + 京东 = 2, + 拼多多 = 3 + } + + /// + /// ECO的订单状态 + /// + public enum OrderStateType + { + 所有 = 0, + 已结算 = 3, + 未结算 = 12, + 已失效 = 13 + } + + /// + /// 获取订单信息 + /// + public void ECOBindOrder(int page, OrderType order, OrderStateType orderState, List bindOrderList, string token, string keyWord = "") + { + try + { + OnEvent(this, string.IsNullOrWhiteSpace(keyWord) ? $"收集ECO订单 【{order.ToString()} - {orderState.ToString()}】 第{page}页开始..." : $"收集ECO订单 【{order.ToString()} - {orderState.ToString()}】 条件{keyWord} 开始..."); + Thread.Sleep(1200 + random.Next(400)); + var payStatus = string.Empty; + if (orderState != OrderStateType.所有) + payStatus = ((int)orderState).ToString(); + else + { + if (order == OrderType.拼多多 && !string.IsNullOrWhiteSpace(keyWord)) + { + if (keyWord.Contains("-")) + { + var strs = keyWord.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries); + if (strs != null && strs.Length == 2) + keyWord = strs[1]; + } + } + } + + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + + URL = $"http://console.ecostudio.cn/back/orderDetail/list?page={page}&keyWord={keyWord}&startTime=&endTime=&payStatus={payStatus}&platformId={(int)order}", + Encoding = Encoding.GetEncoding("utf-8"), + Method = "get", + Referer = "http://www.ecostudio.cn/work/order", + UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)", + ContentType = "text/html" + }; + item.Header["Authorization"] = token; + var html = string.Empty; + int num = 0; + Next: + for (int i = 0; i < 5; i++) + { + HttpResult result = http.GetHtml(item); + html = result.Html; + if (!CheckHttpCallsFrequently(html)) break; + } + var dic = HttpExtend.JsonToDictionary(html); + if (dic == null) throw new Exception("数据异常,转换失败"); + + if (dic.ContainsKey("status")) + { + if (dic["status"].ToString() == "200") + { + if (dic.ContainsKey("data")) + { + var data = dic["data"] as Dictionary; + + if (data.ContainsKey("list")) + { + var list = data["list"] as ArrayList; + foreach (Dictionary obj in list) + { + //if (!obj.ContainsKey("isBing")) continue;//订单没有绑定直接跳过 + var eco_id = obj["id"].ToString(); + //var ecoOrderInfo = new ECOOrderInfo() { eco_id = eco_id, isBing = obj["isBing"].ToString().ToLower() == "true" ? true : false, isComplete = obj["isComplete"].ToString().ToLower() == "true" ? true : false, orderId = obj["orderId"].ToString(), payStatus = (OrderStateType)int.Parse(obj["payStatus"].ToString()), platformId = (OrderType)int.Parse(obj["platformId"].ToString()) }; + var ecoOrderInfo = new ECOOrderInfo() { eco_id = eco_id, isBing = false, orderId = obj["orderId"].ToString(), payStatus = (OrderStateType)int.Parse(obj["payStatus"].ToString()), platformId = (OrderType)int.Parse(obj["platformId"].ToString()) }; + ECOQueryOrderBindInfo(eco_id, ecoOrderInfo, token); + if (ecoOrderInfo.isBing) + bindOrderList.Add(ecoOrderInfo); + } + } + if (data.ContainsKey("currentPage") || data.ContainsKey("totalPage")) + { + var currentPage = int.Parse(data["currentPage"].ToString()); + var totalPage = int.Parse(data["totalPage"].ToString()); + if (totalPage > currentPage) + { + //currentPage++; + ECOBindOrder(currentPage, order, orderState, bindOrderList, token, keyWord); + } + } + } + } + else + { + if (num < 5) + { + OnEvent(this, $"ECO订单请求异常:html => {html}"); + OnEvent(this, $"正在重新请求..."); + num++; + Thread.Sleep(2000); + goto Next; + } + else + { + throw new Exception("多次请求无果,已经终止..."); + } + } + } + OnEvent(this, string.IsNullOrWhiteSpace(keyWord) ? $"收集ECO订单第{page}页完毕!" : $"收集ECO订单条件 {keyWord} 完毕!"); + } + catch (Exception ex) + { + OnEvent(this, $"{order} - ECO订单请求异常:{ex.Message} ^ {ex.StackTrace} ^ {page}"); + //throw new Exception($"{ex.Message} ^ {ex.StackTrace} ^ {page}"); + } + } + + /// + /// 查询订单绑定的用户信息 + /// + /// eco的查询id + /// 订单对象 + /// + private void ECOQueryOrderBindInfo(string eco_id, ECOOrderInfo orderInfo, string token) + { + try + { + Thread.Sleep(1200 + random.Next(300)); + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = $"http://console.ecostudio.cn/back/orderDetail/detail?esId={eco_id}", + Encoding = Encoding.GetEncoding("utf-8"), + Method = "get", + Referer = "http://www.ecostudio.cn/work/order", + UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)", + ContentType = "text/html" + }; + item.Header["Authorization"] = token; + var html = string.Empty; + int num = 0; + Next: + for (int i = 0; i < 5; i++) + { + HttpResult result = http.GetHtml(item); + html = result.Html; + if (!CheckHttpCallsFrequently(html)) break; + } + var dic = HttpExtend.JsonToDictionary(html); + if (dic == null) throw new Exception("数据异常,转换失败"); + if (dic.ContainsKey("status")) + { + if (dic["status"].ToString() == "200") + { + if (dic.ContainsKey("data")) + { + var data = dic["data"] as Dictionary; + if (data != null && data.ContainsKey("esPaymentDetail")) + { + var esPaymentDetail = data["esPaymentDetail"] as Dictionary; + if (esPaymentDetail != null) + { + //orderInfo.isBing = obj["isBing"].ToString().ToLower() == "true" ? true : false + orderInfo.isBing = true; + //orderInfo.isComplete =, + if (esPaymentDetail.ContainsKey("deviceWxId")) + orderInfo.deviceWxId = esPaymentDetail["deviceWxId"].ToString(); + else if (esPaymentDetail.ContainsKey("fromdevice")) + orderInfo.deviceWxId = esPaymentDetail["fromdevice"].ToString(); + if (esPaymentDetail.ContainsKey("wxId")) + orderInfo.fromWxId = esPaymentDetail["wxId"].ToString(); + else if (esPaymentDetail.ContainsKey("fromWxId")) + orderInfo.fromWxId = esPaymentDetail["fromWxId"].ToString(); + if (esPaymentDetail.ContainsKey("itemId")) + orderInfo.itemId = esPaymentDetail["itemId"].ToString(); + } + } + } + } + else + { + if (num < 5) + { + OnEvent(this, $"ECO订单请求异常:html => {html}"); + OnEvent(this, $"正在重新请求..."); + num++; + Thread.Sleep(2000); + goto Next; + } + else + { + throw new Exception("多次请求无果,已经终止..."); + } + } + } + } + catch (Exception ex) + { + throw new Exception($"{ex.Message} * {ex.StackTrace}"); + } + } + #endregion + + /// + /// 检测是否调用频繁 + /// 调用频繁直接休眠2秒钟 + /// + /// + /// 调用频繁返回true + public bool CheckHttpCallsFrequently(string html) + { + try + { + //{ + // "msg":"调用频繁", + // "status":400, + // "success":false + //} + if (string.IsNullOrWhiteSpace(html)) throw new Exception("请重新登录!"); + var dic = HttpExtend.JsonToDictionary(html); + if (dic == null) OnEvent(this, $"转换为空:html = {html}"); + if (dic != null && dic.ContainsKey("status") && dic.ContainsKey("msg")) + { + if (dic["status"].ToString() == "400" && dic["msg"].ToString() == "调用频繁") + { + OnEvent(this, $"调用频繁休眠2-3秒..."); + Thread.Sleep(2000 + random.Next(1000)); + return true; + } + } + else + { + if (html.Contains("请求被中止: 操作超时")) + { + OnEvent(this, $"调用频繁休眠2-3秒..."); + Thread.Sleep(2000 + random.Next(1000)); + return true; + } + } + //else if (dic.ContainsKey("status") && dic["status"].ToString() == "200") + //{ + // var data = dic["data"] as Dictionary; + // if (data.ContainsKey("list")) + // { + // var list = data["list"] as ArrayList; + // foreach (Dictionary obj in list) + // { + // if (!obj.ContainsKey("isBing")) + // { + // Thread.Sleep(2000 + random.Next(1000)); + // return true;//没有获取到绑定信息多获取一次 + // } + // else + // { } + // } + // } + //} + } + catch (Exception ex) + { + throw ex; + } + return false; + } + + internal void ECOOrderBind(CpsType cps, List bindOrderList) + { + var session = ApiClient.GetSession(); + session.BeginTransaction(); + try + { + switch (cps) + { + case CpsType.阿里妈妈: + { + OnEvent(this, $"阿里妈妈订单数量({bindOrderList.Count})绑定开始执行..."); + var aliOrders = session.Find("select * from fl_order_alimama where db_userid = 0").ToList(); + var memberinfos = session.Find("select * from fl_member_info").ToList(); + if (aliOrders != null && bindOrderList != null) + { + OnEvent(this, $"ECO阿里妈妈订单量:{bindOrderList.Count},需要绑定的订单量:{aliOrders.Count}"); + foreach (var item in bindOrderList) + { + if (string.IsNullOrWhiteSpace(item.fromWxId)) continue; + var orders = aliOrders.Where(f => f.trade_parent_id == item.orderId && f.num_iid == item.itemId).ToList(); + if (orders.Count != 0) + { + foreach (var order in orders) + { + var member = memberinfos.FirstOrDefault(f => f.username == item.fromWxId); + if (member != null) + order.db_userid = member.id; + if (item.payStatus == OrderStateType.已结算) + { + order.db_status = SystemOrderStatus.订单结算; + order.db_endtime = DateTime.Now.AddHours(-2); + order.tk_status = 3; + } + if (string.IsNullOrWhiteSpace(order.db_robotname)) + { + order.db_robottype = ChatType.微信; + order.db_robotname = item.deviceWxId; + } + session.SaveOrUpdate(order); + } + } + } + aliOrders.Clear(); + memberinfos.Clear(); + } + OnEvent(this, $"阿里妈妈订单绑定执行完成!"); + } + break; + case CpsType.多多进宝: + { + OnEvent(this, $"多多进宝订单绑定开始执行..."); + var pddOrders = session.Find("select * from fl_order_pinduoduo where db_userid = 0").ToList(); + var memberinfos = session.Find("select * from fl_member_info").ToList(); + if (pddOrders != null && bindOrderList != null) + { + OnEvent(this, $"ECO多多进宝订单量:{bindOrderList.Count},需要绑定的订单量:{pddOrders.Count}"); + foreach (var item in bindOrderList) + { + var order = pddOrders.FirstOrDefault(f => f.order_sn == item.orderId && f.goods_id == item.itemId); + if (order != null) + { + var member = memberinfos.FirstOrDefault(f => f.username == item.fromWxId); + if (member != null) + order.db_userid = member.id; + if (item.payStatus == OrderStateType.已结算) + { + order.db_status = SystemOrderStatus.订单结算; + order.db_endtime = DateTime.Now.AddHours(-2); + order.order_status = 2; + } + if (string.IsNullOrWhiteSpace(order.db_robotname)) + { + order.db_robottype = ChatType.微信; + order.db_robotname = item.deviceWxId; + } + session.SaveOrUpdate(order); + } + } + pddOrders.Clear(); + memberinfos.Clear(); + } + OnEvent(this, $"多多进宝订单绑定执行完成!"); + } + break; + case CpsType.京东联盟: + { + OnEvent(this, $"京东联盟订单绑定开始执行..."); + var jdOrders = session.Find("select * from fl_order_jingdong where db_userid = 0").ToList(); + var memberinfos = session.Find("select * from fl_member_info").ToList(); + if (jdOrders != null && bindOrderList != null) + { + OnEvent(this, $"ECO京东联盟订单量:{bindOrderList.Count},需要绑定的订单量:{jdOrders.Count}"); + foreach (var item in bindOrderList) + { + var order = jdOrders.FirstOrDefault(f => f.orderId.ToString() == item.orderId && f.skuId.ToString() == item.itemId); + if (order != null) + { + var member = memberinfos.FirstOrDefault(f => f.username == item.fromWxId); + if (member != null) + order.db_userid = member.id; + if (item.payStatus == OrderStateType.已结算) + { + order.db_status = SystemOrderStatus.订单结算; + order.db_endtime = DateTime.Now.AddHours(-2); + order.validCode = 17; + } + if (string.IsNullOrWhiteSpace(order.db_robotname)) + { + order.db_robottype = ChatType.微信; + order.db_robotname = item.deviceWxId; + } + session.SaveOrUpdate(order); + } + } + jdOrders.Clear(); + memberinfos.Clear(); + } + OnEvent(this, $"京东联盟订单绑定执行完成!"); + } + break; + } + session.Commit(); + } + catch (Exception ex) + { + OnEvent(this, $"订单绑定异常,开始回滚数据..."); + session.Rollback(); + OnEvent(this, $"订单绑定异常,回滚执行成功! 异常:{ex.Message} / {ex.StackTrace}"); + throw new Exception($"{ex.Message} / {ex.StackTrace}"); + } + + } + } +} diff --git a/应用/BackupAndImport/ECO/Entitys/ECOMemberInfo.cs b/应用/BackupAndImport/ECO/Entitys/ECOMemberInfo.cs new file mode 100644 index 0000000..3dff4df --- /dev/null +++ b/应用/BackupAndImport/ECO/Entitys/ECOMemberInfo.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.ECO.Entitys +{ + public class ECOMemberInfo + { + /// + /// 设备ID + /// + public string device_id { get; set; } + /// + /// 用户昵称 + /// + public string usernick { get; set; } + /// + /// 用户id + /// + public string username { get; set; } + /// + /// 可提现金额 + /// + public double cur_point { get; set; } + /// + /// 上级用户id + /// + public string invite_username { get; set; } + + } +} diff --git a/应用/BackupAndImport/ECO/Entitys/ECOOrderInfo.cs b/应用/BackupAndImport/ECO/Entitys/ECOOrderInfo.cs new file mode 100644 index 0000000..aaf519e --- /dev/null +++ b/应用/BackupAndImport/ECO/Entitys/ECOOrderInfo.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static BackupAndImport.ECO.Eco; + +namespace BackupAndImport.ECO.Entitys +{ + public class ECOOrderInfo + { + /// + /// 查询用户信息的id + /// + public string eco_id { get; set; } + /// + /// 订单是否绑定 + /// + public bool isBing { get; set; } + /// + /// 订单是否完成 + /// + public bool isComplete { get; set; } + /// + /// 商品id + /// + public string itemId { get; set; } + /// + /// 订单编号 + /// + public string orderId { get; set; } + /// + /// 设备id + /// + public string deviceWxId { get; set; } + /// + /// 绑定用户的微信id + /// + public string fromWxId { get; set; } + /// + /// 订单状态 + /// + public OrderStateType payStatus { get; set; } + /// + /// 平台类型 + /// + public OrderType platformId { get; set; } + + } +} diff --git a/应用/BackupAndImport/ECO/Entitys/EcoLoginInfo.cs b/应用/BackupAndImport/ECO/Entitys/EcoLoginInfo.cs new file mode 100644 index 0000000..d7f7667 --- /dev/null +++ b/应用/BackupAndImport/ECO/Entitys/EcoLoginInfo.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.ECO.Entitys +{ + public class EcoLoginInfo + { + public string username { get; set; } + + public string loginValicateSingle { get; set; } + + public string loginValicateName { get; set; } + + public string token { get; set; } + + } +} diff --git a/应用/BackupAndImport/ECO/EventLog.cs b/应用/BackupAndImport/ECO/EventLog.cs new file mode 100644 index 0000000..2019f97 --- /dev/null +++ b/应用/BackupAndImport/ECO/EventLog.cs @@ -0,0 +1,32 @@ +using BackupAndImport.ECO.Events; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.ECO +{ + public class EventLog + { + /// + /// 日志事件 + /// + public static event EventHandler LogEvent; + + public static void OnEvent(object sender, string log) + { + OnEvent(sender, new LogEvent(log)); + } + /// + /// 输出日志 + /// + internal static void OnEvent(object sender, LogEvent e) + { + if (LogEvent != null) + { + LogEvent.Invoke(sender, e); + } + } + } +} diff --git a/应用/BackupAndImport/ECO/Events/LogEvent.cs b/应用/BackupAndImport/ECO/Events/LogEvent.cs new file mode 100644 index 0000000..a1dc520 --- /dev/null +++ b/应用/BackupAndImport/ECO/Events/LogEvent.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.ECO.Events +{ + public class LogEvent : EventArgs + { + public Exception Exception { get; internal set; } + public string Message { get; set; } + public DateTime CrtTime { get; private set; } + public LogEvent(string message) + { + this.Message = message; + this.CrtTime = DateTime.Now; + } + } +} diff --git a/应用/BackupAndImport/ECO/Tools.cs b/应用/BackupAndImport/ECO/Tools.cs new file mode 100644 index 0000000..dd3e9ba --- /dev/null +++ b/应用/BackupAndImport/ECO/Tools.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.ECO +{ + class Tools + { + #region 直接删除指定目录下的所有文件及文件夹(保留目录) + + /// + ///直接删除指定目录下的所有文件及文件夹(保留目录) + /// + /// 文件夹路径 + /// 执行结果 + + public static void DeleteDir(string file) + { + + try + { + //去除文件夹和子文件的只读属性 + //去除文件夹的只读属性 + System.IO.DirectoryInfo fileInfo = new DirectoryInfo(file); + fileInfo.Attributes = FileAttributes.Normal & FileAttributes.Directory; + + //去除文件的只读属性 + System.IO.File.SetAttributes(file, System.IO.FileAttributes.Normal); + + //判断文件夹是否还存在 + if (Directory.Exists(file)) + { + foreach (string f in Directory.GetFileSystemEntries(file)) + { + + if (File.Exists(f)) + { + //如果有子文件删除文件 + File.Delete(f); + //Console.WriteLine(f); + } + else + { + //循环递归删除子文件夹 + DeleteDir(f); + } + } + //删除空文件夹 + Directory.Delete(file); + } + } + catch (Exception ex) // 异常处理 + { + Console.WriteLine(ex.Message.ToString());// 异常信息 + } + } + #endregion + } +} diff --git a/应用/BackupAndImport/EditRobotNameForm.Designer.cs b/应用/BackupAndImport/EditRobotNameForm.Designer.cs new file mode 100644 index 0000000..301e306 --- /dev/null +++ b/应用/BackupAndImport/EditRobotNameForm.Designer.cs @@ -0,0 +1,177 @@ +namespace BackupAndImport +{ + partial class EditRobotNameForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.gridControl1 = new DevExpress.XtraGrid.GridControl(); + this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.labelControl10 = new DevExpress.XtraEditors.LabelControl(); + this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton(); + this.label3 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit(); + this.SuspendLayout(); + // + // gridControl1 + // + this.gridControl1.Location = new System.Drawing.Point(1, 37); + this.gridControl1.MainView = this.gridView1; + this.gridControl1.Name = "gridControl1"; + this.gridControl1.Size = new System.Drawing.Size(588, 306); + this.gridControl1.TabIndex = 7; + this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { + this.gridView1}); + // + // gridView1 + // + this.gridView1.Appearance.HeaderPanel.Options.UseTextOptions = true; + this.gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { + this.gridColumn1, + this.gridColumn3, + this.gridColumn9}); + this.gridView1.GridControl = this.gridControl1; + this.gridView1.Name = "gridView1"; + this.gridView1.OptionsPrint.PrintVertLines = false; + this.gridView1.OptionsView.ShowGroupPanel = false; + this.gridView1.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.gridView1_CellValueChanged); + // + // gridColumn1 + // + this.gridColumn1.AppearanceCell.Options.UseTextOptions = true; + this.gridColumn1.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + this.gridColumn1.AppearanceHeader.Options.UseTextOptions = true; + this.gridColumn1.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + this.gridColumn1.Caption = "当前机器人昵称"; + this.gridColumn1.FieldName = "nick"; + this.gridColumn1.Name = "gridColumn1"; + this.gridColumn1.OptionsColumn.AllowEdit = false; + this.gridColumn1.OptionsColumn.AllowFocus = false; + this.gridColumn1.Visible = true; + this.gridColumn1.VisibleIndex = 0; + this.gridColumn1.Width = 151; + // + // gridColumn3 + // + this.gridColumn3.AppearanceCell.Options.UseTextOptions = true; + this.gridColumn3.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + this.gridColumn3.Caption = "当前机器人账号"; + this.gridColumn3.FieldName = "name"; + this.gridColumn3.Name = "gridColumn3"; + this.gridColumn3.OptionsColumn.AllowEdit = false; + this.gridColumn3.OptionsColumn.AllowFocus = false; + this.gridColumn3.Visible = true; + this.gridColumn3.VisibleIndex = 1; + this.gridColumn3.Width = 125; + // + // gridColumn9 + // + this.gridColumn9.AppearanceCell.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.gridColumn9.AppearanceCell.BackColor2 = System.Drawing.Color.LightGray; + this.gridColumn9.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Underline); + this.gridColumn9.AppearanceCell.ForeColor = System.Drawing.Color.Blue; + this.gridColumn9.AppearanceCell.Options.UseBackColor = true; + this.gridColumn9.AppearanceCell.Options.UseFont = true; + this.gridColumn9.AppearanceCell.Options.UseForeColor = true; + this.gridColumn9.AppearanceCell.Options.UseTextOptions = true; + this.gridColumn9.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + this.gridColumn9.Caption = "新机器人账号"; + this.gridColumn9.FieldName = "newName"; + this.gridColumn9.Name = "gridColumn9"; + this.gridColumn9.Visible = true; + this.gridColumn9.VisibleIndex = 2; + this.gridColumn9.Width = 113; + // + // labelControl10 + // + this.labelControl10.Appearance.ForeColor = System.Drawing.Color.Gray; + this.labelControl10.Appearance.Options.UseForeColor = true; + this.labelControl10.Location = new System.Drawing.Point(357, 3); + this.labelControl10.Name = "labelControl10"; + this.labelControl10.Size = new System.Drawing.Size(232, 28); + this.labelControl10.TabIndex = 12; + this.labelControl10.Text = "修改机器人账号请点击单元格,即可直接修改\r\n(不修改的不操作即可)"; + // + // simpleButton1 + // + this.simpleButton1.Location = new System.Drawing.Point(403, 353); + this.simpleButton1.Name = "simpleButton1"; + this.simpleButton1.Size = new System.Drawing.Size(175, 34); + this.simpleButton1.TabIndex = 13; + this.simpleButton1.Text = "点击确认"; + this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click); + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label3.AutoSize = true; + this.label3.BackColor = System.Drawing.Color.White; + this.label3.Font = new System.Drawing.Font("黑体", 18F); + this.label3.Location = new System.Drawing.Point(80, 131); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(430, 24); + this.label3.TabIndex = 20; + this.label3.Text = "当前不存在机器人数据,请先登录机器人"; + // + // EditRobotNameForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(590, 395); + this.Controls.Add(this.label3); + this.Controls.Add(this.simpleButton1); + this.Controls.Add(this.labelControl10); + this.Controls.Add(this.gridControl1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "EditRobotNameForm"; + this.Text = "设置要修改的机器账号"; + this.Load += new System.EventHandler(this.EditRobotNameForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn3; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn9; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn1; + private DevExpress.XtraEditors.LabelControl labelControl10; + private DevExpress.XtraEditors.SimpleButton simpleButton1; + private System.Windows.Forms.Label label3; + } +} \ No newline at end of file diff --git a/应用/BackupAndImport/EditRobotNameForm.cs b/应用/BackupAndImport/EditRobotNameForm.cs new file mode 100644 index 0000000..77faf31 --- /dev/null +++ b/应用/BackupAndImport/EditRobotNameForm.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; +using DevExpress.XtraEditors; +using UI.Framework.Forms; +using Api.Framework; +using Api.Framework.Tools; +using Api.Framework.Model; +using BackupAndImport.Entitys; + +namespace BackupAndImport +{ + public partial class EditRobotNameForm : BaseForm + { + + public Dictionary RobotNameDic = null; + + public EditRobotNameForm() + { + InitializeComponent(); + RobotNameDic = new Dictionary(); + } + + private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) + { + List robots = null; + try + { + robots = gridControl1.DataSource as List; + if (e.Column.Caption == "新机器人账号" && e.Value != null) + { + var selectRow = gridView1.GetSelectedRows()[0]; + var name = this.gridView1.GetRowCellValue(selectRow, "name").ToString();//获取name列的数据 + + var newName = e.Value.ToString().Trim(); + if (!string.IsNullOrWhiteSpace(newName)) + { + //var session = ApiClient.GetSession(); + var robot = robots.FirstOrDefault(f => f.name == newName); + if (robot == null) + robot = robots.Where(f => f.name != name).FirstOrDefault(f => f.newName == newName); + if (robot != null) + { + robot = robots.FirstOrDefault(f => f.name == name); + if (robot != null) robot.newName = string.Empty; + throw new Exception("设置的账号已被使用"); + } + + var isExit = RobotNameDic.Values.FirstOrDefault(f => f == newName); + if (!string.IsNullOrWhiteSpace(isExit)) throw new Exception("设置的账号已被使用"); + + if (RobotNameDic.ContainsKey(name)) + RobotNameDic[name] = newName; + else + RobotNameDic.Add(name, newName); + } + else + { + if (RobotNameDic.ContainsKey(name)) + RobotNameDic.Remove(name); + } + } + } + catch (Exception ex) + { + ShowError(ex); + } + gridControl1.DataSource = robots; + } + + private void EditRobotNameForm_Load(object sender, EventArgs e) + { + try + { + var session = ApiClient.GetSession(); + var robotUpdateName = new List(); + var robots = session.FindRobots(); + if (robots != null) + { + robots = robots.Where(f => f.type == Api.Framework.SDK.ChatType.微信 && f.remark != "PCWechat HOOK").ToList(); + if (robots != null && robots.Count != 0) + { + foreach (var item in robots) + { + robotUpdateName.Add(new RobotUpdateName() + { + name = item.name, + nick = item.nick, + newName = string.Empty + }); + } + + } + } + gridControl1.DataSource = robotUpdateName; + label3.Visible = gridView1.RowCount == 0; + } + catch (Exception ex) + { + ShowError(ex); + } + } + + private void simpleButton1_Click(object sender, EventArgs e) + { + if (RobotNameDic.Count == 0 && XtraMessageBox.Show(@"当前没有修改的数据,是否取消?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No) return; + + this.Close(); + } + } +} \ No newline at end of file diff --git a/应用/BackupAndImport/EditRobotNameForm.resx b/应用/BackupAndImport/EditRobotNameForm.resx new file mode 100644 index 0000000..9bcc643 --- /dev/null +++ b/应用/BackupAndImport/EditRobotNameForm.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/应用/BackupAndImport/Entitys/AliOrder.cs b/应用/BackupAndImport/Entitys/AliOrder.cs new file mode 100644 index 0000000..9dbbece --- /dev/null +++ b/应用/BackupAndImport/Entitys/AliOrder.cs @@ -0,0 +1,33 @@ +using Api.Framework.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys +{ + /// + /// 订单状态信息 + /// + public class AliOrder + { + /// + /// 用户账号 + /// + public string username { get; set; } + /// + /// 订单号 + /// + public string orderid { get; set; } + /// + /// 订单状态 + /// + public int? status { get; set; } + /// + /// 冻结时间 + /// + public string endtime { get; set; } + + } +} diff --git a/应用/BackupAndImport/Entitys/BindCache.cs b/应用/BackupAndImport/Entitys/BindCache.cs new file mode 100644 index 0000000..33504de --- /dev/null +++ b/应用/BackupAndImport/Entitys/BindCache.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataDocking.Entitys +{ + public class BindCache + { + /// + /// 用户微信id + /// + public string username { get; set; } + /// + /// 订单号 + /// + public string orderid { get; set; } + /// + /// 订单状态 + /// + public string status { get; set; } + + } +} diff --git a/应用/BackupAndImport/Entitys/PrimaryKeyTemp.cs b/应用/BackupAndImport/Entitys/PrimaryKeyTemp.cs new file mode 100644 index 0000000..377b7f0 --- /dev/null +++ b/应用/BackupAndImport/Entitys/PrimaryKeyTemp.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataDocking.Entitys +{ + public class PrimaryKeyTemp + { + public int OldId {get;set;} + + public long NewId { get; set; } + + public string UserName { get; set; } + + } +} diff --git a/应用/BackupAndImport/Entitys/RobotUpdateName.cs b/应用/BackupAndImport/Entitys/RobotUpdateName.cs new file mode 100644 index 0000000..0ba4c43 --- /dev/null +++ b/应用/BackupAndImport/Entitys/RobotUpdateName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys +{ + public class RobotUpdateName + { + /// + /// 原始昵称 + /// + public string nick { get; set; } + + /// + /// 原始账号 + /// + public string name { get; set; } + + /// + /// 新账号 + /// + public string newName { get; set; } + } +} diff --git a/应用/BackupAndImport/Entitys/alitools/AliOrder.cs b/应用/BackupAndImport/Entitys/alitools/AliOrder.cs new file mode 100644 index 0000000..d8d6194 --- /dev/null +++ b/应用/BackupAndImport/Entitys/alitools/AliOrder.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.alitools +{ + /// + /// 订单状态信息 + /// + public class AliOrder + { + /// + /// 用户账号 + /// + public string username { get; set; } + /// + /// 订单号 + /// + public string orderid { get; set; } + /// + /// 订单状态 + /// + public string status { get; set; } + /// + /// 冻结时间 + /// + public string endtime { get; set; } + + } +} diff --git a/应用/BackupAndImport/Entitys/alitools/MemberInfo.cs b/应用/BackupAndImport/Entitys/alitools/MemberInfo.cs new file mode 100644 index 0000000..e8f9180 --- /dev/null +++ b/应用/BackupAndImport/Entitys/alitools/MemberInfo.cs @@ -0,0 +1,28 @@ +using System; + +namespace DataDocking.Entitys.alitools +{ + public class MemberInfo + { + public int Id { get; set; } + + public int UserType { get; set; } + + public string UserName { get; set; } + + public int RecId { get; set; } + + public double Point { get; set; } + + public double SumPoint { get; set; } + + public double TicPoint { get; set; } + + public DateTime CrtTime { get; set; } + + public string NickName { get; set; } + + public string Remark { get; set; } + + } +} diff --git a/应用/BackupAndImport/Entitys/annaer/上下级管理.cs b/应用/BackupAndImport/Entitys/annaer/上下级管理.cs new file mode 100644 index 0000000..8358fc9 --- /dev/null +++ b/应用/BackupAndImport/Entitys/annaer/上下级管理.cs @@ -0,0 +1,11 @@ +namespace BackupAndImport.Entitys.annaer +{ + public class 上下级管理 + { + public string 时间 { get; set; } + public string 上级对应ID { get; set; } + + public string 下级对应ID { get; set; } + + } +} diff --git a/应用/BackupAndImport/Entitys/annaer/会员信息.cs b/应用/BackupAndImport/Entitys/annaer/会员信息.cs new file mode 100644 index 0000000..f4cc6f3 --- /dev/null +++ b/应用/BackupAndImport/Entitys/annaer/会员信息.cs @@ -0,0 +1,254 @@ +using SqlSugar; +using System; + +namespace BackupAndImport.Entitys.annaer +{ + + [SugarTable("会员信息")] + public partial class 会员信息 + { + public 会员信息() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public string 对应ID { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 微信名字 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 姓名 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 支付宝 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? 总提现金额 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? 可提现金额 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? 未收货金额 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? 总成功订单 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? 签到次数 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? 签到奖励 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 签到时间 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? 推广奖励 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 定向比例 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 独立PID { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 注册时间 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 公众号对应ID { get; set; } + + } + + //[SugarTable("会员信息")] + //public partial class 会员信息 + //{ + // public 会员信息() + // { + + + // } + // /// + // /// Desc: + // /// Default: + // /// Nullable:False + // /// + // [SugarColumn(IsPrimaryKey = true)] + // public string 对应ID { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public string 微信名字 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public string 姓名 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public string 支付宝 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public double? 总提现金额 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public double? 可提现金额 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public double? 未收货金额 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public double? 总成功订单 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public double? 签到次数 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public double? 签到奖励 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public string 签到时间 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public double? 推广奖励 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public double? 定向比例 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public string 独立PID { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public string 注册时间 { get; set; } + + // /// + // /// Desc: + // /// Default: + // /// Nullable:True + // /// + // public string 公众号对应ID { get; set; } + + //} + + +} diff --git a/应用/BackupAndImport/Entitys/annaer_cloud/fission.cs b/应用/BackupAndImport/Entitys/annaer_cloud/fission.cs new file mode 100644 index 0000000..f3419eb --- /dev/null +++ b/应用/BackupAndImport/Entitys/annaer_cloud/fission.cs @@ -0,0 +1,20 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.annaer_cloud +{ + public class fission + { + public string creation_time { get; set; } + public string sj_wxid { get; set; } + [SugarColumn(IsPrimaryKey = true)] + public string xj_wxid { get; set; } + public string channel { get; set; } + public string my_user { get; set; } + + } +} diff --git a/应用/BackupAndImport/Entitys/annaer_cloud/member.cs b/应用/BackupAndImport/Entitys/annaer_cloud/member.cs new file mode 100644 index 0000000..7ae8387 --- /dev/null +++ b/应用/BackupAndImport/Entitys/annaer_cloud/member.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.annaer_cloud +{ + public class member + { + public int id { get; set; } + public string wxid { get; set; } + public string wx_user { get; set; } + public string grade { get; set; } + public string wx_name { get; set; } + public string wx_remarks { get; set; } + public string name { get; set; } + public string zfb { get; set; } + public double ztx_money { get; set; } + public double ktx_money { get; set; } + public double wsh_money { get; set; } + public double ycs_money { get; set; } + public int zcg_number { get; set; } + public int zth_number { get; set; } + public int zwq_number { get; set; } + public int qd_number { get; set; } + public double qd_money { get; set; } + public string qd_time { get; set; } + public double royalty_one { get; set; } + public double royalty_two { get; set; } + public double royalty_three { get; set; } + public double royalty_total { get; set; } + public string rebate_type { get; set; } + public string royalty_type { get; set; } + public string pid { get; set; } + public string adding_time { get; set; } + public string due_time { get; set; } + public string shopping_time { get; set; } + public string configure { get; set; } + public string gzh_id { get; set; } + public string record { get; set; } + public string my_user { get; set; } + } +} diff --git a/应用/BackupAndImport/Entitys/lieke/GroupInvite.cs b/应用/BackupAndImport/Entitys/lieke/GroupInvite.cs new file mode 100644 index 0000000..284cafd --- /dev/null +++ b/应用/BackupAndImport/Entitys/lieke/GroupInvite.cs @@ -0,0 +1,125 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.lieke +{ + /// + /// + /// + [SugarTable("GroupInvite")] + public partial class GroupInvite + { + public GroupInvite() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string gid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string inviterLkid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string inviteeLkid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string inviterNick { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string inviteeNick { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? status { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? createTime { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? updateTime { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string log { get; set; } + + } + + //public class GroupInvite + //{ + // public int id { get; set; } + + // public string gid { get; set; } + // /// + // /// 上级微信id + // /// + // public string inviterLkid { get; set; } + // /// + // /// 上级微信昵称 + // /// + // public string inviterNick { get; set; } + // /// + // /// 下级微信id + // /// + // public string inviteeLkid { get; set; } + // /// + // /// 下级微信昵称 + // /// + // public string inviteeNick { get; set; } + + // public int status { get; set; } + + // public int createTime { get; set; } + + // public int updateTime { get; set; } + + // public string log { get; set; } + + //} +} diff --git a/应用/BackupAndImport/Entitys/lieke/Member.cs b/应用/BackupAndImport/Entitys/lieke/Member.cs new file mode 100644 index 0000000..d8cb758 --- /dev/null +++ b/应用/BackupAndImport/Entitys/lieke/Member.cs @@ -0,0 +1,405 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.lieke +{ + /// + /// + /// + [SugarTable("Member")] + public partial class Member + { + public Member() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string lkid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string alias { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string origId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string v1id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string tempUserName { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string inviteCode { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string usernick { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string alipayId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string realname { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string robotUin { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string robotAlias { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? ketixianMoney { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? tixianzhongMoney { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? yitixianMoney { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string tradeidSuffix { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string tradeidSixSuffix { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? parentid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? isContactMember { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? isNeedGroupSend { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? isListen { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? level { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? status { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string adzonePid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? adzoneRate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? firstLevelAdzoneRate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? secondLevelAdzoneRate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string note { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? createTime { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? updateTime { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? channelRate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? isChannel { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? bindChannelId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string kanJiaRate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? firstLevelkanJiaRate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? secondLevelkanJiaRate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string jdAdzonePid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string pddAdzonePid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string mPersonFanliSet { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? closePersonShaShu { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? personShaShuNum { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? personShaShuRate { get; set; } + + } + //public class Member + //{ + + // public int id { get; set; } + + // public string lkid { get; set; } + + // public string alias { get; set; } + + // public string origId { get; set; } + + // public string v1id { get; set; } + + // public string tempUserName { get; set; } + + // public string inviteCode { get; set; } + + // public string usernick { get; set; } + + // public string alipayId { get; set; } + + // public string realname { get; set; } + + // public string robotUin { get; set; } + + // public string robotAlias { get; set; } + + // public double ketixianMoney { get; set; } + + // public double tixianzhongMoney { get; set; } + + // public double yitixianMoney { get; set; } + + // public string tradeidSuffix { get; set; } + + // public string tradeidSixSuffix { get; set; } + + // public int parentid { get; set; } + + // public int isContactMember { get; set; } + + // public int isNeedGroupSend { get; set; } + + // public int isListen { get; set; } + + // public int level { get; set; } + + // public int status { get; set; } + + // public string adzonePid { get; set; } + + // public double adzoneRate { get; set; } + + // public double firstLevelAdzoneRate { get; set; } + + // public double secondLevelAdzoneRate { get; set; } + + // public string note { get; set; } + + // public int createTime { get; set; } + + // public int updateTime { get; set; } + + // public double channelRate { get; set; } + + // public int isChannel { get; set; } + + // public int bindChannelId { get; set; } + + // public string kanJiaRate { get; set; } + + // public string firstLevelkanJiaRate { get; set; } + + // public string secondLevelkanJiaRate { get; set; } + + // public string jdAdzonePid { get; set; } + + // public string pddAdzonePid { get; set; } + + // public string mPersonFanliSet { get; set; } + + // public int closePersonShaShu { get; set; } + + // public int personShaShuNum { get; set; } + + // public double personShaShuRate { get; set; } + + //} +} diff --git a/应用/BackupAndImport/Entitys/念初/member.cs b/应用/BackupAndImport/Entitys/念初/member.cs new file mode 100644 index 0000000..37956a6 --- /dev/null +++ b/应用/BackupAndImport/Entitys/念初/member.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.念初 +{ + /// + /// member + /// + public class member + { + /// + /// member + /// + public member() + { + } + + /// + /// uid + /// + public System.Int64 uid { get; set; } + + /// + /// wxid + /// + public string wxid { get; set; } + + /// + /// nickname + /// + public string nickname { get; set; } + + /// + /// username + /// + public string username { get; set; } + + /// + /// usertype + /// + public System.Int64? usertype { get; set; } + + /// + /// integral + /// + public System.Int64? integral { get; set; } + + /// + /// qdcount + /// + public System.Int64? qdcount { get; set; } + + /// + /// qdlastdt + /// + public string qdlastdt { get; set; } + + /// + /// mmpid + /// + public string mmpid { get; set; } + + /// + /// pidname + /// + public string pidname { get; set; } + + /// + /// trjid + /// + public System.Int64? trjid { get; set; } + + /// + /// groupid + /// + public System.Int64? groupid { get; set; } + + /// + /// groupwxid + /// + public string groupwxid { get; set; } + + /// + /// groupname + /// + public string groupname { get; set; } + + /// + /// balance + /// + public System.Double? balance { get; set; } + + /// + /// alipayrealname + /// + public string alipayrealname { get; set; } + + /// + /// alipaynum + /// + public string alipaynum { get; set; } + + /// + /// regtime + /// + public string regtime { get; set; } + + /// + /// order_sixbit + /// + public string order_sixbit { get; set; } + + /// + /// jdpid + /// + public string jdpid { get; set; } + + /// + /// pddpid + /// + public string pddpid { get; set; } + + /// + /// pdd_order_lastbit + /// + public string pdd_order_lastbit { get; set; } + + /// + /// order_num + /// + public string order_num { get; set; } + + /// + /// smkey + /// + public System.Int64? smkey { get; set; } + + /// + /// del + /// + public System.Int64? del { get; set; } + + /// + /// order_date + /// + public System.String order_date { get; set; } + + /// + /// jinjie1 + /// + public System.Int64? jinjie1 { get; set; } + + /// + /// jinjie2 + /// + public System.Int64? jinjie2 { get; set; } + + /// + /// jinjie3 + /// + public System.Int64? jinjie3 { get; set; } + + /// + /// Evaluate_num + /// + public string Evaluate_num { get; set; } + + /// + /// avatar + /// + public string avatar { get; set; } + } +} diff --git a/应用/BackupAndImport/Entitys/念初/orders.cs b/应用/BackupAndImport/Entitys/念初/orders.cs new file mode 100644 index 0000000..6e9d7f0 --- /dev/null +++ b/应用/BackupAndImport/Entitys/念初/orders.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.念初 +{ + /// + /// orders + /// + public class orders + { + /// + /// orders + /// + public orders() + { + } + + /// + /// id + /// + public System.Int64 id { get; set; } + + /// + /// orderno + /// + public System.String orderno { get; set; } + + /// + /// iid + /// + public System.String iid { get; set; } + + /// + /// title + /// + public System.String title { get; set; } + + /// + /// amount + /// + public System.Int64? amount { get; set; } + + /// + /// price + /// + public System.Double? price { get; set; } + + /// + /// realprice + /// + public System.Double? realprice { get; set; } + + /// + /// tkrate + /// + public System.Double? tkrate { get; set; } + + /// + /// tkcommission + /// + public System.Double? tkcommission { get; set; } + + /// + /// mediaid + /// + public System.String mediaid { get; set; } + + /// + /// adid + /// + public System.String adid { get; set; } + + /// + /// mmpid + /// + public System.String mmpid { get; set; } + + /// + /// pidname + /// + public System.String pidname { get; set; } + + /// + /// createdt + /// + public System.String createdt { get; set; } + + /// + /// accountdt + /// + public System.String accountdt { get; set; } + + /// + /// ordertype + /// + public System.String ordertype { get; set; } + + /// + /// orderstatus + /// + public System.Int64? orderstatus { get; set; } + + /// + /// wxid + /// + public System.String wxid { get; set; } + + /// + /// userid + /// + public System.Int64? userid { get; set; } + + /// + /// fl_group + /// + public System.Double? fl_group { get; set; } + + /// + /// fl_agent + /// + public System.Double? fl_agent { get; set; } + + /// + /// fl_user + /// + public System.Double? fl_user { get; set; } + + /// + /// fl_Integral + /// + public System.Int64? fl_Integral { get; set; } + + /// + /// flstatus + /// + public System.Int64? flstatus { get; set; } + + /// + /// luckdrawTAG + /// + public System.Int64? luckdrawTAG { get; set; } + + /// + /// exceltype + /// + public System.Int64? exceltype { get; set; } + + /// + /// batch + /// + public System.String batch { get; set; } + + /// + /// modifytime + /// + public System.Int64? modifytime { get; set; } + } +} diff --git a/应用/BackupAndImport/Entitys/悠哉/member.cs b/应用/BackupAndImport/Entitys/悠哉/member.cs new file mode 100644 index 0000000..0a0f554 --- /dev/null +++ b/应用/BackupAndImport/Entitys/悠哉/member.cs @@ -0,0 +1,226 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.悠哉 +{ + /// + /// + /// + [SugarTable("member")] + public partial class member + { + public member() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int uid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string wxid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string nickname { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string username { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? usertype { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? integral { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? qdcount { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string qdlastdt { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string mmpid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string pidname { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? trjid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? groupid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string groupwxid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string groupname { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? balance { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string alipayrealname { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string alipaynum { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string regtime { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string order_sixbit { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string jdpid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string pddpid { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string pdd_order_lastbit { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? isblacklist { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? isadmin { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? isync { get; set; } + + } + //public class member + //{ + // public long uid { get; set; } + // public string wxid { get; set; } + // public string nickname { get; set; } + // public string username { get; set; } + // public int usertype { get; set; } + // public int integral { get; set; } + // public int qdcount { get; set; } + // public string qdlastdt { get; set; } + // public string mmpid { get; set; } + // public string pidname { get; set; } + // public int trjid { get; set; } + // public int groupid { get; set; } + // public string groupwxid { get; set; } + // public string groupname { get; set; } + // public double balance { get; set; } + // public string alipayrealname { get; set; } + // public string alipaynum { get; set; } + // public string regtime { get; set; } + // public string order_sixbit { get; set; } + // public string jdpid { get; set; } + // public string pddpid { get; set; } + // public string pdd_order_lastbit { get; set; } + // public int isblacklist { get; set; } + // public int isadmin { get; set; } + // public int isync { get; set; } + //} +} diff --git a/应用/BackupAndImport/Entitys/淘某喵/members_41235.cs b/应用/BackupAndImport/Entitys/淘某喵/members_41235.cs new file mode 100644 index 0000000..8280fd4 --- /dev/null +++ b/应用/BackupAndImport/Entitys/淘某喵/members_41235.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.淘某喵 +{ + /// + /// members_41235 + /// + public class members_41235 + { + /// + /// time + /// + public DateTime? time { get; set; } + + /// + /// wxid + /// + public string wxid { get; set; } + + /// + /// superior + /// + public string superior { get; set; } + + /// + /// name + /// + public string name { get; set; } + + /// + /// order_code + /// + public string order_code { get; set; } + + /// + /// city + /// + public string city { get; set; } + + /// + /// group_id + /// + public string group_id { get; set; } + + /// + /// coins + /// + public double? coins { get; set; } + + /// + /// frozen_coins + /// + public double? frozen_coins { get; set; } + + /// + /// kickback + /// + public double? kickback { get; set; } + + /// + /// total + /// + public double? total { get; set; } + + /// + /// purchase_volume + /// + public int? purchase_volume { get; set; } + + /// + /// commission + /// + public double? commission { get; set; } + + /// + /// withdraw_count + /// + public int? withdraw_count { get; set; } + + /// + /// sign_in_count + /// + public int? sign_in_count { get; set; } + + /// + /// sign_in_time + /// + public DateTime? sign_in_time { get; set; } + + /// + /// unreceived_coins + /// + public double? unreceived_coins { get; set; } + } +} diff --git a/应用/BackupAndImport/Entitys/淘某喵/members_46349.cs b/应用/BackupAndImport/Entitys/淘某喵/members_46349.cs new file mode 100644 index 0000000..907e780 --- /dev/null +++ b/应用/BackupAndImport/Entitys/淘某喵/members_46349.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.淘某喵 +{ + /// + /// members_41235 + /// + public class members_46349 + { + /// + /// time + /// + public DateTime? time { get; set; } + + /// + /// wxid + /// + public string wxid { get; set; } + + /// + /// superior + /// + public string superior { get; set; } + + /// + /// name + /// + public string name { get; set; } + + /// + /// order_code + /// + public string order_code { get; set; } + + /// + /// city + /// + public string city { get; set; } + + /// + /// group_id + /// + public string group_id { get; set; } + + /// + /// coins + /// + public double? coins { get; set; } + + /// + /// frozen_coins + /// + public double? frozen_coins { get; set; } + + /// + /// kickback + /// + public double? kickback { get; set; } + + /// + /// total + /// + public double? total { get; set; } + + /// + /// purchase_volume + /// + public int? purchase_volume { get; set; } + + /// + /// commission + /// + public double? commission { get; set; } + + /// + /// withdraw_count + /// + public int? withdraw_count { get; set; } + + /// + /// sign_in_count + /// + public int? sign_in_count { get; set; } + + /// + /// sign_in_time + /// + public DateTime? sign_in_time { get; set; } + + /// + /// unreceived_coins + /// + public double? unreceived_coins { get; set; } + } +} diff --git a/应用/BackupAndImport/Entitys/淘某喵/rewarded_orders_41235.cs b/应用/BackupAndImport/Entitys/淘某喵/rewarded_orders_41235.cs new file mode 100644 index 0000000..7287ce1 --- /dev/null +++ b/应用/BackupAndImport/Entitys/淘某喵/rewarded_orders_41235.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.淘某喵 +{ + /// + /// rewarded_orders_41235 + /// + public class rewarded_orders_41235 + { + /// + /// order_no + /// + public System.Int64? order_no { get; set; } + + /// + /// item_id + /// + public System.Int64? item_id { get; set; } + + /// + /// volume + /// + public System.Int32? volume { get; set; } + + /// + /// pay_status + /// + public System.Int32? pay_status { get; set; } + + /// + /// create_time + /// + public System.DateTime? create_time { get; set; } + + /// + /// settle_time + /// + public System.DateTime? settle_time { get; set; } + + /// + /// title + /// + public System.String title { get; set; } + + /// + /// pay_fee + /// + public System.Double? pay_fee { get; set; } + + /// + /// comm_rate + /// + public System.String comm_rate { get; set; } + + /// + /// commission + /// + public System.Double? commission { get; set; } + + /// + /// site_id + /// + public System.String site_id { get; set; } + + /// + /// site_name + /// + public System.String site_name { get; set; } + + /// + /// adzone_id + /// + public System.String adzone_id { get; set; } + + /// + /// adzone_name + /// + public System.String adzone_name { get; set; } + + /// + /// reward_fee + /// + public System.Double? reward_fee { get; set; } + + /// + /// superior_reward_fee + /// + public System.Double? superior_reward_fee { get; set; } + + /// + /// wxid + /// + public System.String wxid { get; set; } + + /// + /// superior + /// + public System.String superior { get; set; } + + /// + /// bind_time + /// + public System.DateTime? bind_time { get; set; } + } +} diff --git a/应用/BackupAndImport/Entitys/淘某喵/rewarded_orders_46349.cs b/应用/BackupAndImport/Entitys/淘某喵/rewarded_orders_46349.cs new file mode 100644 index 0000000..eff3f07 --- /dev/null +++ b/应用/BackupAndImport/Entitys/淘某喵/rewarded_orders_46349.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.淘某喵 +{ + /// + /// rewarded_orders_41235 + /// + public class rewarded_orders_46349 + { + /// + /// order_no + /// + public System.Int64? order_no { get; set; } + + /// + /// item_id + /// + public System.Int64? item_id { get; set; } + + /// + /// volume + /// + public System.Int32? volume { get; set; } + + /// + /// pay_status + /// + public System.Int32? pay_status { get; set; } + + /// + /// create_time + /// + public System.DateTime? create_time { get; set; } + + /// + /// settle_time + /// + public System.DateTime? settle_time { get; set; } + + /// + /// title + /// + public System.String title { get; set; } + + /// + /// pay_fee + /// + public System.Double? pay_fee { get; set; } + + /// + /// comm_rate + /// + public System.String comm_rate { get; set; } + + /// + /// commission + /// + public System.Double? commission { get; set; } + + /// + /// site_id + /// + public System.String site_id { get; set; } + + /// + /// site_name + /// + public System.String site_name { get; set; } + + /// + /// adzone_id + /// + public System.String adzone_id { get; set; } + + /// + /// adzone_name + /// + public System.String adzone_name { get; set; } + + /// + /// reward_fee + /// + public System.Double? reward_fee { get; set; } + + /// + /// superior_reward_fee + /// + public System.Double? superior_reward_fee { get; set; } + + /// + /// wxid + /// + public System.String wxid { get; set; } + + /// + /// superior + /// + public System.String superior { get; set; } + + /// + /// bind_time + /// + public System.DateTime? bind_time { get; set; } + } +} diff --git a/应用/BackupAndImport/Entitys/速推客/代理管理.cs b/应用/BackupAndImport/Entitys/速推客/代理管理.cs new file mode 100644 index 0000000..5ea6aa8 --- /dev/null +++ b/应用/BackupAndImport/Entitys/速推客/代理管理.cs @@ -0,0 +1,86 @@ +using SqlSugar; + +namespace BackupAndImport.Entitys.速推客 +{ + /// + /// + /// + [SugarTable("代理管理")] + public partial class 代理管理 + { + public 代理管理() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public string 上级ID { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 上级名称 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public string 下级ID { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 下级名称 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 绑定时间 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 来源 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 类型 { get; set; } + + } + + //public class 代理管理 + //{ + // public string 上级ID { get; set; } + + // public string 上级名称 { get; set; } + + // public string 下级ID { get; set; } + + // public string 下级名称 { get; set; } + + // public string 绑定时间 { get; set; } + + // //public string 来源 { get; set; } + + // //public string 类型 { get; set; } + + //} +} diff --git a/应用/BackupAndImport/Entitys/速推客/会员信息.cs b/应用/BackupAndImport/Entitys/速推客/会员信息.cs new file mode 100644 index 0000000..b9e4269 --- /dev/null +++ b/应用/BackupAndImport/Entitys/速推客/会员信息.cs @@ -0,0 +1,179 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.Entitys.速推客 +{ + /// + /// + /// + [SugarTable("会员信息")] + public partial class 会员信息 + { + public 会员信息() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public string ID { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 名称 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 姓名 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 支付宝 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 已提现金额 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 结算金额 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 付款金额 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 失效金额 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? 结算订单笔数 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? 付款订单笔数 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? 失效订单笔数 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 签到奖励 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 推广奖励 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 额外奖励 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 加入时间 { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 公众号ID { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string 创建时间 { get; set; } + + } + //public class 会员信息 + //{ + // public string ID { get; set; } + + // public string 名称 { get; set; } + + // public string 姓名 { get; set; } + + // public string 支付宝 { get; set; } + + // public double 已提现金额 { get; set; } + + // public double 结算金额 { get; set; } + + // public double 付款金额 { get; set; } + + // public double 失效金额 { get; set; } + + // public int 结算订单笔数 { get; set; } + + // public int 付款订单笔数 { get; set; } + + // public double 失效订单笔数 { get; set; } + + // public double 签到奖励 { get; set; } + + // public double 推广奖励 { get; set; } + + // public double 额外奖励 { get; set; } + + // public string 加入时间 { get; set; } + + // public string 公众号ID { get; set; } + + // //public string 创建时间 { get; set; } + + //} +} diff --git a/应用/BackupAndImport/Enums.cs b/应用/BackupAndImport/Enums.cs new file mode 100644 index 0000000..8aa85c8 --- /dev/null +++ b/应用/BackupAndImport/Enums.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataDocking +{ + class Enums + { + /// + /// 软件类型 + /// + public enum SoftwareType + { + AliTools = 1, + 安娜儿 = 2, + + } + + } + +} diff --git a/应用/BackupAndImport/MainForm.Designer.cs b/应用/BackupAndImport/MainForm.Designer.cs new file mode 100644 index 0000000..13dda38 --- /dev/null +++ b/应用/BackupAndImport/MainForm.Designer.cs @@ -0,0 +1,2799 @@ +namespace DataDocking +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl(); + this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage(); + this.simpleButton13 = new DevExpress.XtraEditors.SimpleButton(); + this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); + this.tabPane1 = new DevExpress.XtraBars.Navigation.TabPane(); + this.tabNavigationPage1 = new DevExpress.XtraBars.Navigation.TabNavigationPage(); + this.memoEdit1 = new DevExpress.XtraEditors.MemoEdit(); + this.simpleButton4 = new DevExpress.XtraEditors.SimpleButton(); + this.label2 = new System.Windows.Forms.Label(); + this.checkedListBoxControl1 = new DevExpress.XtraEditors.CheckedListBoxControl(); + this.tabNavigationPage2 = new DevExpress.XtraBars.Navigation.TabNavigationPage(); + this.tabNavigationPage3 = new DevExpress.XtraBars.Navigation.TabNavigationPage(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.simpleButton6 = new DevExpress.XtraEditors.SimpleButton(); + this.memoEdit2 = new DevExpress.XtraEditors.MemoEdit(); + this.simpleButton5 = new DevExpress.XtraEditors.SimpleButton(); + this.checkedListBoxControl2 = new DevExpress.XtraEditors.CheckedListBoxControl(); + this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage(); + this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl(); + this.xtraTabPage6 = new DevExpress.XtraTab.XtraTabPage(); + this.groupControl1 = new DevExpress.XtraEditors.GroupControl(); + this.labelControl35 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl41 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl37 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl40 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl36 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl34 = new DevExpress.XtraEditors.LabelControl(); + this.label8 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl32 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl31 = new DevExpress.XtraEditors.LabelControl(); + this.panelControl1 = new DevExpress.XtraEditors.PanelControl(); + this.labelControl33 = new DevExpress.XtraEditors.LabelControl(); + this.simpleButton14 = new DevExpress.XtraEditors.SimpleButton(); + this.textEdit12 = new DevExpress.XtraEditors.TextEdit(); + this.textEdit11 = new DevExpress.XtraEditors.TextEdit(); + this.textEdit10 = new DevExpress.XtraEditors.TextEdit(); + this.textEdit13 = new DevExpress.XtraEditors.TextEdit(); + this.textEdit9 = new DevExpress.XtraEditors.TextEdit(); + this.labelControl28 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl27 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl29 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl26 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl30 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl25 = new DevExpress.XtraEditors.LabelControl(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.comboBoxEdit2 = new DevExpress.XtraEditors.ComboBoxEdit(); + this.label31 = new System.Windows.Forms.Label(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.comboBoxEdit1 = new DevExpress.XtraEditors.ComboBoxEdit(); + this.comboBoxEdit3 = new DevExpress.XtraEditors.ComboBoxEdit(); + this.label5 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton(); + this.textEdit1 = new DevExpress.XtraEditors.TextEdit(); + this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton(); + this.xtraTabPage7 = new DevExpress.XtraTab.XtraTabPage(); + this.checkEdit1 = new DevExpress.XtraEditors.CheckEdit(); + this.labelControl44 = new DevExpress.XtraEditors.LabelControl(); + this.dateTimePicker3 = new System.Windows.Forms.DateTimePicker(); + this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker(); + this.labelControl24 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl23 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl43 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl42 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl39 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl38 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl22 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl15 = new DevExpress.XtraEditors.LabelControl(); + this.checkBox16 = new System.Windows.Forms.CheckBox(); + this.checkBox13 = new System.Windows.Forms.CheckBox(); + this.checkBox10 = new System.Windows.Forms.CheckBox(); + this.checkBox15 = new System.Windows.Forms.CheckBox(); + this.checkBox14 = new System.Windows.Forms.CheckBox(); + this.checkBox12 = new System.Windows.Forms.CheckBox(); + this.checkBox11 = new System.Windows.Forms.CheckBox(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); + this.labelControl18 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl14 = new DevExpress.XtraEditors.LabelControl(); + this.checkBox8 = new System.Windows.Forms.CheckBox(); + this.labelControl17 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl12 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl13 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl8 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl11 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl16 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl10 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl9 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl21 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl20 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl19 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl7 = new DevExpress.XtraEditors.LabelControl(); + this.memoEdit3 = new DevExpress.XtraEditors.MemoEdit(); + this.checkBox5 = new System.Windows.Forms.CheckBox(); + this.separatorControl2 = new DevExpress.XtraEditors.SeparatorControl(); + this.separatorControl1 = new DevExpress.XtraEditors.SeparatorControl(); + this.label29 = new System.Windows.Forms.Label(); + this.label28 = new System.Windows.Forms.Label(); + this.label30 = new System.Windows.Forms.Label(); + this.textBox6 = new System.Windows.Forms.TextBox(); + this.textBox5 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox4 = new System.Windows.Forms.TextBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.xtraTabPage10 = new DevExpress.XtraTab.XtraTabPage(); + this.checkBox30 = new System.Windows.Forms.CheckBox(); + this.checkBox25 = new System.Windows.Forms.CheckBox(); + this.checkBox29 = new System.Windows.Forms.CheckBox(); + this.checkBox24 = new System.Windows.Forms.CheckBox(); + this.checkBox28 = new System.Windows.Forms.CheckBox(); + this.checkBox23 = new System.Windows.Forms.CheckBox(); + this.checkBox27 = new System.Windows.Forms.CheckBox(); + this.checkBox22 = new System.Windows.Forms.CheckBox(); + this.checkBox26 = new System.Windows.Forms.CheckBox(); + this.checkBox21 = new System.Windows.Forms.CheckBox(); + this.separatorControl8 = new DevExpress.XtraEditors.SeparatorControl(); + this.label27 = new System.Windows.Forms.Label(); + this.memoEdit5 = new DevExpress.XtraEditors.MemoEdit(); + this.separatorControl7 = new DevExpress.XtraEditors.SeparatorControl(); + this.button7 = new System.Windows.Forms.Button(); + this.checkBox20 = new System.Windows.Forms.CheckBox(); + this.separatorControl6 = new DevExpress.XtraEditors.SeparatorControl(); + this.label26 = new System.Windows.Forms.Label(); + this.labelControl58 = new DevExpress.XtraEditors.LabelControl(); + this.textBox8 = new System.Windows.Forms.TextBox(); + this.labelControl54 = new DevExpress.XtraEditors.LabelControl(); + this.xtraTabPage9 = new DevExpress.XtraTab.XtraTabPage(); + this.labelControl52 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl51 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl53 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl55 = new DevExpress.XtraEditors.LabelControl(); + this.checkBox7 = new System.Windows.Forms.CheckBox(); + this.checkBox17 = new System.Windows.Forms.CheckBox(); + this.checkBox18 = new System.Windows.Forms.CheckBox(); + this.labelControl56 = new DevExpress.XtraEditors.LabelControl(); + this.memoEdit4 = new DevExpress.XtraEditors.MemoEdit(); + this.checkBox19 = new System.Windows.Forms.CheckBox(); + this.separatorControl4 = new DevExpress.XtraEditors.SeparatorControl(); + this.separatorControl5 = new DevExpress.XtraEditors.SeparatorControl(); + this.label24 = new System.Windows.Forms.Label(); + this.textBox7 = new System.Windows.Forms.TextBox(); + this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); + this.xtraTabPage8 = new DevExpress.XtraTab.XtraTabPage(); + this.labelControl50 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl49 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl48 = new DevExpress.XtraEditors.LabelControl(); + this.simpleButton16 = new DevExpress.XtraEditors.SimpleButton(); + this.simpleButton15 = new DevExpress.XtraEditors.SimpleButton(); + this.separatorControl3 = new DevExpress.XtraEditors.SeparatorControl(); + this.label6 = new System.Windows.Forms.Label(); + this.progressBar3 = new System.Windows.Forms.ProgressBar(); + this.labelControl46 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl47 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl45 = new DevExpress.XtraEditors.LabelControl(); + this.simpleButton12 = new DevExpress.XtraEditors.SimpleButton(); + this.xtraTabPage3 = new DevExpress.XtraTab.XtraTabPage(); + this.groupControl2 = new DevExpress.XtraEditors.GroupControl(); + this.label7 = new System.Windows.Forms.Label(); + this.progressBar4 = new System.Windows.Forms.ProgressBar(); + this.simpleButton7 = new DevExpress.XtraEditors.SimpleButton(); + this.textEdit5 = new DevExpress.XtraEditors.TextEdit(); + this.textEdit4 = new DevExpress.XtraEditors.TextEdit(); + this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton(); + this.textEdit3 = new DevExpress.XtraEditors.TextEdit(); + this.labelControl6 = new DevExpress.XtraEditors.LabelControl(); + this.textEdit2 = new DevExpress.XtraEditors.TextEdit(); + this.textEdit6 = new DevExpress.XtraEditors.TextEdit(); + this.labelControl5 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl4 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl3 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); + this.xtraTabPage5 = new DevExpress.XtraTab.XtraTabPage(); + this.groupControl4 = new DevExpress.XtraEditors.GroupControl(); + this.label36 = new System.Windows.Forms.Label(); + this.progressBar2 = new System.Windows.Forms.ProgressBar(); + this.label4 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.label25 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.label22 = new System.Windows.Forms.Label(); + this.simpleButton10 = new DevExpress.XtraEditors.SimpleButton(); + this.textEdit8 = new DevExpress.XtraEditors.TextEdit(); + this.simpleButton11 = new DevExpress.XtraEditors.SimpleButton(); + this.xtraTabPage4 = new DevExpress.XtraTab.XtraTabPage(); + this.groupControl3 = new DevExpress.XtraEditors.GroupControl(); + this.checkBox6 = new System.Windows.Forms.CheckBox(); + this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); + this.Auto_Bak_onoff = new UI.Framework.Controls.ButtonCheck(); + this.numericUpDown2 = new System.Windows.Forms.NumericUpDown(); + this.label16 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label23 = new System.Windows.Forms.Label(); + this.label21 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.simpleButton8 = new DevExpress.XtraEditors.SimpleButton(); + this.textEdit7 = new DevExpress.XtraEditors.TextEdit(); + this.simpleButton9 = new DevExpress.XtraEditors.SimpleButton(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.xtraTabbedMdiManager1 = new DevExpress.XtraTabbedMdi.XtraTabbedMdiManager(this.components); + this.checkBox31 = new System.Windows.Forms.CheckBox(); + ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit(); + this.xtraTabControl1.SuspendLayout(); + this.xtraTabPage2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tabPane1)).BeginInit(); + this.tabPane1.SuspendLayout(); + this.tabNavigationPage1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit1.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkedListBoxControl1)).BeginInit(); + this.tabNavigationPage3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit2.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkedListBoxControl2)).BeginInit(); + this.xtraTabPage1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl2)).BeginInit(); + this.xtraTabControl2.SuspendLayout(); + this.xtraTabPage6.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit(); + this.groupControl1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit(); + this.panelControl1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit12.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit11.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit10.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit13.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit9.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit2.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit3.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit(); + this.xtraTabPage7.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit1.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit3.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl1)).BeginInit(); + this.xtraTabPage10.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl8)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit5.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl7)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl6)).BeginInit(); + this.xtraTabPage9.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit4.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl5)).BeginInit(); + this.xtraTabPage8.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl3)).BeginInit(); + this.xtraTabPage3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.groupControl2)).BeginInit(); + this.groupControl2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit5.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit4.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit3.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit2.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit6.Properties)).BeginInit(); + this.xtraTabPage5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.groupControl4)).BeginInit(); + this.groupControl4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit8.Properties)).BeginInit(); + this.xtraTabPage4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.groupControl3)).BeginInit(); + this.groupControl3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit7.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.xtraTabbedMdiManager1)).BeginInit(); + this.SuspendLayout(); + // + // xtraTabControl1 + // + this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.xtraTabControl1.Location = new System.Drawing.Point(0, 0); + this.xtraTabControl1.Name = "xtraTabControl1"; + this.xtraTabControl1.SelectedTabPage = this.xtraTabPage2; + this.xtraTabControl1.Size = new System.Drawing.Size(816, 469); + this.xtraTabControl1.TabIndex = 0; + this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { + this.xtraTabPage2, + this.xtraTabPage1, + this.xtraTabPage3, + this.xtraTabPage5, + this.xtraTabPage4}); + // + // xtraTabPage2 + // + this.xtraTabPage2.Controls.Add(this.simpleButton13); + this.xtraTabPage2.Controls.Add(this.labelControl1); + this.xtraTabPage2.Controls.Add(this.tabPane1); + this.xtraTabPage2.Name = "xtraTabPage2"; + this.xtraTabPage2.Size = new System.Drawing.Size(814, 443); + this.xtraTabPage2.Text = " 配 置 文 件 导 入 导 出 "; + // + // simpleButton13 + // + this.simpleButton13.Location = new System.Drawing.Point(11, 409); + this.simpleButton13.Name = "simpleButton13"; + this.simpleButton13.Size = new System.Drawing.Size(75, 23); + this.simpleButton13.TabIndex = 8; + this.simpleButton13.Text = "simpleButton13"; + this.simpleButton13.Visible = false; + this.simpleButton13.Click += new System.EventHandler(this.simpleButton13_Click); + // + // labelControl1 + // + this.labelControl1.Appearance.ForeColor = System.Drawing.Color.Gray; + this.labelControl1.Appearance.Options.UseForeColor = true; + this.labelControl1.Location = new System.Drawing.Point(216, 409); + this.labelControl1.Name = "labelControl1"; + this.labelControl1.Size = new System.Drawing.Size(414, 14); + this.labelControl1.TabIndex = 1; + this.labelControl1.Text = "(注:系统配置的导入导出,不会影响用户数据.导入的数据需要重启软件才生效)"; + // + // tabPane1 + // + this.tabPane1.Controls.Add(this.tabNavigationPage1); + this.tabPane1.Controls.Add(this.tabNavigationPage2); + this.tabPane1.Controls.Add(this.tabNavigationPage3); + this.tabPane1.Location = new System.Drawing.Point(38, 28); + this.tabPane1.Name = "tabPane1"; + this.tabPane1.Pages.AddRange(new DevExpress.XtraBars.Navigation.NavigationPageBase[] { + this.tabNavigationPage1, + this.tabNavigationPage3}); + this.tabPane1.RegularSize = new System.Drawing.Size(746, 375); + this.tabPane1.SelectedPage = this.tabNavigationPage1; + this.tabPane1.Size = new System.Drawing.Size(746, 375); + this.tabPane1.TabIndex = 0; + this.tabPane1.Text = "tabPane1"; + // + // tabNavigationPage1 + // + this.tabNavigationPage1.Caption = "导出系统配置"; + this.tabNavigationPage1.Controls.Add(this.memoEdit1); + this.tabNavigationPage1.Controls.Add(this.simpleButton4); + this.tabNavigationPage1.Controls.Add(this.label2); + this.tabNavigationPage1.Controls.Add(this.checkedListBoxControl1); + this.tabNavigationPage1.Name = "tabNavigationPage1"; + this.tabNavigationPage1.Size = new System.Drawing.Size(746, 346); + // + // memoEdit1 + // + this.memoEdit1.Location = new System.Drawing.Point(406, 40); + this.memoEdit1.Name = "memoEdit1"; + this.memoEdit1.Properties.Appearance.ForeColor = System.Drawing.Color.Blue; + this.memoEdit1.Properties.Appearance.Options.UseForeColor = true; + this.memoEdit1.Size = new System.Drawing.Size(323, 287); + this.memoEdit1.TabIndex = 8; + // + // simpleButton4 + // + this.simpleButton4.Location = new System.Drawing.Point(198, 10); + this.simpleButton4.Name = "simpleButton4"; + this.simpleButton4.Size = new System.Drawing.Size(85, 25); + this.simpleButton4.TabIndex = 7; + this.simpleButton4.Text = "立即导出"; + this.simpleButton4.Click += new System.EventHandler(this.simpleButton4_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(52, 16); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(115, 14); + this.label2.TabIndex = 6; + this.label2.Text = "勾选要导出的配置:"; + // + // checkedListBoxControl1 + // + this.checkedListBoxControl1.Location = new System.Drawing.Point(44, 41); + this.checkedListBoxControl1.Name = "checkedListBoxControl1"; + this.checkedListBoxControl1.Size = new System.Drawing.Size(346, 286); + this.checkedListBoxControl1.TabIndex = 5; + this.checkedListBoxControl1.ItemCheck += new DevExpress.XtraEditors.Controls.ItemCheckEventHandler(this.checkedListBoxControl1_ItemCheck); + this.checkedListBoxControl1.SelectedIndexChanged += new System.EventHandler(this.checkedListBoxControl1_SelectedIndexChanged); + // + // tabNavigationPage2 + // + this.tabNavigationPage2.Caption = "tabNavigationPage2"; + this.tabNavigationPage2.Name = "tabNavigationPage2"; + this.tabNavigationPage2.Size = new System.Drawing.Size(506, 235); + // + // tabNavigationPage3 + // + this.tabNavigationPage3.Caption = "导入系统配置"; + this.tabNavigationPage3.Controls.Add(this.checkBox3); + this.tabNavigationPage3.Controls.Add(this.simpleButton6); + this.tabNavigationPage3.Controls.Add(this.memoEdit2); + this.tabNavigationPage3.Controls.Add(this.simpleButton5); + this.tabNavigationPage3.Controls.Add(this.checkedListBoxControl2); + this.tabNavigationPage3.Name = "tabNavigationPage3"; + this.tabNavigationPage3.Size = new System.Drawing.Size(746, 346); + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Location = new System.Drawing.Point(177, 16); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(110, 18); + this.checkBox3.TabIndex = 14; + this.checkBox3.Text = "是否覆盖原配置"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // simpleButton6 + // + this.simpleButton6.Location = new System.Drawing.Point(321, 12); + this.simpleButton6.Name = "simpleButton6"; + this.simpleButton6.Size = new System.Drawing.Size(85, 25); + this.simpleButton6.TabIndex = 13; + this.simpleButton6.Text = "立即导入"; + this.simpleButton6.Click += new System.EventHandler(this.simpleButton6_Click); + // + // memoEdit2 + // + this.memoEdit2.Location = new System.Drawing.Point(409, 43); + this.memoEdit2.Name = "memoEdit2"; + this.memoEdit2.Properties.Appearance.ForeColor = System.Drawing.Color.Blue; + this.memoEdit2.Properties.Appearance.Options.UseForeColor = true; + this.memoEdit2.Size = new System.Drawing.Size(318, 289); + this.memoEdit2.TabIndex = 12; + // + // simpleButton5 + // + this.simpleButton5.Location = new System.Drawing.Point(86, 12); + this.simpleButton5.Name = "simpleButton5"; + this.simpleButton5.Size = new System.Drawing.Size(85, 25); + this.simpleButton5.TabIndex = 11; + this.simpleButton5.Text = "选择导入文件"; + this.simpleButton5.Click += new System.EventHandler(this.simpleButton5_Click); + // + // checkedListBoxControl2 + // + this.checkedListBoxControl2.Location = new System.Drawing.Point(53, 44); + this.checkedListBoxControl2.Name = "checkedListBoxControl2"; + this.checkedListBoxControl2.Size = new System.Drawing.Size(339, 288); + this.checkedListBoxControl2.TabIndex = 9; + this.checkedListBoxControl2.ItemCheck += new DevExpress.XtraEditors.Controls.ItemCheckEventHandler(this.checkedListBoxControl2_ItemCheck); + // + // xtraTabPage1 + // + this.xtraTabPage1.Controls.Add(this.xtraTabControl2); + this.xtraTabPage1.Name = "xtraTabPage1"; + this.xtraTabPage1.Size = new System.Drawing.Size(814, 443); + this.xtraTabPage1.Text = " 其 它 软 件 数 据 导 入 "; + // + // xtraTabControl2 + // + this.xtraTabControl2.Location = new System.Drawing.Point(22, 16); + this.xtraTabControl2.Name = "xtraTabControl2"; + this.xtraTabControl2.SelectedTabPage = this.xtraTabPage6; + this.xtraTabControl2.Size = new System.Drawing.Size(771, 405); + this.xtraTabControl2.TabIndex = 9; + this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { + this.xtraTabPage6, + this.xtraTabPage7, + this.xtraTabPage10, + this.xtraTabPage9, + this.xtraTabPage8}); + // + // xtraTabPage6 + // + this.xtraTabPage6.Controls.Add(this.groupControl1); + this.xtraTabPage6.Name = "xtraTabPage6"; + this.xtraTabPage6.Size = new System.Drawing.Size(769, 379); + this.xtraTabPage6.Text = " 其 他 软 件 数 据 导 入"; + // + // groupControl1 + // + this.groupControl1.Controls.Add(this.labelControl35); + this.groupControl1.Controls.Add(this.labelControl41); + this.groupControl1.Controls.Add(this.labelControl37); + this.groupControl1.Controls.Add(this.labelControl40); + this.groupControl1.Controls.Add(this.labelControl36); + this.groupControl1.Controls.Add(this.labelControl34); + this.groupControl1.Controls.Add(this.label8); + this.groupControl1.Controls.Add(this.labelControl32); + this.groupControl1.Controls.Add(this.labelControl31); + this.groupControl1.Controls.Add(this.panelControl1); + this.groupControl1.Controls.Add(this.checkBox4); + this.groupControl1.Controls.Add(this.comboBoxEdit2); + this.groupControl1.Controls.Add(this.label31); + this.groupControl1.Controls.Add(this.progressBar1); + this.groupControl1.Controls.Add(this.comboBoxEdit1); + this.groupControl1.Controls.Add(this.comboBoxEdit3); + this.groupControl1.Controls.Add(this.label5); + this.groupControl1.Controls.Add(this.label3); + this.groupControl1.Controls.Add(this.label1); + this.groupControl1.Controls.Add(this.checkBox2); + this.groupControl1.Controls.Add(this.checkBox1); + this.groupControl1.Controls.Add(this.simpleButton2); + this.groupControl1.Controls.Add(this.textEdit1); + this.groupControl1.Controls.Add(this.simpleButton1); + this.groupControl1.Location = new System.Drawing.Point(37, 23); + this.groupControl1.Name = "groupControl1"; + this.groupControl1.Size = new System.Drawing.Size(699, 334); + this.groupControl1.TabIndex = 9; + this.groupControl1.Text = " 数据导入"; + // + // labelControl35 + // + this.labelControl35.Location = new System.Drawing.Point(92, 40); + this.labelControl35.Name = "labelControl35"; + this.labelControl35.Size = new System.Drawing.Size(72, 14); + this.labelControl35.TabIndex = 29; + this.labelControl35.Text = "数据库类型:"; + // + // labelControl41 + // + this.labelControl41.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl41.Appearance.Options.UseForeColor = true; + this.labelControl41.Location = new System.Drawing.Point(351, 129); + this.labelControl41.Name = "labelControl41"; + this.labelControl41.Size = new System.Drawing.Size(97, 14); + this.labelControl41.TabIndex = 29; + this.labelControl41.Text = "( * 千万不要选错)"; + // + // labelControl37 + // + this.labelControl37.Location = new System.Drawing.Point(50, 129); + this.labelControl37.Name = "labelControl37"; + this.labelControl37.Size = new System.Drawing.Size(114, 14); + this.labelControl37.TabIndex = 29; + this.labelControl37.Text = "QQ对应机器人账号:"; + // + // labelControl40 + // + this.labelControl40.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl40.Appearance.Options.UseForeColor = true; + this.labelControl40.Location = new System.Drawing.Point(352, 100); + this.labelControl40.Name = "labelControl40"; + this.labelControl40.Size = new System.Drawing.Size(97, 14); + this.labelControl40.TabIndex = 29; + this.labelControl40.Text = "( * 千万不要选错)"; + // + // labelControl36 + // + this.labelControl36.Location = new System.Drawing.Point(44, 103); + this.labelControl36.Name = "labelControl36"; + this.labelControl36.Size = new System.Drawing.Size(120, 14); + this.labelControl36.TabIndex = 29; + this.labelControl36.Text = "微信对应机器人账号:"; + // + // labelControl34 + // + this.labelControl34.Location = new System.Drawing.Point(92, 76); + this.labelControl34.Name = "labelControl34"; + this.labelControl34.Size = new System.Drawing.Size(72, 14); + this.labelControl34.TabIndex = 29; + this.labelControl34.Text = "数据库路径:"; + this.labelControl34.Click += new System.EventHandler(this.labelControl34_Click); + // + // label8 + // + this.label8.Location = new System.Drawing.Point(175, 161); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(72, 14); + this.label8.TabIndex = 28; + this.label8.Text = "请选择数据库"; + // + // labelControl32 + // + this.labelControl32.Appearance.Font = new System.Drawing.Font("Tahoma", 16F); + this.labelControl32.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl32.Appearance.Options.UseFont = true; + this.labelControl32.Appearance.Options.UseForeColor = true; + this.labelControl32.Location = new System.Drawing.Point(65, 71); + this.labelControl32.Name = "labelControl32"; + this.labelControl32.Size = new System.Drawing.Size(21, 25); + this.labelControl32.TabIndex = 27; + this.labelControl32.Text = "②"; + // + // labelControl31 + // + this.labelControl31.Appearance.Font = new System.Drawing.Font("Tahoma", 16F); + this.labelControl31.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl31.Appearance.Options.UseFont = true; + this.labelControl31.Appearance.Options.UseForeColor = true; + this.labelControl31.Location = new System.Drawing.Point(65, 35); + this.labelControl31.Name = "labelControl31"; + this.labelControl31.Size = new System.Drawing.Size(21, 25); + this.labelControl31.TabIndex = 27; + this.labelControl31.Text = "①"; + // + // panelControl1 + // + this.panelControl1.Controls.Add(this.labelControl33); + this.panelControl1.Controls.Add(this.simpleButton14); + this.panelControl1.Controls.Add(this.textEdit12); + this.panelControl1.Controls.Add(this.textEdit11); + this.panelControl1.Controls.Add(this.textEdit10); + this.panelControl1.Controls.Add(this.textEdit13); + this.panelControl1.Controls.Add(this.textEdit9); + this.panelControl1.Controls.Add(this.labelControl28); + this.panelControl1.Controls.Add(this.labelControl27); + this.panelControl1.Controls.Add(this.labelControl29); + this.panelControl1.Controls.Add(this.labelControl26); + this.panelControl1.Controls.Add(this.labelControl30); + this.panelControl1.Controls.Add(this.labelControl25); + this.panelControl1.Location = new System.Drawing.Point(462, 35); + this.panelControl1.Name = "panelControl1"; + this.panelControl1.Size = new System.Drawing.Size(229, 257); + this.panelControl1.TabIndex = 26; + this.panelControl1.Visible = false; + // + // labelControl33 + // + this.labelControl33.Appearance.Font = new System.Drawing.Font("Tahoma", 16F); + this.labelControl33.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl33.Appearance.Options.UseFont = true; + this.labelControl33.Appearance.Options.UseForeColor = true; + this.labelControl33.Location = new System.Drawing.Point(9, 5); + this.labelControl33.Name = "labelControl33"; + this.labelControl33.Size = new System.Drawing.Size(21, 25); + this.labelControl33.TabIndex = 27; + this.labelControl33.Text = "②"; + // + // simpleButton14 + // + this.simpleButton14.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("simpleButton14.ImageOptions.Image"))); + this.simpleButton14.Location = new System.Drawing.Point(73, 215); + this.simpleButton14.Name = "simpleButton14"; + this.simpleButton14.Size = new System.Drawing.Size(102, 23); + this.simpleButton14.TabIndex = 28; + this.simpleButton14.Text = "尝试连接"; + this.simpleButton14.Click += new System.EventHandler(this.simpleButton14_Click); + // + // textEdit12 + // + this.textEdit12.Location = new System.Drawing.Point(83, 182); + this.textEdit12.Name = "textEdit12"; + this.textEdit12.Size = new System.Drawing.Size(131, 20); + this.textEdit12.TabIndex = 26; + // + // textEdit11 + // + this.textEdit11.Location = new System.Drawing.Point(83, 151); + this.textEdit11.Name = "textEdit11"; + this.textEdit11.Size = new System.Drawing.Size(131, 20); + this.textEdit11.TabIndex = 26; + // + // textEdit10 + // + this.textEdit10.Location = new System.Drawing.Point(83, 120); + this.textEdit10.Name = "textEdit10"; + this.textEdit10.Size = new System.Drawing.Size(131, 20); + this.textEdit10.TabIndex = 26; + // + // textEdit13 + // + this.textEdit13.Location = new System.Drawing.Point(83, 89); + this.textEdit13.Name = "textEdit13"; + this.textEdit13.Size = new System.Drawing.Size(131, 20); + this.textEdit13.TabIndex = 26; + // + // textEdit9 + // + this.textEdit9.Location = new System.Drawing.Point(83, 58); + this.textEdit9.Name = "textEdit9"; + this.textEdit9.Size = new System.Drawing.Size(131, 20); + this.textEdit9.TabIndex = 26; + // + // labelControl28 + // + this.labelControl28.Location = new System.Drawing.Point(9, 185); + this.labelControl28.Name = "labelControl28"; + this.labelControl28.Size = new System.Drawing.Size(72, 14); + this.labelControl28.TabIndex = 25; + this.labelControl28.Text = "数据库密码:"; + // + // labelControl27 + // + this.labelControl27.Location = new System.Drawing.Point(9, 154); + this.labelControl27.Name = "labelControl27"; + this.labelControl27.Size = new System.Drawing.Size(72, 14); + this.labelControl27.TabIndex = 25; + this.labelControl27.Text = "数据库账号:"; + // + // labelControl29 + // + this.labelControl29.Location = new System.Drawing.Point(9, 92); + this.labelControl29.Name = "labelControl29"; + this.labelControl29.Size = new System.Drawing.Size(72, 14); + this.labelControl29.TabIndex = 25; + this.labelControl29.Text = "数据库端口:"; + // + // labelControl26 + // + this.labelControl26.Location = new System.Drawing.Point(9, 123); + this.labelControl26.Name = "labelControl26"; + this.labelControl26.Size = new System.Drawing.Size(72, 14); + this.labelControl26.TabIndex = 25; + this.labelControl26.Text = "数据库名称:"; + // + // labelControl30 + // + this.labelControl30.Appearance.Font = new System.Drawing.Font("Tahoma", 14F, System.Drawing.FontStyle.Bold); + this.labelControl30.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl30.Appearance.Options.UseFont = true; + this.labelControl30.Appearance.Options.UseForeColor = true; + this.labelControl30.Location = new System.Drawing.Point(36, 19); + this.labelControl30.Name = "labelControl30"; + this.labelControl30.Size = new System.Drawing.Size(160, 23); + this.labelControl30.TabIndex = 25; + this.labelControl30.Text = "请填写服务器地址"; + // + // labelControl25 + // + this.labelControl25.Location = new System.Drawing.Point(9, 61); + this.labelControl25.Name = "labelControl25"; + this.labelControl25.Size = new System.Drawing.Size(72, 14); + this.labelControl25.TabIndex = 25; + this.labelControl25.Text = "服务器地址:"; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Enabled = false; + this.checkBox4.Font = new System.Drawing.Font("Tahoma", 11F); + this.checkBox4.Location = new System.Drawing.Point(340, 36); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(114, 22); + this.checkBox4.TabIndex = 24; + this.checkBox4.Text = "Mysql 数据库"; + this.checkBox4.UseVisualStyleBackColor = true; + this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged); + // + // comboBoxEdit2 + // + this.comboBoxEdit2.EditValue = "请选择要导入的软件名称"; + this.comboBoxEdit2.Location = new System.Drawing.Point(175, 37); + this.comboBoxEdit2.Name = "comboBoxEdit2"; + this.comboBoxEdit2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.comboBoxEdit2.Properties.Items.AddRange(new object[] { + "请选择要导入的软件名称", + "Alitools", + "安某尔", + "悠某", + "速某客", + "猎某", + "淘某喵", + "安某尔云控版"}); + this.comboBoxEdit2.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; + this.comboBoxEdit2.Size = new System.Drawing.Size(159, 20); + this.comboBoxEdit2.TabIndex = 23; + this.comboBoxEdit2.SelectedIndexChanged += new System.EventHandler(this.comboBoxEdit2_SelectedIndexChanged); + // + // label31 + // + this.label31.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(236)))), ((int)(((byte)(239))))); + this.label31.ForeColor = System.Drawing.Color.Blue; + this.label31.Location = new System.Drawing.Point(4, 274); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(694, 23); + this.label31.TabIndex = 22; + this.label31.Text = "状态"; + this.label31.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // progressBar1 + // + this.progressBar1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.progressBar1.Location = new System.Drawing.Point(2, 299); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(695, 33); + this.progressBar1.TabIndex = 21; + // + // comboBoxEdit1 + // + this.comboBoxEdit1.EditValue = "请选择机器人"; + this.comboBoxEdit1.Location = new System.Drawing.Point(175, 126); + this.comboBoxEdit1.Name = "comboBoxEdit1"; + this.comboBoxEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.comboBoxEdit1.Properties.Items.AddRange(new object[] { + "请选择机器人"}); + this.comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; + this.comboBoxEdit1.Size = new System.Drawing.Size(159, 20); + this.comboBoxEdit1.TabIndex = 20; + // + // comboBoxEdit3 + // + this.comboBoxEdit3.EditValue = "请选择机器人"; + this.comboBoxEdit3.Location = new System.Drawing.Point(175, 100); + this.comboBoxEdit3.Name = "comboBoxEdit3"; + this.comboBoxEdit3.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.comboBoxEdit3.Properties.Items.AddRange(new object[] { + "请选择机器人"}); + this.comboBoxEdit3.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; + this.comboBoxEdit3.Size = new System.Drawing.Size(159, 20); + this.comboBoxEdit3.TabIndex = 20; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(114, 161); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(55, 14); + this.label5.TabIndex = 16; + this.label5.Text = "数据库:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.ForeColor = System.Drawing.Color.Gray; + this.label3.Location = new System.Drawing.Point(81, 249); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(177, 14); + this.label3.TabIndex = 14; + this.label3.Text = "(同步订单前,请务必先同步订单)"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(102, 208); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(67, 14); + this.label1.TabIndex = 13; + this.label1.Text = "导入任务:"; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(327, 206); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(98, 18); + this.checkBox2.TabIndex = 12; + this.checkBox2.Text = "会员订单绑定"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(212, 206); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(98, 18); + this.checkBox1.TabIndex = 11; + this.checkBox1.Text = "会员数据同步"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // simpleButton2 + // + this.simpleButton2.Location = new System.Drawing.Point(271, 241); + this.simpleButton2.Name = "simpleButton2"; + this.simpleButton2.Size = new System.Drawing.Size(124, 30); + this.simpleButton2.TabIndex = 7; + this.simpleButton2.Text = "开始同步"; + this.simpleButton2.Click += new System.EventHandler(this.simpleButton2_Click); + // + // textEdit1 + // + this.textEdit1.Location = new System.Drawing.Point(175, 73); + this.textEdit1.Name = "textEdit1"; + this.textEdit1.Size = new System.Drawing.Size(159, 20); + this.textEdit1.TabIndex = 1; + this.textEdit1.EditValueChanged += new System.EventHandler(this.textEdit1_EditValueChanged); + // + // simpleButton1 + // + this.simpleButton1.Location = new System.Drawing.Point(351, 73); + this.simpleButton1.Name = "simpleButton1"; + this.simpleButton1.Size = new System.Drawing.Size(98, 20); + this.simpleButton1.TabIndex = 2; + this.simpleButton1.Text = "选择数据库"; + this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click); + // + // xtraTabPage7 + // + this.xtraTabPage7.AllowTouchScroll = true; + this.xtraTabPage7.Controls.Add(this.checkEdit1); + this.xtraTabPage7.Controls.Add(this.labelControl44); + this.xtraTabPage7.Controls.Add(this.dateTimePicker3); + this.xtraTabPage7.Controls.Add(this.dateTimePicker2); + this.xtraTabPage7.Controls.Add(this.labelControl24); + this.xtraTabPage7.Controls.Add(this.labelControl23); + this.xtraTabPage7.Controls.Add(this.labelControl43); + this.xtraTabPage7.Controls.Add(this.labelControl42); + this.xtraTabPage7.Controls.Add(this.labelControl39); + this.xtraTabPage7.Controls.Add(this.labelControl38); + this.xtraTabPage7.Controls.Add(this.labelControl22); + this.xtraTabPage7.Controls.Add(this.labelControl15); + this.xtraTabPage7.Controls.Add(this.checkBox16); + this.xtraTabPage7.Controls.Add(this.checkBox13); + this.xtraTabPage7.Controls.Add(this.checkBox10); + this.xtraTabPage7.Controls.Add(this.checkBox15); + this.xtraTabPage7.Controls.Add(this.checkBox14); + this.xtraTabPage7.Controls.Add(this.checkBox12); + this.xtraTabPage7.Controls.Add(this.checkBox11); + this.xtraTabPage7.Controls.Add(this.checkBox9); + this.xtraTabPage7.Controls.Add(this.labelControl18); + this.xtraTabPage7.Controls.Add(this.labelControl14); + this.xtraTabPage7.Controls.Add(this.checkBox8); + this.xtraTabPage7.Controls.Add(this.labelControl17); + this.xtraTabPage7.Controls.Add(this.labelControl12); + this.xtraTabPage7.Controls.Add(this.labelControl13); + this.xtraTabPage7.Controls.Add(this.labelControl8); + this.xtraTabPage7.Controls.Add(this.labelControl11); + this.xtraTabPage7.Controls.Add(this.labelControl16); + this.xtraTabPage7.Controls.Add(this.labelControl10); + this.xtraTabPage7.Controls.Add(this.labelControl9); + this.xtraTabPage7.Controls.Add(this.labelControl21); + this.xtraTabPage7.Controls.Add(this.labelControl20); + this.xtraTabPage7.Controls.Add(this.labelControl19); + this.xtraTabPage7.Controls.Add(this.labelControl7); + this.xtraTabPage7.Controls.Add(this.memoEdit3); + this.xtraTabPage7.Controls.Add(this.checkBox5); + this.xtraTabPage7.Controls.Add(this.separatorControl2); + this.xtraTabPage7.Controls.Add(this.separatorControl1); + this.xtraTabPage7.Controls.Add(this.label29); + this.xtraTabPage7.Controls.Add(this.label28); + this.xtraTabPage7.Controls.Add(this.label30); + this.xtraTabPage7.Controls.Add(this.textBox6); + this.xtraTabPage7.Controls.Add(this.textBox5); + this.xtraTabPage7.Controls.Add(this.textBox2); + this.xtraTabPage7.Controls.Add(this.textBox1); + this.xtraTabPage7.Controls.Add(this.textBox4); + this.xtraTabPage7.Controls.Add(this.textBox3); + this.xtraTabPage7.Controls.Add(this.button3); + this.xtraTabPage7.Controls.Add(this.button4); + this.xtraTabPage7.Controls.Add(this.button1); + this.xtraTabPage7.Controls.Add(this.button2); + this.xtraTabPage7.Name = "xtraTabPage7"; + this.xtraTabPage7.Size = new System.Drawing.Size(769, 379); + this.xtraTabPage7.Text = " E C O 数据导入 "; + // + // checkEdit1 + // + this.checkEdit1.Location = new System.Drawing.Point(35, 208); + this.checkEdit1.Name = "checkEdit1"; + this.checkEdit1.Properties.Caption = "绑定订单时间区间:"; + this.checkEdit1.Size = new System.Drawing.Size(147, 20); + this.checkEdit1.TabIndex = 24; + // + // labelControl44 + // + this.labelControl44.Location = new System.Drawing.Point(354, 210); + this.labelControl44.Name = "labelControl44"; + this.labelControl44.Size = new System.Drawing.Size(12, 14); + this.labelControl44.TabIndex = 23; + this.labelControl44.Text = " - "; + // + // dateTimePicker3 + // + this.dateTimePicker3.CustomFormat = "yyyy-MM-dd HH:mm:ss"; + this.dateTimePicker3.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimePicker3.Location = new System.Drawing.Point(372, 206); + this.dateTimePicker3.Name = "dateTimePicker3"; + this.dateTimePicker3.Size = new System.Drawing.Size(160, 22); + this.dateTimePicker3.TabIndex = 22; + // + // dateTimePicker2 + // + this.dateTimePicker2.CustomFormat = "yyyy-MM-dd HH:mm:ss"; + this.dateTimePicker2.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimePicker2.Location = new System.Drawing.Point(188, 206); + this.dateTimePicker2.Name = "dateTimePicker2"; + this.dateTimePicker2.Size = new System.Drawing.Size(160, 22); + this.dateTimePicker2.TabIndex = 22; + // + // labelControl24 + // + this.labelControl24.Location = new System.Drawing.Point(23, 177); + this.labelControl24.Name = "labelControl24"; + this.labelControl24.Size = new System.Drawing.Size(96, 14); + this.labelControl24.TabIndex = 21; + this.labelControl24.Text = "拼多多订单绑定:"; + // + // labelControl23 + // + this.labelControl23.Location = new System.Drawing.Point(35, 153); + this.labelControl23.Name = "labelControl23"; + this.labelControl23.Size = new System.Drawing.Size(84, 14); + this.labelControl23.TabIndex = 21; + this.labelControl23.Text = "京东订单绑定:"; + // + // labelControl43 + // + this.labelControl43.Location = new System.Drawing.Point(540, 43); + this.labelControl43.Name = "labelControl43"; + this.labelControl43.Size = new System.Drawing.Size(65, 14); + this.labelControl43.TabIndex = 21; + this.labelControl43.Text = "username:"; + // + // labelControl42 + // + this.labelControl42.Location = new System.Drawing.Point(384, 43); + this.labelControl42.Name = "labelControl42"; + this.labelControl42.Size = new System.Drawing.Size(44, 14); + this.labelControl42.TabIndex = 21; + this.labelControl42.Text = "token:"; + // + // labelControl39 + // + this.labelControl39.Location = new System.Drawing.Point(216, 43); + this.labelControl39.Name = "labelControl39"; + this.labelControl39.Size = new System.Drawing.Size(44, 14); + this.labelControl39.TabIndex = 21; + this.labelControl39.Text = "Single:"; + // + // labelControl38 + // + this.labelControl38.Location = new System.Drawing.Point(19, 43); + this.labelControl38.Name = "labelControl38"; + this.labelControl38.Size = new System.Drawing.Size(43, 14); + this.labelControl38.TabIndex = 21; + this.labelControl38.Text = "Name:"; + // + // labelControl22 + // + this.labelControl22.Location = new System.Drawing.Point(35, 129); + this.labelControl22.Name = "labelControl22"; + this.labelControl22.Size = new System.Drawing.Size(84, 14); + this.labelControl22.TabIndex = 21; + this.labelControl22.Text = "淘宝订单绑定:"; + // + // labelControl15 + // + this.labelControl15.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl15.Appearance.Options.UseForeColor = true; + this.labelControl15.Location = new System.Drawing.Point(30, 21); + this.labelControl15.Name = "labelControl15"; + this.labelControl15.Size = new System.Drawing.Size(95, 14); + this.labelControl15.TabIndex = 20; + this.labelControl15.Text = "一、ECO身份数据"; + // + // checkBox16 + // + this.checkBox16.AutoSize = true; + this.checkBox16.Location = new System.Drawing.Point(466, 175); + this.checkBox16.Name = "checkBox16"; + this.checkBox16.Size = new System.Drawing.Size(234, 18); + this.checkBox16.TabIndex = 19; + this.checkBox16.Text = "1000条以外未失效以及没有绑定的订单"; + this.checkBox16.UseVisualStyleBackColor = true; + // + // checkBox13 + // + this.checkBox13.AutoSize = true; + this.checkBox13.Location = new System.Drawing.Point(466, 151); + this.checkBox13.Name = "checkBox13"; + this.checkBox13.Size = new System.Drawing.Size(234, 18); + this.checkBox13.TabIndex = 19; + this.checkBox13.Text = "1000条以外未失效以及没有绑定的订单"; + this.checkBox13.UseVisualStyleBackColor = true; + // + // checkBox10 + // + this.checkBox10.AutoSize = true; + this.checkBox10.Location = new System.Drawing.Point(466, 127); + this.checkBox10.Name = "checkBox10"; + this.checkBox10.Size = new System.Drawing.Size(234, 18); + this.checkBox10.TabIndex = 19; + this.checkBox10.Text = "1000条以外未失效以及没有绑定的订单"; + this.checkBox10.UseVisualStyleBackColor = true; + // + // checkBox15 + // + this.checkBox15.AutoSize = true; + this.checkBox15.Location = new System.Drawing.Point(302, 175); + this.checkBox15.Name = "checkBox15"; + this.checkBox15.Size = new System.Drawing.Size(160, 18); + this.checkBox15.TabIndex = 19; + this.checkBox15.Text = "未结算(最近1000条数据)"; + this.checkBox15.UseVisualStyleBackColor = true; + // + // checkBox14 + // + this.checkBox14.AutoSize = true; + this.checkBox14.Location = new System.Drawing.Point(140, 175); + this.checkBox14.Name = "checkBox14"; + this.checkBox14.Size = new System.Drawing.Size(160, 18); + this.checkBox14.TabIndex = 19; + this.checkBox14.Text = "已结算(最近1000条数据)"; + this.checkBox14.UseVisualStyleBackColor = true; + // + // checkBox12 + // + this.checkBox12.AutoSize = true; + this.checkBox12.Location = new System.Drawing.Point(302, 151); + this.checkBox12.Name = "checkBox12"; + this.checkBox12.Size = new System.Drawing.Size(160, 18); + this.checkBox12.TabIndex = 19; + this.checkBox12.Text = "未结算(最近1000条数据)"; + this.checkBox12.UseVisualStyleBackColor = true; + // + // checkBox11 + // + this.checkBox11.AutoSize = true; + this.checkBox11.Location = new System.Drawing.Point(140, 151); + this.checkBox11.Name = "checkBox11"; + this.checkBox11.Size = new System.Drawing.Size(160, 18); + this.checkBox11.TabIndex = 19; + this.checkBox11.Text = "已结算(最近1000条数据)"; + this.checkBox11.UseVisualStyleBackColor = true; + // + // checkBox9 + // + this.checkBox9.AutoSize = true; + this.checkBox9.Location = new System.Drawing.Point(302, 127); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(160, 18); + this.checkBox9.TabIndex = 19; + this.checkBox9.Text = "未结算(最近1000条数据)"; + this.checkBox9.UseVisualStyleBackColor = true; + // + // labelControl18 + // + this.labelControl18.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl18.Appearance.Options.UseForeColor = true; + this.labelControl18.Location = new System.Drawing.Point(696, 177); + this.labelControl18.Name = "labelControl18"; + this.labelControl18.Size = new System.Drawing.Size(36, 14); + this.labelControl18.TabIndex = 18; + this.labelControl18.Text = "【慢】"; + // + // labelControl14 + // + this.labelControl14.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl14.Appearance.Options.UseForeColor = true; + this.labelControl14.Location = new System.Drawing.Point(736, 177); + this.labelControl14.Name = "labelControl14"; + this.labelControl14.Size = new System.Drawing.Size(5, 14); + this.labelControl14.TabIndex = 18; + this.labelControl14.Text = ")"; + // + // checkBox8 + // + this.checkBox8.AutoSize = true; + this.checkBox8.Location = new System.Drawing.Point(140, 127); + this.checkBox8.Name = "checkBox8"; + this.checkBox8.Size = new System.Drawing.Size(160, 18); + this.checkBox8.TabIndex = 19; + this.checkBox8.Text = "已结算(最近1000条数据)"; + this.checkBox8.UseVisualStyleBackColor = true; + // + // labelControl17 + // + this.labelControl17.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl17.Appearance.Options.UseForeColor = true; + this.labelControl17.Location = new System.Drawing.Point(696, 153); + this.labelControl17.Name = "labelControl17"; + this.labelControl17.Size = new System.Drawing.Size(36, 14); + this.labelControl17.TabIndex = 18; + this.labelControl17.Text = "【慢】"; + // + // labelControl12 + // + this.labelControl12.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl12.Appearance.Options.UseForeColor = true; + this.labelControl12.Location = new System.Drawing.Point(736, 153); + this.labelControl12.Name = "labelControl12"; + this.labelControl12.Size = new System.Drawing.Size(5, 14); + this.labelControl12.TabIndex = 18; + this.labelControl12.Text = ")"; + // + // labelControl13 + // + this.labelControl13.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl13.Appearance.Options.UseForeColor = true; + this.labelControl13.Location = new System.Drawing.Point(129, 177); + this.labelControl13.Name = "labelControl13"; + this.labelControl13.Size = new System.Drawing.Size(5, 14); + this.labelControl13.TabIndex = 18; + this.labelControl13.Text = "("; + // + // labelControl8 + // + this.labelControl8.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl8.Appearance.Options.UseForeColor = true; + this.labelControl8.Location = new System.Drawing.Point(582, 129); + this.labelControl8.Name = "labelControl8"; + this.labelControl8.Size = new System.Drawing.Size(0, 14); + this.labelControl8.TabIndex = 18; + // + // labelControl11 + // + this.labelControl11.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl11.Appearance.Options.UseForeColor = true; + this.labelControl11.Location = new System.Drawing.Point(129, 153); + this.labelControl11.Name = "labelControl11"; + this.labelControl11.Size = new System.Drawing.Size(5, 14); + this.labelControl11.TabIndex = 18; + this.labelControl11.Text = "("; + // + // labelControl16 + // + this.labelControl16.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl16.Appearance.Options.UseForeColor = true; + this.labelControl16.Location = new System.Drawing.Point(696, 129); + this.labelControl16.Name = "labelControl16"; + this.labelControl16.Size = new System.Drawing.Size(36, 14); + this.labelControl16.TabIndex = 18; + this.labelControl16.Text = "【慢】"; + // + // labelControl10 + // + this.labelControl10.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl10.Appearance.Options.UseForeColor = true; + this.labelControl10.Location = new System.Drawing.Point(736, 129); + this.labelControl10.Name = "labelControl10"; + this.labelControl10.Size = new System.Drawing.Size(5, 14); + this.labelControl10.TabIndex = 18; + this.labelControl10.Text = ")"; + // + // labelControl9 + // + this.labelControl9.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl9.Appearance.Options.UseForeColor = true; + this.labelControl9.Location = new System.Drawing.Point(129, 129); + this.labelControl9.Name = "labelControl9"; + this.labelControl9.Size = new System.Drawing.Size(5, 14); + this.labelControl9.TabIndex = 18; + this.labelControl9.Text = "("; + // + // labelControl21 + // + this.labelControl21.Appearance.Font = new System.Drawing.Font("Tahoma", 16F); + this.labelControl21.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl21.Appearance.Options.UseFont = true; + this.labelControl21.Appearance.Options.UseForeColor = true; + this.labelControl21.Location = new System.Drawing.Point(108, 63); + this.labelControl21.Name = "labelControl21"; + this.labelControl21.Size = new System.Drawing.Size(21, 25); + this.labelControl21.TabIndex = 18; + this.labelControl21.Text = "③"; + // + // labelControl20 + // + this.labelControl20.Appearance.Font = new System.Drawing.Font("Tahoma", 16F); + this.labelControl20.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl20.Appearance.Options.UseFont = true; + this.labelControl20.Appearance.Options.UseForeColor = true; + this.labelControl20.Location = new System.Drawing.Point(728, -2); + this.labelControl20.Name = "labelControl20"; + this.labelControl20.Size = new System.Drawing.Size(21, 25); + this.labelControl20.TabIndex = 18; + this.labelControl20.Text = "②"; + this.labelControl20.Visible = false; + // + // labelControl19 + // + this.labelControl19.Appearance.Font = new System.Drawing.Font("Tahoma", 16F); + this.labelControl19.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl19.Appearance.Options.UseFont = true; + this.labelControl19.Appearance.Options.UseForeColor = true; + this.labelControl19.Location = new System.Drawing.Point(139, 12); + this.labelControl19.Name = "labelControl19"; + this.labelControl19.Size = new System.Drawing.Size(21, 25); + this.labelControl19.TabIndex = 18; + this.labelControl19.Text = "①"; + // + // labelControl7 + // + this.labelControl7.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl7.Appearance.Options.UseForeColor = true; + this.labelControl7.Location = new System.Drawing.Point(139, 99); + this.labelControl7.Name = "labelControl7"; + this.labelControl7.Size = new System.Drawing.Size(278, 14); + this.labelControl7.TabIndex = 18; + this.labelControl7.Text = "(切记用户数据千万不要重复导入,只需导入一次即可)"; + // + // memoEdit3 + // + this.memoEdit3.Location = new System.Drawing.Point(13, 252); + this.memoEdit3.Name = "memoEdit3"; + this.memoEdit3.Size = new System.Drawing.Size(730, 111); + this.memoEdit3.TabIndex = 17; + // + // checkBox5 + // + this.checkBox5.AutoSize = true; + this.checkBox5.Location = new System.Drawing.Point(33, 98); + this.checkBox5.Name = "checkBox5"; + this.checkBox5.Size = new System.Drawing.Size(98, 18); + this.checkBox5.TabIndex = 14; + this.checkBox5.Text = "会员数据同步"; + this.checkBox5.UseVisualStyleBackColor = true; + // + // separatorControl2 + // + this.separatorControl2.Location = new System.Drawing.Point(140, 70); + this.separatorControl2.Name = "separatorControl2"; + this.separatorControl2.Size = new System.Drawing.Size(467, 26); + this.separatorControl2.TabIndex = 4; + // + // separatorControl1 + // + this.separatorControl1.Location = new System.Drawing.Point(3, 234); + this.separatorControl1.Name = "separatorControl1"; + this.separatorControl1.Size = new System.Drawing.Size(759, 23); + this.separatorControl1.TabIndex = 3; + // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(184, 4); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(78, 14); + this.label29.TabIndex = 2; + this.label29.Text = "ECO手机号:"; + this.label29.Visible = false; + // + // label28 + // + this.label28.AutoSize = true; + this.label28.Location = new System.Drawing.Point(499, 4); + this.label28.Name = "label28"; + this.label28.Size = new System.Drawing.Size(78, 14); + this.label28.TabIndex = 2; + this.label28.Text = "ECO验证码:"; + this.label28.Visible = false; + // + // label30 + // + this.label30.AutoSize = true; + this.label30.ForeColor = System.Drawing.Color.Blue; + this.label30.Location = new System.Drawing.Point(27, 70); + this.label30.Name = "label30"; + this.label30.Size = new System.Drawing.Size(214, 14); + this.label30.TabIndex = 2; + this.label30.Text = "二、ECO导入 "; + // + // textBox6 + // + this.textBox6.Location = new System.Drawing.Point(608, 39); + this.textBox6.Name = "textBox6"; + this.textBox6.Size = new System.Drawing.Size(86, 22); + this.textBox6.TabIndex = 1; + // + // textBox5 + // + this.textBox5.Location = new System.Drawing.Point(431, 39); + this.textBox5.Name = "textBox5"; + this.textBox5.Size = new System.Drawing.Size(99, 22); + this.textBox5.TabIndex = 1; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(271, 39); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(105, 22); + this.textBox2.TabIndex = 1; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(76, 40); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(133, 22); + this.textBox1.TabIndex = 1; + // + // textBox4 + // + this.textBox4.Location = new System.Drawing.Point(264, 0); + this.textBox4.Name = "textBox4"; + this.textBox4.Size = new System.Drawing.Size(125, 22); + this.textBox4.TabIndex = 1; + this.textBox4.Visible = false; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(579, 0); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(75, 22); + this.textBox3.TabIndex = 1; + this.textBox3.Visible = false; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(644, 202); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(99, 33); + this.button3.TabIndex = 0; + this.button3.Text = " 开 始 导 入 "; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button4 + // + this.button4.Location = new System.Drawing.Point(394, 0); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(75, 23); + this.button4.TabIndex = 0; + this.button4.Text = " 获取验证码 "; + this.button4.UseVisualStyleBackColor = true; + this.button4.Visible = false; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(698, 40); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(64, 23); + this.button1.TabIndex = 0; + this.button1.Text = " 确 认 "; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button2_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(658, 0); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(64, 23); + this.button2.TabIndex = 0; + this.button2.Text = " 确 认 "; + this.button2.UseVisualStyleBackColor = true; + this.button2.Visible = false; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // xtraTabPage10 + // + this.xtraTabPage10.Controls.Add(this.checkBox31); + this.xtraTabPage10.Controls.Add(this.checkBox30); + this.xtraTabPage10.Controls.Add(this.checkBox25); + this.xtraTabPage10.Controls.Add(this.checkBox29); + this.xtraTabPage10.Controls.Add(this.checkBox24); + this.xtraTabPage10.Controls.Add(this.checkBox28); + this.xtraTabPage10.Controls.Add(this.checkBox23); + this.xtraTabPage10.Controls.Add(this.checkBox27); + this.xtraTabPage10.Controls.Add(this.checkBox22); + this.xtraTabPage10.Controls.Add(this.checkBox26); + this.xtraTabPage10.Controls.Add(this.checkBox21); + this.xtraTabPage10.Controls.Add(this.separatorControl8); + this.xtraTabPage10.Controls.Add(this.label27); + this.xtraTabPage10.Controls.Add(this.memoEdit5); + this.xtraTabPage10.Controls.Add(this.separatorControl7); + this.xtraTabPage10.Controls.Add(this.button7); + this.xtraTabPage10.Controls.Add(this.checkBox20); + this.xtraTabPage10.Controls.Add(this.separatorControl6); + this.xtraTabPage10.Controls.Add(this.label26); + this.xtraTabPage10.Controls.Add(this.labelControl58); + this.xtraTabPage10.Controls.Add(this.textBox8); + this.xtraTabPage10.Controls.Add(this.labelControl54); + this.xtraTabPage10.Name = "xtraTabPage10"; + this.xtraTabPage10.Size = new System.Drawing.Size(769, 379); + this.xtraTabPage10.Text = " 速 某 客 云 端 据 导 入 "; + // + // checkBox30 + // + this.checkBox30.AutoSize = true; + this.checkBox30.Location = new System.Drawing.Point(471, 182); + this.checkBox30.Name = "checkBox30"; + this.checkBox30.Size = new System.Drawing.Size(122, 18); + this.checkBox30.TabIndex = 33; + this.checkBox30.Text = "同步抖音订单绑定"; + this.checkBox30.UseVisualStyleBackColor = true; + this.checkBox30.Visible = false; + // + // checkBox25 + // + this.checkBox25.AutoSize = true; + this.checkBox25.Location = new System.Drawing.Point(170, 182); + this.checkBox25.Name = "checkBox25"; + this.checkBox25.Size = new System.Drawing.Size(122, 18); + this.checkBox25.TabIndex = 33; + this.checkBox25.Text = "同步抖音订单绑定"; + this.checkBox25.UseVisualStyleBackColor = true; + // + // checkBox29 + // + this.checkBox29.AutoSize = true; + this.checkBox29.Location = new System.Drawing.Point(471, 158); + this.checkBox29.Name = "checkBox29"; + this.checkBox29.Size = new System.Drawing.Size(134, 18); + this.checkBox29.TabIndex = 33; + this.checkBox29.Text = "同步唯品会订单绑定"; + this.checkBox29.UseVisualStyleBackColor = true; + this.checkBox29.Visible = false; + // + // checkBox24 + // + this.checkBox24.AutoSize = true; + this.checkBox24.Location = new System.Drawing.Point(170, 158); + this.checkBox24.Name = "checkBox24"; + this.checkBox24.Size = new System.Drawing.Size(134, 18); + this.checkBox24.TabIndex = 33; + this.checkBox24.Text = "同步唯品会订单绑定"; + this.checkBox24.UseVisualStyleBackColor = true; + // + // checkBox28 + // + this.checkBox28.AutoSize = true; + this.checkBox28.Location = new System.Drawing.Point(329, 206); + this.checkBox28.Name = "checkBox28"; + this.checkBox28.Size = new System.Drawing.Size(134, 18); + this.checkBox28.TabIndex = 33; + this.checkBox28.Text = "同步拼多多订单绑定"; + this.checkBox28.UseVisualStyleBackColor = true; + this.checkBox28.Visible = false; + // + // checkBox23 + // + this.checkBox23.AutoSize = true; + this.checkBox23.Location = new System.Drawing.Point(28, 206); + this.checkBox23.Name = "checkBox23"; + this.checkBox23.Size = new System.Drawing.Size(134, 18); + this.checkBox23.TabIndex = 33; + this.checkBox23.Text = "同步拼多多订单绑定"; + this.checkBox23.UseVisualStyleBackColor = true; + // + // checkBox27 + // + this.checkBox27.AutoSize = true; + this.checkBox27.Location = new System.Drawing.Point(329, 182); + this.checkBox27.Name = "checkBox27"; + this.checkBox27.Size = new System.Drawing.Size(122, 18); + this.checkBox27.TabIndex = 33; + this.checkBox27.Text = "同步京东订单绑定"; + this.checkBox27.UseVisualStyleBackColor = true; + this.checkBox27.Visible = false; + // + // checkBox22 + // + this.checkBox22.AutoSize = true; + this.checkBox22.Location = new System.Drawing.Point(28, 182); + this.checkBox22.Name = "checkBox22"; + this.checkBox22.Size = new System.Drawing.Size(122, 18); + this.checkBox22.TabIndex = 33; + this.checkBox22.Text = "同步京东订单绑定"; + this.checkBox22.UseVisualStyleBackColor = true; + // + // checkBox26 + // + this.checkBox26.AutoSize = true; + this.checkBox26.Location = new System.Drawing.Point(329, 158); + this.checkBox26.Name = "checkBox26"; + this.checkBox26.Size = new System.Drawing.Size(122, 18); + this.checkBox26.TabIndex = 33; + this.checkBox26.Text = "同步淘宝订单绑定"; + this.checkBox26.UseVisualStyleBackColor = true; + this.checkBox26.Visible = false; + // + // checkBox21 + // + this.checkBox21.AutoSize = true; + this.checkBox21.Location = new System.Drawing.Point(28, 158); + this.checkBox21.Name = "checkBox21"; + this.checkBox21.Size = new System.Drawing.Size(122, 18); + this.checkBox21.TabIndex = 33; + this.checkBox21.Text = "同步淘宝订单绑定"; + this.checkBox21.UseVisualStyleBackColor = true; + // + // separatorControl8 + // + this.separatorControl8.Location = new System.Drawing.Point(135, 127); + this.separatorControl8.Name = "separatorControl8"; + this.separatorControl8.Size = new System.Drawing.Size(467, 26); + this.separatorControl8.TabIndex = 32; + // + // label27 + // + this.label27.AutoSize = true; + this.label27.ForeColor = System.Drawing.Color.Blue; + this.label27.Location = new System.Drawing.Point(25, 132); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(239, 14); + this.label27.TabIndex = 31; + this.label27.Text = "二、订单用户绑定 "; + // + // memoEdit5 + // + this.memoEdit5.Location = new System.Drawing.Point(20, 253); + this.memoEdit5.Name = "memoEdit5"; + this.memoEdit5.Size = new System.Drawing.Size(730, 111); + this.memoEdit5.TabIndex = 30; + // + // separatorControl7 + // + this.separatorControl7.Location = new System.Drawing.Point(10, 235); + this.separatorControl7.Name = "separatorControl7"; + this.separatorControl7.Size = new System.Drawing.Size(759, 23); + this.separatorControl7.TabIndex = 29; + // + // button7 + // + this.button7.Location = new System.Drawing.Point(651, 203); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(99, 33); + this.button7.TabIndex = 28; + this.button7.Text = " 开 始 导 入 "; + this.button7.UseVisualStyleBackColor = true; + this.button7.Click += new System.EventHandler(this.button7_Click); + // + // checkBox20 + // + this.checkBox20.AutoSize = true; + this.checkBox20.Location = new System.Drawing.Point(28, 94); + this.checkBox20.Name = "checkBox20"; + this.checkBox20.Size = new System.Drawing.Size(98, 18); + this.checkBox20.TabIndex = 27; + this.checkBox20.Text = "会员数据同步"; + this.checkBox20.UseVisualStyleBackColor = true; + // + // separatorControl6 + // + this.separatorControl6.Location = new System.Drawing.Point(135, 63); + this.separatorControl6.Name = "separatorControl6"; + this.separatorControl6.Size = new System.Drawing.Size(467, 26); + this.separatorControl6.TabIndex = 26; + // + // label26 + // + this.label26.AutoSize = true; + this.label26.ForeColor = System.Drawing.Color.Blue; + this.label26.Location = new System.Drawing.Point(25, 68); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(215, 14); + this.label26.TabIndex = 25; + this.label26.Text = "二、用户导入 "; + // + // labelControl58 + // + this.labelControl58.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl58.Appearance.Options.UseForeColor = true; + this.labelControl58.Location = new System.Drawing.Point(136, 96); + this.labelControl58.Name = "labelControl58"; + this.labelControl58.Size = new System.Drawing.Size(278, 14); + this.labelControl58.TabIndex = 24; + this.labelControl58.Text = "(切记用户数据千万不要重复导入,只需导入一次即可)"; + // + // textBox8 + // + this.textBox8.Location = new System.Drawing.Point(135, 19); + this.textBox8.Name = "textBox8"; + this.textBox8.Size = new System.Drawing.Size(615, 22); + this.textBox8.TabIndex = 22; + // + // labelControl54 + // + this.labelControl54.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl54.Appearance.Options.UseForeColor = true; + this.labelControl54.Location = new System.Drawing.Point(28, 22); + this.labelControl54.Name = "labelControl54"; + this.labelControl54.Size = new System.Drawing.Size(74, 14); + this.labelControl54.TabIndex = 21; + this.labelControl54.Text = "一、速某客CK"; + // + // xtraTabPage9 + // + this.xtraTabPage9.Controls.Add(this.labelControl52); + this.xtraTabPage9.Controls.Add(this.labelControl51); + this.xtraTabPage9.Controls.Add(this.labelControl53); + this.xtraTabPage9.Controls.Add(this.labelControl55); + this.xtraTabPage9.Controls.Add(this.checkBox7); + this.xtraTabPage9.Controls.Add(this.checkBox17); + this.xtraTabPage9.Controls.Add(this.checkBox18); + this.xtraTabPage9.Controls.Add(this.labelControl56); + this.xtraTabPage9.Controls.Add(this.memoEdit4); + this.xtraTabPage9.Controls.Add(this.checkBox19); + this.xtraTabPage9.Controls.Add(this.separatorControl4); + this.xtraTabPage9.Controls.Add(this.separatorControl5); + this.xtraTabPage9.Controls.Add(this.label24); + this.xtraTabPage9.Controls.Add(this.textBox7); + this.xtraTabPage9.Controls.Add(this.button5); + this.xtraTabPage9.Controls.Add(this.button6); + this.xtraTabPage9.Name = "xtraTabPage9"; + this.xtraTabPage9.PageEnabled = false; + this.xtraTabPage9.Size = new System.Drawing.Size(769, 379); + this.xtraTabPage9.Text = " 念 初 数 据 导 入 "; + // + // labelControl52 + // + this.labelControl52.Location = new System.Drawing.Point(73, 130); + this.labelControl52.Name = "labelControl52"; + this.labelControl52.Size = new System.Drawing.Size(84, 14); + this.labelControl52.TabIndex = 37; + this.labelControl52.Text = "绑定用户订单:"; + // + // labelControl51 + // + this.labelControl51.Location = new System.Drawing.Point(73, 97); + this.labelControl51.Name = "labelControl51"; + this.labelControl51.Size = new System.Drawing.Size(84, 14); + this.labelControl51.TabIndex = 37; + this.labelControl51.Text = "同步会员数据:"; + // + // labelControl53 + // + this.labelControl53.Location = new System.Drawing.Point(42, 41); + this.labelControl53.Name = "labelControl53"; + this.labelControl53.Size = new System.Drawing.Size(47, 14); + this.labelControl53.TabIndex = 36; + this.labelControl53.Text = "Token:"; + // + // labelControl55 + // + this.labelControl55.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl55.Appearance.Options.UseForeColor = true; + this.labelControl55.Location = new System.Drawing.Point(32, 17); + this.labelControl55.Name = "labelControl55"; + this.labelControl55.Size = new System.Drawing.Size(96, 14); + this.labelControl55.TabIndex = 34; + this.labelControl55.Text = "一、念初身份数据"; + // + // checkBox7 + // + this.checkBox7.AutoSize = true; + this.checkBox7.Location = new System.Drawing.Point(415, 128); + this.checkBox7.Name = "checkBox7"; + this.checkBox7.Size = new System.Drawing.Size(110, 18); + this.checkBox7.TabIndex = 32; + this.checkBox7.Text = "拼多多订单绑定"; + this.checkBox7.UseVisualStyleBackColor = true; + // + // checkBox17 + // + this.checkBox17.AutoSize = true; + this.checkBox17.Location = new System.Drawing.Point(288, 128); + this.checkBox17.Name = "checkBox17"; + this.checkBox17.Size = new System.Drawing.Size(98, 18); + this.checkBox17.TabIndex = 31; + this.checkBox17.Text = "京东订单绑定"; + this.checkBox17.UseVisualStyleBackColor = true; + // + // checkBox18 + // + this.checkBox18.AutoSize = true; + this.checkBox18.Location = new System.Drawing.Point(166, 128); + this.checkBox18.Name = "checkBox18"; + this.checkBox18.Size = new System.Drawing.Size(98, 18); + this.checkBox18.TabIndex = 33; + this.checkBox18.Text = "淘宝订单绑定"; + this.checkBox18.UseVisualStyleBackColor = true; + // + // labelControl56 + // + this.labelControl56.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl56.Appearance.Options.UseForeColor = true; + this.labelControl56.Location = new System.Drawing.Point(270, 97); + this.labelControl56.Name = "labelControl56"; + this.labelControl56.Size = new System.Drawing.Size(278, 14); + this.labelControl56.TabIndex = 30; + this.labelControl56.Text = "(切记用户数据千万不要重复导入,只需导入一次即可)"; + // + // memoEdit4 + // + this.memoEdit4.Location = new System.Drawing.Point(17, 179); + this.memoEdit4.Name = "memoEdit4"; + this.memoEdit4.Size = new System.Drawing.Size(730, 183); + this.memoEdit4.TabIndex = 29; + // + // checkBox19 + // + this.checkBox19.AutoSize = true; + this.checkBox19.Location = new System.Drawing.Point(166, 95); + this.checkBox19.Name = "checkBox19"; + this.checkBox19.Size = new System.Drawing.Size(98, 18); + this.checkBox19.TabIndex = 28; + this.checkBox19.Text = "会员数据同步"; + this.checkBox19.UseVisualStyleBackColor = true; + // + // separatorControl4 + // + this.separatorControl4.Location = new System.Drawing.Point(108, 65); + this.separatorControl4.Name = "separatorControl4"; + this.separatorControl4.Size = new System.Drawing.Size(557, 26); + this.separatorControl4.TabIndex = 27; + // + // separatorControl5 + // + this.separatorControl5.Location = new System.Drawing.Point(7, 150); + this.separatorControl5.Name = "separatorControl5"; + this.separatorControl5.Size = new System.Drawing.Size(759, 23); + this.separatorControl5.TabIndex = 26; + // + // label24 + // + this.label24.AutoSize = true; + this.label24.ForeColor = System.Drawing.Color.Blue; + this.label24.Location = new System.Drawing.Point(29, 71); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(215, 14); + this.label24.TabIndex = 25; + this.label24.Text = "二、念初导入 "; + // + // textBox7 + // + this.textBox7.Location = new System.Drawing.Point(91, 37); + this.textBox7.Name = "textBox7"; + this.textBox7.Size = new System.Drawing.Size(531, 22); + this.textBox7.TabIndex = 24; + // + // button5 + // + this.button5.Location = new System.Drawing.Point(628, 113); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(119, 33); + this.button5.TabIndex = 23; + this.button5.Text = " 开 始 导 入 "; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // button6 + // + this.button6.Location = new System.Drawing.Point(628, 37); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(119, 23); + this.button6.TabIndex = 22; + this.button6.Text = " 验 证 有 效 性 "; + this.button6.UseVisualStyleBackColor = true; + this.button6.Click += new System.EventHandler(this.button6_Click); + // + // xtraTabPage8 + // + this.xtraTabPage8.Controls.Add(this.labelControl50); + this.xtraTabPage8.Controls.Add(this.labelControl49); + this.xtraTabPage8.Controls.Add(this.labelControl48); + this.xtraTabPage8.Controls.Add(this.simpleButton16); + this.xtraTabPage8.Controls.Add(this.simpleButton15); + this.xtraTabPage8.Controls.Add(this.separatorControl3); + this.xtraTabPage8.Controls.Add(this.label6); + this.xtraTabPage8.Controls.Add(this.progressBar3); + this.xtraTabPage8.Controls.Add(this.labelControl46); + this.xtraTabPage8.Controls.Add(this.labelControl47); + this.xtraTabPage8.Controls.Add(this.labelControl45); + this.xtraTabPage8.Controls.Add(this.simpleButton12); + this.xtraTabPage8.Name = "xtraTabPage8"; + this.xtraTabPage8.Size = new System.Drawing.Size(769, 379); + this.xtraTabPage8.Text = " 其 他 辅 助 工 具 "; + // + // labelControl50 + // + this.labelControl50.Appearance.Font = new System.Drawing.Font("Tahoma", 14F); + this.labelControl50.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl50.Appearance.Options.UseFont = true; + this.labelControl50.Appearance.Options.UseForeColor = true; + this.labelControl50.Location = new System.Drawing.Point(630, 95); + this.labelControl50.Name = "labelControl50"; + this.labelControl50.Size = new System.Drawing.Size(19, 23); + this.labelControl50.TabIndex = 27; + this.labelControl50.Text = "②"; + // + // labelControl49 + // + this.labelControl49.Appearance.Font = new System.Drawing.Font("Tahoma", 14F); + this.labelControl49.Appearance.ForeColor = System.Drawing.Color.Blue; + this.labelControl49.Appearance.Options.UseFont = true; + this.labelControl49.Appearance.Options.UseForeColor = true; + this.labelControl49.Location = new System.Drawing.Point(429, 95); + this.labelControl49.Name = "labelControl49"; + this.labelControl49.Size = new System.Drawing.Size(19, 23); + this.labelControl49.TabIndex = 27; + this.labelControl49.Text = "①"; + // + // labelControl48 + // + this.labelControl48.Appearance.ForeColor = System.Drawing.Color.Black; + this.labelControl48.Appearance.Options.UseForeColor = true; + this.labelControl48.Location = new System.Drawing.Point(560, 99); + this.labelControl48.Name = "labelControl48"; + this.labelControl48.Size = new System.Drawing.Size(36, 14); + this.labelControl48.TabIndex = 27; + this.labelControl48.Text = "无设置"; + // + // simpleButton16 + // + this.simpleButton16.Location = new System.Drawing.Point(652, 87); + this.simpleButton16.Name = "simpleButton16"; + this.simpleButton16.Size = new System.Drawing.Size(103, 38); + this.simpleButton16.TabIndex = 26; + this.simpleButton16.Text = "一键设置"; + this.simpleButton16.Click += new System.EventHandler(this.simpleButton16_Click); + // + // simpleButton15 + // + this.simpleButton15.Location = new System.Drawing.Point(451, 87); + this.simpleButton15.Name = "simpleButton15"; + this.simpleButton15.Size = new System.Drawing.Size(103, 38); + this.simpleButton15.TabIndex = 26; + this.simpleButton15.Text = "修改数据"; + this.simpleButton15.Click += new System.EventHandler(this.simpleButton15_Click); + // + // separatorControl3 + // + this.separatorControl3.Location = new System.Drawing.Point(18, 65); + this.separatorControl3.Name = "separatorControl3"; + this.separatorControl3.Size = new System.Drawing.Size(734, 23); + this.separatorControl3.TabIndex = 25; + // + // label6 + // + this.label6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(236)))), ((int)(((byte)(239))))); + this.label6.ForeColor = System.Drawing.Color.Blue; + this.label6.Location = new System.Drawing.Point(1, 319); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(764, 23); + this.label6.TabIndex = 24; + this.label6.Text = "状态"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // progressBar3 + // + this.progressBar3.Dock = System.Windows.Forms.DockStyle.Bottom; + this.progressBar3.Location = new System.Drawing.Point(0, 346); + this.progressBar3.Name = "progressBar3"; + this.progressBar3.Size = new System.Drawing.Size(769, 33); + this.progressBar3.TabIndex = 23; + // + // labelControl46 + // + this.labelControl46.Appearance.Font = new System.Drawing.Font("Tahoma", 34F, System.Drawing.FontStyle.Bold); + this.labelControl46.Appearance.ForeColor = System.Drawing.Color.Black; + this.labelControl46.Appearance.Options.UseFont = true; + this.labelControl46.Appearance.Options.UseForeColor = true; + this.labelControl46.Location = new System.Drawing.Point(228, 202); + this.labelControl46.Name = "labelControl46"; + this.labelControl46.Size = new System.Drawing.Size(350, 56); + this.labelControl46.TabIndex = 11; + this.labelControl46.Text = "( 不懂的不要点 )"; + // + // labelControl47 + // + this.labelControl47.Appearance.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold); + this.labelControl47.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl47.Appearance.Options.UseFont = true; + this.labelControl47.Appearance.Options.UseForeColor = true; + this.labelControl47.Location = new System.Drawing.Point(51, 97); + this.labelControl47.Name = "labelControl47"; + this.labelControl47.Size = new System.Drawing.Size(369, 19); + this.labelControl47.TabIndex = 11; + this.labelControl47.Text = "2、该功能用于修改软件中机器人账号(不支持PC)"; + // + // labelControl45 + // + this.labelControl45.Appearance.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold); + this.labelControl45.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl45.Appearance.Options.UseFont = true; + this.labelControl45.Appearance.Options.UseForeColor = true; + this.labelControl45.Location = new System.Drawing.Point(51, 20); + this.labelControl45.Name = "labelControl45"; + this.labelControl45.Size = new System.Drawing.Size(491, 38); + this.labelControl45.TabIndex = 11; + this.labelControl45.Text = "1、该功能用于其他软件导入成功以后,发现分出佣金和其他软件中\r\n的有很大出入可以用该按钮重新计算所有订单的佣金"; + // + // simpleButton12 + // + this.simpleButton12.Location = new System.Drawing.Point(591, 20); + this.simpleButton12.Name = "simpleButton12"; + this.simpleButton12.Size = new System.Drawing.Size(103, 38); + this.simpleButton12.TabIndex = 10; + this.simpleButton12.Text = "一键修改"; + this.simpleButton12.Click += new System.EventHandler(this.simpleButton12_Click); + // + // xtraTabPage3 + // + this.xtraTabPage3.Controls.Add(this.groupControl2); + this.xtraTabPage3.Name = "xtraTabPage3"; + this.xtraTabPage3.Size = new System.Drawing.Size(814, 443); + this.xtraTabPage3.Text = "自转 Sqlite 转 MySql"; + // + // groupControl2 + // + this.groupControl2.Controls.Add(this.label7); + this.groupControl2.Controls.Add(this.progressBar4); + this.groupControl2.Controls.Add(this.simpleButton7); + this.groupControl2.Controls.Add(this.textEdit5); + this.groupControl2.Controls.Add(this.textEdit4); + this.groupControl2.Controls.Add(this.simpleButton3); + this.groupControl2.Controls.Add(this.textEdit3); + this.groupControl2.Controls.Add(this.labelControl6); + this.groupControl2.Controls.Add(this.textEdit2); + this.groupControl2.Controls.Add(this.textEdit6); + this.groupControl2.Controls.Add(this.labelControl5); + this.groupControl2.Controls.Add(this.labelControl4); + this.groupControl2.Controls.Add(this.labelControl3); + this.groupControl2.Controls.Add(this.labelControl2); + this.groupControl2.Location = new System.Drawing.Point(47, 25); + this.groupControl2.Name = "groupControl2"; + this.groupControl2.Size = new System.Drawing.Size(726, 394); + this.groupControl2.TabIndex = 13; + this.groupControl2.Text = "Mysql 详细配置"; + // + // label7 + // + this.label7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(236)))), ((int)(((byte)(239))))); + this.label7.ForeColor = System.Drawing.Color.Blue; + this.label7.Location = new System.Drawing.Point(4, 338); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(719, 18); + this.label7.TabIndex = 26; + this.label7.Text = "状态"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // progressBar4 + // + this.progressBar4.Dock = System.Windows.Forms.DockStyle.Bottom; + this.progressBar4.Location = new System.Drawing.Point(2, 359); + this.progressBar4.Name = "progressBar4"; + this.progressBar4.Size = new System.Drawing.Size(722, 33); + this.progressBar4.TabIndex = 25; + // + // simpleButton7 + // + this.simpleButton7.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("simpleButton7.ImageOptions.Image"))); + this.simpleButton7.Location = new System.Drawing.Point(308, 278); + this.simpleButton7.Name = "simpleButton7"; + this.simpleButton7.Size = new System.Drawing.Size(108, 35); + this.simpleButton7.TabIndex = 14; + this.simpleButton7.Text = "开始转移"; + this.simpleButton7.Click += new System.EventHandler(this.simpleButton7_Click); + // + // textEdit5 + // + this.textEdit5.EditValue = ""; + this.textEdit5.Location = new System.Drawing.Point(266, 213); + this.textEdit5.Name = "textEdit5"; + this.textEdit5.Properties.PasswordChar = '*'; + this.textEdit5.Size = new System.Drawing.Size(160, 20); + this.textEdit5.TabIndex = 15; + // + // textEdit4 + // + this.textEdit4.EditValue = "root"; + this.textEdit4.Location = new System.Drawing.Point(267, 173); + this.textEdit4.Name = "textEdit4"; + this.textEdit4.Size = new System.Drawing.Size(269, 20); + this.textEdit4.TabIndex = 14; + // + // simpleButton3 + // + this.simpleButton3.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("simpleButton3.ImageOptions.Image"))); + this.simpleButton3.Location = new System.Drawing.Point(434, 211); + this.simpleButton3.Name = "simpleButton3"; + this.simpleButton3.Size = new System.Drawing.Size(102, 23); + this.simpleButton3.TabIndex = 13; + this.simpleButton3.Text = "尝试连接"; + this.simpleButton3.Click += new System.EventHandler(this.simpleButton3_Click); + // + // textEdit3 + // + this.textEdit3.EditValue = ""; + this.textEdit3.Location = new System.Drawing.Point(267, 132); + this.textEdit3.Name = "textEdit3"; + this.textEdit3.Size = new System.Drawing.Size(269, 20); + this.textEdit3.TabIndex = 9; + // + // labelControl6 + // + this.labelControl6.Location = new System.Drawing.Point(194, 215); + this.labelControl6.Name = "labelControl6"; + this.labelControl6.Size = new System.Drawing.Size(52, 14); + this.labelControl6.TabIndex = 4; + this.labelControl6.Text = "登录密码:"; + // + // textEdit2 + // + this.textEdit2.EditValue = "3306"; + this.textEdit2.Location = new System.Drawing.Point(266, 98); + this.textEdit2.Name = "textEdit2"; + this.textEdit2.Properties.Mask.EditMask = "d"; + this.textEdit2.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; + this.textEdit2.Size = new System.Drawing.Size(269, 20); + this.textEdit2.TabIndex = 7; + // + // textEdit6 + // + this.textEdit6.EditValue = "127.0.0.1"; + this.textEdit6.Location = new System.Drawing.Point(266, 59); + this.textEdit6.Name = "textEdit6"; + this.textEdit6.Size = new System.Drawing.Size(269, 20); + this.textEdit6.TabIndex = 6; + // + // labelControl5 + // + this.labelControl5.Location = new System.Drawing.Point(206, 176); + this.labelControl5.Name = "labelControl5"; + this.labelControl5.Size = new System.Drawing.Size(40, 14); + this.labelControl5.TabIndex = 3; + this.labelControl5.Text = "用户名:"; + // + // labelControl4 + // + this.labelControl4.Location = new System.Drawing.Point(182, 135); + this.labelControl4.Name = "labelControl4"; + this.labelControl4.Size = new System.Drawing.Size(64, 14); + this.labelControl4.TabIndex = 2; + this.labelControl4.Text = "数据库名称:"; + // + // labelControl3 + // + this.labelControl3.Location = new System.Drawing.Point(206, 100); + this.labelControl3.Name = "labelControl3"; + this.labelControl3.Size = new System.Drawing.Size(40, 14); + this.labelControl3.TabIndex = 1; + this.labelControl3.Text = "端口号:"; + // + // labelControl2 + // + this.labelControl2.Location = new System.Drawing.Point(182, 62); + this.labelControl2.Name = "labelControl2"; + this.labelControl2.Size = new System.Drawing.Size(64, 14); + this.labelControl2.TabIndex = 0; + this.labelControl2.Text = "服务器地址:"; + // + // xtraTabPage5 + // + this.xtraTabPage5.Controls.Add(this.groupControl4); + this.xtraTabPage5.Name = "xtraTabPage5"; + this.xtraTabPage5.Size = new System.Drawing.Size(814, 443); + this.xtraTabPage5.Text = " 数 据 库 合 并 "; + // + // groupControl4 + // + this.groupControl4.Controls.Add(this.label36); + this.groupControl4.Controls.Add(this.progressBar2); + this.groupControl4.Controls.Add(this.label4); + this.groupControl4.Controls.Add(this.label9); + this.groupControl4.Controls.Add(this.label17); + this.groupControl4.Controls.Add(this.label18); + this.groupControl4.Controls.Add(this.label19); + this.groupControl4.Controls.Add(this.label25); + this.groupControl4.Controls.Add(this.label20); + this.groupControl4.Controls.Add(this.label22); + this.groupControl4.Controls.Add(this.simpleButton10); + this.groupControl4.Controls.Add(this.textEdit8); + this.groupControl4.Controls.Add(this.simpleButton11); + this.groupControl4.Location = new System.Drawing.Point(20, 19); + this.groupControl4.Name = "groupControl4"; + this.groupControl4.Size = new System.Drawing.Size(769, 402); + this.groupControl4.TabIndex = 9; + this.groupControl4.Text = "多平台数据导入"; + // + // label36 + // + this.label36.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(236)))), ((int)(((byte)(239))))); + this.label36.ForeColor = System.Drawing.Color.Blue; + this.label36.Location = new System.Drawing.Point(2, 346); + this.label36.Name = "label36"; + this.label36.Size = new System.Drawing.Size(762, 18); + this.label36.TabIndex = 24; + this.label36.Text = "状态"; + this.label36.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // progressBar2 + // + this.progressBar2.Dock = System.Windows.Forms.DockStyle.Bottom; + this.progressBar2.Location = new System.Drawing.Point(2, 367); + this.progressBar2.Name = "progressBar2"; + this.progressBar2.Size = new System.Drawing.Size(765, 33); + this.progressBar2.TabIndex = 23; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Tahoma", 12F); + this.label4.ForeColor = System.Drawing.Color.Red; + this.label4.Location = new System.Drawing.Point(203, 185); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(415, 19); + this.label4.TabIndex = 18; + this.label4.Text = "(合并之前请备份数据,数据无价,如需帮助请联系客服协助)"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(245, 146); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(79, 14); + this.label9.TabIndex = 18; + this.label9.Text = "请选择数据库"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(125, 263); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(79, 14); + this.label17.TabIndex = 17; + this.label17.Text = "请选择数据库"; + this.label17.Visible = false; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(140, 146); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(91, 14); + this.label18.TabIndex = 16; + this.label18.Text = "预导入数据库:"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(56, 263); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(55, 14); + this.label19.TabIndex = 15; + this.label19.Text = "机器人:"; + this.label19.Visible = false; + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Font = new System.Drawing.Font("Tahoma", 10F); + this.label25.ForeColor = System.Drawing.Color.Blue; + this.label25.Location = new System.Drawing.Point(87, 216); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(636, 34); + this.label25.TabIndex = 14; + this.label25.Text = "( 数据量大的用户,可以将比较久远的联盟订单删除后在来合并,可以大大增加合并成功率,以及合并速度)\r\n注:清理历史订单可以使用清理管家"; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.ForeColor = System.Drawing.Color.Gray; + this.label20.Location = new System.Drawing.Point(199, 300); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(419, 14); + this.label20.TabIndex = 14; + this.label20.Text = "( 合并操作针对,用户数据,订单数据,兑换数据,机器人数据,积分记录,cps数据, )"; + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(152, 117); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(79, 14); + this.label22.TabIndex = 10; + this.label22.Text = "数据库路径:"; + // + // simpleButton10 + // + this.simpleButton10.Location = new System.Drawing.Point(343, 263); + this.simpleButton10.Name = "simpleButton10"; + this.simpleButton10.Size = new System.Drawing.Size(95, 29); + this.simpleButton10.TabIndex = 7; + this.simpleButton10.Text = "开始合并"; + this.simpleButton10.Click += new System.EventHandler(this.simpleButton10_Click); + // + // textEdit8 + // + this.textEdit8.Location = new System.Drawing.Point(239, 114); + this.textEdit8.Name = "textEdit8"; + this.textEdit8.Size = new System.Drawing.Size(292, 20); + this.textEdit8.TabIndex = 1; + // + // simpleButton11 + // + this.simpleButton11.Location = new System.Drawing.Point(558, 114); + this.simpleButton11.Name = "simpleButton11"; + this.simpleButton11.Size = new System.Drawing.Size(69, 20); + this.simpleButton11.TabIndex = 2; + this.simpleButton11.Text = "选择数据库"; + this.simpleButton11.Click += new System.EventHandler(this.simpleButton11_Click); + // + // xtraTabPage4 + // + this.xtraTabPage4.Controls.Add(this.groupControl3); + this.xtraTabPage4.Name = "xtraTabPage4"; + this.xtraTabPage4.Size = new System.Drawing.Size(814, 443); + this.xtraTabPage4.Text = "Sqlite 自 动 备 份"; + // + // groupControl3 + // + this.groupControl3.Controls.Add(this.checkBox6); + this.groupControl3.Controls.Add(this.dateTimePicker1); + this.groupControl3.Controls.Add(this.Auto_Bak_onoff); + this.groupControl3.Controls.Add(this.numericUpDown2); + this.groupControl3.Controls.Add(this.label16); + this.groupControl3.Controls.Add(this.label12); + this.groupControl3.Controls.Add(this.label14); + this.groupControl3.Controls.Add(this.label13); + this.groupControl3.Controls.Add(this.label11); + this.groupControl3.Controls.Add(this.label23); + this.groupControl3.Controls.Add(this.label21); + this.groupControl3.Controls.Add(this.label10); + this.groupControl3.Controls.Add(this.label15); + this.groupControl3.Controls.Add(this.simpleButton8); + this.groupControl3.Controls.Add(this.textEdit7); + this.groupControl3.Controls.Add(this.simpleButton9); + this.groupControl3.Location = new System.Drawing.Point(32, 22); + this.groupControl3.Name = "groupControl3"; + this.groupControl3.Size = new System.Drawing.Size(748, 396); + this.groupControl3.TabIndex = 9; + this.groupControl3.Text = "Sqlite自动备份设置"; + // + // checkBox6 + // + this.checkBox6.AutoSize = true; + this.checkBox6.Location = new System.Drawing.Point(215, 256); + this.checkBox6.Name = "checkBox6"; + this.checkBox6.Size = new System.Drawing.Size(122, 18); + this.checkBox6.TabIndex = 22; + this.checkBox6.Text = "开启备份发送邮箱"; + this.checkBox6.UseVisualStyleBackColor = true; + // + // dateTimePicker1 + // + this.dateTimePicker1.CustomFormat = "HH:mm"; + this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimePicker1.Location = new System.Drawing.Point(215, 220); + this.dateTimePicker1.Name = "dateTimePicker1"; + this.dateTimePicker1.Size = new System.Drawing.Size(212, 22); + this.dateTimePicker1.TabIndex = 21; + this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged); + // + // Auto_Bak_onoff + // + this.Auto_Bak_onoff.BackColor = System.Drawing.Color.Transparent; + this.Auto_Bak_onoff.Checked = false; + this.Auto_Bak_onoff.CheckStyleX = UI.Framework.Controls.CheckStyle.style4; + this.Auto_Bak_onoff.Cursor = System.Windows.Forms.Cursors.Hand; + this.Auto_Bak_onoff.Location = new System.Drawing.Point(215, 114); + this.Auto_Bak_onoff.Margin = new System.Windows.Forms.Padding(4); + this.Auto_Bak_onoff.Name = "Auto_Bak_onoff"; + this.Auto_Bak_onoff.Size = new System.Drawing.Size(60, 21); + this.Auto_Bak_onoff.TabIndex = 20; + this.Auto_Bak_onoff.Click += new System.EventHandler(this.Auto_Bak_onoff_Click); + // + // numericUpDown2 + // + this.numericUpDown2.Location = new System.Drawing.Point(215, 285); + this.numericUpDown2.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDown2.Name = "numericUpDown2"; + this.numericUpDown2.Size = new System.Drawing.Size(66, 22); + this.numericUpDown2.TabIndex = 19; + this.numericUpDown2.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged); + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(291, 289); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(67, 14); + this.label16.TabIndex = 18; + this.label16.Text = "天备份一次"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(215, 154); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(37, 14); + this.label12.TabIndex = 16; + this.label12.Text = "Sqlite"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(141, 117); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(67, 14); + this.label14.TabIndex = 16; + this.label14.Text = "功能开关:"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(117, 287); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(91, 14); + this.label13.TabIndex = 10; + this.label13.Text = "自动备份间隔:"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(129, 153); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(79, 14); + this.label11.TabIndex = 16; + this.label11.Text = "当前数据库:"; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.ForeColor = System.Drawing.Color.Red; + this.label23.Location = new System.Drawing.Point(343, 257); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(206, 14); + this.label23.TabIndex = 10; + this.label23.Text = "(备份数据库应大于100兆可能会失败)"; + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(81, 256); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(127, 14); + this.label21.TabIndex = 10; + this.label21.Text = "备份文件是否发邮箱:"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(117, 224); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(91, 14); + this.label10.TabIndex = 10; + this.label10.Text = "自动备份时间:"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(105, 187); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(103, 14); + this.label15.TabIndex = 10; + this.label15.Text = "数据库备份路径:"; + // + // simpleButton8 + // + this.simpleButton8.Location = new System.Drawing.Point(378, 282); + this.simpleButton8.Name = "simpleButton8"; + this.simpleButton8.Size = new System.Drawing.Size(95, 29); + this.simpleButton8.TabIndex = 7; + this.simpleButton8.Text = "立即备份"; + this.simpleButton8.Click += new System.EventHandler(this.simpleButton8_Click); + // + // textEdit7 + // + this.textEdit7.Location = new System.Drawing.Point(215, 184); + this.textEdit7.Name = "textEdit7"; + this.textEdit7.Size = new System.Drawing.Size(332, 20); + this.textEdit7.TabIndex = 1; + this.textEdit7.TextChanged += new System.EventHandler(this.textEdit7_TextChanged); + // + // simpleButton9 + // + this.simpleButton9.Location = new System.Drawing.Point(565, 184); + this.simpleButton9.Name = "simpleButton9"; + this.simpleButton9.Size = new System.Drawing.Size(69, 20); + this.simpleButton9.TabIndex = 2; + this.simpleButton9.Text = "选择目录"; + this.simpleButton9.Click += new System.EventHandler(this.simpleButton9_Click); + // + // xtraTabbedMdiManager1 + // + this.xtraTabbedMdiManager1.MdiParent = this; + // + // checkBox31 + // + this.checkBox31.AutoSize = true; + this.checkBox31.Location = new System.Drawing.Point(449, 94); + this.checkBox31.Name = "checkBox31"; + this.checkBox31.Size = new System.Drawing.Size(110, 18); + this.checkBox31.TabIndex = 34; + this.checkBox31.Text = "未审核余额导入"; + this.checkBox31.UseVisualStyleBackColor = true; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(816, 469); + this.Controls.Add(this.xtraTabControl1); + this.IsMdiContainer = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "MainForm"; + this.Text = "6**"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).EndInit(); + this.xtraTabControl1.ResumeLayout(false); + this.xtraTabPage2.ResumeLayout(false); + this.xtraTabPage2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tabPane1)).EndInit(); + this.tabPane1.ResumeLayout(false); + this.tabNavigationPage1.ResumeLayout(false); + this.tabNavigationPage1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit1.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkedListBoxControl1)).EndInit(); + this.tabNavigationPage3.ResumeLayout(false); + this.tabNavigationPage3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit2.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.checkedListBoxControl2)).EndInit(); + this.xtraTabPage1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl2)).EndInit(); + this.xtraTabControl2.ResumeLayout(false); + this.xtraTabPage6.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit(); + this.groupControl1.ResumeLayout(false); + this.groupControl1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit(); + this.panelControl1.ResumeLayout(false); + this.panelControl1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit12.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit11.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit10.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit13.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit9.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit2.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit3.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit(); + this.xtraTabPage7.ResumeLayout(false); + this.xtraTabPage7.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.checkEdit1.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit3.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl1)).EndInit(); + this.xtraTabPage10.ResumeLayout(false); + this.xtraTabPage10.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl8)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit5.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl7)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl6)).EndInit(); + this.xtraTabPage9.ResumeLayout(false); + this.xtraTabPage9.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.memoEdit4.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl5)).EndInit(); + this.xtraTabPage8.ResumeLayout(false); + this.xtraTabPage8.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.separatorControl3)).EndInit(); + this.xtraTabPage3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.groupControl2)).EndInit(); + this.groupControl2.ResumeLayout(false); + this.groupControl2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit5.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit4.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit3.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit2.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit6.Properties)).EndInit(); + this.xtraTabPage5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.groupControl4)).EndInit(); + this.groupControl4.ResumeLayout(false); + this.groupControl4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit8.Properties)).EndInit(); + this.xtraTabPage4.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.groupControl3)).EndInit(); + this.groupControl3.ResumeLayout(false); + this.groupControl3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textEdit7.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.xtraTabbedMdiManager1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private DevExpress.XtraTab.XtraTabControl xtraTabControl1; + private DevExpress.XtraTab.XtraTabPage xtraTabPage1; + private DevExpress.XtraTab.XtraTabPage xtraTabPage2; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + private DevExpress.XtraBars.Navigation.TabPane tabPane1; + private DevExpress.XtraBars.Navigation.TabNavigationPage tabNavigationPage1; + private DevExpress.XtraTabbedMdi.XtraTabbedMdiManager xtraTabbedMdiManager1; + private System.Windows.Forms.Label label2; + private DevExpress.XtraEditors.CheckedListBoxControl checkedListBoxControl1; + private DevExpress.XtraBars.Navigation.TabNavigationPage tabNavigationPage2; + private DevExpress.XtraBars.Navigation.TabNavigationPage tabNavigationPage3; + private DevExpress.XtraEditors.SimpleButton simpleButton4; + private DevExpress.XtraEditors.MemoEdit memoEdit1; + private DevExpress.XtraEditors.MemoEdit memoEdit2; + private DevExpress.XtraEditors.SimpleButton simpleButton5; + private DevExpress.XtraEditors.CheckedListBoxControl checkedListBoxControl2; + private DevExpress.XtraEditors.SimpleButton simpleButton6; + private System.Windows.Forms.CheckBox checkBox3; + private DevExpress.XtraEditors.LabelControl labelControl1; + private DevExpress.XtraTab.XtraTabPage xtraTabPage3; + private DevExpress.XtraEditors.GroupControl groupControl2; + private DevExpress.XtraEditors.TextEdit textEdit5; + private DevExpress.XtraEditors.TextEdit textEdit4; + private DevExpress.XtraEditors.SimpleButton simpleButton3; + private DevExpress.XtraEditors.TextEdit textEdit3; + private DevExpress.XtraEditors.LabelControl labelControl6; + private DevExpress.XtraEditors.TextEdit textEdit2; + private DevExpress.XtraEditors.TextEdit textEdit6; + private DevExpress.XtraEditors.LabelControl labelControl5; + private DevExpress.XtraEditors.LabelControl labelControl4; + private DevExpress.XtraEditors.LabelControl labelControl3; + private DevExpress.XtraEditors.LabelControl labelControl2; + private DevExpress.XtraEditors.SimpleButton simpleButton7; + private DevExpress.XtraTab.XtraTabPage xtraTabPage4; + private DevExpress.XtraEditors.GroupControl groupControl3; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label15; + private DevExpress.XtraEditors.SimpleButton simpleButton8; + private DevExpress.XtraEditors.TextEdit textEdit7; + private DevExpress.XtraEditors.SimpleButton simpleButton9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label12; + private UI.Framework.Controls.ButtonCheck Auto_Bak_onoff; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.NumericUpDown numericUpDown2; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.DateTimePicker dateTimePicker1; + private DevExpress.XtraTab.XtraTabPage xtraTabPage5; + private DevExpress.XtraEditors.GroupControl groupControl4; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label22; + private DevExpress.XtraEditors.SimpleButton simpleButton10; + private DevExpress.XtraEditors.TextEdit textEdit8; + private DevExpress.XtraEditors.SimpleButton simpleButton11; + private DevExpress.XtraTab.XtraTabControl xtraTabControl2; + private DevExpress.XtraTab.XtraTabPage xtraTabPage6; + private DevExpress.XtraEditors.GroupControl groupControl1; + private DevExpress.XtraEditors.ComboBoxEdit comboBoxEdit3; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox1; + private DevExpress.XtraEditors.SimpleButton simpleButton2; + private DevExpress.XtraEditors.TextEdit textEdit1; + private DevExpress.XtraEditors.SimpleButton simpleButton1; + private DevExpress.XtraTab.XtraTabPage xtraTabPage7; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label28; + private System.Windows.Forms.Label label29; + private System.Windows.Forms.TextBox textBox4; + private DevExpress.XtraEditors.SeparatorControl separatorControl2; + private DevExpress.XtraEditors.SeparatorControl separatorControl1; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.CheckBox checkBox5; + private System.Windows.Forms.Label label30; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.Label label31; + private DevExpress.XtraEditors.ComboBoxEdit comboBoxEdit1; + private System.Windows.Forms.Label label36; + private System.Windows.Forms.ProgressBar progressBar2; + private DevExpress.XtraEditors.LabelControl labelControl7; + private DevExpress.XtraEditors.LabelControl labelControl8; + private System.Windows.Forms.CheckBox checkBox10; + private System.Windows.Forms.CheckBox checkBox9; + private System.Windows.Forms.CheckBox checkBox8; + private DevExpress.XtraEditors.LabelControl labelControl9; + private DevExpress.XtraEditors.LabelControl labelControl10; + private DevExpress.XtraEditors.LabelControl labelControl15; + private System.Windows.Forms.CheckBox checkBox16; + private System.Windows.Forms.CheckBox checkBox13; + private System.Windows.Forms.CheckBox checkBox15; + private System.Windows.Forms.CheckBox checkBox14; + private System.Windows.Forms.CheckBox checkBox12; + private System.Windows.Forms.CheckBox checkBox11; + private DevExpress.XtraEditors.LabelControl labelControl14; + private DevExpress.XtraEditors.LabelControl labelControl12; + private DevExpress.XtraEditors.LabelControl labelControl13; + private DevExpress.XtraEditors.LabelControl labelControl11; + private DevExpress.XtraEditors.LabelControl labelControl18; + private DevExpress.XtraEditors.LabelControl labelControl17; + private DevExpress.XtraEditors.LabelControl labelControl16; + private DevExpress.XtraEditors.LabelControl labelControl19; + private DevExpress.XtraEditors.LabelControl labelControl20; + private DevExpress.XtraEditors.LabelControl labelControl21; + private DevExpress.XtraEditors.LabelControl labelControl22; + private DevExpress.XtraEditors.LabelControl labelControl23; + private DevExpress.XtraEditors.LabelControl labelControl24; + private DevExpress.XtraEditors.ComboBoxEdit comboBoxEdit2; + private System.Windows.Forms.CheckBox checkBox4; + private DevExpress.XtraEditors.PanelControl panelControl1; + private DevExpress.XtraEditors.LabelControl labelControl25; + private DevExpress.XtraEditors.LabelControl labelControl27; + private DevExpress.XtraEditors.LabelControl labelControl26; + private DevExpress.XtraEditors.LabelControl labelControl28; + private DevExpress.XtraEditors.TextEdit textEdit12; + private DevExpress.XtraEditors.TextEdit textEdit11; + private DevExpress.XtraEditors.TextEdit textEdit10; + private DevExpress.XtraEditors.TextEdit textEdit9; + private DevExpress.XtraEditors.SimpleButton simpleButton14; + private DevExpress.XtraEditors.TextEdit textEdit13; + private DevExpress.XtraEditors.LabelControl labelControl29; + private DevExpress.XtraEditors.LabelControl labelControl30; + private DevExpress.XtraEditors.LabelControl labelControl31; + private DevExpress.XtraEditors.LabelControl labelControl32; + private DevExpress.XtraEditors.LabelControl labelControl33; + private DevExpress.XtraEditors.LabelControl label8; + private DevExpress.XtraEditors.LabelControl labelControl34; + private DevExpress.XtraEditors.LabelControl labelControl35; + private DevExpress.XtraEditors.LabelControl labelControl36; + private DevExpress.XtraEditors.LabelControl labelControl37; + private DevExpress.XtraEditors.LabelControl labelControl41; + private DevExpress.XtraEditors.LabelControl labelControl40; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox6; + private System.Windows.Forms.TextBox textBox5; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Button button1; + private DevExpress.XtraEditors.LabelControl labelControl38; + private DevExpress.XtraEditors.LabelControl labelControl39; + private DevExpress.XtraEditors.LabelControl labelControl42; + private DevExpress.XtraEditors.LabelControl labelControl43; + private DevExpress.XtraEditors.LabelControl labelControl44; + private System.Windows.Forms.DateTimePicker dateTimePicker3; + private System.Windows.Forms.DateTimePicker dateTimePicker2; + private DevExpress.XtraEditors.CheckEdit checkEdit1; + private DevExpress.XtraEditors.SimpleButton simpleButton13; + private System.Windows.Forms.Label label4; + private DevExpress.XtraEditors.SimpleButton simpleButton12; + private DevExpress.XtraTab.XtraTabPage xtraTabPage8; + private DevExpress.XtraEditors.LabelControl labelControl45; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.ProgressBar progressBar3; + private DevExpress.XtraEditors.LabelControl labelControl46; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.ProgressBar progressBar4; + private DevExpress.XtraEditors.SeparatorControl separatorControl3; + private DevExpress.XtraEditors.SimpleButton simpleButton15; + private DevExpress.XtraEditors.LabelControl labelControl47; + private DevExpress.XtraEditors.SimpleButton simpleButton16; + private DevExpress.XtraEditors.LabelControl labelControl48; + private DevExpress.XtraEditors.LabelControl labelControl49; + private DevExpress.XtraEditors.LabelControl labelControl50; + private System.Windows.Forms.CheckBox checkBox6; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.Label label23; + private DevExpress.XtraTab.XtraTabPage xtraTabPage9; + private DevExpress.XtraEditors.LabelControl labelControl53; + private DevExpress.XtraEditors.LabelControl labelControl55; + private System.Windows.Forms.CheckBox checkBox7; + private System.Windows.Forms.CheckBox checkBox17; + private System.Windows.Forms.CheckBox checkBox18; + private DevExpress.XtraEditors.LabelControl labelControl56; + private DevExpress.XtraEditors.MemoEdit memoEdit4; + private System.Windows.Forms.CheckBox checkBox19; + private DevExpress.XtraEditors.SeparatorControl separatorControl4; + private DevExpress.XtraEditors.SeparatorControl separatorControl5; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.TextBox textBox7; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; + private DevExpress.XtraEditors.LabelControl labelControl52; + private DevExpress.XtraEditors.LabelControl labelControl51; + private DevExpress.XtraEditors.MemoEdit memoEdit3; + private System.Windows.Forms.Label label25; + private DevExpress.XtraTab.XtraTabPage xtraTabPage10; + private DevExpress.XtraEditors.LabelControl labelControl54; + private System.Windows.Forms.TextBox textBox8; + private System.Windows.Forms.CheckBox checkBox20; + private DevExpress.XtraEditors.SeparatorControl separatorControl6; + private System.Windows.Forms.Label label26; + private DevExpress.XtraEditors.LabelControl labelControl58; + private DevExpress.XtraEditors.MemoEdit memoEdit5; + private DevExpress.XtraEditors.SeparatorControl separatorControl7; + private System.Windows.Forms.Button button7; + private System.Windows.Forms.CheckBox checkBox21; + private DevExpress.XtraEditors.SeparatorControl separatorControl8; + private System.Windows.Forms.Label label27; + private System.Windows.Forms.CheckBox checkBox25; + private System.Windows.Forms.CheckBox checkBox24; + private System.Windows.Forms.CheckBox checkBox23; + private System.Windows.Forms.CheckBox checkBox22; + private System.Windows.Forms.CheckBox checkBox30; + private System.Windows.Forms.CheckBox checkBox29; + private System.Windows.Forms.CheckBox checkBox28; + private System.Windows.Forms.CheckBox checkBox27; + private System.Windows.Forms.CheckBox checkBox26; + private System.Windows.Forms.CheckBox checkBox31; + } +} \ No newline at end of file diff --git a/应用/BackupAndImport/MainForm.cs b/应用/BackupAndImport/MainForm.cs new file mode 100644 index 0000000..1ff7b98 --- /dev/null +++ b/应用/BackupAndImport/MainForm.cs @@ -0,0 +1,6075 @@ +using Api.Framework; +using Api.Framework.Enums; +using Api.Framework.Model; +using Api.Framework.SDK; +using Api.Framework.Tools; +using Api.Framework.Utils; +using BackupAndImport; +using BackupAndImport.ECO; +using BackupAndImport.ECO.Entitys; +using BackupAndImport.ECO.Events; +using BackupAndImport.Entitys; +using BackupAndImport.Entitys.annaer; +using BackupAndImport.Entitys.annaer_cloud; +using BackupAndImport.Entitys.lieke; +using BackupAndImport.Entitys.悠哉; +using BackupAndImport.Entitys.淘某喵; +using BackupAndImport.Entitys.速推客; +using BackupAndImport.NianChu; +using BackupAndImport.Properties; +using CsharpHttpHelper; +using DataDocking.Entitys; +using DataDocking.Utils; +using DevExpress.XtraEditors; +using DevExpress.XtraEditors.Controls; +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using BackupAndImport.速推客云端; +using BackupAndImport.速推客云端.Entitys; +using CsharpHttpHelper.Enum; +using DevExpress.Data.Helpers; +using Newtonsoft.Json.Linq; +using UI.Framework.Forms; +using static Api.Framework.Cps.AlimamaApi; +using static BackupAndImport.ECO.Eco; +using static BackupAndImport.ECO.EventLog; + +namespace DataDocking +{ + public partial class MainForm : BaseForm + { + /// + /// 用户自定义回复库 + /// + public class fl_plugin_autoanswer_definedlib : base_model + { + /// + /// 平台类型 + /// + public string chat_type { get; set; } + /// + /// 关键词 + /// + public string antistop { get; set; } + /// + /// 匹配模式 0是为完全匹配,false为模糊 and 正则表达式 【这里用int类型,主要是因为dev中的Gridcontrol bool好像不支持 修改界面显示】 + /// + public int match_pattern { get; set; } + /// + /// 指定回复的机器人信息,为空时所有机器人都使用 + /// + public string specific_robot_setting_text { get; set; } + /// + /// 回复内容 + /// + [SugarColumn(Length = 10000)]//设置字段为长文本 + public string content { get; set; } + /// + /// 是否通知管理员 【这里用int类型,主要是因为dev中的Gridcontrol bool好像不支持 修改界面显示】 + /// + public int is_alert_admin { get; set; } + + public bool CheckChatType(ChatType type) + { + return string.IsNullOrWhiteSpace(this.chat_type) ? false : this.chat_type.Split(',').FirstOrDefault(f => ushort.Parse(f) == (ushort)type) != null ? true : false; + } + + } + + + public class fl_plugin_autoanswer_userdefinedlibrary : base_model + { + /// + /// 平台类型 + /// + public string chat_type { get; set; } + /// + /// 关键词 + /// + public string antistop { get; set; } + /// + /// 匹配模式 0是为完全匹配,false为模糊 and 正则表达式 【这里用int类型,主要是因为dev中的Gridcontrol bool好像不支持 修改界面显示】 + /// + public int match_pattern { get; set; } + + /// + /// 回复内容 + /// + [SugarColumn(Length = 10000)]//设置字段为长文本 + public string content { get; set; } + /// + /// 是否通知管理员 【这里用int类型,主要是因为dev中的Gridcontrol bool好像不支持 修改界面显示】 + /// + public int is_alert_admin { get; set; } + + public bool CheckChatType(ChatType type) + { + return string.IsNullOrWhiteSpace(this.chat_type) ? false : this.chat_type.Split(',').FirstOrDefault(f => ushort.Parse(f) == (ushort)type) != null ? true : false; + } + + } + + /// + /// 打标记条件 + /// + public enum SignType + { + 好友天数 = 0, + 查询次数 = 1, + 订单总数 = 2, + 退款总数 = 3, + 推荐人数 = 4 + } + + /// + /// 自动打标签数据表 + /// + public class fl_plugin_signcontacts_sign_info : base_model + { + + public SignType signtype { get; set; } + + public long amount { get; set; } + + public string sign { get; set; } + + } + + public MainForm() + { + InitializeComponent(); + this.Text = Resources.MainFormTitle; + } + + public void CloseForm() + { + if (!this.IsDisposed) + { + this.Invoke(new Action(delegate + { + this.Close(); + this.Dispose(); + })); + } + } + + /// + /// 数据库表中的数据 + /// + List tableData = new List() { "延迟结算配置", "会员分组配置", "分出比例配置", "自定义问答", "自动打标签数据", "独立分出比例" }; + + private void MainForm_Load(object sender, EventArgs e) + { + BackupAndImport.ECO.EventLog.LogEvent += EventLog_LogEvent; + BackupAndImport.NianChu.EventLog.LogEvent += NCEventLog_LogEvent; + BackupAndImport.速推客云端.EventLog.LogEvent += STKEventLog_LogEvent; + + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, "全选")); + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, "全消")); + + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, tableData[0])); + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, tableData[1])); + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, tableData[2])); + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, tableData[3])); + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, tableData[4])); + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, tableData[5])); + var session = ApiClient.GetSession(); + var system_configs = session.Find("select * from fl_dictionary_item"); + if (system_configs != null && system_configs.Count != 0) + { + foreach (var item in system_configs) + { + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, item.dickey)); + } + this.checkedListBoxControl1.Tag = system_configs; + } + else + this.checkedListBoxControl1.Items.Add(new CheckedListBoxItem(null, "无配置信息!")); + Auto_Bak_onoff.Checked = Class1.Config.Auto_Bak_OnOff; + label12.Text = (session.CurrentConnectionConfig.DbType == SqlSugar.DbType.MySql) ? "Mysql" : "Sqlite"; + if (string.IsNullOrWhiteSpace(Class1.Config.Auto_Bak_Path)) + Class1.Config.Auto_Bak_Path = Util.MapPath($"File\\备份"); + + textEdit7.Text = Class1.Config.Auto_Bak_Path; + dateTimePicker1.Value = Class1.Config.Auto_Bak_Time; + numericUpDown2.Value = Class1.Config.Auto_Bak_Day; + checkBox6.Checked = Class1.Config.Is_Bak_Send_Email; + + #region 增加所有微信机器人账号 + this.comboBoxEdit3.Properties.Items.Clear(); + //var weixinBases = Chat.Framework.ChatClient.WXClient.Values.ToList(); + var objList = new List() { "请选择机器人" }; + var robotWXInfos = session.Find("select * from fl_robot_info where type = 2"); + + if (robotWXInfos != null && robotWXInfos.Count != 0) + { + foreach (var item in robotWXInfos) + { + objList.Add(item.name); + } + } + this.comboBoxEdit3.Properties.Items.AddRange(objList); + #endregion + + #region 增加所有QQ机器人账号 + this.comboBoxEdit1.Properties.Items.Clear(); + //var qqBases = Chat.Framework.ChatClient.QQPool.QQClients.Values; + var objqqList = new List() { "请选择机器人" }; + var robotQQInfos = session.Find("select * from fl_robot_info where type = 1"); + if (robotQQInfos != null && robotQQInfos.Count != 0) + { + foreach (var item in robotQQInfos) + { + objqqList.Add(item.name); + } + } + this.comboBoxEdit1.Properties.Items.AddRange(objqqList); + #endregion + } + + private void STKEventLog_LogEvent(object sender, LogEvent e) + { + this.Invoke(new Action(() => + { + try + { + if (memoEdit5.Text.Length >= 1000000) + { + memoEdit5.Text = memoEdit5.Text.Remove(300); + } + memoEdit5.Text = $@" +{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:{e.Message.Trim()} +{memoEdit5.Text}"; + //memoEdit5.SelectionStart = memoEdit5.Text.Length; + } + catch (Exception ex) + { + ShowError($"日志异常:{ex.Message} - {ex.StackTrace}"); + } + })); + } + + public string RemoveEmoji(string text) + { + try + { + if (string.IsNullOrWhiteSpace(text)) return string.Empty; + if (Regex.IsMatch(text, @"^(\d+(\.\d+)?)$")) + return text; + //if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["RemoveWechatEmoji"]) && System.Configuration.ConfigurationManager.AppSettings["RemoveWechatEmoji"].ToUpper() == "FALSE") + //{ + // return text; + //} + //text = Regex.Replace(Regex.Replace(text, @"\%uD.{3}", ""), "[👃☺️☹️☠️✊✌️☝✋✍️♀️♂️]", ""); + foreach (var a in text) + { + byte[] bts = Encoding.UTF32.GetBytes(a.ToString()); + + if (bts[0].ToString() == "253" && bts[1].ToString() == "255") + { + text = text.Replace(a.ToString(), ""); + } + } + } + catch (Exception ex) + { + } + return text; + } + + private void MainForm_FormClosing(object sender, FormClosingEventArgs e) + { + try + { + Class1.Config.Is_Bak_Send_Email = checkBox6.Checked; + BackupAndImport.ECO.EventLog.LogEvent -= EventLog_LogEvent; + BackupAndImport.NianChu.EventLog.LogEvent -= NCEventLog_LogEvent; + Api.Framework.Tools.Util.Save(Class1.Config); + } + catch (Exception ex) + { + ShowError(ex); + } + } + + private void EventLog_LogEvent(object sender, BackupAndImport.ECO.Events.LogEvent e) + { + this.Invoke(new Action(() => + { + try + { + if (memoEdit3.Text.Length >= 1000) + { + memoEdit3.Text = memoEdit3.Text.Remove(300); + } + memoEdit3.Text = $@" +{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:{e.Message.Trim()} +{memoEdit3.Text}"; + //memoEdit3.SelectionStart = memoEdit3.Text.Length; + } + catch (Exception ex) + { + ShowError($"日志异常:{ex.Message} - {ex.StackTrace}"); + } + })); + } + + private void NCEventLog_LogEvent(object sender, LogEvent e) + { + this.Invoke(new Action(() => + { + try + { + if (memoEdit4.Text.Length >= 1000) + { + memoEdit4.Text = memoEdit4.Text.Remove(300); + } + memoEdit4.Text = $@" +{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:{e.Message.Trim()} +{memoEdit4.Text}"; + //memoEdit4.SelectionStart = memoEdit4.Text.Length; + } + catch (Exception ex) + { + ShowError($"日志异常:{ex.Message} - {ex.StackTrace}"); + } + })); + } + + #region 导入其他数据库 + string checkState = string.Empty; + private void simpleButton1_Click(object sender, EventArgs e) + { + try + { + if (comboBoxEdit2.SelectedIndex == 0) throw new Exception("请先选择要导入的软件名称"); + + if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) + { + bool isEnabled = false; + var path = folderBrowserDialog1.SelectedPath; + if (Directory.Exists(path)) + { + checkState = string.Empty; + + //string[] paths = BackupAndImport.Tools.GetFiles(path, "(?(数据库.db$)|(AliPro.db$)|(aliTools.db$)|(AlimamaPro.Framework.Configs.SQLConfig.config$)|(db.db$)|(积分.db$)|(订单.db$)|(lieke.db)|(AlimamaPro.Framework.Configs.Config))", -1); + bool isSeek = false; + + #region alitools + if (comboBoxEdit2.SelectedIndex == 1) + { + string[] paths = BackupAndImport.Tools.GetFiles(path, "(?(AliPro.db$)|(aliTools.db$)|(AlimamaPro.Framework.Configs.SQLConfig.config$)|(AlimamaPro.Framework.Configs.Config))", -1); + if (!string.IsNullOrEmpty(paths.FirstOrDefault(f => f.Contains("AliPro.db") || f.Contains("aliTools.db") || f.Contains("AlimamaPro.Framework.Configs.SQLConfig.config")))) + { + isSeek = true; + var sqlConfig = paths.FirstOrDefault(f => f.Contains("AlimamaPro.Framework.Configs.SQLConfig.config")); + var settingConfig = paths.FirstOrDefault(f => f.Contains("AlimamaPro.Framework.Configs.Config")); + if (sqlConfig != null && settingConfig != null) + { + var settingJson = File.ReadAllText(settingConfig); + var settingResult = HttpExtend.JsonToDictionary(settingJson); + if (settingResult != null && settingResult.ContainsKey("积分_换算比例")) + { + var ratio = settingResult["积分_换算比例"].ToString(); + if (ratio == "0") + { + ShowError("Alitools积分比例为0,终止操作~!"); + return; + } + simpleButton2.Tag = ratio; + } + else + { + ShowError("AlimamaPro.Framework.Configs.Config 配置不存在,终止操作~!"); + return; + } + var text = File.ReadAllText(sqlConfig); + var result = HttpExtend.JsonToDictionary(text); + var slqModel = result["SQLModel"].ToString(); + if (slqModel == "1") //SQLiteConfig + { + textEdit1.Text = paths.FirstOrDefault(f => f.ToLower().Contains("alipro.db")); + if (string.IsNullOrEmpty(textEdit1.Text)) + textEdit1.Text = paths.FirstOrDefault(f => f.ToLower().Contains("alitools.db")); + + checkState = conn.CheckSqliteLink(textEdit1.Text.Trim(), ""); + //label7.Text = "AliTools"; + label8.Text = "Sqlite"; + } + else if (slqModel == "2")//MySQLConfig + { + textEdit1.Text = sqlConfig; + var mySQLConfig = result["MySQLConfig"] as Dictionary; + checkState = conn.CheckMysqlLink(mySQLConfig["Host"].ToString(), mySQLConfig["Name"].ToString(), mySQLConfig["User"].ToString(), mySQLConfig["Pass"].ToString(), mySQLConfig["Port"].ToString()); //mysql链接是否成功 + //label7.Text = "AliTools"; + label8.Text = "MySql"; + } + isEnabled = true; + } + else + throw new Exception("选中的目录中未存在源数据库信息,请确定后重试"); + } + } + #endregion + + #region 安娜尔 + else if (comboBoxEdit2.SelectedIndex == 2) + { + string[] paths = BackupAndImport.Tools.GetFiles(path, "(?(数据库.db$))", -1); + textEdit1.Text = paths.FirstOrDefault(f => f.Contains("数据库.db")); + if (!string.IsNullOrEmpty(textEdit1.Text.Trim())) + { + isSeek = true; + checkState = conn.CheckSqliteLink(textEdit1.Text.Trim(), ""); + //label7.Text = "安娜尔"; + label8.Text = "Sqlite"; + } + } + #endregion + + #region 悠哉 + else if (comboBoxEdit2.SelectedIndex == 3) + { + string[] paths = BackupAndImport.Tools.GetFiles(path, "(?(数据库.db$)|(AliPro.db$)|(aliTools.db$)|(AlimamaPro.Framework.Configs.SQLConfig.config$)|(db.db$)|(积分.db$)|(订单.db$)|(lieke.db)|(AlimamaPro.Framework.Configs.Config))", -1); + if (!string.IsNullOrEmpty(paths.FirstOrDefault(f => f.Contains("db.db")))) + { + isSeek = true; + textEdit1.Text = paths.FirstOrDefault(f => f.Contains("db.db")); + + checkState = conn.CheckSqliteLink(textEdit1.Text.Trim(), ""); + //label7.Text = "悠哉"; + label8.Text = "Sqlite"; + } + } + #endregion + + #region 速推客 + else if (comboBoxEdit2.SelectedIndex == 4) + { + string[] paths = BackupAndImport.Tools.GetFiles(path, "(?(积分.db$))", -1); + + if (!string.IsNullOrEmpty(paths.FirstOrDefault(f => f.Contains("积分.db"))))//&& !string.IsNullOrEmpty(paths.FirstOrDefault(f => f.Contains("订单.db")))) //速推客 + { + isSeek = true; + textEdit1.Text = paths.FirstOrDefault(f => f.Contains("积分.db")); + + checkState = conn.CheckSqliteLink(textEdit1.Text.Trim(), ""); //速推客积分库 + //label7.Text = "速推客"; + label8.Text = "Sqlite"; + } + } + #endregion + + #region 猎客 + else if (comboBoxEdit2.SelectedIndex == 5) + { + string[] paths = BackupAndImport.Tools.GetFiles(path, "(?(lieke.db))", -1); + if (!string.IsNullOrEmpty(paths.FirstOrDefault(f => f.Contains("lieke.db")))) + { + isSeek = true; + textEdit1.Text = paths.FirstOrDefault(f => f.Contains("lieke.db")); + + checkState = conn.CheckSqliteLink(textEdit1.Text.Trim(), ""); + //label7.Text = "猎客"; + label8.Text = "Sqlite"; + } + } + #endregion + + #region 淘客喵 + else if (comboBoxEdit2.SelectedIndex == 6) + { + string[] paths = BackupAndImport.Tools.GetFiles(path, @"(?(data_\d+.db))", -1); + if (!string.IsNullOrEmpty(paths.FirstOrDefault(f => f.Contains("data_46349.db")))) + { + isSeek = true; + //textEdit1.Text = paths.FirstOrDefault(f => f.Contains("data_46349.db")); + textEdit1.Text = paths.FirstOrDefault(f => f.Contains("data_46349.db")); + + checkState = conn.CheckSqliteLink(textEdit1.Text.Trim(), ""); + //label7.Text = "淘客喵"; + label8.Text = "Sqlite"; + } + } + #endregion + + #region 安娜尔云控版 + else if (comboBoxEdit2.SelectedIndex == 7) + { + string[] paths = BackupAndImport.Tools.GetFiles(path, "(?(数据库.db$))", -1); + textEdit1.Text = paths.FirstOrDefault(f => f.Contains("数据库.db")); + if (!string.IsNullOrEmpty(textEdit1.Text.Trim())) + { + isSeek = true; + checkState = conn.CheckSqliteLink(textEdit1.Text.Trim(), ""); + //label7.Text = "安娜尔"; + label8.Text = "Sqlite"; + } + } + #endregion + + if (!isSeek && string.IsNullOrEmpty(checkState)) + checkState = "目录中没有找到数据库文件或配置文件"; + if (isSeek && string.IsNullOrEmpty(checkState)) + { + comboBoxEdit1.Enabled = isEnabled; + ShowSuccess("数据库链接成功!"); + } + else + { + //label7.Text = label8.Text = "请选择数据库"; + ShowError(checkState); + } + } + else + throw new Exception("选择的目录路径存在异常"); + } + } + catch (Exception ex) + { + ShowError(ex); + } + } + + private void simpleButton14_Click(object sender, EventArgs e) + { + try + { + //checkState = conn.CheckMysqlLink(mySQLConfig["Host"].ToString(), mySQLConfig["Name"].ToString(), mySQLConfig["User"].ToString(), mySQLConfig["Pass"].ToString(), mySQLConfig["Port"].ToString());//mysql链接是否成功 + checkState = conn.CheckMysqlLink(textEdit9.Text.Trim(), textEdit10.Text.Trim(), textEdit11.Text.Trim(), textEdit12.Text.Trim(), textEdit13.Text.Trim());//mysql链接是否成功 + + if (string.IsNullOrEmpty(checkState)) + { + comboBoxEdit1.Enabled = false; + label8.Text = "MySql"; + ShowSuccess("数据库链接成功!"); + } + else + { + //label7.Text = label8.Text = "请选择数据库"; + label8.Text = "请选择数据库"; + ShowError(checkState); + } + } + catch (Exception ex) + { + tempConfig = null; + ShowError(ex); + } + } + + SetConnectionConfig conn = new SetConnectionConfig(); //测试数据链接的对象 + + /// + /// 开始同步订单 + /// + /// + /// + private void simpleButton2_Click(object sender, EventArgs e) + { + try + { + if (comboBoxEdit2.SelectedIndex == 0) throw new Exception("请先选择要导入的软件名称"); + if (conn == null || conn.tempConfig == null) throw new Exception("请选择数据库~!"); + + //if (label7.Text == "AliTools") + if (comboBoxEdit2.SelectedIndex == 1) + { + if (comboBoxEdit3.SelectedIndex == 0 && comboBoxEdit1.SelectedIndex == 0) throw new Exception(@"请选择导入的对应机器人账号 +1.只导入微信请选择""微信对应机器人账号"" +2.只导入QQ请选择""QQ对应机器人账号"" +3.微信、QQ两个都导入请都选择 +注:一个数据库只能导入一次"); + } + else + { + if (comboBoxEdit3.SelectedIndex == 0) throw new Exception("请选择对应机器人账号"); + } + + + if (checkBox1.Checked || checkBox2.Checked) + { + comboBoxEdit1.Enabled = comboBoxEdit3.Enabled = simpleButton2.Enabled = false; + simpleButton2.Text = "同步中.."; + + //index = comboBox1.SelectedIndex; + TaskTool task = new TaskTool(); + task.AddTask(delegate + { + try + { + EventClient.StopParsing = false; + SynchronousMemberData(); + SynchronousBindTBOrderData(); + } + catch (Exception ex) + { + this.Invoke(new Action(delegate + { + ShowError(ex); + })); + } + finally + { + EventClient.StopParsing = true; + } + }); + task.Start(1, callback); + + } + else + throw new Exception("至少选择一项导入任务"); + } + catch (Exception ex) + { + ShowError(ex.Message); + comboBoxEdit1.Enabled = comboBoxEdit3.Enabled = simpleButton2.Enabled = true; + } + } + + private void callback(IAsyncResult ar) + { + try + { + this.Invoke(new Action(delegate + { + comboBoxEdit3.Enabled = simpleButton2.Enabled = true; + simpleButton2.Text = "开始同步"; + ShowSuccess($"同步操作已执行完毕!"); + })); + } + catch (Exception ex) + { + ShowError(ex); + } + } + + /// + /// 将新用的id和旧的id保存起来.用于之后的修改上级id + /// + List pkts = new List(); + private object objLock = new object(); + private object lock_obj = new object(); + private void AddJindu(string text = "", int max = 0) + { + base.UpdateUI(() => + { + try + { + lock (lock_obj) + { + if (!string.IsNullOrEmpty(text) && max == 0) + { + label31.Text = text; + } + else if (!string.IsNullOrEmpty(text) && max != 0) + { + label31.Text = text; + this.progressBar1.Value = 0; + this.progressBar1.Maximum = max; + } + else + { + if (this.progressBar1.Value < this.progressBar1.Maximum) this.progressBar1.Value++; + label31.Text = $"{this.progressBar1.Value}/{this.progressBar1.Maximum}"; + } + } + + Application.DoEvents(); + } + catch (Exception) + { + } + + }); + } + + /// + /// 同步会员信息 + /// + private void SynchronousMemberData() + { + try + { + if (checkBox1.Checked) //会员数据同步 + { + var session = ApiClient.GetSession(); + session.BeginTransaction(); + var srcSession = ApiClient.GetSession(conn.tempConfig, false); + pkts = new List(); + try + { + + #region AliTools + + //if (label7.Text == "AliTools") + if (comboBoxEdit2.SelectedIndex == 1) + { + if (!srcSession.TableExist()) throw new Exception(@"导入会员数据失败,可能原因:会员信息执行过一次导入操作"); + AddJindu("正在读取会员数据..."); + List old_member_infos; + if (comboBoxEdit3.SelectedIndex != 0 && comboBoxEdit1.SelectedIndex != 0) + old_member_infos = srcSession.Find("select * from MemberInfo");//预导入的会员数据 + else + old_member_infos = srcSession.Find("select * from MemberInfo where UserType = @UserType", new { UserType = comboBoxEdit3.SelectedIndex != 0 ? 1 : 0 });//预导入的会员数据 1是微信,0是QQ + if (old_member_infos.Count > 0) AddJindu("导入会员数据中...", old_member_infos.Count); + + if (old_member_infos != null && old_member_infos.Count != 0) + { + List member_infos = null; + if (comboBoxEdit3.SelectedIndex != 0 && comboBoxEdit1.SelectedIndex != 0) + member_infos = session.Queryable().ToList(); + else + { + var chatType = comboBoxEdit3.SelectedIndex != 0 ? ChatType.微信 : ChatType.QQ; + member_infos = session.Queryable().Where(f => f.robot_type == chatType).ToList(); + } + + var Exists_old_members = old_member_infos.Where(old => member_infos.Exists(goal => goal.username == old.UserName)).ToList();//已经存在的用户,直接加积分 + var UnExists_old_members = old_member_infos.Where(old => !member_infos.Exists(goal => goal.username == old.UserName)).ToList();//不存在的用户,创建用户对象 + + var ratio = 1;//积分比例 + if (simpleButton2.Tag != null) + ratio = int.Parse(simpleButton2.Tag as string); + + //将所有的订单结算 用户id查询到集合中 + var userIds = srcSession.Find("select userId from AliOrder where status = '订单结算' and userId != 0", new { }); + + #region 已经存在的用户 + if (Exists_old_members.Count != 0) + { + List memberInfos = new List();//保存存在的用户对象 + foreach (var oldmember in Exists_old_members) + { + long finishOrder = 0;//已完成订单数量 + if (userIds != null) + finishOrder = userIds.Count(f => f == oldmember.Id); + + double point = double.Parse((oldmember.Point / ratio).ToString("#0.00 ")); + double ticPoint = double.Parse((oldmember.TicPoint / ratio).ToString("#0.00 ")); + double sumPoint = double.Parse((oldmember.SumPoint / ratio).ToString("#0.00 ")); + + var member = member_infos.FirstOrDefault(f => f.username == oldmember.UserName && f.robot_type == (oldmember.UserType == 1 ? ChatType.微信 : ChatType.QQ));//获取对应的对象 + if (member == null) continue; + member.cur_point = (double)((decimal)member.cur_point + (decimal)point); + member.ext_point = (double)((decimal)member.ext_point + (decimal)ticPoint); + member.sum_point = (double)((decimal)member.sum_point + (decimal)sumPoint); + member.finish_order = (long)((decimal)member.finish_order + (decimal)finishOrder); + member.bind_order = member.finish_order; + member.remark = member.remark + (string.IsNullOrEmpty(member.remark) ? "" : " -- ") + oldmember.Remark; + + if (string.IsNullOrWhiteSpace(member.robot_name)) + { + member.robot_name = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + } + + memberInfos.Add(member); + + pkts.Add(new PrimaryKeyTemp() { NewId = member.id, UserName = oldmember.UserName, OldId = oldmember.Id }); + AddJindu(); + } + var _num1 = (int)Math.Ceiling((decimal)memberInfos.Count / 500m); + for (int o = 1; o <= _num1; o++) + { + var _list = memberInfos.Skip((o - 1) * 500).Take(500).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + } + } + #endregion + + #region 不存在的用户 + if (UnExists_old_members.Count != 0) + { + List unMemberInfos = new List();//保存不存在的用户对象 + foreach (var oldmember in UnExists_old_members) + { + long finishOrder = 0;//已完成订单数量 + + if (userIds != null) + finishOrder = userIds.Count(f => f == oldmember.Id); + + double point = double.Parse(((decimal)oldmember.Point / (decimal)ratio).ToString("#0.00 ")); + double ticPoint = double.Parse(((decimal)oldmember.TicPoint / (decimal)ratio).ToString("#0.00 ")); + double sumPoint = double.Parse(((decimal)oldmember.SumPoint / (decimal)ratio).ToString("#0.00 ")); + + var member = new fl_member_info() { crt_time = oldmember.CrtTime, robot_type = (oldmember.UserType == 1 ? ChatType.微信 : ChatType.QQ), username = oldmember.UserName, usernick = oldmember.NickName.Replace("'", "''"), cur_point = point, sum_point = sumPoint, ext_point = ticPoint, remark = oldmember.Remark, inviter_id = 0, finish_order = finishOrder, bind_order = finishOrder, robot_name = oldmember.UserType == 1 ? comboBoxEdit3.Text : comboBoxEdit1.Text, alipay_name = "", alipay_num = "" }; + var groups = session.FindGroups(); + if (groups.Count != 0) + member.group_id = groups[0].id; + if (unMemberInfos.FirstOrDefault(f => f.username == member.username) == null) + unMemberInfos.Add(member); + else + { } + pkts.Add(new PrimaryKeyTemp() { NewId = 0, UserName = oldmember.UserName, OldId = oldmember.Id }); + AddJindu(); + } + var _num1 = (int)Math.Ceiling((decimal)unMemberInfos.Count / 500m); + for (int o = 1; o <= _num1; o++) + { + var _list = unMemberInfos.Skip((o - 1) * 500).Take(500).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + } + } + #endregion + + #region 绑定上下级关系 + //member_infos = session.Find("select * from fl_member_info");//现有的会员数据 + + if (comboBoxEdit3.SelectedIndex != 0 && comboBoxEdit1.SelectedIndex != 0) + member_infos = session.Queryable().ToList();//现有的会员数据 + else + { + var chatType = comboBoxEdit3.SelectedIndex != 0 ? ChatType.微信 : ChatType.QQ; + member_infos = session.Queryable().Where(f => f.robot_type == chatType).ToList(); + } + + + foreach (var item in pkts) + item.NewId = member_infos.FirstOrDefault(f => f.username == item.UserName).id;//增加fl_member_info对应的id + + var allRecIdMember = old_member_infos.Where(f => f.RecId != 0).OrderBy(f => f.RecId).ThenBy(f => f.Id).ToList(); //2.获取预导入集合中所有有上级的用户. + + if (allRecIdMember != null && allRecIdMember.Count != 0) + { + + AddJindu("绑定上下级关系中...", allRecIdMember.Count); + //member_infos = session.Find("select * from fl_member_info");//现有的会员数据 + foreach (var item in allRecIdMember) + { + var value = pkts.FirstOrDefault(f => f.OldId == item.Id);//获取... + if (value != null) + { + var oldmember = old_member_infos.FirstOrDefault(f => f.Id == value.OldId); + if (oldmember != null) + { + var pkt = pkts.FirstOrDefault(f => f.OldId == oldmember.RecId);//通过对比老的id获取新的id值 + if (pkt != null) + { + var member = member_infos.FirstOrDefault(f => f.id == value.NewId); + if (member != null && member.inviter_id == 0) + { + member.inviter_id = pkt.NewId;//赋值推荐人 + + session.SaveOrUpdate(member); + } + else + { } + } + else + { } + } + else + { } + } + else + { } + + AddJindu(); + } + } + #endregion + AddJindu("保存会员数据中.."); + if (label8.Text.ToLower() == "sqlite") + srcSession.ExcuteSQL("ALTER TABLE 'MemberInfo' RENAME TO 'MemberInfo_备份'"); + else if (label8.Text.ToLower() == "mysql") + srcSession.ExcuteSQL("ALTER TABLE MemberInfo RENAME TO MemberInfo_备份"); + session.Commit(); + AddJindu("保存会员数据成功"); + //base.UpdateUI(() =>{ label31.Text = "导入会员数据完成";}); + //this.Invoke(new Action(delegate + //{ + // ShowSuccess($"会员数量预导入数据量:{old_member_infos.Count}条,成功导入:{old_member_infos.Count}"); + //})); + return; + } + else + throw new Exception(@"导入会员数据失败,可能原因:选中数据库中会员数据为空"); + } + #endregion + + #region 安娜儿 + //else if (label7.Text == "安娜尔") + else if (comboBoxEdit2.SelectedIndex == 2) + { + try + { + if (!srcSession.TableExist()) throw new Exception(@"导入会员数据失败,可能原因:会员信息执行过一次导入操作");//检测表是否存在 + AddJindu("正在读取会员数据..."); + srcSession.ExcuteSQL("DROP TABLE IF EXISTS '会员信息A'"); + srcSession.ExcuteSQL("ALTER TABLE 会员信息 RENAME TO 会员信息A"); + srcSession.ExcuteSQL(@"CREATE TABLE '会员信息'( + '对应ID' TEXT NOT NULL, + '微信名字' varchar(255) DEFAULT '', + '姓名' varchar(255) DEFAULT '', + '支付宝' varchar(255) DEFAULT '', + '总提现金额' double DEFAULT 0, + '可提现金额' double DEFAULT 0, + '未收货金额' double DEFAULT 0, + '总成功订单' double DEFAULT 0, + '签到次数' double DEFAULT 0, + '签到奖励' double DEFAULT 0, + '签到时间' varchar(255) DEFAULT '', + '推广奖励' double DEFAULT 0, + '定向比例' varchar(255) DEFAULT '', + '独立PID' varchar(255) DEFAULT '', + '注册时间' varchar(255) DEFAULT '', + '公众号对应ID' varchar(255) DEFAULT '', + PRIMARY KEY('对应ID' ASC) + ); "); + srcSession.ExcuteSQL("INSERT INTO 会员信息 SELECT 对应ID,微信名字,姓名,支付宝,总提现金额,可提现金额,未收货金额,总成功订单,签到次数,签到奖励,签到时间,推广奖励,定向比例,独立PID,注册时间,公众号对应ID FROM 会员信息A"); + srcSession.ExcuteSQL("DROP TABLE '会员信息A'"); + + var member_infos = srcSession.Queryable().ToList(); + var current_member_infos = session.Find("select * from fl_member_info");//目标数据库中获取所有的会员数据 + if (member_infos.Count > 0) AddJindu("导入会员数据中...", member_infos.Count); + + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + //var tixian = decimal.Parse(session.FindTable(@"select uid,COALESCE(sum(point),0) from fl_point_hist where '2019-06-15 16:40:00' <= crt_time and crt_time <= '2019-06-16 15:00:00' and point < 0 and uid = @uid group by uid").Rows[0]["num"].ToString()); + + foreach (var item in member_infos) + { + var user = current_member_infos.FirstOrDefault(f => f.username == item.对应ID && f.robot_type == ChatType.微信); + if (user == null) + { + user = new fl_member_info() + { + username = item.对应ID, + robot_type = ChatType.微信, + usernick = item.微信名字.Replace("'", "''"), + cur_point = item.可提现金额 == null ? 0d : (double)item.可提现金额, + sum_point = item.总提现金额 == null ? 0d : (double)item.总提现金额, + ext_point = item.推广奖励 == null ? 0d : (double)item.推广奖励, + finish_order = (long)item.总成功订单, + bind_order = (long)item.总成功订单, + robot_name = comboBoxEdit3.Text, + alipay_name = string.Empty, + alipay_num = string.Empty, + remark = string.Empty + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + user.group_id = groups[0].id; + unMemberInfos.Add(user); + AddJindu(); + } + else + { + user.cur_point = (double)((decimal)user.cur_point + (item.可提现金额 == null ? 0m : (decimal)item.可提现金额)); + user.sum_point = user.sum_point + (item.总提现金额 == null ? 0d : (double)item.总提现金额); + user.ext_point = user.ext_point + (item.推广奖励 == null ? 0d : (double)item.推广奖励); + user.finish_order = user.finish_order + (long)item.总成功订单; + user.bind_order = user.finish_order; + if (string.IsNullOrWhiteSpace(user.robot_name)) + { + user.robot_name = comboBoxEdit3.Text; + user.robot_type = ChatType.微信; + } + memberInfos.Add(user); + AddJindu(); + } + } + if (unMemberInfos.Count != 0) + session.Insertable(unMemberInfos.ToArray()).ExecuteCommand(); + if (memberInfos.Count != 0) + session.Updateable(memberInfos.ToArray()).ExecuteCommand(); + + //绑定上下级 + if (member_infos != null && member_infos.Count != 0) + { + AddJindu("绑定上下级关系中...", member_infos.Count); + var newDbs = session.Queryable().ToList(); + var old = srcSession.Find<上下级管理>("select * from 上下级管理"); + foreach (var item in old) + { + var new_user = newDbs.FirstOrDefault(f => f.username == item.下级对应ID); + if (new_user != null && new_user.inviter_id == 0) + { + var inviter = newDbs.FirstOrDefault(f => f.username == item.上级对应ID);//找出上级账号 + if (inviter != null) + { + new_user.inviter_id = inviter.id;//填写上级ID + session.Updateable(new { inviter_id = inviter.id }).Where(f => f.id == new_user.id).ExecuteCommand(); + } + } + AddJindu(); + } + AddJindu("保存会员数据中.."); + srcSession.ExcuteSQL("ALTER TABLE '会员信息' RENAME TO '会员信息_备份'"); + AddJindu("保存会员数据成功"); + } + session.Commit(); + return; + } + catch (Exception ex) + { + throw new Exception($"数据异常,同步终止.{ex.Message}"); + } + } + #endregion + + #region 速推客 + //else if (label7.Text == "速推客") + else if (comboBoxEdit2.SelectedIndex == 4) + { + try + { + if (!srcSession.TableExist()) throw new Exception(@"导入会员数据失败,可能原因:会员信息执行过一次导入操作");//检测表是否存在 + AddJindu("正在读取会员数据..."); + var member_infos = srcSession.Find("select * from 会员信息"); //获取预导入表的所有数据 + var current_member_infos = session.Find("select * from fl_member_info");//目标数据库中获取所有的会员数据 + if (member_infos.Count > 0) AddJindu("导入会员数据中...", member_infos.Count); + + //var tableNum = srcSession.FindTable("select count(ID) as num from 订单管理 where ID = @username and 订单状态 = '订单结算' GROUP BY ID,订单状态", new { username = item.ID }); + + var usernames = srcSession.Find("select ID from 订单管理 where 订单状态 = '订单结算'", new { }); + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + foreach (var item in member_infos) + { + var user = current_member_infos.FirstOrDefault(f => f.username == item.ID && f.robot_type == ChatType.微信);//判断是否存在存在给用户的数据 + long finishOrder = 0;//已完成订单数量 + //var tableNum = srcSession.FindTable("select count(ID) as num from 订单管理 where ID = @username and 订单状态 = '订单结算' GROUP BY ID,订单状态", new { username = item.ID }); + //if (tableNum.Rows.Count != 0) + // finishOrder = long.Parse(tableNum.Rows[0]["num"].ToString()); + if (usernames != null) + finishOrder = usernames.Count(f => f.username == item.ID); + + if (user == null) + { + decimal _cur_point = 0; + decimal.TryParse(item.结算金额, out _cur_point); + user = new fl_member_info() + { + username = item.ID, + robot_type = ChatType.微信, + usernick = item.名称.Replace("'", "''"), + cur_point = (double)((string.IsNullOrWhiteSpace(item.结算金额) ? 0m : _cur_point) + (string.IsNullOrWhiteSpace(item.签到奖励) ? 0m : decimal.Parse(item.签到奖励)) + (string.IsNullOrWhiteSpace(item.推广奖励) ? 0m : decimal.Parse(item.推广奖励)) + (string.IsNullOrWhiteSpace(item.额外奖励) ? 0m : decimal.Parse(item.额外奖励)) - (string.IsNullOrWhiteSpace(item.已提现金额) ? 0m : decimal.Parse(item.已提现金额))), + sum_point = (double)(string.IsNullOrWhiteSpace(item.已提现金额) ? 0m : decimal.Parse(item.已提现金额)), + ext_point = (double)(string.IsNullOrWhiteSpace(item.推广奖励) ? 0m : decimal.Parse(item.推广奖励)), + finish_order = finishOrder, + bind_order = finishOrder, + robot_name = comboBoxEdit3.Text, + alipay_name = string.Empty, + alipay_num = string.Empty, + remark = string.Empty + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + user.group_id = groups[0].id; + unMemberInfos.Add(user); + AddJindu(); + } + else + { + decimal _cur_point = 0; + decimal.TryParse(item.结算金额, out _cur_point); + + user.cur_point = user.cur_point + (double)((string.IsNullOrWhiteSpace(item.结算金额) ? 0m : _cur_point) + (string.IsNullOrWhiteSpace(item.签到奖励) ? 0m : decimal.Parse(item.签到奖励)) + (string.IsNullOrWhiteSpace(item.推广奖励) ? 0m : decimal.Parse(item.推广奖励)) + (string.IsNullOrWhiteSpace(item.额外奖励) ? 0m : decimal.Parse(item.额外奖励)) - (string.IsNullOrWhiteSpace(item.已提现金额) ? 0m : decimal.Parse(item.已提现金额))); + user.sum_point = user.sum_point + (double)(string.IsNullOrWhiteSpace(item.已提现金额) ? 0m : decimal.Parse(item.已提现金额)); + user.ext_point = user.ext_point + (double)(string.IsNullOrWhiteSpace(item.推广奖励) ? 0m : decimal.Parse(item.推广奖励)); + user.finish_order = user.finish_order + finishOrder; + user.bind_order = user.finish_order; + + if (string.IsNullOrWhiteSpace(user.robot_name)) + { + user.robot_name = comboBoxEdit3.Text; + user.robot_type = ChatType.微信; + } + memberInfos.Add(user); + AddJindu(); + } + //session.SaveOrUpdate(user); + } + + if (unMemberInfos.Count != 0) + { + //session.Insertable(unMemberInfos.ToArray()).ExecuteCommand(); + var _num = (int)Math.Ceiling((decimal)unMemberInfos.Count / 500m); + + for (int o = 1; o <= _num; o++) + { + var _list = unMemberInfos.Skip((o - 1) * 500).Take(500).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"用户表 保存中...{_num - o}"); + } + + } + + if (memberInfos.Count != 0) + { + //session.Updateable(memberInfos.ToArray()).ExecuteCommand(); + var _num = (int)Math.Ceiling((decimal)memberInfos.Count / 500m); + + for (int o = 1; o <= _num; o++) + { + var _list = memberInfos.Skip((o - 1) * 500).Take(500).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"用户表2 保存中...{_num - o}"); + } + } + + //绑定上下级 + if (member_infos != null && member_infos.Count != 0) + { + AddJindu("绑定上下级关系中...", member_infos.Count); + var newDbs = session.Find("select * from fl_member_info"); + var old = srcSession.Find<代理管理>("select * from 代理管理"); + foreach (var item in newDbs) + { + AddJindu(); + if (item.inviter_id != 0) continue; + if (old != null && old.Count != 0) + { + //Console.WriteLine($"{item.username},{item.usernick}"); + var i = old.FirstOrDefault(f => f.下级ID == item.username); + if (i != null) + { + var inviter = newDbs.FirstOrDefault(f => f.username == i.上级ID);//找出上级账号 + if (inviter != null) + { + item.inviter_id = inviter.id;//填写上级ID + + session.SaveOrUpdate(item); + } + } + } + } + AddJindu("保存会员数据中.."); + srcSession.ExcuteSQL("ALTER TABLE '会员信息' RENAME TO '会员信息_备份'"); + AddJindu("保存会员数据成功"); + } + session.Commit(); + //this.Invoke(new Action(delegate + //{ + // ShowSuccess($"会员数量预导入数据量:{member_infos.Count}条,成功导入:{member_infos.Count}"); + //})); + return; + } + catch (Exception ex) + { + throw new Exception($"数据异常,同步终止.{ex.Message}"); + } + } + #endregion + + #region 悠哉 + //else if (label7.Text == "悠哉") + else if (comboBoxEdit2.SelectedIndex == 3) + { + if (!srcSession.TableExist()) throw new Exception(@"导入会员数据失败,可能原因:会员信息执行过一次导入操作"); + AddJindu("正在读取会员数据..."); + var old_member_infos = srcSession.Find("select * from member where wxid != ''");//预导入的会员数据 + if (old_member_infos != null && old_member_infos.Count != 0) + { + if (old_member_infos.Count > 0) AddJindu("导入会员数据中...", old_member_infos.Count); + var member_infos = session.Find("select * from fl_member_info");//现有的会员数据 + + + var TBOrders = srcSession.Find(@"select userid from orders where orderstatus = '1' and userid is not null", new { }); + var PDDOrders = srcSession.Find(@"select userid from pddorders where orderstatus = '1' and userid is not null", new { }); + var JDOrders = srcSession.Find(@"select userid from jdorders where orderstatus = '1' and userid is not null", new { }); + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + foreach (var oldmember in old_member_infos) + { + var member = member_infos.FirstOrDefault(f => f.username == oldmember.wxid && f.robot_type == (oldmember.usertype == 1 ? ChatType.微信 : ChatType.QQ));//现有的集合中是否已经存在预导入的会员 + long finishOrder = 0;//已完成订单数量 + if (TBOrders.Count != 0)//淘宝订单完成数 + finishOrder += TBOrders.Count(f => f == oldmember.uid); + if (PDDOrders.Count != 0)//拼多多订单完成数 + finishOrder += PDDOrders.Count(f => f == oldmember.uid); + if (JDOrders.Count != 0)//京东订单完成数 + finishOrder += JDOrders.Count(f => f == oldmember.uid); + + double ticPoint = 0; + double sumPoint = 0; + oldmember.balance = (oldmember.balance.ToString().ToLower().Contains("e-") ? null : oldmember.balance); + double point = oldmember.balance == null ? 0d : (double)oldmember.balance; + + if (member == null) + { + member = new fl_member_info() + { + crt_time = DateTime.Parse(oldmember.regtime.Replace("/星期一", "").Replace("/星期二", "").Replace("/星期三", "").Replace("/星期四", "").Replace("/星期五", "").Replace("/星期六", "").Replace("/星期日", "")), + robot_type = ChatType.微信,//oldmember.usertype = 1 为普通用户 2 为客户设置的vip用户 + username = oldmember.wxid, + usernick = oldmember.nickname.Replace("'", "''"), + cur_point = point, + sum_point = sumPoint, + ext_point = ticPoint, + inviter_id = 0, + finish_order = finishOrder, + bind_order = finishOrder, + remark = string.Empty, + robot_name = oldmember.usertype == 1 ? comboBoxEdit3.Text : comboBoxEdit1.Text, + alipay_name = string.Empty, + alipay_num = string.Empty + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + member.group_id = groups[0].id; + unMemberInfos.Add(member); + } + else + { + member.cur_point = member.cur_point + point; + member.ext_point = member.ext_point + ticPoint; + member.sum_point = member.sum_point + sumPoint; + member.finish_order = member.finish_order + finishOrder; + member.bind_order = member.finish_order; + member.remark = string.Empty; + + if (string.IsNullOrWhiteSpace(member.robot_name)) + { + member.robot_name = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + //member.robot_name = comboBoxEdit3.Text; + //member.robot_type = ChatType.微信; + } + memberInfos.Add(member); + } + AddJindu(); + pkts.Add(new PrimaryKeyTemp() { NewId = member.id, UserName = oldmember.wxid, OldId = (int)oldmember.uid }); + } + if (unMemberInfos.Count != 0) + session.Insertable(unMemberInfos.ToArray()).ExecuteCommand(); + if (memberInfos.Count != 0) + session.Updateable(memberInfos.ToArray()).ExecuteCommand(); + + + member_infos = session.Queryable().ToList();//现有的会员数据 + + foreach (var pkt in pkts) + pkt.NewId = member_infos.FirstOrDefault(f => f.username == pkt.UserName).id;//增加fl_member_info对应的id + + var allRecIdMember = old_member_infos.Where(f => f.trjid != 0).OrderBy(f => f.trjid).ThenBy(f => f.uid).ToList(); //2.获取预导入集合中所有有上级的用户. + + if (allRecIdMember != null && allRecIdMember.Count != 0) + { + AddJindu("绑定上下级关系中...", allRecIdMember.Count); + member_infos = session.Find("select * from fl_member_info");//现有的会员数据 + foreach (var item in allRecIdMember) + { + AddJindu(); + var value = pkts.FirstOrDefault(f => f.OldId == item.uid);//获取... + if (value != null) + { + var oldmember = old_member_infos.FirstOrDefault(f => f.uid == value.OldId); + if (oldmember != null) + { + var pkt = pkts.FirstOrDefault(f => f.OldId == oldmember.trjid);//通过对比老的id获取新的id值 + if (pkt != null) + { + var member = member_infos.FirstOrDefault(f => f.id == value.NewId); + if (member != null && member.inviter_id == 0) + { + member.inviter_id = pkt.NewId;//赋值推荐人 + + session.SaveOrUpdate(member); + } + else + { } + } + else + { } + } + else + { } + } + else + { } + } + } + AddJindu("保存会员数据中.."); + if (label8.Text.ToLower() == "sqlite") + srcSession.ExcuteSQL("ALTER TABLE 'member' RENAME TO 'member_备份'"); + else if (label8.Text.ToLower() == "mysql") + srcSession.ExcuteSQL("ALTER TABLE member RENAME TO member_备份"); + AddJindu("保存会员数据成功"); + session.Commit(); + //this.Invoke(new Action(delegate + //{ + // ShowSuccess($"会员数量预导入数据量:{old_member_infos.Count}条,成功导入:{old_member_infos.Count}"); + //})); + return; + } + else + throw new Exception(@"导入会员数据失败,可能原因:选中数据库中会员数据为空"); + } + #endregion + + #region 猎客 + //else if (label7.Text == "猎客") + else if (comboBoxEdit2.SelectedIndex == 5) + { + try + { + if (!srcSession.TableExist()) throw new Exception(@"导入会员数据失败,可能原因:会员信息执行过一次导入操作");//检测表是否存在 + //var member_infos = srcSession.Find("select * from Member"); //获取预导入表的所有数据 + AddJindu("正在读取会员数据..."); + var member_infos = srcSession.Queryable().ToList(); + var current_member_infos = session.Find("select * from fl_member_info");//目标数据库中获取所有的会员数据 + if (member_infos.Count > 0) AddJindu("导入会员数据中...", member_infos.Count); + + var TBuserNames = srcSession.Find("select lkid from PaymentDetail where payStatusInfo = '订单结算'", new { }); + var JDuserNames = srcSession.Find("select lkid from JDOrder where payStatusInfo = '已结算'", new { }); + var PDDuserNames = srcSession.Find("select lkid from PddOrder where payStatusInfo = '已结算'", new { }); + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + foreach (var item in member_infos) + { + var user = current_member_infos.FirstOrDefault(f => f.username == item.lkid && f.robot_type == ChatType.微信); + + long finishOrder = 0;//已完成订单数量 + if (PDDuserNames.Count != 0) + finishOrder += PDDuserNames.Count(f => f.username == item.lkid); + if (JDuserNames.Count != 0) + finishOrder += JDuserNames.Count(f => f.username == item.lkid); + if (TBuserNames.Count != 0) + finishOrder += TBuserNames.Count(f => f.username == item.lkid); + + if (user == null) + { + if (item.lkid.Length > 30) + continue; + user = new fl_member_info() + { + username = item.lkid, + robot_type = ChatType.微信, + usernick = item.usernick.Replace("'", "''"), + cur_point = item.ketixianMoney == null ? 0.00 : (double)item.ketixianMoney, + sum_point = item.yitixianMoney == null ? 0.00 : (double)item.yitixianMoney, + ext_point = 0, + finish_order = finishOrder, + bind_order = finishOrder, + robot_name = comboBoxEdit3.Text, + alipay_name = string.Empty, + alipay_num = string.Empty, + remark = string.Empty + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + user.group_id = groups[0].id; + unMemberInfos.Add(user); + AddJindu(); + } + else + { + user.cur_point = user.cur_point + (item.ketixianMoney == null ? 0.00 : (double)item.ketixianMoney); + user.sum_point = user.sum_point + (item.yitixianMoney == null ? 0.00 : (double)item.yitixianMoney); + user.ext_point = user.ext_point; + user.finish_order = user.finish_order + finishOrder; + user.bind_order = user.finish_order; + + if (string.IsNullOrWhiteSpace(user.robot_name)) + { + user.robot_name = comboBoxEdit3.Text; + user.robot_type = ChatType.微信; + } + memberInfos.Add(user); + AddJindu(); + } + + //session.SaveOrUpdate(user); + } + if (unMemberInfos.Count != 0) + session.Insertable(unMemberInfos.ToArray()).ExecuteCommand(); + if (memberInfos.Count != 0) + session.Updateable(memberInfos.ToArray()).ExecuteCommand(); + + + //绑定上下级 + if (member_infos != null && member_infos.Count != 0) + { + AddJindu("绑定上下级关系中...", member_infos.Count); + var newDbs = session.Find("select * from fl_member_info"); + var old = srcSession.Find("select * from groupInvite"); + foreach (var item in newDbs) + { + AddJindu(); + if (item.inviter_id != 0) continue; + if (old != null && old.Count != 0) + { + //Console.WriteLine($"{item.username},{item.usernick}"); + var i = old.FirstOrDefault(f => f.inviteeLkid == item.username); + if (i != null) + { + var inviter = newDbs.FirstOrDefault(f => f.username == i.inviterLkid);//找出上级账号 + if (inviter != null) + { + item.inviter_id = inviter.id;//填写上级ID + + session.SaveOrUpdate(item); + } + } + } + } + AddJindu("保存会员数据中.."); + //srcSession.ExcuteSQL("ALTER TABLE 'Member' RENAME TO 'Member_备份'"); + if (label8.Text.ToLower() == "sqlite") + srcSession.ExcuteSQL("ALTER TABLE 'Member' RENAME TO 'Member_备份'"); + else if (label8.Text.ToLower() == "mysql") + srcSession.ExcuteSQL("ALTER TABLE Member RENAME TO Member_备份"); + AddJindu("保存会员数据成功"); + } + session.Commit(); + //this.Invoke(new Action(delegate + //{ + // ShowSuccess($"会员数量预导入数据量:{member_infos.Count}条,成功导入:{member_infos.Count}"); + //})); + return; + } + catch (Exception ex) + { + throw new Exception($"数据异常,同步终止.{ex.Message}"); + } + } + #endregion + + #region 淘某喵 + //else if (label7.Text == "淘某喵") + else if (comboBoxEdit2.SelectedIndex == 6) + { + try + { + if (!srcSession.TableExist()) throw new Exception(@"导入会员数据失败,可能原因:会员信息执行过一次导入操作");//检测表是否存在 + AddJindu("正在读取会员数据..."); + + var member_infos = srcSession.Queryable().ToList(); + var current_member_infos = session.Find("select * from fl_member_info");//目标数据库中获取所有的会员数据 + if (member_infos.Count > 0) AddJindu("导入会员数据中...", member_infos.Count); + + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + //var tixian = decimal.Parse(session.FindTable(@"select uid,COALESCE(sum(point),0) from fl_point_hist where '2019-06-15 16:40:00' <= crt_time and crt_time <= '2019-06-16 15:00:00' and point < 0 and uid = @uid group by uid").Rows[0]["num"].ToString()); + + foreach (var item in member_infos) + { + var user = current_member_infos.FirstOrDefault(f => f.username == item.wxid && f.robot_type == ChatType.微信); + var coins = (item.frozen_coins == null ? 0d : (double)item.frozen_coins); + if (user == null) + { + user = new fl_member_info() + { + username = item.wxid, + robot_type = ChatType.微信, + usernick = item.name.Replace("'", "''"), + cur_point = item.coins == null ? 0d + coins : (double)item.coins + coins, + sum_point = 0d, + ext_point = 0d, + finish_order = item.purchase_volume == null ? 0L : (long)item.purchase_volume, + bind_order = item.purchase_volume == null ? 0L : (long)item.purchase_volume, + robot_name = comboBoxEdit3.Text, + alipay_name = string.Empty, + alipay_num = string.Empty, + remark = string.Empty + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + user.group_id = groups[0].id; + unMemberInfos.Add(user); + AddJindu(); + } + else + { + user.cur_point = (double)((decimal)user.cur_point + (decimal)(item.coins == null ? 0d + coins : (double)item.coins + coins)); + //user.sum_point = user.sum_point + (item.总提现金额 == null ? 0d : (double)item.总提现金额); + //user.ext_point = user.ext_point + (item.推广奖励 == null ? 0d : (double)item.推广奖励); + user.finish_order = user.finish_order + (item.purchase_volume == null ? 0L : (long)item.purchase_volume); + user.bind_order = user.finish_order; + + if (string.IsNullOrWhiteSpace(user.robot_name)) + { + user.robot_name = comboBoxEdit3.Text; + user.robot_type = ChatType.微信; + } + memberInfos.Add(user); + AddJindu(); + } + } + if (unMemberInfos.Count != 0) + session.Insertable(unMemberInfos.ToArray()).ExecuteCommand(); + if (memberInfos.Count != 0) + session.Updateable(memberInfos.ToArray()).ExecuteCommand(); + + //绑定上下级 + if (member_infos != null && member_infos.Count != 0) + { + AddJindu("获取所有的上级信息..."); + var superiors = member_infos.GroupBy(f => f.superior).Select(f => f.Key).Where(f => !string.IsNullOrWhiteSpace(f)).ToList(); + current_member_infos = session.Find("select * from fl_member_info");//重新获取用户列表 + Dictionary inviters = new Dictionary();//上级用户微信号与对应的id + foreach (var item in superiors) + { + var member = current_member_infos.FirstOrDefault(f => f.username == item); + if (member != null) + inviters.Add(item, member.id); + } + AddJindu("获取的上级信息完毕"); + + AddJindu("整理的需要绑定上级的用户..."); + var wantBindInviterMembers = member_infos.Where(f => !string.IsNullOrWhiteSpace(f.superior)).ToList();//需要绑定上级的用户 + AddJindu("需要绑定上级的用户整理完毕"); + + AddJindu("绑定上下级关系中...", wantBindInviterMembers.Count); + foreach (var item in wantBindInviterMembers) + { + var member = current_member_infos.FirstOrDefault(f => f.username == item.wxid); + if (member != null && member.inviter_id == 0) + { + if (inviters.ContainsKey(item.superior)) + { + member.inviter_id = inviters[item.superior]; + session.Updateable(member).ExecuteCommand(); + } + } + AddJindu(); + } + AddJindu("保存会员数据中.."); + srcSession.ExcuteSQL("ALTER TABLE 'members_46349' RENAME TO 'members_46349_备份'"); + AddJindu("保存会员数据成功"); + } + session.Commit(); + return; + } + catch (Exception ex) + { + throw new Exception($"数据异常,同步终止.{ex.Message}"); + } + } + #endregion + + #region 安娜儿云控版 + //else if (label7.Text == "安娜尔云控版") + else if (comboBoxEdit2.SelectedIndex == 7) + { + try + { + if (!srcSession.TableExist()) throw new Exception(@"导入会员数据失败,可能原因:会员信息执行过一次导入操作");//检测表是否存在 + AddJindu("正在读取会员数据..."); + + var member_infos = srcSession.Queryable().ToList(); + var current_member_infos = session.Find("select * from fl_member_info");//目标数据库中获取所有的会员数据 + if (member_infos.Count > 0) AddJindu("导入会员数据中...", member_infos.Count); + + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + //var tixian = decimal.Parse(session.FindTable(@"select uid,COALESCE(sum(point),0) from fl_point_hist where '2019-06-15 16:40:00' <= crt_time and crt_time <= '2019-06-16 15:00:00' and point < 0 and uid = @uid group by uid").Rows[0]["num"].ToString()); + + foreach (var item in member_infos) + { + var user = current_member_infos.FirstOrDefault(f => f.username == item.wxid && f.robot_type == ChatType.微信); + if (user == null) + { + user = new fl_member_info() + { + username = item.wxid, + robot_type = ChatType.微信, + usernick = item.wx_name.Replace("'", "''"), + cur_point = item.ktx_money, + sum_point = item.ztx_money, + ext_point = item.royalty_total,//推广奖励, + finish_order = item.zcg_number, + bind_order = item.zcg_number, + robot_name = comboBoxEdit3.Text, + alipay_name = string.Empty, + alipay_num = string.Empty, + remark = string.Empty + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + user.group_id = groups[0].id; + unMemberInfos.Add(user); + AddJindu(); + } + else + { + user.cur_point = (double)((decimal)user.cur_point + (decimal)item.ktx_money); + user.sum_point = user.sum_point + item.ztx_money; + user.ext_point = user.ext_point + item.royalty_total; + user.finish_order = user.finish_order + item.zcg_number; + user.bind_order = user.finish_order; + if (string.IsNullOrWhiteSpace(user.robot_name)) + { + user.robot_name = comboBoxEdit3.Text; + user.robot_type = ChatType.微信; + } + memberInfos.Add(user); + AddJindu(); + } + } + if (unMemberInfos.Count != 0) + session.Insertable(unMemberInfos.ToArray()).ExecuteCommand(); + if (memberInfos.Count != 0) + session.Updateable(memberInfos.ToArray()).ExecuteCommand(); + + //绑定上下级 + if (member_infos != null && member_infos.Count != 0) + { + AddJindu("绑定上下级关系中...", member_infos.Count); + var newDbs = session.Queryable().ToList(); + //var old = srcSession.Find("select * from fission"); + var old = srcSession.Queryable().ToList(); + foreach (var item in old) + { + var new_user = newDbs.FirstOrDefault(f => f.username == item.xj_wxid); + if (new_user != null && new_user.inviter_id == 0) + { + var inviter = newDbs.FirstOrDefault(f => f.username == item.sj_wxid);//找出上级账号 + if (inviter != null) + { + new_user.inviter_id = inviter.id;//填写上级ID + session.Updateable(new { inviter_id = inviter.id }).Where(f => f.id == new_user.id).ExecuteCommand(); + } + } + AddJindu(); + } + AddJindu("保存会员数据中.."); + try + { + srcSession.ExcuteSQL("ALTER TABLE 'member' RENAME TO 'member_2_备份'"); + } + catch (Exception) + { } + AddJindu("保存会员数据成功"); + } + session.Commit(); + return; + } + catch (Exception ex) + { + throw new Exception($"数据异常,同步终止.{ex.Message}"); + } + } + #endregion + } + catch (Exception ex) + { + base.UpdateUI(() => { label31.Text = "导入会员数据失败!"; }); + session.Rollback(); + throw ex; + } + } + } + catch (Exception ex) + { + throw ex; + } + + } + + + /// + /// 同步绑定淘宝订单数据 + /// + public void SynchronousBindTBOrderData() + { + try + { + if (checkBox2.Checked) //淘宝订单同步 + { + var srcSession = ApiClient.GetSession(conn.tempConfig, false); + var session = ApiClient.GetSession(); + session.BeginTransaction(); + + try + { + #region AliTools + + //if (label7.Text == "AliTools") + if (comboBoxEdit2.SelectedIndex == 1) + { + #region 淘宝 + string sql = string.Empty; + AddJindu("正在读取淘宝订单到缓存..."); + //if (!srcSession.TableExist()) + // sql = "select username,orderid,status,endTime from AliOrder a inner join MemberInfo_备份 m on a.userid = m.id GROUP BY orderid"; + //else + // sql = "select username,orderid,status,endTime from AliOrder a inner join MemberInfo m on a.userid = m.id GROUP BY orderid"; + //var aliOrders = srcSession.Find(sql); + + if (!srcSession.TableExist()) + sql = "select username,orderid,status,endTime from AliOrder a inner join MemberInfo_备份 m on a.userid = m.id GROUP BY username,orderid"; + else + sql = "select username,orderid,status,endTime from AliOrder a inner join MemberInfo m on a.userid = m.id GROUP BY username,orderid"; + var aliOrders = srcSession.Find(sql); + + if (aliOrders != null && aliOrders.Count != 0) + { + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0");//所有没有绑定的订单 + + if (unBinds != null && unBinds.Count != 0) + { + var userId = session.Find("select id,username from fl_member_info", new { });//所有 fl_member_info 用户id 和 username + AddJindu("正在绑定订单...", unBinds.Count); + foreach (var item in unBinds) + { + var result = aliOrders.FirstOrDefault(f => f.orderid == item.trade_parent_id); + //EventClient.OnEvent(this,$"找到订单-{item.trade_parent_id}"); + if (result != null) + { + try + { + var user = userId.FirstOrDefault(f => f.username == result.username);//fl_member_info 查询用户信息 + //EventClient.OnEvent(this, $"找到用户-{item.trade_parent_id}"); + if (user != null) + { + item.db_userid = user.id; + if (!item.IsFinish()) + { + SystemOrderStatus enumOne = (SystemOrderStatus)Enum.Parse(typeof(SystemOrderStatus), result.status); + item.db_status = enumOne; + item.db_endtime = DateTime.Parse(result.endtime); + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + item.db_robottype = member.robot_type; + } + } + else + { + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + item.db_robottype = member.robot_type; + } + } + } + session.SaveOrUpdate(item); + } + } + catch (Exception) + { + } + } + Thread.Sleep(2); + AddJindu(); + } + } + } + AddJindu("订单绑定执行完毕"); + #endregion + session.Commit(); + } + #endregion + + #region 安娜儿 + //else if (label7.Text == "安娜尔") + else if (comboBoxEdit2.SelectedIndex == 2) + { + #region 淘宝 + AddJindu("正在读取订单到缓存..."); + var bindCaches = srcSession.Find("select 订单编号 as orderid,对应ID as username,状态 as status from 订单管理 where 类目 = '淘宝' GROUP BY 订单编号"); + if (bindCaches != null && bindCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定订单...", unBinds.Count); + var userIds = session.Find("select id,username from fl_member_info", new { }); + + foreach (var item in unBinds) + { + AddJindu(); + var result = bindCaches.FirstOrDefault(f => f.orderid == item.trade_parent_id); + if (result != null) + { + var user = userIds.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "交易成功" || result.status == "等待收货") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddDays(-1); + item.tk_status = 3; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_alimama set db_status = 1002,tk_status = 3,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 拼多多 + AddJindu("正在读取拼多多订单到缓存..."); + var pddBindCaches = srcSession.Find("select 订单编号 as orderid,对应ID as username,状态 as status from 订单管理 where 类目 = '拼多多' GROUP BY 订单编号"); + if (pddBindCaches != null && pddBindCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_pinduoduo where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定拼多多订单...", unBinds.Count); + var userids = session.Find("select id,username from fl_member_info", new { }); + + foreach (var item in unBinds) + { + AddJindu(); + var result = pddBindCaches.FirstOrDefault(f => f.orderid == item.order_sn); + if (result != null) + { + var user = userids.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "交易成功" || result.status == "等待收货") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddDays(-1); + item.order_status = 2; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_pinduoduo set db_status = 1002,order_status = 2,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 京东 + AddJindu("正在读取京东订单到缓存..."); + var jdBindCaches = srcSession.Find("select 订单编号 as orderid,对应ID as username,状态 as status from 订单管理 where 类目 = '京东' GROUP BY 订单编号"); + if (jdBindCaches != null && jdBindCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_jingdong where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定订单...", unBinds.Count); + var userIds = session.Find("select id,username from fl_member_info", new { }); + + foreach (var item in unBinds) + { + AddJindu(); + var result = jdBindCaches.FirstOrDefault(f => f.orderid == item.orderId.ToString()); + if (result != null) + { + var user = userIds.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "交易成功" || result.status == "等待收货") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddDays(-1); + item.validCode = 17; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_jingdong set db_status = 1002,validCode = 17,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + AddJindu("订单绑定执行完毕"); + session.Commit(); + } + #endregion + + #region 悠哉 + //else if (label7.Text == "悠哉") + else if (comboBoxEdit2.SelectedIndex == 3) + { + #region 淘宝 + AddJindu("正在读取淘宝订单到缓存..."); + string sql = string.Empty; + var aliOrders = srcSession.Find("select wxid as username,orderno as orderid,orderstatus as status,accountdt as endtime from orders where wxid is not null GROUP BY orderno"); + var users = session.Find("select id,username from fl_member_info", new { }); + + if (aliOrders != null && aliOrders.Count != 0) + { + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定淘宝订单...", unBinds.Count); + foreach (var item in unBinds) + { + AddJindu(); + var result = aliOrders.FirstOrDefault(f => f.orderid == item.trade_parent_id); + if (result != null) + { + var user = users.FirstOrDefault(f => f.username == result.username); + + if (user != null) + item.db_userid = user.id; + /* + 订单创建 = 1006, + 订单付款 = 1005, + 订单失效 = 1004, + 订单退款 = 1003, + 订单结算 = 1002, + 订单冻结 = 1001, + 订单未知 = -99 + ------------------------- + 0 付款 + 1 结算 + 2 失效 + 3 退款 + */ + int status = -1; + int tk_status = -1; + if (!string.IsNullOrEmpty(result.endtime) && result.status == 1) + { + if (DateTime.Parse(result.endtime) <= DateTime.Now) + status = 1002; + else + status = 1001; + tk_status = 3; + } + if (result.status == 0) + { + status = 1005; + tk_status = 12; + } + else if (result.status == 2) + { + status = 1004; + tk_status = 13; + } + else if (result.status == 3) + { + status = 1003; + tk_status = 3; + } + SystemOrderStatus enumOne = (SystemOrderStatus)Enum.ToObject(typeof(SystemOrderStatus), status); + item.db_status = enumOne; + item.db_endtime = string.IsNullOrEmpty(result.endtime) ? DateTime.MinValue : DateTime.Parse(result.endtime); + item.tk_status = tk_status; + + if (string.IsNullOrWhiteSpace(item.db_robotname) && user != null) + { + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + item.db_robottype = member.robot_type; + } + } + + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_alimama set db_status = 1002,tk_status = 3,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 拼多多 + AddJindu("正在读取拼多多订单到缓存..."); + var pddOrders = srcSession.Find("select wxid as username,ordersn as orderid,orderstatus as status,accountdt as endtime from pddorders where wxid is not null GROUP BY ordersn"); + if (pddOrders != null && pddOrders.Count != 0) + { + var unBinds = session.Find("select * from fl_order_pinduoduo where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定拼多多订单...", unBinds.Count); + foreach (var item in unBinds) + { + AddJindu(); + var result = pddOrders.FirstOrDefault(f => f.orderid == item.order_sn); + if (result != null) + { + //var value = session.FindRow("select id from fl_member_info where username = @username", new { username = result.username }); + var user = users.FirstOrDefault(f => f.username == result.username); + + if (user != null) + + item.db_userid = user.id; + + /* + 订单创建 = 1006, + 订单付款 = 1005, + 订单失效 = 1004, + 订单退款 = 1003, + 订单结算 = 1002, + 订单冻结 = 1001, + 订单未知 = -99 + ----------------------------------- + 0 付款 + 1 结算 + 2 失效 + 3 退款 + */ + int status = -1; + int order_status = -1; + if (!string.IsNullOrEmpty(result.endtime) && result.status == 1) + { + if (DateTime.Parse(result.endtime) <= DateTime.Now) + status = 1002; + else + status = 1001; + order_status = 2; + } + if (result.status == 0) + { + status = 1005; + order_status = 1; + } + else if (result.status == 2) + { + status = 1004; + order_status = 4; + } + else if (result.status == 3) + { + status = 1003; + order_status = 2; + } + SystemOrderStatus enumOne = (SystemOrderStatus)Enum.ToObject(typeof(SystemOrderStatus), status); + item.db_status = enumOne; + item.db_endtime = string.IsNullOrEmpty(result.endtime) ? DateTime.MinValue : DateTime.Parse(result.endtime); + item.order_status = order_status; + + if (string.IsNullOrWhiteSpace(item.db_robotname) && user != null) + { + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + item.db_robottype = member.robot_type; + } + } + + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_pinduoduo set db_status = 1002,order_status = 2,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 京东 + AddJindu("正在读取京东订单到缓存..."); + var jdBindTBCaches = srcSession.Find("select ordersn as orderid,wxid as username from jdorders where wxid is not null GROUP BY ordersn"); + if (jdBindTBCaches != null && jdBindTBCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_jingdong where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定订单...", unBinds.Count); + var userIds = session.Find("select id,username from fl_member_info", new { }); + foreach (var item in unBinds) + { + AddJindu(); + var result = jdBindTBCaches.FirstOrDefault(f => f.orderid == item.orderId.ToString()); + if (result != null) + { + var user = userIds.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + /* + 订单创建 = 1006, + 订单付款 = 1005, + 订单失效 = 1004, + 订单退款 = 1003, + 订单结算 = 1002, + 订单冻结 = 1001, + 订单未知 = -99 + -------------------- + 0 付款 + 1 结算 + 2 失效 + 3 退款 + */ + int status = -1; + int validCode = -1; + if (!string.IsNullOrEmpty(result.endtime) && result.status == 1) + { + if (DateTime.Parse(result.endtime) <= DateTime.Now) + status = 1002; + else + status = 1001; + validCode = 17; + } + if (result.status == 0) + { + status = 1005; + validCode = 15; + } + else if (result.status == 2) + { + status = 1004; + validCode = 3; + } + else if (result.status == 3) + { + status = 1003; + validCode = 17; + } + SystemOrderStatus enumOne = (SystemOrderStatus)Enum.ToObject(typeof(SystemOrderStatus), status); + item.db_status = enumOne; + item.db_endtime = string.IsNullOrEmpty(result.endtime) ? DateTime.MinValue : DateTime.Parse(result.endtime); + item.validCode = validCode; + + if (string.IsNullOrWhiteSpace(item.db_robotname) && user != null) + { + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + item.db_robottype = member.robot_type; + } + } + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_jingdong set db_status = 1002,validCode = 17,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + AddJindu("订单绑定执行完毕"); + session.Commit(); + } + #endregion + + #region 速推客 + //else if (label7.Text == "速推客") + else if (comboBoxEdit2.SelectedIndex == 4) + { + #region 淘宝 + AddJindu("正在读取淘宝订单到缓存..."); + var bindTBCaches = srcSession.Find("select 订单ID as orderid,ID as username,订单状态 as status from 订单管理 where 类目 = '淘宝' GROUP BY 订单ID"); + if (bindTBCaches != null && bindTBCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定淘宝订单...", unBinds.Count); + var userids = session.Find("select id,username from fl_member_info", new { }); + List GZHs = new List(); + if (srcSession.TableExist("会员信息") || srcSession.TableExist("会员信息_备份")) + { + GZHs = srcSession.Find("select ID,公众号ID from 会员信息_备份 where 公众号ID != \"\""); + } + foreach (var item in unBinds) + { + AddJindu(); + var result = bindTBCaches.FirstOrDefault(f => f.orderid == item.trade_parent_id); + if (result != null) + { + var user = userids.FirstOrDefault(f => f.username == result.username); + if (user == null)//速推客用公总号ID绑定 + { + var gzh = GZHs.FirstOrDefault(f => f.公众号ID == result.username); + if (gzh != null) + { + user = userids.FirstOrDefault(f => f.username == gzh.ID); + } + } + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "订单结算") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddHours(-2); + item.tk_status = 3; + } + } + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_alimama set db_status = 1002,tk_status = 3,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 拼多多 + AddJindu("正在读取拼多多订单到缓存..."); + var bindPDDCaches = srcSession.Find("select 订单ID as orderid,ID as username,订单状态 as status from 订单管理 where 类目 = '拼多多' GROUP BY 订单ID"); + if (bindPDDCaches != null && bindPDDCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_pinduoduo where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在拼多多绑定订单...", unBinds.Count); + var userids = session.Find("select id,username from fl_member_info", new { }); + + foreach (var item in unBinds) + { + AddJindu(); + var result = bindPDDCaches.FirstOrDefault(f => f.orderid == item.order_sn); + if (result != null) + { + var user = userids.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "订单结算") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddHours(-2); + item.order_status = 2; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_pinduoduo set db_status = 1002,order_status = 2,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 京东 + AddJindu("正在读取京东订单到缓存..."); + var jdBindTBCaches = srcSession.Find("select 订单ID as orderid,ID as username,订单状态 as status from 订单管理 where 类目 = '京东' GROUP BY 订单ID"); + if (jdBindTBCaches != null && jdBindTBCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_jingdong where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在京东绑定订单...", unBinds.Count); + var userids = session.Find("select id,username from fl_member_info", new { }); + List GZHs = new List(); + if (srcSession.TableExist("会员信息") || srcSession.TableExist("会员信息_备份")) + { + GZHs = srcSession.Find("select ID,公众号ID from 会员信息_备份 where 公众号ID != \"\""); + } + foreach (var item in unBinds) + { + AddJindu(); + var result = jdBindTBCaches.FirstOrDefault(f => f.orderid == item.orderId.ToString()); + if (result != null) + { + var user = userids.FirstOrDefault(f => f.username == result.username); + if (user == null)//速推客用公总号ID绑定 + { + var gzh = GZHs.FirstOrDefault(f => f.公众号ID == result.username); + if (gzh != null) + { + user = userids.FirstOrDefault(f => f.username == gzh.ID); + } + } + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "订单结算") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddHours(-2); + item.validCode = 17; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_jingdong set db_status = 1002,validCode = 17,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + //session.Commit(); + //this.Invoke(new Action(delegate + //{ + // ShowSuccess($"速推客 - 淘宝订单绑定完成"); + //})); + } + #endregion + AddJindu("订单绑定执行完毕"); + session.Commit(); + } + #endregion + + #region 猎客 + //else if (label7.Text == "猎客") + else if (comboBoxEdit2.SelectedIndex == 5) + { + #region 淘宝 + AddJindu("正在读取淘宝订单到缓存..."); + var bindTBCaches = srcSession.Find("select taobaoTradeParentId as orderid,lkid as username,payStatusInfo as status from PaymentDetail where lkid is not null GROUP BY taobaoTradeParentId"); + if (bindTBCaches != null && bindTBCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在淘宝绑定订单...", unBinds.Count); + var userIds = session.Find("select id,username from fl_member_info", new { }); + foreach (var item in unBinds) + { + AddJindu(); + var result = bindTBCaches.FirstOrDefault(f => f.orderid == item.trade_parent_id); + if (result != null) + { + var user = userIds.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "订单结算") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddHours(-2); + item.tk_status = 3; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_alimama set db_status = 1002,tk_status = 3,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 拼多多 + AddJindu("正在读取拼多多订单到缓存..."); + var bindPDDCaches = srcSession.Find("select pddTradeParentId as orderid,lkid as username,payStatusInfo as status from PddOrder where lkid is not null GROUP BY pddTradeParentId"); + if (bindPDDCaches != null && bindPDDCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_pinduoduo where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定拼多多订单...", unBinds.Count); + var userIds = session.Find("select id,username from fl_member_info", new { }); + foreach (var item in unBinds) + { + AddJindu(); + var result = bindPDDCaches.FirstOrDefault(f => f.orderid == item.order_sn); + if (result != null) + { + var user = userIds.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "订单结算") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddHours(-2); + } + } + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_pinduoduo set db_status = 1002,order_status = 2,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 京东 + AddJindu("正在读取京东订单到缓存..."); + var jdBindTBCaches = srcSession.Find("select jdTradeParentId as orderid,lkid as username,payStatusInfo as status from JDOrder where lkid is not null GROUP BY jdTradeParentId"); + if (jdBindTBCaches != null && jdBindTBCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_jingdong where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定京东订单...", unBinds.Count); + var userIds = session.Find("select id,username from fl_member_info", new { }); + foreach (var item in unBinds) + { + AddJindu(); + var result = jdBindTBCaches.FirstOrDefault(f => f.orderid == item.orderId.ToString()); + if (result != null) + { + var user = userIds.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "订单结算") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddHours(-2); + item.validCode = 17; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_jingdong set db_status = 1002,validCode = 17,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + AddJindu("订单绑定执行完毕"); + session.Commit(); + + } + #endregion + + #region 淘客喵 + if (comboBoxEdit2.SelectedIndex == 6) + { + #region 淘宝 + string sql = string.Empty; + AddJindu("正在读取淘宝订单到缓存..."); + //if (!srcSession.TableExist()) + // sql = "select username,orderid,status,endTime from AliOrder a inner join MemberInfo_备份 m on a.userid = m.id GROUP BY orderid"; + //else + // sql = "select username,orderid,status,endTime from AliOrder a inner join MemberInfo m on a.userid = m.id GROUP BY orderid"; + //var aliOrders = srcSession.Find(sql); + + //if (!srcSession.TableExist()) + // sql = "select username,orderid,status,endTime from AliOrder a inner join members_46349_备份 m on a.userid = m.id GROUP BY username,orderid"; + //else + // sql = "select username,orderid,status,endTime from AliOrder a inner join members_46349 m on a.userid = m.id GROUP BY username,orderid"; + var aliOrders = srcSession.Find("select * from rewarded_orders_46349 where wxid != ''", new { }); + + if (aliOrders != null && aliOrders.Count != 0) + { + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0");//所有没有绑定的订单 + + if (unBinds != null && unBinds.Count != 0) + { + var userId = session.Find("select id,username from fl_member_info", new { });//所有 fl_member_info 用户id 和 username + AddJindu("正在绑定订单...", unBinds.Count); + foreach (var item in unBinds) + { + var result = aliOrders.FirstOrDefault(f => f.order_no.ToString() == item.trade_parent_id); + //EventClient.OnEvent(this,$"找到订单-{item.trade_parent_id}"); + if (result != null) + { + try + { + var user = userId.FirstOrDefault(f => f.username == result.wxid);//fl_member_info 查询用户信息 + //EventClient.OnEvent(this, $"找到用户-{item.trade_parent_id}"); + if (user != null) + { + item.db_userid = user.id; + if (!item.IsFinish()) + { + var status = (AlimamaOrderStatus)result.pay_status; + switch (status) + { + case AlimamaOrderStatus.全部订单: + break; + case AlimamaOrderStatus.订单结算: + case AlimamaOrderStatus.订单成功: + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now; + break; + case AlimamaOrderStatus.订单付款: + item.db_status = SystemOrderStatus.订单付款; + item.db_endtime = DateTime.MinValue; + break; + case AlimamaOrderStatus.订单失效: + item.db_status = SystemOrderStatus.订单失效; + item.db_endtime = DateTime.MinValue; + break; + case AlimamaOrderStatus.订单维权中: + break; + default: + break; + } + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + item.db_robottype = member.robot_type; + } + } + else + { + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_type == ChatType.微信 ? comboBoxEdit3.Text : comboBoxEdit1.Text; + item.db_robottype = member.robot_type; + } + } + } + session.SaveOrUpdate(item); + } + } + catch (Exception) + { + } + } + Thread.Sleep(2); + AddJindu(); + } + } + } + AddJindu("订单绑定执行完毕"); + #endregion + session.Commit(); + } + #endregion + + #region 安娜儿 + //else if (label7.Text == "安娜尔") + else if (comboBoxEdit2.SelectedIndex == 7) + { + #region 淘宝 + AddJindu("正在读取订单到缓存..."); + var bindCaches = srcSession.Find("select order_main as orderid,wxid as username,order_state as status from register_order where platform = '淘宝' GROUP BY order_main"); + if (bindCaches != null && bindCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定订单...", unBinds.Count); + var userIds = session.Find("select id,username from fl_member_info", new { }); + + foreach (var item in unBinds) + { + AddJindu(); + var result = bindCaches.FirstOrDefault(f => f.orderid == item.trade_parent_id); + if (result != null) + { + var user = userIds.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "交易成功" || result.status == "等待收货") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddDays(-1); + item.tk_status = 3; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_alimama set db_status = 1002,tk_status = 3,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 拼多多 + AddJindu("正在读取拼多多订单到缓存..."); + //var pddBindCaches = srcSession.Find("select 订单编号 as orderid,对应ID as username,状态 as status from 订单管理 where 类目 = '拼多多' GROUP BY 订单编号"); + var pddBindCaches = srcSession.Find("select order_main as orderid,wxid as username,order_state as status from register_order where platform = '拼多多' GROUP BY order_main"); + if (pddBindCaches != null && pddBindCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_pinduoduo where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定拼多多订单...", unBinds.Count); + var userids = session.Find("select id,username from fl_member_info", new { }); + + foreach (var item in unBinds) + { + AddJindu(); + var result = pddBindCaches.FirstOrDefault(f => f.orderid == item.order_sn); + if (result != null) + { + var user = userids.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "交易成功" || result.status == "等待收货") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddDays(-1); + item.order_status = 2; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_pinduoduo set db_status = 1002,order_status = 2,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + + #region 京东 + AddJindu("正在读取京东订单到缓存..."); + //var jdBindCaches = srcSession.Find("select 订单编号 as orderid,对应ID as username,状态 as status from 订单管理 where 类目 = '京东' GROUP BY 订单编号"); + var jdBindCaches = srcSession.Find("select order_main as orderid,wxid as username,order_state as status from register_order where platform = '京东' GROUP BY order_main"); + if (jdBindCaches != null && jdBindCaches.Count != 0) + { + var unBinds = session.Find("select * from fl_order_jingdong where db_userid = 0"); + if (unBinds != null && unBinds.Count != 0) + { + AddJindu("正在绑定订单...", unBinds.Count); + var userIds = session.Find("select id,username from fl_member_info", new { }); + + foreach (var item in unBinds) + { + AddJindu(); + var result = jdBindCaches.FirstOrDefault(f => f.orderid == item.orderId.ToString()); + if (result != null) + { + var user = userIds.FirstOrDefault(f => f.username == result.username); + if (user != null) + item.db_userid = user.id; + if (item.db_status == SystemOrderStatus.订单冻结) + { + if (result.status == "交易成功" || result.status == "等待收货") + { + item.db_status = SystemOrderStatus.订单结算; + item.db_endtime = DateTime.Now.AddDays(-1); + item.validCode = 17; + } + } + + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + item.db_robotname = comboBoxEdit3.Text; + item.db_robottype = ChatType.微信; + } + + session.SaveOrUpdate(item); + } + } + session.ExcuteSQL("update fl_order_jingdong set db_status = 1002,validCode = 17,db_endtime = @endtime where db_status = 1001 and db_userid = 0", new { endtime = DateTime.Now.AddDays(-2) }); + } + } + #endregion + AddJindu("订单绑定执行完毕"); + session.Commit(); + } + #endregion + } + catch (Exception ex) + { + base.UpdateUI(() => { label31.Text = "绑定订单失败!"; }); + session.Rollback(); + throw ex; + } + finally + { + srcSession.Close(); + } + } + } + catch (Exception ex) + { + this.Invoke(new Action(delegate + { + ShowError(ex); + })); + } + } + + #endregion + + #region 导出导入配置文件 + + /// + /// 保存文件 + /// + /// + /// + private void simpleButton4_Click(object sender, EventArgs e) + { + try + { + var checks = checkedListBoxControl1.CheckedItems; + if (checks != null && checks.Count != 0) + { + var checkAdminForm = new CheckAdminForm(); + if (checkAdminForm.ShowDialog() == DialogResult.OK) + { + //var system_configs = checkedListBoxControl1.Tag as List; + var out_configs = new List(); + var strb = new StringBuilder(); + + var session = ApiClient.GetSession(); + + foreach (var item in checks) + { + try + { + if (!string.IsNullOrWhiteSpace(tableData.FirstOrDefault(f => f == item.ToString()))) + { + fl_dictionary_item config = new fl_dictionary_item() { dickey = item.ToString() }; + if (item.ToString() == tableData[0])//"延迟结算配置" + { + var order_sleeps = session.Find("select * from fl_order_sleep"); + if (order_sleeps.Count != 0) + { + config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", order_sleeps } });//Tools.Serialize(order_sleeps); + } + } + else if (item.ToString() == tableData[1])//"会员分组配置" + { + var member_group = session.Find("select * from fl_member_group"); + if (member_group.Count != 0) + config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", member_group } }); + } + else if (item.ToString() == tableData[2])//"分出比例配置" + { + var ratio_info = session.Find("select * from fl_ratio_info"); + if (ratio_info.Count != 0) + config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", ratio_info } }); + } + else if (item.ToString() == tableData[3])//"自定义问答" + { + try + { + if (session.TableExist("fl_plugin_autoanswer_userdefinedlibrary")) + { + var userdefinedlibrarys = session.Queryable().ToList(); + if (userdefinedlibrarys.Count != 0) + config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", userdefinedlibrarys } }); + } + } + catch (Exception) + { } + try + { + if (session.TableExist("fl_plugin_autoanswer_definedlib")) + { + var userdefinedlibrarys = session.Queryable().ToList(); + if (userdefinedlibrarys.Count != 0) + config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", userdefinedlibrarys } }); + } + } + catch (Exception) + { } + } + else if (item.ToString() == tableData[4])//"自动打标签数据" + { + if (session.TableExist("fl_plugin_signcontacts_sign_info")) + { + var signcontacts_sign_infos = session.Queryable().ToList(); + if (signcontacts_sign_infos.Count != 0) + config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", signcontacts_sign_infos } }); + } + } + else if (item.ToString() == tableData[5])//"独立分出比例" + { + var dic = new Dictionary(); + if (session.TableExist("fl_ratio_info_custom_group")) + { + var fl_ratio_info_custom_groups = session.Queryable().ToList(); + if (fl_ratio_info_custom_groups.Count != 0) + dic["data"] = fl_ratio_info_custom_groups; + } + if (session.TableExist("fl_ratio_info_custom")) + { + var fl_ratio_info_customs = session.Queryable().ToList(); + if (fl_ratio_info_customs.Count != 0) + dic["data2"] = fl_ratio_info_customs; + } + config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", dic } }); + } + out_configs.Add(config); + strb.AppendLine($"{item},读取成功."); + } + else + { + if (item.ToString() == "全选" || item.ToString() == "全消") continue; + + var config = session.FindSingle("select * from fl_dictionary_item where dickey = @dickey", new { dickey = item.ToString() }); + if (config == null) throw new Exception(""); + + //var config = system_configs.FirstOrDefault(f => f.dickey == item.ToString()); + out_configs.Add(config); + strb.AppendLine($"{config.dickey},读取成功."); + } + } + catch (Exception) + { + strb.AppendLine($"{item.ToString()},读取失败."); + } + } + + SaveFileDialog saveDlg = new SaveFileDialog(); + saveDlg.Filter = "文本文件|*.dxd"; + if (saveDlg.ShowDialog() == DialogResult.OK) + { + FileStream fs = File.Open(saveDlg.FileName, + FileMode.Create, + FileAccess.Write); + StreamWriter sw = new StreamWriter(fs); + sw.WriteLine(HttpHelper.ObjectToJson(out_configs)); + //关闭文件 + sw.Flush(); + sw.Close(); + fs.Close(); + } + memoEdit1.Text = $"{strb.ToString()}\r\n配置文件导出成功!\r\n导出路径:{saveDlg.FileName}"; + } + else + memoEdit1.Text = "终止配置导出任务"; + } + else + { + throw new Exception("请勾选要到导出的配置文件!"); + } + } + catch (Exception ex) + { + ShowError(ex); + } + } + + private void simpleButton5_Click(object sender, EventArgs e) + { + try + { + OpenFileDialog dialog = new OpenFileDialog(); + dialog.Multiselect = false; + dialog.Title = "请选择文件夹"; + dialog.Filter = "所有文件(*.dxd)|*.dxd"; + if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + string json = File.ReadAllText(dialog.FileName); + var configs = HttpHelper.JsonToObject>(json) as List; + if (configs != null && configs.Count != 0) + { + this.checkedListBoxControl2.Items.Add(new CheckedListBoxItem(null, "全选")); + this.checkedListBoxControl2.Items.Add(new CheckedListBoxItem(null, "全消")); + + foreach (var item in configs) + { + this.checkedListBoxControl2.Items.Add(new CheckedListBoxItem(null, item.dickey)); + } + checkedListBoxControl2.SelectAll(); + this.checkedListBoxControl2.Tag = configs; + } + else + throw new Exception("无配置信息!"); + } + } + catch (Exception ex) + { + ShowError(ex); + } + } + + private void simpleButton6_Click(object sender, EventArgs e) + { + try + { + var check_config = checkedListBoxControl2.CheckedItems; + if (check_config != null && check_config.Count != 0) + { + var out_configs = checkedListBoxControl2.Tag as List; + var strb = new StringBuilder(); + var session = ApiClient.GetSession(); + foreach (var item in check_config) + { + if (item.ToString() == "全选" || item.ToString() == "全消") continue; + try + { + var new_config = out_configs.FirstOrDefault(f => f.dickey == item.ToString()); //新的配置 + + if (!string.IsNullOrWhiteSpace(tableData.FirstOrDefault(f => f == item.ToString()))) + { + if (item.ToString() == tableData[0])//"延迟结算配置" + { + var order_sleeps = session.Find("select * from fl_order_sleep"); + if (checkBox3.Checked || order_sleeps.Count == 0) + { + session.ExcuteSQL("DELETE FROM fl_order_sleep"); + var _sleeps = HttpExtend.JsonToDictionary(new_config.dicvalue);//Tools.Serialize(order_sleeps); + List list = new List(); + var array = _sleeps["data"] as ArrayList; + foreach (Dictionary arr in array) + { + list.Add(new fl_order_sleep() { money = double.Parse(arr["money"].ToString()), cps_type = (CpsType)(int.Parse(arr["cps_type"].ToString())), sleep = int.Parse(arr["sleep"].ToString()), white_groups = arr["white_groups"].ToString() }); + } + session.Insertable(list).ExecuteCommand(); + strb.AppendLine($"{item},配置已覆盖."); + } + else + { + strb.AppendLine($"{item},配置已存在."); + continue; + } + } + else if (item.ToString() == tableData[1])//"会员分组配置" + { + var order_sleeps = session.Find("select * from fl_member_group"); + if (checkBox3.Checked || order_sleeps.Count == 0) + { + session.ExcuteSQL("DELETE FROM fl_member_group"); + var _sleeps = HttpExtend.JsonToDictionary(new_config.dicvalue);//Tools.Serialize(order_sleeps); + List list = new List(); + var array = _sleeps["data"] as ArrayList; + foreach (Dictionary arr in array) + { + list.Add(new fl_member_group() + { + name = arr["name"] == null ? string.Empty : arr["name"].ToString(), + subsidy = double.Parse(arr["subsidy"].ToString()), + subsidy_type = (SubsidyType)int.Parse(arr["subsidy_type"].ToString()), + terms = double.Parse(arr["terms"].ToString()), + terms_ordersum = long.Parse(arr["terms_ordersum"].ToString()), + ratio_custom_dy = int.Parse(arr["ratio_custom_dy"].ToString()), + ratio_custom_jd = int.Parse(arr["ratio_custom_jd"].ToString()), + ratio_custom_pdd = int.Parse(arr["ratio_custom_pdd"].ToString()), + ratio_custom_sn = int.Parse(arr["ratio_custom_sn"].ToString()), + ratio_custom_ks = int.Parse(arr["ratio_custom_ks"].ToString()), + ratio_custom_tb = int.Parse(arr["ratio_custom_tb"].ToString()), + ratio_custom_wph = int.Parse(arr["ratio_custom_wph"].ToString()) + }); + } + session.Insertable(list).ExecuteCommand(); + strb.AppendLine($"{item},配置已覆盖."); + } + else + { + strb.AppendLine($"{item},配置已存在."); + continue; + } + } + else if (item.ToString() == tableData[2])//"分出比例配置" + { + var order_sleeps = session.Find("select * from fl_ratio_info"); + if (checkBox3.Checked || order_sleeps.Count == 0) + { + session.ExcuteSQL("DELETE FROM fl_ratio_info"); + var _sleeps = HttpExtend.JsonToDictionary(new_config.dicvalue);//Tools.Serialize(order_sleeps); + List list = new List(); + var array = _sleeps["data"] as ArrayList; + foreach (Dictionary arr in array) + { + list.Add(new fl_ratio_info() { comm = double.Parse(arr["comm"].ToString()), cps_type = (CpsType)(int.Parse(arr["cps_type"].ToString())), subsidy_num = double.Parse(arr["subsidy_num"].ToString()), subsidy_type = (SubsidyType)(int.Parse(arr["subsidy_type"].ToString())) }); + } + session.Insertable(list).ExecuteCommand(); + strb.AppendLine($"{item},配置已覆盖."); + } + else + { + strb.AppendLine($"{item},配置已存在."); + continue; + } + } + else if (item.ToString() == tableData[3])//"自定义问答" + { + try + { + var order_sleeps = session.Find("select * from fl_plugin_autoanswer_definedlib"); + if (checkBox3.Checked || order_sleeps.Count == 0) + { + session.ExcuteSQL("DELETE FROM fl_plugin_autoanswer_definedlib"); + var _sleeps = HttpExtend.JsonToDictionary(new_config.dicvalue);//Tools.Serialize(order_sleeps); + //List list = new List(); + var array = _sleeps["data"] as ArrayList; + foreach (Dictionary arr in array) + { + //list.Add(new fl_plugin_autoanswer_definedlib() { antistop = arr["antistop"].ToString(), chat_type = arr["chat_type"].ToString(), content = arr["content"].ToString(), match_pattern = (int.Parse(arr["match_pattern"].ToString())), is_alert_admin = (int.Parse(arr["is_alert_admin"].ToString())), specific_robot_setting_text = arr["specific_robot_setting_text"].ToString() }); + + try + { + session.Insertable(new fl_plugin_autoanswer_definedlib() { antistop = arr["antistop"].ToString(), chat_type = arr["chat_type"].ToString(), content = arr["content"].ToString(), match_pattern = (int.Parse(arr["match_pattern"].ToString())), is_alert_admin = (int.Parse(arr["is_alert_admin"].ToString())), specific_robot_setting_text = arr["specific_robot_setting_text"].ToString() }).ExecuteCommand(); + } + catch (Exception) + { } + finally { Thread.Sleep(20); } + } + //session.Insertable(list).ExecuteCommand(); + strb.AppendLine($"{item},配置已覆盖."); + } + else + { + strb.AppendLine($"{item},配置已存在."); + continue; + } + } + catch (Exception) + { } + try + { + var order_sleeps = session.Find("select * from fl_plugin_autoanswer_userdefinedlibrary"); + if (checkBox3.Checked || order_sleeps.Count == 0) + { + session.ExcuteSQL("DELETE FROM fl_plugin_autoanswer_userdefinedlibrary"); + var _sleeps = HttpExtend.JsonToDictionary(new_config.dicvalue);//Tools.Serialize(order_sleeps); + List list = new List(); + var array = _sleeps["data"] as ArrayList; + foreach (Dictionary arr in array) + { + list.Add(new fl_plugin_autoanswer_userdefinedlibrary() { antistop = arr["antistop"].ToString(), chat_type = arr["chat_type"].ToString(), content = arr["content"].ToString(), match_pattern = (int.Parse(arr["match_pattern"].ToString())), is_alert_admin = (int.Parse(arr["is_alert_admin"].ToString())) }); + } + session.Insertable(list).ExecuteCommand(); + strb.AppendLine($"{item},配置已覆盖."); + } + else + { + strb.AppendLine($"{item},配置已存在."); + continue; + } + } + catch (Exception) + { } + } + else if (item.ToString() == tableData[4])//"自动打标签数据" + { + var order_sleeps = session.Find("select * from fl_plugin_signcontacts_sign_info"); + if (checkBox3.Checked || order_sleeps.Count == 0) + { + session.ExcuteSQL("DELETE FROM fl_plugin_signcontacts_sign_info"); + var _sleeps = HttpExtend.JsonToDictionary(new_config.dicvalue);//Tools.Serialize(order_sleeps); + List list = new List(); + var array = _sleeps["data"] as ArrayList; + foreach (Dictionary arr in array) + { + list.Add(new fl_plugin_signcontacts_sign_info() { amount = long.Parse(arr["amount"].ToString()), sign = arr["sign"].ToString(), signtype = (SignType)(int.Parse(arr["signtype"].ToString())) }); + } + session.Insertable(list).ExecuteCommand(); + strb.AppendLine($"{item},配置已覆盖."); + } + else + { + strb.AppendLine($"{item},配置已存在."); + continue; + } + } + else if (item.ToString() == tableData[5])//"独立分出比例" + { + //if (session.TableExist("fl_ratio_info_custom_group")) + //{ + // var fl_ratio_info_custom_groups = session.Queryable().ToList(); + // if (fl_ratio_info_custom_groups.Count != 0) + // config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", fl_ratio_info_custom_groups } }); + //} + //else if (session.TableExist("fl_ratio_info_custom")) + //{ + // var fl_ratio_info_customs = session.Queryable().ToList(); + // if (fl_ratio_info_customs.Count != 0) + // config.dicvalue = HttpHelper.ObjectToJson(new Dictionary() { { "data", fl_ratio_info_customs } }); + //} + + var custom_groups = session.Find("select * from fl_ratio_info_custom_group"); + if (checkBox3.Checked || custom_groups.Count == 0) + { + session.ExcuteSQL("DELETE FROM fl_ratio_info_custom_group"); + var _datas = HttpExtend.JsonToDictionary(new_config.dicvalue);//Tools.Serialize(order_sleeps); + List list = new List(); + var _sleeps = _datas["data"] as Dictionary; + + + var array = _sleeps["data"] as ArrayList; + foreach (Dictionary arr in array) + { + //list.Add(new fl_ratio_info_custom_group() { name = arr["name"].ToString(), cps_type = (CpsType)(int.Parse(arr["cps_type"].ToString())), id = long.Parse(arr["id"].ToString()) }); + session.Ado.ExecuteCommand($"INSERT INTO 'fl_ratio_info_custom_group' ('name', 'cps_type', 'id') VALUES ('{arr["name"].ToString()}', {(int.Parse(arr["cps_type"].ToString()))}, {long.Parse(arr["id"].ToString())});"); + } + + //------------------ + session.ExcuteSQL("DELETE FROM fl_ratio_info_custom"); + List list2 = new List(); + var array2 = _sleeps["data2"] as ArrayList; + foreach (Dictionary arr in array2) + { + //list2.Add(new fl_ratio_info_custom() { cgid = long.Parse(arr["cgid"].ToString()), comm = double.Parse(arr["comm"].ToString()), subsidy_num = double.Parse(arr["subsidy_num"].ToString()), subsidy_type = (SubsidyType)(int.Parse(arr["subsidy_type"].ToString())), cps_type = (CpsType)(int.Parse(arr["cps_type"].ToString())), id = long.Parse(arr["id"].ToString()) }); + session.Ado.ExecuteCommand($"INSERT INTO 'fl_ratio_info_custom' ('cgid', 'comm', 'subsidy_num', 'subsidy_type', 'cps_type', 'id') VALUES ({long.Parse(arr["cgid"].ToString())}, {double.Parse(arr["comm"].ToString())},{double.Parse(arr["subsidy_num"].ToString())},{(int.Parse(arr["subsidy_type"].ToString()))}, {int.Parse(arr["cps_type"].ToString())}, {long.Parse(arr["id"].ToString())});"); + } + strb.AppendLine($"{item},配置已覆盖."); + } + else + { + strb.AppendLine($"{item},配置已存在."); + continue; + } + + + } + } + else + { + var src_config = session.Find("select * from fl_dictionary_item where dickey = @dickey", new { dickey = new_config.dickey }).FirstOrDefault(); //原来的配置 + if (src_config != null) + { + if (checkBox3.Checked) + { + src_config.dicvalue = new_config.dicvalue; + strb.AppendLine($"{src_config.dickey},配置已覆盖."); + } + else + { + strb.AppendLine($"{src_config.dickey},配置已存在."); + continue; + } + } + else + { + src_config = new fl_dictionary_item() { dickey = new_config.dickey, dicvalue = new_config.dicvalue }; + strb.AppendLine($"{src_config.dickey},导入成功"); + } + session.SaveOrUpdate(src_config); + } + } + catch (Exception ex) + { + strb.AppendLine(ex.Message); + } + } + memoEdit2.Text = strb.ToString(); + if (strb.Length != 0 && memoEdit2.Text.Contains("配置已覆盖")) + { + //覆盖成功提示用户是否重启软件 + if (MessageBox.Show("配置导入成功,启动后生效,是否马上重启软件?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + #region 是否允许软件重启[创建一个名为 reset 的空文件,在FLSystem的Program中判断这个文件是否存在,存在将允许重启] + var reset_program = Util.MapFile("reset", "File"); + File.Create(reset_program); + #endregion + + Application.ExitThread(); + Thread thtmp = new Thread(new ParameterizedThreadStart(run)); + object appName = Application.ExecutablePath; + Thread.Sleep(500); + thtmp.Start(appName); + } + } + } + else + throw new Exception("请选择要导入的配置"); + } + catch (Exception ex) + { + ShowError(ex); + } + } + private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) + { + try + { + if (e.Index == 0 && e.State == CheckState.Checked) + { + for (int j = 0; j < checkedListBoxControl1.Items.Count; j++) + checkedListBoxControl1.SetItemChecked(j, j != 1); + } + else if (e.Index == 1 && e.State == CheckState.Checked) + { + for (int j = 0; j < checkedListBoxControl1.Items.Count; j++) + checkedListBoxControl1.SetItemChecked(j, j == 1); + } + } + catch (Exception ex) + { + ShowError(ex); + } + } + + private void checkedListBoxControl2_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) + { + try + { + if (e.Index == 0 && e.State == CheckState.Checked) + { + for (int j = 0; j < checkedListBoxControl2.Items.Count; j++) + checkedListBoxControl2.SetItemChecked(j, j != 1); + } + else if (e.Index == 1 && e.State == CheckState.Checked) + { + for (int j = 0; j < checkedListBoxControl2.Items.Count; j++) + checkedListBoxControl2.SetItemChecked(j, j == 1); + } + } + catch (Exception ex) + { + ShowError(ex); + } + } + + #endregion + + private void run(Object obj) + { + Process ps = new Process(); + ps.StartInfo.FileName = obj.ToString(); + ps.Start(); + } + + #region 自转 Sqlite 转 MySql + + private object lock_obj4 = new object(); + private void AddJindu4(string text = "", int max = 0) + { + base.UpdateUI(() => + { + try + { + lock (lock_obj4) + { + if (!string.IsNullOrEmpty(text) && max == 0) + { + label7.Text = text; + } + else if (!string.IsNullOrEmpty(text) && max != 0) + { + label7.Text = text; + this.progressBar4.Value = 0; + this.progressBar4.Maximum = max; + } + else + { + if (this.progressBar4.Value < this.progressBar4.Maximum) this.progressBar4.Value++; + label7.Text = $"{this.progressBar4.Value}/{this.progressBar4.Maximum}"; + } + } + + Application.DoEvents(); + } + catch (Exception) + { + } + + }); + } + + Api.Framework.Tools.ConnectionConfig tempConfig = null; + + private void simpleButton3_Click(object sender, EventArgs e) + { + try + { + if (ApiClient.Setting.DbConfig.DatabaseType == DatabaseType.MYSQL) throw new Exception("当前运行环境使用的数据库为Mysql,本次操作终止"); + tempConfig = new Api.Framework.Tools.ConnectionConfig(); + tempConfig.ConnectionString = string.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3};Port={4};Min Pool Size = 5; Max Pool Size = 30;Charset=utf8;", this.textEdit6.Text, this.textEdit3.Text, this.textEdit4.Text, this.textEdit5.Text, this.textEdit2.Text); + tempConfig.DatabaseType = DatabaseType.MYSQL; + var session = ApiClient.GetSession(tempConfig); + session.BeginTransaction(); + session.Rollback(); + ShowSuccess("恭喜您,数据库连接成功!"); + } + catch (Exception ex) + { + tempConfig = null; + ShowError(ex); + } + } + + private async void simpleButton7_Click(object sender, EventArgs e) + { + bool flag = false; + simpleButton7.Enabled = false; + await Task.Run(() => + { + var tableNameLog = string.Empty;//记录表的名称 + try + { + if (tempConfig == null) throw new Exception("请先测试Mysql 是否可以正常连接!"); + var mySqlSession = ApiClient.GetSession(tempConfig); + //Loding.ShowWaitForm(); + mySqlSession.BeginTransaction(); + try + { + AddJindu4("检测并创建基础表信息..."); + ApiClient.CreateTables(mySqlSession); + AddJindu4("基础表创建完成~!"); + var sqliteSession = ApiClient.GetSession(); + //查询数据库名字 + AddJindu4("获取所有存在表的信息..."); + var query = sqliteSession.FindTable("SELECT name,sql FROM sqlite_master WHERE type='table' and name != 'sqlite_sequence'", new { }); + AddJindu4("获取所有存在表的信息完成~!"); + if (query.Rows.Count > 0) + { + AddJindu4("整理阿里妈妈表数据...(数据越多,等待时间越长)"); + sqliteSession.ExcuteSQL("update fl_order_alimama set paid_time = '0001-01-01 00:00:00' where paid_time IS NULL"); + AddJindu4("整理阿里妈妈表数据完成~!"); + + AddJindu4("整理京东表数据...(数据越多,等待时间越长)"); + sqliteSession.ExcuteSQL("update fl_order_jingdong set refundcreatetime = '0001-01-01 00:00:00' where refundcreatetime IS NULL"); + AddJindu4("整理京东表数据完成~!"); + + sqliteSession.ExcuteSQL("update fl_exchange_info set check_time = '0001-01-01 00:00:00' where check_time IS NULL"); + + sqliteSession.ExcuteSQL("update fl_order_pinduoduo set price_compare_status = 0 where price_compare_status IS NULL"); + + for (int i = 0; i < query.Rows.Count; i++) + { + var name = query.Rows[i]["name"].ToString(); + try + { + if (name.ToLower() == "sqlite_stat1" || name.ToLower() == "fl_plugin_encourage__tasks" || name.ToLower() == "fl_plugin_encourage_tasks" + || name.ToLower() == "fl_plugin_tbcirclepromotion_goodsinfos" + || name.ToLower() == "fl_plugin_pddcirclepromotion_goodsinfos" + || name.ToLower() == "fl_plugin_jdcirclepromotion_goodsinfos" + || name.ToLower() == "fl_plugin_wphcirclepromotion_goodsinfos" + || name.ToLower() == "fl_plugin_couponssend_goodsinfos" + || name.ToLower() == "fl_debug_log" + ) + continue; + tableNameLog = name; + if (!mySqlSession.TableExist(name)) + { + AddJindu4($"表{name}不存在,正在创建..."); + #region 不存在的表 + var sql = query.Rows[i]["sql"].ToString(); + sql = sql.Replace("AUTOINCREMENT", "AUTO_INCREMENT").Replace("\"", ""); + if (name.ToLower().Contains("fl_wechat_device")) + sql = "CREATE TABLE " + name + " (weixinhao varchar(255) default '' ,device_info text ,id integer primary key AUTO_INCREMENT not null )"; + + AddJindu4($"表{name}创建完成~!"); + + sql = sql.Replace("text default ''", "text default null"); + + mySqlSession.ExcuteSQL(sql, new { }); + #endregion + } + if (mySqlSession.TableExist(name))//mysql数据库存在 + { + AddJindu4($"表{name}存在,正在清空数据..."); + #region 数据库表存在 + mySqlSession.ExcuteSQL("TRUNCATE TABLE " + name, new { }); + + AddJindu4($"表{name}清空数据完成~!"); + + AddJindu4($"获取表{name}所有字段..."); + List fieldList = new List();//字段 + var sql = "pragma table_info('" + name + "')"; + var fields = sqliteSession.FindTable(sql, new { }); + for (int k = 0; k < fields.Rows.Count; k++) + { + var temp = fields.Rows[k]["name"].ToString(); + fieldList.Add($"`{temp}`"); + } + AddJindu4($"获取表{name}所有字段完成~!"); + + //读取数量 + sql = $"select count(1) from {name}"; + var countResult = sqliteSession.FindTable(sql); + //数据总数量 + //if(countResult.Rows.Count) + var rowCount = Convert.ToInt32(countResult.Rows[0].ItemArray[0]); + if (rowCount == 0) + continue; + var querySize = 1000; + + //倍率 + var rate = (int)Math.Ceiling((decimal)rowCount / querySize); + //分页查询数据并添加到数据库 + for (int j = 0; j < rate; j++) + { + sql = $"select * from {name} limit {j * querySize},{querySize}"; + + var result = sqliteSession.FindTable(sql); + List valueList = new List();//值 + if (result.Rows.Count > 0) + { + AddJindu4($"表{name},总共{rate + 1}页数据,正在获取第{j + 1}页数据..."); + //循环过一次就情况 + valueList.Clear(); + //存字段对应的数 + var list = new List(); + for (int k = 0; k < result.Rows.Count; k++) + { + var temp = string.Empty; + //foreach (var item in fieldList) + for (int z = 0; z < fieldList.Count; z++) + { + try + { + var item = fieldList[z]; + temp = result.Rows[k][item.Replace("`", "")].ToString().ToLower(); + temp = temp == "false" ? "0" : temp == "true" ? "1" : temp.Replace(@"\", @"\\").Replace("'", "\''"); + + list.Add(temp); + } + catch (Exception exx) + { + //Console.WriteLine(temp); + throw exx; + } + } + valueList.Add("'" + string.Join("','", list) + "'"); + + list.Clear(); + //AddJindu4(); + } + + AddJindu4($"表{name},总共{rate + 1}页数据,准备转移插入第{j + 1}数据中..."); + if (valueList.Count != 0) + { + int size = 120; + var num = (int)Math.Ceiling((decimal)valueList.Count / size); + //AddJindu4($"表{name},总共{rate+1}页数据,准备转移插入第{j + 1}数据中...", num); + + for (int o = 1; o <= num; o++) + { + var _list = valueList.Skip((o - 1) * size).Take(size).ToList(); + sql = "INSERT INTO " + name + " (" + string.Join(",", fieldList) + ") VALUES (" + string.Join("),(", _list) + ")"; + + sql = RemoveEmoji(sql); + mySqlSession.ExcuteSQL(sql, new { }); + //AddJindu4(); + _list.Clear(); + _list = null; + } + } + AddJindu4($"表{name},总共{rate + 1}页数据,转移插入第{j + 1}数据成功~!"); + + //AddJindu4($"表{name},获取数据完成~!"); + //AddJindu4($"表{name},准备转移插入数据中..."); + //if (valueList.Count != 0) + //{ + // int size = 120; + // var num = (int)Math.Ceiling((decimal)valueList.Count / size); + // AddJindu4($"表{name},准备转移插入数据中...", num); + + // for (int o = 1; o <= num; o++) + // { + // var _list = valueList.Skip((o - 1) * size).Take(size).ToList(); + // sql = "INSERT INTO " + name + " (" + string.Join(",", fieldList) + ") VALUES (" + string.Join("),(", _list) + ")"; + + // sql = RemoveEmoji(sql); + // mySqlSession.ExcuteSQL(sql, new { }); + // AddJindu4(); + // _list.Clear(); + // _list = null; + // } + //} + //valueList.Clear(); + //valueList = null; + + //AddJindu4($"表{name},转移插入第{j + 1}数据成功~!"); + } + } + #endregion + } + } + catch (Exception ex) + { + //Console.WriteLine(name); + throw ex; + } + } + } + AddJindu4($"所有数据转移完毕,正在提交数据...请稍等~!"); + mySqlSession.Commit(); + AddJindu4($"所有数据转移完成~!软件重启即可~!"); + ApiClient.Setting.DbConfig = tempConfig; + Util.Save(ApiClient.Setting); + flag = true; + } + catch (Exception ex) + { + flag = false; + AddJindu4($"转移失败,正在回滚数据..."); + mySqlSession.Rollback(); + AddJindu4($"转移失败,数据回滚完成~!"); + if (!this.IsDisposed) ShowError($"数据转移异常:({tableNameLog}) {ex}"); + } + finally + { + //Loding.CloseWaitForm(); + } + } + catch (Exception ex) + { + if (!this.IsDisposed) ShowError($"数据转移异常_:({tableNameLog})" + ex); + } + }); + + simpleButton7.Enabled = true; + + if (flag) + { + if (MessageBox.Show("配置导入成功,启动后生效,是否马上重启软件?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + #region 是否允许软件重启[创建一个名为 reset 的空文件,在FLSystem的Program中判断这个文件是否存在,存在将允许重启] + var reset_program = Util.MapFile("reset", "File"); + File.Create(reset_program); + #endregion + Application.ExitThread(); + Thread thtmp = new Thread(new ParameterizedThreadStart(run)); + object appName = Application.ExecutablePath; + Thread.Sleep(500); + thtmp.Start(appName); + } + } + } + + /// + /// 保存数据 + /// + /// + /// + /// + /// + /// + private void SaveData(List valueList, string name, string sql, List fieldList, SqlSugarClient mySqlSession) + { + + } + + + #endregion + + #region 自动备份 + private void simpleButton8_Click(object sender, EventArgs e) + { + try + { + if (label12.Text.ToLower() != "sqlite") throw new Exception("当前使用的是mysql数据库,该版块功能不支持"); + + if (string.IsNullOrWhiteSpace(textEdit7.Text)) throw new Exception("数据库备份路径不能为空"); + else if (!Directory.Exists(textEdit7.Text.Trim())) throw new Exception("数据库备份路径不存在"); + + //var path = textEdit7.Text.Trim() + "数据库" + DateTime.Now.ToString("yyyyMMddHHmmss_fff.db"); + var path = Path.Combine(new string[] { textEdit7.Text.Trim(), "数据库" + DateTime.Now.ToString("yyyyMMddHHmmssfff") }); + File.Copy(Util.MapFile("数据库.db", "Config"), path); + if (File.Exists(path)) + { + if (Class1.Config.Is_Bak_Send_Email) + { + Zip.Process(new string[] { path }); + + var zipPath = path + ".zip"; + if (File.Exists(zipPath)) + ApiClient.SendAdminEmail(ApiClient.Setting.SystemConfig.account_admin_email, $"数据库备份{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}", "数据库备份", zipPath, true); + } + ShowSuccess("数据库备份成功"); + } + else + ShowError("数据库备份失败"); + } + catch (Exception ex) + { + ShowError(ex); + } + } + + private void Auto_Bak_onoff_Click(object sender, EventArgs e) + { + Class1.Config.Auto_Bak_OnOff = Auto_Bak_onoff.Checked; + } + + private void textEdit7_TextChanged(object sender, EventArgs e) + { + Class1.Config.Auto_Bak_Path = textEdit7.Text; + } + + private void dateTimePicker1_ValueChanged(object sender, EventArgs e) + { + Class1.Config.Auto_Bak_Time = dateTimePicker1.Value; + } + + private void numericUpDown2_ValueChanged(object sender, EventArgs e) + { + Class1.Config.Auto_Bak_Day = (int)numericUpDown2.Value; + } + + private void simpleButton9_Click(object sender, EventArgs e) + { + try + { + FolderBrowserDialog dialog = new FolderBrowserDialog(); + dialog.Description = "请选择文件路径"; + if (dialog.ShowDialog() == DialogResult.OK) + { + textEdit7.Text = dialog.SelectedPath; + } + } + catch (Exception ex) + { + ShowError(ex); + } + } + + #endregion + + #region 一键重新计算订单分出金额 + + private async void simpleButton12_Click(object sender, EventArgs e) + { + try + { + simpleButton12.Enabled = simpleButton15.Enabled = simpleButton16.Enabled = false; + await Task.Run(() => + { + var session = ApiClient.GetSession(); + try + { + session.BeginTransaction(); + AddJindu3("正在读取淘宝订单..."); + var tb_orders = session.Find("select * from fl_order_alimama", new { }); + AddJindu3($"淘宝订单获取成功", tb_orders.Count); + var members = session.Find("select * from fl_member_info"); + foreach (var order in tb_orders) + { + var member = members.FirstOrDefault(f => f.id == order.db_userid); + //计算的佣金 - 判断使用设置模式,符合将扣除用户自定义预扣佣金 + var commission = session.GetTbComparisonFeeRate(order); + //var itempoint = session.FindItemPoint(member, order.pub_share_pre_fee, order.item_num, CpsType.阿里妈妈); + var itempoint = session.FindItemPoint(member, commission, order.item_num, CpsType.阿里妈妈); + order.db_userpoint = itempoint.UserPoint; + order.db_point = HttpHelper.ObjectToJson(itempoint); + session.SaveOrUpdate(order); + AddJindu3(); + } + tb_orders.Clear(); + AddJindu3("淘宝订单修改完毕~!"); + AddJindu3("正在读取京东订单..."); + var jd_orders = session.Find("select * from fl_order_jingdong", new { }); + AddJindu3($"京东订单获取成功", jd_orders.Count); + foreach (var order in jd_orders) + { + var member = members.FirstOrDefault(f => f.id == order.db_userid); + var itempoint = session.FindItemPoint(member, order.estimateFee, (int)order.skuNum, CpsType.京东联盟); + order.db_userpoint = itempoint.UserPoint; + order.db_point = HttpHelper.ObjectToJson(itempoint); + session.SaveOrUpdate(order); + AddJindu3(); + } + jd_orders.Clear(); + AddJindu3("京东订单修改完毕~!"); + AddJindu3("正在读取拼多多订单..."); + var pdd_orders = session.Find("select * from fl_order_pinduoduo", new { }); + AddJindu3($"京东订单获取成功", pdd_orders.Count); + foreach (var order in pdd_orders) + { + var member = members.FirstOrDefault(f => f.id == order.db_userid); + var itempoint = session.FindItemPoint(member, order.promotion_amount, order.goods_quantity, CpsType.多多进宝); + order.db_userpoint = itempoint.UserPoint; + order.db_point = HttpHelper.ObjectToJson(itempoint); + session.SaveOrUpdate(order); + } + pdd_orders.Clear(); + AddJindu3("拼多多订单修改完毕~!"); + } + catch (Exception ex) + { + AddJindu3("修改异常,正在回滚数据~"); + session.Rollback(); + AddJindu3("修改异常,回滚数据完成~!"); + } + finally + { + AddJindu3("所有订单修改完毕!!!"); + session.Commit(); + } + }); + simpleButton12.Enabled = simpleButton15.Enabled = simpleButton16.Enabled = true; + } + catch (Exception ex) + { + if (!this.IsDisposed) ShowError("批量修改异常:" + ex.Message + " - " + ex.StackTrace); + } + } + + private object lock_obj3 = new object(); + private void AddJindu3(string text = "", int max = 0) + { + base.UpdateUI(() => + { + try + { + lock (lock_obj3) + { + if (!string.IsNullOrEmpty(text) && max == 0) + { + label6.Text = text; + } + else if (!string.IsNullOrEmpty(text) && max != 0) + { + label6.Text = text; + this.progressBar3.Value = 0; + this.progressBar3.Maximum = max; + } + else + { + if (this.progressBar3.Value < this.progressBar3.Maximum) this.progressBar3.Value++; + label6.Text = $"{this.progressBar3.Value}/{this.progressBar3.Maximum}"; + } + } + Application.DoEvents(); + } + catch (Exception) + { } + }); + } + + #endregion + + #region ECO数据导入 + + /// + /// 用户登录信息 + /// + EcoLoginInfo loginInfo = null; + + /// + /// 获取验证码 + /// + /// + /// + private async void button4_Click(object sender, EventArgs e) + { + //try + //{ + // if (string.IsNullOrWhiteSpace(textBox4.Text.Trim())) throw new Exception("请输入手机号码"); + // Eco eco = new Eco(); + // button4.Enabled = false; + // await Task.Run(() => + // { + // if (eco.ECOFindCerificationCode(textBox4.Text.Trim())) + // { + // if (!this.IsDisposed) ShowSuccessAutoClose("请求验证码成功"); + // Thread.Sleep(20000); + // } + // else + // this.Invoke(new Action(() => + // { + // if (!this.IsDisposed) ShowErrorAutoClose("获取验证码失败,请稍后重试"); + // })); + // }); + // button4.Enabled = true; + //} + //catch (Exception ex) + //{ + // if (!this.IsDisposed) ShowError($"{ex.Message} - {ex.StackTrace}"); + //} + } + + /// + /// 手机号码登录 + /// + /// + /// + private void button2_Click(object sender, EventArgs e) + { + try + { + //if (string.IsNullOrWhiteSpace(textBox3.Text.Trim())) throw new Exception("请输入验证码"); + //Eco eco = new Eco(); + ////var html = eco.ECOCheckVerificationCode(textBox4.Text.Trim(), textBox3.Text.Trim()); + //var html = eco.ECOLogin(textBox4.Text.Trim(), textBox3.Text.Trim(), Eco.LoginType.手机号码登录); + //if (string.IsNullOrWhiteSpace(html)) throw new Exception("请求异常,返回数据为空"); + //var dic = HttpExtend.JsonToDictionary(html); + //if (dic != null && dic.ContainsKey("msg")) + //{ + // var msg = dic["msg"].ToString(); + // //ShowSuccess(msg);//TODO 这里看怎么显示 + // if (msg != "登录成功") return; + + // if (!dic.ContainsKey("data")) throw new Exception("数据异常,未包含data"); + // var data = dic["data"] as Dictionary; + // if (!data.ContainsKey("loginValicateSingle")) throw new Exception("数据异常,未包含loginValicateSingle"); + // var loginValicateSingle = data["loginValicateSingle"].ToString(); + + // if (!data.ContainsKey("loginValicateName")) throw new Exception("数据异常,未包含loginValicateName"); + // var loginValicateName = data["loginValicateName"].ToString(); + + // if (!data.ContainsKey("token")) throw new Exception("数据异常,未包含token"); + // var token = data["token"].ToString(); + + // if (!data.ContainsKey("username")) throw new Exception("数据异常,未包含username"); + // var username = data["username"].ToString(); + + // loginInfo = new EcoLoginInfo() { loginValicateName = loginValicateName, loginValicateSingle = loginValicateSingle, token = token, username = username }; + + // ShowSuccess("第二步操作完成"); + //} + + + loginInfo = new EcoLoginInfo() { loginValicateName = textBox1.Text.Trim(), loginValicateSingle = textBox2.Text.Trim(), token = textBox5.Text.Trim(), username = textBox6.Text.Trim() }; + + ShowSuccess("第二步操作完成"); + } + catch (Exception ex) + { + ShowError($"{ex.Message} - {ex.StackTrace}"); + } + } + + #region ECO + + /// + /// ECO数据导入 + /// + /// + /// + private void button3_Click(object sender, EventArgs e) + { + if (loginInfo == null) { ShowErrorAutoClose("请先登录"); return; } + try + { + bool tbIsSelect = false; + bool pddIsSelect = false; + bool jdIsSelect = false; + if (!checkBox5.Checked && !checkBox8.Checked && !checkBox9.Checked && !checkBox10.Checked && !checkBox11.Checked && !checkBox12.Checked && !checkBox13.Checked && !checkBox14.Checked && !checkBox15.Checked && !checkBox16.Checked) + { + ShowSuccessAutoClose(@"会员数据,订单绑定至少勾选一个需要同步的数据!"); return; + } + + if (checkBox8.Checked || checkBox9.Checked || checkBox10.Checked) tbIsSelect = true; + if (checkBox11.Checked || checkBox12.Checked || checkBox13.Checked) jdIsSelect = true; + if (checkBox14.Checked || checkBox15.Checked || checkBox16.Checked) pddIsSelect = true; + + + if (checkBox5.Checked) + { + if (XtraMessageBox.Show(@"如果以前导入成功过会员数据,请勿重复导入! + +点击 yes 继续导入", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No) return; + } + + + Task.Run(() => + { + //EventClient.StopParsing = false; + try + { + OnEvent(this, "ECO导入开始执行..."); + Eco eco = new Eco(); + + #region 导入eco用户 + if (checkBox5.Checked) + { + try + { + #region excel用户数据导入(用户数据好像有缺失) + // //第一步找到设备列表(获取所有的机器人id) + // var robotids = new List(); + + // OnEvent(this, "开始获取机器人列表..."); + // eco.ECOFindRobotList(loginInfo.loginValicateName, loginInfo.loginValicateSingle, loginInfo.token, robotids); + // OnEvent(this, "获取机器人列表结束!"); + + // var savepath = @"Cache\ECO"; + // //第二步下载excel + // OnEvent(this, $"开始获取用户数据..."); + // OnEvent(this, $"第一个阶段开始..."); + // eco.ECODownloadMemberExcel(robotids, loginInfo.token, savepath); + + // //第三步读取excel + // OnEvent(this, $"第二个阶段开始..."); + // List memberInfos = eco.ECOReadExcel(savepath); + // OnEvent(this, $"获取用户数据结束!"); + + // //var ss = memberInfos.FirstOrDefault(f=>f.username == "wxid_9njcmjotsgm512"); + + // //第四部插入用户数据 + // OnEvent(this, $"导入用户数据开始..."); + // eco.ECOInsertMember(memberInfos); + // OnEvent(this, $"导入用户数据结束..."); + + // this.UpdateUI(() => + // { + // labelControl8.Text = "【导入成功】"; + // robotids.Clear(); + // }); + // ShowSuccess(@"用户数据导入成功 + //请勿重复导入用户数据,否则会导致积分叠加"); + #endregion + + #region 数据采集 + //第一步找到设备列表(获取所有的机器人id) + var robotids = new List(); + + OnEvent(this, "开始获取机器人列表..."); + eco.ECOFindRobotList(loginInfo.loginValicateName, loginInfo.loginValicateSingle, loginInfo.token, robotids); + OnEvent(this, "获取机器人列表结束!"); + + //var savepath = @"Cache\ECO"; + ////第二步下载excel + //OnEvent(this, $"开始获取用户数据..."); + //OnEvent(this, $"第一个阶段开始..."); + //eco.ECODownloadMemberExcel(robotids, loginInfo.token, savepath); + + ////第三步读取excel + //OnEvent(this, $"第二个阶段开始..."); + //List memberInfos = eco.ECOReadExcel(savepath); + //OnEvent(this, $"获取用户数据结束!"); + + //第二步采集用户数据 + OnEvent(this, $"开始采集用户数据"); + + List memberInfos = eco.ECOFindMembers(loginInfo.token, robotids); + + //第三步数据校验 + eco.ECOFindMemberList(loginInfo.token, string.Empty, memberInfos); + //var ss = memberInfos.FirstOrDefault(f=>f.username == "wxid_9njcmjotsgm512"); + + //第四部插入用户数据 + OnEvent(this, $"导入用户数据开始..."); + eco.ECOInsertMember(memberInfos); + OnEvent(this, $"导入用户数据结束..."); + + this.UpdateUI(() => + { + labelControl8.Text = "【导入成功】"; + robotids.Clear(); + }); + ShowSuccess(@"用户数据导入成功 +请勿重复导入用户数据,否则会导致积分叠加"); + #endregion + } + catch (Exception ex) + { + this.UpdateUI(() => + { + labelControl8.Text = "【导入失败】"; + }); + ShowErrorAutoClose($@"用户数据导入失败 - {ex.Message} - {ex.StackTrace}"); + } + } + #endregion + + #region 绑定订单数据 + if (tbIsSelect) + { + var session = ApiClient.GetSession(); + #region ECO淘宝订单采集 + var tbBindOrderList = new List(); //保存采集到的已经绑定的订单数据 + OnEvent(this, $"ECO淘宝订单信息开始采集..."); + + #region 淘宝采集 + if (checkBox8.Checked) + eco.ECOBindOrder(1, Eco.OrderType.淘宝, OrderStateType.已结算, tbBindOrderList, loginInfo.token, ""); + //eco.ECOBindOrder(1, OrderType.淘宝, OrderStateType.已失效, tbBindOrderList, loginInfo.token, ""); + if (checkBox9.Checked) + eco.ECOBindOrder(1, Eco.OrderType.淘宝, OrderStateType.未结算, tbBindOrderList, loginInfo.token, ""); + #endregion + + #region 淘宝订单(剩余那些绑定的订单(超过1000的)) + + if (checkBox10.Checked) + { + List tbOrders = null; + if (!checkEdit1.Checked) + { + //tbOrders = session.Find("select * from fl_order_alimama where db_userid = 0 and db_status != 1004 and create_time > @create_time", new { create_time = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd HH:mm::ss") }).ToList(); + + tbOrders = session.Find("select * from fl_order_alimama where db_userid = 0 and db_status != 1004 order by create_time desc", new { }).ToList(); + } + else + { + tbOrders = session.Find("select * from fl_order_alimama where db_userid = 0 and db_status != 1004 and @create_time1 <= create_time and create_time <= @create_time2 order by create_time desc", new { create_time1 = dateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss"), create_time2 = dateTimePicker3.Value.ToString("yyyy-MM-dd HH:mm:ss") }).ToList(); + } + + //tbOrders = session.Find("select * from fl_order_alimama where db_userid = 0 and db_status != 1004 and trade_parent_id in ('664726848631005452','664726240485482072','664933795817639226')", new { }).ToList(); + + if (tbOrders != null) + { + var tbBindOrderList2 = new List(); //保存采集到的剩余没有绑定的订单数据 + foreach (var item in tbOrders) + { + if (tbBindOrderList.FirstOrDefault(f => f.orderId == item.trade_parent_id && f.itemId == item.num_iid) == null) + eco.ECOBindOrder(1, Eco.OrderType.淘宝, OrderStateType.所有, tbBindOrderList2, loginInfo.token, item.trade_parent_id); + if (tbBindOrderList2.Count > 20) + { + eco.ECOOrderBind(CpsType.阿里妈妈, tbBindOrderList2); + tbBindOrderList2 = new List(); + } + } + //防止还有订单遗漏提交 + if (tbBindOrderList2.Count != 0) + { + eco.ECOOrderBind(CpsType.阿里妈妈, tbBindOrderList2); + tbBindOrderList2 = new List(); + } + } + } + #endregion + + OnEvent(this, $"ECO淘宝订单采集完毕!!!"); + + OnEvent(this, $"开始进行淘宝用户绑定..."); + //tbBindOrderList.AddRange(tbBindOrderList2); + eco.ECOOrderBind(CpsType.阿里妈妈, tbBindOrderList); + OnEvent(this, $"淘宝订单绑定完毕!"); + #endregion + } + + + if (jdIsSelect) + { + var session = ApiClient.GetSession(); + #region ECO京东订单采集 + + var jdBindOrderList = new List(); //保存采集到的已经绑定的订单数据 + OnEvent(this, $"ECO京东订单信息开始采集..."); + if (checkBox11.Checked) + eco.ECOBindOrder(1, Eco.OrderType.京东, OrderStateType.已结算, jdBindOrderList, loginInfo.token, ""); + //eco.ECOBindOrder(1, OrderType.京东, OrderStateType.已失效, jdBindOrderList, loginInfo.token, ""); + if (checkBox12.Checked) + eco.ECOBindOrder(1, Eco.OrderType.京东, OrderStateType.未结算, jdBindOrderList, loginInfo.token, ""); + + + #region 京东订单 剩余那些绑定的订单(超过1000的) + var jdBindOrderList2 = new List(); //保存采集到的剩余没有绑定的订单数据 + if (checkBox13.Checked) + { + //var jdOrders = session.Find("select * from fl_order_jingdong where db_userid = 0 and db_status != 1004").ToList(); + + List jdOrders = null; + if (!checkEdit1.Checked) + { + jdOrders = session.Find("select * from fl_order_jingdong where db_userid = 0 and db_status != 1004 order by orderTime desc", new { }).ToList(); + } + else + { + jdOrders = session.Find("select * from fl_order_jingdong where db_userid = 0 and db_status != 1004 and @orderTime1 <= orderTime and orderTime <= @orderTime2 order by orderTime desc", new { orderTime1 = dateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss"), orderTime2 = dateTimePicker3.Value.ToString("yyyy-MM-dd HH:mm:ss") }).ToList(); + } + + if (jdOrders != null) + { + foreach (var item in jdOrders) + { + if (jdBindOrderList.FirstOrDefault(f => f.orderId == item.orderId.ToString() && f.itemId == item.skuId.ToString()) == null) + eco.ECOBindOrder(1, Eco.OrderType.京东, OrderStateType.所有, jdBindOrderList2, loginInfo.token, item.orderId.ToString()); + if (jdBindOrderList2.Count > 20) + { + eco.ECOOrderBind(CpsType.京东联盟, jdBindOrderList2); + jdBindOrderList2 = new List(); + } + } + //防止还有订单遗漏提交 + if (jdBindOrderList2.Count != 0) + { + eco.ECOOrderBind(CpsType.京东联盟, jdBindOrderList2); + jdBindOrderList2 = new List(); + } + } + } + #endregion + OnEvent(this, $"ECO京东订单采集完毕!!!"); + + OnEvent(this, $"开始进行京东用户绑定..."); + //jdBindOrderList.AddRange(jdBindOrderList2); + eco.ECOOrderBind(CpsType.京东联盟, jdBindOrderList); + OnEvent(this, $"京东订单绑定完毕!"); + #endregion + } + + if (pddIsSelect) + { + var session = ApiClient.GetSession(); + #region 拼多多采集 + var pddBindOrderList = new List(); //保存采集到的已经绑定的订单数据 + OnEvent(this, $"ECO拼多多订单信息开始采集..."); + if (checkBox14.Checked) + eco.ECOBindOrder(1, Eco.OrderType.拼多多, OrderStateType.已结算, pddBindOrderList, loginInfo.token, ""); + //eco.ECOBindOrder(1, OrderType.拼多多, OrderStateType.已失效, pddBindOrderList, loginInfo.token, ""); + if (checkBox15.Checked) + eco.ECOBindOrder(1, Eco.OrderType.拼多多, OrderStateType.未结算, pddBindOrderList, loginInfo.token, ""); + + + #region 拼多多订单 剩余那些绑定的订单(超过1000的) + var pddBindOrderList2 = new List(); //保存采集到的剩余没有绑定的订单数据 + if (checkBox16.Checked) + { + //var pddOrders = session.Find("select * from fl_order_pinduoduo where db_userid = 0 and db_status != 1004").ToList(); + + List pddOrders = null; + if (!checkEdit1.Checked) + { + pddOrders = session.Find("select * from fl_order_pinduoduo where db_userid = 0 and db_status != 1004 order by order_create_time desc", new { }).ToList(); + } + else + { + pddOrders = session.Find("select * from fl_order_pinduoduo where db_userid = 0 and db_status != 1004 and @orderTime1 <= order_create_time and order_create_time <= @orderTime2 order by order_create_time desc", new { orderTime1 = dateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss"), orderTime2 = dateTimePicker3.Value.ToString("yyyy-MM-dd HH:mm:ss") }).ToList(); + } + + if (pddOrders != null) + { + foreach (var item in pddOrders) + { + if (pddBindOrderList.FirstOrDefault(f => f.orderId == item.order_sn && f.itemId == item.goods_id) == null) + eco.ECOBindOrder(1, Eco.OrderType.拼多多, OrderStateType.所有, pddBindOrderList2, loginInfo.token, item.order_sn); + if (pddBindOrderList2.Count > 20) + { + eco.ECOOrderBind(CpsType.多多进宝, pddBindOrderList2); + pddBindOrderList2 = new List(); + } + } + //防止还有订单遗漏提交 + if (pddBindOrderList2.Count != 0) + { + eco.ECOOrderBind(CpsType.多多进宝, pddBindOrderList2); + pddBindOrderList2 = new List(); + } + } + } + #endregion + + OnEvent(this, $"ECO拼多多订单采集完毕!!!"); + + OnEvent(this, $"开始进行拼多多用户绑定..."); + #region 绑定本地数据库的订单 + //pddBindOrderList.AddRange(pddBindOrderList2); + eco.ECOOrderBind(CpsType.多多进宝, pddBindOrderList); + OnEvent(this, $"拼多多订单绑定完毕!"); + #endregion + + #endregion + } + + OnEvent(this, $"ECO订单所有执行完毕同步绑定执行完毕!"); + if (!this.IsDisposed) ShowSuccess(@"订单绑定成功"); + + #endregion + } + catch (Exception ex) + { + OnEvent(this, $"ECO导入异常,已经终止导入操作~{ex.Message} - {ex.StackTrace}"); + if (!this.IsDisposed) ShowError($"ECO导入异常:{ex.Message} - {ex.StackTrace}"); + } + finally + { + OnEvent(this, "ECO导入执行完毕!"); + //EventClient.StopParsing = true; + } + }); + } + catch (Exception ex) + { + if (!this.IsDisposed) ShowError($"{ex.Message} - {ex.StackTrace}"); + } + } + + #endregion + + #endregion + + #region 数据库合并 + + public static List ConvertTo(DataTable table, string name) + { + if (table == null) + { + return null; + } + List list = new List(); + + foreach (DataRow row in table.Rows) + { + list.Add(row[name].ToString()); + } + return list; + } + public static IList ConvertTo(IList rows) + { + IList list = null; + + if (rows != null) + { + list = new List(); + + foreach (DataRow row in rows) + { + T item = CreateItem(row); + list.Add(item); + } + } + return list; + } + public static T CreateItem(DataRow row) + { + T obj = default(T); + if (row != null) + { + obj = Activator.CreateInstance(); + + foreach (DataColumn column in row.Table.Columns) + { + PropertyInfo prop = obj.GetType().GetProperty(column.ColumnName); + try + { + object value = row[column.ColumnName]; + prop.SetValue(obj, value, null); + } + catch + { //You can log something here + //throw; + } + } + } + + return obj; + } + + /// + /// 选择合并的数据库 + /// + /// + /// + private void simpleButton11_Click(object sender, EventArgs e) + { + try + { + checkState = "-1"; + if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) + { + var path = folderBrowserDialog1.SelectedPath; + if (Directory.Exists(path)) + { + string[] paths = BackupAndImport.Tools.GetFiles(path, "(?(系统配置.ini$)|(数据库.db$))", -1); + if (paths != null && paths.Length != 0) + { + var iniConfig = paths.FirstOrDefault(f => f.ToLower().Contains("系统配置.ini")); + if (iniConfig != null) + { + Api.Framework.Tools.IniHelper ini = new Api.Framework.Tools.IniHelper(iniConfig); + var slqModel = ini.GetValue("数据库", "类型"); + if (slqModel == "5") //SQLiteConfig + { + textEdit8.Text = paths.FirstOrDefault(f => f.ToLower().Contains("数据库.db")); + + checkState = conn.CheckSqliteLink(textEdit8.Text.Trim(), ""); + label9.Text = "Sqlite"; + } + else if (slqModel == "4") //MySQLConfig + { + textEdit8.Text = iniConfig; + var mySQLConfig = ini.GetValue("数据库", "链接"); + var reg = Regex.Match(mySQLConfig, "Data Source=(?.*?);Initial Catalog=(?.*?);Persist Security Info=True;User ID=(?.*?);Password=(?.*?);Port=(?.*?);"); + if (reg.Success) + { + checkState = conn.CheckMysqlLink(reg.Groups["db_host"].ToString(), reg.Groups["db_name"].ToString(), reg.Groups["db_user"].ToString(), reg.Groups["db_pass"].ToString(), reg.Groups["db_port"].ToString()); //mysql链接是否成功 + label9.Text = "MySql"; + } + } + } + else + throw new Exception("未搜索到数据库"); + //else + //{ + // var db = paths.FirstOrDefault(f => f.ToLower().Contains("数据库.db")); + // if (db != null) + // { + // textEdit8.Text = db; + // checkState = conn.CheckSqliteLink(db, ""); + // label9.Text = "Sqlite"; + // } + // else throw new Exception("未搜索到数据库"); + //} + + if (string.IsNullOrEmpty(checkState)) + ShowSuccess("数据库链接成功!"); + else + { + label9.Text = "请选择数据库"; + ShowError(checkState); + } + } + } + } + } + catch (Exception ex) + { + ShowError(ex); + } + } + + #region 合并的进度条 + private object lock_obj2 = new object(); + private void AddJindu2(string text = "", int max = 0) + { + base.UpdateUI(() => + { + try + { + lock (lock_obj2) + { + if (!string.IsNullOrEmpty(text) && max == 0) + { + label36.Text = text; + } + else if (!string.IsNullOrEmpty(text) && max != 0) + { + label36.Text = text; + this.progressBar2.Value = 0; + this.progressBar2.Maximum = max; + } + else + { + if (this.progressBar2.Value < this.progressBar2.Maximum) this.progressBar2.Value++; + label36.Text = $"{this.progressBar2.Value}/{this.progressBar2.Maximum}"; + } + } + Application.DoEvents(); + } + catch (Exception) + { + } + }); + } + #endregion + + /// + /// 通用插入数据 + /// + /// + /// + /// + /// + private void InsertData(SqlSugarClient session, SqlSugarClient srcSession, IList tableNamelist, string tableNme, string fieldName = "", Dictionary memberIdDic = null, Dictionary robotIdDic = null, string defaultFieldName = "") + { + try + { + if (tableNamelist.Contains(tableNme)) + { + List fieldList = new List();//字段 + var sql = string.Empty; + if (conn.tempConfig.DatabaseType == DatabaseType.MYSQL) + sql = "select COLUMN_NAME as name from information_schema.COLUMNS where table_name = '" + tableNme + "'"; + else + sql = "pragma table_info('" + tableNme + "')"; + var fields = srcSession.FindTable(sql, new { }); + for (int k = 0; k < fields.Rows.Count; k++) + { + var temp = fields.Rows[k]["name"].ToString(); + if (temp.ToLower() != "id") + fieldList.Add(temp); + } + + sql = "select * from " + tableNme + ""; + var resultSrc = srcSession.FindTable(sql); + if (resultSrc.Rows.Count > 0) + { + List valueList = new List();//值 + for (int k = 0; k < resultSrc.Rows.Count; k++) + { + var _list = new List(); + var temp = string.Empty; + //foreach (var item in fieldList) + for (int z = 0; z < fieldList.Count; z++) + { + var item = fieldList[z]; + if (item.ToLower() == "id") continue; + temp = resultSrc.Rows[k][item].ToString().ToLower(); + if (!string.IsNullOrEmpty(fieldName) && item == fieldName) + { + if (memberIdDic != null && memberIdDic.ContainsKey(int.Parse(temp))) + temp = memberIdDic[int.Parse(temp)].ToString(); + + if (robotIdDic != null && robotIdDic.ContainsKey(int.Parse(temp))) + temp = robotIdDic[int.Parse(temp)].ToString(); + } + + //回复默认值 + if (!string.IsNullOrEmpty(defaultFieldName) && item == defaultFieldName) + { + temp = "0"; + } + temp = temp == "false" ? "0" : temp == "true" ? "1" : temp.Replace(@"\", @"\\").Replace("'", "\''"); + + if (item.Contains("remark") + || item.Contains("name") + || item.Contains("custom_type") + || item.Contains("nick") + || item.Contains("title") + || item.Contains("text") + || item.Contains("comment") + || item.Contains("sign") + || item.Contains("message") + ) + _list.Add(RemoveEmoji(temp)); + else + _list.Add(temp); + } + valueList.Add("'" + string.Join("','", _list) + "'"); + } + + if (valueList.Count != 0) + { + var num1 = (int)Math.Ceiling((decimal)valueList.Count / 100m); + int size = 100; + for (int o = 1; o <= num1; o++) + { + var _list = valueList.Skip((o - 1) * size).Take(size).ToList(); + sql = "INSERT INTO " + tableNme + " (" + string.Join(",", fieldList) + ") VALUES (" + string.Join("),(", _list) + ")"; + session.ExcuteSQL(sql, new { }); + } + } + } + } + } + catch (Exception ex) + { + EventClient.OnEvent(this, ex.Message + "-" + ex.StackTrace); + } + } + + /// + /// 开始合并 + /// + /// + /// + private void simpleButton10_Click(object sender, EventArgs e) + { + try + { + simpleButton10.Enabled = false; + if (conn == null) throw new Exception("请选择数据库~!"); + + //await Task.Run(delegate () + Task.Run(delegate () + { + var session = ApiClient.GetSession(); + session.BeginTransaction(); + try + { + var srcSession = ApiClient.GetSession(conn.tempConfig, false); + DataTable query = null; + + AddJindu2("正在读取数据库表结构..."); + + if (ApiClient.Setting.DbConfig.DatabaseType == DatabaseType.SQLITE) + { + query = session.FindTable("SELECT name FROM sqlite_master WHERE type='table' and name != 'sqlite_sequence'", new { }); + session.ExcuteSQL("update fl_order_alimama set paid_time = '0001-01-01 00:00:00' where paid_time IS NULL"); + session.ExcuteSQL("update fl_order_jingdong set refundcreatetime = '0001-01-01 00:00:00' where refundcreatetime IS NULL"); + } + else if (ApiClient.Setting.DbConfig.DatabaseType == DatabaseType.MYSQL) + { + var reg = Regex.Match(ApiClient.Setting.DbConfig.ConnectionString, "Data Source=(?.*?);Initial Catalog=(?.*?);Persist Security Info=True;User ID=(?.*?);Password=(?.*?);Port=(?.*?);"); + if (!reg.Success) + { + AddJindu2("读取数据库表名失败,终止操作"); + return; + } + //获取数据库表结构 + query = session.FindTable("select table_name as name from information_schema.tables where table_schema=@table_schema and table_type='base table'", new { table_schema = reg.Groups["db_name"].ToString() }); + + //下面两句是将异常的字段数据改为正常的数据 + session.ExcuteSQL("update fl_order_alimama set paid_time = '0001-01-01 00:00:00' where ISNULL(paid_time)"); + session.ExcuteSQL("update fl_order_jingdong set refundcreatetime = '0001-01-01 00:00:00' where ISNULL(refundcreatetime)"); + } + + if (query == null || query.Rows.Count == 0) + { + AddJindu2("读取数据库表结构失败,终止操作"); + return; + } + + DataTable srcquery = null; + if (query != null && query.Rows.Count > 0) + { + AddJindu2("读取所有表结构成功"); + + var list = ConvertTo(query, "name"); //将DataTable 转成 List + + #region 读取原数据库表结构 + if (conn.tempConfig.DatabaseType == DatabaseType.SQLITE) + { + srcquery = srcSession.FindTable("SELECT name FROM sqlite_master WHERE type='table' and name != 'sqlite_sequence'", new { }); + srcSession.ExcuteSQL("update fl_order_alimama set paid_time = '0001-01-01 00:00:00' where paid_time IS NULL"); + } + else if (conn.tempConfig.DatabaseType == DatabaseType.MYSQL) + { + var reg = Regex.Match(conn.tempConfig.ConnectionString, "Data Source=(?.*?);Initial Catalog=(?.*?);Persist Security Info=True;User ID=(?.*?);Password=(?.*?);Port=(?.*?);"); + if (!reg.Success) + { + AddJindu2("读取数据库表名失败,终止操作"); + return; + } + + srcquery = srcSession.FindTable("select table_name as name from information_schema.tables where table_schema=@table_schema and table_type='base table'", new { table_schema = reg.Groups["db_name"].ToString() }); + srcSession.ExcuteSQL("update fl_order_alimama set paid_time = '0001-01-01 00:00:00' where ISNULL(paid_time)"); + } + + if (srcquery == null || srcquery.Rows.Count == 0) + { + AddJindu2("读取目标数据库表结构失败,终止操作"); + return; + } + + var srclist = ConvertTo(srcquery, "name"); //将DataTable 转成 List + #endregion + + #region fl_wechat_device 微信设备表 + AddJindu2("正在判断表:设备表 是否存在"); + if (list.Contains("fl_wechat_device") && srclist.Contains("fl_wechat_device")) + { + AddJindu2("设备表 存在,正在读取数据..."); + var wechat_device = session.Find("select * from fl_wechat_device", new { }); + var wechat_device_src = srcSession.Find("select * from fl_wechat_device", new { }); + AddJindu2($"设备表 导入中...", wechat_device_src.Count); + foreach (var item in wechat_device_src) + { + if (wechat_device.FirstOrDefault(f => f.weixinhao == item.weixinhao) == null) + session.Insertable(item).ExecuteReturnIdentity(); + AddJindu2(); + } + AddJindu2("设备表 数据导入成功"); + wechat_device.Clear(); + wechat_device_src.Clear(); + } + else AddJindu2("设备表 不存在"); + #endregion + + #region fl_robot_info 机器人表 + AddJindu2("正在判断表:机器人表 是否存在"); + if (list.Contains("fl_robot_info") && srclist.Contains("fl_robot_info")) + { + AddJindu2("机器人表 存在,正在读取数据..."); + var robot_info = session.Find("select * from fl_robot_info", new { }); + var robot_info_src = srcSession.Find("select * from fl_robot_info", new { }); + Dictionary robotIdDic = new Dictionary(); //原来的和现在的ID保存,以后直接替换机器人ID//前旧后新 + AddJindu2($"机器人表 导入中...", robot_info_src.Count); + foreach (var item in robot_info_src) + { + if (robot_info.FirstOrDefault(f => f.name == item.name && f.type == item.type) == null) + { + var oldId = item.id; + item.id = 0; + item.nick = Util.RemoveEmoji(item.nick); + var id = session.Insertable(item).ExecuteReturnIdentity(); + if (!robotIdDic.ContainsKey(oldId)) + robotIdDic.Add(oldId, id); + } + AddJindu2(); + } + robot_info_src.Clear(); + robot_info.Clear(); + AddJindu2("机器人表 数据导入成功"); + + #region fl_adzone_group 推广位组表 + AddJindu2("正在判断表:推广位组表 是否存在"); + if (list.Contains("fl_adzone_group") && srclist.Contains("fl_adzone_group")) + { + AddJindu2("推广位组表 存在,正在读取数据..."); + var adzone_groups = srcSession.Queryable().ToList(); + var srcadzone_groups = srcSession.Queryable().ToList(); + AddJindu2($"推广位组表 导入中...", srcadzone_groups.Count); + foreach (var item in srcadzone_groups) + { + var adzone_group = adzone_groups.FirstOrDefault(f => f.name == item.name); + if (adzone_group == null) + { + session.Insertable(item).ExecuteCommand(); + } + AddJindu2(); + } + AddJindu2("推广位组表 数据导入成功"); + } + #endregion + + #region fl_adzone_info 推广位表 + AddJindu2("正在判断表:推广位表 是否存在"); + if (list.Contains("fl_adzone_info") && srclist.Contains("fl_adzone_info")) + { + AddJindu2("推广位表 存在,正在读取数据..."); + var adzone_info = srcSession.Find("select * from fl_adzone_info"); + AddJindu2($"推广位表 导入中...", adzone_info.Count); + foreach (var item in adzone_info) + { + if (robotIdDic.ContainsKey(item.robot_id)) //将机器人存在的ID的数据导过来,不存在的不要了 + { + item.robot_id = robotIdDic[item.robot_id]; + item.id = 0; + session.Saveable(item).ExecuteCommand(); + } + AddJindu2(); + } + AddJindu2("推广位表 数据导入成功"); + } + #endregion + + #region fl_weixin_password 微信其他信息 + AddJindu2("正在判断表:微信其他信息表 是否存在"); + if (list.Contains("fl_weixin_password") && srclist.Contains("fl_weixin_password")) + { + AddJindu2("微信其他信息表 存在,正在读取数据..."); + var weixin_password = srcSession.Find("select * from fl_weixin_password"); + AddJindu2($"微信其他信息表 导入中...", weixin_password.Count); + foreach (var item in weixin_password) + { + if (robotIdDic.ContainsKey((int)item.robot_id)) //将机器人存在的ID的数据导过来,不存在的不要了 + { + item.robot_id = robotIdDic[item.robot_id]; + item.id = 0; + session.Saveable(item).ExecuteCommand(); + } + AddJindu2(); + } + AddJindu2("微信其他信息表 数据导入成功"); + } + else AddJindu2("微信其他信息表 不存在"); + + #endregion + } + else AddJindu2("微信其他信息表 不存在"); + + #endregion + + #region fl_cps_member 联盟账号 + AddJindu2("正在判断表:联盟账号表 是否存在"); + if (list.Contains("fl_cps_member") && srclist.Contains("fl_cps_member")) + { + AddJindu2("联盟账号表 存在,正在读取数据..."); + var cps_member = session.Find("select * from fl_cps_member", new { }); + var cps_member_src = srcSession.Find("select * from fl_cps_member", new { }); + var exp = cps_member_src.Where(a => !cps_member.Where(t => a.username == t.username).Any()).ToList(); + AddJindu2($"联盟账号表 导入中...", cps_member_src.Count); + foreach (var _item in cps_member_src) + { + var item = exp.FirstOrDefault(f => f.username == _item.username); + if (item != null) + { + item.id = 0; + session.Saveable(item).ExecuteCommand(); + } + AddJindu2(); + } + cps_member_src.Clear(); + cps_member.Clear(); + AddJindu2("联盟账号表 数据导入成功"); + } + else AddJindu2("联盟账号表 不存在"); + #endregion + + #region fl_member_info 用户数据 + AddJindu2("正在判断表:用户数据表 是否存在"); + if (list.Contains("fl_member_info") && srclist.Contains("fl_member_info")) + { + AddJindu2("用户数据表 存在,正在读取数据..."); + var member_info = session.Find("select * from fl_member_info", new { }); + var member_info_src = srcSession.Find("select * from fl_member_info", new { }); + Dictionary memberIdDic = new Dictionary();//前旧后新 + Dictionary bindDic = new Dictionary();//记录老的用户上级id,前面的是新用户的id_后面的是上级用户的老的id + int id = 0; + var robots = session.FindRobots(true); + AddJindu2($"用户数据表 导入中...", member_info_src.Count); + foreach (var item in member_info_src) + { + var member = member_info.FirstOrDefault(f => f.username == item.username); + if (member != null) + { + member.chat_count = member.chat_count + item.chat_count; + member.cur_point = (double)((decimal)member.cur_point + (decimal)item.cur_point); + member.buy_point = (double)((decimal)member.buy_point + (decimal)item.buy_point); + member.sum_point = (double)((decimal)member.sum_point + (decimal)item.sum_point); + member.ext_point = (double)((decimal)member.ext_point + (decimal)item.ext_point); + member.rew_point = (double)((decimal)member.rew_point + (decimal)item.rew_point); + member.finish_order = member.finish_order + item.finish_order; + member.bind_order = member.finish_order; + member.remark = member.remark + (string.IsNullOrEmpty(member.remark) ? "" : " -- ") + item.remark; + session.Updateable(member).ExecuteCommand(); + memberIdDic.Add(item.id, member.id); + } + else + { + item.group_id = 0; + var robot = robots.FirstOrDefault(f => f.name == item.robot_name && f.type == item.robot_type); + item.robot_name = robot == null ? string.Empty : robot.name; + if (robot != null) item.robot_type = robot.type; + item.usernick = Util.RemoveEmoji(item.usernick); + item.realnick = Util.RemoveEmoji(item.realnick); + //TODO 还要绑定上下级,这里还要绑定机器人信息 + id = session.Insertable(item).ExecuteReturnIdentity(); + memberIdDic.Add(item.id, id); + if (item.inviter_id != 0) + bindDic.Add(id, (int)item.inviter_id); + } + AddJindu2(); + } + AddJindu2("用户数据表 数据导入成功"); + + member_info_src.Clear();//释放 + member_info.Clear();//释放 + + #region 将老的上级替换成对应的新id用户 + AddJindu2("用户数据表 正在绑定上下级关系中...", bindDic.Count); + if (bindDic.Count != 0) + { + foreach (var item in bindDic) + { + var member = session.FindMemberInfoById(item.Key); + if (member != null && memberIdDic.ContainsKey(member.inviter_id)) + { + member.inviter_id = memberIdDic[member.inviter_id]; + session.SaveOrUpdate(member); + } + AddJindu2(); + } + } + bindDic.Clear(); + AddJindu2("用户数据表 绑定上下级成功"); + #endregion + + #region fl_alimama_order_lastnum 用户订单尾号 + AddJindu2("正在判断表:用户订单尾号表 是否存在"); + if (list.Contains("fl_alimama_order_lastnum") && srclist.Contains("fl_alimama_order_lastnum")) + { + AddJindu2("用户订单尾号表 存在,正在读取数据..."); + + var alimama_order_lastnum = session.Find("select * from fl_alimama_order_lastnum", new { });//现有的 + var alimama_order_lastnum_src = srcSession.Find("select * from fl_alimama_order_lastnum", new { });//导入的 + AddJindu2("用户订单尾号表 导入中...", alimama_order_lastnum_src.Count); + foreach (var item in alimama_order_lastnum_src) + { + if (memberIdDic.ContainsKey(item.userid)) + { + var order_lastnum = alimama_order_lastnum.FirstOrDefault(f => f.userid == memberIdDic[item.userid]); + if (order_lastnum == null) //不存在的插入,存在的不管 + { + item.userid = memberIdDic[item.userid]; + session.Insertable(item).ExecuteCommand(); + } + } + AddJindu2(); + } + alimama_order_lastnum_src.Clear(); + alimama_order_lastnum.Clear(); + } + AddJindu2("用户订单尾号表 合并成功"); + #endregion + + #region 黄海的合并需要注释掉 + + #region fl_order_alimama 淘宝订单 + AddJindu2("正在判断表:淘宝订单表 是否存在"); + if (list.Contains("fl_order_alimama") && srclist.Contains("fl_order_alimama")) + { + AddJindu2("淘宝订单表 存在,正在读取数据...(数据越多等待时间越长)"); + var order_alimama = session.Find("select * from fl_order_alimama", new { });//现有的数据 + var order_alimama_src = srcSession.Find("select * from fl_order_alimama where db_userid != 0", new { });//导入的数据 + + var _temp = new List();//要保存的订单 + var _temp2 = new List();//本地有的订单,但是没有被绑定 + AddJindu2($"淘宝订单表 导入中...", order_alimama_src.Count); + foreach (var item in order_alimama_src) + { + var order = order_alimama.FirstOrDefault(f => f.trade_id == item.trade_id && f.trade_parent_id == item.trade_parent_id);//匹配订单 + + if (order == null) + { + if (item.db_userid != 0) + { + if (memberIdDic.ContainsKey(item.db_userid)) + item.db_userid = memberIdDic[item.db_userid]; + else//要是用户不存在,改订单不属于任何人 + item.db_userid = 0; + } + item.id = 0; + _temp.Add(item); + } + else + { + if (order.db_userid == 0 && item.db_userid != 0)//本地的订单没有绑定用户,但是导入的的订单已经绑定了用户 + { + if (memberIdDic.ContainsKey(item.db_userid)) + order.db_userid = memberIdDic[item.db_userid]; + else//要是用户不存在,改订单不属于任何人 + order.db_userid = 0; + } + _temp2.Add(order); + } + AddJindu2(); + } + + order_alimama_src.Clear(); + order_alimama.Clear(); + + AddJindu2("淘宝订单表 保存中..."); + var _num1 = (int)Math.Ceiling((decimal)_temp.Count / 500m); + var _num2 = (int)Math.Ceiling((decimal)_temp2.Count / 500m); + + var _num = _num1 + _num2; + for (int o = 1; o <= _num1; o++) + { + var _list = _temp.Skip((o - 1) * 500).Take(500).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"淘宝订单表 保存中...{_num - o}"); + } + + for (int o = 1; o <= _num2; o++) + { + var _list = _temp2.Skip((o - 1) * 500).Take(500).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"淘宝订单表 保存中...{_num - o - _num1}"); + } + + _temp2.Clear(); + _temp.Clear(); + AddJindu2("淘宝订单表 保存成功"); + } + #endregion + + #region fl_order_pinduoduo 拼多多订单 + AddJindu2("正在判断表:拼多多订单表 是否存在"); + if (list.Contains("fl_order_pinduoduo") && srclist.Contains("fl_order_pinduoduo")) + { + AddJindu2("拼多多订单表 存在,正在读取数据...(数据越多等待时间越长)"); + var order_pinduoduo = session.Find("select * from fl_order_pinduoduo", new { }); + var order_pinduoduo_src = srcSession.Find("select * from fl_order_pinduoduo where db_userid != 0", new { }); + var _temp = new List(); + var _temp2 = new List(); + AddJindu2($"拼多多订单表 导入中...", order_pinduoduo_src.Count); + foreach (var item in order_pinduoduo_src) + { + var order = order_pinduoduo.FirstOrDefault(f => f.order_sn == item.order_sn); + if (order == null) + { + if (item.db_userid != 0) + { + if (memberIdDic.ContainsKey(item.db_userid)) + item.db_userid = memberIdDic[item.db_userid]; + else//要是用户不存在,改订单不属于任何人 + item.db_userid = 0; + } + item.id = 0; + _temp.Add(item); + } + else + { + if (order.db_userid == 0 && item.db_userid != 0)//本地的订单没有绑定用户,但是导入的的订单已经绑定了用户 + { + if (memberIdDic.ContainsKey(item.db_userid)) + order.db_userid = memberIdDic[item.db_userid]; + else//要是用户不存在,改订单不属于任何人 + order.db_userid = 0; + } + _temp2.Add(order); + } + AddJindu2(); + } + + order_pinduoduo.Clear(); + order_pinduoduo_src.Clear(); + + AddJindu2("拼多多订单表 保存中..."); + var _num1 = (int)Math.Ceiling((decimal)_temp.Count / 500m); + var _num2 = (int)Math.Ceiling((decimal)_temp2.Count / 500m); + + var _num = _num1 + _num2; + for (int o = 1; o <= _num1; o++) + { + var _list = _temp.Skip((o - 1) * 500).Take(500).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"拼多多订单表 保存中...{_num - o}"); + } + + for (int o = 1; o <= _num2; o++) + { + var _list = _temp2.Skip((o - 1) * 500).Take(500).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"拼多多订单表 保存中...{_num - o - _num1}"); + } + _temp2.Clear(); + _temp.Clear(); + AddJindu2("拼多多订单表 保存成功"); + } + #endregion + + #region fl_order_jingdong 京东订单 + AddJindu2("正在判断表:京东订单表 是否存在"); + if (list.Contains("fl_order_jingdong") && srclist.Contains("fl_order_jingdong")) + { + AddJindu2("京东订单表 存在,正在读取数据...(数据越多等待时间越长)"); + var order_jingdong = session.Find("select * from fl_order_jingdong", new { }); + var order_jingdong_src = srcSession.Find("select * from fl_order_jingdong where db_userid != 0", new { }); + + var _temp = new List(); + var _temp2 = new List(); + AddJindu2($"京东订单表 导入中...", order_jingdong_src.Count); + foreach (var item in order_jingdong_src) + { + var order = order_jingdong.FirstOrDefault(f => f.orderId == item.orderId); + if (order == null) + { + if (item.db_userid != 0) + { + if (memberIdDic.ContainsKey(item.db_userid)) + item.db_userid = memberIdDic[item.db_userid]; + else//要是用户不存在,改订单不属于任何人 + item.db_userid = 0; + } + item.id = 0; + _temp.Add(item); + } + else + { + order = order_jingdong.FirstOrDefault(f => f.orderId == item.orderId && f.db_userid == 0); + if (order != null && order.db_userid == 0 && item.db_userid != 0)//本地的订单没有绑定用户,但是导入的的订单已经绑定了用户 + { + if (memberIdDic.ContainsKey(item.db_userid)) + order.db_userid = memberIdDic[item.db_userid]; + else//要是用户不存在,改订单不属于任何人 + order.db_userid = 0; + } + if (order != null) + _temp2.Add(order); + else + { + } + } + AddJindu2(); + } + + order_jingdong_src.Clear(); + order_jingdong.Clear(); + + AddJindu2("京东订单表 保存中..."); + var _num1 = (int)Math.Ceiling((decimal)_temp.Count / 500m); + var _num2 = (int)Math.Ceiling((decimal)_temp2.Count / 500m); + var _num = _num1 + _num2; + for (int o = 1; o <= _num1; o++) + { + var _list = _temp.Skip((o - 1) * 500).Take(500).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"京东订单表 保存中...{_num - o}"); + } + + for (int o = 1; o <= _num2; o++) + { + var _list = _temp2.Skip((o - 1) * 500).Take(500).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"京东订单表 保存中...{_num - o - _num1}"); + } + _temp.Clear(); + _temp2.Clear(); + AddJindu2("京东订单表 保存成功"); + } + #endregion + + #region fl_order_weipinhui 唯品会订单 + AddJindu2("正在判断表:唯品会订单 是否存在"); + if (list.Contains("fl_order_weipinhui") && srclist.Contains("fl_order_weipinhui")) + { + AddJindu2("唯品会订单表 存在,正在读取数据...(数据越多等待时间越长)"); + var order_weipinhui = session.Find("select * from fl_order_weipinhui", new { });//现有的数据 + var order_weipinhui_src = srcSession.Find("select * from fl_order_weipinhui where db_userid != 0", new { });//导入的数据 + + var _temp = new List();//要保存的订单 + var _temp2 = new List();//本地有的订单,但是没有被绑定 + AddJindu2($"唯品会订单表 导入中...", order_weipinhui_src.Count); + foreach (var item in order_weipinhui_src) + { + var order = order_weipinhui.FirstOrDefault(f => f.orderSn == item.orderSn && f.goodsId == item.goodsId && f.sizeId == item.sizeId);//匹配订单 + if (order == null) + { + if (item.db_userid != 0) + { + if (memberIdDic.ContainsKey(item.db_userid)) + item.db_userid = memberIdDic[item.db_userid]; + else//要是用户不存在,改订单不属于任何人 + item.db_userid = 0; + } + item.id = 0; + _temp.Add(item); + } + else + { + if (order.db_userid == 0 && item.db_userid != 0)//本地的订单没有绑定用户,但是导入的的订单已经绑定了用户 + { + if (memberIdDic.ContainsKey(item.db_userid)) + order.db_userid = memberIdDic[item.db_userid]; + else//要是用户不存在,改订单不属于任何人 + order.db_userid = 0; + } + _temp2.Add(order); + } + AddJindu2(); + } + + order_weipinhui_src.Clear(); + order_weipinhui.Clear(); + + AddJindu2("唯品会订单表 保存中..."); + var _num1 = (int)Math.Ceiling((decimal)_temp.Count / 500m); + var _num2 = (int)Math.Ceiling((decimal)_temp2.Count / 500m); + + var _num = _num1 + _num2; + for (int o = 1; o <= _num1; o++) + { + var _list = _temp.Skip((o - 1) * 500).Take(500).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"唯品会订单表 保存中...{_num - o}"); + } + + for (int o = 1; o <= _num2; o++) + { + var _list = _temp2.Skip((o - 1) * 500).Take(500).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + AddJindu2($"唯品会订单表 保存中...{_num - o - _num1}"); + } + + _temp2.Clear(); + _temp.Clear(); + AddJindu2("唯品会订单表 保存成功"); + } + #endregion + + #endregion + + #region fl_point_hist 积分日志 + AddJindu2("正在判断表:积分日志表 是否存在"); + if (list.Contains("fl_point_hist") && srclist.Contains("fl_point_hist")) + { + AddJindu2("积分日志表 存在,正在读取数据..."); + var point_hist_src = srcSession.Find("select * from fl_point_hist", new { }); + AddJindu2("积分日志表 导入中...", point_hist_src.Count); + foreach (var item in point_hist_src) + { + item.uid = memberIdDic.ContainsKey((int)item.uid) ? memberIdDic[(int)item.uid] : 0; + if (item.rid != 0 && item.uid != 0) + { + var member = session.FindMemberInfoById(item.uid); + if (member != null) + { + var robot = robots.FirstOrDefault(f => f.name == member.robot_name && f.type == member.robot_type); + item.rid = robot == null ? 0 : robot.id; + } + } + item.id = 0; + AddJindu2(); + } + + var num = (int)Math.Ceiling((decimal)point_hist_src.Count / 500m); + for (int o = 1; o <= num; o++) + { + var _list = point_hist_src.Skip((o - 1) * 500).Take(500).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + } + AddJindu2("积分日志表 保存成功"); + point_hist_src.Clear(); + } + else AddJindu2("积分日志表 不存在"); + #endregion + + #region fl_query_hist 查询日志 xxx这个不导了 + + //AddJindu2("正在判断表:查询日志表 是否存在"); + //if (list.Contains("fl_query_hist")) + //{ + // AddJindu2("查询日志表 存在"); + // var query_hist = srcSession.Find("select * from fl_query_hist", new { }); + // AddJindu2("查询日志表 导入中...", query_hist.Count); + // foreach (var item in query_hist) + // { + // item.userid = memberIdDic.ContainsKey((int)item.userid) ? memberIdDic[(int)item.userid] : 0; + // item.id = 0; + // AddJindu2(); + // } + // var _num = (int)Math.Ceiling((decimal)query_hist.Count / 500m); + // for (int o = 1; o <= _num; o++) + // { + // var _list = query_hist.Skip((o - 1) * 500).Take(500).ToList(); + // session.Insertable(_list.ToArray()).ExecuteCommand(); + // } + // AddJindu2("查询日志表 导入成功"); + //} + //else AddJindu2("查询日志表 不存在"); + + #endregion + + #region fl_private_pid 用户私人pid表 + AddJindu2("正在判断表:用户私人pid表 是否存在"); + if (list.Contains("fl_private_pid") && srclist.Contains("fl_private_pid")) + { + AddJindu2("用户私人pid表 存在,正在读取数据..."); + var private_pid = srcSession.Find("select * from fl_private_pid", new { }); + AddJindu2("用户私人pid表 导入中...", private_pid.Count); + List items = new List(); + foreach (var item in private_pid) + { + if (memberIdDic.ContainsKey((int)item.uid)) + { + item.uid = memberIdDic[(int)item.uid]; + item.id = 0; + items.Add(item); + } + AddJindu2(); + } + + var _num_ = (int)Math.Ceiling((decimal)items.Count / 500m); + for (int o = 1; o <= _num_; o++) + { + var _list = items.Skip((o - 1) * 500).Take(500).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + } + items.Clear(); + private_pid.Clear(); + AddJindu2("用户私人pid表 导入成功"); + } + else + AddJindu2("用户私人pid表 不存在"); + #endregion + + #region fl_exchange_info 积分兑换记录 + AddJindu2("正在判断表:积分兑换记录表 是否存在"); + if (list.Contains("fl_exchange_info") && srclist.Contains("fl_exchange_info")) + { + AddJindu2("积分兑换记录表 存在,正在读取数据..."); + AddJindu2("积分兑换记录表 导入中...(速度可能有点慢)"); + InsertData(session, srcSession, list, "fl_exchange_info", "uid", memberIdDic, defaultFieldName: "rid"); + //重新查询导入后的数据,进行rid绑定 + var unRobotBind = session.Find("select * from fl_exchange_info where rid = 0", new { }); + if (unRobotBind != null && unRobotBind.Count != 0) + { + foreach (var item in unRobotBind) + { + var _member = session.FindMemberInfoById(item.uid); + if (_member != null) + { + var robot = robots.FirstOrDefault(f => f.name == _member.robot_name && f.type == _member.robot_type); + item.rid = robot == null ? 0 : robot.id; + session.Saveable(item).ExecuteCommand(); + } + AddJindu2(); + } + } + if (unRobotBind != null) + unRobotBind.Clear(); + AddJindu2("积分兑换记录表 导入完成"); + } + else AddJindu2("积分兑换记录表 不存在"); + #endregion + + #region fl_plugin_pointmanage_checkin_info 签到数据 xxx这个不导入 + //AddJindu2("正在判断表:签到数据表 是否存在"); + //if (list.Contains("fl_plugin_pointmanage_checkin_info")) + //{ + // AddJindu2("签到数据表 存在"); + // var plugin_pointmanage_checkin_info = session.Queryable("fl_plugin_pointmanage_checkin_info", "").ToDataTable(); + // var plugin_pointmanage_checkin_info_src = srcSession.Queryable("fl_plugin_pointmanage_checkin_info", "").ToDataTable(); + + // List fieldList = new List(); //字段 + // string sql = string.Empty; + // string name = "fl_plugin_pointmanage_checkin_info"; + // if (conn.tempConfig.DatabaseType == DatabaseType.MYSQL) + // sql = "select COLUMN_NAME as name from information_schema.COLUMNS where table_name = '" + name + "'"; + // else + // sql = "pragma table_info('" + name + "')"; + // var fields = srcSession.FindTable(sql, new { }); + // for (int k = 0; k < fields.Rows.Count; k++) + // { + // var temp = fields.Rows[k]["name"].ToString(); + // if (temp.ToLower() != "id") + // fieldList.Add(temp); + // } + + // sql = "select * from " + name + ""; + // var resultSrc = srcSession.FindTable(sql); + // if (resultSrc.Rows.Count > 0) + // { + // var result = session.FindTable(sql); + + // List valueList = new List(); //值 + // for (int k = 0; k < resultSrc.Rows.Count; k++) + // { + // #region 两个数据库数据合并 + + // if (result.Rows.Count > 0) + // { + // var uidSrc = long.Parse(resultSrc.Rows[k]["uid"].ToString()); + // if (memberIdDic.ContainsKey((int)uidSrc)) + // { + // var uidSrcStr = memberIdDic[(int)uidSrc].ToString(); + // for (int i = 0; i < result.Rows.Count; i++) + // { + // if (result.Rows[i]["uid"].ToString() == uidSrcStr) + // { + // var daysSrc = + // long.Parse(resultSrc.Rows[k]["days"].ToString()); + // var days = long.Parse(result.Rows[i]["days"].ToString()); + // var sumdaySrc = + // long.Parse(resultSrc.Rows[k]["sumday"].ToString()); + // var sumday = long.Parse(result.Rows[i]["sumday"].ToString()); + // var timeSrc = + // DateTime.Parse(resultSrc.Rows[k]["sumday"].ToString()); + // var time = DateTime.Parse( + // result.Rows[i]["sumday"].ToString()); + // session.ExcuteSQL( + // "update " + name + + // " set days = @days,sumday = @sumday,time = @time where id = @id", + // new + // { + // days = days + daysSrc, + // sumday = sumdaySrc + sumday, + // time = (timeSrc > time ? timeSrc : time), + // id = long.Parse(result.Rows[i]["id"].ToString()) + // }); + // uidSrcStr = string.Empty; //赋值为空,用于外部continue; + // break; + // } + // } + + // if (string.IsNullOrEmpty(uidSrcStr)) continue; + // } + // } + + // #endregion + + // var _list = new List(); + // var temp = string.Empty; + // foreach (var item in fieldList) + // { + // if (item.ToLower() == "id") continue; + // temp = resultSrc.Rows[k][item].ToString(); + // if (item == "uid") + // { + // if (memberIdDic.ContainsKey(int.Parse(temp))) + // temp = memberIdDic[int.Parse(temp)].ToString(); + // } + + // temp = temp.ToLower() == "false" ? "0" : + // temp.ToLower() == "true" ? "1" : + // temp.Replace(@"\", @"\\").Replace("'", "\''"); + // _list.Add(RemoveEmoji(temp)); + // } + + // valueList.Add("'" + string.Join("','", _list) + "'"); + // } + + // if (valueList.Count != 0) + // { + // var num1 = (int)Math.Ceiling((decimal)valueList.Count / 100m); + // int size = 100; + // for (int o = 1; o <= num1; o++) + // { + // var _list = valueList.Skip((o - 1) * size).Take(size).ToList(); + // sql = "INSERT INTO " + name + " (" + string.Join(",", fieldList) + + // ") VALUES (" + string.Join("),(", _list) + ")"; + // session.ExcuteSQL(sql, new { }); + // } + // } + // } + + //} + //else AddJindu2("签到数据表 不存在"); + #endregion + + #region fl_plugin_userfission_user_invitation_code 用户邀请码xxx这个不导入 + + //InsertData(session, srcSession, list, "fl_plugin_userfission_user_invitation_code", "member_info_id", memberIdDic); + + #endregion + + } + else AddJindu2("用户数据表 不存在"); + #endregion + + #region fl_order_refund_alimama 维权的订单数据表 + //AddJindu2("正在判断表:维权的订单数据表 是否存在"); + //if (list.Contains("fl_order_refund_alimama") && srclist.Contains("fl_order_refund_alimama")) + //{ + // AddJindu2("维权的订单数据表 存在,正在读取数据..."); + // var order_refund_alimama = session.Find("select * from fl_order_refund_alimama", new { }); + // var order_refund_alimama_src = srcSession.Find("select * from fl_order_refund_alimama", new { }); + // AddJindu2($"维权的订单数据表 导入中...", order_refund_alimama_src.Count); + // foreach (var item in order_refund_alimama_src) + // { + // var order_refund = order_refund_alimama.FirstOrDefault(f => f.tbtradeparentid == item.tbtradeparentid && f.tbtradeid == item.tbtradeid); + // if (order_refund == null) + // { + // item.id = 0; + // session.Insertable(item).ExecuteCommand(); + // } + // AddJindu2(); + // } + // order_refund_alimama.Clear(); + // order_refund_alimama_src.Clear(); + // AddJindu2("维权的订单数据表 导入成功"); + //} + #endregion + + #region fl_plugin_userfission_applyfriend_info 加好友申请 xxx + + //InsertData(session, srcSession, list, "fl_plugin_userfission_applyfriend_info"); + + #endregion + + #region fl_plugin_userfission_invite_record 用户邀请进群邀请记录 + + //InsertData(session, srcSession, list, "fl_plugin_userfission_invite_record"); + + #endregion + + } + + session.Commit(); + Thread.Sleep(200); + AddJindu2("所有数据已经全部合并完成,并提交成功!"); + Thread.Sleep(2000); + } + catch (Exception ex) + { + AddJindu2("合并操作执行异常,正在回滚数据..."); + session.Rollback(); + AddJindu2("合并操作执行异常,数据回滚完毕!"); + this.Invoke(new Action(delegate { ShowError(ex); })); + } + finally + { + this.Invoke(new Action(delegate + { + simpleButton10.Enabled = true; + })); + } + }); + } + catch (Exception ex) + { + if (!this.IsDisposed) ShowError(ex); + } + } + + private void comboBoxEdit2_SelectedIndexChanged(object sender, EventArgs e) + { + if (comboBoxEdit2.SelectedIndex == 5) + { + checkBox4.Enabled = true; + if (checkBox4.Checked) + { + panelControl1.Visible = true; + labelControl34.Visible = labelControl32.Visible = textEdit1.Visible = simpleButton1.Visible = false; + } + else + { + panelControl1.Visible = false; + labelControl34.Visible = labelControl32.Visible = textEdit1.Visible = simpleButton1.Visible = true; + } + } + else + { + labelControl34.Visible = labelControl32.Visible = textEdit1.Visible = simpleButton1.Visible = true; + checkBox4.Enabled = panelControl1.Visible = checkBox4.Checked = false; + } + } + + private void checkBox4_CheckedChanged(object sender, EventArgs e) + { + panelControl1.Visible = checkBox4.Checked; + labelControl34.Visible = labelControl32.Visible = textEdit1.Visible = simpleButton1.Visible = !checkBox4.Checked; + } + + private void simpleButton13_Click(object sender, EventArgs e) + { + var session = ApiClient.GetSession(); + session.BeginTransaction(); + try + { + var members = session.Find("select * from fl_member_info"); + var tblist = session.Find("select * from fl_order_alimama where db_userid != 0 and db_robotname = ''"); + + foreach (var item in tblist) + { + var member = members.FirstOrDefault(f => f.id == item.db_userid); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + session.SaveOrUpdate(item); + } + + var pddlist = session.Find("select * from fl_order_pinduoduo where db_userid != 0 and db_robotname = ''"); + + foreach (var item in pddlist) + { + var member = members.FirstOrDefault(f => f.id == item.db_userid); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + session.SaveOrUpdate(item); + } + + var jdlist = session.Find("select * from fl_order_jingdong where db_userid != 0 and db_robotname = ''"); + + foreach (var item in jdlist) + { + var member = members.FirstOrDefault(f => f.id == item.db_userid); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + session.SaveOrUpdate(item); + } + + session.Commit(); + } + catch (Exception ex) + { + session.Rollback(); + } + } + + private void simpleButton15_Click(object sender, EventArgs e) + { + try + { + var EditRobotNameForm = new EditRobotNameForm(); + EditRobotNameForm.ShowDialog(); + var RobotNameDic = EditRobotNameForm.RobotNameDic; + + if (RobotNameDic.Count == 0) + labelControl48.Text = "无设置"; + else + { + labelControl48.Text = "已经设置"; + labelControl48.Tag = RobotNameDic; + } + } + catch (Exception ex) + { + + } + } + + private async void simpleButton16_Click(object sender, EventArgs e) + { + try + { + if (labelControl48.Tag == null) throw new Exception("请先设置要修改的机器人账号,点击【修改数据】设置."); + simpleButton12.Enabled = simpleButton15.Enabled = simpleButton16.Enabled = false; + Action restatr = null; + EventClient.StopParsing = false; + await Task.Run(() => + { + var session = ApiClient.GetSession(); + session.BeginTransaction(); + try + { + var RobotNameDic = labelControl48.Tag as Dictionary; + AddJindu3($"获取需要修改的数据{RobotNameDic.Count}条", RobotNameDic.Count); + Thread.Sleep(1300); + foreach (KeyValuePair item in RobotNameDic) + { + if (session.TableExist("fl_robot_info")) + { + AddJindu3($"正在修改{item.Key},表 fl_robot_info 数据..."); + session.ExcuteSQL("update fl_robot_info set name = @newName where name = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_member_info")) + { + AddJindu3($"正在修改{item.Key},表 fl_member_info 数据..."); + session.ExcuteSQL("update fl_member_info set robot_name = @newName where robot_name = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_order_alimama")) + { + AddJindu3($"正在修改{item.Key},表 fl_order_alimama 数据..."); + session.ExcuteSQL("update fl_order_alimama set db_robotname = @newName where db_robotname = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_order_pinduoduo")) + { + AddJindu3($"正在修改{item.Key},表 fl_order_pinduoduo 数据..."); + session.ExcuteSQL("update fl_order_pinduoduo set db_robotname = @newName where db_robotname = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_order_jingdong")) + { + AddJindu3($"正在修改{item.Key},表 fl_order_jingdong 数据..."); + session.ExcuteSQL("update fl_order_jingdong set db_robotname = @newName where db_robotname = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_plugin_pointmanage_exchange_list")) + { + AddJindu3($"正在修改{item.Key},表 fl_plugin_pointmanage_exchange_list 数据..."); + session.ExcuteSQL("update fl_plugin_pointmanage_exchange_list set robot_name = @newName where robot_name = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_plugin_userfission_applyfriend_info")) + { + AddJindu3($"正在修改{item.Key},表 fl_plugin_userfission_applyfriend_info 数据..."); + session.ExcuteSQL("update fl_plugin_userfission_applyfriend_info set robot_name = @newName where robot_name = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_query_hist")) + { + AddJindu3($"正在修改{item.Key},表 fl_query_hist 数据..."); + session.ExcuteSQL("update fl_query_hist set robot_name = @newName where robot_name = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_wechat_device")) + { + AddJindu3($"正在修改{item.Key},表 fl_wechat_device 数据..."); + session.ExcuteSQL("update fl_wechat_device set weixinhao = @newName where weixinhao = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + if (session.TableExist("fl_plugin_autoanswer__log")) + { + AddJindu3($"正在修改{item.Key},表 fl_plugin_autoanswer__log 数据..."); + session.ExcuteSQL("update fl_plugin_autoanswer__log set robot_name = @newName where robot_name = @robot_name", new { newName = item.Value, robot_name = item.Key }); + } + AddJindu3($"修改{item.Key}相关的表数据成功~!"); + AddJindu3(); + session.Commit(); + AddJindu3("所有账号修改完毕!!!"); + restatr = ReStart; + } + } + catch (Exception ex) + { + AddJindu3("修改异常,正在回滚数据~"); + session.Rollback(); + ShowError(ex); + AddJindu3("修改异常,回滚数据完成~!"); + } + }); + EventClient.StopParsing = true; + simpleButton12.Enabled = simpleButton15.Enabled = simpleButton16.Enabled = true; + restatr?.Invoke(); + } + catch (Exception ex) + { + if (!this.IsDisposed) ShowError("批量修改异常:" + ex.Message + " - " + ex.StackTrace); + } + } + + /// + /// 软件重启 + /// + public void ReStart() + { + try + { + labelControl48.Text = "无设置"; + labelControl48.Tag = null; + //覆盖成功提示用户是否重启软件 + if (MessageBox.Show("机器人账号修改成功,启动后生效,是否马上重启软件?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + #region 是否允许软件重启[创建一个名为 reset 的空文件,在FLSystem的Program中判断这个文件是否存在,存在将允许重启] + var reset_program = Util.MapFile("reset", "File"); + File.Create(reset_program); + #endregion + + Application.ExitThread(); + Thread thtmp = new Thread(new ParameterizedThreadStart(run)); + object appName = Application.ExecutablePath; + Thread.Sleep(500); + thtmp.Start(appName); + } + } + catch (Exception ex) + { + ShowError(ex); + } + } + + #region 念初新版 + + Nianchu nc = null; + + /// + /// 验证token的有效性 + /// + /// + /// + private void button6_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrWhiteSpace(textBox7.Text)) throw new Exception("请先填写念初token"); + nc = new Nianchu(textBox7.Text); + ShowSuccess("验证成功,请进行下一步操作!"); + } + catch (Exception ex) + { + nc = null; + ShowError($"{ex.Message} - {ex.StackTrace}"); + } + } + + /// + /// 开始念初导入 + /// + /// + /// + private void button5_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrWhiteSpace(textBox7.Text) || nc == null) throw new Exception("请先填写念初token"); + + Task.Run(() => + { + try + { + OnEvent(this, "念初导入开始执行..."); + + #region 导入念初用户 + if (checkBox19.Checked) + { + try + { + //导入用户操作(获取机器人列表,机器人对应用户列表) + nc.InsertMember(); + + ShowSuccess(@"用户数据导入成功 +请勿重复导入用户数据,否则会导致积分叠加"); + } + catch (Exception ex) + { + ShowError($@"用户数据导入失败 - {ex.Message} - {ex.StackTrace}"); + } + } + #endregion + + #region 同步淘宝订单 + if (checkBox18.Checked) + { + nc.BindTb(); + } + #endregion + + #region 同步京东订单 + if (checkBox17.Checked) + { + + } + #endregion + + #region 同步拼多多订单 + if (checkBox7.Checked) + { + + } + #endregion + + OnEvent(this, $"念初订单所有执行完毕同步绑定执行完毕!"); + if (!this.IsDisposed) ShowSuccess(@"订单绑定成功"); + #endregion + } + catch (Exception ex) + { + OnEvent(this, $"念初导入异常,已经终止导入操作~{ex.Message} - {ex.StackTrace}"); + if (!this.IsDisposed) ShowError($"念初导入异常:{ex.Message} - {ex.StackTrace}"); + } + finally + { + OnEvent(this, "念初导入执行完毕!"); + //EventClient.StopParsing = true; + } + }); + + } + catch (Exception ex) + { + ShowError("念初导入异常:" + ex.Message + " - " + ex.StackTrace); + } + } + + #endregion + + private void checkedListBoxControl1_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + private void textEdit1_EditValueChanged(object sender, EventArgs e) + { + + } + + private void labelControl34_Click(object sender, EventArgs e) + { + + } + + + private void button7_Click(object sender, EventArgs e) + { + if (textBox8.Text == null) { ShowErrorAutoClose("请填写速推客云端cookie"); return; } + try + { + if (checkBox20.Checked) + { + if (XtraMessageBox.Show(@"如果以前导入成功过会员数据,请勿重复导入! + +点击 yes 继续导入", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No) return; + } + + + var ck = textBox8.Text; + button7.Enabled = false; + Task.Run(() => + { + try + { + BackupAndImport.速推客云端.EventLog.OnEvent(this, "速推客云端导入开始执行..."); + Stk stk = new Stk(ck); + + #region 导入eco用户 + if (checkBox20.Checked) + { + try + { + #region 数据采集 + //第一步找到设备列表(获取所有的机器人id以及机器人类型 ,1为普通微信,2为企业微信) + var robotids = new Dictionary(); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, "开始获取机器人列表..."); + stk.GetRobot(robotids); + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"获取机器人列表结束,一共{robotids.Count}!"); + + //第二步采集用户数据 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"开始采集用户数据"); + + //Dictionary> memberdic = new Dictionary>(); + + foreach (KeyValuePair robotinfo in robotids) + { + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"{robotinfo.Key}导入用户数据开始..."); + var members = new List(); + stk.GetMembers(robotinfo.Key, members); + //memberdic[robotinfo.Key] = members; + + stk.STKInsertMember(robotinfo.Key, robotids[robotinfo.Key] == "1" ? ChatType.微信 : ChatType.企业微信, members); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"{robotinfo.Key},导入用户数据结束!!!\r\n"); + } + + ////第四部插入用户数据 + //BackupAndImport.速推客云端.EventLog.OnEvent(this, $"导入用户数据开始..."); + //foreach (var dic in memberdic) + //{ + // stk.STKInsertMember(dic.Key, robotids[dic.Key] == "1" ? ChatType.微信 : ChatType.企业微信, dic.Value); + //} + //BackupAndImport.速推客云端.EventLog.OnEvent(this, $"导入用户数据结束!!!"); + + this.UpdateUI(() => + { + labelControl8.Text = "【导入成功】"; + robotids.Clear(); + }); + ShowSuccess(@"用户数据导入成功 +请勿重复导入用户数据,否则会导致积分叠加"); + #endregion + } + catch (Exception ex) + { + this.UpdateUI(() => + { + labelControl8.Text = "【导入失败】"; + }); + ShowErrorAutoClose($@"用户数据导入失败 - {ex.Message} - {ex.StackTrace}"); + } + } + #endregion + + if (checkBox31.Checked) + { + #region STK未审核提现采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客未审核提现信息开始采集..."); + + int total = 0; + int page = 0; + int pageSize = 100; + var date = DateTime.Now; + do + { + page++; + //Thread.Sleep(200); + stk.Exchanges(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"未审核提现采集完毕!"); + #endregion + } + + #region 绑定订单数据 + if (checkBox21.Checked) + { + #region STK淘宝订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客淘宝订单信息开始采集..."); + + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + //Thread.Sleep(200); + stk.BindTBOrder(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"淘宝订单绑定完毕!"); + #endregion + } + + + if (checkBox22.Checked) + { + #region STK京东订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客京东订单信息开始采集..."); + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + //Thread.Sleep(200); + stk.BindJDOrder(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"京东订单绑定完毕!"); + #endregion + } + + if (checkBox23.Checked) + { + #region STK拼多多订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客拼多多订单信息开始采集..."); + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + //Thread.Sleep(200); + stk.BindPDDOrder(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"拼多多订单绑定完毕!"); + #endregion + } + + if (checkBox24.Checked) + { + #region STK唯品会订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客唯品会订单信息开始采集..."); + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + stk.BindWPHOrder(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"唯品会订单绑定完毕!"); + #endregion + } + + if (checkBox25.Checked) + { + #region STK抖音订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客抖音订单信息开始采集..."); + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + stk.BindDYOrder(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"抖音订单绑定完毕!"); + #endregion + } + + //--------- + + if (checkBox26.Checked) + { + #region STK淘宝订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客淘宝订单信息开始采集..."); + + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + //Thread.Sleep(200); + stk.BindTBOrder2(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"淘宝订单绑定完毕!"); + #endregion + } + + + if (checkBox27.Checked) + { + #region STK京东订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客京东订单信息开始采集..."); + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + //Thread.Sleep(200); + stk.BindJDOrder2(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"京东订单绑定完毕!"); + #endregion + } + + if (checkBox28.Checked) + { + #region STK拼多多订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客拼多多订单信息开始采集..."); + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + //Thread.Sleep(200); + stk.BindPDDOrder2(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"拼多多订单绑定完毕!"); + #endregion + } + + if (checkBox29.Checked) + { + #region STK唯品会订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客唯品会订单信息开始采集..."); + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + stk.BindWPHOrder2(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"唯品会订单绑定完毕!"); + #endregion + } + + if (checkBox30.Checked) + { + #region STK抖音订单采集 + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"速推客抖音订单信息开始采集..."); + int total = 0; + int page = 0; + int pageSize = 30; + var date = DateTime.Now; + do + { + page++; + stk.BindDYOrder2(date, page, pageSize, out total); + } while (total > (page * pageSize)); + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"抖音订单绑定完毕!"); + #endregion + } + + + + + + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"云端速推客订单所有执行完毕同步绑定执行完毕!"); + if ((checkBox21.Checked || checkBox22.Checked || checkBox23.Checked || checkBox24.Checked || checkBox25.Checked + || checkBox26.Checked || checkBox27.Checked || checkBox28.Checked || checkBox29.Checked || checkBox30.Checked) && !this.IsDisposed) ShowSuccess(@"订单绑定成功"); + + #endregion + } + catch (Exception ex) + { + BackupAndImport.速推客云端.EventLog.OnEvent(this, $"云端速推客导入异常,已经终止导入操作~{ex.Message} - {ex.StackTrace}"); + if (!this.IsDisposed) ShowError($"云端速推客导入异常:{ex.Message} - {ex.StackTrace}"); + } + finally + { + this.Invoke(new Action(() => + { + button7.Enabled = true; + })); + BackupAndImport.速推客云端.EventLog.OnEvent(this, "云端速推客导入执行完毕!"); + //EventClient.StopParsing = true; + } + }); + } + catch (Exception ex) + { + if (!this.IsDisposed) ShowError($"{ex.Message} - {ex.StackTrace}"); + } + } + + } + + + class point + { + public long uid { get; set; } + + public double num { get; set; } + } + +} \ No newline at end of file diff --git a/应用/BackupAndImport/MainForm.resx b/应用/BackupAndImport/MainForm.resx new file mode 100644 index 0000000..fedd7b5 --- /dev/null +++ b/应用/BackupAndImport/MainForm.resx @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAUdEVYdFRpdGxlAEh5cGVybGluaztXZWI7Bv6gzgAA + BGFJREFUWEfFlXtQVFUcxxUWsEwT/pFmUsnRNI0EEi2EeAwiYOqyKwuLYAGxAgt7eQTyUAZalOWZ1oxB + BqQwU1pOBj3MxBZiWpYWQeSNoBINWiZvcMr8ds4VaWGvI39dz+znj/O933u/v3vO756dB+CJwinyCafI + J5win3CKfMIp8gmnyCecIp9winxiKMwc82dhpAedzx6P9RvkzZj8Px7eLCCYEMwITxEWTvH0lGZM0A+b + k39GJke4kUiWtiIwtuCLgLj836VMHvwU2fCVZ0EccQjCsIwBr71Jles3e9gQ7zMEEx9ZmhXxfzlHPy1y + uojZBczfHaFczyiPD2kudeCvoVFyaea4PTiM6rrLCIxRjbzssN3LXSJ3iM4oGqqpb8HNPwfxz717+Pf+ + fZDftL9G2/zA/7q3O8mgRRiTSwYF0GUUSJncr+qaOtkH9d0aRNv1ATR29aOhow/a1mv4uakbal07lB+W + w8knXCMMS6+uuKBB97XfoG3uhoZAfbr2G6hvuw5NSy/qrvQgp+gU3hBF/kQyLAmmNI+rADNpTO7w+MRd + 3Lh1BwfzS7DVn8FGz2Bs9g5FgOIQ5OlFCIx/H/5MDsSRWdglU2J7SBo8glLg/VYq3CQM7L1CWL9UnoHy + impUN3YhObcErhJmgmSsJND+MCiANtFCv6hsMgVaewfgKAyHpzSqyFhg8tJiC0v7wLiCyebOPgyNTuD2 + 8Bhu3hlBb/8fuNTWg3PVOhwrq4CjiPl7tZ2rD/UHRKR86huhxEVdJ1LySuEsjqZB62gOwaAA2qHPiiMP + 03w0dveTt4/Btt3BsQJTM1sLSysXX7lqrKm9F2ptCyrUOpz5UYviM1XIKjyNWGUhpNGZ2CJSTK6ycfZf + ZL7UcZdf8IHQ/UdwTtPCroCjMJIGvUKgfWBQAO1Oc6EsfXR8YpLd85NnL2JHcDI8g/ZjR2ga/BUqiMKV + 2LY3BW4BiXCWxMNJHEtCGRYXSRzcpfHw2JPA+t9JOopfr1xF+Tc1eDfrOF57M+wuybAmPHIFlngGJV74 + paGNNM9VtoFqm3ugbujCeW0rTv2gwdGTlWDeOwZ/sr+27tJuN4mirfT09zhxtgqffVeLr9UNOK9pRZWu + A9/WXkZZZQ3SjpQhNCEXNm5+9SRjNeHRPWDt4O2xhzk8ovroc7JsxThYcAIH8kuRnFeCpOxP2PC341XY + IpRNPP/iq8y6TVtDpFGZY8oPypGo+hipZK9TiTeFkJxTjNjMQoQk5MDRZ9+45QvWQSRjKcFkOlevAPoV + 0FPMYvkaO2ennTK1izhq0NlXASeRnN0/h537sMkreHiDi6/W4rmVYmOB6SqB6YJlK9ZudH2c39zSSkSe + vZxAT0UjgwL0iqDf6BLCMsJawgaCHcF+ClvCGgJ9E7qXCwhz9c8IZzP1J6zwoAjaD/TspgGLCIv1oHO6 + h3S1Hv7JzNlvkDdb4BtOkU84RT7hFPmEU+QTTpFPOEU+4RT5hFPkD8z7D3RuucIJQA76AAAAAElFTkSu + QmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAACF0RVh0VGl0 + bGUAQXBwbHk7T0s7Q2hlY2s7QmFycztSaWJib247ZGPIaAAACrBJREFUWEeVVwtQlccZXdu82jyaNmNr + 0zTpREBBBURRFEEMrysQlEReakAUH4ii4BtBERFRQOSN4AUFQZP4BARBAQmgiIkoaAQEL29RQUTBTpzM + nH7fwkVN03a6M2d2//2//c75zu7+XMT2ZEuxQ2kldh6yFqEZCrEnUyHCj80Wkd/aiKiTNiL6tI2IzbYV + 8Tm2IiHPTlAb8d8Qm6sQ+7OtRNQpSxFx3EKEfW0uQrNmieAMM7E9zVQEpJiILYnGYmPcdAqnti3ZQrQ/ + PSw6nqaLzv4McW/giETXQCYhS9x/lsVhaoLfEH5LeI3w+i/Acwx+z3Ej2p9miranR0TrkwzR3JcuVI8P + ibu9aaLxkVKsj5tGIdQCDphT0CEpoKN/UESnFJHJr9XEkjQ0w9wg+rQiOD5/dkViwexrSYU2PydfsPk5 + Id+6Oj7P+tK+ExYh2w+aTKbYNzieIIW09pGAx+nirlpAT6pYH2tEr6gFJH1GClNF25M0coKE9JMbBGrq + il8PyzR3is62bkgtmocLNzegtnMf6h/EoWvgqET9g3iai0Rh7TocPP8FIk+ZN+w4ZLKA1r5JkEKah8ib + HqWKOz0HxbqYIQH+CWaipS+ZRKSQiIMkQsnTsupNMdNHh39jUZlRMh817eHo6FeisTcStx4G4+bDbaju + 2oBrXetR8yAQtQ+2o6EnAq1PlLhOsYeLXbDrqGmVZ6DuWMrFjkg3GntSxJ3uZOEXM5UeqW2ON6G9SaQ9 + SiIhB3iKyV/zT5phufdri0fFtzZB1ReLG/e3oqpjDa52MtZKfH+Pxz6o6lyNyvZVuNTmjYpWL1zt2ICG + RzEorNmAXVkzH/mET7KhnOyGFFHfnSR89xvSkNrGWGPR9DiWRMTxoyTfGD3NKuIbq5+uqoKpsm24REkv + txHaVxLRSlzpGOzVuNzuReQrUN66DN81e6JUtRjFTR74ocMflxuDEZo56/nKUP1hEXUPE8SaKD4q1Hyj + porG3igeStuX75g4dme6WfdV1TZcaV+DsuYlEuUtnkSwFBVtni+Bnlt5nmIIpc0eKFG5o+iuGxLzFVi8 + Uwdnazxw6U4QApXGPc5rxk4gDrkdPpGTmFOIpbt0RcOjcB6yPW9sSTK6lHeN7VyJoqaFKLn7FS5Swosq + N3zX4k5Y9KJvdkdpixsRuxHxVyhWLcSpakd4hugiMNYPMRlRWBIyAQV1S3Dm6mr4RU+qJI53CHwwuWAh + vgocx5203mevwYKIrxW0134ouOOEQsKFRheJoiZXqsyVSOYTGWOBHDN4/gK9Tz5vDdcNU3CioBB1qm40 + qJow13c0EgotUaZai91HrLAocJwHcb1F4IKFWBigzR0/vLkuxrDh/M1VyK93xNk6B+TVO+Bcw5ck5EsU + NM6j3hHnGxkkjvsm6hk03n/aDIv8FSj/vh5t95+ip68Hq3fb4vjl5cj50RknauyRV+2DVeH6jcT1HmHY + BVm9k6+WIijVjOwmu27aIvu2HXJuf47c2/bIrZtDoggNcyXONThQz6BnEhmSZQS3Lda4fL0J97qfoffJ + Y6zYaY3MUg/k3HLCsWprZP1ghXN1ixF40AxzvTTsiVN9K6SAN1w3jY2KO+NCgbNxvMYaJ2sVOHVrNk4T + sm/bEGxJiB0JIlF1jMHx5hQDeGy1xZUaFToePkP3414sC7LCgTwXnPnREUerLZF5zRIZVeZIv6JAfLYL + XDaM5Sv3NoG/sFLFW/O3aFcoi1wRd9EECd/NICHmJMQSx65ZwF85kcZWJEYhBTHOEHYcmYxFW+1QVdOM + ju4B9D79CcFJXtiutJS2Z1Vb4AjlOVQ5CwmllLd0JtJKFoC4+DDyNgwL+L3rFu3utDJHRBdNw/5iI8QU + T0fCxRlYsE0THgE2cNs+DhlXZ+F4rSVO1FohMnsanNfPQEV1A9ofDqCr558ovHwCHkG6yK9zk8RpV8xw + oMwEcSUzEFMynWCMQxVOWLhVp4c4/0jgcyBVvO2yWft5SrkdIi8YYt+FqRILgzTgt3cRvr/VjqNns+G8 + aTwSimYg9rwxHHzHIa+sEq33+6WA1q4WOK6bgG+r3JFcYYbEUlPEl84gR40l+f4iI8ppBGWFPRb46zwn + zj8R+K+oFPCO80bt5wkXzRFeaIjI81MQljsV9ms/QeX1K7hH1d3t6MPpC8WYt04X9ms0cCz/LFSdfWh7 + 0I/uvmfwC5+HyBP2SC7/7CViY3KTHCVXuaDI84YkzAKuVCxxfvCKgHnrxnbvO2eKiMLJiCgwJNtmQlnk + THZNRld3Bzp7nqGJCPPKqpD4Df1RautFK5HzwTtVpKSPz0SkV86hdWz1dERLYiNEFZGbVFAEkTOiCmbC + acNY3oJhAXwG3nZYPeZS6HETRJwzxN78SQgvmISkMkv6pM7D8hAzPOh9gDay+m7nE/yo6kELWd9MaOlq + w9y1mkgtdRokVRMPbSNXzcScL5IK233CFA6rtaqIc/gMsIDf2S7XiNmcMp0CDRGWb4A9BQZyUXKZFfad + ssOavTbo6++XVTNxc9dTuTW7lV4IUJqR5TOHSbli3sZI2s5wcjS8YDIVZUDuTsGWg8aw8RydRJyv3II3 + Z7l8Yu8RpE/BU7H7rD7C8hgTpRsp5QqEHrVCYMJ8PO5/BhWRM67XV8LFXwOpFXNkpbJaJhzCXiqACwnL + nyhzRVDuxTv0YTLvY2fi5O8Acw9+CQl/+NxLsykwy0AKCD2rNySEFlMCZbktAtJMEZ7ujb6Bn2hLBrBq + jyWic+nmSIuZ8AXpHqo4LI8xcThP4NFJsPfWUhHXnwn8JRwhbJZrUj/4LSAXli4MnIA9eZMRkqOLXbm6 + UkjoUII0ukLrE42QfDIAeeXpWBmhh/iSWZJskHAirR2sNoyLIBdDc/Vknr2U023bBJg6fuxNXGr7R4jZ + yzSoly7wiXzfZpnG1bWJRJ6jL0WE0OIXQvRw+NJc+EQb4IuNHyO+wEZWt5sImUyOmZhjh9bJtbn68E3S + BeW+Thwvquem8NQQ+bdY1OBh1DcfZWS/aswj/yO62EkCdmZPkL10ZEhQ+mUHnKxeRKd66iAJEe4aqpTB + seo1ITl68M/Uwxxvzd7xJiNNiYN/DwxWz816iYbIrfUSObXL+ZHPwjtG9h99OddH6/n6NB3sODMewWdI + RPb4QTESlJjxChGLHRJNCKY4Xsc5HNZoPTe0/dCVcr9PYKdHKJZK5/9NgHor3pti9zdHuxWaj73jtKUI + NYJJyKsgIklG7+n55dhV8dqwW6HVZ6j4cD7l5E8v/xwbkUN81kvk2VMLWP6yALWId7WNRk6xXvxptdNm + Law/pIMgShp0Zhx2nCYCAj8zkZx/aY5jnbeMgZXH6Btahh/w/2BcuSRnMBfzysYDnmCwEGpqEbwdfFdH + Gs35yNt68egWB19NLNkzBn5KbWw8rIPtp8ch6NQ4bEzXgV+qDjzpnYOvFqwXa7Qa2f99Na0dRXiXIG1n + qHl+IcBryAXeCi+eVovgw8Inlq/NX/Q/G/W5qfM/4i3cR9+wdP+0ng4wGJbuo+st3D+9Yer8SYLerFFz + KPavBK6af/txIcPkvyrgP4Hay0LYQnaEE48kcHUfDoHHfL34+86nnEUPE/9absb/09RC+KpyYraUBTER + g8c8x+84Rh3/P5oQ/wKtHXLtkLLsUQAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAUdEVYdFRpdGxlAEh5cGVybGluaztXZWI7Bv6gzgAA + BGFJREFUWEfFlXtQVFUcxxUWsEwT/pFmUsnRNI0EEi2EeAwiYOqyKwuLYAGxAgt7eQTyUAZalOWZ1oxB + BqQwU1pOBj3MxBZiWpYWQeSNoBINWiZvcMr8ds4VaWGvI39dz+znj/O933u/v3vO756dB+CJwinyCafI + J5win3CKfMIp8gmnyCecIp9winxiKMwc82dhpAedzx6P9RvkzZj8Px7eLCCYEMwITxEWTvH0lGZM0A+b + k39GJke4kUiWtiIwtuCLgLj836VMHvwU2fCVZ0EccQjCsIwBr71Jles3e9gQ7zMEEx9ZmhXxfzlHPy1y + uojZBczfHaFczyiPD2kudeCvoVFyaea4PTiM6rrLCIxRjbzssN3LXSJ3iM4oGqqpb8HNPwfxz717+Pf+ + fZDftL9G2/zA/7q3O8mgRRiTSwYF0GUUSJncr+qaOtkH9d0aRNv1ATR29aOhow/a1mv4uakbal07lB+W + w8knXCMMS6+uuKBB97XfoG3uhoZAfbr2G6hvuw5NSy/qrvQgp+gU3hBF/kQyLAmmNI+rADNpTO7w+MRd + 3Lh1BwfzS7DVn8FGz2Bs9g5FgOIQ5OlFCIx/H/5MDsSRWdglU2J7SBo8glLg/VYq3CQM7L1CWL9UnoHy + impUN3YhObcErhJmgmSsJND+MCiANtFCv6hsMgVaewfgKAyHpzSqyFhg8tJiC0v7wLiCyebOPgyNTuD2 + 8Bhu3hlBb/8fuNTWg3PVOhwrq4CjiPl7tZ2rD/UHRKR86huhxEVdJ1LySuEsjqZB62gOwaAA2qHPiiMP + 03w0dveTt4/Btt3BsQJTM1sLSysXX7lqrKm9F2ptCyrUOpz5UYviM1XIKjyNWGUhpNGZ2CJSTK6ycfZf + ZL7UcZdf8IHQ/UdwTtPCroCjMJIGvUKgfWBQAO1Oc6EsfXR8YpLd85NnL2JHcDI8g/ZjR2ga/BUqiMKV + 2LY3BW4BiXCWxMNJHEtCGRYXSRzcpfHw2JPA+t9JOopfr1xF+Tc1eDfrOF57M+wuybAmPHIFlngGJV74 + paGNNM9VtoFqm3ugbujCeW0rTv2gwdGTlWDeOwZ/sr+27tJuN4mirfT09zhxtgqffVeLr9UNOK9pRZWu + A9/WXkZZZQ3SjpQhNCEXNm5+9SRjNeHRPWDt4O2xhzk8ovroc7JsxThYcAIH8kuRnFeCpOxP2PC341XY + IpRNPP/iq8y6TVtDpFGZY8oPypGo+hipZK9TiTeFkJxTjNjMQoQk5MDRZ9+45QvWQSRjKcFkOlevAPoV + 0FPMYvkaO2ennTK1izhq0NlXASeRnN0/h537sMkreHiDi6/W4rmVYmOB6SqB6YJlK9ZudH2c39zSSkSe + vZxAT0UjgwL0iqDf6BLCMsJawgaCHcF+ClvCGgJ9E7qXCwhz9c8IZzP1J6zwoAjaD/TspgGLCIv1oHO6 + h3S1Hv7JzNlvkDdb4BtOkU84RT7hFPmEU+QTTpFPOEU+4RT5hFPkD8z7D3RuucIJQA76AAAAAElFTkSu + QmCC + + + + 109, 17 + + + 289, 17 + + + 64 + + \ No newline at end of file diff --git a/应用/BackupAndImport/NianChu/Entitys/TbOrder.cs b/应用/BackupAndImport/NianChu/Entitys/TbOrder.cs new file mode 100644 index 0000000..872eb12 --- /dev/null +++ b/应用/BackupAndImport/NianChu/Entitys/TbOrder.cs @@ -0,0 +1,302 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.NianChu.Entitys +{ + public class TbOrder + { + /// + /// + /// + public int code { get; set; } + /// + /// 操作成功 + /// + public string msg { get; set; } + /// + /// + /// + public OrderList data { get; set; } + } + + public class User_info + { + /// + /// + /// + public int uid { get; set; } + /// + /// + /// + public string wxid { get; set; } + /// + /// A惠省钱一号 + /// + public string nickname { get; set; } + /// + /// + /// + public string username { get; set; } + /// + /// + /// + public int usertype { get; set; } + /// + /// + /// + public int integral { get; set; } + /// + /// + /// + public int qdcount { get; set; } + /// + /// + /// + public string qdlastdt { get; set; } + /// + /// + /// + public string mmpid { get; set; } + /// + /// + /// + public string pidname { get; set; } + /// + /// + /// + public string trjid { get; set; } + /// + /// + /// + public string groupid { get; set; } + /// + /// + /// + public string groupwxid { get; set; } + /// + /// 每周五晚8点抽淘宝100元免单 + /// + public string groupname { get; set; } + /// + /// + /// + public string balance { get; set; } + /// + /// + /// + public string alipayrealname { get; set; } + /// + /// + /// + public string alipaynum { get; set; } + /// + /// + /// + public string regtime { get; set; } + /// + /// + /// + public string order_sixbit { get; set; } + /// + /// + /// + public string jdpid { get; set; } + /// + /// + /// + public string pddpid { get; set; } + /// + /// + /// + public string pdd_order_lastbit { get; set; } + /// + /// + /// + public int order_num { get; set; } + /// + /// + /// + public int smkey { get; set; } + /// + /// + /// + public string del { get; set; } + /// + /// + /// + public string order_date { get; set; } + /// + /// + /// + public string jinjie1 { get; set; } + /// + /// + /// + public string jinjie2 { get; set; } + /// + /// + /// + public string jinjie3 { get; set; } + /// + /// + /// + public int Evaluate_num { get; set; } + /// + /// + /// + public string avatar { get; set; } + /// + /// + /// + public string tag { get; set; } + } + + public class Order + { + /// + /// + /// + public int id { get; set; } + /// + /// + /// + public string orderno { get; set; } + /// + /// + /// + public string iid { get; set; } + /// + /// 超火cec卫衣女早春秋薄款韩版ins潮慵懒风bf宽松waitmore百搭外套 + /// + public string title { get; set; } + /// + /// + /// + public string item_img { get; set; } + /// + /// + /// + public string cid { get; set; } + /// + /// + /// + public int amount { get; set; } + /// + /// + /// + public string price { get; set; } + /// + /// + /// + public string realprice { get; set; } + /// + /// + /// + public string tkrate { get; set; } + /// + /// + /// + public string tkcommission { get; set; } + /// + /// + /// + public string mediaid { get; set; } + /// + /// + /// + public string adid { get; set; } + /// + /// + /// + public string mmpid { get; set; } + /// + /// 柠檬 + /// + public string pidname { get; set; } + /// + /// + /// + public string createdt { get; set; } + /// + /// + /// + public string accountdt { get; set; } + /// + /// 天猫 + /// + public string ordertype { get; set; } + /// + /// + /// + public int orderstatus { get; set; } + /// + /// + /// + public string wxid { get; set; } + /// + /// + /// + public string userid { get; set; } + /// + /// + /// + public string fl_group { get; set; } + /// + /// + /// + public string fl_agent { get; set; } + /// + /// + /// + public string fl_user { get; set; } + /// + /// + /// + public string fl_Integral { get; set; } + /// + /// + /// + public int flstatus { get; set; } + /// + /// + /// + public int luckdrawTAG { get; set; } + /// + /// + /// + public int exceltype { get; set; } + /// + /// + /// + public string batch { get; set; } + /// + /// + /// + public string modifytime { get; set; } + /// + /// 女装/女士精品 + /// + public string item_tag { get; set; } + /// + /// + /// + public User_info user_info { get; set; } + } + + public class OrderList + { + /// + /// + /// + public List list { get; set; } + /// + /// + /// + public int count { get; set; } + } + + +} diff --git a/应用/BackupAndImport/NianChu/Entitys/members.cs b/应用/BackupAndImport/NianChu/Entitys/members.cs new file mode 100644 index 0000000..7863d50 --- /dev/null +++ b/应用/BackupAndImport/NianChu/Entitys/members.cs @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.NianChu.Entitys +{ + public class User_group_info + { + /// + /// + /// + public int id { get; set; } + /// + /// 黑铁会员 + /// + public string name { get; set; } + /// + /// + /// + public int rebate_group { get; set; } + } + + public class Superiors_info + { + /// + /// + /// + public int uid { get; set; } + /// + /// + /// + public string nickname { get; set; } + } + + public class Member + { + /// + /// + /// + public int uid { get; set; } + /// + /// + /// + public string wxid { get; set; } + /// + /// (默)& + /// + public string nickname { get; set; } + /// + /// + /// + public string username { get; set; } + /// + /// + /// + public int usertype { get; set; } + /// + /// + /// + public int integral { get; set; } + /// + /// + /// + public int qdcount { get; set; } + /// + /// + /// + public string qdlastdt { get; set; } + /// + /// + /// + public string mmpid { get; set; } + /// + /// + /// + public string pidname { get; set; } + /// + /// + /// + public string trjid { get; set; } + /// + /// + /// + public string groupid { get; set; } + /// + /// + /// + public string groupwxid { get; set; } + /// + /// + /// + public string groupname { get; set; } + /// + /// + /// + public string balance { get; set; } + /// + /// + /// + public string alipayrealname { get; set; } + /// + /// + /// + public string alipaynum { get; set; } + /// + /// + /// + public string regtime { get; set; } + /// + /// + /// + public string order_sixbit { get; set; } + /// + /// + /// + public string jdpid { get; set; } + /// + /// + /// + public string pddpid { get; set; } + /// + /// + /// + public string pdd_order_lastbit { get; set; } + /// + /// + /// + public int order_num { get; set; } + /// + /// + /// + public int smkey { get; set; } + /// + /// + /// + public string del { get; set; } + /// + /// + /// + public string order_date { get; set; } + /// + /// + /// + public string jinjie1 { get; set; } + /// + /// + /// + public string jinjie2 { get; set; } + /// + /// + /// + public string jinjie3 { get; set; } + /// + /// + /// + public int Evaluate_num { get; set; } + /// + /// + /// + public string avatar { get; set; } + /// + /// + /// + public string tag { get; set; } + /// + /// + /// + public User_group_info user_group_info { get; set; } + /// + /// + /// + public Superiors_info superiors_info { get; set; } + } + + public class MemberList + { + /// + /// + /// + public List list { get; set; } + /// + /// + /// + public int count { get; set; } + } + + public class members + { + /// + /// + /// + public int code { get; set; } + /// + /// 操作成功 + /// + public string msg { get; set; } + /// + /// + /// + public MemberList data { get; set; } + } + +} diff --git a/应用/BackupAndImport/NianChu/Entitys/robots.cs b/应用/BackupAndImport/NianChu/Entitys/robots.cs new file mode 100644 index 0000000..36f4756 --- /dev/null +++ b/应用/BackupAndImport/NianChu/Entitys/robots.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.NianChu.Entitys +{ + public class robots + { + /// + /// + /// + public int code { get; set; } + /// + /// 操作成功 + /// + public string msg { get; set; } + /// + /// + /// + public RobotList data { get; set; } + } + public class RobotList + { + /// + /// + /// + public List list { get; set; } + /// + /// + /// + public int count { get; set; } + } + + public class Web_sub_database_info + { + /// + /// + /// + public int sub_id { get; set; } + } + + public class Robot + { + /// + /// + /// + public int id { get; set; } + /// + /// + /// + public int main_id { get; set; } + /// + /// + /// + public string wx_id { get; set; } + /// + /// + /// + public string nickname { get; set; } + /// + /// + /// + public int time { get; set; } + /// + /// + /// + public string credit { get; set; } + /// + /// + /// + public string wx_avatar { get; set; } + /// + /// + /// + public string create_time { get; set; } + /// + /// + /// + public int group_id { get; set; } + /// + /// + /// + public Web_sub_database_info web_sub_database_info { get; set; } + /// + /// + /// + public string get_robot_group_list { get; set; } + /// + /// + /// + public string get_ecc_project { get; set; } + } + +} diff --git a/应用/BackupAndImport/NianChu/EventLog.cs b/应用/BackupAndImport/NianChu/EventLog.cs new file mode 100644 index 0000000..e8e48b6 --- /dev/null +++ b/应用/BackupAndImport/NianChu/EventLog.cs @@ -0,0 +1,30 @@ +using BackupAndImport.ECO.Events; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.NianChu +{ + public class EventLog + { + public static event EventHandler LogEvent; + + public static void OnEvent(object sender, string log) + { + OnEvent(sender, new LogEvent(log)); + } + /// + /// 输出日志 + /// + internal static void OnEvent(object sender, LogEvent e) + { + if (LogEvent != null) + { + LogEvent.Invoke(sender, e); + } + } + + } +} diff --git a/应用/BackupAndImport/NianChu/Nianchu.cs b/应用/BackupAndImport/NianChu/Nianchu.cs new file mode 100644 index 0000000..80e7340 --- /dev/null +++ b/应用/BackupAndImport/NianChu/Nianchu.cs @@ -0,0 +1,704 @@ +using Api.Framework; +using Api.Framework.Enums; +using Api.Framework.Model; +using Api.Framework.SDK; +using Api.Framework.Tools; +using BackupAndImport.NianChu.Entitys; +using CsharpHttpHelper; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using static BackupAndImport.NianChu.EventLog; + +namespace BackupAndImport.NianChu +{ + public class Nianchu + { + private Random random = new Random(); + private string token = string.Empty; + + public Nianchu(string token) + { + try + { + this.token = token; + var url = $"{domainUrl}/5ca310d13e8b3?pageNo=1&pageSize=10&page=1&size=10"; + var html = GetNCHtml(url); + + if (!string.IsNullOrWhiteSpace(html)) + { + if (!html.Contains("操作成功")) + { + token = string.Empty; + throw new Exception($"念初token无效,请重新获取!{html}"); + } + } + } + catch (Exception ex) + { + throw ex; + } + + } + + /// + /// 默认域名 + /// + string domainUrl = "https://yun-api95d.nianchu.net:9991/api"; + + /// + /// 获取机器人列表 + /// + /// + private List GetRobots() + { + List robotList = null; + try + { + var objJson = GetNCHtml($"{domainUrl}/5ca310d13e8b3?pageSize=10000&page=1&size=10000"); + var robots = HttpHelper.JsonToObject(objJson) as robots; + if (robots != null && robots.code == 1) + { + if (robots.data.count == 0) throw new Exception("机器人列表为空,导入终止"); + if (robots.data.list != null) + robotList = robots.data.list; + } + } + catch (Exception ex) + { + OnEvent(this, $"获取机器人信息异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + return robotList; + } + + /// + /// 获取机器人对应的用户列表 + /// + /// + /// + private Dictionary> GetMembers(List robots) + { + Dictionary> objectDic = new Dictionary>(); + try + { + if (robots != null) + { + var page = 1;//获取的页数 + var size = 5000;//获取的数量 + var isGo = false;//是否获取下一页的member数据 + var objJson = string.Empty; + + + for (int i = 0; i < robots.Count; i++) + { + var members = new List(); + var robot = robots[i]; + page = 1; + isGo = false; + do + { + objJson = GetNCHtml($"{domainUrl}/5cb07ea5d4413?pageNo={page}&pageSize={size}&sub_id={robot.id}&page={page}&size={size}"); + var _members = HttpHelper.JsonToObject(objJson) as members; + if (_members != null && _members.code == 1) + { + if (_members.data.count == 0) throw new Exception("用户列表为空,导入终止"); + isGo = (_members.data.count > size * page);//判断是否获取下一页数据 + members.AddRange(_members.data.list);//追加数据到 + } + Thread.Sleep(2000 + random.Next(1000)); + page++; + } while (isGo); + objectDic.Add(robot, members); + } + } + } + catch (Exception ex) + { + OnEvent(this, $"获取机器人信息异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + return objectDic; + } + + /// + /// 插入用户数据到秒单客数据库(包括绑定上下级) + /// + public void InsertMember() + { + var session = ApiClient.GetSession(); + session.BeginTransaction(); + try + { + var robots = GetRobots(); + var wxInfos = GetMembers(robots);//所有的机器人账号,键 为 机器人信息,值 为 用户集合信息 + + if (wxInfos != null && wxInfos.Count != 0) + { + var srcMemberInfo = session.Find("select * from fl_member_info"); + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + foreach (KeyValuePair> item in wxInfos) + { + var members = item.Value; + foreach (var member in members) + { + var user = srcMemberInfo.FirstOrDefault(f => f.username == member.wxid && f.robot_type == ChatType.微信); + if (user == null) + { + user = new fl_member_info() + { + username = member.wxid, + robot_type = ChatType.微信, + usernick = member.nickname.Replace("'", "''"), + cur_point = double.Parse(member.balance), + sum_point = 0, + ext_point = 0, + finish_order = member.order_num, + bind_order = member.order_num, + robot_name = item.Key.wx_id, + alipay_name = string.Empty, + alipay_num = string.Empty, + remark = string.Empty + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + user.group_id = groups[0].id; + unMemberInfos.Add(user); + } + else + { + user.cur_point = (double)((decimal)user.cur_point + (decimal.Parse(member.balance))); + user.finish_order = user.finish_order + member.order_num; + user.bind_order = user.bind_order + member.order_num; + + if (string.IsNullOrWhiteSpace(user.robot_name)) + { + user.robot_name = item.Key.wx_id; + user.robot_type = ChatType.微信; + } + memberInfos.Add(user); + } + } + } + + OnEvent(this, $"执行用户导入操作..."); + + var _num1 = (int)Math.Ceiling((decimal)unMemberInfos.Count / 1000m); + for (int o = 1; o <= _num1; o++) + { + var _list = unMemberInfos.Skip((o - 1) * 1000).Take(1000).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + } + + var _num2 = (int)Math.Ceiling((decimal)memberInfos.Count / 1000m); + for (int o = 1; o <= _num2; o++) + { + var _list = memberInfos.Skip((o - 1) * 1000).Take(1000).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + } + + OnEvent(this, $"导入数据完成,正在绑定上下级..."); + //将有上级的用户筛选出来 + + var memberss = wxInfos.Values.ToList(); + + List memberList = new List();//所有的用户用户列表 + foreach (var item in memberss) + { + memberList.AddRange(item); + } + + var exiteInviteMemberList = memberList.Where(f => f.trjid != "0").ToList();//存在上级的用户集合 + + //绑定上下级 + if (exiteInviteMemberList != null && exiteInviteMemberList.Count != 0) + { + var newDbs = session.Queryable().ToList(); + + foreach (var item in exiteInviteMemberList) + { + var new_user = newDbs.FirstOrDefault(f => f.username == item.wxid); + if (new_user != null && new_user.inviter_id == 0) + { + var invitemember = memberList.FirstOrDefault(f => item.trjid == f.uid.ToString()); + if (invitemember != null) + { + var inviter = newDbs.FirstOrDefault(f => f.username == invitemember.wxid);//找出上级账号 + if (inviter != null) + { + new_user.inviter_id = inviter.id;//填写上级ID + session.Updateable(new { inviter_id = inviter.id }).Where(f => f.id == new_user.id).ExecuteCommand(); + } + else + { + + } + } + else + { } + } + } + newDbs.Clear(); + } + OnEvent(this, $"用户上下级关系绑定成功!"); + session.Commit(); + srcMemberInfo.Clear(); + exiteInviteMemberList.Clear(); + memberss.Clear(); + memberList.Clear(); + } + } + catch (Exception ex) + { + OnEvent(this, $"导入用户数据异常,开始回滚数据..."); + session.Rollback(); + OnEvent(this, $"导入用户数据异常,回滚执行成功! 异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + } + + /// + /// 绑定淘宝订单 + /// + public void BindTb() + { + var session = ApiClient.GetSession(); + try + { + var robots = GetRobots(); + + if (robots != null) + { + var page = 1;//获取的页数 + var size = 5000;//获取的数量 + var isGo = false;//是否获取下一页的member数据 + var objJson = string.Empty; + + TbOrder tbOrder = null; + + List orderList = new List();//将所有的订单保存下来 + + for (int i = 0; i < robots.Count; i++) + { + var robot = robots[i]; + page = 1; + isGo = false; + do + { + objJson = GetNCHtml($"{domainUrl}/5caf22f33b600?pageNo={page}&pageSize={size}&page={page}&size={size}&sub_id={robot.id}"); + tbOrder = HttpHelper.JsonToObject(objJson) as TbOrder; + if (tbOrder != null && tbOrder.code == 1) + { + if (tbOrder.data.count == 0) continue; + orderList.AddRange(tbOrder.data.list.Where(f => !string.IsNullOrWhiteSpace(f.userid))); + isGo = (tbOrder.data.count > page * size); + Thread.Sleep(2000 + random.Next(1000)); + page++; + } + } while (isGo); + } + + #region 绑定订单 + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0");//本地所有没有绑定的订单 + + if (unBinds != null && unBinds.Count != 0) + { + var userId = session.Find("select id,username from fl_member_info", new { });//所有 fl_member_info 用户id 和 username + + foreach (var item in unBinds) + { + var result = orderList.Where(f => f.orderno == item.trade_parent_id).ToList(); + //EventClient.OnEvent(this,$"找到订单-{item.trade_parent_id}"); + if (result != null) + { + try + { + for (int i = 0; i < result.Count; i++) + { + var user = userId.FirstOrDefault(f => f.username == result[i].wxid);//fl_member_info 查询用户信息 + //EventClient.OnEvent(this, $"找到用户-{item.trade_parent_id}"); + if (user != null) + { + item.db_userid = user.id; + if (!item.IsFinish()) + { + SystemOrderStatus orderStatus = SystemOrderStatus.订单付款; + + switch (result[i].orderstatus) + { + case 0: + orderStatus = SystemOrderStatus.订单付款; + break; + case 2: + orderStatus = SystemOrderStatus.订单失效; + break; + case 3: + orderStatus = SystemOrderStatus.全额退款; + break; + case 1: + case 4: + orderStatus = SystemOrderStatus.订单结算; + break; + default: + break; + } + + item.db_status = orderStatus; + item.db_endtime = string.IsNullOrWhiteSpace(result[i].accountdt) ? DateTime.MinValue : DateTime.Parse(result[i].accountdt); + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + } + else + { + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + } + } + session.SaveOrUpdate(item); + } + } + } + catch (Exception) + { + } + } + } + } + + #endregion + } + + } + catch (Exception ex) + { + OnEvent(this, $"绑定淘宝订单异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + } + + /// + /// 绑定京东订单 + /// + public void BindJd() + { + var session = ApiClient.GetSession(); + try + { + var robots = GetRobots(); + + if (robots != null) + { + var page = 1;//获取的页数 + var size = 5000;//获取的数量 + var isGo = false;//是否获取下一页的member数据 + var objJson = string.Empty; + + TbOrder tbOrder = null; + + List orderList = new List();//将所有的订单保存下来 + + for (int i = 0; i < robots.Count; i++) + { + var robot = robots[i]; + page = 1; + isGo = false; + do + { + objJson = GetNCHtml($"{domainUrl}/5cb0037ad62f5?pageNo={page}&pageSize={size}&page={page}&size={size}&sub_id={robot.id}"); + tbOrder = HttpHelper.JsonToObject(objJson) as TbOrder; + if (tbOrder != null && tbOrder.code == 1) + { + if (tbOrder.data.count == 0) continue; + orderList.AddRange(tbOrder.data.list.Where(f => !string.IsNullOrWhiteSpace(f.userid))); + isGo = (tbOrder.data.count > page * size); + Thread.Sleep(2000 + random.Next(1000)); + page++; + } + } while (isGo); + } + + #region 绑定订单 + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0");//本地所有没有绑定的订单 + + if (unBinds != null && unBinds.Count != 0) + { + var userId = session.Find("select id,username from fl_member_info", new { });//所有 fl_member_info 用户id 和 username + + foreach (var item in unBinds) + { + var result = orderList.Where(f => f.orderno == item.trade_parent_id).ToList(); + //EventClient.OnEvent(this,$"找到订单-{item.trade_parent_id}"); + if (result != null) + { + try + { + for (int i = 0; i < result.Count; i++) + { + var user = userId.FirstOrDefault(f => f.username == result[i].wxid);//fl_member_info 查询用户信息 + //EventClient.OnEvent(this, $"找到用户-{item.trade_parent_id}"); + if (user != null) + { + item.db_userid = user.id; + if (!item.IsFinish()) + { + SystemOrderStatus orderStatus = SystemOrderStatus.订单付款; + + switch (result[i].orderstatus) + { + case 0: + orderStatus = SystemOrderStatus.订单付款; + break; + case 2: + orderStatus = SystemOrderStatus.订单失效; + break; + case 3: + orderStatus = SystemOrderStatus.全额退款; + break; + case 1: + case 4: + orderStatus = SystemOrderStatus.订单结算; + break; + default: + break; + } + + item.db_status = orderStatus; + item.db_endtime = string.IsNullOrWhiteSpace(result[i].accountdt) ? DateTime.MinValue : DateTime.Parse(result[i].accountdt); + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + } + else + { + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + } + } + session.SaveOrUpdate(item); + } + } + } + catch (Exception) + { + } + } + } + } + + #endregion + } + + } + catch (Exception ex) + { + OnEvent(this, $"绑定淘宝订单异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + } + + /// + /// 绑定拼多多订单 + /// + public void BindPdd() + { + var session = ApiClient.GetSession(); + try + { + var robots = GetRobots(); + + if (robots != null) + { + var page = 1;//获取的页数 + var size = 5000;//获取的数量 + var isGo = false;//是否获取下一页的member数据 + var objJson = string.Empty; + + TbOrder tbOrder = null; + + List orderList = new List();//将所有的订单保存下来 + + for (int i = 0; i < robots.Count; i++) + { + var robot = robots[i]; + page = 1; + isGo = false; + do + { + objJson = GetNCHtml($"{domainUrl}/5caf22f33b600?pageNo={page}&pageSize={size}&page={page}&size={size}&sub_id={robot.id}"); + tbOrder = HttpHelper.JsonToObject(objJson) as TbOrder; + if (tbOrder != null && tbOrder.code == 1) + { + if (tbOrder.data.count == 0) continue; + orderList.AddRange(tbOrder.data.list.Where(f => !string.IsNullOrWhiteSpace(f.userid))); + isGo = (tbOrder.data.count > page * size); + Thread.Sleep(2000 + random.Next(1000)); + page++; + } + } while (isGo); + } + + #region 绑定订单 + var unBinds = session.Find("select * from fl_order_alimama where db_userid = 0");//本地所有没有绑定的订单 + + if (unBinds != null && unBinds.Count != 0) + { + var userId = session.Find("select id,username from fl_member_info", new { });//所有 fl_member_info 用户id 和 username + + foreach (var item in unBinds) + { + var result = orderList.Where(f => f.orderno == item.trade_parent_id).ToList(); + //EventClient.OnEvent(this,$"找到订单-{item.trade_parent_id}"); + if (result != null) + { + try + { + for (int i = 0; i < result.Count; i++) + { + var user = userId.FirstOrDefault(f => f.username == result[i].wxid);//fl_member_info 查询用户信息 + //EventClient.OnEvent(this, $"找到用户-{item.trade_parent_id}"); + if (user != null) + { + item.db_userid = user.id; + if (!item.IsFinish()) + { + SystemOrderStatus orderStatus = SystemOrderStatus.订单付款; + + switch (result[i].orderstatus) + { + case 0: + orderStatus = SystemOrderStatus.订单付款; + break; + case 2: + orderStatus = SystemOrderStatus.订单失效; + break; + case 3: + orderStatus = SystemOrderStatus.全额退款; + break; + case 1: + case 4: + orderStatus = SystemOrderStatus.订单结算; + break; + default: + break; + } + + item.db_status = orderStatus; + item.db_endtime = string.IsNullOrWhiteSpace(result[i].accountdt) ? DateTime.MinValue : DateTime.Parse(result[i].accountdt); + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + } + else + { + if (string.IsNullOrWhiteSpace(item.db_robotname)) + { + var member = session.FindMemberInfoById(user.id); + if (member != null) + { + item.db_robotname = member.robot_name; + item.db_robottype = member.robot_type; + } + } + } + session.SaveOrUpdate(item); + } + } + } + catch (Exception) + { + } + } + } + } + + #endregion + } + + } + catch (Exception ex) + { + OnEvent(this, $"绑定淘宝订单异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + } + + /// + /// 请求念初服务器数据 + /// + /// + /// + private string GetNCHtml(string url) + { + try + { + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = url, + Method = "GET", + Encoding = UTF8Encoding.UTF8, + Timeout = 100000, + ReadWriteTimeout = 30000, + IsToLower = false, + Cookie = "", + UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)", + Accept = "text/html, application/xhtml+xml, */*", + ContentType = "application/json", + Referer = "https://yun.nianchu.net/", + Allowautoredirect = false, + AutoRedirectCookie = false, + }; + item.Header.Add("version", "v3.0"); + item.Header.Add("user-token", token); + HttpResult result = http.GetHtml(item); + string html = result.Html; + + return html; + } + catch (Exception ex) + { } + return string.Empty; + } + + /// + /// 念初订单状态 + /// + enum NcOrderStatic + { + 已付款 = 0, + 已结算 = 1, + 已失效 = 2, + 订单退款 = 3, + 订单完成 = 4 + } + + } +} diff --git a/应用/BackupAndImport/Properties/AssemblyInfo.cs b/应用/BackupAndImport/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..93e6c7f --- /dev/null +++ b/应用/BackupAndImport/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("DataDocking")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DataDocking")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("35a30202-1d63-413a-ad12-8ffb24165b43")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("2019.06.10.2")] +[assembly: AssemblyFileVersion("2019.06.10.2")] diff --git a/应用/BackupAndImport/Properties/Resources.Designer.cs b/应用/BackupAndImport/Properties/Resources.Designer.cs new file mode 100644 index 0000000..ba9206a --- /dev/null +++ b/应用/BackupAndImport/Properties/Resources.Designer.cs @@ -0,0 +1,100 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace BackupAndImport.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BackupAndImport.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性 + /// 重写当前线程的 CurrentUICulture 属性。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 查找类似 备份与导入 的本地化字符串。 + /// + internal static string MainFormTitle { + get { + return ResourceManager.GetString("MainFormTitle", resourceCulture); + } + } + + /// + /// 查找类似 备份与导入 的本地化字符串。 + /// + internal static string PluginName { + get { + return ResourceManager.GetString("PluginName", resourceCulture); + } + } + + /// + /// 查找类似 备份与导入,多机器人数据对接 的本地化字符串。 + /// + internal static string PluginNote { + get { + return ResourceManager.GetString("PluginNote", resourceCulture); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 备份与导入 { + get { + object obj = ResourceManager.GetObject("备份与导入", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/应用/BackupAndImport/Properties/Resources.resx b/应用/BackupAndImport/Properties/Resources.resx new file mode 100644 index 0000000..e9b35eb --- /dev/null +++ b/应用/BackupAndImport/Properties/Resources.resx @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 备份与导入 + 插件主窗体名称 + + + 备份与导入 + 插件名称 + + + 备份与导入,多机器人数据对接 + 插件介绍 + + + + ..\Resources\备份与导入.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/应用/BackupAndImport/Properties/Settings.Designer.cs b/应用/BackupAndImport/Properties/Settings.Designer.cs new file mode 100644 index 0000000..93b7c04 --- /dev/null +++ b/应用/BackupAndImport/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace BackupAndImport.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/应用/BackupAndImport/Properties/Settings.settings b/应用/BackupAndImport/Properties/Settings.settings new file mode 100644 index 0000000..049245f --- /dev/null +++ b/应用/BackupAndImport/Properties/Settings.settings @@ -0,0 +1,6 @@ + + + + + + diff --git a/应用/BackupAndImport/Properties/licenses.licx b/应用/BackupAndImport/Properties/licenses.licx new file mode 100644 index 0000000..5f47d16 --- /dev/null +++ b/应用/BackupAndImport/Properties/licenses.licx @@ -0,0 +1,5 @@ +DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraTabbedMdi.XtraTabbedMdiManager, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/应用/BackupAndImport/Resources/备份与导入.png b/应用/BackupAndImport/Resources/备份与导入.png new file mode 100644 index 0000000000000000000000000000000000000000..cd4eb395ab00af91d2ca4302a607e1100a257424 GIT binary patch literal 5963 zcmaJ_cQ{<#y4RvcCrXfs-bWo~^j;Eu^blhV#u&pG(c9=fMD$*R=p{;q5G{!iqJ@YO zLIe>KB!Vm7Io~<=kNe&IJbSP5yuaUD*1Oibo}FN7tVc`DNlipVL~Ee0ZGPDX{CO$K zFTY?H(9~tafzz?USzugo{xB?pNW%r=i~ty*VQvU>1k5GS=LJHUh=^1W3AMr57~O`z zF=$EH9~sF2wD%>Nh)7v2z#9ffA#ea^gd5UJh4*VuA1?suqQYw}ZzN^pt%Yz$>IY#F z7D2{Pcn}H>cHvc11tG91IYE_Vn_F1gP--#S6LY|Ct8z0{#-gp;UPPWt5GP zDL@N@MF8X_K@xCjIeCBrSW+4!D+dOP17xJ66@gNUKxtVCX%IwC3L+x|`1iwmsSWGm z3NhE#{kN{mkqWOn4(AO40{#8{CH-Y3F<3XCG#Cs9O346aWF#&nBzyzCaIgRgFJHdD z8MG0;a4garhs1aR{xHIvF@87|-b+jWcTZ=kfK)E}4r7Bn*Y z|3%U0|494d%n|>!_x~jJg$8;ffaVBaj2{+$xp1z0e^hxxw6F*m4ugeaFrI%$(bOG- z!}z*mya8HTf1(Bk2wNk)TrmE=B7b3wj35SHzBrf{9ATiX!h6XgiA1_UH02bebfm$G zItsed($YGL8q)H*U`07aFi1gOLsJ{{H&z=1_d_GRaDQW6{)+|wBlb@^puI0OYa_78 zdk7a@ECvnu%WVkqpKSsCBj3NVF8^$c!arhxm&O49EbjkW?7ycjGw4tEKdE~;_)qd9 zye=~ydzsq0oyCkqM9e(~+8WS+g&hYf9CT*s!tG|T4HHw#eX@5?03@(hh75Lne%>pC zDIHb|^x4k4a|;`%LBAi{WqaIG@c#nlS*(q>QrD-{Cv$nAV|G7Uebi9%T1$H9>E2gY zrh&0g*{_5^*+cRVUkifYjE&_h93SspoF9K_hG_}cL+HJc3&bAVD?(w`4Ag1T9kqXv%CTt31;dkDVak~a{DQhv=N z;rs_XU)ApHjf5ESMW+OStn$ts2ZsCR0}@iq1;otgG>zC)M}`||u^Z(*JyD5C{$>^y zF@)?y>DOmqX0}p0#;18HcR)PO&qqpbgM)&)Ybsn6?3j1HME&ySiA@7u zssl*oDugR4i7m~{?}vc|Fc-EqW>422?gr1*h=Q9roXJ~S@ys1$yt@6~R)9VK2m=3A z72JWy%!b&R4L>CvsA@vR)XXQ^!^2qQr@j;=2!G-gU0ciS86t4Jt6DUi z*>%Iiqj#gumhLKkiDf>m8Muf)Za?`*K}%h6|Nb}6L-FTP4fxGv4i81v}~I-Zi9{-iCBkI$9!S>tBmQB7gw)cWut zY-%CSpglRYXz}7nRu-p+yKw2@X6xsjcW9_XsNr$n>A{AKmspgGiODU93doak*T>B{ z9jfZLO^`#pBzRVOAg7L{%KWFS?-De0biiKw5pny!Q9$4_D$0qT9;mymB8Qp{;)LMZ zp7&CSG;WTgtAV{I%$8PR^zEOSRhl^oRc)jEtW14HqF9xSVszcp^PZ1EGwHwJ> zYUX-+tzMhMi;K%pN!e+Y_N^BWzLv3ysp3St2z7k%OiW>hud*>NiHkN%dpU7ot?E?X#NOm@cCkAJ*m`hdiHk8vGm)=K9m;6_FC2J z1ZGUjL%(RY(3<|0{${y*JLY++XL>t*A3YPF?=FT9@>Fnl7pgV3wM7Vh7k4!`KX>=t zu(Ar%>ba+4sF&)wvc{a(Xs4c>oqeP7>C?0m>Nrh`6o=pYv}K*0F6Zj7>u)wlCJ(ob z^aG;bbuPF5DuRzVRvG1InZZ^ijrw}Jy7G?pLJL&SPbBwNTRu4%+zL*>s34g0B}+i5KtM> zDWNnnVne>l3Kmv4)~bF_ea0dr3ijoZrR=DZ7vleY8w-q5o1eMo_SG;fQ^{DHUBQbZ&4YuChJjT+e>mBIx!20f zrvN$jOE`?Ii-KNNs6&Ym()kEPdCh5|?FKd4IDYu-w3sER{7%f<>gDQ;jL?BO-8AF! zH*XTi`>pdio8>&9iTmxcZmO;ies(p0n3Zu9bjq)EI>0M)x~7AG6VaaIYkP81dTws{ zUfQkTm#_Lt@c7#a%dI)5U9|YqA-nGVuUD=t*3@qEe`bwmO#1zS0ET^}#Ye8JxF;qT z2n1BdCAq1TKi-kDwB9sqaE@|{jgPn0^dU#LcLp>zQ0cPNHF;O>w~vmJML7ZFa3oJ6 zb?Tm{hq=~A%(vS3B!4z3l%~9v*mt&0r*7%n0L@;s5kYklnHF*)z(>tuGy% zRd1OYk{{K-X3M*UZP9A@$to_Bwy=2pQCHWL1ZAv|_(u0t%6RWx66{d+TFr26%u%vv z^orA~Yd7ob{gk)%B=7SEOjRh&V`@sfyETh`ta=s>Aj#t5Mr2!IRL2T@yDUXwsIBd7 zhMJQF`}Tlgl*fUvTDX|S7&f4xeUX`qEnEBBH?@^>TeIC{*8XaU&p2zu zU^6+{%~<;4fstq`v7E4Uy}RLOphDF%o(W?gCA^lF(B%8BzLI9REdPVq$EEf4ll4|j zQ^7jiGi5px`+2pYr{^Y9(^G{RS7g$=TY`QF$$7ostsT8$T=zI1RfN7=}4KQlM?UM@kOE?THP)b zfJu?Q+PB=Z*tl6(44y0<(G3ktnge3Lbcv9efBBNsxt3md7Qa__MSDvn08S4~&|sF` zdEww7adyY_!9Gt4pIR3>4nQl$T6 zS6;p=Gy9l0KU=V>nA1Cx_9z1gG~NC6 zleP+v7sryVd>CwpJNNQ&WIhv}n7FWMPqJvw#eGacbpdV3+ISZ_&=SSo5|I^H)C*4< zHq{|i$Zlj{AN^xq1dk%(S#IoN$C3#x?NA1di0ZlO=0bnGuW|mpzJ2-V@yAO|cF#V_ zVm<)tdnxR`tPO>K+*1!eGVt};cAuVOJAlAzEIDsngc?ZiG2qkt#Hqg#d-os<`6E{cQ&L$cL(0WlQOPKHc}DLZ<64z(LkcQS%KsPsl_J zw}+sRu+k~a0;Q2w$3y;odcJitT%tiP_-G<`+`D*@;p)XxXsx%)y5|V9c;!?54e~l- z&QuLl2Xv)q#pL9fRj4&CO1(FZTkSk?2$hg9F^^USGn+TV$oRO7rQ{&#NZjWs4x=!x zqN$&U;qY(%J4Pd^1Q#Z29!Y>d|O!I!2gx&YY`yYN#3fu996Y{uFLuAiq+i;!* zbK<-F;+`!r&e5(Vm&Y^T+tl5vLZxtz$rw5xEBipFAPp3X&?NC7kG)5bI9yw~&9G5p zq9*c%JAj%XojFbZ9M%LM(fSRYP=#8Di$NW~$B&P@ma>_qw9%R2@d(Nk z7VNAXIvBMWlzF|BKt4@+m|)?o{pk@i<+X?I0j9X`AyFJDmjzC5OUv3KxjM(GCQ9Uu z_D}@q{!5>pfNx?W%*lIoywCLNH(Rg1zp~|*z$%W<`xwf?eDzQV`a1Q!_=KTo!z0x-`I+YL{pm_Ed+vMhVgwcwlZ#wzO20w8bPeao)8!m6&TC^OR2iL@1`dS z-xYp_6@8V%FAEly(xJc70-14)QX`6JBMIdwe3^*k-nF3y-OO8dV&AlN$wg0pL}Pjb z7YA&ma9gyQ>EEuI2xe;D1zZtPFSC&!tj;@Ywyu3|l8|6x|Bi0CxsDjZHhF#yOJ0ZS zREHB&(ETooTh)#zEy_6H<@-e+Qn^K}Z#eog=)Scq9a+ZJEb+j1ZO)LfusDik($X9O zp*|-cBd8#k>hH3(U=0cRS~)2-^MuIw$FS7h$W7KONOmFHOgg?R>-0CRlER1fS4_6J z{XJc&jk+cEWA^}wQmf~tU>MI(-0F_7!_&$`miI=>K{^PaifqS8Hh>gEX-I z)RF3NYSzOn@^tob?%^P-(RlWa*hp+*gJfVTdU~$poDz{oLfua)aeQ%4OR2FWHSYr(gj4!CNIwCST3*ZqgjHtlT zH%-#}rhvt=-rk&~0QPTabUW12&#+}Vb5;?z71;2T4w};x^x9rHIy$-CRP$!DjO-j$ zT9lro!gg+x#7&~8w!3Yzg9GX1$mhS`cli=r9q6L-SXm^69V;t?UDQgeO)%@lw+w^& zT|KD66m_A~cakiL(>IgxUbolXiqB%>AaFQyed2T-YlGJU;Z)j7G>_EWvmd`Kt*KYj zEfnqSQ%hqW(T=ZfzX8Io^B%3g=zC{Teg1lA_Sqd_foI#7H{^H7GwxDPgj?gL1oOJ{ z#d&o!86b?N(m7Y3saptBU>&Aj!-*UN+g>CU7n?fNBr}JwGgG z@^!zIdXNB0O)Dfv#x!WCGdJTmMKmn!#BfZwl;utzkq0>xa^dlaz!qL!SFzfp$Ue@6 zA9^?H%Ua!@h>mw^Tb25mzZB=9O-Vu23K7rTA023`qAh8(0qT2^P;Jf(R2&ldl$7(@sCfl~&8+@7#oKvYj; z!umcvG@|Nh;Neos5pt(5A)#;c+)JEXpDZWZrZB*pkr98W$>KFb+fOhFCVtD?4(4L| zM7Es>aNY3Op(|w2y;`QVm2B@2nz4z1&xjDq`QE9{zBBj9xsI1z9W&h066&J9Y+C5R z&BgWnsDR~(Xj88vm6ZdOg+U6hq|G%cFcTr@PSJnwN6zsf4T2wduP2Osj*3&GX=(iK zjpF|I;k(s&}z_pP#cdLaDFHy|lsM%K?gd zufzt^g|E`6$Tv_A0yj#34b%wA_&49OpUW0v_Ui%Abns5z+DSU=}8s$sCV4 zqJn$JV2ESO2v0}s{yv9XNWfF+CF728qk^O0mZpMb-1L*kmHqwvWTZdOhwa6C6y2gX z+{%Z|mf4wP5=I`**Hk8SN%Zep${>dYgF@VqdgIPWa+{LtDD^-&)x+css$OkJGldkK9BZvnM=ZP zo0CL~w+q@|-DFpvUEEE*Hb-e3;ev{}OYTX+6*@P_@j`%IopqM9O6WOE&xda;-n-n9 zdip)($~q6TUWNquhC9Uc>6`3TOYD7FGI_J+<|q4PB&00`?2UPffpfF@Dy+&9TNXr{ z2Zx@S$j~|A;K((B?S0pX@-ew%`0YER8MXS|7DE)*6;ot#Q*u35^o^vVD%^T3KOP)J zLGOm22MI8(T|3KMP0-Bti}sxal3K1L-qJb08$nET$UIkDM89_Q=l8aOj + /// 封装ManualResetEvent + /// + public class MutipleThreadResetEvent : IDisposable + { + private readonly ManualResetEvent done; + private readonly int total; + private long current; + + /// + /// 构造函数 + /// + /// 需要等待执行的线程总数 + public MutipleThreadResetEvent(int total) + { + this.total = total; + current = total; + done = new ManualResetEvent(false); + } + + /// + /// 唤醒一个等待的线程 + /// + public void SetOne() + { + // Interlocked 原子操作类 ,此处将计数器减1 + if (Interlocked.Decrement(ref current) == 0) + { + //当所以等待线程执行完毕时,唤醒等待的线程 + done.Set(); + } + } + + /// + /// 等待所以线程执行完毕 + /// + public void WaitAll() + { + done.WaitOne(); + } + + /// + /// 释放对象占用的空间 + /// + public void Dispose() + { + ((IDisposable)done).Dispose(); + } + } +} diff --git a/应用/BackupAndImport/Tools.cs b/应用/BackupAndImport/Tools.cs new file mode 100644 index 0000000..0bf5d9a --- /dev/null +++ b/应用/BackupAndImport/Tools.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace BackupAndImport +{ + class Tools + { + /// + /// 获取指定目录中的匹配文件 + /// + /// 要搜索的目录 + /// 文件名模式(正则)。null表示忽略模式匹配,返回所有文件 + /// 递归深度。负数表示不限,0表示仅顶级 + /// 是否抛异常 + /// GetFiles(path,"(?(数据库.db)|(aliTools.db))",-1) + public static string[] GetFiles(string dir, string regexPattern = null, int depth = 0, bool throwEx = false) + { + List lst = new List(); + + try + { + foreach (string item in Directory.GetFileSystemEntries(dir)) + { + try + { + bool isFile = (File.GetAttributes(item) & FileAttributes.Directory) != FileAttributes.Directory; + + if (isFile && (regexPattern == null || Regex.IsMatch(Path.GetFileName(item), regexPattern, RegexOptions.IgnoreCase | RegexOptions.Multiline))) + { lst.Add(item); } + + //递归 + if (depth != 0 && !isFile) { lst.AddRange(GetFiles(item, regexPattern, depth - 1, throwEx)); } + } + catch { if (throwEx) { throw; } } + } + } + catch { if (throwEx) { throw; } } + + return lst.ToArray(); + } + + + /// + /// 序列化 对象到字符串 + /// + /// 泛型对象 + /// 序列化后的字符串 + public static string Serialize(T obj) + { + try + { + IFormatter formatter = new BinaryFormatter(); + MemoryStream stream = new MemoryStream(); + formatter.Serialize(stream, obj); + stream.Position = 0; + byte[] buffer = new byte[stream.Length]; + stream.Read(buffer, 0, buffer.Length); + stream.Flush(); + stream.Close(); + return Convert.ToBase64String(buffer); + } + catch (Exception ex) + { + throw new Exception("序列化失败,原因:" + ex.Message); + } + } + + /// + /// 反序列化 字符串到对象 + /// + /// 泛型对象 + /// 要转换为对象的字符串 + /// 反序列化出来的对象 + public static T Desrialize(T obj, string str) + { + try + { + obj = default(T); + IFormatter formatter = new BinaryFormatter(); + byte[] buffer = Convert.FromBase64String(str); + MemoryStream stream = new MemoryStream(buffer); + obj = (T)formatter.Deserialize(stream); + stream.Flush(); + stream.Close(); + } + catch (Exception ex) + { + throw new Exception("反序列化失败,原因:" + ex.Message); + } + return obj; + } + + } +} diff --git a/应用/BackupAndImport/UserId.cs b/应用/BackupAndImport/UserId.cs new file mode 100644 index 0000000..27e91d2 --- /dev/null +++ b/应用/BackupAndImport/UserId.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport +{ + /// + /// 用户信息 + /// + public class UserId + { + public long id { get; set; } + + public string username { get; set; } + } + + public class UserName + { + public string username { get; set; } + } + + /// + /// 速推客 + /// + public class GZH + { + public string ID { get; set; } + public string 公众号ID { get; set; } + } + +} diff --git a/应用/BackupAndImport/Utils/SetConnectionConfig.cs b/应用/BackupAndImport/Utils/SetConnectionConfig.cs new file mode 100644 index 0000000..1062e96 --- /dev/null +++ b/应用/BackupAndImport/Utils/SetConnectionConfig.cs @@ -0,0 +1,67 @@ +using Api.Framework; +using Api.Framework.Tools; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataDocking.Utils +{ + public class SetConnectionConfig + { + public ConnectionConfig tempConfig = null; + + public bool IsOk { get; set; } + + /// + /// 测试mysql数据库是否可以链接 + /// + /// + /// + public string CheckMysqlLink(string host, string name, string user, string pass, string port) + { + try + { + tempConfig = new ConnectionConfig(); + + tempConfig.ConnectionString = string.Format($"Data Source={host};Initial Catalog={name};Persist Security Info=True;User ID={user};Password={pass};Port={port};Min Pool Size = 5; Max Pool Size = 30;Charset=utf8;"); + tempConfig.DatabaseType = DatabaseType.MYSQL; + var session = ApiClient.GetSession(tempConfig); + session.BeginTransaction(); + session.Rollback(); + return string.Empty; + } + catch (Exception ex) + { + tempConfig = null; + return ex.Message; + } + } + + /// + /// 测试sqlite数据是否可以链接 + /// + /// + /// + /// + public string CheckSqliteLink(string url, string pass = "") + { + try + { + string src = string.Format("Data Source={0};Version=3;password={1};Journal Mode=WAL;", url, pass); + tempConfig = new ConnectionConfig() { ConnectionString = src, DatabaseType = DatabaseType.SQLITE }; + var session = ApiClient.GetSession(tempConfig); + session.BeginTransaction(); + session.Rollback(); + return string.Empty; + } + catch (Exception ex) + { + return ex.Message; + } + } + + + } +} diff --git a/应用/BackupAndImport/速推客云端/Entitys/STKMemberInfo.cs b/应用/BackupAndImport/速推客云端/Entitys/STKMemberInfo.cs new file mode 100644 index 0000000..f986de1 --- /dev/null +++ b/应用/BackupAndImport/速推客云端/Entitys/STKMemberInfo.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BackupAndImport.速推客云端.Entitys +{ + /// + /// 云端速推客用户数据 + /// + public class STKMemberInfo + { + /// + /// 查询索引 - 无用 + /// + public int numbers { get; set; } + /// + /// 用户id + /// + public string id { get; set; } + /// + /// 微信头像 + /// + public string wx_img { get; set; } + /// + /// 微信昵称 + /// + public string wx_name { get; set; } + /// + /// 用户id + /// + public string uid { get; set; } + /// + /// 备注 + /// + public string wx_note { get; set; } + /// + /// 用户账号 + /// + public string wx_id { get; set; } + /// + /// 分组 + /// + public string group_name { get; set; } + /// + /// 机器人昵称 + /// + public string robot_name { get; set; } + /// + /// 机器人id + /// + public string robot_id { get; set; } + /// + /// 上级wxid + /// + public string father_id { get; set; } + /// + /// 可提现 + /// + public string effec_money { get; set; } + /// + /// 已提现 + /// + public string take_money { get; set; } + /// + /// + /// + public string processing_money { get; set; } + /// + /// + /// + public int for_order_fee { get; set; } + ///// + ///// 创建时间 + ///// + //public DateTime create_time { get; set; } + /// + /// 固定率利 + /// + public string fixed_rate { get; set; } + /// + /// 积分变动时间 + /// + public string update_money_time { get; set; } + /// + /// 总订单数 + /// + public string order_num { get; set; } + } +} diff --git a/应用/BackupAndImport/速推客云端/EventLog.cs b/应用/BackupAndImport/速推客云端/EventLog.cs new file mode 100644 index 0000000..1952a26 --- /dev/null +++ b/应用/BackupAndImport/速推客云端/EventLog.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using BackupAndImport.ECO.Events; + +namespace BackupAndImport.速推客云端 +{ + public class EventLog + { + public static event EventHandler LogEvent; + + public static void OnEvent(object sender, string log) + { + OnEvent(sender, new LogEvent(log)); + } + /// + /// 输出日志 + /// + internal static void OnEvent(object sender, LogEvent e) + { + if (LogEvent != null) + { + LogEvent.Invoke(sender, e); + } + } + + } +} diff --git a/应用/BackupAndImport/速推客云端/Stk.cs b/应用/BackupAndImport/速推客云端/Stk.cs new file mode 100644 index 0000000..7cebe0d --- /dev/null +++ b/应用/BackupAndImport/速推客云端/Stk.cs @@ -0,0 +1,865 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Api.Framework; +using Api.Framework.Enums; +using Api.Framework.Model; +using Api.Framework.SDK; +using Api.Framework.Tools; +using BackupAndImport.速推客云端.Entitys; +using Chat.Framework.WXSdk.IPAD; +using CsharpHttpHelper; +using CsharpHttpHelper.Enum; +using Newtonsoft.Json.Linq; +using static BackupAndImport.速推客云端.EventLog; + +namespace BackupAndImport.速推客云端 +{ + public class Stk + { + private string ck; + + public Stk(string ck) + { + this.ck = ck; + } + + #region 云端速推客导入 + + /// + /// 获取机器人列表 + /// + /// + public void GetRobot(Dictionary robots, int page = 1, int pageSize = 30) + { + var url = "http://yun.yunsutuike.com/page/robot/data.php?typeName=robotList&type=1&page=" + page + "&limit=" + pageSize; + var html = GetHtml(url); + + #region 数据结构 + //{"code":0,"msg":"","count":"4","data":[{"uid":"11","wx_img":"http:\/\/wx.qlogo.cn\/mmhead\/ver_1\/0SXNqzaIpVNdlUrezfv6Hlepsp6FMr1qWa13ozRFhCC2z8ntELjhPbHWficegATH7cRa71Ria7pFQXqxMAghswfpV3ZzdwvF3UGO1KkZvj2D8\/0","wx_type":"1","wx_id":"wxid_qhemii9dknvp22","wx_name":"A \u7701\u94b1\u7ba1\u5bb6 \u638f\u3001\u62fc\u3001\u4eac\u67e5\u8be2","gruop_name":"\u672a\u5206\u7ec4","km_user":"letee88","km_ip":"118.24.33.97","version":"2.0.6","remarks":null,"wx_number":"","km_expire_time":"2022-07-01 20:14:04","update_time":"2022-05-27 19:54:06","oauth":"\u65e0\/\u65e0\/22222\/\u65e0","status":0,"wx_version":"3.3.0","member_num":"4370"},{"uid":"6","wx_img":"http:\/\/wx.qlogo.cn\/mmhead\/ver_1\/9Pias2AZwGBYcuLlLUSiad23q9smXM8g3f9lQIc8EQoHo8ek0N0ODYUpg2eeYVDU4IAxJOic2ibdvVVHlocezEQOU7Esn7opz7KQ5HdaQBDJNFU\/0","wx_type":"1","wx_id":"wxid_scynpy2cpotu12","wx_name":"A \u5238\u9505\u513f\uff08\u638f\u3001\u62fc\u3001\u4eac\uff09","gruop_name":"\u672a\u5206\u7ec4","km_user":"letao879","km_ip":"118.24.33.97","version":"2.0.6","remarks":null,"wx_number":"","km_expire_time":"2023-04-02 09:01:17","update_time":"2022-05-27 19:54:09","oauth":"\u65e0\/\u65e0\/22222\/\u65e0","status":0,"wx_version":"3.3.0","member_num":"5451"},{"uid":"3","wx_img":"http:\/\/wx.qlogo.cn\/mmhead\/ver_1\/m6qtl2JnRJ3ibQV1t7jfetl9xXH0j3VGTjA1ZjQXUwicN5uYcwZVMNBrJiahR0veicj0MH6sAQVRHOYEzzWHVeuyQm5Q1roeRZtoUaxPlgj0tUc\/0","wx_type":"1","wx_id":"wxid_64arztvjyh512","wx_name":"A \u5238\u5927\u5927 ? \u638f\u62fc\u4eac24\u5c0f\u65f6\u67e5\u8be2","gruop_name":"\u672a\u5206\u7ec4","km_user":"18550782199","km_ip":"118.24.33.97","version":"2.0.6","remarks":null,"wx_number":"","km_expire_time":"2023-03-02 20:41:01","update_time":"2022-05-27 19:54:14","oauth":"\u65e0\/\u65e0\/22222\/\u65e0","status":0,"wx_version":"3.3.0","member_num":"4931"},{"uid":"1","wx_img":"http:\/\/wx.qlogo.cn\/mmhead\/ver_1\/4XBEJdC1ULpibibalNibS8N48h8UdKVnMtDwC4BcCjPeg9Hgjsk2czUuDajq98GaqicaBOGn2SwhhibKKucWibIG0qOHxKEH64Au1gczc7vaAE4Q0\/0","wx_type":"1","wx_id":"lzy1249923552","wx_name":"A\u5341\u7c73??\u5b9d\u770b\u670b\u53cb\u5708\u6f6e\u978b\u5728\u89c6\u9891\u53f7","gruop_name":"\u672a\u5206\u7ec4","km_user":"17312558003","km_ip":"120.242.233.249","version":"1.9.2","remarks":null,"wx_number":"","km_expire_time":"2022-02-10 13:22:34","update_time":"2022-02-09 23:48:08","oauth":"\u65e0\/\u65e0\/\u65e0\/\u65e0","status":2,"wx_version":"3.3.5","member_num":"4"}]} + #endregion + + OnEvent(this, $"正在获取第{page}页机器人数据..."); + + var jObj = JObject.Parse(html); + var count = jObj["count"].Value();//总用户数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + if (data.Length == 0) throw new Exception("不存在机器人,疑似没有任何数据"); + + OnEvent(this, $"获取第{page}页机器人数据成功"); + + foreach (var tmp in data) + { + robots[tmp["wx_id"].ToString()] = tmp["wx_type"].ToString(); + } + + if (count > (page * pageSize)) + { + page++; + //Thread.Sleep(200); + GetRobot(robots, page, pageSize); + } + } + else + { + OnEvent(this, $"正在获取机器人,第{page}页数据异常"); + } + } + + /// + /// 获取机器人对应的用户列表 + /// + /// + /// + /// + /// + public void GetMembers(string robotname, List memberInfos, int page = 1, int pageSize = 100) + { + if (ReadLogIsContains(robotname)) + { + OnEvent(this, $"机器人{robotname},执行过用户导入。跳过"); + return; + } + + OnEvent(this, $"正在获取机器人{robotname},第{page}页用户数据..."); + var url = "http://yun.yunsutuike.com/page/member/data.php?typeName=getMemberNew&data={%22desc_name%22:%22create_time%22,%22create_time%22:%22%22,%22order_time_type%22:%22update_money_time%22,%22order_time%22:%22%22,%22group_name%22:%22all%22,%22robot_id%22:%22" + robotname + "%22,%22screen_type%22:%22all%22,%22screen_val_1%22:%22%22,%22screen_val_2%22:%22%22,%22search_type%22:%22all%22,%22search_val%22:%22%22}&page=" + page + "&limit=" + pageSize; + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + #region 数据结构 + + // + + #endregion + + var jObj = JObject.Parse(html); + var count = jObj["count"].Value();//总用户数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + OnEvent(this, $"获取机器人{robotname},第{page}页用户数据成功"); + + if (data.Length != 0) + { + var members = jObj["data"].ToObject>(); + if (members != null) + memberInfos.AddRange(members); + + if (count > (page * pageSize)) + { + page++; + //Thread.Sleep(200); + GetMembers(robotname, memberInfos, page, pageSize); + } + } + } + else + { + OnEvent(this, $"正在获取机器人{robotname},第{page}页用户数据异常"); + } + } + + /// + /// 插入用户数据到秒单客数据库(包括绑定上下级) + /// + /// + public void STKInsertMember(string robotname, ChatType chatType, List STKMemberInfos) + { + if (ReadLogIsContains(robotname)) + { + OnEvent(this, $"机器人{robotname},执行过用户导入。跳过"); + return; + } + + var session = ApiClient.GetSession(); + session.BeginTransaction(); + try + { + //var srcMemberInfo = session.Find("select * from fl_member_info"); + + List unMemberInfos = new List();//保存不存在的用户对象 + List memberInfos = new List();//保存存在的用户对象 + + foreach (var member in STKMemberInfos) + { + //TODO 这里就不判断企业微信了 + var user = session.Queryable().First(f => f.robot_type == chatType && f.username == member.wx_id); + if (user == null) + { + user = new fl_member_info() + { + username = member.wx_id, + robot_type = ChatType.微信, + usernick = member.wx_name.Replace("'", "''"), + cur_point = string.IsNullOrWhiteSpace(member.effec_money) ? 0 : double.Parse(member.effec_money), + sum_point = string.IsNullOrWhiteSpace(member.take_money) ? 0 : double.Parse(member.take_money), + ext_point = string.IsNullOrWhiteSpace(member.take_money) ? 0 : double.Parse(member.take_money), + finish_order = member.order_num == "无" ? 0 : int.Parse(member.order_num), + robot_name = member.robot_name, + headurl = member.wx_img, + bind_order = member.order_num == "无" ? 0 : int.Parse(member.order_num), + remark = member.wx_note, + realnick = member.wx_name, + alipay_name = string.Empty, + alipay_num = string.Empty, + }; + var groups = session.FindGroups(); + if (groups.Count != 0) + user.group_id = groups[0].id; + unMemberInfos.Add(user); + } + else + { + user.cur_point = (double)((decimal)user.cur_point + (string.IsNullOrWhiteSpace(member.effec_money) ? 0m : decimal.Parse(member.effec_money))); + user.finish_order = user.finish_order + (member.order_num == "无" ? 0 : long.Parse(member.order_num)); + + if (string.IsNullOrWhiteSpace(user.robot_name)) + { + user.robot_name = member.robot_id; + user.robot_type = chatType; + } + memberInfos.Add(user); + } + } + OnEvent(this, $"机器人{robotname},执行用户导入操作..."); + + var _num1 = (int)Math.Ceiling((decimal)unMemberInfos.Count / 1000m); + for (int o = 1; o <= _num1; o++) + { + var _list = unMemberInfos.Skip((o - 1) * 1000).Take(1000).ToList(); + session.Insertable(_list.ToArray()).ExecuteCommand(); + } + + var _num2 = (int)Math.Ceiling((decimal)memberInfos.Count / 1000m); + for (int o = 1; o <= _num2; o++) + { + var _list = memberInfos.Skip((o - 1) * 1000).Take(1000).ToList(); + session.Updateable(_list.ToArray()).ExecuteCommand(); + } + + OnEvent(this, $"机器人{robotname},导入数据完成,正在绑定上下级..."); + //将有上级的用户筛选出来 + STKMemberInfos = STKMemberInfos.Where(f => !string.IsNullOrEmpty(f.father_id)).ToList(); + //绑定上下级 + if (STKMemberInfos != null && STKMemberInfos.Count != 0) + { + foreach (var item in STKMemberInfos) + { + var new_user = session.Queryable().First(f => f.robot_type == chatType && f.username == item.wx_id); + if (new_user != null && new_user.inviter_id == 0) + { + var inviter = session.Queryable().First(f => f.robot_type == chatType && f.username == item.father_id);//找出上级账号 + if (inviter != null) + { + new_user.inviter_id = inviter.id;//填写上级ID + session.Updateable(new { inviter_id = inviter.id }).Where(f => f.id == new_user.id).ExecuteCommand(); + } + else + { + + } + } + } + } + OnEvent(this, $"用户上下级关系绑定成功!"); + session.Commit(); + + WriteLog(robotname); + } + catch (Exception ex) + { + OnEvent(this, $"导入用户数据异常,开始回滚数据..."); + session.Rollback(); + OnEvent(this, $"导入用户数据异常,回滚执行成功! 异常:{ex.Message} ~ {ex.StackTrace}"); + throw new Exception($"{ex.Message} ~ {ex.StackTrace}"); + } + } + + private void WriteLog(string _log) + { + var log = _log; + var m = new Action(delegate () + { + try + { + string filename = CsharpHttpHelper.HttpExtend.MapFile($"stk.log", "Cache"); + + //(优化写法)创建或打开日志文件,向日志文件末尾追加记录,关闭日志文件 + using (StreamWriter mySw = File.AppendText(filename)) + { + string writeContent = log; + mySw.WriteLine(writeContent);//向日志文件写入内容 + mySw.Close(); //关闭日志文件 + } + } + catch (Exception) + { + } + }); + m.BeginInvoke(null, null); + } + + private bool ReadLogIsContains(string log) + { + string filename = CsharpHttpHelper.HttpExtend.MapFile($"stk.log", "Cache"); + if (File.Exists(filename)) + { + var lines = File.ReadLines(filename).ToList(); + return lines.Contains(log); + } + return false; + } + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void Exchanges(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取未审核数据,第{page}页..."); + + //未审核的订单 + var url = "http://yun.yunsutuike.com/page/retrieve/data.php?typeName=mainListNew&data={%22create_time%22:%22%22,%22robot_id%22:%22all%22,%22grant_type%22:%22all%22,%22order_status%22:%220%22,%22search_type%22:%22all%22,%22search_val%22:%22%22}&page=" + page + "&limit=" + pageSize; + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + var money = item["money"].ToObject(); + + var exchange = new fl_exchange_info(); + + var member = db.FindMemberInfoByUsername(wx_id); + if (member != null) + { + var robot = db.FindRobotInfo(robot_id, member.robot_type); + if (robot != null) + { + exchange.rid = robot.id; + } + exchange.uid = member.id; + } + + var time = DateTime.Now; + try + { + time = item["create_time"].ToObject(); + } + catch (Exception e) + { + time = DateTime.Now; + } + + exchange.IsTransmatic = false; + exchange.point = money; + exchange.time = time; + exchange.state = ApplyType.未审核; + + db.Saveable(exchange).ExecuteCommand(); + + } + OnEvent(this, $"未审核数据,第{page}页完成,并成功导入信息"); + } + } + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindTBOrder(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取淘宝绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getTbListNew&data={%22desc_name%22:%22tk_create_time%22,%22order_time_type%22:%22tk_create_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22order_type%22:%22all%22,%22tk_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var trade_parent_id = item["trade_parent_id"].ToString(); + var trade_id = item["trade_id"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var order = db.FindSingle("trade_parent_id = @trade_parent_id and trade_id = @trade_id", + new { trade_parent_id = trade_parent_id, trade_id = trade_id }); + if (order != null && order.db_userid == 0) + { + var member = db.FindMemberInfoByUsername(wx_id); + if (member != null) + { + order.db_robotname = robot_id; + order.db_userid = member.id; + order.db_robottype = member.robot_type; + db.Updateable(order).ExecuteCommand(); + } + } + } + OnEvent(this, $"淘宝绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindJDOrder(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取京东绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getJdListNew&data={%22desc_name%22:%22order_time%22,%22order_time_type%22:%22order_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22plus%22:%22all%22,%22valid_code%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var order_id = item["order_parent_id"].ToString(); + var sku_id = item["sku_id"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var order = db.FindSingle("orderId = @orderId and skuId = @skuId", + new { orderId = order_id, skuId = sku_id }); + if (order != null && order.db_userid == 0) + { + var member = db.FindMemberInfoByUsername(wx_id); + if (member != null) + { + order.db_robotname = robot_id; + order.db_userid = member.id; + order.db_robottype = member.robot_type; + db.Updateable(order).ExecuteCommand(); + } + } + } + OnEvent(this, $"京东绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindPDDOrder(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取拼多多绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getPddListNew&data={%22desc_name%22:%22order_pay_time%22,%22order_time_type%22:%22order_pay_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + //http://yun.yunsutuike.com/page/order/data.php?typeName=getPddListNew&data={%22desc_name%22:%22order_pay_time%22,%22order_time_type%22:%22order_pay_time%22,%22order_time%22:%222022-02-28%20-%202022-05-28%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=1&limit=15 + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var order_sn = item["order_sn"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var order = db.FindSingle("order_sn = @order_sn", new { order_sn = order_sn }); + if (order != null && order.db_userid == 0) + { + var member = db.FindMemberInfoByUsername(wx_id); + if (member != null) + { + order.db_robotname = robot_id; + order.db_userid = member.id; + order.db_robottype = member.robot_type; + db.Updateable(order).ExecuteCommand(); + } + } + } + OnEvent(this, $"拼多多绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindWPHOrder(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取唯品会绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getVipListNew&data={%22desc_name%22:%22order_time%22,%22order_time_type%22:%22order_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22order_sub_status_name%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + //http://yun.yunsutuike.com/page/order/data.php?typeName=getVipListNew&data={%22desc_name%22:%22order_time%22,%22order_time_type%22:%22order_time%22,%22order_time%22:%222022-02-28%20-%202022-05-28%22,%22cps_user_id%22:%22all%22,%22order_sub_status_name%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=1&limit=15 + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var orderSn = item["order_parent_sn"].ToString(); + var goodsId = item["goods_id"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var orders = db.Find("orderSn = @orderSn and goodsId= @goodsId", new { orderSn = orderSn, goodsId = goodsId }).ToList(); + if (orders.Count != 0) + { + foreach (var order in orders) + { + if (order.db_userid == 0) + { + var member = db.FindMemberInfoByUsername(wx_id); + if (member != null) + { + order.db_robotname = robot_id; + order.db_userid = member.id; + order.db_robottype = member.robot_type; + db.Updateable(order).ExecuteCommand(); + } + } + } + + } + } + OnEvent(this, $"唯品会绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindDYOrder(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取抖音绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getDyListNew&data={%22desc_name%22:%22pay_time%22,%22order_time_type%22:%22pay_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + //http://yun.yunsutuike.com/page/order/data.php?typeName=getDyListNew&data={%22desc_name%22:%22pay_time%22,%22order_time_type%22:%22pay_time%22,%22order_time%22:%222022-05-02%20-%202022-06-14%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=1&limit=15 + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var order_id = item["order_id"].ToString(); + var product_id = item["product_id"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var order = db.FindSingle("order_id = @order_id and product_id=@product_id", new { order_id = order_id, product_id = product_id }); + if (order != null && order.db_userid == 0) + { + var member = db.FindMemberInfoByUsername(wx_id); + if (member != null) + { + order.db_robotname = robot_id; + order.db_userid = member.id; + order.db_robottype = member.robot_type; + db.Updateable(order).ExecuteCommand(); + } + } + } + OnEvent(this, $"抖音绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + + //------------------------------- + + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindTBOrder2(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取淘宝绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + //var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getTbListNew&data={%22desc_name%22:%22tk_create_time%22,%22order_time_type%22:%22tk_create_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22order_type%22:%22all%22,%22tk_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getTbListNew&data={%22desc_name%22:%22tk_create_time%22,%22order_time_type%22:%22tk_create_time%22,%22order_time%22:%22%22,%22cps_user_id%22:%22all%22,%22order_type%22:%22all%22,%22tk_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%222%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var trade_parent_id = item["trade_parent_id"].ToString(); + var trade_id = item["trade_id"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var order = db.FindSingle("trade_parent_id = @trade_parent_id and trade_id = @trade_id", + new { trade_parent_id = trade_parent_id, trade_id = trade_id }); + if (order != null) + { + order.db_robotname = robot_id; + order.db_status = SystemOrderStatus.订单冻结; + order.db_endtime = DateTime.Now.AddMinutes(10); + db.Updateable(order).ExecuteCommand(); + } + } + OnEvent(this, $"淘宝绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindJDOrder2(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取京东绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + //var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getJdListNew&data={%22desc_name%22:%22order_time%22,%22order_time_type%22:%22order_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22plus%22:%22all%22,%22valid_code%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getJdListNew&data={%22desc_name%22:%22order_time%22,%22order_time_type%22:%22order_time%22,%22order_time%22:%22%22,%22cps_user_id%22:%22all%22,%22plus%22:%22all%22,%22valid_code%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%222%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var order_id = item["order_parent_id"].ToString(); + var sku_id = item["sku_id"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var order = db.FindSingle("orderId = @orderId and skuId = @skuId", + new { orderId = order_id, skuId = sku_id }); + if (order != null) + { + order.db_robotname = robot_id; + order.db_status = SystemOrderStatus.订单冻结; + order.db_endtime = DateTime.Now.AddMinutes(10); + db.Updateable(order).ExecuteCommand(); + } + } + OnEvent(this, $"京东绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindPDDOrder2(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取拼多多绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + //var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getPddListNew&data={%22desc_name%22:%22order_pay_time%22,%22order_time_type%22:%22order_pay_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getPddListNew&data={%22desc_name%22:%22order_pay_time%22,%22order_time_type%22:%22order_pay_time%22,%22order_time%22:%22%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%222%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + //http://yun.yunsutuike.com/page/order/data.php?typeName=getPddListNew&data={%22desc_name%22:%22order_pay_time%22,%22order_time_type%22:%22order_pay_time%22,%22order_time%22:%222022-02-28%20-%202022-05-28%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=1&limit=15 + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var order_sn = item["order_sn"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var order = db.FindSingle("order_sn = @order_sn", new { order_sn = order_sn }); + if (order != null) + { + order.db_robotname = robot_id; + order.db_status = SystemOrderStatus.订单冻结; + order.db_endtime = DateTime.Now.AddMinutes(10); + db.Updateable(order).ExecuteCommand(); + } + } + OnEvent(this, $"拼多多绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindWPHOrder2(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取唯品会绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + //var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getVipListNew&data={%22desc_name%22:%22order_time%22,%22order_time_type%22:%22order_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22order_sub_status_name%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getVipListNew&data={%22desc_name%22:%22order_time%22,%22order_time_type%22:%22order_time%22,%22order_time%22:%22%22,%22cps_user_id%22:%22all%22,%22order_sub_status_name%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%222%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + //http://yun.yunsutuike.com/page/order/data.php?typeName=getVipListNew&data={%22desc_name%22:%22order_time%22,%22order_time_type%22:%22order_time%22,%22order_time%22:%222022-02-28%20-%202022-05-28%22,%22cps_user_id%22:%22all%22,%22order_sub_status_name%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=1&limit=15 + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var orderSn = item["order_parent_sn"].ToString(); + var goodsId = item["goods_id"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var orders = db.Find("orderSn = @orderSn and goodsId= @goodsId", new { orderSn = orderSn, goodsId = goodsId }).ToList(); + if (orders.Count != 0) + { + foreach (var order in orders) + { + //if (order.db_userid == 0) + //{ + // var member = db.FindMemberInfoByUsername(wx_id); + // if (member != null) + // { + // order.db_robotname = robot_id; + // order.db_userid = member.id; + // order.db_robottype = member.robot_type; + // db.Updateable(order).ExecuteCommand(); + // } + //} + order.db_robotname = robot_id; + order.db_status = SystemOrderStatus.订单冻结; + order.db_endtime = DateTime.Now.AddMinutes(10); + db.Updateable(order).ExecuteCommand(); + } + + } + } + OnEvent(this, $"唯品会绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + /// + /// 下载并绑定订单数据 + /// + /// + /// + public void BindDYOrder2(DateTime date, int page, int pageSize, out int total) + { + OnEvent(this, $"正在获取抖音绑定数据,第{page}页..."); + + //三个月已经绑定的订单请求 + //var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getDyListNew&data={%22desc_name%22:%22pay_time%22,%22order_time_type%22:%22pay_time%22,%22order_time%22:%22" + date.AddMonths(-3).ToString("yyyy-MM-dd") + "%20-%20" + date.ToString("yyyy-MM-dd") + "%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + var url = "http://yun.yunsutuike.com/page/order/data.php?typeName=getDyListNew&data={%22desc_name%22:%22pay_time%22,%22order_time_type%22:%22pay_time%22,%22order_time%22:%22%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%222%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=" + page + "&limit=" + pageSize; + + //http://yun.yunsutuike.com/page/order/data.php?typeName=getDyListNew&data={%22desc_name%22:%22pay_time%22,%22order_time_type%22:%22pay_time%22,%22order_time%22:%222022-05-02%20-%202022-06-14%22,%22cps_user_id%22:%22all%22,%22order_status%22:%22all%22,%22robot_id%22:%22all%22,%22fl_status%22:%22100%22,%22fl_source%22:%22all%22,%22search_type%22:%22all%22,%22search_val%22:%22%22,%22user_rate%22:%22%22}&page=1&limit=15 + + var html = GetHtml(url); + html = HttpExtend.Unicode2String(html); + + var jObj = JObject.Parse(html); + total = jObj["count"].Value();//总订单数 + var data = jObj["data"]?.ToArray(); + if (data != null) + { + var db = ApiClient.GetSession(); + foreach (var item in data) + { + var order_id = item["order_id"].ToString(); + var product_id = item["product_id"].ToString(); + var robot_id = item["robot_id"].ToString(); + var wx_id = item["wx_id"].ToString(); + + var order = db.FindSingle("order_id = @order_id and product_id=@product_id", new { order_id = order_id, product_id = product_id }); + if (order != null && order.db_userid == 0) + { + order.db_robotname = robot_id; + order.db_status = SystemOrderStatus.订单冻结; + order.db_endtime = DateTime.Now.AddMinutes(10); + db.Updateable(order).ExecuteCommand(); + } + } + OnEvent(this, $"抖音绑定数据,第{page}页完成,并成功绑定用户信息"); + } + } + + + /// + /// http请求方法 + /// + /// + /// + private string GetHtml(string url) + { + for (int i = 0; i < 10; i++) + { + HttpHelper http = new HttpHelper(); + HttpItem item = new HttpItem() + { + URL = url, + Method = "GET", + Timeout = 100000, + ReadWriteTimeout = 30000, + IsToLower = false, + Cookie = ck, + UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0", + Accept = "text/html, application/xhtml+xml, */*", + ContentType = "text/html", + Referer = "http://yun.yunsutuike.com/page/member/mainNew.php", + Allowautoredirect = false, + AutoRedirectCookie = false, + Postdata = "", + ResultType = ResultType.String, + }; + HttpResult result = http.GetHtml(item); + if (result.StatusCode == System.Net.HttpStatusCode.OK) + { + string html = result.Html; + if (html.Contains("Empty needle in")) + throw new Exception("可能Cookie错误"); + return html; + } + + OnEvent(this, $"请求数据异常,正在重试第{(i + 1)}次..."); + Thread.Sleep(2000); + } + throw new Exception("多次请求数据异常:终止操作"); + } + + #endregion + + } +}