http_manager.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Net;
  7. using System.IO;
  8. using System.Collections.Specialized;
  9. using System.Threading;
  10. using System.Collections.Concurrent;
  11. using System.Diagnostics;
  12. using SqlSugar;
  13. using Newtonsoft.Json;
  14. using HXX.Scanner.Database;
  15. using HXX.Scanner.Common;
  16. using HXX.Scanner.Biz.Socket;
  17. namespace HXX.Scanner.Biz
  18. {
  19. /// <summary>
  20. /// 文件上传类
  21. /// </summary>
  22. public class upf
  23. {
  24. /// <summary>
  25. /// 文件基本信息,来自数据库
  26. /// </summary>
  27. public tb_file_info entity { get; set; }
  28. /// <summary>
  29. /// 文件当初状态,判断是否允许做上传的动作
  30. /// </summary>
  31. public ResponseEntity<response_http_uploadImg2> result { get; set; }
  32. /// <summary>
  33. /// seqNumber
  34. /// </summary>
  35. //public int seqNumber { get; set; }
  36. /// <summary>
  37. /// upload type
  38. /// </summary>
  39. public upload_type_enum upload_type { get; set; }
  40. }
  41. /// <summary>
  42. /// 文件上传业务
  43. /// </summary>
  44. public class http_manager
  45. {
  46. public http_manager()
  47. {
  48. ////测试状态禁止上传
  49. //if (config_environment.scan_type == ScanType.Test_Panel_1_Side || config_environment.scan_type == ScanType.Test_Panel_2_Sides)
  50. //{
  51. // return;
  52. //}
  53. //else
  54. //{
  55. // url_upload = config_environment.web_parameter.uploadUrl + config_manager.Get("uploadFileUrl");
  56. //}
  57. url_upload = config_environment.web_parameter.uploadUrl;
  58. }
  59. /// <summary>
  60. /// url
  61. /// </summary>
  62. private string url_upload;
  63. /// <summary>
  64. /// 上传失败的处理方法
  65. /// </summary>
  66. public static del_on_net_broken on_net_broken;
  67. /// <summary>
  68. /// 上传结果通知
  69. /// </summary>
  70. public static del_http_notify on_http_notify;
  71. /// <summary>
  72. /// 上传结果通知2
  73. /// </summary>
  74. public static del_http_notify2 on_http_notify2;
  75. /// <summary>
  76. /// 文件上传队列
  77. /// </summary>
  78. private static ConcurrentQueue<upf> queue = new ConcurrentQueue<upf>();
  79. //public void Upload(tb_file_info _entity, ResponseEntity<response_http_uploadImg> _result)
  80. //{
  81. // var e_q = new upf() { entity = _entity, result = _result, seqNumber = 0 };
  82. // queue.Enqueue(e_q);
  83. //}
  84. /// <summary>
  85. /// 检查队列是否为空
  86. /// </summary>
  87. /// <returns></returns>
  88. public static bool check_is_queue_empty()
  89. {
  90. //return false;
  91. return queue.IsEmpty;
  92. }
  93. /// <summary>
  94. /// 进上传队列
  95. /// </summary>
  96. /// <param name="e_q"></param>
  97. public void Upload(upf e_q)
  98. {
  99. queue.Enqueue(e_q);
  100. }
  101. //public static void start_http_upload()
  102. //{
  103. // Task.Run(() =>
  104. // {
  105. // while (true)
  106. // {
  107. // if (!queue.IsEmpty)
  108. // {
  109. // queue.TryDequeue(out upf eq);
  110. // if (eq != null)
  111. // {
  112. // new http_manager().Upload_1(eq.entity, eq.result, eq.seqNumber);
  113. // }
  114. // }
  115. // else
  116. // {
  117. // Thread.Sleep(100);
  118. // }
  119. // }
  120. // });
  121. //}
  122. /// <summary>
  123. /// 队列上传线程
  124. /// </summary>
  125. public static void start_http_upload()
  126. {
  127. Task.Run(() =>
  128. {
  129. while (true)
  130. {
  131. if (!queue.IsEmpty)
  132. {
  133. //队列不空,取一个待上传实体
  134. queue.TryDequeue(out upf eq);
  135. if (eq != null)
  136. {
  137. //真实上传业务
  138. //开始计时
  139. Stopwatch sw = new Stopwatch();
  140. sw.Start();
  141. while (true)
  142. {
  143. //判断图片转换和保存数据库操作是否完成
  144. if ((eq.upload_type == upload_type_enum.normal && eq.result != null && eq.result.Status == 1)
  145. || eq.upload_type == upload_type_enum.reUpload)
  146. {
  147. //告诉网页端开始上传
  148. //if (eq.entity.fi_zipId == 1)
  149. //{
  150. // var response = new response_uploading() { batchNumber = eq.entity.fi_batchSeq, subjectCode = eq.entity.fi_subjectCode };
  151. // on_http_notify2(JsonConvert.SerializeObject(response));
  152. //}
  153. //http上传
  154. eq.result = new http_manager().Upload_1(eq);
  155. break;
  156. }
  157. else
  158. {
  159. //数据操作超时
  160. if (sw.ElapsedMilliseconds > 10000)
  161. {
  162. eq.result.Status = 0;
  163. eq.result.Message = "保存图片超时";
  164. sw.Stop();
  165. break;
  166. }
  167. else
  168. {
  169. Thread.Sleep(100);
  170. }
  171. }
  172. }
  173. //真实上传业务
  174. //test
  175. //if (testflag)
  176. //{
  177. // eq.result.Status = 1;
  178. //}
  179. //else
  180. //{
  181. // eq.result.Status = 0;
  182. //}
  183. //testflag = !testflag;
  184. //test
  185. AfterUpload(eq);
  186. }
  187. }
  188. else
  189. {
  190. Thread.Sleep(100);
  191. }
  192. }
  193. });
  194. }
  195. static bool testflag = true;
  196. private static void AfterUpload(upf eq)
  197. {
  198. //Thread.Sleep(1000);
  199. try
  200. {
  201. if (eq.result.Status == 1 || eq.result.Status == 200)
  202. {
  203. entity_server_upload server_response = null;
  204. try
  205. {
  206. server_response = JsonConvert.DeserializeObject<entity_server_upload>(eq.result.Data.data_string);
  207. }
  208. catch (Exception ee)
  209. {
  210. LogManager.WriteLog(ee.Message);
  211. }
  212. var db_list = new biz_db().get_by_sn(eq.entity.fi_SN);
  213. foreach (var entity in db_list)
  214. {
  215. var fileName = Path.GetFileName(entity.fi_full_name);
  216. var path = Path.GetDirectoryName(entity.fi_full_name);
  217. path = path.Replace("ready", "complete");
  218. fileName = Path.Combine(path, fileName);
  219. try
  220. {
  221. if (File.Exists(fileName))
  222. {
  223. File.Delete(fileName);
  224. }
  225. //把上传成功的文件,从ready移动到complete中
  226. File.Move(entity.fi_full_name, fileName);
  227. }
  228. catch (Exception e1)
  229. {
  230. LogManager.WriteLog(e1.Message);
  231. response_error error = new response_error(e1.Message);
  232. on_http_notify2(JsonConvert.SerializeObject(error));
  233. }
  234. var url = get_url_from_server_response(entity, server_response);
  235. //上传成功,更新数据库标志
  236. new biz_db().update_upload_flag_by_id(entity.fi_id, 1, url);
  237. new biz_db().update_file_name(entity.fi_id, fileName);
  238. }
  239. }
  240. else if (eq.result.Status == -1)
  241. {
  242. return;
  243. }
  244. else
  245. {
  246. new biz_db().update_upload_flag_by_SN(eq.entity.fi_SN.Value, -1);
  247. }
  248. //socket发送结果
  249. if (eq.upload_type == upload_type_enum.normal)
  250. {
  251. notify_nomral(eq);
  252. }
  253. else
  254. {
  255. notify_reUpload(eq);
  256. }
  257. }
  258. catch (Exception ee)
  259. {
  260. LogManager.WriteLog(eq.result.Message);
  261. response_error error = new response_error(ee.Message);
  262. on_http_notify2(JsonConvert.SerializeObject(error));
  263. }
  264. }
  265. private static string get_url_from_server_response(tb_file_info db_entity, entity_server_upload server_response)
  266. {
  267. string result = string.Empty;
  268. try
  269. {
  270. var data = server_response.data.Where(x => x.Contains("_" + db_entity.fi_zipId + ".")).FirstOrDefault();
  271. if (!string.IsNullOrEmpty(data))
  272. {
  273. result = data;
  274. }
  275. }
  276. catch (Exception ee)
  277. {
  278. LogManager.WriteLog(ee.Message);
  279. }
  280. return result;
  281. }
  282. private static void notify_nomral(upf eq)
  283. {
  284. var entity = eq.entity;
  285. var qty = new biz_db().get_upload_count_by_batchNumber(eq.entity.fi_batchSeq, eq.entity.fi_subjectCode);
  286. var response1 = new response_uploadNumber() { number = qty.qty_success, batchNumber = eq.entity.fi_batchSeq };
  287. //var response2 = new response_fainNumber() { number = qty.qty_fail, batchNumber = eq.entity.fi_batchSeq };
  288. on_http_notify(eq);
  289. on_http_notify2(JsonConvert.SerializeObject(response1));
  290. //on_http_notify2(JsonConvert.SerializeObject(response2));
  291. //if (queue.IsEmpty)
  292. //{
  293. // var response_finish = new response_uploadFinish() { subjectCode = entity.fi_subjectCode, batchNumber = entity.fi_batchSeq };
  294. // var upload_count = new biz_db().get_upload_count_by_batchNumber(entity.fi_batchSeq, entity.fi_subjectCode);
  295. // response_finish.scanNumber = new biz_db().get_count_by_batchNumber(entity.fi_batchSeq, entity.fi_subjectCode);
  296. // response_finish.uploadNumber = upload_count.qty_success;
  297. // response_finish.failedNumber = upload_count.qty_fail;
  298. // on_http_notify2(JsonConvert.SerializeObject(response_finish));
  299. //}
  300. }
  301. public static void notify_scan_finish()
  302. {
  303. Task.Run(() =>
  304. {
  305. if (config_environment.scan_type2 == ScanType.Formal)
  306. {
  307. while (!queue.IsEmpty)
  308. {
  309. Thread.Sleep(100);
  310. }
  311. var response_finish = new response_uploadFinish();
  312. try
  313. {
  314. response_finish.subjectCode = config_environment.web_parameter.subjectCode;
  315. response_finish.batchNumber = config_environment.web_parameter.batchNumber;
  316. var upload_count = new biz_db().get_upload_count_by_batchNumber(config_environment.web_parameter.batchNumber, config_environment.web_parameter.subjectCode);
  317. response_finish.scanNumber = new biz_db().get_count_by_batchNumber(config_environment.web_parameter.batchNumber, config_environment.web_parameter.subjectCode);
  318. response_finish.uploadNumber = upload_count.qty_success;
  319. response_finish.failedNumber = upload_count.qty_fail;
  320. }
  321. catch (Exception ee)
  322. {
  323. response_finish.code = 500;
  324. response_finish.msg = ee.Message;
  325. LogManager.WriteLog(ee.Message);
  326. }
  327. on_http_notify2(JsonConvert.SerializeObject(response_finish));
  328. }
  329. });
  330. }
  331. private static void notify_reUpload(upf eq)
  332. {
  333. var response1 = new response_reUpload_single_finish();
  334. response1.fileIndex = get_ids_whenUpload(eq.entity.fi_SN);
  335. response1.batchNumber = eq.entity.fi_batchSeq;
  336. response1.subjectCode = eq.entity.fi_subjectCode;
  337. if (eq.result.Status == 1 || eq.result.Status == -1 || eq.result.Status == 200)
  338. {
  339. response1.uploadState = 0;
  340. }
  341. else
  342. {
  343. response1.uploadState = 1;
  344. }
  345. on_http_notify2(JsonConvert.SerializeObject(response1));
  346. if (queue.IsEmpty)
  347. {
  348. var response_finish = new response_reUpload_all_finish() { subjectCode = eq.entity.fi_subjectCode, batchNumber = eq.entity.fi_batchSeq, number = biz_reUpload.current_list.Count(x => x.fi_side == 1) };
  349. string id_list = string.Empty;
  350. foreach(var record in biz_reUpload.current_list)
  351. {
  352. id_list += "," + record.fi_id;
  353. }
  354. if (id_list.Length > 0)
  355. {
  356. id_list = id_list.Substring(1);
  357. }
  358. response_finish.failedNumber = new biz_db().get_not_upload_status(id_list);
  359. on_http_notify(eq);
  360. on_http_notify2(JsonConvert.SerializeObject(response_finish));
  361. }
  362. }
  363. /// <summary>
  364. /// 单任务上传
  365. /// </summary>
  366. /// <param name="entity"></param>
  367. /// <param name="result"></param>
  368. /// <param name="seqNumber"></param>
  369. /// <returns></returns>
  370. //private ResponseEntity<response_http_uploadImg2> Upload_1(tb_file_info entity, ResponseEntity<response_http_uploadImg2> result, int seqNumber)
  371. private ResponseEntity<response_http_uploadImg2> Upload_1(upf eq)
  372. {
  373. if (eq.entity != null)
  374. {
  375. if (eq.upload_type == upload_type_enum.normal && eq.result.Status == 1)
  376. {
  377. try
  378. {
  379. //根据实体获取json
  380. var content = get_json(eq.entity);
  381. eq.result = content.Item1;
  382. if (eq.result.Status == 1)
  383. {
  384. eq.result = upload_try(eq, eq.result.Message, content.Item2);
  385. }
  386. else if (eq.result.Status == -1)
  387. {
  388. //双面的第一面,等待第二面到来再传
  389. return eq.result;
  390. }
  391. }
  392. catch (Exception ee)
  393. {
  394. eq.result.Status = 0;
  395. eq.result.Message = ee.Message;
  396. }
  397. //biz_scanFinish.Work(eq.entity, eq.result);
  398. }
  399. else if (eq.upload_type == upload_type_enum.reUpload)
  400. {
  401. try
  402. {
  403. //根据实体获取json
  404. var content = get_json(eq.entity);
  405. eq.result = content.Item1;
  406. if (eq.result.Status == 1)
  407. {
  408. eq.result = upload_try(eq, eq.result.Message, content.Item2);
  409. }
  410. else if (eq.result.Status == -1)
  411. {
  412. //双面的第一面,等待第二面到来再传
  413. return eq.result;
  414. }
  415. else
  416. {
  417. var response3 = new response_reUpload_error()
  418. {
  419. batchNumber = eq.entity.fi_batchSeq,
  420. subjectCode = eq.entity.fi_subjectCode,
  421. code = 500,
  422. msg = eq.result.Message,
  423. };
  424. on_http_notify2(JsonConvert.SerializeObject(response3));
  425. }
  426. }
  427. catch (Exception ee)
  428. {
  429. eq.result.Status = 0;
  430. eq.result.Message = ee.Message;
  431. LogManager.WriteLog(ee.Message);
  432. }
  433. }
  434. }
  435. return eq.result;
  436. }
  437. private string get_seqNumbers_whenUpload(long? sn)
  438. {
  439. string result = "";
  440. var list = new biz_db().get_by_sn(sn);
  441. if (list[0].fi_schema != list.Count)
  442. {
  443. throw new Exception("Paper Schema does not match Paper Count");
  444. }
  445. foreach(var record in list)
  446. {
  447. result += "," + record.fi_zipId;
  448. }
  449. if (result.Length > 0)
  450. {
  451. result = result.Substring(1);
  452. }
  453. return result;
  454. }
  455. private static string get_ids_whenUpload(long? sn)
  456. {
  457. string result = "";
  458. var list = new biz_db().get_by_sn(sn);
  459. foreach (var record in list)
  460. {
  461. result += "," + record.fi_id;
  462. }
  463. if (result.Length > 0)
  464. {
  465. result = result.Substring(1);
  466. }
  467. return result;
  468. }
  469. /// <summary>
  470. /// 3次上传尝试
  471. /// </summary>
  472. /// <param name="json"></param>
  473. /// <param name="file_list"></param>
  474. /// <returns></returns>
  475. private ResponseEntity<response_http_uploadImg2> upload_try(upf eq, string json, List<string> file_list)
  476. {
  477. var result = new ResponseEntity<response_http_uploadImg2>();
  478. int try_count = 0;
  479. //////////
  480. var entity = JsonConvert.DeserializeObject<request_http_uploadImg>(json);
  481. /////////
  482. NameValueCollection param_list = new NameValueCollection();
  483. //new
  484. param_list.Add("seqNumbers", get_seqNumbers_whenUpload(eq.entity.fi_SN));
  485. param_list.Add("paperSchema", eq.entity.fi_schema.ToString());
  486. //new
  487. //old
  488. param_list.Add("seqNumber", eq.entity.fi_zipId.ToString());
  489. param_list.Add("schema", eq.entity.fi_schema.ToString());
  490. //old
  491. param_list.Add("jsonParam", config_environment.web_parameter.jsonParam);
  492. while (try_count < 3)
  493. {
  494. try_count++;
  495. result = upload_try2(param_list, file_list);
  496. if (result.Status == 1)
  497. {
  498. break;
  499. }
  500. else
  501. {
  502. Thread.Sleep(100);
  503. }
  504. }
  505. return result;
  506. }
  507. /// <summary>
  508. /// 具体上传逻辑
  509. /// </summary>
  510. /// <param name="param_list"></param>
  511. /// <param name="file_list"></param>
  512. /// <returns></returns>
  513. private ResponseEntity<response_http_uploadImg2> upload_try2(NameValueCollection param_list, List<string> file_list)
  514. {
  515. ResponseEntity<response_http_uploadImg2> result = new ResponseEntity<response_http_uploadImg2>();
  516. try
  517. {
  518. var response_string = http_helper.HttpUploadFile2(url_upload, file_list, "files", "multipart/form-data", config_environment.web_parameter.token, param_list);
  519. try
  520. {
  521. result.Data = JsonConvert.DeserializeObject<response_http_uploadImg2>(response_string);
  522. }
  523. catch (Exception ee2)
  524. {
  525. if (ee2.Message.StartsWith("Unexpected character"))
  526. {
  527. result.Data = new response_http_uploadImg2() { code = 200 };
  528. }
  529. else
  530. {
  531. throw ee2;
  532. }
  533. }
  534. result.Data.data_string = response_string;
  535. if (result.Data.code == 200)
  536. {
  537. result.Status = 1;
  538. result.Message = "ok";
  539. }
  540. else
  541. {
  542. result.Status = result.Data.code;
  543. result.Message = result.Data.msg;
  544. LogManager.WriteLog(response_string);
  545. }
  546. }
  547. catch (Exception ee)
  548. {
  549. LogManager.WriteLog(ee);
  550. if (ee.Message.Contains("未能解析此远程名称"))
  551. {
  552. on_net_broken();
  553. }
  554. else if (ee.Message.Contains("超时") || ee.Message.Contains("timeout"))
  555. {
  556. result.Status = -2;
  557. result.Message = "http上传超时";
  558. }
  559. else
  560. {
  561. result.Status = 0;
  562. result.Message = "http上传文件失败:" + ee.Message;
  563. }
  564. }
  565. return result;
  566. }
  567. /// <summary>
  568. /// 根据实体获取json
  569. /// </summary>
  570. /// <param name="entity"></param>
  571. /// <param name="seqNumber"></param>
  572. /// <returns></returns>
  573. private Tuple<ResponseEntity<response_http_uploadImg2>, List<string>> get_json(tb_file_info entity)
  574. {
  575. ResponseEntity<response_http_uploadImg2> result_entity = new ResponseEntity<response_http_uploadImg2>();
  576. List<string> result_path = new List<string>();
  577. try
  578. {
  579. List<tb_file_info> file_list = new List<tb_file_info>();
  580. //单面
  581. if (entity.fi_schema == 1)
  582. {
  583. file_list.Add(entity);
  584. }
  585. //双面
  586. else
  587. {
  588. file_list = new biz_db().get_by_sn(entity.fi_SN);
  589. if (file_list.Count < 2)
  590. {
  591. var ss = entity.fi_side;
  592. var ss2 = entity.fi_full_name;
  593. result_entity.Status = -1;
  594. result_entity.Message = "第1面,等待第2面再传";
  595. return new Tuple<ResponseEntity<response_http_uploadImg2>, List<string>>(result_entity, result_path);
  596. }
  597. if (file_list.Count(x => x.fi_upload_flag == 1) == file_list.Count)
  598. {
  599. result_entity.Status = -1;
  600. result_entity.Message = "已全部上传";
  601. return new Tuple<ResponseEntity<response_http_uploadImg2>, List<string>>(result_entity, result_path);
  602. }
  603. }
  604. if (file_list.Count == 1 || file_list.Count == 2)
  605. {
  606. bool flag = true;
  607. foreach (var f in file_list)
  608. {
  609. if (!File.Exists(f.fi_full_name))
  610. {
  611. flag = false;
  612. break;
  613. }
  614. }
  615. if (flag)
  616. {
  617. var req = new request_http_uploadImg();
  618. req.token = config_environment.web_parameter.token;
  619. req.fileCount = file_list.Count;
  620. req.isTest = file_list[0].fi_isTest;
  621. req.fileMetaInfo = new List<subRequest_http_uploadImg>();
  622. req.zipId = file_list[0].fi_zipId;
  623. req.examId = file_list[0].fi_examId;
  624. req.examPaperId = file_list[0].fi_examPaperId;
  625. //req.seqNumber = file_list[0].fi_schema;
  626. //req.seqNumber = file_manager.get_seqNumber();
  627. //req.seqNumber = seqNumber;
  628. req.schoolId = config_environment.web_parameter.schoolId;
  629. req.accountId = file_list[0].fi_accountId.ToString();
  630. //req.completedAmount = new biz_db().get_count_by_seq(config_environment.web_parameter.batchNumber, req.zipId);
  631. req.completedAmount = new biz_db().get_count_by_seq(file_list[0].fi_batchSeq, req.zipId, config_environment.web_parameter.paperSchema);
  632. //req.batchNumber = file_list[0].fi_batchNumber;
  633. req.batchNumber = entity.fi_batchSeq;
  634. req.schema = entity.fi_schema == null ? "1" : entity.fi_schema.ToString();
  635. foreach (var f in file_list)
  636. {
  637. var sub = new subRequest_http_uploadImg();
  638. sub.fileName = f.fi_name;
  639. req.fileMetaInfo.Add(sub);
  640. result_path.Add(f.fi_full_name);
  641. }
  642. result_entity.Status = 1;
  643. result_entity.Message = JsonConvert.SerializeObject(req);
  644. }
  645. else
  646. {
  647. result_entity.Status = 0;
  648. result_entity.Message = "未能找到用于上传的文件";
  649. }
  650. }
  651. else
  652. {
  653. result_entity.Status = 0;
  654. result_entity.Message = "db错误,未能找到用于上传的文件记录";
  655. }
  656. }
  657. catch (Exception ee)
  658. {
  659. LogManager.WriteLog(ee);
  660. result_entity.Status = 0;
  661. result_entity.Message = ee.Message;
  662. }
  663. return new Tuple<ResponseEntity<response_http_uploadImg2>, List<string>>(result_entity, result_path);
  664. }
  665. }
  666. }