DuGuYang 2 роки тому
батько
коміт
6f70a28cf4

+ 6 - 0
Areas/Api/Controllers/v1/Main1/ConsumerOrdersController.cs

@@ -43,6 +43,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             string IsAct = data["IsAct"].ToString(); //是否参与分账(0 否 1 是)
             string Status = data["Status"].ToString(); //交易状态(0 未支付 1 已支付)
             string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体)
+            string TradePayNo = data["TradePayNo"].ToString(); //第三方交易号
             int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
             int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
             string condition = "";
@@ -93,6 +94,10 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
                 var Ids = MerchantInfoUtil.QueryMerchantIdBySubjectType(SubjectType);
                 condition += " and MerchantId in (" + Ids + ")";
             }
+            if (!string.IsNullOrEmpty(data["TradePayNo"].ToString()))
+            {
+                condition += " and TradePayNo='" + TradePayNo + "'";
+            }
             List<RelationData> relationData = new List<RelationData>();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             Other = new Dictionary<string, object>();
@@ -116,6 +121,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
                 if (query.SubjectType == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
                 if (query.SubjectType == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
                 curData.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体)
+                curData.Add("TradePayNo", TradePayNo); //第三方交易号
                 dataList.Add(curData);
             }
             Other.Add("Count", count); //总数

+ 96 - 3
Areas/Api/Controllers/v1/Main1/MerchantAddInfoController.cs

@@ -205,6 +205,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
             string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体)
             string IsAct = data["IsAct"].ToString(); //激活状态(0 未激活 1 已激活)
+            string ActDate = data["ActDate"].ToString(); //激活时间
             int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
             int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
             string condition = "";
@@ -242,6 +243,14 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
                 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 + ")";
+            }
             List<RelationData> relationData = new List<RelationData>();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             Other = new Dictionary<string, object>();
@@ -256,6 +265,13 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
                 var userInfo = UsersService.Query(merInfo.UserId);
                 curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
                 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("Mobile", subdata["MobilePhone"].ToString()); //手机号码
                 curData.Add("MakerCode", userInfo.MakerCode); //所属创客
@@ -304,17 +320,17 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             {
                 if (string.IsNullOrEmpty(query.AlipayPid))
                 {
-                    fields.Add("AlipayPid", AliPPID); //支付宝PID
+                    // fields.Add("AlipayPid", AliPPID); //支付宝PID
                     query.AlipayPid = AliPPID;
                 }
                 if (!string.IsNullOrEmpty(AliPayToken))
                 {
-                    fields.Add("AlipayAuthToken", AliPayToken); //支付宝token
+                    // fields.Add("AlipayAuthToken", AliPayToken); //支付宝token
                     query.AlipayAuthToken = AliPayToken;
                 }
                 if (string.IsNullOrEmpty(query.SubMchid))
                 {
-                    fields.Add("SubMchid", WeChatNo); //微信商户号
+                    // fields.Add("SubMchid", WeChatNo); //微信商户号
                     query.SubMchid = WeChatNo;
                 }
             }
@@ -324,5 +340,82 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
         }
         #endregion
 
+
+        #region 商户管理-直连查询商户交易信息导出
+        [Authorize]
+        public JsonResult ExportDirectQueryMerchantTradeInfo(string value)
+        {
+            value = PublicFunction.DesDecrypt(value); ;
+            JsonData data = JsonMapper.ToObject(value);
+            AppResultJson result = ExportDirectQueryMerchantTradeInfoDo(value);
+            return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
+        }
+        private AppResultJson ExportDirectQueryMerchantTradeInfoDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            string MerchantName = data["MerchantName"].ToString(); //商户名称
+            string Mobile = data["Mobile"].ToString(); //手机号码
+            string MakerCode = data["MakerCode"].ToString(); //所属创客
+            string AliPID = data["AliPID"].ToString(); //支付宝PID
+            string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
+            string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体)
+            string IsAct = data["IsAct"].ToString(); //激活状态(0 未激活 1 已激活)
+            string ActDate = data["ActDate"].ToString(); //激活时间
+            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.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(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 + "'";
+            }
+            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 StoreName '仓库名称',StoreNo '仓库编号',MakerCode '仓库所属人编码',RealName '仓库所属人名称',Mobile '仓库所属人手机号',ManageMobile '仓库管理员手机号',Address '地址',Name '品牌',LaveNum '当前库存',c1 '出库(调拨)量',c2 '出货(发货到创客)量',c3 '激活量' from (select s.StoreName,s.StoreNo,u.MakerCode,u.RealName,u.Mobile,s.ManageMobile,s.Address,k.Name,s.LaveNum,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType=1) as c1, (select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType in (10,11,2)) as c2, (select ActCount from KxsStatServer.StoreAct202211 where StoreId=s.Id) as c3, ua.FixedAmount, ua.ValidAmount, ua.TempAmount, (select sum(PromissAmount) from StoreHouseAmountPromiss where ToUserId=s.UserId and `Status`=1) as PromissAmount from StoreHouse s left join Users u on s.BrandId>0 and s.UserId=u.Id left join KqProducts k on s.BrandId=k.Id left join UserAccount ua on s.UserId=ua.Id) tb where (c1>0 or c2>0 or c3>0)" + condtion + "";
+            // var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
+            // var FileName = "仓库统计管理记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            // string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
+            // RedisDbconn.Instance.AddList("ExportQueue", SendData);
+
+            return new AppResultJson() { Status = "1", Info = "", Data = Obj };
+        }
+        #endregion
+
     }
 }

