Pengxy 10 ay önce
ebeveyn
işleme
5b27d75243
20 değiştirilmiş dosya ile 1632 ekleme ve 66 silme
  1. 19 2
      MicroServices/Business/Business.Application.Contracts/Sqe/ISqeExcelService.cs
  2. 96 0
      MicroServices/Business/Business.Application/LoggerHelper.cs
  3. 917 21
      MicroServices/Business/Business.Application/SqeManagement/SqeExcelService.cs
  4. 3 1
      MicroServices/Business/Business.Application/SystemJobManagement/SystemJobAppService.cs
  5. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/MES/SalesOrdDetail.cs
  6. 0 5
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process.cs
  7. 1 6
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process_data.cs
  8. 0 5
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process_standard.cs
  9. 0 5
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test.cs
  10. 0 5
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_data.cs
  11. 0 5
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_standard.cs
  12. 272 0
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_file_data.cs
  13. 0 5
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_file_upload.cs
  14. 40 0
      MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Sqe/BusinessSqeDbContext.cs
  15. 25 0
      MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Sqe/BusinessSqeDbContextFactory.cs
  16. 20 0
      MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Sqe/BussinessSqeDbContextOptionsConfigurer.cs
  17. 39 0
      MicroServices/Business/Business.EntityFrameworkCore/Repository/SqlRepositories/ISqeRepository.cs
  18. 173 0
      MicroServices/Business/Business.EntityFrameworkCore/Repository/SqlRepositories/SqeRepository.cs
  19. 8 5
      MicroServices/Business/Business.HttpApi/Controllers/SqeController.cs
  20. 18 0
      MicroServices/Business/QuartzSettings/logs/logs.txt

+ 19 - 2
MicroServices/Business/Business.Application.Contracts/Sqe/ISqeExcelService.cs

@@ -6,8 +6,7 @@ using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using Business;
-using Business.Dto;
-using Business.ResourceExamineManagement;
+using Business.StructuredDB.Sqe;
 using Volo.Abp.Application.Services;
 
 namespace Business.VSM
@@ -33,5 +32,23 @@ namespace Business.VSM
         /// <returns></returns>
         public DataTable ImportExcelSheetToDataTable_process(string filePath, string sheetName);
 
+
+        /// <summary>
+        /// 依据id,从sqe_file_upload和sqe_file_data,加载数据
+        /// </summary>
+        /// <param name="upload_id"></param>
+        /// <returns></returns>
+        public List<sqe_file_data> LoadData_file_data(int upload_id);
+
+        /// <summary>
+        /// 依据id,从sqe_file_upload和sqe_file_data,加载数据到因为数据表中
+        /// </summary>
+        /// <param name="upload_id"></param>
+        /// <param name="create_by"></param>
+        /// <param name="create_date"></param>
+        /// <param name="create_org"></param>
+        /// <returns></returns>
+        public string ImportData_From_Data(int upload_id, string create_by, DateTime create_date, string create_org);
+
     }
 }

+ 96 - 0
MicroServices/Business/Business.Application/LoggerHelper.cs

@@ -0,0 +1,96 @@
+using NLog;
+using System;
+
+namespace Business.VSM
+{
+    /// <summary>
+    /// nLog使用帮助类
+    /// </summary>
+    public class LoggerHelper
+    {
+        /// <summary>
+        /// 实例化nLog,即为获取配置文件相关信息(获取以当前正在初始化的类命名的记录器)
+        /// </summary>
+        private readonly NLog.Logger _logger = LogManager.GetCurrentClassLogger();
+
+        private static LoggerHelper _obj;
+
+        public static LoggerHelper _
+        {
+            get => _obj ?? (new LoggerHelper());
+            set => _obj = value;
+        }
+
+        #region Debug,调试
+        public void Debug(string msg)
+        {
+            _logger.Debug(msg);
+        }
+
+        public void Debug(string msg, Exception err)
+        {
+            _logger.Debug(err, msg);
+        }
+        #endregion
+
+        #region Info,信息
+        public void Info(string msg)
+        {
+            _logger.Info(msg);
+        }
+
+        public void Info(string msg, Exception err)
+        {
+            _logger.Info(err, msg);
+        }
+        #endregion
+
+        #region Warn,警告
+        public void Warn(string msg)
+        {
+            _logger.Warn(msg);
+        }
+
+        public void Warn(string msg, Exception err)
+        {
+            _logger.Warn(err, msg);
+        }
+        #endregion
+
+        #region Trace,追踪
+        public void Trace(string msg)
+        {
+            _logger.Trace(msg);
+        }
+
+        public void Trace(string msg, Exception err)
+        {
+            _logger.Trace(err, msg);
+        }
+        #endregion
+
+        #region Error,错误
+        public void Error(string msg)
+        {
+            _logger.Error(msg);
+        }
+
+        public void Error(string msg, Exception err)
+        {
+            _logger.Error(err, msg);
+        }
+        #endregion
+
+        #region Fatal,致命错误
+        public void Fatal(string msg)
+        {
+            _logger.Fatal(msg);
+        }
+
+        public void Fatal(string msg, Exception err)
+        {
+            _logger.Fatal(err, msg);
+        }
+        #endregion
+    }
+}

+ 917 - 21
MicroServices/Business/Business.Application/SqeManagement/SqeExcelService.cs

@@ -4,17 +4,12 @@ using System.Data;
 using System.IO;
 using System.Linq;
 using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using Business;
