纽威

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