Ver código fonte

2020/05/25 Jessica
Actions:
1.簡化更新流程 資料表

Jessica.Tseng 4 anos atrás
pai
commit
3ff61e2919

+ 7 - 7
EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj

@@ -178,6 +178,10 @@
     <Compile Include="MainDBContextMigrations\202004230638409_AddMachine_ConnectorPowerType_Geo.Designer.cs">
       <DependentUpon>202004230638409_AddMachine_ConnectorPowerType_Geo.cs</DependentUpon>
     </Compile>
+    <Compile Include="MainDBContextMigrations\202005250837509_Modify_UpdateFirmwareLogic.cs" />
+    <Compile Include="MainDBContextMigrations\202005250837509_Modify_UpdateFirmwareLogic.Designer.cs">
+      <DependentUpon>202005250837509_Modify_UpdateFirmwareLogic.cs</DependentUpon>
+    </Compile>
     <Compile Include="MainDBContextMigrations\Configuration.cs" />
     <Compile Include="MeterValueDBContext.cs" />
     <Compile Include="MeterValueDBContextMigrations\201907150814558_Init.cs" />
@@ -205,19 +209,12 @@
     <Compile Include="Models\Database\ConnectorMeterValueRecord.cs" />
     <Compile Include="Models\Database\ConnectorStatus.cs" />
     <Compile Include="Models\Database\Customer.cs" />
-    <Compile Include="Models\Database\CustomerMachineComponent.cs" />
     <Compile Include="Models\Database\Machine.cs" />
-    <Compile Include="Models\Database\MachineComponent.cs" />
     <Compile Include="Models\Database\MachineConfiguration.cs" />
     <Compile Include="Models\Database\MachineConnectionLog.cs" />
     <Compile Include="Models\Database\MachineError.cs" />
-    <Compile Include="Models\Database\MachineModel.cs" />
     <Compile Include="Models\Database\MachineOperateRecord.cs" />
-    <Compile Include="Models\Database\MachinePart.cs" />
-    <Compile Include="Models\Database\MachineVersion.cs" />
     <Compile Include="Models\Database\MachineVersionFile.cs" />
-    <Compile Include="Models\Database\PublishVersion.cs" />
-    <Compile Include="Models\Database\PublishVersionFile.cs" />
     <Compile Include="Models\Database\ServerMessage.cs" />
     <Compile Include="Models\Database\TransactionDataRecord.cs" />
     <Compile Include="Models\Database\TransactionRecord.cs" />
@@ -324,6 +321,9 @@
     <EmbeddedResource Include="MainDBContextMigrations\202004230638409_AddMachine_ConnectorPowerType_Geo.resx">
       <DependentUpon>202004230638409_AddMachine_ConnectorPowerType_Geo.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="MainDBContextMigrations\202005250837509_Modify_UpdateFirmwareLogic.resx">
+      <DependentUpon>202005250837509_Modify_UpdateFirmwareLogic.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="MeterValueDBContextMigrations\201907150814558_Init.resx">
       <DependentUpon>201907150814558_Init.cs</DependentUpon>
     </EmbeddedResource>

+ 3 - 25
EVCB_OCPP.Domain/MainDBContext.cs

@@ -39,29 +39,23 @@
 
         public virtual DbSet<Customer> Customer { get; set; }
 
-        public virtual DbSet<CustomerMachineComponent> CustomerMachineComponent { get; set; }
 
         public virtual DbSet<Machine> Machine { get; set; }
 
-        public virtual DbSet<MachineComponent> MachineComponent { get; set; }
+
 
         public virtual DbSet<MachineConfiguration> MachineConfiguration { get; set; }
 
         public virtual DbSet<MachineError> MachineError { get; set; }
 
-        public virtual DbSet<MachineModel> MachineModel { get; set; }
 
         public virtual DbSet<MachineOperateRecord> MachineOperateRecord { get; set; }
 
-        public virtual DbSet<MachineVersion> MachineVersion { get; set; }
-
-        public virtual DbSet<MachinePart> MachinePart { get; set; }
+ 
 
         public virtual DbSet<MachineVersionFile> MachineVersionFile { get; set; }
 
-        public virtual DbSet<PublishVersion> PublishVersion { get; set; }
 
