From 1bbab53e2f0c4a9c2b77545ead7952408f4bb9ef Mon Sep 17 00:00:00 2001
From: fly-l <1420031550@qq.com>
Date: Tue, 7 Mar 2023 11:24:59 +0800
Subject: [PATCH] =?UTF-8?q?20230307=20=E8=B4=A8=E9=87=8F=E5=9C=A8=E7=BA=BF?=
=?UTF-8?q?=E6=96=87=E6=A1=A3=E7=BC=96=E8=BE=91=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DataBase/版本日志/SGGLDB_V2023-03-07.sql | 2 +
SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs | 2 +
SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs | 2 +
SGGL/BLL/Common/Const.cs | 4 +
.../AttachFile/EditOffice.aspx.cs | 21 +++-
.../FineUIPro.Web/AttachFile/IndexOffice.aspx | 7 +-
SGGL/FineUIPro.Web/AttachFile/exeindex.html | 51 +++++++++
.../AttachFile/officecontrol/ntko.js | 8 +-
SGGL/FineUIPro.Web/AttachFile/save.aspx | 1 +
SGGL/FineUIPro.Web/AttachFile/save.aspx.cs | 82 +++++++++++++++
.../AttachFile/save.aspx.designer.cs | 17 +++
SGGL/FineUIPro.Web/CQMS/Plan/MainPlan.aspx.cs | 6 ++
.../FineUIPro.Web/CQMS/Plan/MainPlanEdit.aspx | 5 +-
.../CQMS/Plan/MainPlanEdit.aspx.cs | 76 +++++++++++++-
.../CQMS/Plan/MainPlanEdit.aspx.designer.cs | 85 ++++++++-------
SGGL/FineUIPro.Web/CQMS/Plan/SubPlan.aspx.cs | 6 ++
SGGL/FineUIPro.Web/CQMS/Plan/SubPlanEdit.aspx | 4 +-
.../CQMS/Plan/SubPlanEdit.aspx.cs | 84 ++++++++++++++-
.../CQMS/Plan/SubPlanEdit.aspx.designer.cs | 99 ++++++++++--------
.../CQMS/Solution/项目施工质量计划模板.doc | Bin 0 -> 843776 bytes
SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 ++
SGGL/Model/Model.cs | 66 ++++++++++--
22 files changed, 532 insertions(+), 104 deletions(-)
create mode 100644 DataBase/版本日志/SGGLDB_V2023-03-07.sql
create mode 100644 SGGL/FineUIPro.Web/AttachFile/exeindex.html
create mode 100644 SGGL/FineUIPro.Web/AttachFile/save.aspx
create mode 100644 SGGL/FineUIPro.Web/AttachFile/save.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/AttachFile/save.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/File/Word/CQMS/Solution/项目施工质量计划模板.doc
diff --git a/DataBase/版本日志/SGGLDB_V2023-03-07.sql b/DataBase/版本日志/SGGLDB_V2023-03-07.sql
new file mode 100644
index 00000000..03b1e667
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2023-03-07.sql
@@ -0,0 +1,2 @@
+alter table Plan_MainPlan add FilePath varchar(200)
+alter table Plan_SubPlan add FilePath varchar(200)
\ No newline at end of file
diff --git a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs
index 0788d9f2..e04725c7 100644
--- a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs
+++ b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs
@@ -30,6 +30,7 @@ namespace BLL
newMainPlan.State = MainPlan.State;
newMainPlan.CompileMan = MainPlan.CompileMan;
newMainPlan.CompileDate = MainPlan.CompileDate;
+ newMainPlan.FilePath = MainPlan.FilePath;
db.Plan_MainPlan.InsertOnSubmit(newMainPlan);
db.SubmitChanges();
}
@@ -47,6 +48,7 @@ namespace BLL
newMainPlan.PlanCode = MainPlan.PlanCode;
newMainPlan.FileName = MainPlan.FileName;
newMainPlan.State = MainPlan.State;
+ newMainPlan.FilePath = MainPlan.FilePath;
db.SubmitChanges();
}
}
diff --git a/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs b/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs
index bd14cf0e..18508b10 100644
--- a/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs
+++ b/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs
@@ -60,6 +60,7 @@ namespace BLL
newSubPlan.CompileDate = SubPlan.CompileDate;
newSubPlan.State = SubPlan.State;
newSubPlan.Edition = SubPlan.Edition;
+ newSubPlan.FilePath=SubPlan.FilePath;
db.Plan_SubPlan.InsertOnSubmit(newSubPlan);
db.SubmitChanges();
}
@@ -78,6 +79,7 @@ namespace BLL
newSubPlan.CNProfessionalCodes = SubPlan.CNProfessionalCodes;
newSubPlan.State = SubPlan.State;
newSubPlan.Edition = SubPlan.Edition;
+ newSubPlan.FilePath = SubPlan.FilePath;
db.SubmitChanges();
}
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 6c00c05f..a510325d 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -4093,6 +4093,10 @@
/// 质量共检通知单的虚拟路径
///
public const string SpotCheckTemplateUrl = "File\\Word\\CQMS\\Check\\质量共检通知单.doc";
+ ///
+ /// 项目施工质量计划模板
+ ///
+ public const string CQMSPlanTemplateUrl = "File\\Word\\CQMS\\Solution\\项目施工质量计划模板.doc";
#endregion
#endregion
diff --git a/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs
index 988be538..f1f2f823 100644
--- a/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs
+++ b/SGGL/FineUIPro.Web/AttachFile/EditOffice.aspx.cs
@@ -1,4 +1,5 @@
-using FineUIPro;
+using BLL;
+using FineUIPro;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -14,12 +15,26 @@ namespace WordEdit
public string url;
- protected void Page_Load(object sender, EventArgs e)
+ protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
+
+ string cmd= Request.QueryString["cmd"];
+ var a = cmd.Split('|');
+ if (a[1] == "CQMSMainPlan")
+ {
+ var model = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(a[0]);
+ string filepath = model.FilePath;
+ url = Funs.SGGLUrl + filepath;
+ }
+ else if (a[1]== "CQMSSubPlan")
+ {
+ var model = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanId(a[0]);
+ string filepath = model.FilePath;
+ url = Funs.SGGLUrl + filepath;
+ }
- url = "http://localhost:8899/File/Word/集团公司安全监督检查管理办法.doc";
}
diff --git a/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx b/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx
index b7971932..0e4c5a28 100644
--- a/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx
+++ b/SGGL/FineUIPro.Web/AttachFile/IndexOffice.aspx
@@ -20,6 +20,11 @@
return null;
}
+ function custom_close() {
+ window.opener = null;
+ window.open('', '_self');
+ window.close();(strHello);
+ }
function openhtml(cmd) {
//判断插件是否安装
datatochildcmd = cmd;
@@ -54,7 +59,7 @@
//在父页面定义的跨浏览器插件应用程序关闭事件响应方法,且方法名不能自定义,必须是ntkoCloseEvent
function ntkoCloseEvent() {
- if (CLOSEVENT) alert("跨浏览器插件应用程序窗口已关闭!");
+ if (CLOSEVENT) { custom_close(); }
}
//在父页面固定OnDataParentText方法名来获取子页面传过来的数据
diff --git a/SGGL/FineUIPro.Web/AttachFile/exeindex.html b/SGGL/FineUIPro.Web/AttachFile/exeindex.html
new file mode 100644
index 00000000..cefa77b4
--- /dev/null
+++ b/SGGL/FineUIPro.Web/AttachFile/exeindex.html
@@ -0,0 +1,51 @@
+
+
+
+
+ 跨浏览器插件检测
+
+
+
+
+
+ !
+
+
+ 本机尚未安装跨浏览器插件。
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntko.js b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntko.js
index dd98acd5..ebd2fc8c 100644
--- a/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntko.js
+++ b/SGGL/FineUIPro.Web/AttachFile/officecontrol/ntko.js
@@ -1,5 +1,6 @@
var ntko;//控件对象
var savecode = "save.aspx";//保存文档程序程序
+var fileName = "";
window.onbeforeunload=function(e){
ntkocloseparentpage();
}
@@ -16,8 +17,8 @@ function init(cmd) {
ntko.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.1.0","officecontrol/ntkooledocallx64.cab",51,true);
}
if (cmd != "") {
- alert(cmd);
ntko.OpenFromURL(cmd);
+ fileName = cmd;
}
/*if (cmd == 1)
{
@@ -164,7 +165,7 @@ function erropen(retHTML) {
}
//保存office文档
function saveFileToUrl() {
- var fileName ="ntkocreatnew.docx"
+
/*
if (fileName.length == 0) { alert("请输入文件标题!"); document.all("filetitle").focus(); return false; }//判断文件标题输入域
var result, filedot;
@@ -202,10 +203,11 @@ function saveFileToUrl() {
fileType = "unkownfiletype";
filedot = ".doc";
}*/
+
retHTML = ntko.saveToURL("save.aspx",//提交到的url地址
"EDITFILE",//文件域的id,类似
diff --git a/SGGL/FineUIPro.Web/AttachFile/save.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/save.aspx.cs
new file mode 100644
index 00000000..9be0f1bd
--- /dev/null
+++ b/SGGL/FineUIPro.Web/AttachFile/save.aspx.cs
@@ -0,0 +1,82 @@
+using BLL;
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace WordEdit
+{
+ public partial class save : System.Web.UI.Page
+ {
+
+ //参数savetype定义要另存的文档格式office,html,pdf
+ //参数filetype定义要保存的文档的文件内型
+ public string savetype, filetype, fid, title, fother, fname, fname1;
+
+ //定义文件上传路径目录
+ public string filepath, htmlpath, pdfpath, attachpath, delcount;
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ //Response.Write("ok");
+ //Response.End();
+ fid = Request.Form["fileid"];//获取文件ID
+ fname = Request.Form["filename"];//获取已有文件的名称
+ title = Request.Form["filetitle"];//获取文件的标题
+ savetype = Request.Form["savetype"];//获取文件另存为格式类型
+ filetype = Request.Form["filetype"];//获取当前文件的文件格式
+ fother = Request.Form["fileother"];
+ //filepath = db.getofficepath();
+ //htmlpath = db.gethtmlpath();
+ //pdfpath = db.getpdfpath();
+ //attachpath = db.getattachpath();
+ filepath = "D:\\我的代码\\在线文档编辑\\WordEdit\\WordEdit";
+ htmlpath = "";
+ pdfpath = "";
+ attachpath = "";
+ //根据保存类型调用相应处理方法
+ switch (savetype)
+ {
+ case "1":
+ saveoffice();
+ break;
+
+ default:
+ saveoffice();
+ break;
+ }
+ }
+
+ //保存文档为office
+ public void saveoffice()
+ {
+ string uploadoffiepath = Server.MapPath("~/");//上传文件的路径
+ // string uploadoffiepath = filepath;//上传文件的路径
+ string attpath = Server.MapPath(attachpath);//上传附件文件路径
+
+ System.Web.HttpFileCollection uploadFiles = Request.Files;
+ System.Web.HttpPostedFile theFile;
+ theFile = uploadFiles[0];
+ if (uploadFiles.GetKey(0).ToUpper() == "EDITFILE")//上传文档控件中的文档
+ {
+
+ /* string time = System.DateTime.Now.ToString();
+ if (fname == "" || fname == null)
+ {
+ fname = time + "." + theFile.FileName.Substring(theFile.FileName.LastIndexOf('\\') + 1);
+ }
+ fname = fname.Replace(":", ".");//上传文件到磁盘,文件名中不允许带:符号*/
+ // theFile.SaveAs(uploadoffiepath + @"\" + fname);
+ var path = theFile.FileName.Replace(Funs.SGGLUrl, "");
+ theFile.SaveAs(uploadoffiepath + path);
+
+ }
+
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/AttachFile/save.aspx.designer.cs b/SGGL/FineUIPro.Web/AttachFile/save.aspx.designer.cs
new file mode 100644
index 00000000..8031e1b7
--- /dev/null
+++ b/SGGL/FineUIPro.Web/AttachFile/save.aspx.designer.cs
@@ -0,0 +1,17 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace WordEdit
+{
+
+
+ public partial class save
+ {
+ }
+}
diff --git a/SGGL/FineUIPro.Web/CQMS/Plan/MainPlan.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Plan/MainPlan.aspx.cs
index f1f69c22..75497856 100644
--- a/SGGL/FineUIPro.Web/CQMS/Plan/MainPlan.aspx.cs
+++ b/SGGL/FineUIPro.Web/CQMS/Plan/MainPlan.aspx.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
+using System.IO;
using System.Linq;
using System.Threading.Tasks;
@@ -240,6 +241,11 @@ namespace FineUIPro.Web.CQMS.Plan
}
string id = Grid1.SelectedRowID;
var ins = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(id);
+ if (File.Exists(Funs.RootPath+ins.FilePath))
+ {
+ File.Delete(Funs.RootPath + ins.FilePath);
+
+ }
////删除附件表
BLL.CommonService.DeleteAttachFileById(id);
BLL.CQMS_MaterialTestService.DeleteMaterialTestById(id);
diff --git a/SGGL/FineUIPro.Web/CQMS/Plan/MainPlanEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Plan/MainPlanEdit.aspx
index 8acfe3be..e9804240 100644
--- a/SGGL/FineUIPro.Web/CQMS/Plan/MainPlanEdit.aspx
+++ b/SGGL/FineUIPro.Web/CQMS/Plan/MainPlanEdit.aspx
@@ -20,7 +20,7 @@