Просмотр исходного кода

添加实体模型
添加导入逻辑

DuGuYang 3 лет назад
Родитель
Сommit
17048cd99f

+ 10 - 5
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -622,19 +622,19 @@ namespace MySystem.Areas.Admin.Controllers
             ExcelData = HttpUtility.UrlDecode(ExcelData);
             JsonData list = JsonMapper.ToObject(ExcelData);
             string error = "";
-            List<string> IdList = new List<string>();
+            List<int> IdList = new List<int>();
             for (int i = 1; i < list.Count; i++)
             {
                 JsonData dr = list[i];
                 string itemJson = dr.ToJson();
                 string Id = itemJson.Contains("\"A\"") ? dr["A"].ToString() : "";
-                if (IdList.Contains(Id))
+                if (IdList.Contains(Convert.ToInt32(Id)))
                 {
-                    error += "以下操作失败" + Id + ',' + "该机具号重复" + '\n';
+                    error += "以下操作失败" + Id + ',' + "该记录重复" + '\n';
                 }
                 else
                 {
-                    IdList.Add(Id);
+                    IdList.Add(Convert.ToInt32(Id));
                 }
             }
             if (!string.IsNullOrEmpty(error))
@@ -643,7 +643,12 @@ namespace MySystem.Areas.Admin.Controllers
             }
             else
             {
-                
+                var Info = db.StoreHouseAmountRecord.Where(m => IdList.Contains(m.Id)).ToList();
+                foreach (var item in Info)
+                {
+                    item.Status = -1;
+                    db.SaveChanges();
+                }
             }
             AddSysLog("0", "StoreHouseCardAmountRecord", "Import");
             return "success";

+ 4 - 4
Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Indexs.cshtml

@@ -86,16 +86,16 @@
                         <button class="layui-btn" data-type="batchdel"><i
                             class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
                     }
-                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    @if (RightInfo.Contains("," + right + "_export,"))
                     {
                         <button class="layui-btn" data-type="ExportExcel"><i
                             class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
 
                     }
-                    @if (RightInfo.Contains("," + right + "_batchset,"))
+                    @if (RightInfo.Contains("," + right + "_import,"))
                     {
-                        <button class="layui-btn" data-type="BatchSetting"><i
-                            class="layui-icon layui-icon-edit layuiadmin-button-btn"></i>批量设置</button>
+                        <button class="layui-btn" data-type="ImportData"><i
+                            class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导入结果</button>
                     }
                 </div>
 

+ 24 - 0
Models/SmallStoreQuotaRecord.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class SmallStoreQuotaRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int OperateType { get; set; }
+        public decimal AfterAmount { get; set; }
+        public decimal BeforeAmount { get; set; }
+        public decimal UseAmount { get; set; }
+        public int ApplyId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 1 - 0
Models/UserAccount.cs

@@ -41,5 +41,6 @@ namespace MySystem.Models
         public decimal TempAmountForBalance { get; set; }
         public decimal ThisMonthPreAmount { get; set; }
         public decimal ValidPreAmount { get; set; }
+        public decimal SmallStoreDeposit { get; set; }
     }
 }

+ 45 - 0
Models/WebCMSEntities.cs

@@ -177,6 +177,7 @@ namespace MySystem.Models
         public virtual DbSet<ServiceCenter> ServiceCenter { get; set; }
         public virtual DbSet<SetMerchantTypeRecord> SetMerchantTypeRecord { get; set; }
         public virtual DbSet<SmallStoreHouse> SmallStoreHouse { get; set; }
+        public virtual DbSet<SmallStoreQuotaRecord> SmallStoreQuotaRecord { get; set; }
         public virtual DbSet<SpOrderNos> SpOrderNos { get; set; }
         public virtual DbSet<StoreBalance> StoreBalance { get; set; }
         public virtual DbSet<StoreChangeHistory> StoreChangeHistory { get; set; }
@@ -12227,6 +12228,48 @@ namespace MySystem.Models
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<SmallStoreQuotaRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ApplyId).HasColumnType("int(11)");
+
+                entity.Property(e => e.BeforeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OperateType).HasColumnType("int(11)");
+
+                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)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UseAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<SpOrderNos>(entity =>
             {
                 entity.HasKey(e => e.OrderNo)
@@ -14577,6 +14620,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.SmallStoreDeposit).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.Sort).HasColumnType("int(11)");
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");

+ 1 - 1
wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js

@@ -320,7 +320,7 @@ layui.config({
                 cancel: function () {
                 }
             });
-            $("#excelTemp").html('<a href="/excelfile/模板文件.xlsx">点击下载模板文件</a>');
+            $("#excelTemp");
         }
         , ExportExcel: function () {
             var userdata = '';