-        public virtual DbSet<PublishVersionFile> PublishVersionFile { get; set; }
 
         public virtual DbSet<ServerMessage> ServerMessage { get; set; }
 
@@ -71,23 +65,7 @@
 
         protected override void OnModelCreating(DbModelBuilder modelBuilder)
         {
-            modelBuilder.Entity<MachineVersion>()
-                .HasRequired(a => a.Machine)
-                .WithMany()
-                .HasForeignKey(a => a.MachineId);
-
-
-            modelBuilder.Entity<Machine>()
-                .HasOptional(m => m.FW_MachineVersion)
-                .WithMany()
-                .HasForeignKey(m => m.FW_AssignedMachineVersionId);
-
-
-            modelBuilder.Entity<PublishVersion>()
-                .HasRequired(a => a.CustomerMachineComponent)
-                .WithMany()
-                .HasForeignKey(a => a.CustomerMachineComponentId)
-                .WillCascadeOnDelete(false);
+           
 
 
             modelBuilder.Entity<Machine>().Property(x => x.Longitude).HasPrecision(10, 6);

+ 29 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/202005250837509_Modify_UpdateFirmwareLogic.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class Modify_UpdateFirmwareLogic : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(Modify_UpdateFirmwareLogic));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "202005250837509_Modify_UpdateFirmwareLogic"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 171 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/202005250837509_Modify_UpdateFirmwareLogic.cs

