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

1303 lines
44 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
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. [HttpPost]
  824. [HandlerAjaxOnly]
  825. //[ValidateAntiForgeryToken]
  826. public ActionResult SubmitTLPL(string ids)
  827. {
  828. int i = App.SubmitTLPL(ids);
  829. if (i > 0)
  830. {
  831. return Success("生成成功!");
  832. }
  833. else
  834. {
  835. return Error("生成失败!");
  836. }
  837. }
  838. //委外拒收单
  839. [HttpGet]
  840. [HandlerAjaxOnly]
  841. public ActionResult GetGridJsonWWJSD(Pagination pagination, string queryJson)
  842. {
  843. DataTable ListData = App.GetGridJsonWWJSD(queryJson, ref pagination);
  844. var JsonData = new
  845. {
  846. total = pagination.total,
  847. page = pagination.page,
  848. records = pagination.records,
  849. rows = ListData,
  850. };
  851. return Content(JsonData.ToJson());
  852. }
  853. //拒收单
  854. [HttpGet]
  855. [HandlerAjaxOnly]
  856. public ActionResult GetGridJsonJSD(Pagination pagination, string queryJson)
  857. {
  858. DataTable ListData = App.GetGridJsonJSD(queryJson, ref pagination);
  859. var JsonData = new
  860. {
  861. total = pagination.total,
  862. page = pagination.page,
  863. records = pagination.records,
  864. rows = ListData,
  865. };
  866. return Content(JsonData.ToJson());
  867. }
  868. //审核到货单
  869. [HttpPost]
  870. [HandlerAjaxOnly]
  871. [ValidateAntiForgeryToken]
  872. public ActionResult SubmitFormJSD(string DNCode, string Sequence, string keyValue, string WorkPoint)
  873. {
  874. int i = App.SubmitFormJSD(DNCode, Sequence, keyValue, WorkPoint);
  875. if (i > 0)
  876. {
  877. return Success("生成成功!");
  878. }
  879. else
  880. {
  881. return Error("生成失败!");
  882. }
  883. }
  884. //审核委外到货单
  885. [HttpPost]
  886. [HandlerAjaxOnly]
  887. [ValidateAntiForgeryToken]
  888. public ActionResult SubmitFormWWJSD(string ODNCode, string Sequence, string keyValue, string WorkPoint)
  889. {
  890. int i = App.SubmitFormWWJSD(ODNCode, Sequence, keyValue, WorkPoint);
  891. if (i > 0)
  892. {
  893. return Success("生成成功!");
  894. }
  895. else
  896. {
  897. return Error("生成失败!");
  898. }
  899. }
  900. //领料申请退料
  901. [HttpGet]
  902. [HandlerAjaxOnly]
  903. public ActionResult GetGridJsonLLSQTL(Pagination pagination, string queryJson)
  904. {
  905. DataTable ListData = App.GetGridJsonLLSQTL(queryJson, ref pagination);
  906. var JsonData = new
  907. {
  908. total = pagination.total,
  909. page = pagination.page,
  910. records = pagination.records,
  911. rows = ListData,
  912. };
  913. return Content(JsonData.ToJson());
  914. }
  915. /// <summary>
  916. /// 点击生成条码查询(领料申请退料)
  917. /// </summary>
  918. [HttpGet]
  919. [HandlerAjaxOnly]
  920. public ActionResult GetSubGridJsonJSDByCreate(string DNCode, string Sequence, string WorkPoint)
  921. {
  922. DataTable ListData = App.GetSubGridJsonJSDByCreate(DNCode, Sequence, WorkPoint);
  923. var JsonData = new
  924. {
  925. rows = ListData,
  926. };
  927. return Content(JsonData.ToJson());
  928. }
  929. /// <summary>
  930. /// 点击生成条码查询(领料申请退料)
  931. /// </summary>
  932. [HttpGet]
  933. [HandlerAjaxOnly]
  934. public ActionResult GetSubGridJsonWWJSDByCreate(string ODNCode, string Sequence, string WorkPoint)
  935. {
  936. DataTable ListData = App.GetSubGridJsonWWJSDByCreate(ODNCode, Sequence, WorkPoint);
  937. var JsonData = new
  938. {
  939. rows = ListData,
  940. };
  941. return Content(JsonData.ToJson());
  942. }
  943. [HttpGet]
  944. [HandlerAjaxOnly]
  945. public ActionResult GetSubGridJsonLLSQDByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  946. {
  947. DataTable ListData = App.GetSubGridJsonLLSQDByCreate(ApplyNegCode, Sequence, WorkPoint);
  948. var JsonData = new
  949. {
  950. rows = ListData,
  951. };
  952. return Content(JsonData.ToJson());
  953. }
  954. //领料申请退料生成条码
  955. [HttpPost]
  956. [HandlerAjaxOnly]
  957. [ValidateAntiForgeryToken]
  958. public ActionResult SubmitFormLLSQTL(string ApplyNegCode, string Sequence, string INVCode, string keyValue, string WorkPoint)
  959. {
  960. int i = App.SubmitFormLLSQTL(ApplyNegCode, Sequence, INVCode, keyValue, WorkPoint);
  961. if (i > 0)
  962. {
  963. return Success("生成成功!");
  964. }
  965. else
  966. {
  967. return Error("生成失败!");
  968. }
  969. }
  970. //材料出库退料
  971. [HttpGet]
  972. [HandlerAjaxOnly]
  973. public ActionResult GetGridJsonCLCK(Pagination pagination, string queryJson)
  974. {
  975. DataTable ListData = App.GetGridJsonCLCK(queryJson, ref pagination);
  976. var JsonData = new
  977. {
  978. total = pagination.total,
  979. page = pagination.page,
  980. records = pagination.records,
  981. rows = ListData,
  982. };
  983. return Content(JsonData.ToJson());
  984. }
  985. //材料出库退料
  986. [HttpGet]
  987. [HandlerAjaxOnly]
  988. public ActionResult GetSubGridJsonCLCKByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  989. {
  990. DataTable ListData = App.GetSubGridJsonCLCKByCreate(ApplyNegCode, Sequence, WorkPoint);
  991. var JsonData = new
  992. {
  993. rows = ListData,
  994. };
  995. return Content(JsonData.ToJson());
  996. }
  997. //材料出库退料生成条码
  998. [HttpPost]
  999. [HandlerAjaxOnly]
  1000. [ValidateAntiForgeryToken]
  1001. public ActionResult SubmitFormCLCKT(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  1002. {
  1003. int i = App.SubmitFormCLCKT(ApplyNegCode, Sequence, keyValue, WorkPoint);
  1004. if (i > 0)
  1005. {
  1006. return Success("生成成功!");
  1007. }
  1008. else
  1009. {
  1010. return Error("生成失败!");
  1011. }
  1012. }
  1013. //委外领料
  1014. [HttpGet]
  1015. [HandlerAjaxOnly]
  1016. public ActionResult GetGridJsonWWLLTL(Pagination pagination, string queryJson)
  1017. {
  1018. DataTable ListData = App.GetGridJsonWWLLTL(queryJson, ref pagination);
  1019. var JsonData = new
  1020. {
  1021. total = pagination.total,
  1022. page = pagination.page,
  1023. records = pagination.records,
  1024. rows = ListData,
  1025. };
  1026. return Content(JsonData.ToJson());
  1027. }
  1028. //委外领料
  1029. [HttpGet]
  1030. [HandlerAjaxOnly]
  1031. public ActionResult GetSubGridJsonWWLLByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  1032. {
  1033. DataTable ListData = App.GetSubGridJsonWWLLByCreate(OApplyNegCode, Sequence, WorkPoint);
  1034. var JsonData = new
  1035. {
  1036. rows = ListData,
  1037. };
  1038. return Content(JsonData.ToJson());
  1039. }
  1040. //委外领料申请退料
  1041. [HttpPost]
  1042. [HandlerAjaxOnly]
  1043. [ValidateAntiForgeryToken]
  1044. public ActionResult SubmitFormWWLL(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  1045. {
  1046. int i = App.SubmitFormWWLL(OApplyNegCode, Sequence, keyValue, WorkPoint);
  1047. if (i > 0)
  1048. {
  1049. return Success("生成成功!");
  1050. }
  1051. else
  1052. {
  1053. return Error("生成失败!");
  1054. }
  1055. }
  1056. //委外材料出库
  1057. [HttpGet]
  1058. [HandlerAjaxOnly]
  1059. public ActionResult GetGridJsonWWCLCK(Pagination pagination, string queryJson)
  1060. {
  1061. DataTable ListData = App.GetGridJsonWWCLCK(queryJson, ref pagination);
  1062. var JsonData = new
  1063. {
  1064. total = pagination.total,
  1065. page = pagination.page,
  1066. records = pagination.records,
  1067. rows = ListData,
  1068. };
  1069. return Content(JsonData.ToJson());
  1070. }
  1071. //委外材料出库
  1072. [HttpGet]
  1073. [HandlerAjaxOnly]
  1074. public ActionResult GetSubGridJsonWWCLByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  1075. {
  1076. DataTable ListData = App.GetSubGridJsonWWCLByCreate(OApplyNegCode, Sequence, WorkPoint);
  1077. var JsonData = new
  1078. {
  1079. rows = ListData,
  1080. };
  1081. return Content(JsonData.ToJson());
  1082. }
  1083. [HttpPost]
  1084. [HandlerAjaxOnly]
  1085. [ValidateAntiForgeryToken]
  1086. public ActionResult SubmitFormWWCL(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  1087. {
  1088. int i = App.SubmitFormWWCL(OApplyNegCode, Sequence, keyValue, WorkPoint);
  1089. if (i > 0)
  1090. {
  1091. return Success("生成成功!");
  1092. }
  1093. else
  1094. {
  1095. return Error("生成失败!");
  1096. }
  1097. }
  1098. //返工工单
  1099. [HttpGet]
  1100. [HandlerAjaxOnly]
  1101. public ActionResult GetGridJsonFGGD(Pagination pagination, string queryJson)
  1102. {
  1103. DataTable ListData = App.GetGridJsonFGGD(queryJson, ref pagination);
  1104. var JsonData = new
  1105. {
  1106. total = pagination.total,
  1107. page = pagination.page,
  1108. records = pagination.records,
  1109. rows = ListData,
  1110. };
  1111. return Content(JsonData.ToJson());
  1112. }
  1113. [HttpGet]
  1114. [HandlerAjaxOnly]
  1115. public ActionResult GetSubGridJsonFGGDCreate(string FGGDMOCode, string Sequence, string WorkPoint)
  1116. {
  1117. DataTable ListData = App.GetSubGridJsonFGGDCreate(FGGDMOCode, Sequence, WorkPoint);
  1118. var JsonData = new
  1119. {
  1120. rows = ListData,
  1121. };
  1122. return Content(JsonData.ToJson());
  1123. }
  1124. [HttpPost]
  1125. [HandlerAjaxOnly]
  1126. [ValidateAntiForgeryToken]
  1127. public ActionResult SubmitFormFGGD(string FGGDMOCode, string Sequence, string keyValue, string WorkPoint)
  1128. {
  1129. int i = App.SubmitFormFGGD(FGGDMOCode, Sequence, keyValue, WorkPoint);
  1130. if (i > 0)
  1131. {
  1132. return Success("生成成功!");
  1133. }
  1134. else
  1135. {
  1136. return Error("生成失败!");
  1137. }
  1138. }
  1139. //[HttpPost]
  1140. //[HandlerAjaxOnly]
  1141. //[ValidateAntiForgeryToken]
  1142. public ActionResult DocUpLoadToHG(string DocNoList, string Type)
  1143. {
  1144. string msg = App.DocUpLoadToHG(DocNoList, Type);
  1145. if (msg == "")
  1146. {
  1147. return Success("上传成功!");
  1148. }
  1149. else
  1150. {
  1151. return Error(msg);
  1152. }
  1153. }
  1154. //[HttpPost]
  1155. //[HandlerAjaxOnly]
  1156. //[ValidateAntiForgeryToken]
  1157. public ActionResult GXWXCallSAPInterFace(string DocNoList)
  1158. {
  1159. string msg = App.GXWXCallSAPInterFace(DocNoList);
  1160. if (msg == "")
  1161. {
  1162. return Success("过账成功!");
  1163. }
  1164. else
  1165. {
  1166. return Error(msg);
  1167. }
  1168. }
  1169. public ActionResult GetQiSetNum(string keyValue)
  1170. {
  1171. var rows = App.GetQiSetNum(keyValue);
  1172. return Content(rows.ToJson());
  1173. }
  1174. [HttpGet]
  1175. [HandlerAjaxOnly]
  1176. public ActionResult GetGeneratedNum(string Code, string Sequence, string Type, string thisCreateQty)
  1177. {
  1178. bool Flag = App.GetGeneratedNum(Code, Sequence, Type, thisCreateQty);
  1179. var JsonData = new
  1180. {
  1181. Flag = Flag,
  1182. };
  1183. return Content(JsonData.ToJson());
  1184. }
  1185. }
  1186. }