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

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