Pengxy 11 月之前
父节点
当前提交
ca7ee56fe9

+ 37 - 0
MicroServices/Business/Business.Application.Contracts/Sqe/ISqeExcelService.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using Business;
+using Business.Dto;
+using Business.ResourceExamineManagement;
+using Volo.Abp.Application.Services;
+
+namespace Business.VSM
+{
+    /// <summary>
+    /// Sqe数据导入接口
+    /// </summary>
+    public interface ISqeExcelService : IApplicationService
+    {
+        /// <summary>
+        /// 导入检测的excel文件到DataTable
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <param name="sheetName"></param>
+        /// <returns></returns>
+        public DataTable ImportExcelSheetToDataTable_test(string filePath, string sheetName);
+
+        /// <summary>
+        /// 导入过程的excel文件到DataTable
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <param name="sheetName"></param>
+        /// <returns></returns>
+        public DataTable ImportExcelSheetToDataTable_process(string filePath, string sheetName);
+
+    }
+}

+ 1 - 1
MicroServices/Business/Business.Application/Business.Application.csproj

@@ -17,8 +17,8 @@
 
   <ItemGroup>
     <PackageReference Include="Magicodes.IE.Pdf" Version="2.7.1" />
-    <PackageReference Include="MathNet.Numerics" Version="5.0.0" />
     <PackageReference Include="NLog" Version="5.1.2" />
+    <PackageReference Include="NPOI" Version="2.7.3" />
     <PackageReference Include="Quartz.AspNetCore" Version="3.6.2" />
     <PackageReference Include="Volo.Abp.AutoMapper" Version="6.0.3" />
     <PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="6.0.3" />

+ 18 - 3
MicroServices/Business/Business.Application/ResourceExamineManagement/PurchaseOrderAppService.cs

@@ -208,6 +208,15 @@ namespace Business.ResourceExamineManagement
             List<string> purords = new List<string>();
             var ic_Plan = ic_PlanList.Where(x => x.mysql_id == icitem_id).FirstOrDefault();
             //查询出对应物料采购订单明细  --数据未被停用 && 评审通过后
