diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo
index 8e04b264..31fa17ab 100644
Binary files a/.vs/SGGL_SeDin/v17/.wsuo and b/.vs/SGGL_SeDin/v17/.wsuo differ
diff --git a/DataBase/版本日志/SGGLDB_V2023-03-09.sql b/DataBase/版本日志/SGGLDB_V2023-03-09.sql
new file mode 100644
index 00000000..b9fea3e4
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2023-03-09.sql
@@ -0,0 +1,6 @@
+alter table [dbo].[HSSEData_HSSE] alter column [TotalEnergyConsumption] decimal(18,4) null
+alter table [dbo].[HSSEData_HSSE] alter column [IncomeComprehensiveEnergyConsumption] decimal(18,4) null
+alter table [dbo].[HSSEData_HSSE] alter column [NewWaterConsumption] decimal(18,4) null
+alter table [dbo].[Base_Factory] add MapCoordinates nvarchar(50) null
+GO
+
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 5b45a003..3a63a896 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -117,6 +117,7 @@
+
..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll
diff --git a/SGGL/BLL/BaseInfo/BaseFactoryService.cs b/SGGL/BLL/BaseInfo/BaseFactoryService.cs
index e490be6d..eaf7fe17 100644
--- a/SGGL/BLL/BaseInfo/BaseFactoryService.cs
+++ b/SGGL/BLL/BaseInfo/BaseFactoryService.cs
@@ -104,6 +104,7 @@ namespace BLL
FactoryCode = newtable.FactoryCode,
FactoryName = newtable.FactoryName,
Address = newtable.Address,
+ MapCoordinates= newtable.MapCoordinates,
};
db.Base_Factory.InsertOnSubmit(table);
db.SubmitChanges();
@@ -128,6 +129,7 @@ namespace BLL
table.FactoryCode = newtable.FactoryCode;
table.FactoryName = newtable.FactoryName;
table.Address = newtable.Address;
+ table.MapCoordinates = newtable.MapCoordinates;
db.SubmitChanges();
}
diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs
index 7178c5fd..59a84938 100644
--- a/SGGL/BLL/Common/Funs.cs
+++ b/SGGL/BLL/Common/Funs.cs
@@ -567,6 +567,55 @@ namespace BLL
return str;
}
+ public static bool DeleteDir(string file)
+ {
+
+ try
+ {
+ //ȥļкļֻ
+ //ȥļеֻ
+ System.IO.DirectoryInfo fileInfo = new DirectoryInfo(file);
+ fileInfo.Attributes = FileAttributes.Normal & FileAttributes.Directory;
+
+ //ȥļֻ
+ System.IO.File.SetAttributes(file, System.IO.FileAttributes.Normal);
+
+ //жļǷ
+ if (Directory.Exists(file))
+ {
+
+ foreach (string f in Directory.GetFileSystemEntries(file))
+ {
+
+ if (File.Exists(f))
+ {
+ //ļɾļ
+ File.Delete(f);
+ Console.WriteLine(f);
+ }
+ else
+ {
+ //ѭݹɾļ
+ DeleteDir(f);
+ }
+
+ }
+
+ //ɾļ
+
+ Directory.Delete(file);
+
+ }
+ return true;
+ }
+ catch (Exception ex) // 쳣
+ {
+ return false;
+ }
+
+ }
+
+
#region ʱת
///
/// ıתʱ
diff --git a/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs b/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs
index 0275bc1f..c457b709 100644
--- a/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs
+++ b/SGGL/BLL/PHTGL/ContractCompile/ContractReviewService.cs
@@ -1,5 +1,7 @@
using Aspose.Words;
using FineUIPro;
+using ICSharpCode.SharpZipLib.Zip;
+using Microsoft.SqlServer.Server;
using System;
using System.Collections.Generic;
using System.Data;
@@ -618,34 +620,116 @@ namespace BLL
}
- public static void PrintApprovalForm(string ContractReviewId)
+ public static void PrintFileByDocument(Document doc,string name)
+ {
+ string rootPath = Funs.RootPath;
+
+ string newUrl = string.Empty;
+ newUrl = rootPath + "File\\Word\\PHTGL\\合同评审.docx";
+ newUrl = newUrl.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx");
+ if (File.Exists(newUrl))
+ {
+ File.Delete(newUrl);
+ }
+ doc.Save(newUrl);
+ //生成PDF文件
+ string pdfUrl = newUrl.Replace(".docx", ".pdf");
+ Document doc1 = new Aspose.Words.Document(newUrl);
+ //验证参数
+ if (doc1 == null) { throw new Exception("Word文件无效"); }
+ doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式
+ string fileName = Path.GetFileName(pdfUrl).Replace("合同评审", name );
+ FileInfo info = new FileInfo(pdfUrl);
+ long fileSize = info.Length;
+ System.Web.HttpContext.Current.Response.Clear();
+ System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
+ System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
+ System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
+ System.Web.HttpContext.Current.Response.TransmitFile(pdfUrl, 0, fileSize);
+ System.Web.HttpContext.Current.Response.Flush();
+ System.Web.HttpContext.Current.Response.Close();
+ File.Delete(newUrl);
+ File.Delete(pdfUrl);
+
+ }
+ //删除文件夹
+
+ public static void PrintApprovalForm(string ContractReviewId)
{
var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
var getFireWork = BLL.ContractService.GetContractById(ReviewModel.ContractId);
+ string projectname=ProjectService.GetProjectNameByProjectId(getFireWork.ProjectId);
+ string rootPath = Funs.RootPath;
+
+ string startPath = rootPath + "File\\Word\\PHTGL\\"+ getFireWork.ContractNum + "-"+projectname + "-" + getFireWork.ContractName + "-合同管理资料";
+ if (!Directory.Exists(startPath))
+ {
+ Directory.CreateDirectory(startPath);
+ }
+ string zipPath = rootPath + "File\\Word\\PHTGL\\" + getFireWork.ContractNum + "-" + projectname + "-" + getFireWork.ContractName + "-合同管理资料.zip";
switch (getFireWork.ConfirmWay)
{
case "1":
+ PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
break;
case "2":
+ PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
break;
case "3":
+ PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
break;
case "4":
+ PrintApprovalFormType_Act(ContractReviewId, startPath + "\\");
+
break;
case "5":
+ PrintApprovalFormType_Act(ContractReviewId, startPath + "\\");
+
break;
+ default :
+ PrintApprovalFormType__Con(ContractReviewId, startPath + "\\");
+ break;
}
- }
+ System.IO.Compression.ZipFile.CreateFromDirectory(startPath, zipPath);
+ FileInfo info = new FileInfo(zipPath);
+ long fileSize = info.Length;
+ System.Web.HttpContext.Current.Response.Clear();
+ System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
+ System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(getFireWork.ContractNum + "-" + projectname + "-" + getFireWork.ContractName + "-合同管理资料.zip", System.Text.Encoding.UTF8));
+ System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
+ System.Web.HttpContext.Current.Response.TransmitFile(zipPath, 0, fileSize);
+ System.Web.HttpContext.Current.Response.Flush();
+ System.Web.HttpContext.Current.Response.Close();
+ Funs.DeleteDir(startPath);
+ File.Delete (zipPath);
+
+ }
///
/// ConfirmWay 4,5
///
- public static void PrintApprovalFormType_Act()
- {
+ public static void PrintApprovalFormType_Act(string ContractReviewId, string path)
+ {
+ Model.PHTGL_Contract Contract = new Model.PHTGL_Contract(); //合同信息
+ Model.PHTGL_ActionPlanFormation ActPlan = new Model.PHTGL_ActionPlanFormation(); //实施计划编制信息
+ Model.PHTGL_ActionPlanFormation ActPlanFormat = new Model.PHTGL_ActionPlanFormation(); //实施计划编制信息
+
+ var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
+ Contract = BLL.ContractService.GetContractById(ReviewModel.ContractId);
+ ActPlan = BLL.PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationByCode(Contract.ActionPlanCode);
+ ActPlanFormat = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(ActPlan.ActionPlanID);
+
+
+ var Doc_ActPlan = PHTGL_ActionPlanFormationService.Print(ActPlan.ActionPlanID);
+ var Doc_Contract = Print(ContractReviewId);
+
+ Doc_ActPlan.Save(path + ActPlanFormat.ActionPlanCode + "施工分包实施计划.pdf", SaveFormat.Pdf);
+ Doc_Contract.Save(path + Contract.ContractNum + "合同评审.pdf", SaveFormat.Pdf);
+
}
///
/// ConfirmWay 1,2,3
///
- public static void PrintApprovalFormType_SetSub(string ContractReviewId)
+ public static void PrintApprovalFormType_SetSub(string ContractReviewId,string path)
{
Model.PHTGL_Contract Contract =new Model.PHTGL_Contract(); //合同信息
@@ -653,13 +737,15 @@ namespace BLL
Model.PHTGL_BidApproveUserReview ApproveUser = new Model.PHTGL_BidApproveUserReview(); //评标小组名单信息
Model.PHTGL_BidDocumentsReview BidDoc = new Model.PHTGL_BidDocumentsReview();//招标文件信息
Model.PHTGL_ActionPlanReview ActPlan = new Model.PHTGL_ActionPlanReview();//实施计划信息
+ Model.PHTGL_ActionPlanFormation ActPlanFormat = new Model.PHTGL_ActionPlanFormation(); //实施计划编制信息
- var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
+ var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
Contract = BLL.ContractService.GetContractById(ReviewModel.ContractId);
SetSub = BLL.PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewBySetSubReviewCode(Contract.SetSubReviewCode);
ApproveUser = BLL.PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(SetSub.ApproveUserReviewID);
BidDoc = BLL.PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(ApproveUser.BidDocumentsReviewId);
ActPlan = BLL.PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewById(BidDoc.ActionPlanReviewId);
+ ActPlanFormat = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(ActPlan.ActionPlanID);
var Doc_ActPlan = PHTGL_ActionPlanFormationService.Print(ActPlan.ActionPlanID);
var Doc_BidDoc = PHTGL_BidDocumentsReviewService.Print(BidDoc.BidDocumentsReviewId);
@@ -667,14 +753,21 @@ namespace BLL
var Doc_SetSub = PHTGL_SetSubReviewService.Print(SetSub.SetSubReviewID);
var Doc_Contract = Print(ContractReviewId);
- Doc_ActPlan.AppendDocument(Doc_BidDoc, ImportFormatMode.UseDestinationStyles);
- Doc_ActPlan.AppendDocument(Doc_ApproveUser, ImportFormatMode.UseDestinationStyles);
- Doc_ActPlan.AppendDocument(Doc_SetSub, ImportFormatMode.UseDestinationStyles);
- Doc_ActPlan.AppendDocument(Doc_Contract, ImportFormatMode.UseDestinationStyles);
-
+ Doc_ActPlan.Save(path+ ActPlanFormat.ActionPlanCode+ "施工分包实施计划.pdf" , SaveFormat.Pdf);
+ Doc_BidDoc.Save(path + BidDoc.BidDocumentsCode + "招标文件审批表.pdf",SaveFormat.Pdf);
+ Doc_ApproveUser.Save(path+ "施工招标评标小组名单审批表.pdf", SaveFormat.Pdf);
+ Doc_SetSub.Save(path+ SetSub.SetSubReviewCode+ "确定分包商审批表.pdf", SaveFormat.Pdf);
+ Doc_Contract.Save(path+ Contract.ContractNum + "合同评审.pdf", SaveFormat.Pdf);
}
- public static void PrintApprovalFormType__Con()
+ public static void PrintApprovalFormType__Con(string ContractReviewId,string path)
{
+ Model.PHTGL_Contract Contract = new Model.PHTGL_Contract(); //合同信息
+ var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
+ Contract = BLL.ContractService.GetContractById(ReviewModel.ContractId);
+
+ var Doc_Contract = Print(ContractReviewId);
+ Doc_Contract.Save(path + Contract.ContractNum + "合同评审.pdf", SaveFormat.Pdf);
+
}
///
/// 分包合同协议书
diff --git a/SGGL/BLL/PHTGL/ContractCompile/PHTGL_ApproveService.cs b/SGGL/BLL/PHTGL/ContractCompile/PHTGL_ApproveService.cs
index cf4fb640..c2175632 100644
--- a/SGGL/BLL/PHTGL/ContractCompile/PHTGL_ApproveService.cs
+++ b/SGGL/BLL/PHTGL/ContractCompile/PHTGL_ApproveService.cs
@@ -21,7 +21,6 @@ namespace BLL
return Funs.DB.PHTGL_Approve.FirstOrDefault(e => e.ApproveId == ApproveId);
}
-
public static List GetPHTGL_ApproveByContractId(string contractId)
{
var q = (from x in Funs.DB.PHTGL_Approve where x.ContractId == contractId && x.State == 0 select x).ToList();
@@ -41,9 +40,10 @@ namespace BLL
return q;
}
public static Model.PHTGL_Approve GetPHTGL_ApproveByContractIdandUserId(string contractId, string UserID)
-
{
- return Funs.DB.PHTGL_Approve.FirstOrDefault(e => e.ContractId == contractId && e.ApproveMan == UserID);
+ var q=(from x in Funs.DB.PHTGL_Approve where x.ContractId==contractId && x.ApproveMan==UserID orderby x.ApproveDate descending select x ).FirstOrDefault();
+ //return Funs.DB.PHTGL_Approve.FirstOrDefault(e => e.ContractId == contractId && e.ApproveMan == UserID );
+ return q;
}
public static Model.PHTGL_Approve GetPHTGL_ApproveByContractIdAndType(string contractId, string approveType)
diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
index fd2eaa3c..04f3edc7 100644
--- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
+++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs
@@ -154,6 +154,7 @@ namespace BLL
Item.FactoryCode = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).FactoryCode;
Item.FactoryName = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).FactoryName;
Item.Address = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).Address;
+ Item.MapCoordinates= BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).MapCoordinates;
Item.SafetyMnaHours = data.SafetyMnaHours.HasValue ? data.SafetyMnaHours.Value : 0;
Item.GeneralRiskNum = data.GeneralRiskNum.HasValue ? data.GeneralRiskNum.Value : 0;
Item.LowRiskNum = data.LowRiskNum.HasValue ? data.LowRiskNum.Value : 0;
diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx
index 4e4b03e2..db5aff90 100644
--- a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx
+++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx
@@ -33,6 +33,14 @@
+
+
+
+
+ 拾取坐标
+
+
+
diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs
index e6bd10c3..d70decc7 100644
--- a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs
@@ -44,6 +44,7 @@ namespace FineUIPro.Web.BaseInfo
this.txtFactoryCode.Text = model.FactoryCode;
this.txtFactoryName.Text = model.FactoryName;
this.txtAddress.Text = model.Address;
+ this.txtMapCoordinates.Text = model.MapCoordinates;
}
}
@@ -67,6 +68,7 @@ namespace FineUIPro.Web.BaseInfo
table.FactoryCode = this.txtFactoryCode.Text;
table.FactoryName = this.txtFactoryName.Text;
table.Address = this.txtAddress.Text;
+ table.MapCoordinates=this.txtMapCoordinates.Text;
if (string.IsNullOrEmpty(this.FactoryId))
{
table.FactoryId = SQLHelper.GetNewID(typeof(Model.Base_Factory));
diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.designer.cs
index 8671a426..49a796c2 100644
--- a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.designer.cs
@@ -68,6 +68,24 @@ namespace FineUIPro.Web.BaseInfo
///
protected global::FineUIPro.TextBox txtAddress;
+ ///
+ /// txtMapCoordinates 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtMapCoordinates;
+
+ ///
+ /// bottomPanel 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ContentPanel bottomPanel;
+
///
/// Toolbar1 控件。
///
diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx b/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx
index e3d443f1..d4811688 100644
--- a/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx
+++ b/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx
@@ -23,14 +23,8 @@
-
-
-
-
-
-
-
-
+
+
diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.cs
index 4a5ff4d8..439cb7fb 100644
--- a/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.cs
+++ b/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.cs
@@ -20,6 +20,8 @@ namespace FineUIPro.Web.PHTGL.Filing
if (!IsPostBack)
{
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
+ BLL.DepartService.InitDepartDropDownList(this.drpDepartId, false);
+
BindGrid();
}
}
@@ -105,6 +107,12 @@ namespace FineUIPro.Web.PHTGL.Filing
strSql += " AND Con.ContractName LIKE @ContractName";
listStr.Add(new SqlParameter("@ContractName", "%" + this.txtContractName.Text.Trim() + "%"));
}
+ if (!string.IsNullOrEmpty(drpDepartId.SelectedValue))
+ {
+ strSql += " AND Con.DepartId = @DepartId";
+ listStr.Add(new SqlParameter("@DepartId", drpDepartId.SelectedValue));
+
+ }
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.designer.cs b/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.designer.cs
index 2a972cc1..a06b4836 100644
--- a/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/PHTGL/Filing/ContractFile.aspx.designer.cs
@@ -60,13 +60,13 @@ namespace FineUIPro.Web.PHTGL.Filing
protected global::FineUIPro.Toolbar Toolbar2;
///
- /// DropDownList1 控件。
+ /// drpDepartId 控件。
///
///
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
- protected global::FineUIPro.DropDownList DropDownList1;
+ protected global::FineUIPro.DropDownList drpDepartId;
///
/// txtContractName 控件。
diff --git a/SGGL/FineUIPro.Web/PHTGL/Filing/Files.aspx b/SGGL/FineUIPro.Web/PHTGL/Filing/Files.aspx
index 79563de6..ced6c6ab 100644
--- a/SGGL/FineUIPro.Web/PHTGL/Filing/Files.aspx
+++ b/SGGL/FineUIPro.Web/PHTGL/Filing/Files.aspx
@@ -13,9 +13,9 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+ <%--
+
+ --%>
-
+
@@ -81,10 +85,10 @@
Target="Parent" EnableResize="false" runat="server" IsModal="true"
Width="700px" Height="500px">
-
+
+
+