|
@@ -44,6 +44,8 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
|
|
int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
|
|
|
int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
|
|
int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
|
|
|
string condition = "";
|
|
string condition = "";
|
|
|
|
|
+ var merIds = MerchantInfoUtil.QuerySenedMerchantId();
|
|
|
|
|
+ condition = " and Id in (" + merIds + ")";
|
|
|
if (!string.IsNullOrEmpty(data["SubjectType"].ToString()))
|
|
if (!string.IsNullOrEmpty(data["SubjectType"].ToString()))
|
|
|
{
|
|
{
|
|
|
if (data["SubjectType"].ToString() == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
|
|
if (data["SubjectType"].ToString() == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
|
|
@@ -67,12 +69,11 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
{
|
|
{
|
|
|
if (Status == "0") condition += " and Status=0"; //审核中
|
|
if (Status == "0") condition += " and Status=0"; //审核中
|
|
|
if (Status == "1") condition += " and Status=2 and QueryCount=2"; //已通过
|
|
if (Status == "1") condition += " and Status=2 and QueryCount=2"; //已通过
|
|
|
- if (Status == "-1") condition += " and Status=-1"; //审核失败
|
|
|
|
|
|
|
+ if (Status == "-1") condition += " and Status=-1 and QueryCount=0"; //审核失败
|
|
|
if (Status == "20") condition += " and Status=1"; //微信待签约
|
|
if (Status == "20") condition += " and Status=1"; //微信待签约
|
|
|
if (Status == "21") condition += " and Status=2"; //微信已签约
|
|
if (Status == "21") condition += " and Status=2"; //微信已签约
|
|
|
if (Status == "10") condition += " and QueryCount=1"; //支付宝待签约
|
|
if (Status == "10") condition += " and QueryCount=1"; //支付宝待签约
|
|
|
if (Status == "11") condition += " and QueryCount=2"; //支付宝已签约
|
|
if (Status == "11") condition += " and QueryCount=2"; //支付宝已签约
|
|
|
- condition += "";
|
|
|
|
|
}
|
|
}
|
|
|
List<RelationData> relationData = new List<RelationData>();
|
|
List<RelationData> relationData = new List<RelationData>();
|
|
|
List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
|
|
List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
|
|
@@ -104,19 +105,23 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
//商户状态
|
|
//商户状态
|
|
|
var MerStatus = 0;
|
|
var MerStatus = 0;
|
|
|
// if (status == 0) MerStatus = 0; //审核中
|
|
// if (status == 0) MerStatus = 0; //审核中
|
|
|
- if (status == 2 && queryCount == 2) MerStatus = 1; //已通过
|
|
|
|
|
- if (status == -1) MerStatus = -1; //审核失败
|
|
|
|
|
- if (status == 1) MerStatus = 20; //微信待签约
|
|
|
|
|
- if (status == 2) MerStatus = 21; //微信已签约
|
|
|
|
|
|
|
+ if (status == -1 && queryCount == 0) MerStatus = -1; //审核失败
|
|
|
if (queryCount == 1) MerStatus = 10; //支付宝待签约
|
|
if (queryCount == 1) MerStatus = 10; //支付宝待签约
|
|
|
if (queryCount == 2) MerStatus = 11; //支付宝已签约
|
|
if (queryCount == 2) MerStatus = 11; //支付宝已签约
|
|
|
|
|
+ if (status == 1) MerStatus = 20; //微信待签约
|
|
|
|
|
+ if (status == 2) MerStatus = 21; //微信已签约
|
|
|
|
|
+ if (status == 2 && queryCount == 2) MerStatus = 1; //已通过
|
|
|
curData.Add("Status", MerStatus); //商户状态
|
|
curData.Add("Status", MerStatus); //商户状态
|
|
|
//审核平台
|
|
//审核平台
|
|
|
var AuditInfo = 0;
|
|
var AuditInfo = 0;
|
|
|
- if (status < 0 && queryCount >= 1) AuditInfo = 2;
|
|
|
|
|
- if (status >= 1 && queryCount < 0) AuditInfo = 1;
|
|
|
|
|
|
|
+ if (status < 0 && queryCount >= 1) AuditInfo = 1;
|
|
|
|
|
+ if (status >= 1 && queryCount < 0) AuditInfo = 2;
|
|
|
curData.Add("AuditInfo", AuditInfo); //审核平台(1 支付宝 2 微信)
|
|
curData.Add("AuditInfo", AuditInfo); //审核平台(1 支付宝 2 微信)
|
|
|
|
|
|
|
|
|
|
+ // curData.Add("Status", GetMainStatusName(merchantAddInfo.QueryCount, merchantAddInfo.Status));
|
|
|
|
|
+ // curData.Add("AlipayStatus", merchantAddInfo.QueryCount);
|
|
|
|
|
+ // curData.Add("WeChatStatus", merchantAddInfo.Status);
|
|
|
|
|
+
|
|
|
dataList.Add(curData);
|
|
dataList.Add(curData);
|
|
|
}
|
|
}
|
|
|
Other.Add("Count", count); //总数
|
|
Other.Add("Count", count); //总数
|
|
@@ -145,11 +150,11 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
var info = "";
|
|
var info = "";
|
|
|
if (query.Status == -1)
|
|
if (query.Status == -1)
|
|
|
{
|
|
{
|
|
|
- info += query.WeChatRemark + "\n";
|
|
|
|
|
|
|
+ info += "微信:" + query.WeChatRemark + "\n";
|
|
|
}
|
|
}
|
|
|
if (query.QueryCount == -1)
|
|
if (query.QueryCount == -1)
|
|
|
{
|
|
{
|
|
|
- info += query.AlipayRemark + "\n";
|
|
|
|
|
|
|
+ info += "支付宝:" + query.AlipayRemark + "\n";
|
|
|
}
|
|
}
|
|
|
Obj.Add("Info", info); //失败原因
|
|
Obj.Add("Info", info); //失败原因
|
|
|
|
|
|
|
@@ -193,15 +198,16 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
{
|
|
{
|
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
|
string MerchantId = data["MerchantId"].ToString(); //商户Id
|
|
string MerchantId = data["MerchantId"].ToString(); //商户Id
|
|
|
- var info = MerchantAddInfoUtil.DirectSubmitDo(int.Parse(MerchantId));
|
|
|
|
|
- if (info == "success")
|
|
|
|
|
- {
|
|
|
|
|
- return new AppResultJson() { Status = "1", Info = "成功", Data = info };
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- return new AppResultJson() { Status = "-1", Info = "失败", Data = info };
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // var info = MerchantAddInfoUtil.DirectSubmitDo(int.Parse(MerchantId));
|
|
|
|
|
+ // if (info == "success")
|
|
|
|
|
+ // {
|
|
|
|
|
+ // return new AppResultJson() { Status = "1", Info = "成功", Data = info };
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else
|
|
|
|
|
+ // {
|
|
|
|
|
+ // return new AppResultJson() { Status = "-1", Info = "失败", Data = info };
|
|
|
|
|
+ // }
|
|
|
|
|
+ return new AppResultJson() { Status = "1", Info = "成功" };
|
|
|
}
|
|
}
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
@@ -211,12 +217,13 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
[Authorize]
|
|
[Authorize]
|
|
|
public JsonResult DirectQueryMerchantTradeInfo(string value)
|
|
public JsonResult DirectQueryMerchantTradeInfo(string value)
|
|
|
{
|
|
{
|
|
|
- value = PublicFunction.DesDecrypt(value);
|
|
|
|
|
|
|
+ value = PublicFunction.DesDecrypt(value); ;
|
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
|
- Dictionary<string, object> Obj = DirectQueryMerchantTradeInfoDo(value);
|
|
|
|
|
- return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
|
|
|
|
|
|
|
+ Dictionary<string, object> Other = new Dictionary<string, object>();
|
|
|
|
|
+ List<Dictionary<string, object>> dataList = DirectQueryMerchantTradeInfoDo(value, out Other);
|
|
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList, Other = Other });
|
|
|
}
|
|
}
|
|
|
- private Dictionary<string, object> DirectQueryMerchantTradeInfoDo(string value)
|
|
|
|
|
|
|
+ private List<Dictionary<string, object>> DirectQueryMerchantTradeInfoDo(string value, out Dictionary<string, object> Other)
|
|
|
{
|
|
{
|
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
|
string MerchantName = data["MerchantName"].ToString(); //商户名称
|
|
string MerchantName = data["MerchantName"].ToString(); //商户名称
|
|
@@ -226,12 +233,68 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
string AliPID = data["AliPID"].ToString(); //支付宝PID
|
|
string AliPID = data["AliPID"].ToString(); //支付宝PID
|
|
|
string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
|
|
string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
|
|
|
string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体)
|
|
string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体)
|
|
|
- Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
|
|
- Obj = MerchantAddInfoUtil.DirectQueryMerchantTradeInfoDo(MerchantName, Mobile, MakerCode, MatchNo, AliPID, WeChatNo, SubjectType);
|
|
|
|
|
- return Obj;
|
|
|
|
|
|
|
+ int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
|
|
|
|
|
+ int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
|
|
|
|
|
+ string condition = "";
|
|
|
|
|
+ var merIds = MerchantInfoUtil.QuerySenedMerchantId();
|
|
|
|
|
+ condition = " and Id in (" + merIds + ")";
|
|
|
|
|
+ if (!string.IsNullOrEmpty(MerchantName))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and CertMerchantName='" + MerchantName + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(Mobile))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and MobilePhone='" + Mobile + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(MakerCode))
|
|
|
|
|
+ {
|
|
|
|
|
+ var Ids = MerchantInfoUtil.QueryMerchantIdByMakerCode(MakerCode);
|
|
|
|
|
+ condition += " and Id in (" + Ids + ")";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(AliPID))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and AlipayPid='" + AliPID + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(WeChatNo))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and SubMchid='" + WeChatNo + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(SubjectType))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (SubjectType == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
|
|
|
|
|
+ if (SubjectType == "2") SubjectType = "SUBJECT_TYPE_INDIVIDUAL"; //个体工商户
|
|
|
|
|
+ condition += " and SubjectType='" + SubjectType + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ 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 = MerchantAddInfoService.List(relationData, condition, out count, pageNum, pageSize);
|
|
|
|
|
+ foreach (Dictionary<string, object> subdata in source)
|
|
|
|
|
+ {
|
|
|
|
|
+ Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
|
|
|
+ //商户Id
|
|
|
|
|
+ var MerchantId = int.Parse(subdata["Id"].ToString());
|
|
|
|
|
+ curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
|
|
|
|
|
+ curData.Add("MerchantName", subdata["CertMerchantName"].ToString()); //商户名称
|
|
|
|
|
+ curData.Add("Mobile", subdata["MobilePhone"].ToString()); //手机号码
|
|
|
|
|
+ curData.Add("MakerCode", UsersService.Query(MerchantInfoService.Query(MerchantId).UserId).MakerCode); //所属创客
|
|
|
|
|
+ var subjectType = 0;
|
|
|
|
|
+ if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
|
|
|
|
|
+ if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
|
|
|
|
|
+ curData.Add("AliPID", subdata["AlipayPid"].ToString()); //支付宝PID
|
|
|
|
|
+ curData.Add("WeChatNo", subdata["SubMchid"].ToString()); //微信商户号
|
|
|
|
|
+ curData.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体 3 小微)
|
|
|
|
|
+ curData.Add("MatchNo", subdata["MchtNo"].ToString()); //商户号
|
|
|
|
|
+ curData.Add("OrderCount", ConsumerOrdersService.Count(" and Status>0 and MerchantId=" + MerchantId + "")); //订单总数
|
|
|
|
|
+ curData.Add("InComeAmount", ConsumerOrdersService.Sum(" and Status>0 and MerchantId=" + MerchantId + "", "MerchantActualAmount")); //实收总金额
|
|
|
|
|
+ curData.Add("TradeAmount", ConsumerOrdersService.Sum(" and Status>0 and MerchantId=" + MerchantId + "", "PayMoney")); //营业总金额
|
|
|
|
|
+ dataList.Add(curData);
|
|
|
|
|
+ }
|
|
|
|
|
+ Other.Add("Count", count); //总数
|
|
|
|
|
+ return dataList;
|
|
|
|
|
+ #endregion
|
|
|
}
|
|
}
|
|
|
- #endregion
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 商户管理-直连添加支付宝PID和微信商户号
|
|
#region 商户管理-直连添加支付宝PID和微信商户号
|