@@ -0,0 +1,171 @@
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class Modify_UpdateFirmwareLogic : DbMigration
+    {
+        public override void Up()
+        {
+            DropForeignKey("dbo.CustomerMachineComponent", "CustomerId", "dbo.Customer");
+            DropForeignKey("dbo.MachineComponent", "MachineModelId", "dbo.MachineModel");
+            DropForeignKey("dbo.MachineComponent", "MachinePartId", "dbo.MachinePart");
+            DropForeignKey("dbo.CustomerMachineComponent", "MachineComponentId", "dbo.MachineComponent");
+            DropForeignKey("dbo.MachineVersion", "MachineId", "dbo.Machine");
+            DropForeignKey("dbo.MachineVersionFile", "MachineVersionId", "dbo.MachineVersion");
+            DropForeignKey("dbo.PublishVersion", "CustomerMachineComponentId", "dbo.CustomerMachineComponent");
+            DropForeignKey("dbo.PublishVersionFile", "PublishVersionId", "dbo.PublishVersion");
+            DropForeignKey("dbo.PublishVersionFile", "UploadFileId", "dbo.UploadFile");
+            DropForeignKey("dbo.MachineVersion", "PublishVersionId", "dbo.PublishVersion");
+            DropForeignKey("dbo.Machine", "FW_AssignedMachineVersionId", "dbo.MachineVersion");
+            DropForeignKey("dbo.Machine", "MachineModelId", "dbo.MachineModel");
+            DropForeignKey("dbo.Machine", "MachinePartId", "dbo.MachinePart");
+            DropIndex("dbo.CustomerMachineComponent", new[] { "CustomerId" });
+            DropIndex("dbo.CustomerMachineComponent", new[] { "MachineComponentId" });
+            DropIndex("dbo.MachineComponent", new[] { "MachineModelId" });
+            DropIndex("dbo.MachineComponent", new[] { "MachinePartId" });
+            DropIndex("dbo.Machine", new[] { "FW_AssignedMachineVersionId" });
+            DropIndex("dbo.Machine", new[] { "MachineModelId" });
+            DropIndex("dbo.Machine", new[] { "MachinePartId" });
+            DropIndex("dbo.MachineVersion", new[] { "PublishVersionId" });
+            DropIndex("dbo.MachineVersion", new[] { "MachineId" });
+            DropIndex("dbo.MachineVersionFile", new[] { "MachineVersionId" });
+            DropIndex("dbo.PublishVersion", new[] { "CustomerMachineComponentId" });
+            DropIndex("dbo.PublishVersionFile", new[] { "PublishVersionId" });
+            DropIndex("dbo.PublishVersionFile", new[] { "UploadFileId" });
+            AddColumn("dbo.Machine", "VendorId", c => c.String(maxLength: 50));
+            AddColumn("dbo.Machine", "ModelName", c => c.String(maxLength: 50));
+            AddColumn("dbo.MachineVersionFile", "MachineId", c => c.Guid(nullable: false));
+            AddColumn("dbo.UploadFile", "VendorId", c => c.String(maxLength: 50));
+            AddColumn("dbo.UploadFile", "ModelName", c => c.String(maxLength: 50));
+            AddColumn("dbo.UploadFile", "ModuleId", c => c.Int(nullable: false));
+            DropColumn("dbo.Machine", "FW_AssignedMachineVersionId");
+            DropColumn("dbo.Machine", "MachineModelId");
+            DropColumn("dbo.Machine", "MachinePartId");
+            DropColumn("dbo.MachineVersionFile", "MachineVersionId");
+            DropTable("dbo.CustomerMachineComponent");
+            DropTable("dbo.MachineComponent");
+            DropTable("dbo.MachineModel");
+            DropTable("dbo.MachinePart");
+            DropTable("dbo.MachineVersion");
+            DropTable("dbo.PublishVersion");
+            DropTable("dbo.PublishVersionFile");
+        }
+        
+        public override void Down()
+        {
+            CreateTable(
+                "dbo.PublishVersionFile",
+                c => new
+                    {
+                        Id = c.Int(nullable: false, identity: true),
+                        PublishVersionId = c.Int(nullable: false),
+                        UploadFileId = c.Guid(nullable: false),
+                        Seq = c.Int(nullable: false),
+                    })
+                .PrimaryKey(t => t.Id);
+            
+            CreateTable(
+                "dbo.PublishVersion",
+                c => new
+                    {
+                        Id = c.Int(nullable: false, identity: true),
+                        CreatedOn = c.DateTime(nullable: false),
+                        Version = c.Int(nullable: false),
+                        CustomerMachineComponentId = c.Int(nullable: false),
+                    })
+                .PrimaryKey(t => t.Id);
+            
+            CreateTable(
+                "dbo.MachineVersion",
+                c => new
+                    {
+                        Id = c.Int(nullable: false, identity: true),
+                        CreatedOn = c.DateTime(nullable: false),
+                        PublishVersionId = c.Int(nullable: false),
+                        MachineId = c.String(nullable: false, maxLength: 36),
+                        UpdatedOn = c.DateTime(),
+                    })
+                .PrimaryKey(t => t.Id);
+            
+            CreateTable(
+                "dbo.MachinePart",
+                c => new
+                    {
+                        Id = c.Int(nullable: false),
+                        Desc = c.String(maxLength: 36),
+                    })
+                .PrimaryKey(t => t.Id);
+            
+            CreateTable(
+                "dbo.MachineModel",
+                c => new
+                    {
+                        Id = c.Int(nullable: false, identity: true),
+                        Name = c.String(maxLength: 36),
+                    })
+                .PrimaryKey(t => t.Id);
+            
+            CreateTable(
+                "dbo.MachineComponent",
+                c => new
+                    {
+                        Id = c.Int(nullable: false, identity: true),
+                        MachineModelId = c.Int(nullable: false),
+                        GunAmt = c.Int(),
+                        MachinePartId = c.Int(nullable: false),
+                        ModelName = c.String(),
+                    })
+                .PrimaryKey(t => t.Id);
+            
+            CreateTable(
+                "dbo.CustomerMachineComponent",
+                c => new
+                    {
+                        Id = c.Int(nullable: false, identity: true),
+                        CustomerId = c.Guid(nullable: false),
+                        MachineComponentId = c.Int(nullable: false),
+                        CreatedOn = c.DateTime(nullable: false),
+                        CreatedBy = c.String(maxLength: 50),
+                    })
+                .PrimaryKey(t => t.Id);
+            
+            AddColumn("dbo.MachineVersionFile", "MachineVersionId", c => c.Int(nullable: false));
+            AddColumn("dbo.Machine", "MachinePartId", c => c.Int(nullable: false));
+            AddColumn("dbo.Machine", "MachineModelId", c => c.Int(nullable: false));
+            AddColumn("dbo.Machine", "FW_AssignedMachineVersionId", c => c.Int());
+            DropColumn("dbo.UploadFile", "ModuleId");
+            DropColumn("dbo.UploadFile", "ModelName");
+            DropColumn("dbo.UploadFile", "VendorId");
+            DropColumn("dbo.MachineVersionFile", "MachineId");
+            DropColumn("dbo.Machine", "ModelName");
+            DropColumn("dbo.Machine", "VendorId");
+            CreateIndex("dbo.PublishVersionFile", "UploadFileId");
+            CreateIndex("dbo.PublishVersionFile", "PublishVersionId");
+            CreateIndex("dbo.PublishVersion", "CustomerMachineComponentId");
+            CreateIndex("dbo.MachineVersionFile", "MachineVersionId");
+            CreateIndex("dbo.MachineVersion", "MachineId");
+            CreateIndex("dbo.MachineVersion", "PublishVersionId");
+            CreateIndex("dbo.Machine", "MachinePartId");
+            CreateIndex("dbo.Machine", "MachineModelId");
+            CreateIndex("dbo.Machine", "FW_AssignedMachineVersionId");
+            CreateIndex("dbo.MachineComponent", "MachinePartId");
+            CreateIndex("dbo.MachineComponent", "MachineModelId");
+            CreateIndex("dbo.CustomerMachineComponent", "MachineComponentId");
+            CreateIndex("dbo.CustomerMachineComponent", "CustomerId");
+            AddForeignKey("dbo.Machine", "MachinePartId", "dbo.MachinePart", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.Machine", "MachineModelId", "dbo.MachineModel", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.Machine", "FW_AssignedMachineVersionId", "dbo.MachineVersion", "Id");
+            AddForeignKey("dbo.MachineVersion", "PublishVersionId", "dbo.PublishVersion", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.PublishVersionFile", "UploadFileId", "dbo.UploadFile", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.PublishVersionFile", "PublishVersionId", "dbo.PublishVersion", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.PublishVersion", "CustomerMachineComponentId", "dbo.CustomerMachineComponent", "Id");
+            AddForeignKey("dbo.MachineVersionFile", "MachineVersionId", "dbo.MachineVersion", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.MachineVersion", "MachineId", "dbo.Machine", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.CustomerMachineComponent", "MachineComponentId", "dbo.MachineComponent", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.MachineComponent", "MachinePartId", "dbo.MachinePart", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.MachineComponent", "MachineModelId", "dbo.MachineModel", "Id", cascadeDelete: true);
+            AddForeignKey("dbo.CustomerMachineComponent", "CustomerId", "dbo.Customer", "Id", cascadeDelete: true);
+        }
+    }
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 120 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/202005250837509_Modify_UpdateFirmwareLogic.resx


+ 1 - 2
EVCB_OCPP.Domain/Models/Database/Customer.cs

@@ -106,9 +106,8 @@ namespace EVCB_OCPP.Domain.Models.Database
         {
             Id = Guid.NewGuid();
         }
-
         
-        public virtual ICollection<CustomerMachineComponent> CustomerMachineComponents { get; set; }
+       
        
 
     }

