2 Commits a0cb5514dc ... 242a1eef12

Autore SHA1 Messaggio Data
  DuGuYang 242a1eef12 Merge branch 'feature-dgy-进件区分银联品牌' into feature-dgy-功能测试 6 mesi fa
  DuGuYang dc128ebf47 完成,待测试 6 mesi fa

+ 6 - 0
Config/Base.cs

@@ -12,6 +12,12 @@ namespace AppConfig
         public static string defaultImage = Library.ConfigurationManager.AppSettings["Host"].ToString() + "/skin/app/default/static/images/default.jpg";
         public static string SqlConnStr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
 
+        //好哒FTP
+        public static string HaoDaFtpHost = Library.ConfigurationManager.AppSettings["HaoDaFtpHost"].ToString();
+        public static string HaoDaFtpLoginName = Library.ConfigurationManager.AppSettings["HaoDaFtpLoginName"].ToString();
+        public static string HaoDaFtpLoginPwd = Library.ConfigurationManager.AppSettings["HaoDaFtpLoginPwd"].ToString();
+
+
 
         #region 数据库结构
         public static Dictionary<string, Dictionary<string, string>> mainTables = new Dictionary<string, Dictionary<string, string>>();

+ 13 - 11
Startup.cs

@@ -135,13 +135,14 @@ namespace MySystem
             });
 
             initMainServer();
-            if(Library.ConfigurationManager.EnvironmentFlag == 1)
+            if (Library.ConfigurationManager.EnvironmentFlag == 1)
             {
                 TestHaoDaService.Instance.Start(); //好哒测试
                 // MerchantStandardService.Instance.Start();
             }
-            if(Library.ConfigurationManager.EnvironmentFlag == 2)
+            if (Library.ConfigurationManager.EnvironmentFlag == 2)
             {
+                GetHaoDaFTPInfoService.Instance.Start(); // 获取好哒FTP交易数据
                 GetTencentAddressInfoService.Instance.Start(); // 获取腾讯地图地址
                 GetStoreNoHelper.Instance.Start(); //获取商户门店号、微信支付宝商户号
                 MerchantConfirmService.Instance.Start(); //提交商户进件
@@ -165,15 +166,16 @@ namespace MySystem
                 ProfitHelper.Instance.StartListenProfit(); //每月分润
                 ProfitCheckHelper.Instance.Start(); //检查订单是否在队列里
 
-            //     AlipayPayBackFeeService.Instance.Start();
-            //     ActiveRewardService.Instance.StartAct();
-            //     ActiveRewardService.Instance.StartOpenReward();
-            //     ActiveRewardService.Instance.StartLeaderReward();
-            //     ActiveRewardService.Instance.StartOperateReward();
-                
-            //     MerchantStandardService.Instance.Start(); //商户缴纳服务费次月活动交易额大于等于1W,奖励进件创客50元
-            //     MerchantStandardService.Instance.StartThree(); //商户缴纳服务费次月起连续不间断三个月,每月活动交易额大于1W,奖励进件创客100元
-            //     MerchantStandardService.Instance.StartActive();
+
+                //     AlipayPayBackFeeService.Instance.Start();
+                //     ActiveRewardService.Instance.StartAct();
+                //     ActiveRewardService.Instance.StartOpenReward();
+                //     ActiveRewardService.Instance.StartLeaderReward();
+                //     ActiveRewardService.Instance.StartOperateReward();
+
+                //     MerchantStandardService.Instance.Start(); //商户缴纳服务费次月活动交易额大于等于1W,奖励进件创客50元
+                //     MerchantStandardService.Instance.StartThree(); //商户缴纳服务费次月起连续不间断三个月,每月活动交易额大于1W,奖励进件创客100元
+                //     MerchantStandardService.Instance.StartActive();
             }
         }
 

+ 376 - 0
Util/HaoDa/GetHaoDaFTPInfoService.cs

