|
@@ -40,7 +40,8 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
string CertMerchantName = data["CertMerchantName"].ToString(); //商户名称
|
|
string CertMerchantName = data["CertMerchantName"].ToString(); //商户名称
|
|
|
string ServicePhone = data["ServicePhone"].ToString(); //客服电话
|
|
string ServicePhone = data["ServicePhone"].ToString(); //客服电话
|
|
|
string MakerCode = data["MakerCode"].ToString(); //所属创客编号
|
|
string MakerCode = data["MakerCode"].ToString(); //所属创客编号
|
|
|
- string Status = data["Status"].ToString(); //商户状态(0 审核中 1 已通过 -1 审核失败 20 微信待签约 21 微信已签约 10 支付宝待签约 11 支付宝已签约)
|
|
|
|
|
|
|
+ string WeChatStatus = data["WeChatStatus"].ToString(); //微信状态(-1 审核失败 0 待审核 1 待签约 2 已通过)
|
|
|
|
|
+ string AliPayStatus = data["AliPayStatus"].ToString(); //支付宝状态(-1 审核失败 0 待审核 1 待签约 2 已通过)
|
|
|
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 = "";
|
|
@@ -65,12 +66,13 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
var Ids = MerchantInfoUtil.QueryMerchantIdByMakerCode(MakerCode);
|
|
var Ids = MerchantInfoUtil.QueryMerchantIdByMakerCode(MakerCode);
|
|
|
condition += " and Id in (" + Ids + ")";
|
|
condition += " and Id in (" + Ids + ")";
|
|
|
}
|
|
}
|
|
|
- if (!string.IsNullOrEmpty(data["Status"].ToString()))
|
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(data["WeChatStatus"].ToString()))
|
|
|
{
|
|
{
|
|
|
- if (Status == "0") condition += " and Status=0 and QueryCount=0"; //待审核
|
|
|
|
|
- if (Status == "-1") condition += " and (Status=-1 or QueryCount=-1)"; //审核失败
|
|
|
|
|
- if (Status == "1") condition += " and (Status=1 or QueryCount=1)"; //待签约
|
|
|
|
|
- if (Status == "2") condition += " and Status=2 and QueryCount=2"; //已通过
|
|
|
|
|
|
|
+ condition += " and Status=" + WeChatStatus + "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(data["AliPayStatus"].ToString()))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and QueryCount=" + AliPayStatus + "";
|
|
|
}
|
|
}
|
|
|
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>>();
|
|
@@ -98,20 +100,8 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
curData.Add("CreateDate", subdata["CreateDate"].ToString() == null ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //进件时间
|
|
curData.Add("CreateDate", subdata["CreateDate"].ToString() == null ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //进件时间
|
|
|
var userInfo = UsersService.Query(MerchantInfoService.Query(MerchantId).UserId);
|
|
var userInfo = UsersService.Query(MerchantInfoService.Query(MerchantId).UserId);
|
|
|
curData.Add("MakerCode", userInfo.MakerCode); //所属创客编号
|
|
curData.Add("MakerCode", userInfo.MakerCode); //所属创客编号
|
|
|
- curData.Add("RealName", userInfo.RealName); //所属创客姓名
|
|
|
|
|
- //商户状态
|
|
|
|
|
- var MerStatus = 0;
|
|
|
|
|
- if (status == 0 && queryCount == 0) MerStatus = 0; //待审核
|
|
|
|
|
- if (status == -1 || queryCount == -1) MerStatus = -1; //审核失败
|
|
|
|
|
- if (status == 1 || queryCount == 1) MerStatus = 1; //待签约
|
|
|
|
|
- if (status == 2 && queryCount == 2) MerStatus = 1; //已通过
|
|
|
|
|
- curData.Add("Status", MerStatus); //商户状态
|
|
|
|
|
- //审核平台
|
|
|
|
|
- var AuditInfo = 1;
|
|
|
|
|
- if (status == -1 && queryCount >= 1) AuditInfo = 2;
|
|
|
|
|
- if (status >= 1 && queryCount == -1) AuditInfo = 1;
|
|
|
|
|
- curData.Add("AuditInfo", AuditInfo); //审核平台(1 支付宝 2 微信)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ curData.Add("WeChatStatus", status); //微信状态(-1 审核失败 0 待审核 1 待签约 2 已通过)
|
|
|
|
|
+ curData.Add("AliPayStatus", queryCount); //支付宝状态(-1 审核失败 0 待审核 1 待签约 2 已通过)
|
|
|
dataList.Add(curData);
|
|
dataList.Add(curData);
|
|
|
}
|
|
}
|
|
|
Other.Add("Count", count); //总数
|
|
Other.Add("Count", count); //总数
|
|
@@ -135,18 +125,10 @@ 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
|
|
|
Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
- MerchantAddInfo query = new MerchantAddInfo();
|
|
|
|
|
- query = MerchantAddInfoService.Query(int.Parse(MerchantId));
|
|
|
|
|
- var info = "";
|
|
|
|
|
- if (query.Status == -1)
|
|
|
|
|
- {
|
|
|
|
|
- info += "微信:" + query.WeChatRemark + "\n";
|
|
|
|
|
- }
|
|
|
|
|
- if (query.QueryCount == -1)
|
|
|
|
|
- {
|
|
|
|
|
- info += "支付宝:" + query.AlipayRemark + "\n";
|
|
|
|
|
- }
|
|
|
|
|
- Obj.Add("Info", info); //失败原因
|
|
|
|
|
|
|
+ var query = MerchantAddInfoService.Query(int.Parse(MerchantId));
|
|
|
|
|
+ Obj.Add("HdReason", query.WeChatRemark); //好哒原因
|
|
|
|
|
+ Obj.Add("WeChatReason", query.WeChatRemark); //微信原因
|
|
|
|
|
+ Obj.Add("AlipayReason", query.AlipayRemark); //支付宝原因
|
|
|
|
|
|
|
|
return Obj;
|
|
return Obj;
|
|
|
}
|
|
}
|
|
@@ -218,7 +200,6 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
string MerchantName = data["MerchantName"].ToString(); //商户名称
|
|
string MerchantName = data["MerchantName"].ToString(); //商户名称
|
|
|
string Mobile = data["Mobile"].ToString(); //手机号码
|
|
string Mobile = data["Mobile"].ToString(); //手机号码
|
|
|
string MakerCode = data["MakerCode"].ToString(); //所属创客
|
|
string MakerCode = data["MakerCode"].ToString(); //所属创客
|
|
|
- string MatchNo = data["MatchNo"].ToString(); //商户号
|
|
|
|
|
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 个体)
|
|
@@ -264,20 +245,23 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
|
|
|
Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
|
//商户Id
|
|
//商户Id
|
|
|
var MerchantId = int.Parse(subdata["Id"].ToString());
|
|
var MerchantId = int.Parse(subdata["Id"].ToString());
|
|
|
|
|
+ var userInfo = UsersService.Query(MerchantInfoService.Query(MerchantId).UserId);
|
|
|
curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
|
|
curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
|
|
|
curData.Add("MerchantName", subdata["CertMerchantName"].ToString()); //商户名称
|
|
curData.Add("MerchantName", subdata["CertMerchantName"].ToString()); //商户名称
|
|
|
curData.Add("Mobile", subdata["MobilePhone"].ToString()); //手机号码
|
|
curData.Add("Mobile", subdata["MobilePhone"].ToString()); //手机号码
|
|
|
- curData.Add("MakerCode", UsersService.Query(MerchantInfoService.Query(MerchantId).UserId).MakerCode); //所属创客
|
|
|
|
|
|
|
+ curData.Add("MakerCode", userInfo.MakerCode); //所属创客
|
|
|
|
|
+ curData.Add("RealName", userInfo.RealName); //所属创客姓名
|
|
|
var subjectType = 0;
|
|
var subjectType = 0;
|
|
|
if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
|
|
if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
|
|
|
if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
|
|
if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
|
|
|
curData.Add("AliPID", subdata["AlipayPid"].ToString()); //支付宝PID
|
|
curData.Add("AliPID", subdata["AlipayPid"].ToString()); //支付宝PID
|
|
|
|
|
+ curData.Add("AliPayToken", subdata["AlipayAuthToken"].ToString()); //支付宝token
|
|
|
curData.Add("WeChatNo", subdata["SubMchid"].ToString()); //微信商户号
|
|
curData.Add("WeChatNo", subdata["SubMchid"].ToString()); //微信商户号
|
|
|
curData.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体 3 小微)
|
|
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")); //营业总金额
|
|
|
|
|
|
|
+ var amountInfo = MerchantAmountSummayService.Sum("TradeCount,TotalActual,TradeAmount", " and MerchantId=" + MerchantId + "");
|
|
|
|
|
+ curData.Add("OrderCount", decimal.Parse(amountInfo["TradeCount"].ToString())); //订单总数
|
|
|
|
|
+ curData.Add("InComeAmount", decimal.Parse(amountInfo["TotalActual"].ToString()).ToString("f2")); //实收总金额
|
|
|
|
|
+ curData.Add("TradeAmount", decimal.Parse(amountInfo["TradeAmount"].ToString()).ToString("f2")); //营业总金额
|
|
|
dataList.Add(curData);
|
|
dataList.Add(curData);
|
|
|
}
|
|
}
|
|
|
Other.Add("Count", count); //总数
|
|
Other.Add("Count", count); //总数
|
|
@@ -300,22 +284,27 @@ 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
|
|
|
string AliPPID = data["AliPPID"].ToString(); //支付宝PID
|
|
string AliPPID = data["AliPPID"].ToString(); //支付宝PID
|
|
|
|
|
+ string AliPayToken = data["AliPayToken"].ToString(); //支付宝token
|
|
|
string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
|
|
string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
|
|
|
Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
var query = MerchantAddInfoService.Query(int.Parse(MerchantId));
|
|
var query = MerchantAddInfoService.Query(int.Parse(MerchantId));
|
|
|
Dictionary<string, object> fields = new Dictionary<string, object>();
|
|
Dictionary<string, object> fields = new Dictionary<string, object>();
|
|
|
if (query.Id > 0)
|
|
if (query.Id > 0)
|
|
|
{
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(query.AlipayPid))
|
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(query.AlipayPid))
|
|
|
{
|
|
{
|
|
|
fields.Add("AlipayPid", AliPPID); //支付宝PID
|
|
fields.Add("AlipayPid", AliPPID); //支付宝PID
|
|
|
}
|
|
}
|
|
|
- if (!string.IsNullOrEmpty(query.SubMchid))
|
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(AliPayToken))
|
|
|
|
|
+ {
|
|
|
|
|
+ fields.Add("AlipayAuthToken", AliPayToken); //支付宝token
|
|
|
|
|
+ }
|
|
|
|
|
+ if (string.IsNullOrEmpty(query.SubMchid))
|
|
|
{
|
|
{
|
|
|
fields.Add("SubMchid", WeChatNo); //微信商户号
|
|
fields.Add("SubMchid", WeChatNo); //微信商户号
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- AppResultJson resultJson = MerchantAddInfoService.Edit(fields, int.Parse(MerchantId));
|
|
|
|
|
|
|
+ AppResultJson resultJson = MerchantAddInfoService.Edit(fields, int.Parse(MerchantId), false);
|
|
|
|
|
|
|
|
return new AppResultJson() { Status = "1", Info = "添加成功", Data = Obj };
|
|
return new AppResultJson() { Status = "1", Info = "添加成功", Data = Obj };
|
|
|
}
|
|
}
|