HomeController.cs 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. // List<string> poslist = new List<string>();
  50. // poslist.Add("M00000000000034");
  51. // string result = PublicImportDataService.Instance.PospFee(poslist, "LKB_0.63+3", "联客宝");
  52. // if(result.Contains("\"content\""))
  53. // {
  54. // JsonData jsonObj = JsonMapper.ToObject(result);
  55. // result += EncryptHelper.AesDecrypt(jsonObj["content"].ToString(), "6v8cr0uyhtwtawda");
  56. // }
  57. // string result = PublicImportDataService.Instance.PospQueryServiceFee();
  58. // result += "\n\n";
  59. // result += PublicImportDataService.Instance.PospQueryFee();
  60. // {"deposit_change_time":"2023-12-26 21:51:04","agent_id":"V1703471325","deposit_list":[{"deposit_id":"LKB_000","deposit_name":"联客宝","supplement_info":"LKB_000"},{"deposit_id":"LKB_99","deposit_name":"联客宝","supplement_info":"LKB_99"},{"deposit_id":"LKB_199","deposit_name":"联客宝","supplement_info":"LKB_199"},{"deposit_id":"LKB_0.63+3","deposit_name":"联客宝","supplement_info":"LKB_0.63+3"},{"deposit_id":"LKB_0.6+0","deposit_name":"联客宝0.6+0","supplement_info":"LKB_0.6+0"},{"deposit_id":"LKB_0.63+0","deposit_name":"联客宝0.63+0","supplement_info":"LKB_0.63+0"},{"deposit_id":"LKB_299","deposit_name":"联客宝299押金","supplement_info":"LKB_299"}]}
  61. // {"plan_change_time":"2023-12-26 21:51:04","agent_id":"V1703471325","plan_list":[{"plan_id":"LKB_000","plan_name":"联客宝","supplement_info":"LKB_000"},{"plan_id":"LKB_99","plan_name":"联客宝","supplement_info":"LKB_99"},{"plan_id":"LKB_199","plan_name":"联客宝","supplement_info":"LKB_199"},{"plan_id":"LKB_0.63+3","plan_name":"联客宝","supplement_info":"LKB_0.63+3"},{"plan_id":"LKB_0.6+0","plan_name":"联客宝0.6+0","supplement_info":"LKB_0.6+0"},{"plan_id":"LKB_0.63+0","plan_name":"联客宝0.63+0","supplement_info":"LKB_0.63+0"},{"plan_id":"LKB_299","plan_name":"联客宝299押金","supplement_info":"LKB_299"}]}
  62. List<string> list = new List<string>();
  63. // list.Add("{\"RecordId\":\"65707\",\"PosId\":\"197929\",\"Fee\": \"0.63\",\"Kind\": \"2\",\"OpMan\": \"系统\"}");
  64. foreach(string sub in list)
  65. {
  66. RedisDbconn.Instance.AddList("SetDepositPostQueue", sub);
  67. }
  68. return "ok";
  69. }
  70. }
  71. }