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

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