-using Business.Core.Utilities;
-using Business.Dto;
-using Business.ResourceExamineManagement;
+using Business.EntityFrameworkCore.SqlRepositories;
+using Business.StructuredDB.Sqe;
 using NPOI.HSSF.UserModel;
 using NPOI.SS.UserModel;
 using NPOI.XSSF.UserModel;
 using Volo.Abp.Application.Services;
-using Volo.Abp.MultiTenancy;
 
 namespace Business.VSM
 {
@@ -23,11 +18,37 @@ namespace Business.VSM
     /// </summary>
     public class SqeExcelService : ApplicationService, ISqeExcelService
     {
-        private readonly ICurrentTenant _currentTenant;
-        //LoggerHelper WLLog;
-        public SqeExcelService()
+        LoggerHelper WLLog;
+
+        private readonly ISqeRepository<sqe_cto_process> _sqe_cto_process;
+        private readonly ISqeRepository<sqe_cto_process_data> _sqe_cto_process_data;
+        private readonly ISqeRepository<sqe_cto_process_standard> _sqe_cto_process_standard;
+        private readonly ISqeRepository<sqe_cto_test> _sqe_cto_test;
+        private readonly ISqeRepository<sqe_cto_test_data> _sqe_cto_test_data;
+        private readonly ISqeRepository<sqe_cto_test_standard> _sqe_cto_test_standard;
+        private readonly ISqeRepository<sqe_file_upload> _sqe_file_upload;
+        private readonly ISqeRepository<sqe_file_data> _sqe_file_data;
+
+
+        public SqeExcelService(ISqeRepository<sqe_cto_process> sqe_cto_process
+            , ISqeRepository<sqe_cto_process_data> sqe_cto_process_data
+            , ISqeRepository<sqe_cto_process_standard> sqe_cto_process_standard
+            , ISqeRepository<sqe_cto_test> sqe_cto_test
+            , ISqeRepository<sqe_cto_test_data> sqe_cto_test_data
+            , ISqeRepository<sqe_cto_test_standard> sqe_cto_test_standard
+            , ISqeRepository<sqe_file_upload> sqe_file_upload
+            , ISqeRepository<sqe_file_data> sqe_file_data
+            )
         {
-           // WLLog = new LoggerHelper();
+            WLLog = new LoggerHelper();
+            _sqe_cto_process = sqe_cto_process;
+            _sqe_cto_process_data = sqe_cto_process_data;
+            _sqe_cto_process_standard = sqe_cto_process_standard;
+            _sqe_cto_test = sqe_cto_test;
+            _sqe_cto_test_data = sqe_cto_test_data;
+            _sqe_cto_test_standard = sqe_cto_test_standard;
+            _sqe_file_upload = sqe_file_upload;
+            _sqe_file_data = sqe_file_data;
         }
 
         /// <summary>
@@ -175,8 +196,7 @@ namespace Business.VSM
                                             }
                                             catch (Exception ex)
                                             {
-                                                //WLLog.Error("Excel导入问题:", ex);
-                                                new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题" + ex.Message, _currentTenant.Id.ToString());
+                                                WLLog.Error("Excel导入问题:", ex);
                                             }
                                         }
                                         break;
@@ -214,8 +234,7 @@ namespace Business.VSM
             }
             catch (Exception ex)
             {
-                //WLLog.Error("Excel导入问题:", ex);
-                new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题" + ex.Message, _currentTenant.Id.ToString());
+                WLLog.Error("Excel导入问题:", ex);
             }
             finally
             {
@@ -360,8 +379,7 @@ namespace Business.VSM
                                         }
                                         catch (Exception ex)
                                         {
-                                            //WLLog.Error("Excel导入问题:", ex);
-                                            new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题" + ex.Message, _currentTenant.Id.ToString());
+                                            WLLog.Error("Excel导入问题:", ex);
                                         }
 
                                         break;
@@ -399,8 +417,7 @@ namespace Business.VSM
             }
             catch (Exception ex)
             {
-                //WLLog.Error("Excel导入问题:", ex);
-                new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题" + ex.Message, _currentTenant.Id.ToString());
+                WLLog.Error("Excel导入问题:", ex);
             }
             finally
             {
@@ -455,8 +472,7 @@ namespace Business.VSM
             }
             catch (Exception ex)
             {
-                //WLLog.Error("Excel导入问题:", ex);
-                new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题"+ex.Message, _currentTenant.Id.ToString());
+                WLLog.Error("Excel导入问题:", ex);
             }
             finally
             {
@@ -469,5 +485,885 @@ namespace Business.VSM
             return tables;
         }
 