+ 63 - 0
Areas/Api/Controllers/v1/Main1/MerchantInfoController.cs

@@ -84,5 +84,68 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
         #endregion
 
 
+        #region 商户管理-商户管理-直连重置登录密码
+        [Authorize]
+        public JsonResult DirectResetLoginPwd(string value)
+        {
+            value = PublicFunction.DesDecrypt(value); ;
+            JsonData data = JsonMapper.ToObject(value);
+            AppResultJson result = DirectResetLoginPwdDo(value);
+            return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
+        }
+        private AppResultJson DirectResetLoginPwdDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            string MerchantId = data["MerchantId"].ToString(); //商户Id
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
+            var Id = int.Parse(MerchantId);
+            var query = main1db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
+            Dictionary<string, object> fields = new Dictionary<string, object>();
+            if (query.Id > 0)
+            {
+                query.LoginPwd = function.MD532(query.Mobile.Substring(query.Mobile.Length - 6, 6)); //登录密码
+            }
+            main2db.SaveChanges();
+
+            return new AppResultJson() { Status = "1", Info = "该商户的登录密码已重置为手机号后6位", Data = Obj };
+            return new AppResultJson() { Status = "1", Info = "", Data = Obj };
+        }
+        #endregion
+
+
+        #region 商户管理-商户管理-直连修改手机号
+        [Authorize]
+        public JsonResult DirectEditMobile(string value)
+        {
+            value = PublicFunction.DesDecrypt(value); ;
+            JsonData data = JsonMapper.ToObject(value);
+            AppResultJson result = DirectEditMobileDo(value);
+            return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
+        }
+        private AppResultJson DirectEditMobileDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            string MerchantId = data["MerchantId"].ToString(); //商户Id
+            string Mobile = data["Mobile"].ToString(); //新手机号
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
+            if (Mobile.Length != 11 || !function.IsInt(Mobile) || Mobile.Substring(0, 1) != "1")
+            {
+                return new AppResultJson() { Status = "-1", Info = "手机号不正确" };
+            }
+            var Id = int.Parse(MerchantId);
+            var query = main1db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
+            Dictionary<string, object> fields = new Dictionary<string, object>();
+            if (query.Id > 0)
+            {
+                query.Mobile = Mobile;
+                query.LoginPwd = function.MD532(Mobile.Substring(Mobile.Length - 6, 6)); //登录密码
+            }
+            main2db.SaveChanges();
+
+            return new AppResultJson() { Status = "1", Info = "修改成功,新密码默认为该手机号后6位", Data = Obj };
+        }
+        #endregion
+
+
     }
 }

+ 68 - 0
Areas/Api/Controllers/v1/Main1/MerchantParamSetRecordController.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Microsoft.AspNetCore.Authorization;
+using System.Web;
+using MySystem.Models.Main1;
+using MySystem.Service.Main1;
+using LitJson;
+using Library;
+
+namespace MySystem.Areas.Api.Controllers.v1.Main1
+{
+    [Area("Api")]
+    [Route("/v1/QrCodePlateMain/[controller]/[action]")]
+    public class MerchantParamSetRecordController : BaseController
+    {
+        public MerchantParamSetRecordController(IHttpContextAccessor accessor) : base(accessor)
+        {
+        }
+
+
+        #region 商户管理-商户管理-直连商户活动变更记录
+        [Authorize]
+        public JsonResult DirectMerchantParamSetRecordList(string value)
+        {
+            value = PublicFunction.DesDecrypt(value); ;
+            JsonData data = JsonMapper.ToObject(value);
+            List<Dictionary<string, object>> dataList = DirectMerchantParamSetRecordListDo(value);
+            return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
+        }
+        private List<Dictionary<string, object>> DirectMerchantParamSetRecordListDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            string MerchantId = data["MerchantId"].ToString(); //商户Id
+            int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
+            int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
+            string condition = "";
+            List<RelationData> relationData = new List<RelationData>();
+            List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
+            List<Dictionary<string, object>> source = MerchantParamSetRecordService.List(relationData, condition, pageNum, pageSize);
+            foreach (Dictionary<string, object> subdata in source)
+            {
+                Dictionary<string, object> curData = new Dictionary<string, object>();
+                //商户Id
+                var Id = int.Parse(subdata["MerchantId"].ToString());
+                curData.Add("Id", int.Parse(subdata["Id"].ToString())); //变更记录Id
+                curData.Add("Status", int.Parse(subdata["Status"].ToString())); //活动状态(1 使用中 -1 已失效 0 已关闭)
+                // var merAddInfo = MerchantAddInfoService.Query(Id);
+                curData.Add("MerchantName", MerchantAddInfoService.Query(Id).CertMerchantName); //商户名称
+                curData.Add("CreateDate", subdata["AfterCreateDate"].ToString() == "" ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //最后操作时间
+                curData.Add("GetPercent", subdata["AfterGetPercent"].ToString()); //实收比例
+                curData.Add("DiviPersons", subdata["AfterDiviPersons"].ToString()); //分红人数
+                curData.Add("ProfitDays", subdata["AfterProfitDays"].ToString()); //分红天数
+                curData.Add("MinPayMoney", subdata["AfterMinPayMoney"].ToString()); //参与门槛
+                curData.Add("DiviPercent", subdata["AfterDiviPercent"].ToString()); //最大分红比例
+
+                dataList.Add(curData);
+            }
+            return dataList;
+        }
+        #endregion
+
+    }
+}

+ 6 - 0
Areas/Api/Controllers/v1/Main2/ConsumerOrdersController.cs

@@ -43,6 +43,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             string IsAct = data["IsAct"].ToString(); //是否参与分账(0 否 1 是)
             string Status = data["Status"].ToString(); //交易状态(0 未支付 1 已支付)
             string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体 3 小微)
+            string TradePayNo = data["TradePayNo"].ToString(); //第三方交易号
             int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
             int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
             string condition = "";
@@ -94,6 +95,10 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
                 var Ids = MerchantInfoUtil.QueryMerchantIdBySubjectType(SubjectType);
                 condition += " and MerchantId in (" + Ids + ")";
             }
+            if (!string.IsNullOrEmpty(data["TradePayNo"].ToString()))
+            {
+                condition += " and TradePayNo='" + TradePayNo + "'";
+            }
             List<RelationData> relationData = new List<RelationData>();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             Other = new Dictionary<string, object>();
@@ -118,6 +123,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
                 if (query.SubjectType == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
                 if (query.SubjectType == "SUBJECT_TYPE_SMALL") subjectType = 3; //小微
                 curData.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体 3 小微)
+                curData.Add("TradePayNo", TradePayNo); //第三方交易号
                 dataList.Add(curData);
             }
             Other.Add("Count", count); //总数

+ 126 - 0
Areas/Api/Controllers/v1/Main2/MerchantAddInfoController.cs

@@ -225,6 +225,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             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(); //激活时间
             int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
             int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
             string condition = "";
@@ -259,6 +260,14 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
                 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 + ")";
+            }
             List<RelationData> relationData = new List<RelationData>();
             List<Dictionary<string, object>> dataList = new List<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);
                 curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
                 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("Mobile", subdata["MobilePhone"].ToString()); //手机号码
                 curData.Add("MakerCode", userInfo.MakerCode); //所属创客
@@ -295,5 +311,115 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
         #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();
+            Dictionary<string, object> fields = new Dictionary<string, object>();
+            if (query.Id > 0)
+            {
+                if (string.IsNullOrEmpty(MerchantName))
+                {
+                    query.CertMerchantName = MerchantName;
+                    merInfo.Name = MerchantName;
+                }
+                if (!string.IsNullOrEmpty(MerchantShortName))
+                {
+                    fields.Add("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 StoreName '仓库名称',StoreNo '仓库编号',MakerCode '仓库所属人编码',RealName '仓库所属人名称',Mobile '仓库所属人手机号',ManageMobile '仓库管理员手机号',Address '地址',Name '品牌',LaveNum '当前库存',c1 '出库(调拨)量',c2 '出货(发货到创客)量',c3 '激活量' from (select s.StoreName,s.StoreNo,u.MakerCode,u.RealName,u.Mobile,s.ManageMobile,s.Address,k.Name,s.LaveNum,(select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType=1) as c1, (select count(Id) from StoreStockChange where Id>=" + minId + " and Id<=" + maxId + " and CreateDate>='" + sCreateDate + "' and CreateDate<='" + eCreateDate + "' and StoreId=s.Id and TransType in (10,11,2)) as c2, (select ActCount from KxsStatServer.StoreAct202211 where StoreId=s.Id) as c3, ua.FixedAmount, ua.ValidAmount, ua.TempAmount, (select sum(PromissAmount) from StoreHouseAmountPromiss where ToUserId=s.UserId and `Status`=1) as PromissAmount from StoreHouse s left join Users u on s.BrandId>0 and s.UserId=u.Id left join KqProducts k on s.BrandId=k.Id left join UserAccount ua on s.UserId=ua.Id) tb where (c1>0 or c2>0 or c3>0)" + condtion + "";
+            // var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
+            // var FileName = "仓库统计管理记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            // string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
+            // RedisDbconn.Instance.AddList("ExportQueue", SendData);
+
+            return new AppResultJson() { Status = "1", Info = "", Data = Obj };
+        }
+        #endregion
+
+
     }
 }

+ 63 - 1
Areas/Api/Controllers/v1/Main2/MerchantInfoController.cs

@@ -21,7 +21,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
         public MerchantInfoController(IHttpContextAccessor accessor) : base(accessor)
         {
         }
-        
+
         #region 商户激活-银联达标商户列表
         [Authorize]
         public JsonResult UnionPayQualifiedMerchants(string value)
@@ -77,6 +77,68 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
         #endregion
 
 
+        #region 商户管理-商户管理-银联重置登录密码
+        [Authorize]
+        public JsonResult UnionPayResetLoginPwd(string value)
+        {
+            value = PublicFunction.DesDecrypt(value); ;
+            JsonData data = JsonMapper.ToObject(value);
+            AppResultJson result = UnionPayResetLoginPwdDo(value);
+            return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
+        }
+        private AppResultJson UnionPayResetLoginPwdDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            string MerchantId = data["MerchantId"].ToString(); //商户Id
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
+            var Id = int.Parse(MerchantId);
+            var query = main2db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
+            Dictionary<string, object> fields = new Dictionary<string, object>();
+            if (query.Id > 0)
+            {
+                query.LoginPwd = function.MD532(query.Mobile.Substring(query.Mobile.Length - 6, 6)); //登录密码
+            }
+            main2db.SaveChanges();
+
+            return new AppResultJson() { Status = "1", Info = "该商户的登录密码已重置为手机号后6位", Data = Obj };
+        }
+        #endregion
+
+
+        #region 商户管理-商户管理-银联修改手机号
+        [Authorize]
+        public JsonResult UnionPayEditMobile(string value)
+        {
+            value = PublicFunction.DesDecrypt(value); ;
+            JsonData data = JsonMapper.ToObject(value);
+            AppResultJson result = UnionPayEditMobileDo(value);
+            return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
+        }
+        private AppResultJson UnionPayEditMobileDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            string MerchantId = data["MerchantId"].ToString(); //商户Id
+            string Mobile = data["Mobile"].ToString(); //新手机号
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
+            if (Mobile.Length != 11 || !function.IsInt(Mobile) || Mobile.Substring(0, 1) != "1")
+            {
+                return new AppResultJson() { Status = "-1", Info = "手机号不正确" };
+            }
+            var Id = int.Parse(MerchantId);
+            var query = main2db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
+            Dictionary<string, object> fields = new Dictionary<string, object>();
+            if (query.Id > 0)
+            {
+                query.Mobile = Mobile;
+                query.LoginPwd = function.MD532(Mobile.Substring(Mobile.Length - 6, 6)); //登录密码
+            }
+            main2db.SaveChanges();
+
+            return new AppResultJson() { Status = "1", Info = "修改成功,新密码默认为该手机号后6位", Data = Obj };
+        }
+        #endregion
+
+
 
     }
 }

+ 68 - 0
Areas/Api/Controllers/v1/Main2/MerchantParamSetRecordController.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using Microsoft.AspNetCore.Authorization;
+using System.Web;
+using MySystem.Models.Main2;
+using MySystem.Service.Main2;
+using LitJson;
+using Library;
+
+namespace MySystem.Areas.Api.Controllers.v1.Main2
+{
+    [Area("Api")]
+    [Route("/v1/QrCodePlateMain/[controller]/[action]")]
+    public class MerchantParamSetRecordController : BaseController
+    {
+        public MerchantParamSetRecordController(IHttpContextAccessor accessor) : base(accessor)
+        {
+        }
+
+
+        #region 商户管理-商户管理-直连商户活动变更记录
+        [Authorize]
+        public JsonResult DirectMerchantParamSetRecordList(string value)
+        {
+            value = PublicFunction.DesDecrypt(value); ;
+            JsonData data = JsonMapper.ToObject(value);
+            List<Dictionary<string, object>> dataList = DirectMerchantParamSetRecordListDo(value);
+            return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
+        }
+        private List<Dictionary<string, object>> DirectMerchantParamSetRecordListDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            string MerchantId = data["MerchantId"].ToString(); //商户Id
+            int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
+            int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
+            string condition = "";
+            List<RelationData> relationData = new List<RelationData>();
+            List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
+            List<Dictionary<string, object>> source = MerchantParamSetRecordService.List(relationData, condition, pageNum, pageSize);
+            foreach (Dictionary<string, object> subdata in source)
+            {
+                Dictionary<string, object> curData = new Dictionary<string, object>();
+                //商户Id
+                var Id = int.Parse(subdata["MerchantId"].ToString());
+                curData.Add("Id", int.Parse(subdata["Id"].ToString())); //变更记录Id
+                curData.Add("Status", int.Parse(subdata["Status"].ToString())); //活动状态(1 使用中 -1 已失效 0 已关闭)
+                // var merAddInfo = MerchantAddInfoService.Query(Id);
+                curData.Add("MerchantName", MerchantAddInfoService.Query(Id).CertMerchantName); //商户名称
+                curData.Add("CreateDate", subdata["AfterCreateDate"].ToString() == "" ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //最后操作时间
+                curData.Add("GetPercent", subdata["AfterGetPercent"].ToString()); //实收比例
+                curData.Add("DiviPersons", subdata["AfterDiviPersons"].ToString()); //分红人数
+                curData.Add("ProfitDays", subdata["AfterProfitDays"].ToString()); //分红天数
+                curData.Add("MinPayMoney", subdata["AfterMinPayMoney"].ToString()); //参与门槛
+                curData.Add("DiviPercent", subdata["AfterDiviPercent"].ToString()); //最大分红比例
+
+                dataList.Add(curData);
+            }
+            return dataList;
+        }
+        #endregion
+
+    }
+}

+ 4 - 0
Models/Main1/ConsumerOrders.cs

@@ -29,5 +29,9 @@ namespace MySystem.Models.Main1
         public ulong IsAct { get; set; }
         public int UserId { get; set; }
         public decimal MerchantActualAmount { get; set; }
+        public string DivideLog { get; set; }
+        public int DivideFlag { get; set; }
+        public DateTime? DivideDate { get; set; }
+        public string TradePayNo { get; set; }
     }
 }

+ 34 - 0
Models/Main1/MerchantParamSetRecord.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class MerchantParamSetRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int AfterDiviPersons { get; set; }
+        public decimal AfterDiviPercent { get; set; }
+        public int AfterProfitDays { get; set; }
+        public decimal AfterGetPercent { get; set; }
+        public decimal AfterMinPayMoney { get; set; }
+        public int AfterIsAll { get; set; }
+        public int MerchantId { get; set; }
+        public int BeforeDiviPersons { get; set; }
+        public decimal BeforeDiviPercent { get; set; }
+        public int BeforeProfitDays { get; set; }
+        public decimal BeforeGetPercent { get; set; }
+        public decimal BeforeMinPayMoney { get; set; }
+        public int BeforeIsAll { get; set; }
+    }
+}

+ 131 - 0
Models/Main1/WebCMSEntities.cs

@@ -103,6 +103,7 @@ namespace MySystem.Models.Main1
         public virtual DbSet<MerchantInfo> MerchantInfo { get; set; }
         public virtual DbSet<MerchantLoginInfo> MerchantLoginInfo { get; set; }
         public virtual DbSet<MerchantParamSet> MerchantParamSet { get; set; }
+        public virtual DbSet<MerchantParamSetRecord> MerchantParamSetRecord { get; set; }
         public virtual DbSet<MerchantQrCode> MerchantQrCode { get; set; }
         public virtual DbSet<MerchantRebateDetail> MerchantRebateDetail { get; set; }
         public virtual DbSet<MerchantTradeSummary> MerchantTradeSummary { get; set; }
@@ -2257,6 +2258,20 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.CurDivi).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.DivideDate)
+                    .HasColumnType("datetime")
+                    .HasComment("提交分账时间");
+
+                entity.Property(e => e.DivideFlag)
+                    .HasColumnType("int(11)")
+                    .HasComment("分账标记");
+
+                entity.Property(e => e.DivideLog)
+                    .HasColumnType("mediumtext")
+                    .HasComment("分账结果日志")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.IsAct)
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
@@ -2306,6 +2321,12 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
+                entity.Property(e => e.TradePayNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("支付交易号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.UpdateMan)
@@ -6942,6 +6963,116 @@ namespace MySystem.Models.Main1
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<MerchantParamSetRecord>(entity =>
+            {
+                entity.HasComment("商户活动配置历史记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterDiviPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后最大分红比例");
+
+                entity.Property(e => e.AfterDiviPersons)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后单笔订单分红人数");
+
+                entity.Property(e => e.AfterGetPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后商家实收比例");
+
+                entity.Property(e => e.AfterIsAll)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后是否收全额");
+
+                entity.Property(e => e.AfterMinPayMoney)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后订单参与门槛");
+
+                entity.Property(e => e.AfterProfitDays)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后分红期限(天)");
+
+                entity.Property(e => e.BeforeDiviPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前最大分红比例");
+
+                entity.Property(e => e.BeforeDiviPersons)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改前单笔订单分红人数");
+
+                entity.Property(e => e.BeforeGetPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前商家实收比例");
+
+                entity.Property(e => e.BeforeIsAll)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改前是否收全额");
+
+                entity.Property(e => e.BeforeMinPayMoney)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前订单参与门槛");
+
+                entity.Property(e => e.BeforeProfitDays)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改前分红期限(天)");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创建人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerchantId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户Id");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<MerchantQrCode>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");

+ 4 - 0
Models/Main2/ConsumerOrders.cs

@@ -29,5 +29,9 @@ namespace MySystem.Models.Main2
         public ulong IsAct { get; set; }
         public int UserId { get; set; }
         public decimal MerchantActualAmount { get; set; }
+        public int DivideFlag { get; set; }
+        public DateTime? DivideDate { get; set; }
+        public string DivideLog { get; set; }
+        public string TradePayNo { get; set; }
     }
 }

+ 34 - 0
Models/Main2/MerchantParamSetRecord.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main2
+{
+    public partial class MerchantParamSetRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int AfterDiviPersons { get; set; }
+        public decimal AfterDiviPercent { get; set; }
+        public int AfterProfitDays { get; set; }
+        public decimal AfterGetPercent { get; set; }
+        public decimal AfterMinPayMoney { get; set; }
+        public int AfterIsAll { get; set; }
+        public int MerchantId { get; set; }
+        public int BeforeDiviPersons { get; set; }
+        public decimal BeforeDiviPercent { get; set; }
+        public int BeforeProfitDays { get; set; }
+        public decimal BeforeGetPercent { get; set; }
+        public decimal BeforeMinPayMoney { get; set; }
+        public int BeforeIsAll { get; set; }
+    }
+}

+ 131 - 0
Models/Main2/WebCMSEntities.cs

@@ -103,6 +103,7 @@ namespace MySystem.Models.Main2
         public virtual DbSet<MerchantInfo> MerchantInfo { get; set; }
         public virtual DbSet<MerchantLoginInfo> MerchantLoginInfo { get; set; }
         public virtual DbSet<MerchantParamSet> MerchantParamSet { get; set; }
+        public virtual DbSet<MerchantParamSetRecord> MerchantParamSetRecord { get; set; }
         public virtual DbSet<MerchantQrCode> MerchantQrCode { get; set; }
         public virtual DbSet<MerchantRebateDetail> MerchantRebateDetail { get; set; }
         public virtual DbSet<MerchantTradeSummary> MerchantTradeSummary { get; set; }
@@ -2257,6 +2258,20 @@ namespace MySystem.Models.Main2
 
                 entity.Property(e => e.CurDivi).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.DivideDate)
+                    .HasColumnType("datetime")
+                    .HasComment("提交分账时间");
+
+                entity.Property(e => e.DivideFlag)
+                    .HasColumnType("int(11)")
+                    .HasComment("分账标记");
+
+                entity.Property(e => e.DivideLog)
+                    .HasColumnType("mediumtext")
+                    .HasComment("分账结果日志")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.IsAct)
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
@@ -2306,6 +2321,12 @@ namespace MySystem.Models.Main2
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
+                entity.Property(e => e.TradePayNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("支付交易号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.UpdateMan)
@@ -6955,6 +6976,116 @@ namespace MySystem.Models.Main2
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<MerchantParamSetRecord>(entity =>
+            {
+                entity.HasComment("商户活动配置历史记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterDiviPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后最大分红比例");
+
+                entity.Property(e => e.AfterDiviPersons)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后单笔订单分红人数");
+
+                entity.Property(e => e.AfterGetPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后商家实收比例");
+
+                entity.Property(e => e.AfterIsAll)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后是否收全额");
+
+                entity.Property(e => e.AfterMinPayMoney)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后订单参与门槛");
+
+                entity.Property(e => e.AfterProfitDays)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后分红期限(天)");
+
+                entity.Property(e => e.BeforeDiviPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前最大分红比例");
+
+                entity.Property(e => e.BeforeDiviPersons)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改前单笔订单分红人数");
+
+                entity.Property(e => e.BeforeGetPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前商家实收比例");
+
+                entity.Property(e => e.BeforeIsAll)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改前是否收全额");
+
+                entity.Property(e => e.BeforeMinPayMoney)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前订单参与门槛");
+
+                entity.Property(e => e.BeforeProfitDays)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改前分红期限(天)");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创建人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerchantId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户Id");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<MerchantQrCode>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");

+ 287 - 0
Service/Main1/MerchantParamSetRecordService.cs

@@ -0,0 +1,287 @@
+/*
+ * 商户活动变更记录
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using MySystem.Models.Main1;
+using Library;
+using LitJson;
+
+namespace MySystem.Service.Main1
+{
+    public class MerchantParamSetRecordService
+    {
+        static string _conn = ConfigurationManager.AppSettings["SqlConnStr1"].ToString();
+
+        /// <summary>
+        /// 查询列表(适合多表关联查询)
+        /// </summary>
+        /// <param name="relationData">关联表</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="count">总数(输出)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public static List<Dictionary<string, object>> List(List<RelationData> relationData, string condition, out int count, int page = 1, int limit = 30, string orderBy = "Sort desc,Id desc")
+        {
+            List<string> fields = new List<string>(); //要显示的列,不设置则返回全部字段
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("MerchantParamSetRecord", relationData, orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            count = int.Parse(obj["count"].ToString());
+            return diclist;
+        }
+        public static List<Dictionary<string, object>> List(List<RelationData> relationData, string condition, int page = 1, int limit = 30, string orderBy = "Sort desc,Id desc")
+        {
+            List<string> fields = new List<string>(); //要显示的列,不设置则返回全部字段
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("MerchantParamSetRecord", relationData, orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询列表(单表)
+        /// </summary>
+        /// <param name="fieldList">返回的字段</param>
+        /// <param name="condition">查询条件</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <param name="orderBy">排序</param>
+        /// <returns></returns>
+        public static List<Dictionary<string, object>> List(string fieldList, string condition, int page = 1, int limit = 30, string orderBy = "Sort desc,Id desc")
+        {
+            List<string> fields = fieldList.Split(',').ToList(); //要显示的列
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("MerchantParamSetRecord", new List<RelationData>(), orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static MerchantParamSetRecord Query(int Id)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("*", "MerchantParamSetRecord", Id);
+            if (obj.Keys.Count > 0)
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<MerchantParamSetRecord>(Newtonsoft.Json.JsonConvert.SerializeObject(obj));
+            }
+            return new MerchantParamSetRecord();
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public static MerchantParamSetRecord Query(string condition)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("*", "MerchantParamSetRecord", condition);
+            if (obj.Keys.Count > 0)
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<MerchantParamSetRecord>(Newtonsoft.Json.JsonConvert.SerializeObject(obj));
+            }
+            return new MerchantParamSetRecord();
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="fields">返回的字段</param>
+        /// <returns></returns>
+        public static Dictionary<string, object> Query(string condition, string fields)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query(fields, "MerchantParamSetRecord", condition);
+            return obj;
+        }
+
+        public static decimal Sum(string condition, string field)
+        {
+            decimal amount = 0;
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantParamSetRecord", condition);
+            if (obj.Keys.Count > 0)
+            {
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
+            }
+            return amount;
+        }
+
+        /// <summary>
+        /// 查询记录数
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static int Count(string condition = "", string field = "Id")
+        {
+            int result = 0;
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("count(" + field + ") " + field + "", "MerchantParamSetRecord", condition);
+            if (obj.Keys.Count > 0)
+            {
+                result = int.Parse(function.CheckInt(obj[field].ToString()));
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 查询是否存在
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static bool Exist(string condition)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("1", "MerchantParamSetRecord", condition);
+            if (obj.Keys.Count > 0)
+            {
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public static AppResultJson Add(Dictionary<string, object> fields, bool check = true)
+        {
+            if (check)
+            {
+                if (string.IsNullOrEmpty(fields["MerchantId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写商户Id" };
+                }
+                if (!function.IsInt(fields["MerchantId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的商户Id" };
+                }
+                if (string.IsNullOrEmpty(fields["UserId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写创客Id" };
+                }
+                if (!function.IsInt(fields["UserId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的创客Id" };
+                }
+                if (!function.IsNum(fields["ActPayPrice"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的激活支付金额" };
+                }
+                if (string.IsNullOrEmpty(fields["OrderNo"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写订单号" };
+                }
+
+            }
+            int Id = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Add("MerchantParamSetRecord", fields, 0);
+            return new AppResultJson() { Status = "1", Data = Id };
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public static AppResultJson Edit(Dictionary<string, object> fields, int Id, bool check = true)
+        {
+            if (check)
+            {
+                if (string.IsNullOrEmpty(fields["MerchantId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写商户Id" };
+                }
+                if (!function.IsInt(fields["MerchantId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的商户Id" };
+                }
+                if (string.IsNullOrEmpty(fields["UserId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写创客Id" };
+                }
+                if (!function.IsInt(fields["UserId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的创客Id" };
+                }
+                if (!function.IsNum(fields["ActPayPrice"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的激活支付金额" };
+                }
+                if (string.IsNullOrEmpty(fields["OrderNo"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写订单号" };
+                }
+
+            }
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Edit("MerchantParamSetRecord", fields, Id);
+            return new AppResultJson() { Status = "1", Data = Id };
+        }
+
+        /// <summary>
+        /// 逻辑删除
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public static void Remove(int Id)
+        {
+            Dictionary<string, object> fields = new Dictionary<string, object>();
+            fields.Add("Status", -1);
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Edit("MerchantParamSetRecord", fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public static void Delete(int Id)
+        {
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Delete("MerchantParamSetRecord", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public static void Sort(int Id, int Sort)
+        {
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Sort("MerchantParamSetRecord", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public static void Import(string ExcelData)
+        {
+            // WebCMSEntities db = new WebCMSEntities();
+            // JsonData list = JsonMapper.ToObject(ExcelData);
+            // for (int i = 1; i < list.Count;i++ )
+            // {
+            //     JsonData dr = list[i];
+
+            //     db.MerchantParamSetRecord.Add(new MerchantParamSetRecord()
+            //     {
+            //         CreateDate = DateTime.Now,
+            //         UpdateDate = DateTime.Now,
+
+            //     });
+            //     db.SaveChanges();
+            // }
+            // db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        // public static void ExportExcel(List<RelationData> relationData, string condition)
+        // {
+
+        // }
+    }
+}

+ 287 - 0
Service/Main2/MerchantParamSetRecordService.cs

@@ -0,0 +1,287 @@
+/*
+ * 商户活动变更记录
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using MySystem.Models.Main2;
+using Library;
+using LitJson;
+
+namespace MySystem.Service.Main2
+{
+    public class MerchantParamSetRecordService
+    {
+        static string _conn = ConfigurationManager.AppSettings["SqlConnStr2"].ToString();
+
+        /// <summary>
+        /// 查询列表(适合多表关联查询)
+        /// </summary>
+        /// <param name="relationData">关联表</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="count">总数(输出)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public static List<Dictionary<string, object>> List(List<RelationData> relationData, string condition, out int count, int page = 1, int limit = 30, string orderBy = "Sort desc,Id desc")
+        {
+            List<string> fields = new List<string>(); //要显示的列,不设置则返回全部字段
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("MerchantParamSetRecord", relationData, orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            count = int.Parse(obj["count"].ToString());
+            return diclist;
+        }
+        public static List<Dictionary<string, object>> List(List<RelationData> relationData, string condition, int page = 1, int limit = 30, string orderBy = "Sort desc,Id desc")
+        {
+            List<string> fields = new List<string>(); //要显示的列,不设置则返回全部字段
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("MerchantParamSetRecord", relationData, orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询列表(单表)
+        /// </summary>
+        /// <param name="fieldList">返回的字段</param>
+        /// <param name="condition">查询条件</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <param name="orderBy">排序</param>
+        /// <returns></returns>
+        public static List<Dictionary<string, object>> List(string fieldList, string condition, int page = 1, int limit = 30, string orderBy = "Sort desc,Id desc")
+        {
+            List<string> fields = fieldList.Split(',').ToList(); //要显示的列
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).IndexData("MerchantParamSetRecord", new List<RelationData>(), orderBy, page, limit, condition, fields);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static MerchantParamSetRecord Query(int Id)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("*", "MerchantParamSetRecord", Id);
+            if (obj.Keys.Count > 0)
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<MerchantParamSetRecord>(Newtonsoft.Json.JsonConvert.SerializeObject(obj));
+            }
+            return new MerchantParamSetRecord();
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public static MerchantParamSetRecord Query(string condition)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("*", "MerchantParamSetRecord", condition);
+            if (obj.Keys.Count > 0)
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<MerchantParamSetRecord>(Newtonsoft.Json.JsonConvert.SerializeObject(obj));
+            }
+            return new MerchantParamSetRecord();
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="fields">返回的字段</param>
+        /// <returns></returns>
+        public static Dictionary<string, object> Query(string condition, string fields)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query(fields, "MerchantParamSetRecord", condition);
+            return obj;
+        }
+
+        public static decimal Sum(string condition, string field)
+        {
+            decimal amount = 0;
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantParamSetRecord", condition);
+            if (obj.Keys.Count > 0)
+            {
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
+            }
+            return amount;
+        }
+
+        /// <summary>
+        /// 查询记录数
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static int Count(string condition = "", string field = "Id")
+        {
+            int result = 0;
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("count(" + field + ") " + field + "", "MerchantParamSetRecord", condition);
+            if (obj.Keys.Count > 0)
+            {
+                result = int.Parse(function.CheckInt(obj[field].ToString()));
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 查询是否存在
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public static bool Exist(string condition)
+        {
+            Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("1", "MerchantParamSetRecord", condition);
+            if (obj.Keys.Count > 0)
+            {
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public static AppResultJson Add(Dictionary<string, object> fields, bool check = true)
+        {
+            if (check)
+            {
+                if (string.IsNullOrEmpty(fields["MerchantId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写商户Id" };
+                }
+                if (!function.IsInt(fields["MerchantId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的商户Id" };
+                }
+                if (string.IsNullOrEmpty(fields["UserId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写创客Id" };
+                }
+                if (!function.IsInt(fields["UserId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的创客Id" };
+                }
+                if (!function.IsNum(fields["ActPayPrice"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的激活支付金额" };
+                }
+                if (string.IsNullOrEmpty(fields["OrderNo"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写订单号" };
+                }
+
+            }
+            int Id = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Add("MerchantParamSetRecord", fields, 0);
+            return new AppResultJson() { Status = "1", Data = Id };
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public static AppResultJson Edit(Dictionary<string, object> fields, int Id, bool check = true)
+        {
+            if (check)
+            {
+                if (string.IsNullOrEmpty(fields["MerchantId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写商户Id" };
+                }
+                if (!function.IsInt(fields["MerchantId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的商户Id" };
+                }
+                if (string.IsNullOrEmpty(fields["UserId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写创客Id" };
+                }
+                if (!function.IsInt(fields["UserId"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的创客Id" };
+                }
+                if (!function.IsNum(fields["ActPayPrice"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写正确的激活支付金额" };
+                }
+                if (string.IsNullOrEmpty(fields["OrderNo"].ToString()))
+                {
+                    return new AppResultJson() { Status = "-1", Info = "请填写订单号" };
+                }
+
+            }
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Edit("MerchantParamSetRecord", fields, Id);
+            return new AppResultJson() { Status = "1", Data = Id };
+        }
+
+        /// <summary>
+        /// 逻辑删除
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public static void Remove(int Id)
+        {
+            Dictionary<string, object> fields = new Dictionary<string, object>();
+            fields.Add("Status", -1);
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Edit("MerchantParamSetRecord", fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public static void Delete(int Id)
+        {
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Delete("MerchantParamSetRecord", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public static void Sort(int Id, int Sort)
+        {
+            new DbServiceNew(AppConfig.Base.main1Tables, _conn).Sort("MerchantParamSetRecord", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public static void Import(string ExcelData)
+        {
+            // WebCMSEntities db = new WebCMSEntities();
+            // JsonData list = JsonMapper.ToObject(ExcelData);
+            // for (int i = 1; i < list.Count;i++ )
+            // {
+            //     JsonData dr = list[i];
+
+            //     db.MerchantParamSetRecord.Add(new MerchantParamSetRecord()
+            //     {
+            //         CreateDate = DateTime.Now,
+            //         UpdateDate = DateTime.Now,
+
+            //     });
+            //     db.SaveChanges();
+            // }
+            // db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        // public static void ExportExcel(List<RelationData> relationData, string condition)
+        // {
+
+        // }
+    }
+}

+ 26 - 0
Util/Main1/MerchantInfoUtil.cs

@@ -139,6 +139,32 @@ namespace MySystem.Service.Main1
         }
         #endregion
 
+        #region 获取指定时间段激活商户Id
+        /// <summary>
+        /// 获取指定时间段激活商户Id
+        /// </summary>
+        /// <param name="StartDate">开始时间</param>
+        /// <param name="EndDate">结束时间</param>
+        /// <returns></returns>
+        public static string QueryActDateMerchantId(string StartDate,string EndDate)
+        {
+            var info = "";
+            List<RelationData> relationData = new List<RelationData>();
+            var merInfo = MerchantInfoService.List(relationData, " and UpdateDate>='" + StartDate + " 00:00:00' and UpdateDate<='" + EndDate + " 23:59:59'", 1, 9999999);
+            if (merInfo.Count > 0)
+            {
+                var merIds = "";
+                foreach (Dictionary<string, object> dic in merInfo)
+                {
+                    var MerchantId = int.Parse(dic["MerchantId"].ToString());
+                    merIds += MerchantId + ",";
+                }
+                info = merIds.TrimEnd(',');
+            }
+            return info;
+        }
+        #endregion
+
         #region 主体类型
         /// <summary>
         /// 主体类型

+ 26 - 0
Util/Main2/MerchantInfoUtil.cs

@@ -138,6 +138,32 @@ namespace MySystem.Service.Main2
         }
         #endregion
 
+        #region 获取指定时间段激活商户Id
+        /// <summary>
+        /// 获取指定时间段激活商户Id
+        /// </summary>
+        /// <param name="StartDate">开始时间</param>
+        /// <param name="EndDate">结束时间</param>
+        /// <returns></returns>
+        public static string QueryActDateMerchantId(string StartDate,string EndDate)
+        {
+            var info = "";
+            List<RelationData> relationData = new List<RelationData>();
+            var merInfo = MerchantInfoService.List(relationData, " and UpdateDate>='" + StartDate + " 00:00:00' and UpdateDate<='" + EndDate + " 23:59:59'", 1, 9999999);
+            if (merInfo.Count > 0)
+            {
+                var merIds = "";
+                foreach (Dictionary<string, object> dic in merInfo)
+                {
+                    var MerchantId = int.Parse(dic["MerchantId"].ToString());
+                    merIds += MerchantId + ",";
+                }
+                info = merIds.TrimEnd(',');
+            }
+            return info;
+        }
+        #endregion
+
         #region 主体类型
         /// <summary>
         /// 主体类型