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.

792 lines
27 KiB

3 weeks ago
  1. using NFine.Application.DHAY;
  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. namespace NFine.Web.Areas.DHAY.Controllers
  16. {
  17. public class ICSRCVIQCsController : ControllerBase
  18. {
  19. ICSRCVIQCsApp App = new ICSRCVIQCsApp();
  20. // GET: WMS/ICSRCVIQCs
  21. public ActionResult ICSRCVIQCs()
  22. {
  23. return View();
  24. }
  25. public ActionResult Rejection()
  26. {
  27. return View();
  28. }
  29. public ActionResult WWRejection()
  30. {
  31. return View();
  32. }
  33. public ActionResult ICSInspectionDetail()
  34. {
  35. return View();
  36. }
  37. public ActionResult ICSLookFiles()
  38. {
  39. return View();
  40. }
  41. public ActionResult ICSInspectionDetailNew()
  42. {
  43. return View();
  44. }
  45. public ActionResult ICSInspectionDetailDelete()
  46. {
  47. return View();
  48. }
  49. public ActionResult UpdateLeadTime()
  50. {
  51. return View();
  52. }
  53. public ActionResult YLICSRCVIQCs()
  54. {
  55. return View();
  56. }
  57. public ActionResult GetBadReasonCode()
  58. {
  59. return View();
  60. }
  61. //采购
  62. [HttpGet]
  63. public ActionResult GetICSInspection(Pagination pagination, string MenuID, string queryJson)
  64. {
  65. DataTable ListData = App.GetICSInspection(ref pagination, MenuID, queryJson);
  66. var JsonData = new
  67. {
  68. total = pagination.total,
  69. page = pagination.page,
  70. records = pagination.records,
  71. rows = ListData,
  72. };
  73. return Content(JsonData.ToJson());
  74. }
  75. [HttpGet]
  76. public ActionResult GetInspectionFile(Pagination pagination, string JYID, string queryJson)
  77. {
  78. DataTable ListData = App.GetInspectionFile(ref pagination, queryJson, JYID);
  79. var JsonData = new
  80. {
  81. total = pagination.total,
  82. page = pagination.page,
  83. records = pagination.records,
  84. rows = ListData,
  85. };
  86. return Content(JsonData.ToJson());
  87. }
  88. //委外
  89. [HttpGet]
  90. public ActionResult GetICSInspection2(Pagination pagination, string MenuID, string queryJson)
  91. {
  92. DataTable ListData = App.GetICSInspection2(ref pagination, MenuID, queryJson);
  93. var JsonData = new
  94. {
  95. total = pagination.total,
  96. page = pagination.page,
  97. records = pagination.records,
  98. rows = ListData,
  99. };
  100. return Content(JsonData.ToJson());
  101. }
  102. //工单
  103. [HttpGet]
  104. public ActionResult GetICSInspection3(Pagination pagination, string MenuID, string queryJson)
  105. {
  106. DataTable ListData = App.GetICSInspection3(ref pagination, MenuID, queryJson);
  107. var JsonData = new
  108. {
  109. total = pagination.total,
  110. page = pagination.page,
  111. records = pagination.records,
  112. rows = ListData,
  113. };
  114. return Content(JsonData.ToJson());
  115. }
  116. //其他入库
  117. [HttpGet]
  118. public ActionResult GetICSInspection4(Pagination pagination, string MenuID, string queryJson)
  119. {
  120. DataTable ListData = App.GetICSInspection4(ref pagination, MenuID, queryJson);
  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 GetICSInspection5(Pagination pagination, string MenuID, string queryJson)
  133. {
  134. DataTable ListData = App.GetICSInspection5(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 GetICSInspection6(Pagination pagination, string MenuID, string queryJson)
  147. {
  148. DataTable ListData = App.GetICSInspection6(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 GetICSInspection7(Pagination pagination, string MenuID, string queryJson)
  161. {
  162. DataTable ListData = App.GetICSInspection7(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 Select_ICSBadReason(string InvCode)
  175. {
  176. var data = App.Select_ICSBadReason(InvCode);
  177. return Content(data.ToJson());
  178. }
  179. [HttpGet]
  180. [HandlerAjaxOnly]
  181. public ActionResult GetBadReason(string InvCode,Pagination pagination, string queryJson)
  182. {
  183. DataTable ListData = App.GetBadReason(InvCode,queryJson, ref pagination);
  184. var JsonData = new
  185. {
  186. total = pagination.total,
  187. page = pagination.page,
  188. records = pagination.records,
  189. rows = ListData,
  190. };
  191. return Content(JsonData.ToJson());
  192. }
  193. //不良代码
  194. [HttpGet]
  195. public ActionResult GetSelectICSBadCode(string InvCode)
  196. {
  197. var data = App.GetSelectICSBadCode(InvCode);
  198. return Content(data.ToJson());
  199. }
  200. /// <summary>
  201. /// 创建检验表
  202. /// </summary>
  203. /// <param name="keyValue"></param>
  204. /// <returns></returns>
  205. [HttpPost]
  206. [HandlerAjaxOnly]
  207. public ActionResult CreateICSInspection(string keyValue, string ICSInspections)
  208. {
  209. string msg = App.CreateICSInspection(keyValue, ICSInspections);
  210. if (!string.IsNullOrEmpty(msg))
  211. {
  212. return Error(msg);
  213. }
  214. else
  215. {
  216. return Success("添加成功!");
  217. }
  218. }
  219. /// <summary>
  220. /// 在库检验保存检验结果
  221. /// </summary>
  222. /// <param name="keyValue"></param>
  223. /// <returns></returns>
  224. [HttpPost]
  225. [HandlerAjaxOnly]
  226. public ActionResult ICSWHLotInspection(string keyValue, string ICSInspections)
  227. {
  228. string msg = App.ICSWHLotInspection(keyValue, ICSInspections);
  229. if (!string.IsNullOrEmpty(msg))
  230. {
  231. return Error(msg);
  232. }
  233. else
  234. {
  235. return Success("检验结果保存成功!");
  236. }
  237. }
  238. /// <summary>
  239. /// 在库检验审核
  240. /// </summary>
  241. /// <param name="keyValue"></param>
  242. /// <returns></returns>
  243. [HttpPost]
  244. [HandlerAjaxOnly]
  245. public ActionResult ApproveWHLotInspection(string keyValue, string ICSInspections)
  246. {
  247. string msg = App.ApproveWHLotInspection(keyValue, ICSInspections);
  248. if (!string.IsNullOrEmpty(msg))
  249. {
  250. return Error(msg);
  251. }
  252. else
  253. {
  254. return Success("审核成功!");
  255. }
  256. }
  257. /// <summary>
  258. /// 在库检验复审
  259. /// </summary>
  260. /// <param name="keyValue"></param>
  261. /// <returns></returns>
  262. [HttpPost]
  263. [HandlerAjaxOnly]
  264. public ActionResult SecApproveWHLotInspection(string keyValue, string ICSInspections)
  265. {
  266. try
  267. {
  268. string msg = App.SecApproveWHLotInspection(keyValue, ICSInspections);
  269. if (!string.IsNullOrEmpty(msg))
  270. {
  271. return Error(msg);
  272. }
  273. else
  274. {
  275. return Success("审核成功!");
  276. }
  277. }
  278. catch (Exception ex)
  279. {
  280. return Error(ex.Message);
  281. }
  282. }
  283. //生成拒收单
  284. [HttpPost]
  285. [HandlerAjaxOnly]
  286. [ValidateAntiForgeryToken]
  287. public ActionResult CreateRejection(string keyValue, string Type)
  288. {
  289. string msg = "";
  290. if (Type == "1")
  291. {
  292. msg = App.CreateRejection(keyValue);
  293. }
  294. else if (Type == "8")
  295. {
  296. msg = App.CreateWLYRejection(keyValue);
  297. }
  298. else if (Type == "9")
  299. {
  300. msg = App.CreateWWWLYRejection(keyValue);
  301. }
  302. else
  303. {
  304. msg = App.CreateWWRejection(keyValue);
  305. }
  306. if (string.IsNullOrEmpty(msg))
  307. {
  308. return Success("操作成功!");
  309. }
  310. else
  311. {
  312. return Error("" + msg + "");
  313. }
  314. }
  315. /// <summary>
  316. /// 删除拒收单
  317. /// </summary>
  318. /// <returns></returns>
  319. [HttpPost]
  320. [HandlerAjaxOnly]
  321. [ValidateAntiForgeryToken]
  322. public ActionResult DelectRejection(string keyValue)
  323. {
  324. string msg = App.DelectRejection(keyValue);
  325. if (string.IsNullOrEmpty(msg))
  326. {
  327. return Success("删除成功!");
  328. }
  329. else
  330. {
  331. return Error(msg);
  332. }
  333. }
  334. [HttpPost]
  335. [HandlerAjaxOnly]
  336. [ValidateAntiForgeryToken]
  337. public ActionResult DelectWWRejection(string keyValue)
  338. {
  339. string msg = App.DelectWWRejection(keyValue);
  340. if (string.IsNullOrEmpty(msg))
  341. {
  342. return Success("删除成功!");
  343. }
  344. else
  345. {
  346. return Error(msg);
  347. }
  348. }
  349. [HttpGet]
  350. public ActionResult GetInventoryInspection(Pagination pagination, string InvCode, int SampleQuantity, string ResultINp)
  351. {
  352. DataTable ListData = App.GetInventoryInspection(ref pagination, InvCode, SampleQuantity, ResultINp);
  353. var JsonData = new
  354. {
  355. total = pagination.total,
  356. page = pagination.page,
  357. records = pagination.records,
  358. rows = ListData,
  359. };
  360. return Content(JsonData.ToJson());
  361. }
  362. [HttpPost]
  363. [HandlerAjaxOnly]
  364. public ActionResult SaveICSInspectionDetail(string ICSMTDOC, string InvCode, string ResultINp)
  365. {
  366. string msg = App.SaveICSInspectionDetail(ICSMTDOC, InvCode, ResultINp);
  367. if (!string.IsNullOrEmpty(msg))
  368. {
  369. return Error(msg);
  370. }
  371. else
  372. {
  373. return Success("保存成功!");
  374. }
  375. }
  376. /// <summary>
  377. /// 上传文件(检验信息)
  378. /// </summary>
  379. /// <param name="BidCode"></param>
  380. /// <param name="ID"></param>
  381. /// <returns></returns>
  382. [HttpPost]
  383. public ActionResult UpLoadFileImport(string ID, string DNCode)
  384. {
  385. string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
  386. string UploadfileName = "";
  387. string fileName = "";
  388. //获取上传的文件集合
  389. try
  390. {
  391. HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  392. for (int i = 0; i < httpFile.Count; i++)
  393. {
  394. //获取送货单号
  395. //string STNO = Request.Form["STNO"].ToString();
  396. UploadfileName = Path.GetFileNameWithoutExtension(httpFile[i].FileName)
  397. + Path.GetExtension(httpFile[i].FileName);
  398. fileName = DNCode + Path.GetExtension(httpFile[i].FileName);
  399. string Paths = System.Web.HttpContext.Current.Server.MapPath("~\\File\\InspectionFile\\");
  400. if (!Directory.Exists(Paths))
  401. {
  402. Directory.CreateDirectory(Paths);
  403. }
  404. string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\InspectionFile\\" + UploadfileName);
  405. int iLen = httpFile[0].ContentLength;
  406. byte[] bData = new byte[iLen];
  407. httpFile[0].InputStream.Read(bData, 0, iLen);
  408. FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
  409. fs.Write(bData, 0, bData.Length);
  410. fs.Flush();
  411. fs.Close();
  412. fs.Dispose();
  413. App.InsertICSInspectionFile(ID, UploadfileName, fileName);
  414. }
  415. return Success("上传成功!");
  416. }
  417. catch (Exception ex)
  418. {
  419. return Error(ex.Message);
  420. }
  421. }
  422. //采购到货单检验
  423. [HttpGet]
  424. public ActionResult GetICSInspection8(Pagination pagination, string MenuID, string queryJson)
  425. {
  426. DataTable ListData = App.GetICSInspection8(ref pagination, MenuID, queryJson);
  427. var JsonData = new
  428. {
  429. total = pagination.total,
  430. page = pagination.page,
  431. records = pagination.records,
  432. rows = ListData,
  433. };
  434. return Content(JsonData.ToJson());
  435. }
  436. //委外采购到货单检验
  437. [HttpGet]
  438. public ActionResult GetICSInspection9(Pagination pagination, string MenuID, string queryJson)
  439. {
  440. DataTable ListData = App.GetICSInspection9(ref pagination, MenuID, queryJson);
  441. var JsonData = new
  442. {
  443. total = pagination.total,
  444. page = pagination.page,
  445. records = pagination.records,
  446. rows = ListData,
  447. };
  448. return Content(JsonData.ToJson());
  449. }
  450. //委外采购到货单检验
  451. [HttpGet]
  452. public ActionResult GetICSInspection10(Pagination pagination, string MenuID, string queryJson)
  453. {
  454. DataTable ListData = App.GetICSInspection10(ref pagination, MenuID, queryJson);
  455. var JsonData = new
  456. {
  457. total = pagination.total,
  458. page = pagination.page,
  459. records = pagination.records,
  460. rows = ListData,
  461. };
  462. return Content(JsonData.ToJson());
  463. }
  464. //在库检验
  465. [HttpGet]
  466. public ActionResult GetICSInspection11(Pagination pagination, string MenuID, string queryJson)
  467. {
  468. try
  469. {
  470. DataTable ListData = App.GetICSInspection11(ref pagination, MenuID, queryJson);
  471. var JsonData = new
  472. {
  473. total = pagination.total,
  474. page = pagination.page,
  475. records = pagination.records,
  476. rows = ListData,
  477. };
  478. return Content(JsonData.ToJson());
  479. }
  480. catch (Exception ex)
  481. {
  482. return Error(ex.Message);
  483. }
  484. }
  485. //采购入库单检验
  486. [HttpGet]
  487. public ActionResult GetICSInspection22(Pagination pagination, string MenuID, string queryJson)
  488. {
  489. DataTable ListData = App.GetICSInspection22(ref pagination, MenuID, queryJson);
  490. var JsonData = new
  491. {
  492. total = pagination.total,
  493. page = pagination.page,
  494. records = pagination.records,
  495. rows = ListData,
  496. };
  497. return Content(JsonData.ToJson());
  498. }
  499. //委外入库单检验
  500. [HttpGet]
  501. public ActionResult GetICSInspection23(Pagination pagination, string MenuID, string queryJson)
  502. {
  503. DataTable ListData = App.GetICSInspection23(ref pagination, MenuID, queryJson);
  504. var JsonData = new
  505. {
  506. total = pagination.total,
  507. page = pagination.page,
  508. records = pagination.records,
  509. rows = ListData,
  510. };
  511. return Content(JsonData.ToJson());
  512. }
  513. [HttpGet]
  514. public ActionResult GetInventoryInspectionNew(Pagination pagination, string InvCode, int? SampleQuantity, string ResultINp, string JYID,string LotNo)
  515. {
  516. DataTable ListData = App.GetInventoryInspectionNew(ref pagination, InvCode, SampleQuantity, ResultINp, JYID,LotNo);
  517. var JsonData = new
  518. {
  519. total = pagination.total,
  520. page = pagination.page,
  521. records = pagination.records,
  522. rows = ListData,
  523. };
  524. return Content(JsonData.ToJson());
  525. }
  526. [HttpGet]
  527. public ActionResult GetInventoryInspectionNew1(Pagination pagination, string InvCode, int? SampleQuantity, string ResultINp, string JYID, string LotNo)
  528. {
  529. DataTable ListData = App.GetInventoryInspectionNew1(ref pagination, InvCode, SampleQuantity, ResultINp, JYID, LotNo);
  530. var JsonData = new
  531. {
  532. total = pagination.total,
  533. page = pagination.page,
  534. records = pagination.records,
  535. rows = ListData,
  536. };
  537. return Content(JsonData.ToJson());
  538. }
  539. [HttpGet]
  540. [HandlerAjaxOnly]
  541. public ActionResult GetRulesDetail(string LotNo)
  542. {
  543. DataTable ListData = App.GetRulesDetail(LotNo);
  544. var JsonData = new
  545. {
  546. rows = ListData,
  547. };
  548. return Content(JsonData.ToJson());
  549. }
  550. //[HttpPost]
  551. //[HandlerAjaxOnly]
  552. //[ValidateInput(false)]
  553. //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)
  554. //{
  555. // string msg = App.SaveICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, BCCode, BRCode, ResultINp, Lot, Type, CJQty);
  556. // if (!string.IsNullOrEmpty(msg))
  557. // {
  558. // return Error(msg);
  559. // }
  560. // else
  561. // {
  562. // return Success("保存成功!");
  563. // }
  564. //}
  565. [HttpPost]
  566. [HandlerAjaxOnly]
  567. [ValidateInput(false)]
  568. public ActionResult SaveICSInspectionDetailNew(string InvCode, string JYID, string AllNumber, string YLOTQTY, string NLOTQTY, string WaiveQuantity, string Filtering, string SpecialNumber, string ResultINp, string SpecialPicks, string Lot, string Type, decimal CJQty, string ICSMTDOC)
  569. {
  570. string msg = App.SaveICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, Filtering, SpecialNumber, ResultINp, SpecialPicks,Lot, Type, CJQty);
  571. if (!string.IsNullOrEmpty(msg))
  572. {
  573. return Error(msg);
  574. }
  575. else
  576. {
  577. return Success("保存成功!");
  578. }
  579. }
  580. [HttpPost]
  581. [HandlerAjaxOnly]
  582. [ValidateInput(false)]
  583. 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)
  584. {
  585. string msg = App.StagingICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, BCCode, BRCode, ResultINp, Lot, Type, CJQty);
  586. if (!string.IsNullOrEmpty(msg))
  587. {
  588. return Error(msg);
  589. }
  590. else
  591. {
  592. return Success("操作成功!");
  593. }
  594. }
  595. [HttpPost]
  596. [HandlerAjaxOnly]
  597. public ActionResult UpdateICSInspectionDetailNew(string InvCode, string JYID, string AllNumber, string YLOTQTY, string NLOTQTY, string WaiveQuantity, string Filtering, string SpecialNumber, string ResultINp,string SpecialPicks, string Lot, string Type, decimal CJQty, string ICSMTDOC)
  598. {
  599. string msg = App.UpdateICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, Filtering, SpecialNumber, ResultINp, SpecialPicks,Lot, Type, CJQty);
  600. if (!string.IsNullOrEmpty(msg))
  601. {
  602. return Error(msg);
  603. }
  604. else
  605. {
  606. return Success("保存成功!");
  607. }
  608. }
  609. /// <summary>
  610. /// 获取动态列
  611. /// </summary>
  612. /// <param name="BidCode"></param>
  613. /// <returns></returns>
  614. public ActionResult SelectSORRFQColumnName(string InvCode, string JYID,string LotNo)
  615. {
  616. var data = App.SelectSORRFQColumnName(InvCode, JYID,LotNo);
  617. return Content(data.ToJson());
  618. }
  619. /// <summary>
  620. /// 删除动态列
  621. /// </summary>
  622. /// <param name="InvCode"></param>
  623. /// <param name="JYID"></param>
  624. /// <returns></returns>
  625. ///
  626. public ActionResult deleteSelectSORRFQColumnName(string InvCode, string JYID, string LotNo)
  627. {
  628. var data = App.deleteSelectSORRFQColumnName(InvCode, JYID, LotNo);
  629. return Content(data.ToJson());
  630. }
  631. [HttpGet]
  632. [HandlerAjaxOnly]
  633. public ActionResult GetDeleteRulesDetail(string InvCode, string JYID)
  634. {
  635. DataTable ListData = App.GetDeleteRulesDetail(InvCode, JYID);
  636. var JsonData = new
  637. {
  638. rows = ListData,
  639. };
  640. return Content(JsonData.ToJson());
  641. }
  642. [HttpPost]
  643. public ActionResult DeleteICSInspection(string DetailID)
  644. {
  645. DetailID = DetailID.Substring(1, DetailID.Length - 2);
  646. string msg = App.DeleteICSInspection(DetailID);
  647. if (string.IsNullOrWhiteSpace(msg))
  648. {
  649. return Success("删除成功!");
  650. }
  651. else
  652. {
  653. return Error("删除失败");
  654. }
  655. }
  656. /// <summary>
  657. /// 数据导入
  658. /// </summary>
  659. /// <returns></returns>
  660. [HttpPost]
  661. public string UploadFile(string LotNo)
  662. {
  663. try
  664. {
  665. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  666. if (hpFiles != null && hpFiles.Count > 0)
  667. {
  668. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  669. if (IsXls != ".xls" && IsXls != ".xlsx")
  670. {
  671. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  672. }
  673. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
  674. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  675. int iLen = hpFiles[0].ContentLength;
  676. if (Directory.Exists(savePath)) return "文件已存在";
  677. byte[] bData = new byte[iLen];
  678. hpFiles[0].InputStream.Read(bData, 0, iLen);
  679. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  680. newFile.Write(bData, 0, bData.Length);
  681. newFile.Flush();
  682. int _FileSizeTemp = hpFiles[0].ContentLength;
  683. newFile.Close();
  684. newFile.Dispose();
  685. //bool del = false;
  686. string mess = "";
  687. mess = App.SetData_PR(savePath,LotNo);
  688. if (System.IO.File.Exists(savePath))//删除文件
  689. {
  690. System.IO.File.Delete(savePath);
  691. }
  692. return mess;
  693. }
  694. else
  695. {
  696. return "获取文件失败";
  697. }
  698. }
  699. catch (Exception ex)
  700. {
  701. return ex.ToString();
  702. }
  703. }
  704. /// <summary>
  705. /// 红字销售出库单检验
  706. /// </summary>
  707. /// <param name="pagination"></param>
  708. /// <param name="MenuID"></param>
  709. /// <param name="queryJson"></param>
  710. /// <returns></returns>
  711. [HttpGet]
  712. public ActionResult GetICSSSDInspection(Pagination pagination, string MenuID, string queryJson)
  713. {
  714. DataTable ListData = App.GetICSSSDInspection(ref pagination, MenuID, queryJson);
  715. var JsonData = new
  716. {
  717. total = pagination.total,
  718. page = pagination.page,
  719. records = pagination.records,
  720. rows = ListData,
  721. };
  722. return Content(JsonData.ToJson());
  723. }
  724. /// <summary>
  725. /// 更新交期(咖博士使用)
  726. /// </summary>
  727. /// <param name="ICSMTDOC"></param>
  728. /// <param name="JYID"></param>
  729. /// <param name="ResultINp"></param>
  730. /// <returns></returns>
  731. [HttpPost]
  732. [HandlerAjaxOnly]
  733. public ActionResult UpdateLeadTime(string LeadModel)
  734. {
  735. string msg = App.UpdateLeadTime(LeadModel);
  736. if (!string.IsNullOrEmpty(msg))
  737. {
  738. return Error(msg);
  739. }
  740. else
  741. {
  742. return Success("更新成功!");
  743. }
  744. }
  745. }
  746. }