+ 0 - 40
EVCB_OCPP.Domain/Models/Database/CustomerMachineComponent.cs

@@ -1,40 +0,0 @@
-namespace EVCB_OCPP.Domain.Models.Database
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.ComponentModel.DataAnnotations;
-    using System.ComponentModel.DataAnnotations.Schema;
-    using System.Data.Entity.Spatial;
-
-    /// <summary>
-    /// 客戶所使用的機器元件
-    /// </summary>
-    [Table("CustomerMachineComponent")]
-    public partial class CustomerMachineComponent
-    {
-        [Key]
-        public int Id { get; set; }
-
-        /// <summary>
-        /// 客戶ID
-        /// </summary>
-        public Guid CustomerId { get; set; }
-
-        [ForeignKey("CustomerId")]
-        public virtual Customer Customer { get; set; }
-        /// <summary>
-        /// 設定好的機器元件Id
-        /// </summary>
-        public int MachineComponentId { get; set; }
-
-        [ForeignKey("MachineComponentId")]
-        public virtual MachineComponent MachineComponent { get; set; }
-
-      
-        public DateTime CreatedOn { get; set; }
-
-        [StringLength(50)]     
-        public string CreatedBy { get; set; }
-    }
-}

+ 21 - 43
EVCB_OCPP.Domain/Models/Database/Machine.cs

@@ -13,7 +13,7 @@
     public partial class Machine
     {
         public Machine()
-        {            
+        {
             Id = Guid.NewGuid().ToString();
             ChargePointSerialNumber = string.Empty;
             ChargeBoxSerialNumber = string.Empty;
@@ -49,9 +49,9 @@
         /// chargeBoxSerialNumber
         /// </summary>    
         [StringLength(25)]
-        public string ChargeBoxSerialNumber { get; set; }     
+        public string ChargeBoxSerialNumber { get; set; }
+
 
-       
 
         /// <summary>
         /// chargePointModel
@@ -99,13 +99,13 @@
         /// <summary>
         /// 建立者
         /// </summary>
-        [StringLength(50)]      
+        [StringLength(50)]
         public string CreatedBy { get; set; }
 
         /// <summary>
         /// 描述
         /// </summary>
-        [StringLength(100)]     
+        [StringLength(100)]
         public string Comment { get; set; }
 
         /// <summary>
@@ -117,42 +117,30 @@
         /// 是否為AC電源 true為ac,false為dc
         /// </summary>
         public bool AC { get; set; }
-      
+
 
         /// <summary>
         /// 充電槍個數
         /// </summary>
         public int GunAmt { get; set; }
 
-        
+
 
         /// <summary>
         /// 心跳包更新時間
         /// </summary>
         public DateTime HeartbeatUpdatedOn { get; set; }
 
-
-     
-
-
-
         /// <summary>
         /// 機器回報的韌體版本編號
         /// </summary>
-        public int? FW_VersionReport { get; set; }      
+        public int? FW_VersionReport { get; set; }
 
-      
 
         /// <summary>
         /// 機器被指派的韌體版本編號
         /// </summary>
         public int? FW_AssignedVersion { get; set; }
-      
-
-        /// <summary>
-        /// 目前被指派更新的韌體 MachineVersion號碼
-        /// </summary>
-        public int? FW_AssignedMachineVersionId { get; set; }      
 
         /// <summary>
         /// 是否在線
@@ -168,32 +156,9 @@
         public int ConnectionType { get; set; }
 
 
-        /// <summary>
-        /// 機器的模組 Ref MachineModel
-        /// </summary>
-        public int MachineModelId { get; set; }
-
-        [ForeignKey("MachineModelId")]
-        public virtual MachineModel MachineModel { get; set; }
-
-        /// <summary>
-        /// 客戶自訂樁號
-        /// </summary>
-        public int MachinePartId { get; set; }
-
-        [ForeignKey("MachinePartId")]
-        public virtual MachinePart MachinePart { get; set; }
-
-      
-
         [ForeignKey("CustomerId")]
         public virtual Customer Customer { get; set; }
 
-      
-
-        public virtual MachineVersion FW_MachineVersion { get; set; }       
-
-     
 
         /// <summary>
         /// 斷網時間
@@ -228,6 +193,19 @@
         public decimal Longitude { set; get; }
 
 
+        /// <summary>
+        /// VendorId
+        /// </summary>
+        [StringLength(50)]
+        public string VendorId { get; set; }
+
+
+        /// <summary>
+        /// ModelName
+        /// </summary>
+        [StringLength(50)]
+        public string ModelName { get; set; }
+
 
 
     }

+ 0 - 47
EVCB_OCPP.Domain/Models/Database/MachineComponent.cs

@@ -1,47 +0,0 @@
-namespace EVCB_OCPP.Domain.Models.Database
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.ComponentModel.DataAnnotations;
-    using System.ComponentModel.DataAnnotations.Schema;
-    using System.Data.Entity.Spatial;
-
-    /// <summary>
-    /// 機器的組成項目
-    /// </summary>
-    [Table("MachineComponent")]
-    public partial class MachineComponent
-    {
-        [Key]
-        public int Id { get; set; }
-
-        /// <summary>
-        /// 機器的MachineModelId
-        /// </summary>
-        public int MachineModelId { get; set; }
-
-        [ForeignKey("MachineModelId")]
-        public virtual MachineModel MachineModel { get; set; }
-
-        /// <summary>
-        /// 槍數
-        /// </summary>
-        public int? GunAmt { get; set; }
-
-        /// <summary>
-        /// 機器零件ID
-        /// </summary>
-        public int MachinePartId { get; set; }
-
-        [ForeignKey("MachinePartId")]
-        public virtual MachinePart MachinePart { get; set; }
-
-        /// <summary>
-        /// 機器 Model Name
-        /// </summary>
-        public String ModelName { get; set; }
-
-     
-    }
-}

+ 0 - 25
EVCB_OCPP.Domain/Models/Database/MachineModel.cs

@@ -1,25 +0,0 @@
-namespace EVCB_OCPP.Domain.Models.Database
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.ComponentModel.DataAnnotations;
-    using System.ComponentModel.DataAnnotations.Schema;
-    using System.Data.Entity.Spatial;
-
-    /// <summary>
-    /// 機器的模組
-    /// { Id = 0, Name = "Beaglebone" },
-    /// { Id = 1, Name = "IPC" },
-    /// { Id = 2, Name = "HMI" }
-    /// </summary>
-    [Table("MachineModel")]
-    public partial class MachineModel
-    {
-        [Key]
-        public int Id { get; set; }
-
-        [StringLength(36)]       
-        public string Name { get; set; }
-    }
-}

