|
|
@@ -266,7 +266,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string SeoKeyword = "0";
|
|
|
if (!string.IsNullOrEmpty(pos.SeoKeyword))
|
|
|
{
|
|
|
- if (pos.SeoKeyword.Length > 3)
|
|
|
+ // SeoKeyword = pos.SeoKeyword.Replace(".00","");
|
|
|
+ if (pos.SeoKeyword.Replace(".00","").Length > 3)
|
|
|
{
|
|
|
SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
|
|
|
}
|
|
|
@@ -322,6 +323,161 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
+ #region 导出人工已退商户Excel
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 导出人工已退商户Excel
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public JsonResult ExportrgExcel(PosMerchantInfo data, string MerIdcardNo, string MerchantName, string PhoneNo, string PosSn)
|
|
|
+ {
|
|
|
+ Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+
|
|
|
+ Fields.Add("KqMerNo", "1"); //商户编号
|
|
|
+ string condition = " and Status>-1 and StandardStatus=-2";
|
|
|
+ //身份证号
|
|
|
+ if (!string.IsNullOrEmpty(MerIdcardNo))
|
|
|
+ {
|
|
|
+ var IdCardf = MerIdcardNo.Substring(0, 6);
|
|
|
+ var IdCardb = MerIdcardNo.Substring(MerIdcardNo.Length - 4);
|
|
|
+ condition += " and LEFT(MerIdcardNo,6)=" + IdCardf + " AND RIGHT(MerIdcardNo,4)=" + IdCardb + "";
|
|
|
+ }
|
|
|
+ //商户姓名
|
|
|
+ if (!string.IsNullOrEmpty(MerchantName))
|
|
|
+ {
|
|
|
+ condition += " and MerchantName like '%" + MerchantName + "%'";
|
|
|
+ }
|
|
|
+ //手机号
|
|
|
+ if (!string.IsNullOrEmpty(PhoneNo))
|
|
|
+ {
|
|
|
+ var PhoneNof = PhoneNo.Substring(0, 3);
|
|
|
+ var PhoneNob = PhoneNo.Substring(PhoneNo.Length - 4);
|
|
|
+ condition += " and LEFT(MerchantMobile,3)=" + PhoneNof + " AND RIGHT(MerchantMobile,4)=" + PhoneNob + "";
|
|
|
+ }
|
|
|
+ //机具号
|
|
|
+ if (!string.IsNullOrEmpty(PosSn))
|
|
|
+ {
|
|
|
+ condition += " and KqSnNo='" + PosSn + "'";
|
|
|
+ }
|
|
|
+
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosMerchantInfo", Fields, "Id desc", "0", 1, 20000, condition, "MerchantNo,MerchantName,MerchantMobile,KqMerNo,KqSnNo,MerStatus,ActiveStatus,UserId,MerUserId,SnType,SnApplyUserId,KqRegTime,ActType,SnStoreId,TopUserId,MerUserType,RebateQual", false);
|
|
|
+ List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
+ foreach (Dictionary<string, object> dic in diclist)
|
|
|
+ {
|
|
|
+ //直属创客
|
|
|
+ int UserId = int.Parse(dic["UserId"].ToString());
|
|
|
+ Users puser = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
+ dic["MakerCode"] = puser.MakerCode;
|
|
|
+ dic["RealName"] = puser.RealName;
|
|
|
+ //顶级创客
|
|
|
+ int TopUserId = int.Parse(dic["TopUserId"].ToString());
|
|
|
+ Users tuser = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
|
|
|
+ dic["TopMakerCode"] = tuser.MakerCode;
|
|
|
+ dic["TopRealName"] = tuser.RealName;
|
|
|
+ //商户创客
|
|
|
+ int MerUserId = int.Parse(dic["MerUserId"].ToString());
|
|
|
+ Users muser = db.Users.FirstOrDefault(m => m.Id == MerUserId) ?? new Users();
|
|
|
+ dic["MerMakerCode"] = muser.MakerCode;
|
|
|
+ dic["MerRealName"] = muser.RealName;
|
|
|
+ //申请创客
|
|
|
+ int SnApplyUserId = int.Parse(dic["SnApplyUserId"].ToString());
|
|
|
+ Users snuser = db.Users.FirstOrDefault(m => m.Id == SnApplyUserId) ?? new Users();
|
|
|
+ dic["SnApplyMakerCode"] = snuser.MakerCode;
|
|
|
+ dic["SnApplyRealName"] = snuser.RealName;
|
|
|
+ //SN仓库
|
|
|
+ int SnStoreId = int.Parse(dic["SnStoreId"].ToString());
|
|
|
+ StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == SnStoreId) ?? new StoreHouse();
|
|
|
+ dic["StoreNo"] = store.StoreNo;
|
|
|
+ dic["StoreName"] = store.StoreName;
|
|
|
+ //机具类型
|
|
|
+ int SnType = int.Parse(dic["SnType"].ToString());
|
|
|
+ if (SnType == 0) dic["SnType"] = "兑换机具";
|
|
|
+ if (SnType == 1) dic["SnType"] = "循环机具";
|
|
|
+ //返利资格
|
|
|
+ dic["RebateQual"] = dic["RebateQual"].ToString() == "1" ? "是" : "否";
|
|
|
+ //激活类型
|
|
|
+ int ActType = int.Parse(dic["ActType"].ToString());
|
|
|
+ if (ActType == 0) dic["ActType"] = "正常激活";
|
|
|
+ if (ActType == 1) dic["ActType"] = "首次已激活MPOS";
|
|
|
+ if (ActType == 2) dic["ActType"] = "首次已激活KPOS";
|
|
|
+ if (ActType == 3) dic["ActType"] = "循环机划拨激活";
|
|
|
+ //商户状态
|
|
|
+ int MerStatus = int.Parse(dic["MerStatus"].ToString());
|
|
|
+ if (MerStatus == 0) dic["MerStatus"] = "正常";
|
|
|
+ if (MerStatus == 1) dic["MerStatus"] = "冻结";
|
|
|
+ if (MerStatus == 2) dic["MerStatus"] = "关闭";
|
|
|
+ //商户激活状态
|
|
|
+ int ActiveStatus = int.Parse(dic["ActiveStatus"].ToString());
|
|
|
+ if (ActiveStatus == 0) dic["ActiveStatus"] = "未激活";
|
|
|
+ if (ActiveStatus == 1) dic["ActiveStatus"] = "已激活";
|
|
|
+ if (ActiveStatus == 2) dic["ActiveStatus"] = "SN已返现";
|
|
|
+ //商户创客类型
|
|
|
+ int MerUserType = int.Parse(dic["MerUserType"].ToString());
|
|
|
+ if (MerUserType == 0) dic["MerUserType"] = "非商户型创客";
|
|
|
+ if (MerUserType == 1) dic["MerUserType"] = "商户型创客";
|
|
|
+
|
|
|
+ var KqSnNo = dic["KqSnNo"].ToString();
|
|
|
+ var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == KqSnNo) ?? new PosMachinesTwo();
|
|
|
+
|
|
|
+ //实际押金
|
|
|
+ string SeoKeyword = "0";
|
|
|
+ if (!string.IsNullOrEmpty(pos.SeoKeyword))
|
|
|
+ {
|
|
|
+ if (pos.SeoKeyword.ToString().Length > 3)
|
|
|
+ {
|
|
|
+ SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SeoKeyword = pos.SeoKeyword;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dic["SeoKeyword"] = SeoKeyword;
|
|
|
+
|
|
|
+ //设置押金
|
|
|
+ string PrizeParams = "0";
|
|
|
+ if (!string.IsNullOrEmpty(pos.PrizeParams))
|
|
|
+ {
|
|
|
+ PrizeParams = pos.PrizeParams.ToString();
|
|
|
+ }
|
|
|
+ dic["PrizeParams"] = PrizeParams;
|
|
|
+ }
|
|
|
+
|
|
|
+ Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
+ result.Add("Status", "1");
|
|
|
+ result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
|
|
|
+ result.Add("Obj", diclist);
|
|
|
+ Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
|
+ ReturnFields.Add("MerchantNo", "商户编号");
|
|
|
+ ReturnFields.Add("MerchantName", "商户名称");
|
|
|
+ ReturnFields.Add("MerchantMobile", "商户手机号");
|
|
|
+ ReturnFields.Add("KqMerNo", "快钱商户编码");
|
|
|
+ ReturnFields.Add("KqSnNo", "快钱SN号");
|
|
|
+ ReturnFields.Add("SnType", "机具类型");
|
|
|
+ ReturnFields.Add("RebateQual", "返利资格");
|
|
|
+ ReturnFields.Add("ActType", "激活类型");
|
|
|
+ ReturnFields.Add("MerStatus", "商户状态");
|
|
|
+ ReturnFields.Add("ActiveStatus", "商户激活状态");
|
|
|
+ ReturnFields.Add("MerMakerCode", "商户创客编码");
|
|
|
+ ReturnFields.Add("MerRealName", "商户创客名称");
|
|
|
+ ReturnFields.Add("MerUserType", "商户创客类型");
|
|
|
+ ReturnFields.Add("MakerCode", "直属创客编号");
|
|
|
+ ReturnFields.Add("RealName", "直属创客姓名");
|
|
|
+ ReturnFields.Add("TopMakerCode", "顶级创客编码");
|
|
|
+ ReturnFields.Add("TopRealName", "顶级创客名称");
|
|
|
+ ReturnFields.Add("StoreNo", "SN仓库编号");
|
|
|
+ ReturnFields.Add("StoreName", "SN仓库名称");
|
|
|
+ ReturnFields.Add("SnApplyMakerCode", "申请创客编号");
|
|
|
+ ReturnFields.Add("SnApplyRealName", "申请创客姓名");
|
|
|
+ ReturnFields.Add("KqRegTime", "注册时间");
|
|
|
+ result.Add("Fields", ReturnFields);
|
|
|
+ AddSysLog("0", "PosMerchantInfo", "ExportExcel");
|
|
|
+ return Json(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
#region 达标商户列表
|
|
|
|
|
|
/// <summary>
|