Pengxy 8 kuukautta sitten
vanhempi
commit
a37cb4e57a
34 muutettua tiedostoa jossa 2267 lisäystä ja 244 poistoa
  1. 0 0
      MicroServices/Business/Business.Application.Contracts/SqeManagement/IJwtService.cs
  2. 12 1
      MicroServices/Business/Business.Application.Contracts/SqeManagement/ISqeExcelService.cs
  3. 1081 137
      MicroServices/Business/Business.Application/SqeManagement/SqeExcelService.cs
  4. 47 0
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_chart_data_temp.cs
  5. 2 2
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process.cs
  6. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process_data.cs
  7. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process_standard.cs
  8. 2 2
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test.cs
  9. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_avg.cs
  10. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_data.cs
  11. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_standard.cs
  12. 70 3
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_statistics.cs
  13. 11 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_fct.cs
  14. 3 3
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_fct_data.cs
  15. 7 2
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_file_upload.cs
  16. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_fpy.cs
  17. 2 2
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_fpy_data.cs
  18. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_op.cs
  19. 2 2
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_op_data.cs
  20. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_op_data_detail.cs
  21. 2 2
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_oqc.cs
  22. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_oqc_data.cs
  23. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_oqc_standard.cs
  24. 140 0
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_oqc_statistics.cs
  25. 6 1
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_transfer.cs
  26. 205 0
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_cto_process_data.cs
  27. 226 0
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_cto_test_avg.cs
  28. 6 5
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_cto_test_data.cs
  29. 94 0
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_fpy_data.cs
  30. 2 2
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_op_data_detail.cs
  31. 169 0
      MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_oqc_data.cs
  32. 85 50
      MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/BusinessDbContextModelCreatingExtensions.cs
  33. 16 5
      MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Sqe/BusinessSqeDbContext.cs
  34. 67 14
      MicroServices/Business/Business.HttpApi/Controllers/SqeController.cs

+ 0 - 0
MicroServices/Business/Business.Application.Contracts/Sqe/IJwtService.cs → MicroServices/Business/Business.Application.Contracts/SqeManagement/IJwtService.cs


+ 12 - 1
MicroServices/Business/Business.Application.Contracts/Sqe/ISqeExcelService.cs → MicroServices/Business/Business.Application.Contracts/SqeManagement/ISqeExcelService.cs

@@ -66,7 +66,18 @@ namespace Business.VSM
 
         public string Compute_Test(string startDate, string endDate, string item_no, string item_batch, string org, string standard_no, int sample_count);
 
-        public string Compute_op_query(string startDate, string endDate, string item_no, string item_batch, string org);
+        public string Compute_op_query(string startDate, string endDate, string item_no, string item_batch, string org, string op, string bad_type);
 
+        public string Compute_TestChartData(string startDate, string endDate, string item_no, string item_batch, string org, string standard_no, int sample_count);
+
+        public string Compute_OpChartData(string startDate, string endDate, string item_no, string item_batch, string org, string op, string bad_type);
+
+        public string Compute_OpChartData_Date(string startDate, string endDate, string item_no, string item_batch, string org, string op);
+
+        public string Compute_FpyChartData(string startDate, string endDate, string item_no, string org, string op);
+
+        public string Compute_FpyChartData_Date(string startDate, string endDate, string item_no, string org, string op);
+
+        public string Compute_OqcChartData(string startDate, string endDate, string item_no, string org);
     }
 }

+ 1081 - 137
MicroServices/Business/Business.Application/SqeManagement/SqeExcelService.cs

@@ -1,22 +1,26 @@
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection;
-using System.Text;
-using Business.EntityFrameworkCore.SqlRepositories;
+using Business.EntityFrameworkCore.SqlRepositories;
 using Business.StructuredDB;
 using Business.StructuredDB.Sqe;
 using MathNet.Numerics.Statistics;
+using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Metadata.Internal;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
+using NPOI.POIFS.Crypt.Dsig;
 using NPOI.SS.Formula.Functions;
 using NPOI.XWPF.UserModel;
 using RazorEngine.Compilation.ImpromptuInterface.Optimization;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+using System.Runtime.Intrinsics.X86;
+using System.Text;
 using Volo.Abp.Application.Services;
 using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