+            List<mo_srm_po_list> poDetailList = new List<mo_srm_po_list>();
+            if (supplier_id != null)
+            {
+                poDetailList = mo_Srm_Po_Lists.Where(x => x.icitem_id == icitem_id && x.pr_purchase_id == supplier_id && x.rarrdate.GetValueOrDefault() < DeliverDate).ToList();
+            }
+            else
+            {
+                poDetailList = mo_Srm_Po_Lists.Where(x => x.icitem_id == icitem_id && x.rarrdate.GetValueOrDefault() < DeliverDate).ToList();
+            }
             var shd = scm_Shdzbs.Where(x => x.sh_material_code == ic_Plan.number && x.yjdhrq >= DeliverDate && x.yjdhrq <= DeliverDate.AddDays(5)).ToList();
             if (supplier_id != null)
             {
@@ -263,13 +272,19 @@ namespace Business.ResourceExamineManagement
                     {
                         decimal prOccupy = srm_Po_Occupies.Where(x => x.polist_id == jq.polist_id).Sum(c => c.qty.GetValueOrDefault());
                         //剩余可用数量
-                        var prQty = jq.jhdsl - prOccupy;
+                        var poDetail = poDetailList.Where(p => p.mysql_id == jq.polist_id).ToList();
+                        var PlanQty = 0m;
+                        if (poDetail.Any())
+                        {
+                            PlanQty = poDetail[0].qty.GetValueOrDefault() - poDetail[0].rqty.GetValueOrDefault() - poDetail[0].esqty.GetValueOrDefault();
+                        }
+                        var prQty = PlanQty - prOccupy; //jq.jhdsl - prOccupy;
                         if (prQty > 0)
                         {
                             //可占用数量-需求数量小于0时 占用全部可占用数量
                             if (prQty - Quantity <= 0)
                             {
-                                QuantityNumber = prQty.GetValueOrDefault();
+                                QuantityNumber = prQty;
                             }
                             else
                             {
@@ -283,7 +298,7 @@ namespace Business.ResourceExamineManagement
                             {
                                 break;
                             }
-                            Quantity = Quantity - prQty.GetValueOrDefault();
+                            Quantity = Quantity - prQty;
                         }
                     }
                 }

+ 473 - 0
MicroServices/Business/Business.Application/Sqe/SqeExcelService.cs

@@ -0,0 +1,473 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using Business;
+using Business.Core.Utilities;
+using Business.Dto;
+using Business.ResourceExamineManagement;
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using Volo.Abp.Application.Services;
+using Volo.Abp.MultiTenancy;
+
+namespace Business.VSM
+{
+    /// <summary>
+    /// Sqe数据导入接口实现
+    /// </summary>
+    public class SqeExcelService : ApplicationService, ISqeExcelService
+    {
+        private readonly ICurrentTenant _currentTenant;
+        //LoggerHelper WLLog;
+        public SqeExcelService()
+        {
+           // WLLog = new LoggerHelper();
+        }
+
+        /// <summary>
+        /// 导入Excel文件的sheetName的sheet页面到数据表
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <param name="sheetName"></param>
+        /// <returns></returns>
+        public DataTable ImportExcelSheetToDataTable_test(string filePath, string sheetName)
+        {
+            FileStream file = null;
+            DataTable dt = new DataTable();
+            int index = 0;
+            try
+            {
+                file = new FileStream(filePath, FileMode.Open, FileAccess.Read);
+
+                //打开Excel对象
+                IWorkbook workbook;
+                IRow row;
+                string fileExt = Path.GetExtension(filePath).ToLower();
+                workbook = null;
+                if (fileExt == ".xlsx")
+                {
+                    workbook = new XSSFWorkbook(file);
+                }
+                else
+                {
+                    if (fileExt == ".xls")
+                    {
+                        workbook = new HSSFWorkbook(file);
+                    }
+                    else
+                    {
+                        workbook = null;
+                    }
+                }
+                if (workbook == null) { return null; }
+
+                //Excel的Sheet对象
+                NPOI.SS.UserModel.ISheet sheet = workbook.GetSheet(sheetName);
+
+                //获取Sheet的所有的行
+                System.Collections.IEnumerator rows = sheet.GetRowEnumerator();
+
+                //int colCountMax = 0;
+
+                dt.TableName = sheetName;
+
+                //判断是否拥有首行
+                bool firstLine = true;
+                //if (!haveColumnName)
+                //{
+                //    firstLine = false;
+                //}
+
+                bool bDate = false;
+                while (rows.MoveNext())
+                {
+                    index++;
+
+                    bDate = false;
+                    if (fileExt == ".xlsx")
+                    {
+                        row = (XSSFRow)rows.Current;
+                    }
+                    else
+                    {
+                        row = (HSSFRow)rows.Current;
+                    }
+                    if (!firstLine)
+                    {
+                        //生成表结构
+                        //仅当首次调用时会进行循环生成
+                        for (int i = dt.Columns.Count; i < row.Cells.Count; i++)
+                        {
+                            dt.Columns.Add(Convert.ToChar(((int)'A') + i).ToString());
+                        }
+                    }
+                    else
+                    {
+                        //依据首行进行字段生成
+                        for (int i = dt.Columns.Count; i < row.Cells.Count; i++)
+                        {
+                            dt.Columns.Add(row.Cells[i].ToString());
+                        }
+
+                    }
+
+                    //没有首行,生成数据
+                    if (!firstLine)
+                    {
+                        DataRow dr = dt.NewRow();
+
+                        for (int i = 0; i < row.LastCellNum - 1; i++)
+                        {
+                            NPOI.SS.UserModel.ICell cell = row.GetCell(i);
+                            String s = "";
+                            if (cell != null)
+                            {
+                                switch (cell.CellType)
+                                {
+                                    case NPOI.SS.UserModel.CellType.Unknown:
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Numeric:
+                                        if (HSSFDateUtil.IsCellDateFormatted(cell))
+                                        {
+                                            if (index < 6)
+                                            {
+                                                s = cell.DateCellValue.ToString();
+                                            }
+                                            else
+                                            {
+                                                s = cell.ToString();
+                                            }
+                                        }
+                                        else
+                                        {
+                                            s = cell.NumericCellValue.ToString();
+                                        }
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.String:
+                                        s = cell.StringCellValue;
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Formula:
+                                        if (i == 0 || i == 1)
+                                        {
+                                            s = cell.StringCellValue;
+                                        }
+                                        else
+                                        {
+                                            try
+                                            {
+                                                if (cell.CellFormula == "序号")
+                                                {
+                                                    s = cell.ToString();
+                                                }
+                                                else
+                                                {
+                                                    s = cell.NumericCellValue != null ? cell.NumericCellValue.ToString() : null;
+                                                }
+                                            }
+                                            catch (Exception ex)
+                                            {
+                                                //WLLog.Error("Excel导入问题:", ex);
+                                                new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题" + ex.Message, _currentTenant.Id.ToString());
+                                            }
+                                        }
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Blank:
+                                        if (bDate)
+                                        {
+                                            //对于日期的特殊处理
+                                            s = dr[i - 1].ToString();
+                                        }
+                                        else
+                                        {
+                                            s = cell.StringCellValue;
+                                        }
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Boolean:
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Error:
+                                        break;
+
+                                    default:
+                                        break;
+                                }
+                            }
+                            dr[i] = s;
+                        }
+                        dt.Rows.Add(dr);
+                    }
+                    firstLine = false;
+
+                }
+                return dt;
+            }
+            catch (Exception ex)
+            {
+                //WLLog.Error("Excel导入问题:", ex);
+                new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题" + ex.Message, _currentTenant.Id.ToString());
+            }
+            finally
+            {
+                if (file != null)
+                {
+                    file.Close();
+                }
+            }
+            return dt;
+        }
+
+        public DataTable ImportExcelSheetToDataTable_process(string filePath, string sheetName)
+        {
+            FileStream file = null;
+            DataTable dt = new DataTable();
+            int index = 0;
+            try
+            {
+                file = new FileStream(filePath, FileMode.Open, FileAccess.Read);
+
+                //打开Excel对象
+                IWorkbook workbook;
+                IRow row;
+                string fileExt = Path.GetExtension(filePath).ToLower();
+                workbook = null;
+                if (fileExt == ".xlsx")
+                {
+                    workbook = new XSSFWorkbook(file);
+                }
+                else
+                {
+                    if (fileExt == ".xls")
+                    {
+                        workbook = new HSSFWorkbook(file);
+                    }
+                    else
+                    {
+                        workbook = null;
+                    }
+                }
+                if (workbook == null) { return null; }
+
+                //Excel的Sheet对象
+                NPOI.SS.UserModel.ISheet sheet = workbook.GetSheet(sheetName);
+
+                //获取Sheet的所有的行
+                System.Collections.IEnumerator rows = sheet.GetRowEnumerator();
+
+                //int colCountMax = 0;
+
+                dt.TableName = sheetName;
+
+                //判断是否拥有首行
+                bool firstLine = true;
+                //if (!haveColumnName)
+                //{
+                //    firstLine = false;
+                //}
+
+                bool bDate = false;
+                while (rows.MoveNext())
+                {
+                    index++;
+
+                    bDate = false;
+                    if (fileExt == ".xlsx")
+                    {
+                        row = (XSSFRow)rows.Current;
+                    }
+                    else
+                    {
+                        row = (HSSFRow)rows.Current;
+                    }
+                    if (!firstLine)
+                    {
+                        //生成表结构
+                        //仅当首次调用时会进行循环生成
+                        for (int i = dt.Columns.Count; i < row.Cells.Count; i++)
+                        {
+                            dt.Columns.Add(Convert.ToChar(((int)'A') + i).ToString());
+                        }
+                    }
+                    else
+                    {
+                        //依据首行进行字段生成
+                        for (int i = dt.Columns.Count; i < row.Cells.Count; i++)
+                        {
+                            dt.Columns.Add(row.Cells[i].ToString());
+                        }
+
+                    }
+
+                    //没有首行,生成数据
+                    if (!firstLine)
+                    {
+                        DataRow dr = dt.NewRow();
+
+                        for (int i = 0; i < row.LastCellNum - 1; i++)
+                        {
+                            NPOI.SS.UserModel.ICell cell = row.GetCell(i);
+                            String s = "";
+                            if (cell != null)
+                            {
+                                switch (cell.CellType)
+                                {
+                                    case NPOI.SS.UserModel.CellType.Unknown:
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Numeric:
+                                        if (HSSFDateUtil.IsCellDateFormatted(cell))
+                                        {
+                                            if (index < 6)
+                                            {
+                                                s = cell.DateCellValue.ToString();
+                                            }
+                                            else
+                                            {
+                                                s = cell.ToString();
+                                            }
+                                        }
+                                        else
+                                        {
+                                            s = cell.NumericCellValue.ToString();
+                                        }
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.String:
+                                        s = cell.StringCellValue;
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Formula:
+                                        try
+                                        {
+                                            if (cell.CellFormula == "序号")
+                                            {
+                                                s = cell.ToString();
+                                            }
+                                            else
+                                            {
+                                                s = cell.NumericCellValue != null ? cell.NumericCellValue.ToString() : null;
+                                            }
+                                        }
+                                        catch (Exception ex)
+                                        {
+                                            //WLLog.Error("Excel导入问题:", ex);
+                                            new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题" + ex.Message, _currentTenant.Id.ToString());
+                                        }
+
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Blank:
+                                        if (bDate)
+                                        {
+                                            //对于日期的特殊处理
+                                            s = dr[i - 1].ToString();
+                                        }
+                                        else
+                                        {
+                                            s = cell.StringCellValue;
+                                        }
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Boolean:
+                                        break;
+
+                                    case NPOI.SS.UserModel.CellType.Error:
+                                        break;
+
+                                    default:
+                                        break;
+                                }
+                            }
+                            dr[i] = s;
+                        }
+                        dt.Rows.Add(dr);
+                    }
+                    firstLine = false;
+
+                }
+                return dt;
+            }
+            catch (Exception ex)
+            {
+                //WLLog.Error("Excel导入问题:", ex);
+                new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题" + ex.Message, _currentTenant.Id.ToString());
+            }
+            finally
+            {
+                if (file != null)
+                {
+                    file.Close();
+                }
+            }
+            return dt;
+        }
+
+
+
+        /// <summary>
+        /// 获取Excel文件Sheet名称列表,与Jet引擎不一致,获取的时候没有$多余字符。
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <returns></returns>
+        public List<String> GetSheetNames(string filePath)
+        {
+            List<String> tables = null;
+            FileStream file = null;
+            try
+            {
+                tables = new List<string>();
+
+                file = new FileStream(filePath, FileMode.Open, FileAccess.Read);
+
+                HSSFWorkbook hssfworkbook = new HSSFWorkbook(file);
+
+                int i = 0;
+                while (true)
+                {
+                    try
+                    {
+                        String s = hssfworkbook.GetSheetName(i);
+                        if (s != null)
+                        {
+                            tables.Add(s);
+                            i++;
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        break;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                //WLLog.Error("Excel导入问题:", ex);
+                new NLogHelper("SqeExcelService").WriteLog("ImportExcelSheetToDataTable", "Excel导入问题"+ex.Message, _currentTenant.Id.ToString());
+            }
+            finally
+            {
+                if (file != null)
+                {
+                    file.Close();
+                }
+            }
+
+            return tables;
+        }
+
+    }
+}

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

@@ -0,0 +1,127 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 产品过程特性
+    /// </summary>
+    [Comment("产品过程特性")]
+    public class sqe_cto_process
+    {
+
+        /// <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>
+        public decimal material_used { get; set; }
+
+        /// <summary>
+        /// 物料批次号
+        /// </summary>
+        public string item_batch { get; set; }
+
+        /// <summary>
+        /// 物料数量
+        /// </summary>
+        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>
+        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; }
+
+    }
+}

+ 72 - 0
MicroServices/Business/Business.Domain/StructuredDB/Sqe/sqe_cto_process_data.cs

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 产品过程特性检测数据
+    /// </summary>
+    [Comment("产品过程特性检测数据")]
+    public class sqe_cto_process_data
+    {
+
+        /// <summary>
+        /// 流水号
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 检验主键
+        /// </summary>
+        public Int64 process_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>
+        public decimal ? data_value { get; set; }
+
+        /// <summary>
+        /// 检验结果状态
+        /// </summary>
+        public string data_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; }
+
+    }
+}

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