+ 0 - 29
EVCB_OCPP.Domain/Models/Database/MachinePart.cs

@@ -1,29 +0,0 @@
-namespace EVCB_OCPP.Domain.Models.Database
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.ComponentModel.DataAnnotations;
-    using System.ComponentModel.DataAnnotations.Schema;
-
-    /// <summary>
-    /// 充電樁零件
-    /// </summary>
-    [Table("MachinePart")]
-    public partial class MachinePart
-    {
-        public MachinePart()
-        {
-        }
-
-        [DatabaseGenerated(DatabaseGeneratedOption.None)]
-        [Key]
-        public int Id { get; set; }
-
-        /// <summary>
-        /// 描述
-        /// </summary>
-        [StringLength(36)]
-        public string Desc { get; set; }
-    }
-}

+ 0 - 58
EVCB_OCPP.Domain/Models/Database/MachineVersion.cs

@@ -1,58 +0,0 @@
-namespace EVCB_OCPP.Domain.Models.Database
-{
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.ComponentModel.DataAnnotations;
-    using System.ComponentModel.DataAnnotations.Schema;
-    using System.Data.Entity.Spatial;
-
-    /// <summary>
-    /// 機器的版本發佈
-    /// </summary>
-    [Table("MachineVersion")]
-    public partial class MachineVersion
-    {
-        public MachineVersion()
-        {
-            MachineVersionFiles = new List<MachineVersionFile>();
-        }
-
-        [Key]
-        public int Id { get; set; }
-
-      
-        [Required]
-        public DateTime CreatedOn { get; set; }
-
-        /// <summary>
-        /// 發佈版本ID
-        /// </summary>
-        [DisplayName("Version")]
-        [Required]
-        public int PublishVersionId { get; set; }
-
-
-        [Required]
-        [StringLength(36)]
-        public string MachineId { get; set; }
-
-        /// <summary>
-        /// 更新日期
-        /// </summary>
-       
-        public DateTime? UpdatedOn { get; set; }
-
-        //[ForeignKey("MachineId")]
-        public virtual Machine Machine { get; set; }
-
-        [ForeignKey("PublishVersionId")]        
-        public virtual PublishVersion PublishVersion { get; set; }
-
-        public virtual ICollection<MachineVersionFile> MachineVersionFiles { get; set; }
-
-        //[InverseProperty("MachineId")]
-        //public virtual ICollection<Machine> Machines { get; set; }
-
-    }
-}

+ 3 - 6
EVCB_OCPP.Domain/Models/Database/MachineVersionFile.cs

