Kaynağa Gözat

Merge branch 'feat-lcl-电签兑大机' of kxs-end/admin-server into release-adminserver

lichunlei 2 yıl önce
ebeveyn
işleme
2fed513b1b

+ 148 - 0
Areas/Admin/Controllers/MainServer/PosCouponExchangeRecordController.cs

@@ -0,0 +1,148 @@
+/*
+ * 电签券兑换记录
+ */
+
+using System;
+using System.Web;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using MySystem.Models;
+using Library;
+using LitJson;
+using MySystemLib;
+
+namespace MySystem.Areas.Admin.Controllers
+{
+    [Area("Admin")]
+    [Route("Admin/[controller]/[action]")]
+    public class PosCouponExchangeRecordController : BaseController
+    {
+        public PosCouponExchangeRecordController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
+        {
+            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        #region 电签券兑换记录列表
+
+        /// <summary>
+        /// 根据条件查询电签券兑换记录列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Index(PosCouponExchangeRecord data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询电签券兑换记录列表
+
+        /// <summary>
+        /// 电签券兑换记录列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexData(PosCouponExchangeRecord data, string UserIdMakerCode, string CreateDateData, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            string condition = "";
+            //来源创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosCouponExchangeRecord", Fields, "Id desc", "0", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //来源创客
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdMakerCode"] = Users.MakerCode;
+                dic["UserIdRealName"] = Users.RealName;
+                dic.Remove("UserId");
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+        #region 导出Excel
+
+        /// <summary>
+        /// 导出Excel
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ExportExcel(PosCouponExchangeRecord data, string UserIdMakerCode, string CreateDateData)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            string condition = "";
+            //来源创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosCouponExchangeRecord", Fields, "Id desc", "0", 1, 20000, condition, "FromUserId,ToUserId,OrderNo,BeforeStock,BeforeTotal,BeforeOut,AfterStock,AfterTotal,AfterOut,ChangeCount,ChangeKind", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //来源创客
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdMakerCode"] = Users.MakerCode;
+                dic["UserIdRealName"] = Users.RealName;
+                dic.Remove("UserId");
+
+            }
+
+            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("UserIdMakerCode", "来源创客编号");
+            ReturnFields.Add("UserIdRealName", "来源创客真实姓名");
+            ReturnFields.Add("SourceCount", "来源券数量");
+            ReturnFields.Add("ToCount", "兑换券数量");
+            ReturnFields.Add("SourceCoupons", "来源券");
+            ReturnFields.Add("ToCoupons", "兑换券");
+
+            result.Add("Fields", ReturnFields);
+            AddSysLog("0", "PosCouponExchangeRecord", "ExportExcel");
+            return Json(result);
+        }
+
+        #endregion
+
+    }
+}

+ 101 - 0
Areas/Admin/Views/MainServer/PosCouponExchangeRecord/Index.cshtml

@@ -0,0 +1,101 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    
+}
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>电签券兑换记录</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <style>
+        .layui-input-inline{
+            width: 175px !important;
+        }
+        .layui-form-label{
+            width: 85px !important;
+        }
+        .layui-inline{
+            margin-right: 0px !important;
+        }
+        .w100{
+            width: 100px !important;
+        }
+        .ml50{
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创客编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="UserIdMakerCode" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创建时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
+                                placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+
+                    <div class="layui-inline ml50">
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
+                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
+                        </button>
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
+                            <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
+                        </button>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-card-body">                
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+            </div>
+        </div>
+    </div>
+    <div id="excelForm" style="display:none; padding:20px;">
+        <div class="layui-tab-item layui-show">
+            <div class="layui-form-item">
+                <label class="layui-form-label">模板下载</label>
+                <div class="layui-form-mid layui-word-aux" id="excelTemp">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">excel文件</label>
+                <div class="layui-form-mid layui-word-aux">
+                    <div class="layui-upload">
+                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
+                    </div>
+                    <div class="mt10" id="ExcelFileList">
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item ml10">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script src="/layuiadmin/modules_main/PosCouponExchangeRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+        
+    </script>
+</body>
+</html>

+ 14 - 0
Models/JavaApiSet.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class JavaApiSet
+    {
+        public int Id { get; set; }
+        public string ToApiHost { get; set; }
+        public string ToApiUrl { get; set; }
+        public string SourceApiUrl { get; set; }
+        public string ApiName { get; set; }
+    }
+}

+ 15 - 0
Models/JavaApiSetFields.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class JavaApiSetFields
+    {
+        public int Id { get; set; }
+        public string TargetFieldType { get; set; }
+        public string TargetFieldName { get; set; }
+        public string SourceFieldTitle { get; set; }
+        public string SourceFieldName { get; set; }
+        public int ApiId { get; set; }
+    }
+}

