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.

1765 lines
53 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Configuration;
  6. using System.Data;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Web;
  11. using System.Web.Mvc;
  12. namespace NFine.Web.Areas.WMS.Controllers
  13. {
  14. /// <summary>
  15. /// IQC来料检验(咖博士)
  16. /// </summary>
  17. public class IQCQualityController : ControllerBase
  18. {
  19. private IQCQualityApp app = new IQCQualityApp();
  20. public ActionResult GetICSInventory2()
  21. {
  22. return View();
  23. }
  24. // GET: WMS/IQCQuality
  25. public ActionResult AqlQuery()
  26. {
  27. return View();
  28. }
  29. public ActionResult AqlEdit(string ids)
  30. {
  31. ViewData["ids"] = ids;
  32. return View();
  33. }
  34. public ActionResult Item2AqlQuery()
  35. {
  36. return View();
  37. }
  38. public ActionResult Item2AqlEdit()
  39. {
  40. return View();
  41. }
  42. public ActionResult Item2AqlEditSingle(string ids)
  43. {
  44. ViewData["ids"] = ids;
  45. return View();
  46. }
  47. public ActionResult Item2AqlFileView(string ids)
  48. {
  49. ViewData["ids"] = ids;
  50. return View();
  51. }
  52. public ActionResult MaterialCheckLog(string ids)
  53. {
  54. ViewData["ids"] = ids;
  55. return View();
  56. }
  57. public ActionResult BadCodeGroupQuery()
  58. {
  59. return View();
  60. }
  61. public ActionResult BadCodeGroupEdit(string ids)
  62. {
  63. ViewData["ids"] = ids;
  64. return View();
  65. }
  66. public ActionResult BadReasonGroupQuery()
  67. {
  68. return View();
  69. }
  70. public ActionResult BadReasonGroupEdit(string ids)
  71. {
  72. ViewData["ids"] = ids;
  73. return View();
  74. }
  75. public ActionResult CheckItemGroupQuery()
  76. {
  77. return View();
  78. }
  79. public ActionResult CheckItemGroupEdit(string ids)
  80. {
  81. ViewData["ids"] = ids;
  82. return View();
  83. }
  84. public ActionResult UpdateTime()
  85. {
  86. return View();
  87. }
  88. public ActionResult Item2CheckItemGroupQuery()
  89. {
  90. return View();
  91. }
  92. public ActionResult Item2CheckItemGroupBind()
  93. {
  94. return View();
  95. }
  96. public ActionResult Item2CheckItemEdit(string ids)
  97. {
  98. ViewData["ids"] = ids;
  99. return View();
  100. }
  101. public ActionResult MaterialInStorageCheckQuery()
  102. {
  103. return View();
  104. }
  105. public ActionResult MaterialInStorageCheckEdit(string ids,decimal qty,string docType)
  106. {
  107. ViewData["ids"] = ids;
  108. ViewData["qty"] = qty;
  109. ViewData["docType"] = docType;
  110. return View();
  111. }
  112. public ActionResult MaterialDestoryExperimentEdit(string ids)
  113. {
  114. ViewData["ids"] = ids;
  115. return View();
  116. }
  117. public ActionResult MaterialInStorageFinalQuery()
  118. {
  119. return View();
  120. }
  121. public ActionResult MaterialReJudgeEdit(string ids,string judgeRole)
  122. {
  123. ViewData["ids"] = ids;
  124. ViewData["judgeRole"] = judgeRole;
  125. return View();
  126. }
  127. public ActionResult MaterialReJudgeView(string ids, string judgeRole)
  128. {
  129. ViewData["ids"] = ids;
  130. ViewData["judgeRole"] = judgeRole;
  131. return View();
  132. }
  133. public ActionResult MaterialDoJudge(string ids)
  134. {
  135. ViewData["ids"] = ids;
  136. return View();
  137. }
  138. public ActionResult MaterialCheckDoJudge(string ids, decimal qty, string docType)
  139. {
  140. ViewData["ids"] = ids;
  141. ViewData["qty"] = qty;
  142. ViewData["docType"] = docType;
  143. return View();
  144. }
  145. public ActionResult MaterialFinalJudgeEdit(string ids)
  146. {
  147. ViewData["ids"] = ids;
  148. return View();
  149. }
  150. public ActionResult MaterialHasReturnItemEdit(string ids)
  151. {
  152. ViewData["ids"] = ids;
  153. return View();
  154. }
  155. public ActionResult PDMFile(string materialCode)
  156. {
  157. ViewData["materialCode"] = materialCode;
  158. return View();
  159. }
  160. /// <summary>
  161. /// 查询检验项目组列表
  162. /// </summary>
  163. /// <param name="pagination"></param>
  164. /// <param name="queryJson"></param>
  165. /// <returns></returns>
  166. [HttpPost]
  167. public ActionResult GetCheckItemGroupPageList(Pagination pagination, string queryJson)
  168. {
  169. DataTable ListData = app.GetCheckItemGroupPageList(queryJson, ref pagination);
  170. var JsonData = new
  171. {
  172. total = pagination.total,
  173. page = pagination.page,
  174. records = pagination.records,
  175. rows = ListData,
  176. };
  177. return Content(JsonData.ToJson());
  178. }
  179. /// <summary>
  180. /// 查询检验项目
  181. /// </summary>
  182. /// <param name="id"></param>
  183. /// <param name="pagination"></param>
  184. /// <returns></returns>
  185. [HttpGet]
  186. public ActionResult GetCheckItemDetailList(string id, Pagination pagination)
  187. {
  188. DataTable ListData = app.GetCheckItemDetailList(id, ref pagination);
  189. var JsonData = new
  190. {
  191. total = 1,
  192. page = 1,
  193. records = 0,
  194. rows = ListData,
  195. };
  196. return Content(JsonData.ToJson());
  197. }
  198. /// <summary>
  199. /// 查询Aql列表
  200. /// </summary>
  201. /// <param name="pagination"></param>
  202. /// <param name="queryJson"></param>
  203. /// <returns></returns>
  204. [HttpPost]
  205. public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
  206. {
  207. DataTable ListData = app.GetGridJsonChengPing(queryJson, ref pagination);
  208. var JsonData = new
  209. {
  210. total = pagination.total,
  211. page = pagination.page,
  212. records = pagination.records,
  213. rows = ListData,
  214. };
  215. return Content(JsonData.ToJson());
  216. }
  217. /// <summary>
  218. /// 查询不良状态组列表
  219. /// </summary>
  220. /// <param name="pagination"></param>
  221. /// <param name="queryJson"></param>
  222. /// <returns></returns>
  223. [HttpPost]
  224. public ActionResult GetBadCodeGroupPageList(Pagination pagination, string queryJson)
  225. {
  226. DataTable ListData = app.GetBadCodeGroupPageList(queryJson, ref pagination);
  227. var JsonData = new
  228. {
  229. total = pagination.total,
  230. page = pagination.page,
  231. records = pagination.records,
  232. rows = ListData,
  233. };
  234. return Content(JsonData.ToJson());
  235. }
  236. /// <summary>
  237. /// 查询不良状态列表
  238. /// </summary>
  239. /// <param name="id"></param>
  240. /// <param name="pagination"></param>
  241. /// <returns></returns>
  242. [HttpGet]
  243. public ActionResult GetBadCodeGroupDetailList(string id, Pagination pagination)
  244. {
  245. DataTable ListData = app.GetBadCodeGroupDetailList(id, ref pagination);
  246. var JsonData = new
  247. {
  248. total = 1,
  249. page = 1,
  250. records = 0,
  251. rows = ListData,
  252. };
  253. return Content(JsonData.ToJson());
  254. }
  255. /// <summary>
  256. /// 查询Aql明细
  257. /// </summary>
  258. /// <param name="id"></param>
  259. /// <param name="pagination"></param>
  260. /// <returns></returns>
  261. [HttpGet]
  262. public ActionResult GetAqlSubGridJsonList(string id, Pagination pagination)
  263. {
  264. DataTable ListData = app.GetAqlSubGridJsonList(id, ref pagination);
  265. var JsonData = new
  266. {
  267. total = 1,
  268. page = 1,
  269. records = 0,
  270. rows = ListData,
  271. };
  272. return Content(JsonData.ToJson());
  273. }
  274. /// <summary>
  275. /// 保存
  276. /// </summary>
  277. /// <param name="keyValue"></param>
  278. /// <returns></returns>
  279. [HttpPost]
  280. public ActionResult SaveAql(string keyValue)
  281. {
  282. string msg = app.SaveAql(keyValue);
  283. if (!string.IsNullOrEmpty(msg))
  284. {
  285. return Error(msg);
  286. }
  287. else
  288. {
  289. return Success("操作成功!");
  290. }
  291. }
  292. /// <summary>
  293. /// 获取单个
  294. /// </summary>
  295. /// <param name="keyValue"></param>
  296. /// <returns></returns>
  297. [HttpGet]
  298. public ActionResult GetAql(string keyValue)
  299. {
  300. var dt = app.GetAql(keyValue);
  301. return Content(dt.ToJson());
  302. }
  303. /// <summary>
  304. /// 删除
  305. /// </summary>
  306. /// <param name="keyValue"></param>
  307. /// <returns></returns>
  308. [HttpPost]
  309. public ActionResult DeleteAql(string keyValue)
  310. {
  311. var msg = app.DeleteAql(keyValue);
  312. if (!string.IsNullOrEmpty(msg))
  313. {
  314. return Error(msg);
  315. }
  316. else
  317. {
  318. return Success("操作成功!");
  319. }
  320. }
  321. /// <summary>
  322. /// 导出列表
  323. /// </summary>
  324. /// <param name="pagination"></param>
  325. /// <param name="queryJson"></param>
  326. /// <returns></returns>
  327. [HttpPost]
  328. public void ExportAllAqlList(string RulesCode, string RulesName, string Enable)
  329. {
  330. DataTable dt = app.ExportAllAqlList(RulesCode, RulesName, Enable);
  331. AsposeCell.Export(dt);
  332. }
  333. /// <summary>
  334. /// 查询物料Aql关系列表
  335. /// </summary>
  336. /// <param name="pagination"></param>
  337. /// <param name="queryJson"></param>
  338. /// <returns></returns>
  339. [HttpPost]
  340. public ActionResult GetItem2RuleList(Pagination pagination, string queryJson)
  341. {
  342. DataTable ListData = app.GetItem2RuleList(queryJson, ref pagination);
  343. var JsonData = new
  344. {
  345. total = pagination.total,
  346. page = pagination.page,
  347. records = pagination.records,
  348. rows = ListData,
  349. };
  350. return Content(JsonData.ToJson());
  351. }
  352. /// <summary>
  353. /// 获取所有物料(条件)
  354. /// </summary>
  355. /// <param name="keyValue"></param>
  356. /// <returns></returns>
  357. [HttpGet]
  358. public ActionResult GetAllItemList(string code)
  359. {
  360. var dt = app.GetAllItemList(code);
  361. return Content(dt.ToJson());
  362. }
  363. /// <summary>
  364. /// 获取所有Aql(条件)
  365. /// </summary>
  366. /// <param name="keyValue"></param>
  367. /// <returns></returns>
  368. [HttpGet]
  369. public ActionResult GetAllAqlList(string code)
  370. {
  371. var dt = app.GetAllAqlList(code);
  372. return Content(dt.ToJson());
  373. }
  374. /// <summary>
  375. /// 获取所有检验类型(条件)
  376. /// </summary>
  377. /// <param name="keyValue"></param>
  378. /// <returns></returns>
  379. [HttpGet]
  380. public ActionResult GetAllCheckGroupList(string code)
  381. {
  382. var dt = app.GetAllCheckGroupList(code);
  383. return Content(dt.ToJson());
  384. }
  385. /// <summary>
  386. /// 获取单个
  387. /// </summary>
  388. /// <param name="keyValue"></param>
  389. /// <returns></returns>
  390. [HttpGet]
  391. public ActionResult GetItem2Aql(string keyValue)
  392. {
  393. var dt = app.GetItem2Aql(keyValue);
  394. return Content(dt.ToJson());
  395. }
  396. /// <summary>
  397. /// 保存
  398. /// </summary>
  399. /// <param name="keyValue"></param>
  400. /// <returns></returns>
  401. [HttpPost]
  402. public ActionResult SaveItem2Aql(string keyValue)
  403. {
  404. string msg = app.SaveItem2Aql(keyValue);
  405. if (!string.IsNullOrEmpty(msg))
  406. {
  407. return Error(msg);
  408. }
  409. else
  410. {
  411. return Success("操作成功!");
  412. }
  413. }
  414. /// <summary>
  415. /// 保存
  416. /// </summary>
  417. /// <param name="keyValue"></param>
  418. /// <returns></returns>
  419. [HttpPost]
  420. public ActionResult SaveItem2AqlSingle(string keyValue)
  421. {
  422. string msg = app.SaveItem2AqlSingle(keyValue);
  423. if (!string.IsNullOrEmpty(msg))
  424. {
  425. return Error(msg);
  426. }
  427. else
  428. {
  429. return Success("操作成功!");
  430. }
  431. }
  432. /// <summary>
  433. /// 导入列表
  434. /// </summary>
  435. /// <param name="pagination"></param>
  436. /// <param name="queryJson"></param>
  437. /// <returns></returns>
  438. [HttpPost]
  439. public string UploadFile()
  440. {
  441. try
  442. {
  443. //string str_Year = Request.Form["txt_Year"];
  444. //String UPLoadType = Request.Form["UPLoadType"];
  445. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  446. if (hpFiles != null && hpFiles.Count > 0)
  447. {
  448. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  449. if (IsXls != ".xls" && IsXls != ".xlsx")
  450. {
  451. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  452. }
  453. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + IsXls; //获取Execle文件名 DateTime日期函数
  454. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  455. int iLen = hpFiles[0].ContentLength;
  456. if (Directory.Exists(savePath)) return "文件已存在";
  457. byte[] bData = new byte[iLen];
  458. hpFiles[0].InputStream.Read(bData, 0, iLen);
  459. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  460. newFile.Write(bData, 0, bData.Length);
  461. newFile.Flush();
  462. int _FileSizeTemp = hpFiles[0].ContentLength;
  463. newFile.Close();
  464. newFile.Dispose();
  465. //bool del = false;
  466. string mess = "";
  467. mess = app.SetData_PR(savePath);
  468. if (System.IO.File.Exists(savePath))//删除文件
  469. {
  470. System.IO.File.Delete(savePath);
  471. }
  472. return mess;
  473. }
  474. else
  475. {
  476. return "获取文件失败";
  477. }
  478. }
  479. catch (Exception ex)
  480. {
  481. return ex.ToString();
  482. }
  483. }
  484. /// <summary>
  485. /// 导出物料关联Aql列表
  486. /// </summary>
  487. /// <param name="pagination"></param>
  488. /// <param name="queryJson"></param>
  489. /// <returns></returns>
  490. [HttpPost]
  491. public void ExportAllItem2AqlList(string RulesCode, string RulesName, string InvCode, string InvName)
  492. {
  493. DataTable dt = app.ExportAllItem2AqlList(RulesCode, RulesName, InvCode, InvName);
  494. AsposeCell.Export(dt);
  495. }
  496. /// <summary>
  497. /// 删除
  498. /// </summary>
  499. /// <param name="keyValue"></param>
  500. /// <returns></returns>
  501. [HttpPost]
  502. public ActionResult DeleteItem2Aql(string keyValue)
  503. {
  504. var msg = app.DeleteItem2Aql(keyValue);
  505. if (!string.IsNullOrEmpty(msg))
  506. {
  507. return Error(msg);
  508. }
  509. else
  510. {
  511. return Success("操作成功!");
  512. }
  513. }
  514. [HttpPost]
  515. public ActionResult UpLoadItemRuleFile()
  516. {
  517. try
  518. {
  519. //获取上传的文件集合
  520. HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  521. //获取送货单号
  522. string ID = Request.Form["ID"].ToString();
  523. //string LableName = Request.Form["LableName"].ToString();
  524. string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
  525. + Path.GetExtension(httpFile[0].FileName);
  526. string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
  527. if (System.IO.File.Exists(filePath))//删除文件
  528. {
  529. System.IO.File.Delete(filePath);
  530. }
  531. int iLen = httpFile[0].ContentLength;
  532. byte[] bData = new byte[iLen];
  533. httpFile[0].InputStream.Read(bData, 0, iLen);
  534. FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
  535. fs.Write(bData, 0, bData.Length);
  536. fs.Flush();
  537. fs.Close();
  538. fs.Dispose();
  539. int count = app.UpLoadItemRuleFile(ID, fileName);
  540. if (count > 0)
  541. {
  542. return Success("上传成功!");
  543. }
  544. else
  545. {
  546. throw new Exception("");
  547. }
  548. }
  549. catch (Exception ex)
  550. {
  551. return Error(ex.Message);
  552. }
  553. }
  554. /// <summary>
  555. /// 检验异常文件
  556. /// </summary>
  557. /// <returns></returns>
  558. [HttpPost]
  559. public ActionResult UpLoadMaterialCheckExFile()
  560. {
  561. try
  562. {
  563. //获取上传的文件集合
  564. HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  565. //获取送货单号
  566. string ID = Request.Form["ID"].ToString();
  567. //string LableName = Request.Form["LableName"].ToString();
  568. string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
  569. + Path.GetExtension(httpFile[0].FileName);
  570. string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
  571. if (System.IO.File.Exists(filePath))//删除文件
  572. {
  573. System.IO.File.Delete(filePath);
  574. }
  575. int iLen = httpFile[0].ContentLength;
  576. byte[] bData = new byte[iLen];
  577. httpFile[0].InputStream.Read(bData, 0, iLen);
  578. FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
  579. fs.Write(bData, 0, bData.Length);
  580. fs.Flush();
  581. fs.Close();
  582. fs.Dispose();
  583. //int count = app.UpLoadItemRuleFile(ID, fileName);
  584. //if (count > 0)
  585. //{
  586. // return Success("上传成功!");
  587. //}
  588. //else
  589. //{
  590. // throw new Exception("");
  591. //}
  592. return Success("上传成功!");
  593. }
  594. catch (Exception ex)
  595. {
  596. return Error(ex.Message);
  597. }
  598. }
  599. [HttpPost]
  600. public ActionResult UpLoadFinalJudgeFile()
  601. {
  602. try
  603. {
  604. //获取上传的文件集合
  605. HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  606. //获取送货单号
  607. string ID = Request.Form["ID"].ToString();
  608. //string LableName = Request.Form["LableName"].ToString();
  609. string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
  610. + Path.GetExtension(httpFile[0].FileName);
  611. string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
  612. if (System.IO.File.Exists(filePath))//删除文件
  613. {
  614. System.IO.File.Delete(filePath);
  615. }
  616. int iLen = httpFile[0].ContentLength;
  617. byte[] bData = new byte[iLen];
  618. httpFile[0].InputStream.Read(bData, 0, iLen);
  619. FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
  620. fs.Write(bData, 0, bData.Length);
  621. fs.Flush();
  622. fs.Close();
  623. fs.Dispose();
  624. int count = app.UpLoadFinalJudgeFile(ID, fileName);
  625. if (count > 0)
  626. {
  627. return Success("上传成功!");
  628. }
  629. else
  630. {
  631. throw new Exception("");
  632. }
  633. }
  634. catch (Exception ex)
  635. {
  636. return Error(ex.Message);
  637. }
  638. }
  639. [HttpGet]
  640. public ActionResult GetItem2AqlFileList(string keyValue)
  641. {
  642. var dt = app.GetItem2AqlFileList(keyValue);
  643. return Content(dt.ToJson());
  644. }
  645. [HttpGet]
  646. public ActionResult GetMaterialCheckLog(string keyValue)
  647. {
  648. var dt = app.GetMaterialCheckLog(keyValue);
  649. return Content(dt.ToJson());
  650. }
  651. /// <summary>
  652. /// 删除物料规则文件
  653. /// </summary>
  654. /// <param name="keyValue"></param>
  655. /// <returns></returns>
  656. [HttpPost]
  657. public ActionResult DeleteItem2AqlFile(string keyValue)
  658. {
  659. var msg = app.DeleteItem2AqlFile(keyValue);
  660. if (!string.IsNullOrEmpty(msg))
  661. {
  662. return Error(msg);
  663. }
  664. else
  665. {
  666. return Success("操作成功!");
  667. }
  668. }
  669. /// <summary>
  670. /// 获取文件预览路径
  671. /// </summary>
  672. /// <param name="fileName"></param>
  673. /// <returns></returns>
  674. [HttpGet]
  675. public ActionResult GetItem2AqlFilePath(string fileName)
  676. {
  677. try
  678. {
  679. string fileServerPath = CommonHelper.GetBaseUrl(Request.Url)+ @"/File/IQC/"+ fileName;
  680. //string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
  681. return Success(fileServerPath);
  682. }
  683. catch (Exception ex)
  684. {
  685. return Error(ex.Message);
  686. }
  687. }
  688. /// <summary>
  689. /// 获取单个
  690. /// </summary>
  691. /// <param name="keyValue"></param>
  692. /// <returns></returns>
  693. [HttpGet]
  694. public ActionResult GetBadCodeGroup(string keyValue)
  695. {
  696. var dt = app.GetBadCodeGroup(keyValue);
  697. return Content(dt.ToJson());
  698. }
  699. /// <summary>
  700. /// 保存不良状态组
  701. /// </summary>
  702. /// <param name="keyValue"></param>
  703. /// <returns></returns>
  704. [HttpPost]
  705. public ActionResult SaveBadCodeGroup(string keyValue)
  706. {
  707. string msg = app.SaveBadCodeGroup(keyValue);
  708. if (!string.IsNullOrEmpty(msg))
  709. {
  710. return Error(msg);
  711. }
  712. else
  713. {
  714. return Success("操作成功!");
  715. }
  716. }
  717. /// <summary>
  718. /// 删除
  719. /// </summary>
  720. /// <param name="keyValue"></param>
  721. /// <returns></returns>
  722. [HttpPost]
  723. public ActionResult DeleteBadCodeGroup(string keyValue)
  724. {
  725. var msg = app.DeleteBadCodeGroup(keyValue);
  726. if (!string.IsNullOrEmpty(msg))
  727. {
  728. return Error(msg);
  729. }
  730. else
  731. {
  732. return Success("操作成功!");
  733. }
  734. }
  735. /// <summary>
  736. /// 导出列表
  737. /// </summary>
  738. /// <param name="pagination"></param>
  739. /// <param name="queryJson"></param>
  740. /// <returns></returns>
  741. [HttpPost]
  742. public void ExportAllBadCodeGroup(string BCGCode, string BCGDesc)
  743. {
  744. DataTable dt = app.ExportAllBadCodeGroup(BCGCode, BCGDesc);
  745. AsposeCell.Export(dt);
  746. }
  747. /// <summary>
  748. /// 查询不良现象组列表
  749. /// </summary>
  750. /// <param name="pagination"></param>
  751. /// <param name="queryJson"></param>
  752. /// <returns></returns>
  753. [HttpPost]
  754. public ActionResult GetBadReasonGroupPageList(Pagination pagination, string queryJson)
  755. {
  756. DataTable ListData = app.GetBadReasonGroupPageList(queryJson, ref pagination);
  757. var JsonData = new
  758. {
  759. total = pagination.total,
  760. page = pagination.page,
  761. records = pagination.records,
  762. rows = ListData,
  763. };
  764. return Content(JsonData.ToJson());
  765. }
  766. /// <summary>
  767. /// 查询不良现象列表
  768. /// </summary>
  769. /// <param name="id"></param>
  770. /// <param name="pagination"></param>
  771. /// <returns></returns>
  772. [HttpGet]
  773. public ActionResult GetBadReasonDetailList(string id, Pagination pagination)
  774. {
  775. DataTable ListData = app.GetBadReasonDetailList(id, ref pagination);
  776. var JsonData = new
  777. {
  778. total = 1,
  779. page = 1,
  780. records = 0,
  781. rows = ListData,
  782. };
  783. return Content(JsonData.ToJson());
  784. }
  785. /// <summary>
  786. /// 获取单个
  787. /// </summary>
  788. /// <param name="keyValue"></param>
  789. /// <returns></returns>
  790. [HttpGet]
  791. public ActionResult GetBadReasonGroup(string keyValue)
  792. {
  793. var dt = app.GetBadReasonGroup(keyValue);
  794. return Content(dt.ToJson());
  795. }
  796. /// <summary>
  797. /// 保存不良现象组
  798. /// </summary>
  799. /// <param name="keyValue"></param>
  800. /// <returns></returns>
  801. [HttpPost]
  802. public ActionResult SaveBadReasonGroup(string keyValue)
  803. {
  804. string msg = app.SaveBadReasonGroup(keyValue);
  805. if (!string.IsNullOrEmpty(msg))
  806. {
  807. return Error(msg);
  808. }
  809. else
  810. {
  811. return Success("操作成功!");
  812. }
  813. }
  814. /// <summary>
  815. /// 删除
  816. /// </summary>
  817. /// <param name="keyValue"></param>
  818. /// <returns></returns>
  819. [HttpPost]
  820. public ActionResult DeleteBadReasonGroup(string keyValue)
  821. {
  822. var msg = app.DeleteBadReasonGroup(keyValue);
  823. if (!string.IsNullOrEmpty(msg))
  824. {
  825. return Error(msg);
  826. }
  827. else
  828. {
  829. return Success("操作成功!");
  830. }
  831. }
  832. /// <summary>
  833. /// 导出列表
  834. /// </summary>
  835. /// <param name="pagination"></param>
  836. /// <param name="queryJson"></param>
  837. /// <returns></returns>
  838. [HttpPost]
  839. public void ExportAllBadReasonGroup(string BRGCode, string BRGDesc)
  840. {
  841. DataTable dt = app.ExportAllBadReasonGroup(BRGCode, BRGDesc);
  842. AsposeCell.Export(dt);
  843. }
  844. /// <summary>
  845. /// 获取单个
  846. /// </summary>
  847. /// <param name="keyValue"></param>
  848. /// <returns></returns>
  849. [HttpGet]
  850. public ActionResult GetCheckItemGroup(string keyValue)
  851. {
  852. var dt = app.GetCheckItemGroup(keyValue);
  853. return Content(dt.ToJson());
  854. }
  855. /// <summary>
  856. /// 保存检验类型
  857. /// </summary>
  858. /// <param name="keyValue"></param>
  859. /// <returns></returns>
  860. [HttpPost]
  861. public ActionResult SaveCheckItemGroup(string keyValue)
  862. {
  863. string msg = app.SaveCheckItemGroup(keyValue);
  864. if (!string.IsNullOrEmpty(msg))
  865. {
  866. return Error(msg);
  867. }
  868. else
  869. {
  870. return Success("操作成功!");
  871. }
  872. }
  873. /// <summary>
  874. /// 删除
  875. /// </summary>
  876. /// <param name="keyValue"></param>
  877. /// <returns></returns>
  878. [HttpPost]
  879. public ActionResult DeleteCheckItemGroup(string keyValue)
  880. {
  881. var msg = app.DeleteCheckItemGroup(keyValue);
  882. if (!string.IsNullOrEmpty(msg))
  883. {
  884. return Error(msg);
  885. }
  886. else
  887. {
  888. return Success("操作成功!");
  889. }
  890. }
  891. /// <summary>
  892. /// 导出列表
  893. /// </summary>
  894. /// <param name="pagination"></param>
  895. /// <param name="queryJson"></param>
  896. /// <returns></returns>
  897. [HttpPost]
  898. public void ExportAllCheckItemGroup(string GroupCode, string GroupName)
  899. {
  900. DataTable dt = app.ExportAllCheckItemGroup(GroupCode, GroupName);
  901. AsposeCell.Export(dt);
  902. }
  903. /// <summary>
  904. /// 导入列表
  905. /// </summary>
  906. /// <param name="pagination"></param>
  907. /// <param name="queryJson"></param>
  908. /// <returns></returns>
  909. [HttpPost]
  910. public string ImportCheckItem()
  911. {
  912. try
  913. {
  914. //string str_Year = Request.Form["txt_Year"];
  915. //String UPLoadType = Request.Form["UPLoadType"];
  916. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  917. if (hpFiles != null && hpFiles.Count > 0)
  918. {
  919. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  920. if (IsXls != ".xls" && IsXls != ".xlsx")
  921. {
  922. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  923. }
  924. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + IsXls; //获取Execle文件名 DateTime日期函数
  925. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  926. int iLen = hpFiles[0].ContentLength;
  927. if (Directory.Exists(savePath)) return "文件已存在";
  928. byte[] bData = new byte[iLen];
  929. hpFiles[0].InputStream.Read(bData, 0, iLen);
  930. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  931. newFile.Write(bData, 0, bData.Length);
  932. newFile.Flush();
  933. int _FileSizeTemp = hpFiles[0].ContentLength;
  934. newFile.Close();
  935. newFile.Dispose();
  936. //bool del = false;
  937. string mess = "";
  938. mess = app.ImportCheckItem(savePath);
  939. if (System.IO.File.Exists(savePath))//删除文件
  940. {
  941. System.IO.File.Delete(savePath);
  942. }
  943. return mess;
  944. }
  945. else
  946. {
  947. return "获取文件失败";
  948. }
  949. }
  950. catch (Exception ex)
  951. {
  952. return ex.ToString();
  953. }
  954. }
  955. /// <summary>
  956. /// 查询物料检验类型列表
  957. /// </summary>
  958. /// <param name="pagination"></param>
  959. /// <param name="queryJson"></param>
  960. /// <returns></returns>
  961. [HttpPost]
  962. public ActionResult GetItem2CheckItemPageList(Pagination pagination, string queryJson)
  963. {
  964. DataTable ListData = app.GetItem2CheckItemPageList(queryJson, ref pagination);
  965. var JsonData = new
  966. {
  967. total = pagination.total,
  968. page = pagination.page,
  969. records = pagination.records,
  970. rows = ListData,
  971. };
  972. return Content(JsonData.ToJson());
  973. }
  974. /// <summary>
  975. /// 保存物料检验类型
  976. /// </summary>
  977. /// <param name="keyValue"></param>
  978. /// <returns></returns>
  979. [HttpPost]
  980. public ActionResult SaveItem2CheckItem(string keyValue)
  981. {
  982. string msg = app.SaveItem2CheckItem(keyValue);
  983. if (!string.IsNullOrEmpty(msg))
  984. {
  985. return Error(msg);
  986. }
  987. else
  988. {
  989. return Success("操作成功!");
  990. }
  991. }
  992. /// <summary>
  993. /// 获取单个
  994. /// </summary>
  995. /// <param name="keyValue"></param>
  996. /// <returns></returns>
  997. [HttpGet]
  998. public ActionResult GetItem2CheckItem(string keyValue)
  999. {
  1000. var dt = app.GetItem2CheckItem(keyValue);
  1001. return Content(dt.ToJson());
  1002. }
  1003. /// <summary>
  1004. /// 保存物料检验类型
  1005. /// </summary>
  1006. /// <param name="keyValue"></param>
  1007. /// <returns></returns>
  1008. [HttpPost]
  1009. public ActionResult SaveItem2CheckItemSingle(string keyValue)
  1010. {
  1011. string msg = app.SaveItem2CheckItemSingle(keyValue);
  1012. if (!string.IsNullOrEmpty(msg))
  1013. {
  1014. return Error(msg);
  1015. }
  1016. else
  1017. {
  1018. return Success("操作成功!");
  1019. }
  1020. }
  1021. /// <summary>
  1022. /// 删除
  1023. /// </summary>
  1024. /// <param name="keyValue"></param>
  1025. /// <returns></returns>
  1026. [HttpPost]
  1027. public ActionResult DeleteItem2CheckItem(string keyValue)
  1028. {
  1029. var msg = app.DeleteItem2CheckItem(keyValue);
  1030. if (!string.IsNullOrEmpty(msg))
  1031. {
  1032. return Error(msg);
  1033. }
  1034. else
  1035. {
  1036. return Success("操作成功!");
  1037. }
  1038. }
  1039. /// <summary>
  1040. /// 导入列表
  1041. /// </summary>
  1042. /// <param name="pagination"></param>
  1043. /// <param name="queryJson"></param>
  1044. /// <returns></returns>
  1045. [HttpPost]
  1046. public string ImportItem2CheckGroup()
  1047. {
  1048. try
  1049. {
  1050. //string str_Year = Request.Form["txt_Year"];
  1051. //String UPLoadType = Request.Form["UPLoadType"];
  1052. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  1053. if (hpFiles != null && hpFiles.Count > 0)
  1054. {
  1055. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  1056. if (IsXls != ".xls" && IsXls != ".xlsx")
  1057. {
  1058. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  1059. }
  1060. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + IsXls; //获取Execle文件名 DateTime日期函数
  1061. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  1062. int iLen = hpFiles[0].ContentLength;
  1063. if (Directory.Exists(savePath)) return "文件已存在";
  1064. byte[] bData = new byte[iLen];
  1065. hpFiles[0].InputStream.Read(bData, 0, iLen);
  1066. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  1067. newFile.Write(bData, 0, bData.Length);
  1068. newFile.Flush();
  1069. int _FileSizeTemp = hpFiles[0].ContentLength;
  1070. newFile.Close();
  1071. newFile.Dispose();
  1072. //bool del = false;
  1073. string mess = "";
  1074. mess = app.ImportItem2CheckGroup(savePath);
  1075. if (System.IO.File.Exists(savePath))//删除文件
  1076. {
  1077. System.IO.File.Delete(savePath);
  1078. }
  1079. return mess;
  1080. }
  1081. else
  1082. {
  1083. return "获取文件失败";
  1084. }
  1085. }
  1086. catch (Exception ex)
  1087. {
  1088. return ex.ToString();
  1089. }
  1090. }
  1091. /// <summary>
  1092. /// 导出列表
  1093. /// </summary>
  1094. /// <param name="pagination"></param>
  1095. /// <param name="queryJson"></param>
  1096. /// <returns></returns>
  1097. [HttpPost]
  1098. public void ExportAllItem2CheckItem(string InvCode, string InvName,string ListCode, string ListName)
  1099. {
  1100. DataTable dt = app.ExportAllItem2CheckItem(InvCode, InvName, ListCode, ListName);
  1101. AsposeCell.Export(dt);
  1102. }
  1103. /// <summary>
  1104. /// 获取出货报告预览路径
  1105. /// </summary>
  1106. /// <param name="fileName"></param>
  1107. /// <returns></returns>
  1108. [HttpGet]
  1109. public ActionResult GetOutReportFilePath(string fileName)
  1110. {
  1111. try
  1112. {
  1113. //获取SRM虚拟路径
  1114. var baseUrl = ConfigurationManager.ConnectionStrings["SRMURL"].ConnectionString;
  1115. if (baseUrl.IsNullOrEmpty())
  1116. {
  1117. throw new Exception("没有维护SRM站点信息");
  1118. }
  1119. //fileName F:\桌面\Git\基础版\SRM\NFine.Web\File\VendorFile\01000000\DN0100000024000010101000001202406050001\222.txt
  1120. string fileServerPath = baseUrl+@"/"+ fileName.Substring( fileName.IndexOf("File"));
  1121. fileServerPath = fileServerPath.Replace(@"\", @"/");
  1122. //string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
  1123. return Success(fileServerPath);
  1124. }
  1125. catch (Exception ex)
  1126. {
  1127. return Error(ex.Message);
  1128. }
  1129. }
  1130. /// <summary>
  1131. /// 获取异常预览路径
  1132. /// </summary>
  1133. /// <param name="fileName"></param>
  1134. /// <returns></returns>
  1135. [HttpGet]
  1136. public ActionResult GetMaterialExFilePath(string fileName)
  1137. {
  1138. try
  1139. {
  1140. //获取SRM虚拟路径
  1141. //var baseUrl = ConfigurationManager.ConnectionStrings["SRMURL"].ConnectionString;
  1142. //if (baseUrl.IsNullOrEmpty())
  1143. //{
  1144. // throw new Exception("没有维护SRM站点信息");
  1145. //}
  1146. //fileName F:\桌面\Git\基础版\SRM\NFine.Web\File\VendorFile\01000000\DN0100000024000010101000001202406050001\222.txt
  1147. var baseUrl = new StringBuilder()
  1148. .Append(Request.Url.Scheme)
  1149. .Append("://")
  1150. .Append(Request.Url.Host)
  1151. .Append(":")
  1152. .Append(Request.Url.Port)
  1153. .ToString();
  1154. //string fileServerPath = baseUrl + @"/" + fileName.Substring(fileName.IndexOf("File"));
  1155. //fileServerPath = fileServerPath.Replace(@"\", @"/");
  1156. // string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
  1157. string filePath = baseUrl+ @"/File/IQC/"+ fileName;
  1158. return Success(filePath);
  1159. }
  1160. catch (Exception ex)
  1161. {
  1162. return Error(ex.Message);
  1163. }
  1164. }
  1165. /// <summary>
  1166. /// 查询来料送检列表
  1167. /// </summary>
  1168. /// <param name="pagination"></param>
  1169. /// <param name="queryJson"></param>
  1170. /// <returns></returns>
  1171. [HttpPost]
  1172. public ActionResult GetMaterialInStorageCheckPageList(Pagination pagination, string queryJson)
  1173. {
  1174. DataTable ListData = app.GetMaterialInStorageCheckPageList(queryJson, ref pagination);
  1175. var JsonData = new
  1176. {
  1177. total = pagination.total,
  1178. page = pagination.page,
  1179. records = pagination.records,
  1180. rows = ListData,
  1181. };
  1182. return Content(JsonData.ToJson());
  1183. }
  1184. /// <summary>
  1185. /// 查询来料检验明细
  1186. /// </summary>
  1187. /// <param name="id"></param>
  1188. /// <param name="pagination"></param>
  1189. /// <returns></returns>
  1190. [HttpGet]
  1191. public ActionResult GetMaterialInStorageCheckDetailList(string code,string lotno, string InvCode,Pagination pagination)
  1192. {
  1193. DataTable ListData = app.GetMaterialInStorageCheckDetailList(code, lotno, InvCode, ref pagination);
  1194. var JsonData = new
  1195. {
  1196. total = 1,
  1197. page = 1,
  1198. records = 0,
  1199. rows = ListData,
  1200. };
  1201. return Content(JsonData.ToJson());
  1202. }
  1203. /// <summary>
  1204. /// 导出列表
  1205. /// </summary>
  1206. /// <param name="pagination"></param>
  1207. /// <param name="queryJson"></param>
  1208. /// <returns></returns>
  1209. [HttpPost]
  1210. public void ExportAllMaterialInStorageCheck(string InvCode,string InvName, string StartDate, string EndDate, string IsCheck,string CheckStartDate,string CheckEndDate)
  1211. {
  1212. //return;
  1213. DataTable dt = app.ExportAllMaterialInStorageCheck(InvCode, InvName, IsCheck, StartDate, EndDate, CheckStartDate, CheckEndDate);
  1214. AsposeCell.Export(dt);
  1215. }
  1216. /// <summary>
  1217. /// 导出列表
  1218. /// </summary>
  1219. /// <param name="pagination"></param>
  1220. /// <param name="queryJson"></param>
  1221. /// <returns></returns>
  1222. [HttpPost]
  1223. public void ExportMaterialInStorageFinalList(string InvCode, string InvName, string StartDate, string EndDate, string ASNCode, string VenCode, string VenName
  1224. , string InvBatcgNo, string IsCheckComplete, string JuegeProgess, string BcgCode)
  1225. {
  1226. //return;
  1227. DataTable dt = app.ExportMaterialInStorageFinalList(InvCode, InvName, IsCheckComplete, StartDate, EndDate, ASNCode, VenCode, VenName, InvBatcgNo, JuegeProgess, BcgCode);
  1228. AsposeCell.Export(dt);
  1229. }
  1230. /// <summary>
  1231. /// 导出列表
  1232. /// </summary>
  1233. /// <param name="pagination"></param>
  1234. /// <param name="queryJson"></param>
  1235. /// <returns></returns>
  1236. [HttpPost]
  1237. public void ExportAllMaterialCheckLog(string keyValue)
  1238. {
  1239. //return;
  1240. DataTable dt = app.ExportAllMaterialCheckLog(keyValue);
  1241. AsposeCell.Export(dt);
  1242. }
  1243. /// <summary>
  1244. /// 查询破坏性实验记录
  1245. /// </summary>
  1246. /// <param name="id"></param>
  1247. /// <param name="pagination"></param>
  1248. /// <returns></returns>
  1249. [HttpGet]
  1250. public ActionResult GetMaterialInStorageCheckDetailList2(string code, string lotno,string invCode)
  1251. {
  1252. Pagination pagination = null;
  1253. DataTable ListData = app.GetMaterialInStorageCheckDetailList(code, lotno, invCode, ref pagination);
  1254. //var JsonData = new
  1255. //{
  1256. // total = 1,
  1257. // page = 1,
  1258. // records = 0,
  1259. // rows = ListData,
  1260. //};
  1261. return Content(ListData.ToJson());
  1262. }
  1263. /// <summary>
  1264. /// 来料检验加急
  1265. /// </summary>
  1266. /// <param name="keyValue"></param>
  1267. /// <returns></returns>
  1268. [HttpPost]
  1269. public ActionResult UpdateUrgent(string keyValue)
  1270. {
  1271. string msg = app.UpdateUrgent(keyValue);
  1272. if (!string.IsNullOrEmpty(msg))
  1273. {
  1274. return Error(msg);
  1275. }
  1276. else
  1277. {
  1278. return Success("操作成功!");
  1279. }
  1280. }
  1281. /// <summary>
  1282. /// 删除
  1283. /// </summary>
  1284. /// <param name="keyValue"></param>
  1285. /// <returns></returns>
  1286. [HttpPost]
  1287. public ActionResult DeleteMatCheck(string keyValue)
  1288. {
  1289. var msg = app.DeleteMatCheck(keyValue);
  1290. if (!string.IsNullOrEmpty(msg))
  1291. {
  1292. return Error(msg);
  1293. }
  1294. else
  1295. {
  1296. return Success("操作成功!");
  1297. }
  1298. }
  1299. /// <summary>
  1300. /// 仓库已退实物
  1301. /// </summary>
  1302. /// <param name="keyValue"></param>
  1303. /// <returns></returns>
  1304. [HttpPost]
  1305. public ActionResult UpdateMaterialHasReturnItem(string keyValue)
  1306. {
  1307. string msg = app.UpdateMaterialHasReturnItem(keyValue);
  1308. if (!string.IsNullOrEmpty(msg))
  1309. {
  1310. return Error(msg);
  1311. }
  1312. else
  1313. {
  1314. return Success("操作成功!");
  1315. }
  1316. }
  1317. /// <summary>
  1318. /// 复盘加急
  1319. /// </summary>
  1320. /// <param name="keyValue"></param>
  1321. /// <returns></returns>
  1322. [HttpPost]
  1323. public ActionResult UpdateMaterialReUrgent(string keyValue,string time)
  1324. {
  1325. string msg = app.UpdateMaterialReUrgent(keyValue,time);
  1326. if (!string.IsNullOrEmpty(msg))
  1327. {
  1328. return Error(msg);
  1329. }
  1330. else
  1331. {
  1332. return Success("操作成功!");
  1333. }
  1334. }
  1335. /// <summary>
  1336. ///
  1337. /// </summary>
  1338. /// <param name="keyValue"></param>
  1339. /// <returns></returns>
  1340. [HttpPost]
  1341. public ActionResult IQC1Back(string keyValue)
  1342. {
  1343. string msg = app.IQC1Back(keyValue);
  1344. if (!string.IsNullOrEmpty(msg))
  1345. {
  1346. return Error(msg);
  1347. }
  1348. else
  1349. {
  1350. return Success("操作成功!");
  1351. }
  1352. }
  1353. /// <summary>
  1354. /// 获取单个
  1355. /// </summary>
  1356. /// <param name="keyValue"></param>
  1357. /// <returns></returns>
  1358. [HttpGet]
  1359. public ActionResult GetMaterialCheckMain(string keyValue)
  1360. {
  1361. var dt = app.GetMaterialCheckMain(keyValue);
  1362. return Content(dt.ToJson());
  1363. }
  1364. /// <summary>
  1365. /// 获取单个
  1366. /// </summary>
  1367. /// <param name="keyValue"></param>
  1368. /// <returns></returns>
  1369. [HttpGet]
  1370. public ActionResult GetMaterialCheckMain2(string keyValue,decimal qty)
  1371. {
  1372. var dt = app.GetMaterialCheckMain2(keyValue, qty);
  1373. return Content(dt.ToJson());
  1374. }
  1375. /// <summary>
  1376. /// 获取尺寸检验项目
  1377. /// </summary>
  1378. /// <param name="keyValue"></param>
  1379. /// <returns></returns>
  1380. [HttpGet]
  1381. public ActionResult GetMaterialCheckMain4CC(string keyValue)
  1382. {
  1383. var dt = app.GetMaterialCheckMain4CC(keyValue);
  1384. return Content(dt.ToJson());
  1385. }
  1386. /// <summary>
  1387. /// 获取外观检验项目
  1388. /// </summary>
  1389. /// <param name="keyValue"></param>
  1390. /// <returns></returns>
  1391. [HttpGet]
  1392. public ActionResult GetMaterialCheckMain4WG(string keyValue)
  1393. {
  1394. var dt = app.GetMaterialCheckMain4WG(keyValue);
  1395. return Content(dt.ToJson());
  1396. }
  1397. /// <summary>
  1398. /// 获取性能检验项目
  1399. /// </summary>
  1400. /// <param name="keyValue"></param>
  1401. /// <returns></returns>
  1402. [HttpGet]
  1403. public ActionResult GetMaterialCheckMain4XN(string keyValue)
  1404. {
  1405. var dt = app.GetMaterialCheckMain4XN(keyValue);
  1406. return Content(dt.ToJson());
  1407. }
  1408. /// <summary>
  1409. /// 保存来料检验
  1410. /// </summary>
  1411. /// <param name="keyValue"></param>
  1412. /// <returns></returns>
  1413. [HttpPost]
  1414. public ActionResult SaveMaterialCheckResult(string keyValue)
  1415. {
  1416. string msg = app.SaveMaterialCheckResult(keyValue);
  1417. if (!string.IsNullOrEmpty(msg))
  1418. {
  1419. return Error(msg);
  1420. }
  1421. else
  1422. {
  1423. return Success("操作成功!");
  1424. }
  1425. }
  1426. /// <summary>
  1427. /// 查询来料复判列表
  1428. /// </summary>
  1429. /// <param name="pagination"></param>
  1430. /// <param name="queryJson"></param>
  1431. /// <returns></returns>
  1432. [HttpPost]
  1433. public ActionResult GetMaterialInStorageFinalPageList(Pagination pagination, string queryJson)
  1434. {
  1435. DataTable ListData = app.GetMaterialInStorageFinalPageList(queryJson, ref pagination);
  1436. var JsonData = new
  1437. {
  1438. total = pagination.total,
  1439. page = pagination.page,
  1440. records = pagination.records,
  1441. rows = ListData,
  1442. };
  1443. return Content(JsonData.ToJson());
  1444. }
  1445. /// <summary>
  1446. /// 获取单个复判表头
  1447. /// </summary>
  1448. /// <param name="keyValue"></param>
  1449. /// <returns></returns>
  1450. [HttpGet]
  1451. public ActionResult GetMaterialReJudgeMain(string keyValue)
  1452. {
  1453. var dt = app.GetMaterialReJudgeMain(keyValue);
  1454. return Content(dt.ToJson());
  1455. }
  1456. /// <summary>
  1457. /// 保存复判结果
  1458. /// </summary>
  1459. /// <param name="keyValue"></param>
  1460. /// <returns></returns>
  1461. [HttpPost]
  1462. public ActionResult SaveMaterialCheckReJudgeResult(string keyValue)
  1463. {
  1464. string msg = app.SaveMaterialCheckReJudgeResult(keyValue);
  1465. if (!string.IsNullOrEmpty(msg))
  1466. {
  1467. return Error(msg);
  1468. }
  1469. else
  1470. {
  1471. return Success("操作成功!");
  1472. }
  1473. }
  1474. /// <summary>
  1475. /// 保存最终复判结果
  1476. /// </summary>
  1477. /// <param name="keyValue"></param>
  1478. /// <returns></returns>
  1479. [HttpPost]
  1480. public ActionResult SaveMaterialCheckFinalJudgeResult(string keyValue)
  1481. {
  1482. string msg = app.SaveMaterialCheckFinalJudgeResult(keyValue);
  1483. if (!string.IsNullOrEmpty(msg))
  1484. {
  1485. return Error(msg);
  1486. }
  1487. else
  1488. {
  1489. return Success("操作成功!");
  1490. }
  1491. }
  1492. /// <summary>
  1493. /// 获取所有不良状态
  1494. /// </summary>
  1495. /// <param name="keyValue"></param>
  1496. /// <returns></returns>
  1497. [HttpGet]
  1498. public ActionResult GetSelectBadCodeGroupList()
  1499. {
  1500. var dt = app.GetSelectBadCodeGroupList();
  1501. return Content(dt.ToJson());
  1502. }
  1503. /// <summary>
  1504. /// 获取所有不良现象
  1505. /// </summary>
  1506. /// <param name="keyValue"></param>
  1507. /// <returns></returns>
  1508. [HttpGet]
  1509. public ActionResult GetSelectBadReasonGroupList()
  1510. {
  1511. var dt = app.GetSelectBadReasonGroupList();
  1512. return Content(dt.ToJson());
  1513. }
  1514. /// <summary>
  1515. /// 获取不良现象明细
  1516. /// </summary>
  1517. /// <param name="keyValue"></param>
  1518. /// <returns></returns>
  1519. [HttpGet]
  1520. public ActionResult GetSelectBadReasonList(string keyValue)
  1521. {
  1522. var dt = app.GetSelectBadReasonList(keyValue);
  1523. return Content(dt.ToJson());
  1524. }
  1525. /// <summary>
  1526. /// 获取自定义档案列表
  1527. /// </summary>
  1528. /// <param name="keyValue"></param>
  1529. /// <returns></returns>
  1530. [HttpGet]
  1531. public ActionResult GetSelectItemList(string keyValue)
  1532. {
  1533. var dt = app.GetSelectItemList(keyValue);
  1534. return Content(dt.ToJson());
  1535. }
  1536. /// <summary>
  1537. /// 获取尺寸检验项目
  1538. /// </summary>
  1539. /// <param name="keyValue"></param>
  1540. /// <returns></returns>
  1541. [HttpGet]
  1542. public ActionResult GetFTPFile(string keyValue)
  1543. {
  1544. var rows = app.GetFTPFile(keyValue);
  1545. return Content(rows.ToJson());
  1546. }
  1547. [HttpGet]
  1548. public ActionResult GetFTPToPath(string pathName, string FTPTopPath, string materialCode, string version)
  1549. {
  1550. var rows = app.GetFTPToPath(pathName, FTPTopPath, materialCode, version);
  1551. return Content(rows.ToJson());
  1552. }
  1553. public ActionResult GetInvcode(Pagination pagination, string queryJson)
  1554. {
  1555. DataTable ListData = app.GetInvcode(queryJson, ref pagination);
  1556. var JsonData = new
  1557. {
  1558. total = pagination.total,
  1559. page = pagination.page,
  1560. records = pagination.records,
  1561. rows = ListData,
  1562. };
  1563. return Content(JsonData.ToJson());
  1564. }
  1565. }
  1566. }