@@ -15,7 +15,6 @@
     {
         [Key]
         public int Id { get; set; }
-
       
         [Required]
         public DateTime CreatedOn { get; set; }
@@ -25,8 +24,8 @@
         /// </summary>     
         public DateTime? UpdatedOn { get; set; }
 
-        [Required]
-        public int MachineVersionId { get; set; }
+      
+        public Guid MachineId { get; set; }
 
         [Required]
         public Guid UploadFileId { get; set; }
@@ -40,9 +39,7 @@
         /// 排序
         /// </summary>
         public int Seq { get; set; }
-
-        [ForeignKey("MachineVersionId")]
-        public virtual MachineVersion MachineVersion { get; set; }
+      
 
         [ForeignKey("UploadFileId")]
         public virtual UploadFile UploadFile { get; set; }

+ 0 - 48
EVCB_OCPP.Domain/Models/Database/PublishVersion.cs

@@ -1,48 +0,0 @@
-namespace EVCB_OCPP.Domain.Models.Database
-{
- 
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.ComponentModel.DataAnnotations;
-    using System.ComponentModel.DataAnnotations.Schema;
-    using System.Data.Entity.Spatial;
-
-    /// <summary>
-    /// 版本發佈
-    /// </summary>
-    [Table("PublishVersion")]
-    public partial class PublishVersion
-    {
-        public PublishVersion()
-        {
-            PublishVersionFiles = new List<PublishVersionFile>();
-        }
-
-        [Key]
-        public int Id { get; set; }
-
-      
-        [Required]
-        public DateTime CreatedOn { get; set; }
-
-        /// <summary>
-        /// 自動遞增的版號
-        /// </summary>
-        [DisplayName("Version")]
-        [Required]
-        public int Version { get; set; }
-      
-
-        /// <summary>
-        /// 客戶所使用的機器元件
-        /// </summary>
-        [Required]
-        public int CustomerMachineComponentId { get; set; }
-      
-
-        public virtual ICollection<PublishVersionFile> PublishVersionFiles { get; set; }
-
-        public virtual CustomerMachineComponent CustomerMachineComponent { get; set; }
-    }
-}

+ 0 - 37
EVCB_OCPP.Domain/Models/Database/PublishVersionFile.cs

@@ -1,37 +0,0 @@
-namespace EVCB_OCPP.Domain.Models.Database
-{
-    using EVCB_OCPP.Domain.Models.Database;
-    using System;
-    using System.Collections.Generic;
-    using System.ComponentModel;
-    using System.ComponentModel.DataAnnotations;
-    using System.ComponentModel.DataAnnotations.Schema;
-    using System.Data.Entity.Spatial;
-
-    /// <summary>
-    /// 版本發佈的檔案關連
-    /// </summary>
-    [Table("PublishVersionFile")]
-    public partial class PublishVersionFile
-    {
-        [Key]
-        public int Id { get; set; }
-
-        [Required]
-        public int PublishVersionId { get; set; }
-
-        [Required]
-        public Guid UploadFileId { get; set; }
-
-        /// <summary>
-        /// 排序
-        /// </summary>
-        public int Seq { get; set; }
-
-        [ForeignKey("PublishVersionId")]
-        public virtual PublishVersion PublishVersion { get; set; }
-
-        [ForeignKey("UploadFileId")]
-        public virtual UploadFile UploadFile { get; set; }
-    }
-}

+ 19 - 1
EVCB_OCPP.Domain/Models/Database/UploadFile.cs

@@ -86,6 +86,24 @@
         [StringLength(512)]
         public string FileUrl { get; set; }
 
-       
+        /// <summary>
+        /// VendorId
+        /// </summary>
+        [StringLength(50)]
+        public string VendorId { get; set; }
+
+
+        /// <summary>
+        /// ModelName
+        /// </summary>
+        [StringLength(50)]
+        public string ModelName { get; set; }
+
+        /// <summary>
+        /// ModuleId
+        /// </summary>      
+        public int ModuleId { get; set; }
+
+
     }
 }

+ 1 - 1
EVCB_OCPP.Domain/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("c4a64e3")]
+[assembly: AssemblyInformationalVersion("b2bb0b6")]

+ 1 - 1
EVCB_OCPP.MailService/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("c4a64e3")]
+[assembly: AssemblyInformationalVersion("b2bb0b6")]

+ 1 - 1
EVCB_OCPP.Packet/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("c4a64e3")]
+[assembly: AssemblyInformationalVersion("b2bb0b6")]

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff