using MySystem.Models.Main;
using Library;
using MySystem.Service.Main;
using System.Collections.Generic;
using System;
using LitJson;
namespace MySystem
{
///
/// 我的工具类
///
public class MySelfUtil
{
#region 到账记录列表
///
/// 到账记录列表
///
/// 查询条件
/// 条数
/// 页数
///
public static List> CardInComeRecordList(int MerchantId, string TradeMonth, string pageSize, string pageNum)
{
DateTime start = new DateTime(int.Parse(TradeMonth.Substring(0, 4)), int.Parse(TradeMonth.Substring(TradeMonth.Length - 2, 2)), 1);
DateTime end = start.AddMonths(1).AddDays(-1);
var merchantInfo = MerchantAddInfoService.Query(MerchantId);
JsonData Info = JsonMapper.ToObject(HaoDaHelper.Instance.CardInComeRecord(merchantInfo.OutMchtNo, start.ToString("yyyy-MM-dd"), end.ToString("yyyy-MM-dd"), merchantInfo.MchtNo, "", "", pageNum, pageSize));
List> dataList = new List>();
if (Info["resultCode"].ToString() == "1")
{
var list = Info["list"];
for (int i = 0; i < list.Count; i++)
{
Dictionary curData = new Dictionary();
var item = list[i];
curData.Add("Id", item["id"].ToString()); //订单Id
curData.Add("SettleStatus", item["settleStatus"].ToString()); //结算状态(0:未结算;1:结算中;2:已结算)
curData.Add("SettleDate", item["settleDate"].ToString().Substring(item["settleDate"].ToString().Length - 5, 5)); //结算日期
curData.Add("SettleAmount", "+" + item["settleAmount"].ToString()); //结算金额
curData.Add("TradeMchtName", item["tradeMchtName"].ToString()); //收单商户名称
curData.Add("BankName", item["bankName"].ToString()); //开户行名称
curData.Add("BankLogo", item["bankLogo"].ToString()); //银行卡logo
dataList.Add(curData);
}
}
return dataList;
}
#endregion
#region 到账记录详情
///
/// 到账记录详情
///
/// 查询条件
/// 条数
/// 页数
///
public static Dictionary CardInComeRecordDetail(int MerchantId, string OrderId)
{
var merchantInfo = MerchantAddInfoService.Query(MerchantId);
JsonData Info = JsonMapper.ToObject(HaoDaHelper.Instance.CardInComeDetail(merchantInfo.OutMchtNo, OrderId));
Dictionary obj = new Dictionary();
if (Info["code"].ToString() == "1")
{
obj.Add("Id", Info["data"]["id"].ToString()); //订单Id
obj.Add("SettleStatus", Info["data"]["settleStatus"].ToString()); //结算状态(0:未结算;1:结算中;2:已结算)
obj.Add("SettleType", Info["data"]["settleType"].ToString()); //结算周期
obj.Add("SettleDate", Info["data"]["settleDate"].ToString().Substring(Info["data"]["settleDate"].ToString().Length - 5, 5)); //结算日期
obj.Add("ClearTime", Info["data"]["clearTime"].ToString().Substring(Info["data"]["clearTime"].ToString().Length - 5, 5)); //出款受理时间
obj.Add("RemitTime", Info["data"]["remitTime"].ToString().Substring(Info["data"]["remitTime"].ToString().Length - 5, 5)); //出款成功时间
obj.Add("SettleAmount", "+" + Info["data"]["settleAmount"].ToString()); //结算金额
obj.Add("TradeMchtName", Info["data"]["tradeMchtName"].ToString()); //收单商户名称
obj.Add("BankName", Info["data"]["bankName"].ToString() + Info["data"]["cardNo"].ToString().Substring(Info["data"]["cardNo"].ToString().Length - 4, 4)); //开户行名称
obj.Add("BankLogo", Info["data"]["bankLogo"].ToString()); //银行卡logo
}
return obj;
}
#endregion
#region 我的-设置-修改登录手机号(新手机验证)
///
/// 我的-设置-修改登录手机号(新手机验证)
///
/// 原手机号
/// 新手机号
///
public static string ChangeLoginMobile(string LoginMobile, string Mobile)
{
var info = MerchantLoginInfoService.Query(" and LoginMobile=" + LoginMobile + "");
if (info.Id > 0)
{
Dictionary obj = new Dictionary();
obj.Add("LoginMobile", Mobile);
MerchantLoginInfoService.Edit(obj, info.Id);
}
return "修改成功";
}
#endregion
}
}