callm 2 дней назад
Родитель
Сommit
6d7944d68f

+ 48 - 48
UAS_MES_ZKLH/FunctionCode/Query/Query_SOP.Designer.cs

@@ -41,6 +41,11 @@ namespace UAS_MES_NEW.Query
             this.SendSop = new System.Windows.Forms.Button();
             this.JPG = new System.Windows.Forms.RadioButton();
             this.SendDGV = new System.Windows.Forms.DataGridView();
+            this.CheckColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.fp_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.fp_path = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.psd_iskey = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.issend = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ChooseALL = new System.Windows.Forms.Button();
             this.GetSOP = new System.Windows.Forms.Button();
             this.ChoosePrint = new System.Windows.Forms.Button();
@@ -65,11 +70,6 @@ namespace UAS_MES_NEW.Query
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ps_prodcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
-            this.CheckColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.fp_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.fp_path = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.psd_iskey = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.issend = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.label10 = new System.Windows.Forms.Label();
             this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             ((System.ComponentModel.ISupportInitialize)(this.SendDGV)).BeginInit();
@@ -191,6 +191,47 @@ namespace UAS_MES_NEW.Query
             this.SendDGV.TabIndex = 22;
             this.SendDGV.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.SendDGV_CellPainting);
             // 
+            // CheckColumn
+            // 
+            this.CheckColumn.DataPropertyName = "CheckColumn";
+            this.CheckColumn.HeaderText = "勾选";
+            this.CheckColumn.MinimumWidth = 100;
+            this.CheckColumn.Name = "CheckColumn";
+            this.CheckColumn.Width = 200;
+            // 
+            // fp_name
+            // 
+            this.fp_name.DataPropertyName = "fp_name";
+            this.fp_name.HeaderText = "文件名";
+            this.fp_name.MinimumWidth = 10;
+            this.fp_name.Name = "fp_name";
+            this.fp_name.Width = 200;
+            // 
+            // fp_path
+            // 
+            this.fp_path.DataPropertyName = "fp_path";
+            this.fp_path.HeaderText = "路径";
+            this.fp_path.MinimumWidth = 10;
+            this.fp_path.Name = "fp_path";
+            this.fp_path.Width = 200;
+            // 
+            // psd_iskey
+            // 
+            this.psd_iskey.DataPropertyName = "psd_iskey";
+            this.psd_iskey.HeaderText = "是否关键工序";
+            this.psd_iskey.MinimumWidth = 10;
+            this.psd_iskey.Name = "psd_iskey";
+            this.psd_iskey.Width = 200;
+            // 
+            // issend
+            // 
+            this.issend.DataPropertyName = "issend";
+            this.issend.HeaderText = "是否成功发送";
+            this.issend.MinimumWidth = 10;
+            this.issend.Name = "issend";
+            this.issend.Visible = false;
+            this.issend.Width = 200;
+            // 
             // ChooseALL
             // 
             this.ChooseALL.Location = new System.Drawing.Point(865, 61);
@@ -293,7 +334,7 @@ namespace UAS_MES_NEW.Query
             this.Y.Size = new System.Drawing.Size(120, 35);
             this.Y.TabIndex = 34;
             this.Y.Value = new decimal(new int[] {
-            25,
+            15,
             0,
             0,
             0});
@@ -351,7 +392,7 @@ namespace UAS_MES_NEW.Query
             this.RowCount.Size = new System.Drawing.Size(120, 35);
             this.RowCount.TabIndex = 40;
             this.RowCount.Value = new decimal(new int[] {
-            40,
+            36,
             0,
             0,
             0});
@@ -436,47 +477,6 @@ namespace UAS_MES_NEW.Query
             this.ps_prodcode.TextBoxEnable = false;
             this.ps_prodcode.UserControlTextChanged += new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.ps_prodcode_UserControlTextChanged);
             // 
