| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- 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 MerchantDepositOrderController : BaseController
- {
- public MerchantDepositOrderController(IHttpContextAccessor accessor) : base(accessor)
- {
- }
- #region 商户激活-直连激活商户记录
- [Authorize]
- public JsonResult DirectActRecord(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- Dictionary<string, object> Other = new Dictionary<string, object>();
- List<Dictionary<string, object>> dataList = DirectActRecordDo(value, out Other);
- return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList, Other = Other });
- }
- private List<Dictionary<string, object>> DirectActRecordDo(string value, out Dictionary<string, object> Other)
- {
- JsonData data = JsonMapper.ToObject(value);
- string MerchantName = data["MerchantName"].ToString(); //商户名称
- string AliPID = data["AliPID"].ToString(); //支付宝PID
- string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
- string UpdateDate = data["UpdateDate"].ToString(); //激活时间
- string PayMode = data["PayMode"].ToString(); //支付方式(1 支付宝 2 微信)
- int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
- int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
- string condition = "";
- if (!string.IsNullOrEmpty(MerchantName))
- {
- var query = MerchantAddInfoService.Query(" and CertMerchantName='" + MerchantName + "'");
- condition += " and MerchantId='" + query.Id + "'";
- }
- if (!string.IsNullOrEmpty(AliPID))
- {
- condition += " and AlipayPid='" + AliPID + "'";
- }
- if (!string.IsNullOrEmpty(WeChatNo))
- {
- condition += " and SubMchid='" + WeChatNo + "'";
- }
- if (!string.IsNullOrEmpty(data["UpdateDate"].ToString()))
- {
- string[] datelist = UpdateDate.Split(new string[] { " - " }, StringSplitOptions.None);
- string start = datelist[0];
- string end = datelist[1];
- condition += " and UpdateDate>='" + start + " 00:00:00' and UpdateDate<='" + end + " 23:59:59'";
- }
- if (!string.IsNullOrEmpty(data["PayMode"].ToString()))
- {
- condition += " and Sort='" + PayMode + "'";
- }
- List<RelationData> relationData = new List<RelationData>();
- List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
- Other = new Dictionary<string, object>();
- int count = 0;
- List<Dictionary<string, object>> source = MerchantDepositOrderService.List(relationData, condition, out count, pageNum, pageSize);
- foreach (Dictionary<string, object> subdata in source)
- {
- Dictionary<string, object> curData = new Dictionary<string, object>();
- var query = MerchantAddInfoService.Query(int.Parse(subdata["MerchantId"].ToString()));
- curData.Add("Id", subdata["Id"].ToString()); //Id
- curData.Add("MerchantName", query.CertMerchantName); //交易商户
- curData.Add("AliPID", query.AlipayPid); //支付宝PID
- curData.Add("WeChatNo", query.SubMchid); //微信商户号
- curData.Add("UpdateDate", subdata["UpdateDate"].ToString() == null ? "" : DateTime.Parse(subdata["UpdateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //激活时间
- curData.Add("PayMode", int.Parse(subdata["Sort"].ToString())); //支付方式(1 支付宝 2 微信)
- curData.Add("ActPayPrice", decimal.Parse(subdata["ActPayPrice"].ToString())); //支付金额
- dataList.Add(curData);
- }
- return dataList;
- }
- #endregion
- }
- }
|