|
@@ -210,7 +210,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
|
|
|
[Authorize]
|
|
[Authorize]
|
|
|
public JsonResult UnionPayQueryMerchantTradeInfo(string value)
|
|
public JsonResult UnionPayQueryMerchantTradeInfo(string value)
|
|
|
{
|
|
{
|
|
|
- value = PublicFunction.DesDecrypt(value); ;
|
|
|
|
|
|
|
+ value = PublicFunction.DesDecrypt(value);
|
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
|
Dictionary<string, object> Other = new Dictionary<string, object>();
|
|
Dictionary<string, object> Other = new Dictionary<string, object>();
|
|
|
List<Dictionary<string, object>> dataList = UnionPayQueryMerchantTradeInfoDo(value, out Other);
|
|
List<Dictionary<string, object>> dataList = UnionPayQueryMerchantTradeInfoDo(value, out Other);
|
|
@@ -225,6 +225,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
|
|
|
string MatchNo = data["MatchNo"].ToString(); //商户号
|
|
string MatchNo = data["MatchNo"].ToString(); //商户号
|
|
|
string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体 3 小微)
|
|
string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体 3 小微)
|
|
|
string IsAct = data["IsAct"].ToString(); //激活状态(0 未激活 1 已激活)
|
|
string IsAct = data["IsAct"].ToString(); //激活状态(0 未激活 1 已激活)
|
|
|
|
|
+ string ActDate = data["ActDate"].ToString(); //激活时间
|
|
|
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 = "";
|
|
@@ -259,6 +260,14 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
|
|
|
var Ids = MerchantInfoUtil.QueryIsActMerchantId(int.Parse(IsAct));
|
|
var Ids = MerchantInfoUtil.QueryIsActMerchantId(int.Parse(IsAct));
|
|
|
condition += " and Id in (" + Ids + ")";
|
|
condition += " and Id in (" + Ids + ")";
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!string.IsNullOrEmpty(data["ActDate"].ToString()))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = ActDate.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ string start = datelist[0];
|
|
|
|
|
+ string end = datelist[1];
|
|
|
|
|
+ var Ids = MerchantInfoUtil.QueryActDateMerchantId(start, end);
|
|
|
|
|
+ condition += " and Id in (" + Ids + ")";
|
|
|
|
|
+ }
|
|
|
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>>();
|
|
|
Other = new Dictionary<string, object>();
|
|
Other = new Dictionary<string, object>();
|
|
@@ -273,6 +282,13 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
|
|
|
var userInfo = UsersService.Query(merInfo.UserId);
|
|
var userInfo = UsersService.Query(merInfo.UserId);
|
|
|
curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
|
|
curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
|
|
|
curData.Add("IsAct", merInfo.IsAct); //激活状态(0 未激活 1 已激活)
|
|
curData.Add("IsAct", merInfo.IsAct); //激活状态(0 未激活 1 已激活)
|
|
|
|
|
+ var actDate = "";
|
|
|
|
|
+ var order = MerchantDepositOrderService.Query(" and Status>0 and MerchantId=" + MerchantId + "");
|
|
|
|
|
+ if (order.Id > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ actDate = order.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ }
|
|
|
|
|
+ curData.Add("ActDate", actDate); //激活时间
|
|
|
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", userInfo.MakerCode); //所属创客
|
|
curData.Add("MakerCode", userInfo.MakerCode); //所属创客
|
|
@@ -295,9 +311,6 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
#region 节点操作-银联提交微信开户意愿
|
|
#region 节点操作-银联提交微信开户意愿
|
|
|
[Authorize]
|
|
[Authorize]
|
|
|
public JsonResult UnionWeChatMerchantOpenAccount(string value)
|
|
public JsonResult UnionWeChatMerchantOpenAccount(string value)
|
|
@@ -454,5 +467,190 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ #region 进件管理-银联修改商户名称
|
|
|
|
|
+ [Authorize]
|
|
|
|
|
+ public JsonResult UnionPayEditMerchantName(string value)
|
|
|
|
|
+ {
|
|
|
|
|
+ value = PublicFunction.DesDecrypt(value);
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
|
|
+ AppResultJson result = UnionPayEditMerchantNameDo(value);
|
|
|
|
|
+ return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
|
|
|
|
|
+ }
|
|
|
|
|
+ private AppResultJson UnionPayEditMerchantNameDo(string value)
|
|
|
|
|
+ {
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
|
|
+ string MerchantId = data["MerchantId"].ToString(); //商户Id
|
|
|
|
|
+ string MerchantName = data["MerchantName"].ToString(); //新商户名称
|
|
|
|
|
+ string MerchantShortName = data["MerchantShortName"].ToString(); //新商户简称
|
|
|
|
|
+ Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
|
|
+ var Id = int.Parse(MerchantId);
|
|
|
|
|
+ var query = main2db.MerchantAddInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantAddInfo();
|
|
|
|
|
+ var merInfo = main2db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
|
|
|
|
|
+ if (query.Id > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!string.IsNullOrEmpty(MerchantName))
|
|
|
|
|
+ {
|
|
|
|
|
+ query.CertMerchantName = MerchantName;
|
|
|
|
|
+ merInfo.Name = MerchantName;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(MerchantShortName))
|
|
|
|
|
+ {
|
|
|
|
|
+ query.MerchantShortname = MerchantShortName;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ main2db.SaveChanges();
|
|
|
|
|
+
|
|
|
|
|
+ return new AppResultJson() { Status = "1", Info = "", Data = Obj };
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ #region 商户管理-银联查询商户交易信息导出
|
|
|
|
|
+ [Authorize]
|
|
|
|
|
+ public JsonResult ExportUnionPayQueryMerchantTradeInfo(string value)
|
|
|
|
|
+ {
|
|
|
|
|
+ value = PublicFunction.DesDecrypt(value);
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
|
|
+ AppResultJson result = ExportUnionPayQueryMerchantTradeInfoDo(value);
|
|
|
|
|
+ return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
|
|
|
|
|
+ }
|
|
|
|
|
+ private AppResultJson ExportUnionPayQueryMerchantTradeInfoDo(string value)
|
|
|
|
|
+ {
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
|
|
+ string MerchantName = data["MerchantName"].ToString(); //商户名称
|
|
|
|
|
+ string Mobile = data["Mobile"].ToString(); //手机号码
|
|
|
|
|
+ string MakerCode = data["MakerCode"].ToString(); //所属创客
|
|
|
|
|
+ string MatchNo = data["MatchNo"].ToString(); //商户号
|
|
|
|
|
+ string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体 3 小微)
|
|
|
|
|
+ string IsAct = data["IsAct"].ToString(); //激活状态(0 未激活 1 已激活)
|
|
|
|
|
+ string ActDate = data["ActDate"].ToString(); //激活时间
|
|
|
|
|
+ string condition = "";
|
|
|
|
|
+ var merIds = MerchantInfoUtil.QueryAnyIsOkMerchantId();
|
|
|
|
|
+ condition = " and Id in (" + merIds + ")";
|
|
|
|
|
+ if (!string.IsNullOrEmpty(MerchantName))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and CertMerchantName like '%" + 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(MatchNo))
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and MchtNo='" + MatchNo + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(SubjectType))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (SubjectType == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
|
|
|
|
|
+ if (SubjectType == "2") SubjectType = "SUBJECT_TYPE_INDIVIDUAL"; //个体工商户
|
|
|
|
|
+ if (SubjectType == "3") SubjectType = "SUBJECT_TYPE_SMALL"; //小微
|
|
|
|
|
+ condition += " and SubjectType='" + SubjectType + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(IsAct))
|
|
|
|
|
+ {
|
|
|
|
|
+ var Ids = MerchantInfoUtil.QueryIsActMerchantId(int.Parse(IsAct));
|
|
|
|
|
+ condition += " and Id in (" + Ids + ")";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(data["ActDate"].ToString()))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = ActDate.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ string start = datelist[0];
|
|
|
|
|
+ string end = datelist[1];
|
|
|
|
|
+ var Ids = MerchantInfoUtil.QueryActDateMerchantId(start, end);
|
|
|
|
|
+ condition += " and Id in (" + Ids + ")";
|
|
|
|
|
+ }
|
|
|
|
|
+ Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
|
|
+ var Sql = "SELECT a.Id '商户Id',(CASE WHEN b.IsAct=0 THEN '未激活' WHEN b.IsAct=1 THEN '已激活' ELSE '' end) '激活状态',c.UpdateDate '激活时间',a.CertMerchantName '商户名称',a.MobilePhone '手机号码',b.UserId '所属创客Id',(CASE WHEN a.SubjectType='SUBJECT_TYPE_ENTERPRISE' THEN '企业公司' WHEN a.SubjectType='SUBJECT_TYPE_INDIVIDUAL' THEN '个体工商户' WHEN a.SubjectType='SUBJECT_TYPE_SMALL' THEN '小微' ELSE '' end) '主体类型',a.MchtNo '商户号',(SELECT SUM(TradeCount) TradeCount FROM MerchantAmountSummay WHERE 1=1 AND MerchantId=a.Id) '订单总数',(SELECT SUM(TotalActual) TotalActual FROM MerchantAmountSummay WHERE 1=1 AND MerchantId=a.Id)' 实收总金额',(SELECT SUM(TradeAmount) TradeAmount FROM MerchantAmountSummay WHERE 1=1 AND MerchantId=a.Id) '营业总金额' FROM(SELECT Id,CertMerchantName,MobilePhone,MchtNo,SubjectType FROM MerchantAddInfo WHERE 1=1 " + condition + " AND (Status=2 or QueryCount=2)) a LEFT JOIN (SELECT Id,IsAct,UserId FROM MerchantInfo WHERE 1=1 AND Status=2 or QueryCount=2) b ON a.Id=b.Id LEFT JOIN (SELECT MerchantId,UpdateDate FROM MerchantDepositOrder WHERE `Status`>0)c ON a.Id=c.MerchantId";
|
|
|
|
|
+ var FileName = "商户管理-银联查询商户交易信息" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ string SendData = "{\"Operater\":\"" + AppConfig.LoginSession.sysId + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
|
|
|
|
|
+ RedisDbconn.Instance.AddList("ExportQueue", SendData);
|
|
|
|
|
+
|
|
|
|
|
+ return new AppResultJson() { Status = "1", Info = "", Data = Obj };
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ #region 银联结算管理-银联结算记录
|
|
|
|
|
+ [Authorize]
|
|
|
|
|
+ public JsonResult UnionPaySettlementRecordList(string value)
|
|
|
|
|
+ {
|
|
|
|
|
+ value = PublicFunction.DesDecrypt(value);
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
|
|
+ Dictionary<string, object> Other = new Dictionary<string, object>();
|
|
|
|
|
+ List<Dictionary<string, object>> dataList = UnionPaySettlementRecordListDo(value, out Other);
|
|
|
|
|
+ return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList, Other = Other });
|
|
|
|
|
+ }
|
|
|
|
|
+ private List<Dictionary<string, object>> UnionPaySettlementRecordListDo(string value, out Dictionary<string, object> Other)
|
|
|
|
|
+ {
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
|
|
+ string MerchantName = data["MerchantName"].ToString(); //商户名称
|
|
|
|
|
+ string MerchantNo = data["MerchantNo"].ToString(); //商户号
|
|
|
|
|
+ string SettlementDate = data["SettlementDate"].ToString(); //结算时间(必填)
|
|
|
|
|
+ string SettleStatus = data["SettleStatus"].ToString(); //出款状态(0 入账成功 1 入账失败 2 结算超时 3 入账受理成功 4 已提交结算请求)
|
|
|
|
|
+ string pageSize = data["page_size"].ToString();
|
|
|
|
|
+ string pageNum = data["page_num"].ToString();
|
|
|
|
|
+ var MerchantId = 0;
|
|
|
|
|
+ string StartDate = "";
|
|
|
|
|
+ string EndDate = "";
|
|
|
|
|
+ if (!string.IsNullOrEmpty(data["MerchantName"].ToString()))
|
|
|
|
|
+ {
|
|
|
|
|
+ var merAddInfo = MerchantAddInfoService.Query(" and CertMerchantName='" + MerchantName + "'");
|
|
|
|
|
+ MerchantId = merAddInfo.Id;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(data["MerchantNo"].ToString()))
|
|
|
|
|
+ {
|
|
|
|
|
+ var merAddInfo = MerchantAddInfoService.Query(" and MchtNo='" + MerchantNo + "'");
|
|
|
|
|
+ MerchantId = merAddInfo.Id;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(data["SettlementDate"].ToString()))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = SettlementDate.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ StartDate = datelist[0];
|
|
|
|
|
+ EndDate = datelist[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ Other = new Dictionary<string, object>();
|
|
|
|
|
+ var dataList = MySelfUtil.CardInComeRecordList(MerchantId, StartDate, EndDate, SettleStatus, pageSize, pageNum, out Other);
|
|
|
|
|
+ Other = Other;
|
|
|
|
|
+ return dataList;
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ #region 重置交易额-银联重置商户交易额
|
|
|
|
|
+ [Authorize]
|
|
|
|
|
+ public JsonResult UnionPayResetMerchantAmount(string value)
|
|
|
|
|
+ {
|
|
|
|
|
+ value = PublicFunction.DesDecrypt(value);
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
|
|
+ AppResultJson result = UnionPayResetMerchantAmountDo(value);
|
|
|
|
|
+ return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
|
|
|
|
|
+ }
|
|
|
|
|
+ private AppResultJson UnionPayResetMerchantAmountDo(string value)
|
|
|
|
|
+ {
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(value);
|
|
|
|
|
+ string MerchantId = data["MerchantId"].ToString(); //商户Id
|
|
|
|
|
+ string TradeDate = data["TradeDate"].ToString(); //交易时间
|
|
|
|
|
+ if (string.IsNullOrEmpty(data["MerchantId"].ToString()) || string.IsNullOrEmpty(data["TradeDate"].ToString()))
|
|
|
|
|
+ {
|
|
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "商户Id和交易时间不能为空" };
|
|
|
|
|
+ }
|
|
|
|
|
+ string[] datelist = TradeDate.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ string start = DateTime.Parse(datelist[0]).ToString("yyyyMMdd");
|
|
|
|
|
+ string end = DateTime.Parse(datelist[1]).ToString("yyyyMMdd");
|
|
|
|
|
+ string info = "{\"MerchantId\":\"" + MerchantId + "\",\"StartDate\":\"" + start + "\",\"EndDate\": \"" + end + "\"}";
|
|
|
|
|
+ RedisDbconn.Instance.AddList("ResetMerchantStatDataQueue2", info);
|
|
|
|
|
+ Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
|
|
+
|
|
|
|
|
+ return new AppResultJson() { Status = "1", Info = "成功", Data = Obj };
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|