+using static NPOI.POIFS.Crypt.CryptoFunctions;
 
 namespace Business.VSM
 {
@@ -27,6 +31,7 @@ namespace Business.VSM
     {
         LoggerHelper WLLog;
 
+        private readonly ISqeRepository<sqe_chart_data_temp> _sqe_chart_data_temp;
         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;
@@ -35,24 +40,30 @@ namespace Business.VSM
         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_cto_test_statistics> _sqe_cto_test_statistics;
+        private readonly ISqeRepository<sqe_fct> _sqe_fct;
+        private readonly ISqeRepository<sqe_fct_data> _sqe_fct_data;
         private readonly ISqeRepository<sqe_file_data> _sqe_file_data;
         private readonly ISqeRepository<sqe_file_upload> _sqe_file_upload;
-        private readonly ISqeRepository<sqe_oqc> _sqe_oqc;
-        private readonly ISqeRepository<sqe_oqc_data> _sqe_oqc_data;
-        private readonly ISqeRepository<sqe_oqc_standard> _sqe_oqc_standard;
         private readonly ISqeRepository<sqe_fpy> _sqe_fpy;
         private readonly ISqeRepository<sqe_fpy_data> _sqe_fpy_data;
         private readonly ISqeRepository<sqe_op> _sqe_op;
         private readonly ISqeRepository<sqe_op_data> _sqe_op_data;
         private readonly ISqeRepository<sqe_op_data_detail> _sqe_op_data_detail;
-        private readonly ISqeRepository<sqe_fct> _sqe_fct;
-        private readonly ISqeRepository<sqe_fct_data> _sqe_fct_data;
+        private readonly ISqeRepository<sqe_oqc> _sqe_oqc;
+        private readonly ISqeRepository<sqe_oqc_data> _sqe_oqc_data;
+        private readonly ISqeRepository<sqe_oqc_standard> _sqe_oqc_standard;
+        private readonly ISqeRepository<sqe_oqc_statistics> _sqe_oqc_statistics;
+
+        private readonly ISqeRepository<v_sqe_cto_process_data> _v_sqe_cto_process_data;
+        private readonly ISqeRepository<v_sqe_cto_test_avg> _v_sqe_cto_test_avg;
         private readonly ISqeRepository<v_sqe_cto_test_data> _v_sqe_cto_test_data;
+        private readonly ISqeRepository<v_sqe_fpy_data> _v_sqe_fpy_data;
         private readonly ISqeRepository<v_sqe_op_data_detail> _v_sqe_op_data_detail;
-
+        private readonly ISqeRepository<v_sqe_oqc_data> _v_sqe_oqc_data;
 
 
         public SqeExcelService(
+            ISqeRepository<sqe_chart_data_temp> sqe_chart_data_temp,
             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,
@@ -61,23 +72,29 @@ namespace Business.VSM
             ISqeRepository<sqe_cto_test_data> sqe_cto_test_data,
             ISqeRepository<sqe_cto_test_standard> sqe_cto_test_standard,
             ISqeRepository<sqe_cto_test_statistics> sqe_cto_test_statistics,
+            ISqeRepository<sqe_fct> sqe_fct,
+            ISqeRepository<sqe_fct_data> sqe_fct_data,
             ISqeRepository<sqe_file_data> sqe_file_data,
             ISqeRepository<sqe_file_upload> sqe_file_upload,
-            ISqeRepository<sqe_oqc> sqe_oqc,
-            ISqeRepository<sqe_oqc_data> sqe_oqc_data,
-            ISqeRepository<sqe_oqc_standard> sqe_oqc_standard,
             ISqeRepository<sqe_fpy> sqe_fpy,
             ISqeRepository<sqe_fpy_data> sqe_fpy_data,
             ISqeRepository<sqe_op> sqe_op,
             ISqeRepository<sqe_op_data> sqe_op_data,
             ISqeRepository<sqe_op_data_detail> sqe_op_data_detail,
-            ISqeRepository<sqe_fct> sqe_fct,
-            ISqeRepository<sqe_fct_data> sqe_fct_data,
+            ISqeRepository<sqe_oqc> sqe_oqc,
+            ISqeRepository<sqe_oqc_data> sqe_oqc_data,
+            ISqeRepository<sqe_oqc_standard> sqe_oqc_standard,
+            ISqeRepository<sqe_oqc_statistics> sqe_oqc_statistics,
+            ISqeRepository<v_sqe_cto_process_data> v_sqe_cto_process_data,
+            ISqeRepository<v_sqe_cto_test_avg> v_sqe_cto_test_avg,
             ISqeRepository<v_sqe_cto_test_data> v_sqe_cto_test_data,
-            ISqeRepository<v_sqe_op_data_detail> v_sqe_op_data_detail
+            ISqeRepository<v_sqe_fpy_data> v_sqe_fpy_data,
+            ISqeRepository<v_sqe_op_data_detail> v_sqe_op_data_detail,
+            ISqeRepository<v_sqe_oqc_data> v_sqe_oqc_data
             )
         {
             WLLog = new LoggerHelper();
+            _sqe_chart_data_temp = sqe_chart_data_temp;
             _sqe_cto_process = sqe_cto_process;
             _sqe_cto_process_data = sqe_cto_process_data;
             _sqe_cto_process_standard = sqe_cto_process_standard;
@@ -86,21 +103,27 @@ namespace Business.VSM
             _sqe_cto_test_data = sqe_cto_test_data;
             _sqe_cto_test_standard = sqe_cto_test_standard;
             _sqe_cto_test_statistics = sqe_cto_test_statistics;
+            _sqe_fct = sqe_fct;
+            _sqe_fct_data = sqe_fct_data;
             _sqe_file_data = sqe_file_data;
             _sqe_file_upload = sqe_file_upload;
-            _sqe_oqc = sqe_oqc;
-            _sqe_oqc_data = sqe_oqc_data;
-            _sqe_oqc_standard = sqe_oqc_standard;
             _sqe_fpy = sqe_fpy;
             _sqe_fpy_data = sqe_fpy_data;
             _sqe_op = sqe_op;
             _sqe_op_data = sqe_op_data;
             _sqe_op_data_detail = sqe_op_data_detail;
-            _sqe_fct = sqe_fct;
-            _sqe_fct_data = sqe_fct_data;
+            _sqe_oqc = sqe_oqc;
+            _sqe_oqc_data = sqe_oqc_data;
+            _sqe_oqc_standard = sqe_oqc_standard;
+            _sqe_oqc_statistics = sqe_oqc_statistics;
 
+            _v_sqe_cto_process_data = v_sqe_cto_process_data;
+            _v_sqe_cto_test_avg = v_sqe_cto_test_avg;
             _v_sqe_cto_test_data = v_sqe_cto_test_data;
+            _v_sqe_fpy_data = v_sqe_fpy_data;
             _v_sqe_op_data_detail = v_sqe_op_data_detail;
+            _v_sqe_oqc_data = v_sqe_oqc_data;
+
         }
 
         ///// <summary>
@@ -1248,7 +1271,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -1271,7 +1294,7 @@ namespace Business.VSM
                             {
                                 String s = dataRow.c2.ToString();
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -1294,7 +1317,7 @@ namespace Business.VSM
                             {
                                 String s = dataRow.c2.ToString();
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -1317,7 +1340,7 @@ namespace Business.VSM
                             {
                                 String s = dataRow.c2.ToString();
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -1340,7 +1363,7 @@ namespace Business.VSM
                             {
                                 String s = dataRow.c2.ToString();
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -1363,7 +1386,7 @@ namespace Business.VSM
                             {
                                 String s = dataRow.c2.ToString();
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -1386,7 +1409,7 @@ namespace Business.VSM
                             {
                                 String s = dataRow.c2.ToString();
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -1409,7 +1432,7 @@ namespace Business.VSM
                             {
                                 String s = dataRow.c2.ToString();
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -1432,7 +1455,7 @@ namespace Business.VSM
                             {
                                 String s = dataRow.c2.ToString();
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2111,7 +2134,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2136,7 +2159,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2161,7 +2184,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2186,7 +2209,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2211,7 +2234,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2236,7 +2259,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2261,7 +2284,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2286,7 +2309,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2311,7 +2334,7 @@ namespace Business.VSM
                                     s = s.Substring(s.Length - 9);
                                 }
                                 DateTime date;
-                                if (DateTime.TryParse(test.product_time.ToString("yyyy-MM-dd ") + s, out date))
+                                if (DateTime.TryParse(test.product_time.Value.ToString("yyyy-MM-dd ") + s, out date))
                                 {
                                     data.data_time = date.ToString("yyyy-MM-dd HH:mm");
                                 }
@@ -2497,6 +2520,7 @@ namespace Business.VSM
                 for (int i = 1; i < datas.Count; i++)
                 {
                     sqe_op_data model = new sqe_op_data();
+                    model.op_id = test.id;
                     sqe_file_data dataRow = datas[i];
                     if ((dataRow.c1 == null || dataRow.c1.Length == 0) && (dataRow.c2 == null || dataRow.c2.Length == 0))
                     {
@@ -3259,9 +3283,11 @@ namespace Business.VSM
                 model.LineID = json["LineID"].ToString();
                 model.OpID = json["OpID"].ToString();
                 model.bar_code = json["BarCode"].ToString();
+                model.SerialNO = json["SerialNO"].ToString();
                 model.WONO = json["WONO"].ToString();
                 model.program = json["Program"].ToString();
                 model.pro_version = json["ProVersion"].ToString();
+                model.test_date = DateTime.Parse(json["TestDate"].ToString());
                 model.test_result = json["testResult"].ToString();
                 model.msg = json["Msg"].ToString();
                 model.create_by = create_by;
@@ -3366,6 +3392,16 @@ namespace Business.VSM
             return stringBuilder.ToString();
         }
 
+        /// <summary>
+        /// 依据test_id,生成该对象的均值和极差,保存到数据库表sqe_cto_test_avg
+        /// 依据均值和极差,再次生成该数据的统计值对象,并且保存到数据库表sqe_cto_test_statistics
+        /// </summary>
+        /// <param name="test_id"></param>
+        /// <param name="standard_no"></param>
+        /// <param name="create_by"></param>
+        /// <param name="create_date"></param>
+        /// <param name="create_org"></param>
+        /// <returns></returns>
         public string Compute_Test_id(int test_id, string standard_no, string create_by, DateTime create_date, string create_org)
         {
             StringBuilder stringBuilder = new StringBuilder();
@@ -3378,11 +3414,7 @@ namespace Business.VSM
                 return stringBuilder.ToString();
             }
             sqe_cto_test test = tests[0];
-
-            List<v_sqe_cto_test_data> test_datas = _v_sqe_cto_test_data.Select(a => a.test_id == test.id && a.standard_no == standard_no && a.data_value != null).OrderBy(a => a.id).ToList();
-            //List<v_sqe_cto_test_data> test_datas = _v_sqe_cto_test_data.Select(a => a.standard_no == standard_no && a.data_value != null).OrderBy(a => a.id).ToList();
-
-            //生成统计信息
+            //查看该CTO的产品特性数据,查询统计信息是否已经生成
             List<sqe_cto_test_avg> test_avgs = _sqe_cto_test_avg.Select(a => a.cto_test_id == test.id).OrderBy(a => a.id).ToList();
             if (test_avgs != null && test_avgs.Count > 0)
             {
@@ -3390,9 +3422,26 @@ namespace Business.VSM
                 return stringBuilder.ToString();
             }
 
+            // 依据ID条件,获取用户上传的CTO产品特性数据
+            List<v_sqe_cto_test_data> test_datas = _v_sqe_cto_test_data.Select(a => a.test_id == test.id && a.standard_no == standard_no && a.data_value != null).OrderBy(a => a.id).ToList();
+            if (test_datas == null || test_datas.Count == 0)
+            {
+                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您的查询条件没有查询到数据可能有问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                return JsonConvert.SerializeObject(resultError);
+            }
+            //int sample_count = test_datas != null && test_datas.Count > 0 ? test_datas[0].sampling_count : -1;
+            //if (sample_count == -1)
+            //{
+            //    ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择数据中的采样数有问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+            //    return JsonConvert.SerializeObject(resultError);
+            //}
+
             int sample_count = test.sampling_number;
+
             double[] data = new double[sample_count];
+            //所有的检测数据,按照进行采样数进行归一
             double[] dataAll = new double[test_datas.Count / sample_count * sample_count];
+            //极差数据
             double[] dataRange = new double[test_datas.Count / sample_count];
             for (int i = 0; i <= test_datas.Count - sample_count; i += sample_count)
             {
@@ -3467,6 +3516,7 @@ namespace Business.VSM
             return stringBuilder.ToString();
         }
 
+        #region 计算系数
         /// <summary>
         /// 计算A2系数
         /// </summary>
@@ -3495,6 +3545,11 @@ namespace Business.VSM
             return 1;
         }
 
+        /// <summary>
+        /// 计算系数D2
+        /// </summary>
+        /// <param name="sample_count"></param>
+        /// <returns></returns>
         public double GetD2(int sample_count)
         {
             switch (sample_count)
@@ -3518,6 +3573,11 @@ namespace Business.VSM
             return 1;
         }
 
+        /// <summary>
+        /// 计算系数D4
+        /// </summary>
+        /// <param name="sample_count"></param>
+        /// <returns></returns>
         public double GetD4(int sample_count)
         {
             switch (sample_count)
@@ -3541,6 +3601,11 @@ namespace Business.VSM
             return 1;
         }
 
+        /// <summary>
+        /// 计算系数D3
+        /// </summary>
+        /// <param name="sample_count"></param>
+        /// <returns></returns>
         public double GetD3(int sample_count)
         {
             return 0;
@@ -3565,72 +3630,147 @@ namespace Business.VSM
             //return 1;
         }
 
+        #endregion 计算系数
 
-        public string Compute_Test(string startDate, string endDate, string item_no, string item_batch, string org, string standard_no, int sample_count)
+        /// <summary>
+        /// 通过查询条件,查询统计Chart的数据的标识信息
+        /// </summary>
+        /// <param name="startDate"></param>
+        /// <param name="endDate"></param>
+        /// <param name="item_no"></param>
+        /// <param name="item_batch"></param>
+        /// <param name="org"></param>
+        /// <param name="standard_no"></param>
+        /// <param name="sample_count"></param>
+        /// <returns></returns>
+        public string Compute_TestChartData(string startDate, string endDate, string item_no, string item_batch, string org, string standard_no, int sample_count)
         {
             try
             {
-                #region 查询条件
-                // 动态条件
-                var conditions = new List<Expression<Func<v_sqe_cto_test_data, bool>>>();
-                conditions.Add(p => p.data_value != null);
-                if (!string.IsNullOrEmpty(startDate))
-                {
-                    DateTime dateTime;
-                    if (DateTime.TryParse(startDate, out dateTime))
-                    {
-                        // 添加条件1:Name 包含 "searchTerm"
-                        conditions.Add(p => p.create_date >= dateTime);
-                    }
-                }
-                if (!string.IsNullOrEmpty(endDate))
-                {
-                    DateTime dateTime;
-                    if (DateTime.TryParse(endDate, out dateTime))
-                    {
-                        // 添加条件1:Name 包含 "searchTerm"
-                        conditions.Add(p => p.create_date <= dateTime);
-                    }
-                }
-                if (!string.IsNullOrEmpty(item_no))
-                {
-                    // 添加条件1:Name 包含 "searchTerm"
-                    conditions.Add(p => p.item_no == item_no);
-                }
-                if (!string.IsNullOrEmpty(item_batch))
-                {
-                    // 添加条件1:Name 包含 "searchTerm"
-                    conditions.Add(p => p.item_batch == item_batch);
-                }
-                if (!string.IsNullOrEmpty(org))
-                {
-                    // 添加条件1:Name 包含 "searchTerm"
-                    conditions.Add(p => p.create_org == org);
-                }
-                if (!string.IsNullOrEmpty(standard_no))
+                // 依据查询条件,获取用户上传的CTO产品特性数据
+                List<v_sqe_cto_test_data> test_datas = Get_TestData(startDate, endDate, item_no, item_batch, org, standard_no);
+                if (test_datas == null || test_datas.Count == 0)
                 {
-                    // 添加条件1:Name 包含 "searchTerm"
-                    conditions.Add(p => p.standard_no == standard_no);
+                    ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您的查询条件没有查询到数据可能有问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                    return JsonConvert.SerializeObject(resultError);
                 }
 
-                // 组合条件
-                var combinedCondition = PredicateBuilder.New<v_sqe_cto_test_data>();
-                foreach (var condition in conditions)
-                {
-                    combinedCondition = combinedCondition.And(condition);
-                }
-                var query = _v_sqe_cto_test_data.GetDbContext().v_sqe_cto_test_data.AsQueryable();
+                //所有的检测数据,按照进行采样数进行归一
+                double[] dataAll = null;
+                //均值数据
+                double[] dataAvg = null;
+                //极差数据
+                double[] dataRange = null;
+                //计算均值与极差
+                Get_TestAvgRange(test_datas, sample_count, out dataAll, out dataAvg, out dataRange);
 
-                // 应用条件
-                if (combinedCondition.Body != null)
+                double a2 = GetA2(sample_count);
+                double d2 = GetD2(sample_count);
+                double d3 = GetD3(sample_count);
+                double d4 = GetD4(sample_count);
+
+                //开始计算统计结果
+                double UCLx = 0, AveX = 0, LCLx = 0, UCLr = 0, AveR = 0, LCLr = 0;
+                AveX = dataAvg.Average();
+                AveR = dataRange.Average();
+                UCLx = AveX + a2 * AveR;
+                LCLx = AveX - a2 * AveR;
+                UCLr = d4 * AveR;
+                LCLr = d3 * AveR;
+                //生成临时数据,插入数据库
+                List<sqe_chart_data_temp> models = new List<sqe_chart_data_temp>();
+                sqe_chart_data_temp model;
+                DateTime dateTimeNow = DateTime.Now;
+                for (int i = 0; i < dataAvg.Length; i++)
                 {
-                    query = query.Where(combinedCondition);
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "sub" + (i + 1).ToString();
+                    model.type_name = "均值";
+                    model.type_value = (decimal)AveX;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "sub" + (i + 1).ToString();
+                    model.type_name = "极差";
+                    model.type_value = (decimal)AveR;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "sub" + (i + 1).ToString();
+                    model.type_name = "UCLx";
+                    model.type_value = (decimal)UCLx;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "sub" + (i + 1).ToString();
+                    model.type_name = "LCLx";
+                    model.type_value = (decimal)LCLx;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "sub" + (i + 1).ToString();
+                    model.type_name = "UCLr";
+                    model.type_value = (decimal)UCLr;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "sub" + (i + 1).ToString();
+                    model.type_name = "LCLr";
+                    model.type_value = (decimal)LCLr;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+
                 }
-                #endregion 查询条件
 
-                // 执行查询
-                List<v_sqe_cto_test_data> test_datas = query.ToList();
+                _sqe_chart_data_temp.Insert(models);
+                ResultViewModel result = ResultHelper.CreateResult(ResultCode.Success, dateTimeNow.Ticks.ToString(), ResultCode.Success, null);
+                return JsonConvert.SerializeObject(result);
+            }
+            catch (Exception ex)
+            {
+                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择数据中的采样数有问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                return JsonConvert.SerializeObject(resultError);
+            }
+        }
 
+
+
+
+        /// <summary>
+        /// 依据查询统计条件,生成该时间段内的均值和极差
+        /// 依据均值和极差,再次生成统计对象
+        /// </summary>
+        /// <param name="startDate"></param>
+        /// <param name="endDate"></param>
+        /// <param name="item_no"></param>
+        /// <param name="item_batch"></param>
+        /// <param name="org"></param>
+        /// <param name="standard_no"></param>
+        /// <param name="sample_count"></param>
+        /// <returns></returns>
+        public string Compute_Test(string startDate, string endDate, string item_no, string item_batch, string org, string standard_no, int sample_count)
+        {
+            try
+            {
+                // 依据查询条件,获取用户上传的CTO产品特性数据
+                List<v_sqe_cto_test_data> test_datas = Get_TestData(startDate, endDate, item_no, item_batch, org, standard_no);
+                if (test_datas == null || test_datas.Count == 0)
+                {
+                    ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您的查询条件没有查询到数据可能有问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                    return JsonConvert.SerializeObject(resultError);
+                }
                 //int sample_count = test_datas != null && test_datas.Count > 0 ? test_datas[0].sampling_count : -1;
                 //if (sample_count == -1)
                 //{
@@ -3638,18 +3778,17 @@ namespace Business.VSM
                 //    return JsonConvert.SerializeObject(resultError);
                 //}
 
-                double[] data = new double[sample_count];
-                double[] dataAll = new double[test_datas.Count / sample_count * sample_count];
-                double[] dataRange = new double[test_datas.Count / sample_count];
-                for (int i = 0; i <= test_datas.Count - sample_count; i += sample_count)
-                {
-                    for (int j = 0; j < sample_count; j++)
-                    {
-                        data[j] = (double)test_datas[i + j].data_value.Value;
-                        dataAll[i + j] = data[j];
-                    }
-                    dataRange[i / sample_count] = data.Max() - data.Min();
-                }
+                //所有的检测数据,按照进行采样数进行归一
+                double[] dataAll = null;
+
+                //均值数据
+                double[] dataAvg = null;
+
+                //极差数据
+                double[] dataRange = null;
+
+                //计算均值与极差
+                Get_TestAvgRange(test_datas, sample_count, out dataAll, out dataAvg, out dataRange);
 
                 decimal a2 = (decimal)GetA2(sample_count);
                 decimal d2 = (decimal)GetD2(sample_count);
@@ -3696,21 +3835,25 @@ namespace Business.VSM
         }
 
         /// <summary>
-        /// 依据查询条件,统计工序的不良情况
+        /// 依据查询条件,查询用户上传的CTO产品特性数据
         /// </summary>
         /// <param name="startDate"></param>
         /// <param name="endDate"></param>
         /// <param name="item_no"></param>
         /// <param name="item_batch"></param>
         /// <param name="org"></param>
+        /// <param name="standard_no"></param>
         /// <returns></returns>
-        public string Compute_op_query(string startDate, string endDate, string item_no, string item_batch, string org)
+        public List<v_sqe_cto_test_data> Get_TestData(string startDate, string endDate,
+            string item_no, string item_batch,
+            string org, string standard_no)
         {
             try
             {
                 #region 查询条件
                 // 动态条件
-                var conditions = new List<Expression<Func<v_sqe_op_data_detail, bool>>>();
+                var conditions = new List<Expression<Func<v_sqe_cto_test_data, bool>>>();
+                conditions.Add(p => p.data_value != null);
                 if (!string.IsNullOrEmpty(startDate))
                 {
                     DateTime dateTime;
@@ -3737,49 +3880,850 @@ namespace Business.VSM
                 if (!string.IsNullOrEmpty(item_batch))
                 {
                     // 添加条件1:Name 包含 "searchTerm"
-                    conditions.Add(p => p.batch_no == item_batch);
+                    conditions.Add(p => p.item_batch == item_batch);
                 }
                 if (!string.IsNullOrEmpty(org))
                 {
                     // 添加条件1:Name 包含 "searchTerm"
                     conditions.Add(p => p.create_org == org);
                 }
+                if (!string.IsNullOrEmpty(standard_no))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.standard_no == standard_no);
+                }
 
                 // 组合条件
-                var combinedCondition = PredicateBuilder.New<v_sqe_op_data_detail>();
-                //此处是所有的条件都and。
+                var combinedCondition = PredicateBuilder.New<v_sqe_cto_test_data>();
                 foreach (var condition in conditions)
                 {
                     combinedCondition = combinedCondition.And(condition);
                 }
-                var query = _v_sqe_op_data_detail.GetDbContext().v_sqe_op_data_detail.AsQueryable();
+
+                var query = _v_sqe_cto_test_data.GetDbContext().v_sqe_cto_test_data.AsQueryable();
 
                 // 应用条件
-                if (conditions.Count > 0)
+                if (combinedCondition.Body != null)
                 {
                     query = query.Where(combinedCondition);
                 }
                 #endregion 查询条件
 
-                // 分组统计,此处多个条件进行统计,p.bad_type, p.op_no 
-                var groupBy = query.GroupBy(p => new { p.bad_type, p.op_no })
-                .Select(g => new
-                {
-                    bad_type = g.Key.bad_type,
-                    op_no = g.Key.op_no,
-                    bad_qty = g.Sum(p => p.bad_qty)
-                });
+                // 执行查询
+                List<v_sqe_cto_test_data> test_datas = query.DefaultIfEmpty().ToList();
+                return test_datas;
+            }
+            catch (Exception ex)
+            {
+                return null;
+            }
+        }
 
-                //增加排序条件,此处多个条件,op_no,bad_type
-                var test_datas = groupBy.OrderBy(p => p.op_no).ThenBy(p => p.bad_type).ToList();
-                ResultViewModel result = ResultHelper.CreateResult(ResultCode.Success, test_datas, ResultCode.Success, null);
-                return JsonConvert.SerializeObject(result);
+        /// <summary>
+        /// 依据CTO产品特性数据,采样数,统计均值与极差
+        /// </summary>
+        /// <param name="datas"></param>
+        /// <param name="sample_count"></param>
+        /// <param name="dataAll"></param>
+        /// <param name="dataAvg"></param>
+        /// <param name="dataRange"></param>
+        public void Get_TestAvgRange(List<v_sqe_cto_test_data> datas, int sample_count, out double[] dataAll, out double[] dataAvg, out double[] dataRange)
+        {
+            //所有的检测数据,按照进行采样数进行归一
+            dataAll = new double[datas.Count / sample_count * sample_count];
+            //均值数据
+            dataAvg = new double[datas.Count / sample_count];
+            //极差数据
+            dataRange = new double[datas.Count / sample_count];
+
+            //计算极差与均值时的临时数据
+            double[] data = new double[sample_count];
 
+            //计算所有的均值与极差
+            for (int i = 0; i <= datas.Count - sample_count; i += sample_count)
+            {
+                for (int j = 0; j < sample_count; j++)
+                {
+                    data[j] = (double)datas[i + j].data_value.Value;
+                    dataAll[i + j] = data[j];
+                }
+                dataRange[i / sample_count] = data.Max() - data.Min();
             }
-            catch (Exception ex)
+        }
+
+
+
+
+        /// <summary>
+        /// 依据查询条件,统计工序的不良情况
+        /// </summary>
+        /// <param name="startDate"></param>
+        /// <param name="endDate"></param>
+        /// <param name="item_no"></param>
+        /// <param name="item_batch"></param>
+        /// <param name="org"></param>
+        /// <returns></returns>
+        public string Compute_op_query(string startDate, string endDate, string item_no, string item_batch, string org, string op, string bad_type)
+        {
+            try
+            {
+                #region 查询条件
+                // 动态条件
+                var conditions = new List<Expression<Func<v_sqe_op_data_detail, bool>>>();
+                if (!string.IsNullOrEmpty(startDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(startDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date >= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(endDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(endDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date <= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(item_no))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.item_no == item_no);
+                }
+                if (!string.IsNullOrEmpty(item_batch))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.batch_no == item_batch);
+                }
+                if (!string.IsNullOrEmpty(org))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.create_org == org);
+                }
+                if (!string.IsNullOrEmpty(op))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.op_no == op);
+                }
+                if (!string.IsNullOrEmpty(bad_type))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.bad_type == bad_type);
+                }
+
+                // 组合条件
+                var combinedCondition = PredicateBuilder.New<v_sqe_op_data_detail>();
+                //此处是所有的条件都and。
+                foreach (var condition in conditions)
+                {
+                    combinedCondition = combinedCondition.And(condition);
+                }
+                var query = _v_sqe_op_data_detail.GetDbContext().v_sqe_op_data_detail.AsQueryable();
+
+                // 应用条件
+                if (conditions.Count > 0)
+                {
+                    query = query.Where(combinedCondition);
+                }
+                #endregion 查询条件
+
+                // 分组统计,此处多个条件进行统计,p.bad_type, p.op_no 
+                var groupBy = query.GroupBy(p => new { p.bad_type, p.op_no })
+                .Select(g => new
+                {
+                    bad_type = g.Key.bad_type,
+                    op_no = g.Key.op_no,
+                    bad_qty = g.Sum(p => p.bad_qty)
+                });
+
+                //增加排序条件,此处多个条件,op_no,bad_type
+                var test_datas = groupBy.OrderBy(p => p.op_no).ThenBy(p => p.bad_type).ToList();
+                ResultViewModel result = ResultHelper.CreateResult(ResultCode.Success, test_datas, ResultCode.Success, null);
+                return JsonConvert.SerializeObject(result);
+
+            }
+            catch (Exception ex)
+            {
+                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择的数据在统计中出现问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                return JsonConvert.SerializeObject(resultError);
+            }
+            return null;
+        }
+
+        /// <summary>
+        /// 工序统计图
+        /// </summary>
+        /// <param name="startDate"></param>
+        /// <param name="endDate"></param>
+        /// <param name="item_no"></param>
+        /// <param name="item_batch"></param>
+        /// <param name="org"></param>
+        /// <param name="op"></param>
+        /// <param name="bad_type"></param>
+        /// <returns></returns>
+        public string Compute_OpChartData(string startDate, string endDate, string item_no, string item_batch, string org, string op, string bad_type)
+        {
+            try
+            {
+                #region 查询条件
+                // 动态条件
+                var conditions = new List<Expression<Func<v_sqe_op_data_detail, bool>>>();
+                if (!string.IsNullOrEmpty(startDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(startDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date >= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(endDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(endDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date <= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(item_no))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.item_no == item_no);
+                }
+                if (!string.IsNullOrEmpty(item_batch))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.batch_no == item_batch);
+                }
+                if (!string.IsNullOrEmpty(org))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.create_org == org);
+                }
+                if (!string.IsNullOrEmpty(op))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.op_no == op);
+                }
+                if (!string.IsNullOrEmpty(bad_type))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.bad_type == bad_type);
+                }
+
+                // 组合条件
+                var combinedCondition = PredicateBuilder.New<v_sqe_op_data_detail>();
+                //此处是所有的条件都and。
+                foreach (var condition in conditions)
+                {
+                    combinedCondition = combinedCondition.And(condition);
+                }
+                var query = _v_sqe_op_data_detail.GetDbContext().v_sqe_op_data_detail.AsQueryable();
+
+                // 应用条件
+                if (conditions.Count > 0)
+                {
+                    query = query.Where(combinedCondition);
+                }
+                #endregion 查询条件
+
+                // 分组统计,此处多个条件进行统计,p.bad_type, p.op_no 
+                var groupBy = query.GroupBy(p => new { p.bad_type, p.op_no })
+                .Select(g => new
+                {
+                    bad_type = g.Key.bad_type,
+                    op_no = g.Key.op_no,
+                    bad_qty = g.Sum(p => p.bad_qty)
+                });
+
+                //增加排序条件,此处多个条件,op_no,bad_type
+                var test_datas = groupBy.OrderBy(p => p.op_no).ThenBy(p => p.bad_type).ToList();
+
+                //生成临时数据,插入数据库
+                List<sqe_chart_data_temp> models = new List<sqe_chart_data_temp>();
+                sqe_chart_data_temp model;
+                DateTime dateTimeNow = DateTime.Now;
+                for (int i = 0; i < test_datas.Count; i++)
+                {
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = test_datas[i].bad_type;
+                    model.type_name = test_datas[i].op_no;
+                    model.type_value = test_datas[i].bad_qty;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                }
+
+                _sqe_chart_data_temp.Insert(models);
+                ResultViewModel result = ResultHelper.CreateResult(ResultCode.Success, dateTimeNow.Ticks.ToString(), ResultCode.Success, null);
+                return JsonConvert.SerializeObject(result);
+
+            }
+            catch (Exception ex)
+            {
+                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择的数据在统计中出现问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                return JsonConvert.SerializeObject(resultError);
+            }
+            return null;
+        }
+
+        /// <summary>
+        /// 统计工序百分比
+        /// </summary>
+        /// <param name="startDate"></param>
+        /// <param name="endDate"></param>
+        /// <param name="item_no"></param>
+        /// <param name="item_batch"></param>
+        /// <param name="org"></param>
+        /// <param name="op"></param>
+        /// <returns></returns>
+        public string Compute_OpChartData_Date(string startDate, string endDate, string item_no, string item_batch, string org, string op)
+        {
+            try
+            {
+                #region 查询条件
+                // 动态条件
+                var conditions = new List<Expression<Func<v_sqe_op_data_detail, bool>>>();
+                if (!string.IsNullOrEmpty(startDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(startDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date >= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(endDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(endDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date <= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(item_no))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.item_no == item_no);
+                }
+                if (!string.IsNullOrEmpty(item_batch))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.batch_no == item_batch);
+                }
+                if (!string.IsNullOrEmpty(org))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.create_org == org);
+                }
+                if (!string.IsNullOrEmpty(op))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.op_no == op);
+                }
+
+                // 组合条件
+                var combinedCondition = PredicateBuilder.New<v_sqe_op_data_detail>();
+                //此处是所有的条件都and。
+                foreach (var condition in conditions)
+                {
+                    combinedCondition = combinedCondition.And(condition);
+                }
+                var query = _v_sqe_op_data_detail.GetDbContext().v_sqe_op_data_detail.AsQueryable();
+
+                // 应用条件
+                if (conditions.Count > 0)
+                {
+                    query = query.Where(combinedCondition);
+                }
+                #endregion 查询条件
+
+                // 分组统计,此处多个条件进行统计,p.bad_type, p.op_no 
+                var groupBy = query.GroupBy(p => new { p.op_time, p.op_no })
+                .Select(g => new
+                {
+                    op_time = g.Key.op_time,
+                    op_no = g.Key.op_no,
+                    qty_ok = g.Sum(p => p.qty_ok),
+                    qty_all = g.Sum(p => p.qty_all),
+                    percent = g.Sum(p => p.qty_ok) / g.Sum(p => p.qty_all)
+                });
+
+                //增加排序条件,此处多个条件,op_no,bad_type
+                var test_datas = groupBy.OrderBy(p => p.op_time).ThenBy(p => p.op_no).ToList();
+
+                //生成临时数据,插入数据库
+                List<sqe_chart_data_temp> models = new List<sqe_chart_data_temp>();
+                sqe_chart_data_temp model;
+                DateTime dateTimeNow = DateTime.Now;
+                for (int i = 0; i < test_datas.Count; i++)
+                {
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = test_datas[i].op_time.Value.ToString("yyyy-MM-dd");
+                    model.type_name = test_datas[i].op_no;
+                    model.type_value = test_datas[i].percent;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                }
+
+                _sqe_chart_data_temp.Insert(models);
+                ResultViewModel result = ResultHelper.CreateResult(ResultCode.Success, dateTimeNow.Ticks.ToString(), ResultCode.Success, null);
+                return JsonConvert.SerializeObject(result);
+
+            }
+            catch (Exception ex)
+            {
+                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择的数据在统计中出现问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                return JsonConvert.SerializeObject(resultError);
+            }
+            return null;
+        }
+
+        public string Compute_FpyChartData(string startDate, string endDate, string item_no, string org, string op)
+        {
+            try
+            {
+                #region 查询条件
+                // 动态条件
+                var conditions = new List<Expression<Func<v_sqe_fpy_data, bool>>>();
+                if (!string.IsNullOrEmpty(startDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(startDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date >= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(endDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(endDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date <= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(item_no))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.item_no == item_no);
+                }
+
+                if (!string.IsNullOrEmpty(org))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.create_org == org);
+                }
+                if (!string.IsNullOrEmpty(op))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.op_no == op);
+                }
+                // 组合条件
+                var combinedCondition = PredicateBuilder.New<v_sqe_fpy_data>();
+                //此处是所有的条件都and。
+                foreach (var condition in conditions)
+                {
+                    combinedCondition = combinedCondition.And(condition);
+                }
+                var query = _v_sqe_fpy_data.GetDbContext().v_sqe_fpy_data.AsQueryable();
+
+                // 应用条件
+                if (conditions.Count > 0)
+                {
+                    query = query.Where(combinedCondition);
+                }
+                #endregion 查询条件
+
+                // 分组统计,此处多个条件进行统计,p.bad_type, p.op_no 
+                var groupBy = query.GroupBy(p => new { p.op_no })
+                .Select(g => new
+                {
+                    op_no = g.Key.op_no,
+                    qty_error = g.Sum(p => p.qty_error),
+                    qty_all = g.Sum(p => p.qty_all),
+                });
+
+                //增加排序条件,此处多个条件,op_no,bad_type
+                var test_datas = groupBy.OrderBy(p => p.op_no).ToList();
+
+                //生成临时数据,插入数据库
+                List<sqe_chart_data_temp> models = new List<sqe_chart_data_temp>();
+                sqe_chart_data_temp model;
+                DateTime dateTimeNow = DateTime.Now;
+                for (int i = 0; i < test_datas.Count; i++)
+                {
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "期间投入总数";
+                    model.type_name = test_datas[i].op_no;
+                    model.type_value = test_datas[i].qty_all;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "期间不良总数";
+                    model.type_name = test_datas[i].op_no;
+                    model.type_value = test_datas[i].qty_error;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "良率";
+                    model.type_name = test_datas[i].op_no;
+                    model.type_value = (1 - test_datas[i].qty_error / test_datas[i].qty_all);
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                }
+
+                _sqe_chart_data_temp.Insert(models);
+                ResultViewModel result = ResultHelper.CreateResult(ResultCode.Success, dateTimeNow.Ticks.ToString(), ResultCode.Success, null);
+                return JsonConvert.SerializeObject(result);
+
+            }
+            catch (Exception ex)
+            {
+                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择的数据在统计中出现问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                return JsonConvert.SerializeObject(resultError);
+            }
+            return null;
+        }
+
+        public string Compute_FpyChartData_Date(string startDate, string endDate, string item_no, string org, string op)
+        {
+            try
+            {
+                #region 查询条件
+                // 动态条件
+                var conditions = new List<Expression<Func<v_sqe_fpy_data, bool>>>();
+                if (!string.IsNullOrEmpty(startDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(startDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date >= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(endDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(endDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.create_date <= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(item_no))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.item_no == item_no);
+                }
+
+                if (!string.IsNullOrEmpty(org))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.create_org == org);
+                }
+                if (!string.IsNullOrEmpty(op))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.op_no == op);
+                }
+                // 组合条件
+                var combinedCondition = PredicateBuilder.New<v_sqe_fpy_data>();
+                //此处是所有的条件都and。
+                foreach (var condition in conditions)
+                {
+                    combinedCondition = combinedCondition.And(condition);
+                }
+                var query = _v_sqe_fpy_data.GetDbContext().v_sqe_fpy_data.AsQueryable();
+
+                // 应用条件
+                if (conditions.Count > 0)
+                {
+                    query = query.Where(combinedCondition);
+                }
+                #endregion 查询条件
+
+                // 分组统计,此处多个条件进行统计,p.bad_type, p.op_no 
+                var groupBy = query.GroupBy(p => new { p.op_time })
+                .Select(g => new
+                {
+                    op_time = g.Key.op_time,
+                    qty_error = g.Sum(p => p.qty_error),
+                    qty_all = g.Sum(p => p.qty_all)
+                });
+
+                //增加排序条件,此处多个条件,op_no,bad_type
+                var test_datas = groupBy.OrderBy(p => p.op_time).ToList();
+
+                //生成临时数据,插入数据库
+                List<sqe_chart_data_temp> models = new List<sqe_chart_data_temp>();
+                sqe_chart_data_temp model;
+                DateTime dateTimeNow = DateTime.Now;
+                for (int i = 0; i < test_datas.Count; i++)
+                {
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = test_datas[i].op_time.Value.ToString("MM-dd");
+                    model.type_name = "走势图";
+                    model.type_value = (1 - test_datas[i].qty_error / test_datas[i].qty_all);
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                }
+
+                _sqe_chart_data_temp.Insert(models);
+                ResultViewModel result = ResultHelper.CreateResult(ResultCode.Success, dateTimeNow.Ticks.ToString(), ResultCode.Success, null);
+                return JsonConvert.SerializeObject(result);
+
+            }
+            catch (Exception ex)
+            {
+                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择的数据在统计中出现问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                return JsonConvert.SerializeObject(resultError);
+            }
+            return null;
+        }
+
+        /// <summary>
+        /// 已经查询条件,统计Oqc数据
+        /// </summary>
+        /// <param name="startDate"></param>
+        /// <param name="endDate"></param>
+        /// <param name="item_no"></param>
+        /// <param name="org"></param>
+        /// <returns></returns>
+        public string Compute_OqcChartData(string startDate, string endDate, string item_no, string org)
+        {
+            try
+            {
+                //增加排序条件,此处多个条件,op_no,bad_type
+                var test_datas = Get_OqcData(startDate, endDate, item_no, org, null);
+
+                //生成临时数据,插入数据库
+                List<sqe_chart_data_temp> models = new List<sqe_chart_data_temp>();
+                sqe_chart_data_temp model;
+                DateTime dateTimeNow = DateTime.Now;
+
+                //生成临时数据,插入数据库
+                sqe_oqc_statistics modelStatistics;
+                string standard_no = "";
+                for (int i = 0; i < test_datas.Count;)
+                {
+                    standard_no = test_datas[i].standard_no;
+                    if (standard_no == null)
+                    {
+                        i++;
+                        continue;
+                    }
+                    List<Double> dataList = new List<double>();
+                    int j = i;
+                    for (; j < test_datas.Count; j++)
+                    {
+                        if (standard_no.CompareTo(test_datas[j].standard_no) == 0)
+                        {
+                            dataList.Add((double)test_datas[j].data_value);
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                    Double[] datas = dataList.ToArray();
+                    modelStatistics = new sqe_oqc_statistics();
+                    try
+                    {
+                        modelStatistics.standard_no = standard_no;
+                        modelStatistics.value_avg = (decimal)datas.Average();
+                        modelStatistics.value_std_range = (decimal)datas.StandardDeviation();
+                        if (modelStatistics.value_std_range != 0)
+                        {
+                            modelStatistics.value_pp = (test_datas[i].standard_max - test_datas[i].standard_min) / modelStatistics.value_std_range;
+                            if (modelStatistics.value_pp > 100000)
+                            {
+                                modelStatistics.value_pp = 100000;
+                            }
+                        }
+                        else
+                        {
+                            i = j;
+                            continue;
+                        }
+                        //=MIN((B10-Q53)/(3*R53),(Q53-B11)/(3*R53))
+                        decimal d1, d2;
+                        d1 = (test_datas[i].standard_max - modelStatistics.value_avg) / 3 * modelStatistics.value_std_range;
+                        d2 = (modelStatistics.value_avg - test_datas[i].standard_min) / 3 * modelStatistics.value_std_range;
+                        modelStatistics.value_ppk = d1 > d2 ? d2 : d1;
+                        modelStatistics.value_max = (decimal)datas.Max();
+                        modelStatistics.value_min = (decimal)datas.Min();
+                        modelStatistics.value_range = modelStatistics.value_max - modelStatistics.value_min;
+                    }
+                    catch (Exception ex)
+                    {
+                        i = j;
+                        continue;
+                    }
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "均值";
+                    model.type_name = standard_no;
+                    model.type_value = modelStatistics.value_avg;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                    Console.WriteLine(model.type_value);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "西格玛(标准差)";
+                    model.type_name = standard_no;
+                    model.type_value = modelStatistics.value_std_range;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                    Console.WriteLine(model.type_value);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "PP";
+                    model.type_name = standard_no;
+                    model.type_value = modelStatistics.value_pp;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                    Console.WriteLine(model.type_value);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "PPK";
+                    model.type_name = standard_no;
+                    model.type_value = modelStatistics.value_ppk;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                    Console.WriteLine(model.type_value);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "Max";
+                    model.type_name = standard_no;
+                    model.type_value = modelStatistics.value_max;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                    Console.WriteLine(model.type_value);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "Min";
+                    model.type_name = standard_no;
+                    model.type_value = modelStatistics.value_min;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                    Console.WriteLine(model.type_value);
+
+                    model = new sqe_chart_data_temp();
+                    model.data_id = dateTimeNow.Ticks;
+                    model.sub_group = "极差(Max-Min)";
+                    model.type_name = standard_no;
+                    model.type_value = modelStatistics.value_range;
+                    model.data_time = dateTimeNow;
+                    models.Add(model);
+                    Console.WriteLine(model.type_value);
+
+                    i = j;
+
+                }
+                _sqe_chart_data_temp.Insert(models);
+                ResultViewModel result = ResultHelper.CreateResult(ResultCode.Success, dateTimeNow.Ticks.ToString(), ResultCode.Success, null);
+                return JsonConvert.SerializeObject(result);
+            }
+            catch (Exception ex)
+            {
+                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择的数据在统计中出现问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
+                return JsonConvert.SerializeObject(resultError);
+            }
+            return null;
+        }
+
+        /// <summary>
+        /// 查询Oqc的数据信息
+        /// </summary>
+        /// <param name="startDate"></param>
+        /// <param name="endDate"></param>
+        /// <param name="item_no"></param>
+        /// <param name="org"></param>
+        /// <param name="standard_no"></param>
+        /// <returns></returns>
+        public List<v_sqe_oqc_data> Get_OqcData(string startDate, string endDate, string item_no, string org, string standard_no)
+        {
+            try
+            {
+                #region 查询条件
+                // 动态条件
+                var conditions = new List<Expression<Func<v_sqe_oqc_data, bool>>>();
+                if (!string.IsNullOrEmpty(startDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(startDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.product_time >= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(endDate))
+                {
+                    DateTime dateTime;
+                    if (DateTime.TryParse(endDate, out dateTime))
+                    {
+                        // 添加条件1:Name 包含 "searchTerm"
+                        conditions.Add(p => p.product_time <= dateTime);
+                    }
+                }
+                if (!string.IsNullOrEmpty(item_no))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.item_no == item_no);
+                }
+
+                if (!string.IsNullOrEmpty(org))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.create_org == org);
+                }
+                if (!string.IsNullOrEmpty(standard_no))
+                {
+                    // 添加条件1:Name 包含 "searchTerm"
+                    conditions.Add(p => p.standard_no == standard_no);
+                }
+                // 组合条件
+                var combinedCondition = PredicateBuilder.New<v_sqe_oqc_data>();
+                //此处是所有的条件都and。
+                foreach (var condition in conditions)
+                {
+                    combinedCondition = combinedCondition.And(condition);
+                }
+                var query = _v_sqe_oqc_data.GetDbContext().v_sqe_oqc_data.AsQueryable();
+
+                // 应用条件
+                if (conditions.Count > 0)
+                {
+                    query = query.Where(combinedCondition);
+                }
+                #endregion 查询条件
+
+                //增加排序条件,此处多个条件,op_no,bad_type
+                var test_datas = query.OrderBy(p => p.standard_no).DefaultIfEmpty().ToList();
+                return test_datas;
+            }
+            catch (Exception ex)
             {
-                ResultViewModel resultError = ResultHelper.CreateResult(ResultCode.BusinessError, "您选择的数据在统计中出现问题,请核对之后再进行操作!", ResultCode.BusinessError, null);
-                return JsonConvert.SerializeObject(resultError);
             }
             return null;
         }

