纽威
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.

1034 lines
36 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  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. namespace NFine.Web.Areas.WMS.Controllers
  16. {
  17. public class WMSCreateItemLotController : ControllerBase
  18. {
  19. // GET: WMS/WMSCreateItemLot
  20. private WMSCreateItemLotApp App = new WMSCreateItemLotApp();
  21. public ActionResult CreateItemLot()
  22. {
  23. return View();
  24. }
  25. public ActionResult From()
  26. {
  27. return View();
  28. }
  29. [HttpGet]
  30. public ActionResult SelectICSExtensionEnable(string BeginTime, string EndTime)
  31. {
  32. var data = App.SelectICSExtensionEnable(BeginTime, EndTime);
  33. return Content(data.ToJson());
  34. }
  35. [HttpGet]
  36. [HandlerAjaxOnly]
  37. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  38. {
  39. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  40. var JsonData = new
  41. {
  42. total = pagination.total,
  43. page = pagination.page,
  44. records = pagination.records,
  45. rows = ListData,
  46. };
  47. return Content(JsonData.ToJson());
  48. }
  49. [HttpGet]
  50. [HandlerAjaxOnly]
  51. public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, string Type, Pagination pagination)
  52. {
  53. DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, Type, ref pagination);
  54. var JsonData = new
  55. {
  56. total = pagination.total,
  57. page = pagination.page,
  58. records = pagination.records,
  59. rows = ListData,
  60. };
  61. return Content(JsonData.ToJson());
  62. }
  63. /// <summary>
  64. /// 点击生成条码查询
  65. /// </summary>
  66. [HttpGet]
  67. [HandlerAjaxOnly]
  68. public ActionResult GetSubGridJsonByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  69. {
  70. DataTable ListData = App.GetSubGridJsonByCreate(ApplyNegCode, Sequence, WorkPoint);
  71. var JsonData = new
  72. {
  73. rows = ListData,
  74. };
  75. return Content(JsonData.ToJson());
  76. }
  77. [HttpGet]
  78. [HandlerAjaxOnly]
  79. public ActionResult GetVendorLotNo(string VenCode, string WorkPoint)
  80. {
  81. DataTable ListData = App.GetVendorLotNo(VenCode, WorkPoint);
  82. var JsonData = new
  83. {
  84. VendorLotNo = ListData.Rows[0][0].ToString(),
  85. };
  86. return Content(JsonData.ToJson());
  87. }
  88. [HttpPost]
  89. [HandlerAjaxOnly]
  90. [ValidateAntiForgeryToken]
  91. public ActionResult SubmitForm(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  92. {
  93. int i = App.CreateItemLotNo(ApplyNegCode, Sequence, keyValue, WorkPoint);
  94. if (i > 0)
  95. {
  96. return Success("生成成功!");
  97. }
  98. else
  99. {
  100. return Error("生成失败!");
  101. }
  102. }
  103. [HttpPost]
  104. [HandlerAjaxOnly]
  105. [ValidateAntiForgeryToken]
  106. public ActionResult DeleteItemLot(string keyValue)
  107. {
  108. keyValue = keyValue.Substring(1, keyValue.Length - 2);
  109. //WorkPoint = WorkPoint.Substring(1, WorkPoint.Length - 2);
  110. string msg = App.DeleteItemLot(keyValue);
  111. if (string.IsNullOrWhiteSpace(msg))
  112. {
  113. return Success("删除成功!");
  114. }
  115. else
  116. {
  117. return Error(msg);
  118. }
  119. }
  120. [HttpPost]
  121. [HandlerAjaxOnly]
  122. [ValidateAntiForgeryToken]
  123. public ActionResult SubmitFormWeiWai(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  124. {
  125. int i = App.SubmitFormWeiWai(OApplyNegCode, Sequence, keyValue, WorkPoint);
  126. if (i > 0)
  127. {
  128. return Success("生成成功!");
  129. }
  130. else
  131. {
  132. return Error("生成失败!");
  133. }
  134. }
  135. //成品
  136. [HttpPost]
  137. [HandlerAjaxOnly]
  138. [ValidateAntiForgeryToken]
  139. public ActionResult SubmitFormChengPing(string MOCode, string Sequence, string keyValue, string WorkPoint)
  140. {
  141. int i = App.SubmitFormChengPing(MOCode, Sequence, keyValue, WorkPoint);
  142. if (i > 0)
  143. {
  144. return Success("生成成功!");
  145. }
  146. else
  147. {
  148. return Error("生成失败!");
  149. }
  150. }
  151. //销售退货
  152. [HttpPost]
  153. [HandlerAjaxOnly]
  154. [ValidateAntiForgeryToken]
  155. public ActionResult SubmitFormXiaoShou(string SDNCode, string Sequence, string keyValue, string WorkPoint)
  156. {
  157. int i = App.SubmitFormXiaoShou(SDNCode, Sequence, keyValue, WorkPoint);
  158. if (i > 0)
  159. {
  160. return Success("生成成功!");
  161. }
  162. else
  163. {
  164. return Error("生成失败!");
  165. }
  166. }
  167. //其他
  168. [HttpPost]
  169. [HandlerAjaxOnly]
  170. [ValidateAntiForgeryToken]
  171. public ActionResult SubmitFormQiTa(string InCode, string Sequence, string keyValue, string WorkPoint)
  172. {
  173. int i = App.SubmitFormQiTa(InCode, Sequence, keyValue, WorkPoint);
  174. if (i > 0)
  175. {
  176. return Success("生成成功!");
  177. }
  178. else
  179. {
  180. return Error("生成失败!");
  181. }
  182. }
  183. /// <summary>
  184. /// 打印数据参数:服务器的URL+打印的文件名,转化为Base64编码
  185. /// </summary>
  186. protected string strPrintData;
  187. /// <summary>
  188. /// 标识是否安装了控件
  189. /// </summary>
  190. protected bool bIsInstallPrintControl = true;
  191. /// <summary>
  192. /// 打印控件的Cookie值
  193. /// </summary>
  194. protected string strPrintControlCookie = "";
  195. /// <summary>
  196. /// 获取Url中去掉文件名的路径
  197. /// </summary>
  198. /// <returns></returns>
  199. private string GetUrlPath()
  200. {
  201. string strUrl = Request.Url.ToString();
  202. int iEnd = strUrl.LastIndexOf("/");
  203. strUrl = strUrl.Substring(0, iEnd + 1);
  204. return strUrl;
  205. }
  206. //打印
  207. [HttpPost]
  208. [HandlerAjaxOnly]
  209. public ActionResult PrintItemLot(string keyValue, string WorkPoint,string Type)
  210. {
  211. // string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
  212. keyValue = keyValue.Substring(1, keyValue.Length - 2);
  213. WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
  214. string strPrintFileName = Server.MapPath("/ReportFile/") + "纷纷无法b_成品条码.fr3";
  215. PrintJson pJson = new PrintJson(Server.MapPath("./PrintTemp"), strPrintFileName);
  216. pJson.CheckRegister("苏州智合诚信息科技有限公司", "56DD3B4C172D0D140841CAC98A58A819F4E28EDA5D6E45711DDD64F6A439F68B6A7870CD7DAFD69A919CB870207FE4BB206F92BE3D53C221B019E0797E739EBA4"); //注册信息
  217. //pJson.CheckRegister("注册姓名", "8ECCCD6A1302DFEE1A6456A5D"); //注册信息
  218. //pJson.AddPrintParam("ShopName", "测试酒楼");
  219. //pJson.AddPrintParam("PrintDepositAdd", "说明:本单据为贵客押金收取凭证,盖章有效。退房时请出示,遗失者自负,请妥善保存。退房时间为12:00时,延时退房18:00时以前按半天房费收取,18:00时以后算全天房价。押金单有效期为一个月,过期作废。 贵重物品请交前台寄存,未寄存丢失自负。 谢谢!");
  220. SetCookieAndURL(pJson);// 设置控件调用的Cookie值,判断是否安装了打印控件
  221. string strSql = "";
  222. if (Type=="1")
  223. {
  224. strSql = @"select a.LotNo, c.ApplyNegCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  225. FROM dbo.ICSInventoryLot a
  226. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  227. left join ICSMOApplyNegDetail c on b.TransCode=c.ApplyNegCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  228. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  229. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  230. }
  231. if (Type=="2")
  232. {
  233. strSql = @"select a.LotNo, c.OApplyNegCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  234. FROM dbo.ICSInventoryLot a
  235. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  236. left join ICSOApplyNegDetail c on b.TransCode=c.OApplyNegCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  237. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  238. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  239. }
  240. if (Type == "3")
  241. {
  242. strSql = @"select a.LotNo, c.MOCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  243. FROM dbo.ICSInventoryLot a
  244. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  245. left join ICSMO c on b.TransCode=c.MOCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  246. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  247. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  248. }
  249. if (Type == "5")
  250. {
  251. strSql = @"select a.LotNo, c.InCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  252. FROM dbo.ICSInventoryLot a
  253. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  254. left join ICSOtherIn c on b.TransCode=c.InCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  255. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  256. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  257. }
  258. if (Type == "6")
  259. {
  260. strSql = @"select a.LotNo, c.ReturnCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  261. FROM dbo.ICSInventoryLot a
  262. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  263. left join ICSReturn c on b.TransCode=c.ReturnCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  264. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  265. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  266. }
  267. if (Type == "7")
  268. {
  269. strSql = @"select a.LotNo, c.DNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  270. FROM dbo.ICSInventoryLot a
  271. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  272. left join ICSDeliveryNotice c on b.TransCode=c.DNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  273. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  274. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  275. }
  276. if (Type == "8")
  277. {
  278. strSql = @"select a.LotNo, c.ODNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  279. FROM dbo.ICSInventoryLot a
  280. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  281. left join ICSODeliveryNotice c on b.TransCode=c.ODNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  282. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  283. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  284. }
  285. if (Type == "9")
  286. {
  287. strSql = @" select a.LotNo, c.RCVCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  288. FROM dbo.ICSInventoryLot a
  289. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  290. left join ICSManufactureReceive c on b.TransCode=c.RCVCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  291. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  292. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  293. }
  294. if (Type == "10")
  295. {
  296. strSql = @"select a.LotNo, c.DNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  297. FROM dbo.ICSInventoryLot a
  298. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  299. left join ICSDeliveryNotice c on b.TransCode=c.DNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  300. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  301. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  302. }
  303. if (Type == "11")
  304. {
  305. strSql = @"select a.LotNo, c.ODNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  306. FROM dbo.ICSInventoryLot a
  307. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  308. left join ICSODeliveryNotice c on b.TransCode=c.ODNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  309. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  310. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  311. }
  312. //string strSql = @"Select * From CashLog";
  313. DataTable dtCashLog = DbHelper.ExecuteTable(DbHelper.ConnectionString, CommandType.Text, strSql, true, null);
  314. // string strPrintTempFile = pJson.ShowReport(dtCashLog); //产生JSON文件内容
  315. string strPrintTempFile = pJson.ShowReport(dtCashLog); //导出PDF文件
  316. //把服务器的URL + 此文件名 传递给控件,由控件下载还原数据进行打印
  317. string strServerURL = GetUrlPath() + "PrintTemp/";
  318. string strData = strServerURL + strPrintTempFile;
  319. strPrintData = PrintFunction.EnBase64(strData);
  320. var JsonData = new
  321. {
  322. strPrintData_1 = strPrintData,
  323. bIsInstallPrintControl_1 = bIsInstallPrintControl,
  324. strPrintControlCookie_1 = strPrintControlCookie
  325. };
  326. //多站点
  327. string sql = @"UPDATE dbo.ICSInventoryLot
  328. SET PrintTimes=ISNULL(PrintTimes,0)+1,
  329. LastPrintUser='',
  330. LastPrintTime=GETDATE()
  331. WHERE ID IN (" + keyValue.TrimEnd(',') + ") and WorkPoint in ('" + WorkPoint.TrimEnd(',') + "')";
  332. SqlHelper.ExecuteNonQuery(sql);
  333. return Content(JsonData.ToJson());
  334. }
  335. /// <summary>
  336. /// 设置控件调用的Cookie值,判断是否安装了打印控件
  337. /// </summary>
  338. /// <param name="pJson"></param>
  339. private void SetCookieAndURL(PrintJson pJson)
  340. {
  341. bIsInstallPrintControl = false;
  342. strPrintControlCookie = "";
  343. HttpCookie pCookieInstall = Request.Cookies["InstallPrintControl"];
  344. if (pCookieInstall != null)
  345. { //Cookie存在
  346. strPrintControlCookie = pCookieInstall.Value.ToString();
  347. //以Cookie值查找在数据表中是否存在
  348. string strSql = @"Select * From sys_SRM_CheckInstall Where Cookie = @Cookie";
  349. SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strPrintControlCookie) };
  350. using (SqlDataReader drCookie = DbHelper.ExecuteReader(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie))
  351. {
  352. if (drCookie.Read())
  353. { //标识为已经安装
  354. bIsInstallPrintControl = true;
  355. }
  356. drCookie.Close();
  357. }
  358. //更新Cookie的保存时间
  359. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  360. Response.SetCookie(pCookieInstall);
  361. }
  362. else
  363. {//Cookie不存在,则新建Cookie
  364. strPrintControlCookie = System.Guid.NewGuid().ToString();
  365. pCookieInstall = new HttpCookie("InstallPrintControl", strPrintControlCookie);
  366. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  367. Response.Cookies.Add(pCookieInstall);
  368. }
  369. string strUrl = Server.MapPath("/PrintTemp/") + "IsCheckInstall";
  370. pJson.SetCookieAndURL(strPrintControlCookie, strUrl);
  371. }
  372. [HttpGet]
  373. [HandlerAjaxOnly]
  374. public ActionResult GetGridJsonWeiWai(Pagination pagination, string queryJson)
  375. {
  376. DataTable ListData = App.GetGridJsonWeiWai(queryJson, ref pagination);
  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. [HttpGet]
  387. [HandlerAjaxOnly]
  388. public ActionResult GetSubGridJsonWeiWai(string OApplyNegCode, string Sequence, Pagination pagination)
  389. {
  390. DataTable ListData = App.GetSubGridJsonWeiWai(OApplyNegCode, Sequence, ref pagination);
  391. var JsonData = new
  392. {
  393. total = pagination.total,
  394. page = pagination.page,
  395. records = pagination.records,
  396. rows = ListData,
  397. };
  398. return Content(JsonData.ToJson());
  399. }
  400. /// <summary>
  401. /// 点击生成条码查询
  402. /// </summary>
  403. [HttpGet]
  404. [HandlerAjaxOnly]
  405. public ActionResult GetSubGridJsonWeiWaiByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  406. {
  407. DataTable ListData = App.GetSubGridJsonWeiWaiByCreate(OApplyNegCode, Sequence, WorkPoint);
  408. var JsonData = new
  409. {
  410. rows = ListData,
  411. };
  412. return Content(JsonData.ToJson());
  413. }
  414. [HttpGet]
  415. [HandlerAjaxOnly]
  416. public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
  417. {
  418. DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination);
  419. var JsonData = new
  420. {
  421. total = pagination.total,
  422. page = pagination.page,
  423. records = pagination.records,
  424. rows = ListData,
  425. };
  426. return Content(JsonData.ToJson());
  427. }
  428. /// <summary>
  429. /// 点击生成条码查询(成品)
  430. /// </summary>
  431. [HttpGet]
  432. [HandlerAjaxOnly]
  433. public ActionResult GetSubGridJsonChengPingByCreate(string MOCode, string Sequence, string WorkPoint)
  434. {
  435. DataTable ListData = App.GetSubGridJsonChengPingByCreate(MOCode, Sequence, WorkPoint);
  436. var JsonData = new
  437. {
  438. rows = ListData,
  439. };
  440. return Content(JsonData.ToJson());
  441. }
  442. [HttpGet]
  443. [HandlerAjaxOnly]
  444. public ActionResult GetGridJsonXiaoShou(Pagination pagination, string queryJson)
  445. {
  446. DataTable ListData = App.GetGridJsonXiaoShou(queryJson, ref pagination);
  447. var JsonData = new
  448. {
  449. total = pagination.total,
  450. page = pagination.page,
  451. records = pagination.records,
  452. rows = ListData,
  453. };
  454. return Content(JsonData.ToJson());
  455. }
  456. [HttpGet]
  457. [HandlerAjaxOnly]
  458. public ActionResult GetGridJsonQiTa(Pagination pagination, string queryJson)
  459. {
  460. DataTable ListData = App.GetGridJsonQiTa(queryJson, ref pagination);
  461. var JsonData = new
  462. {
  463. total = pagination.total,
  464. page = pagination.page,
  465. records = pagination.records,
  466. rows = ListData,
  467. };
  468. return Content(JsonData.ToJson());
  469. }
  470. /// <summary>
  471. /// 点击生成条码查询(销售退货)
  472. /// </summary>
  473. [HttpGet]
  474. [HandlerAjaxOnly]
  475. public ActionResult GetSubGridJsonXiaoShouByCreate(string SDNCode, string Sequence, string WorkPoint)
  476. {
  477. DataTable ListData = App.GetSubGridJsonXiaoShouByCreate(SDNCode, Sequence, WorkPoint);
  478. var JsonData = new
  479. {
  480. rows = ListData,
  481. };
  482. return Content(JsonData.ToJson());
  483. }
  484. /// <summary>
  485. /// 点击生成条码查询(其他入库)
  486. /// </summary>
  487. [HttpGet]
  488. [HandlerAjaxOnly]
  489. public ActionResult GetSubGridJsonQiTaByCreate(string InCode, string Sequence, string WorkPoint)
  490. {
  491. DataTable ListData = App.GetSubGridJsonQiTaByCreate(InCode, Sequence, WorkPoint);
  492. var JsonData = new
  493. {
  494. rows = ListData,
  495. };
  496. return Content(JsonData.ToJson());
  497. }
  498. //归还
  499. [HttpGet]
  500. [HandlerAjaxOnly]
  501. public ActionResult GetGridJsonGuiHuan(Pagination pagination, string queryJson)
  502. {
  503. DataTable ListData = App.GetGridJsonGuiHuan(queryJson, ref pagination);
  504. var JsonData = new
  505. {
  506. total = pagination.total,
  507. page = pagination.page,
  508. records = pagination.records,
  509. rows = ListData,
  510. };
  511. return Content(JsonData.ToJson());
  512. }
  513. //审核到货单
  514. [HttpGet]
  515. [HandlerAjaxOnly]
  516. public ActionResult GetGridJsonSHDH(Pagination pagination, string queryJson)
  517. {
  518. DataTable ListData = App.GetGridJsonSHDH(queryJson, ref pagination);
  519. var JsonData = new
  520. {
  521. total = pagination.total,
  522. page = pagination.page,
  523. records = pagination.records,
  524. rows = ListData,
  525. };
  526. return Content(JsonData.ToJson());
  527. }
  528. //审核到货单
  529. [HttpGet]
  530. [HandlerAjaxOnly]
  531. public ActionResult GetGridJsonWWSHDH(Pagination pagination, string queryJson)
  532. {
  533. DataTable ListData = App.GetGridJsonWWSHDH(queryJson, ref pagination);
  534. var JsonData = new
  535. {
  536. total = pagination.total,
  537. page = pagination.page,
  538. records = pagination.records,
  539. rows = ListData,
  540. };
  541. return Content(JsonData.ToJson());
  542. }
  543. //审核到货单
  544. [HttpGet]
  545. [HandlerAjaxOnly]
  546. public ActionResult GetGridJsonKLCPRK(Pagination pagination, string queryJson)
  547. {
  548. DataTable ListData = App.GetGridJsonKLCPRK(queryJson, ref pagination);
  549. var JsonData = new
  550. {
  551. total = pagination.total,
  552. page = pagination.page,
  553. records = pagination.records,
  554. rows = ListData,
  555. };
  556. return Content(JsonData.ToJson());
  557. }
  558. /// <summary>
  559. /// 点击生成条码查询(审核到货单)
  560. /// </summary>
  561. [HttpGet]
  562. [HandlerAjaxOnly]
  563. public ActionResult GetSubGridJsonSHDHByCreate(string DNCode, string Sequence, string WorkPoint)
  564. {
  565. DataTable ListData = App.GetSubGridJsonSHDHByCreate(DNCode, Sequence, WorkPoint);
  566. var JsonData = new
  567. {
  568. rows = ListData,
  569. };
  570. return Content(JsonData.ToJson());
  571. }
  572. /// <summary>
  573. /// 点击生成条码查询(审核委外到货单)
  574. /// </summary>
  575. [HttpGet]
  576. [HandlerAjaxOnly]
  577. public ActionResult GetSubGridJsonWWSHDHByCreate(string ODNCode, string Sequence, string WorkPoint)
  578. {
  579. DataTable ListData = App.GetSubGridJsonWWSHDHByCreate(ODNCode, Sequence, WorkPoint);
  580. var JsonData = new
  581. {
  582. rows = ListData,
  583. };
  584. return Content(JsonData.ToJson());
  585. }
  586. /// <summary>
  587. /// 点击生成条码查询(审核委外到货单)
  588. /// </summary>
  589. [HttpGet]
  590. [HandlerAjaxOnly]
  591. public ActionResult GetSubGridJsonKLCPRKByCreate(string RCVCode, string Sequence, string WorkPoint)
  592. {
  593. DataTable ListData = App.GetSubGridJsonKLCPRKByCreate(RCVCode, Sequence, WorkPoint);
  594. var JsonData = new
  595. {
  596. rows = ListData,
  597. };
  598. return Content(JsonData.ToJson());
  599. }
  600. /// <summary>
  601. /// 点击生成条码查询(归还)
  602. /// </summary>
  603. [HttpGet]
  604. [HandlerAjaxOnly]
  605. public ActionResult GetSubGridJsonGuiHuanByCreate(string ReturnCode, string Sequence, string WorkPoint)
  606. {
  607. DataTable ListData = App.GetSubGridJsonGuiHuanByCreate(ReturnCode, Sequence, WorkPoint);
  608. var JsonData = new
  609. {
  610. rows = ListData,
  611. };
  612. return Content(JsonData.ToJson());
  613. }
  614. //归还
  615. [HttpPost]
  616. [HandlerAjaxOnly]
  617. [ValidateAntiForgeryToken]
  618. public ActionResult SubmitFormGuiHuan(string ReturnCode, string Sequence, string keyValue, string WorkPoint)
  619. {
  620. int i = App.SubmitFormGuiHuan(ReturnCode, Sequence, keyValue, WorkPoint);
  621. if (i > 0)
  622. {
  623. return Success("生成成功!");
  624. }
  625. else
  626. {
  627. return Error("生成失败!");
  628. }
  629. }
  630. //审核到货单
  631. [HttpPost]
  632. [HandlerAjaxOnly]
  633. [ValidateAntiForgeryToken]
  634. public ActionResult SubmitFormSHDH(string DNCode, string Sequence, string keyValue, string WorkPoint)
  635. {
  636. int i = App.SubmitFormSHDH(DNCode, Sequence, keyValue, WorkPoint);
  637. if (i > 0)
  638. {
  639. return Success("生成成功!");
  640. }
  641. else
  642. {
  643. return Error("生成失败!");
  644. }
  645. }
  646. //审核委外到货单
  647. [HttpPost]
  648. [HandlerAjaxOnly]
  649. [ValidateAntiForgeryToken]
  650. public ActionResult SubmitFormWWSHDH(string ODNCode, string Sequence, string keyValue, string WorkPoint)
  651. {
  652. int i = App.SubmitFormWWSHDH(ODNCode, Sequence, keyValue, WorkPoint);
  653. if (i > 0)
  654. {
  655. return Success("生成成功!");
  656. }
  657. else
  658. {
  659. return Error("生成失败!");
  660. }
  661. }
  662. //开立成品入库
  663. [HttpPost]
  664. [HandlerAjaxOnly]
  665. [ValidateAntiForgeryToken]
  666. public ActionResult SubmitFormKLCPRK(string RCVCode, string Sequence, string keyValue, string WorkPoint)
  667. {
  668. int i = App.SubmitFormKLCPRK(RCVCode, Sequence, keyValue, WorkPoint);
  669. if (i > 0)
  670. {
  671. return Success("生成成功!");
  672. }
  673. else
  674. {
  675. return Error("生成失败!");
  676. }
  677. }
  678. //委外拒收单
  679. [HttpGet]
  680. [HandlerAjaxOnly]
  681. public ActionResult GetGridJsonWWJSD(Pagination pagination, string queryJson)
  682. {
  683. DataTable ListData = App.GetGridJsonWWJSD(queryJson, ref pagination);
  684. var JsonData = new
  685. {
  686. total = pagination.total,
  687. page = pagination.page,
  688. records = pagination.records,
  689. rows = ListData,
  690. };
  691. return Content(JsonData.ToJson());
  692. }
  693. //拒收单
  694. [HttpGet]
  695. [HandlerAjaxOnly]
  696. public ActionResult GetGridJsonJSD(Pagination pagination, string queryJson)
  697. {
  698. DataTable ListData = App.GetGridJsonJSD(queryJson, ref pagination);
  699. var JsonData = new
  700. {
  701. total = pagination.total,
  702. page = pagination.page,
  703. records = pagination.records,
  704. rows = ListData,
  705. };
  706. return Content(JsonData.ToJson());
  707. }
  708. //审核到货单
  709. [HttpPost]
  710. [HandlerAjaxOnly]
  711. [ValidateAntiForgeryToken]
  712. public ActionResult SubmitFormJSD(string DNCode, string Sequence, string keyValue, string WorkPoint)
  713. {
  714. int i = App.SubmitFormJSD(DNCode, Sequence, keyValue, WorkPoint);
  715. if (i > 0)
  716. {
  717. return Success("生成成功!");
  718. }
  719. else
  720. {
  721. return Error("生成失败!");
  722. }
  723. }
  724. //审核委外到货单
  725. [HttpPost]
  726. [HandlerAjaxOnly]
  727. [ValidateAntiForgeryToken]
  728. public ActionResult SubmitFormWWJSD(string ODNCode, string Sequence, string keyValue, string WorkPoint)
  729. {
  730. int i = App.SubmitFormWWJSD(ODNCode, Sequence, keyValue, WorkPoint);
  731. if (i > 0)
  732. {
  733. return Success("生成成功!");
  734. }
  735. else
  736. {
  737. return Error("生成失败!");
  738. }
  739. }
  740. //领料申请退料
  741. [HttpGet]
  742. [HandlerAjaxOnly]
  743. public ActionResult GetGridJsonLLSQTL(Pagination pagination, string queryJson)
  744. {
  745. DataTable ListData = App.GetGridJsonLLSQTL(queryJson, ref pagination);
  746. var JsonData = new
  747. {
  748. total = pagination.total,
  749. page = pagination.page,
  750. records = pagination.records,
  751. rows = ListData,
  752. };
  753. return Content(JsonData.ToJson());
  754. }
  755. /// <summary>
  756. /// 点击生成条码查询(领料申请退料)
  757. /// </summary>
  758. [HttpGet]
  759. [HandlerAjaxOnly]
  760. public ActionResult GetSubGridJsonJSDByCreate(string DNCode, string Sequence, string WorkPoint)
  761. {
  762. DataTable ListData = App.GetSubGridJsonJSDByCreate(DNCode, Sequence, WorkPoint);
  763. var JsonData = new
  764. {
  765. rows = ListData,
  766. };
  767. return Content(JsonData.ToJson());
  768. }
  769. /// <summary>
  770. /// 点击生成条码查询(领料申请退料)
  771. /// </summary>
  772. [HttpGet]
  773. [HandlerAjaxOnly]
  774. public ActionResult GetSubGridJsonWWJSDByCreate(string ODNCode, string Sequence, string WorkPoint)
  775. {
  776. DataTable ListData = App.GetSubGridJsonWWJSDByCreate(ODNCode, Sequence, WorkPoint);
  777. var JsonData = new
  778. {
  779. rows = ListData,
  780. };
  781. return Content(JsonData.ToJson());
  782. }
  783. [HttpGet]
  784. [HandlerAjaxOnly]
  785. public ActionResult GetSubGridJsonLLSQDByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  786. {
  787. DataTable ListData = App.GetSubGridJsonLLSQDByCreate(ApplyNegCode, Sequence, WorkPoint);
  788. var JsonData = new
  789. {
  790. rows = ListData,
  791. };
  792. return Content(JsonData.ToJson());
  793. }
  794. //领料申请退料生成条码
  795. [HttpPost]
  796. [HandlerAjaxOnly]
  797. [ValidateAntiForgeryToken]
  798. public ActionResult SubmitFormLLSQTL(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  799. {
  800. int i = App.SubmitFormLLSQTL(ApplyNegCode, Sequence, keyValue, WorkPoint);
  801. if (i > 0)
  802. {
  803. return Success("生成成功!");
  804. }
  805. else
  806. {
  807. return Error("生成失败!");
  808. }
  809. }
  810. //材料出库退料
  811. [HttpGet]
  812. [HandlerAjaxOnly]
  813. public ActionResult GetGridJsonCLCK(Pagination pagination, string queryJson)
  814. {
  815. DataTable ListData = App.GetGridJsonCLCK(queryJson, ref pagination);
  816. var JsonData = new
  817. {
  818. total = pagination.total,
  819. page = pagination.page,
  820. records = pagination.records,
  821. rows = ListData,
  822. };
  823. return Content(JsonData.ToJson());
  824. }
  825. //材料出库退料
  826. [HttpGet]
  827. [HandlerAjaxOnly]
  828. public ActionResult GetSubGridJsonCLCKByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  829. {
  830. DataTable ListData = App.GetSubGridJsonCLCKByCreate(ApplyNegCode, Sequence, WorkPoint);
  831. var JsonData = new
  832. {
  833. rows = ListData,
  834. };
  835. return Content(JsonData.ToJson());
  836. }
  837. //材料出库退料生成条码
  838. [HttpPost]
  839. [HandlerAjaxOnly]
  840. [ValidateAntiForgeryToken]
  841. public ActionResult SubmitFormCLCKT(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  842. {
  843. int i = App.SubmitFormCLCKT(ApplyNegCode, Sequence, keyValue, WorkPoint);
  844. if (i > 0)
  845. {
  846. return Success("生成成功!");
  847. }
  848. else
  849. {
  850. return Error("生成失败!");
  851. }
  852. }
  853. //委外领料
  854. [HttpGet]
  855. [HandlerAjaxOnly]
  856. public ActionResult GetGridJsonWWLLTL(Pagination pagination, string queryJson)
  857. {
  858. DataTable ListData = App.GetGridJsonWWLLTL(queryJson, ref pagination);
  859. var JsonData = new
  860. {
  861. total = pagination.total,
  862. page = pagination.page,
  863. records = pagination.records,
  864. rows = ListData,
  865. };
  866. return Content(JsonData.ToJson());
  867. }
  868. //委外领料
  869. [HttpGet]
  870. [HandlerAjaxOnly]
  871. public ActionResult GetSubGridJsonWWLLByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  872. {
  873. DataTable ListData = App.GetSubGridJsonWWLLByCreate(OApplyNegCode, Sequence, WorkPoint);
  874. var JsonData = new
  875. {
  876. rows = ListData,
  877. };
  878. return Content(JsonData.ToJson());
  879. }
  880. //委外领料申请退料
  881. [HttpPost]
  882. [HandlerAjaxOnly]
  883. [ValidateAntiForgeryToken]
  884. public ActionResult SubmitFormWWLL(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  885. {
  886. int i = App.SubmitFormWWLL(OApplyNegCode, Sequence, keyValue, WorkPoint);
  887. if (i > 0)
  888. {
  889. return Success("生成成功!");
  890. }
  891. else
  892. {
  893. return Error("生成失败!");
  894. }
  895. }
  896. //委外材料出库
  897. [HttpGet]
  898. [HandlerAjaxOnly]
  899. public ActionResult GetGridJsonWWCLCK(Pagination pagination, string queryJson)
  900. {
  901. DataTable ListData = App.GetGridJsonWWCLCK(queryJson, ref pagination);
  902. var JsonData = new
  903. {
  904. total = pagination.total,
  905. page = pagination.page,
  906. records = pagination.records,
  907. rows = ListData,
  908. };
  909. return Content(JsonData.ToJson());
  910. }
  911. //委外材料出库
  912. [HttpGet]
  913. [HandlerAjaxOnly]
  914. public ActionResult GetSubGridJsonWWCLByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  915. {
  916. DataTable ListData = App.GetSubGridJsonWWCLByCreate(OApplyNegCode, Sequence, WorkPoint);
  917. var JsonData = new
  918. {
  919. rows = ListData,
  920. };
  921. return Content(JsonData.ToJson());
  922. }
  923. [HttpPost]
  924. [HandlerAjaxOnly]
  925. [ValidateAntiForgeryToken]
  926. public ActionResult SubmitFormWWCL(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  927. {
  928. int i = App.SubmitFormWWCL(OApplyNegCode, Sequence, keyValue, WorkPoint);
  929. if (i > 0)
  930. {
  931. return Success("生成成功!");
  932. }
  933. else
  934. {
  935. return Error("生成失败!");
  936. }
  937. }
  938. }
  939. }