HomeController.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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("00003102722201179813196", 0);
  67. // return PublicImportDataService.Instance.LkbSetFee("00000302QRNL20019214", 0.63M, 300);
  68. return PublicImportDataService.Instance.LkLSetFee("100117947", 0.6M, 300);
  69. // string content = "OiqJAGEVZSIrQmtKggTtFfSwtybN7gdJd6obHt27KfZIdMUzIsXIVtNdYGWHWr93f6kR1+5JUuwQ1ZP0Z/HxSKd2FeOAJpkgBWjzaOZV4badFJt7ptxVCN4QWAyCSKB+uyGAwwj2zo2S6wz/ongWGZexAZk8K6PKyz0aXyhm0rFPEDl2e4r68luLMI7hd4fVsoxE+455afZyLCv2jt3XCH7XcyaxHO8HR/BaHJDIWu8RQwaPYgx2gdiOftlybiiSDhJcI2S1plDH5uSfMrx/UCQ+2KqSfF/HjlLWXLUk1jwlSs6hNaCHYdO5T/6nRjfO+nB0vJtSS9j++Wi7fxM9dg==";
  70. // return PublicImportDataService.Instance.LklDecrypt(content);
  71. //{"orgCode":"1951139","agentNo":29146077,"agencyNo":30342600,"externalCustomerNo":"82212108299005P","customerName":"��机****了饭","legalName":"徐*","posSn":"123081400101002052","posType":"PAPER_CODE","termNo":"A9323753","type":"UNBIND","operateTime":"2024-11-14 11:36:00"}
  72. //{"orderNo":"20241113170425","userNo":29115902,"agencyNo":30324920,"customerNo":100132238,"externalCustomerNo":"822121070110BDQ","customerName":"好拓*************件二","legalName":"宋*杰","posSn":"HAOTKwzn20241113111","type":"DEPOSIT","transCardType":"01","extTransCode":"412001","termId":"012001","amount":40000000,"transTime":"2024-11-13 17:04:25"}
  73. //{"logNo":"24111250702305","posSn":"00007902C32300000502","externalCustomerNo":"822121070110BDB","amount":8.0,"time":"2024-11-12 00:00:00","deductDate":"20241112","agencyNo":30343214}
  74. }
  75. }
  76. }