MerchantDepositBackController.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Microsoft.AspNetCore.Mvc;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.Extensions.Logging;
  7. using Microsoft.Extensions.Options;
  8. using Microsoft.AspNetCore.Authorization;
  9. using System.Web;
  10. using MySystem.Models.Main1;
  11. using MySystem.Service.Main1;
  12. using LitJson;
  13. using Library;
  14. namespace MySystem.Areas.Api.Controllers.v1.Main1
  15. {
  16. [Area("Api")]
  17. [Route("/v1/QrCodePlateMain/[controller]/[action]")]
  18. public class MerchantDepositBackController : BaseController
  19. {
  20. public MerchantDepositBackController(IHttpContextAccessor accessor) : base(accessor)
  21. {
  22. }
  23. #region 商户激活-直连商户服务费退还结果导入
  24. [Authorize]
  25. public JsonResult DirectBatchImport(string value)
  26. {
  27. value = PublicFunction.DesDecrypt(value); ;
  28. JsonData data = JsonMapper.ToObject(value);
  29. AppResultJson result = DirectBatchImportDo(value);
  30. return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
  31. }
  32. private AppResultJson DirectBatchImportDo(string value)
  33. {
  34. JsonData data = JsonMapper.ToObject(value);
  35. string OrderNo = data["OrderNo"].ToString(); //订单号
  36. string Status = data["Status"].ToString(); //结果(1 成功 2 失败)
  37. string Remark = data["Remark"].ToString(); //备注
  38. Dictionary<string, object> Obj = new Dictionary<string, object>();
  39. MerchantDepositBack query = new MerchantDepositBack();
  40. int Id = int.Parse(function.CheckInt(data["id"].ToString()));
  41. Dictionary<string, object> fields = new Dictionary<string, object>();
  42. MerchantDepositBackService.Edit(fields, Id, false);
  43. return new AppResultJson() { Status = "1", Info = "", Data = Obj };
  44. }
  45. #endregion
  46. #region 商户激活-直连批量导出
  47. [Authorize]
  48. public JsonResult DirectBatchExport(string value)
  49. {
  50. value = PublicFunction.DesDecrypt(value); ;
  51. JsonData data = JsonMapper.ToObject(value);
  52. AppResultJson result = DirectBatchExportDo(value);
  53. return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
  54. }
  55. private AppResultJson DirectBatchExportDo(string value)
  56. {
  57. JsonData data = JsonMapper.ToObject(value);
  58. string Id = data["Id"].ToString(); //记录Id(多个Id用数组传参)
  59. Dictionary<string, object> Obj = new Dictionary<string, object>();
  60. MerchantDepositBack query = new MerchantDepositBack();
  61. Dictionary<string, object> fields = new Dictionary<string, object>();
  62. // MerchantDepositBackService.Edit(fields, Id, false);
  63. return new AppResultJson() { Status = "1", Info = "", Data = Obj };
  64. }
  65. #endregion
  66. #region 商户激活-直连达标商户服务费退还记录
  67. [Authorize]
  68. public JsonResult DirectMerchantDepositBack(string value)
  69. {
  70. value = PublicFunction.DesDecrypt(value); ;
  71. JsonData data = JsonMapper.ToObject(value);
  72. List<Dictionary<string, object>> dataList = DirectMerchantDepositBackDo(value);
  73. return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  74. }
  75. private List<Dictionary<string, object>> DirectMerchantDepositBackDo(string value)
  76. {
  77. JsonData data = JsonMapper.ToObject(value);
  78. string MerchantName = data["MerchantName"].ToString(); //商户名称
  79. string MctNo = data["MctNo"].ToString(); //商户号
  80. string CreateDate = data["CreateDate"].ToString(); //申请时间
  81. string ReturnWay = data["ReturnWay"].ToString(); //退还方式
  82. string AlipayAccountNo = data["AlipayAccountNo"].ToString(); //支付宝账号
  83. string BankCardNo = data["BankCardNo"].ToString(); //银行卡号
  84. string Status = data["Status"].ToString(); //状态(0 待处理 1 成功 2 失败 99 处理中)
  85. int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
  86. int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
  87. string condition = "";
  88. List<RelationData> relationData = new List<RelationData>();
  89. List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  90. List<Dictionary<string, object>> source = MerchantDepositBackService.List(relationData, condition, pageNum, pageSize);
  91. foreach (Dictionary<string, object> subdata in source)
  92. {
  93. Dictionary<string, object> curData = new Dictionary<string, object>();
  94. curData.Add("", subdata[""].ToString()); //
  95. curData.Add("MerchantName", ""); //商户名称
  96. curData.Add("MctNo", ""); //商户号
  97. curData.Add("CreateDate", ""); //申请时间
  98. curData.Add("ReturnWay", ""); //退还方式
  99. curData.Add("AlipayAccountNo", ""); //支付宝账号
  100. curData.Add("BankCardNo", ""); //银行卡号
  101. curData.Add("Status", ""); //状态(0 待处理 1 成功 2 失败 99 处理中)
  102. dataList.Add(curData);
  103. }
  104. return dataList;
  105. }
  106. #endregion
  107. }
  108. }