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

1116 lines
39 KiB

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