+ 47 - 0
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_chart_data_temp.cs

@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Business.Core.Attributes;
+using System.IO;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class sqe_chart_data_temp
+    {
+
+        /// <summary>
+        /// 流水号主键
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// Data主键
+        /// </summary>
+        public Int64 data_id { get; set; }
+
+        /// <summary>
+        /// 分组名称
+        /// </summary>
+        public string sub_group { get; set; }
+
+        /// <summary>
+        /// 类型名称
+        /// </summary>
+        public string type_name { get; set; }
+
+        /// <summary>
+        /// 类型的值
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal type_value { get; set; }
+
+        /// <summary>
+        /// Data的日期
+        /// </summary>
+        public DateTime? data_time { get; set; }
+
+    }
+}

+ 2 - 2
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process.cs

@@ -25,7 +25,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 生产时间
         /// </summary>
-        public DateTime product_time { get; set; }
+        public DateTime? product_time { get; set; }
 
         /// <summary>
         /// 生产班次
@@ -108,7 +108,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

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

@@ -51,7 +51,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process_standard.cs

@@ -60,7 +60,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 2 - 2
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test.cs

@@ -25,7 +25,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 生产时间
         /// </summary>
-        public DateTime product_time { get; set; }
+        public DateTime? product_time { get; set; }
 
         /// <summary>
         /// 生产班次