-            // CheckColumn
-            // 
-            this.CheckColumn.DataPropertyName = "CheckColumn";
-            this.CheckColumn.HeaderText = "勾选";
-            this.CheckColumn.MinimumWidth = 100;
-            this.CheckColumn.Name = "CheckColumn";
-            this.CheckColumn.Width = 200;
-            // 
-            // fp_name
-            // 
-            this.fp_name.DataPropertyName = "fp_name";
-            this.fp_name.HeaderText = "文件名";
-            this.fp_name.MinimumWidth = 10;
-            this.fp_name.Name = "fp_name";
-            this.fp_name.Width = 200;
-            // 
-            // fp_path
-            // 
-            this.fp_path.DataPropertyName = "fp_path";
-            this.fp_path.HeaderText = "路径";
-            this.fp_path.MinimumWidth = 10;
-            this.fp_path.Name = "fp_path";
-            this.fp_path.Width = 200;
-            // 
-            // psd_iskey
-            // 
-            this.psd_iskey.DataPropertyName = "psd_iskey";
-            this.psd_iskey.HeaderText = "是否关键工序";
-            this.psd_iskey.MinimumWidth = 10;
-            this.psd_iskey.Name = "psd_iskey";
-            this.psd_iskey.Width = 200;
-            // 
-            // issend
-            // 
-            this.issend.DataPropertyName = "issend";
-            this.issend.HeaderText = "是否成功发送";
-            this.issend.MinimumWidth = 10;
-            this.issend.Name = "issend";
-            this.issend.Visible = false;
-            this.issend.Width = 200;
-            // 
             // label10
             // 
             this.label10.AutoSize = true;

+ 182 - 161
UAS_MES_ZKLH/FunctionCode/Query/Query_SOP.cs

@@ -53,7 +53,7 @@ namespace UAS_MES_NEW.Query
             pr_code.DBTitle = "物料查询";
             pr_code.Condition = "pr_code not like '%LX%'";
             pr_code.SetValueField = new string[] { "pr_code" };
-
+            DateCode.Value = DateCode.Value.AddMonths(2);
             dh = SystemInf.dh;
         }
 