@@ -0,0 +1,376 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using System.Threading;
+using MySystem.Models.Main;
+using Library;
+using LitJson;
+using System.Net;
+using System.IO;
+using AppConfig;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 获取好哒ftp数据
+    /// </summary>
+    public class GetHaoDaFTPInfoService
+    {
+        public readonly static GetHaoDaFTPInfoService Instance = new GetHaoDaFTPInfoService();
+        private GetHaoDaFTPInfoService()
+        { }
+
+
+        public void Start()
+        {
+            //半小时执行获取好哒FTP交易数据
+            Thread th = new Thread(GetFTPDataInfoHalfHour);
+            th.IsBackground = true;
+            th.Start();
+
+            //每天凌晨执行获取好哒FTP今日交易数据
+            Thread th1 = new Thread(GetFTPDataInfoToday);
+            th1.IsBackground = true;
+            th1.Start();
+
+            //每天凌晨执行获取好哒FTP昨日交易数据
+            Thread th2 = new Thread(GetFTPDataInfoYesterday);
+            th2.IsBackground = true;
+            th2.Start();
+        }
+
+
+        /// <summary>
+        /// 没半小时获取好哒FTP今日交易数据
+        /// </summary>
+        public static void GetFTPDataInfoHalfHour()
+        {
+            // 47.108.253.46
+            // 用户名:hdftp
+            // 密:haodatradeftp2024
+            // 目录:/haoda-trade
+
+            // FTP服务器的地址
+            string ftpServerAddress = Base.HaoDaFtpHost;
+            // FTP登录凭证
+            string ftpUser = Base.HaoDaFtpLoginName;
+            string ftpPassword = Base.HaoDaFtpLoginPwd;
+            // 要下载的文件路径
+            string filePath = "/haoda-trade/" + DateTime.Now.ToString("yyyyMMdd") + ".csv";
+
+            while (true)
+            {
+                try
+                {
+                    // 创建FtpWebRequest对象
+                    FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpServerAddress + filePath);
+                    request.Method = WebRequestMethods.Ftp.DownloadFile;
+                    request.Credentials = new NetworkCredential(ftpUser, ftpPassword);
+
+                    // 使用WebResponse获取响应
+                    FtpWebResponse response = (FtpWebResponse)request.GetResponse();
+
+                    // 打开数据流
+                    Stream responseStream = response.GetResponseStream();
+                    using (StreamReader reader = new StreamReader(responseStream))
+                    {
+                        WebCMSEntities db = new WebCMSEntities();
+                        // 读取数据
+                        string fileContents = reader.ReadToEnd();
+                        if (!string.IsNullOrEmpty(fileContents))
+                        {
+                            var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
+                            var DataList = DataInfo[1].Split('\n');
+                            foreach (var DataListItem in DataList)
+                            {
+                                var DataListInfo = DataListItem.Split(',');
+
+                                var MerchantNo = ""; // 商户号
+                                var BaseNo = ""; // 设备号
+                                var OrderNo = ""; // 订单号
+                                var PayWay = ""; // 支付方式(微信 支付宝)
+                                var TradeType = ""; // 交易类型
+                                var TradeAmount = ""; // 交易金额
+                                var TradeFee = ""; // 交易手续费
+                                var TradeDate = ""; // 交易时间
+                                var TradeCycle = ""; // 结算周期
+
+                                MerchantNo = DataListInfo[0];
+                                BaseNo = DataListInfo[1];
+                                OrderNo = DataListInfo[2];
+                                PayWay = DataListInfo[3];
+                                TradeType = DataListInfo[4];
+                                TradeAmount = DataListInfo[5];
+                                TradeFee = DataListInfo[6];
+                                TradeDate = DataListInfo[7];
+                                TradeCycle = DataListInfo[8];
+
+                                var PayMode = 0;
+                                if (PayWay.Contains("支付宝")) PayMode = 1;
+                                if (PayWay.Contains("微信")) PayMode = 2;
+
+                                var merchantAddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.MchtNo == MerchantNo) ?? new MerchantAddInfo();
+                                if (merchantAddInfo.Id > 0)
+                                {
+                                    var merchantInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == merchantAddInfo.Id) ?? new MerchantInfo();
+                                    var orders = db.ConsumerOrders.FirstOrDefault(m => m.SeoTitle == OrderNo && OrderNo == OrderNo) ?? new ConsumerOrders();
+                                    if (orders.Id == 0)
+                                    {
+                                        ConsumerOrders consumerOrders = new ConsumerOrders
+                                        {
+                                            Status = 1,
+                                            CreateDate = DateTime.Parse(TradeDate),
+                                            UpdateDate = DateTime.Parse(TradeDate),
+                                            SnNo = BaseNo,
+                                            PayMoney = decimal.Parse(TradeAmount),
+                                            PayMode = PayMode,
+                                            SeoTitle = OrderNo,
+                                            OrderNo = OrderNo,
+                                            MerchantId = merchantAddInfo.Id,
+                                            UserId = merchantInfo.UserId
+                                        };
+                                    }
+                                }
+                            }
+                            db.SaveChanges();
+                            db.Dispose();
+                        }
+
+                        // 关闭响应
+                        response.Close();
+                        Thread.Sleep(1800000);
+                    }
+                }
+                catch (WebException ex)
+                {
+                    Console.WriteLine("获取好哒FTP文件数据异常: " + ex.Message);
+                }
+            }
+        }
+
+
+        /// <summary>
+        /// 获取好哒FTP今日交易数据
+        /// </summary>
+        public static void GetFTPDataInfoToday()
+        {
+            // 47.108.253.46
+            // 用户名:hdftp
+            // 密:haodatradeftp2024
+            // 目录:/haoda-trade
+
+            // FTP服务器的地址
+            string ftpServerAddress = Base.HaoDaFtpHost;
+            // FTP登录凭证
+            string ftpUser = Base.HaoDaFtpLoginName;
+            string ftpPassword = Base.HaoDaFtpLoginPwd;
+            // 要下载的文件路径
+            string filePath = "/haoda-trade/" + DateTime.Now.ToString("yyyyMMdd") + ".csv";
+
+            while (true)
+            {
+                if (DateTime.Now.Hour > 0 && DateTime.Now.Hour < 9)
+                {
+                    try
+                    {
+                        // 创建FtpWebRequest对象
+                        FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpServerAddress + filePath);
+                        request.Method = WebRequestMethods.Ftp.DownloadFile;
+                        request.Credentials = new NetworkCredential(ftpUser, ftpPassword);
+
+                        // 使用WebResponse获取响应
+                        FtpWebResponse response = (FtpWebResponse)request.GetResponse();
+
+                        // 打开数据流
+                        Stream responseStream = response.GetResponseStream();
+                        using (StreamReader reader = new StreamReader(responseStream))
+                        {
+                            WebCMSEntities db = new WebCMSEntities();
+                            // 读取数据
+                            string fileContents = reader.ReadToEnd();
+                            if (!string.IsNullOrEmpty(fileContents))
+                            {
+                                var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
+                                var DataList = DataInfo[1].Split('\n');
+                                foreach (var DataListItem in DataList)
+                                {
+                                    var DataListInfo = DataListItem.Split(',');
+
+                                    var MerchantNo = ""; // 商户号
+                                    var BaseNo = ""; // 设备号
+                                    var OrderNo = ""; // 订单号
+                                    var PayWay = ""; // 支付方式(微信 支付宝)
+                                    var TradeType = ""; // 交易类型
+                                    var TradeAmount = ""; // 交易金额
+                                    var TradeFee = ""; // 交易手续费
+                                    var TradeDate = ""; // 交易时间
+                                    var TradeCycle = ""; // 结算周期
+
+                                    MerchantNo = DataListInfo[0];
+                                    BaseNo = DataListInfo[1];
+                                    OrderNo = DataListInfo[2];
+                                    PayWay = DataListInfo[3];
+                                    TradeType = DataListInfo[4];
+                                    TradeAmount = DataListInfo[5];
+                                    TradeFee = DataListInfo[6];
+                                    TradeDate = DataListInfo[7];
+                                    TradeCycle = DataListInfo[8];
+
+                                    var PayMode = 0;
+                                    if (PayWay.Contains("支付宝")) PayMode = 1;
+                                    if (PayWay.Contains("微信")) PayMode = 2;
+
+                                    var merchantAddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.MchtNo == MerchantNo) ?? new MerchantAddInfo();
+                                    if (merchantAddInfo.Id > 0)
+                                    {
+                                        var merchantInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == merchantAddInfo.Id) ?? new MerchantInfo();
+                                        var orders = db.ConsumerOrders.FirstOrDefault(m => m.SeoTitle == OrderNo && OrderNo == OrderNo) ?? new ConsumerOrders();
+                                        if (orders.Id == 0)
+                                        {
+                                            ConsumerOrders consumerOrders = new ConsumerOrders
+                                            {
+                                                Status = 1,
+                                                CreateDate = DateTime.Parse(TradeDate),
+                                                UpdateDate = DateTime.Parse(TradeDate),
+                                                SnNo = BaseNo,
+                                                PayMoney = decimal.Parse(TradeAmount),
+                                                PayMode = PayMode,
+                                                SeoTitle = OrderNo,
+                                                OrderNo = OrderNo,
+                                                MerchantId = merchantAddInfo.Id,
+                                                UserId = merchantInfo.UserId
+                                            };
+                                        }
+                                    }
+                                }
+                                db.SaveChanges();
+                                db.Dispose();
+                            }
+
+                            // 关闭响应
+                            response.Close();
+                            Thread.Sleep(1800000);
+                        }
+                    }
+                    catch (WebException ex)
+                    {
+                        Console.WriteLine("获取好哒FTP文件数据异常: " + ex.Message);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// 获取好哒FTP昨日交易数据
+        /// </summary>
+        public static void GetFTPDataInfoYesterday()
+        {
+            // 47.108.253.46
+            // 用户名:hdftp
+            // 密:haodatradeftp2024
+            // 目录:/haoda-trade
+
+            // FTP服务器的地址
+            string ftpServerAddress = Base.HaoDaFtpHost;
+            // FTP登录凭证
+            string ftpUser = Base.HaoDaFtpLoginName;
+            string ftpPassword = Base.HaoDaFtpLoginPwd;
+            // 要下载的文件路径
+            string filePath = "/haoda-trade/" + DateTime.Now.AddDays(-1).ToString("yyyyMMdd") + ".csv";
+
+            while (true)
+            {
+                if (DateTime.Now.Hour > 0 && DateTime.Now.Hour < 9)
+                {
+                    try
+                    {
+                        // 创建FtpWebRequest对象
+                        FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpServerAddress + filePath);
+                        request.Method = WebRequestMethods.Ftp.DownloadFile;
+                        request.Credentials = new NetworkCredential(ftpUser, ftpPassword);
+
+                        // 使用WebResponse获取响应
+                        FtpWebResponse response = (FtpWebResponse)request.GetResponse();
+
+                        // 打开数据流
+                        Stream responseStream = response.GetResponseStream();
+                        using (StreamReader reader = new StreamReader(responseStream))
+                        {
+                            WebCMSEntities db = new WebCMSEntities();
+                            // 读取数据
+                            string fileContents = reader.ReadToEnd();
+                            if (!string.IsNullOrEmpty(fileContents))
+                            {
+                                var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
+                                var DataList = DataInfo[1].Split('\n');
+                                foreach (var DataListItem in DataList)
+                                {
+                                    var DataListInfo = DataListItem.Split(',');
+
+                                    var MerchantNo = ""; // 商户号
+                                    var BaseNo = ""; // 设备号
+                                    var OrderNo = ""; // 订单号
+                                    var PayWay = ""; // 支付方式(微信 支付宝)
+                                    var TradeType = ""; // 交易类型
+                                    var TradeAmount = ""; // 交易金额
+                                    var TradeFee = ""; // 交易手续费
+                                    var TradeDate = ""; // 交易时间
+                                    var TradeCycle = ""; // 结算周期
+
+                                    MerchantNo = DataListInfo[0];
+                                    BaseNo = DataListInfo[1];
+                                    OrderNo = DataListInfo[2];
+                                    PayWay = DataListInfo[3];
+                                    TradeType = DataListInfo[4];
+                                    TradeAmount = DataListInfo[5];
+                                    TradeFee = DataListInfo[6];
+                                    TradeDate = DataListInfo[7];
+                                    TradeCycle = DataListInfo[8];
+
+                                    var PayMode = 0;
+                                    if (PayWay.Contains("支付宝")) PayMode = 1;
+                                    if (PayWay.Contains("微信")) PayMode = 2;
+
+                                    var merchantAddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.MchtNo == MerchantNo) ?? new MerchantAddInfo();
+                                    if (merchantAddInfo.Id > 0)
+                                    {
+                                        var merchantInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == merchantAddInfo.Id) ?? new MerchantInfo();
+                                        var orders = db.ConsumerOrders.FirstOrDefault(m => m.SeoTitle == OrderNo && OrderNo == OrderNo) ?? new ConsumerOrders();
+                                        if (orders.Id == 0)
+                                        {
+                                            ConsumerOrders consumerOrders = new ConsumerOrders
+                                            {
+                                                Status = 1,
+                                                CreateDate = DateTime.Parse(TradeDate),
+                                                UpdateDate = DateTime.Parse(TradeDate),
+                                                SnNo = BaseNo,
+                                                PayMoney = decimal.Parse(TradeAmount),
+                                                PayMode = PayMode,
+                                                SeoTitle = OrderNo,
+                                                OrderNo = OrderNo,
+                                                MerchantId = merchantAddInfo.Id,
+                                                UserId = merchantInfo.UserId
+                                            };
+                                        }
+                                    }
+                                }
+                                db.SaveChanges();
+                                db.Dispose();
+                            }
+
+                            // 关闭响应
+                            response.Close();
+                            Thread.Sleep(1800000);
+                        }
+                    }
+                    catch (WebException ex)
+                    {
+                        Console.WriteLine("获取好哒FTP文件数据异常: " + ex.Message);
+                    }
+                }
+            }
+        }
+
+    }
+}

