GetHaoDaFTPInfoService.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Data;
  5. using System.Threading;
  6. using Library;
  7. using LitJson;
  8. using System.Net;
  9. using System.IO;
  10. using MySystem.SpModels;
  11. namespace MySystem
  12. {
  13. /// <summary>
  14. /// 获取好哒ftp数据
  15. /// </summary>
  16. public class GetHaoDaFTPInfoService
  17. {
  18. public readonly static GetHaoDaFTPInfoService Instance = new GetHaoDaFTPInfoService();
  19. private GetHaoDaFTPInfoService()
  20. { }
  21. // 47.108.253.46
  22. // 用户名:hdftp
  23. // 密:haodatradeftp2024
  24. // 目录:/haoda-trade
  25. public string ftpServerAddress = "ftp://47.108.253.46";
  26. public string ftpUser = "hdftp";
  27. public string ftpPassword = "haodatradeftp2024";
  28. public void Start()
  29. {
  30. //每天凌晨执行获取好哒FTP昨日交易数据
  31. Thread th2 = new Thread(GetDepositDataReady);
  32. th2.IsBackground = true;
  33. th2.Start();
  34. }
  35. /// <summary>
  36. /// 获取好哒FTP昨日交易数据
  37. /// </summary>
  38. public void GetDepositDataReady()
  39. {
  40. while (true)
  41. {
  42. if (DateTime.Now.Hour > 10 && DateTime.Now.Hour < 22)
  43. {
  44. string check = function.ReadInstance("/GetFTPDepositYesterday/check" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + ".txt");
  45. if (string.IsNullOrEmpty(check))
  46. {
  47. function.WritePage("/GetFTPDepositYesterday/", "check" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString());
  48. GetDepositData(DateTime.Now.AddDays(-1).ToString("yyyyMMdd"));
  49. Thread.Sleep(60000);
  50. GetTradeData(DateTime.Now.AddDays(-1).ToString("yyyyMMdd"));
  51. }
  52. }
  53. Thread.Sleep(7200000);
  54. }
  55. }
  56. public void Start2()
  57. {
  58. //每天凌晨执行获取好哒FTP昨日交易数据
  59. Thread th2 = new Thread(GetDepositDataReady2);
  60. th2.IsBackground = true;
  61. th2.Start();
  62. }
  63. /// <summary>
  64. /// 获取好哒FTP昨日交易数据
  65. /// </summary>
  66. public void GetDepositDataReady2()
  67. {
  68. while (true)
  69. {
  70. if (DateTime.Now > DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 10:05:00"))
  71. {
  72. GetDepositData("d_" + DateTime.Now.ToString("yyyyMMdd"));
  73. }
  74. GetTradeData(DateTime.Now.ToString("yyyyMMdd"));
  75. Thread.Sleep(1800000);
  76. }
  77. }
  78. public void StartListen()
  79. {
  80. //每天凌晨执行获取好哒FTP昨日交易数据
  81. Thread th2 = new Thread(ListenDepositDataReady);
  82. th2.IsBackground = true;
  83. th2.Start();
  84. }
  85. /// <summary>
  86. /// 获取好哒FTP昨日交易数据
  87. /// </summary>
  88. public void ListenDepositDataReady()
  89. {
  90. while (true)
  91. {
  92. string content = RedisDbconn.Instance.RPop<string>("ListenDepositDataQueue2");
  93. if (!string.IsNullOrEmpty(content))
  94. {
  95. GetDepositData2(content);
  96. Thread.Sleep(2000);
  97. }
  98. else
  99. {
  100. Thread.Sleep(60000);
  101. }
  102. }
  103. }
  104. public void GetDepositData(string Date)
  105. {
  106. // 要下载的文件路径
  107. string filePath = "/haoda-deposit/deposit_" + Date + ".csv";
  108. try
  109. {
  110. // 创建FtpWebRequest对象
  111. FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpServerAddress + filePath);
  112. request.Method = WebRequestMethods.Ftp.DownloadFile;
  113. request.Credentials = new NetworkCredential(ftpUser, ftpPassword);
  114. // 使用WebResponse获取响应
  115. FtpWebResponse response = (FtpWebResponse)request.GetResponse();
  116. // 打开数据流
  117. Stream responseStream = response.GetResponseStream();
  118. StreamReader reader = new StreamReader(responseStream);
  119. // 读取数据
  120. string fileContents = reader.ReadToEnd();
  121. if (!string.IsNullOrEmpty(fileContents))
  122. {
  123. WebCMSEntities db = new WebCMSEntities();
  124. MpMainModels2.WebCMSEntities mpdb2 = new MpMainModels2.WebCMSEntities();
  125. var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
  126. if(DataInfo.Length > 1)
  127. {
  128. var DataList = DataInfo[1].Split('\n');
  129. foreach (var DataListItem in DataList)
  130. {
  131. var DataListInfo = DataListItem.Split(',');
  132. string SnNo = DataListInfo[0]; //sn
  133. string MerNo = DataListInfo[1]; //商户编号
  134. string PosKind = DataListInfo[2]; //机具型号
  135. string ActDate = DataListInfo[3]; //激活时间
  136. string Deposit = DataListInfo[4]; //押金金额
  137. string PrizeAmt = "0"; //奖励金额
  138. string PrizeDate = "None"; //奖励发放时间
  139. string Name = ""; //发放人姓名
  140. string MerName = ""; //商户名称
  141. string PassDate = ""; //审核通过时期
  142. if(Date.StartsWith("d_"))
  143. {
  144. MerName = DataListInfo[5]; //商户名称
  145. PassDate = DataListInfo[6]; //审核通过时期
  146. }
  147. else
  148. {
  149. PrizeAmt = DataListInfo[5]; //奖励金额
  150. PrizeDate = DataListInfo[6]; //奖励发放时间
  151. Name = DataListInfo[7]; //发放人姓名
  152. MerName = DataListInfo[8]; //商户名称
  153. PassDate = DataListInfo[9]; //审核通过时期
  154. }
  155. string ActDateString = ActDate.Substring(0, 4) + "-" + ActDate.Substring(4, 2) + "-" + ActDate.Substring(6, 2);
  156. if(DateTime.Parse(ActDateString) >= DateTime.Parse(DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd")))
  157. {
  158. string PrizeDateString = "";
  159. if(PrizeDate == "None")
  160. {
  161. PrizeDate = Date.Replace("d_", "");
  162. }
  163. else
  164. {
  165. PrizeDateString = PrizeDate.Substring(0, 4) + "-" + PrizeDate.Substring(4, 2) + "-" + PrizeDate.Substring(6, 2);
  166. }
  167. if(!db.BindRecord.Any(m => m.MerSnNo == SnNo))
  168. {
  169. string ProductType = "0";
  170. if(PosKind == "好哒语音王Y512") ProductType = "18";
  171. if(PosKind == "4G收款王M820") ProductType = "19";
  172. if(PosKind == "4G收款王M826") ProductType = "20";
  173. if(PosKind == "好哒S312") ProductType = "21";
  174. if(PosKind == "好哒扫码通M837") ProductType = "29";
  175. db.BindRecord.Add(new BindRecord()
  176. {
  177. CreateDate = DateTime.Now,
  178. UpdateTime = DateTime.Now, //机具绑定、解绑时间
  179. CreateTime = DateTime.Now, //商户操作时间
  180. MerSnNo = SnNo, //序列号
  181. MerNo = MerNo, //商户编号
  182. MerName = MerName,
  183. SeoTitle = PrizeAmt,
  184. SeoKeyword = ActDateString,
  185. ProductType = ProductType,
  186. Field1 = Deposit,
  187. Field2 = PrizeDate,
  188. Field3 = Name,
  189. Field4 = PassDate,
  190. Status = 1,
  191. });
  192. db.Merchants.Add(new Merchants()
  193. {
  194. SnNo = SnNo,
  195. CreateTime = DateTime.Now,
  196. UpdateTime = DateTime.Now,
  197. AgentName = Name,
  198. MerRealName = Name,
  199. MerNo = MerNo,
  200. MerName = Name,
  201. ProductType = ProductType,
  202. Status = 1,
  203. });
  204. db.SaveChanges();
  205. Thread.Sleep(1000);
  206. db.ActivateRecord.Add(new ActivateRecord()
  207. {
  208. SnNo = SnNo,
  209. CreateDate = DateTime.Now,
  210. SeoTitle = Deposit,
  211. ActivateDate = DateTime.Now,
  212. AgentNo = MerNo,
  213. MerRealName = Name,
  214. MerNo = MerNo,
  215. MerName = Name,
  216. ProductType = ProductType,
  217. ChannelSerial = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8),
  218. Status = 1,
  219. Field1 = PassDate,
  220. });
  221. db.SaveChanges();
  222. //推送MQ给创业帮
  223. var merchantAddInfo = mpdb2.MerchantAddInfo.FirstOrDefault(m => m.MchtNo == MerNo) ?? new MpMainModels2.MerchantAddInfo();
  224. if (merchantAddInfo.BrandId == 1 && !string.IsNullOrEmpty(merchantAddInfo.CybMakerCode))
  225. {
  226. SortedList<string, string> obj = new SortedList<string, string>();
  227. obj.Add("create_time", ActDateString);
  228. obj.Add("sn", SnNo);
  229. obj.Add("deposit", Deposit);
  230. obj.Add("subject_type", merchantAddInfo.SubjectType);
  231. obj.Add("merch_no", merchantAddInfo.MchtNo);
  232. obj.Add("maker_code", merchantAddInfo.CybMakerCode);
  233. PushHelper.Instance.Do(obj, "cashNotify");
  234. }
  235. }
  236. }
  237. }
  238. }
  239. db.Dispose();
  240. mpdb2.Dispose();
  241. }
  242. // 关闭响应
  243. reader.Dispose();
  244. responseStream.Dispose();
  245. response.Close();
  246. }
  247. catch (WebException ex)
  248. {
  249. function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
  250. }
  251. }
  252. public void GetDepositData2(string Date)
  253. {
  254. // 要下载的文件路径
  255. string filePath = "/haoda-deposit/deposit_" + Date + ".csv";
  256. try
  257. {
  258. // 创建FtpWebRequest对象
  259. FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpServerAddress + filePath);
  260. request.Method = WebRequestMethods.Ftp.DownloadFile;
  261. request.Credentials = new NetworkCredential(ftpUser, ftpPassword);
  262. // 使用WebResponse获取响应
  263. FtpWebResponse response = (FtpWebResponse)request.GetResponse();
  264. // 打开数据流
  265. Stream responseStream = response.GetResponseStream();
  266. StreamReader reader = new StreamReader(responseStream);
  267. // 读取数据
  268. string fileContents = reader.ReadToEnd();
  269. if (!string.IsNullOrEmpty(fileContents))
  270. {
  271. WebCMSEntities db = new WebCMSEntities();
  272. MpMainModels2.WebCMSEntities mpdb2 = new MpMainModels2.WebCMSEntities();
  273. var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
  274. if(DataInfo.Length > 1)
  275. {
  276. var DataList = DataInfo[1].Split('\n');
  277. foreach (var DataListItem in DataList)
  278. {
  279. var DataListInfo = DataListItem.Split(',');
  280. string SnNo = DataListInfo[0]; //sn
  281. string MerNo = DataListInfo[1]; //商户编号
  282. string PosKind = DataListInfo[2]; //机具型号
  283. string ActDate = DataListInfo[3]; //激活时间
  284. string Deposit = DataListInfo[4]; //押金金额
  285. string PrizeAmt = DataListInfo[5]; //奖励金额
  286. string PrizeDate = DataListInfo[6]; //奖励发放时间
  287. string Name = DataListInfo[7]; //发放人姓名
  288. string ActDateString = ActDate.Substring(0, 4) + "-" + ActDate.Substring(4, 2) + "-" + ActDate.Substring(6, 2);
  289. string PrizeDateString = "";
  290. if(PrizeDate == "None")
  291. {
  292. PrizeDate = Date;
  293. }
  294. else
  295. {
  296. PrizeDateString = PrizeDate.Substring(0, 4) + "-" + PrizeDate.Substring(4, 2) + "-" + PrizeDate.Substring(6, 2);
  297. }
  298. string ProductType = "0";
  299. if(PosKind == "好哒语音王Y512") ProductType = "18";
  300. if(PosKind == "4G收款王M820") ProductType = "19";
  301. if(PosKind == "4G收款王M826") ProductType = "20";
  302. if(PosKind == "好哒S312") ProductType = "21";
  303. db.BindRecord.Add(new BindRecord()
  304. {
  305. CreateDate = DateTime.Now,
  306. UpdateTime = DateTime.Now, //机具绑定、解绑时间
  307. CreateTime = DateTime.Now, //商户操作时间
  308. MerSnNo = SnNo, //序列号
  309. MerNo = MerNo, //商户编号
  310. MerName = Name,
  311. SeoTitle = PrizeAmt,
  312. SeoKeyword = ActDateString,
  313. ProductType = ProductType,
  314. Field1 = Deposit,
  315. Field2 = PrizeDate,
  316. Status = 1,
  317. });
  318. db.Merchants.Add(new Merchants()
  319. {
  320. SnNo = SnNo,
  321. CreateTime = DateTime.Now,
  322. UpdateTime = DateTime.Now,
  323. AgentName = Name,
  324. MerRealName = Name,
  325. MerNo = MerNo,
  326. MerName = Name,
  327. ProductType = ProductType,
  328. Status = 1,
  329. });
  330. db.SaveChanges();
  331. Thread.Sleep(1000);
  332. db.ActivateRecord.Add(new ActivateRecord()
  333. {
  334. SnNo = SnNo,
  335. CreateDate = DateTime.Now,
  336. SeoTitle = Deposit,
  337. ActivateDate = DateTime.Now,
  338. AgentNo = MerNo,
  339. MerRealName = Name,
  340. MerNo = MerNo,
  341. MerName = Name,
  342. ProductType = ProductType,
  343. ChannelSerial = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8),
  344. Status = 1,
  345. });
  346. db.SaveChanges();
  347. //推送MQ给创业帮
  348. var merchantAddInfo = mpdb2.MerchantAddInfo.FirstOrDefault(m => m.MchtNo == MerNo) ?? new MpMainModels2.MerchantAddInfo();
  349. if (merchantAddInfo.BrandId == 1 && !string.IsNullOrEmpty(merchantAddInfo.CybMakerCode))
  350. {
  351. SortedList<string, string> obj = new SortedList<string, string>();
  352. obj.Add("create_time", ActDateString);
  353. obj.Add("sn", SnNo);
  354. obj.Add("deposit", Deposit);
  355. obj.Add("subject_type", merchantAddInfo.SubjectType);
  356. obj.Add("merch_no", merchantAddInfo.MchtNo);
  357. obj.Add("maker_code", merchantAddInfo.CybMakerCode);
  358. PushHelper.Instance.Do(obj, "cashNotify");
  359. }
  360. }
  361. }
  362. db.Dispose();
  363. mpdb2.Dispose();
  364. }
  365. // 关闭响应
  366. reader.Dispose();
  367. responseStream.Dispose();
  368. response.Close();
  369. }
  370. catch (WebException ex)
  371. {
  372. function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
  373. }
  374. }
  375. public void StartTrade()
  376. {
  377. //每天凌晨执行获取好哒FTP昨日交易数据
  378. Thread th2 = new Thread(GetTradeDataReady);
  379. th2.IsBackground = true;
  380. th2.Start();
  381. }
  382. /// <summary>
  383. /// 获取好哒FTP昨日交易数据
  384. /// </summary>
  385. public void GetTradeDataReady()
  386. {
  387. while (true)
  388. {
  389. if (DateTime.Now.Hour > 10 && DateTime.Now.Hour < 22)
  390. {
  391. string check = function.ReadInstance("/GetFTPTradeYesterday/check" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + ".txt");
  392. if (string.IsNullOrEmpty(check))
  393. {
  394. function.WritePage("/GetFTPTradeYesterday/", "check" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString());
  395. GetTradeData(DateTime.Now.AddDays(-1).ToString("yyyyMMdd"));
  396. Thread.Sleep(600000);
  397. }
  398. }
  399. else
  400. {
  401. Thread.Sleep(1800000);
  402. }
  403. }
  404. }
  405. public void StartTradeListen()
  406. {
  407. //每天凌晨执行获取好哒FTP昨日交易数据
  408. Thread th2 = new Thread(ListenTradeDataReady);
  409. th2.IsBackground = true;
  410. th2.Start();
  411. }
  412. /// <summary>
  413. /// 获取好哒FTP昨日交易数据
  414. /// </summary>
  415. public void ListenTradeDataReady()
  416. {
  417. while (true)
  418. {
  419. string content = RedisDbconn.Instance.RPop<string>("ListenTradeDataQueue");
  420. if (!string.IsNullOrEmpty(content))
  421. {
  422. GetTradeData(content);
  423. Thread.Sleep(2000);
  424. }
  425. else
  426. {
  427. Thread.Sleep(60000);
  428. }
  429. }
  430. }
  431. public void GetTradeData(string Date)
  432. {
  433. // 要下载的文件路径
  434. string filePath = "/haoda-trade/" + Date + ".csv";
  435. function.WriteLog(DateTime.Now.ToString() + ":" + filePath, "获取好哒FTP文件交易数据");
  436. try
  437. {
  438. // 创建FtpWebRequest对象
  439. FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpServerAddress + filePath);
  440. request.Method = WebRequestMethods.Ftp.DownloadFile;
  441. request.Credentials = new NetworkCredential(ftpUser, ftpPassword);
  442. // 使用WebResponse获取响应
  443. FtpWebResponse response = (FtpWebResponse)request.GetResponse();
  444. // 打开数据流
  445. Stream responseStream = response.GetResponseStream();
  446. StreamReader reader = new StreamReader(responseStream);
  447. // 读取数据
  448. string fileContents = reader.ReadToEnd();
  449. function.WriteLog("fileContents:" + fileContents, "获取好哒FTP文件交易数据");
  450. if (!string.IsNullOrEmpty(fileContents))
  451. {
  452. MpMainModels2.WebCMSEntities db = new MpMainModels2.WebCMSEntities();
  453. var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
  454. if(DataInfo.Length > 1)
  455. {
  456. var DataList = DataInfo[1].Split('\n');
  457. foreach (var DataListItem in DataList)
  458. {
  459. var DataListInfo = DataListItem.Split(',');
  460. var MerchantNo = ""; // 商户号
  461. var BaseNo = ""; // 设备号
  462. var OrderNo = ""; // 订单号
  463. var PayWay = ""; // 支付方式(微信 支付宝)
  464. var TradeType = ""; // 交易类型
  465. var TradeAmount = ""; // 交易金额
  466. var TradeFee = ""; // 交易手续费
  467. var TradeDate = ""; // 交易时间
  468. var TradeCycle = ""; // 结算周期
  469. MerchantNo = DataListInfo[0];
  470. BaseNo = DataListInfo[1];
  471. OrderNo = DataListInfo[3];
  472. PayWay = DataListInfo[4];
  473. TradeType = DataListInfo[5];
  474. TradeAmount = DataListInfo[6];
  475. TradeFee = DataListInfo[7];
  476. TradeDate = DataListInfo[8];
  477. TradeCycle = DataListInfo[9];
  478. TradeDate = TradeDate.Substring(0, 4) + "-" + TradeDate.Substring(4, 2) + "-" + TradeDate.Substring(6, 2) + " " + TradeDate.Substring(8, 2) + ":" + TradeDate.Substring(10, 2) + ":" + TradeDate.Substring(12, 2);
  479. function.WriteLog("OrderNo:" + OrderNo, "获取好哒FTP文件交易数据");
  480. function.WriteLog("MerchantNo:" + MerchantNo, "获取好哒FTP文件交易数据");
  481. var PayMode = 0;
  482. if (PayWay.Contains("支付宝")) PayMode = 1;
  483. if (PayWay.Contains("微信")) PayMode = 2;
  484. var merchantAddInfo = db.MerchantAddInfo.FirstOrDefault(m => m.MchtNo == MerchantNo) ?? new MpMainModels2.MerchantAddInfo();
  485. if (merchantAddInfo.Id > 0)
  486. {
  487. function.WriteLog("找到商户", "获取好哒FTP文件交易数据");
  488. var merchantInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == merchantAddInfo.Id) ?? new MpMainModels2.MerchantInfo();
  489. if(merchantInfo.IsAct == 0)
  490. {
  491. merchantInfo.IsAct = 1;
  492. }
  493. var orders = db.ConsumerOrders.FirstOrDefault(m => m.SeoTitle == OrderNo && m.OrderNo == OrderNo) ?? new MpMainModels2.ConsumerOrders();
  494. if (orders.Id == 0)
  495. {
  496. function.WriteLog("订单号不存在,开始入库", "获取好哒FTP文件交易数据");
  497. var query = db.ConsumerOrders.Add(new MpMainModels2.ConsumerOrders()
  498. {
  499. Status = 1,
  500. CreateDate = DateTime.Parse(TradeDate),
  501. UpdateDate = DateTime.Parse(TradeDate),
  502. SnNo = BaseNo,
  503. PayMoney = decimal.Parse(TradeAmount),
  504. PayMode = PayMode,
  505. SeoTitle = OrderNo,
  506. OrderNo = OrderNo,
  507. MerchantId = merchantAddInfo.Id,
  508. UserId = merchantInfo.UserId,
  509. SeoKeyword = merchantAddInfo.CybMakerCode,
  510. }).Entity;
  511. db.SaveChanges();
  512. function.WriteLog("入库完毕", "获取好哒FTP文件交易数据");
  513. //推送MQ给创业帮
  514. if (merchantAddInfo.BrandId == 1)
  515. {
  516. if(!string.IsNullOrEmpty(merchantAddInfo.CybMakerCode))
  517. {
  518. SortedList<string, string> obj = new SortedList<string, string>();
  519. obj.Add("create_time", TradeDate);
  520. obj.Add("sn", BaseNo);
  521. obj.Add("pay_money", TradeAmount);
  522. obj.Add("pay_mode", PayMode.ToString());
  523. obj.Add("order_no", OrderNo);
  524. obj.Add("merch_no", merchantAddInfo.MchtNo);
  525. obj.Add("maker_code", merchantAddInfo.CybMakerCode);
  526. PushHelper.Instance.Do(obj);
  527. }
  528. OrderMessageHelper.SendOrderMsg(query);
  529. }
  530. }
  531. }
  532. }
  533. }
  534. db.Dispose();
  535. }
  536. // 关闭响应
  537. reader.Dispose();
  538. responseStream.Dispose();
  539. response.Close();
  540. function.WriteLog("结束\n\n\n", "获取好哒FTP文件数据异常");
  541. }
  542. catch (WebException ex)
  543. {
  544. function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件交易数据异常");
  545. }
  546. }
  547. }
  548. }