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.

1657 lines
54 KiB

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