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

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