Parcourir la source

保存广电卡激活表格中的信息到新建的广电卡商户表

lcl il y a 1 an
Parent
commit
bb60c314a6

+ 50 - 1
AppStart/Helper/SycnSpServer/SycnSpBindService.cs

@@ -180,7 +180,7 @@ namespace MySystem
                     PxcModels.WebCMSEntities db = new PxcModels.WebCMSEntities();
                     DateTime start = DateTime.Now.AddDays(-60);
                     int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/BindRecordId.txt")));
-                    var Binds = spdb.BindRecord.Select(m => new { m.Id, m.CreateTime, m.Status, m.MerNo, m.MerSnNo, m.ProductType, m.Remark, m.Field1, m.Field2, m.Field3, m.Field5, m.SeoTitle, m.SeoKeyword }).Where(m => m.Id >= StartId && m.CreateTime >= start && m.ProductType == "14" && m.Status == 1).OrderByDescending(m => m.Id).ToList();
+                    var Binds = spdb.BindRecord.Select(m => new { m.Id, m.CreateTime, m.Status, m.MerNo, m.MerSnNo, m.ProductType, m.Remark, m.Field1, m.Field2, m.Field3, m.Field5, m.SeoTitle, m.SeoKeyword, m.SeoDescription }).Where(m => m.Id >= StartId && m.CreateTime >= start && m.ProductType == "14" && m.Status == 1).OrderByDescending(m => m.Id).ToList();
                     foreach (var Bind in Binds)
                     {
                         try
@@ -232,6 +232,55 @@ namespace MySystem
                                     }).Entity;
                                     db.SaveChanges();
                                 }
+                                PxcModels.SimposMerchantInfo sim = db.SimposMerchantInfo.FirstOrDefault(m => m.KqMerNo == Bind.MerNo);
+                                if (sim == null)
+                                {
+                                    string json = Bind.SeoDescription;
+                                    string ProductName = ""; //商品名称
+                                    string ActivityName = ""; //促销活动名称
+                                    string ProductTypeName = ""; //商品类型名称
+                                    string ActStatusName = ""; //激活状态名称
+                                    string ActAmount = ""; //实付金额
+                                    string EmployeeNo = ""; //员工工号
+                                    string EmployeeName = ""; //员工姓名
+                                    if(!string.IsNullOrEmpty(json))
+                                    {
+                                        JsonData jsonObj = JsonMapper.ToObject(json);
+                                        // string OrderNo = jsonObj["订单编码"].ToString();
+                                        // string CreateDate = jsonObj["订单创建时间"].ToString();
+                                        // string PhoneNumber = jsonObj["选择号码"].ToString();
+                                        // string HasFirstCharge = jsonObj["是否有首充"].ToString();
+                                        // string FirstChargeAmount = jsonObj["首充金额(元)"].ToString();
+                                        // string Province = jsonObj["号码归属省份"].ToString();
+                                        // string City = jsonObj["号码归属地市"].ToString();
+                                        // string OrderStatus = jsonObj["订单状态"].ToString();
+                                        // string ActDate = jsonObj["激活时间"].ToString();
+                                        // string SimNo = jsonObj["SIM卡号"].ToString();
+
+                                        ProductName = jsonObj["商品名称"].ToString();
+                                        ActivityName = jsonObj["促销活动名称"].ToString();
+                                        ProductTypeName = jsonObj["商品类型名称"].ToString();
+                                        ActAmount = jsonObj["实付金额(元)"].ToString();
+                                        ActStatusName = jsonObj["激活状态名称"].ToString();
+                                        EmployeeNo = jsonObj["BOSS员工工号"].ToString();
+                                        EmployeeName = jsonObj["账号姓名"].ToString();
+                                    }
+                                    sim = db.SimposMerchantInfo.Add(new PxcModels.SimposMerchantInfo()
+                                    {
+                                        Id = add.Id,
+                                        CreateDate = Bind.CreateTime,
+                                        KqMerNo = Bind.MerNo,
+                                        MerchantNo = Bind.MerNo.Length > 16 ? Bind.MerNo.Substring(0, 16) : Bind.MerNo,
+                                        ProductName = ProductName,
+                                        ActivityName = ActivityName,
+                                        ProductTypeName = ProductTypeName,
+                                        ActStatusName = ActStatusName,
+                                        ActAmount = decimal.Parse(ActAmount),
+                                        EmployeeNo = EmployeeNo,
+                                        EmployeeName = EmployeeName,
+                                    }).Entity;
+                                    db.SaveChanges();
+                                }
                                 pos.BindMerchantId = add.Id;
                                 pos.LastMerchantId = add.Id;
                                 pos.IsFirst = 1;

+ 1 - 1
PxcModels/PosMachinesTwo.cs

@@ -61,9 +61,9 @@ namespace MySystem.PxcModels
         public int RecycStatus { get; set; }
         public string OutBatchNo { get; set; }
         public int WithholdFlag { get; set; }
-        public int LastMerchantId { get; set; }
         public int IsSupplement { get; set; }
         public int IsOpAct { get; set; }
+        public int LastMerchantId { get; set; }
         public int CardType { get; set; }
     }
 }

+ 51 - 0
PxcModels/SimposMerchantInfo.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class SimposMerchantInfo
+    {
+        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 string EmployeeName { get; set; }
+        public string EmployeeNo { get; set; }
+        public decimal ActAmount { get; set; }
+        public string ActStatusName { get; set; }
+        public string ProductTypeName { get; set; }
+        public string ActivityName { get; set; }
+        public string ProductName { get; set; }
+        public int Type { get; set; }
+        public int StandardMonths { get; set; }
+        public int StandardStatus { get; set; }
+        public int TopUserId { get; set; }
+        public int MerUserType { get; set; }
+        public string Remark { get; set; }
+        public int BrandId { get; set; }
+        public int SnStoreId { get; set; }
+        public DateTime? MerStandardDate { get; set; }
+        public int SnType { get; set; }
+        public int MerUserId { get; set; }
+        public int UserId { get; set; }
+        public string MgrName { get; set; }
+        public int DirectUserId { get; set; }
+        public int ActiveStatus { get; set; }
+        public int MerStatus { get; set; }
+        public string KqSnNo { get; set; }
+        public string KqMerNo { get; set; }
+        public string MerIdcardNo { get; set; }
+        public string MerRealName { get; set; }
+        public string MerchantMobile { get; set; }
+        public string MerchantName { get; set; }
+        public string MerchantNo { get; set; }
+    }
+}

Fichier diff supprimé car celui-ci est trop grand
+ 359 - 125
PxcModels/WebCMSEntities.cs


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff