You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1282 lines
48 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. using NFine.Code;
  10. using System.Data.SqlClient;
  11. using NFine.Data.Extensions;
  12. using System.Data.OleDb;
  13. using System.Configuration;
  14. using ICS.Application.Entity;
  15. using Newtonsoft.Json.Linq;
  16. using Newtonsoft.Json;
  17. using System.Data.Common;
  18. using NFine.Domain._03_Entity.WMS;
  19. namespace NFine.Web.Areas.WMS.Controllers
  20. {
  21. public class ICSRCVIQCsController : ControllerBase
  22. {
  23. ICSRCVIQCsApp App = new ICSRCVIQCsApp();
  24. WMSCreateItemLotApp wMSCreateItemLotApp = new WMSCreateItemLotApp();
  25. // GET: WMS/ICSRCVIQCs
  26. public ActionResult ICSRCVIQCs()
  27. {
  28. return View();
  29. }
  30. public ActionResult Rejection()
  31. {
  32. return View();
  33. }
  34. public ActionResult WWRejection()
  35. {
  36. return View();
  37. }
  38. public ActionResult ICSInspectionDetail()
  39. {
  40. return View();
  41. }
  42. public ActionResult ICSLookFiles()
  43. {
  44. return View();
  45. }
  46. public ActionResult ICSInspectionDetailNew()
  47. {
  48. return View();
  49. }
  50. public ActionResult ICSInspectionDetailDelete()
  51. {
  52. return View();
  53. }
  54. public ActionResult UpdateLeadTime()
  55. {
  56. return View();
  57. }
  58. public ActionResult UpdateTrackCode()
  59. {
  60. return View();
  61. }
  62. public ActionResult YLICSRCVIQCs()
  63. {
  64. return View();
  65. }
  66. /// <summary>
  67. /// 打印数据参数:服务器的URL+打印的文件名,转化为Base64编码
  68. /// </summary>
  69. protected string strPrintData;
  70. /// <summary>
  71. /// 标识是否安装了控件
  72. /// </summary>
  73. protected bool bIsInstallPrintControl = true;
  74. /// <summary>
  75. /// 打印控件的Cookie值
  76. /// </summary>
  77. protected string strPrintControlCookie = "";
  78. /// <summary>
  79. /// 获取Url中去掉文件名的路径
  80. /// </summary>
  81. /// <returns></returns>
  82. private string GetUrlPath()
  83. {
  84. string strUrl = Request.Url.ToString();
  85. int iEnd = strUrl.LastIndexOf("/");
  86. strUrl = strUrl.Substring(0, iEnd + 1);
  87. return strUrl;
  88. }
  89. //采购
  90. [HttpGet]
  91. public ActionResult GetICSInspection(Pagination pagination, string MenuID, string queryJson)
  92. {
  93. DataTable ListData = App.GetICSInspection(ref pagination, MenuID, queryJson);
  94. var JsonData = new
  95. {
  96. total = pagination.total,
  97. page = pagination.page,
  98. records = pagination.records,
  99. rows = ListData,
  100. };
  101. return Content(JsonData.ToJson());
  102. }
  103. //采购
  104. [HttpGet]
  105. public ActionResult GetICSInspectionYL(Pagination pagination, string MenuID, string queryJson)
  106. {
  107. DataTable ListData = App.GetICSInspectionYL(ref pagination, MenuID, queryJson);
  108. var JsonData = new
  109. {
  110. total = pagination.total,
  111. page = pagination.page,
  112. records = pagination.records,
  113. rows = ListData,
  114. };
  115. return Content(JsonData.ToJson());
  116. }
  117. [HttpGet]
  118. public ActionResult GetInspectionFile(Pagination pagination, string JYID, string queryJson)
  119. {
  120. DataTable ListData = App.GetInspectionFile(ref pagination, queryJson, JYID);
  121. var JsonData = new
  122. {
  123. total = pagination.total,
  124. page = pagination.page,
  125. records = pagination.records,
  126. rows = ListData,
  127. };
  128. return Content(JsonData.ToJson());
  129. }
  130. //委外
  131. [HttpGet]
  132. public ActionResult GetICSInspection2(Pagination pagination, string MenuID, string queryJson)
  133. {
  134. DataTable ListData = App.GetICSInspection2(ref pagination, MenuID, queryJson);
  135. var JsonData = new
  136. {
  137. total = pagination.total,
  138. page = pagination.page,
  139. records = pagination.records,
  140. rows = ListData,
  141. };
  142. return Content(JsonData.ToJson());
  143. }
  144. //工单
  145. [HttpGet]
  146. public ActionResult GetICSInspection3(Pagination pagination, string MenuID, string queryJson)
  147. {
  148. DataTable ListData = App.GetICSInspection3(ref pagination, MenuID, queryJson);
  149. var JsonData = new
  150. {
  151. total = pagination.total,
  152. page = pagination.page,
  153. records = pagination.records,
  154. rows = ListData,
  155. };
  156. return Content(JsonData.ToJson());
  157. }
  158. //其他入库
  159. [HttpGet]
  160. public ActionResult GetICSInspection4(Pagination pagination, string MenuID, string queryJson)
  161. {
  162. DataTable ListData = App.GetICSInspection4(ref pagination, MenuID, queryJson);
  163. var JsonData = new
  164. {
  165. total = pagination.total,
  166. page = pagination.page,
  167. records = pagination.records,
  168. rows = ListData,
  169. };
  170. return Content(JsonData.ToJson());
  171. }
  172. //生产退料
  173. [HttpGet]
  174. public ActionResult GetICSInspection5(Pagination pagination, string MenuID, string queryJson)
  175. {
  176. DataTable ListData = App.GetICSInspection5(ref pagination, MenuID, queryJson);
  177. var JsonData = new
  178. {
  179. total = pagination.total,
  180. page = pagination.page,
  181. records = pagination.records,
  182. rows = ListData,
  183. };
  184. return Content(JsonData.ToJson());
  185. }
  186. //委外退料
  187. [HttpGet]
  188. public ActionResult GetICSInspection6(Pagination pagination, string MenuID, string queryJson)
  189. {
  190. DataTable ListData = App.GetICSInspection6(ref pagination, MenuID, queryJson);
  191. var JsonData = new
  192. {
  193. total = pagination.total,
  194. page = pagination.page,
  195. records = pagination.records,
  196. rows = ListData,
  197. };
  198. return Content(JsonData.ToJson());
  199. }
  200. //销售退货
  201. [HttpGet]
  202. public ActionResult GetICSInspection7(Pagination pagination, string MenuID, string queryJson)
  203. {
  204. DataTable ListData = App.GetICSInspection7(ref pagination, MenuID, queryJson);
  205. var JsonData = new
  206. {
  207. total = pagination.total,
  208. page = pagination.page,
  209. records = pagination.records,
  210. rows = ListData,
  211. };
  212. return Content(JsonData.ToJson());
  213. }
  214. //海格工单子线检验
  215. [HttpGet]
  216. public ActionResult GetICSInspection25(Pagination pagination, string MenuID, string queryJson)
  217. {
  218. DataTable ListData = App.GetICSInspection25(ref pagination, MenuID, queryJson);
  219. var JsonData = new
  220. {
  221. total = pagination.total,
  222. page = pagination.page,
  223. records = pagination.records,
  224. rows = ListData,
  225. };
  226. return Content(JsonData.ToJson());
  227. }
  228. //不良原因
  229. [HttpGet]
  230. public ActionResult Select_ICSBadReason(string InvCode)
  231. {
  232. var data = App.Select_ICSBadReason(InvCode);
  233. return Content(data.ToJson());
  234. }
  235. //不良代码
  236. [HttpGet]
  237. public ActionResult GetSelectICSBadCode(string InvCode)
  238. {
  239. var data = App.GetSelectICSBadCode(InvCode);
  240. return Content(data.ToJson());
  241. }
  242. /// <summary>
  243. /// 创建检验表
  244. /// </summary>
  245. /// <param name="keyValue"></param>
  246. /// <returns></returns>
  247. [HttpPost]
  248. [HandlerAjaxOnly]
  249. public ActionResult CreateICSInspection(string keyValue, string ICSInspections)
  250. {
  251. string msg = App.CreateICSInspection(keyValue, ICSInspections);
  252. if (!string.IsNullOrEmpty(msg))
  253. {
  254. return Error(msg);
  255. }
  256. else
  257. {
  258. return Success("添加成功!");
  259. }
  260. }
  261. /// <summary>
  262. /// 创建检验表并按照结果分批
  263. /// </summary>
  264. /// <param name="keyValue"></param>
  265. /// <returns></returns>
  266. [HttpPost]
  267. [HandlerAjaxOnly]
  268. public ActionResult CreateICSInspectionAndSplit(string keyValue, string ICSInspections)
  269. {
  270. string msg = App.CreateICSInspectionAndSplit(keyValue, ICSInspections);
  271. if (!string.IsNullOrEmpty(msg))
  272. {
  273. return Error(msg);
  274. }
  275. else
  276. {
  277. return Success("添加成功!");
  278. }
  279. }
  280. /// <summary>
  281. /// 在库检验保存检验结果
  282. /// </summary>
  283. /// <param name="keyValue"></param>
  284. /// <returns></returns>
  285. [HttpPost]
  286. [HandlerAjaxOnly]
  287. public ActionResult ICSWHLotInspection(string keyValue, string ICSInspections)
  288. {
  289. string msg = App.ICSWHLotInspection(keyValue, ICSInspections);
  290. if (!string.IsNullOrEmpty(msg))
  291. {
  292. return Error(msg);
  293. }
  294. else
  295. {
  296. return Success("检验结果保存成功!");
  297. }
  298. }
  299. /// <summary>
  300. /// 创建检验表(海格工单子线)
  301. /// </summary>
  302. /// <param name="keyValue"></param>
  303. /// <returns></returns>
  304. [HttpPost]
  305. [HandlerAjaxOnly]
  306. public ActionResult CreateICSInspectionHG(string keyValue, string ICSInspections)
  307. {
  308. string msg = CreateICSInspectionHG1(keyValue, ICSInspections);
  309. if (!string.IsNullOrEmpty(msg))
  310. {
  311. return Error(msg);
  312. }
  313. else
  314. {
  315. return Success("添加成功!");
  316. }
  317. }
  318. /// <summary>
  319. /// 在库检验审核
  320. /// </summary>
  321. /// <param name="keyValue"></param>
  322. /// <returns></returns>
  323. [HttpPost]
  324. [HandlerAjaxOnly]
  325. public ActionResult ApproveWHLotInspection(string keyValue, string ICSInspections)
  326. {
  327. string msg = App.ApproveWHLotInspection(keyValue, ICSInspections);
  328. if (!string.IsNullOrEmpty(msg))
  329. {
  330. return Error(msg);
  331. }
  332. else
  333. {
  334. return Success("审核成功!");
  335. }
  336. }
  337. /// <summary>
  338. /// 在库检验复审
  339. /// </summary>
  340. /// <param name="keyValue"></param>
  341. /// <returns></returns>
  342. [HttpPost]
  343. [HandlerAjaxOnly]
  344. public ActionResult SecApproveWHLotInspection(string keyValue, string ICSInspections)
  345. {
  346. try
  347. {
  348. string msg = App.SecApproveWHLotInspection(keyValue, ICSInspections);
  349. if (!string.IsNullOrEmpty(msg))
  350. {
  351. return Error(msg);
  352. }
  353. else
  354. {
  355. return Success("审核成功!");
  356. }
  357. }
  358. catch (Exception ex)
  359. {
  360. return Error(ex.Message);
  361. }
  362. }
  363. //生成拒收单
  364. [HttpPost]
  365. [HandlerAjaxOnly]
  366. [ValidateAntiForgeryToken]
  367. public ActionResult CreateRejection(string keyValue, string Type)
  368. {
  369. try
  370. {
  371. string msg = "";
  372. if (Type == "1")
  373. {
  374. msg = App.CreateRejection(keyValue);
  375. }
  376. else if (Type == "8")
  377. {
  378. msg = App.CreateWLYRejection(keyValue);
  379. }
  380. else if (Type == "9")
  381. {
  382. msg = App.CreateWWWLYRejection(keyValue);
  383. }
  384. else
  385. {
  386. msg = App.CreateWWRejection(keyValue);
  387. }
  388. if (string.IsNullOrEmpty(msg))
  389. {
  390. return Success("操作成功!");
  391. }
  392. else
  393. {
  394. return Error("" + msg + "");
  395. }
  396. }
  397. catch (Exception ex)
  398. {
  399. return Error(ex.Message);
  400. }
  401. }
  402. //生成拒收单
  403. [HttpPost]
  404. [HandlerAjaxOnly]
  405. [ValidateAntiForgeryToken]
  406. public ActionResult CreateRejectionYL(string keyValue, string Type)
  407. {
  408. string msg = "";
  409. if (Type == "1")
  410. {
  411. msg = App.CreateRejectionYL(keyValue);
  412. }
  413. else if (Type == "8")
  414. {
  415. msg = App.CreateWLYRejection(keyValue);
  416. }
  417. else if (Type == "9")
  418. {
  419. msg = App.CreateWWWLYRejection(keyValue);
  420. }
  421. else
  422. {
  423. msg = App.CreateWWRejection(keyValue);
  424. }
  425. if (string.IsNullOrEmpty(msg))
  426. {
  427. return Success("操作成功!");
  428. }
  429. else
  430. {
  431. return Error("" + msg + "");
  432. }
  433. }
  434. /// <summary>
  435. /// 删除拒收单
  436. /// </summary>
  437. /// <returns></returns>
  438. [HttpPost]
  439. [HandlerAjaxOnly]
  440. [ValidateAntiForgeryToken]
  441. public ActionResult DelectRejection(string keyValue)
  442. {
  443. string msg = App.DelectRejection(keyValue);
  444. if (string.IsNullOrEmpty(msg))
  445. {
  446. return Success("删除成功!");
  447. }
  448. else
  449. {
  450. return Error(msg);
  451. }
  452. }
  453. [HttpPost]
  454. [HandlerAjaxOnly]
  455. [ValidateAntiForgeryToken]
  456. public ActionResult DelectWWRejection(string keyValue)
  457. {
  458. string msg = App.DelectWWRejection(keyValue);
  459. if (string.IsNullOrEmpty(msg))
  460. {
  461. return Success("删除成功!");
  462. }
  463. else
  464. {
  465. return Error(msg);
  466. }
  467. }
  468. [HttpGet]
  469. public ActionResult GetInventoryInspection(Pagination pagination, string InvCode, int SampleQuantity, string ResultINp)
  470. {
  471. DataTable ListData = App.GetInventoryInspection(ref pagination, InvCode, SampleQuantity, ResultINp);
  472. var JsonData = new
  473. {
  474. total = pagination.total,
  475. page = pagination.page,
  476. records = pagination.records,
  477. rows = ListData,
  478. };
  479. return Content(JsonData.ToJson());
  480. }
  481. [HttpPost]
  482. [HandlerAjaxOnly]
  483. public ActionResult SaveICSInspectionDetail(string ICSMTDOC, string InvCode, string ResultINp)
  484. {
  485. string msg = App.SaveICSInspectionDetail(ICSMTDOC, InvCode, ResultINp);
  486. if (!string.IsNullOrEmpty(msg))
  487. {
  488. return Error(msg);
  489. }
  490. else
  491. {
  492. return Success("保存成功!");
  493. }
  494. }
  495. /// <summary>
  496. /// 上传文件(检验信息)
  497. /// </summary>
  498. /// <param name="BidCode"></param>
  499. /// <param name="ID"></param>
  500. /// <returns></returns>
  501. [HttpPost]
  502. public ActionResult UpLoadFileImport(string ID, string DNCode)
  503. {
  504. string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
  505. string UploadfileName = "";
  506. string fileName = "";
  507. //获取上传的文件集合
  508. try
  509. {
  510. HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  511. for (int i = 0; i < httpFile.Count; i++)
  512. {
  513. //获取送货单号
  514. //string STNO = Request.Form["STNO"].ToString();
  515. UploadfileName = Path.GetFileNameWithoutExtension(httpFile[i].FileName)
  516. + Path.GetExtension(httpFile[i].FileName);
  517. fileName = DNCode + Path.GetExtension(httpFile[i].FileName);
  518. string Paths = System.Web.HttpContext.Current.Server.MapPath("~\\File\\InspectionFile\\");
  519. if (!Directory.Exists(Paths))
  520. {
  521. Directory.CreateDirectory(Paths);
  522. }
  523. string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\InspectionFile\\" + UploadfileName);
  524. int iLen = httpFile[0].ContentLength;
  525. byte[] bData = new byte[iLen];
  526. httpFile[0].InputStream.Read(bData, 0, iLen);
  527. FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
  528. fs.Write(bData, 0, bData.Length);
  529. fs.Flush();
  530. fs.Close();
  531. fs.Dispose();
  532. App.InsertICSInspectionFile(ID, UploadfileName, fileName);
  533. }
  534. return Success("上传成功!");
  535. }
  536. catch (Exception ex)
  537. {
  538. return Error(ex.Message);
  539. }
  540. }
  541. //采购到货单检验
  542. [HttpGet]
  543. public ActionResult GetICSInspection8(Pagination pagination, string MenuID, string queryJson)
  544. {
  545. DataTable ListData = App.GetICSInspection8(ref pagination, MenuID, queryJson);
  546. var JsonData = new
  547. {
  548. total = pagination.total,
  549. page = pagination.page,
  550. records = pagination.records,
  551. rows = ListData,
  552. };
  553. return Content(JsonData.ToJson());
  554. }
  555. //委外采购到货单检验
  556. [HttpGet]
  557. public ActionResult GetICSInspection9(Pagination pagination, string MenuID, string queryJson)
  558. {
  559. DataTable ListData = App.GetICSInspection9(ref pagination, MenuID, queryJson);
  560. var JsonData = new
  561. {
  562. total = pagination.total,
  563. page = pagination.page,
  564. records = pagination.records,
  565. rows = ListData,
  566. };
  567. return Content(JsonData.ToJson());
  568. }
  569. //委外采购到货单检验
  570. [HttpGet]
  571. public ActionResult GetICSInspection10(Pagination pagination, string MenuID, string queryJson)
  572. {
  573. DataTable ListData = App.GetICSInspection10(ref pagination, MenuID, queryJson);
  574. var JsonData = new
  575. {
  576. total = pagination.total,
  577. page = pagination.page,
  578. records = pagination.records,
  579. rows = ListData,
  580. };
  581. return Content(JsonData.ToJson());
  582. }
  583. //比博联副产品检验
  584. [HttpGet]
  585. public ActionResult GetICSInspection101(Pagination pagination, string MenuID, string queryJson)
  586. {
  587. DataTable ListData = App.GetICSInspection101(ref pagination, MenuID, queryJson);
  588. var JsonData = new
  589. {
  590. total = pagination.total,
  591. page = pagination.page,
  592. records = pagination.records,
  593. rows = ListData,
  594. };
  595. return Content(JsonData.ToJson());
  596. }
  597. //在库检验
  598. [HttpGet]
  599. public ActionResult GetICSInspection11(Pagination pagination, string MenuID, string queryJson)
  600. {
  601. try
  602. {
  603. DataTable ListData = App.GetICSInspection11(ref pagination, MenuID, queryJson);
  604. var JsonData = new
  605. {
  606. total = pagination.total,
  607. page = pagination.page,
  608. records = pagination.records,
  609. rows = ListData,
  610. };
  611. return Content(JsonData.ToJson());
  612. }
  613. catch (Exception ex)
  614. {
  615. return Error(ex.Message);
  616. }
  617. }
  618. //采购入库单检验
  619. [HttpGet]
  620. public ActionResult GetICSInspection22(Pagination pagination, string MenuID, string queryJson)
  621. {
  622. DataTable ListData = App.GetICSInspection22(ref pagination, MenuID, queryJson);
  623. var JsonData = new
  624. {
  625. total = pagination.total,
  626. page = pagination.page,
  627. records = pagination.records,
  628. rows = ListData,
  629. };
  630. return Content(JsonData.ToJson());
  631. }
  632. //委外入库单检验
  633. [HttpGet]
  634. public ActionResult GetICSInspection23(Pagination pagination, string MenuID, string queryJson)
  635. {
  636. DataTable ListData = App.GetICSInspection23(ref pagination, MenuID, queryJson);
  637. var JsonData = new
  638. {
  639. total = pagination.total,
  640. page = pagination.page,
  641. records = pagination.records,
  642. rows = ListData,
  643. };
  644. return Content(JsonData.ToJson());
  645. }
  646. [HttpGet]
  647. public ActionResult GetInventoryInspectionNew(Pagination pagination, string InvCode, int? SampleQuantity, string ResultINp, string JYID, string LotNo)
  648. {
  649. DataTable ListData = App.GetInventoryInspectionNew(ref pagination, InvCode, SampleQuantity, ResultINp, JYID, LotNo);
  650. var JsonData = new
  651. {
  652. total = pagination.total,
  653. page = pagination.page,
  654. records = pagination.records,
  655. rows = ListData,
  656. };
  657. return Content(JsonData.ToJson());
  658. }
  659. [HttpGet]
  660. [HandlerAjaxOnly]
  661. public ActionResult GetRulesDetail(string LotNo)
  662. {
  663. DataTable ListData = App.GetRulesDetail(LotNo);
  664. var JsonData = new
  665. {
  666. rows = ListData,
  667. };
  668. return Content(JsonData.ToJson());
  669. }
  670. [HttpPost]
  671. [HandlerAjaxOnly]
  672. [ValidateInput(false)]
  673. public ActionResult SaveICSInspectionDetailNew(string InvCode, string JYID, string AllNumber, string YLOTQTY, string NLOTQTY, string WaiveQuantity, string BCCode, string BRCode, string ResultINp, string Lot, string Type, decimal CJQty, string ICSMTDOC)
  674. {
  675. string msg = App.SaveICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, BCCode, BRCode, ResultINp, Lot, Type, CJQty);
  676. if (!string.IsNullOrEmpty(msg))
  677. {
  678. return Error(msg);
  679. }
  680. else
  681. {
  682. return Success("保存成功!");
  683. }
  684. }
  685. [HttpPost]
  686. [HandlerAjaxOnly]
  687. [ValidateInput(false)]
  688. public ActionResult StagingICSInspectionDetailNew(string InvCode, string JYID, string AllNumber, string YLOTQTY, string NLOTQTY, string WaiveQuantity, string BCCode, string BRCode, string ResultINp, string Lot, string Type, decimal CJQty, string ICSMTDOC)
  689. {
  690. string msg = App.StagingICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, BCCode, BRCode, ResultINp, Lot, Type, CJQty);
  691. if (!string.IsNullOrEmpty(msg))
  692. {
  693. return Error(msg);
  694. }
  695. else
  696. {
  697. return Success("操作成功!");
  698. }
  699. }
  700. [HttpPost]
  701. [HandlerAjaxOnly]
  702. public ActionResult UpdateICSInspectionDetailNew(string ICSMTDOC, string JYID, string ResultINp)
  703. {
  704. string msg = App.UpdateICSInspectionDetailNew(ICSMTDOC, JYID, ResultINp);
  705. if (!string.IsNullOrEmpty(msg))
  706. {
  707. return Error(msg);
  708. }
  709. else
  710. {
  711. return Success("保存成功!");
  712. }
  713. }
  714. /// <summary>
  715. /// 获取动态列
  716. /// </summary>
  717. /// <param name="BidCode"></param>
  718. /// <returns></returns>
  719. public ActionResult SelectSORRFQColumnName(string InvCode, string JYID, string LotNo)
  720. {
  721. var data = App.SelectSORRFQColumnName(InvCode, JYID, LotNo);
  722. return Content(data.ToJson());
  723. }
  724. [HttpGet]
  725. [HandlerAjaxOnly]
  726. public ActionResult GetDeleteRulesDetail(string InvCode, string JYID)
  727. {
  728. DataTable ListData = App.GetDeleteRulesDetail(InvCode, JYID);
  729. var JsonData = new
  730. {
  731. rows = ListData,
  732. };
  733. return Content(JsonData.ToJson());
  734. }
  735. [HttpPost]
  736. public ActionResult DeleteICSInspection(string DetailID)
  737. {
  738. DetailID = DetailID.Substring(1, DetailID.Length - 2);
  739. string msg = App.DeleteICSInspection(DetailID);
  740. if (string.IsNullOrWhiteSpace(msg))
  741. {
  742. return Success("删除成功!");
  743. }
  744. else
  745. {
  746. return Error("删除失败");
  747. }
  748. }
  749. /// <summary>
  750. /// 数据导入
  751. /// </summary>
  752. /// <returns></returns>
  753. [HttpPost]
  754. public string UploadFile(string LotNo)
  755. {
  756. try
  757. {
  758. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  759. if (hpFiles != null && hpFiles.Count > 0)
  760. {
  761. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  762. if (IsXls != ".xls" && IsXls != ".xlsx")
  763. {
  764. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  765. }
  766. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
  767. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  768. int iLen = hpFiles[0].ContentLength;
  769. if (Directory.Exists(savePath)) return "文件已存在";
  770. byte[] bData = new byte[iLen];
  771. hpFiles[0].InputStream.Read(bData, 0, iLen);
  772. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  773. newFile.Write(bData, 0, bData.Length);
  774. newFile.Flush();
  775. int _FileSizeTemp = hpFiles[0].ContentLength;
  776. newFile.Close();
  777. newFile.Dispose();
  778. //bool del = false;
  779. string mess = "";
  780. mess = App.SetData_PR(savePath, LotNo);
  781. if (System.IO.File.Exists(savePath))//删除文件
  782. {
  783. System.IO.File.Delete(savePath);
  784. }
  785. return mess;
  786. }
  787. else
  788. {
  789. return "获取文件失败";
  790. }
  791. }
  792. catch (Exception ex)
  793. {
  794. return ex.ToString();
  795. }
  796. }
  797. /// <summary>
  798. /// 红字销售出库单检验
  799. /// </summary>
  800. /// <param name="pagination"></param>
  801. /// <param name="MenuID"></param>
  802. /// <param name="queryJson"></param>
  803. /// <returns></returns>
  804. [HttpGet]
  805. public ActionResult GetICSSSDInspection(Pagination pagination, string MenuID, string queryJson)
  806. {
  807. DataTable ListData = App.GetICSSSDInspection(ref pagination, MenuID, queryJson);
  808. var JsonData = new
  809. {
  810. total = pagination.total,
  811. page = pagination.page,
  812. records = pagination.records,
  813. rows = ListData,
  814. };
  815. return Content(JsonData.ToJson());
  816. }
  817. /// <summary>
  818. /// 更新交期(咖博士使用)
  819. /// </summary>
  820. /// <param name="ICSMTDOC"></param>
  821. /// <param name="JYID"></param>
  822. /// <param name="ResultINp"></param>
  823. /// <returns></returns>
  824. [HttpPost]
  825. [HandlerAjaxOnly]
  826. public ActionResult UpdateLeadTime(string LeadModel)
  827. {
  828. string msg = App.UpdateLeadTime(LeadModel);
  829. if (!string.IsNullOrEmpty(msg))
  830. {
  831. return Error(msg);
  832. }
  833. else
  834. {
  835. return Success("更新成功!");
  836. }
  837. }
  838. /// <summary>
  839. /// 填写快递单号(东辉使用)
  840. /// </summary>
  841. /// <param name="LeadModel"></param>
  842. /// <returns></returns>
  843. [HttpPost]
  844. [HandlerAjaxOnly]
  845. public ActionResult UpdateTrackCode(string LeadModel)
  846. {
  847. string msg = App.UpdateTrackCode(LeadModel);
  848. if (!string.IsNullOrEmpty(msg))
  849. {
  850. return Error(msg);
  851. }
  852. else
  853. {
  854. return Success("保存成功!");
  855. }
  856. }
  857. /// <summary>
  858. /// 海格工单子线保存检验结果
  859. /// </summary>
  860. /// <param name="keyValue"></param>
  861. /// <param name="ICSInspections"></param>
  862. /// <returns></returns>
  863. public string CreateICSInspectionHG1(string keyValue, string ICSInspections)
  864. {
  865. string msg = "";
  866. try
  867. {
  868. string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
  869. string MUSERNAME = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
  870. string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
  871. string date = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
  872. keyValue = keyValue.TrimEnd(',');
  873. //获取需要检验的工单编码
  874. string moCode = $"SELECT DISTINCT MOCode FROM ICSMOSubInventoryLot WHERE ID in ({keyValue});";
  875. DataTable modt = SqlHelper.CmdExecuteDataTable(moCode);
  876. string sql = string.Empty;
  877. JArray res = (JArray)JsonConvert.DeserializeObject(ICSInspections);
  878. foreach (var item in res)
  879. {
  880. object CARID = Guid.NewGuid();
  881. JObject jo = (JObject)item;
  882. Dictionary<string, string> values = new Dictionary<string, string>();
  883. foreach (JProperty prop in jo.Properties())
  884. {
  885. string key = prop.Name; // 获取键名
  886. JToken value = prop.Value; // 获取值(JToken类型)
  887. string stringValue = value?.Type == JTokenType.Null ? string.Empty : value.ToString();
  888. if (key != "JYID")
  889. {
  890. values.Add(key, "'" + stringValue + "'");
  891. }
  892. }
  893. values.Add("ID", "'" + CARID + "'");
  894. values.Add("MTIME", "'" + DateTime.Now.ToString() + "'");
  895. values.Add("MUSER", "'" + MUSER + "'");
  896. values.Add("MUSERName", "'" + MUSERNAME + "'");
  897. values.Add("WorkPoint", "'" + WorkPoint + "'");
  898. values.Add("Enable", "'1'");
  899. string sqls = string.Empty;
  900. if (!string.IsNullOrWhiteSpace(jo["JYID"].ToString()))
  901. {
  902. sqls += @"IF EXISTS( select a.ID from ICSInspection a
  903. INNER JOIN ICSMOSubInventoryLot c ON a.LotNo=c.LotNo AND a.WorkPoint=c.WorkPoint
  904. INNER JOIN ICSInventoryLotDetail b ON c.MOCode = b.TransCode AND c.WorkPoint = b.WorkPoint
  905. where a.Enable = '1' AND a.Id = '{3}' AND QualifiedQuantity>'{4}')
  906. BEGIN
  907. RAISERROR('', 16, 1);
  908. RETURN
  909. END;" +
  910. " update ICSInspectionDetailGroup set InspectionID='{2}' WHERE InspectionID='{3}' and WorkPoint='{1}' ";
  911. }
  912. sqls += @"update ICSInspection set Enable='0' WHERE LotNO='{0}' and Enable='1' and WorkPoint='{1}'";
  913. sqls = string.Format(sqls, jo["LotNo"].ToString(), WorkPoint, CARID, jo["JYID"].ToString(), jo["QualifiedQuantity"].ToString());
  914. SqlHelper.CmdExecuteNonQueryLi(sqls);
  915. sql += SqlHelper.InsertSQL("ICSInspection", values);
  916. }
  917. //}
  918. string lotid = string.Empty;
  919. SqlHelper.ExecuteWithTrans((dbConn, trans) =>
  920. {
  921. if (SqlHelper.ExecuteNonQuery(dbConn, trans, sql) == 0)
  922. throw new Exception("新增失败");
  923. string lotsql = string.Empty;
  924. for (int i = 0; i < modt.Rows.Count; i++)
  925. {
  926. //查询工单子件是否检验完成,检验完成根据最小检验数量生成条码
  927. var checksql = $@"DECLARE @count1 int ,@count2 int ,@count3 int ;
  928. set @count1=(SELECT Isnull(EATTRIBUTE6,0) as SubCount FROM ICSInventory WHERE InvCode=( SELECT InvCode FROM ICSMO WHERE MOCode='{modt.Rows[i]["MOCOde"]}' AND Workpoint='{WorkPoint}'
  929. ) AND WorkPoint='{WorkPoint}');
  930. set @count2=(SELECT Count(1) Quantity FROM ICSInspection WHERE Enable='1' AND EATTRIBUTE3='{modt.Rows[i]["MOCOde"]}' AND WorkPoint='{WorkPoint}');
  931. set @count3=(SELECT sum(b.Quantity) QualifiedQuantity FROM ICSInventoryLotDetail a
  932. INNER JOIN ICSInventoryLot b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
  933. WHERE a.TransCode='{modt.Rows[i]["MOCOde"]}' AND a.WorkPoint='{WorkPoint}' GROUP BY a.TransCode,a.WorkPoint );
  934. IF (@count1=@count2)
  935. BEGIN
  936. SELECT top 1 *,case when ISnull(@count3,0)>0 and QualifiedQuantity-ISnull(@count3,0)>0 THEN QualifiedQuantity-ISnull(@count3,0) when ISnull(@count3,0)=0 then QualifiedQuantity ELSE 0 end as Quantity1 FROM ICSInspection WHERE Enable='1' AND EATTRIBUTE3='{modt.Rows[i]["MOCOde"]}' AND WorkPoint='{WorkPoint}' ORDER BY QualifiedQuantity asc
  937. end ";
  938. var checkdt = SqlHelper.CmdExecuteDataTable(dbConn, trans, checksql);
  939. if (checkdt.Rows.Count > 0)
  940. {
  941. if (checkdt.Rows[0]["Quantity1"].ToInt() > 0)
  942. {
  943. //获取id
  944. string id = GetNewid(dbConn, trans);
  945. //生成条码打印
  946. var lotNo = GetSerialCode(dbConn, trans, WorkPoint, "ICSInventoryLot", "LotNO", $"CP{modt.Rows[i]["MOCOde"]}0001", 4);
  947. lotsql += $@"Insert into ICSInventoryLotDetail(LotNo, TransCode,TransSequence,MUSER,MUSERName,MTIME,WorkPoint,TransID)
  948. select '{lotNo}',MOCOde,'1','{MUSER}','{MUSERNAME}','{date}','{WorkPoint}',ID
  949. from ICSMO where MOCode='{modt.Rows[i]["MOCOde"]}' and Sequence='1' and WorkPoint='{WorkPoint}'
  950. insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount)
  951. select
  952. '{id}','{lotNo}',InvCode,'{date}','2999-12-31','{checkdt.Rows[0]["Quantity1"]}',ExtensionID,'3','{MUSER}','{MUSERNAME}', '{date}','{WorkPoint}','0'
  953. from ICSMO where MOCode='{modt.Rows[i]["MOCOde"]}' and Sequence='1' and WorkPoint='{WorkPoint}' ";
  954. //if (SqlHelper.ExecuteNonQuery(dbConn, trans, lotsql) == 0)
  955. // throw new Exception("新增失败");
  956. //打印条码
  957. lotid += $"'{id}',";
  958. }
  959. }
  960. }
  961. if (!string.IsNullOrWhiteSpace(lotsql))
  962. {
  963. if (SqlHelper.ExecuteNonQuery(dbConn, trans, lotsql) == 0)
  964. throw new Exception("新增失败");
  965. }
  966. }, ex =>
  967. {
  968. msg = $"新增失败:{ex.Message}";
  969. });
  970. if (!string.IsNullOrWhiteSpace(lotid))
  971. {
  972. //打印条码
  973. lotid = "\"" + lotid + "|\"";
  974. PrintItemLot("{\"Sys_LablesID\":\"D2005CFB-BFC0-4393-BB10-DC864371CEF7\"}", lotid);
  975. }
  976. }
  977. catch (Exception ex)
  978. {
  979. msg = ex.Message;
  980. }
  981. return msg;
  982. }
  983. public ActionResult PrintItemLot(string keyValue, string Parameter)
  984. {
  985. string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
  986. string WorkPoint = "'" + NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(',') + "'";
  987. string sqltxt = "";
  988. Parameter = Parameter.Substring(1, Parameter.Length - 4);
  989. var queryParam = keyValue.ToJObject();
  990. List<DbParameter> parameter = new List<DbParameter>();
  991. var Sys_LablesID = queryParam["Sys_LablesID"].ToString();
  992. List<PrintPara> parasList = new List<PrintPara>();
  993. keyValue = keyValue.Substring(1, keyValue.Length - 2);
  994. string sqlValue = @"select LableSourceID,FileAddress,LableCode,LableName from Sys_Lables where ID='{0}'";
  995. sqlValue = string.Format(sqlValue, Sys_LablesID);
  996. DataRow drV = SqlHelper.GetDataRowBySql(sqlValue);
  997. string LableSourceID = drV["LableSourceID"].ToString();
  998. string FileAddress = drV["FileAddress"].ToString();
  999. string LableCode = drV["LableCode"].ToString();
  1000. string LableName = drV["LableName"].ToString();
  1001. string sqlLableDataSource = @"SELECT ID,WorkPointCode,OtherDataBaseID,WorkPointDataFlag,
  1002. SysDataFlag,SqlTxt,SourceName,FormatSqlTxt,Paras,DbParas,LinkCols,CreateUserID,
  1003. CreateDate,ModifyUserID,ModifyDate,Link2Cols FROM dbo.Sys_LableDataSource
  1004. where ID='{0}'";
  1005. sqlLableDataSource = string.Format(sqlLableDataSource, LableSourceID);
  1006. DataRow dr = SqlHelper.GetDataRowBySql(sqlLableDataSource);
  1007. #region 打印
  1008. #endregion
  1009. var PrintValue = Parameter.Split('|');
  1010. string[] ValueParameters = PrintValue[0].Split(',');
  1011. string[] PrintParas = Parameter.Split('|');
  1012. string LinkCols = string.Empty;
  1013. sqltxt = dr["SqlTxt"].ToString();
  1014. LinkCols = dr["LinkCols"].ToString();
  1015. string SourceName = dr["SourceName"].ToString();
  1016. string Paras = dr["Paras"].ToString();
  1017. if (dr["Paras"].ToString() != "")
  1018. {
  1019. string[] ps = dr["Paras"].ToString().Split(',');
  1020. for (int i = 0; i < ps.Length; i++)
  1021. {
  1022. if (!string.IsNullOrEmpty(ps[i]))
  1023. {
  1024. sqltxt = sqltxt.Replace(ps[i], PrintParas[i]);
  1025. }
  1026. }
  1027. }
  1028. if (sqltxt.Contains("[WorkPoint]"))
  1029. {
  1030. sqltxt = sqltxt.Replace("[WorkPoint]", WorkPoint);
  1031. }
  1032. string strPrintFileName = Server.MapPath("/File/LablesFile/") + "" + FileAddress + "";
  1033. PrintJson pJson = new PrintJson(Server.MapPath("./PrintTemp"), strPrintFileName);
  1034. pJson.CheckRegister("苏州智合诚信息科技有限公司", "56DD3B4C172D0D140841CAC98A58A819F4E28EDA5D6E45711DDD64F6A439F68B6A7870CD7DAFD69A919CB870207FE4BB206F92BE3D53C221B019E0797E739EBA4"); //注册信息
  1035. if (LinkCols != "")
  1036. {
  1037. pJson.MasterOptions(1, "" + LinkCols + "", false); //主从关系
  1038. }
  1039. //pJson.CheckRegister("注册姓名", "8ECCCD6A1302DFEE1A6456A5D"); //注册信息
  1040. //pJson.AddPrintParam("ShopName", "测试酒楼");
  1041. //pJson.AddPrintParam("PrintDepositAdd", "说明:本单据为贵客押金收取凭证,盖章有效。退房时请出示,遗失者自负,请妥善保存。退房时间为12:00时,延时退房18:00时以前按半天房费收取,18:00时以后算全天房价。押金单有效期为一个月,过期作废。 贵重物品请交前台寄存,未寄存丢失自负。 谢谢!");
  1042. SetCookieAndURL(pJson);// 设置控件调用的Cookie值,判断是否安装了打印控件
  1043. string strSql = sqltxt;
  1044. //DataTable dtCashLog = DbHelper.ExecuteTable(DbHelper.ConnectionString, CommandType.Text, strSql, true, null);
  1045. DataSet dtCashLog = SqlHelper.GetDataSetBySql(strSql);
  1046. DataTable dt1 = null;
  1047. DataTable dt2 = null;
  1048. DataTable dt3 = null;
  1049. string strPrintTempFile = "";
  1050. if (dtCashLog.Tables.Count > 0 && dtCashLog.Tables.Count <= 1)
  1051. {
  1052. dt1 = dtCashLog.Tables[0];
  1053. strPrintTempFile = pJson.ShowReport(dt1);
  1054. }
  1055. if (dtCashLog.Tables.Count > 1 && dtCashLog.Tables.Count <= 2)
  1056. {
  1057. dt1 = dtCashLog.Tables[0];
  1058. dt2 = dtCashLog.Tables[1];
  1059. strPrintTempFile = pJson.ShowReport(dt1, dt2);
  1060. }
  1061. if (dtCashLog.Tables.Count > 2)
  1062. {
  1063. dt1 = dtCashLog.Tables[0];
  1064. dt2 = dtCashLog.Tables[1];
  1065. dt3 = dtCashLog.Tables[2];
  1066. strPrintTempFile = pJson.ShowReport(dt1, dt2, dt3);
  1067. }
  1068. //string strPrintTempFile = pJson.ShowReport(dt1, dt2); //产生JSON文件内容
  1069. //把服务器的URL + 此文件名 传递给控件,由控件下载还原数据进行打印
  1070. string strServerURL = GetUrlPath() + "PrintTemp/";
  1071. string strData = strServerURL + strPrintTempFile;
  1072. strPrintData = PrintFunction.EnBase64(strData);
  1073. var JsonData = new
  1074. {
  1075. strPrintData_1 = strPrintData,
  1076. bIsInstallPrintControl_1 = bIsInstallPrintControl,
  1077. strPrintControlCookie_1 = strPrintControlCookie
  1078. };
  1079. string sql = string.Empty;
  1080. for (int i = 0; i < ValueParameters.Length; i++)
  1081. {
  1082. // 打印记录
  1083. sql += @"insert into Sys_LableTask (ID, LableCode, LableName, PrintTableID, PrintTableName, PrintKey, ValueParameters, PrintDate, PrintUserCode, WorkPoint)
  1084. values(newid(),'{0}','{1}','{2}','{3}','{4}',{5},getdate(),'{6}',{7})";
  1085. sql = string.Format(sql, LableCode, LableName, LableSourceID, SourceName, Paras, ValueParameters[i].ToString(), MUSER, WorkPoint);
  1086. }
  1087. SqlHelper.ExecuteNonQuery(sql);
  1088. //多站点
  1089. //string sql = @"UPDATE dbo.ICSInventoryLot
  1090. // SET PrintTimes=ISNULL(PrintTimes,0)+1,
  1091. // LastPrintUser='',
  1092. // LastPrintTime=GETDATE()
  1093. // WHERE ID IN (" + keyValue.TrimEnd(',') + ") and WorkPoint in ('" + WorkPoint.TrimEnd(',') + "')";
  1094. //SqlHelper.ExecuteNonQuery(sql);
  1095. return Content(JsonData.ToJson());
  1096. }
  1097. /// <summary>
  1098. /// 设置控件调用的Cookie值,判断是否安装了打印控件....
  1099. /// </summary>
  1100. /// <param name="pJson"></param>
  1101. private void SetCookieAndURL(PrintJson pJson)
  1102. {
  1103. bIsInstallPrintControl = false;
  1104. strPrintControlCookie = "";
  1105. HttpCookie pCookieInstall = Request.Cookies["InstallPrintControl"];
  1106. if (pCookieInstall != null)
  1107. { //Cookie存在
  1108. strPrintControlCookie = pCookieInstall.Value.ToString();
  1109. //以Cookie值查找在数据表中是否存在
  1110. string strSql = @"Select * From sys_SRM_CheckInstall Where Cookie = @Cookie";
  1111. SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strPrintControlCookie) };
  1112. using (SqlDataReader drCookie = DbHelper.ExecuteReader(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie))
  1113. {
  1114. if (drCookie.Read())
  1115. { //标识为已经安装
  1116. bIsInstallPrintControl = true;
  1117. }
  1118. drCookie.Close();
  1119. }
  1120. //更新Cookie的保存时间
  1121. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  1122. Response.SetCookie(pCookieInstall);
  1123. }
  1124. else
  1125. {//Cookie不存在,则新建Cookie
  1126. strPrintControlCookie = System.Guid.NewGuid().ToString();
  1127. pCookieInstall = new HttpCookie("InstallPrintControl", strPrintControlCookie);
  1128. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  1129. Response.Cookies.Add(pCookieInstall);
  1130. }
  1131. string strUrl = Server.MapPath("/PrintTemp/") + "IsCheckInstall";
  1132. pJson.SetCookieAndURL(strPrintControlCookie, strUrl);
  1133. }
  1134. //导出
  1135. [HttpPost]
  1136. public void ExportAll(string POCode, string VenCode, string VenName, string InvCode, string InvName, string InvStd, string BatchCode, string ReleaseState, string selEnableShow, string LotNO, string DocType, string Surveyor)
  1137. {
  1138. try
  1139. {
  1140. DataTable dt = App.GetInspectionExport(POCode, VenCode, VenName, InvCode, InvName, InvStd, BatchCode, ReleaseState, selEnableShow, LotNO, DocType, Surveyor);
  1141. AsposeCell.Export(dt);
  1142. }
  1143. catch (Exception ex)
  1144. {
  1145. throw new Exception(ex.Message);
  1146. }
  1147. }
  1148. [HttpPost]
  1149. public void ExportAll25(string POCode, string VenCode, string VenName, string InvCode, string InvName, string InvStd, string BatchCode, string ReleaseState, string selEnableShow, string LotNO, string DocType, string Surveyor, string selIsWH, string FromTime, string ToTime)
  1150. {
  1151. try
  1152. {
  1153. DataTable dt = App.GetInspectionExport25(POCode, VenCode, VenName, InvCode, InvName, InvStd, BatchCode, ReleaseState, selEnableShow, LotNO, DocType, Surveyor, selIsWH, FromTime, ToTime);
  1154. AsposeCell.Export(dt);
  1155. }
  1156. catch (Exception ex)
  1157. {
  1158. throw new Exception(ex.Message);
  1159. }
  1160. }
  1161. public string GetSerialCode(SqlConnection sqlConn, SqlTransaction sqlTrans, string workPointCode, string tbName, string colName, string Pre, int numLen)
  1162. {
  1163. string sql = "EXEC Addins_GetSerialCode '{0}','{1}','{2}','{3}',{4}";
  1164. sql = string.Format(sql, new object[] { workPointCode, tbName, colName, Pre, numLen });
  1165. //return Repository().FindTableBySql(sql.ToString());
  1166. return SqlHelper.ExecuteScalar(sqlConn, sqlTrans, sql).ToString();
  1167. //return DbHelper.ExecuteScalar(CommandType.Text, sql).ToString();
  1168. }
  1169. public string GetNewid(SqlConnection sqlConn, SqlTransaction sqlTrans)
  1170. {
  1171. string sql = "select newid() AS ID";
  1172. return SqlHelper.CmdExecuteDataTable(sqlConn, sqlTrans, sql).Rows[0]["ID"].ToString();
  1173. }
  1174. }
  1175. }