+ 146 - 0
Util/HaoDa/TestHaoDaService.cs

@@ -6,6 +6,8 @@ using MySystem.Models.Main;
 using Library;
 using LitJson;
 using System.Threading;
+using System.Net;
+using System.IO;
 
 namespace MySystem
 {
@@ -27,6 +29,8 @@ namespace MySystem
 
         public void StartListen()
         {
+            // GetFTPListInfo(); // 获取好哒FTPInfo
+            // GetFTPDataInfo(); //获取好哒FTPDataInfo
             //开户意愿申请
             // RedisDbconn.Instance.AddList("AlipayForHaoDaQueue",824);
             // RedisDbconn.Instance.AddList("WeChatForHaoDaQueue",824);
@@ -160,6 +164,148 @@ namespace MySystem
             // db.Dispose();
         }
 
+        /// <summary>
+        /// 从ftp服务器上获得文件列表
+        /// </summary>
+        /// <param name="RequedstPath">服务器下的相对路径</param>
+        /// <returns></returns>
+        public static List<string> GetFTPListInfo(string RequedstPath = "/haoda-trade")
+        {
+            // 47.108.253.46
+            // 用户名:hdftp
+            // 密:haodatradeftp2024
+            // 目录:/haoda-trade
+            List<string> strs = new List<string>();
+            try
+            {
+                string uri = "ftp://47.108.253.46" + RequedstPath;   //目标路径 path为服务器地址        ②
+                FtpWebRequest reqFTP = (FtpWebRequest)WebRequest.Create(new Uri(uri));
+                // ftp用户名和密码
+                reqFTP.Credentials = new NetworkCredential("hdftp", "haodatradeftp2024");
+                reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
+                WebResponse response = reqFTP.GetResponse();
+                StreamReader reader = new StreamReader(response.GetResponseStream());//中文文件名
+
+                string line = reader.ReadLine();
+                while (line != null)
+                {
+                    if (!line.Contains("<DIR>"))
+                    {
+                        string msg = line.Substring(0).Trim();
+                        msg = msg.Substring(msg.Length - 24, 24);
+                        strs.Add(msg);
+                    }
+                    line = reader.ReadLine();
+                }
+                reader.Close();
+                response.Close();
+                return strs;
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine("获取文件出错:" + ex.Message);
+            }
+            return strs;
+        }
+
+        public static void GetFTPDataInfo()
+        {
+            // 47.108.253.46
+            // 用户名:hdftp
+            // 密:haodatradeftp2024
+            // 目录:/haoda-trade
+
+            // FTP服务器的地址
+            string ftpServerAddress = "ftp://47.108.253.46";
+            // FTP登录凭证
+            string ftpUser = "hdftp";
+            string ftpPassword = "haodatradeftp2024";
+            // 要下载的文件路径
+            string filePath = "/haoda-trade/20240513.csv";
+
+            try
+            {
+                // 创建FtpWebRequest对象
+                FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpServerAddress + filePath);
+                request.Method = WebRequestMethods.Ftp.DownloadFile;
+                request.Credentials = new NetworkCredential(ftpUser, ftpPassword);
+
+                // 使用WebResponse获取响应
+                FtpWebResponse response = (FtpWebResponse)request.GetResponse();
+
+                // 打开数据流
+                Stream responseStream = response.GetResponseStream();
+                using (StreamReader reader = new StreamReader(responseStream))
+                {
+                    WebCMSEntities db = new WebCMSEntities();
+                    // 读取数据
+                    string fileContents = reader.ReadToEnd();
+                    var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
+                    var DataList = DataInfo[1].Split('\n');
+                    foreach (var DataListItem in DataList)
+                    {
+                        var DataListInfo = DataListItem.Split(',');
+
+                        var MerchantNo = ""; // 商户号
+                        var BaseNo = ""; // 设备号
+                        var OrderNo = ""; // 订单号
+                        var PayWay = ""; // 支付方式(微信 支付宝)
+                        var TradeType = ""; // 交易类型
+                        var TradeAmount = ""; // 交易金额
+                        var TradeFee = ""; // 交易手续费
+                        var TradeDate = ""; // 交易时间
+                        var TradeCycle = ""; // 结算周期
+
+                        MerchantNo = DataListInfo[0];
+                        BaseNo = DataListInfo[1];
+                        OrderNo = DataListInfo[2];
+                        PayWay = DataListInfo[3];
+                        TradeType = DataListInfo[4];
+                        TradeAmount = DataListInfo[5];
+                        TradeFee = DataListInfo[6];
+                        TradeDate = DataListInfo[7];
+                        TradeCycle = DataListInfo[8];
+
+                        var PayMode = 0;
+                        if (PayWay.Contains("支付宝")) PayMode = 1;
+                        if (PayWay.Contains("微信")) PayMode = 2;
+
+                        var merchantAddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.MchtNo == MerchantNo) ?? new MerchantAddInfo();
+                        if (merchantAddInfo.Id > 0)
+                        {
+                            var merchantInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == merchantAddInfo.Id) ?? new MerchantInfo();
+                            var orders = db.ConsumerOrders.FirstOrDefault(m => m.SeoTitle == OrderNo && OrderNo == OrderNo) ?? new ConsumerOrders();
+                            if (orders.Id == 0)
+                            {
+                                ConsumerOrders consumerOrders = new ConsumerOrders
+                                {
+                                    Status = 1,
+                                    CreateDate = DateTime.Parse(TradeDate),
+                                    UpdateDate = DateTime.Parse(TradeDate),
+                                    SnNo = BaseNo,
+                                    PayMoney = decimal.Parse(TradeAmount),
+                                    PayMode = PayMode,
+                                    SeoTitle = OrderNo,
+                                    OrderNo = OrderNo,
+                                    MerchantId = merchantAddInfo.Id,
+                                    UserId = merchantInfo.UserId
+                                };
+                            }
+                        }
+                    }
+                    db.SaveChanges();
+                    db.Dispose();
+                }
+
+                // 关闭响应
+                response.Close();
+            }
+            catch (WebException ex)
+            {
+                Console.WriteLine("获取好哒FTP文件数据异常: " + ex.Message);
+            }
+        }
+
         public void StartProfitShareListen()
         {
             bool op = true;

+ 6 - 3
appsettings.Development.json

@@ -22,10 +22,13 @@
     "OSSSecret": "Q6P2vSNEY2LBNdygO8gUCkBZQpiswZ",
     "OSSEndpoint": "oss-cn-hangzhou.aliyuncs.com",
     "OSSBucketName": "yunmuit",
-    "TencentKey":"GU3BZ-JYL6Q-ETG5Y-BGPXM-QFQV6-PZBLW",
+    "TencentKey": "GU3BZ-JYL6Q-ETG5Y-BGPXM-QFQV6-PZBLW",
     "AppSource": "/skin/app/default/",
     "JwtSecret": "JvDHuowbOnWiyxMIFc9gG5rw1LSSc0xx68L31oRfxS0",
     "JwtIss": "TpAdminServer",
-    "JwtAud": "api"
+    "JwtAud": "api",
+    "HaoDaFtpHost": "ftp://47.108.253.46",
+    "HaoDaFtpLoginName": "hdftp",
+    "HaoDaFtpLoginPwd": "haodatradeftp2024"
   }
-}
+}