@@ -102,7 +102,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_avg.cs

@@ -84,7 +84,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_data.cs

@@ -51,7 +51,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_standard.cs

@@ -70,7 +70,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 70 - 3
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_test_statistics.cs

@@ -7,7 +7,7 @@ using System.IO;
 namespace Business.StructuredDB.Sqe
 {
     /// <summary>
-    /// 产品过程检验记录
+    /// 
     /// </summary>
     public class sqe_cto_test_statistics
     {
@@ -23,11 +23,78 @@ namespace Business.StructuredDB.Sqe
         public Int64 cto_test_id { get; set; }
 
         /// <summary>
-        /// 检验标准编号_尺寸
+        /// 统计起始日期
+        /// </summary>
+        public DateTime? start_date { get; set; }
+
+        /// <summary>
+        /// 统计结束日期
+        /// </summary>
+        public DateTime? end_date { get; set; }
+
+        /// <summary>
+        /// 供应商编码
+        /// </summary>
+        public string supp_no { get; set; }
+
+        /// <summary>
+        /// 生产时间
+        /// </summary>
+        public DateTime? product_time { get; set; }
+
+        /// <summary>
+        /// 生产班次
+        /// </summary>
+        public string shift_no { get; set; }
+
+        /// <summary>
+        /// 物料号
+        /// </summary>
+        public string item_no { get; set; }
+
+        /// <summary>
+        /// 物料批次号
+        /// </summary>
+        public string item_batch { get; set; }
+
+        /// <summary>
+        /// 当工序
+        /// </summary>
+        public string op_current { get; set; }
+
+        /// <summary>
+        /// 设备名称
+        /// </summary>
+        public string device_name { get; set; }
+
+        /// <summary>
+        /// 设备机台号
+        /// </summary>
+        public string device_no { get; set; }
+
+        /// <summary>
+        /// 抽样数
+        /// </summary>
+        public int sampling_number { get; set; }
+
+        /// <summary>
+        /// 检验标准编号
         /// </summary>
         public string standard_no { get; set; }
 
         /// <summary>
+        /// 上公差
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal delta_up { get; set; }
+
+        /// <summary>
+        /// 下公差
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal delta_down { get; set; }
+
+        /// <summary>
         /// 取值数
         /// </summary>
         [DecimalPrecision(18, 5)]
@@ -178,7 +245,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 11 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_fct.cs

@@ -20,7 +20,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime ? create_date { get; set; }
 
         /// <summary>
         /// 创建人员
@@ -97,5 +97,15 @@ namespace Business.StructuredDB.Sqe
         /// </summary>
         public string msg { get; set; }
 
+        /// <summary>
+        /// 批次号
+        /// </summary>
+        public string SerialNO { get; set; }
+
+        /// <summary>
+        /// 测试时间
+        /// </summary>
+        public DateTime ? test_date { get; set; }
+
     }
 }

