GetHaoDaFTPInfoService.cs 29 KB

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