HomeController.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Data;
  6. using System.Threading.Tasks;
  7. using Microsoft.AspNetCore.Mvc;
  8. using Microsoft.Extensions.Logging;
  9. using MySystem.PxcModels;
  10. using System.Threading;
  11. using Library;
  12. using LitJson;
  13. using System.Security.Cryptography;
  14. namespace MySystem.Controllers
  15. {
  16. public class HomeController : Controller
  17. {
  18. private readonly ILogger<HomeController> _logger;
  19. public HomeController(ILogger<HomeController> logger)
  20. {
  21. _logger = logger;
  22. }
  23. public IActionResult Index()
  24. {
  25. return View();
  26. }
  27. public IActionResult Error()
  28. {
  29. string isapi = Request.Headers["Api"].ToString();
  30. if (isapi != "1")
  31. {
  32. if (Response.StatusCode == 500)
  33. {
  34. return Redirect("/public/errpage/pc/500.html");
  35. }
  36. else if (Response.StatusCode == 502)
  37. {
  38. return Redirect("/public/errpage/pc/502.html");
  39. }
  40. else if (Response.StatusCode == 404)
  41. {
  42. return Redirect("/public/errpage/pc/404.html");
  43. }
  44. }
  45. return View();
  46. }
  47. public string test()
  48. {
  49. // WebCMSEntities db = new WebCMSEntities();
  50. // string content = function.ReadInstance("/txt/lkbsn.txt");
  51. // string[] list = content.Replace("\r", "").Split('\n');
  52. // foreach (string sub in list)
  53. // {
  54. // PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == sub);
  55. // if (pos != null)
  56. // {
  57. // string info = "{\"RecordId\":\"\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"0.63\",\"Kind\": \"1\",\"OpMan\": \"" + "系统" + "\"}";
  58. // RedisDbconn.Instance.AddList("SetDepositPostQueue", info);
  59. // }
  60. // }
  61. // db.Dispose();
  62. // return "ok";
  63. // return PublicImportDataService.Instance.QueryLiSDeposit("N00000D0022G499", "");
  64. // {"existsFlag":"1","feeList":[{"feeCalcType":"M1","fixed":"0","rate":"0.24"},{"feeCalcType":"M2","fixed":"0","rate":"0.24"},{"feeCalcType":"M3","fixed":"0","rate":"0.38"},{"feeCalcType":"M4","fixed":"0","rate":"2.63"},{"feeCalcType":"M5","fixed":"0","rate":"0.63"},{"feeCalcType":"M7","fixed":"0"},{"feeCalcType":"M8","fixed":"0"},{"feeCalcType":"M9","fixed":"0"},{"feeCalcType":"T0","fixed":"1","rate":"300"}],"merchNo":"N00000D0022G499","ret_code":"00","ret_msg":"请求成功"}
  65. // return PublicImportDataService.Instance.SetLiSWeFee("WME52S0151221", "N00000C05U77807", "0.63", "300");
  66. // return PublicImportDataService.Instance.LkbSetDeposit("00000302QRNL15510103", 299);
  67. // return PublicImportDataService.Instance.LkbSetFee("00000302QRNL20019214", 0.63M, 300);
  68. return PublicImportDataService.Instance.LkLSetFee("00007302823221000005", 0.63M, 3);
  69. // string content = "Oa4NF8tNLKthg9Q9klCLxyWtNJdAuL8n7NH5yM8VgM2eekpkzJ8/sFiY31NBo8qXGDcNi9GAiALsTZcEO5PAAZPsErhYQTeHoZ/cRkySVXm50r1aZ0osZfXysjrwvkP3lPLZzjeB21JldrUKviJ4k7YQunWC+B2Y4MX1ApZoTCw=";
  70. // return PublicImportDataService.Instance.LklDecrypt(content);
  71. }
  72. }
  73. }