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.

587 lines
19 KiB

4 days ago
  1. using NFine.Application;
  2. using NFine.Application.ProductManage;
  3. using NFine.Application.SRM;
  4. using NFine.Code;
  5. using NFine.Data.Extensions;
  6. using NFine.Domain.Entity.ProductManage;
  7. using NPOI.SS.Formula.Functions;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Data;
  11. using System.Data.SqlClient;
  12. using System.IO;
  13. using System.Linq;
  14. using System.Threading;
  15. using System.Web;
  16. using System.Web.Mvc;
  17. namespace NFine.Web.Areas.SRM.Controllers
  18. {
  19. public class EcharsPerFormController : ControllerBase
  20. {
  21. EcharsPerFormApp app = new EcharsPerFormApp();
  22. //
  23. // GET: /SRM/EcharsPerForm/
  24. public ActionResult PerFormChars()
  25. {
  26. return View();
  27. }
  28. public ActionResult PerFormZLChars()
  29. {
  30. return View();
  31. }
  32. /// <summary>
  33. /// 实际采购数量
  34. /// </summary>
  35. /// <returns></returns>
  36. public ActionResult PoQuantity()
  37. {
  38. return View();
  39. }
  40. /// <summary>
  41. /// 计划达成率
  42. /// </summary>
  43. /// <returns></returns>
  44. public ActionResult PoRrice()
  45. {
  46. return View();
  47. }
  48. /// <summary>
  49. /// 采购到货数量
  50. /// </summary>
  51. /// <returns></returns>
  52. public ActionResult PORQuantity()
  53. {
  54. return View();
  55. }
  56. /// <summary>
  57. /// 采购到货数量
  58. /// </summary>
  59. /// <returns></returns>
  60. public ActionResult InvoicePrice()
  61. {
  62. return View();
  63. }
  64. //采购金额(订单金额) 占比
  65. public ActionResult PoPriceSum()
  66. {
  67. return View();
  68. }
  69. //采购周期
  70. public ActionResult Procurementcycle()
  71. {
  72. return View();
  73. }
  74. //供应商数量
  75. public ActionResult VendorQuantity()
  76. {
  77. return View();
  78. }
  79. //采购降本额
  80. public ActionResult PoJBPrice()
  81. {
  82. return View();
  83. }
  84. //实际交期与供应商交期一致率
  85. public ActionResult POMaintenance()
  86. {
  87. return View();
  88. }
  89. public ActionResult VendorQualifiedQuantity()
  90. {
  91. return View();
  92. }
  93. public ActionResult DeliveryNoticeType2()
  94. {
  95. return View();
  96. }
  97. public ActionResult VendorSORQUOTATION()
  98. {
  99. return View();
  100. }
  101. public ActionResult PoJBPriceByInvCode()
  102. {
  103. return View();
  104. }
  105. public ActionResult PoJBPriceByPersonCode()
  106. {
  107. return View();
  108. }
  109. public ActionResult PoJBPriceByVenCode()
  110. {
  111. return View();
  112. }
  113. public ActionResult BidChartsTB()
  114. {
  115. return View();
  116. }
  117. public ActionResult BidChartsJB()
  118. {
  119. return View();
  120. }
  121. [HttpGet]
  122. [HandlerAjaxOnly]
  123. public ActionResult GetJQDC(string Year)
  124. {
  125. DataTable data = app.GetJQDC(Year);
  126. return Content(data.ToJson());
  127. }
  128. [HttpGet]
  129. [HandlerAjaxOnly]
  130. public ActionResult GetPoQuantity(string VenName,string InvName,string BegionDate,string EndDate,string DETP,string selectedValue, string radios)
  131. {
  132. DataTable data = app.GetPoQuantity(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  133. return Content(data.ToJson());
  134. }
  135. [HttpGet]
  136. [HandlerAjaxOnly]
  137. public ActionResult GetPoSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  138. {
  139. DataTable data = app.GetPoSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  140. return Content(data.ToJson());
  141. }
  142. [HttpGet]
  143. [HandlerAjaxOnly]
  144. public ActionResult GetJHImplementSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  145. {
  146. DataTable data = app.GetJHImplementSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  147. return Content(data.ToJson());
  148. }
  149. [HttpGet]
  150. [HandlerAjaxOnly]
  151. public ActionResult GetPorSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  152. {
  153. DataTable data = app.GetPorSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  154. return Content(data.ToJson());
  155. }
  156. [HttpGet]
  157. [HandlerAjaxOnly]
  158. public ActionResult GetInvoicePriceSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  159. {
  160. DataTable data = app.GetInvoicePriceSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  161. return Content(data.ToJson());
  162. }
  163. [HttpGet]
  164. [HandlerAjaxOnly]
  165. public ActionResult GetPoPriceSumSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  166. {
  167. DataTable data = app.GetPoPriceSumSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  168. return Content(data.ToJson());
  169. }
  170. /// <summary>
  171. /// 供应商数量
  172. /// </summary>
  173. /// <param name="VenName"></param>
  174. /// <param name="InvName"></param>
  175. /// <param name="BegionDate"></param>
  176. /// <param name="EndDate"></param>
  177. /// <param name="DETP"></param>
  178. /// <param name="selectedValue"></param>
  179. /// <param name="radios"></param>
  180. /// <returns></returns>
  181. [HttpGet]
  182. [HandlerAjaxOnly]
  183. public ActionResult GetVendorQuantitySearcs()
  184. {
  185. DataTable data = app.GetVendorQuantitySearcs();
  186. return Content(data.ToJson());
  187. }
  188. /// <summary>
  189. /// 交期一致率
  190. /// </summary>
  191. /// <returns></returns>
  192. [HttpGet]
  193. [HandlerAjaxOnly]
  194. public ActionResult GetPOMaintenanceSearcs()
  195. {
  196. DataTable data = app.GetPOMaintenanceSearcs();
  197. return Content(data.ToJson());
  198. }
  199. [HttpGet]
  200. [HandlerAjaxOnly]
  201. public ActionResult GetVendorQualifiedQuantitySearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  202. {
  203. DataTable data = app.GetVendorQualifiedQuantitySearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  204. return Content(data.ToJson());
  205. }
  206. [HttpGet]
  207. [HandlerAjaxOnly]
  208. public ActionResult GetDeliveryNoticeSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  209. {
  210. DataTable data = app.GetDeliveryNoticeSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  211. return Content(data.ToJson());
  212. }
  213. [HttpGet]
  214. [HandlerAjaxOnly]
  215. public ActionResult GetDeliveryNoticeType2Searcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  216. {
  217. DataTable data = app.GetDeliveryNoticeType2Searcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  218. return Content(data.ToJson());
  219. }
  220. [HttpGet]
  221. [HandlerAjaxOnly]
  222. public ActionResult GetDeliveryNoticeType2JQSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  223. {
  224. DataTable data = app.GetDeliveryNoticeType2JQSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  225. return Content(data.ToJson());
  226. }
  227. [HttpGet]
  228. [HandlerAjaxOnly]
  229. public ActionResult GetVendorSORQUOTATIONSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  230. {
  231. DataTable data = app.GetVendorSORQUOTATIONSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  232. return Content(data.ToJson());
  233. }
  234. [HttpGet]
  235. [HandlerAjaxOnly]
  236. public ActionResult GetPoJBPriceSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  237. {
  238. DataTable data = app.GetPoJBPriceSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  239. return Content(data.ToJson());
  240. }
  241. [HttpGet]
  242. [HandlerAjaxOnly]
  243. public ActionResult GetBidChartsTBSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  244. {
  245. DataTable data = app.GetBidChartsTBSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  246. return Content(data.ToJson());
  247. }
  248. [HttpGet]
  249. [HandlerAjaxOnly]
  250. public ActionResult GetBidChartsJBSearcs(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  251. {
  252. DataTable data = app.GetBidChartsJBSearcs(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  253. return Content(data.ToJson());
  254. }
  255. [HttpGet]
  256. [HandlerAjaxOnly]
  257. public ActionResult GetProcurementcycle(string VenName, string InvName, string BegionDate, string EndDate, string DETP, string selectedValue, string radios)
  258. {
  259. DataTable data = app.GetProcurementcycle(VenName, InvName, BegionDate, EndDate, DETP, selectedValue, radios);
  260. return Content(data.ToJson());
  261. }
  262. [HttpGet]
  263. [HandlerAjaxOnly]
  264. public ActionResult GetGridJsonByLB(Pagination pagination, string queryJson)
  265. {
  266. DataTable ListData = app.GetGridJsonByLB(queryJson, ref pagination);
  267. var JsonData = new
  268. {
  269. total = pagination.total,
  270. page = pagination.page,
  271. records = pagination.records,
  272. rows = ListData,
  273. };
  274. return Content(JsonData.ToJson());
  275. }
  276. [HttpGet]
  277. [HandlerAjaxOnly]
  278. public ActionResult GetJHImplementByLB(Pagination pagination, string queryJson)
  279. {
  280. DataTable ListData = app.GetJHImplementByLB(queryJson, ref pagination);
  281. var JsonData = new
  282. {
  283. total = pagination.total,
  284. page = pagination.page,
  285. records = pagination.records,
  286. rows = ListData,
  287. };
  288. return Content(JsonData.ToJson());
  289. }
  290. [HttpGet]
  291. [HandlerAjaxOnly]
  292. public ActionResult GetPorGridJsonByLB(Pagination pagination, string queryJson)
  293. {
  294. DataTable ListData = app.GetPorGridJsonByLB(queryJson, ref pagination);
  295. var JsonData = new
  296. {
  297. total = pagination.total,
  298. page = pagination.page,
  299. records = pagination.records,
  300. rows = ListData,
  301. };
  302. return Content(JsonData.ToJson());
  303. }
  304. [HttpGet]
  305. [HandlerAjaxOnly]
  306. public ActionResult GetInvoicePriceByLB(Pagination pagination, string queryJson)
  307. {
  308. DataTable ListData = app.GetInvoicePriceByLB(queryJson, ref pagination);
  309. var JsonData = new
  310. {
  311. total = pagination.total,
  312. page = pagination.page,
  313. records = pagination.records,
  314. rows = ListData,
  315. };
  316. return Content(JsonData.ToJson());
  317. }
  318. [HttpGet]
  319. [HandlerAjaxOnly]
  320. public ActionResult GetPoPriceSumGridJsonByLB(Pagination pagination, string queryJson)
  321. {
  322. DataTable ListData = app.GetPoPriceSumGridJsonByLB(queryJson, ref pagination);
  323. var JsonData = new
  324. {
  325. total = pagination.total,
  326. page = pagination.page,
  327. records = pagination.records,
  328. rows = ListData,
  329. };
  330. return Content(JsonData.ToJson());
  331. }
  332. [HttpGet]
  333. [HandlerAjaxOnly]
  334. public ActionResult GetProcurementcycleJsonByLB(Pagination pagination, string queryJson)
  335. {
  336. DataTable ListData = app.GetProcurementcycleJsonByLB(queryJson, ref pagination);
  337. var JsonData = new
  338. {
  339. total = pagination.total,
  340. page = pagination.page,
  341. records = pagination.records,
  342. rows = ListData,
  343. };
  344. return Content(JsonData.ToJson());
  345. }
  346. [HttpGet]
  347. [HandlerAjaxOnly]
  348. public ActionResult GetVendorQualifiedQuantityByLB(Pagination pagination, string queryJson)
  349. {
  350. DataTable ListData = app.GetVendorQualifiedQuantityByLB(queryJson, ref pagination);
  351. var JsonData = new
  352. {
  353. total = pagination.total,
  354. page = pagination.page,
  355. records = pagination.records,
  356. rows = ListData,
  357. };
  358. return Content(JsonData.ToJson());
  359. }
  360. [HttpGet]
  361. [HandlerAjaxOnly]
  362. public ActionResult GetDeliveryNoticeByLB(Pagination pagination, string queryJson)
  363. {
  364. DataTable ListData = app.GetDeliveryNoticeByLB(queryJson, ref pagination);
  365. var JsonData = new
  366. {
  367. total = pagination.total,
  368. page = pagination.page,
  369. records = pagination.records,
  370. rows = ListData,
  371. };
  372. return Content(JsonData.ToJson());
  373. }
  374. [HttpGet]
  375. [HandlerAjaxOnly]
  376. public ActionResult GetDeliveryNoticeType2ByLB(Pagination pagination, string queryJson)
  377. {
  378. DataTable ListData = app.GetDeliveryNoticeType2ByLB(queryJson, ref pagination);
  379. var JsonData = new
  380. {
  381. total = pagination.total,
  382. page = pagination.page,
  383. records = pagination.records,
  384. rows = ListData,
  385. };
  386. return Content(JsonData.ToJson());
  387. }
  388. [HttpGet]
  389. [HandlerAjaxOnly]
  390. public ActionResult GetDeliveryNoticeTypeJQ2ByLB(Pagination pagination, string queryJson)
  391. {
  392. DataTable ListData = app.GetDeliveryNoticeTypeJQ2ByLB(queryJson, ref pagination);
  393. var JsonData = new
  394. {
  395. total = pagination.total,
  396. page = pagination.page,
  397. records = pagination.records,
  398. rows = ListData,
  399. };
  400. return Content(JsonData.ToJson());
  401. }
  402. [HttpGet]
  403. [HandlerAjaxOnly]
  404. public ActionResult GetVendorSORQUOTATIONByLB(Pagination pagination, string queryJson)
  405. {
  406. DataTable ListData = app.GetVendorSORQUOTATIONByLB(queryJson, ref pagination);
  407. var JsonData = new
  408. {
  409. total = pagination.total,
  410. page = pagination.page,
  411. records = pagination.records,
  412. rows = ListData,
  413. };
  414. return Content(JsonData.ToJson());
  415. }
  416. [HttpGet]
  417. [HandlerAjaxOnly]
  418. public ActionResult GetPoJBPriceByLB(Pagination pagination, string queryJson)
  419. {
  420. DataTable ListData = app.GetPoJBPriceByLB(queryJson, ref pagination);
  421. var JsonData = new
  422. {
  423. total = pagination.total,
  424. page = pagination.page,
  425. records = pagination.records,
  426. rows = ListData,
  427. };
  428. return Content(JsonData.ToJson());
  429. }
  430. [HttpGet]
  431. [HandlerAjaxOnly]
  432. public ActionResult GetZL(string Year)
  433. {
  434. DataTable data = app.GetZL(Year);
  435. return Content(data.ToJson());
  436. }
  437. public ActionResult ReportCountSum()
  438. {
  439. return View();
  440. }
  441. [HttpGet]
  442. [HandlerAjaxOnly]
  443. public ActionResult GetDelayOrder(string Year)
  444. {
  445. DataTable data = app.GetDelayOrder(Year);
  446. return Content(data.ToJson());
  447. }
  448. [HttpGet]
  449. [HandlerAjaxOnly]
  450. public ActionResult GetPoMain()
  451. {
  452. DataTable data = app.GetPoMain();
  453. return Content(data.ToJson());
  454. }
  455. [HttpGet]
  456. [HandlerAjaxOnly]
  457. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  458. {
  459. DataTable ListData = app.GetGridJson(queryJson, ref pagination);
  460. var JsonData = new
  461. {
  462. total = pagination.total,
  463. page = pagination.page,
  464. records = pagination.records,
  465. rows = ListData,
  466. };
  467. return Content(JsonData.ToJson());
  468. }
  469. public ActionResult GetInvCode()
  470. {
  471. DataTable dt = app.GetInvCode();
  472. return Content(dt.ToJson());
  473. }
  474. /// <summary>
  475. /// 采购总金额(近四年)
  476. /// </summary>
  477. /// <returns></returns>
  478. [HttpGet]
  479. [HandlerAjaxOnly]
  480. public ActionResult GetNCGJE()
  481. {
  482. DataTable data = app.GetNCGJE();
  483. return Content(data.ToJson());
  484. }
  485. /// <summary>
  486. /// 采购总金额(近六月)
  487. /// </summary>
  488. /// <returns></returns>
  489. [HttpGet]
  490. [HandlerAjaxOnly]
  491. public ActionResult GetYCGJE()
  492. {
  493. DataTable data = app.GetYCGJE();
  494. return Content(data.ToJson());
  495. }
  496. [HttpGet]
  497. [HandlerAjaxOnly]
  498. public ActionResult GetWLCGJEZB()
  499. {
  500. DataTable data = app.GetWLCGJEZB();
  501. return Content(data.ToJson());
  502. }
  503. [HttpGet]
  504. [HandlerAjaxOnly]
  505. public ActionResult GetGYSCGJEZB()
  506. {
  507. DataTable data = app.GetGYSCGJEZB();
  508. return Content(data.ToJson());
  509. }
  510. [HttpGet]
  511. [HandlerAjaxOnly]
  512. public ActionResult GetCGJBE()
  513. {
  514. DataTable data = app.GetCGJBE();
  515. return Content(data.ToJson());
  516. }
  517. [HttpGet]
  518. [HandlerAjaxOnly]
  519. public ActionResult GetCGSDZT()
  520. {
  521. DataTable data = app.GetCGSDZT();
  522. return Content(data.ToJson());
  523. }
  524. [HttpGet]
  525. [HandlerAjaxOnly]
  526. public ActionResult GetGYSTZ()
  527. {
  528. DataTable data = app.GetGYSTZ();
  529. return Content(data.ToJson());
  530. }
  531. [HttpGet]
  532. [HandlerAjaxOnly]
  533. public ActionResult GetWLCFCGBL()
  534. {
  535. DataTable data = app.GetWLCFCGBL();
  536. return Content(data.ToJson());
  537. }
  538. }
  539. }