+
+
+        /// <summary>
+        /// 导入数据到检验表 sqe_cto_test、sqe_cto_test_standard、sqe_cto_test_data
+        /// </summary>
+        /// <param name="upload_id"></param>
+        /// <param name="create_by"></param>
+        /// <param name="create_date"></param>
+        /// <param name="create_org"></param>
+        /// <returns></returns>
+        public string ImportData_From_Data(int upload_id, string create_by, DateTime create_date, string create_org)
+        {
+            StringBuilder stringBuilder = new StringBuilder();
+            try
+            {
+
+                List<sqe_file_data> datas = LoadData_file_data(upload_id);
+                if (datas == null || datas.Count == 0)
+                {
+                    stringBuilder.AppendLine("导入数据信息不存在!");
+                    return stringBuilder.ToString();
+                }
+
+                string errorMsg;
+                sqe_cto_test test = File_data_ToModel_test(datas, create_by, create_date, create_org, out errorMsg);
+                if (errorMsg != null && errorMsg.Length > 0)
+                {
+                    stringBuilder.AppendLine(errorMsg);
+                    return stringBuilder.ToString();
+                }
+
+                _sqe_cto_test.BeginTransaction();
+                _sqe_cto_test.Insert(test);
+
+                errorMsg = null;
+                List<sqe_cto_test_standard> standards = File_data_ToModel_test_standard(datas, test, create_by, create_date, create_org, out errorMsg);
+                if (errorMsg != null && errorMsg.Length > 0)
+                {
+                    _sqe_cto_test.Rollback();
+                    stringBuilder.AppendLine(errorMsg);
+                    return stringBuilder.ToString();
+                }
+                _sqe_cto_test_standard.BeginTransaction();
+                _sqe_cto_test_standard.Insert(standards);
+
+                List<sqe_cto_test_data> test_Datas = File_data_ToModel_test_data(datas, test, standards, create_by, create_date, create_org, out errorMsg);
+                if (errorMsg != null && errorMsg.Length > 0)
+                {
+                    _sqe_cto_test.Rollback();
+                    _sqe_cto_test_standard.Rollback();
+                    stringBuilder.AppendLine(errorMsg);
+                    return stringBuilder.ToString();
+                }
+                _sqe_cto_test_data.Insert(test_Datas);
+                _sqe_cto_test.CommitTransaction();
+                _sqe_cto_test_standard.CommitTransaction();
+            }
+            catch (Exception ex)
+            {
+                stringBuilder.Append("数据导入失败!");
+            }
+            finally
+            {
+            }
+            return stringBuilder.ToString();
+        }
+
+        /// <summary>
+        /// 依据id,从sqe_file_upload和sqe_file_data,加载数据
+        /// </summary>
+        /// <param name="upload_id"></param>
+        /// <returns></returns>
+        public List<sqe_file_data> LoadData_file_data(int upload_id)
+        {
+            List<sqe_file_data> datas = _sqe_file_data.Select(a => a.file_id == upload_id).OrderBy(a => a.id).ToList();
+            return datas;
+        }
+
+
+        public sqe_cto_test File_data_ToModel_test(List<sqe_file_data> datas, string create_by, DateTime create_date, string create_org, out string errorMsg)
+        {
+            StringBuilder stringBuilder = new StringBuilder();
+
+            sqe_cto_test model = new sqe_cto_test();
+            DateTime timeValue;
+            decimal realValuel;
+            if (datas != null && datas.Count >= 5)
+            {
+                try
+                {
+                    sqe_file_data data = datas[1];
+                    if (DateTime.TryParse(data.c2, out timeValue))
+                    {
+                        model.product_time = timeValue;
+                    }
+                    else
+                    {
+                        model.product_time = DateTime.Parse("2000-01-01");
+                    }
+                    model.shift_no = data.c4;
+                    model.item_no = data.c6;
+                    model.item_name = data.c8;
+
+                    data = datas[2];
+                    model.material_batch = data.c2;
+                    if (decimal.TryParse(data.c4, out realValuel))
+                    {
+                        model.material_used = realValuel;
+                    }
+                    model.item_batch = data.c6;
+                    if (decimal.TryParse(data.c8, out realValuel))
+                    {
+                        model.item_qty = realValuel;
+                    }
+
+                    data = datas[3];
+                    model.op_pre = data.c2;
+                    model.op_pre_batch = data.c4;
+                    model.op_current = data.c6;
+                    model.op_batch = data.c8;
+
+                    data = datas[4];
+                    model.device_name = data.c2;
+                    model.device_no = data.c4;
+                    if (decimal.TryParse(data.c8, out realValuel))
+                    {
+                        model.sampling_number = realValuel;
+                    }
+                }
+                catch (Exception ex)
+                {
+                    WLLog.Error("Excel数据解析问题:", ex);
+                }
+                model.create_by = create_by;
+                model.create_date = create_date;
+                model.create_org = create_org;
+                errorMsg = string.Empty;
+                return model;
+            }
+            else
+            {
+                errorMsg = stringBuilder.ToString();
+                return null;
+            }
+        }
+
+        public List<sqe_cto_test_standard> File_data_ToModel_test_standard(List<sqe_file_data> datas, sqe_cto_test test, string create_by, DateTime create_date, string create_org, out string errorMsg)
+        {
+            StringBuilder stringBuilder = new StringBuilder();
+
+            List<sqe_cto_test_standard> modelList = new List<sqe_cto_test_standard>();
+            decimal realValuel;
+            if (datas != null && datas.Count >= 14)
+            {
+                try
+                {
+                    sqe_file_data dataRow = datas[6];
+                    #region 处理尺寸的表头
+                    if (dataRow.c3 != null && dataRow.c3.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c3;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    if (dataRow.c4 != null && dataRow.c4.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c4;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    if (dataRow.c5 != null && dataRow.c5.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c5;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    if (dataRow.c6 != null && dataRow.c6.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c6;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    if (dataRow.c7 != null && dataRow.c7.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c7;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    if (dataRow.c8 != null && dataRow.c8.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c8;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    if (dataRow.c9 != null && dataRow.c9.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c9;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    if (dataRow.c10 != null && dataRow.c10.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c10;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    if (dataRow.c11 != null && dataRow.c11.Length > 0)
+                    {
+                        sqe_cto_test_standard model = new sqe_cto_test_standard();
+                        model.standard_no = dataRow.c11;
+                        model.create_by = create_by;
+                        model.create_date = create_date;
+                        model.create_org = create_org;
+                        model.test_id = test.id;
+                        modelList.Add(model);
+                    }
+                    #endregion 处理尺寸的表头
+
+
+                    if (modelList.Count > 0)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c3);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c3;
+
+                        dataRow = datas[9];
+                        if (dataRow.c3 != null && decimal.TryParse(dataRow.c3, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c3 != null && decimal.TryParse(dataRow.c3, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c3 != null && decimal.TryParse(dataRow.c3, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c3 != null && decimal.TryParse(dataRow.c3, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c3 != null && decimal.TryParse(dataRow.c3, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+                    if (modelList.Count > 1)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c4);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c4;
+
+                        dataRow = datas[9];
+                        if (dataRow.c4 != null && decimal.TryParse(dataRow.c4, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c4 != null && decimal.TryParse(dataRow.c4, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c4 != null && decimal.TryParse(dataRow.c4, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c4 != null && decimal.TryParse(dataRow.c4, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c4 != null && decimal.TryParse(dataRow.c4, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+                    if (modelList.Count > 2)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c5);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c5;
+
+                        dataRow = datas[9];
+                        if (dataRow.c5 != null && decimal.TryParse(dataRow.c5, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c5 != null && decimal.TryParse(dataRow.c5, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c5 != null && decimal.TryParse(dataRow.c5, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c5 != null && decimal.TryParse(dataRow.c5, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c5 != null && decimal.TryParse(dataRow.c5, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+                    if (modelList.Count > 3)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c6);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c6;
+
+                        dataRow = datas[9];
+                        if (dataRow.c6 != null && decimal.TryParse(dataRow.c6, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c6 != null && decimal.TryParse(dataRow.c6, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c6 != null && decimal.TryParse(dataRow.c6, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c6 != null && decimal.TryParse(dataRow.c6, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c6 != null && decimal.TryParse(dataRow.c6, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+                    if (modelList.Count > 4)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c7);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c7;
+
+                        dataRow = datas[9];
+                        if (dataRow.c7 != null && decimal.TryParse(dataRow.c7, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c7 != null && decimal.TryParse(dataRow.c7, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c7 != null && decimal.TryParse(dataRow.c7, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c7 != null && decimal.TryParse(dataRow.c7, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c7 != null && decimal.TryParse(dataRow.c7, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+                    if (modelList.Count > 5)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c8);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c8;
+
+                        dataRow = datas[9];
+                        if (dataRow.c8 != null && decimal.TryParse(dataRow.c8, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c8 != null && decimal.TryParse(dataRow.c8, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c8 != null && decimal.TryParse(dataRow.c8, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c8 != null && decimal.TryParse(dataRow.c8, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c8 != null && decimal.TryParse(dataRow.c8, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+                    if (modelList.Count > 6)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c9);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c9;
+
+                        dataRow = datas[9];
+                        if (dataRow.c9 != null && decimal.TryParse(dataRow.c9, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c9 != null && decimal.TryParse(dataRow.c9, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c9 != null && decimal.TryParse(dataRow.c9, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c9 != null && decimal.TryParse(dataRow.c9, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c9 != null && decimal.TryParse(dataRow.c9, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+                    if (modelList.Count > 7)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c10);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c10;
+
+                        dataRow = datas[9];
+                        if (dataRow.c10 != null && decimal.TryParse(dataRow.c10, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c10 != null && decimal.TryParse(dataRow.c10, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c10 != null && decimal.TryParse(dataRow.c10, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c10 != null && decimal.TryParse(dataRow.c10, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c10 != null && decimal.TryParse(dataRow.c10, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+                    if (modelList.Count > 8)
+                    {
+                        sqe_cto_test_standard model = modelList[0];
+                        dataRow = datas[7];
+                        model.sampling_count = int.Parse(dataRow.c11);
+
+                        dataRow = datas[8];
+                        model.is_associated_size = dataRow.c11;
+
+                        dataRow = datas[9];
+                        if (dataRow.c11 != null && decimal.TryParse(dataRow.c11, out realValuel))
+                        {
+                            model.standard_value = realValuel;
+                        }
+
+                        dataRow = datas[10];
+                        if (dataRow.c11 != null && decimal.TryParse(dataRow.c11, out realValuel))
+                        {
+                            model.delta_up = realValuel;
+                        }
+
+                        dataRow = datas[11];
+                        if (dataRow.c11 != null && decimal.TryParse(dataRow.c11, out realValuel))
+                        {
+                            model.delta_down = realValuel;
+                        }
+
+                        dataRow = datas[12];
+                        if (dataRow.c11 != null && decimal.TryParse(dataRow.c11, out realValuel))
+                        {
+                            model.standard_max = realValuel;
+                        }
+
+                        dataRow = datas[13];
+                        if (dataRow.c11 != null && decimal.TryParse(dataRow.c11, out realValuel))
+                        {
+                            model.standard_min = realValuel;
+                        }
+                    }
+
+                }
+                catch (Exception ex)
+                {
+                    WLLog.Error("Excel数据解析问题:", ex);
+                }
+                errorMsg = stringBuilder.ToString();
+                return modelList;
+            }
+            else
+            {
+                errorMsg = stringBuilder.ToString();
+                return null;
+            }
+        }
+
+        public List<sqe_cto_test_data> File_data_ToModel_test_data(List<sqe_file_data> datas, sqe_cto_test test, List<sqe_cto_test_standard> standards, string create_by, DateTime create_date, string create_org, out string errorMsg)
+        {
+            StringBuilder stringBuilder = new StringBuilder();
+
+            List<sqe_cto_test_data> modelList = new List<sqe_cto_test_data>();
+            decimal realValuel;
+            if (datas != null && datas.Count >= 17)
+            {
+                for (int i = 16; i < datas.Count; i++)
+                {
+                    sqe_file_data dataRow = datas[i];
+                    if (dataRow.c1 == null || dataRow.c1.Length == 0)
+                    {
+                        break;
+                    }
+                    //初始化每一层的数据集合
+                    List<sqe_cto_test_data> test_datas = new List<sqe_cto_test_data>();
+                    for (int j = 0; j < standards.Count; j++)
+                    {
+                        sqe_cto_test_data data = new sqe_cto_test_data();
+                        data.test_id = standards[j].test_id;
+                        data.standard_id = standards[j].id;
+                        data.create_by = create_by;
+                        data.create_date = create_date;
+                        data.create_org = create_org;
+                        test_datas.Add(data);
+                    }
+                    try
+                    {
+                        //将每一个检测标准的值从记录行中取出来
+                        if (test_datas.Count > 0)
+                        {
+                            sqe_cto_test_data data = test_datas[0];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c3 != null && dataRow.c3.Length > 0 && decimal.TryParse(dataRow.c3, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                        }
+                        modelList.AddRange(test_datas);
+
+                        if (test_datas.Count > 1)
+                        {
+                            sqe_cto_test_data data = test_datas[1];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c4 != null && dataRow.c4.Length > 0 && decimal.TryParse(dataRow.c4, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                            modelList.AddRange(test_datas);
+                        }
+
+                        if (test_datas.Count > 2)
+                        {
+                            sqe_cto_test_data data = test_datas[1];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c5 != null && dataRow.c5.Length > 0 && decimal.TryParse(dataRow.c5, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                            modelList.AddRange(test_datas);
+                        }
+
+                        if (test_datas.Count > 3)
+                        {
+                            sqe_cto_test_data data = test_datas[1];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c6 != null && dataRow.c6.Length > 0 && decimal.TryParse(dataRow.c6, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                            modelList.AddRange(test_datas);
+                        }
+
+                        if (test_datas.Count > 4)
+                        {
+                            sqe_cto_test_data data = test_datas[1];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c7 != null && dataRow.c7.Length > 0 && decimal.TryParse(dataRow.c7, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                            modelList.AddRange(test_datas);
+                        }
+
+                        if (test_datas.Count > 5)
+                        {
+                            sqe_cto_test_data data = test_datas[1];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c8 != null && dataRow.c8.Length > 0 && decimal.TryParse(dataRow.c8, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                            modelList.AddRange(test_datas);
+                        }
+
+                        if (test_datas.Count > 6)
+                        {
+                            sqe_cto_test_data data = test_datas[1];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c9 != null && dataRow.c9.Length > 0 && decimal.TryParse(dataRow.c9, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                            modelList.AddRange(test_datas);
+                        }
+
+                        if (test_datas.Count > 7)
+                        {
+                            sqe_cto_test_data data = test_datas[1];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c10 != null && dataRow.c10.Length > 0 && decimal.TryParse(dataRow.c10, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                            modelList.AddRange(test_datas);
+                        }
+
+                        if (test_datas.Count > 8)
+                        {
+                            sqe_cto_test_data data = test_datas[1];
+                            data.data_no = dataRow.c1;
+                            if (dataRow.c2 != null)
+                            {
+                                String s = dataRow.c2.ToString();
+                                DateTime date;
+                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                {
+                                    data.data_time = date.ToString("yyyy-MM-dd HH:mm");
+                                }
+                            }
+                            if (dataRow.c11 != null && dataRow.c11.Length > 0 && decimal.TryParse(dataRow.c11, out realValuel))
+                            {
+                                data.data_value = realValuel;
+                            }
+                            else
+                            {
+                                data.data_value = null;
+                            }
+                            modelList.AddRange(test_datas);
+                        }
+
+                    }
+                    catch (Exception ex)
+                    {
+                        WLLog.Error("Excel数据解析_原始数据转换到对象实体的问题:", ex);
+                    }
+                }
+                errorMsg = string.Empty;
+                return modelList;
+            }
+            else
+            {
+                errorMsg = stringBuilder.ToString();
+                return null;
+            }
+        }
+
     }
 }

+ 3 - 1
MicroServices/Business/Business.Application/SystemJobManagement/SystemJobAppService.cs

@@ -568,6 +568,7 @@ namespace Business.SystemJobManagement
                                 se.Line = dtl.entry_seq.GetValueOrDefault();
                                 se.IsConfirm = true;
                                 se.IsActive = true;
+                                se.QtyShipped = 0m;
                                 seAdd.Add(se);
                             }
                             else
@@ -583,6 +584,7 @@ namespace Business.SystemJobManagement
                                 se.UpdateTime = dtl.update_time;
                                 se.Domain = so.Domain;
                                 se.Line = dtl.entry_seq.GetValueOrDefault();
+                                se.QtyShipped = dtl.deliver_count.GetValueOrDefault();
                                 seUpdate.Add(se);
                             }
                         }
@@ -642,7 +644,7 @@ namespace Business.SystemJobManagement
                     if (sal != null)
                     {
                         //发货数量
-                        sal.QtyShipped = asbl.RealQty;
+                        sal.QtyShipped = asbl.RealQty.GetValueOrDefault();
                         sal.UpdateTime = DateTime.Now;
                         sal.UpdateUser = "sync";
                         SItemsUpdate.Add(sal);

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/MES/SalesOrdDetail.cs

@@ -60,7 +60,7 @@ namespace Business.StructuredDB.MES
         /// <summary>
         /// 已发数
         /// </summary>
-        public decimal? QtyShipped { get; set; }
+        public decimal QtyShipped { get; set; }
 
         /// <summary>
         /// 日期

+ 0 - 5
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process.cs

@@ -2,14 +2,9 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;
-using Microsoft.EntityFrameworkCore;
 
 namespace Business.StructuredDB.Sqe
 {
-    /// <summary>
-    /// 产品过程特性
-    /// </summary>
-    [Comment("产品过程特性")]
     public class sqe_cto_process
     {
 

+ 1 - 6
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process_data.cs

@@ -2,14 +2,9 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;
-using Microsoft.EntityFrameworkCore;
 
 namespace Business.StructuredDB.Sqe
 {
-    /// <summary>
-    /// 产品过程特性检测数据
-    /// </summary>
-    [Comment("产品过程特性检测数据")]
     public class sqe_cto_process_data
     {
 
@@ -41,7 +36,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 检验值
         /// </summary>
-        public decimal ? data_value { get; set; }
+        public decimal data_value { get; set; }
 
         /// <summary>
         /// 检验结果状态

+ 0 - 5
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process_standard.cs

@@ -2,14 +2,9 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;
-using Microsoft.EntityFrameworkCore;
 
 namespace Business.StructuredDB.Sqe
 {
-    /// <summary>
-    /// 产品过程特性检测标准
-    /// </summary>
-    [Comment("产品过程特性检测标准")]
     public class sqe_cto_process_standard
     {
 

+ 0 - 5
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test.cs

@@ -2,14 +2,9 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;
-using Microsoft.EntityFrameworkCore;
 
 namespace Business.StructuredDB.Sqe
 {
-    /// <summary>
-    /// 产品过程检验记录
-    /// </summary>
-    [Comment("产品过程检验记录")]
     public class sqe_cto_test
     {
 

+ 0 - 5
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_data.cs

@@ -2,14 +2,9 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;
-using Microsoft.EntityFrameworkCore;
 
 namespace Business.StructuredDB.Sqe
 {
-    /// <summary>
-    /// 产品过程检验记录数据
-    /// </summary>
-    [Comment("产品过程检验记录数据")]
     public class sqe_cto_test_data
     {
 

+ 0 - 5
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_standard.cs

@@ -2,14 +2,9 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;
-using Microsoft.EntityFrameworkCore;
 
 namespace Business.StructuredDB.Sqe
 {
-    /// <summary>
-    /// 产品过程检验记录检测标准
-    /// </summary>
-    [Comment("产品过程检验记录检测标准")]
     public class sqe_cto_test_standard
     {
 

+ 272 - 0
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_file_data.cs

@@ -0,0 +1,272 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+
+namespace Business.StructuredDB.Sqe
+{
+    public class sqe_file_data
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 file_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c1 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c2 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c3 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c4 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c5 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c6 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c7 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c8 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c9 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c10 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c11 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c12 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c13 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c14 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c15 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c16 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c17 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c18 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c19 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c20 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c21 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c22 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c23 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c24 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c25 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c26 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c27 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c28 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c29 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c30 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c31 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c32 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c33 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c34 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c35 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c36 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c37 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c38 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c39 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c40 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c41 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c42 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c43 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c44 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c45 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c46 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c47 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c48 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c49 { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string c50 { get; set; }
+
+    }
+}

+ 0 - 5
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_file_upload.cs

@@ -2,14 +2,9 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;
-using Microsoft.EntityFrameworkCore;
 
 namespace Business.StructuredDB.Sqe
 {
-    /// <summary>
-    /// 上传文件
-    /// </summary>
-    [Comment("上传文件")]
     public class sqe_file_upload
     {
 

+ 40 - 0
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Sqe/BusinessSqeDbContext.cs

@@ -0,0 +1,40 @@
+using Business.StructuredDB.Sqe;
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.Data;
+using Volo.Abp.EntityFrameworkCore;
+
+namespace Business.EntityFrameworkCore
+{
+    /// <summary>
+    /// 对应DOPDemoRq数据库
+    /// </summary>
+    [ConnectionStringName("Default")]
+    public class BusinessSqeDbContext : AbpDbContext<BusinessSqeDbContext>
+    {
+        #region Sqe数据访问
+        public DbSet<sqe_cto_process> sqe_cto_process { get; set; }
+        public DbSet<sqe_cto_process_data> sqe_cto_process_data { get; set; }
+        public DbSet<sqe_cto_process_standard> sqe_cto_process_standard { get; set; }
+        public DbSet<sqe_cto_test> sqe_cto_test { get; set; }
+        public DbSet<sqe_cto_test_data> sqe_cto_test_data { get; set; }
+        public DbSet<sqe_cto_test_standard> sqe_cto_test_standard { get; set; }
+        public DbSet<sqe_file_upload> sqe_file_upload { get; set; }
+        public DbSet<sqe_file_data> sqe_file_data { get; set; }
+
+
+        #endregion Sqe数据访问
+
+        //Code generation...
+        public BusinessSqeDbContext(DbContextOptions<BusinessSqeDbContext> options)
+            : base(options)
+        {
+
+        }
+
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            base.OnModelCreating(modelBuilder);
+            //modelBuilder.ConfigureBusiness();
+        }
+    }
+}

+ 25 - 0
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Sqe/BusinessSqeDbContextFactory.cs

@@ -0,0 +1,25 @@
+using Business.Core.Configuration;
+using Business.Core.Web;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Design;
+using Microsoft.Extensions.Configuration;
+
+namespace Business.EntityFrameworkCore
+{
+    /* This class is needed to run EF Core PMC commands. Not used anywhere else */
+    public class BusinessSqeDbContextFactory : IDesignTimeDbContextFactory<BusinessSqeDbContext>
+    {
+        public BusinessSqeDbContext CreateDbContext(string[] args)
+        {
+            var builder = new DbContextOptionsBuilder<BusinessSqeDbContext>();
+            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());
+
+            BussinessSqeDbContextOptionsConfigurer.Configure(
+                builder,
+                configuration.GetConnectionString("Default")
+            );
+
+            return new BusinessSqeDbContext(builder.Options);
+        }
+    }
+}

+ 20 - 0
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Sqe/BussinessSqeDbContextOptionsConfigurer.cs

@@ -0,0 +1,20 @@
+using System.Data.Common;
+using Microsoft.EntityFrameworkCore;
+
+namespace Business.EntityFrameworkCore
+{
+    public static class BussinessSqeDbContextOptionsConfigurer
+    {
+        public static void Configure(DbContextOptionsBuilder<BusinessSqeDbContext> dbContextOptions, string connectionString)
+        {
+            /* This is the single point to configure DbContextOptions for MultipleDbContextEfCoreDemoDbContext */
+            dbContextOptions.UseSqlServer(connectionString);
+        }
+
+        public static void Configure( DbContextOptionsBuilder<BusinessSqeDbContext> dbContextOptions,DbConnection connection)
+        {
+            /* This is the single point to configure DbContextOptions for MultipleDbContextEfCoreDemoDbContext */
+            dbContextOptions.UseSqlServer(connection);
+        }
+    }
+}

+ 39 - 0
MicroServices/Business/Business.EntityFrameworkCore/Repository/SqlRepositories/ISqeRepository.cs

@@ -0,0 +1,39 @@
+using Microsoft.EntityFrameworkCore.ChangeTracking;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq.Expressions;
+using System.Threading.Tasks;
+
+namespace Business.EntityFrameworkCore.SqlRepositories
+{
+    public interface ISqeRepository<T> where T : class, new()
+    {
+        public void BeginTransaction();
+        public void CommitTransaction();
+        public void Rollback();
+        public void Dispose();
+
+        int Insert(T entity);
+        int Insert(List<T> entitylist);
+        int Update(T entity);
+        int Update(List<T> entitylist);
+
+        int Update(Expression<Func<T, bool>> whereLambda, Expression<Func<T, T>> entity);
+
+        int Delete(Expression<Func<T, bool>> whereLambda);
+
+        int Delete(List<T> entitylist);
+
+        bool IsExist(Expression<Func<T, bool>> whereLambda);
+
+        List<T> Select();
+
+        List<T> Select(Expression<Func<T, bool>> whereLambda);
+
+        Tuple<List<T>, int> Select<S>(int pageSize, int pageIndex, Expression<Func<T, bool>> whereLambda, Expression<Func<T, S>> orderByLambda, bool isAsc);
+
+        DataSet SelectDataBaseBySql(string sql, string tableName);
+    }
+}

+ 173 - 0
MicroServices/Business/Business.EntityFrameworkCore/Repository/SqlRepositories/SqeRepository.cs

@@ -0,0 +1,173 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Common;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using System.Collections;
+using Business.EntityFrameworkCore;
+using System.Linq.Expressions;
+using System.Data.SqlClient;
+using EFCore.BulkExtensions;
+using Microsoft.EntityFrameworkCore.Storage;
+
+namespace Business.EntityFrameworkCore.SqlRepositories
+{
+    public class SqeRepository<T>: ISqeRepository<T> where T : class, new()
+    {
+        /// <summary>
+        /// 数据库操作对象
+        /// </summary>
+        readonly BusinessSqeDbContext _dbContext;
+
+        /// <summary>
+        /// 事务处理对象
+        /// </summary>
+        private IDbContextTransaction? _transaction;
+
+        /// <summary>
+        /// 是否已经提交事务
+        /// </summary>
+        private bool _isCommit = false;
+
+        public SqeRepository(BusinessSqeDbContext dbContext)
+        {
+            _dbContext = dbContext;
+        }
+
+        public void BeginTransaction()
+        {
+            _transaction = _dbContext.Database.BeginTransaction();
+            _isCommit = false;
+        }
+
+        public void CommitTransaction()
+        {
+            if (_transaction != null)
+            {
+                _transaction.Commit();
+            }
+            _isCommit = true;
+        }
+
+        public void Rollback()
+        {
+            if (_transaction != null && !_isCommit)
+            {
+                _transaction.Rollback();
+            }
+        }
+
+        public void Dispose()
+        {
+            if (_transaction != null && !_isCommit)
+            {
+                _transaction.Rollback();
+            }
+            if (_transaction != null)
+            {
+                _transaction.Dispose();
+                _transaction = null;
+            }
+        }
+
+        public  int Insert(T entity)
+        {
+            _dbContext.Set<T>().Add(entity);
+            return  _dbContext.SaveChanges();
+        }
+
+        public int Insert(List<T> entitylist)
+        {
+             _dbContext.Set<T>().AddRange(entitylist);
+            return  _dbContext.SaveChanges();
+        }
+
+        public  int Update(T entity)
+        {
+            _dbContext.Set<T>().Update(entity);
+           return _dbContext.SaveChanges();
+        }
+        public  int Update(List<T> entitylist)
+        {
+            _dbContext.Set<T>().UpdateRange(entitylist);
+           return  _dbContext.SaveChanges();
+        }
+
+        public int Update(Expression<Func<T, bool>> whereLambda, Expression<Func<T, T>> entity)
+        {
+            _dbContext.Set<T>().Where(whereLambda).BatchUpdate(entity);
+            return  _dbContext.SaveChanges();
+        }
+
+        public  int Delete(Expression<Func<T, bool>> whereLambda)
+        {
+            _dbContext.Set<T>().Where(whereLambda).BatchDelete();
+            return  _dbContext.SaveChanges();
+        }
+
+        public int Delete(List<T> entitylist)
+        {
+            _dbContext.Set<T>().RemoveRange(entitylist);
+            return _dbContext.SaveChanges();
+        }
+
+        public  bool IsExist(Expression<Func<T, bool>> whereLambda)
+        {
+            return  _dbContext.Set<T>().Any(whereLambda);
+        }
+
+        public  List<T> Select()
+        {
+            return  _dbContext.Set<T>().ToList();
+        }
+
+        public  List<T> Select(Expression<Func<T, bool>> whereLambda)
+        {
+            return _dbContext.Set<T>().Where(whereLambda).ToList();
+        }
+
+        public Tuple<List<T>, int> Select<S>(int pageSize, int pageIndex, Expression<Func<T, bool>> whereLambda, Expression<Func<T, S>> orderByLambda, bool isAsc)
+        {
+            var total = _dbContext.Set<T>().Where(whereLambda).Count();
+
+            if (isAsc)
+            {
+                var entities =  _dbContext.Set<T>().Where(whereLambda)
+                                      .OrderBy<T, S>(orderByLambda)
+                                      .Skip(pageSize * (pageIndex - 1))
+                                      .Take(pageSize).ToList();
+
+                return  new Tuple<List<T>, int>(entities, total);
+            }
+            else
+            {
+                var entities = _dbContext.Set<T>().Where(whereLambda)
+                                      .OrderByDescending<T, S>(orderByLambda)
+                                      .Skip(pageSize * (pageIndex - 1))
+                                      .Take(pageSize).ToList();
+
+                return new Tuple<List<T>, int>(entities, total);
+            }
+        }
+
+        public DataSet SelectDataBaseBySql(string sql, string tableName)
+        {
+            DataSet ds = new DataSet();
+            try
+            {
+                string connectionString = _dbContext.Database.GetConnectionString();
+                SqlDataAdapter da = new SqlDataAdapter(sql, connectionString);
+                da.Fill(ds, tableName);
+            }
+            catch (Exception ex)
+            {
+            }
+            return ds;
+        }
+    }
+}

+ 8 - 5
MicroServices/Business/Business.HttpApi/Controllers/SqeController.cs

@@ -1,10 +1,12 @@
-using Business.Dto;
+using Business.StructuredDB.Sqe;
 using Business.VSM;
 using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
 using NLog.Fluent;
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Linq;
 using System.Threading.Tasks;
 using Volo.Abp;
 using Volo.Abp.AspNetCore.Mvc;
@@ -28,11 +30,12 @@ namespace Business.Controllers
 
 
         [HttpGet]
-        [Route("import_test")]
-        public string ImportTest(string filePath, string sheetName)
+        [Route("import_1")]
+        public string Import_1(int file_id)
         {
-            DataTable dt = _SqeExcelService.ImportExcelSheetToDataTable_test(filePath, sheetName);
-            return "测试系统";
+
+            String s = _SqeExcelService.ImportData_From_Data(28, "测试用户", DateTime.Now, "测试组织");
+            return s;
         }
     }
 }

+ 18 - 0
MicroServices/Business/QuartzSettings/logs/logs.txt

@@ -3580,3 +3580,21 @@
 {"TaskName":"长周期物料PR","GroupName":"systemquartzjob","BeginDate":"2025-05-28T15:47:54.7433496+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
 {"TaskName":"TestTimeOut","GroupName":"systemquartzjob","BeginDate":"2025-05-28T15:47:54.7525759+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
 {"TaskName":"BOM预处理自动任务","GroupName":"BOM预处理自动任务","BeginDate":"2025-05-28T15:47:54.7545414+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时同步WMS物料订单等基础数据到MySQL","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:07:54.2579895+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时创建NLog日志按月分表","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:07:54.2910639+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时同步MySQL基础数据到MongoDB","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:07:54.2939919+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"长周期物料PR","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:07:54.2954746+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"TestTimeOut","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:07:54.2996769+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"BOM预处理自动任务","GroupName":"BOM预处理自动任务","BeginDate":"2025-05-29T17:07:54.3014632+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时同步WMS物料订单等基础数据到MySQL","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:08:49.6580561+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时创建NLog日志按月分表","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:08:49.6923481+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时同步MySQL基础数据到MongoDB","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:08:49.6953409+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"长周期物料PR","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:08:49.6968563+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"TestTimeOut","GroupName":"systemquartzjob","BeginDate":"2025-05-29T17:08:49.701578+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"BOM预处理自动任务","GroupName":"BOM预处理自动任务","BeginDate":"2025-05-29T17:08:49.703367+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时同步WMS物料订单等基础数据到MySQL","GroupName":"systemquartzjob","BeginDate":"2025-05-30T15:18:15.1251428+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时创建NLog日志按月分表","GroupName":"systemquartzjob","BeginDate":"2025-05-30T15:18:15.1621919+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"定时同步MySQL基础数据到MongoDB","GroupName":"systemquartzjob","BeginDate":"2025-05-30T15:18:15.1650575+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"长周期物料PR","GroupName":"systemquartzjob","BeginDate":"2025-05-30T15:18:15.1664009+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"TestTimeOut","GroupName":"systemquartzjob","BeginDate":"2025-05-30T15:18:15.1706305+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"BOM预处理自动任务","GroupName":"BOM预处理自动任务","BeginDate":"2025-05-30T15:18:15.1727226+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}