+ 18 - 0
Models/LiShuaFeeSetRecord.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class LiShuaFeeSetRecord
+    {
+        public int Id { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string TradeFeeAmt { get; set; }
+        public string TradeFeeRate { get; set; }
+        public string MerNo { get; set; }
+        public int MerId { get; set; }
+        public string PosSn { get; set; }
+        public int PosId { get; set; }
+    }
+}

+ 27 - 0
Models/PosCouponExchangeRecord.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class PosCouponExchangeRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string Note { get; set; }
+        public int ToCount { get; set; }
+        public int SourceCount { get; set; }
+        public string ToCoupons { get; set; }
+        public string SourceCoupons { get; set; }
+        public int UserId { get; set; }
+        public int QueryCount { 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; }
+    }
+}

+ 202 - 1
Models/WebCMSEntities.cs

@@ -71,6 +71,8 @@ namespace MySystem.Models
         public virtual DbSet<HelpProfitRewardDetail> HelpProfitRewardDetail { get; set; }
         public virtual DbSet<HelpProfitRewardDetail> HelpProfitRewardDetail { get; set; }
         public virtual DbSet<HelpProfitUserTradeSummay> HelpProfitUserTradeSummay { get; set; }
         public virtual DbSet<HelpProfitUserTradeSummay> HelpProfitUserTradeSummay { get; set; }
         public virtual DbSet<IndexIconList> IndexIconList { get; set; }
         public virtual DbSet<IndexIconList> IndexIconList { get; set; }
+        public virtual DbSet<JavaApiSet> JavaApiSet { get; set; }
+        public virtual DbSet<JavaApiSetFields> JavaApiSetFields { get; set; }
         public virtual DbSet<KqProductBrand> KqProductBrand { get; set; }
         public virtual DbSet<KqProductBrand> KqProductBrand { get; set; }
         public virtual DbSet<KqProductOrgs> KqProductOrgs { get; set; }
         public virtual DbSet<KqProductOrgs> KqProductOrgs { get; set; }
         public virtual DbSet<KqProductRuleSet> KqProductRuleSet { get; set; }
         public virtual DbSet<KqProductRuleSet> KqProductRuleSet { get; set; }
@@ -88,6 +90,7 @@ namespace MySystem.Models
         public virtual DbSet<LeaderReconRecord> LeaderReconRecord { get; set; }
         public virtual DbSet<LeaderReconRecord> LeaderReconRecord { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
         public virtual DbSet<Leaders> Leaders { get; set; }
         public virtual DbSet<Leaders> Leaders { get; set; }
+        public virtual DbSet<LiShuaFeeSetRecord> LiShuaFeeSetRecord { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
         public virtual DbSet<MachineApplyDetail> MachineApplyDetail { get; set; }
         public virtual DbSet<MachineApplyDetail> MachineApplyDetail { get; set; }
         public virtual DbSet<MachineChange> MachineChange { get; set; }
         public virtual DbSet<MachineChange> MachineChange { get; set; }
@@ -144,6 +147,7 @@ namespace MySystem.Models
         public virtual DbSet<PageUpdateInfo> PageUpdateInfo { get; set; }
         public virtual DbSet<PageUpdateInfo> PageUpdateInfo { get; set; }
         public virtual DbSet<PosChannelSet> PosChannelSet { get; set; }
         public virtual DbSet<PosChannelSet> PosChannelSet { get; set; }
         public virtual DbSet<PosChannelSetRecord> PosChannelSetRecord { get; set; }
         public virtual DbSet<PosChannelSetRecord> PosChannelSetRecord { get; set; }
+        public virtual DbSet<PosCouponExchangeRecord> PosCouponExchangeRecord { get; set; }
         public virtual DbSet<PosCouponForUser> PosCouponForUser { get; set; }
         public virtual DbSet<PosCouponForUser> PosCouponForUser { get; set; }
         public virtual DbSet<PosCouponOrders> PosCouponOrders { get; set; }
         public virtual DbSet<PosCouponOrders> PosCouponOrders { get; set; }
         public virtual DbSet<PosCouponRecord> PosCouponRecord { get; set; }
         public virtual DbSet<PosCouponRecord> PosCouponRecord { get; set; }
@@ -4211,6 +4215,72 @@ namespace MySystem.Models
                 entity.Property(e => e.Version).HasColumnType("int(11)");
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
             });
 
 