+ 3 - 3
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_fct_data.cs

@@ -58,12 +58,12 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 测试项开始时间
         /// </summary>
-        public DateTime start_time { get; set; }
+        public DateTime? start_time { get; set; }
 
         /// <summary>
         /// 测试项结束时间
         /// </summary>
-        public DateTime end_time { get; set; }
+        public DateTime? end_time { get; set; }
 
         /// <summary>
         /// 测试项描述说明
@@ -73,7 +73,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 7 - 2
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_file_upload.cs

@@ -25,7 +25,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 生产时间
         /// </summary>
-        public DateTime ? product_time { get; set; }
+        public DateTime? product_time { get; set; }
 
         /// <summary>
         /// 生产班次
@@ -65,7 +65,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员
@@ -82,5 +82,10 @@ namespace Business.StructuredDB.Sqe
         /// </summary>
         public int delete_flag { get; set; }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 transfer_id { get; set; }
+
     }
 }

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_fpy.cs

@@ -20,7 +20,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 2 - 2
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_fpy_data.cs

@@ -25,7 +25,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 日期
         /// </summary>
-        public DateTime op_time { get; set; }
+        public DateTime? op_time { get; set; }
 
         /// <summary>
         /// 物料号
@@ -63,7 +63,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_op.cs

@@ -20,7 +20,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 2 - 2
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_op_data.cs

