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.

246 lines
8.2 KiB

1 month ago
  1. using NFine.Application.PNSRM;
  2. using NFine.Application.SRM;
  3. using NFine.Code;
  4. using NFine.Domain._03_Entity.SRM;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Data;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Web;
  11. using System.Web.Mvc;
  12. namespace NFine.Web.Areas.PNSRM.Controllers
  13. {
  14. public class BicDoc_SellerController : ControllerBase
  15. {
  16. private PNBicDoc_SellerApp App = new PNBicDoc_SellerApp();
  17. //
  18. // GET: /SRM/BicDoc_Seller/
  19. public ActionResult ICSBidding_Seller()
  20. {
  21. return View();
  22. }
  23. public ActionResult ICSBiddingAdd_Seller()
  24. {
  25. return View();
  26. }
  27. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  28. {
  29. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  30. var JsonData = new
  31. {
  32. total = pagination.total,
  33. page = pagination.page,
  34. records = pagination.records,
  35. rows = ListData,
  36. };
  37. return Content(JsonData.ToJson());
  38. }
  39. [HttpGet]
  40. [HandlerAjaxOnly]
  41. public ActionResult GetSubGridJson(string STNO, Pagination pagination,string WorkPoint)
  42. {
  43. DataTable ListData = App.GetSubGridJson(STNO, ref pagination, WorkPoint);
  44. var JsonData = new
  45. {
  46. total = pagination.total,
  47. page = pagination.page,
  48. records = pagination.records,
  49. rows = ListData,
  50. };
  51. return Content(JsonData.ToJson());
  52. }
  53. //public ActionResult GetICSBidDoc(string BidCode, string WorkPoint, Pagination pagination)
  54. //{
  55. // DataTable ListData = App.GetICSBidDoc(BidCode, WorkPoint, ref pagination);
  56. // var JsonData = new
  57. // {
  58. // total = pagination.total,
  59. // page = pagination.page,
  60. // records = pagination.records,
  61. // rows = ListData,
  62. // };
  63. // return Content(JsonData.ToJson());
  64. //}
  65. //[HttpGet]
  66. //[HandlerAjaxOnly]
  67. //public ActionResult GetICSBidDoc(Pagination pagination, string BidCode, string WorkPoint)
  68. //{
  69. // DataTable ListData = App.GetICSBidDoc(ref pagination, BidCode, WorkPoint);
  70. // var JsonData = new
  71. // {
  72. // total = pagination.total,
  73. // page = pagination.page,
  74. // records = pagination.records,
  75. // rows = ListData,
  76. // };
  77. // return Content(JsonData.ToJson());
  78. //}
  79. public ActionResult SearchBidDocBDInfoByBidCodeSeller(string BidCode, string WorkPoint, Pagination pagination)
  80. {
  81. DataTable ListData = App.SearchBidDocBDInfoByBidCodeSeller(BidCode, WorkPoint, ref pagination);
  82. var JsonData = new
  83. {
  84. total = pagination.total,
  85. page = pagination.page,
  86. records = pagination.records,
  87. rows = ListData,
  88. };
  89. return Content(JsonData.ToJson());
  90. }
  91. [HttpPost]
  92. public ActionResult SaveForm(ICSBidInfoDetail main)
  93. {
  94. try
  95. {
  96. App.SaveForm(main);
  97. return Success("保存成功");
  98. }
  99. catch (Exception ex)
  100. {
  101. return Error(ex.Message);
  102. }
  103. }
  104. public ActionResult SaveFormTiJiao(string keyValue, string BidCode, string TBCount,string WorkPoint)
  105. {
  106. try
  107. {
  108. App.SaveFormTiJiao(keyValue, BidCode, TBCount, WorkPoint);
  109. return Success("保存成功");
  110. }
  111. catch (Exception ex)
  112. {
  113. return Error(ex.Message);
  114. }
  115. }
  116. public ActionResult SaveFormQTiJiao(string keyValue, string BidCode)
  117. {
  118. try
  119. {
  120. App.SaveFormQTiJiao(keyValue, BidCode);
  121. return Success("取消保存成功");
  122. }
  123. catch (Exception ex)
  124. {
  125. return Error(ex.Message);
  126. }
  127. }
  128. [HttpPost]
  129. public ActionResult UpLoadFileImport(string BidCode, string ID)
  130. {
  131. string FileName = "";
  132. string PathName = "";
  133. string UserName = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
  134. //获取上传的文件集合
  135. HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
  136. for (int i = 0; i < httpFile.Count; i++)
  137. {
  138. //获取送货单号
  139. //string STNO = Request.Form["STNO"].ToString();
  140. string fileName =UserName.Substring(0,4)+"_"+Path.GetFileNameWithoutExtension(httpFile[i].FileName)
  141. + Path.GetExtension(httpFile[i].FileName);
  142. string Paths = System.Web.HttpContext.Current.Server.MapPath("~\\File\\GYSZTBFile\\" + BidCode);
  143. if (!Directory.Exists(Paths))
  144. {
  145. Directory.CreateDirectory(Paths);
  146. }
  147. string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\GYSZTBFile\\" + BidCode + "\\" + fileName);
  148. int iLen = httpFile[0].ContentLength;
  149. byte[] bData = new byte[iLen];
  150. httpFile[0].InputStream.Read(bData, 0, iLen);
  151. FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
  152. fs.Write(bData, 0, bData.Length);
  153. fs.Flush();
  154. fs.Close();
  155. fs.Dispose();
  156. FileName += "" + fileName + ";";
  157. PathName += "" + filePath + ";";
  158. }
  159. int count = App.UpLoadFile(FileName, PathName, BidCode);
  160. if (count > 0)
  161. {
  162. return Success("上传成功!");
  163. }
  164. else
  165. {
  166. return Error("上传失败");
  167. }
  168. }
  169. [HttpGet]
  170. [HandlerAjaxOnly]
  171. public ActionResult GetICSBidDocInfoSum(string BidCode, string WorkPoint, string Status)
  172. {
  173. DataTable ListData = App.GetICSBidDocInfoSum(BidCode, WorkPoint, Status);
  174. var JsonData = new
  175. {
  176. rows = ListData,
  177. };
  178. return Content(JsonData.ToJson());
  179. }
  180. [HttpGet]
  181. [HandlerAjaxOnly]
  182. public ActionResult GetCGFile(string BidCode, string WorkPoint)
  183. {
  184. DataTable ListData = App.GetCGFile(BidCode, WorkPoint);
  185. var JsonData = new
  186. {
  187. rows = ListData,
  188. };
  189. return Content(JsonData.ToJson());
  190. }
  191. [HttpGet]
  192. [HandlerAjaxOnly]
  193. public ActionResult GetVenDorFile(string BidCode, string WorkPoint)
  194. {
  195. DataTable ListData = App.GetVenDorFile(BidCode, WorkPoint);
  196. var JsonData = new
  197. {
  198. rows = ListData,
  199. };
  200. return Content(JsonData.ToJson());
  201. }
  202. [HttpGet]
  203. [HandlerAjaxOnly]
  204. public ActionResult GetVenDorFileTB(string BidCode, string WorkPoint)
  205. {
  206. DataTable ListData = App.GetVenDorFileTB(BidCode, WorkPoint);
  207. var JsonData = new
  208. {
  209. rows = ListData,
  210. };
  211. return Content(JsonData.ToJson());
  212. }
  213. /// <summary>
  214. /// 调用OA接口
  215. /// </summary>
  216. /// <param name="TEMPVENDORCODE">公司名称</param>
  217. /// <returns></returns>
  218. [HttpPost]
  219. public ActionResult SellerSubmitOARejict(string BidCode, string WorkPoint)
  220. {
  221. try
  222. {
  223. string msg = App.SellerSubmitOARejict(BidCode, WorkPoint);
  224. var JsonData = new
  225. {
  226. msg = msg,
  227. };
  228. return Content(JsonData.ToJson());
  229. }
  230. catch (Exception ex)
  231. {
  232. return Error("推送失败" + ex.Message);
  233. }
  234. }
  235. }
  236. }