@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 产品过程特性检测标准
+    /// </summary>
+    [Comment("产品过程特性检测标准")]
+    public class sqe_cto_process_standard
+    {
+
+        /// <summary>
+        /// 流水号
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 检验主键
+        /// </summary>
+        public Int64 process_id { get; set; }
+
+        /// <summary>
+        /// 检验标准编号
+        /// </summary>
+        public string standard_no { get; set; }
+
+        /// <summary>
+        /// 标准值
+        /// </summary>
+        public decimal standard_value { get; set; }
+
+        /// <summary>
+        /// 上公差
+        /// </summary>
+        public decimal delta_up { get; set; }
+
+        /// <summary>
+        /// 下公差
+        /// </summary>
+        public decimal delta_down { get; set; }
+
+        /// <summary>
+        /// 上限
+        /// </summary>
+        public decimal standard_max { get; set; }
+
+        /// <summary>
+        /// 下限
+        /// </summary>
+        public decimal standard_min { 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; }
+
+    }
+}

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

@@ -0,0 +1,122 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 产品过程检验记录
+    /// </summary>
+    [Comment("产品过程检验记录")]
+    public class sqe_cto_test
+    {
+
+        /// <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>
+        public decimal material_used { get; set; }
+
+        /// <summary>
+        /// 物料批次号
+        /// </summary>
+        public string item_batch { get; set; }
+
+        /// <summary>
+        /// 物料数量
+        /// </summary>
+        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 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; }
+
+    }
+}

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

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 产品过程检验记录数据
+    /// </summary>
+    [Comment("产品过程检验记录数据")]
+    public class sqe_cto_test_data
+    {
+
+        /// <summary>
+        /// 流水号
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 检验主键
+        /// </summary>
+        public Int64 test_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>
+        public decimal ? data_value { get; set; }
+
+        /// <summary>
+        /// 检验结果状态
+        /// </summary>
+        public string data_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; }
+
+    }
+}

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

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 产品过程检验记录检测标准
+    /// </summary>
+    [Comment("产品过程检验记录检测标准")]
+    public class sqe_cto_test_standard
+    {
+
+        /// <summary>
+        /// 流水号
+        /// </summary>
+        public Int64 id { get; set; }
+
+        /// <summary>
+        /// 检验主键
+        /// </summary>
+        public Int64 test_id { get; set; }
+
+        /// <summary>
+        /// 检验标准编号
+        /// </summary>
+        public string standard_no { get; set; }
+
+        /// <summary>
+        /// 抽样频次
+        /// </summary>
+        public int sampling_count { get; set; }
+
+        /// <summary>
+        /// 是否为CTQ关联尺寸
+        /// </summary>
+        public string is_associated_size { get; set; }
+
+        /// <summary>
+        /// 标准值
+        /// </summary>
+        public decimal standard_value { get; set; }
+
+        /// <summary>
+        /// 上公差
+        /// </summary>
+        public decimal delta_up { get; set; }
+
+        /// <summary>
+        /// 下公差
+        /// </summary>
+        public decimal delta_down { get; set; }
+
+        /// <summary>
+        /// 上限
+        /// </summary>
+        public decimal standard_max { get; set; }
+
+        /// <summary>
+        /// 下限
+        /// </summary>
+        public decimal standard_min { 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; }
+
+    }
+}

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

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+
+namespace Business.StructuredDB.Sqe
+{
+    /// <summary>
+    /// 上传文件
+    /// </summary>
+    [Comment("上传文件")]
+    public class sqe_file_upload
+    {
+
+        /// <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 upload_type { get; set; }
+
+        /// <summary>
+        /// 上传文件路径
+        /// </summary>
+        public string file_path { get; set; }
+
+        /// <summary>
+        /// 上传文件名称
+        /// </summary>
+        public string file_name { get; set; }
+
+        /// <summary>
+        /// 文件被使用id
+        /// </summary>
+        public string used_id { 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; }
+
+    }
+}

+ 38 - 0
MicroServices/Business/Business.HttpApi/Controllers/SqeController.cs

@@ -0,0 +1,38 @@
+using Business.Dto;
+using Business.VSM;
+using Microsoft.AspNetCore.Mvc;
+using NLog.Fluent;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace Business.Controllers
+{
+    /// <summary>
+    /// 价值流接口
+    /// </summary>
+    [RemoteService]
+    [Area("Sqe")]
+    [Route("api/business/sqe")]
+    public class SqeController : AbpController
+    {
+        private readonly ISqeExcelService _SqeExcelService;
+
+        public SqeController(ISqeExcelService SqeExcelService)
+        {
+            _SqeExcelService = SqeExcelService;
+        }
+
+
+        [HttpGet]
+        [Route("import_test")]
+        public string ImportTest(string filePath, string sheetName)
+        {
+            DataTable dt = _SqeExcelService.ImportExcelSheetToDataTable_test(filePath, sheetName);
+            return "测试系统";
+        }
+    }
+}