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.

325 lines
9.1 KiB

4 days ago
  1. using NFine.Application;
  2. using NFine.Application.ProductManage;
  3. using NFine.Code;
  4. using NFine.Domain.Entity.ProductManage;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Web.Mvc;
  9. using ICSSoft.SendMail;
  10. namespace NFine.Web.Areas.SRM.Controllers
  11. {
  12. public class POReleaseController : ControllerBase
  13. {
  14. private POReleaseApp App = new POReleaseApp();
  15. [HttpGet]
  16. [HandlerAjaxOnly]
  17. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  18. {
  19. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  20. var JsonData = new
  21. {
  22. total = pagination.total,
  23. page = pagination.page,
  24. records = pagination.records,
  25. rows = ListData,
  26. };
  27. return Content(JsonData.ToJson());
  28. }
  29. [HttpGet]
  30. [HandlerAjaxOnly]
  31. public ActionResult GetGridJsonByBB(Pagination pagination, string queryJson)
  32. {
  33. DataTable ListData = App.GetGridJsonByBB(queryJson, ref pagination);
  34. var JsonData = new
  35. {
  36. total = pagination.total,
  37. page = pagination.page,
  38. records = pagination.records,
  39. rows = ListData,
  40. };
  41. return Content(JsonData.ToJson());
  42. }
  43. [HttpGet]
  44. [HandlerAjaxOnly]
  45. public ActionResult GetGridJsonWeiWai(Pagination pagination, string queryJson)
  46. {
  47. DataTable ListData = App.GetGridJsonWeiWai(queryJson, ref pagination);
  48. var JsonData = new
  49. {
  50. total = pagination.total,
  51. page = pagination.page,
  52. records = pagination.records,
  53. rows = ListData,
  54. };
  55. return Content(JsonData.ToJson());
  56. }
  57. [HttpGet]
  58. [HandlerAjaxOnly]
  59. public ActionResult GetGridJsonWeiWaiByBB(Pagination pagination, string queryJson)
  60. {
  61. DataTable ListData = App.GetGridJsonWeiWaiByBB(queryJson, ref pagination);
  62. var JsonData = new
  63. {
  64. total = pagination.total,
  65. page = pagination.page,
  66. records = pagination.records,
  67. rows = ListData,
  68. };
  69. return Content(JsonData.ToJson());
  70. }
  71. [HttpGet]
  72. [HandlerAjaxOnly]
  73. public ActionResult GetSubGridJson(string POCode, Pagination pagination,string WorkPoint)
  74. {
  75. DataTable ListData = App.GetSubGridJson(POCode, ref pagination, WorkPoint);
  76. var JsonData = new
  77. {
  78. total = pagination.total,
  79. page = pagination.page,
  80. records = pagination.records,
  81. rows = ListData,
  82. };
  83. //获取当前登录人信息;
  84. return Content(JsonData.ToJson());
  85. }
  86. [HttpGet]
  87. [HandlerAjaxOnly]
  88. public ActionResult GetSubGridJsonWW(string OOCode, Pagination pagination,string WorkPoint)
  89. {
  90. DataTable ListData = App.GetSubGridJsonWW(OOCode, ref pagination, WorkPoint);
  91. var JsonData = new
  92. {
  93. total = pagination.total,
  94. page = pagination.page,
  95. records = pagination.records,
  96. rows = ListData,
  97. };
  98. //获取当前登录人信息;
  99. return Content(JsonData.ToJson());
  100. }
  101. public ActionResult IndexByBB()
  102. {
  103. return View();
  104. }
  105. public ActionResult Index()
  106. {
  107. return View();
  108. }
  109. //[HttpGet]
  110. //[HandlerAjaxOnly]
  111. //public ActionResult GetFormJson(string keyValue)
  112. //{
  113. // //var data = maintainAppApp.GetForm(keyValue);
  114. // //return Content(data.ToJson());
  115. //}
  116. /// <summary>
  117. /// 发布采购订单信息
  118. /// </summary>
  119. /// <param name="keyValue">采购订单</param>
  120. /// <param name="WorkPoint">多站点信息</param>
  121. /// <returns></returns>
  122. [HttpPost]
  123. [HandlerAjaxOnly]
  124. [ValidateAntiForgeryToken]
  125. public ActionResult SubmitForm(string keyValue, string WorkPoint)
  126. {
  127. int i = App.SubmitPoRelease(keyValue, WorkPoint);
  128. if (i > 0)
  129. {
  130. return Success("发布成功!");
  131. }
  132. else
  133. {
  134. return Error("发布失败!");
  135. }
  136. }
  137. /// <summary>
  138. /// 取消发布
  139. /// </summary>
  140. /// <param name="keyValue"></param>
  141. /// <param name="WorkPoint"></param>
  142. /// <returns></returns>
  143. [HttpPost]
  144. [HandlerAjaxOnly]
  145. [ValidateAntiForgeryToken]
  146. public ActionResult CeanlSubmitForm(string keyValue, string WorkPoint)
  147. {
  148. int i = App.CeanlSubmitForm(keyValue, WorkPoint);
  149. if (i > 0)
  150. {
  151. return Success("取消发布成功!");
  152. }
  153. else
  154. {
  155. return Error("取消发布失败!");
  156. }
  157. }
  158. [HttpPost]
  159. [HandlerAjaxOnly]
  160. [ValidateAntiForgeryToken]
  161. public ActionResult SubmitFormWeiWai(string keyValue, string WorkPoint)
  162. {
  163. try
  164. {
  165. int i = App.SubmitFormWeiWai(keyValue, WorkPoint);
  166. if (i > 0)
  167. {
  168. return Success("发布成功!");
  169. }
  170. else
  171. {
  172. return Error("发布失败!");
  173. }
  174. }
  175. catch (System.Exception ex)
  176. {
  177. return Error("发布失败,"+ex.Message);
  178. }
  179. }
  180. /// <summary>
  181. /// 取消发布 委外
  182. /// </summary>
  183. /// <param name="keyValue"></param>
  184. /// <param name="WorkPoint"></param>
  185. /// <returns></returns>
  186. [HttpPost]
  187. [HandlerAjaxOnly]
  188. [ValidateAntiForgeryToken]
  189. public ActionResult CeanlSubmitFormWeiWai(string keyValue, string WorkPoint)
  190. {
  191. int i = App.CeanlSubmitFormWeiWai(keyValue, WorkPoint);
  192. if (i > 0)
  193. {
  194. return Success("取消发布成功!");
  195. }
  196. else
  197. {
  198. return Error("发布失败!");
  199. }
  200. }
  201. //[HttpPost]
  202. //[HandlerAjaxOnly]
  203. //[HandlerAuthorize]
  204. //[ValidateAntiForgeryToken]
  205. //public ActionResult DeleteForm(string keyValue)
  206. //{
  207. // maintainAppApp.DeleteForm(keyValue);
  208. // return Success("Delete success.");
  209. //}
  210. [HttpGet]
  211. [HandlerAjaxOnly]
  212. public ActionResult CheckIsAgaion(string POCode, string PORow)
  213. {
  214. POCode = POCode.TrimEnd(',');
  215. PORow = PORow.TrimEnd(',');
  216. string _result = App.CheckIsAgaion(POCode, PORow);
  217. var JsonData = new
  218. {
  219. result = _result
  220. };
  221. return Content(JsonData.ToJson());
  222. }
  223. [HttpGet]
  224. public ActionResult SelectColumnName(string BeginTime, string EndTime)
  225. {
  226. var data = App.SelectColumnName(BeginTime, EndTime);
  227. return Content(data.ToJson());
  228. }
  229. [HttpGet]
  230. public ActionResult SelectTableColumnName(string BeginTime, string EndTime)
  231. {
  232. var data = App.SelectTableColumnName(BeginTime, EndTime);
  233. return Content(data.ToJson());
  234. }
  235. [HttpGet]
  236. [HandlerAjaxOnly]
  237. public ActionResult GetSubGridJsonBYBB(string POCode, Pagination pagination, string WorkPoint)
  238. {
  239. DataTable ListData = App.GetSubGridJsonBYBB(POCode, ref pagination, WorkPoint);
  240. var JsonData = new
  241. {
  242. total = pagination.total,
  243. page = pagination.page,
  244. records = pagination.records,
  245. rows = ListData,
  246. };
  247. //获取当前登录人信息;
  248. return Content(JsonData.ToJson());
  249. }
  250. [HttpGet]
  251. [HandlerAjaxOnly]
  252. public ActionResult GetSubGridJsonWWByBB(string OOCode, Pagination pagination, string WorkPoint)
  253. {
  254. DataTable ListData = App.GetSubGridJsonWWByBB(OOCode, ref pagination, WorkPoint);
  255. var JsonData = new
  256. {
  257. total = pagination.total,
  258. page = pagination.page,
  259. records = pagination.records,
  260. rows = ListData,
  261. };
  262. //获取当前登录人信息;
  263. return Content(JsonData.ToJson());
  264. }
  265. [HttpPost]
  266. [HandlerAjaxOnly]
  267. public ActionResult SaveRemark(string keyValue,string Type)
  268. {
  269. string msg = App.SaveRemark(keyValue, Type);
  270. if (!string.IsNullOrEmpty(msg))
  271. {
  272. return Error(msg);
  273. }
  274. else
  275. {
  276. return Success("保存成功!");
  277. }
  278. }
  279. }
  280. }