callm 5 днів тому
батько
коміт
a103f19848

+ 57 - 44
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();
@@ -64,11 +69,7 @@ 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.PDF = new System.Windows.Forms.RadioButton();
             ((System.ComponentModel.ISupportInitialize)(this.SendDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.X)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Y)).BeginInit();
@@ -188,6 +189,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);
@@ -423,52 +465,22 @@ 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
+            // PDF
             // 
-            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;
+            this.PDF.AutoSize = true;
+            this.PDF.Location = new System.Drawing.Point(368, 534);
+            this.PDF.Name = "PDF";
+            this.PDF.Size = new System.Drawing.Size(77, 28);
+            this.PDF.TabIndex = 42;
+            this.PDF.Text = "PDF";
+            this.PDF.UseVisualStyleBackColor = true;
             // 
             // Query_SOP
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1945, 1234);
+            this.Controls.Add(this.PDF);
             this.Controls.Add(this.label9);
             this.Controls.Add(this.RowCount);
             this.Controls.Add(this.VaildDate);
@@ -552,5 +564,6 @@ namespace UAS_MES_NEW.Query
         private System.Windows.Forms.CheckBox VaildDate;
         private System.Windows.Forms.NumericUpDown RowCount;
         private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.RadioButton PDF;
     }
 }

+ 157 - 112
UAS_MES_ZKLH/FunctionCode/Query/Query_SOP.cs

@@ -63,145 +63,189 @@ namespace UAS_MES_NEW.Query
                 MessageBox.Show("文件不能为空!");
                 return;
             }
-            ps_prodcode.Text = FilePath.Text.Substring(FilePath.Text.LastIndexOf(@"\") + 1).Replace(".xls", "").Replace(".xlsx", "");
-            pr_code_Leave(new object(), new EventArgs());
-            DataTable dt = (DataTable)dh.ExecuteSql("select * from productsop where ps_prodcode='" + ps_prodcode.Text + "' ", "select");
-            if (dt.Rows.Count == 0)
+            if (JPG.Checked)
             {
-                string code = LogicHandler.GetPiInoutCode("ProductSOP", "1");
-                ps_code.Text = code;
-                if (VaildDate.Checked)
+                ps_prodcode.Text = FilePath.Text.Substring(FilePath.Text.LastIndexOf(@"\") + 1).Replace(".xls", "").Replace(".xlsx", "");
+                pr_code_Leave(new object(), new EventArgs());
+                DataTable dt = (DataTable)dh.ExecuteSql("select * from productsop where ps_prodcode='" + ps_prodcode.Text + "' ", "select");
+                if (dt.Rows.Count == 0)
                 {
-                    dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode,ps_vailddate)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING',to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'))", "insert");
+                    string code = LogicHandler.GetPiInoutCode("ProductSOP", "1");
+                    ps_code.Text = code;
+                    if (VaildDate.Checked)
+                    {
+                        dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode,ps_vailddate)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING',to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'))", "insert");
+                    }
+                    else
+                    {
+                        dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING')", "insert");
+                    }
                 }
                 else
                 {
-                    dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING')", "insert");
+                    string ps_id = dt.Rows[0]["ps_id"].ToString();
+                    dh.ExecuteSql("delete from ProductSOPdetail where psd_psid='" + ps_id + "'", "delete");
+                    ps_prodcode.Text = dt.Rows[0]["ps_prodcode"].ToString();
                 }
-            }
-            else
-            {
-                string ps_id = dt.Rows[0]["ps_id"].ToString();
-                dh.ExecuteSql("delete from ProductSOPdetail where psd_psid='" + ps_id + "'", "delete");
-                ps_prodcode.Text = dt.Rows[0]["ps_prodcode"].ToString();
-            }
-            Workbook workbook = new Workbook(FilePath.Text);
-            List<Worksheet> list = new List<Worksheet>();
-            List<string> filename = new List<string>();
+                Workbook workbook = new Workbook(FilePath.Text);
+                List<Worksheet> list = new List<Worksheet>();
+                List<string> filename = new List<string>();
 
-            if (VaildDate.Checked)
-            {
-                dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "',ps_vailddate=to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') where ps_prodcode='" + ps_prodcode.Text + "'", "update");
-            }
-            else
-            {
-                dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "' where ps_prodcode='" + ps_prodcode.Text + "'", "update");
-            }
+                if (VaildDate.Checked)
+                {
+                    dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "',ps_vailddate=to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') where ps_prodcode='" + ps_prodcode.Text + "'", "update");
+                }
+                else
+                {
+                    dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "' where ps_prodcode='" + ps_prodcode.Text + "'", "update");
+                }
 