@@ -30,7 +30,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 日期
         /// </summary>
-        public DateTime op_time { get; set; }
+        public DateTime? op_time { get; set; }
 
         /// <summary>
         /// 客户料号
@@ -85,7 +85,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_op_data_detail.cs

@@ -53,7 +53,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 2 - 2
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_oqc.cs

@@ -40,7 +40,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 日期
         /// </summary>
-        public DateTime product_time { get; set; }
+        public DateTime? product_time { get; set; }
 
         /// <summary>
         /// 批次号
@@ -77,7 +77,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_oqc_data.cs

@@ -46,7 +46,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_oqc_standard.cs

@@ -60,7 +60,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 创建日期
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 创建人员

+ 140 - 0
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_oqc_statistics.cs

@@ -0,0 +1,140 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Business.Core.Attributes;
+using System.IO;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// OQC统计
+    /// </summary>
+    public class sqe_oqc_statistics
+    {
+
+        /// <summary>
+        /// 流水号主键
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// Data主键
+        /// </summary>
+        public Int64 data_id { get; set; }
+
+        /// <summary>
+        /// OQC标识
+        /// </summary>
+        public Int64 oqc_id { get; set; }
+
+        /// <summary>
+        /// 统计起始日期
+        /// </summary>
+        public DateTime ? start_date { get; set; }
+
+        /// <summary>
+        /// 统计结束日期
+        /// </summary>
+        public DateTime ? end_date { get; set; }
+
+        /// <summary>
+        /// 供应商编码
+        /// </summary>
+        public string supp_no { get; set; }
+
+        /// <summary>
+        /// 物料名称
+        /// </summary>
+        public string item_name { get; set; }
+
+        /// <summary>
+        /// 物料号
+        /// </summary>
+        public string item_no { get; set; }
+
+        /// <summary>
+        /// 物料版本号
+        /// </summary>
+        public string item_version { get; set; }
+
+        /// <summary>
+        /// 日期
+        /// </summary>
+        public DateTime ? product_time { get; set; }
+
+        /// <summary>
+        /// 批次号
+        /// </summary>
+        public string batch_no { get; set; }
+
+        /// <summary>
+        /// 批次数量
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal batch_qty { get; set; }
+
+        /// <summary>
+        /// 检验人员
+        /// </summary>
+        public string test_person { get; set; }
+
+        /// <summary>
+        /// 抽样标准
+        /// </summary>
+        public string sampling_standard { get; set; }
+
+        /// <summary>
+        /// 抽样数量
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal sampling_number { get; set; }
+
+        /// <summary>
+        /// 检验项目
+        /// </summary>
+        public string standard_no { get; set; }
+
+        /// <summary>
+        /// 均值
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_avg { get; set; }
+
+        /// <summary>
+        /// 标准差
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_std_range { get; set; }
+
+        /// <summary>
+        /// PP
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_pp { get; set; }
+
+        /// <summary>
+        /// PPK
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_ppk { get; set; }
+
+        /// <summary>
+        /// Max
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_max { get; set; }
+
+        /// <summary>
+        /// Min
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_min { get; set; }
+
+        /// <summary>
+        /// 极差
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_range { get; set; }
+
+    }
+}

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