@@ -118,190 +118,211 @@ namespace UAS_MES_NEW.Query
                     OperatResult.AppendText("正在解析Sheet" + workbook.Worksheets[i].Name + "\n");
                     if (JPG.Checked)
                     {
-                        try
+                        //try
+                        //{
+                        // ---------- 输出目录 ----------
+                        if (!Directory.Exists(Application.StartupPath + @"\" + ps_prodcode.Text))
                         {
-                            // ---------- 输出目录 ----------
-                            if (!Directory.Exists(Application.StartupPath + @"\" + ps_prodcode.Text))
-                            {
-                                Directory.CreateDirectory(Application.StartupPath + @"\" + ps_prodcode.Text);
-                            }
-                            string path = Application.StartupPath + @"\" + ps_prodcode.Text + @"\";
+                            Directory.CreateDirectory(Application.StartupPath + @"\" + ps_prodcode.Text);
+                        }
+                        string path = Application.StartupPath + @"\" + ps_prodcode.Text + @"\";
 
-                            Worksheet she = workbook.Worksheets[i];
+                        Worksheet she = workbook.Worksheets[i];
 
-                            // ---------- 基础参数 ----------
-                            int lastColIndex = she.Cells.MaxDataColumn + 3;
-                            string lastColLetter = CellsHelper.ColumnIndexToName(lastColIndex);
-                            const int headerRows = 3;                              // 表头行数(每页都保留)
-                            int dataRowsPerPage = int.Parse(RowCount.Value.ToString());
+                        // ---------- 基础参数 ----------
+                        int lastColIndex = she.Cells.MaxDataColumn + 3;
+                        string lastColLetter = CellsHelper.ColumnIndexToName(lastColIndex);
+                        const int headerRows = 3;                              // 表头行数(每页都保留)
+                        int dataRowsPerPage = int.Parse(RowCount.Value.ToString());
 
-                            // ★ 关键修复①:计算"内容最大行"时必须包含图片和形状的底部锚点行
-                            // 图片/形状不影响 Cells.MaxDataRow,只看单元格会把底部图片切掉
-                            int contentMaxRow = she.Cells.MaxDataRow;
-                            for (int p = 0; p < she.Pictures.Count; p++)
-                            {
-                                if (she.Pictures[p].LowerRightRow > contentMaxRow)
-                                    contentMaxRow = she.Pictures[p].LowerRightRow;
-                            }
-                            for (int s = 0; s < she.Shapes.Count; s++)
-                            {
-                                if (she.Shapes[s].LowerRightRow > contentMaxRow)
-                                    contentMaxRow = she.Shapes[s].LowerRightRow;
-                            }
-                            int totalRows = contentMaxRow + 1;
-                            int totalDataRows = Math.Max(totalRows - headerRows, 0);
-                            int totalPages = (int)Math.Ceiling(totalDataRows / (double)dataRowsPerPage);
-                            if (totalPages == 0) totalPages = 1;
+                        // ★ 关键修复①:计算"内容最大行"时必须包含图片和形状的底部锚点行
+                        // 图片/形状不影响 Cells.MaxDataRow,只看单元格会把底部图片切掉
+                        int contentMaxRow = she.Cells.MaxDataRow;
+                        for (int p = 0; p < she.Pictures.Count; p++)
+                        {
+                            if (she.Pictures[p].LowerRightRow > contentMaxRow)
+                                contentMaxRow = she.Pictures[p].LowerRightRow;
+                        }
+                        for (int s = 0; s < she.Shapes.Count; s++)
+                        {
+                            if (she.Shapes[s].LowerRightRow > contentMaxRow)
+                                contentMaxRow = she.Shapes[s].LowerRightRow;
+                        }
+                        int totalRows = contentMaxRow + 1;
+                        int totalDataRows = Math.Max(totalRows - headerRows, 0);
+                        int totalPages = (int)Math.Ceiling(totalDataRows / (double)dataRowsPerPage);
+                        if (totalPages == 0) totalPages = 1;
 
-                            // 水印在原表中的目标行/列
-                            int wmRowGlobal = int.Parse(Y.Value.ToString());
-                            int wmCol = int.Parse(X.Value.ToString());
+                        // 水印在原表中的目标行/列
+                        int wmRowGlobal = int.Parse(Y.Value.ToString());
+                        int wmCol = int.Parse(X.Value.ToString());
 
-                            int imageIndex = 1;
+                        int imageIndex = 1;
 
-                            for (int page = 0; page < totalPages; page++)
+                        for (int page = 0; page < totalPages; page++)
+                        {
+                            // ---------- 1. 复制原表到临时工作表 ----------
+                            int newSheetIndex = workbook.Worksheets.Add();
+                            Worksheet newshe = workbook.Worksheets[newSheetIndex];
+                            newshe.Copy(she);
+                            newshe.Name = $"Temp_{page}";
+
+                            // 本页在原表中的数据行区间(原表坐标,0-based)
+                            int dataStartRow = headerRows + page * dataRowsPerPage;
+                            int dataEndRow = Math.Min(headerRows + (page + 1) * dataRowsPerPage - 1, totalRows - 1);
+
+                            // ---------- 2. 按页过滤原表图片(Pictures) ----------
+                            for (int p = newshe.Pictures.Count - 1; p >= 0; p--)
                             {
-                                // ---------- 1. 复制原表到临时工作表 ----------
-                                int newSheetIndex = workbook.Worksheets.Add();
-                                Worksheet newshe = workbook.Worksheets[newSheetIndex];
-                                newshe.Copy(she);
-                                newshe.Name = $"Temp_{page}";
-
-                                // 本页在原表中的数据行区间(原表坐标,0-based)
-                                int dataStartRow = headerRows + page * dataRowsPerPage;
-                                int dataEndRow = Math.Min(headerRows + (page + 1) * dataRowsPerPage - 1, totalRows - 1);
-
-                                // ---------- 2. 按页过滤原表图片(Pictures) ----------
-                                for (int p = newshe.Pictures.Count - 1; p >= 0; p--)
+                                Aspose.Cells.Drawing.Picture pic = newshe.Pictures[p];
+                                int topRow = pic.UpperLeftRow;
+                                bool isHeaderPic = topRow < headerRows;
+                                bool belongsToPage = topRow >= dataStartRow && topRow <= dataEndRow;
+                                if (!isHeaderPic && !belongsToPage)
                                 {
-                                    Aspose.Cells.Drawing.Picture pic = newshe.Pictures[p];
-                                    int topRow = pic.UpperLeftRow;
-                                    bool isHeaderPic = topRow < headerRows;
-                                    bool belongsToPage = topRow >= dataStartRow && topRow <= dataEndRow;
-                                    if (!isHeaderPic && !belongsToPage)
-                                    {
-                                        newshe.Pictures.RemoveAt(p);
-                                    }
+                                    newshe.Pictures.RemoveAt(p);
                                 }
+                            }
 
-                                // ---------- 3. 按页过滤原表形状(Shapes:文本框/箭头/连接线等) ----------
-                                for (int s = newshe.Shapes.Count - 1; s >= 0; s--)
-                                {
-                                    Aspose.Cells.Drawing.Shape shape = newshe.Shapes[s];
-                                    int topRow = shape.UpperLeftRow;
-                                    bool isHeaderShape = topRow < headerRows;
-                                    bool belongsToPage = topRow >= dataStartRow && topRow <= dataEndRow;
-                                    if (!isHeaderShape && !belongsToPage)
-                                    {
-                                        newshe.Shapes.RemoveAt(s);
-                                    }
-                                }
+                            // ---------- 3. 按页过滤原表形状(Shapes:文本框/箭头/连接线等) ----------
 
-                                // ---------- 4. 清空非本页单元格内容 ----------
-                                for (int r = 0; r < totalRows; r++)
+                            for (int s = newshe.Shapes.Count - 1; s >= 0; s--)
+                            {
+                                Aspose.Cells.Drawing.Shape shape;
+                                try
                                 {
-                                    if (r < headerRows) continue;
-                                    if (r >= dataStartRow && r <= dataEndRow) continue;
-                                    newshe.Cells.ClearRange(r, 0, r, lastColIndex);
+                                    shape = newshe.Shapes[s];
                                 }
-
-                                // ---------- 5. 删除非本页整行 ----------
-                                for (int r = totalRows - 1; r >= 0; r--)
+                                catch
                                 {
-                                    if (r < headerRows) continue;
-                                    if (r >= dataStartRow && r <= dataEndRow) continue;
-                                    newshe.Cells.DeleteRow(r);
+                                    // 下标已经失效,直接跳过
+                                    continue;
                                 }
 
-                                // ---------- 6. 页面设置 ----------
-                                // ★ 关键修复②:PrintArea 必须覆盖临时表中图片/形状延伸到的最大行
-                                // 不能只用 Cells.MaxDataRow + 1,否则底部图片被截断
-                                int printMaxRow = newshe.Cells.MaxDataRow;
-                                for (int p = 0; p < newshe.Pictures.Count; p++)
-                                {
-                                    if (newshe.Pictures[p].LowerRightRow > printMaxRow)
-                                        printMaxRow = newshe.Pictures[p].LowerRightRow;
-                                }
-                                for (int s = 0; s < newshe.Shapes.Count; s++)
-                                {
-                                    if (newshe.Shapes[s].LowerRightRow > printMaxRow)
-                                        printMaxRow = newshe.Shapes[s].LowerRightRow;
-                                }
-                                int newTotalRows = printMaxRow + 1;
-                                if (i == 0)
-                                {
-                                    newshe.PageSetup.PrintArea = $"A1:{lastColLetter}{25}";
-                                }
-                                else {
-                                    newshe.PageSetup.PrintArea = $"A1:{lastColLetter}{newTotalRows}";
-                                }
-                                newshe.PageSetup.CenterHorizontally = true;
-                                newshe.PageSetup.CenterVertically = true;
-                                newshe.PageSetup.LeftMargin = 2;
-                                newshe.PageSetup.RightMargin = 2;
-                                newshe.PageSetup.TopMargin = 2;
-                                newshe.PageSetup.BottomMargin = 2;
-                                newshe.PageSetup.SetFooter(0, "");
-                                newshe.PageSetup.SetFooter(1, "");
-                                newshe.PageSetup.SetFooter(2, "");
-
-                                // ---------- 7. 插入水印(额外图片,坐标映射到压缩后本页) ----------
-                                if (File.Exists(PrintPath.Text))
-                                {
-                                    int rowOffset = headerRows + int.Parse(Y.Value.ToString());
-                                    newshe.Pictures.Add(rowOffset, int.Parse(X.Value.ToString()), PrintPath.Text);
-                                }
-                                // ---------- 8. 页脚 ----------
-                                string pageFooter = $"第 {imageIndex} 页 / 共 {totalPages} 页";
-                                newshe.PageSetup.SetFooter(1, pageFooter);
-
-                                // ---------- 9. 渲染为 PNG ----------
-                                ImageOrPrintOptions options = new ImageOrPrintOptions();
-                                options.ImageFormat = ImageFormat.Png;
-                                options.OnePagePerSheet = true;
-                                options.PrintingPage = PrintingPageType.Default;
-
-                                SheetRender sr = new SheetRender(newshe, options);
-                                if (sr.PageCount > 0)
+                                int topRow = shape.UpperLeftRow;
+                                bool isHeaderShape = topRow < headerRows;
+                                bool belongsToPage = topRow >= dataStartRow && topRow <= dataEndRow;
+
+                                if (!isHeaderShape && !belongsToPage)
                                 {
-                                    using (Bitmap bitmap = sr.ToImage(0))
+                                    try
+                                    {
+                                        newshe.Shapes.RemoveAt(s);
+                                    }
+                                    catch
                                     {
-                                        string imagename = $"{she.Name}_{imageIndex}.png";
-                                        string imagePath = Path.Combine(path, imagename);
-                                        bitmap.Save(imagePath, ImageFormat.Png);
-                                        OperatResult.AppendText("解析图片【" + imagePath + "】\n");
-
-                                        // ---------- 10. 上传 ----------
-                                        Dictionary<string, object> dic = new Dictionary<string, object>();
-                                        dic.Add("em_name", "管理员");
-                                        dic.Add("em_code", "ADMIN");
-                                        dic.Add("caller", "ProductSOP");
-                                        OperatResult.AppendText("上传文件【" + imagePath + "】\n");
-
-                                        string fp_id = UploadFilesToRemoteUrl(
-                                            "https://mes.lihantech.cn/mes/MEScommon/uploadFiles.action?_noc=1",
-                                            imagePath, dic);
-
-                                        // ---------- 11. 入库 ----------
-                                        string ps_id = dh.getFieldDataByCondition(
-                                            "ProductSOP", "ps_id", "ps_prodcode='" + ps_prodcode.Text + "'").ToString();
-
-                                        dh.ExecuteSql(
-                                            "insert into ProductSOPdetail(psd_id,psd_psid,psd_attach) " +
-                                            "select ProductSOPdetail_seq.nextval,ps_id,'" + imagename + ";" + fp_id +
-                                            "' from ProductSOP where ps_prodcode='" + ps_prodcode.Text + "'", "insert");
+                                        // GroupShape组合形状无法直接RemoveAt,就隐藏
+                                        shape.IsHidden = true;
                                     }
                                 }
+                            }
 
-                                // ---------- 12. 删除临时工作表 ----------
-                                workbook.Worksheets.RemoveAt(newSheetIndex);
-                                imageIndex++;
+                            // ---------- 4. 清空非本页单元格内容 ----------
+                            for (int r = 0; r < totalRows; r++)
+                            {
+                                if (r < headerRows) continue;
+                                if (r >= dataStartRow && r <= dataEndRow) continue;
+                                newshe.Cells.ClearRange(r, 0, r, lastColIndex);
                             }
+
+                            // ---------- 5. 删除非本页整行 ----------
+                            for (int r = totalRows - 1; r >= 0; r--)
+                            {
+                                if (r < headerRows) continue;
+                                if (r >= dataStartRow && r <= dataEndRow) continue;
+                                newshe.Cells.DeleteRow(r);
+                            }
+
+                            // ---------- 6. 页面设置 ----------
+                            // ★ 关键修复②:PrintArea 必须覆盖临时表中图片/形状延伸到的最大行
+                            // 不能只用 Cells.MaxDataRow + 1,否则底部图片被截断
+                            int printMaxRow = newshe.Cells.MaxDataRow;
+                            for (int p = 0; p < newshe.Pictures.Count; p++)
+                            {
+                                if (newshe.Pictures[p].LowerRightRow > printMaxRow)
+                                    printMaxRow = newshe.Pictures[p].LowerRightRow;
+                            }
+                            for (int s = 0; s < newshe.Shapes.Count; s++)
+                            {
+                                if (newshe.Shapes[s].LowerRightRow > printMaxRow)
+                                    printMaxRow = newshe.Shapes[s].LowerRightRow;
+                            }
+                            int newTotalRows = printMaxRow + 1;
+                            if (i == 0)
+                            {
+                                newshe.PageSetup.PrintArea = $"A1:{lastColLetter}{25}";
+                            }
+                            else
+                            {
+                                newshe.PageSetup.PrintArea = $"A1:{lastColLetter}{newTotalRows}";
+                            }
+                            newshe.PageSetup.CenterHorizontally = true;
+                            newshe.PageSetup.CenterVertically = true;
+                            newshe.PageSetup.LeftMargin = 2;
+                            newshe.PageSetup.RightMargin = 2;
+                            newshe.PageSetup.TopMargin = 2;
+                            newshe.PageSetup.BottomMargin = 2;
+                            newshe.PageSetup.SetFooter(0, "");
+                            newshe.PageSetup.SetFooter(1, "");
+                            newshe.PageSetup.SetFooter(2, "");
+
+                            // ---------- 7. 插入水印(额外图片,坐标映射到压缩后本页) ----------
+                            if (File.Exists(PrintPath.Text))
+                            {
+                                int rowOffset = headerRows + int.Parse(Y.Value.ToString());
+                                newshe.Pictures.Add(rowOffset, int.Parse(X.Value.ToString()), PrintPath.Text);
+                            }
+                            // ---------- 8. 页脚 ----------
+                            string pageFooter = $"第 {imageIndex} 页 / 共 {totalPages} 页";
+                            newshe.PageSetup.SetFooter(1, pageFooter);
+
+                            // ---------- 9. 渲染为 PNG ----------
+                            ImageOrPrintOptions options = new ImageOrPrintOptions();
+                            options.ImageFormat = ImageFormat.Png;
+                            options.OnePagePerSheet = true;
+                            options.PrintingPage = PrintingPageType.Default;
+
+                            SheetRender sr = new SheetRender(newshe, options);
+                            if (sr.PageCount > 0)
+                            {
+                                using (Bitmap bitmap = sr.ToImage(0))
+                                {
+                                    string imagename = $"{she.Name}_{imageIndex}.png";
+                                    string imagePath = Path.Combine(path, imagename);
+                                    bitmap.Save(imagePath, ImageFormat.Png);
+                                    OperatResult.AppendText("解析图片【" + imagePath + "】\n");
+
+                                    // ---------- 10. 上传 ----------
+                                    Dictionary<string, object> dic = new Dictionary<string, object>();
+                                    dic.Add("em_name", "管理员");
+                                    dic.Add("em_code", "ADMIN");
+                                    dic.Add("caller", "ProductSOP");
+                                    OperatResult.AppendText("上传文件【" + imagePath + "】\n");
+
+                                    string fp_id = UploadFilesToRemoteUrl(
+                                        "https://mes.lihantech.cn/mes/MEScommon/uploadFiles.action?_noc=1",
+                                        imagePath, dic);
+
+                                    // ---------- 11. 入库 ----------
+                                    string ps_id = dh.getFieldDataByCondition(
+                                        "ProductSOP", "ps_id", "ps_prodcode='" + ps_prodcode.Text + "'").ToString();
+
+                                    dh.ExecuteSql(
+                                        "insert into ProductSOPdetail(psd_id,psd_psid,psd_attach) " +
+                                        "select ProductSOPdetail_seq.nextval,ps_id,'" + imagename + ";" + fp_id +
+                                        "' from ProductSOP where ps_prodcode='" + ps_prodcode.Text + "'", "insert");
+                                }
+                            }
+
+                            // ---------- 12. 删除临时工作表 ----------
+                            workbook.Worksheets.RemoveAt(newSheetIndex);
+                            imageIndex++;
                         }
-                        catch (Exception ex)
-                        {
-                            OperatResult.AppendText(ex.Message + ex.StackTrace);
-                        }
+                        //}
+                        //catch (Exception ex)
+                        //{
+                        //    OperatResult.AppendText(ex.Message + ex.StackTrace);
+                        //}
                     }
 
                 }