+            modelBuilder.Entity<JavaApiSet>(entity =>
+            {
+                entity.HasComment("java接口对接");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ApiName)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("接口名称")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SourceApiUrl)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("来源地址")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ToApiHost)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("接收主机头")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ToApiUrl)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("接收地址")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
+            modelBuilder.Entity<JavaApiSetFields>(entity =>
+            {
+                entity.HasComment("java接口对接字段配置");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ApiId)
+                    .HasColumnType("int(11)")
+                    .HasComment("父Id");
+
+                entity.Property(e => e.SourceFieldName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("来源字段名")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SourceFieldTitle)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("来源字段说明")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TargetFieldName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("对应字段名")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TargetFieldType)
+                    .HasColumnType("varchar(20)")
+                    .HasComment("对应字段类型")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
             modelBuilder.Entity<KqProductBrand>(entity =>
             modelBuilder.Entity<KqProductBrand>(entity =>
             {
             {
                 entity.HasComment("产品品牌");
                 entity.HasComment("产品品牌");
@@ -5487,6 +5557,53 @@ namespace MySystem.Models
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
             });
 
 
+            modelBuilder.Entity<LiShuaFeeSetRecord>(entity =>
+            {
+                entity.HasComment("立刷费率查询");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.MerId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户Id");
+
+                entity.Property(e => e.MerNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("商户号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PosId)
+                    .HasColumnType("int(11)")
+                    .HasComment("机具Id");
+
+                entity.Property(e => e.PosSn)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("机具SN")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeFeeAmt)
+                    .HasColumnType("varchar(10)")
+                    .HasComment("交易秒到费")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeFeeRate)
+                    .HasColumnType("varchar(10)")
+                    .HasComment("交易费率")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+            });
+
             modelBuilder.Entity<MachineApply>(entity =>
             modelBuilder.Entity<MachineApply>(entity =>
             {
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -9979,6 +10096,90 @@ namespace MySystem.Models
                     .HasComment("修改时间");
                     .HasComment("修改时间");
             });
             });
 
 
+            modelBuilder.Entity<PosCouponExchangeRecord>(entity =>
+            {
+                entity.HasComment("电签券兑换记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Note)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("备注")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                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.SourceCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("来源券数量");
+
+                entity.Property(e => e.SourceCoupons)
+                    .HasColumnType("mediumtext")
+                    .HasComment("来源券")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.ToCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("兑换券数量");
+
+                entity.Property(e => e.ToCoupons)
+                    .HasColumnType("mediumtext")
+                    .HasComment("兑换券")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<PosCouponForUser>(entity =>
             modelBuilder.Entity<PosCouponForUser>(entity =>
             {
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -10691,7 +10892,7 @@ namespace MySystem.Models
                 entity.Property(e => e.MatchTime).HasColumnType("datetime");
                 entity.Property(e => e.MatchTime).HasColumnType("datetime");
 
 
                 entity.Property(e => e.MerIdcardNo)
                 entity.Property(e => e.MerIdcardNo)
-                    .HasColumnType("varchar(30)")
+                    .HasColumnType("varchar(18)")
                     .HasCharSet("utf8")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
                     .HasCollation("utf8_general_ci");
 
 

+ 152 - 0
wwwroot/layuiadmin/modules_main/PosCouponExchangeRecord_Admin.js

@@ -0,0 +1,152 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/PosCouponExchangeRecord/Import?r=" + Math.random(1),
+        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+var excel;
+layui.config({
+    base: '/layuiadmin/' //静态资源所在路径
+}).extend({
+    myexcel: 'layui/lay/modules/excel',
+    index: 'lib/index' //主入口模块
+}).use(['index', 'table', 'excel', 'laydate'], function () {
+    var $ = layui.$
+        , form = layui.form
+        , table = layui.table;
+
+    //- 筛选条件-日期
+    var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+        elem: '#CreateDate',
+        type: 'date',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
+
+
+    //excel导入
+    excel = layui.excel;
+    $('#ExcelFile').change(function (e) {
+        var files = e.target.files;
+        excel.importExcel(files, {}, function (data) {
+            ExcelData = data[0].sheet1;
+        });
+    });
+
+    //监听单元格编辑
+    table.on('edit(LAY-list-manage)', function (obj) {
+        var value = obj.value //得到修改后的值
+            , data = obj.data //得到所在行所有键值
+            , field = obj.field; //得到字段
+        if (field == "Sort") {
+            $.ajax({
+                type: "POST",
+                url: "/Admin/PosCouponExchangeRecord/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/PosCouponExchangeRecord/IndexData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
+            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
+            , { field: 'UserIdMakerCode', width: 200, title: '创客编号', sort: true }
+            , { field: 'UserIdRealName', width: 200, title: '真实姓名', sort: true }
+            , { field: 'SourceCount', width: 200, title: '来源券数量', sort: true }
+            , { field: 'ToCount', width: 200, title: '兑换券数量', sort: true }
+            , { field: 'SourceCoupons', width: 300, title: '来源券', sort: true }
+            , { field: 'ToCoupons', width: 300, title: '兑换券', sort: true }
+        ]]
+        , where: {
+            OrderNo: OrderNo
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-220'
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    table.on('tool(LAY-list-manage)', function (obj) {
+        var data = obj.data;
+        
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+
+        //执行重载
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: null,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});