-            OperatResult.AppendText("一共Sheet: " + workbook.Worksheets.Count + "\n");
-            for (int i = 0; i < workbook.Worksheets.Count; i++)
-            {
-                OperatResult.AppendText("正在解析Sheet" + workbook.Worksheets[i].Name + "\n");
-                string path = Application.StartupPath + @"\" + ps_prodcode.Text + @"\";
-                Worksheet she = workbook.Worksheets[i];
-                int lastColIndex = she.Cells.MaxDataColumn;
-                string lastColLetter = CellsHelper.ColumnIndexToName(lastColIndex);
-                she.PageSetup.LeftMargin = 0;
-                she.PageSetup.RightMargin = 0;
-                she.PageSetup.TopMargin = 0;
-                she.PageSetup.BottomMargin = 0;
-                if (JPG.Checked)
+                OperatResult.AppendText("一共Sheet: " + workbook.Worksheets.Count + "\n");
+                for (int i = 0; i < workbook.Worksheets.Count; i++)
                 {
-                    try
+                    OperatResult.AppendText("正在解析Sheet" + workbook.Worksheets[i].Name + "\n");
+                    string path = Application.StartupPath + @"\" + ps_prodcode.Text + @"\";
+                    Worksheet she = workbook.Worksheets[i];
+                    int lastColIndex = she.Cells.MaxDataColumn;
+                    string lastColLetter = CellsHelper.ColumnIndexToName(lastColIndex);
+                    she.PageSetup.LeftMargin = 0;
+                    she.PageSetup.RightMargin = 0;
+                    she.PageSetup.TopMargin = 0;
+                    she.PageSetup.BottomMargin = 0;
+                    if (JPG.Checked)
                     {
-                        if (!Directory.Exists(Application.StartupPath + @"\" + ps_prodcode.Text))
-                        {
-                            Directory.CreateDirectory(Application.StartupPath + @"\" + ps_prodcode.Text);
-                        }
-                        string sheetname = she.Name;
-                        // 获取工作表中的所有图片
-                        List<Picture> pictures = new List<Picture>();
-                        foreach (Aspose.Cells.Drawing.Picture picture in she.Pictures)
+                        try
                         {
-                            pictures.Add(picture);
-                        }
-                        // 获取使用的行数
-                        int totalRows = she.Cells.MaxDataRow + 1;
-                        int imageIndex = 1;
+                            if (!Directory.Exists(Application.StartupPath + @"\" + ps_prodcode.Text))
+                            {
+                                Directory.CreateDirectory(Application.StartupPath + @"\" + ps_prodcode.Text);
+                            }
+                            string sheetname = she.Name;
+                            // 获取工作表中的所有图片
+                            List<Picture> pictures = new List<Picture>();
+                            foreach (Aspose.Cells.Drawing.Picture picture in she.Pictures)
+                            {
+                                pictures.Add(picture);
+                            }
+                            // 获取使用的行数
+                            int totalRows = she.Cells.MaxDataRow + 1;
+                            int imageIndex = 1;
 
-                        // 每40行生成一张图片
-                        for (int startRow = 0; startRow < totalRows; startRow += int.Parse(RowCount.Value.ToString()))
-                        {
-                            int endRow = Math.Min(startRow + int.Parse(RowCount.Value.ToString()) - 1, totalRows - 1);
-                            // 创建图片选项
-                            ImageOrPrintOptions options = new ImageOrPrintOptions();
-                            options.ImageFormat = ImageFormat.Png;
-                            options.OnePagePerSheet = false;
-                            options.PrintingPage = PrintingPageType.IgnoreBlank;
-
-                            she.PageSetup.PrintArea = $"A{startRow + 1}:{lastColLetter}{endRow + 1}";
-                            if (File.Exists(PrintPath.Text))
+                            // 每40行生成一张图片
+                            for (int startRow = 0; startRow < totalRows; startRow += int.Parse(RowCount.Value.ToString()))
                             {
-                                if (startRow == 0)
+                                int endRow = Math.Min(startRow + int.Parse(RowCount.Value.ToString()) - 1, totalRows - 1);
+                                // 创建图片选项
+                                ImageOrPrintOptions options = new ImageOrPrintOptions();
+                                options.ImageFormat = ImageFormat.Png;
+                                options.OnePagePerSheet = false;
+                                options.PrintingPage = PrintingPageType.IgnoreBlank;
+
+                                she.PageSetup.PrintArea = $"A{startRow + 1}:{lastColLetter}{endRow + 1}";
+                                if (File.Exists(PrintPath.Text))
                                 {
-                                    she.Pictures.Add(startRow + int.Parse(Y.Value.ToString()), int.Parse(X.Value.ToString()), PrintPath.Text);
+                                    if (startRow == 0)
+                                    {
+                                        she.Pictures.Add(startRow + int.Parse(Y.Value.ToString()), int.Parse(X.Value.ToString()), PrintPath.Text);
 
+                                    }
+                                    else
+                                    {
+                                        she.Pictures.Add(startRow - 4 + int.Parse(Y.Value.ToString()), int.Parse(X.Value.ToString()), PrintPath.Text);
+
+                                    }
                                 }
-                                else
+                                // 创建SheetRender对象
+                                SheetRender sr = new SheetRender(she, options);
+
+                                string imagename = $"{she.Name}_{imageIndex}.png";
+                                // 获取渲染后的图像
+                                Bitmap bitmap = sr.ToImage(0);
+                                string imagePath = "";
+                                // 如果有图片在当前行范围内,将它们添加到最终图像中
+                                if (pictures.Count > 0)
                                 {
-                                    she.Pictures.Add(startRow - 4 + int.Parse(Y.Value.ToString()), int.Parse(X.Value.ToString()), PrintPath.Text);
-
+                                    using (Bitmap finalImage = new Bitmap(bitmap.Width, bitmap.Height))
+                                    using (Graphics g = Graphics.FromImage(finalImage))
+                                    {
+                                        // 绘制Excel内容
+                                        g.DrawImage(bitmap, 0, 0);
+
+                                        // 绘制原始Excel中的图片
+                                        int yOffset = bitmap.Height;
+                                        // 保存图像
+                                        imagePath = Path.Combine(path, $"{she.Name}_{imageIndex}.png");
+                                        finalImage.Save(imagePath, ImageFormat.Png);
+                                        Console.WriteLine($"Saved: {imagePath}");
+                                    }
                                 }
-                            }
-                            // 创建SheetRender对象
-                            SheetRender sr = new SheetRender(she, options);
-
-                            string imagename = $"{she.Name}_{imageIndex}.png";
-                            // 获取渲染后的图像
-                            Bitmap bitmap = sr.ToImage(0);
-                            string imagePath = "";
-                            // 如果有图片在当前行范围内,将它们添加到最终图像中
-                            if (pictures.Count > 0)
-                            {
-                                using (Bitmap finalImage = new Bitmap(bitmap.Width, bitmap.Height))
-                                using (Graphics g = Graphics.FromImage(finalImage))
+                                else
                                 {
-                                    // 绘制Excel内容
-                                    g.DrawImage(bitmap, 0, 0);
-
-                                    // 绘制原始Excel中的图片
-                                    int yOffset = bitmap.Height;
-                                    // 保存图像
+                                    // 如果没有图片,直接保存渲染的图像
                                     imagePath = Path.Combine(path, $"{she.Name}_{imageIndex}.png");
-                                    finalImage.Save(imagePath, ImageFormat.Png);
+                                    bitmap.Save(imagePath, ImageFormat.Png);
                                     Console.WriteLine($"Saved: {imagePath}");
                                 }
+                                imageIndex++;
+                                OperatResult.AppendText("解析图片【" + imagePath + ".jpg】" + "\n");
+                                Dictionary<string, object> dic = new Dictionary<string, object>();
+                                dic.Add("em_name", "管理员");
+                                dic.Add("em_code", "ADMIN");
+                                dic.Add("caller", "ProductSOP");
+                                OperatResult.AppendText("上传文件【" + imagePath + ".jpg" + "】\n");
+                                string fp_id = UploadFilesToRemoteUrl("https://mes.lihantech.cn/mes/MEScommon/uploadFiles.action?_noc=1", Application.StartupPath + @"\" + ps_prodcode.Text + @"\" + imagename, dic);
+                                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");
                             }
-                            else
-                            {
-                                // 如果没有图片,直接保存渲染的图像
-                                imagePath = Path.Combine(path, $"{she.Name}_{imageIndex}.png");
-                                bitmap.Save(imagePath, ImageFormat.Png);
-                                Console.WriteLine($"Saved: {imagePath}");
-                            }
-                            imageIndex++;
-                            OperatResult.AppendText("解析图片【" + imagePath + ".jpg】" + "\n");
-                            Dictionary<string, object> dic = new Dictionary<string, object>();
-                            dic.Add("em_name", "管理员");
-                            dic.Add("em_code", "ADMIN");
-                            dic.Add("caller", "ProductSOP");
-                            OperatResult.AppendText("上传文件【" + imagePath + ".jpg" + "】\n");
-                            string fp_id = UploadFilesToRemoteUrl("https://mes.lihantech.cn/mes/MEScommon/uploadFiles.action?_noc=1", Application.StartupPath + @"\" + ps_prodcode.Text + @"\" + imagename, dic);
-                            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");
                         }
+                        catch (Exception ex)
+                        {
+                            OperatResult.AppendText(ex.Message + ex.StackTrace);
+                        }
+                        filename.Add(she.Name + ".jpg");
                     }
-                    catch (Exception ex)
+                }
+            }
+            else if (PDF.Checked)
+            {
+                ps_prodcode.Text = FilePath.Text.Substring(FilePath.Text.LastIndexOf(@"\") + 1).Replace(".pdf","");
+                pr_code_Leave(new object(), new EventArgs());
+                DataTable dt = (DataTable)dh.ExecuteSql("select * from productsop where ps_prodcode='" + ps_prodcode.Text + "' ", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    string code = LogicHandler.GetPiInoutCode("ProductSOP", "1");
+                    ps_code.Text = code;
+                    if (VaildDate.Checked)
                     {
-                        OperatResult.AppendText(ex.Message + ex.StackTrace);
+                        dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode,ps_vailddate)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING',to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'))", "insert");
                     }
-                    filename.Add(she.Name + ".jpg");
+                    else
+                    {
+                        dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING')", "insert");
+                    }
+                }
+                else
+                {
+                    string psid = dt.Rows[0]["ps_id"].ToString();
+                    dh.ExecuteSql("delete from ProductSOPdetail where psd_psid='" + psid + "'", "delete");
+                    ps_prodcode.Text = dt.Rows[0]["ps_prodcode"].ToString();
+                }
+                if (VaildDate.Checked)
+                {
+                    dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "',ps_vailddate=to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') where ps_prodcode='" + ps_prodcode.Text + "'", "update");
+                }
+                else
+                {
+                    dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "' where ps_prodcode='" + ps_prodcode.Text + "'", "update");
                 }
+                Dictionary<string, object> dic = new Dictionary<string, object>();
+                dic.Add("em_name", "管理员");
+                dic.Add("em_code", "ADMIN");
+                dic.Add("caller", "ProductSOP");
+                OperatResult.AppendText("上传文件【" + ps_prodcode.Text + "" + "】\n");
+                string fp_id = UploadFilesToRemoteUrl("https://mes.lihantech.cn/mes/MEScommon/uploadFiles.action?_noc=1", FilePath.Text, dic);
+                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,'" + ps_prodcode.Text + ";" + fp_id + "' from ProductSOP where ps_prodcode='" + ps_prodcode.Text + "'", "insert");
             }
         }
 
@@ -216,6 +260,7 @@ namespace UAS_MES_NEW.Query
         {
             try
             {
+                ServicePointManager.SecurityProtocol =  SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
                 ServicePointManager.DefaultConnectionLimit = 50;
 
                 string boundary = DateTime.Now.Ticks.ToString("x");
@@ -303,7 +348,7 @@ namespace UAS_MES_NEW.Query
 
         private void ChooseFile_Click(object sender, EventArgs e)
         {
-            ChoosePath.Filter = "(*.xls)|*.xls|(*.xlsx)|*.xlsx";
+            ChoosePath.Filter = "(*.xlsx)|*.xlsx|(*.xls)|*.xls|(*.pdf)|*.pdf";
             DialogResult result = ChoosePath.ShowDialog();
             if (result == DialogResult.OK)
             {

+ 15 - 0
UAS_MES_ZKLH/FunctionCode/Query/Query_SOP.resx

@@ -135,4 +135,19 @@
   <metadata name="issend.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="CheckColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="fp_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="fp_path.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psd_iskey.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="issend.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 1 - 1
UAS_MES_ZKLH/UAS_MES_ZKLH.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>UAS_MES_NEW</RootNamespace>
     <AssemblyName>UAS_MES_NEW</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <IsWebBootstrapper>true</IsWebBootstrapper>
     <TargetFrameworkProfile />