@@ -45,7 +45,12 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 
         /// </summary>
-        public DateTime createTime { get; set; }
+        public DateTime? createTime { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 glid { get; set; }
 
     }
 }

+ 205 - 0
MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_cto_process_data.cs

@@ -0,0 +1,205 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Business.Core.Attributes;
+using System.IO;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class v_sqe_cto_process_data
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 standard_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string data_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string data_time { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal data_value { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string data_result { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string file_path { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 file_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string supp_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime? product_time { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string shift_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_name { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string material_batch { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal material_used { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_batch { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal item_qty { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_pre { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_pre_batch { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_current { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_batch { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string device_name { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string device_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string sampling_freq { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal sampling_number { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime? create_date { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string create_by { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string create_org { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int delete_flag { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 process_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string standard_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_value { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal delta_up { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal delta_down { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_max { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_min { get; set; }
+
+    }
+}

+ 226 - 0
MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_cto_test_avg.cs

@@ -0,0 +1,226 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Business.Core.Attributes;
+using System.IO;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class v_sqe_cto_test_avg
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string supp_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime? product_time { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string shift_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_name { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string material_batch { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal material_used { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_batch { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal item_qty { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_pre { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_pre_batch { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_current { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_batch { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string device_name { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string device_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int sampling_number { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 file_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int sampling_count { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string is_associated_size { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_value { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal delta_up { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal delta_down { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_max { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_min { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 cto_test_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string standard_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal mean_value { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal range_value { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal mean_value_all { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal range_value_all { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_uclx { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_lclx { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_uclr { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal value_lclr { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime? create_date { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string create_by { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string create_org { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int delete_flag { get; set; }
+
+    }
+}

+ 6 - 5
MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_cto_test_data.cs

@@ -15,12 +15,13 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 
         /// </summary>
-        public Int64 test_id { get; set; }
+        public Int64 id { get; set; }
 
         /// <summary>
         /// 
         /// </summary>
-        public Int64 id { get; set; }
+        public Int64 test_id { get; set; }
+
 
         /// <summary>
         /// 
@@ -41,7 +42,7 @@ namespace Business.StructuredDB.Sqe
         /// 
         /// </summary>
         [DecimalPrecision(18, 5)]
-        public decimal? data_value { get; set; }
+        public decimal ? data_value { get; set; }
 
         /// <summary>
         /// 
@@ -101,7 +102,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 
         /// </summary>
-        public DateTime product_time { get; set; }
+        public DateTime? product_time { get; set; }
 
         /// <summary>
         /// 
@@ -178,7 +179,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 

+ 94 - 0
MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_fpy_data.cs

@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Business.Core.Attributes;
+using System.IO;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class v_sqe_fpy_data
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 fpy_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime? op_time { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_name { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string op_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal qty_all { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal qty_error { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal percent_ok { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime? create_date { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string create_by { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string create_org { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int delete_flag { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 file_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string file_path { get; set; }
+
+    }
+}

+ 2 - 2
MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_op_data_detail.cs

@@ -63,7 +63,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 
         /// </summary>
-        public DateTime op_time { get; set; }
+        public DateTime? op_time { get; set; }
 
         /// <summary>
         /// 
@@ -118,7 +118,7 @@ namespace Business.StructuredDB.Sqe
         /// <summary>
         /// 
         /// </summary>
-        public DateTime create_date { get; set; }
+        public DateTime? create_date { get; set; }
 
         /// <summary>
         /// 

+ 169 - 0
MicroServices/Business/Business.Domain/StructuredDB/Sqe/v_sqe_oqc_data.cs

@@ -0,0 +1,169 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Business.Core.Attributes;
+using System.IO;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    public class v_sqe_oqc_data
+    {
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 standard_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string data_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal data_value { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string data_result { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 file_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string file_path { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string supp_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_name { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string item_version { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime? product_time { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string batch_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal batch_qty { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string test_person { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string sampling_standard { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal sampling_number { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string test_result { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime? create_date { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string create_by { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string create_org { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int delete_flag { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public Int64 oqc_id { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string standard_no { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_value { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal delta_up { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal delta_down { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_max { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [DecimalPrecision(18, 5)]
+        public decimal standard_min { get; set; }
+
+    }
+}

+ 85 - 50
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/BusinessDbContextModelCreatingExtensions.cs

@@ -508,11 +508,20 @@ namespace Business.EntityFrameworkCore
 
         public static void ConfigureBusinessSqe(this ModelBuilder builder)
         {
-            Check.NotNull(builder, nameof(builder));
+            //Check.NotNull(builder, nameof(builder));
+
+            builder.Entity<sqe_chart_data_temp>(b =>
+            {
+                b.ToTable("sqe_chart_data_temp");
+                //b.HasNoKey();
+                b.ConfigureByConvention();
+
+            });
+
             builder.Entity<sqe_cto_process>(b =>
             {
                 b.ToTable("sqe_cto_process");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -521,7 +530,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_cto_process_data>(b =>
             {
                 b.ToTable("sqe_cto_process_data");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -530,7 +539,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_cto_process_standard>(b =>
             {
                 b.ToTable("sqe_cto_process_standard");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -539,7 +548,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_cto_test>(b =>
             {
                 b.ToTable("sqe_cto_test");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -548,16 +557,17 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_cto_test_avg>(b =>
             {
                 b.ToTable("sqe_cto_test_avg");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
             });
 
+
             builder.Entity<sqe_cto_test_data>(b =>
             {
                 b.ToTable("sqe_cto_test_data");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -566,7 +576,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_cto_test_standard>(b =>
             {
                 b.ToTable("sqe_cto_test_standard");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -575,52 +585,45 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_cto_test_statistics>(b =>
             {
                 b.ToTable("sqe_cto_test_statistics");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
             });
 
-            builder.Entity<sqe_file_data>(b =>
+            builder.Entity<sqe_fct>(b =>
             {
-                b.ToTable("sqe_file_data");
-                b.HasNoKey();
-                //b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
+                b.ToTable("sqe_fct");
+                //b.HasNoKey();
+                b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
             });
 
-            builder.Entity<sqe_file_upload>(b =>
+            builder.Entity<sqe_fct_data>(b =>
             {
-                b.ToTable("sqe_file_upload");
-                b.HasNoKey();
+                b.ToTable("sqe_fct_data");
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
             });
 
-            builder.Entity<sqe_oqc>(b =>
-            {
-                b.ToTable("sqe_oqc");
-                b.HasNoKey();
-                b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
-                b.ConfigureByConvention();
 
-            });
 
-            builder.Entity<sqe_oqc_data>(b =>
+            builder.Entity<sqe_file_data>(b =>
             {
-                b.ToTable("sqe_oqc_data");
-                b.HasNoKey();
-                b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
+                b.ToTable("sqe_file_data");
+                //b.HasNoKey();
+                //b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
             });
 
-            builder.Entity<sqe_oqc_standard>(b =>
+            builder.Entity<sqe_file_upload>(b =>
             {
-                b.ToTable("sqe_oqc_standard");
-                b.HasNoKey();
+                b.ToTable("sqe_file_upload");
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -629,7 +632,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_fpy>(b =>
             {
                 b.ToTable("sqe_fpy");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -638,7 +641,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_fpy_data>(b =>
             {
                 b.ToTable("sqe_fpy_data");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -647,7 +650,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_op>(b =>
             {
                 b.ToTable("sqe_op");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -656,7 +659,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_op_data>(b =>
             {
                 b.ToTable("sqe_op_data");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
@@ -665,43 +668,75 @@ namespace Business.EntityFrameworkCore
             builder.Entity<sqe_op_data_detail>(b =>
             {
                 b.ToTable("sqe_op_data_detail");
-                b.HasNoKey();
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
             });
 
-            builder.Entity<sqe_fct>(b =>
+
+            builder.Entity<sqe_oqc>(b =>
             {
-                b.ToTable("sqe_fct");
-                b.HasNoKey();
+                b.ToTable("sqe_oqc");
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
             });
 
-            builder.Entity<sqe_fct_data>(b =>
+            builder.Entity<sqe_oqc_data>(b =>
             {
-                b.ToTable("sqe_fct_data");
-                b.HasNoKey();
+                b.ToTable("sqe_oqc_data");
+                //b.HasNoKey();
                 b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
 
             });
 
-            builder.Entity<v_sqe_cto_test_data>(b =>
+            builder.Entity<sqe_oqc_standard>(b =>
             {
-                b.ToView("v_sqe_cto_test_data");
-                b.HasNoKey();
+                b.ToTable("sqe_oqc_standard");
+                //b.HasNoKey();
+                b.Property(b => b.create_date).HasDefaultValue(DateTime.Now);
                 b.ConfigureByConvention();
-            });
 
-            builder.Entity<v_sqe_op_data_detail>(b =>
-            {
-                b.ToView("v_sqe_op_data_detail");
-                b.HasNoKey();
-                b.ConfigureByConvention();
             });
+
+
+            //builder.Entity<v_sqe_cto_process_data>(b =>
+            //{
+            //    b.ToView("v_sqe_cto_process_data");
+            //    b.HasNoKey();
+            //    b.ConfigureByConvention();
+            //});
+
+            //builder.Entity<v_sqe_cto_test_avg>(b =>
+            //{
+            //    b.ToView("v_sqe_cto_test_avg");
+            //    b.HasNoKey();
+            //    b.ConfigureByConvention();
+            //});
+
+            //builder.Entity<v_sqe_cto_test_data>(b =>
+            //{
+            //    b.ToView("v_sqe_cto_test_data");
+            //    b.HasNoKey();
+            //    b.ConfigureByConvention();
+            //});
+
+            //builder.Entity<v_sqe_op_data_detail>(b =>
+            //{
+            //    b.ToView("v_sqe_op_data_detail");
+            //    b.HasNoKey();
+            //    b.ConfigureByConvention();
+            //});
+
+            //builder.Entity<v_sqe_oqc_data>(b =>
+            //{
+            //    b.ToView("v_sqe_oqc_data");
+            //    b.HasNoKey();
+            //    b.ConfigureByConvention();
+            //});
         }
     }
 }

+ 16 - 5
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Sqe/BusinessSqeDbContext.cs

@@ -12,6 +12,7 @@ namespace Business.EntityFrameworkCore
     public class BusinessSqeDbContext : AbpDbContext<BusinessSqeDbContext>
     {
         #region SqeÊý¾Ý·ÃÎÊ
+        public DbSet<sqe_chart_data_temp> sqe_chart_data_temp { get; set; }
         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; }
@@ -20,21 +21,31 @@ namespace Business.EntityFrameworkCore
         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_cto_test_statistics> sqe_cto_test_statistics { get; set; }
+        public DbSet<sqe_fct> sqe_fct { get; set; }
+        public DbSet<sqe_fct_data> sqe_fct_data { get; set; }
         public DbSet<sqe_file_data> sqe_file_data { get; set; }
         public DbSet<sqe_file_upload> sqe_file_upload { get; set; }
-        public DbSet<sqe_oqc> sqe_oqc { get; set; }
-        public DbSet<sqe_oqc_data> sqe_oqc_data { get; set; }
-        public DbSet<sqe_oqc_standard> sqe_oqc_standard { get; set; }
         public DbSet<sqe_fpy> sqe_fpy { get; set; }
         public DbSet<sqe_fpy_data> sqe_fpy_data { get; set; }
         public DbSet<sqe_op> sqe_op { get; set; }
         public DbSet<sqe_op_data> sqe_op_data { get; set; }
         public DbSet<sqe_op_data_detail> sqe_op_data_detail { get; set; }
-        public DbSet<sqe_fct> sqe_fct { get; set; }
-        public DbSet<sqe_fct_data> sqe_fct_data { get; set; }
+        public DbSet<sqe_oqc> sqe_oqc { get; set; }
+        public DbSet<sqe_oqc_data> sqe_oqc_data { get; set; }
+        public DbSet<sqe_oqc_standard> sqe_oqc_standard { get; set; }
+        public DbSet<sqe_oqc_statistics> sqe_oqc_statistics { get; set; }
+        public DbSet<v_sqe_cto_process_data> v_sqe_cto_process_data { get; set; }
+
+        public DbSet<v_sqe_cto_test_avg> v_sqe_cto_test_avg { get; set; }
+
         public DbSet<v_sqe_cto_test_data> v_sqe_cto_test_data { get; set; }
+
+        public DbSet<v_sqe_fpy_data> v_sqe_fpy_data { get; set; }
+
         public DbSet<v_sqe_op_data_detail> v_sqe_op_data_detail { get; set; }
 
+        public DbSet<v_sqe_oqc_data> v_sqe_oqc_data { get; set; }
+
         #endregion SqeÊý¾Ý·ÃÎÊ
 
         //Code generation...

+ 67 - 14
MicroServices/Business/Business.HttpApi/Controllers/SqeController.cs

@@ -64,41 +64,41 @@ namespace Business.Controllers
 
         [HttpGet]
         [Route("import_test")]
-        public string Import_test(int file_id)
+        public string Import_test(int file_id, string create_by, string create_org)
         {
-            String s = _SqeExcelService.Import_Test_From_Data(file_id, "测试用户", DateTime.Now, "测试组织");
+            String s = _SqeExcelService.Import_Test_From_Data(file_id, create_by, DateTime.Now, create_org);
             return s;
         }
 
         [HttpGet]
         [Route("import_process")]
-        public string Import_process(int file_id)
+        public string Import_process(int file_id, string create_by, string create_org)
         {
-            String s = _SqeExcelService.Import_Process_From_Data(file_id, "测试用户", DateTime.Now, "测试组织");
+            String s = _SqeExcelService.Import_Process_From_Data(file_id, create_by, DateTime.Now, create_org);
             return s;
         }
 
         [HttpGet]
         [Route("import_oqc")]
-        public string Import_oqc(int file_id)
+        public string Import_oqc(int file_id, string create_by, string create_org)
         {
-            String s = _SqeExcelService.Import_Oqc_From_Data(file_id, "测试用户", DateTime.Now, "测试组织");
+            String s = _SqeExcelService.Import_Oqc_From_Data(file_id, create_by, DateTime.Now, create_org);
             return s;
         }
 
         [HttpGet]
         [Route("import_op")]
-        public string Import_op(int file_id)
+        public string Import_op(int file_id, string create_by, string create_org)
         {
-            String s = _SqeExcelService.Import_Op_From_Data(file_id, "测试用户", DateTime.Now, "测试组织");
+            String s = _SqeExcelService.Import_Op_From_Data(file_id, create_by, DateTime.Now, create_org);
             return s;
         }
 
         [HttpGet]
         [Route("import_fpy")]
-        public string Import_fpy(int file_id)
+        public string Import_fpy(int file_id, string create_by, string create_org)
         {
-            String s = _SqeExcelService.Import_Fpy_From_Data(file_id, "测试用户", DateTime.Now, "测试组织");
+            String s = _SqeExcelService.Import_Fpy_From_Data(file_id, create_by, DateTime.Now, create_org);
             return s;
         }
 
@@ -134,9 +134,9 @@ namespace Business.Controllers
 
         [HttpGet]
         [Route("compute_test_id")]
-        public string Compute_test_id(int file_id)
+        public string Compute_test_id(int file_id, string create_by, string create_org)
         {
-            String s = _SqeExcelService.Compute_Test(file_id, "测试用户", DateTime.Now, "测试组织");
+            String s = _SqeExcelService.Compute_Test(file_id, create_by, DateTime.Now, create_org);
             return s;
         }
 
@@ -148,6 +148,19 @@ namespace Business.Controllers
             return s;
         }
 
+        [HttpGet]
+        [Route("compute_test_query_chart")]
+        public string compute_test_query_chart(string startDate, string endDate, string item_no, string item_batch, string org, string standard_no, int sample_count)
+        {
+            String s = _SqeExcelService.Compute_TestChartData(startDate, endDate, item_no, item_batch, org, standard_no, sample_count);
+            return s;
+        }
+
+
+
+
+        //工序方法
+
         /// <summary>
         /// 依据查询条件,统计工序的不良情况
         /// </summary>
@@ -156,15 +169,55 @@ namespace Business.Controllers
         /// <param name="item_no"></param>
         /// <param name="item_batch"></param>
         /// <param name="org"></param>
+        /// <param name="op"></param>
+        /// <param name="bad_type"></param>
         /// <returns></returns>
         [HttpGet]
         [Route("compute_op_query")]
-        public string Compute_op_query(string startDate, string endDate, string item_no, string item_batch, string org)
+        public string Compute_op_query(string startDate, string endDate, string item_no, string item_batch, string org, string op, string bad_type)
+        {
+            String s = _SqeExcelService.Compute_op_query(startDate, endDate, item_no, item_batch, org, op, bad_type);
+            return s;
+        }
+
+        [HttpGet]
+        [Route("compute_op_query_chart")]
+        public string compute_op_query_chart(string startDate, string endDate, string item_no, string item_batch, string org, string op, string bad_type)
+        {
+            String s = _SqeExcelService.Compute_OpChartData(startDate, endDate, item_no, item_batch, org, op, bad_type);
+            return s;
+        }
+
+        [HttpGet]
+        [Route("compute_op_query_chart_date")]
+        public string compute_op_query_chart_date(string startDate, string endDate, string item_no, string item_batch, string org, string op)
+        {
+            String s = _SqeExcelService.Compute_OpChartData_Date(startDate, endDate, item_no, item_batch, org, op);
+            return s;
+        }
+
+        [HttpGet]
+        [Route("compute_fpy_query_chart")]
+        public string compute_fpy_query_chart(string startDate, string endDate, string item_no, string org, string op)
         {
-            String s = _SqeExcelService.Compute_op_query(startDate, endDate, item_no, item_batch, org);
+            String s = _SqeExcelService.Compute_FpyChartData(startDate, endDate, item_no, org, op);
             return s;
         }
 
+        [HttpGet]
+        [Route("compute_fpy_query_chart_date")]
+        public string compute_fpy_query_chart_date(string startDate, string endDate, string item_no, string org, string op)
+        {
+            String s = _SqeExcelService.Compute_FpyChartData_Date(startDate, endDate, item_no, org, op);
+            return s;
+        }
 
+        [HttpGet]
+        [Route("compute_oqc_query_chart_date")]
+        public string compute_oqc_query_chart_date(string startDate, string endDate, string item_no, string org)
+        {
+            String s = _SqeExcelService.Compute_OqcChartData(startDate, endDate, item_no, org);
+            return s;
+        }
     }
 }