| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.AspNetCore.Http;
- using Microsoft.Extensions.Logging;
- using Microsoft.Extensions.Options;
- using Microsoft.AspNetCore.Authorization;
- using System.Web;
- using MySystem.Models.Main1;
- using MySystem.Service.Main1;
- using LitJson;
- using Library;
- namespace MySystem.Areas.Api.Controllers.v1.Main1
- {
- [Area("Api")]
- [Route("/v1/QrCodePlateMain/[controller]/[action]")]
- public class MerchantDepositBackController : BaseController
- {
- public MerchantDepositBackController(IHttpContextAccessor accessor) : base(accessor)
- {
- }
- #region 商户激活-直连商户服务费退还结果导入
- [Authorize]
- public JsonResult DirectBatchImport(string value)
- {
- value = PublicFunction.DesDecrypt(value); ;
- JsonData data = JsonMapper.ToObject(value);
- AppResultJson result = DirectBatchImportDo(value);
- return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
- }
- private AppResultJson DirectBatchImportDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string OrderNo = data["OrderNo"].ToString(); //订单号
- string Status = data["Status"].ToString(); //结果(1 成功 2 失败)
- string Remark = data["Remark"].ToString(); //备注
- Dictionary<string, object> Obj = new Dictionary<string, object>();
- MerchantDepositBack query = new MerchantDepositBack();
- int Id = int.Parse(function.CheckInt(data["id"].ToString()));
- Dictionary<string, object> fields = new Dictionary<string, object>();
- MerchantDepositBackService.Edit(fields, Id, false);
- return new AppResultJson() { Status = "1", Info = "", Data = Obj };
- }
- #endregion
- #region 商户激活-直连批量导出
- [Authorize]
- public JsonResult DirectBatchExport(string value)
- {
- value = PublicFunction.DesDecrypt(value); ;
- JsonData data = JsonMapper.ToObject(value);
- AppResultJson result = DirectBatchExportDo(value);
- return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
- }
- private AppResultJson DirectBatchExportDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string Id = data["Id"].ToString(); //记录Id(多个Id用数组传参)
- Dictionary<string, object> Obj = new Dictionary<string, object>();
- MerchantDepositBack query = new MerchantDepositBack();
- Dictionary<string, object> fields = new Dictionary<string, object>();
- // MerchantDepositBackService.Edit(fields, Id, false);
- return new AppResultJson() { Status = "1", Info = "", Data = Obj };
- }
- #endregion
- #region 商户激活-直连达标商户服务费退还记录
- [Authorize]
- public JsonResult DirectMerchantDepositBack(string value)
- {
- value = PublicFunction.DesDecrypt(value); ;
- JsonData data = JsonMapper.ToObject(value);
- List<Dictionary<string, object>> dataList = DirectMerchantDepositBackDo(value);
- return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
- }
- private List<Dictionary<string, object>> DirectMerchantDepositBackDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string MerchantName = data["MerchantName"].ToString(); //商户名称
- string MctNo = data["MctNo"].ToString(); //商户号
- string CreateDate = data["CreateDate"].ToString(); //申请时间
- string ReturnWay = data["ReturnWay"].ToString(); //退还方式
- string AlipayAccountNo = data["AlipayAccountNo"].ToString(); //支付宝账号
- string BankCardNo = data["BankCardNo"].ToString(); //银行卡号
- string Status = data["Status"].ToString(); //状态(0 待处理 1 成功 2 失败 99 处理中)
- int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
- int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
- string condition = "";
- List<RelationData> relationData = new List<RelationData>();
- List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
- List<Dictionary<string, object>> source = MerchantDepositBackService.List(relationData, condition, pageNum, pageSize);
- foreach (Dictionary<string, object> subdata in source)
- {
- Dictionary<string, object> curData = new Dictionary<string, object>();
- curData.Add("", subdata[""].ToString()); //
- curData.Add("MerchantName", ""); //商户名称
- curData.Add("MctNo", ""); //商户号
- curData.Add("CreateDate", ""); //申请时间
- curData.Add("ReturnWay", ""); //退还方式
- curData.Add("AlipayAccountNo", ""); //支付宝账号
- curData.Add("BankCardNo", ""); //银行卡号
- curData.Add("Status", ""); //状态(0 待处理 1 成功 2 失败 99 处理中)
- dataList.Add(curData);
- }
- return dataList;
- }
- #endregion
- }
- }
|