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.

1507 lines
49 KiB

  1. using NFine.Application.WMS;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. using NFine.Code;
  10. using System.Data.SqlClient;
  11. using NFine.Data.Extensions;
  12. using System.Data.OleDb;
  13. using System.Configuration;
  14. using ICS.Application.Entity;
  15. using System.Xml;
  16. namespace NFine.Web.Areas.WMS.Controllers
  17. {
  18. public class WMSCreateItemLotController : ControllerBase
  19. {
  20. // GET: WMS/WMSCreateItemLot
  21. private WMSCreateItemLotApp App = new WMSCreateItemLotApp();
  22. public ActionResult CreateItemLot()
  23. {
  24. return View();
  25. }
  26. public ActionResult From()
  27. {
  28. return View();
  29. }
  30. public ActionResult FormMoPick()
  31. {
  32. return View();
  33. }
  34. public ActionResult ImportLot()
  35. {
  36. return View();
  37. }
  38. [HttpGet]
  39. public ActionResult SelectICSExtensionEnable()
  40. {
  41. var data = App.SelectICSExtensionEnable();
  42. return Content(data.ToJson());
  43. }
  44. [HttpGet]
  45. public ActionResult GetComplete()
  46. {
  47. var data = App.GetComplete();
  48. return Content(data.ToJson());
  49. }
  50. [HttpGet]
  51. public ActionResult GetWWComplete()
  52. {
  53. var data = App.GetWWComplete();
  54. return Content(data.ToJson());
  55. }
  56. [HttpGet]
  57. [HandlerAjaxOnly]
  58. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  59. {
  60. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  61. var JsonData = new
  62. {
  63. total = pagination.total,
  64. page = pagination.page,
  65. records = pagination.records,
  66. rows = ListData,
  67. };
  68. return Content(JsonData.ToJson());
  69. }
  70. [HttpGet]
  71. [HandlerAjaxOnly]
  72. public ActionResult GetICSMOPick(Pagination pagination, string MODetailID,string workpoint)
  73. {
  74. DataTable ListData = App.GetICSMOPick(MODetailID, workpoint, ref pagination);
  75. var JsonData = new
  76. {
  77. total = pagination.total,
  78. page = pagination.page,
  79. records = pagination.records,
  80. rows = ListData,
  81. };
  82. return Content(JsonData.ToJson());
  83. }
  84. [HttpGet]
  85. [HandlerAjaxOnly]
  86. public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, string Type, Pagination pagination)
  87. {
  88. DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, Type, ref pagination);
  89. var JsonData = new
  90. {
  91. total = pagination.total,
  92. page = pagination.page,
  93. records = pagination.records,
  94. rows = ListData,
  95. };
  96. return Content(JsonData.ToJson());
  97. }
  98. /// <summary>
  99. /// 点击生成条码查询
  100. /// </summary>
  101. [HttpGet]
  102. [HandlerAjaxOnly]
  103. public ActionResult GetSubGridJsonByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  104. {
  105. DataTable ListData = App.GetSubGridJsonByCreate(ApplyNegCode, Sequence, WorkPoint);
  106. var JsonData = new
  107. {
  108. rows = ListData,
  109. };
  110. return Content(JsonData.ToJson());
  111. }
  112. [HttpGet]
  113. [HandlerAjaxOnly]
  114. public ActionResult GetVendorLotNo(string VenCode, string WorkPoint)
  115. {
  116. DataTable ListData = App.GetVendorLotNo(VenCode, WorkPoint);
  117. var JsonData = new
  118. {
  119. VendorLotNo = ListData.Rows[0][0].ToString(),
  120. };
  121. return Content(JsonData.ToJson());
  122. }
  123. [HttpPost]
  124. [HandlerAjaxOnly]
  125. [ValidateAntiForgeryToken]
  126. public ActionResult SubmitForm(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint,string AMEnable)
  127. {
  128. int i = App.CreateItemLotNo(ApplyNegCode, Sequence, keyValue, WorkPoint, AMEnable);
  129. if (i > 0)
  130. {
  131. return Success("生成成功!");
  132. }
  133. else
  134. {
  135. return Error("生成失败!");
  136. }
  137. }
  138. [HttpPost]
  139. [HandlerAjaxOnly]
  140. [ValidateAntiForgeryToken]
  141. public ActionResult DeleteItemLot(string keyValue)
  142. {
  143. keyValue = keyValue.Substring(1, keyValue.Length - 2);
  144. //WorkPoint = WorkPoint.Substring(1, WorkPoint.Length - 2);
  145. string msg = App.DeleteItemLot(keyValue);
  146. if (string.IsNullOrWhiteSpace(msg))
  147. {
  148. return Success("删除成功!");
  149. }
  150. else
  151. {
  152. return Error(msg);
  153. }
  154. }
  155. [HttpPost]
  156. [HandlerAjaxOnly]
  157. [ValidateAntiForgeryToken]
  158. public ActionResult SubmitFormWeiWai(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  159. {
  160. int i = App.SubmitFormWeiWai(OApplyNegCode, Sequence, keyValue, WorkPoint);
  161. if (i > 0)
  162. {
  163. return Success("生成成功!");
  164. }
  165. else
  166. {
  167. return Error("生成失败!");
  168. }
  169. }
  170. //成品
  171. [HttpPost]
  172. [HandlerAjaxOnly]
  173. [ValidateAntiForgeryToken]
  174. public ActionResult SubmitFormChengPing(string MOCode, string Sequence, string keyValue, string WorkPoint)
  175. {
  176. int i = App.SubmitFormChengPing(MOCode, Sequence, keyValue, WorkPoint);
  177. if (i > 0)
  178. {
  179. return Success("生成成功!");
  180. }
  181. else
  182. {
  183. return Error("生成失败!");
  184. }
  185. }
  186. //销售退货
  187. [HttpPost]
  188. [HandlerAjaxOnly]
  189. [ValidateAntiForgeryToken]
  190. public ActionResult SubmitFormXiaoShou(string SDNCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
  191. {
  192. int i = App.SubmitFormXiaoShou(SDNCode, Sequence, keyValue, WorkPoint, AMEnable);
  193. if (i > 0)
  194. {
  195. return Success("生成成功!");
  196. }
  197. else
  198. {
  199. return Error("生成失败!");
  200. }
  201. }
  202. //其他
  203. [HttpPost]
  204. [HandlerAjaxOnly]
  205. [ValidateAntiForgeryToken]
  206. public ActionResult SubmitFormQiTa(string InCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
  207. {
  208. int i = App.SubmitFormQiTa(InCode, Sequence, keyValue, WorkPoint, AMEnable);
  209. if (i > 0)
  210. {
  211. return Success("生成成功!");
  212. }
  213. else
  214. {
  215. return Error("生成失败!");
  216. }
  217. }
  218. /// <summary>
  219. /// 打印数据参数:服务器的URL+打印的文件名,转化为Base64编码
  220. /// </summary>
  221. protected string strPrintData;
  222. /// <summary>
  223. /// 标识是否安装了控件
  224. /// </summary>
  225. protected bool bIsInstallPrintControl = true;
  226. /// <summary>
  227. /// 打印控件的Cookie值
  228. /// </summary>
  229. protected string strPrintControlCookie = "";
  230. /// <summary>
  231. /// 获取Url中去掉文件名的路径
  232. /// </summary>
  233. /// <returns></returns>
  234. private string GetUrlPath()
  235. {
  236. string strUrl = Request.Url.ToString();
  237. int iEnd = strUrl.LastIndexOf("/");
  238. strUrl = strUrl.Substring(0, iEnd + 1);
  239. return strUrl;
  240. }
  241. //打印
  242. [HttpPost]
  243. [HandlerAjaxOnly]
  244. public ActionResult PrintItemLot(string keyValue, string WorkPoint, string Type)
  245. {
  246. // string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
  247. keyValue = keyValue.Substring(1, keyValue.Length - 2);
  248. WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
  249. string strPrintFileName = Server.MapPath("/ReportFile/") + "纷纷无法b_成品条码.fr3";
  250. PrintJson pJson = new PrintJson(Server.MapPath("./PrintTemp"), strPrintFileName);
  251. pJson.CheckRegister("苏州智合诚信息科技有限公司", "56DD3B4C172D0D140841CAC98A58A819F4E28EDA5D6E45711DDD64F6A439F68B6A7870CD7DAFD69A919CB870207FE4BB206F92BE3D53C221B019E0797E739EBA4"); //注册信息
  252. //pJson.CheckRegister("注册姓名", "8ECCCD6A1302DFEE1A6456A5D"); //注册信息
  253. //pJson.AddPrintParam("ShopName", "测试酒楼");
  254. //pJson.AddPrintParam("PrintDepositAdd", "说明:本单据为贵客押金收取凭证,盖章有效。退房时请出示,遗失者自负,请妥善保存。退房时间为12:00时,延时退房18:00时以前按半天房费收取,18:00时以后算全天房价。押金单有效期为一个月,过期作废。 贵重物品请交前台寄存,未寄存丢失自负。 谢谢!");
  255. SetCookieAndURL(pJson);// 设置控件调用的Cookie值,判断是否安装了打印控件
  256. string strSql = "";
  257. if (Type == "1")
  258. {
  259. strSql = @"select a.LotNo, c.ApplyNegCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  260. FROM dbo.ICSInventoryLot a
  261. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  262. left join ICSMOApplyNegDetail c on b.TransCode=c.ApplyNegCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  263. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  264. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  265. }
  266. if (Type == "2")
  267. {
  268. strSql = @"select a.LotNo, c.OApplyNegCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  269. FROM dbo.ICSInventoryLot a
  270. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  271. left join ICSOApplyNegDetail c on b.TransCode=c.OApplyNegCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  272. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  273. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  274. }
  275. if (Type == "3")
  276. {
  277. strSql = @"select a.LotNo, c.MOCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  278. FROM dbo.ICSInventoryLot a
  279. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  280. left join ICSMO c on b.TransCode=c.MOCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  281. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  282. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  283. }
  284. if (Type == "5")
  285. {
  286. strSql = @"select a.LotNo, c.InCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  287. FROM dbo.ICSInventoryLot a
  288. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  289. left join ICSOtherIn c on b.TransCode=c.InCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  290. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  291. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  292. }
  293. if (Type == "6")
  294. {
  295. strSql = @"select a.LotNo, c.ReturnCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  296. FROM dbo.ICSInventoryLot a
  297. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  298. left join ICSReturn c on b.TransCode=c.ReturnCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  299. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  300. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  301. }
  302. if (Type == "7")
  303. {
  304. strSql = @"select a.LotNo, c.DNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  305. FROM dbo.ICSInventoryLot a
  306. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  307. left join ICSDeliveryNotice c on b.TransCode=c.DNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  308. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  309. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  310. }
  311. if (Type == "8")
  312. {
  313. strSql = @"select a.LotNo, c.ODNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  314. FROM dbo.ICSInventoryLot a
  315. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  316. left join ICSODeliveryNotice c on b.TransCode=c.ODNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  317. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  318. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  319. }
  320. if (Type == "9")
  321. {
  322. strSql = @" select a.LotNo, c.RCVCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  323. FROM dbo.ICSInventoryLot a
  324. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  325. left join ICSManufactureReceive c on b.TransCode=c.RCVCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  326. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  327. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  328. }
  329. if (Type == "10")
  330. {
  331. strSql = @"select a.LotNo, c.DNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  332. FROM dbo.ICSInventoryLot a
  333. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  334. left join ICSDeliveryNotice c on b.TransCode=c.DNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  335. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  336. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  337. }
  338. if (Type == "11")
  339. {
  340. strSql = @"select a.LotNo, c.ODNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  341. FROM dbo.ICSInventoryLot a
  342. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  343. left join ICSODeliveryNotice c on b.TransCode=c.ODNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  344. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  345. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  346. }
  347. //string strSql = @"Select * From CashLog";
  348. DataTable dtCashLog = DbHelper.ExecuteTable(DbHelper.ConnectionString, CommandType.Text, strSql, true, null);
  349. // string strPrintTempFile = pJson.ShowReport(dtCashLog); //产生JSON文件内容
  350. string strPrintTempFile = pJson.ShowReport(dtCashLog); //导出PDF文件
  351. //把服务器的URL + 此文件名 传递给控件,由控件下载还原数据进行打印
  352. string strServerURL = GetUrlPath() + "PrintTemp/";
  353. string strData = strServerURL + strPrintTempFile;
  354. strPrintData = PrintFunction.EnBase64(strData);
  355. var JsonData = new
  356. {
  357. strPrintData_1 = strPrintData,
  358. bIsInstallPrintControl_1 = bIsInstallPrintControl,
  359. strPrintControlCookie_1 = strPrintControlCookie
  360. };
  361. //多站点
  362. string sql = @"UPDATE dbo.ICSInventoryLot
  363. SET PrintTimes=ISNULL(PrintTimes,0)+1,
  364. LastPrintUser='',
  365. LastPrintTime=GETDATE()
  366. WHERE ID IN (" + keyValue.TrimEnd(',') + ") and WorkPoint in ('" + WorkPoint.TrimEnd(',') + "')";
  367. SqlHelper.ExecuteNonQuery(sql);
  368. return Content(JsonData.ToJson());
  369. }
  370. /// <summary>
  371. /// 设置控件调用的Cookie值,判断是否安装了打印控件
  372. /// </summary>
  373. /// <param name="pJson"></param>
  374. private void SetCookieAndURL(PrintJson pJson)
  375. {
  376. bIsInstallPrintControl = false;
  377. strPrintControlCookie = "";
  378. HttpCookie pCookieInstall = Request.Cookies["InstallPrintControl"];
  379. if (pCookieInstall != null)
  380. { //Cookie存在
  381. strPrintControlCookie = pCookieInstall.Value.ToString();
  382. //以Cookie值查找在数据表中是否存在
  383. string strSql = @"Select * From sys_SRM_CheckInstall Where Cookie = @Cookie";
  384. SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strPrintControlCookie) };
  385. using (SqlDataReader drCookie = DbHelper.ExecuteReader(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie))
  386. {
  387. if (drCookie.Read())
  388. { //标识为已经安装
  389. bIsInstallPrintControl = true;
  390. }
  391. drCookie.Close();
  392. }
  393. //更新Cookie的保存时间
  394. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  395. Response.SetCookie(pCookieInstall);
  396. }
  397. else
  398. {//Cookie不存在,则新建Cookie
  399. strPrintControlCookie = System.Guid.NewGuid().ToString();
  400. pCookieInstall = new HttpCookie("InstallPrintControl", strPrintControlCookie);
  401. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  402. Response.Cookies.Add(pCookieInstall);
  403. }
  404. string strUrl = Server.MapPath("/PrintTemp/") + "IsCheckInstall";
  405. pJson.SetCookieAndURL(strPrintControlCookie, strUrl);
  406. }
  407. [HttpGet]
  408. [HandlerAjaxOnly]
  409. public ActionResult GetGridJsonWeiWai(Pagination pagination, string queryJson)
  410. {
  411. DataTable ListData = App.GetGridJsonWeiWai(queryJson, ref pagination);
  412. var JsonData = new
  413. {
  414. total = pagination.total,
  415. page = pagination.page,
  416. records = pagination.records,
  417. rows = ListData,
  418. };
  419. return Content(JsonData.ToJson());
  420. }
  421. [HttpGet]
  422. [HandlerAjaxOnly]
  423. public ActionResult GetSubGridJsonWeiWai(string OApplyNegCode, string Sequence, Pagination pagination)
  424. {
  425. DataTable ListData = App.GetSubGridJsonWeiWai(OApplyNegCode, Sequence, ref pagination);
  426. var JsonData = new
  427. {
  428. total = pagination.total,
  429. page = pagination.page,
  430. records = pagination.records,
  431. rows = ListData,
  432. };
  433. return Content(JsonData.ToJson());
  434. }
  435. /// <summary>
  436. /// 点击生成条码查询
  437. /// </summary>
  438. [HttpGet]
  439. [HandlerAjaxOnly]
  440. public ActionResult GetSubGridJsonWeiWaiByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  441. {
  442. DataTable ListData = App.GetSubGridJsonWeiWaiByCreate(OApplyNegCode, Sequence, WorkPoint);
  443. var JsonData = new
  444. {
  445. rows = ListData,
  446. };
  447. return Content(JsonData.ToJson());
  448. }
  449. [HttpGet]
  450. [HandlerAjaxOnly]
  451. public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
  452. {
  453. DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination);
  454. var JsonData = new
  455. {
  456. total = pagination.total,
  457. page = pagination.page,
  458. records = pagination.records,
  459. rows = ListData,
  460. };
  461. return Content(JsonData.ToJson());
  462. }
  463. /// <summary>
  464. /// 点击生成条码查询(成品)
  465. /// </summary>
  466. [HttpGet]
  467. [HandlerAjaxOnly]
  468. public ActionResult GetSubGridJsonChengPingByCreate(string MOCode, string Sequence, string WorkPoint)
  469. {
  470. DataTable ListData = App.GetSubGridJsonChengPingByCreate(MOCode, Sequence, WorkPoint);
  471. var JsonData = new
  472. {
  473. rows = ListData,
  474. };
  475. return Content(JsonData.ToJson());
  476. }
  477. [HttpGet]
  478. [HandlerAjaxOnly]
  479. public ActionResult GetGridJsonXiaoShou(Pagination pagination, string queryJson)
  480. {
  481. DataTable ListData = App.GetGridJsonXiaoShou(queryJson, ref pagination);
  482. var JsonData = new
  483. {
  484. total = pagination.total,
  485. page = pagination.page,
  486. records = pagination.records,
  487. rows = ListData,
  488. };
  489. return Content(JsonData.ToJson());
  490. }
  491. [HttpGet]
  492. [HandlerAjaxOnly]
  493. public ActionResult GetGridJsonQiTa(Pagination pagination, string queryJson)
  494. {
  495. DataTable ListData = App.GetGridJsonQiTa(queryJson, ref pagination);
  496. var JsonData = new
  497. {
  498. total = pagination.total,
  499. page = pagination.page,
  500. records = pagination.records,
  501. rows = ListData,
  502. };
  503. return Content(JsonData.ToJson());
  504. }
  505. /// <summary>
  506. /// 点击生成条码查询(销售退货)
  507. /// </summary>
  508. [HttpGet]
  509. [HandlerAjaxOnly]
  510. public ActionResult GetSubGridJsonXiaoShouByCreate(string SDNCode, string Sequence, string WorkPoint)
  511. {
  512. DataTable ListData = App.GetSubGridJsonXiaoShouByCreate(SDNCode, Sequence, WorkPoint);
  513. var JsonData = new
  514. {
  515. rows = ListData,
  516. };
  517. return Content(JsonData.ToJson());
  518. }
  519. /// <summary>
  520. /// 点击生成条码查询(其他入库)
  521. /// </summary>
  522. [HttpGet]
  523. [HandlerAjaxOnly]
  524. public ActionResult GetSubGridJsonQiTaByCreate(string InCode, string Sequence, string WorkPoint)
  525. {
  526. DataTable ListData = App.GetSubGridJsonQiTaByCreate(InCode, Sequence, WorkPoint);
  527. var JsonData = new
  528. {
  529. rows = ListData,
  530. };
  531. return Content(JsonData.ToJson());
  532. }
  533. //归还
  534. [HttpGet]
  535. [HandlerAjaxOnly]
  536. public ActionResult GetGridJsonGuiHuan(Pagination pagination, string queryJson)
  537. {
  538. DataTable ListData = App.GetGridJsonGuiHuan(queryJson, ref pagination);
  539. var JsonData = new
  540. {
  541. total = pagination.total,
  542. page = pagination.page,
  543. records = pagination.records,
  544. rows = ListData,
  545. };
  546. return Content(JsonData.ToJson());
  547. }
  548. //审核到货单
  549. [HttpGet]
  550. [HandlerAjaxOnly]
  551. public ActionResult GetGridJsonSHDH(Pagination pagination, string queryJson)
  552. {
  553. DataTable ListData = App.GetGridJsonSHDH(queryJson, ref pagination);
  554. var JsonData = new
  555. {
  556. total = pagination.total,
  557. page = pagination.page,
  558. records = pagination.records,
  559. rows = ListData,
  560. };
  561. return Content(JsonData.ToJson());
  562. }
  563. //审核到货单
  564. [HttpGet]
  565. [HandlerAjaxOnly]
  566. public ActionResult GetGridJsonWWSHDH(Pagination pagination, string queryJson)
  567. {
  568. DataTable ListData = App.GetGridJsonWWSHDH(queryJson, ref pagination);
  569. var JsonData = new
  570. {
  571. total = pagination.total,
  572. page = pagination.page,
  573. records = pagination.records,
  574. rows = ListData,
  575. };
  576. return Content(JsonData.ToJson());
  577. }
  578. //审核到货单
  579. [HttpGet]
  580. [HandlerAjaxOnly]
  581. public ActionResult GetGridJsonKLCPRK(Pagination pagination, string queryJson)
  582. {
  583. DataTable ListData = App.GetGridJsonKLCPRK(queryJson, ref pagination);
  584. var JsonData = new
  585. {
  586. total = pagination.total,
  587. page = pagination.page,
  588. records = pagination.records,
  589. rows = ListData,
  590. };
  591. return Content(JsonData.ToJson());
  592. }
  593. /// <summary>
  594. /// 点击生成条码查询(审核到货单)
  595. /// </summary>
  596. [HttpGet]
  597. [HandlerAjaxOnly]
  598. public ActionResult GetSubGridJsonSHDHByCreate(string DNCode, string Sequence, string WorkPoint)
  599. {
  600. DataTable ListData = App.GetSubGridJsonSHDHByCreate(DNCode, Sequence, WorkPoint);
  601. var JsonData = new
  602. {
  603. rows = ListData,
  604. };
  605. return Content(JsonData.ToJson());
  606. }
  607. /// <summary>
  608. /// 点击生成条码查询(审核委外到货单)
  609. /// </summary>
  610. [HttpGet]
  611. [HandlerAjaxOnly]
  612. public ActionResult GetSubGridJsonWWSHDHByCreate(string ODNCode, string Sequence, string WorkPoint)
  613. {
  614. DataTable ListData = App.GetSubGridJsonWWSHDHByCreate(ODNCode, Sequence, WorkPoint);
  615. var JsonData = new
  616. {
  617. rows = ListData,
  618. };
  619. return Content(JsonData.ToJson());
  620. }
  621. /// <summary>
  622. /// 点击生成条码查询(审核委外到货单)
  623. /// </summary>
  624. [HttpGet]
  625. [HandlerAjaxOnly]
  626. public ActionResult GetSubGridJsonKLCPRKByCreate(string RCVCode, string Sequence, string WorkPoint)
  627. {
  628. DataTable ListData = App.GetSubGridJsonKLCPRKByCreate(RCVCode, Sequence, WorkPoint);
  629. var JsonData = new
  630. {
  631. rows = ListData,
  632. };
  633. return Content(JsonData.ToJson());
  634. }
  635. /// <summary>
  636. /// 点击生成条码查询(归还)
  637. /// </summary>
  638. [HttpGet]
  639. [HandlerAjaxOnly]
  640. public ActionResult GetSubGridJsonGuiHuanByCreate(string ReturnCode, string Sequence, string WorkPoint)
  641. {
  642. DataTable ListData = App.GetSubGridJsonGuiHuanByCreate(ReturnCode, Sequence, WorkPoint);
  643. var JsonData = new
  644. {
  645. rows = ListData,
  646. };
  647. return Content(JsonData.ToJson());
  648. }
  649. //归还
  650. [HttpPost]
  651. [HandlerAjaxOnly]
  652. [ValidateAntiForgeryToken]
  653. public ActionResult SubmitFormGuiHuan(string ReturnCode, string Sequence, string keyValue, string WorkPoint)
  654. {
  655. int i = App.SubmitFormGuiHuan(ReturnCode, Sequence, keyValue, WorkPoint);
  656. if (i > 0)
  657. {
  658. return Success("生成成功!");
  659. }
  660. else
  661. {
  662. return Error("生成失败!");
  663. }
  664. }
  665. //审核到货单
  666. [HttpPost]
  667. [HandlerAjaxOnly]
  668. [ValidateAntiForgeryToken]
  669. public ActionResult SubmitFormSHDH(string DNCode, string Sequence, string keyValue, string WorkPoint,string AMEnable)
  670. {
  671. int i = App.SubmitFormSHDH(DNCode, Sequence, keyValue, WorkPoint, AMEnable);
  672. if (i > 0)
  673. {
  674. return Success("生成成功!");
  675. }
  676. else
  677. {
  678. return Error("生成失败!");
  679. }
  680. }
  681. //审核委外到货单
  682. [HttpPost]
  683. [HandlerAjaxOnly]
  684. [ValidateAntiForgeryToken]
  685. public ActionResult SubmitFormWWSHDH(string ODNCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
  686. {
  687. int i = App.SubmitFormWWSHDH(ODNCode, Sequence, keyValue, WorkPoint, AMEnable);
  688. if (i > 0)
  689. {
  690. return Success("生成成功!");
  691. }
  692. else
  693. {
  694. return Error("生成失败!");
  695. }
  696. }
  697. //开立成品入库
  698. [HttpPost]
  699. [HandlerAjaxOnly]
  700. [ValidateAntiForgeryToken]
  701. public ActionResult SubmitFormKLCPRK(string RCVCode, string Sequence, string keyValue, string WorkPoint)
  702. {
  703. int i = App.SubmitFormKLCPRK(RCVCode, Sequence, keyValue, WorkPoint);
  704. if (i > 0)
  705. {
  706. return Success("生成成功!");
  707. }
  708. else
  709. {
  710. return Error("生成失败!");
  711. }
  712. }
  713. //委外拒收单
  714. [HttpGet]
  715. [HandlerAjaxOnly]
  716. public ActionResult GetGridJsonWWJSD(Pagination pagination, string queryJson)
  717. {
  718. DataTable ListData = App.GetGridJsonWWJSD(queryJson, ref pagination);
  719. var JsonData = new
  720. {
  721. total = pagination.total,
  722. page = pagination.page,
  723. records = pagination.records,
  724. rows = ListData,
  725. };
  726. return Content(JsonData.ToJson());
  727. }
  728. //拒收单
  729. [HttpGet]
  730. [HandlerAjaxOnly]
  731. public ActionResult GetGridJsonJSD(Pagination pagination, string queryJson)
  732. {
  733. DataTable ListData = App.GetGridJsonJSD(queryJson, ref pagination);
  734. var JsonData = new
  735. {
  736. total = pagination.total,
  737. page = pagination.page,
  738. records = pagination.records,
  739. rows = ListData,
  740. };
  741. return Content(JsonData.ToJson());
  742. }
  743. //审核到货单
  744. [HttpPost]
  745. [HandlerAjaxOnly]
  746. [ValidateAntiForgeryToken]
  747. public ActionResult SubmitFormJSD(string DNCode, string Sequence, string keyValue, string WorkPoint)
  748. {
  749. int i = App.SubmitFormJSD(DNCode, Sequence, keyValue, WorkPoint);
  750. if (i > 0)
  751. {
  752. return Success("生成成功!");
  753. }
  754. else
  755. {
  756. return Error("生成失败!");
  757. }
  758. }
  759. //审核委外到货单
  760. [HttpPost]
  761. [HandlerAjaxOnly]
  762. [ValidateAntiForgeryToken]
  763. public ActionResult SubmitFormWWJSD(string ODNCode, string Sequence, string keyValue, string WorkPoint)
  764. {
  765. int i = App.SubmitFormWWJSD(ODNCode, Sequence, keyValue, WorkPoint);
  766. if (i > 0)
  767. {
  768. return Success("生成成功!");
  769. }
  770. else
  771. {
  772. return Error("生成失败!");
  773. }
  774. }
  775. //领料申请退料
  776. [HttpGet]
  777. [HandlerAjaxOnly]
  778. public ActionResult GetGridJsonLLSQTL(Pagination pagination, string queryJson)
  779. {
  780. DataTable ListData = App.GetGridJsonLLSQTL(queryJson, ref pagination);
  781. var JsonData = new
  782. {
  783. total = pagination.total,
  784. page = pagination.page,
  785. records = pagination.records,
  786. rows = ListData,
  787. };
  788. return Content(JsonData.ToJson());
  789. }
  790. /// <summary>
  791. /// 点击生成条码查询(领料申请退料)
  792. /// </summary>
  793. [HttpGet]
  794. [HandlerAjaxOnly]
  795. public ActionResult GetSubGridJsonJSDByCreate(string DNCode, string Sequence, string WorkPoint)
  796. {
  797. DataTable ListData = App.GetSubGridJsonJSDByCreate(DNCode, Sequence, WorkPoint);
  798. var JsonData = new
  799. {
  800. rows = ListData,
  801. };
  802. return Content(JsonData.ToJson());
  803. }
  804. /// <summary>
  805. /// 点击生成条码查询(领料申请退料)
  806. /// </summary>
  807. [HttpGet]
  808. [HandlerAjaxOnly]
  809. public ActionResult GetSubGridJsonWWJSDByCreate(string ODNCode, string Sequence, string WorkPoint)
  810. {
  811. DataTable ListData = App.GetSubGridJsonWWJSDByCreate(ODNCode, Sequence, WorkPoint);
  812. var JsonData = new
  813. {
  814. rows = ListData,
  815. };
  816. return Content(JsonData.ToJson());
  817. }
  818. [HttpGet]
  819. [HandlerAjaxOnly]
  820. public ActionResult GetSubGridJsonLLSQDByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  821. {
  822. DataTable ListData = App.GetSubGridJsonLLSQDByCreate(ApplyNegCode, Sequence, WorkPoint);
  823. var JsonData = new
  824. {
  825. rows = ListData,
  826. };
  827. return Content(JsonData.ToJson());
  828. }
  829. //领料申请退料生成条码
  830. [HttpPost]
  831. [HandlerAjaxOnly]
  832. [ValidateAntiForgeryToken]
  833. public ActionResult SubmitFormLLSQTL(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  834. {
  835. int i = App.SubmitFormLLSQTL(ApplyNegCode, Sequence, keyValue, WorkPoint);
  836. if (i > 0)
  837. {
  838. return Success("生成成功!");
  839. }
  840. else
  841. {
  842. return Error("生成失败!");
  843. }
  844. }
  845. //材料出库退料
  846. [HttpGet]
  847. [HandlerAjaxOnly]
  848. public ActionResult GetGridJsonCLCK(Pagination pagination, string queryJson)
  849. {
  850. DataTable ListData = App.GetGridJsonCLCK(queryJson, ref pagination);
  851. var JsonData = new
  852. {
  853. total = pagination.total,
  854. page = pagination.page,
  855. records = pagination.records,
  856. rows = ListData,
  857. };
  858. return Content(JsonData.ToJson());
  859. }
  860. //材料出库退料
  861. [HttpGet]
  862. [HandlerAjaxOnly]
  863. public ActionResult GetSubGridJsonCLCKByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  864. {
  865. DataTable ListData = App.GetSubGridJsonCLCKByCreate(ApplyNegCode, Sequence, WorkPoint);
  866. var JsonData = new
  867. {
  868. rows = ListData,
  869. };
  870. return Content(JsonData.ToJson());
  871. }
  872. //材料出库退料生成条码
  873. [HttpPost]
  874. [HandlerAjaxOnly]
  875. [ValidateAntiForgeryToken]
  876. public ActionResult SubmitFormCLCKT(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  877. {
  878. int i = App.SubmitFormCLCKT(ApplyNegCode, Sequence, keyValue, WorkPoint);
  879. if (i > 0)
  880. {
  881. return Success("生成成功!");
  882. }
  883. else
  884. {
  885. return Error("生成失败!");
  886. }
  887. }
  888. //委外领料
  889. [HttpGet]
  890. [HandlerAjaxOnly]
  891. public ActionResult GetGridJsonWWLLTL(Pagination pagination, string queryJson)
  892. {
  893. DataTable ListData = App.GetGridJsonWWLLTL(queryJson, ref pagination);
  894. var JsonData = new
  895. {
  896. total = pagination.total,
  897. page = pagination.page,
  898. records = pagination.records,
  899. rows = ListData,
  900. };
  901. return Content(JsonData.ToJson());
  902. }
  903. //委外领料
  904. [HttpGet]
  905. [HandlerAjaxOnly]
  906. public ActionResult GetSubGridJsonWWLLByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  907. {
  908. DataTable ListData = App.GetSubGridJsonWWLLByCreate(OApplyNegCode, Sequence, WorkPoint);
  909. var JsonData = new
  910. {
  911. rows = ListData,
  912. };
  913. return Content(JsonData.ToJson());
  914. }
  915. //委外领料申请退料
  916. [HttpPost]
  917. [HandlerAjaxOnly]
  918. [ValidateAntiForgeryToken]
  919. public ActionResult SubmitFormWWLL(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  920. {
  921. int i = App.SubmitFormWWLL(OApplyNegCode, Sequence, keyValue, WorkPoint);
  922. if (i > 0)
  923. {
  924. return Success("生成成功!");
  925. }
  926. else
  927. {
  928. return Error("生成失败!");
  929. }
  930. }
  931. //委外材料出库
  932. [HttpGet]
  933. [HandlerAjaxOnly]
  934. public ActionResult GetGridJsonWWCLCK(Pagination pagination, string queryJson)
  935. {
  936. DataTable ListData = App.GetGridJsonWWCLCK(queryJson, ref pagination);
  937. var JsonData = new
  938. {
  939. total = pagination.total,
  940. page = pagination.page,
  941. records = pagination.records,
  942. rows = ListData,
  943. };
  944. return Content(JsonData.ToJson());
  945. }
  946. //委外材料出库
  947. [HttpGet]
  948. [HandlerAjaxOnly]
  949. public ActionResult GetSubGridJsonWWCLByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  950. {
  951. DataTable ListData = App.GetSubGridJsonWWCLByCreate(OApplyNegCode, Sequence, WorkPoint);
  952. var JsonData = new
  953. {
  954. rows = ListData,
  955. };
  956. return Content(JsonData.ToJson());
  957. }
  958. [HttpPost]
  959. [HandlerAjaxOnly]
  960. [ValidateAntiForgeryToken]
  961. public ActionResult SubmitFormWWCL(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  962. {
  963. int i = App.SubmitFormWWCL(OApplyNegCode, Sequence, keyValue, WorkPoint);
  964. if (i > 0)
  965. {
  966. return Success("生成成功!");
  967. }
  968. else
  969. {
  970. return Error("生成失败!");
  971. }
  972. }
  973. //返工工单
  974. [HttpGet]
  975. [HandlerAjaxOnly]
  976. public ActionResult GetGridJsonFGGD(Pagination pagination, string queryJson)
  977. {
  978. DataTable ListData = App.GetGridJsonFGGD(queryJson, ref pagination);
  979. var JsonData = new
  980. {
  981. total = pagination.total,
  982. page = pagination.page,
  983. records = pagination.records,
  984. rows = ListData,
  985. };
  986. return Content(JsonData.ToJson());
  987. }
  988. [HttpGet]
  989. [HandlerAjaxOnly]
  990. public ActionResult GetSubGridJsonFGGDCreate(string FGGDMOCode, string Sequence, string WorkPoint)
  991. {
  992. DataTable ListData = App.GetSubGridJsonFGGDCreate(FGGDMOCode, Sequence, WorkPoint);
  993. var JsonData = new
  994. {
  995. rows = ListData,
  996. };
  997. return Content(JsonData.ToJson());
  998. }
  999. [HttpPost]
  1000. [HandlerAjaxOnly]
  1001. [ValidateAntiForgeryToken]
  1002. public ActionResult SubmitFormFGGD(string FGGDMOCode, string Sequence, string keyValue, string WorkPoint)
  1003. {
  1004. int i = App.SubmitFormFGGD(FGGDMOCode, Sequence, keyValue, WorkPoint);
  1005. if (i > 0)
  1006. {
  1007. return Success("生成成功!");
  1008. }
  1009. else
  1010. {
  1011. return Error("生成失败!");
  1012. }
  1013. }
  1014. [HttpGet]
  1015. [HandlerAjaxOnly]
  1016. public ActionResult GetQiSetNum(string keyValue)
  1017. {
  1018. var rows = App.GetQiSetNum(keyValue);
  1019. return Content(rows.ToJson());
  1020. }
  1021. [HttpGet]
  1022. [HandlerAjaxOnly]
  1023. public ActionResult GetLoadShow()
  1024. {
  1025. DataTable ListData = App.GetLoadShow();
  1026. var JsonData = new
  1027. {
  1028. rows = ListData,
  1029. };
  1030. return Content(JsonData.ToJson());
  1031. }
  1032. [HttpGet]
  1033. [HandlerAjaxOnly]
  1034. public ActionResult GetFreeEnble()
  1035. {
  1036. DataTable ListData = App.GetFreeEnble();
  1037. var JsonData = new
  1038. {
  1039. rows = ListData,
  1040. };
  1041. return Content(JsonData.ToJson());
  1042. }
  1043. [HttpPost]
  1044. public void StatementExportAll(string Type, string ID)
  1045. {
  1046. //ID = ID.Substring(0, ID.Length - 2);
  1047. DataTable dt = App.StatementExportAll(Type,ID);
  1048. AsposeCell.Export(dt);
  1049. }
  1050. [HttpGet]
  1051. [HandlerAjaxOnly]
  1052. public ActionResult GetGridJsonBHGTM(Pagination pagination, string queryJson)
  1053. {
  1054. DataTable ListData = App.GetGridJsonBHGTM(queryJson, ref pagination);
  1055. var JsonData = new
  1056. {
  1057. total = pagination.total,
  1058. page = pagination.page,
  1059. records = pagination.records,
  1060. rows = ListData,
  1061. };
  1062. return Content(JsonData.ToJson());
  1063. }
  1064. //[HttpGet]
  1065. //[HandlerAjaxOnly]
  1066. public ActionResult GetSubGridJsonBHGTM(string LotNo, string Type, Pagination pagination)
  1067. {
  1068. DataTable ListData = App.GetSubGridJsonBHGTM(LotNo, Type, ref pagination);
  1069. var JsonData = new
  1070. {
  1071. total = pagination.total,
  1072. page = pagination.page,
  1073. records = pagination.records,
  1074. rows = ListData,
  1075. };
  1076. return Content(JsonData.ToJson());
  1077. }
  1078. //审核到货单
  1079. [HttpPost]
  1080. [HandlerAjaxOnly]
  1081. [ValidateAntiForgeryToken]
  1082. public ActionResult SubmitFormBHGTM(string LotNo, string keyValue, string WorkPoint)
  1083. {
  1084. int i = App.SubmitFormBHGTM(LotNo, keyValue, WorkPoint);
  1085. if (i > 0)
  1086. {
  1087. return Success("生成成功!");
  1088. }
  1089. else
  1090. {
  1091. return Error("生成失败!");
  1092. }
  1093. }
  1094. [HttpGet]
  1095. public ActionResult SelGDLX()
  1096. {
  1097. var data = App.SelGDLX();
  1098. return Content(data.ToJson());
  1099. }
  1100. [HttpGet]
  1101. public ActionResult GetInvBatchEnable(string InvCode)
  1102. {
  1103. var data = App.GetInvBatchEnable(InvCode);
  1104. return Content(data.ToJson());
  1105. }
  1106. //副产品
  1107. [HttpGet]
  1108. [HandlerAjaxOnly]
  1109. public ActionResult GetGridJsonFCP(Pagination pagination, string queryJson)
  1110. {
  1111. DataTable ListData = App.GetGridJsonFCP(queryJson, ref pagination);
  1112. var JsonData = new
  1113. {
  1114. total = pagination.total,
  1115. page = pagination.page,
  1116. records = pagination.records,
  1117. rows = ListData,
  1118. };
  1119. return Content(JsonData.ToJson());
  1120. }
  1121. [HttpGet]
  1122. [HandlerAjaxOnly]
  1123. public ActionResult GetSubGridJsonFCPCreate(string FCPMOCode, string Sequence, string WorkPoint)
  1124. {
  1125. DataTable ListData = App.GetSubGridJsonFCPCreate(FCPMOCode, Sequence, WorkPoint);
  1126. var JsonData = new
  1127. {
  1128. rows = ListData,
  1129. };
  1130. return Content(JsonData.ToJson());
  1131. }
  1132. [HttpPost]
  1133. [HandlerAjaxOnly]
  1134. [ValidateAntiForgeryToken]
  1135. public ActionResult SubmitFormFCP(string FCPMOCode, string Sequence, string keyValue, string WorkPoint)
  1136. {
  1137. int i = App.SubmitFormFCP(FCPMOCode, Sequence, keyValue, WorkPoint);
  1138. if (i > 0)
  1139. {
  1140. return Success("生成成功!");
  1141. }
  1142. else
  1143. {
  1144. return Error("生成失败!");
  1145. }
  1146. }
  1147. [HttpGet]
  1148. [HandlerAjaxOnly]
  1149. public ActionResult GetGeneratedNum(string Code, string Sequence, string Type,string thisCreateQty)
  1150. {
  1151. bool Flag = App.GetGeneratedNum(Code, Sequence, Type, thisCreateQty);
  1152. var JsonData = new
  1153. {
  1154. Flag = Flag,
  1155. };
  1156. return Content(JsonData.ToJson());
  1157. }
  1158. //到货单一键生成条码
  1159. [HttpPost]
  1160. [HandlerAjaxOnly]
  1161. [ValidateAntiForgeryToken]
  1162. public ActionResult SubmitFormSHDHALL( string keyValue)
  1163. {
  1164. int i = App.SubmitFormSHDHALL( keyValue);
  1165. if (i > 0)
  1166. {
  1167. return Success("生成成功!");
  1168. }
  1169. else
  1170. {
  1171. return Error("生成失败!");
  1172. }
  1173. }
  1174. //委外到货单一键生成条码
  1175. [HttpPost]
  1176. [HandlerAjaxOnly]
  1177. [ValidateAntiForgeryToken]
  1178. public ActionResult SubmitFormWWSHDHALL( string keyValue)
  1179. {
  1180. int i = App.SubmitFormWWSHDHALL( keyValue);
  1181. if (i > 0)
  1182. {
  1183. return Success("生成成功!");
  1184. }
  1185. else
  1186. {
  1187. return Error("生成失败!");
  1188. }
  1189. }
  1190. //开立成品入库(一键生成)
  1191. [HttpPost]
  1192. [HandlerAjaxOnly]
  1193. [ValidateAntiForgeryToken]
  1194. public ActionResult SubmitFormKLCPRKALL( string keyValue)
  1195. {
  1196. int i = App.SubmitFormKLCPRKALL( keyValue);
  1197. if (i > 0)
  1198. {
  1199. return Success("生成成功!");
  1200. }
  1201. else
  1202. {
  1203. return Error("生成失败!");
  1204. }
  1205. }
  1206. [HttpGet]
  1207. public ActionResult SelectICSColumnEnableForLotEnable()
  1208. {
  1209. var data = App.SelectICSColumnEnableForLotEnable();
  1210. return Content(data.ToJson());
  1211. }
  1212. [HttpGet]
  1213. [HandlerAjaxOnly]
  1214. public ActionResult GetLoadShowForColumn()
  1215. {
  1216. DataTable ListData = App.GetLoadShowForColumn();
  1217. var JsonData = new
  1218. {
  1219. rows = ListData,
  1220. };
  1221. return Content(JsonData.ToJson());
  1222. }
  1223. [HttpGet]
  1224. [HandlerAjaxOnly]
  1225. public ActionResult GetAMEnable()
  1226. {
  1227. string ListData = App.GetAMEnable();
  1228. var data = new
  1229. {
  1230. rows = ListData,
  1231. };
  1232. return Content(data.ToJson());
  1233. }
  1234. //查询配置-计量
  1235. [HttpGet]
  1236. [HandlerAjaxOnly]
  1237. public ActionResult SeachMeasure()
  1238. {
  1239. DataTable ListData = App.SeachMeasure();
  1240. var JsonData = new
  1241. {
  1242. rows = ListData,
  1243. };
  1244. return Content(JsonData.ToJson());
  1245. }
  1246. //查询配置-开启栏位
  1247. [HttpGet]
  1248. [HandlerAjaxOnly]
  1249. public ActionResult SeachLableofDisable()
  1250. {
  1251. DataTable ListData = App.SeachLableofDisable();
  1252. var JsonData = new
  1253. {
  1254. rows = ListData,
  1255. };
  1256. return Content(JsonData.ToJson());
  1257. }
  1258. [HttpGet]
  1259. [HandlerAjaxOnly]
  1260. public ActionResult SeachAmountEnablebyInvCode(string InvCode)
  1261. {
  1262. DataTable ListData = App.SeachAmountEnablebyInvCode(InvCode);
  1263. var JsonData = new
  1264. {
  1265. rows = ListData,
  1266. };
  1267. return Content(JsonData.ToJson());
  1268. }
  1269. [HttpPost]
  1270. /// <summary>
  1271. /// 文件上传到本地
  1272. /// </summary>
  1273. public string UploadFile()
  1274. {
  1275. try
  1276. {
  1277. //string str_Year = Request.Form["txt_Year"];
  1278. //String UPLoadType = Request.Form["UPLoadType"];
  1279. HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
  1280. if (hpFiles != null && hpFiles.Count > 0)
  1281. {
  1282. string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
  1283. if (IsXls != ".xls" && IsXls != ".xlsx")
  1284. {
  1285. return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
  1286. }
  1287. string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + IsXls; //获取Execle文件名 DateTime日期函数
  1288. string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
  1289. int iLen = hpFiles[0].ContentLength;
  1290. if (Directory.Exists(savePath)) return "文件已存在";
  1291. byte[] bData = new byte[iLen];
  1292. hpFiles[0].InputStream.Read(bData, 0, iLen);
  1293. FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
  1294. newFile.Write(bData, 0, bData.Length);
  1295. newFile.Flush();
  1296. int _FileSizeTemp = hpFiles[0].ContentLength;
  1297. newFile.Close();
  1298. newFile.Dispose();
  1299. //bool del = false;
  1300. string mess = "";
  1301. mess = App.LotBindCode(savePath);
  1302. if (System.IO.File.Exists(savePath))//删除文件
  1303. {
  1304. System.IO.File.Delete(savePath);
  1305. }
  1306. return mess;
  1307. }
  1308. else
  1309. {
  1310. return "获取文件失败";
  1311. }
  1312. }
  1313. catch (Exception ex)
  1314. {
  1315. return ex.ToString();
  1316. }
  1317. }
  1318. }
  1319. }