diff --git a/DataBase/版本日志/HJGLDB_DS_2026-08-07_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-08-07_bwj.sql new file mode 100644 index 0000000..b4c6ac9 --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2026-08-07_bwj.sql @@ -0,0 +1,22 @@ + +alter table HJGL_PW_JointInfo add QRCodeAttachUrl nvarchar(200) +go + +CREATE view [dbo].[View_PrintJointInfo] +as +select joint.JOT_ID, +joint.ProjectId, +joint.ISO_ID, +unit.UnitName, +installation.InstallationName, +iso.ISO_IsoNo, +joint.JOT_JointNo, +joint.JOT_JointDesc, +Steel.STE_Code, +joint.QRCodeAttachUrl +from HJGL_PW_JointInfo as joint +left join HJGL_PW_IsoInfo as iso on iso.ISO_ID = joint.ISO_ID +left join Project_Installation as installation on installation.InstallationId = joint.InstallationId +left join Base_Unit as unit on unit.UnitId = iso.BSU_ID +LEFT JOIN HJGL_BS_Steel AS Steel ON Steel.STE_ID = joint.STE_ID +GO diff --git a/HJGL_DS/BLL/BLL.csproj b/HJGL_DS/BLL/BLL.csproj index 499139d..37b3876 100644 --- a/HJGL_DS/BLL/BLL.csproj +++ b/HJGL_DS/BLL/BLL.csproj @@ -112,6 +112,9 @@ + + ..\packages\ThoughtWorks.QRCode.1.1.0\lib\ThoughtWorks.QRCode.dll + @@ -135,6 +138,7 @@ + diff --git a/HJGL_DS/BLL/Common/CreateQRCodeService.cs b/HJGL_DS/BLL/Common/CreateQRCodeService.cs new file mode 100644 index 0000000..a8a3034 --- /dev/null +++ b/HJGL_DS/BLL/Common/CreateQRCodeService.cs @@ -0,0 +1,85 @@ +using System; +using System.IO; +using System.Text; +using ThoughtWorks.QRCode.Codec; +using System.Web.UI; + +namespace BLL +{ + /// + /// 上传附件相关 + /// + public class CreateQRCodeService + { + /// + /// 生成二维码方法一 + /// + public static string CreateCode_Simple(string nr) + { + string imageUrl = string.Empty; + if (!string.IsNullOrEmpty(nr)) + { + QRCodeEncoder qrCodeEncoder = new QRCodeEncoder + { + QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE, + QRCodeScale = nr.Length, + QRCodeVersion = 0, + QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M + }; + System.Drawing.Image image = qrCodeEncoder.Encode(nr, Encoding.UTF8); + string filepath = Funs.RootPath + UploadFileService.QRCodeImageFilePath; + //如果文件夹不存在,则创建 + if (!Directory.Exists(filepath)) + { + Directory.CreateDirectory(filepath); + } + string filename = DateTime.Now.ToString("yyyymmddhhmmssfff").ToString() + ".jpg"; + FileStream fs = new FileStream(filepath + filename, FileMode.OpenOrCreate, FileAccess.Write); + image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg); + fs.Close(); + image.Dispose(); + imageUrl= UploadFileService.QRCodeImageFilePath + filename; + } + return imageUrl; + } + + //public static string CreateCode_Simple2(string nr) + //{ + // string imageUrl = string.Empty; + // if (!string.IsNullOrEmpty(nr)) + // { + // QRCodeEncoder qrCodeEncoder = new QRCodeEncoder + // { + // QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE, + // QRCodeScale = nr.Length, + // QRCodeVersion = 0, + // QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M + // }; + // System.Drawing.Image image = qrCodeEncoder.Encode(nr, Encoding.UTF8); + // string filepath = Funs.RootPath + UploadFileService.WelderQRCodeImageFilePath; + // //如果文件夹不存在,则创建 + // if (!Directory.Exists(filepath)) + // { + // Directory.CreateDirectory(filepath); + // } + // string filename = DateTime.Now.ToString("yyyymmddhhmmssfff").ToString() + ".jpg"; + // FileStream fs = new FileStream(filepath + filename, FileMode.OpenOrCreate, FileAccess.Write); + // image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg); + // fs.Close(); + // image.Dispose(); + // imageUrl = UploadFileService.WelderQRCodeImageFilePath + filename; + // } + // return imageUrl; + //} + + /// + /// + /// + /// + public static bool isHaveImage(string url) + { + string filepath = Funs.RootPath + url; + return File.Exists(filepath); + } + } +} \ No newline at end of file diff --git a/HJGL_DS/BLL/packages.config b/HJGL_DS/BLL/packages.config index 3816bf3..f5895ec 100644 --- a/HJGL_DS/BLL/packages.config +++ b/HJGL_DS/BLL/packages.config @@ -5,4 +5,5 @@ + \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/焊口打印.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/焊口打印.frx new file mode 100644 index 0000000..741fb45 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/焊口打印.frx @@ -0,0 +1,156 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + /** + private void Table3_ManualBuild(object sender, EventArgs e) + { + // get the data source by its name + DataSourceBase rowData = Report.GetDataSource("Data"); + // init the data source + rowData.Init(); + + // print the first table row - it is a header + Tabel_Data.PrintRow(0); + // each PrintRow call must be followed by either PrintColumn or PrintColumns call + // to print cells on the row + Tabel_Data.PrintColumns(); + + // now enumerate the data source and print the table body + while (rowData.HasMoreRows) + { + // print the table body + Tabel_Data.PrintRow(0); + Tabel_Data.PrintColumns(); + + // go next data source row + rowData.Next(); + } + + + // print the last table row - it is a footer + //Tabel_Data.PrintRow(2); + //Table3.PrintColumns(); + } + + + + private void Table4_ManualBuild(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("Table1"); + // init the data source + rowData.Init(); + + // print the first table row - it is a header + Table4.PrintRow(0); + // each PrintRow call must be followed by either PrintColumn or PrintColumns call + // to print cells on the row + Table4.PrintColumns(); + + // now enumerate the data source and print the table body + + // print the table body + Table4.PrintRow(1); + Table4.PrintColumns(); + Table4.PrintRow(2); + Table4.PrintColumns(); + Table4.PrintRow(3); + Table4.PrintColumns(); + Table4.PrintRow(4); + Table4.PrintColumns(); + Table4.PrintRow(5); + Table4.PrintColumns(); + Table4.PrintRow(6); + Table4.PrintColumns(); + // go next data source row + rowData.Next(); + + } + + private void Table5_ManualBuild(object sender, EventArgs e) + { + Table5.PrintRow(0); + Table5.PrintColumns(); + Table5.PrintRow(1); + Table5.PrintColumns(); + } + **/ + + + + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165249887899.png b/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165249887899.png deleted file mode 100644 index 99bc941..0000000 Binary files a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165249887899.png and /dev/null differ diff --git a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250157901.gif b/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250157901.gif deleted file mode 100644 index 21f6832..0000000 Binary files a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250157901.gif and /dev/null differ diff --git a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250197900.gif b/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250197900.gif deleted file mode 100644 index 3da3cfe..0000000 Binary files a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250197900.gif and /dev/null differ diff --git a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250247900.gif b/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250247900.gif deleted file mode 100644 index 9e5d2d5..0000000 Binary files a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250247900.gif and /dev/null differ diff --git a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250297898.gif b/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250297898.gif deleted file mode 100644 index 52f1a29..0000000 Binary files a/HJGL_DS/FineUIPro.Web/FileUpload/HJGL/HotProessManage/638555165250297898.gif and /dev/null differ diff --git a/HJGL_DS/FineUIPro.Web/FileUpload/WeldMat/QualityCertificate/639008956132961833_焊口信息导入模板.xls b/HJGL_DS/FineUIPro.Web/FileUpload/WeldMat/QualityCertificate/639008956132961833_焊口信息导入模板.xls deleted file mode 100644 index 2bb2a2f..0000000 Binary files a/HJGL_DS/FineUIPro.Web/FileUpload/WeldMat/QualityCertificate/639008956132961833_焊口信息导入模板.xls and /dev/null differ diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx index 1c3ed49..2b82106 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx @@ -124,6 +124,12 @@ + + + + + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.cs index bee5856..65cb2a1 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.cs @@ -1538,5 +1538,108 @@ namespace FineUIPro.Web.HJGL.WeldingManage ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); } } + + /// + /// 批量生成二维码 + /// + /// + /// + protected void btnQR_Click(object sender, EventArgs e) + { + Model.SGGLDB db = Funs.DB; + var p = db.HJGL_PW_IsoInfo.Where(x => x.ISO_ID == this.tvControlItem.SelectedNodeID).FirstOrDefault(); + if (p != null) + { + var getJoints = from x in db.HJGL_PW_JointInfo + where x.ProjectId == this.ProjectId && x.ISO_ID == this.tvControlItem.SelectedNodeID + select x; + int num = 0; + if (getJoints.Any()) + { + foreach (var item in getJoints) + { + string url = CreateQRCodeService.CreateCode_Simple(item.JOT_ID); + if (!string.IsNullOrEmpty(url)) + { + item.QRCodeAttachUrl = url; + num++; + } + } + db.SubmitChanges(); + } + ShowNotify("操作完成,新生成二维码" + num.ToString() + "条", MessageBoxIcon.Success); + } + else + { + Alert.ShowInTop("请选择一条管线!", MessageBoxIcon.Warning); + return; + } + } + + #region 打印二维码 + protected void btnPrintJoint_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + Dictionary keyValuePairs = new Dictionary(); + //keyValuePairs.Add("ProjectName", projectName); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + string strSql = "select * from View_PrintJointInfo where ProjectId=@projectId and ISO_ID =@isoId"; + + List listStr = new List + { + new SqlParameter("@projectId", this.CurrUser.LoginProjectId), + new SqlParameter("@isoId", this.tvControlItem.SelectedNodeID), + }; + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Table1"; + dt.Columns.Add("UnitName"); + dt.Columns.Add("WorkAreaCode"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("JOT_JointNo"); + dt.Columns.Add("JOT_JointDesc"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("QRCodeAttachUrl"); + + DataView dv = tb.DefaultView;//获取表视图 + dv.Sort = "JOT_JointNo ASC";//按照ID排序 + tb = dv.ToTable();//转为表 + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRow["UnitName"] = row["UnitName"].ToString(); + newRow["WorkAreaCode"] = row["InstallationName"].ToString(); + newRow["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + newRow["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); + newRow["STE_Code"] = row["STE_Code"].ToString(); + newRow["QRCodeAttachUrl"] = Funs.RootPath + row["QRCodeAttachUrl"].ToString(); + dt.Rows.Add(newRow); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + initTemplatePath = "File\\Fastreport\\焊口打印.frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + } + } + else + { + Alert.ShowInTop("请选择要打印的管线!", MessageBoxIcon.Warning); + return; + } + } + #endregion } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.designer.cs index 9ab0cdc..37abab8 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.designer.cs @@ -365,6 +365,33 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected global::FineUIPro.RadioButtonList rbHotProessResult; + /// + /// ToolbarFill3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill3; + + /// + /// btnQR 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQR; + + /// + /// btnPrintJoint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrintJoint; + /// /// Toolbar5 控件。 /// diff --git a/HJGL_DS/Model/Model.cs b/HJGL_DS/Model/Model.cs index 614c7b9..31e79bb 100644 --- a/HJGL_DS/Model/Model.cs +++ b/HJGL_DS/Model/Model.cs @@ -48941,6 +48941,8 @@ namespace Model private string _Y2; + private string _QRCodeAttachUrl; + private EntityRef _HJGL_BO_BatchDetail; private EntitySet _HJGL_BO_PreWeldReportMain; @@ -49201,6 +49203,8 @@ namespace Model partial void OnX2Changed(); partial void OnY2Changing(string value); partial void OnY2Changed(); + partial void OnQRCodeAttachUrlChanging(string value); + partial void OnQRCodeAttachUrlChanged(); #endregion public HJGL_PW_JointInfo() @@ -51303,6 +51307,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_QRCodeAttachUrl", DbType="NVarChar(200)")] + public string QRCodeAttachUrl + { + get + { + return this._QRCodeAttachUrl; + } + set + { + if ((this._QRCodeAttachUrl != value)) + { + this.OnQRCodeAttachUrlChanging(value); + this.SendPropertyChanging(); + this._QRCodeAttachUrl = value; + this.SendPropertyChanged("QRCodeAttachUrl"); + this.OnQRCodeAttachUrlChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_BO_BatchDetail_HJGL_PW_JointInfo", Storage="_HJGL_BO_BatchDetail", ThisKey="JOT_ID", OtherKey="JOT_ID", IsUnique=true, IsForeignKey=false, DeleteRule="NO ACTION")] public HJGL_BO_BatchDetail HJGL_BO_BatchDetail {