MerchantParamSetRecordController.cs 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.Main2;
  11. using MySystem.Service.Main2;
  12. using LitJson;
  13. using Library;
  14. namespace MySystem.Areas.Api.Controllers.v1.Main2
  15. {
  16. [Area("Api")]
  17. [Route("/v1/QrCodePlateMain/[controller]/[action]")]
  18. public class MerchantParamSetRecordController : BaseController
  19. {
  20. public MerchantParamSetRecordController(IHttpContextAccessor accessor) : base(accessor)
  21. {
  22. }
  23. #region 商户管理-商户管理-直连商户活动变更记录
  24. [Authorize]
  25. public JsonResult DirectMerchantParamSetRecordList(string value)
  26. {
  27. value = PublicFunction.DesDecrypt(value); ;
  28. JsonData data = JsonMapper.ToObject(value);
  29. List<Dictionary<string, object>> dataList = DirectMerchantParamSetRecordListDo(value);
  30. return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  31. }
  32. private List<Dictionary<string, object>> DirectMerchantParamSetRecordListDo(string value)
  33. {
  34. JsonData data = JsonMapper.ToObject(value);
  35. string MerchantId = data["MerchantId"].ToString(); //商户Id
  36. int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
  37. int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
  38. string condition = "";
  39. List<RelationData> relationData = new List<RelationData>();
  40. List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  41. List<Dictionary<string, object>> source = MerchantParamSetRecordService.List(relationData, condition, pageNum, pageSize);
  42. foreach (Dictionary<string, object> subdata in source)
  43. {
  44. Dictionary<string, object> curData = new Dictionary<string, object>();
  45. //商户Id
  46. var Id = int.Parse(subdata["MerchantId"].ToString());
  47. curData.Add("Id", int.Parse(subdata["Id"].ToString())); //变更记录Id
  48. curData.Add("Status", int.Parse(subdata["Status"].ToString())); //活动状态(1 使用中 -1 已失效 0 已关闭)
  49. // var merAddInfo = MerchantAddInfoService.Query(Id);
  50. curData.Add("MerchantName", MerchantAddInfoService.Query(Id).CertMerchantName); //商户名称
  51. curData.Add("CreateDate", subdata["AfterCreateDate"].ToString() == "" ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //最后操作时间
  52. curData.Add("GetPercent", subdata["AfterGetPercent"].ToString()); //实收比例
  53. curData.Add("DiviPersons", subdata["AfterDiviPersons"].ToString()); //分红人数
  54. curData.Add("ProfitDays", subdata["AfterProfitDays"].ToString()); //分红天数
  55. curData.Add("MinPayMoney", subdata["AfterMinPayMoney"].ToString()); //参与门槛
  56. curData.Add("DiviPercent", subdata["AfterDiviPercent"].ToString()); //最大分红比例
  57. dataList.Add(curData);
  58. }
  59. return dataList;
  60. }
  61. #endregion
  62. }
  63. }