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.

3931 lines
117 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using System;
  3. using System.Data;
  4. using System.IO;
  5. using System.Web;
  6. using System.Web.Mvc;
  7. using NFine.Code;
  8. using System.Data.SqlClient;
  9. using NFine.Data.Extensions;
  10. using System.Collections.Generic;
  11. using ICS.Application.Entity;
  12. using Newtonsoft.Json;
  13. //using System.Web.Http;
  14. namespace NFine.Web.Areas.WMS.Controllers
  15. {
  16. public class BasicSettingsController : ControllerBase
  17. {
  18. BasicSettingsApp App = new BasicSettingsApp();
  19. /// <summary>
  20. /// 加载仓库
  21. /// </summary>
  22. /// <returns></returns>
  23. [HttpGet]
  24. public ActionResult Warehouse()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 加载库位
  30. /// </summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult ICSStackWMS()
  34. {
  35. return View();
  36. }
  37. /// <summary>
  38. ///修改库位
  39. /// </summary>
  40. /// <returns></returns>
  41. [HttpGet]
  42. public ActionResult ICSStackWMSUpdate()
  43. {
  44. return View();
  45. }
  46. /// <summary>
  47. /// 物料档案
  48. /// </summary>
  49. /// <returns></returns>
  50. [HttpGet]
  51. public ActionResult ICSINVENTORY()
  52. {
  53. return View();
  54. }
  55. /// <summary>
  56. /// 物料档案(得易仕)
  57. /// </summary>
  58. /// <returns></returns>
  59. [HttpGet]
  60. public ActionResult ICSINVENTORYByDYS()
  61. {
  62. return View();
  63. }
  64. /// <summary>
  65. /// 不良代码组
  66. /// </summary>
  67. /// <returns></returns>
  68. [HttpGet]
  69. public ActionResult ICSECG()
  70. {
  71. return View();
  72. }
  73. /// <summary>
  74. /// 加载仓库
  75. /// </summary>
  76. /// <returns></returns>
  77. [HttpGet]
  78. public ActionResult WarehouseApplyNegAdd()
  79. {
  80. return View();
  81. }
  82. /// <summary>
  83. /// 加载仓库
  84. /// </summary>
  85. /// <returns></returns>
  86. [HttpGet]
  87. public ActionResult WarehouseApplyNegUpdate()
  88. {
  89. return View();
  90. }
  91. /// <summary>
  92. ///
  93. /// </summary>
  94. /// <returns></returns>
  95. [HttpGet]
  96. public ActionResult ICSVenderAdd()
  97. {
  98. return View();
  99. }
  100. /// <summary>
  101. ///
  102. /// </summary>
  103. /// <returns></returns>
  104. [HttpGet]
  105. public ActionResult ICSDepartmentAdd()
  106. {
  107. return View();
  108. }
  109. /// <summary>
  110. ///
  111. /// </summary>
  112. /// <returns></returns>
  113. [HttpGet]
  114. public ActionResult ICSPDAAPIErrorHandle()
  115. {
  116. return View();
  117. }
  118. [HttpGet]
  119. public ActionResult ICSContainerAddMore()
  120. {
  121. return View();
  122. }
  123. /// <summary>
  124. /// 获取料品信息
  125. /// </summary>
  126. /// <param name="pagination"></param>
  127. /// <returns></returns>
  128. [HttpGet]
  129. public ActionResult GetICSWarehouseInfoId(string ID, Pagination pagination)
  130. {
  131. DataTable ListData = App.GetICSWarehouseInfoId(ID, ref pagination);
  132. var JsonData = new
  133. {
  134. total = pagination.total,
  135. page = pagination.page,
  136. records = pagination.records,
  137. rows = ListData,
  138. };
  139. return Content(JsonData.ToJson());
  140. }
  141. [HttpGet]
  142. public ActionResult ICSSDN()
  143. {
  144. return View();
  145. }
  146. /// <summary>
  147. /// 不良代码维护
  148. /// </summary>
  149. /// <returns></returns>
  150. [HttpGet]
  151. public ActionResult ICSBadCode()
  152. {
  153. return View();
  154. }
  155. /// <summary>
  156. /// 新增库位信息
  157. /// </summary>
  158. /// <returns></returns>
  159. [HttpGet]
  160. public ActionResult ICSStackWMSAdd()
  161. {
  162. return View();
  163. }
  164. [HttpGet]
  165. /// <summary>
  166. /// 标签模板维护
  167. /// </summary>
  168. /// <returns></returns>
  169. public ActionResult ICSLableManage()
  170. {
  171. return View();
  172. }
  173. public ActionResult ICSLableManageAdd()
  174. {
  175. return View();
  176. }
  177. /// <summary>
  178. /// 新增不良代码
  179. /// </summary>
  180. /// <returns></returns>
  181. public ActionResult ICSBadCodeAdd()
  182. {
  183. return View();
  184. }
  185. /// <summary>
  186. /// 类型维护
  187. /// </summary>
  188. /// <returns></returns>
  189. public ActionResult ICSTypeMaintain()
  190. {
  191. return View();
  192. }
  193. /// <summary>
  194. /// 站点维护
  195. /// </summary>
  196. /// <returns></returns>
  197. public ActionResult Sys_WorkPoint()
  198. {
  199. return View();
  200. }
  201. /// <summary>
  202. /// 新增站点
  203. /// </summary>
  204. /// <returns></returns>
  205. public ActionResult Sys_WorkPointAdd()
  206. {
  207. return View();
  208. }
  209. /// 新增类型
  210. /// </summary>
  211. /// <returns></returns>
  212. [HttpGet]
  213. public ActionResult ICSTypeMaintainAdd()
  214. {
  215. return View();
  216. }
  217. /// <summary>
  218. /// 配置参数维护
  219. /// </summary>
  220. /// <returns></returns>
  221. public ActionResult ICSConfiguration()
  222. {
  223. return View();
  224. }
  225. /// <summary>
  226. /// 启用配置
  227. /// </summary>
  228. /// <returns></returns>
  229. public ActionResult ICSExtensionEnable()
  230. {
  231. return View();
  232. }
  233. /// <summary>
  234. /// 单据启用配置
  235. /// </summary>
  236. /// <returns></returns>
  237. public ActionResult ICSColumnEnable()
  238. {
  239. return View();
  240. }
  241. /// <summary>
  242. /// 新增启用配置
  243. /// </summary>
  244. /// <returns></returns>
  245. public ActionResult ICSExtensionEnableAdd()
  246. {
  247. return View();
  248. }
  249. /// <summary>
  250. /// 新增单据启用配置
  251. /// </summary>
  252. /// <returns></returns>
  253. public ActionResult ICSColumnEnableAdd()
  254. {
  255. return View();
  256. }
  257. /// 新增类型
  258. /// </summary>
  259. /// <returns></returns>
  260. [HttpGet]
  261. public ActionResult ICSConfigurationAdd()
  262. {
  263. return View();
  264. }
  265. /// 不良原因组
  266. /// </summary>
  267. /// <returns></returns>
  268. [HttpGet]
  269. public ActionResult ICSBadReasonGroup()
  270. {
  271. return View();
  272. }
  273. /// 新增不良原因组
  274. /// </summary>
  275. /// <returns></returns>
  276. [HttpGet]
  277. public ActionResult ICSBadReasonGroupAdd()
  278. {
  279. return View();
  280. }
  281. /// 新增不良原因组
  282. /// </summary>
  283. /// <returns></returns>
  284. [HttpGet]
  285. public ActionResult ICSInventoryBadGroupAdd()
  286. {
  287. return View();
  288. }
  289. //包装容器绑定
  290. [HttpGet]
  291. public ActionResult ICSContainerBinding()
  292. {
  293. return View();
  294. }
  295. //维护条码过期时间
  296. [HttpGet]
  297. public ActionResult MaintainBarcodeTime()
  298. {
  299. return View();
  300. }
  301. //维护条码过期时间
  302. [HttpGet]
  303. public ActionResult MaintainBarcodeTimeUpdate()
  304. {
  305. return View();
  306. }
  307. //维护批次过期时间
  308. [HttpGet]
  309. public ActionResult MaintainBatchTime()
  310. {
  311. return View();
  312. }
  313. //维护批次过期时间
  314. [HttpGet]
  315. public ActionResult MaintainBatchTimeUpdate()
  316. {
  317. return View();
  318. }
  319. //多语言
  320. [HttpGet]
  321. public ActionResult ICSlanguage()
  322. {
  323. return View();
  324. }
  325. [HttpGet]
  326. public ActionResult ICSlanguageAdd()
  327. {
  328. return View();
  329. }
  330. [HttpGet]
  331. public ActionResult ICSInventoryInspectionRulesGroup()
  332. {
  333. return View();
  334. }
  335. [HttpGet]
  336. public ActionResult ICSInventoryInspectionRulesGroupAdd()
  337. {
  338. return View();
  339. }
  340. /// <summary>
  341. /// 检验规则
  342. /// </summary>
  343. /// <returns></returns>
  344. [HttpGet]
  345. public ActionResult ICSInspectionRulesGroup()
  346. {
  347. return View();
  348. }
  349. [HttpGet]
  350. public ActionResult ICSInspectionRulesListAdd()
  351. {
  352. return View();
  353. }
  354. [HttpGet]
  355. public ActionResult ICSVender()
  356. {
  357. return View();
  358. }
  359. [HttpGet]
  360. //不良代码
  361. public ActionResult GetICSBadCodeGroup(Pagination pagination, string queryJson)
  362. {
  363. DataTable ListData = App.GetICSBadCodeGroup(ref pagination, queryJson);
  364. var JsonData = new
  365. {
  366. total = pagination.total,
  367. page = pagination.page,
  368. records = pagination.records,
  369. rows = ListData,
  370. };
  371. return Content(JsonData.ToJson());
  372. }
  373. //不良原因()
  374. public ActionResult GetICSBadReasonGroup(Pagination pagination, string queryJson)
  375. {
  376. DataTable ListData = App.GetICSBadReasonGroup(ref pagination, queryJson);
  377. var JsonData = new
  378. {
  379. total = pagination.total,
  380. page = pagination.page,
  381. records = pagination.records,
  382. rows = ListData,
  383. };
  384. return Content(JsonData.ToJson());
  385. }
  386. //不良代码子表
  387. [HttpGet]
  388. [HandlerAjaxOnly]
  389. public ActionResult GetICSBadCodeGroupdetil(string ID, Pagination pagination)
  390. {
  391. DataTable ListData = App.GetICSBadCodeGroupdetil(ID, ref pagination);
  392. var JsonData = new
  393. {
  394. total = pagination.total,
  395. page = pagination.page,
  396. records = pagination.records,
  397. rows = ListData,
  398. };
  399. return Content(JsonData.ToJson());
  400. }
  401. [HttpGet]
  402. public ActionResult GetICSBadCodeGroupdetil2(string ID, Pagination pagination)
  403. {
  404. var data = App.GetICSBadCodeGroupdetil2(ID, ref pagination);
  405. var JsonData = new
  406. {
  407. total = pagination.total,
  408. page = pagination.page,
  409. records = pagination.records,
  410. rows = data,
  411. };
  412. return Content(JsonData.ToJson());
  413. }
  414. //不良原因子表
  415. [HttpGet]
  416. [HandlerAjaxOnly]
  417. public ActionResult GetICSBadReason(string BRGroupID, Pagination pagination)
  418. {
  419. DataTable ListData = App.GetICSBadReason(BRGroupID, ref pagination);
  420. var JsonData = new
  421. {
  422. total = pagination.total,
  423. page = pagination.page,
  424. records = pagination.records,
  425. rows = ListData,
  426. };
  427. return Content(JsonData.ToJson());
  428. }
  429. [HttpGet]
  430. public ActionResult GetICSBadReason2(string BID, Pagination pagination)
  431. {
  432. var ListData = App.GetICSBadReason2(BID, ref pagination);
  433. var JsonData = new
  434. {
  435. total = pagination.total,
  436. page = pagination.page,
  437. records = pagination.records,
  438. rows = ListData,
  439. };
  440. return Content(JsonData.ToJson());
  441. //return Content(data.ToJson());
  442. }
  443. [HttpGet]
  444. public ActionResult ICSInspectionGroup()
  445. {
  446. return View();
  447. }
  448. [HttpGet]
  449. public ActionResult ICSInspectionListAdd()
  450. {
  451. return View();
  452. }
  453. [HttpGet]
  454. public ActionResult ICSINVEBTORYAdd()
  455. {
  456. return View();
  457. }
  458. [HttpGet]
  459. public ActionResult ICSINVEBTORYAddByDYS()
  460. {
  461. return View();
  462. }
  463. [HttpGet]
  464. public ActionResult ICSInventoryBatchEnable()
  465. {
  466. return View();
  467. }
  468. [HttpGet]
  469. public ActionResult ICSInventoryBatchEnableAdd()
  470. {
  471. return View();
  472. }
  473. [HttpGet]
  474. public ActionResult ICSInventoryBatchEnableUpadte()
  475. {
  476. return View();
  477. }
  478. [HttpGet]
  479. public ActionResult ICSInventoryLocation()
  480. {
  481. return View();
  482. }
  483. [HttpGet]
  484. public ActionResult ICSInventoryLocationAdd()
  485. {
  486. return View();
  487. }
  488. [HttpGet]
  489. public ActionResult ICSInventoryLocationUpdate()
  490. {
  491. return View();
  492. }
  493. [HttpGet]
  494. public ActionResult ICSContainer()
  495. {
  496. return View();
  497. }
  498. [HttpGet]
  499. public ActionResult ICSContainerAdd()
  500. {
  501. return View();
  502. }
  503. [HttpGet]
  504. public ActionResult ICSContainerLot()
  505. {
  506. return View();
  507. }
  508. [HttpGet]
  509. public ActionResult ICSContainerLotAdd()
  510. {
  511. return View();
  512. }
  513. [HttpGet]
  514. public ActionResult ICSInventoryBadGroup()
  515. {
  516. return View();
  517. }
  518. [HttpGet]
  519. public ActionResult ICSInventoryBadGroupUpdate()
  520. {
  521. return View();
  522. }
  523. [HttpGet]
  524. public ActionResult ICSLabelTemplate()
  525. {
  526. return View();
  527. }
  528. [HttpGet]
  529. public ActionResult ICSLabelTemplateAdd()
  530. {
  531. return View();
  532. }
  533. [HttpGet]
  534. public ActionResult ICSContainerLotBinding()
  535. {
  536. return View();
  537. }
  538. //料品检验项目组
  539. [HttpGet]
  540. public ActionResult ICSInventoryInspectionGroup()
  541. {
  542. return View();
  543. }
  544. [HttpGet]
  545. public ActionResult ICSInventoryInspectionGroupAdd()
  546. {
  547. return View();
  548. }
  549. [HttpGet]
  550. public ActionResult ICSSearchInventory()
  551. {
  552. return View();
  553. }
  554. [HttpGet]
  555. public ActionResult Sys_WorkPointClone()
  556. {
  557. return View();
  558. }
  559. public ActionResult CleanUpTableData()
  560. {
  561. return View();
  562. }
  563. /// <summary>
  564. /// 删除库位
  565. /// </summary>
  566. /// <returns></returns>
  567. [HttpPost]
  568. [HandlerAjaxOnly]
  569. [ValidateAntiForgeryToken]
  570. public ActionResult DeleteStack(string keyValue)
  571. {
  572. string msg = App.DeleteStack(keyValue);
  573. if (string.IsNullOrEmpty(msg))
  574. {
  575. return Success("删除成功!");
  576. }
  577. else
  578. {
  579. return Error(msg);
  580. //throw new Exception(msg);
  581. }
  582. }
  583. /// <summary>
  584. /// 删除不良原因
  585. /// </summary>
  586. /// <returns></returns>
  587. [HttpPost]
  588. [HandlerAjaxOnly]
  589. [ValidateAntiForgeryToken]
  590. public ActionResult DeleteBadCode(string keyValue)
  591. {
  592. string msg = App.DeleteBadCode(keyValue);
  593. if (string.IsNullOrEmpty(msg))
  594. {
  595. return Success("删除成功!");
  596. }
  597. else
  598. {
  599. return Error(msg);
  600. }
  601. }
  602. [HttpPost]
  603. [HandlerAjaxOnly]
  604. public ActionResult InsertStack(string keyValue)
  605. {
  606. string msg = App.InsertStack(keyValue);
  607. if (!string.IsNullOrEmpty(msg))
  608. {
  609. return Error(msg);
  610. }
  611. else
  612. {
  613. return Success("添加成功!");
  614. }
  615. }
  616. [HttpPost]
  617. [HandlerAjaxOnly]
  618. public ActionResult InsertBadCode(string keyValue)
  619. {
  620. string msg = App.InsertBadCode(keyValue);
  621. try
  622. {
  623. if (!string.IsNullOrEmpty(msg))
  624. {
  625. return Error(msg);
  626. }
  627. else
  628. {
  629. return Success("添加成功!");
  630. }
  631. }
  632. catch (Exception ex)
  633. {
  634. return Error(ex.Message);
  635. }
  636. }
  637. [HttpPost]
  638. [HandlerAjaxOnly]
  639. public ActionResult UpdateBadCode(string keyValue)
  640. {
  641. string msg = App.UpdateBadCode(keyValue);
  642. if (!string.IsNullOrEmpty(msg))
  643. {
  644. return Error(msg);
  645. }
  646. else
  647. {
  648. return Success("修改成功!");
  649. }
  650. }
  651. [HttpPost]
  652. [HandlerAjaxOnly]
  653. public ActionResult UpdateStack(string keyValue)
  654. {
  655. string msg = App.UpdateStack(keyValue);
  656. if (!string.IsNullOrEmpty(msg))
  657. {
  658. return Error(msg);
  659. }
  660. else
  661. {
  662. return Success("修改成功!");
  663. }
  664. }
  665. /// <summary>
  666. /// 获取库位信息
  667. /// </summary>
  668. /// <returns></returns>
  669. public ActionResult GetWarehouse()
  670. {
  671. DataTable dt = App.GetWarehouse();
  672. return Content(dt.ToJson());
  673. }
  674. /// <summary>
  675. /// 新增类型
  676. /// </summary>
  677. /// <param name="keyValue"></param>
  678. /// <returns></returns>
  679. [HttpPost]
  680. [HandlerAjaxOnly]
  681. public ActionResult InsertICSType(string keyValue)
  682. {
  683. string msg = App.InsertICSType(keyValue);
  684. if (!string.IsNullOrEmpty(msg))
  685. {
  686. return Error(msg);
  687. }
  688. else
  689. {
  690. return Success("添加成功!");
  691. }
  692. }
  693. /// <summary>
  694. /// 修改类型
  695. /// </summary>
  696. /// <param name="keyValue"></param>
  697. /// <returns></returns>
  698. [HttpPost]
  699. [HandlerAjaxOnly]
  700. public ActionResult UpdateICSType(string keyValue)
  701. {
  702. string msg = App.UpdateICSType(keyValue);
  703. if (!string.IsNullOrEmpty(msg))
  704. {
  705. return Error(msg);
  706. }
  707. else
  708. {
  709. return Success("修改成功!");
  710. }
  711. }
  712. /// <summary>
  713. /// 删除类型
  714. /// </summary>
  715. /// <returns></returns>
  716. [HttpPost]
  717. [HandlerAjaxOnly]
  718. [ValidateAntiForgeryToken]
  719. public ActionResult DeleteICSType(string keyValue)
  720. {
  721. string msg = App.DeleteICSType(keyValue);
  722. if (string.IsNullOrEmpty(msg))
  723. {
  724. return Success("删除成功!");
  725. }
  726. else
  727. {
  728. return Error(msg);
  729. }
  730. }
  731. /// <summary>
  732. /// 修改配置参数
  733. /// </summary>
  734. /// <param name="keyValue"></param>
  735. /// <returns></returns>
  736. [HttpPost]
  737. [HandlerAjaxOnly]
  738. public ActionResult UpdateICSConfiguration(string keyValue)
  739. {
  740. string msg = App.UpdateICSConfiguration(keyValue);
  741. if (!string.IsNullOrEmpty(msg))
  742. {
  743. return Error(msg);
  744. }
  745. else
  746. {
  747. return Success("修改成功!");
  748. }
  749. }
  750. /// <summary>
  751. /// 新增参数配置
  752. /// </summary>
  753. /// <param name="keyValue"></param>
  754. /// <returns></returns>
  755. [HttpPost]
  756. [HandlerAjaxOnly]
  757. public ActionResult InsertICSConfiguration(string keyValue)
  758. {
  759. string msg = App.InsertICSConfiguration(keyValue);
  760. if (!string.IsNullOrEmpty(msg))
  761. {
  762. return Error(msg);
  763. }
  764. else
  765. {
  766. return Success("添加成功!");
  767. }
  768. }
  769. /// <summary>
  770. /// 删除参数配置
  771. /// </summary>
  772. /// <returns></returns>
  773. [HttpPost]
  774. [HandlerAjaxOnly]
  775. [ValidateAntiForgeryToken]
  776. public ActionResult DeleteICSConfiguration(string keyValue)
  777. {
  778. string msg = App.DeleteICSConfiguration(keyValue);
  779. if (string.IsNullOrEmpty(msg))
  780. {
  781. return Success("删除成功!");
  782. }
  783. else
  784. {
  785. return Error(msg);
  786. }
  787. }
  788. /// <summary>
  789. /// 修改启用配置
  790. /// </summary>
  791. /// <param name="keyValue"></param>
  792. /// <returns></returns>
  793. [HttpPost]
  794. [HandlerAjaxOnly]
  795. public ActionResult UpdateICSExtensionEnable(string keyValue)
  796. {
  797. string msg = App.UpdateICSExtensionEnable(keyValue);
  798. if (!string.IsNullOrEmpty(msg))
  799. {
  800. return Error(msg);
  801. }
  802. else
  803. {
  804. return Success("修改成功!");
  805. }
  806. }
  807. /// <summary>
  808. /// 修改启用配置
  809. /// </summary>
  810. /// <param name="keyValue"></param>
  811. /// <returns></returns>
  812. [HttpPost]
  813. [HandlerAjaxOnly]
  814. public ActionResult UpdateICSColumnEnable(string keyValue)
  815. {
  816. string msg = App.UpdateICSColumnEnable(keyValue);
  817. if (!string.IsNullOrEmpty(msg))
  818. {
  819. return Error(msg);
  820. }
  821. else
  822. {
  823. return Success("修改成功!");
  824. }
  825. }
  826. /// <summary>
  827. /// 新增启用配置
  828. /// </summary>
  829. /// <param name="keyValue"></param>
  830. /// <returns></returns>
  831. [HttpPost]
  832. [HandlerAjaxOnly]
  833. public ActionResult InsertICSExtensionEnable(string keyValue)
  834. {
  835. string msg = App.InsertICSExtensionEnable(keyValue);
  836. if (!string.IsNullOrEmpty(msg))
  837. {
  838. return Error(msg);
  839. }
  840. else
  841. {
  842. return Success("添加成功!");
  843. }
  844. }
  845. /// <summary>
  846. /// 新增单据启用配置
  847. /// </summary>
  848. /// <param name="keyValue"></param>
  849. /// <returns></returns>
  850. [HttpPost]
  851. [HandlerAjaxOnly]
  852. public ActionResult InsertICSColumnEnable(string keyValue)
  853. {
  854. string msg = App.InsertICSColumnEnable(keyValue);
  855. if (!string.IsNullOrEmpty(msg))
  856. {
  857. return Error(msg);
  858. }
  859. else
  860. {
  861. return Success("添加成功!");
  862. }
  863. }
  864. /// <summary>
  865. /// 删除启用配置
  866. /// </summary>
  867. /// <returns></returns>
  868. [HttpPost]
  869. [HandlerAjaxOnly]
  870. [ValidateAntiForgeryToken]
  871. public ActionResult DeleteICSExtensionEnable(string keyValue)
  872. {
  873. string msg = App.DeleteICSExtensionEnable(keyValue);
  874. if (string.IsNullOrEmpty(msg))
  875. {
  876. return Success("删除成功!");
  877. }
  878. else
  879. {
  880. return Error(msg);
  881. }
  882. }
  883. /// <summary>
  884. /// 删除单据启用配置
  885. /// </summary>
  886. /// <returns></returns>
  887. [HttpPost]
  888. [HandlerAjaxOnly]
  889. [ValidateAntiForgeryToken]
  890. public ActionResult DeleteICSColumnEnable(string keyValue)
  891. {
  892. string msg = App.DeleteICSColumnEnable(keyValue);
  893. if (string.IsNullOrEmpty(msg))
  894. {
  895. return Success("删除成功!");
  896. }
  897. else
  898. {
  899. return Error(msg);
  900. }
  901. }
  902. [HttpGet]
  903. public ActionResult DeleteBCItem(string ID)
  904. {
  905. try
  906. {
  907. App.DeleteBCItem(ID);
  908. return Success("删除成功!");
  909. }
  910. catch (Exception ex)
  911. {
  912. return Error(ex.Message);
  913. }
  914. }
  915. [HttpGet]
  916. public ActionResult DeleteINvItem(string ID)
  917. {
  918. try
  919. {
  920. App.DeleteItem(ID);
  921. return Success("删除成功!");
  922. }
  923. catch (Exception ex)
  924. {
  925. return Error(ex.Message);
  926. }
  927. }
  928. //不良代码组新增
  929. [HttpPost]
  930. public ActionResult SubICSBadCodeGroupAdd(ICSBadReason main, string BRGCode, string BRGDesc)
  931. {
  932. try
  933. {
  934. App.SubICSBadCodeGroupAdd(main, BRGCode, BRGDesc);
  935. return Success("保存成功!");
  936. }
  937. catch (Exception ex)
  938. {
  939. return Error(ex.Message);
  940. }
  941. }
  942. //不良原因组新增
  943. [HttpPost]
  944. public ActionResult SubICSBadReasonGroupAdd(ICSBadReason main, string BRGCode, string BRGDesc)
  945. {
  946. try
  947. {
  948. App.SubICSBadReasonGroupAdd(main, BRGCode, BRGDesc);
  949. return Success("保存成功!");
  950. }
  951. catch (Exception ex)
  952. {
  953. return Error(ex.Message);
  954. }
  955. }
  956. //不良代码组修改
  957. [HttpPost]
  958. public ActionResult UpdateICSBadCodeGroup(ICSBadReason main, string BID, string BRGCode, string BRGDesc)
  959. {
  960. try
  961. {
  962. App.UpdateICSBadCodeGroup(main, BID, BRGCode, BRGDesc);
  963. return Success("修改成功!");
  964. }
  965. catch (Exception ex)
  966. {
  967. return Error(ex.Message);
  968. }
  969. }
  970. //不良原因组修改
  971. [HttpPost]
  972. public ActionResult UpdateICSBadReasonGroup(ICSBadReason main, string BID, string BRGCode, string BRGDesc)
  973. {
  974. try
  975. {
  976. App.UpdateICSBadReasonGroup(main, BID, BRGCode, BRGDesc);
  977. return Success("修改成功!");
  978. }
  979. catch (Exception ex)
  980. {
  981. return Error(ex.Message);
  982. }
  983. }
  984. /// <summary>
  985. /// 删除不良代码组
  986. /// </summary>
  987. /// <returns></returns>
  988. [HttpPost]
  989. [HandlerAjaxOnly]
  990. [ValidateAntiForgeryToken]
  991. public ActionResult DeleteICSBadCodeGroup(string keyValue)
  992. {
  993. string msg = App.DeleteICSBadCodeGroup(keyValue);
  994. if (string.IsNullOrEmpty(msg))
  995. {
  996. return Success("删除成功!");
  997. }
  998. else
  999. {
  1000. return Error(msg);
  1001. }
  1002. }
  1003. /// <summary>
  1004. /// 删除不良原因组
  1005. /// </summary>
  1006. /// <returns></returns>
  1007. [HttpPost]
  1008. [HandlerAjaxOnly]
  1009. [ValidateAntiForgeryToken]
  1010. public ActionResult DeleteICSBadReasonGroup(string keyValue)
  1011. {
  1012. string msg = App.DeleteICSBadReasonGroup(keyValue);
  1013. if (string.IsNullOrEmpty(msg))
  1014. {
  1015. return Success("删除成功!");
  1016. }
  1017. else
  1018. {
  1019. return Error(msg);
  1020. }
  1021. }
  1022. [HttpGet]
  1023. public ActionResult GetICSInspectionGroup(Pagination pagination, string queryJson)
  1024. {
  1025. DataTable ListData = App.GetICSInspectionGroup(ref pagination, queryJson);
  1026. var JsonData = new
  1027. {
  1028. total = pagination.total,
  1029. page = pagination.page,
  1030. records = pagination.records,
  1031. rows = ListData,
  1032. };
  1033. return Content(JsonData.ToJson());
  1034. }
  1035. [HttpGet]
  1036. [HandlerAjaxOnly]
  1037. public ActionResult ICSInspectionList(string GroupCode, Pagination pagination)
  1038. {
  1039. DataTable ListData = App.ICSInspectionList(GroupCode, ref pagination);
  1040. var JsonData = new
  1041. {
  1042. total = pagination.total,
  1043. page = pagination.page,
  1044. records = pagination.records,
  1045. rows = ListData,
  1046. };
  1047. return Content(JsonData.ToJson());
  1048. }
  1049. //删除自动表
  1050. [HttpGet]
  1051. public ActionResult DeleteList(string ID)
  1052. {
  1053. try
  1054. {
  1055. App.DeleteList(ID);
  1056. return Success("删除成功!");
  1057. }
  1058. catch (Exception ex)
  1059. {
  1060. return Error(ex.Message);
  1061. }
  1062. }
  1063. //检查项目组组修改
  1064. [ValidateInput(false)]
  1065. [HttpPost]
  1066. public ActionResult UpdateICSInspectionGroup(ICSInspectionList main, [System.Web.Http.FromBody] string attributteModel, string BID, string GroupCode, string GroupName, string Enable, string IQCStatus,string Type)
  1067. {
  1068. try
  1069. {
  1070. App.UpdateICSInspectionGroup(main,JsonConvert.DeserializeObject<List<EATTRIBUTEModel>>(attributteModel) , BID, GroupCode, GroupName, Enable, IQCStatus,Type);
  1071. return Success("修改成功!");
  1072. }
  1073. catch (Exception ex)
  1074. {
  1075. return Error(ex.Message);
  1076. }
  1077. }
  1078. //检查项目组新增
  1079. [HttpPost]
  1080. public ActionResult ICSInspectionGroupAdd(ICSInspectionList main, string attributteModel, string GroupCode, string GroupName, string Enable, string IQCStatus,string Type)
  1081. {
  1082. try
  1083. {
  1084. App.ICSInspectionGroupAdd(main, JsonConvert.DeserializeObject<List<EATTRIBUTEModel>>(attributteModel), GroupCode, GroupName, Enable, IQCStatus,Type);
  1085. return Success("保存成功!");
  1086. }
  1087. catch (Exception ex)
  1088. {
  1089. return Error(ex.Message);
  1090. }
  1091. }
  1092. /// <summary>
  1093. /// 动态子表修改加载页面
  1094. /// </summary>
  1095. /// <param name="GroupCode"></param>
  1096. /// <returns></returns>
  1097. [HttpGet]
  1098. public ActionResult ICSInspectionList2(string GroupCode)
  1099. {
  1100. var data = App.ICSInspectionList2(GroupCode);
  1101. return Content(data.ToJson());
  1102. }
  1103. /// <summary>
  1104. /// 删除不良原因组
  1105. /// </summary>
  1106. /// <returns></returns>
  1107. [HttpPost]
  1108. [HandlerAjaxOnly]
  1109. [ValidateAntiForgeryToken]
  1110. public ActionResult DeleteICSInspectionGroup(string keyValue)
  1111. {
  1112. string msg = App.DeleteICSInspectionGroup(keyValue);
  1113. if (string.IsNullOrEmpty(msg))
  1114. {
  1115. return Success("删除成功!");
  1116. }
  1117. else
  1118. {
  1119. return Error(msg);
  1120. }
  1121. }
  1122. /// <summary>
  1123. /// 新增料品属性
  1124. /// </summary>
  1125. /// <param name="keyValue"></param>
  1126. /// <returns></returns>
  1127. [HttpPost]
  1128. [HandlerAjaxOnly]
  1129. public ActionResult InsertICSInventory(string keyValue)
  1130. {
  1131. string msg = App.InsertICSInventory(keyValue);
  1132. if (!string.IsNullOrEmpty(msg))
  1133. {
  1134. return Error(msg);
  1135. }
  1136. else
  1137. {
  1138. return Success("添加成功!");
  1139. }
  1140. }
  1141. /// <summary>
  1142. /// 修改料品属性
  1143. /// </summary>
  1144. /// <param name="keyValue"></param>
  1145. /// <returns></returns>
  1146. [HttpPost]
  1147. [HandlerAjaxOnly]
  1148. public ActionResult UpdateICSInventory(string keyValue)
  1149. {
  1150. string msg = App.UpdateICSInventory(keyValue);
  1151. if (!string.IsNullOrEmpty(msg))
  1152. {
  1153. return Error(msg);
  1154. }
  1155. else
  1156. {
  1157. return Success("修改成功!");
  1158. }
  1159. }
  1160. /// <summary>
  1161. /// 新增部门
  1162. /// </summary>
  1163. /// <param name="keyValue"></param>
  1164. /// <returns></returns>
  1165. [HttpPost]
  1166. [HandlerAjaxOnly]
  1167. public ActionResult InsertICSDeptment(string keyValue)
  1168. {
  1169. string msg = App.InsertICSDeptment(keyValue);
  1170. if (!string.IsNullOrEmpty(msg))
  1171. {
  1172. return Error(msg);
  1173. }
  1174. else
  1175. {
  1176. return Success("添加成功!");
  1177. }
  1178. }
  1179. /// <summary>
  1180. /// 修改部门
  1181. /// </summary>
  1182. /// <param name="keyValue"></param>
  1183. /// <returns></returns>
  1184. [HttpPost]
  1185. [HandlerAjaxOnly]
  1186. public ActionResult UpdateICSDeptment(string keyValue)
  1187. {
  1188. string msg = App.UpdateICSDeptment(keyValue);
  1189. if (!string.IsNullOrEmpty(msg))
  1190. {
  1191. return Error(msg);
  1192. }
  1193. else
  1194. {
  1195. return Success("修改成功!");
  1196. }
  1197. }
  1198. /// <summary>
  1199. /// 删除部门
  1200. /// </summary>
  1201. /// <returns></returns>
  1202. [HttpPost]
  1203. [HandlerAjaxOnly]
  1204. [ValidateAntiForgeryToken]
  1205. public ActionResult DeleteICSDeptment(string keyValue)
  1206. {
  1207. string msg = App.DeleteICSDeptment(keyValue);
  1208. if (string.IsNullOrEmpty(msg))
  1209. {
  1210. return Success("删除成功!");
  1211. }
  1212. else
  1213. {
  1214. return Error(msg);
  1215. }
  1216. }
  1217. /// <summary>
  1218. /// 修改PDA版本
  1219. /// </summary>
  1220. /// <param name="keyValue"></param>
  1221. /// <returns></returns>
  1222. [HttpPost]
  1223. [HandlerAjaxOnly]
  1224. public ActionResult UpdatePDAVersion(string keyValue)
  1225. {
  1226. string msg = App.UpdatePDAVersion(keyValue);
  1227. if (!string.IsNullOrEmpty(msg))
  1228. {
  1229. return Error(msg);
  1230. }
  1231. else
  1232. {
  1233. return Success("修改成功!");
  1234. }
  1235. }
  1236. /// <summary>
  1237. /// 获取料品属性修改文本框值
  1238. /// </summary>
  1239. /// <param name="POCode"></param>
  1240. /// <param name="PORow"></param>
  1241. /// <returns></returns>
  1242. [HttpPost]
  1243. [HandlerAjaxOnly]
  1244. public ActionResult GetInputValue(string ID)
  1245. {
  1246. DataTable ListData = App.GetInputValue(ID);
  1247. var JsonData = new
  1248. {
  1249. rows = ListData,
  1250. };
  1251. return Content(JsonData.ToJson());
  1252. }
  1253. /// <summary>
  1254. /// 获取库位属性修改文本框值
  1255. /// </summary>
  1256. /// <param name="POCode"></param>
  1257. /// <param name="PORow"></param>
  1258. /// <returns></returns>
  1259. [HttpPost]
  1260. [HandlerAjaxOnly]
  1261. public ActionResult GetStackValue(string ID)
  1262. {
  1263. DataTable ListData = App.GetStackValue(ID);
  1264. var JsonData = new
  1265. {
  1266. rows = ListData,
  1267. };
  1268. return Content(JsonData.ToJson());
  1269. }
  1270. /// <summary>
  1271. /// 获取部门修改文本框值
  1272. /// </summary>
  1273. [HttpPost]
  1274. [HandlerAjaxOnly]
  1275. public ActionResult GetDepInputValue(string ID)
  1276. {
  1277. DataTable ListData = App.GetDepInputValue(ID);
  1278. var JsonData = new
  1279. {
  1280. rows = ListData,
  1281. };
  1282. return Content(JsonData.ToJson());
  1283. }
  1284. /// <summary>
  1285. /// 删除料品属性
  1286. /// </summary>
  1287. /// <returns></returns>
  1288. [HttpPost]
  1289. [HandlerAjaxOnly]
  1290. [ValidateAntiForgeryToken]
  1291. public ActionResult DeleteICSInventory(string keyValue)
  1292. {
  1293. string msg = App.DeleteICSInventory(keyValue);
  1294. if (string.IsNullOrEmpty(msg))
  1295. {
  1296. return Success("删除成功!");
  1297. }
  1298. else
  1299. {
  1300. return Error(msg);
  1301. }
  1302. }
  1303. /// <summary>
  1304. /// 获取料品信息
  1305. /// </summary>
  1306. /// <param name="pagination"></param>
  1307. /// <returns></returns>
  1308. [HttpGet]
  1309. public ActionResult GetICSInventoryInfo(string queryJson, Pagination pagination)
  1310. {
  1311. DataTable ListData = App.GetICSInventoryInfo(queryJson, ref pagination);
  1312. var JsonData = new
  1313. {
  1314. total = pagination.total,
  1315. page = pagination.page,
  1316. records = pagination.records,
  1317. rows = ListData,
  1318. };
  1319. return Content(JsonData.ToJson());
  1320. }
  1321. /// 获取仓库信息
  1322. /// </summary>
  1323. /// <param name="pagination"></param>
  1324. /// <returns></returns>
  1325. [HttpGet]
  1326. public ActionResult GetICSWarehouseInfo(string queryJson, Pagination pagination)
  1327. {
  1328. DataTable ListData = App.GetICSWarehouseInfo(queryJson, ref pagination);
  1329. var JsonData = new
  1330. {
  1331. total = pagination.total,
  1332. page = pagination.page,
  1333. records = pagination.records,
  1334. rows = ListData,
  1335. };
  1336. return Content(JsonData.ToJson());
  1337. }
  1338. /// <summary>
  1339. /// 新增料品仓库批次
  1340. /// </summary>
  1341. /// <param name="keyValue"></param>
  1342. /// <returns></returns>
  1343. [HttpPost]
  1344. [HandlerAjaxOnly]
  1345. public ActionResult InsertICSInventoryBatchEnable(string keyValue, string keyValue2)
  1346. {
  1347. string msg = App.InsertICSInventoryBatchEnable(keyValue, keyValue2);
  1348. if (!string.IsNullOrEmpty(msg))
  1349. {
  1350. return Error(msg);
  1351. }
  1352. else
  1353. {
  1354. return Success("添加成功!");
  1355. }
  1356. }
  1357. /// <summary>
  1358. /// 修改料品仓库批次关系
  1359. /// </summary>
  1360. /// <param name="keyValue"></param>
  1361. /// <returns></returns>
  1362. [HttpPost]
  1363. [HandlerAjaxOnly]
  1364. public ActionResult UpdateICSInventoryBatchEnable(string keyValue)
  1365. {
  1366. string msg = App.UpdateICSInventoryBatchEnable(keyValue);
  1367. if (!string.IsNullOrEmpty(msg))
  1368. {
  1369. return Error(msg);
  1370. }
  1371. else
  1372. {
  1373. return Success("修改成功!");
  1374. }
  1375. }
  1376. /// <summary>
  1377. /// 删除料品仓库批次关系
  1378. /// </summary>
  1379. /// <returns></returns>
  1380. [HttpPost]
  1381. [HandlerAjaxOnly]
  1382. [ValidateAntiForgeryToken]
  1383. public ActionResult DeleteICSInventoryBatchEnable(string keyValue)
  1384. {
  1385. string msg = App.DeleteICSInventoryBatchEnable(keyValue);
  1386. if (string.IsNullOrEmpty(msg))
  1387. {
  1388. return Success("删除成功!");
  1389. }
  1390. else
  1391. {
  1392. return Error(msg);
  1393. }
  1394. }
  1395. /// 获取库位信息
  1396. /// </summary>
  1397. /// <param name="pagination"></param>
  1398. /// <returns></returns>
  1399. [HttpGet]
  1400. public ActionResult GetICSLocation(string queryJson, Pagination pagination)
  1401. {
  1402. DataTable ListData = App.GetICSLocation(queryJson, ref pagination);
  1403. var JsonData = new
  1404. {
  1405. total = pagination.total,
  1406. page = pagination.page,
  1407. records = pagination.records,
  1408. rows = ListData,
  1409. };
  1410. return Content(JsonData.ToJson());
  1411. }
  1412. /// <summary>
  1413. /// 新增料品库位绑定关系
  1414. /// </summary>
  1415. /// <param name="keyValue"></param>
  1416. /// <returns></returns>
  1417. [HttpPost]
  1418. [HandlerAjaxOnly]
  1419. public ActionResult InsertICSInventoryLocation(string keyValue, string keyValue2)
  1420. {
  1421. string msg = App.InsertICSInventoryLocation(keyValue, keyValue2);
  1422. if (!string.IsNullOrEmpty(msg))
  1423. {
  1424. return Error(msg);
  1425. }
  1426. else
  1427. {
  1428. return Success("添加成功!");
  1429. }
  1430. }
  1431. /// <summary>
  1432. /// 修改料品库位绑定关系
  1433. /// </summary>
  1434. /// <param name="keyValue"></param>
  1435. /// <returns></returns>
  1436. [HttpPost]
  1437. [HandlerAjaxOnly]
  1438. public ActionResult UpdateICSInventoryLocation(string keyValue)
  1439. {
  1440. string msg = App.UpdateICSInventoryLocation(keyValue);
  1441. if (!string.IsNullOrEmpty(msg))
  1442. {
  1443. return Error(msg);
  1444. }
  1445. else
  1446. {
  1447. return Success("修改成功!");
  1448. }
  1449. }
  1450. /// <summary>
  1451. /// 删除料品仓库批次关系
  1452. /// </summary>
  1453. /// <returns></returns>
  1454. [HttpPost]
  1455. [HandlerAjaxOnly]
  1456. [ValidateAntiForgeryToken]
  1457. public ActionResult DeleteICSInventoryLocation(string keyValue)
  1458. {
  1459. string msg = App.DeleteICSInventoryLocation(keyValue);
  1460. if (string.IsNullOrEmpty(msg))
  1461. {
  1462. return Success("删除成功!");
  1463. }
  1464. else
  1465. {
  1466. return Error(msg);
  1467. }
  1468. }
  1469. /// <summary>
  1470. /// 新增包装、容器
  1471. /// </summary>
  1472. /// <param name="keyValue"></param>
  1473. /// <returns></returns>
  1474. [HttpPost]
  1475. [HandlerAjaxOnly]
  1476. public ActionResult InsertICSContainer(string keyValue)
  1477. {
  1478. string msg = App.InsertICSContainer(keyValue);
  1479. if (!string.IsNullOrEmpty(msg))
  1480. {
  1481. return Error(msg);
  1482. }
  1483. else
  1484. {
  1485. return Success("添加成功!");
  1486. }
  1487. }
  1488. /// <summary>
  1489. /// 新增包装、容器
  1490. /// </summary>
  1491. /// <param name="keyValue"></param>
  1492. /// <returns></returns>
  1493. [HttpPost]
  1494. [HandlerAjaxOnly]
  1495. public ActionResult InsertICSContainerMore(string keyValue)
  1496. {
  1497. string msg = App.InsertICSContainerMore(keyValue);
  1498. if (!string.IsNullOrEmpty(msg))
  1499. {
  1500. return Error(msg);
  1501. }
  1502. else
  1503. {
  1504. return Success("添加成功!");
  1505. }
  1506. }
  1507. /// <summary>
  1508. /// 修改包装、容器
  1509. /// </summary>
  1510. /// <param name="keyValue"></param>
  1511. /// <returns></returns>
  1512. [HttpPost]
  1513. [HandlerAjaxOnly]
  1514. public ActionResult UpdateICSContainer(string keyValue)
  1515. {
  1516. string msg = App.UpdateICSContainer(keyValue);
  1517. if (!string.IsNullOrEmpty(msg))
  1518. {
  1519. return Error(msg);
  1520. }
  1521. else
  1522. {
  1523. return Success("修改成功!");
  1524. }
  1525. }
  1526. /// <summary>
  1527. /// 解绑包装、容器
  1528. /// </summary>
  1529. /// <returns></returns>
  1530. [HttpPost]
  1531. [HandlerAjaxOnly]
  1532. [ValidateAntiForgeryToken]
  1533. public ActionResult UnBindingICSContainer(string keyValue)
  1534. {
  1535. string msg = App.UnBindingICSContainer(keyValue);
  1536. if (string.IsNullOrEmpty(msg))
  1537. {
  1538. return Success("解绑成功!");
  1539. }
  1540. else
  1541. {
  1542. return Error(msg);
  1543. }
  1544. }
  1545. /// <summary> UnBinding
  1546. /// 删除包装、容器
  1547. /// </summary>
  1548. /// <returns></returns>
  1549. [HttpPost]
  1550. [HandlerAjaxOnly]
  1551. [ValidateAntiForgeryToken]
  1552. public ActionResult DeleteICSContainer(string keyValue)
  1553. {
  1554. string msg = App.DeleteICSContainer(keyValue);
  1555. if (string.IsNullOrEmpty(msg))
  1556. {
  1557. return Success("删除成功!");
  1558. }
  1559. else
  1560. {
  1561. return Error(msg);
  1562. }
  1563. }
  1564. /// <summary>
  1565. /// 新增包装、容器
  1566. /// </summary>
  1567. /// <param name="keyValue"></param>
  1568. /// <returns></returns>
  1569. [HttpPost]
  1570. [HandlerAjaxOnly]
  1571. public ActionResult InsertICSContainerLot(string keyValue)
  1572. {
  1573. string msg = App.InsertICSContainerLot(keyValue);
  1574. if (!string.IsNullOrEmpty(msg))
  1575. {
  1576. return Error(msg);
  1577. }
  1578. else
  1579. {
  1580. return Success("添加成功!");
  1581. }
  1582. }
  1583. /// <summary>
  1584. /// 修改包装、容器
  1585. /// </summary>
  1586. /// <param name="keyValue"></param>
  1587. /// <returns></returns>
  1588. [HttpPost]
  1589. [HandlerAjaxOnly]
  1590. public ActionResult UpdateICSContainerLot(string keyValue)
  1591. {
  1592. string msg = App.UpdateICSContainerLot(keyValue);
  1593. if (!string.IsNullOrEmpty(msg))
  1594. {
  1595. return Error(msg);
  1596. }
  1597. else
  1598. {
  1599. return Success("修改成功!");
  1600. }
  1601. }
  1602. /// <summary>
  1603. /// 删除包装、容器关联
  1604. /// </summary>
  1605. /// <returns></returns>
  1606. [HttpPost]
  1607. [HandlerAjaxOnly]
  1608. [ValidateAntiForgeryToken]
  1609. public ActionResult DeleteICSContainerLot(string keyValue)
  1610. {
  1611. string msg = App.DeleteICSContainerLot(keyValue);
  1612. if (string.IsNullOrEmpty(msg))
  1613. {
  1614. return Success("删除成功!");
  1615. }
  1616. else
  1617. {
  1618. return Error(msg);
  1619. }
  1620. }
  1621. /// <summary>
  1622. /// 获取物料信息
  1623. /// </summary>
  1624. /// <returns></returns>
  1625. public ActionResult GetInvCode()
  1626. {
  1627. DataTable dt = App.GetInvCode();
  1628. return Content(dt.ToJson());
  1629. }
  1630. /// <summary>
  1631. /// 获取不良代码信息
  1632. /// </summary>
  1633. /// <returns></returns>
  1634. public ActionResult GetBCGroup()
  1635. {
  1636. DataTable dt = App.GetBCGroup();
  1637. return Content(dt.ToJson());
  1638. }
  1639. /// <summary>
  1640. /// 获取不良原因信息
  1641. /// </summary>
  1642. /// <returns></returns>
  1643. public ActionResult BRGroupID()
  1644. {
  1645. DataTable dt = App.BRGroupID();
  1646. return Content(dt.ToJson());
  1647. }
  1648. [HttpPost]
  1649. [HandlerAjaxOnly]
  1650. public ActionResult InsertInventoryBadGroup(string keyValue)
  1651. {
  1652. string msg = App.InsertInventoryBadGroup(keyValue);
  1653. if (!string.IsNullOrEmpty(msg))
  1654. {
  1655. return Error(msg);
  1656. }
  1657. else
  1658. {
  1659. return Success("添加成功!");
  1660. }
  1661. }
  1662. [HttpPost]
  1663. [HandlerAjaxOnly]
  1664. public ActionResult UpdateInventoryBadGroup(string keyValue)
  1665. {
  1666. string msg = App.UpdateInventoryBadGroup(keyValue);
  1667. if (!string.IsNullOrEmpty(msg))
  1668. {
  1669. return Error(msg);
  1670. }
  1671. else
  1672. {
  1673. return Success("修改成功!");
  1674. }
  1675. }
  1676. /// <summary>
  1677. /// 删除料品不良信息
  1678. /// </summary>
  1679. /// <returns></returns>
  1680. [HttpPost]
  1681. [HandlerAjaxOnly]
  1682. [ValidateAntiForgeryToken]
  1683. public ActionResult DeleteInventoryBadGroup(string keyValue)
  1684. {
  1685. string msg = App.DeleteInventoryBadGroup(keyValue);
  1686. if (string.IsNullOrEmpty(msg))
  1687. {
  1688. return Success("删除成功!");
  1689. }
  1690. else
  1691. {
  1692. return Error(msg);
  1693. }
  1694. }
  1695. #region 打印
  1696. /// <summary>
  1697. /// 打印数据参数:服务器的URL+打印的文件名,转化为Base64编码
  1698. /// </summary>
  1699. protected string strPrintData;
  1700. /// <summary>
  1701. /// 标识是否安装了控件
  1702. /// </summary>
  1703. protected bool bIsInstallPrintControl = true;
  1704. /// <summary>
  1705. /// 打印控件的Cookie值
  1706. /// </summary>
  1707. protected string strPrintControlCookie = "";
  1708. /// <summary>
  1709. /// 获取Url中去掉文件名的路径
  1710. /// </summary>
  1711. /// <returns></returns>
  1712. private string GetUrlPath()
  1713. {
  1714. string strUrl = Request.Url.ToString();
  1715. int iEnd = strUrl.LastIndexOf("/");
  1716. strUrl = strUrl.Substring(0, iEnd + 1);
  1717. return strUrl;
  1718. }
  1719. /// <summary>
  1720. /// 设置控件调用的Cookie值,判断是否安装了打印控件
  1721. /// </summary>
  1722. /// <param name="pJson"></param>
  1723. private void SetCookieAndURL(PrintJson pJson)
  1724. {
  1725. bIsInstallPrintControl = false;
  1726. strPrintControlCookie = "";
  1727. HttpCookie pCookieInstall = Request.Cookies["InstallPrintControl"];
  1728. if (pCookieInstall != null)
  1729. { //Cookie存在
  1730. strPrintControlCookie = pCookieInstall.Value.ToString();
  1731. //以Cookie值查找在数据表中是否存在
  1732. string strSql = @"Select * From sys_SRM_CheckInstall Where Cookie = @Cookie";
  1733. SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strPrintControlCookie) };
  1734. using (SqlDataReader drCookie = DbHelper.ExecuteReader(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie))
  1735. {
  1736. if (drCookie.Read())
  1737. { //标识为已经安装
  1738. bIsInstallPrintControl = true;
  1739. }
  1740. drCookie.Close();
  1741. }
  1742. //更新Cookie的保存时间
  1743. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  1744. Response.SetCookie(pCookieInstall);
  1745. }
  1746. else
  1747. {//Cookie不存在,则新建Cookie
  1748. strPrintControlCookie = System.Guid.NewGuid().ToString();
  1749. pCookieInstall = new HttpCookie("InstallPrintControl", strPrintControlCookie);
  1750. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  1751. Response.Cookies.Add(pCookieInstall);
  1752. }
  1753. string strUrl = Server.MapPath("/PrintTemp/") + "IsCheckInstall";
  1754. pJson.SetCookieAndURL(strPrintControlCookie, strUrl);
  1755. }
  1756. [HttpPost]
  1757. [HandlerAjaxOnly]
  1758. public ActionResult PrintStack(string keyValue)
  1759. {
  1760. keyValue = keyValue.Substring(1, keyValue.Length - 2);
  1761. string strPrintFileName = Server.MapPath("/ReportFile/") + "Stack.fr3";
  1762. PrintJson pJson = new PrintJson(Server.MapPath("./PrintTemp"), strPrintFileName);
  1763. pJson.CheckRegister("苏州智合诚信息科技有限公司", "56DD3B4C172D0D140841CAC98A58A819F4E28EDA5D6E45711DDD64F6A439F68B6A7870CD7DAFD69A919CB870207FE4BB206F92BE3D53C221B019E0797E739EBA4"); //注册信息
  1764. pJson.MasterOptions(1, "STNO", false); //主从关系
  1765. SetCookieAndURL(pJson);// 设置控件调用的Cookie值,判断是否安装了打印控件
  1766. string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
  1767. string strSql = @"select a.LocationCode,
  1768. a.ID,
  1769. a.LocationName,
  1770. b.WarehouseCode,
  1771. b.WarehouseName,
  1772. a.Musername as 'MUSER',
  1773. a.MTIME
  1774. from ICSLocation a WITH (NOLOCK)
  1775. inner join ICSWarehouse b WITH (NOLOCK) on a.WHID=b.ID
  1776. where 1=1
  1777. and a.ID IN (" + keyValue.TrimEnd(',') + ")";
  1778. DataTable dtInInfo = DbHelper.ExecuteTable(DbHelper.ConnectionString, CommandType.Text, strSql, true, null);
  1779. // strSql = @"SELECT Row_Number() OVER (partition BY a.STNO ORDER BY a.CREATETIME DESC) AS rowno,c.STNO,
  1780. // c.PLANQTY,c.LotnoQTY,c.CartonNOQTY,c.ITEMCODE,b.INVNAME,b.INVSTD,b.INVPARSETYPE,d.StorageName,
  1781. // CONVERT(VARCHAR,CAST(ISNULL(c.Qty,0) AS money),1) AS Qty,
  1782. // CONVERT(VARCHAR,CAST(ISNULL(c.Meters,0) AS money),1) AS Meters,
  1783. // c.STNO AS QRSTNO,c.TransNO,c.TransLine,c.MEMO,c.VenderLotNO,CONVERT(varchar(10), c.PRODUCTDATE, 23) as PRODUCTDATE,a.remark
  1784. // FROM
  1785. // (SELECT aa.STNO,aa.ITEMCODE,aa.WorkPoint,SUM(aa.PLANQTY) PLANQTY,SUM(cc.LOTQTY) Qty,
  1786. // SUM(ISNULL(cc.Meters,0)) Meters,cc.TransNO,cc.TransLine,dd.MEMO,cc.VenderLotNO,cc.PRODUCTDATE,
  1787. // COUNT(aa.LOTNO) LotnoQTY,COUNT(bb.CartonNO) CartonNOQTY
  1788. // FROM ICSASNDETAIL aa
  1789. // LEFT JOIN ICSITEMLot2Carton bb ON aa.LOTNO = bb.LotNO AND aa.WorkPoint = bb.WorkPoint
  1790. // LEFT JOIN ICSITEMLot cc ON aa.LOTNO = cc.LotNO AND aa.WorkPoint = cc.WorkPoint
  1791. // LEFT JOIN ICSPO_PoMain dd on dd.POCode=cc.TransNO and dd.PORow=cc.TransLine
  1792. // GROUP BY aa.stno,aa.itemcode,aa.WorkPoint,cc.TransNO,cc.TransLine,dd.MEMO,cc.VenderLotNO,cc.PRODUCTDATE) c
  1793. // LEFT JOIN ICSASN a on c.stno=a.stno AND c.WorkPoint=a.WorkPoint
  1794. // LEFT JOIN dbo.ICSINVENTORY b ON c.ITEMCODE=b.INVCODE AND b.WorkPoint=c.WorkPoint
  1795. // LEFT JOIN dbo.icsstorage d ON b.INVMACHINETYPE=d.StorageCode
  1796. // WHERE c.STNO IN (" + keyValue.TrimEnd(',') + ") and c.WorkPoint='" + WorkPoint + "'";
  1797. // DataTable dtInMaterial = DbHelper.ExecuteTable(DbHelper.ConnectionString, CommandType.Text, strSql, true, null);
  1798. string strPrintTempFile = pJson.ShowReport(dtInInfo, null); //产生JSON文件内容
  1799. //把服务器的URL + 此文件名 传递给控件,由控件下载还原数据进行打印
  1800. string strServerURL = Server.MapPath("/PrintTemp/");
  1801. string strData = strServerURL + strPrintTempFile;
  1802. strPrintData = PrintFunction.EnBase64(strData);
  1803. var JsonData = new
  1804. {
  1805. strPrintData_1 = strPrintData,
  1806. bIsInstallPrintControl_1 = bIsInstallPrintControl,
  1807. strPrintControlCookie_1 = strPrintControlCookie
  1808. };
  1809. // string sql = @"UPDATE dbo.ICSASN
  1810. // SET ADDITION1=ISNULL(ADDITION1,0)+1,
  1811. // ADDITION2=CONVERT(varchar(100), GETDATE(), 21)
  1812. // WHERE STNO in (" + keyValue.TrimEnd(',') + ") and WorkPoint='" + WorkPoint + "'";
  1813. // SqlHelper.ExecuteNonQuery(sql);
  1814. return Content(JsonData.ToJson());
  1815. }
  1816. /// <summary>
  1817. /// 写日志(用于跟踪)
  1818. /// </summary>
  1819. private void WriteLog(string strMessage)
  1820. {
  1821. string strLogFile = Server.MapPath("./Cookie_Log.txt");
  1822. StreamWriter swLogFile = null;
  1823. try
  1824. {
  1825. if (!System.IO.File.Exists(strLogFile))
  1826. {
  1827. swLogFile = System.IO.File.CreateText(strLogFile);
  1828. }
  1829. else
  1830. {
  1831. swLogFile = System.IO.File.AppendText(strLogFile);
  1832. }
  1833. swLogFile.WriteLine(strMessage);
  1834. }
  1835. catch
  1836. {
  1837. }
  1838. finally
  1839. {
  1840. if (swLogFile != null)
  1841. swLogFile.Close();
  1842. }
  1843. }
  1844. /// <summary>
  1845. ///判断数据表中是否存在,若不存在则新建一条记录,若存在则更新最后访问的时间
  1846. /// </summary>
  1847. /// <param name="strCookie"></param>
  1848. private void UpdateCheckInstall(string strCookie)
  1849. {
  1850. bool bIsExist = false;
  1851. //判断记录是否存在
  1852. GetLastAccessTime(strCookie, ref bIsExist);
  1853. string strSql = "";
  1854. SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strCookie) };
  1855. if (bIsExist)
  1856. { //存在则更新最后访问的时间
  1857. strSql = @"Update sys_SRM_CheckInstall
  1858. Set LastAccessTime = getDate()
  1859. Where Cookie = @Cookie";
  1860. }
  1861. else
  1862. { //不存在则新建一条记录
  1863. strSql = @"Insert into sys_SRM_CheckInstall(Cookie, LastAccessTime)
  1864. Values( @Cookie, getDate() )";
  1865. }
  1866. DbHelper.ExecuteNonQuery(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie);
  1867. }
  1868. public DateTime ToDateTime(object SrcValue)
  1869. {
  1870. if (Convert.IsDBNull(SrcValue) == true)
  1871. return DateTime.MinValue;
  1872. else
  1873. {
  1874. try
  1875. {
  1876. return Convert.ToDateTime(SrcValue);
  1877. }
  1878. catch
  1879. {
  1880. return DateTime.MinValue;
  1881. }
  1882. }
  1883. }
  1884. /// <summary>
  1885. /// 获取此Cookie的最后访问时间
  1886. /// </summary>
  1887. /// <param name="strCookie"></param>
  1888. /// <returns></returns>
  1889. private DateTime GetLastAccessTime(string strCookie, ref bool bIsExist)
  1890. {
  1891. DateTime dtLastAccessTime = DateTime.MinValue;
  1892. bIsExist = false;
  1893. string strSql = @"Select * From sys_SRM_CheckInstall Where Cookie = @Cookie";
  1894. SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strCookie) };
  1895. using (SqlDataReader drCookie = DbHelper.ExecuteReader(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie))
  1896. {
  1897. if (drCookie.Read())
  1898. {
  1899. dtLastAccessTime = ToDateTime(drCookie["LastAccessTime"]);
  1900. bIsExist = true;
  1901. }
  1902. drCookie.Close();
  1903. }
  1904. return dtLastAccessTime;
  1905. }
  1906. [HttpGet]
  1907. [HandlerAjaxOnly]
  1908. public ActionResult IsCheckInstall(string checkInstall)
  1909. {
  1910. string strValue = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss 访问,");
  1911. if (Request.QueryString["cookie"] != null)
  1912. { //有控件上传的Cookie值
  1913. string strCookie = Request.QueryString["cookie"].ToString();
  1914. //判断数据表中是否存在,若不存在则新建一条记录,若存在则更新最后访问的时间
  1915. UpdateCheckInstall(strCookie);
  1916. strValue = strValue + "上传的cookie:" + strCookie;
  1917. }
  1918. else if (checkInstall != null)
  1919. {//Ajax检查控件是否安装了,防止那种客户把打印控件卸装了,打印时无法检测到的情况
  1920. string strCookie = checkInstall;
  1921. //读取最后访问的时间
  1922. string strResult = "PrintControlInstall";
  1923. bool bIsExist = false;
  1924. DateTime dtLastAccessTime = GetLastAccessTime(strCookie, ref bIsExist);
  1925. if (!bIsExist || dtLastAccessTime.AddSeconds(30) < DateTime.Now)
  1926. {
  1927. strResult = "NOT";
  1928. }
  1929. Response.Clear();
  1930. Response.Write(strResult);
  1931. strValue = strValue + "检测安装的值:" + strCookie;
  1932. }
  1933. WriteLog(strValue);
  1934. return null;
  1935. }
  1936. [HttpGet]
  1937. [HandlerAjaxOnly]
  1938. public ActionResult IsCheckInstall()
  1939. {
  1940. string strValue = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss 访问,");
  1941. if (Request.QueryString["cookie"] != null)
  1942. { //有控件上传的Cookie值
  1943. string strCookie = Request.QueryString["cookie"].ToString();
  1944. //判断数据表中是否存在,若不存在则新建一条记录,若存在则更新最后访问的时间
  1945. UpdateCheckInstall(strCookie);
  1946. strValue = strValue + "上传的cookie:" + strCookie;
  1947. }
  1948. else if (Request.QueryString["checkInstall"] != null)
  1949. {//Ajax检查控件是否安装了,防止那种客户把打印控件卸装了,打印时无法检测到的情况
  1950. string strCookie = Request.QueryString["checkInstall"];
  1951. //读取最后访问的时间
  1952. string strResult = "PrintControlInstall";
  1953. bool bIsExist = false;
  1954. DateTime dtLastAccessTime = GetLastAccessTime(strCookie, ref bIsExist);
  1955. if (!bIsExist || dtLastAccessTime.AddSeconds(30) < DateTime.Now)
  1956. {
  1957. strResult = "NOT";
  1958. }
  1959. Response.Clear();
  1960. Response.Write(strResult);
  1961. strValue = strValue + "检测安装的值:" + strCookie;
  1962. }
  1963. WriteLog(strValue);
  1964. return null;
  1965. }
  1966. #endregion
  1967. /// <summary>
  1968. /// 导入Excel
  1969. /// </summary>
  1970. /// <param name="fileURL"></param>
  1971. /// <returns></returns>
  1972. [HttpPost]
  1973. public ActionResult Import(string fileURL)
  1974. {
  1975. var fileName = "";
  1976. var filePath = fileURL;
  1977. string path = Path.Combine(filePath, fileName);
  1978. //file.SaveAs(path);
  1979. DataTable excelTable = new DataTable();
  1980. //excelTable =SqlHelper.GetExcelDataTable(path);
  1981. DataTable dbdata = new DataTable();
  1982. dbdata.Columns.Add("LocationCode");
  1983. dbdata.Columns.Add("LocationName");
  1984. dbdata.Columns.Add("Musername");
  1985. dbdata.Columns.Add("MUSER");
  1986. dbdata.Columns.Add("EATTRIBUTE1");
  1987. for (int i = 0; i < excelTable.Rows.Count; i++)
  1988. {
  1989. string LocationCode = "";
  1990. string LocationName = "";
  1991. DataRow dr = excelTable.Rows[i];
  1992. DataRow dr_ = dbdata.NewRow();
  1993. if (!string.IsNullOrWhiteSpace(dr["区"].ToString().ToUpper()))
  1994. {
  1995. LocationCode += "-" + dr["区"].ToString().ToUpper();
  1996. LocationName += dr["区"].ToString().ToUpper() + "区";
  1997. }
  1998. if (!string.IsNullOrWhiteSpace(dr["排"].ToString().ToUpper()))
  1999. {
  2000. LocationCode += "-" + dr["排"].ToString().ToUpper();
  2001. LocationName += dr["排"].ToString().ToUpper() + "排";
  2002. }
  2003. if (!string.IsNullOrWhiteSpace(dr["货架"].ToString().ToUpper()))
  2004. {
  2005. LocationCode += "-" + dr["货架"].ToString().ToUpper();
  2006. LocationName += dr["货架"].ToString().ToUpper() + "货架";
  2007. }
  2008. if (!string.IsNullOrWhiteSpace(dr["层"].ToString().ToUpper()))
  2009. {
  2010. LocationCode += "-" + dr["层"].ToString().ToUpper();
  2011. LocationName += dr["层"].ToString().ToUpper() + "层";
  2012. }
  2013. if (!string.IsNullOrWhiteSpace(dr["格"].ToString().ToUpper()))
  2014. {
  2015. LocationCode += "-" + dr["格"].ToString().ToUpper();
  2016. LocationName += dr["格"].ToString().ToUpper() + "格";
  2017. }
  2018. dr_["LocationCode"] = LocationCode;
  2019. dr_["LocationName"] = LocationName;
  2020. dr_["Musername"] = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
  2021. dr_["MUSER"] = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
  2022. dr_["Musername"] = "";
  2023. dbdata.Rows.Add(dr_);
  2024. }
  2025. SqlHelper.RemoveEmpty(dbdata);
  2026. SqlHelper.SqlBulkCopyByDatatable("ICSLocation", dbdata);
  2027. return View();
  2028. }
  2029. //料品导入
  2030. [HttpPost]
  2031. /// <summary>
  2032. /// 文件上传到本地
  2033. /// </summary>
  2034. public string UploadFileByInvCode()
  2035. {
  2036. try
  2037. {
  2038. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  2039. if (hpFiles != null && hpFiles.Count > 0)
  2040. {
  2041. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  2042. if (IsXls != ".xls" && IsXls != ".xlsx")
  2043. {
  2044. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  2045. }
  2046. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
  2047. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  2048. int iLen = hpFiles[0].ContentLength;
  2049. if (Directory.Exists(savePath)) return "文件已存在";
  2050. byte[] bData = new byte[iLen];
  2051. hpFiles[0].InputStream.Read(bData, 0, iLen);
  2052. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  2053. newFile.Write(bData, 0, bData.Length);
  2054. newFile.Flush();
  2055. int _FileSizeTemp = hpFiles[0].ContentLength;
  2056. newFile.Close();
  2057. newFile.Dispose();
  2058. //bool del = false;
  2059. string mess = "";
  2060. mess = App.SetData_PRByInvCode(savePath);
  2061. if (System.IO.File.Exists(savePath))//删除文件
  2062. {
  2063. System.IO.File.Delete(savePath);
  2064. }
  2065. return mess;
  2066. }
  2067. else
  2068. {
  2069. return "获取文件失败";
  2070. }
  2071. }
  2072. catch (Exception ex)
  2073. {
  2074. return ex.ToString();
  2075. }
  2076. }
  2077. //供应商导入
  2078. [HttpPost]
  2079. /// <summary>
  2080. /// 文件上传到本地
  2081. /// </summary>
  2082. public string UploadFileByVenCode()
  2083. {
  2084. try
  2085. {
  2086. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  2087. if (hpFiles != null && hpFiles.Count > 0)
  2088. {
  2089. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  2090. if (IsXls != ".xls" && IsXls != ".xlsx")
  2091. {
  2092. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  2093. }
  2094. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
  2095. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  2096. int iLen = hpFiles[0].ContentLength;
  2097. if (Directory.Exists(savePath)) return "文件已存在";
  2098. byte[] bData = new byte[iLen];
  2099. hpFiles[0].InputStream.Read(bData, 0, iLen);
  2100. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  2101. newFile.Write(bData, 0, bData.Length);
  2102. newFile.Flush();
  2103. int _FileSizeTemp = hpFiles[0].ContentLength;
  2104. newFile.Close();
  2105. newFile.Dispose();
  2106. //bool del = false;
  2107. string mess = "";
  2108. mess = App.SetData_PRByVenCode(savePath);
  2109. if (System.IO.File.Exists(savePath))//删除文件
  2110. {
  2111. System.IO.File.Delete(savePath);
  2112. }
  2113. return mess;
  2114. }
  2115. else
  2116. {
  2117. return "获取文件失败";
  2118. }
  2119. }
  2120. catch (Exception ex)
  2121. {
  2122. return ex.ToString();
  2123. }
  2124. }
  2125. //库位导入
  2126. [HttpPost]
  2127. /// <summary>
  2128. /// 文件上传到本地
  2129. /// </summary>
  2130. public string UploadFile()
  2131. {
  2132. try
  2133. {
  2134. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  2135. if (hpFiles != null && hpFiles.Count > 0)
  2136. {
  2137. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  2138. if (IsXls != ".xls" && IsXls != ".xlsx")
  2139. {
  2140. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  2141. }
  2142. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
  2143. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  2144. int iLen = hpFiles[0].ContentLength;
  2145. if (Directory.Exists(savePath)) return "文件已存在";
  2146. byte[] bData = new byte[iLen];
  2147. hpFiles[0].InputStream.Read(bData, 0, iLen);
  2148. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  2149. newFile.Write(bData, 0, bData.Length);
  2150. newFile.Flush();
  2151. int _FileSizeTemp = hpFiles[0].ContentLength;
  2152. newFile.Close();
  2153. newFile.Dispose();
  2154. //bool del = false;
  2155. string mess = "";
  2156. mess = App.SetData_PR(savePath);
  2157. if (System.IO.File.Exists(savePath))//删除文件
  2158. {
  2159. System.IO.File.Delete(savePath);
  2160. }
  2161. return mess;
  2162. }
  2163. else
  2164. {
  2165. return "获取文件失败";
  2166. }
  2167. }
  2168. catch (Exception ex)
  2169. {
  2170. return ex.ToString();
  2171. }
  2172. }
  2173. /// <summary>
  2174. ///启用的料品库位绑定关系
  2175. /// </summary>
  2176. /// <returns></returns>
  2177. [HttpPost]
  2178. [HandlerAjaxOnly]
  2179. [ValidateAntiForgeryToken]
  2180. public ActionResult EnableInventoryLocation(string keyValue)
  2181. {
  2182. string msg = App.EnableInventoryLocation(keyValue);
  2183. if (string.IsNullOrEmpty(msg))
  2184. {
  2185. return Success("启用成功!");
  2186. }
  2187. else
  2188. {
  2189. return Error(msg);
  2190. }
  2191. }
  2192. [HttpPost]
  2193. [HandlerAjaxOnly]
  2194. [ValidateAntiForgeryToken]
  2195. public ActionResult ForbiddenInventoryLocation(string keyValue)
  2196. {
  2197. string msg = App.ForbiddenInventoryLocation(keyValue);
  2198. if (string.IsNullOrEmpty(msg))
  2199. {
  2200. return Success("禁用成功!");
  2201. }
  2202. else
  2203. {
  2204. return Error(msg);
  2205. }
  2206. }
  2207. /// <summary>
  2208. ///启用的料品仓库绑定关系
  2209. /// </summary>
  2210. /// <returns></returns>
  2211. [HttpPost]
  2212. [HandlerAjaxOnly]
  2213. [ValidateAntiForgeryToken]
  2214. public ActionResult EnableBatchEnable(string keyValue)
  2215. {
  2216. string msg = App.EnableBatchEnable(keyValue);
  2217. if (string.IsNullOrEmpty(msg))
  2218. {
  2219. return Success("启用成功!");
  2220. }
  2221. else
  2222. {
  2223. return Error(msg);
  2224. }
  2225. }
  2226. [HttpPost]
  2227. [HandlerAjaxOnly]
  2228. [ValidateAntiForgeryToken]
  2229. public ActionResult ForbiddenBatchEnable(string keyValue)
  2230. {
  2231. string msg = App.ForbiddenBatchEnable(keyValue);
  2232. if (string.IsNullOrEmpty(msg))
  2233. {
  2234. return Success("禁用成功!");
  2235. }
  2236. else
  2237. {
  2238. return Error(msg);
  2239. }
  2240. }
  2241. //新增标签数据源
  2242. [HttpPost]
  2243. [HandlerAjaxOnly]
  2244. public ActionResult CreateLableDataSource(string Sys_LableDataSource)
  2245. {
  2246. string msg = App.CreateLableDataSource(Sys_LableDataSource);
  2247. if (!string.IsNullOrEmpty(msg))
  2248. {
  2249. return Error(msg);
  2250. }
  2251. else
  2252. {
  2253. return Success("添加成功!");
  2254. }
  2255. }
  2256. [HttpGet]
  2257. [HandlerAjaxOnly]
  2258. public ActionResult GetTXT(string ID)
  2259. {
  2260. DataTable ListData = App.GetTXT(ID);
  2261. var JsonData = new
  2262. {
  2263. rows = ListData,
  2264. };
  2265. return Content(JsonData.ToJson());
  2266. }
  2267. //修改标签数据源
  2268. [HttpPost]
  2269. [HandlerAjaxOnly]
  2270. public ActionResult updateLableDataSource(string Sys_LableDataSource)
  2271. {
  2272. string msg = App.updateLableDataSource(Sys_LableDataSource);
  2273. if (!string.IsNullOrEmpty(msg))
  2274. {
  2275. return Error(msg);
  2276. }
  2277. else
  2278. {
  2279. return Success("添加成功!");
  2280. }
  2281. }
  2282. [HttpPost]
  2283. [HandlerAjaxOnly]
  2284. [ValidateAntiForgeryToken]
  2285. public ActionResult DeleteLableDataSource(string keyValue)
  2286. {
  2287. string msg = App.DeleteLableDataSource(keyValue);
  2288. if (string.IsNullOrEmpty(msg))
  2289. {
  2290. return Success("删除成功!");
  2291. }
  2292. else
  2293. {
  2294. return Error(msg);
  2295. }
  2296. }
  2297. [HttpGet]
  2298. [HandlerAjaxOnly]
  2299. public ActionResult GetLableType()
  2300. {
  2301. DataTable dt = App.GetLableType();
  2302. return Content(dt.ToJson());
  2303. }
  2304. [HttpGet]
  2305. [HandlerAjaxOnly]
  2306. public ActionResult GetSys_LablesID()
  2307. {
  2308. DataTable dt = App.GetSys_LablesID();
  2309. return Content(dt.ToJson());
  2310. }
  2311. //新增标签数据源
  2312. [HttpPost]
  2313. [HandlerAjaxOnly]
  2314. public ActionResult CreateLables(string txtLableName, string sel_LableType, string sel_LableSourceID)
  2315. {
  2316. string msg = App.CreateLables(txtLableName, sel_LableType, sel_LableSourceID);
  2317. if (!string.IsNullOrEmpty(msg))
  2318. {
  2319. return Error(msg);
  2320. }
  2321. else
  2322. {
  2323. return Success("添加成功!");
  2324. }
  2325. }
  2326. [HttpGet]
  2327. [HandlerAjaxOnly]
  2328. public ActionResult GetLabelTXT(string ID)
  2329. {
  2330. DataTable ListData = App.GetLabelTXT(ID);
  2331. var JsonData = new
  2332. {
  2333. rows = ListData,
  2334. };
  2335. return Content(JsonData.ToJson());
  2336. }
  2337. [HttpPost]
  2338. [HandlerAjaxOnly]
  2339. public ActionResult updateLables(string ID, string txtLableName, string sel_LableType, string sel_LableSourceID)
  2340. {
  2341. string msg = App.updateLables(ID, txtLableName, sel_LableType, sel_LableSourceID);
  2342. if (!string.IsNullOrEmpty(msg))
  2343. {
  2344. return Error(msg);
  2345. }
  2346. else
  2347. {
  2348. return Success("修改成功!");
  2349. }
  2350. }
  2351. [HttpPost]
  2352. [HandlerAjaxOnly]
  2353. [ValidateAntiForgeryToken]
  2354. public ActionResult DeleteICSLabelTemplate(string keyValue)
  2355. {
  2356. string msg = App.DeleteICSLabelTemplate(keyValue);
  2357. if (string.IsNullOrEmpty(msg))
  2358. {
  2359. return Success("删除成功!");
  2360. }
  2361. else
  2362. {
  2363. return Error(msg);
  2364. }
  2365. }
  2366. //获取父容器
  2367. [HttpGet]
  2368. [HandlerAjaxOnly]
  2369. public ActionResult GetContainerID()
  2370. {
  2371. DataTable dt = App.GetContainerID();
  2372. return Content(dt.ToJson());
  2373. }
  2374. //获取父容器
  2375. [HttpGet]
  2376. [HandlerAjaxOnly]
  2377. public ActionResult GetContainerType()
  2378. {
  2379. DataTable dt = App.GetContainerType();
  2380. return Content(dt.ToJson());
  2381. }
  2382. //[HttpPost]
  2383. //public ActionResult UpLoadLabelFile()
  2384. //{
  2385. // //获取上传的文件集合
  2386. // HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  2387. // //获取送货单号
  2388. // string ID = Request.Form["ID"].ToString();
  2389. // string LableName = Request.Form["LableName"].ToString();
  2390. // string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
  2391. // + "_" + LableName + Path.GetExtension(httpFile[0].FileName);
  2392. // string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\LablesFile\\" + fileName);
  2393. // int iLen = httpFile[0].ContentLength;
  2394. // byte[] bData = new byte[iLen];
  2395. // httpFile[0].InputStream.Read(bData, 0, iLen);
  2396. // FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
  2397. // fs.Write(bData, 0, bData.Length);
  2398. // fs.Flush();
  2399. // fs.Close();
  2400. // fs.Dispose();
  2401. // int count = App.UpLoadLabelFile(ID, fileName);
  2402. // if (count > 0)
  2403. // {
  2404. // return Success("上传成功!");
  2405. // }
  2406. // else
  2407. // {
  2408. // return Error("上传失败");
  2409. // }
  2410. //}
  2411. [HttpPost]
  2412. public ActionResult UpLoadLabelFile()
  2413. {
  2414. try
  2415. {
  2416. //获取上传的文件集合
  2417. HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  2418. //获取送货单号
  2419. string ID = Request.Form["ID"].ToString();
  2420. string LableName = Request.Form["LableName"].ToString();
  2421. // 构建文件名
  2422. string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
  2423. + "_" + LableName + Path.GetExtension(httpFile[0].FileName);
  2424. // 构建文件路径
  2425. string directoryPath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\LablesFile\\");
  2426. string filePath = Path.Combine(directoryPath, fileName);
  2427. // 检查文件夹是否存在,如果不存在则创建
  2428. if (!Directory.Exists(directoryPath))
  2429. {
  2430. Directory.CreateDirectory(directoryPath);
  2431. }
  2432. // 处理文件上传
  2433. int iLen = httpFile[0].ContentLength;
  2434. byte[] bData = new byte[iLen];
  2435. httpFile[0].InputStream.Read(bData, 0, iLen);
  2436. using (FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate))
  2437. {
  2438. fs.Write(bData, 0, bData.Length);
  2439. fs.Flush();
  2440. }
  2441. // 调用业务逻辑
  2442. int count = App.UpLoadLabelFile(ID, fileName);
  2443. if (count > 0)
  2444. {
  2445. return Success("上传成功!");
  2446. }
  2447. else
  2448. {
  2449. return Error("上传失败,数据库操作未成功");
  2450. }
  2451. }
  2452. catch (Exception ex)
  2453. {
  2454. // 记录日志
  2455. // Logger.Error("文件上传失败", ex);
  2456. return Error("上传失败:'"+ex.Message+"'");
  2457. }
  2458. }
  2459. [HttpPost]
  2460. public ActionResult UpLoadFileTxT()
  2461. {
  2462. //获取上传的文件集合
  2463. HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  2464. //获取送货单号
  2465. string LotNo = Request.Form["LotNo"].ToString();
  2466. string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
  2467. + Path.GetExtension(httpFile[0].FileName);
  2468. string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + fileName);
  2469. int iLen = httpFile[0].ContentLength;
  2470. byte[] bData = new byte[iLen];
  2471. httpFile[0].InputStream.Read(bData, 0, iLen);
  2472. FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
  2473. fs.Write(bData, 0, bData.Length);
  2474. fs.Flush();
  2475. fs.Close();
  2476. fs.Dispose();
  2477. int count = App.UpLoadFiles(LotNo, fileName);
  2478. if (count > 0)
  2479. {
  2480. return Success("上传成功!");
  2481. }
  2482. else
  2483. {
  2484. return Error("上传失败");
  2485. }
  2486. }
  2487. //包装容器
  2488. public ActionResult GetSendContainer(Pagination pagination, string queryJson)
  2489. {
  2490. DataTable ListData = App.GetSendContainer(ref pagination, queryJson);
  2491. var JsonData = new
  2492. {
  2493. total = pagination.total,
  2494. page = pagination.page,
  2495. records = pagination.records,
  2496. rows = ListData,
  2497. };
  2498. return Content(JsonData.ToJson());
  2499. }
  2500. [HttpGet]
  2501. [HandlerAjaxOnly]
  2502. public ActionResult GetContainerInfo(string Code)
  2503. {
  2504. DataTable ListData = App.GetContainerInfo(Code);
  2505. var JsonData = new
  2506. {
  2507. rows = ListData,
  2508. };
  2509. return Content(JsonData.ToJson());
  2510. }
  2511. [HttpGet]
  2512. [HandlerAjaxOnly]
  2513. public ActionResult GetBindContainerID(string SireCode)
  2514. {
  2515. DataTable ListData = App.GetBindContainerID(SireCode);
  2516. var JsonData = new
  2517. {
  2518. rows = ListData,
  2519. };
  2520. return Content(JsonData.ToJson());
  2521. }
  2522. [HttpPost]
  2523. [HandlerAjaxOnly]
  2524. public ActionResult BindingContainerID(string keyValue)
  2525. {
  2526. string msg = App.BindingContainerID(keyValue);
  2527. if (!string.IsNullOrEmpty(msg))
  2528. {
  2529. return Error(msg);
  2530. }
  2531. else
  2532. {
  2533. return Success("绑定成功!");
  2534. }
  2535. }
  2536. //包装容器关联条码
  2537. public ActionResult GetSendContainerLot(Pagination pagination, string queryJson)
  2538. {
  2539. DataTable ListData = App.GetSendContainerLot(ref pagination, queryJson);
  2540. var JsonData = new
  2541. {
  2542. total = pagination.total,
  2543. page = pagination.page,
  2544. records = pagination.records,
  2545. rows = ListData,
  2546. };
  2547. return Content(JsonData.ToJson());
  2548. }
  2549. [HttpGet]
  2550. [HandlerAjaxOnly]
  2551. public ActionResult GetContainerLotInfo(string LotNo)
  2552. {
  2553. DataTable ListData = App.GetContainerLotInfo(LotNo);
  2554. var JsonData = new
  2555. {
  2556. rows = ListData,
  2557. };
  2558. return Content(JsonData.ToJson());
  2559. }
  2560. [HttpPost]
  2561. [HandlerAjaxOnly]
  2562. public ActionResult BindingContainerLotID(string keyValue)
  2563. {
  2564. string msg = App.BindingContainerLotID(keyValue);
  2565. if (!string.IsNullOrEmpty(msg))
  2566. {
  2567. return Error(msg);
  2568. }
  2569. else
  2570. {
  2571. return Success("绑定成功!");
  2572. }
  2573. }
  2574. /// <summary>
  2575. /// 新增站点
  2576. /// </summary>
  2577. /// <param name="keyValue"></param>
  2578. /// <returns></returns>
  2579. [HttpPost]
  2580. [HandlerAjaxOnly]
  2581. public ActionResult InsertWorkPoint(string keyValue)
  2582. {
  2583. string msg = App.InsertWorkPoint(keyValue);
  2584. if (!string.IsNullOrEmpty(msg))
  2585. {
  2586. return Error(msg);
  2587. }
  2588. else
  2589. {
  2590. return Success("添加成功!");
  2591. }
  2592. }
  2593. /// <summary>
  2594. /// 修改站点
  2595. /// </summary>
  2596. /// <param name="keyValue"></param>
  2597. /// <returns></returns>
  2598. [HttpPost]
  2599. [HandlerAjaxOnly]
  2600. public ActionResult UpdateWorkPoint(string keyValue)
  2601. {
  2602. string msg = App.UpdateWorkPoint(keyValue);
  2603. if (!string.IsNullOrEmpty(msg))
  2604. {
  2605. return Error(msg);
  2606. }
  2607. else
  2608. {
  2609. return Success("修改成功!");
  2610. }
  2611. }
  2612. /// <summary>
  2613. /// 删除站点
  2614. /// </summary>
  2615. /// <returns></returns>
  2616. [HttpPost]
  2617. [HandlerAjaxOnly]
  2618. [ValidateAntiForgeryToken]
  2619. public ActionResult DeleteWorkPoint(string keyValue)
  2620. {
  2621. string msg = App.DeleteWorkPoint(keyValue);
  2622. if (string.IsNullOrEmpty(msg))
  2623. {
  2624. return Success("删除成功!");
  2625. }
  2626. else
  2627. {
  2628. return Error(msg);
  2629. }
  2630. }
  2631. /// <summary>
  2632. /// 查询站点
  2633. /// </summary>
  2634. /// <param name="Id"></param>
  2635. /// <returns></returns>
  2636. [HttpGet]
  2637. [HandlerAjaxOnly]
  2638. public ActionResult GetWorkPoint(string Id)
  2639. {
  2640. var data = App.GetWorkPoint(Id);
  2641. return Content(data.ToJson()); ;
  2642. }
  2643. [HttpGet]
  2644. [HandlerAjaxOnly]
  2645. public ActionResult GetICSInventoryLotInfo(string ID)
  2646. {
  2647. DataTable ListData = App.GetICSInventoryLotInfo(ID);
  2648. var JsonData = new
  2649. {
  2650. rows = ListData,
  2651. };
  2652. return Content(JsonData.ToJson());
  2653. }
  2654. [HttpGet]
  2655. [HandlerAjaxOnly]
  2656. public ActionResult GetICSBatchInfo(string BatchCode, string INVCode)
  2657. {
  2658. DataTable ListData = App.GetICSBatchInfo(BatchCode, INVCode);
  2659. var JsonData = new
  2660. {
  2661. rows = ListData,
  2662. };
  2663. return Content(JsonData.ToJson());
  2664. }
  2665. [HttpPost]
  2666. [HandlerAjaxOnly]
  2667. [ValidateAntiForgeryToken]
  2668. public ActionResult UpdateExpirationDate(string ID, string ExpirationDate, string Inv, string LotNo, string InvCode, string Quantity)
  2669. {
  2670. int i = App.UpdateExpirationDate(ID, ExpirationDate, Inv, LotNo, InvCode, Quantity);
  2671. if (i > 0)
  2672. {
  2673. return Success("维护成功!");
  2674. }
  2675. else
  2676. {
  2677. return Error("维护失败!");
  2678. }
  2679. }
  2680. [HttpPost]
  2681. [HandlerAjaxOnly]
  2682. [ValidateAntiForgeryToken]
  2683. public ActionResult UpdateBatchExpirationDate(string ExpirationDate, string BatchCode, string InvCode)
  2684. {
  2685. try
  2686. {
  2687. int i = App.UpdateBatchExpirationDate(ExpirationDate, BatchCode, InvCode);
  2688. if (i > 0)
  2689. {
  2690. return Success("维护成功!");
  2691. }
  2692. else
  2693. {
  2694. return Error("维护失败!");
  2695. }
  2696. }
  2697. catch (Exception ex)
  2698. {
  2699. return Error(ex.Message);
  2700. }
  2701. }
  2702. //修改多语言
  2703. [HttpPost]
  2704. [HandlerAjaxOnly]
  2705. public ActionResult UpdateSys_Language(string keyValue)
  2706. {
  2707. string msg = App.UpdateSys_Language(keyValue);
  2708. if (!string.IsNullOrEmpty(msg))
  2709. {
  2710. return Error(msg);
  2711. }
  2712. else
  2713. {
  2714. return Success("修改成功!");
  2715. }
  2716. }
  2717. //新增多语言
  2718. [HttpPost]
  2719. [HandlerAjaxOnly]
  2720. public ActionResult InsertSys_Language(string keyValue)
  2721. {
  2722. string msg = App.InsertSys_Language(keyValue);
  2723. if (!string.IsNullOrEmpty(msg))
  2724. {
  2725. return Error(msg);
  2726. }
  2727. else
  2728. {
  2729. return Success("添加成功!");
  2730. }
  2731. }
  2732. [HttpGet]
  2733. [HandlerAjaxOnly]
  2734. public ActionResult GetSys_Language(string ID)
  2735. {
  2736. DataTable ListData = App.GetSys_Language(ID);
  2737. var JsonData = new
  2738. {
  2739. rows = ListData,
  2740. };
  2741. return Content(JsonData.ToJson());
  2742. }
  2743. [HttpPost]
  2744. [HandlerAjaxOnly]
  2745. [ValidateAntiForgeryToken]
  2746. public ActionResult DeleteSys_Language(string keyValue)
  2747. {
  2748. string msg = App.DeleteSys_Language(keyValue);
  2749. if (string.IsNullOrEmpty(msg))
  2750. {
  2751. return Success("删除成功!");
  2752. }
  2753. else
  2754. {
  2755. return Error(msg);
  2756. }
  2757. }
  2758. //料品检验明细
  2759. public ActionResult GetICSInventoryInspectionGroup(Pagination pagination, string queryJson)
  2760. {
  2761. DataTable ListData = App.GetICSInventoryInspectionGroup(ref pagination, queryJson);
  2762. var JsonData = new
  2763. {
  2764. total = pagination.total,
  2765. page = pagination.page,
  2766. records = pagination.records,
  2767. rows = ListData,
  2768. };
  2769. return Content(JsonData.ToJson());
  2770. }
  2771. //料品检验明细子表
  2772. [HttpGet]
  2773. [HandlerAjaxOnly]
  2774. public ActionResult ICSInventoryInspectionList(string ID, Pagination pagination)
  2775. {
  2776. DataTable ListData = App.ICSInventoryInspectionList(ID, ref pagination);
  2777. var JsonData = new
  2778. {
  2779. total = pagination.total,
  2780. page = pagination.page,
  2781. records = pagination.records,
  2782. rows = ListData,
  2783. };
  2784. return Content(JsonData.ToJson());
  2785. }
  2786. //删除料品检验明细子表
  2787. [HttpPost]
  2788. [HandlerAjaxOnly]
  2789. [ValidateAntiForgeryToken]
  2790. public ActionResult DeleteICSInventoryInspectionGroup(string keyValue)
  2791. {
  2792. string msg = App.DeleteICSInventoryInspectionGroup(keyValue);
  2793. if (string.IsNullOrEmpty(msg))
  2794. {
  2795. return Success("删除成功!");
  2796. }
  2797. else
  2798. {
  2799. return Error(msg);
  2800. }
  2801. }
  2802. //查询物料
  2803. [HttpGet]
  2804. public ActionResult GetINv(string invcode, Pagination pagination)
  2805. {
  2806. DataTable ListData = App.Getinv(invcode, ref pagination);
  2807. var JsonData = new
  2808. {
  2809. total = pagination.total,
  2810. page = pagination.page,
  2811. records = pagination.records,
  2812. rows = ListData,
  2813. };
  2814. return Content(JsonData.ToJson());
  2815. }
  2816. [HttpGet]
  2817. [HandlerAjaxOnly]
  2818. public ActionResult GetGroupCode()
  2819. {
  2820. DataTable dt = App.GetGroupCode();
  2821. return Content(dt.ToJson());
  2822. }
  2823. [HttpGet]
  2824. public ActionResult DeleteItem(string ID)
  2825. {
  2826. try
  2827. {
  2828. App.DeleteItem(ID);
  2829. return Success("删除成功!");
  2830. }
  2831. catch (Exception ex)
  2832. {
  2833. return Error(ex.Message);
  2834. }
  2835. }
  2836. [HttpGet]
  2837. [HandlerAjaxOnly]
  2838. public ActionResult GetICSInventoryInspectionList(string BRGCode, Pagination pagination)
  2839. {
  2840. DataTable ListData = App.GetICSInventoryInspectionList(BRGCode, ref pagination);
  2841. var JsonData = new
  2842. {
  2843. total = pagination.total,
  2844. page = pagination.page,
  2845. records = pagination.records,
  2846. rows = ListData,
  2847. };
  2848. return Content(JsonData.ToJson());
  2849. }
  2850. [HttpGet]
  2851. [HandlerAjaxOnly]
  2852. public ActionResult GetInspectionListInfo(string ID)
  2853. {
  2854. DataTable ListData = App.GetInspectionListInfo(ID);
  2855. var JsonData = new
  2856. {
  2857. rows = ListData,
  2858. };
  2859. return Content(JsonData.ToJson());
  2860. }
  2861. //新增料品检验明细
  2862. [HttpPost]
  2863. public ActionResult SubICSInventoryInspectionGroupAdd(ICSInventoryInspectionGroup main, string ID, string InvCode)
  2864. {
  2865. try
  2866. {
  2867. App.SubICSInventoryInspectionGroupAdd(main, ID, InvCode);
  2868. return Success("保存成功!");
  2869. }
  2870. catch (Exception ex)
  2871. {
  2872. return Error(ex.Message);
  2873. }
  2874. }
  2875. //修改料品检验明细
  2876. //[HttpPost]
  2877. public ActionResult UpdateICSInventoryInspectionGroup(ICSInventoryInspectionGroup main, string BID, string ID, string InvCode)
  2878. {
  2879. try
  2880. {
  2881. App.UpdateICSInventoryInspectionGroup(main, BID, ID, InvCode);
  2882. return Success("修改成功!");
  2883. }
  2884. catch (Exception ex)
  2885. {
  2886. return Error(ex.Message);
  2887. }
  2888. }
  2889. [HttpGet]
  2890. public ActionResult GetICSInventoryInspectionList2(string BID)
  2891. {
  2892. var data = App.GetICSInventoryInspectionList2(BID);
  2893. return Content(data.ToJson());
  2894. }
  2895. //料品不良组导入
  2896. [HttpPost]
  2897. /// <summary>
  2898. /// 文件上传到本地
  2899. /// </summary>
  2900. public string UploadFileInvBadGroup()
  2901. {
  2902. try
  2903. {
  2904. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  2905. if (hpFiles != null && hpFiles.Count > 0)
  2906. {
  2907. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  2908. if (IsXls != ".xls" && IsXls != ".xlsx")
  2909. {
  2910. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  2911. }
  2912. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
  2913. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  2914. int iLen = hpFiles[0].ContentLength;
  2915. if (Directory.Exists(savePath)) return "文件已存在";
  2916. byte[] bData = new byte[iLen];
  2917. hpFiles[0].InputStream.Read(bData, 0, iLen);
  2918. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  2919. newFile.Write(bData, 0, bData.Length);
  2920. newFile.Flush();
  2921. int _FileSizeTemp = hpFiles[0].ContentLength;
  2922. newFile.Close();
  2923. newFile.Dispose();
  2924. //bool del = false;
  2925. string mess = "";
  2926. mess = App.UploadFileInvBadGroup(savePath);
  2927. if (System.IO.File.Exists(savePath))//删除文件
  2928. {
  2929. System.IO.File.Delete(savePath);
  2930. }
  2931. return mess;
  2932. }
  2933. else
  2934. {
  2935. return "获取文件失败";
  2936. }
  2937. }
  2938. catch (Exception ex)
  2939. {
  2940. return ex.ToString();
  2941. }
  2942. }
  2943. //根据ID获取其他站点
  2944. public ActionResult GetWorkPointNotInID(string WorkPointCode)
  2945. {
  2946. DataTable dt = App.GetWorkPointNotInID(WorkPointCode);
  2947. return Content(dt.ToJson());
  2948. }
  2949. //克隆站点
  2950. [HttpPost]
  2951. [HandlerAjaxOnly]
  2952. public ActionResult CloneWorkPointByCode(string WorkPoint, string WorkPointCode)
  2953. {
  2954. string msg = App.CloneWorkPointByCode(WorkPoint, WorkPointCode);
  2955. if (!string.IsNullOrEmpty(msg))
  2956. {
  2957. return Error(msg);
  2958. }
  2959. else
  2960. {
  2961. return Success("修改成功!");
  2962. }
  2963. }
  2964. [HttpPost]
  2965. [HandlerAjaxOnly]
  2966. public ActionResult DeleteTableByCode(string TableCode)
  2967. {
  2968. string msg = App.DeleteTableByCode(TableCode);
  2969. if (!string.IsNullOrEmpty(msg))
  2970. {
  2971. return Error(msg);
  2972. }
  2973. else
  2974. {
  2975. return Success("添加成功!");
  2976. }
  2977. }
  2978. /// <summary>
  2979. /// 根据表名获取类型
  2980. /// </summary>
  2981. /// <returns></returns>
  2982. [HttpGet]
  2983. //[HandlerAjaxOnly]
  2984. public ActionResult GetICSType(string type, string tableCode)
  2985. {
  2986. DataTable dt = App.GetICSType(type,tableCode);
  2987. return Content(dt.ToJson());
  2988. }
  2989. /// <summary>
  2990. /// 获取自定义档案中检验项目的配置
  2991. /// </summary>
  2992. /// <returns></returns>
  2993. [HttpGet]
  2994. //[HandlerAjaxOnly]
  2995. public ActionResult GetInspectListCode()
  2996. {
  2997. DataTable dt = App.GetInspectListCode();
  2998. return Content(dt.ToJson());
  2999. }
  3000. /// <summary>
  3001. /// 获取自定义档案中检验单位的配置
  3002. /// </summary>
  3003. /// <returns></returns>
  3004. [HttpGet]
  3005. //[HandlerAjaxOnly]
  3006. public ActionResult GetUom()
  3007. {
  3008. DataTable dt = App.GetUom();
  3009. return Content(dt.ToJson());
  3010. }
  3011. /// <summary>
  3012. /// 获取自定义档案中检验仪器的配置
  3013. /// </summary>
  3014. /// <returns></returns>
  3015. [HttpGet]
  3016. //[HandlerAjaxOnly]
  3017. public ActionResult GetDevice()
  3018. {
  3019. DataTable dt = App.GetDevice();
  3020. return Content(dt.ToJson());
  3021. }
  3022. /// <summary>
  3023. /// 获取自定义档案中检验项目的配置
  3024. /// </summary>
  3025. /// <returns></returns>
  3026. [HttpGet]
  3027. //[HandlerAjaxOnly]
  3028. public ActionResult GetListName(string ListCode)
  3029. {
  3030. DataTable dt = App.GetListName(ListCode);
  3031. return Content(dt.ToJson());
  3032. }
  3033. //抽检规则新增
  3034. [HttpPost]
  3035. public ActionResult ICSInspectionRulesGroupAdd(ICSInspectionList main, string RulesCode, string RulesName, string Enable, string RulesDesc, string Type)
  3036. {
  3037. try
  3038. {
  3039. App.ICSInspectionRulesGroupAdd(main, RulesCode, RulesName, Enable, RulesDesc, Type);
  3040. return Success("保存成功!");
  3041. }
  3042. catch (Exception ex)
  3043. {
  3044. return Error(ex.Message);
  3045. }
  3046. }
  3047. //抽检规则修改
  3048. [HttpPost]
  3049. public ActionResult UpdateICSInspectionRulesList(ICSInspectionList main, string BID, string RulesCode, string RulesName, string Enable, string RulesDesc, string Type)
  3050. {
  3051. try
  3052. {
  3053. App.UpdateICSInspectionRulesList(main, BID, RulesCode, RulesName, Enable, RulesDesc, Type);
  3054. return Success("修改成功!");
  3055. }
  3056. catch (Exception ex)
  3057. {
  3058. return Error(ex.Message);
  3059. }
  3060. }
  3061. /// <summary>
  3062. /// 获取抽样规则子表
  3063. /// </summary>
  3064. /// <param name="GroupCode"></param>
  3065. /// <param name="pagination"></param>
  3066. /// <returns></returns>
  3067. [HttpGet]
  3068. [HandlerAjaxOnly]
  3069. public ActionResult GetICSInspectionRulesList(string GroupCode, Pagination pagination)
  3070. {
  3071. DataTable ListData = App.GetICSInspectionRulesList(GroupCode, ref pagination);
  3072. var JsonData = new
  3073. {
  3074. total = pagination.total,
  3075. page = pagination.page,
  3076. records = pagination.records,
  3077. rows = ListData,
  3078. };
  3079. return Content(JsonData.ToJson());
  3080. }
  3081. /// <summary>
  3082. /// 动态子表修改加载页面
  3083. /// </summary>
  3084. /// <param name="GroupCode"></param>
  3085. /// <returns></returns>
  3086. [HttpGet]
  3087. public ActionResult GetICSInspectionRulesList2(string RulesCode)
  3088. {
  3089. var data = App.GetICSInspectionRulesList2(RulesCode);
  3090. return Content(data.ToJson());
  3091. }
  3092. [HttpGet]
  3093. public ActionResult GetICSInspectionRulesGroup(Pagination pagination, string queryJson)
  3094. {
  3095. DataTable ListData = App.GetICSInspectionRulesGroup(ref pagination, queryJson);
  3096. var JsonData = new
  3097. {
  3098. total = pagination.total,
  3099. page = pagination.page,
  3100. records = pagination.records,
  3101. rows = ListData,
  3102. };
  3103. return Content(JsonData.ToJson());
  3104. }
  3105. /// <summary>
  3106. /// 删除抽检规则
  3107. /// </summary>
  3108. /// <returns></returns>
  3109. [HttpPost]
  3110. [HandlerAjaxOnly]
  3111. [ValidateAntiForgeryToken]
  3112. public ActionResult DeleteICSInspectionRulesGroup(string keyValue)
  3113. {
  3114. string msg = App.DeleteICSInspectionRulesGroup(keyValue);
  3115. if (string.IsNullOrEmpty(msg))
  3116. {
  3117. return Success("删除成功!");
  3118. }
  3119. else
  3120. {
  3121. return Error(msg);
  3122. }
  3123. }
  3124. /// <summary>
  3125. /// 获取抽样规则子表
  3126. /// </summary>
  3127. /// <param name="GroupCode"></param>
  3128. /// <param name="pagination"></param>
  3129. /// <returns></returns>
  3130. [HttpGet]
  3131. [HandlerAjaxOnly]
  3132. public ActionResult GetICSInspectionRulesListBYCode(string RulesCode, Pagination pagination)
  3133. {
  3134. DataTable ListData = App.GetICSInspectionRulesListBYCode(RulesCode, ref pagination);
  3135. var JsonData = new
  3136. {
  3137. total = pagination.total,
  3138. page = pagination.page,
  3139. records = pagination.records,
  3140. rows = ListData,
  3141. };
  3142. return Content(JsonData.ToJson());
  3143. }
  3144. //料品不良组导入
  3145. [HttpPost]
  3146. /// <summary>
  3147. /// 文件上传到本地
  3148. /// </summary>
  3149. public string UploadFileInspectionRulesList()
  3150. {
  3151. try
  3152. {
  3153. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  3154. if (hpFiles != null && hpFiles.Count > 0)
  3155. {
  3156. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  3157. if (IsXls != ".xls" && IsXls != ".xlsx")
  3158. {
  3159. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  3160. }
  3161. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
  3162. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  3163. int iLen = hpFiles[0].ContentLength;
  3164. if (Directory.Exists(savePath)) return "文件已存在";
  3165. byte[] bData = new byte[iLen];
  3166. hpFiles[0].InputStream.Read(bData, 0, iLen);
  3167. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  3168. newFile.Write(bData, 0, bData.Length);
  3169. newFile.Flush();
  3170. int _FileSizeTemp = hpFiles[0].ContentLength;
  3171. newFile.Close();
  3172. newFile.Dispose();
  3173. //bool del = false;
  3174. string mess = "";
  3175. mess = App.UploadFileInspectionRulesList(savePath);
  3176. if (System.IO.File.Exists(savePath))//删除文件
  3177. {
  3178. System.IO.File.Delete(savePath);
  3179. }
  3180. return mess;
  3181. }
  3182. else
  3183. {
  3184. return "获取文件失败";
  3185. }
  3186. }
  3187. catch (Exception ex)
  3188. {
  3189. return ex.ToString();
  3190. }
  3191. }
  3192. //物料抽检规则绑定明细
  3193. public ActionResult GetICSInventoryInspectionRulesGroup(Pagination pagination, string queryJson)
  3194. {
  3195. DataTable ListData = App.GetICSInventoryInspectionRulesGroup(ref pagination, queryJson);
  3196. var JsonData = new
  3197. {
  3198. total = pagination.total,
  3199. page = pagination.page,
  3200. records = pagination.records,
  3201. rows = ListData,
  3202. };
  3203. return Content(JsonData.ToJson());
  3204. }
  3205. ///物料抽检规则绑定明细子表
  3206. [HttpGet]
  3207. [HandlerAjaxOnly]
  3208. public ActionResult ICSInventoryInspectionRulesList(string ID, Pagination pagination)
  3209. {
  3210. DataTable ListData = App.ICSInventoryInspectionRulesList(ID, ref pagination);
  3211. var JsonData = new
  3212. {
  3213. total = pagination.total,
  3214. page = pagination.page,
  3215. records = pagination.records,
  3216. rows = ListData,
  3217. };
  3218. return Content(JsonData.ToJson());
  3219. }
  3220. //删除物料抽检规则绑定明细
  3221. [HttpPost]
  3222. [HandlerAjaxOnly]
  3223. [ValidateAntiForgeryToken]
  3224. public ActionResult DeleteICSInventoryInspectionRulesGroup(string keyValue)
  3225. {
  3226. string msg = App.DeleteICSInventoryInspectionRulesGroup(keyValue);
  3227. if (string.IsNullOrEmpty(msg))
  3228. {
  3229. return Success("删除成功!");
  3230. }
  3231. else
  3232. {
  3233. return Error(msg);
  3234. }
  3235. }
  3236. [HttpGet]
  3237. [HandlerAjaxOnly]
  3238. public ActionResult GetRulesName()
  3239. {
  3240. DataTable dt = App.GetRulesName();
  3241. return Content(dt.ToJson());
  3242. }
  3243. [HttpGet]
  3244. [HandlerAjaxOnly]
  3245. public ActionResult GetInspectionListInfoByRules(string ID)
  3246. {
  3247. DataTable ListData = App.GetInspectionListInfoByRules(ID);
  3248. var JsonData = new
  3249. {
  3250. rows = ListData,
  3251. };
  3252. return Content(JsonData.ToJson());
  3253. }
  3254. [HttpGet]
  3255. [HandlerAjaxOnly]
  3256. public ActionResult GetICSInventoryInspectionRulesList(string BID, Pagination pagination)
  3257. {
  3258. DataTable ListData = App.GetICSInventoryInspectionRulesList(BID, ref pagination);
  3259. var JsonData = new
  3260. {
  3261. total = pagination.total,
  3262. page = pagination.page,
  3263. records = pagination.records,
  3264. rows = ListData,
  3265. };
  3266. return Content(JsonData.ToJson());
  3267. }
  3268. [HttpGet]
  3269. [HandlerAjaxOnly]
  3270. public ActionResult GetICSInventoryInspectionRulesList2(string BID, Pagination pagination)
  3271. {
  3272. DataTable ListData = App.GetICSInventoryInspectionRulesList2(BID, ref pagination);
  3273. var JsonData = new
  3274. {
  3275. total = pagination.total,
  3276. page = pagination.page,
  3277. records = pagination.records,
  3278. rows = ListData,
  3279. };
  3280. return Content(JsonData.ToJson());
  3281. }
  3282. //新增料品检验明细
  3283. [HttpPost]
  3284. public ActionResult SubICSInventoryInspectionRulesGroupAdd(ICSInventoryInspectionGroup main, string ID, string InvCode, string Editable)
  3285. {
  3286. try
  3287. {
  3288. App.SubICSInventoryInspectionRulesGroupAdd(main, ID, InvCode, Editable);
  3289. return Success("保存成功!");
  3290. }
  3291. catch (Exception ex)
  3292. {
  3293. return Error(ex.Message);
  3294. }
  3295. }
  3296. //修改料品检验明细
  3297. //[HttpPost]
  3298. public ActionResult UpdateICSInventoryInspectionRulesGroup(ICSInventoryInspectionGroup main, string BID, string ID, string InvCode, string Editable)
  3299. {
  3300. try
  3301. {
  3302. App.UpdateICSInventoryInspectionRulesGroup(main, BID, ID, InvCode, Editable);
  3303. return Success("修改成功!");
  3304. }
  3305. catch (Exception ex)
  3306. {
  3307. return Error(ex.Message);
  3308. }
  3309. }
  3310. [HttpPost]
  3311. /// <summary>
  3312. /// 文件上传到本地
  3313. /// </summary>
  3314. public string UploadFileS(string type)
  3315. {
  3316. try
  3317. {
  3318. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  3319. if (hpFiles != null && hpFiles.Count > 0)
  3320. {
  3321. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  3322. if (IsXls != ".xls" && IsXls != ".xlsx")
  3323. {
  3324. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  3325. }
  3326. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
  3327. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  3328. int iLen = hpFiles[0].ContentLength;
  3329. if (Directory.Exists(savePath)) return "文件已存在";
  3330. byte[] bData = new byte[iLen];
  3331. hpFiles[0].InputStream.Read(bData, 0, iLen);
  3332. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  3333. newFile.Write(bData, 0, bData.Length);
  3334. newFile.Flush();
  3335. int _FileSizeTemp = hpFiles[0].ContentLength;
  3336. newFile.Close();
  3337. newFile.Dispose();
  3338. //bool del = false;
  3339. string mess = "";
  3340. if (type == "InspectionGroup")
  3341. {
  3342. mess = App.UploadFileInspectionGoup(savePath);
  3343. }
  3344. else if (type == "BadCode")
  3345. {
  3346. mess = App.UploadFileBadCode(savePath);
  3347. }
  3348. else if (type == "BadReasonGroup")
  3349. {
  3350. mess = App.UploadFileBadReasonGroup(savePath);
  3351. }
  3352. else if (type == "InventoryInspectionRulesGroup")
  3353. {
  3354. mess = App.UploadFileInvInspectionRulesGroup(savePath);
  3355. }
  3356. if (System.IO.File.Exists(savePath))//删除文件
  3357. {
  3358. System.IO.File.Delete(savePath);
  3359. }
  3360. return mess;
  3361. }
  3362. else
  3363. {
  3364. return "获取文件失败";
  3365. }
  3366. }
  3367. catch (Exception ex)
  3368. {
  3369. return ex.ToString();
  3370. }
  3371. }
  3372. /// <summary>
  3373. /// 删除供应商
  3374. /// </summary>
  3375. /// <returns></returns>
  3376. [HttpPost]
  3377. [HandlerAjaxOnly]
  3378. [ValidateAntiForgeryToken]
  3379. public ActionResult DeleteICSVender(string keyValue)
  3380. {
  3381. string msg = App.DeleteICSVender(keyValue);
  3382. if (string.IsNullOrEmpty(msg))
  3383. {
  3384. return Success("删除成功!");
  3385. }
  3386. else
  3387. {
  3388. return Error(msg);
  3389. }
  3390. }
  3391. /// <summary>
  3392. /// 获取供应商修改文本框值
  3393. /// </summary>
  3394. [HttpPost]
  3395. [HandlerAjaxOnly]
  3396. public ActionResult GetVenderInputValue(string ID, string WorkPoint)
  3397. {
  3398. DataTable ListData = App.GetVenderInputValue(ID, WorkPoint);
  3399. var JsonData = new
  3400. {
  3401. rows = ListData,
  3402. };
  3403. return Content(JsonData.ToJson());
  3404. }
  3405. /// <summary>
  3406. /// 新增部门
  3407. /// </summary>
  3408. /// <param name="keyValue"></param>
  3409. /// <returns></returns>
  3410. [HttpPost]
  3411. [HandlerAjaxOnly]
  3412. public ActionResult InsertICSVender(string keyValue)
  3413. {
  3414. string msg = App.InsertICSVender(keyValue);
  3415. if (!string.IsNullOrEmpty(msg))
  3416. {
  3417. return Error(msg);
  3418. }
  3419. else
  3420. {
  3421. return Success("添加成功!");
  3422. }
  3423. }
  3424. /// <summary>
  3425. /// 修改供应商
  3426. /// </summary>
  3427. /// <param name="keyValue"></param>
  3428. /// <returns></returns>
  3429. [HttpPost]
  3430. [HandlerAjaxOnly]
  3431. public ActionResult UpdateICSVender(string keyValue, string WorkPoint)
  3432. {
  3433. string msg = App.UpdateICSVender(keyValue, WorkPoint);
  3434. if (!string.IsNullOrEmpty(msg))
  3435. {
  3436. return Error(msg);
  3437. }
  3438. else
  3439. {
  3440. return Success("修改成功!");
  3441. }
  3442. }
  3443. /// <summary>
  3444. /// 获取仓库修改文本框值
  3445. /// </summary>
  3446. [HttpPost]
  3447. [HandlerAjaxOnly]
  3448. public ActionResult GetWareHouseInputValue(string ID)
  3449. {
  3450. DataTable ListData = App.GetWareHouseInputValue(ID);
  3451. var JsonData = new
  3452. {
  3453. rows = ListData,
  3454. };
  3455. return Content(JsonData.ToJson());
  3456. }
  3457. /// <summary>
  3458. /// 新增仓库
  3459. /// </summary>
  3460. /// <param name="keyValue"></param>
  3461. /// <returns></returns>
  3462. [HttpPost]
  3463. [HandlerAjaxOnly]
  3464. public ActionResult InsertICSWareHouse(string keyValue)
  3465. {
  3466. string msg = App.InsertICSWareHouse(keyValue);
  3467. if (!string.IsNullOrEmpty(msg))
  3468. {
  3469. return Error(msg);
  3470. }
  3471. else
  3472. {
  3473. return Success("添加成功!");
  3474. }
  3475. }
  3476. /// <summary>
  3477. /// 修改仓库
  3478. /// </summary>
  3479. /// <param name="keyValue"></param>
  3480. /// <returns></returns>
  3481. [HttpPost]
  3482. [HandlerAjaxOnly]
  3483. public ActionResult UpdateICSWareHouse(string keyValue)
  3484. {
  3485. string msg = App.UpdateICSWareHouse(keyValue);
  3486. if (!string.IsNullOrEmpty(msg))
  3487. {
  3488. return Error(msg);
  3489. }
  3490. else
  3491. {
  3492. return Success("修改成功!");
  3493. }
  3494. }
  3495. /// <summary>
  3496. /// 删除仓库
  3497. /// </summary>
  3498. /// <returns></returns>
  3499. [HttpPost]
  3500. [HandlerAjaxOnly]
  3501. [ValidateAntiForgeryToken]
  3502. public ActionResult DeleteICSWareHouse(string keyValue)
  3503. {
  3504. string msg = App.DeleteICSWareHouse(keyValue);
  3505. if (string.IsNullOrEmpty(msg))
  3506. {
  3507. return Success("删除成功!");
  3508. }
  3509. else
  3510. {
  3511. return Error(msg);
  3512. }
  3513. }
  3514. [HttpGet]
  3515. public ActionResult SelectICSColumnEnableForTypeEnable()
  3516. {
  3517. var data = App.SelectICSColumnEnableForTypeEnable();
  3518. return Content(data.ToJson());
  3519. }
  3520. [HttpGet]
  3521. [HandlerAjaxOnly]
  3522. public ActionResult GetLoadShowForColumn()
  3523. {
  3524. DataTable ListData = App.GetLoadShowForColumn();
  3525. var JsonData = new
  3526. {
  3527. rows = ListData,
  3528. };
  3529. return Content(JsonData.ToJson());
  3530. }
  3531. [HttpGet]
  3532. public ActionResult SelectICSColumnEnableForEnablePulic(string TabName)
  3533. {
  3534. var data = App.SelectICSColumnEnableForEnablePulic(TabName);
  3535. return Content(data.ToJson());
  3536. }
  3537. //一键设置物料免检
  3538. [HttpPost]
  3539. [HandlerAjaxOnly]
  3540. public ActionResult SetIQCICSInventory(string keyValue)
  3541. {
  3542. string msg = App.SetIQCICSInventory(keyValue);
  3543. if (!string.IsNullOrEmpty(msg))
  3544. {
  3545. return Error(msg);
  3546. }
  3547. else
  3548. {
  3549. return Success("设置免检成功!");
  3550. }
  3551. }
  3552. //一键取消物料免检
  3553. [HttpPost]
  3554. [HandlerAjaxOnly]
  3555. public ActionResult CancelIQCICSInventory(string keyValue)
  3556. {
  3557. string msg = App.CancelIQCICSInventory(keyValue);
  3558. if (!string.IsNullOrEmpty(msg))
  3559. {
  3560. return Error(msg);
  3561. }
  3562. else
  3563. {
  3564. return Success("取消免检成功!");
  3565. }
  3566. }
  3567. }
  3568. }